Bug

[В начало]

Ошибка # 133

Показать/спрятать трассу ошибок
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()
{
95 struct kernel_symbol { unsigned long value; const char *name; } ;
33 struct module ;
19 typedef signed char __s8;
20 typedef unsigned char __u8;
22 typedef short __s16;
23 typedef unsigned short __u16;
25 typedef int __s32;
26 typedef unsigned int __u32;
29 typedef long long __s64;
30 typedef unsigned long long __u64;
16 typedef unsigned char u8;
18 typedef short s16;
19 typedef unsigned short u16;
21 typedef int s32;
22 typedef unsigned int u32;
24 typedef long long s64;
25 typedef unsigned long long u64;
14 typedef long __kernel_long_t;
15 typedef unsigned long __kernel_ulong_t;
27 typedef int __kernel_pid_t;
40 typedef __kernel_long_t __kernel_suseconds_t;
48 typedef unsigned int __kernel_uid32_t;
49 typedef unsigned int __kernel_gid32_t;
71 typedef __kernel_ulong_t __kernel_size_t;
72 typedef __kernel_long_t __kernel_ssize_t;
87 typedef long long __kernel_loff_t;
88 typedef __kernel_long_t __kernel_time_t;
89 typedef __kernel_long_t __kernel_clock_t;
90 typedef int __kernel_timer_t;
91 typedef int __kernel_clockid_t;
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;
147 typedef u64 dma_addr_t;
158 typedef unsigned int gfp_t;
159 typedef unsigned int fmode_t;
160 typedef unsigned int oom_flags_t;
163 typedef u64 phys_addr_t;
168 typedef phys_addr_t resource_size_t;
178 struct __anonstruct_atomic_t_6 { int counter; } ;
178 typedef struct __anonstruct_atomic_t_6 atomic_t;
183 struct __anonstruct_atomic64_t_7 { long counter; } ;
183 typedef struct __anonstruct_atomic64_t_7 atomic64_t;
184 struct list_head { struct list_head *next; struct list_head *prev; } ;
189 struct hlist_node ;
189 struct hlist_head { struct hlist_node *first; } ;
193 struct hlist_node { struct hlist_node *next; struct hlist_node **pprev; } ;
204 struct callback_head { struct callback_head *next; void (*func)(struct callback_head *); } ;
65 struct pt_regs { unsigned long r15; unsigned long r14; unsigned long r13; unsigned long r12; unsigned long bp; unsigned long bx; unsigned long r11; unsigned long r10; unsigned long r9; unsigned long r8; unsigned long ax; unsigned long cx; unsigned long dx; unsigned long si; unsigned long di; unsigned long orig_ax; unsigned long ip; unsigned long cs; unsigned long flags; unsigned long sp; unsigned long ss; } ;
59 struct __anonstruct_ldv_1016_9 { unsigned int a; unsigned int b; } ;
59 struct __anonstruct_ldv_1031_10 { u16 limit0; u16 base0; unsigned char base1; unsigned char type; unsigned char s; unsigned char dpl; unsigned char p; unsigned char limit; unsigned char avl; unsigned char l; unsigned char d; unsigned char g; unsigned char base2; } ;
59 union __anonunion_ldv_1032_8 { struct __anonstruct_ldv_1016_9 ldv_1016; struct __anonstruct_ldv_1031_10 ldv_1031; } ;
59 struct desc_struct { union __anonunion_ldv_1032_8 ldv_1032; } ;
12 typedef unsigned long pteval_t;
15 typedef unsigned long pgdval_t;
16 typedef unsigned long pgprotval_t;
18 struct __anonstruct_pte_t_11 { pteval_t pte; } ;
18 typedef struct __anonstruct_pte_t_11 pte_t;
20 struct pgprot { pgprotval_t pgprot; } ;
242 typedef struct pgprot pgprot_t;
244 struct __anonstruct_pgd_t_12 { pgdval_t pgd; } ;
244 typedef struct __anonstruct_pgd_t_12 pgd_t;
332 struct page ;
332 typedef struct page *pgtable_t;
340 struct file ;
353 struct seq_file ;
390 struct thread_struct ;
392 struct mm_struct ;
393 struct task_struct ;
394 struct cpumask ;
327 struct arch_spinlock ;
18 typedef u16 __ticket_t;
19 typedef u32 __ticketpair_t;
20 struct __raw_tickets { __ticket_t head; __ticket_t tail; } ;
32 union __anonunion_ldv_1452_15 { __ticketpair_t head_tail; struct __raw_tickets tickets; } ;
32 struct arch_spinlock { union __anonunion_ldv_1452_15 ldv_1452; } ;
33 typedef struct arch_spinlock arch_spinlock_t;
34 struct qrwlock { atomic_t cnts; arch_spinlock_t lock; } ;
14 typedef struct qrwlock arch_rwlock_t;
142 typedef void (*ctor_fn_t)();
48 struct device ;
403 struct file_operations ;
415 struct completion ;
416 struct pid ;
526 struct bug_entry { int bug_addr_disp; int file_disp; unsigned short line; unsigned short flags; } ;
102 struct timespec ;
127 struct kernel_vm86_regs { struct pt_regs pt; unsigned short es; unsigned short __esh; unsigned short ds; unsigned short __dsh; unsigned short fs; unsigned short __fsh; unsigned short gs; unsigned short __gsh; } ;
79 union __anonunion_ldv_3051_20 { struct pt_regs *regs; struct kernel_vm86_regs *vm86; } ;
79 struct math_emu_info { long ___orig_eip; union __anonunion_ldv_3051_20 ldv_3051; } ;
306 struct cpumask { unsigned long bits[128U]; } ;
14 typedef struct cpumask cpumask_t;
671 typedef struct cpumask *cpumask_var_t;
161 struct seq_operations ;
293 struct i387_fsave_struct { u32 cwd; u32 swd; u32 twd; u32 fip; u32 fcs; u32 foo; u32 fos; u32 st_space[20U]; u32 status; } ;
311 struct __anonstruct_ldv_5357_25 { u64 rip; u64 rdp; } ;
311 struct __anonstruct_ldv_5363_26 { u32 fip; u32 fcs; u32 foo; u32 fos; } ;
311 union __anonunion_ldv_5364_24 { struct __anonstruct_ldv_5357_25 ldv_5357; struct __anonstruct_ldv_5363_26 ldv_5363; } ;
311 union __anonunion_ldv_5373_27 { u32 padding1[12U]; u32 sw_reserved[12U]; } ;
311 struct i387_fxsave_struct { u16 cwd; u16 swd; u16 twd; u16 fop; union __anonunion_ldv_5364_24 ldv_5364; u32 mxcsr; u32 mxcsr_mask; u32 st_space[32U]; u32 xmm_space[64U]; u32 padding[12U]; union __anonunion_ldv_5373_27 ldv_5373; } ;
345 struct i387_soft_struct { u32 cwd; u32 swd; u32 twd; u32 fip; u32 fcs; u32 foo; u32 fos; u32 st_space[20U]; u8 ftop; u8 changed; u8 lookahead; u8 no_update; u8 rm; u8 alimit; struct math_emu_info *info; u32 entry_eip; } ;
366 struct ymmh_struct { u32 ymmh_space[64U]; } ;
371 struct lwp_struct { u8 reserved[128U]; } ;
376 struct bndregs_struct { u64 bndregs[8U]; } ;
380 struct bndcsr_struct { u64 cfg_reg_u; u64 status_reg; } ;
385 struct xsave_hdr_struct { u64 xstate_bv; u64 xcomp_bv; u64 reserved[6U]; } ;
391 struct xsave_struct { struct i387_fxsave_struct i387; struct xsave_hdr_struct xsave_hdr; struct ymmh_struct ymmh; struct lwp_struct lwp; struct bndregs_struct bndregs; struct bndcsr_struct bndcsr; } ;
400 union thread_xstate { struct i387_fsave_struct fsave; struct i387_fxsave_struct fxsave; struct i387_soft_struct soft; struct xsave_struct xsave; } ;
408 struct fpu { unsigned int last_cpu; unsigned int has_fpu; union thread_xstate *state; } ;
464 struct kmem_cache ;
465 struct perf_event ;
466 struct thread_struct { struct desc_struct tls_array[3U]; unsigned long sp0; unsigned long sp; unsigned long usersp; unsigned short es; unsigned short ds; unsigned short fsindex; unsigned short gsindex; unsigned long fs; unsigned long gs; struct perf_event *ptrace_bps[4U]; unsigned long debugreg6; unsigned long ptrace_dr7; unsigned long cr2; unsigned long trap_nr; unsigned long error_code; struct fpu fpu; unsigned long *io_bitmap_ptr; unsigned long iopl; unsigned int io_bitmap_max; unsigned char fpu_counter; } ;
23 typedef atomic64_t atomic_long_t;
34 struct lockdep_map ;
55 struct stack_trace { unsigned int nr_entries; unsigned int max_entries; unsigned long *entries; int skip; } ;
26 struct lockdep_subclass_key { char __one_byte; } ;
53 struct lock_class_key { struct lockdep_subclass_key subkeys[8U]; } ;
59 struct lock_class { struct list_head hash_entry; struct list_head lock_entry; struct lockdep_subclass_key *key; unsigned int subclass; unsigned int dep_gen_id; unsigned long usage_mask; struct stack_trace usage_traces[13U]; struct list_head locks_after; struct list_head locks_before; unsigned int version; unsigned long ops; const char *name; int name_version; unsigned long contention_point[4U]; unsigned long contending_point[4U]; } ;
144 struct lockdep_map { struct lock_class_key *key; struct lock_class *class_cache[2U]; const char *name; int cpu; unsigned long ip; } ;
205 struct held_lock { u64 prev_chain_key; unsigned long acquire_ip; struct lockdep_map *instance; struct lockdep_map *nest_lock; u64 waittime_stamp; u64 holdtime_stamp; unsigned short class_idx; unsigned char irq_context; unsigned char trylock; unsigned char read; unsigned char check; unsigned char hardirqs_off; unsigned short references; } ;
530 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_ldv_6410_31 { u8 __padding[24U]; struct lockdep_map dep_map; } ;
33 union __anonunion_ldv_6411_30 { struct raw_spinlock rlock; struct __anonstruct_ldv_6410_31 ldv_6410; } ;
33 struct spinlock { union __anonunion_ldv_6411_30 ldv_6411; } ;
76 typedef struct spinlock spinlock_t;
23 struct __anonstruct_rwlock_t_32 { arch_rwlock_t raw_lock; unsigned int magic; unsigned int owner_cpu; void *owner; struct lockdep_map dep_map; } ;
23 typedef struct __anonstruct_rwlock_t_32 rwlock_t;
35 struct __wait_queue_head { spinlock_t lock; struct list_head task_list; } ;
40 typedef struct __wait_queue_head wait_queue_head_t;
1029 struct seqcount { unsigned int sequence; struct lockdep_map dep_map; } ;
51 typedef struct seqcount seqcount_t;
98 struct __anonstruct_nodemask_t_34 { unsigned long bits[16U]; } ;
98 typedef struct __anonstruct_nodemask_t_34 nodemask_t;
825 struct optimistic_spin_queue { atomic_t tail; } ;
26 struct mutex { atomic_t count; spinlock_t wait_lock; struct list_head wait_list; struct task_struct *owner; const char *name; void *magic; struct lockdep_map dep_map; } ;
68 struct mutex_waiter { struct list_head list; struct task_struct *task; void *magic; } ;
178 struct rw_semaphore ;
179 struct rw_semaphore { long count; struct list_head wait_list; raw_spinlock_t wait_lock; struct optimistic_spin_queue osq; struct task_struct *owner; struct lockdep_map dep_map; } ;
172 struct completion { unsigned int done; wait_queue_head_t wait; } ;
1112 struct timespec { __kernel_time_t tv_sec; long tv_nsec; } ;
13 struct timeval { __kernel_time_t tv_sec; __kernel_suseconds_t tv_usec; } ;
323 union ktime { s64 tv64; } ;
41 typedef union ktime ktime_t;
207 struct tvec_base ;
208 struct timer_list { struct list_head entry; unsigned long expires; struct tvec_base *base; void (*function)(unsigned long); unsigned long data; int slack; int start_pid; void *start_site; char start_comm[16U]; struct lockdep_map lockdep_map; } ;
254 struct hrtimer ;
255 enum hrtimer_restart ;
266 struct workqueue_struct ;
267 struct work_struct ;
53 struct work_struct { atomic_long_t data; struct list_head entry; void (*func)(struct work_struct *); struct lockdep_map lockdep_map; } ;
106 struct delayed_work { struct work_struct work; struct timer_list timer; struct workqueue_struct *wq; int cpu; } ;
72 struct resource { resource_size_t start; resource_size_t end; const char *name; unsigned long flags; struct resource *parent; struct resource *sibling; struct resource *child; } ;
172 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 ;
546 struct pm_subsys_data { spinlock_t lock; unsigned int refcount; struct list_head clock_list; } ;
553 struct dev_pm_qos ;
553 struct dev_pm_info { pm_message_t power_state; unsigned char can_wakeup; unsigned char async_suspend; bool is_prepared; bool is_suspended; bool is_noirq_suspended; bool is_late_suspended; bool ignore_children; bool early_init; bool direct_complete; spinlock_t lock; struct list_head entry; struct completion completion; struct wakeup_source *wakeup; bool wakeup_path; bool syscore; struct timer_list suspend_timer; unsigned long timer_expires; struct work_struct work; wait_queue_head_t wait_queue; atomic_t usage_count; atomic_t child_count; unsigned char disable_depth; unsigned char idle_notification; unsigned char request_pending; unsigned char deferred_resume; unsigned char run_wake; unsigned char runtime_auto; unsigned char no_callbacks; unsigned char irq_safe; unsigned char use_autosuspend; unsigned char timer_autosuspends; unsigned char memalloc_noio; enum rpm_request request; enum rpm_status runtime_status; int runtime_error; int autosuspend_delay; unsigned long last_busy; unsigned long active_jiffies; unsigned long suspended_jiffies; unsigned long accounting_timestamp; struct pm_subsys_data *subsys_data; void (*set_latency_tolerance)(struct device *, s32 ); struct dev_pm_qos *qos; } ;
614 struct dev_pm_domain { struct dev_pm_ops ops; } ;
133 struct pci_bus ;
22 struct __anonstruct_mm_context_t_99 { void *ldt; int size; unsigned short ia32_compat; struct mutex lock; void *vdso; } ;
22 typedef struct __anonstruct_mm_context_t_99 mm_context_t;
18 struct rb_node { unsigned long __rb_parent_color; struct rb_node *rb_right; struct rb_node *rb_left; } ;
40 struct rb_root { struct rb_node *rb_node; } ;
87 struct vm_area_struct ;
169 struct device_node ;
1304 struct llist_node ;
64 struct llist_node { struct llist_node *next; } ;
57 struct mem_cgroup ;
338 union __anonunion_ldv_13031_126 { unsigned long bitmap[4U]; struct callback_head callback_head; } ;
338 struct idr_layer { int prefix; int layer; struct idr_layer *ary[256U]; int count; union __anonunion_ldv_13031_126 ldv_13031; } ;
41 struct idr { struct idr_layer *hint; struct idr_layer *top; int layers; int cur; spinlock_t lock; int id_free_cnt; struct idr_layer *id_free; } ;
124 struct ida_bitmap { long nr_busy; unsigned long bitmap[15U]; } ;
153 struct ida { struct idr idr; struct ida_bitmap *free_bitmap; } ;
185 struct dentry ;
186 struct iattr ;
187 struct super_block ;
188 struct file_system_type ;
189 struct kernfs_open_node ;
190 struct kernfs_iattrs ;
213 struct kernfs_root ;
213 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_ldv_13176_127 { 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_ldv_13176_127 ldv_13176; 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 *); } ;
155 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; } ;
171 struct vm_operations_struct ;
171 struct kernfs_open_file { struct kernfs_node *kn; struct file *file; void *priv; struct mutex mutex; int event; struct list_head list; size_t atomic_write_len; bool mmapped; const struct vm_operations_struct *vm_ops; } ;
187 struct kernfs_ops { int (*seq_show)(struct seq_file *, void *); void * (*seq_start)(struct seq_file *, loff_t *); void * (*seq_next)(struct seq_file *, void *, loff_t *); void (*seq_stop)(struct seq_file *, void *); ssize_t (*read)(struct kernfs_open_file *, char *, size_t , loff_t ); size_t atomic_write_len; 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; } ;
464 struct sock ;
465 struct kobject ;
466 enum kobj_ns_type { KOBJ_NS_TYPE_NONE = 0, KOBJ_NS_TYPE_NET = 1, KOBJ_NS_TYPES = 2 } ;
472 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 *); } ;
83 struct user_namespace ;
22 struct __anonstruct_kuid_t_128 { uid_t val; } ;
22 typedef struct __anonstruct_kuid_t_128 kuid_t;
27 struct __anonstruct_kgid_t_129 { gid_t val; } ;
27 typedef struct __anonstruct_kgid_t_129 kgid_t;
127 struct kstat { u64 ino; dev_t dev; umode_t mode; unsigned int nlink; kuid_t uid; kgid_t gid; dev_t rdev; loff_t size; struct timespec atime; struct timespec mtime; struct timespec ctime; unsigned long blksize; unsigned long long blocks; } ;
36 struct bin_attribute ;
37 struct attribute { const char *name; umode_t mode; bool ignore_lockdep; struct lock_class_key *key; struct lock_class_key skey; } ;
37 struct attribute_group { const char *name; umode_t (*is_visible)(struct kobject *, struct attribute *, int); struct attribute **attrs; struct bin_attribute **bin_attrs; } ;
67 struct bin_attribute { struct attribute attr; size_t size; void *private; ssize_t (*read)(struct file *, struct kobject *, struct bin_attribute *, char *, loff_t , size_t ); ssize_t (*write)(struct file *, struct kobject *, struct bin_attribute *, char *, loff_t , size_t ); int (*mmap)(struct file *, struct kobject *, struct bin_attribute *, struct vm_area_struct *); } ;
131 struct sysfs_ops { ssize_t (*show)(struct kobject *, struct attribute *, char *); ssize_t (*store)(struct kobject *, struct attribute *, const char *, size_t ); } ;
470 struct kref { atomic_t refcount; } ;
52 struct kset ;
52 struct kobj_type ;
52 struct kobject { const char *name; struct list_head entry; struct kobject *parent; struct kset *kset; struct kobj_type *ktype; struct kernfs_node *sd; struct kref kref; struct delayed_work release; unsigned char state_initialized; unsigned char state_in_sysfs; unsigned char state_add_uevent_sent; unsigned char state_remove_uevent_sent; unsigned char uevent_suppress; } ;
114 struct kobj_type { void (*release)(struct kobject *); const struct sysfs_ops *sysfs_ops; struct attribute **default_attrs; const struct kobj_ns_type_operations * (*child_ns_type)(struct kobject *); const void * (*namespace)(struct kobject *); } ;
122 struct kobj_uevent_env { char *argv[3U]; char *envp[32U]; int envp_idx; char buf[2048U]; int buflen; } ;
130 struct kset_uevent_ops { const int (*filter)(struct kset *, struct kobject *); const const char * (*name)(struct kset *, struct kobject *); const int (*uevent)(struct kset *, struct kobject *, struct kobj_uevent_env *); } ;
147 struct kset { struct list_head list; spinlock_t list_lock; struct kobject kobj; const struct kset_uevent_ops *uevent_ops; } ;
252 struct kmem_cache_cpu { void **freelist; unsigned long tid; struct page *page; struct page *partial; unsigned int stat[26U]; } ;
48 struct kmem_cache_order_objects { unsigned long x; } ;
58 struct memcg_cache_params ;
58 struct kmem_cache_node ;
58 struct kmem_cache { struct kmem_cache_cpu *cpu_slab; unsigned long flags; unsigned long min_partial; int size; int object_size; int offset; int cpu_partial; struct kmem_cache_order_objects oo; struct kmem_cache_order_objects max; struct kmem_cache_order_objects min; gfp_t allocflags; int refcount; void (*ctor)(void *); int inuse; int align; int reserved; const char *name; struct list_head list; struct kobject kobj; struct memcg_cache_params *memcg_params; int max_attr_size; struct kset *memcg_kset; int remote_node_defrag_ratio; struct kmem_cache_node *node[1024U]; } ;
505 struct __anonstruct_ldv_14081_131 { struct callback_head callback_head; struct kmem_cache *memcg_caches[0U]; } ;
505 struct __anonstruct_ldv_14087_132 { struct mem_cgroup *memcg; struct list_head list; struct kmem_cache *root_cache; atomic_t nr_pages; } ;
505 union __anonunion_ldv_14088_130 { struct __anonstruct_ldv_14081_131 ldv_14081; struct __anonstruct_ldv_14087_132 ldv_14087; } ;
505 struct memcg_cache_params { bool is_root_cache; union __anonunion_ldv_14088_130 ldv_14088; } ;
35 struct snd_tea575x ;
836 struct nsproxy ;
37 struct cred ;
24 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_ldv_15202_141 { struct arch_uprobe_task autask; unsigned long vaddr; } ;
73 struct __anonstruct_ldv_15206_142 { struct callback_head dup_xol_work; unsigned long dup_xol_addr; } ;
73 union __anonunion_ldv_15207_140 { struct __anonstruct_ldv_15202_141 ldv_15202; struct __anonstruct_ldv_15206_142 ldv_15206; } ;
73 struct uprobe ;
73 struct return_instance ;
73 struct uprobe_task { enum uprobe_task_state state; union __anonunion_ldv_15207_140 ldv_15207; struct uprobe *active_uprobe; unsigned long xol_vaddr; struct return_instance *return_instances; unsigned int depth; } ;
94 struct xol_area ;
95 struct uprobes_state { struct xol_area *xol_area; } ;
133 struct address_space ;
134 union __anonunion_ldv_15316_143 { struct address_space *mapping; void *s_mem; } ;
134 union __anonunion_ldv_15322_145 { unsigned long index; void *freelist; bool pfmemalloc; } ;
134 struct __anonstruct_ldv_15332_149 { unsigned short inuse; unsigned short objects; unsigned char frozen; } ;
134 union __anonunion_ldv_15334_148 { atomic_t _mapcount; struct __anonstruct_ldv_15332_149 ldv_15332; int units; } ;
134 struct __anonstruct_ldv_15336_147 { union __anonunion_ldv_15334_148 ldv_15334; atomic_t _count; } ;
134 union __anonunion_ldv_15338_146 { unsigned long counters; struct __anonstruct_ldv_15336_147 ldv_15336; unsigned int active; } ;
134 struct __anonstruct_ldv_15339_144 { union __anonunion_ldv_15322_145 ldv_15322; union __anonunion_ldv_15338_146 ldv_15338; } ;
134 struct __anonstruct_ldv_15346_151 { struct page *next; int pages; int pobjects; } ;
134 struct slab ;
134 union __anonunion_ldv_15351_150 { struct list_head lru; struct __anonstruct_ldv_15346_151 ldv_15346; struct slab *slab_page; struct callback_head callback_head; pgtable_t pmd_huge_pte; } ;
134 union __anonunion_ldv_15357_152 { unsigned long private; spinlock_t *ptl; struct kmem_cache *slab_cache; struct page *first_page; } ;
134 struct page { unsigned long flags; union __anonunion_ldv_15316_143 ldv_15316; struct __anonstruct_ldv_15339_144 ldv_15339; union __anonunion_ldv_15351_150 ldv_15351; union __anonunion_ldv_15357_152 ldv_15357; unsigned long debug_flags; } ;
187 struct page_frag { struct page *page; __u32 offset; __u32 size; } ;
239 struct __anonstruct_linear_154 { struct rb_node rb; unsigned long rb_subtree_last; } ;
239 union __anonunion_shared_153 { struct __anonstruct_linear_154 linear; struct list_head nonlinear; } ;
239 struct anon_vma ;
239 struct mempolicy ;
239 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; union __anonunion_shared_153 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; } ;
311 struct core_thread { struct task_struct *task; struct core_thread *next; } ;
317 struct core_state { atomic_t nr_threads; struct core_thread dumper; struct completion startup; } ;
330 struct task_rss_stat { int events; int count[3U]; } ;
338 struct mm_rss_stat { atomic_long_t count[3U]; } ;
343 struct kioctx_table ;
344 struct linux_binfmt ;
344 struct mmu_notifier_mm ;
344 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; int map_count; spinlock_t page_table_lock; struct rw_semaphore mmap_sem; struct list_head mmlist; unsigned long hiwater_rss; unsigned long hiwater_vm; unsigned long total_vm; unsigned long locked_vm; unsigned long pinned_vm; unsigned long shared_vm; unsigned long exec_vm; unsigned long stack_vm; unsigned long def_flags; unsigned long start_code; unsigned long end_code; unsigned long start_data; unsigned long end_data; unsigned long start_brk; unsigned long brk; unsigned long start_stack; unsigned long arg_start; unsigned long arg_end; unsigned long env_start; unsigned long env_end; unsigned long saved_auxv[46U]; struct mm_rss_stat rss_stat; struct linux_binfmt *binfmt; cpumask_var_t cpu_vm_mask_var; mm_context_t context; unsigned long flags; struct core_state *core_state; spinlock_t ioctx_lock; struct kioctx_table *ioctx_table; struct task_struct *owner; struct file *exe_file; struct mmu_notifier_mm *mmu_notifier_mm; struct cpumask cpumask_allocation; unsigned long numa_next_scan; unsigned long numa_scan_offset; int numa_scan_seq; bool tlb_flush_pending; struct uprobes_state uprobes_state; } ;
15 typedef __u64 Elf64_Addr;
16 typedef __u16 Elf64_Half;
20 typedef __u32 Elf64_Word;
21 typedef __u64 Elf64_Xword;
190 struct elf64_sym { Elf64_Word st_name; unsigned char st_info; unsigned char st_other; Elf64_Half st_shndx; Elf64_Addr st_value; Elf64_Xword st_size; } ;
198 typedef struct elf64_sym Elf64_Sym;
48 struct kernel_param ;
53 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 *); } ;
58 struct kparam_string ;
58 struct kparam_array ;
58 union __anonunion_ldv_15740_158 { void *arg; const struct kparam_string *str; const struct kparam_array *arr; } ;
58 struct kernel_param { const char *name; const struct kernel_param_ops *ops; u16 perm; s16 level; union __anonunion_ldv_15740_158 ldv_15740; } ;
70 struct kparam_string { unsigned int maxlen; char *string; } ;
76 struct kparam_array { unsigned int max; unsigned int elemsize; unsigned int *num; const struct kernel_param_ops *ops; void *elem; } ;
466 struct mod_arch_specific { } ;
36 struct module_param_attrs ;
36 struct module_kobject { struct kobject kobj; struct module *mod; struct kobject *drivers_dir; struct module_param_attrs *mp; struct completion *kobj_completion; } ;
46 struct module_attribute { struct attribute attr; ssize_t (*show)(struct module_attribute *, struct module_kobject *, char *); ssize_t (*store)(struct module_attribute *, struct module_kobject *, const char *, size_t ); void (*setup)(struct module *, const char *); int (*test)(struct module *); void (*free)(struct module *); } ;
72 struct exception_table_entry ;
205 enum module_state { MODULE_STATE_LIVE = 0, MODULE_STATE_COMING = 1, MODULE_STATE_GOING = 2, MODULE_STATE_UNFORMED = 3 } ;
212 struct module_ref { unsigned long incs; unsigned long decs; } ;
226 struct module_sect_attrs ;
226 struct module_notes_attrs ;
226 struct tracepoint ;
226 struct ftrace_event_call ;
226 struct module { enum module_state state; struct list_head list; char name[56U]; struct module_kobject mkobj; struct module_attribute *modinfo_attrs; const char *version; const char *srcversion; struct kobject *holders_dir; const struct kernel_symbol *syms; const unsigned long *crcs; unsigned int num_syms; struct kernel_param *kp; unsigned int num_kp; unsigned int num_gpl_syms; const struct kernel_symbol *gpl_syms; const unsigned long *gpl_crcs; const struct kernel_symbol *unused_syms; const unsigned long *unused_crcs; unsigned int num_unused_syms; unsigned int num_unused_gpl_syms; const struct kernel_symbol *unused_gpl_syms; const unsigned long *unused_gpl_crcs; bool sig_ok; const struct kernel_symbol *gpl_future_syms; const unsigned long *gpl_future_crcs; unsigned int num_gpl_future_syms; unsigned int num_exentries; struct exception_table_entry *extable; int (*init)(); void *module_init; void *module_core; unsigned int init_size; unsigned int core_size; unsigned int init_text_size; unsigned int core_text_size; unsigned int init_ro_size; unsigned int core_ro_size; struct mod_arch_specific arch; unsigned int taints; unsigned int num_bugs; struct list_head bug_list; struct bug_entry *bug_table; Elf64_Sym *symtab; Elf64_Sym *core_symtab; unsigned int num_symtab; unsigned int core_num_syms; char *strtab; char *core_strtab; struct module_sect_attrs *sect_attrs; struct module_notes_attrs *notes_attrs; char *args; void *percpu; unsigned int percpu_size; unsigned int num_tracepoints; const struct tracepoint **tracepoints_ptrs; unsigned int num_trace_bprintk_fmt; const char **trace_bprintk_fmt_start; struct ftrace_event_call **trace_events; unsigned int num_trace_events; struct list_head source_list; struct list_head target_list; void (*exit)(); struct module_ref *refptr; ctor_fn_t (**ctors)(); unsigned int num_ctors; } ;
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; } ;
219 struct of_device_id { char name[32U]; char type[32U]; char compatible[128U]; const void *data; } ;
628 struct klist_node ;
37 struct klist_node { void *n_klist; struct list_head n_node; struct kref n_ref; } ;
67 struct path ;
68 struct seq_file { char *buf; size_t size; size_t from; size_t count; size_t pad_until; loff_t index; loff_t read_pos; u64 version; struct mutex lock; const struct seq_operations *op; int poll_event; struct user_namespace *user_ns; void *private; } ;
35 struct seq_operations { void * (*start)(struct seq_file *, loff_t *); void (*stop)(struct seq_file *, void *); void * (*next)(struct seq_file *, void *, loff_t *); int (*show)(struct seq_file *, void *); } ;
196 struct pinctrl ;
197 struct pinctrl_state ;
194 struct dev_pin_info { struct pinctrl *p; struct pinctrl_state *default_state; struct pinctrl_state *sleep_state; struct pinctrl_state *idle_state; } ;
42 struct dma_map_ops ;
42 struct dev_archdata { struct dma_map_ops *dma_ops; void *iommu; } ;
14 struct device_private ;
15 struct device_driver ;
16 struct driver_private ;
17 struct class ;
18 struct subsys_private ;
19 struct bus_type ;
20 struct iommu_ops ;
21 struct iommu_group ;
60 struct device_attribute ;
60 struct bus_type { const char *name; const char *dev_name; struct device *dev_root; struct device_attribute *dev_attrs; const struct attribute_group **bus_groups; const struct attribute_group **dev_groups; const struct attribute_group **drv_groups; int (*match)(struct device *, struct device_driver *); int (*uevent)(struct device *, struct kobj_uevent_env *); int (*probe)(struct device *); int (*remove)(struct device *); void (*shutdown)(struct device *); int (*online)(struct device *); int (*offline)(struct device *); int (*suspend)(struct device *, pm_message_t ); int (*resume)(struct device *); const struct dev_pm_ops *pm; const struct iommu_ops *iommu_ops; struct subsys_private *p; struct lock_class_key lock_key; } ;
138 struct device_type ;
195 struct device_driver { const char *name; struct bus_type *bus; struct module *owner; const char *mod_name; bool suppress_bind_attrs; const struct of_device_id *of_match_table; const struct acpi_device_id *acpi_match_table; int (*probe)(struct device *); int (*remove)(struct device *); void (*shutdown)(struct device *); int (*suspend)(struct device *, pm_message_t ); int (*resume)(struct device *); const struct attribute_group **groups; const struct dev_pm_ops *pm; struct driver_private *p; } ;
321 struct class_attribute ;
321 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; } ;
414 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 ); } ;
482 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; } ;
510 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 ); } ;
642 struct device_dma_parameters { unsigned int max_segment_size; unsigned long segment_boundary_mask; } ;
651 struct acpi_device ;
652 struct acpi_dev_node { struct acpi_device *companion; } ;
658 struct dma_coherent_mem ;
658 struct cma ;
658 struct device { struct device *parent; struct device_private *p; struct kobject kobj; const char *init_name; const struct device_type *type; struct mutex mutex; struct bus_type *bus; struct device_driver *driver; void *platform_data; void *driver_data; struct dev_pm_info power; struct dev_pm_domain *pm_domain; struct dev_pin_info *pins; int numa_node; u64 *dma_mask; u64 coherent_dma_mask; unsigned long dma_pfn_offset; struct device_dma_parameters *dma_parms; struct list_head dma_pools; struct dma_coherent_mem *dma_mem; struct cma *cma_area; struct dev_archdata archdata; struct device_node *of_node; struct acpi_dev_node acpi_node; dev_t devt; u32 id; spinlock_t devres_lock; struct list_head devres_head; struct klist_node knode_class; struct class *class; const struct attribute_group **groups; void (*release)(struct device *); struct iommu_group *iommu_group; bool offline_disabled; bool offline; } ;
805 struct wakeup_source { const char *name; struct list_head entry; spinlock_t lock; struct timer_list timer; unsigned long timer_expires; ktime_t total_time; ktime_t max_time; ktime_t last_time; ktime_t start_prevent_time; ktime_t prevent_sleep_time; unsigned long event_count; unsigned long active_count; unsigned long relax_count; unsigned long expire_count; unsigned long wakeup_count; bool active; bool autosleep_enabled; } ;
71 struct hotplug_slot ;
71 struct pci_slot { struct pci_bus *bus; struct list_head list; struct hotplug_slot *hotplug; unsigned char number; struct kobject kobj; } ;
109 typedef int pci_power_t;
136 typedef unsigned int pci_channel_state_t;
137 enum pci_channel_state { pci_channel_io_normal = 1, pci_channel_io_frozen = 2, pci_channel_io_perm_failure = 3 } ;
162 typedef unsigned short pci_dev_flags_t;
185 typedef unsigned short pci_bus_flags_t;
242 struct pcie_link_state ;
243 struct pci_vpd ;
244 struct pci_sriov ;
245 struct pci_ats ;
246 struct proc_dir_entry ;
246 struct pci_driver ;
246 union __anonunion_ldv_17793_162 { struct pci_sriov *sriov; struct pci_dev *physfn; } ;
246 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; u8 dma_alias_devfn; 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 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 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 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; 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]; struct list_head msi_list; const struct attribute_group **msi_irq_groups; struct pci_vpd *vpd; union __anonunion_ldv_17793_162 ldv_17793; struct pci_ats *ats; phys_addr_t rom; size_t romlen; char *driver_override; } ;
436 struct pci_ops ;
436 struct msi_chip ;
436 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_chip *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; } ;
553 struct pci_ops { int (*read)(struct pci_bus *, unsigned int, int, int, u32 *); int (*write)(struct pci_bus *, unsigned int, int, int, u32 ); } ;
574 struct pci_dynids { spinlock_t lock; struct list_head list; } ;
588 typedef unsigned int pci_ers_result_t;
598 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 *); } ;
631 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; } ;
1155 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; } ;
93 struct shrink_control { gfp_t gfp_mask; unsigned long nr_to_scan; nodemask_t nodes_to_scan; int nid; } ;
26 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; } ;
71 struct file_ra_state ;
72 struct user_struct ;
73 struct writeback_control ;
188 struct vm_fault { unsigned int flags; unsigned long pgoff; void *virtual_address; struct page *page; unsigned long max_pgoff; pte_t *pte; } ;
221 struct vm_operations_struct { void (*open)(struct vm_area_struct *); void (*close)(struct vm_area_struct *); int (*fault)(struct vm_area_struct *, struct vm_fault *); void (*map_pages)(struct vm_area_struct *, struct vm_fault *); int (*page_mkwrite)(struct vm_area_struct *, struct vm_fault *); int (*access)(struct vm_area_struct *, unsigned long, void *, int, int); const char * (*name)(struct vm_area_struct *); int (*set_policy)(struct vm_area_struct *, struct mempolicy *); struct mempolicy * (*get_policy)(struct vm_area_struct *, unsigned long); int (*migrate)(struct vm_area_struct *, const nodemask_t *, const nodemask_t *, unsigned long); int (*remap_pages)(struct vm_area_struct *, unsigned long, unsigned long, unsigned long); } ;
34 struct dma_attrs { unsigned long flags[1U]; } ;
70 enum dma_data_direction { DMA_BIDIRECTIONAL = 0, DMA_TO_DEVICE = 1, DMA_FROM_DEVICE = 2, DMA_NONE = 3 } ;
77 struct sg_table { struct scatterlist *sgl; unsigned int nents; unsigned int orig_nents; } ;
351 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; } ;
1841 struct v4l2_edid { __u32 pad; __u32 start_block; __u32 blocks; __u32 reserved[5U]; __u8 *edid; } ;
569 enum v4l2_buf_type { V4L2_BUF_TYPE_VIDEO_CAPTURE = 1, V4L2_BUF_TYPE_VIDEO_OUTPUT = 2, V4L2_BUF_TYPE_VIDEO_OVERLAY = 3, V4L2_BUF_TYPE_VBI_CAPTURE = 4, V4L2_BUF_TYPE_VBI_OUTPUT = 5, V4L2_BUF_TYPE_SLICED_VBI_CAPTURE = 6, V4L2_BUF_TYPE_SLICED_VBI_OUTPUT = 7, V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY = 8, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE = 9, V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE = 10, V4L2_BUF_TYPE_SDR_CAPTURE = 11, V4L2_BUF_TYPE_PRIVATE = 128 } ;
610 enum v4l2_priority { V4L2_PRIORITY_UNSET = 0, V4L2_PRIORITY_BACKGROUND = 1, V4L2_PRIORITY_INTERACTIVE = 2, V4L2_PRIORITY_RECORD = 3, V4L2_PRIORITY_DEFAULT = 2 } ;
618 struct v4l2_rect { __s32 left; __s32 top; __u32 width; __u32 height; } ;
220 struct v4l2_fract { __u32 numerator; __u32 denominator; } ;
225 struct v4l2_capability { __u8 driver[16U]; __u8 card[32U]; __u8 bus_info[32U]; __u32 version; __u32 capabilities; __u32 device_caps; __u32 reserved[3U]; } ;
246 struct v4l2_pix_format { __u32 width; __u32 height; __u32 pixelformat; __u32 field; __u32 bytesperline; __u32 sizeimage; __u32 colorspace; __u32 priv; __u32 flags; } ;
297 struct v4l2_fmtdesc { __u32 index; __u32 type; __u32 flags; __u8 description[32U]; __u32 pixelformat; __u32 reserved[4U]; } ;
483 struct v4l2_frmsize_discrete { __u32 width; __u32 height; } ;
496 struct v4l2_frmsize_stepwise { __u32 min_width; __u32 max_width; __u32 step_width; __u32 min_height; __u32 max_height; __u32 step_height; } ;
505 union __anonunion_ldv_23377_163 { struct v4l2_frmsize_discrete discrete; struct v4l2_frmsize_stepwise stepwise; } ;
505 struct v4l2_frmsizeenum { __u32 index; __u32 pixel_format; __u32 type; union __anonunion_ldv_23377_163 ldv_23377; __u32 reserved[2U]; } ;
524 struct v4l2_frmival_stepwise { struct v4l2_fract min; struct v4l2_fract max; struct v4l2_fract step; } ;
533 union __anonunion_ldv_23396_164 { struct v4l2_fract discrete; struct v4l2_frmival_stepwise stepwise; } ;
533 struct v4l2_frmivalenum { __u32 index; __u32 pixel_format; __u32 width; __u32 height; __u32 type; union __anonunion_ldv_23396_164 ldv_23396; __u32 reserved[2U]; } ;
548 struct v4l2_timecode { __u32 type; __u32 flags; __u8 frames; __u8 seconds; __u8 minutes; __u8 hours; __u8 userbits[4U]; } ;
562 struct v4l2_jpegcompression { int quality; int APPn; int APP_len; char APP_data[60U]; int COM_len; char COM_data[60U]; __u32 jpeg_markers; } ;
591 struct v4l2_requestbuffers { __u32 count; __u32 type; __u32 memory; __u32 reserved[2U]; } ;
616 union __anonunion_m_165 { __u32 mem_offset; unsigned long userptr; __s32 fd; } ;
616 struct v4l2_plane { __u32 bytesused; __u32 length; union __anonunion_m_165 m; __u32 data_offset; __u32 reserved[11U]; } ;
648 union __anonunion_m_166 { __u32 offset; unsigned long userptr; struct v4l2_plane *planes; __s32 fd; } ;
648 struct v4l2_buffer { __u32 index; __u32 type; __u32 bytesused; __u32 flags; __u32 field; struct timeval timestamp; struct v4l2_timecode timecode; __u32 sequence; __u32 memory; union __anonunion_m_166 m; __u32 length; __u32 reserved2; __u32 reserved; } ;
701 struct v4l2_exportbuffer { __u32 type; __u32 index; __u32 plane; __u32 flags; __s32 fd; __u32 reserved[11U]; } ;
760 struct __anonstruct_fmt_167 { __u32 width; __u32 height; __u32 pixelformat; __u32 field; __u32 bytesperline; __u32 sizeimage; __u32 colorspace; __u32 priv; } ;
760 struct v4l2_framebuffer { __u32 capability; __u32 flags; void *base; struct __anonstruct_fmt_167 fmt; } ;
781 struct v4l2_clip { struct v4l2_rect c; struct v4l2_clip *next; } ;
803 struct v4l2_window { struct v4l2_rect w; __u32 field; __u32 chromakey; struct v4l2_clip *clips; __u32 clipcount; void *bitmap; __u8 global_alpha; } ;
813 struct v4l2_captureparm { __u32 capability; __u32 capturemode; struct v4l2_fract timeperframe; __u32 extendedmode; __u32 readbuffers; __u32 reserved[4U]; } ;
825 struct v4l2_outputparm { __u32 capability; __u32 outputmode; struct v4l2_fract timeperframe; __u32 extendedmode; __u32 writebuffers; __u32 reserved[4U]; } ;
838 struct v4l2_cropcap { __u32 type; struct v4l2_rect bounds; struct v4l2_rect defrect; struct v4l2_fract pixelaspect; } ;
848 struct v4l2_crop { __u32 type; struct v4l2_rect c; } ;
853 struct v4l2_selection { __u32 type; __u32 target; __u32 flags; struct v4l2_rect r; __u32 reserved[9U]; } ;
880 typedef __u64 v4l2_std_id;
1016 struct v4l2_bt_timings { __u32 width; __u32 height; __u32 interlaced; __u32 polarities; __u64 pixelclock; __u32 hfrontporch; __u32 hsync; __u32 hbackporch; __u32 vfrontporch; __u32 vsync; __u32 vbackporch; __u32 il_vfrontporch; __u32 il_vsync; __u32 il_vbackporch; __u32 standards; __u32 flags; __u32 reserved[14U]; } ;
1072 union __anonunion_ldv_23539_168 { struct v4l2_bt_timings bt; __u32 reserved[32U]; } ;
1072 struct v4l2_dv_timings { __u32 type; union __anonunion_ldv_23539_168 ldv_23539; } ;
1134 struct v4l2_enum_dv_timings { __u32 index; __u32 pad; __u32 reserved[2U]; struct v4l2_dv_timings timings; } ;
1152 struct v4l2_bt_timings_cap { __u32 min_width; __u32 max_width; __u32 min_height; __u32 max_height; __u64 min_pixelclock; __u64 max_pixelclock; __u32 standards; __u32 capabilities; __u32 reserved[16U]; } ;
1175 union __anonunion_ldv_23562_169 { struct v4l2_bt_timings_cap bt; __u32 raw_data[32U]; } ;
1175 struct v4l2_dv_timings_cap { __u32 type; __u32 pad; __u32 reserved[2U]; union __anonunion_ldv_23562_169 ldv_23562; } ;
1200 struct v4l2_input { __u32 index; __u8 name[32U]; __u32 type; __u32 audioset; __u32 tuner; v4l2_std_id std; __u32 status; __u32 capabilities; __u32 reserved[3U]; } ;
1216 struct v4l2_output { __u32 index; __u8 name[32U]; __u32 type; __u32 audioset; __u32 modulator; v4l2_std_id std; __u32 capabilities; __u32 reserved[3U]; } ;
1263 struct v4l2_control { __u32 id; __s32 value; } ;
1280 union __anonunion_ldv_23597_170 { __s32 value; __s64 value64; char *string; __u8 *p_u8; __u16 *p_u16; __u32 *p_u32; void *ptr; } ;
1280 struct v4l2_ext_control { __u32 id; __u32 size; __u32 reserved2[1U]; union __anonunion_ldv_23597_170 ldv_23597; } ;
1295 struct v4l2_ext_controls { __u32 ctrl_class; __u32 count; __u32 error_idx; __u32 reserved[2U]; struct v4l2_ext_control *controls; } ;
1303 enum v4l2_ctrl_type { V4L2_CTRL_TYPE_INTEGER = 1, V4L2_CTRL_TYPE_BOOLEAN = 2, V4L2_CTRL_TYPE_MENU = 3, V4L2_CTRL_TYPE_BUTTON = 4, V4L2_CTRL_TYPE_INTEGER64 = 5, V4L2_CTRL_TYPE_CTRL_CLASS = 6, V4L2_CTRL_TYPE_STRING = 7, V4L2_CTRL_TYPE_BITMASK = 8, V4L2_CTRL_TYPE_INTEGER_MENU = 9, V4L2_CTRL_COMPOUND_TYPES = 256, V4L2_CTRL_TYPE_U8 = 256, V4L2_CTRL_TYPE_U16 = 257, V4L2_CTRL_TYPE_U32 = 258 } ;
1319 struct v4l2_queryctrl { __u32 id; __u32 type; __u8 name[32U]; __s32 minimum; __s32 maximum; __s32 step; __s32 default_value; __u32 flags; __u32 reserved[2U]; } ;
1339 struct v4l2_query_ext_ctrl { __u32 id; __u32 type; char name[32U]; __s64 minimum; __s64 maximum; __u64 step; __s64 default_value; __u32 flags; __u32 elem_size; __u32 elems; __u32 nr_of_dims; __u32 dims[4U]; __u32 reserved[32U]; } ;
1356 union __anonunion_ldv_23648_171 { __u8 name[32U]; __s64 value; } ;
1356 struct v4l2_querymenu { __u32 id; __u32 index; union __anonunion_ldv_23648_171 ldv_23648; __u32 reserved; } ;
1367 struct v4l2_tuner { __u32 index; __u8 name[32U]; __u32 type; __u32 capability; __u32 rangelow; __u32 rangehigh; __u32 rxsubchans; __u32 audmode; __s32 signal; __s32 afc; __u32 reserved[4U]; } ;
1405 struct v4l2_modulator { __u32 index; __u8 name[32U]; __u32 capability; __u32 rangelow; __u32 rangehigh; __u32 txsubchans; __u32 reserved[4U]; } ;
1415 struct v4l2_frequency { __u32 tuner; __u32 type; __u32 frequency; __u32 reserved[8U]; } ;
1454 struct v4l2_frequency_band { __u32 tuner; __u32 type; __u32 index; __u32 capability; __u32 rangelow; __u32 rangehigh; __u32 modulation; __u32 reserved[9U]; } ;
1469 struct v4l2_hw_freq_seek { __u32 tuner; __u32 type; __u32 seek_upward; __u32 wrap_around; __u32 spacing; __u32 rangelow; __u32 rangehigh; __u32 reserved[5U]; } ;
1490 struct v4l2_audio { __u32 index; __u8 name[32U]; __u32 capability; __u32 mode; __u32 reserved[2U]; } ;
1512 struct v4l2_audioout { __u32 index; __u8 name[32U]; __u32 capability; __u32 mode; __u32 reserved[2U]; } ;
1527 struct v4l2_enc_idx_entry { __u64 offset; __u64 pts; __u32 length; __u32 flags; __u32 reserved[2U]; } ;
1546 struct v4l2_enc_idx { __u32 entries; __u32 entries_cap; __u32 reserved[4U]; struct v4l2_enc_idx_entry entry[64U]; } ;
1554 struct __anonstruct_raw_173 { __u32 data[8U]; } ;
1554 union __anonunion_ldv_23727_172 { struct __anonstruct_raw_173 raw; } ;
1554 struct v4l2_encoder_cmd { __u32 cmd; __u32 flags; union __anonunion_ldv_23727_172 ldv_23727; } ;
1573 struct __anonstruct_stop_175 { __u64 pts; } ;
1573 struct __anonstruct_start_176 { __s32 speed; __u32 format; } ;
1573 struct __anonstruct_raw_177 { __u32 data[16U]; } ;
1573 union __anonunion_ldv_23742_174 { struct __anonstruct_stop_175 stop; struct __anonstruct_start_176 start; struct __anonstruct_raw_177 raw; } ;
1573 struct v4l2_decoder_cmd { __u32 cmd; __u32 flags; union __anonunion_ldv_23742_174 ldv_23742; } ;
1622 struct v4l2_vbi_format { __u32 sampling_rate; __u32 offset; __u32 samples_per_line; __u32 sample_format; __s32 start[2U]; __u32 count[2U]; __u32 flags; __u32 reserved[2U]; } ;
1642 struct v4l2_sliced_vbi_format { __u16 service_set; __u16 service_lines[2U][24U]; __u32 io_size; __u32 reserved[2U]; } ;
1670 struct v4l2_sliced_vbi_cap { __u16 service_set; __u16 service_lines[2U][24U]; __u32 type; __u32 reserved[3U]; } ;
1694 struct v4l2_sliced_vbi_data { __u32 id; __u32 field; __u32 line; __u32 reserved; __u8 data[48U]; } ;
1749 struct v4l2_plane_pix_format { __u32 sizeimage; __u16 bytesperline; __u16 reserved[7U]; } ;
1766 struct v4l2_pix_format_mplane { __u32 width; __u32 height; __u32 pixelformat; __u32 field; __u32 colorspace; struct v4l2_plane_pix_format plane_fmt[8U]; __u8 num_planes; __u8 flags; __u8 reserved[10U]; } ;
1790 struct v4l2_sdr_format { __u32 pixelformat; __u32 buffersize; __u8 reserved[24U]; } ;
1801 union __anonunion_fmt_179 { struct v4l2_pix_format pix; struct v4l2_pix_format_mplane pix_mp; struct v4l2_window win; struct v4l2_vbi_format vbi; struct v4l2_sliced_vbi_format sliced; struct v4l2_sdr_format sdr; __u8 raw_data[200U]; } ;
1801 struct v4l2_format { __u32 type; union __anonunion_fmt_179 fmt; } ;
1824 union __anonunion_parm_180 { struct v4l2_captureparm capture; struct v4l2_outputparm output; __u8 raw_data[200U]; } ;
1824 struct v4l2_streamparm { __u32 type; union __anonunion_parm_180 parm; } ;
1915 struct v4l2_event_subscription { __u32 type; __u32 id; __u32 flags; __u32 reserved[5U]; } ;
1925 union __anonunion_ldv_23865_183 { __u32 addr; char name[32U]; } ;
1925 struct v4l2_dbg_match { __u32 type; union __anonunion_ldv_23865_183 ldv_23865; } ;
1951 struct v4l2_dbg_register { struct v4l2_dbg_match match; __u32 size; __u64 reg; __u64 val; } ;
1958 struct v4l2_dbg_chip_info { struct v4l2_dbg_match match; char name[32U]; __u32 flags; __u32 reserved[32U]; } ;
1969 struct v4l2_create_buffers { __u32 index; __u32 count; __u32 memory; struct v4l2_format format; __u32 reserved[8U]; } ;
1986 struct v4l2_ctrl_handler ;
1987 struct v4l2_ctrl_helper ;
1988 struct v4l2_ctrl ;
1989 struct video_device ;
1990 struct v4l2_subdev ;
1992 struct v4l2_fh ;
1993 struct poll_table_struct ;
1994 union v4l2_ctrl_ptr { s32 *p_s32; s64 *p_s64; u8 *p_u8; u16 *p_u16; u32 *p_u32; char *p_char; void *p; } ;
57 struct v4l2_ctrl_ops { int (*g_volatile_ctrl)(struct v4l2_ctrl *); int (*try_ctrl)(struct v4l2_ctrl *); int (*s_ctrl)(struct v4l2_ctrl *); } ;
75 struct v4l2_ctrl_type_ops { bool (*equal)(const struct v4l2_ctrl *, u32 , union v4l2_ctrl_ptr , union v4l2_ctrl_ptr ); void (*init)(const struct v4l2_ctrl *, u32 , union v4l2_ctrl_ptr ); void (*log)(const struct v4l2_ctrl *); int (*validate)(const struct v4l2_ctrl *, u32 , union v4l2_ctrl_ptr ); } ;
94 union __anonunion_ldv_23956_184 { u64 step; u64 menu_skip_mask; } ;
94 union __anonunion_ldv_23960_185 { const const char **qmenu; const s64 *qmenu_int; } ;
94 struct __anonstruct_cur_186 { s32 val; } ;
94 struct v4l2_ctrl { struct list_head node; struct list_head ev_subs; struct v4l2_ctrl_handler *handler; struct v4l2_ctrl **cluster; unsigned int ncontrols; unsigned char done; unsigned char is_new; unsigned char has_changed; unsigned char is_private; unsigned char is_auto; unsigned char is_int; unsigned char is_string; unsigned char is_ptr; unsigned char is_array; unsigned char has_volatiles; unsigned char call_notify; unsigned char manual_mode_value; const struct v4l2_ctrl_ops *ops; const struct v4l2_ctrl_type_ops *type_ops; u32 id; const char *name; enum v4l2_ctrl_type type; s64 minimum; s64 maximum; s64 default_value; u32 elems; u32 elem_size; u32 dims[4U]; u32 nr_of_dims; union __anonunion_ldv_23956_184 ldv_23956; union __anonunion_ldv_23960_185 ldv_23960; unsigned long flags; void *priv; s32 val; struct __anonstruct_cur_186 cur; union v4l2_ctrl_ptr p_new; union v4l2_ctrl_ptr p_cur; } ;
212 struct v4l2_ctrl_ref { struct list_head node; struct v4l2_ctrl_ref *next; struct v4l2_ctrl *ctrl; struct v4l2_ctrl_helper *helper; } ;
229 struct v4l2_ctrl_handler { struct mutex _lock; struct mutex *lock; struct list_head ctrls; struct list_head ctrl_refs; struct v4l2_ctrl_ref *cached; struct v4l2_ctrl_ref **buckets; void (*notify)(struct v4l2_ctrl *, void *); void *notify_priv; u16 nr_of_buckets; int error; } ;
461 struct hlist_bl_node ;
461 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_ldv_24408_188 { spinlock_t lock; unsigned int count; } ;
114 union __anonunion_ldv_24409_187 { struct __anonstruct_ldv_24408_188 ldv_24408; } ;
114 struct lockref { union __anonunion_ldv_24409_187 ldv_24409; } ;
49 struct nameidata ;
50 struct vfsmount ;
51 struct __anonstruct_ldv_24432_190 { u32 hash; u32 len; } ;
51 union __anonunion_ldv_24434_189 { struct __anonstruct_ldv_24432_190 ldv_24432; u64 hash_len; } ;
51 struct qstr { union __anonunion_ldv_24434_189 ldv_24434; const unsigned char *name; } ;
90 struct dentry_operations ;
90 union __anonunion_d_u_191 { struct list_head d_child; struct callback_head d_rcu; } ;
90 struct dentry { unsigned int d_flags; seqcount_t d_seq; struct hlist_bl_node d_hash; struct dentry *d_parent; struct qstr d_name; struct inode *d_inode; unsigned char d_iname[32U]; struct lockref d_lockref; const struct dentry_operations *d_op; struct super_block *d_sb; unsigned long d_time; void *d_fsdata; struct list_head d_lru; union __anonunion_d_u_191 d_u; struct list_head d_subdirs; struct hlist_node d_alias; } ;
142 struct dentry_operations { int (*d_revalidate)(struct dentry *, unsigned int); int (*d_weak_revalidate)(struct dentry *, unsigned int); int (*d_hash)(const struct dentry *, struct qstr *); int (*d_compare)(const struct dentry *, const struct dentry *, unsigned int, const char *, const struct qstr *); int (*d_delete)(const struct dentry *); void (*d_release)(struct dentry *); void (*d_prune)(struct dentry *); void (*d_iput)(struct dentry *, struct inode *); char * (*d_dname)(struct dentry *, char *, int); struct vfsmount * (*d_automount)(struct path *); int (*d_manage)(struct dentry *, bool ); } ;
478 struct path { struct vfsmount *mnt; struct dentry *dentry; } ;
27 struct list_lru_node { spinlock_t lock; struct list_head list; long nr_items; } ;
30 struct list_lru { struct list_lru_node *node; nodemask_t active_nodes; } ;
58 struct __anonstruct_ldv_24797_193 { struct radix_tree_node *parent; void *private_data; } ;
58 union __anonunion_ldv_24799_192 { struct __anonstruct_ldv_24797_193 ldv_24797; struct callback_head callback_head; } ;
58 struct radix_tree_node { unsigned int path; unsigned int count; union __anonunion_ldv_24799_192 ldv_24799; struct list_head private_list; void *slots[64U]; unsigned long tags[3U][1U]; } ;
105 struct radix_tree_root { unsigned int height; gfp_t gfp_mask; struct radix_tree_node *rnode; } ;
428 enum pid_type { PIDTYPE_PID = 0, PIDTYPE_PGID = 1, PIDTYPE_SID = 2, PIDTYPE_MAX = 3 } ;
435 struct pid_namespace ;
435 struct upid { int nr; struct pid_namespace *ns; struct hlist_node pid_chain; } ;
56 struct pid { atomic_t count; unsigned int level; struct hlist_head tasks[3U]; struct callback_head rcu; struct upid numbers[1U]; } ;
68 struct pid_link { struct hlist_node node; struct pid *pid; } ;
22 struct kernel_cap_struct { __u32 cap[2U]; } ;
25 typedef struct kernel_cap_struct kernel_cap_t;
45 struct fiemap_extent { __u64 fe_logical; __u64 fe_physical; __u64 fe_length; __u64 fe_reserved64[2U]; __u32 fe_flags; __u32 fe_reserved[3U]; } ;
38 enum migrate_mode { MIGRATE_ASYNC = 0, MIGRATE_SYNC_LIGHT = 1, MIGRATE_SYNC = 2 } ;
30 struct block_device ;
31 struct io_context ;
59 struct export_operations ;
61 struct iovec ;
62 struct kiocb ;
63 struct pipe_inode_info ;
64 struct kstatfs ;
65 struct swap_info_struct ;
66 struct iov_iter ;
69 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; } ;
253 struct percpu_counter { raw_spinlock_t lock; s64 count; struct list_head list; s32 *counters; } ;
176 struct fs_disk_quota { __s8 d_version; __s8 d_flags; __u16 d_fieldmask; __u32 d_id; __u64 d_blk_hardlimit; __u64 d_blk_softlimit; __u64 d_ino_hardlimit; __u64 d_ino_softlimit; __u64 d_bcount; __u64 d_icount; __s32 d_itimer; __s32 d_btimer; __u16 d_iwarns; __u16 d_bwarns; __s32 d_padding2; __u64 d_rtb_hardlimit; __u64 d_rtb_softlimit; __u64 d_rtbcount; __s32 d_rtbtimer; __u16 d_rtbwarns; __s16 d_padding3; char d_padding4[8U]; } ;
76 struct fs_qfilestat { __u64 qfs_ino; __u64 qfs_nblks; __u32 qfs_nextents; } ;
151 typedef struct fs_qfilestat fs_qfilestat_t;
152 struct fs_quota_stat { __s8 qs_version; __u16 qs_flags; __s8 qs_pad; fs_qfilestat_t qs_uquota; fs_qfilestat_t qs_gquota; __u32 qs_incoredqs; __s32 qs_btimelimit; __s32 qs_itimelimit; __s32 qs_rtbtimelimit; __u16 qs_bwarnlimit; __u16 qs_iwarnlimit; } ;
166 struct fs_qfilestatv { __u64 qfs_ino; __u64 qfs_nblks; __u32 qfs_nextents; __u32 qfs_pad; } ;
196 struct fs_quota_statv { __s8 qs_version; __u8 qs_pad1; __u16 qs_flags; __u32 qs_incoredqs; struct fs_qfilestatv qs_uquota; struct fs_qfilestatv qs_gquota; struct fs_qfilestatv qs_pquota; __s32 qs_btimelimit; __s32 qs_itimelimit; __s32 qs_rtbtimelimit; __u16 qs_bwarnlimit; __u16 qs_iwarnlimit; __u64 qs_pad2[8U]; } ;
212 struct dquot ;
19 typedef __kernel_uid32_t projid_t;
23 struct __anonstruct_kprojid_t_195 { projid_t val; } ;
23 typedef struct __anonstruct_kprojid_t_195 kprojid_t;
119 struct if_dqinfo { __u64 dqi_bgrace; __u64 dqi_igrace; __u32 dqi_flags; __u32 dqi_valid; } ;
152 enum quota_type { USRQUOTA = 0, GRPQUOTA = 1, PRJQUOTA = 2 } ;
60 typedef long long qsize_t;
61 union __anonunion_ldv_25597_196 { kuid_t uid; kgid_t gid; kprojid_t projid; } ;
61 struct kqid { union __anonunion_ldv_25597_196 ldv_25597; enum quota_type type; } ;
178 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; } ;
200 struct quota_format_type ;
201 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_maxblimit; qsize_t dqi_maxilimit; void *dqi_priv; } ;
264 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; } ;
291 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 *); } ;
302 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 *); } ;
316 struct quotactl_ops { int (*quota_on)(struct super_block *, int, int, struct path *); int (*quota_on_meta)(struct super_block *, int, int); int (*quota_off)(struct super_block *, int); int (*quota_sync)(struct super_block *, int); int (*get_info)(struct super_block *, int, struct if_dqinfo *); int (*set_info)(struct super_block *, int, struct if_dqinfo *); int (*get_dqblk)(struct super_block *, struct kqid , struct fs_disk_quota *); int (*set_dqblk)(struct super_block *, struct kqid , struct fs_disk_quota *); int (*get_xstate)(struct super_block *, struct fs_quota_stat *); int (*set_xstate)(struct super_block *, unsigned int, int); int (*get_xstatev)(struct super_block *, struct fs_quota_statv *); int (*rm_xquota)(struct super_block *, unsigned int); } ;
334 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; } ;
380 struct quota_info { unsigned int flags; struct mutex dqio_mutex; struct mutex dqonoff_mutex; struct inode *files[2U]; struct mem_dqinfo info[2U]; const struct quota_format_ops *ops[2U]; } ;
323 struct address_space_operations { int (*writepage)(struct page *, struct writeback_control *); int (*readpage)(struct file *, struct page *); int (*writepages)(struct address_space *, struct writeback_control *); int (*set_page_dirty)(struct page *); int (*readpages)(struct file *, struct address_space *, struct list_head *, unsigned int); int (*write_begin)(struct file *, struct address_space *, loff_t , unsigned int, unsigned int, struct page **, void **); int (*write_end)(struct file *, struct address_space *, loff_t , unsigned int, unsigned int, struct page *, void *); sector_t (*bmap)(struct address_space *, sector_t ); void (*invalidatepage)(struct page *, unsigned int, unsigned int); int (*releasepage)(struct page *, gfp_t ); void (*freepage)(struct page *); ssize_t (*direct_IO)(int, struct kiocb *, struct iov_iter *, loff_t ); int (*get_xip_mem)(struct address_space *, unsigned long, int, void **, unsigned long *); 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 *); } ;
382 struct backing_dev_info ;
383 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 list_head i_mmap_nonlinear; struct mutex i_mmap_mutex; unsigned long nrpages; unsigned long nrshadows; unsigned long writeback_index; const struct address_space_operations *a_ops; unsigned long flags; struct backing_dev_info *backing_dev_info; spinlock_t private_lock; struct list_head private_list; void *private_data; } ;
405 struct request_queue ;
406 struct hd_struct ;
406 struct gendisk ;
406 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; } ;
503 struct posix_acl ;
504 struct inode_operations ;
504 union __anonunion_ldv_26023_199 { const unsigned int i_nlink; unsigned int __i_nlink; } ;
504 union __anonunion_ldv_26043_200 { struct hlist_head i_dentry; struct callback_head i_rcu; } ;
504 struct file_lock ;
504 struct cdev ;
504 union __anonunion_ldv_26060_201 { struct pipe_inode_info *i_pipe; struct block_device *i_bdev; struct cdev *i_cdev; } ;
504 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_ldv_26023_199 ldv_26023; dev_t i_rdev; loff_t i_size; struct timespec i_atime; struct timespec i_mtime; struct timespec i_ctime; spinlock_t i_lock; unsigned short i_bytes; unsigned int i_blkbits; blkcnt_t i_blocks; unsigned long i_state; struct mutex i_mutex; unsigned long dirtied_when; struct hlist_node i_hash; struct list_head i_wb_list; struct list_head i_lru; struct list_head i_sb_list; union __anonunion_ldv_26043_200 ldv_26043; 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 *i_flock; struct address_space i_data; struct dquot *i_dquot[2U]; struct list_head i_devices; union __anonunion_ldv_26060_201 ldv_26060; __u32 i_generation; __u32 i_fsnotify_mask; struct hlist_head i_fsnotify_marks; void *i_private; } ;
740 struct fown_struct { rwlock_t lock; struct pid *pid; enum pid_type pid_type; kuid_t uid; kuid_t euid; int signum; } ;
748 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; } ;
771 union __anonunion_f_u_202 { struct llist_node fu_llist; struct callback_head fu_rcuhead; } ;
771 struct file { union __anonunion_f_u_202 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; } ;
861 typedef void *fl_owner_t;
862 struct file_lock_operations { void (*fl_copy_lock)(struct file_lock *, struct file_lock *); void (*fl_release_private)(struct file_lock *); } ;
867 struct lock_manager_operations { int (*lm_compare_owner)(struct file_lock *, struct file_lock *); unsigned long int (*lm_owner_key)(struct file_lock *); void (*lm_notify)(struct file_lock *); int (*lm_grant)(struct file_lock *, struct file_lock *, int); void (*lm_break)(struct file_lock *); int (*lm_change)(struct file_lock **, int); } ;
885 struct nlm_lockowner ;
886 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_204 { struct list_head link; int state; } ;
19 union __anonunion_fl_u_203 { struct nfs_lock_info nfs_fl; struct nfs4_lock_info nfs4_fl; struct __anonstruct_afs_204 afs; } ;
19 struct file_lock { struct file_lock *fl_next; 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_203 fl_u; } ;
988 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; } ;
1182 struct sb_writers { struct percpu_counter counter[3U]; wait_queue_head_t wait; int frozen; wait_queue_head_t wait_unfrozen; struct lockdep_map lock_map[3U]; } ;
1198 struct super_operations ;
1198 struct xattr_handler ;
1198 struct mtd_info ;
1198 struct super_block { struct list_head s_list; dev_t s_dev; unsigned char s_blocksize_bits; unsigned long s_blocksize; loff_t s_maxbytes; struct file_system_type *s_type; const struct super_operations *s_op; const struct dquot_operations *dq_op; const struct quotactl_ops *s_qcop; const struct export_operations *s_export_op; unsigned long s_flags; unsigned long s_magic; struct dentry *s_root; struct rw_semaphore s_umount; int s_count; atomic_t s_active; void *s_security; const struct xattr_handler **s_xattr; struct list_head s_inodes; struct hlist_bl_head s_anon; struct list_head s_mounts; struct block_device *s_bdev; struct backing_dev_info *s_bdi; struct mtd_info *s_mtd; struct hlist_node s_instances; 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; } ;
1429 struct fiemap_extent_info { unsigned int fi_flags; unsigned int fi_extents_mapped; unsigned int fi_extents_max; struct fiemap_extent *fi_extents_start; } ;
1467 struct dir_context { int (*actor)(void *, const char *, int, loff_t , u64 , unsigned int); loff_t pos; } ;
1472 struct file_operations { struct module *owner; loff_t (*llseek)(struct file *, loff_t , int); ssize_t (*read)(struct file *, char *, size_t , loff_t *); ssize_t (*write)(struct file *, const char *, size_t , loff_t *); ssize_t (*aio_read)(struct kiocb *, const struct iovec *, unsigned long, loff_t ); ssize_t (*aio_write)(struct kiocb *, const struct iovec *, unsigned long, loff_t ); ssize_t (*read_iter)(struct kiocb *, struct iov_iter *); ssize_t (*write_iter)(struct kiocb *, struct iov_iter *); int (*iterate)(struct file *, struct dir_context *); unsigned int (*poll)(struct file *, struct poll_table_struct *); long int (*unlocked_ioctl)(struct file *, unsigned int, unsigned long); long int (*compat_ioctl)(struct file *, unsigned int, unsigned long); int (*mmap)(struct file *, struct vm_area_struct *); 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 **); long int (*fallocate)(struct file *, int, loff_t , loff_t ); int (*show_fdinfo)(struct seq_file *, struct file *); } ;
1514 struct inode_operations { struct dentry * (*lookup)(struct inode *, struct dentry *, unsigned int); void * (*follow_link)(struct dentry *, struct nameidata *); int (*permission)(struct inode *, int); struct posix_acl * (*get_acl)(struct inode *, int); int (*readlink)(struct dentry *, char *, int); void (*put_link)(struct dentry *, struct nameidata *, void *); int (*create)(struct inode *, struct dentry *, umode_t , bool ); int (*link)(struct dentry *, struct inode *, struct dentry *); int (*unlink)(struct inode *, struct dentry *); int (*symlink)(struct inode *, struct dentry *, const char *); int (*mkdir)(struct inode *, struct dentry *, umode_t ); int (*rmdir)(struct inode *, struct dentry *); int (*mknod)(struct inode *, struct dentry *, umode_t , dev_t ); int (*rename)(struct inode *, struct dentry *, struct inode *, struct dentry *); int (*rename2)(struct inode *, struct dentry *, struct inode *, struct dentry *, unsigned int); int (*setattr)(struct dentry *, struct iattr *); int (*getattr)(struct vfsmount *, struct dentry *, struct kstat *); int (*setxattr)(struct dentry *, const char *, const void *, size_t , int); ssize_t (*getxattr)(struct dentry *, const char *, void *, size_t ); ssize_t (*listxattr)(struct dentry *, char *, size_t ); int (*removexattr)(struct dentry *, const char *); int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 , u64 ); int (*update_time)(struct inode *, struct timespec *, int); int (*atomic_open)(struct inode *, struct dentry *, struct file *, unsigned int, umode_t , int *); int (*tmpfile)(struct inode *, struct dentry *, umode_t ); int (*set_acl)(struct inode *, struct posix_acl *, int); } ;
1561 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_fs)(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 ); int (*bdev_try_to_free_page)(struct super_block *, struct page *, gfp_t ); long int (*nr_cached_objects)(struct super_block *, int); long int (*free_cached_objects)(struct super_block *, long, int); } ;
1775 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; } ;
62 struct exception_table_entry { int insn; int fixup; } ;
32 struct poll_table_struct { void (*_qproc)(struct file *, wait_queue_head_t *, struct poll_table_struct *); unsigned long _key; } ;
163 struct cdev { struct kobject kobj; struct module *owner; const struct file_operations *ops; struct list_head list; dev_t dev; unsigned int count; } ;
129 struct media_pipeline { } ;
132 struct media_pad ;
132 struct media_link { struct media_pad *source; struct media_pad *sink; struct media_link *reverse; unsigned long flags; } ;
40 struct media_entity ;
40 struct media_pad { struct media_entity *entity; u16 index; unsigned long flags; } ;
46 struct media_entity_operations { int (*link_setup)(struct media_entity *, const struct media_pad *, const struct media_pad *, u32 ); int (*link_validate)(struct media_link *); } ;
53 struct media_device ;
53 struct __anonstruct_v4l_211 { u32 major; u32 minor; } ;
53 struct __anonstruct_fb_212 { u32 major; u32 minor; } ;
53 struct __anonstruct_alsa_213 { u32 card; u32 device; u32 subdevice; } ;
53 union __anonunion_info_210 { struct __anonstruct_v4l_211 v4l; struct __anonstruct_fb_212 fb; struct __anonstruct_alsa_213 alsa; int dvb; } ;
53 struct media_entity { struct list_head list; struct media_device *parent; u32 id; const char *name; u32 type; u32 revision; unsigned long flags; u32 group_id; u16 num_pads; u16 num_links; u16 num_backlinks; u16 max_links; struct media_pad *pads; struct media_link *links; const struct media_entity_operations *ops; int stream_count; int use_count; struct media_pipeline *pipe; union __anonunion_info_210 info; } ;
156 struct v4l2_device ;
157 struct v4l2_prio_state { atomic_t prios[4U]; } ;
61 struct v4l2_file_operations { struct module *owner; ssize_t (*read)(struct file *, char *, size_t , loff_t *); ssize_t (*write)(struct file *, const char *, size_t , loff_t *); unsigned int (*poll)(struct file *, struct poll_table_struct *); long int (*ioctl)(struct file *, unsigned int, unsigned long); long int (*unlocked_ioctl)(struct file *, unsigned int, unsigned long); long int (*compat_ioctl32)(struct file *, unsigned int, unsigned long); unsigned long int (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); int (*mmap)(struct file *, struct vm_area_struct *); int (*open)(struct file *); int (*release)(struct file *); } ;
79 struct vb2_queue ;
79 struct v4l2_ioctl_ops ;
79 struct video_device { struct media_entity entity; const struct v4l2_file_operations *fops; struct device dev; struct cdev *cdev; struct v4l2_device *v4l2_dev; struct device *dev_parent; struct v4l2_ctrl_handler *ctrl_handler; struct vb2_queue *queue; struct v4l2_prio_state *prio; char name[32U]; int vfl_type; int vfl_dir; int minor; u16 num; unsigned long flags; int index; spinlock_t fh_lock; struct list_head fh_list; int debug; v4l2_std_id tvnorms; void (*release)(struct video_device *); const struct v4l2_ioctl_ops *ioctl_ops; unsigned long valid_ioctls[3U]; unsigned long disable_locking[3U]; struct mutex *lock; } ;
235 struct media_file_operations { struct module *owner; ssize_t (*read)(struct file *, char *, size_t , loff_t *); ssize_t (*write)(struct file *, const char *, size_t , loff_t *); unsigned int (*poll)(struct file *, struct poll_table_struct *); long int (*ioctl)(struct file *, unsigned int, unsigned long); long int (*compat_ioctl)(struct file *, unsigned int, unsigned long); int (*open)(struct file *); int (*release)(struct file *); } ;
53 struct media_devnode { const struct media_file_operations *fops; struct device dev; struct cdev cdev; struct device *parent; int minor; unsigned long flags; void (*release)(struct media_devnode *); } ;
98 struct media_device { struct device *dev; struct media_devnode devnode; char model[32U]; char serial[40U]; char bus_info[32U]; u32 hw_revision; u32 driver_version; u32 entity_id; struct list_head entities; spinlock_t lock; struct mutex graph_mutex; int (*link_notify)(struct media_link *, u32 , unsigned int); } ;
98 enum v4l2_mbus_pixelcode { V4L2_MBUS_FMT_FIXED = 1, V4L2_MBUS_FMT_RGB444_2X8_PADHI_BE = 4097, V4L2_MBUS_FMT_RGB444_2X8_PADHI_LE = 4098, V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE = 4099, V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE = 4100, V4L2_MBUS_FMT_BGR565_2X8_BE = 4101, V4L2_MBUS_FMT_BGR565_2X8_LE = 4102, V4L2_MBUS_FMT_RGB565_2X8_BE = 4103, V4L2_MBUS_FMT_RGB565_2X8_LE = 4104, V4L2_MBUS_FMT_RGB666_1X18 = 4105, V4L2_MBUS_FMT_RGB888_1X24 = 4106, V4L2_MBUS_FMT_RGB888_2X12_BE = 4107, V4L2_MBUS_FMT_RGB888_2X12_LE = 4108, V4L2_MBUS_FMT_ARGB8888_1X32 = 4109, V4L2_MBUS_FMT_Y8_1X8 = 8193, V4L2_MBUS_FMT_UV8_1X8 = 8213, V4L2_MBUS_FMT_UYVY8_1_5X8 = 8194, V4L2_MBUS_FMT_VYUY8_1_5X8 = 8195, V4L2_MBUS_FMT_YUYV8_1_5X8 = 8196, V4L2_MBUS_FMT_YVYU8_1_5X8 = 8197, V4L2_MBUS_FMT_UYVY8_2X8 = 8198, V4L2_MBUS_FMT_VYUY8_2X8 = 8199, V4L2_MBUS_FMT_YUYV8_2X8 = 8200, V4L2_MBUS_FMT_YVYU8_2X8 = 8201, V4L2_MBUS_FMT_Y10_1X10 = 8202, V4L2_MBUS_FMT_UYVY10_2X10 = 8216, V4L2_MBUS_FMT_VYUY10_2X10 = 8217, V4L2_MBUS_FMT_YUYV10_2X10 = 8203, V4L2_MBUS_FMT_YVYU10_2X10 = 8204, V4L2_MBUS_FMT_Y12_1X12 = 8211, V4L2_MBUS_FMT_UYVY8_1X16 = 8207, V4L2_MBUS_FMT_VYUY8_1X16 = 8208, V4L2_MBUS_FMT_YUYV8_1X16 = 8209, V4L2_MBUS_FMT_YVYU8_1X16 = 8210, V4L2_MBUS_FMT_YDYUYDYV8_1X16 = 8212, V4L2_MBUS_FMT_UYVY10_1X20 = 8218, V4L2_MBUS_FMT_VYUY10_1X20 = 8219, V4L2_MBUS_FMT_YUYV10_1X20 = 8205, V4L2_MBUS_FMT_YVYU10_1X20 = 8206, V4L2_MBUS_FMT_YUV10_1X30 = 8214, V4L2_MBUS_FMT_AYUV8_1X32 = 8215, V4L2_MBUS_FMT_UYVY12_2X12 = 8220, V4L2_MBUS_FMT_VYUY12_2X12 = 8221, V4L2_MBUS_FMT_YUYV12_2X12 = 8222, V4L2_MBUS_FMT_YVYU12_2X12 = 8223, V4L2_MBUS_FMT_UYVY12_1X24 = 8224, V4L2_MBUS_FMT_VYUY12_1X24 = 8225, V4L2_MBUS_FMT_YUYV12_1X24 = 8226, V4L2_MBUS_FMT_YVYU12_1X24 = 8227, V4L2_MBUS_FMT_SBGGR8_1X8 = 12289, V4L2_MBUS_FMT_SGBRG8_1X8 = 12307, V4L2_MBUS_FMT_SGRBG8_1X8 = 12290, V4L2_MBUS_FMT_SRGGB8_1X8 = 12308, V4L2_MBUS_FMT_SBGGR10_ALAW8_1X8 = 12309, V4L2_MBUS_FMT_SGBRG10_ALAW8_1X8 = 12310, V4L2_MBUS_FMT_SGRBG10_ALAW8_1X8 = 12311, V4L2_MBUS_FMT_SRGGB10_ALAW8_1X8 = 12312, V4L2_MBUS_FMT_SBGGR10_DPCM8_1X8 = 12299, V4L2_MBUS_FMT_SGBRG10_DPCM8_1X8 = 12300, V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8 = 12297, V4L2_MBUS_FMT_SRGGB10_DPCM8_1X8 = 12301, V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_BE = 12291, V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_LE = 12292, V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_BE = 12293, V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_LE = 12294, V4L2_MBUS_FMT_SBGGR10_1X10 = 12295, V4L2_MBUS_FMT_SGBRG10_1X10 = 12302, V4L2_MBUS_FMT_SGRBG10_1X10 = 12298, V4L2_MBUS_FMT_SRGGB10_1X10 = 12303, V4L2_MBUS_FMT_SBGGR12_1X12 = 12296, V4L2_MBUS_FMT_SGBRG12_1X12 = 12304, V4L2_MBUS_FMT_SGRBG12_1X12 = 12305, V4L2_MBUS_FMT_SRGGB12_1X12 = 12306, V4L2_MBUS_FMT_JPEG_1X8 = 16385, V4L2_MBUS_FMT_S5C_UYVY_JPEG_1X8 = 20481, V4L2_MBUS_FMT_AHSV8888_1X32 = 24577 } ;
177 struct v4l2_mbus_framefmt { __u32 width; __u32 height; __u32 code; __u32 field; __u32 colorspace; __u32 reserved[7U]; } ;
151 struct v4l2_subdev_format { __u32 which; __u32 pad; struct v4l2_mbus_framefmt format; __u32 reserved[8U]; } ;
53 struct v4l2_subdev_crop { __u32 which; __u32 pad; struct v4l2_rect rect; __u32 reserved[8U]; } ;
66 struct v4l2_subdev_mbus_code_enum { __u32 pad; __u32 index; __u32 code; __u32 reserved[9U]; } ;
79 struct v4l2_subdev_frame_size_enum { __u32 index; __u32 pad; __u32 code; __u32 min_width; __u32 max_width; __u32 min_height; __u32 max_height; __u32 reserved[9U]; } ;
96 struct v4l2_subdev_frame_interval { __u32 pad; struct v4l2_fract interval; __u32 reserved[9U]; } ;
107 struct v4l2_subdev_frame_interval_enum { __u32 index; __u32 pad; __u32 code; __u32 width; __u32 height; struct v4l2_fract interval; __u32 reserved[9U]; } ;
126 struct v4l2_subdev_selection { __u32 which; __u32 pad; __u32 target; __u32 flags; struct v4l2_rect r; __u32 reserved[8U]; } ;
150 struct v4l2_async_notifier ;
151 enum v4l2_async_match_type { V4L2_ASYNC_MATCH_CUSTOM = 0, V4L2_ASYNC_MATCH_DEVNAME = 1, V4L2_ASYNC_MATCH_I2C = 2, V4L2_ASYNC_MATCH_OF = 3 } ;
158 struct __anonstruct_of_216 { const struct device_node *node; } ;
158 struct __anonstruct_device_name_217 { const char *name; } ;
158 struct __anonstruct_i2c_218 { int adapter_id; unsigned short address; } ;
158 struct __anonstruct_custom_219 { bool (*match)(struct device *, struct v4l2_async_subdev *); void *priv; } ;
158 union __anonunion_match_215 { struct __anonstruct_of_216 of; struct __anonstruct_device_name_217 device_name; struct __anonstruct_i2c_218 i2c; struct __anonstruct_custom_219 custom; } ;
158 struct v4l2_async_subdev { enum v4l2_async_match_type match_type; union __anonunion_match_215 match; struct list_head list; } ;
63 struct v4l2_async_notifier { unsigned int num_subdevs; struct v4l2_async_subdev **subdevs; struct v4l2_device *v4l2_dev; struct list_head waiting; struct list_head done; struct list_head list; int (*bound)(struct v4l2_async_notifier *, struct v4l2_subdev *, struct v4l2_async_subdev *); int (*complete)(struct v4l2_async_notifier *); void (*unbind)(struct v4l2_async_notifier *, struct v4l2_subdev *, struct v4l2_async_subdev *); } ;
104 struct v4l2_subdev_ops ;
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; } ;
26 struct sysv_shm { struct list_head shm_clist; } ;
24 struct __anonstruct_sigset_t_220 { unsigned long sig[1U]; } ;
24 typedef struct __anonstruct_sigset_t_220 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_222 { __kernel_pid_t _pid; __kernel_uid32_t _uid; } ;
11 struct __anonstruct__timer_223 { __kernel_timer_t _tid; int _overrun; char _pad[0U]; sigval_t _sigval; int _sys_private; } ;
11 struct __anonstruct__rt_224 { __kernel_pid_t _pid; __kernel_uid32_t _uid; sigval_t _sigval; } ;
11 struct __anonstruct__sigchld_225 { __kernel_pid_t _pid; __kernel_uid32_t _uid; int _status; __kernel_clock_t _utime; __kernel_clock_t _stime; } ;
11 struct __anonstruct__sigfault_226 { void *_addr; short _addr_lsb; } ;
11 struct __anonstruct__sigpoll_227 { long _band; int _fd; } ;
11 struct __anonstruct__sigsys_228 { void *_call_addr; int _syscall; unsigned int _arch; } ;
11 union __anonunion__sifields_221 { int _pad[28U]; struct __anonstruct__kill_222 _kill; struct __anonstruct__timer_223 _timer; struct __anonstruct__rt_224 _rt; struct __anonstruct__sigchld_225 _sigchld; struct __anonstruct__sigfault_226 _sigfault; struct __anonstruct__sigpoll_227 _sigpoll; struct __anonstruct__sigsys_228 _sigsys; } ;
11 struct siginfo { int si_signo; int si_errno; int si_code; union __anonunion__sifields_221 _sifields; } ;
109 typedef struct siginfo siginfo_t;
21 struct sigpending { struct list_head list; sigset_t signal; } ;
246 struct sigaction { __sighandler_t sa_handler; unsigned long sa_flags; __sigrestore_t sa_restorer; sigset_t sa_mask; } ;
260 struct k_sigaction { struct sigaction sa; } ;
53 struct seccomp_filter ;
54 struct seccomp { int mode; struct seccomp_filter *filter; } ;
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; unsigned long state; int start_pid; void *start_site; char start_comm[16U]; } ;
132 struct hrtimer_clock_base { struct hrtimer_cpu_base *cpu_base; int index; clockid_t clockid; struct timerqueue_head active; ktime_t resolution; ktime_t (*get_time)(); ktime_t softirq_time; ktime_t offset; } ;
163 struct hrtimer_cpu_base { raw_spinlock_t lock; unsigned int cpu; unsigned int active_bases; unsigned int clock_was_set; ktime_t expires_next; int hres_active; int hang_detected; unsigned long nr_events; unsigned long nr_retries; unsigned long nr_hangs; ktime_t max_hang_time; struct hrtimer_clock_base clock_base[4U]; } ;
451 struct task_io_accounting { u64 rchar; u64 wchar; u64 syscr; u64 syscw; u64 read_bytes; u64 write_bytes; u64 cancelled_write_bytes; } ;
45 struct latency_record { unsigned long backtrace[12U]; unsigned int count; unsigned long time; unsigned long max; } ;
39 struct assoc_array_ptr ;
39 struct assoc_array { struct assoc_array_ptr *root; unsigned long nr_leaves_on_tree; } ;
31 typedef int32_t key_serial_t;
34 typedef uint32_t key_perm_t;
35 struct key ;
36 struct signal_struct ;
37 struct key_type ;
41 struct keyring_index_key { struct key_type *type; const char *description; size_t desc_len; } ;
123 union __anonunion_ldv_30099_231 { struct list_head graveyard_link; struct rb_node serial_node; } ;
123 struct key_user ;
123 union __anonunion_ldv_30107_232 { time_t expiry; time_t revoked_at; } ;
123 struct __anonstruct_ldv_30120_234 { struct key_type *type; char *description; } ;
123 union __anonunion_ldv_30121_233 { struct keyring_index_key index_key; struct __anonstruct_ldv_30120_234 ldv_30120; } ;
123 union __anonunion_type_data_235 { struct list_head link; unsigned long x[2U]; void *p[2U]; int reject_error; } ;
123 union __anonunion_payload_237 { unsigned long value; void *rcudata; void *data; void *data2[2U]; } ;
123 union __anonunion_ldv_30136_236 { union __anonunion_payload_237 payload; struct assoc_array keys; } ;
123 struct key { atomic_t usage; key_serial_t serial; union __anonunion_ldv_30099_231 ldv_30099; struct rw_semaphore sem; struct key_user *user; void *security; union __anonunion_ldv_30107_232 ldv_30107; 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_ldv_30121_233 ldv_30121; union __anonunion_type_data_235 type_data; union __anonunion_ldv_30136_236 ldv_30136; } ;
358 struct audit_context ;
27 struct group_info { atomic_t usage; int ngroups; int nblocks; kgid_t small_block[32U]; kgid_t *blocks[0U]; } ;
78 struct cred { atomic_t usage; atomic_t subscribers; void *put_addr; unsigned int magic; kuid_t uid; kgid_t gid; kuid_t suid; kgid_t sgid; kuid_t euid; kgid_t egid; kuid_t fsuid; kgid_t fsgid; unsigned int securebits; kernel_cap_t cap_inheritable; kernel_cap_t cap_permitted; kernel_cap_t cap_effective; kernel_cap_t cap_bset; unsigned char jit_keyring; struct key *session_keyring; struct key *process_keyring; struct key *thread_keyring; struct key *request_key_auth; void *security; struct user_struct *user; struct user_namespace *user_ns; struct group_info *group_info; struct callback_head rcu; } ;
126 struct futex_pi_state ;
127 struct robust_list_head ;
128 struct bio_list ;
129 struct fs_struct ;
130 struct perf_event_context ;
131 struct blk_plug ;
180 struct cfs_rq ;
181 struct task_group ;
426 struct sighand_struct { atomic_t count; struct k_sigaction action[64U]; spinlock_t siglock; wait_queue_head_t signalfd_wqh; } ;
465 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; } ;
473 struct cpu_itimer { cputime_t expires; cputime_t incr; u32 error; u32 incr_error; } ;
480 struct cputime { cputime_t utime; cputime_t stime; } ;
492 struct task_cputime { cputime_t utime; cputime_t stime; unsigned long long sum_exec_runtime; } ;
512 struct thread_group_cputimer { struct task_cputime cputime; int running; raw_spinlock_t lock; } ;
554 struct autogroup ;
555 struct tty_struct ;
555 struct taskstats ;
555 struct tty_audit_buf ;
555 struct signal_struct { atomic_t sigcnt; atomic_t live; int nr_threads; struct list_head thread_head; wait_queue_head_t wait_chldexit; struct task_struct *curr_target; struct sigpending shared_pending; int group_exit_code; int notify_count; struct task_struct *group_exit_task; int group_stop_count; unsigned int flags; unsigned char is_child_subreaper; unsigned char has_child_subreaper; int posix_timer_id; struct list_head posix_timers; struct hrtimer real_timer; struct pid *leader_pid; ktime_t it_real_incr; struct cpu_itimer it[2U]; struct thread_group_cputimer cputimer; struct task_cputime cputime_expires; struct list_head cpu_timers[3U]; struct pid *tty_old_pgrp; int leader; struct tty_struct *tty; struct autogroup *autogroup; cputime_t utime; cputime_t stime; cputime_t cutime; cputime_t cstime; cputime_t gtime; cputime_t cgtime; struct cputime prev_cputime; unsigned long nvcsw; unsigned long nivcsw; unsigned long cnvcsw; unsigned long cnivcsw; unsigned long min_flt; unsigned long maj_flt; unsigned long cmin_flt; unsigned long cmaj_flt; unsigned long inblock; unsigned long oublock; unsigned long cinblock; unsigned long coublock; unsigned long maxrss; unsigned long cmaxrss; struct task_io_accounting ioac; unsigned long long sum_sched_runtime; struct rlimit rlim[16U]; struct pacct_struct pacct; struct taskstats *stats; unsigned int audit_tty; unsigned int audit_tty_log_passwd; struct tty_audit_buf *tty_audit_buf; struct rw_semaphore group_rwsem; oom_flags_t oom_flags; short oom_score_adj; short oom_score_adj_min; struct mutex cred_guard_mutex; } ;
735 struct user_struct { atomic_t __count; atomic_t processes; atomic_t sigpending; atomic_t inotify_watches; atomic_t inotify_devs; atomic_t fanotify_listeners; atomic_long_t epoll_watches; unsigned long mq_bytes; unsigned long locked_shm; struct key *uid_keyring; struct key *session_keyring; struct hlist_node uidhash_node; kuid_t uid; atomic_long_t locked_vm; } ;
778 struct reclaim_state ;
779 struct sched_info { unsigned long pcount; unsigned long long run_delay; unsigned long long last_arrival; unsigned long long last_queued; } ;
794 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; } ;
1061 struct load_weight { unsigned long weight; u32 inv_weight; } ;
1069 struct sched_avg { u32 runnable_avg_sum; u32 runnable_avg_period; u64 last_runnable_update; s64 decay_count; unsigned long load_avg_contrib; } ;
1081 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; } ;
1116 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; } ;
1148 struct rt_rq ;
1148 struct sched_rt_entity { struct list_head run_list; unsigned long timeout; unsigned long watchdog_stamp; unsigned int time_slice; struct sched_rt_entity *back; struct sched_rt_entity *parent; struct rt_rq *rt_rq; struct rt_rq *my_q; } ;
1164 struct sched_dl_entity { struct rb_node rb_node; u64 dl_runtime; u64 dl_deadline; u64 dl_period; u64 dl_bw; s64 runtime; u64 deadline; unsigned int flags; int dl_throttled; int dl_new; int dl_boosted; int dl_yielded; struct hrtimer dl_timer; } ;
1222 struct memcg_oom_info { struct mem_cgroup *memcg; gfp_t gfp_mask; int order; unsigned char may_oom; } ;
1639 struct sched_class ;
1639 struct files_struct ;
1639 struct css_set ;
1639 struct compat_robust_list_head ;
1639 struct numa_group ;
1639 struct task_struct { volatile long state; void *stack; atomic_t usage; unsigned int flags; unsigned int ptrace; struct llist_node wake_entry; int on_cpu; struct task_struct *last_wakee; unsigned long wakee_flips; unsigned long wakee_flip_decay_ts; int wake_cpu; int on_rq; int prio; int static_prio; int normal_prio; unsigned int rt_priority; const struct sched_class *sched_class; struct sched_entity se; struct sched_rt_entity rt; struct task_group *sched_task_group; struct sched_dl_entity dl; struct hlist_head preempt_notifiers; unsigned int policy; int nr_cpus_allowed; cpumask_t cpus_allowed; struct sched_info sched_info; struct list_head tasks; struct plist_node pushable_tasks; struct rb_node pushable_dl_tasks; struct mm_struct *mm; struct mm_struct *active_mm; unsigned char brk_randomized; u32 vmacache_seqnum; struct vm_area_struct *vmacache[4U]; struct task_rss_stat rss_stat; int exit_state; int exit_code; int exit_signal; int pdeath_signal; unsigned int jobctl; unsigned int personality; unsigned char in_execve; unsigned char in_iowait; unsigned char sched_reset_on_fork; unsigned char sched_contributes_to_load; unsigned long atomic_flags; pid_t pid; pid_t tgid; struct task_struct *real_parent; struct task_struct *parent; struct list_head children; struct list_head sibling; struct task_struct *group_leader; struct list_head ptraced; struct list_head ptrace_entry; struct pid_link pids[3U]; struct list_head thread_group; struct list_head thread_node; struct completion *vfork_done; int *set_child_tid; int *clear_child_tid; cputime_t utime; cputime_t stime; cputime_t utimescaled; cputime_t stimescaled; cputime_t gtime; struct cputime prev_cputime; unsigned long nvcsw; unsigned long nivcsw; u64 start_time; u64 real_start_time; unsigned long min_flt; unsigned long maj_flt; struct task_cputime cputime_expires; struct list_head cpu_timers[3U]; const struct cred *real_cred; const struct cred *cred; char comm[16U]; int link_count; int total_link_count; struct sysv_sem sysvsem; struct sysv_shm sysvshm; unsigned long last_switch_count; struct thread_struct thread; struct fs_struct *fs; struct files_struct *files; struct nsproxy *nsproxy; struct signal_struct *signal; struct sighand_struct *sighand; sigset_t blocked; sigset_t real_blocked; sigset_t saved_sigmask; struct sigpending pending; unsigned long sas_ss_sp; size_t sas_ss_size; int (*notifier)(void *); void *notifier_data; sigset_t *notifier_mask; struct callback_head *task_works; struct audit_context *audit_context; kuid_t loginuid; unsigned int sessionid; struct seccomp seccomp; u32 parent_exec_id; u32 self_exec_id; spinlock_t alloc_lock; raw_spinlock_t pi_lock; struct rb_root pi_waiters; struct rb_node *pi_waiters_leftmost; struct rt_mutex_waiter *pi_blocked_on; struct mutex_waiter *blocked_on; unsigned int irq_events; unsigned long hardirq_enable_ip; unsigned long hardirq_disable_ip; unsigned int hardirq_enable_event; unsigned int hardirq_disable_event; int hardirqs_enabled; int hardirq_context; unsigned long softirq_disable_ip; unsigned long softirq_enable_ip; unsigned int softirq_disable_event; unsigned int softirq_enable_event; int softirqs_enabled; int softirq_context; u64 curr_chain_key; int lockdep_depth; unsigned int lockdep_recursion; struct held_lock held_locks[48U]; gfp_t lockdep_reclaim_gfp; void *journal_info; struct bio_list *bio_list; struct blk_plug *plug; struct reclaim_state *reclaim_state; struct backing_dev_info *backing_dev_info; struct io_context *io_context; unsigned long ptrace_message; siginfo_t *last_siginfo; struct task_io_accounting ioac; u64 acct_rss_mem1; u64 acct_vm_mem1; cputime_t acct_timexpd; nodemask_t mems_allowed; seqcount_t mems_allowed_seq; int cpuset_mem_spread_rotor; int cpuset_slab_spread_rotor; struct css_set *cgroups; struct list_head cg_list; struct robust_list_head *robust_list; struct compat_robust_list_head *compat_robust_list; struct list_head pi_state_list; struct futex_pi_state *pi_state_cache; struct perf_event_context *perf_event_ctxp[2U]; struct mutex perf_event_mutex; struct list_head perf_event_list; struct mempolicy *mempolicy; short il_next; short pref_node_fork; int numa_scan_seq; unsigned int numa_scan_period; unsigned int numa_scan_period_max; int numa_preferred_nid; unsigned long numa_migrate_retry; u64 node_stamp; u64 last_task_numa_placement; u64 last_sum_exec_runtime; struct callback_head numa_work; struct list_head numa_entry; struct numa_group *numa_group; unsigned long *numa_faults_memory; unsigned long total_numa_faults; unsigned long *numa_faults_buffer_memory; unsigned long *numa_faults_cpu; unsigned long *numa_faults_buffer_cpu; unsigned long numa_faults_locality[2U]; unsigned long numa_pages_migrated; struct callback_head rcu; struct pipe_inode_info *splice_pipe; struct page_frag task_frag; struct task_delay_info *delays; int make_it_fail; int nr_dirtied; int nr_dirtied_pause; unsigned long dirty_paused_when; int latency_record_count; struct latency_record latency_record[32U]; unsigned long timer_slack_ns; unsigned long default_timer_slack_ns; unsigned long trace; unsigned long trace_recursion; unsigned int memcg_kmem_skip_account; struct memcg_oom_info memcg_oom; struct uprobe_task *utask; unsigned int sequential_io; unsigned int sequential_io_avg; } ;
162 struct v4l2_priv_tun_config { int tuner; void *priv; } ;
206 struct v4l2_m2m_ctx ;
206 struct v4l2_fh { struct list_head list; struct video_device *vdev; struct v4l2_ctrl_handler *ctrl_handler; enum v4l2_priority prio; wait_queue_head_t wait; struct list_head subscribed; struct list_head available; unsigned int navailable; u32 sequence; struct v4l2_m2m_ctx *m2m_ctx; } ;
106 enum v4l2_mbus_type { V4L2_MBUS_PARALLEL = 0, V4L2_MBUS_BT656 = 1, V4L2_MBUS_CSI2 = 2 } ;
112 struct v4l2_mbus_config { enum v4l2_mbus_type type; unsigned int flags; } ;
109 struct v4l2_subdev_fh ;
110 struct tuner_setup ;
111 struct v4l2_mbus_frame_desc ;
112 struct v4l2_decode_vbi_line { u32 is_second_field; u8 *p; u32 line; u32 type; } ;
61 struct v4l2_subdev_io_pin_config { u32 flags; u8 pin; u8 function; u8 value; u8 strength; } ;
117 struct v4l2_subdev_core_ops { int (*log_status)(struct v4l2_subdev *); int (*s_io_pin_config)(struct v4l2_subdev *, size_t , struct v4l2_subdev_io_pin_config *); int (*init)(struct v4l2_subdev *, u32 ); int (*load_fw)(struct v4l2_subdev *); int (*reset)(struct v4l2_subdev *, u32 ); int (*s_gpio)(struct v4l2_subdev *, u32 ); int (*queryctrl)(struct v4l2_subdev *, struct v4l2_queryctrl *); int (*g_ctrl)(struct v4l2_subdev *, struct v4l2_control *); int (*s_ctrl)(struct v4l2_subdev *, struct v4l2_control *); int (*g_ext_ctrls)(struct v4l2_subdev *, struct v4l2_ext_controls *); int (*s_ext_ctrls)(struct v4l2_subdev *, struct v4l2_ext_controls *); int (*try_ext_ctrls)(struct v4l2_subdev *, struct v4l2_ext_controls *); int (*querymenu)(struct v4l2_subdev *, struct v4l2_querymenu *); long int (*ioctl)(struct v4l2_subdev *, unsigned int, void *); long int (*compat_ioctl32)(struct v4l2_subdev *, unsigned int, unsigned long); int (*g_register)(struct v4l2_subdev *, struct v4l2_dbg_register *); int (*s_register)(struct v4l2_subdev *, const struct v4l2_dbg_register *); int (*s_power)(struct v4l2_subdev *, int); int (*interrupt_service_routine)(struct v4l2_subdev *, u32 , bool *); int (*subscribe_event)(struct v4l2_subdev *, struct v4l2_fh *, struct v4l2_event_subscription *); int (*unsubscribe_event)(struct v4l2_subdev *, struct v4l2_fh *, struct v4l2_event_subscription *); } ;
178 struct v4l2_subdev_tuner_ops { int (*s_radio)(struct v4l2_subdev *); int (*s_frequency)(struct v4l2_subdev *, const struct v4l2_frequency *); int (*g_frequency)(struct v4l2_subdev *, struct v4l2_frequency *); int (*enum_freq_bands)(struct v4l2_subdev *, struct v4l2_frequency_band *); int (*g_tuner)(struct v4l2_subdev *, struct v4l2_tuner *); int (*s_tuner)(struct v4l2_subdev *, const struct v4l2_tuner *); int (*g_modulator)(struct v4l2_subdev *, struct v4l2_modulator *); int (*s_modulator)(struct v4l2_subdev *, const struct v4l2_modulator *); int (*s_type_addr)(struct v4l2_subdev *, struct tuner_setup *); int (*s_config)(struct v4l2_subdev *, const struct v4l2_priv_tun_config *); } ;
205 struct v4l2_subdev_audio_ops { int (*s_clock_freq)(struct v4l2_subdev *, u32 ); int (*s_i2s_clock_freq)(struct v4l2_subdev *, u32 ); int (*s_routing)(struct v4l2_subdev *, u32 , u32 , u32 ); int (*s_stream)(struct v4l2_subdev *, int); } ;
232 struct v4l2_mbus_frame_desc_entry { u16 flags; u32 pixelcode; u32 length; } ;
253 struct v4l2_mbus_frame_desc { struct v4l2_mbus_frame_desc_entry entry[4U]; unsigned short num_entries; } ;
265 struct v4l2_subdev_video_ops { int (*s_routing)(struct v4l2_subdev *, u32 , u32 , u32 ); int (*s_crystal_freq)(struct v4l2_subdev *, u32 , u32 ); int (*g_std)(struct v4l2_subdev *, v4l2_std_id *); int (*s_std)(struct v4l2_subdev *, v4l2_std_id ); int (*s_std_output)(struct v4l2_subdev *, v4l2_std_id ); int (*g_std_output)(struct v4l2_subdev *, v4l2_std_id *); int (*querystd)(struct v4l2_subdev *, v4l2_std_id *); int (*g_tvnorms)(struct v4l2_subdev *, v4l2_std_id *); int (*g_tvnorms_output)(struct v4l2_subdev *, v4l2_std_id *); int (*g_input_status)(struct v4l2_subdev *, u32 *); int (*s_stream)(struct v4l2_subdev *, int); int (*cropcap)(struct v4l2_subdev *, struct v4l2_cropcap *); int (*g_crop)(struct v4l2_subdev *, struct v4l2_crop *); int (*s_crop)(struct v4l2_subdev *, const struct v4l2_crop *); int (*g_parm)(struct v4l2_subdev *, struct v4l2_streamparm *); int (*s_parm)(struct v4l2_subdev *, struct v4l2_streamparm *); int (*g_frame_interval)(struct v4l2_subdev *, struct v4l2_subdev_frame_interval *); int (*s_frame_interval)(struct v4l2_subdev *, struct v4l2_subdev_frame_interval *); int (*enum_framesizes)(struct v4l2_subdev *, struct v4l2_frmsizeenum *); int (*enum_frameintervals)(struct v4l2_subdev *, struct v4l2_frmivalenum *); int (*s_dv_timings)(struct v4l2_subdev *, struct v4l2_dv_timings *); int (*g_dv_timings)(struct v4l2_subdev *, struct v4l2_dv_timings *); int (*query_dv_timings)(struct v4l2_subdev *, struct v4l2_dv_timings *); int (*enum_mbus_fmt)(struct v4l2_subdev *, unsigned int, enum v4l2_mbus_pixelcode *); int (*enum_mbus_fsizes)(struct v4l2_subdev *, struct v4l2_frmsizeenum *); int (*g_mbus_fmt)(struct v4l2_subdev *, struct v4l2_mbus_framefmt *); int (*try_mbus_fmt)(struct v4l2_subdev *, struct v4l2_mbus_framefmt *); int (*s_mbus_fmt)(struct v4l2_subdev *, struct v4l2_mbus_framefmt *); int (*g_mbus_config)(struct v4l2_subdev *, struct v4l2_mbus_config *); int (*s_mbus_config)(struct v4l2_subdev *, const struct v4l2_mbus_config *); int (*s_rx_buffer)(struct v4l2_subdev *, void *, unsigned int *); } ;
359 struct v4l2_subdev_vbi_ops { int (*decode_vbi_line)(struct v4l2_subdev *, struct v4l2_decode_vbi_line *); int (*s_vbi_data)(struct v4l2_subdev *, const struct v4l2_sliced_vbi_data *); int (*g_vbi_data)(struct v4l2_subdev *, struct v4l2_sliced_vbi_data *); int (*g_sliced_vbi_cap)(struct v4l2_subdev *, struct v4l2_sliced_vbi_cap *); int (*s_raw_fmt)(struct v4l2_subdev *, struct v4l2_vbi_format *); int (*g_sliced_fmt)(struct v4l2_subdev *, struct v4l2_sliced_vbi_format *); int (*s_sliced_fmt)(struct v4l2_subdev *, struct v4l2_sliced_vbi_format *); } ;
399 struct v4l2_subdev_sensor_ops { int (*g_skip_top_lines)(struct v4l2_subdev *, u32 *); int (*g_skip_frames)(struct v4l2_subdev *, u32 *); } ;
414 enum v4l2_subdev_ir_mode { V4L2_SUBDEV_IR_MODE_PULSE_WIDTH = 0 } ;
418 struct v4l2_subdev_ir_parameters { unsigned int bytes_per_data_element; enum v4l2_subdev_ir_mode mode; bool enable; bool interrupt_enable; bool shutdown; bool modulation; u32 max_pulse_width; unsigned int carrier_freq; unsigned int duty_cycle; bool invert_level; bool invert_carrier_sense; u32 noise_filter_min_width; unsigned int carrier_range_lower; unsigned int carrier_range_upper; u32 resolution; } ;
466 struct v4l2_subdev_ir_ops { int (*rx_read)(struct v4l2_subdev *, u8 *, size_t , ssize_t *); int (*rx_g_parameters)(struct v4l2_subdev *, struct v4l2_subdev_ir_parameters *); int (*rx_s_parameters)(struct v4l2_subdev *, struct v4l2_subdev_ir_parameters *); int (*tx_write)(struct v4l2_subdev *, u8 *, size_t , ssize_t *); int (*tx_g_parameters)(struct v4l2_subdev *, struct v4l2_subdev_ir_parameters *); int (*tx_s_parameters)(struct v4l2_subdev *, struct v4l2_subdev_ir_parameters *); } ;
485 struct v4l2_subdev_pad_ops { int (*enum_mbus_code)(struct v4l2_subdev *, struct v4l2_subdev_fh *, struct v4l2_subdev_mbus_code_enum *); int (*enum_frame_size)(struct v4l2_subdev *, struct v4l2_subdev_fh *, struct v4l2_subdev_frame_size_enum *); int (*enum_frame_interval)(struct v4l2_subdev *, struct v4l2_subdev_fh *, struct v4l2_subdev_frame_interval_enum *); int (*get_fmt)(struct v4l2_subdev *, struct v4l2_subdev_fh *, struct v4l2_subdev_format *); int (*set_fmt)(struct v4l2_subdev *, struct v4l2_subdev_fh *, struct v4l2_subdev_format *); int (*set_crop)(struct v4l2_subdev *, struct v4l2_subdev_fh *, struct v4l2_subdev_crop *); int (*get_crop)(struct v4l2_subdev *, struct v4l2_subdev_fh *, struct v4l2_subdev_crop *); int (*get_selection)(struct v4l2_subdev *, struct v4l2_subdev_fh *, struct v4l2_subdev_selection *); int (*set_selection)(struct v4l2_subdev *, struct v4l2_subdev_fh *, struct v4l2_subdev_selection *); int (*get_edid)(struct v4l2_subdev *, struct v4l2_edid *); int (*set_edid)(struct v4l2_subdev *, struct v4l2_edid *); int (*dv_timings_cap)(struct v4l2_subdev *, struct v4l2_dv_timings_cap *); int (*enum_dv_timings)(struct v4l2_subdev *, struct v4l2_enum_dv_timings *); int (*link_validate)(struct v4l2_subdev *, struct media_link *, struct v4l2_subdev_format *, struct v4l2_subdev_format *); int (*get_frame_desc)(struct v4l2_subdev *, unsigned int, struct v4l2_mbus_frame_desc *); int (*set_frame_desc)(struct v4l2_subdev *, unsigned int, struct v4l2_mbus_frame_desc *); } ;
529 struct v4l2_subdev_ops { const struct v4l2_subdev_core_ops *core; const struct v4l2_subdev_tuner_ops *tuner; const struct v4l2_subdev_audio_ops *audio; const struct v4l2_subdev_video_ops *video; const struct v4l2_subdev_vbi_ops *vbi; const struct v4l2_subdev_ir_ops *ir; const struct v4l2_subdev_sensor_ops *sensor; const struct v4l2_subdev_pad_ops *pad; } ;
541 struct v4l2_subdev_internal_ops { int (*registered)(struct v4l2_subdev *); void (*unregistered)(struct v4l2_subdev *); int (*open)(struct v4l2_subdev *, struct v4l2_subdev_fh *); int (*close)(struct v4l2_subdev *, struct v4l2_subdev_fh *); } ;
562 struct regulator_bulk_data ;
563 struct v4l2_subdev_platform_data { struct regulator_bulk_data *regulators; int num_regulators; void *host_priv; } ;
584 struct v4l2_subdev { struct media_entity entity; struct list_head list; struct module *owner; bool owner_v4l2_dev; u32 flags; struct v4l2_device *v4l2_dev; const struct v4l2_subdev_ops *ops; const struct v4l2_subdev_internal_ops *internal_ops; struct v4l2_ctrl_handler *ctrl_handler; char name[32U]; u32 grp_id; void *dev_priv; void *host_priv; struct video_device *devnode; struct device *dev; struct list_head async_list; struct v4l2_async_subdev *asd; struct v4l2_async_notifier *notifier; struct v4l2_subdev_platform_data *pdata; } ;
622 struct __anonstruct_pad_239 { struct v4l2_mbus_framefmt try_fmt; struct v4l2_rect try_crop; struct v4l2_rect try_compose; } ;
622 struct v4l2_subdev_fh { struct v4l2_fh vfh; struct __anonstruct_pad_239 *pad; } ;
691 struct v4l2_device { struct device *dev; struct media_device *mdev; struct list_head subdevs; spinlock_t lock; char name[36U]; void (*notify)(struct v4l2_subdev *, unsigned int, void *); struct v4l2_ctrl_handler *ctrl_handler; struct v4l2_prio_state prio; struct mutex ioctl_lock; struct kref ref; void (*release)(struct v4l2_device *); } ;
130 struct snd_tea575x_ops { void (*write_val)(struct snd_tea575x *, u32 ); u32 (*read_val)(struct snd_tea575x *); void (*set_pins)(struct snd_tea575x *, u8 ); u8 (*get_pins)(struct snd_tea575x *); void (*set_direction)(struct snd_tea575x *, bool ); } ;
49 struct snd_tea575x { struct v4l2_device *v4l2_dev; struct v4l2_file_operations fops; struct video_device vd; int radio_nr; bool tea5759; bool has_am; bool cannot_read_data; bool cannot_mute; bool mute; bool stereo; bool tuned; unsigned int val; u32 band; u32 freq; struct mutex mutex; struct snd_tea575x_ops *ops; void *private_data; u8 card[32U]; u8 bus_info[32U]; struct v4l2_ctrl_handler ctrl_handler; int (*ext_init)(struct snd_tea575x *); } ;
78 struct v4l2_ioctl_ops { int (*vidioc_querycap)(struct file *, void *, struct v4l2_capability *); int (*vidioc_g_priority)(struct file *, void *, enum v4l2_priority *); int (*vidioc_s_priority)(struct file *, void *, enum v4l2_priority ); int (*vidioc_enum_fmt_vid_cap)(struct file *, void *, struct v4l2_fmtdesc *); int (*vidioc_enum_fmt_vid_overlay)(struct file *, void *, struct v4l2_fmtdesc *); int (*vidioc_enum_fmt_vid_out)(struct file *, void *, struct v4l2_fmtdesc *); int (*vidioc_enum_fmt_vid_cap_mplane)(struct file *, void *, struct v4l2_fmtdesc *); int (*vidioc_enum_fmt_vid_out_mplane)(struct file *, void *, struct v4l2_fmtdesc *); int (*vidioc_enum_fmt_sdr_cap)(struct file *, void *, struct v4l2_fmtdesc *); int (*vidioc_g_fmt_vid_cap)(struct file *, void *, struct v4l2_format *); int (*vidioc_g_fmt_vid_overlay)(struct file *, void *, struct v4l2_format *); int (*vidioc_g_fmt_vid_out)(struct file *, void *, struct v4l2_format *); int (*vidioc_g_fmt_vid_out_overlay)(struct file *, void *, struct v4l2_format *); int (*vidioc_g_fmt_vbi_cap)(struct file *, void *, struct v4l2_format *); int (*vidioc_g_fmt_vbi_out)(struct file *, void *, struct v4l2_format *); int (*vidioc_g_fmt_sliced_vbi_cap)(struct file *, void *, struct v4l2_format *); int (*vidioc_g_fmt_sliced_vbi_out)(struct file *, void *, struct v4l2_format *); int (*vidioc_g_fmt_vid_cap_mplane)(struct file *, void *, struct v4l2_format *); int (*vidioc_g_fmt_vid_out_mplane)(struct file *, void *, struct v4l2_format *); int (*vidioc_g_fmt_sdr_cap)(struct file *, void *, struct v4l2_format *); int (*vidioc_s_fmt_vid_cap)(struct file *, void *, struct v4l2_format *); int (*vidioc_s_fmt_vid_overlay)(struct file *, void *, struct v4l2_format *); int (*vidioc_s_fmt_vid_out)(struct file *, void *, struct v4l2_format *); int (*vidioc_s_fmt_vid_out_overlay)(struct file *, void *, struct v4l2_format *); int (*vidioc_s_fmt_vbi_cap)(struct file *, void *, struct v4l2_format *); int (*vidioc_s_fmt_vbi_out)(struct file *, void *, struct v4l2_format *); int (*vidioc_s_fmt_sliced_vbi_cap)(struct file *, void *, struct v4l2_format *); int (*vidioc_s_fmt_sliced_vbi_out)(struct file *, void *, struct v4l2_format *); int (*vidioc_s_fmt_vid_cap_mplane)(struct file *, void *, struct v4l2_format *); int (*vidioc_s_fmt_vid_out_mplane)(struct file *, void *, struct v4l2_format *); int (*vidioc_s_fmt_sdr_cap)(struct file *, void *, struct v4l2_format *); int (*vidioc_try_fmt_vid_cap)(struct file *, void *, struct v4l2_format *); int (*vidioc_try_fmt_vid_overlay)(struct file *, void *, struct v4l2_format *); int (*vidioc_try_fmt_vid_out)(struct file *, void *, struct v4l2_format *); int (*vidioc_try_fmt_vid_out_overlay)(struct file *, void *, struct v4l2_format *); int (*vidioc_try_fmt_vbi_cap)(struct file *, void *, struct v4l2_format *); int (*vidioc_try_fmt_vbi_out)(struct file *, void *, struct v4l2_format *); int (*vidioc_try_fmt_sliced_vbi_cap)(struct file *, void *, struct v4l2_format *); int (*vidioc_try_fmt_sliced_vbi_out)(struct file *, void *, struct v4l2_format *); int (*vidioc_try_fmt_vid_cap_mplane)(struct file *, void *, struct v4l2_format *); int (*vidioc_try_fmt_vid_out_mplane)(struct file *, void *, struct v4l2_format *); int (*vidioc_try_fmt_sdr_cap)(struct file *, void *, struct v4l2_format *); int (*vidioc_reqbufs)(struct file *, void *, struct v4l2_requestbuffers *); int (*vidioc_querybuf)(struct file *, void *, struct v4l2_buffer *); int (*vidioc_qbuf)(struct file *, void *, struct v4l2_buffer *); int (*vidioc_expbuf)(struct file *, void *, struct v4l2_exportbuffer *); int (*vidioc_dqbuf)(struct file *, void *, struct v4l2_buffer *); int (*vidioc_create_bufs)(struct file *, void *, struct v4l2_create_buffers *); int (*vidioc_prepare_buf)(struct file *, void *, struct v4l2_buffer *); int (*vidioc_overlay)(struct file *, void *, unsigned int); int (*vidioc_g_fbuf)(struct file *, void *, struct v4l2_framebuffer *); int (*vidioc_s_fbuf)(struct file *, void *, const struct v4l2_framebuffer *); int (*vidioc_streamon)(struct file *, void *, enum v4l2_buf_type ); int (*vidioc_streamoff)(struct file *, void *, enum v4l2_buf_type ); int (*vidioc_g_std)(struct file *, void *, v4l2_std_id *); int (*vidioc_s_std)(struct file *, void *, v4l2_std_id ); int (*vidioc_querystd)(struct file *, void *, v4l2_std_id *); int (*vidioc_enum_input)(struct file *, void *, struct v4l2_input *); int (*vidioc_g_input)(struct file *, void *, unsigned int *); int (*vidioc_s_input)(struct file *, void *, unsigned int); int (*vidioc_enum_output)(struct file *, void *, struct v4l2_output *); int (*vidioc_g_output)(struct file *, void *, unsigned int *); int (*vidioc_s_output)(struct file *, void *, unsigned int); int (*vidioc_queryctrl)(struct file *, void *, struct v4l2_queryctrl *); int (*vidioc_query_ext_ctrl)(struct file *, void *, struct v4l2_query_ext_ctrl *); int (*vidioc_g_ctrl)(struct file *, void *, struct v4l2_control *); int (*vidioc_s_ctrl)(struct file *, void *, struct v4l2_control *); int (*vidioc_g_ext_ctrls)(struct file *, void *, struct v4l2_ext_controls *); int (*vidioc_s_ext_ctrls)(struct file *, void *, struct v4l2_ext_controls *); int (*vidioc_try_ext_ctrls)(struct file *, void *, struct v4l2_ext_controls *); int (*vidioc_querymenu)(struct file *, void *, struct v4l2_querymenu *); int (*vidioc_enumaudio)(struct file *, void *, struct v4l2_audio *); int (*vidioc_g_audio)(struct file *, void *, struct v4l2_audio *); int (*vidioc_s_audio)(struct file *, void *, const struct v4l2_audio *); int (*vidioc_enumaudout)(struct file *, void *, struct v4l2_audioout *); int (*vidioc_g_audout)(struct file *, void *, struct v4l2_audioout *); int (*vidioc_s_audout)(struct file *, void *, const struct v4l2_audioout *); int (*vidioc_g_modulator)(struct file *, void *, struct v4l2_modulator *); int (*vidioc_s_modulator)(struct file *, void *, const struct v4l2_modulator *); int (*vidioc_cropcap)(struct file *, void *, struct v4l2_cropcap *); int (*vidioc_g_crop)(struct file *, void *, struct v4l2_crop *); int (*vidioc_s_crop)(struct file *, void *, const struct v4l2_crop *); int (*vidioc_g_selection)(struct file *, void *, struct v4l2_selection *); int (*vidioc_s_selection)(struct file *, void *, struct v4l2_selection *); int (*vidioc_g_jpegcomp)(struct file *, void *, struct v4l2_jpegcompression *); int (*vidioc_s_jpegcomp)(struct file *, void *, const struct v4l2_jpegcompression *); int (*vidioc_g_enc_index)(struct file *, void *, struct v4l2_enc_idx *); int (*vidioc_encoder_cmd)(struct file *, void *, struct v4l2_encoder_cmd *); int (*vidioc_try_encoder_cmd)(struct file *, void *, struct v4l2_encoder_cmd *); int (*vidioc_decoder_cmd)(struct file *, void *, struct v4l2_decoder_cmd *); int (*vidioc_try_decoder_cmd)(struct file *, void *, struct v4l2_decoder_cmd *); int (*vidioc_g_parm)(struct file *, void *, struct v4l2_streamparm *); int (*vidioc_s_parm)(struct file *, void *, struct v4l2_streamparm *); int (*vidioc_g_tuner)(struct file *, void *, struct v4l2_tuner *); int (*vidioc_s_tuner)(struct file *, void *, const struct v4l2_tuner *); int (*vidioc_g_frequency)(struct file *, void *, struct v4l2_frequency *); int (*vidioc_s_frequency)(struct file *, void *, const struct v4l2_frequency *); int (*vidioc_enum_freq_bands)(struct file *, void *, struct v4l2_frequency_band *); int (*vidioc_g_sliced_vbi_cap)(struct file *, void *, struct v4l2_sliced_vbi_cap *); int (*vidioc_log_status)(struct file *, void *); int (*vidioc_s_hw_freq_seek)(struct file *, void *, const struct v4l2_hw_freq_seek *); int (*vidioc_g_register)(struct file *, void *, struct v4l2_dbg_register *); int (*vidioc_s_register)(struct file *, void *, const struct v4l2_dbg_register *); int (*vidioc_g_chip_info)(struct file *, void *, struct v4l2_dbg_chip_info *); int (*vidioc_enum_framesizes)(struct file *, void *, struct v4l2_frmsizeenum *); int (*vidioc_enum_frameintervals)(struct file *, void *, struct v4l2_frmivalenum *); int (*vidioc_s_dv_timings)(struct file *, void *, struct v4l2_dv_timings *); int (*vidioc_g_dv_timings)(struct file *, void *, struct v4l2_dv_timings *); int (*vidioc_query_dv_timings)(struct file *, void *, struct v4l2_dv_timings *); int (*vidioc_enum_dv_timings)(struct file *, void *, struct v4l2_enum_dv_timings *); int (*vidioc_dv_timings_cap)(struct file *, void *, struct v4l2_dv_timings_cap *); int (*vidioc_g_edid)(struct file *, void *, struct v4l2_edid *); int (*vidioc_s_edid)(struct file *, void *, struct v4l2_edid *); int (*vidioc_subscribe_event)(struct v4l2_fh *, const struct v4l2_event_subscription *); int (*vidioc_unsubscribe_event)(struct v4l2_fh *, const struct v4l2_event_subscription *); long int (*vidioc_default)(struct file *, void *, bool , unsigned int, void *); } ;
107 struct maxiradio { struct snd_tea575x tea; struct v4l2_device v4l2_dev; struct pci_dev *pdev; u16 io; } ;
29 struct attribute___0 { const char *name; umode_t mode; bool ignore_lockdep; struct lock_class_key *key; struct lock_class_key skey; } ;
60 struct attribute_group___0 { const char *name; umode_t (*is_visible)(struct kobject___0 *, struct attribute___0 *, int); struct attribute___0 **attrs; struct bin_attribute___0 **bin_attrs; } ;
121 struct bin_attribute___0 { struct attribute___0 attr; size_t size; void *private; ssize_t (*read)(struct file *, struct kobject___0 *, struct bin_attribute___0 *, char *, loff_t , size_t ); ssize_t (*write)(struct file *, struct kobject___0 *, struct bin_attribute___0 *, char *, loff_t , size_t ); int (*mmap)(struct file *, struct kobject___0 *, struct bin_attribute___0 *attr, struct vm_area_struct *vma); } ;
175 struct sysfs_ops___0 { ssize_t (*show)(struct kobject___0 *, struct attribute___0 *, char *); ssize_t (*store)(struct kobject___0 *, struct attribute___0 *, const char *, size_t ); } ;
63 struct kobject___0 { const char *name; struct list_head entry; struct kobject___0 *parent; struct kset *kset; struct kobj_type___0 *ktype; struct kernfs_node *sd; struct kref kref; struct delayed_work release; unsigned int state_initialized; unsigned int state_in_sysfs; unsigned int state_add_uevent_sent; unsigned int state_remove_uevent_sent; unsigned int uevent_suppress; } ;
115 struct kobj_type___0 { void (*release)(struct kobject___0 *kobj); const struct sysfs_ops___0 *sysfs_ops; struct attribute___0 **default_attrs; const struct kobj_ns_type_operations * (*child_ns_type)(struct kobject___0 *kobj); const void * (*namespace)(struct kobject___0 *kobj); } ;
295 struct dev_pm_ops___0 { int (*prepare)(struct device___0 *dev); void (*complete)(struct device___0 *dev); int (*suspend)(struct device___0 *dev); int (*resume)(struct device___0 *dev); int (*freeze)(struct device___0 *dev); int (*thaw)(struct device___0 *dev); int (*poweroff)(struct device___0 *dev); int (*restore)(struct device___0 *dev); int (*suspend_late)(struct device___0 *dev); int (*resume_early)(struct device___0 *dev); int (*freeze_late)(struct device___0 *dev); int (*thaw_early)(struct device___0 *dev); int (*poweroff_late)(struct device___0 *dev); int (*restore_early)(struct device___0 *dev); int (*suspend_noirq)(struct device___0 *dev); int (*resume_noirq)(struct device___0 *dev); int (*freeze_noirq)(struct device___0 *dev); int (*thaw_noirq)(struct device___0 *dev); int (*poweroff_noirq)(struct device___0 *dev); int (*restore_noirq)(struct device___0 *dev); int (*runtime_suspend)(struct device___0 *dev); int (*runtime_resume)(struct device___0 *dev); int (*runtime_idle)(struct device___0 *dev); } ;
558 struct dev_pm_info___0 { pm_message_t power_state; unsigned int can_wakeup; unsigned int async_suspend; bool is_prepared; bool is_suspended; bool is_noirq_suspended; bool is_late_suspended; bool ignore_children; bool early_init; bool direct_complete; spinlock_t lock; struct list_head entry; struct completion completion; struct wakeup_source___0 *wakeup; bool wakeup_path; bool syscore; struct timer_list suspend_timer; unsigned long timer_expires; struct work_struct work; wait_queue_head_t wait_queue; atomic_t usage_count; atomic_t child_count; unsigned int disable_depth; unsigned int idle_notification; unsigned int request_pending; unsigned int deferred_resume; unsigned int run_wake; unsigned int runtime_auto; unsigned int no_callbacks; unsigned int irq_safe; unsigned int use_autosuspend; unsigned int timer_autosuspends; unsigned int 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___0 *, s32 ); struct dev_pm_qos *qos; } ;
620 struct dev_pm_domain___0 { struct dev_pm_ops___0 ops; } ;
104 struct bus_type___0 { const char *name; const char *dev_name; struct device___0 *dev_root; struct device_attribute___0 *dev_attrs; const struct attribute_group___0 **bus_groups; const struct attribute_group___0 **dev_groups; const struct attribute_group___0 **drv_groups; int (*match)(struct device___0 *dev, struct device_driver___0 *drv); int (*uevent)(struct device___0 *dev, struct kobj_uevent_env *env); int (*probe)(struct device___0 *dev); int (*remove)(struct device___0 *dev); void (*shutdown)(struct device___0 *dev); int (*online)(struct device___0 *dev); int (*offline)(struct device___0 *dev); int (*suspend)(struct device___0 *dev, pm_message_t state); int (*resume)(struct device___0 *dev); const struct dev_pm_ops___0 *pm; const struct iommu_ops *iommu_ops; struct subsys_private *p; struct lock_class_key lock_key; } ;
228 struct device_driver___0 { const char *name; struct bus_type___0 *bus; struct module *owner; const char *mod_name; bool suppress_bind_attrs; const struct of_device_id *of_match_table; const struct acpi_device_id *acpi_match_table; int (*probe)(struct device___0 *dev); int (*remove)(struct device___0 *dev); void (*shutdown)(struct device___0 *dev); int (*suspend)(struct device___0 *dev, pm_message_t state); int (*resume)(struct device___0 *dev); const struct attribute_group___0 **groups; const struct dev_pm_ops___0 *pm; struct driver_private *p; } ;
351 struct class___0 { const char *name; struct module *owner; struct class_attribute___0 *class_attrs; const struct attribute_group___0 **dev_groups; struct kobject___0 *dev_kobj; int (*dev_uevent)(struct device___0 *dev, struct kobj_uevent_env *env); char * (*devnode)(struct device___0 *dev, umode_t *mode); void (*class_release)(struct class___0 *class); void (*dev_release)(struct device___0 *dev); int (*suspend)(struct device___0 *dev, pm_message_t state); int (*resume)(struct device___0 *dev); const struct kobj_ns_type_operations *ns_type; const void * (*namespace)(struct device___0 *dev); const struct dev_pm_ops___0 *pm; struct subsys_private *p; } ;
417 struct class_attribute___0 { struct attribute___0 attr; ssize_t (*show)(struct class___0 *class, struct class_attribute___0 *attr, char *buf); ssize_t (*store)(struct class___0 *class, struct class_attribute___0 *attr, const char *buf, size_t count); } ;
500 struct device_type___0 { const char *name; const struct attribute_group___0 **groups; int (*uevent)(struct device___0 *dev, struct kobj_uevent_env *env); char * (*devnode)(struct device___0 *dev, umode_t *mode, kuid_t *uid, kgid_t *gid); void (*release)(struct device___0 *dev); const struct dev_pm_ops___0 *pm; } ;
512 struct device_attribute___0 { struct attribute___0 attr; ssize_t (*show)(struct device___0 *dev, struct device_attribute___0 *attr, char *buf); ssize_t (*store)(struct device___0 *dev, struct device_attribute___0 *attr, const char *buf, size_t count); } ;
729 struct device___0 { struct device___0 *parent; struct device_private *p; struct kobject___0 kobj; const char *init_name; const struct device_type___0 *type; struct mutex mutex; struct bus_type___0 *bus; struct device_driver___0 *driver; void *platform_data; void *driver_data; struct dev_pm_info___0 power; struct dev_pm_domain___0 *pm_domain; struct dev_pin_info *pins; int numa_node; u64 *dma_mask; u64 coherent_dma_mask; unsigned long dma_pfn_offset; struct device_dma_parameters *dma_parms; struct list_head dma_pools; struct dma_coherent_mem *dma_mem; struct cma *cma_area; struct dev_archdata archdata; struct device_node *of_node; struct acpi_dev_node acpi_node; dev_t devt; u32 id; spinlock_t devres_lock; struct list_head devres_head; struct klist_node knode_class; struct class___0 *class; const struct attribute_group___0 **groups; void (*release)(struct device___0 *dev); struct iommu_group *iommu_group; bool offline_disabled; bool offline; } ;
46 struct wakeup_source___0 { const char *name; struct list_head entry; spinlock_t lock; struct timer_list timer; unsigned long timer_expires; ktime_t total_time; ktime_t max_time; ktime_t last_time; ktime_t start_prevent_time; ktime_t prevent_sleep_time; unsigned long event_count; unsigned long active_count; unsigned long relax_count; unsigned long expire_count; unsigned long wakeup_count; bool active; bool autosleep_enabled; } ;
1 long int __builtin_expect(long exp, long c);
33 extern struct module __this_module;
142 int printk(const char *, ...);
391 int snprintf(char *, size_t , const char *, ...);
14 void ldv_error();
24 void ldv_stop();
30 void * ldv_undef_ptr();
33 void * __VERIFIER_alloc(size_t size);
34 void * ldv_zalloc(size_t size);
35 void * ldv_successful_alloc(size_t size);
79 void __builtin_trap();
18 void ldv_free();
28 void ldv_assume_and_increase(void *res);
26 size_t strlcpy(char *, const char *, size_t );
138 extern struct resource ioport_resource;
192 struct resource * __request_region(struct resource *, resource_size_t , resource_size_t , const char *, int);
203 void __release_region(struct resource *, resource_size_t , resource_size_t );
309 void outb(unsigned char value, int port);
309 unsigned char inb(int port);
144 void kfree(const void *);
147 void ldv_kfree_9(const void *ldv_func_arg1);
151 void ldv_kfree_10(const void *ldv_func_arg1);
86 const char * kobject_name(const struct kobject *kobj);
637 void * kzalloc(size_t size, gfp_t flags);
33 int LDV_IN_INTERRUPT = 1;
34 int ldv_state_variable_2 = 0;
35 struct snd_tea575x *maxiradio_tea_ops_group0 = 0;
36 struct pci_dev *maxiradio_driver_group1 = 0;
37 int __VERIFIER_nondet_int();
38 int ref_cnt = 0;
39 int ldv_state_variable_1 = 0;
40 int ldv_state_variable_0 = 0;
41 void ldv_initialyze_snd_tea575x_ops_2();
808 const char * dev_name(const struct device *dev);
839 void * dev_get_drvdata(const struct device *dev);
1044 int dev_err(const struct device *, const char *, ...);
924 int pci_enable_device(struct pci_dev *);
1109 int __pci_register_driver(struct pci_driver *, struct module *, const char *);
1118 void pci_unregister_driver(struct pci_driver *);
1439 const char * pci_name(const struct pci_dev *pdev);
79 int v4l2_device_register(struct device *, struct v4l2_device *);
97 int v4l2_device_set_name(struct v4l2_device *, const char *, atomic_t *);
106 void v4l2_device_unregister(struct v4l2_device *);
75 int snd_tea575x_init(struct snd_tea575x *, struct module *);
76 void snd_tea575x_exit(struct snd_tea575x *);
99 int radio_nr = -1;
104 const int clk = 1;
104 const int data = 2;
104 const int wren = 4;
104 const int mo_st = 8;
104 const int power = 16;
106 atomic_t maxiradio_instance = { 0 };
120 struct maxiradio * to_maxiradio(struct v4l2_device *v4l2_dev);
125 void maxiradio_tea575x_set_pins(struct snd_tea575x *tea, u8 pins);
140 u8 maxiradio_tea575x_get_pins(struct snd_tea575x *tea);
149 void maxiradio_tea575x_set_direction(struct snd_tea575x *tea, bool output);
153 struct snd_tea575x_ops maxiradio_tea_ops = { 0, 0, &maxiradio_tea575x_set_pins, &maxiradio_tea575x_get_pins, &maxiradio_tea575x_set_direction };
159 int maxiradio_probe(struct pci_dev *pdev, const struct pci_device_id *ent);
218 void maxiradio_remove(struct pci_dev *pdev);
230 struct pci_device_id maxiradio_pci_tbl[2U] = { { 20550U, 4097U, 4294967295U, 4294967295U, 0U, 0U, 0UL }, { 0U, 0U, 0U, 0U, 0U, 0U, 0UL } };
236 const struct pci_device_id __mod_pci__maxiradio_pci_tbl_device_table = { };
238 struct pci_driver maxiradio_driver = { { 0, 0 }, "radio-maxiradio", (const struct pci_device_id *)(&maxiradio_pci_tbl), &maxiradio_probe, &maxiradio_remove, 0, 0, 0, 0, 0, 0, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { { { { { { 0U } }, 0U, 0U, 0, { 0, { 0, 0 }, 0, 0, 0UL } } } }, { 0, 0 } } };
245 int maxiradio_driver_init();
245 void maxiradio_driver_exit();
247 int ldv_retval_0 = 0;
248 int ldv_retval_1 = 0;
249 void ldv_initialize();
250 void ldv_check_final_state();
265 void entry_point();
14 void ldv_error___0();
24 void ldv_stop___0();
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);
8 int ldv_alloc_count = 0;
11 void (*gadget_release_pointer)(struct device___0 *_dev) = 0;
19 void * ldv_alloc(size_t size);
26 void * ldv_zero_alloc(size_t size);
43 void * ldv_nonzero_alloc(size_t size);
56 void * ldv_alloc_without_counter(size_t size);
64 void * ldv_zalloc_without_counter(size_t size);
80 void ldv_condition_free();
89 void ldv_save_gadget_release(void (*func)(struct device___0 *_dev));
94 int ldv_dev_set_drvdata(struct device___0 *dev, void *data___0);
100 void * ldv_dev_get_drvdata(const struct device___0 *dev);
return ;
}
-entry_point
{
267 const struct pci_device_id *ldvarg0;
268 u8 ldvarg1;
269 bool ldvarg2;
270 int tmp;
271 int tmp___0;
272 int tmp___1;
273 void *tmp___2;
274 int tmp___3;
266 ldv_initialize() { /* Function call is skipped due to function is undefined */}
272 ldv_state_variable_1 = 0;
273 ref_cnt = 0;
274 ldv_state_variable_0 = 1;
275 ldv_state_variable_2 = 0;
276 ldv_33442:;
277 tmp = __VERIFIER_nondet_int() { /* Function call is skipped due to function is undefined */}
277 switch (tmp);
278 assume(!(tmp == 0));
310 assume(tmp == 1);
313 assume(ldv_state_variable_0 != 0);
314 tmp___1 = __VERIFIER_nondet_int() { /* Function call is skipped due to function is undefined */}
314 switch (tmp___1);
315 assume(!(tmp___1 == 0));
325 assume(tmp___1 == 1);
327 assume(ldv_state_variable_0 == 1);
329 -maxiradio_driver_init()
{
247 int tmp;
245 tmp = __pci_register_driver(&maxiradio_driver, &__this_module, "radio_maxiradio") { /* Function call is skipped due to function is undefined */}
245 return tmp;;
}
331 assume(ldv_retval_1 == 0);
332 ldv_state_variable_0 = 3;
333 ldv_state_variable_2 = 1;
334 -ldv_initialyze_snd_tea575x_ops_2()
{
255 void *tmp;
254 tmp = ldv_undef_ptr() { /* Function call is skipped due to function is undefined */}
254 maxiradio_tea_ops_group0 = (struct snd_tea575x *)tmp;
255 return ;;
}
335 ldv_state_variable_1 = 1;
336 -ldv_successful_alloc(2976UL)
{
37 void *ret;
38 void *tmp;
37 tmp = __VERIFIER_alloc(size) { /* Function call is skipped due to function is undefined */}
37 ret = tmp;
38 assume(!(((unsigned long)ret) == 0UL));
39 return ret;;
}
336 maxiradio_driver_group1 = (struct pci_dev *)tmp___2;
338 assume(!(ldv_retval_1 != 0));
344 goto ldv_33432;
349 goto ldv_33428;
392 goto ldv_33442;
277 tmp = __VERIFIER_nondet_int() { /* Function call is skipped due to function is undefined */}
277 switch (tmp);
278 assume(tmp == 0);
281 assume(ldv_state_variable_1 != 0);
282 tmp___0 = __VERIFIER_nondet_int() { /* Function call is skipped due to function is undefined */}
282 switch (tmp___0);
283 assume(tmp___0 == 0);
285 assume(ldv_state_variable_1 == 1);
287 -maxiradio_probe(maxiradio_driver_group1, ldvarg0)
{
161 struct maxiradio *dev;
162 struct v4l2_device *v4l2_dev;
163 int retval;
164 void *tmp;
165 const char *tmp___0;
166 struct resource *tmp___1;
167 int tmp___2;
168 int tmp___3;
164 retval = -12;
166 -kzalloc(2840UL, 208U)
{
442 void *res;
443 void *tmp;
443 tmp = ldv_zalloc(size) { /* Function call is skipped due to function is undefined */}
443 res = tmp;
444 -ldv_assume_and_increase(res)
{
36 assume(((unsigned long)res) <= 201200UL);
37 assume(((unsigned long)res) != 0UL);
39 ldv_alloc_count = ldv_alloc_count + 1;
41 return ;;
}
445 return res;;
}
166 dev = (struct maxiradio *)tmp;
167 assume(!(((unsigned long)dev) == 0UL));
172 v4l2_dev = &(dev->v4l2_dev);
173 v4l2_device_set_name(v4l2_dev, "maxiradio", &maxiradio_instance) { /* Function call is skipped due to function is undefined */}
175 retval = v4l2_device_register(&(pdev->dev), v4l2_dev) { /* Function call is skipped due to function is undefined */}
176 assume(!(retval < 0));
180 dev->tea.private_data = (void *)dev;
181 dev->tea.ops = &maxiradio_tea_ops;
184 dev->tea.cannot_read_data = 1;
185 dev->tea.v4l2_dev = v4l2_dev;
186 dev->tea.radio_nr = radio_nr;
187 strlcpy((char *)(&(dev->tea.card)), "Maxi Radio FM2000", 32UL) { /* Function call is skipped due to function is undefined */}
188 -pci_name((const struct pci_dev *)pdev)
{
1441 const char *tmp;
1441 -dev_name(&(pdev->dev))
{
810 const char *tmp;
811 unsigned long __CPAchecker_TMP_0 = (unsigned long)(dev->init_name);
811 assume(!(__CPAchecker_TMP_0 != 0UL));
814 -kobject_name(&(dev->kobj))
{
88 const char *__CPAchecker_TMP_0 = (const char *)(kobj->name);
88 return __CPAchecker_TMP_0;;
}
814 return tmp;;
}
1441 return tmp;;
}
188 snprintf((char *)(&(dev->tea.bus_info)), 32UL, "PCI:%s", tmp___0) { /* Function call is skipped due to function is undefined */}
191 retval = -19;
193 resource_size_t __CPAchecker_TMP_0;
193 assume((((pdev->resource)[0]).start) != 0ULL);
193 __CPAchecker_TMP_0 = ((((pdev->resource)[0]).end) - (((pdev->resource)[0]).start)) + 1ULL;
193 tmp___1 = __request_region(&ioport_resource, ((pdev->resource)[0]).start, __CPAchecker_TMP_0, (const char *)(&(v4l2_dev->name)), 0) { /* Function call is skipped due to function is undefined */}
193 assume(!(((unsigned long)tmp___1) == 0UL));
199 tmp___2 = pci_enable_device(pdev) { /* Function call is skipped due to function is undefined */}
199 assume(!(tmp___2 != 0));
202 dev->io = (u16 )(((pdev->resource)[0]).start);
203 tmp___3 = snd_tea575x_init(&(dev->tea), &__this_module) { /* Function call is skipped due to function is undefined */}
203 assume(!(tmp___3 != 0));
207 return 0;;
}
288 assume(ldv_retval_0 == 0);
289 ldv_state_variable_1 = 2;
290 ref_cnt = ref_cnt + 1;
294 goto ldv_33425;
309 goto ldv_33428;
392 goto ldv_33442;
277 tmp = __VERIFIER_nondet_int() { /* Function call is skipped due to function is undefined */}
277 switch (tmp);
278 assume(tmp == 0);
281 assume(ldv_state_variable_1 != 0);
282 tmp___0 = __VERIFIER_nondet_int() { /* Function call is skipped due to function is undefined */}
282 switch (tmp___0);
283 assume(!(tmp___0 == 0));
295 assume(tmp___0 == 1);
297 assume(ldv_state_variable_1 == 2);
299 -maxiradio_remove(maxiradio_driver_group1)
{
220 struct v4l2_device *v4l2_dev;
221 void *tmp;
222 struct maxiradio *dev;
223 struct maxiradio *tmp___0;
220 -dev_get_drvdata((const struct device *)(&(pdev->dev)))
{
841 void *__CPAchecker_TMP_0 = (void *)(dev->driver_data);
841 return __CPAchecker_TMP_0;;
}
220 v4l2_dev = (struct v4l2_device *)tmp;
221 -to_maxiradio(v4l2_dev)
{
122 const struct v4l2_device *__mptr;
122 __mptr = (const struct v4l2_device *)v4l2_dev;
122 return ((struct maxiradio *)__mptr) + 18446744073709549152UL;;
}
221 dev = tmp___0;
223 snd_tea575x_exit(&(dev->tea)) { /* Function call is skipped due to function is undefined */}
225 int __CPAchecker_TMP_0 = (int)(dev->io);
225 -outb(0, __CPAchecker_TMP_0)
{
309 Ignored inline assembler code
310 return ;;
}
226 v4l2_device_unregister(v4l2_dev) { /* Function call is skipped due to function is undefined */}
227 resource_size_t __CPAchecker_TMP_1;
227 assume((((pdev->resource)[0]).start) != 0ULL);
227 __CPAchecker_TMP_1 = ((((pdev->resource)[0]).end) - (((pdev->resource)[0]).start)) + 1ULL;
227 __release_region(&ioport_resource, ((pdev->resource)[0]).start, __CPAchecker_TMP_1) { /* Function call is skipped due to function is undefined */}
228 return ;;
}
300 ldv_state_variable_1 = 1;
301 ref_cnt = ref_cnt - 1;
304 goto ldv_33425;
309 goto ldv_33428;
392 goto ldv_33442;
277 tmp = __VERIFIER_nondet_int() { /* Function call is skipped due to function is undefined */}
277 switch (tmp);
278 assume(!(tmp == 0));
310 assume(tmp == 1);
313 assume(ldv_state_variable_0 != 0);
314 tmp___1 = __VERIFIER_nondet_int() { /* Function call is skipped due to function is undefined */}
314 switch (tmp___1);
315 assume(tmp___1 == 0);
317 assume(ldv_state_variable_0 == 3);
317 assume(ref_cnt == 0);
319 -maxiradio_driver_exit()
{
245 pci_unregister_driver(&maxiradio_driver) { /* Function call is skipped due to function is undefined */}
246 return ;;
}
320 ldv_state_variable_0 = 2;
321 goto ldv_final;
393 ldv_final:;
394 -ldv_check_final_state()
{
111 assume(!(ldv_alloc_count == 0));
111 -ldv_error___0()
{
19 LDV_ERROR:;
16 goto LDV_ERROR;
}
}
}
Source code
1 #ifndef _ASM_X86_IO_H 2 #define _ASM_X86_IO_H 3 4 /* 5 * This file contains the definitions for the x86 IO instructions 6 * inb/inw/inl/outb/outw/outl and the "string versions" of the same 7 * (insb/insw/insl/outsb/outsw/outsl). You can also use "pausing" 8 * versions of the single-IO instructions (inb_p/inw_p/..). 9 * 10 * This file is not meant to be obfuscating: it's just complicated 11 * to (a) handle it all in a way that makes gcc able to optimize it 12 * as well as possible and (b) trying to avoid writing the same thing 13 * over and over again with slight variations and possibly making a 14 * mistake somewhere. 15 */ 16 17 /* 18 * Thanks to James van Artsdalen for a better timing-fix than 19 * the two short jumps: using outb's to a nonexistent port seems 20 * to guarantee better timings even on fast machines. 21 * 22 * On the other hand, I'd like to be sure of a non-existent port: 23 * I feel a bit unsafe about using 0x80 (should be safe, though) 24 * 25 * Linus 26 */ 27 28 /* 29 * Bit simplified and optimized by Jan Hubicka 30 * Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999. 31 * 32 * isa_memset_io, isa_memcpy_fromio, isa_memcpy_toio added, 33 * isa_read[wl] and isa_write[wl] fixed 34 * - Arnaldo Carvalho de Melo <acme@conectiva.com.br> 35 */ 36 37 #define ARCH_HAS_IOREMAP_WC 38 39 #include <linux/string.h> 40 #include <linux/compiler.h> 41 #include <asm/page.h> 42 #include <asm/early_ioremap.h> 43 44 #define build_mmio_read(name, size, type, reg, barrier) \ 45 static inline type name(const volatile void __iomem *addr) \ 46 { type ret; asm volatile("mov" size " %1,%0":reg (ret) \ 47 :"m" (*(volatile type __force *)addr) barrier); return ret; } 48 49 #define build_mmio_write(name, size, type, reg, barrier) \ 50 static inline void name(type val, volatile void __iomem *addr) \ 51 { asm volatile("mov" size " %0,%1": :reg (val), \ 52 "m" (*(volatile type __force *)addr) barrier); } 53 54 build_mmio_read(readb, "b", unsigned char, "=q", :"memory") 55 build_mmio_read(readw, "w", unsigned short, "=r", :"memory") 56 build_mmio_read(readl, "l", unsigned int, "=r", :"memory") 57 58 build_mmio_read(__readb, "b", unsigned char, "=q", ) 59 build_mmio_read(__readw, "w", unsigned short, "=r", ) 60 build_mmio_read(__readl, "l", unsigned int, "=r", ) 61 62 build_mmio_write(writeb, "b", unsigned char, "q", :"memory") 63 build_mmio_write(writew, "w", unsigned short, "r", :"memory") 64 build_mmio_write(writel, "l", unsigned int, "r", :"memory") 65 66 build_mmio_write(__writeb, "b", unsigned char, "q", ) 67 build_mmio_write(__writew, "w", unsigned short, "r", ) 68 build_mmio_write(__writel, "l", unsigned int, "r", ) 69 70 #define readb_relaxed(a) __readb(a) 71 #define readw_relaxed(a) __readw(a) 72 #define readl_relaxed(a) __readl(a) 73 #define __raw_readb __readb 74 #define __raw_readw __readw 75 #define __raw_readl __readl 76 77 #define __raw_writeb __writeb 78 #define __raw_writew __writew 79 #define __raw_writel __writel 80 81 #define mmiowb() barrier() 82 83 #ifdef CONFIG_X86_64 84 85 build_mmio_read(readq, "q", unsigned long, "=r", :"memory") 86 build_mmio_write(writeq, "q", unsigned long, "r", :"memory") 87 88 #define readq_relaxed(a) readq(a) 89 90 #define __raw_readq(a) readq(a) 91 #define __raw_writeq(val, addr) writeq(val, addr) 92 93 /* Let people know that we have them */ 94 #define readq readq 95 #define writeq writeq 96 97 #endif 98 99 /** 100 * virt_to_phys - map virtual addresses to physical 101 * @address: address to remap 102 * 103 * The returned physical address is the physical (CPU) mapping for 104 * the memory address given. It is only valid to use this function on 105 * addresses directly mapped or allocated via kmalloc. 106 * 107 * This function does not give bus mappings for DMA transfers. In 108 * almost all conceivable cases a device driver should not be using 109 * this function 110 */ 111 112 static inline phys_addr_t virt_to_phys(volatile void *address) 113 { 114 return __pa(address); 115 } 116 117 /** 118 * phys_to_virt - map physical address to virtual 119 * @address: address to remap 120 * 121 * The returned virtual address is a current CPU mapping for 122 * the memory address given. It is only valid to use this function on 123 * addresses that have a kernel mapping 124 * 125 * This function does not handle bus mappings for DMA transfers. In 126 * almost all conceivable cases a device driver should not be using 127 * this function 128 */ 129 130 static inline void *phys_to_virt(phys_addr_t address) 131 { 132 return __va(address); 133 } 134 135 /* 136 * Change "struct page" to physical address. 137 */ 138 #define page_to_phys(page) ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT) 139 140 /* 141 * ISA I/O bus memory addresses are 1:1 with the physical address. 142 * However, we truncate the address to unsigned int to avoid undesirable 143 * promitions in legacy drivers. 144 */ 145 static inline unsigned int isa_virt_to_bus(volatile void *address) 146 { 147 return (unsigned int)virt_to_phys(address); 148 } 149 #define isa_page_to_bus(page) ((unsigned int)page_to_phys(page)) 150 #define isa_bus_to_virt phys_to_virt 151 152 /* 153 * However PCI ones are not necessarily 1:1 and therefore these interfaces 154 * are forbidden in portable PCI drivers. 155 * 156 * Allow them on x86 for legacy drivers, though. 157 */ 158 #define virt_to_bus virt_to_phys 159 #define bus_to_virt phys_to_virt 160 161 /** 162 * ioremap - map bus memory into CPU space 163 * @offset: bus address of the memory 164 * @size: size of the resource to map 165 * 166 * ioremap performs a platform specific sequence of operations to 167 * make bus memory CPU accessible via the readb/readw/readl/writeb/ 168 * writew/writel functions and the other mmio helpers. The returned 169 * address is not guaranteed to be usable directly as a virtual 170 * address. 171 * 172 * If the area you are trying to map is a PCI BAR you should have a 173 * look at pci_iomap(). 174 */ 175 extern void __iomem *ioremap_nocache(resource_size_t offset, unsigned long size); 176 extern void __iomem *ioremap_cache(resource_size_t offset, unsigned long size); 177 extern void __iomem *ioremap_prot(resource_size_t offset, unsigned long size, 178 unsigned long prot_val); 179 180 /* 181 * The default ioremap() behavior is non-cached: 182 */ 183 static inline void __iomem *ioremap(resource_size_t offset, unsigned long size) 184 { 185 return ioremap_nocache(offset, size); 186 } 187 188 extern void iounmap(volatile void __iomem *addr); 189 190 extern void set_iounmap_nonlazy(void); 191 192 #ifdef __KERNEL__ 193 194 #include <asm-generic/iomap.h> 195 196 #include <linux/vmalloc.h> 197 198 /* 199 * Convert a virtual cached pointer to an uncached pointer 200 */ 201 #define xlate_dev_kmem_ptr(p) p 202 203 static inline void 204 memset_io(volatile void __iomem *addr, unsigned char val, size_t count) 205 { 206 memset((void __force *)addr, val, count); 207 } 208 209 static inline void 210 memcpy_fromio(void *dst, const volatile void __iomem *src, size_t count) 211 { 212 memcpy(dst, (const void __force *)src, count); 213 } 214 215 static inline void 216 memcpy_toio(volatile void __iomem *dst, const void *src, size_t count) 217 { 218 memcpy((void __force *)dst, src, count); 219 } 220 221 /* 222 * ISA space is 'always mapped' on a typical x86 system, no need to 223 * explicitly ioremap() it. The fact that the ISA IO space is mapped 224 * to PAGE_OFFSET is pure coincidence - it does not mean ISA values 225 * are physical addresses. The following constant pointer can be 226 * used as the IO-area pointer (it can be iounmapped as well, so the 227 * analogy with PCI is quite large): 228 */ 229 #define __ISA_IO_base ((char __iomem *)(PAGE_OFFSET)) 230 231 /* 232 * Cache management 233 * 234 * This needed for two cases 235 * 1. Out of order aware processors 236 * 2. Accidentally out of order processors (PPro errata #51) 237 */ 238 239 static inline void flush_write_buffers(void) 240 { 241 #if defined(CONFIG_X86_PPRO_FENCE) 242 asm volatile("lock; addl $0,0(%%esp)": : :"memory"); 243 #endif 244 } 245 246 #endif /* __KERNEL__ */ 247 248 extern void native_io_delay(void); 249 250 extern int io_delay_type; 251 extern void io_delay_init(void); 252 253 #if defined(CONFIG_PARAVIRT) 254 #include <asm/paravirt.h> 255 #else 256 257 static inline void slow_down_io(void) 258 { 259 native_io_delay(); 260 #ifdef REALLY_SLOW_IO 261 native_io_delay(); 262 native_io_delay(); 263 native_io_delay(); 264 #endif 265 } 266 267 #endif 268 269 #define BUILDIO(bwl, bw, type) \ 270 static inline void out##bwl(unsigned type value, int port) \ 271 { \ 272 asm volatile("out" #bwl " %" #bw "0, %w1" \ 273 : : "a"(value), "Nd"(port)); \ 274 } \ 275 \ 276 static inline unsigned type in##bwl(int port) \ 277 { \ 278 unsigned type value; \ 279 asm volatile("in" #bwl " %w1, %" #bw "0" \ 280 : "=a"(value) : "Nd"(port)); \ 281 return value; \ 282 } \ 283 \ 284 static inline void out##bwl##_p(unsigned type value, int port) \ 285 { \ 286 out##bwl(value, port); \ 287 slow_down_io(); \ 288 } \ 289 \ 290 static inline unsigned type in##bwl##_p(int port) \ 291 { \ 292 unsigned type value = in##bwl(port); \ 293 slow_down_io(); \ 294 return value; \ 295 } \ 296 \ 297 static inline void outs##bwl(int port, const void *addr, unsigned long count) \ 298 { \ 299 asm volatile("rep; outs" #bwl \ 300 : "+S"(addr), "+c"(count) : "d"(port)); \ 301 } \ 302 \ 303 static inline void ins##bwl(int port, void *addr, unsigned long count) \ 304 { \ 305 asm volatile("rep; ins" #bwl \ 306 : "+D"(addr), "+c"(count) : "d"(port)); \ 307 } 308 309 BUILDIO(b, b, char) 310 BUILDIO(w, w, short) 311 BUILDIO(l, , int) 312 313 extern void *xlate_dev_mem_ptr(unsigned long phys); 314 extern void unxlate_dev_mem_ptr(unsigned long phys, void *addr); 315 316 extern int ioremap_change_attr(unsigned long vaddr, unsigned long size, 317 unsigned long prot_val); 318 extern void __iomem *ioremap_wc(resource_size_t offset, unsigned long size); 319 320 extern bool is_early_ioremap_ptep(pte_t *ptep); 321 322 #ifdef CONFIG_XEN 323 #include <xen/xen.h> 324 struct bio_vec; 325 326 extern bool xen_biovec_phys_mergeable(const struct bio_vec *vec1, 327 const struct bio_vec *vec2); 328 329 #define BIOVEC_PHYS_MERGEABLE(vec1, vec2) \ 330 (__BIOVEC_PHYS_MERGEABLE(vec1, vec2) && \ 331 (!xen_domain() || xen_biovec_phys_mergeable(vec1, vec2))) 332 #endif /* CONFIG_XEN */ 333 334 #define IO_SPACE_LIMIT 0xffff 335 336 #ifdef CONFIG_MTRR 337 extern int __must_check arch_phys_wc_add(unsigned long base, 338 unsigned long size); 339 extern void arch_phys_wc_del(int handle); 340 #define arch_phys_wc_add arch_phys_wc_add 341 #endif 342 343 #endif /* _ASM_X86_IO_H */
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 /* TODO: this include should be avoided here while bindings below should 9 * call just model functions from LDV_COMMON_MODEL rather then, say, 10 * ldv_undef_int_negative(). */ 11 #include <verifier/rcv.h> 12 // Provide model function prototypes before their usage. 13 //for dev_get_drvdata, dev_set_drvdata 14 //#include <linux/device.h> 15 16 void* ldv_alloc(size_t size); 17 void* ldv_zero_alloc(size_t size); 18 void ldv_free(void); 19 void ldv_condition_free(void); 20 void ldv_save_gadget_release(void (*func)(struct device *_dev)); 21 void *ldv_dev_get_drvdata(const struct device *dev); 22 int ldv_dev_set_drvdata(struct device *dev, void *data); 23 void* ldv_alloc_without_counter(size_t size); 24 void* ldv_zalloc_without_counter(size_t size); 25 void* ldv_nonzero_alloc(size_t size); 26 void* __VERIFIER_alloc(size_t size); 27 void* ldv_zalloc(size_t size); 28 void ldv_assume_and_increase(void* res) ; 29 30 #include <linux/slab.h> 31 #include <verifier/rcv.h> 32 #include <linux/gfp.h> 33 int LDV_IN_INTERRUPT = 1; 34 int ldv_state_variable_2; 35 struct snd_tea575x *maxiradio_tea_ops_group0; 36 struct pci_dev *maxiradio_driver_group1; 37 int __VERIFIER_nondet_int(void); 38 int ref_cnt; 39 int ldv_state_variable_1; 40 int ldv_state_variable_0; 41 void ldv_initialyze_snd_tea575x_ops_2(void); 42 int __VERIFIER_nondet_int(void); 43 /* 44 * Guillemot Maxi Radio FM 2000 PCI radio card driver for Linux 45 * (C) 2001 Dimitromanolakis Apostolos <apdim@grecian.net> 46 * 47 * Based in the radio Maestro PCI driver. Actually it uses the same chip 48 * for radio but different pci controller. 49 * 50 * I didn't have any specs I reversed engineered the protocol from 51 * the windows driver (radio.dll). 52 * 53 * The card uses the TEA5757 chip that includes a search function but it 54 * is useless as I haven't found any way to read back the frequency. If 55 * anybody does please mail me. 56 * 57 * For the pdf file see: 58 * http://www.nxp.com/acrobat_download2/expired_datasheets/TEA5757_5759_3.pdf 59 * 60 * 61 * CHANGES: 62 * 0.75b 63 * - better pci interface thanks to Francois Romieu <romieu@cogenit.fr> 64 * 65 * 0.75 Sun Feb 4 22:51:27 EET 2001 66 * - tiding up 67 * - removed support for multiple devices as it didn't work anyway 68 * 69 * BUGS: 70 * - card unmutes if you change frequency 71 * 72 * (c) 2006, 2007 by Mauro Carvalho Chehab <mchehab@infradead.org>: 73 * - Conversion to V4L2 API 74 * - Uses video_ioctl2 for parsing and to add debug support 75 */ 76 77 78 #include <linux/module.h> 79 #include <linux/init.h> 80 #include <linux/ioport.h> 81 #include <linux/delay.h> 82 #include <linux/mutex.h> 83 #include <linux/pci.h> 84 #include <linux/videodev2.h> 85 #include <linux/io.h> 86 #include <linux/slab.h> 87 #include <media/tea575x.h> 88 #include <media/v4l2-device.h> 89 #include <media/v4l2-ioctl.h> 90 #include <media/v4l2-fh.h> 91 #include <media/v4l2-ctrls.h> 92 #include <media/v4l2-event.h> 93 94 MODULE_AUTHOR("Dimitromanolakis Apostolos, apdim@grecian.net"); 95 MODULE_DESCRIPTION("Radio driver for the Guillemot Maxi Radio FM2000."); 96 MODULE_LICENSE("GPL"); 97 MODULE_VERSION("1.0.0"); 98 99 static int radio_nr = -1; 100 module_param(radio_nr, int, 0644); 101 MODULE_PARM_DESC(radio_nr, "Radio device number"); 102 103 /* TEA5757 pin mappings */ 104 static const int clk = 1, data = 2, wren = 4, mo_st = 8, power = 16; 105 106 static atomic_t maxiradio_instance = ATOMIC_INIT(0); 107 108 #define PCI_VENDOR_ID_GUILLEMOT 0x5046 109 #define PCI_DEVICE_ID_GUILLEMOT_MAXIRADIO 0x1001 110 111 struct maxiradio 112 { 113 struct snd_tea575x tea; 114 struct v4l2_device v4l2_dev; 115 struct pci_dev *pdev; 116 117 u16 io; /* base of radio io */ 118 }; 119 120 static inline struct maxiradio *to_maxiradio(struct v4l2_device *v4l2_dev) 121 { 122 return container_of(v4l2_dev, struct maxiradio, v4l2_dev); 123 } 124 125 static void maxiradio_tea575x_set_pins(struct snd_tea575x *tea, u8 pins) 126 { 127 struct maxiradio *dev = tea->private_data; 128 u8 bits = 0; 129 130 bits |= (pins & TEA575X_DATA) ? data : 0; 131 bits |= (pins & TEA575X_CLK) ? clk : 0; 132 bits |= (pins & TEA575X_WREN) ? wren : 0; 133 bits |= power; 134 135 outb(bits, dev->io); 136 } 137 138 /* Note: this card cannot read out the data of the shift registers, 139 only the mono/stereo pin works. */ 140 static u8 maxiradio_tea575x_get_pins(struct snd_tea575x *tea) 141 { 142 struct maxiradio *dev = tea->private_data; 143 u8 bits = inb(dev->io); 144 145 return ((bits & data) ? TEA575X_DATA : 0) | 146 ((bits & mo_st) ? TEA575X_MOST : 0); 147 } 148 149 static void maxiradio_tea575x_set_direction(struct snd_tea575x *tea, bool output) 150 { 151 } 152 153 static struct snd_tea575x_ops maxiradio_tea_ops = { 154 .set_pins = maxiradio_tea575x_set_pins, 155 .get_pins = maxiradio_tea575x_get_pins, 156 .set_direction = maxiradio_tea575x_set_direction, 157 }; 158 159 static int maxiradio_probe(struct pci_dev *pdev, 160 const struct pci_device_id *ent) 161 { 162 struct maxiradio *dev; 163 struct v4l2_device *v4l2_dev; 164 int retval = -ENOMEM; 165 166 dev = kzalloc(sizeof(*dev), GFP_KERNEL); 167 if (dev == NULL) { 168 dev_err(&pdev->dev, "not enough memory\n"); 169 return -ENOMEM; 170 } 171 172 v4l2_dev = &dev->v4l2_dev; 173 v4l2_device_set_name(v4l2_dev, "maxiradio", &maxiradio_instance); 174 175 retval = v4l2_device_register(&pdev->dev, v4l2_dev); 176 if (retval < 0) { 177 v4l2_err(v4l2_dev, "Could not register v4l2_device\n"); 178 goto errfr; 179 } 180 dev->tea.private_data = dev; 181 dev->tea.ops = &maxiradio_tea_ops; 182 /* The data pin cannot be read. This may be a hardware limitation, or 183 we just don't know how to read it. */ 184 dev->tea.cannot_read_data = true; 185 dev->tea.v4l2_dev = v4l2_dev; 186 dev->tea.radio_nr = radio_nr; 187 strlcpy(dev->tea.card, "Maxi Radio FM2000", sizeof(dev->tea.card)); 188 snprintf(dev->tea.bus_info, sizeof(dev->tea.bus_info), 189 "PCI:%s", pci_name(pdev)); 190 191 retval = -ENODEV; 192 193 if (!request_region(pci_resource_start(pdev, 0), 194 pci_resource_len(pdev, 0), v4l2_dev->name)) { 195 dev_err(&pdev->dev, "can't reserve I/O ports\n"); 196 goto err_hdl; 197 } 198 199 if (pci_enable_device(pdev)) 200 goto err_out_free_region; 201 202 dev->io = pci_resource_start(pdev, 0); 203 if (snd_tea575x_init(&dev->tea, THIS_MODULE)) { 204 printk(KERN_ERR "radio-maxiradio: Unable to detect TEA575x tuner\n"); 205 goto err_out_free_region; 206 } 207 return 0; 208 209 err_out_free_region: 210 release_region(pci_resource_start(pdev, 0), pci_resource_len(pdev, 0)); 211 err_hdl: 212 v4l2_device_unregister(v4l2_dev); 213 errfr: 214 kfree(dev); 215 return retval; 216 } 217 218 static void maxiradio_remove(struct pci_dev *pdev) 219 { 220 struct v4l2_device *v4l2_dev = dev_get_drvdata(&pdev->dev); 221 struct maxiradio *dev = to_maxiradio(v4l2_dev); 222 223 snd_tea575x_exit(&dev->tea); 224 /* Turn off power */ 225 outb(0, dev->io); 226 v4l2_device_unregister(v4l2_dev); 227 release_region(pci_resource_start(pdev, 0), pci_resource_len(pdev, 0)); 228 } 229 230 static struct pci_device_id maxiradio_pci_tbl[] = { 231 { PCI_VENDOR_ID_GUILLEMOT, PCI_DEVICE_ID_GUILLEMOT_MAXIRADIO, 232 PCI_ANY_ID, PCI_ANY_ID, }, 233 { 0 } 234 }; 235 236 MODULE_DEVICE_TABLE(pci, maxiradio_pci_tbl); 237 238 static struct pci_driver maxiradio_driver = { 239 .name = "radio-maxiradio", 240 .id_table = maxiradio_pci_tbl, 241 .probe = maxiradio_probe, 242 .remove = maxiradio_remove, 243 }; 244 245 module_pci_driver(maxiradio_driver); 246 247 int ldv_retval_0; 248 int ldv_retval_1; 249 void ldv_initialize(void); 250 void ldv_check_final_state(void); 251 252 253 void ldv_initialyze_snd_tea575x_ops_2(void){ 254 maxiradio_tea_ops_group0 = ldv_undef_ptr(); 255 } 256 int __VERIFIER_nondet_int(void); 257 258 /* DEG-ENVIRONMENT-BEGIN */ 259 extern void ldv_main_exported_1(void); 260 extern void ldv_main_exported_0(void); 261 extern void ldv_main_exported_2(void); 262 263 //********************* LDV MAIN ********************* 264 //main 265 void entry_point(void){ 266 ldv_initialize(); 267 //args for callbacks 268 struct pci_device_id const *ldvarg0; 269 u8 ldvarg1; 270 bool ldvarg2; 271 //initialization of machine states 272 ldv_state_variable_1=0; 273 ref_cnt=0; 274 ldv_state_variable_0=1; 275 ldv_state_variable_2=0; 276 while(1){ 277 switch(__VERIFIER_nondet_int()){ 278 case 0:{ 279 /*DEG-struct: handlers from structure maxiradio_driver*/ 280 /*DEG-CHECK: checking registration of maxiradio_driver structure*/ 281 if(ldv_state_variable_1 != 0){ 282 switch(__VERIFIER_nondet_int()){ 283 case 0:{ 284 /*DEG-state: state 1 (look at corresponding state-chart diagram for details)*/ 285 if(ldv_state_variable_1 == 1){ 286 /*DEG-CALL: handler probe from maxiradio_driver*/ 287 ldv_retval_0=(& maxiradio_probe)(maxiradio_driver_group1,ldvarg0); 288 if(ldv_retval_0==0){ 289 ldv_state_variable_1 = 2; 290 ref_cnt++; 291 } 292 } 293 } 294 break; 295 case 1:{ 296 /*DEG-state: state 2 (look at corresponding state-chart diagram for details)*/ 297 if(ldv_state_variable_1 == 2){ 298 /*DEG-CALL: handler remove from maxiradio_driver*/ 299 (& maxiradio_remove)(maxiradio_driver_group1); 300 ldv_state_variable_1 = 1; 301 ref_cnt--; 302 } 303 } 304 break; 305 default: ldv_assume(0); 306 } 307 } 308 } 309 break; 310 case 1:{ 311 /*DEG-struct: handlers from structure module*/ 312 /*DEG-CHECK: checking registration of module structure*/ 313 if(ldv_state_variable_0 != 0){ 314 switch(__VERIFIER_nondet_int()){ 315 case 0:{ 316 /*DEG-state: state 3 (look at corresponding state-chart diagram for details)*/ 317 if(ldv_state_variable_0 == 3 && ref_cnt==0){ 318 /*DEG-CALL: handler module_exit from module*/ 319 maxiradio_driver_exit(); 320 ldv_state_variable_0 = 2; 321 goto ldv_final; 322 } 323 } 324 break; 325 case 1:{ 326 /*DEG-state: state 1 (look at corresponding state-chart diagram for details)*/ 327 if(ldv_state_variable_0 == 1){ 328 /*DEG-CALL: handler module_init from module*/ 329 ldv_retval_1=maxiradio_driver_init(); 330 /*DEG-postcall: if success*/ 331 if(ldv_retval_1==0){ 332 ldv_state_variable_0 = 3; 333 ldv_state_variable_2 = 1; 334 ldv_initialyze_snd_tea575x_ops_2(); 335 ldv_state_variable_1 = 1; 336 maxiradio_driver_group1 = ldv_successful_alloc(sizeof(struct pci_dev)); 337 } 338 if(ldv_retval_1!=0){ 339 ldv_state_variable_0 = 2; 340 goto ldv_final; 341 } 342 } 343 } 344 break; 345 default: ldv_assume(0); 346 } 347 } 348 } 349 break; 350 case 2:{ 351 /*DEG-struct: handlers from structure maxiradio_tea_ops*/ 352 /*DEG-CHECK: checking registration of maxiradio_tea_ops structure*/ 353 if(ldv_state_variable_2 != 0){ 354 switch(__VERIFIER_nondet_int()){ 355 case 0:{ 356 /*DEG-state: state 1 (look at corresponding state-chart diagram for details)*/ 357 if(ldv_state_variable_2 == 1){ 358 /*DEG-CALL: handler set_direction from maxiradio_tea_ops*/ 359 (& maxiradio_tea575x_set_direction)(maxiradio_tea_ops_group0,ldvarg2); 360 /*DEG-postcall: default*/ 361 ldv_state_variable_2 = 1; 362 } 363 } 364 break; 365 case 1:{ 366 /*DEG-state: state 1 (look at corresponding state-chart diagram for details)*/ 367 if(ldv_state_variable_2 == 1){ 368 /*DEG-CALL: handler set_pins from maxiradio_tea_ops*/ 369 (& maxiradio_tea575x_set_pins)(maxiradio_tea_ops_group0,ldvarg1); 370 /*DEG-postcall: default*/ 371 ldv_state_variable_2 = 1; 372 } 373 } 374 break; 375 case 2:{ 376 /*DEG-state: state 1 (look at corresponding state-chart diagram for details)*/ 377 if(ldv_state_variable_2 == 1){ 378 /*DEG-CALL: handler get_pins from maxiradio_tea_ops*/ 379 (& maxiradio_tea575x_get_pins)(maxiradio_tea_ops_group0); 380 /*DEG-postcall: default*/ 381 ldv_state_variable_2 = 1; 382 } 383 } 384 break; 385 default: ldv_assume(0); 386 } 387 } 388 } 389 break; 390 default: ldv_assume(0); 391 } 392 } 393 ldv_final: 394 ldv_check_final_state(); 395 return; 396 } 397 /* DEG-ENVIRONMENT-END */
1 2 3 #include <verifier/rcv.h> 4 #include <linux/device.h> 5 #include <kernel-model/ERR.inc> 6 struct device_private; 7 /* LDV_COMMENT_CHANGE_STATE At the beginning nothing is allocated. */ 8 int ldv_alloc_count = 0; 9 10 /* LDV_COMMENT_CHANGE_STATE Saved release function pointer. */ 11 void (*gadget_release_pointer)(struct device *_dev); 12 13 void* __VERIFIER_alloc(size_t size); 14 15 /* LDV_COMMENT_CHANGE_STATE At the beginning nothing is allocated. */ 16 //void* ldv_saved_drv_data; 17 18 /* LDV_COMMENT_MODEL_FUNCTION_DEFINITION(name='ldv_alloc') Allocate a "memory". */ 19 void* ldv_alloc(size_t size) 20 { 21 void *res = __VERIFIER_alloc(size); 22 ldv_assume_and_increase(res); 23 return res; 24 } 25 26 void* ldv_zero_alloc(size_t size) 27 { 28 void *res = ldv_zalloc(size); 29 ldv_assume_and_increase(res); 30 return res; 31 } 32 33 /* LDV_COMMENT_MODEL_FUNCTION_DEFINITION(name='ldv_assume_and_increase') Allocate a "memory". */ 34 void ldv_assume_and_increase(void* res) 35 { 36 ldv_assume(res <= LDV_PTR_MAX); 37 if (res != 0) { 38 /* LDV_COMMENT_CHANGE_STATE One more "memory" is allocated. */ 39 ldv_alloc_count++; 40 } 41 } 42 43 void* ldv_nonzero_alloc(size_t size) 44 { 45 //functions, like memdup_user returns either valid pointer, or ptr_err 46 void *res = __VERIFIER_alloc(size); 47 ldv_assume(res != 0); 48 if (res <= LDV_PTR_MAX) { 49 /* LDV_COMMENT_CHANGE_STATE One more "memory" is allocated. */ 50 ldv_alloc_count++; 51 } 52 return res; 53 } 54 55 /* LDV_COMMENT_MODEL_FUNCTION_DEFINITION(name='ldv_alloc_without_counter') Allocate a "memory". */ 56 void* ldv_alloc_without_counter(size_t size) 57 { 58 void *res = __VERIFIER_alloc(size); 59 ldv_assume(res <= LDV_PTR_MAX); 60 return res; 61 } 62 63 /* LDV_COMMENT_MODEL_FUNCTION_DEFINITION(name='ldv_zalloc_without_counter') Allocate a "memory". */ 64 void* ldv_zalloc_without_counter(size_t size) 65 { 66 void *res = ldv_zalloc(size); 67 ldv_assume(res <= LDV_PTR_MAX); 68 return res; 69 } 70 71 /* LDV_COMMENT_MODEL_FUNCTION_DEFINITION(name='ldv_free') Free a "memory". */ 72 void ldv_free(void) 73 { 74 ldv_assert(ldv_alloc_count > 0); 75 /* LDV_COMMENT_CHANGE_STATE Free a "memory". */ 76 ldv_alloc_count--; 77 //ldv_saved_drv_data = 0; 78 } 79 80 void ldv_condition_free() 81 { 82 if (ldv_alloc_count > 0) 83 { 84 ldv_free(); 85 } 86 } 87 88 /* LDV_COMMENT_MODEL_FUNCTION_DEFINITION(name='ldv_save_gadget_release') Free a "memory". */ 89 void ldv_save_gadget_release(void (*func)(struct device *_dev)) 90 { 91 gadget_release_pointer = func; 92 } 93 94 int ldv_dev_set_drvdata(struct device *dev, void *data) 95 { 96 dev->p = data; 97 return 0; 98 } 99 100 void *ldv_dev_get_drvdata(const struct device *dev) 101 { 102 return dev->p; 103 } 104 105 106 107 /* LDV_COMMENT_MODEL_FUNCTION_DEFINITION(name='ldv_check_final_state') All allocated memory should be freed at the end. */ 108 void ldv_check_final_state(void) 109 { 110 /* LDV_COMMENT_ASSERT Nothing should be allocated at the end. */ 111 ldv_assert(ldv_alloc_count == 0); 112 }
1 #ifndef _LDV_RCV_H_ 2 #define _LDV_RCV_H_ 3 4 //Only for defining size_t 5 #include <linux/types.h> 6 7 /* If expr evaluates to zero, ldv_assert() causes a program to reach the error 8 label like the standard assert(). */ 9 #define ldv_assert(expr) ((expr) ? 0 : ldv_error()) 10 11 12 /* The error label wrapper. It is used because of some static verifiers (like 13 BLAST) don't accept multiple error labels through a program. */ 14 static inline void ldv_error(void) 15 { 16 LDV_ERROR: goto LDV_ERROR; 17 } 18 19 /* If expr evaluates to zero, ldv_assume() causes an infinite loop that is 20 avoided by verifiers. */ 21 #define ldv_assume(expr) ((expr) ? 0 : ldv_stop()) 22 23 /* Infinite loop, that causes verifiers to skip such paths. */ 24 static inline void ldv_stop(void) { 25 LDV_STOP: goto LDV_STOP; 26 } 27 28 /* Special nondeterministic functions. */ 29 int ldv_undef_int(void); 30 void *ldv_undef_ptr(void); 31 unsigned long ldv_undef_ulong(void); 32 33 void* __VERIFIER_alloc(size_t size); 34 void* ldv_zalloc(size_t size); 35 static inline void* ldv_successful_alloc(size_t size) 36 { 37 void* ret = __VERIFIER_alloc(size); 38 ldv_assume(ret != 0); 39 return ret; 40 } 41 42 static inline void* ldv_successful_zalloc(size_t size) 43 { 44 void* ret = ldv_zalloc(size); 45 ldv_assume(ret != 0); 46 return ret; 47 } 48 /* Return nondeterministic negative integer number. */ 49 static inline int ldv_undef_int_negative(void) 50 { 51 int ret = ldv_undef_int(); 52 53 ldv_assume(ret < 0); 54 55 return ret; 56 } 57 /* Return nondeterministic nonpositive integer number. */ 58 static inline int ldv_undef_int_nonpositive(void) 59 { 60 int ret = ldv_undef_int(); 61 62 ldv_assume(ret <= 0); 63 64 return ret; 65 } 66 67 /* Add explicit model for __builin_expect GCC function. Without the model a 68 return value will be treated as nondetermined by verifiers. */ 69 long __builtin_expect(long exp, long c) 70 { 71 return exp; 72 } 73 74 /* This function causes the program to exit abnormally. GCC implements this 75 function by using a target-dependent mechanism (such as intentionally executing 76 an illegal instruction) or by calling abort. The mechanism used may vary from 77 release to release so you should not rely on any particular implementation. 78 http://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html */ 79 void __builtin_trap(void) 80 { 81 ldv_assert(0); 82 } 83 84 /* The constant is for simulating an error of ldv_undef_ptr() function. */ 85 #define LDV_PTR_MAX 201200 86 87 #endif /* _LDV_RCV_H_ */
1 /* 2 * device.h - generic, centralized driver model 3 * 4 * Copyright (c) 2001-2003 Patrick Mochel <mochel@osdl.org> 5 * Copyright (c) 2004-2009 Greg Kroah-Hartman <gregkh@suse.de> 6 * Copyright (c) 2008-2009 Novell Inc. 7 * 8 * This file is released under the GPLv2 9 * 10 * See Documentation/driver-model/ for more information. 11 */ 12 13 #ifndef _DEVICE_H_ 14 #define _DEVICE_H_ 15 16 #include <linux/ioport.h> 17 #include <linux/kobject.h> 18 #include <linux/klist.h> 19 #include <linux/list.h> 20 #include <linux/lockdep.h> 21 #include <linux/compiler.h> 22 #include <linux/types.h> 23 #include <linux/mutex.h> 24 #include <linux/pinctrl/devinfo.h> 25 #include <linux/pm.h> 26 #include <linux/atomic.h> 27 #include <linux/ratelimit.h> 28 #include <linux/uidgid.h> 29 #include <linux/gfp.h> 30 #include <asm/device.h> 31 32 struct device; 33 struct device_private; 34 struct device_driver; 35 struct driver_private; 36 struct module; 37 struct class; 38 struct subsys_private; 39 struct bus_type; 40 struct device_node; 41 struct iommu_ops; 42 struct iommu_group; 43 44 struct bus_attribute { 45 struct attribute attr; 46 ssize_t (*show)(struct bus_type *bus, char *buf); 47 ssize_t (*store)(struct bus_type *bus, const char *buf, size_t count); 48 }; 49 50 #define BUS_ATTR(_name, _mode, _show, _store) \ 51 struct bus_attribute bus_attr_##_name = __ATTR(_name, _mode, _show, _store) 52 #define BUS_ATTR_RW(_name) \ 53 struct bus_attribute bus_attr_##_name = __ATTR_RW(_name) 54 #define BUS_ATTR_RO(_name) \ 55 struct bus_attribute bus_attr_##_name = __ATTR_RO(_name) 56 57 extern int __must_check bus_create_file(struct bus_type *, 58 struct bus_attribute *); 59 extern void bus_remove_file(struct bus_type *, struct bus_attribute *); 60 61 /** 62 * struct bus_type - The bus type of the device 63 * 64 * @name: The name of the bus. 65 * @dev_name: Used for subsystems to enumerate devices like ("foo%u", dev->id). 66 * @dev_root: Default device to use as the parent. 67 * @dev_attrs: Default attributes of the devices on the bus. 68 * @bus_groups: Default attributes of the bus. 69 * @dev_groups: Default attributes of the devices on the bus. 70 * @drv_groups: Default attributes of the device drivers on the bus. 71 * @match: Called, perhaps multiple times, whenever a new device or driver 72 * is added for this bus. It should return a nonzero value if the 73 * given device can be handled by the given driver. 74 * @uevent: Called when a device is added, removed, or a few other things 75 * that generate uevents to add the environment variables. 76 * @probe: Called when a new device or driver add to this bus, and callback 77 * the specific driver's probe to initial the matched device. 78 * @remove: Called when a device removed from this bus. 79 * @shutdown: Called at shut-down time to quiesce the device. 80 * 81 * @online: Called to put the device back online (after offlining it). 82 * @offline: Called to put the device offline for hot-removal. May fail. 83 * 84 * @suspend: Called when a device on this bus wants to go to sleep mode. 85 * @resume: Called to bring a device on this bus out of sleep mode. 86 * @pm: Power management operations of this bus, callback the specific 87 * device driver's pm-ops. 88 * @iommu_ops: IOMMU specific operations for this bus, used to attach IOMMU 89 * driver implementations to a bus and allow the driver to do 90 * bus-specific setup 91 * @p: The private data of the driver core, only the driver core can 92 * touch this. 93 * @lock_key: Lock class key for use by the lock validator 94 * 95 * A bus is a channel between the processor and one or more devices. For the 96 * purposes of the device model, all devices are connected via a bus, even if 97 * it is an internal, virtual, "platform" bus. Buses can plug into each other. 98 * A USB controller is usually a PCI device, for example. The device model 99 * represents the actual connections between buses and the devices they control. 100 * A bus is represented by the bus_type structure. It contains the name, the 101 * default attributes, the bus' methods, PM operations, and the driver core's 102 * private data. 103 */ 104 struct bus_type { 105 const char *name; 106 const char *dev_name; 107 struct device *dev_root; 108 struct device_attribute *dev_attrs; /* use dev_groups instead */ 109 const struct attribute_group **bus_groups; 110 const struct attribute_group **dev_groups; 111 const struct attribute_group **drv_groups; 112 113 int (*match)(struct device *dev, struct device_driver *drv); 114 int (*uevent)(struct device *dev, struct kobj_uevent_env *env); 115 int (*probe)(struct device *dev); 116 int (*remove)(struct device *dev); 117 void (*shutdown)(struct device *dev); 118 119 int (*online)(struct device *dev); 120 int (*offline)(struct device *dev); 121 122 int (*suspend)(struct device *dev, pm_message_t state); 123 int (*resume)(struct device *dev); 124 125 const struct dev_pm_ops *pm; 126 127 const struct iommu_ops *iommu_ops; 128 129 struct subsys_private *p; 130 struct lock_class_key lock_key; 131 }; 132 133 extern int __must_check bus_register(struct bus_type *bus); 134 135 extern void bus_unregister(struct bus_type *bus); 136 137 extern int __must_check bus_rescan_devices(struct bus_type *bus); 138 139 /* iterator helpers for buses */ 140 struct subsys_dev_iter { 141 struct klist_iter ki; 142 const struct device_type *type; 143 }; 144 void subsys_dev_iter_init(struct subsys_dev_iter *iter, 145 struct bus_type *subsys, 146 struct device *start, 147 const struct device_type *type); 148 struct device *subsys_dev_iter_next(struct subsys_dev_iter *iter); 149 void subsys_dev_iter_exit(struct subsys_dev_iter *iter); 150 151 int bus_for_each_dev(struct bus_type *bus, struct device *start, void *data, 152 int (*fn)(struct device *dev, void *data)); 153 struct device *bus_find_device(struct bus_type *bus, struct device *start, 154 void *data, 155 int (*match)(struct device *dev, void *data)); 156 struct device *bus_find_device_by_name(struct bus_type *bus, 157 struct device *start, 158 const char *name); 159 struct device *subsys_find_device_by_id(struct bus_type *bus, unsigned int id, 160 struct device *hint); 161 int bus_for_each_drv(struct bus_type *bus, struct device_driver *start, 162 void *data, int (*fn)(struct device_driver *, void *)); 163 void bus_sort_breadthfirst(struct bus_type *bus, 164 int (*compare)(const struct device *a, 165 const struct device *b)); 166 /* 167 * Bus notifiers: Get notified of addition/removal of devices 168 * and binding/unbinding of drivers to devices. 169 * In the long run, it should be a replacement for the platform 170 * notify hooks. 171 */ 172 struct notifier_block; 173 174 extern int bus_register_notifier(struct bus_type *bus, 175 struct notifier_block *nb); 176 extern int bus_unregister_notifier(struct bus_type *bus, 177 struct notifier_block *nb); 178 179 /* All 4 notifers below get called with the target struct device * 180 * as an argument. Note that those functions are likely to be called 181 * with the device lock held in the core, so be careful. 182 */ 183 #define BUS_NOTIFY_ADD_DEVICE 0x00000001 /* device added */ 184 #define BUS_NOTIFY_DEL_DEVICE 0x00000002 /* device removed */ 185 #define BUS_NOTIFY_BIND_DRIVER 0x00000003 /* driver about to be 186 bound */ 187 #define BUS_NOTIFY_BOUND_DRIVER 0x00000004 /* driver bound to device */ 188 #define BUS_NOTIFY_UNBIND_DRIVER 0x00000005 /* driver about to be 189 unbound */ 190 #define BUS_NOTIFY_UNBOUND_DRIVER 0x00000006 /* driver is unbound 191 from the device */ 192 193 extern struct kset *bus_get_kset(struct bus_type *bus); 194 extern struct klist *bus_get_device_klist(struct bus_type *bus); 195 196 /** 197 * struct device_driver - The basic device driver structure 198 * @name: Name of the device driver. 199 * @bus: The bus which the device of this driver belongs to. 200 * @owner: The module owner. 201 * @mod_name: Used for built-in modules. 202 * @suppress_bind_attrs: Disables bind/unbind via sysfs. 203 * @of_match_table: The open firmware table. 204 * @acpi_match_table: The ACPI match table. 205 * @probe: Called to query the existence of a specific device, 206 * whether this driver can work with it, and bind the driver 207 * to a specific device. 208 * @remove: Called when the device is removed from the system to 209 * unbind a device from this driver. 210 * @shutdown: Called at shut-down time to quiesce the device. 211 * @suspend: Called to put the device to sleep mode. Usually to a 212 * low power state. 213 * @resume: Called to bring a device from sleep mode. 214 * @groups: Default attributes that get created by the driver core 215 * automatically. 216 * @pm: Power management operations of the device which matched 217 * this driver. 218 * @p: Driver core's private data, no one other than the driver 219 * core can touch this. 220 * 221 * The device driver-model tracks all of the drivers known to the system. 222 * The main reason for this tracking is to enable the driver core to match 223 * up drivers with new devices. Once drivers are known objects within the 224 * system, however, a number of other things become possible. Device drivers 225 * can export information and configuration variables that are independent 226 * of any specific device. 227 */ 228 struct device_driver { 229 const char *name; 230 struct bus_type *bus; 231 232 struct module *owner; 233 const char *mod_name; /* used for built-in modules */ 234 235 bool suppress_bind_attrs; /* disables bind/unbind via sysfs */ 236 237 const struct of_device_id *of_match_table; 238 const struct acpi_device_id *acpi_match_table; 239 240 int (*probe) (struct device *dev); 241 int (*remove) (struct device *dev); 242 void (*shutdown) (struct device *dev); 243 int (*suspend) (struct device *dev, pm_message_t state); 244 int (*resume) (struct device *dev); 245 const struct attribute_group **groups; 246 247 const struct dev_pm_ops *pm; 248 249 struct driver_private *p; 250 }; 251 252 253 extern int __must_check driver_register(struct device_driver *drv); 254 extern void driver_unregister(struct device_driver *drv); 255 256 extern struct device_driver *driver_find(const char *name, 257 struct bus_type *bus); 258 extern int driver_probe_done(void); 259 extern void wait_for_device_probe(void); 260 261 262 /* sysfs interface for exporting driver attributes */ 263 264 struct driver_attribute { 265 struct attribute attr; 266 ssize_t (*show)(struct device_driver *driver, char *buf); 267 ssize_t (*store)(struct device_driver *driver, const char *buf, 268 size_t count); 269 }; 270 271 #define DRIVER_ATTR(_name, _mode, _show, _store) \ 272 struct driver_attribute driver_attr_##_name = __ATTR(_name, _mode, _show, _store) 273 #define DRIVER_ATTR_RW(_name) \ 274 struct driver_attribute driver_attr_##_name = __ATTR_RW(_name) 275 #define DRIVER_ATTR_RO(_name) \ 276 struct driver_attribute driver_attr_##_name = __ATTR_RO(_name) 277 #define DRIVER_ATTR_WO(_name) \ 278 struct driver_attribute driver_attr_##_name = __ATTR_WO(_name) 279 280 extern int __must_check driver_create_file(struct device_driver *driver, 281 const struct driver_attribute *attr); 282 extern void driver_remove_file(struct device_driver *driver, 283 const struct driver_attribute *attr); 284 285 extern int __must_check driver_for_each_device(struct device_driver *drv, 286 struct device *start, 287 void *data, 288 int (*fn)(struct device *dev, 289 void *)); 290 struct device *driver_find_device(struct device_driver *drv, 291 struct device *start, void *data, 292 int (*match)(struct device *dev, void *data)); 293 294 /** 295 * struct subsys_interface - interfaces to device functions 296 * @name: name of the device function 297 * @subsys: subsytem of the devices to attach to 298 * @node: the list of functions registered at the subsystem 299 * @add_dev: device hookup to device function handler 300 * @remove_dev: device hookup to device function handler 301 * 302 * Simple interfaces attached to a subsystem. Multiple interfaces can 303 * attach to a subsystem and its devices. Unlike drivers, they do not 304 * exclusively claim or control devices. Interfaces usually represent 305 * a specific functionality of a subsystem/class of devices. 306 */ 307 struct subsys_interface { 308 const char *name; 309 struct bus_type *subsys; 310 struct list_head node; 311 int (*add_dev)(struct device *dev, struct subsys_interface *sif); 312 int (*remove_dev)(struct device *dev, struct subsys_interface *sif); 313 }; 314 315 int subsys_interface_register(struct subsys_interface *sif); 316 void subsys_interface_unregister(struct subsys_interface *sif); 317 318 int subsys_system_register(struct bus_type *subsys, 319 const struct attribute_group **groups); 320 int subsys_virtual_register(struct bus_type *subsys, 321 const struct attribute_group **groups); 322 323 /** 324 * struct class - device classes 325 * @name: Name of the class. 326 * @owner: The module owner. 327 * @class_attrs: Default attributes of this class. 328 * @dev_groups: Default attributes of the devices that belong to the class. 329 * @dev_kobj: The kobject that represents this class and links it into the hierarchy. 330 * @dev_uevent: Called when a device is added, removed from this class, or a 331 * few other things that generate uevents to add the environment 332 * variables. 333 * @devnode: Callback to provide the devtmpfs. 334 * @class_release: Called to release this class. 335 * @dev_release: Called to release the device. 336 * @suspend: Used to put the device to sleep mode, usually to a low power 337 * state. 338 * @resume: Used to bring the device from the sleep mode. 339 * @ns_type: Callbacks so sysfs can detemine namespaces. 340 * @namespace: Namespace of the device belongs to this class. 341 * @pm: The default device power management operations of this class. 342 * @p: The private data of the driver core, no one other than the 343 * driver core can touch this. 344 * 345 * A class is a higher-level view of a device that abstracts out low-level 346 * implementation details. Drivers may see a SCSI disk or an ATA disk, but, 347 * at the class level, they are all simply disks. Classes allow user space 348 * to work with devices based on what they do, rather than how they are 349 * connected or how they work. 350 */ 351 struct class { 352 const char *name; 353 struct module *owner; 354 355 struct class_attribute *class_attrs; 356 const struct attribute_group **dev_groups; 357 struct kobject *dev_kobj; 358 359 int (*dev_uevent)(struct device *dev, struct kobj_uevent_env *env); 360 char *(*devnode)(struct device *dev, umode_t *mode); 361 362 void (*class_release)(struct class *class); 363 void (*dev_release)(struct device *dev); 364 365 int (*suspend)(struct device *dev, pm_message_t state); 366 int (*resume)(struct device *dev); 367 368 const struct kobj_ns_type_operations *ns_type; 369 const void *(*namespace)(struct device *dev); 370 371 const struct dev_pm_ops *pm; 372 373 struct subsys_private *p; 374 }; 375 376 struct class_dev_iter { 377 struct klist_iter ki; 378 const struct device_type *type; 379 }; 380 381 extern struct kobject *sysfs_dev_block_kobj; 382 extern struct kobject *sysfs_dev_char_kobj; 383 extern int __must_check __class_register(struct class *class, 384 struct lock_class_key *key); 385 extern void class_unregister(struct class *class); 386 387 /* This is a #define to keep the compiler from merging different 388 * instances of the __key variable */ 389 #define class_register(class) \ 390 ({ \ 391 static struct lock_class_key __key; \ 392 __class_register(class, &__key); \ 393 }) 394 395 struct class_compat; 396 struct class_compat *class_compat_register(const char *name); 397 void class_compat_unregister(struct class_compat *cls); 398 int class_compat_create_link(struct class_compat *cls, struct device *dev, 399 struct device *device_link); 400 void class_compat_remove_link(struct class_compat *cls, struct device *dev, 401 struct device *device_link); 402 403 extern void class_dev_iter_init(struct class_dev_iter *iter, 404 struct class *class, 405 struct device *start, 406 const struct device_type *type); 407 extern struct device *class_dev_iter_next(struct class_dev_iter *iter); 408 extern void class_dev_iter_exit(struct class_dev_iter *iter); 409 410 extern int class_for_each_device(struct class *class, struct device *start, 411 void *data, 412 int (*fn)(struct device *dev, void *data)); 413 extern struct device *class_find_device(struct class *class, 414 struct device *start, const void *data, 415 int (*match)(struct device *, const void *)); 416 417 struct class_attribute { 418 struct attribute attr; 419 ssize_t (*show)(struct class *class, struct class_attribute *attr, 420 char *buf); 421 ssize_t (*store)(struct class *class, struct class_attribute *attr, 422 const char *buf, size_t count); 423 }; 424 425 #define CLASS_ATTR(_name, _mode, _show, _store) \ 426 struct class_attribute class_attr_##_name = __ATTR(_name, _mode, _show, _store) 427 #define CLASS_ATTR_RW(_name) \ 428 struct class_attribute class_attr_##_name = __ATTR_RW(_name) 429 #define CLASS_ATTR_RO(_name) \ 430 struct class_attribute class_attr_##_name = __ATTR_RO(_name) 431 432 extern int __must_check class_create_file_ns(struct class *class, 433 const struct class_attribute *attr, 434 const void *ns); 435 extern void class_remove_file_ns(struct class *class, 436 const struct class_attribute *attr, 437 const void *ns); 438 439 static inline int __must_check class_create_file(struct class *class, 440 const struct class_attribute *attr) 441 { 442 return class_create_file_ns(class, attr, NULL); 443 } 444 445 static inline void class_remove_file(struct class *class, 446 const struct class_attribute *attr) 447 { 448 return class_remove_file_ns(class, attr, NULL); 449 } 450 451 /* Simple class attribute that is just a static string */ 452 struct class_attribute_string { 453 struct class_attribute attr; 454 char *str; 455 }; 456 457 /* Currently read-only only */ 458 #define _CLASS_ATTR_STRING(_name, _mode, _str) \ 459 { __ATTR(_name, _mode, show_class_attr_string, NULL), _str } 460 #define CLASS_ATTR_STRING(_name, _mode, _str) \ 461 struct class_attribute_string class_attr_##_name = \ 462 _CLASS_ATTR_STRING(_name, _mode, _str) 463 464 extern ssize_t show_class_attr_string(struct class *class, struct class_attribute *attr, 465 char *buf); 466 467 struct class_interface { 468 struct list_head node; 469 struct class *class; 470 471 int (*add_dev) (struct device *, struct class_interface *); 472 void (*remove_dev) (struct device *, struct class_interface *); 473 }; 474 475 extern int __must_check class_interface_register(struct class_interface *); 476 extern void class_interface_unregister(struct class_interface *); 477 478 extern struct class * __must_check __class_create(struct module *owner, 479 const char *name, 480 struct lock_class_key *key); 481 extern void class_destroy(struct class *cls); 482 483 /* This is a #define to keep the compiler from merging different 484 * instances of the __key variable */ 485 #define class_create(owner, name) \ 486 ({ \ 487 static struct lock_class_key __key; \ 488 __class_create(owner, name, &__key); \ 489 }) 490 491 /* 492 * The type of device, "struct device" is embedded in. A class 493 * or bus can contain devices of different types 494 * like "partitions" and "disks", "mouse" and "event". 495 * This identifies the device type and carries type-specific 496 * information, equivalent to the kobj_type of a kobject. 497 * If "name" is specified, the uevent will contain it in 498 * the DEVTYPE variable. 499 */ 500 struct device_type { 501 const char *name; 502 const struct attribute_group **groups; 503 int (*uevent)(struct device *dev, struct kobj_uevent_env *env); 504 char *(*devnode)(struct device *dev, umode_t *mode, 505 kuid_t *uid, kgid_t *gid); 506 void (*release)(struct device *dev); 507 508 const struct dev_pm_ops *pm; 509 }; 510 511 /* interface for exporting device attributes */ 512 struct device_attribute { 513 struct attribute attr; 514 ssize_t (*show)(struct device *dev, struct device_attribute *attr, 515 char *buf); 516 ssize_t (*store)(struct device *dev, struct device_attribute *attr, 517 const char *buf, size_t count); 518 }; 519 520 struct dev_ext_attribute { 521 struct device_attribute attr; 522 void *var; 523 }; 524 525 ssize_t device_show_ulong(struct device *dev, struct device_attribute *attr, 526 char *buf); 527 ssize_t device_store_ulong(struct device *dev, struct device_attribute *attr, 528 const char *buf, size_t count); 529 ssize_t device_show_int(struct device *dev, struct device_attribute *attr, 530 char *buf); 531 ssize_t device_store_int(struct device *dev, struct device_attribute *attr, 532 const char *buf, size_t count); 533 ssize_t device_show_bool(struct device *dev, struct device_attribute *attr, 534 char *buf); 535 ssize_t device_store_bool(struct device *dev, struct device_attribute *attr, 536 const char *buf, size_t count); 537 538 #define DEVICE_ATTR(_name, _mode, _show, _store) \ 539 struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store) 540 #define DEVICE_ATTR_RW(_name) \ 541 struct device_attribute dev_attr_##_name = __ATTR_RW(_name) 542 #define DEVICE_ATTR_RO(_name) \ 543 struct device_attribute dev_attr_##_name = __ATTR_RO(_name) 544 #define DEVICE_ATTR_WO(_name) \ 545 struct device_attribute dev_attr_##_name = __ATTR_WO(_name) 546 #define DEVICE_ULONG_ATTR(_name, _mode, _var) \ 547 struct dev_ext_attribute dev_attr_##_name = \ 548 { __ATTR(_name, _mode, device_show_ulong, device_store_ulong), &(_var) } 549 #define DEVICE_INT_ATTR(_name, _mode, _var) \ 550 struct dev_ext_attribute dev_attr_##_name = \ 551 { __ATTR(_name, _mode, device_show_int, device_store_int), &(_var) } 552 #define DEVICE_BOOL_ATTR(_name, _mode, _var) \ 553 struct dev_ext_attribute dev_attr_##_name = \ 554 { __ATTR(_name, _mode, device_show_bool, device_store_bool), &(_var) } 555 #define DEVICE_ATTR_IGNORE_LOCKDEP(_name, _mode, _show, _store) \ 556 struct device_attribute dev_attr_##_name = \ 557 __ATTR_IGNORE_LOCKDEP(_name, _mode, _show, _store) 558 559 extern int device_create_file(struct device *device, 560 const struct device_attribute *entry); 561 extern void device_remove_file(struct device *dev, 562 const struct device_attribute *attr); 563 extern bool device_remove_file_self(struct device *dev, 564 const struct device_attribute *attr); 565 extern int __must_check device_create_bin_file(struct device *dev, 566 const struct bin_attribute *attr); 567 extern void device_remove_bin_file(struct device *dev, 568 const struct bin_attribute *attr); 569 570 /* device resource management */ 571 typedef void (*dr_release_t)(struct device *dev, void *res); 572 typedef int (*dr_match_t)(struct device *dev, void *res, void *match_data); 573 574 #ifdef CONFIG_DEBUG_DEVRES 575 extern void *__devres_alloc(dr_release_t release, size_t size, gfp_t gfp, 576 const char *name); 577 #define devres_alloc(release, size, gfp) \ 578 __devres_alloc(release, size, gfp, #release) 579 #else 580 extern void *devres_alloc(dr_release_t release, size_t size, gfp_t gfp); 581 #endif 582 extern void devres_for_each_res(struct device *dev, dr_release_t release, 583 dr_match_t match, void *match_data, 584 void (*fn)(struct device *, void *, void *), 585 void *data); 586 extern void devres_free(void *res); 587 extern void devres_add(struct device *dev, void *res); 588 extern void *devres_find(struct device *dev, dr_release_t release, 589 dr_match_t match, void *match_data); 590 extern void *devres_get(struct device *dev, void *new_res, 591 dr_match_t match, void *match_data); 592 extern void *devres_remove(struct device *dev, dr_release_t release, 593 dr_match_t match, void *match_data); 594 extern int devres_destroy(struct device *dev, dr_release_t release, 595 dr_match_t match, void *match_data); 596 extern int devres_release(struct device *dev, dr_release_t release, 597 dr_match_t match, void *match_data); 598 599 /* devres group */ 600 extern void * __must_check devres_open_group(struct device *dev, void *id, 601 gfp_t gfp); 602 extern void devres_close_group(struct device *dev, void *id); 603 extern void devres_remove_group(struct device *dev, void *id); 604 extern int devres_release_group(struct device *dev, void *id); 605 606 /* managed devm_k.alloc/kfree for device drivers */ 607 extern void *devm_kmalloc(struct device *dev, size_t size, gfp_t gfp); 608 extern char *devm_kvasprintf(struct device *dev, gfp_t gfp, const char *fmt, 609 va_list ap); 610 extern char *devm_kasprintf(struct device *dev, gfp_t gfp, 611 const char *fmt, ...); 612 static inline void *devm_kzalloc(struct device *dev, size_t size, gfp_t gfp) 613 { 614 return devm_kmalloc(dev, size, gfp | __GFP_ZERO); 615 } 616 static inline void *devm_kmalloc_array(struct device *dev, 617 size_t n, size_t size, gfp_t flags) 618 { 619 if (size != 0 && n > SIZE_MAX / size) 620 return NULL; 621 return devm_kmalloc(dev, n * size, flags); 622 } 623 static inline void *devm_kcalloc(struct device *dev, 624 size_t n, size_t size, gfp_t flags) 625 { 626 return devm_kmalloc_array(dev, n, size, flags | __GFP_ZERO); 627 } 628 extern void devm_kfree(struct device *dev, void *p); 629 extern char *devm_kstrdup(struct device *dev, const char *s, gfp_t gfp); 630 extern void *devm_kmemdup(struct device *dev, const void *src, size_t len, 631 gfp_t gfp); 632 633 extern unsigned long devm_get_free_pages(struct device *dev, 634 gfp_t gfp_mask, unsigned int order); 635 extern void devm_free_pages(struct device *dev, unsigned long addr); 636 637 void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res); 638 639 /* allows to add/remove a custom action to devres stack */ 640 int devm_add_action(struct device *dev, void (*action)(void *), void *data); 641 void devm_remove_action(struct device *dev, void (*action)(void *), void *data); 642 643 struct device_dma_parameters { 644 /* 645 * a low level driver may set these to teach IOMMU code about 646 * sg limitations. 647 */ 648 unsigned int max_segment_size; 649 unsigned long segment_boundary_mask; 650 }; 651 652 struct acpi_device; 653 654 struct acpi_dev_node { 655 #ifdef CONFIG_ACPI 656 struct acpi_device *companion; 657 #endif 658 }; 659 660 /** 661 * struct device - The basic device structure 662 * @parent: The device's "parent" device, the device to which it is attached. 663 * In most cases, a parent device is some sort of bus or host 664 * controller. If parent is NULL, the device, is a top-level device, 665 * which is not usually what you want. 666 * @p: Holds the private data of the driver core portions of the device. 667 * See the comment of the struct device_private for detail. 668 * @kobj: A top-level, abstract class from which other classes are derived. 669 * @init_name: Initial name of the device. 670 * @type: The type of device. 671 * This identifies the device type and carries type-specific 672 * information. 673 * @mutex: Mutex to synchronize calls to its driver. 674 * @bus: Type of bus device is on. 675 * @driver: Which driver has allocated this 676 * @platform_data: Platform data specific to the device. 677 * Example: For devices on custom boards, as typical of embedded 678 * and SOC based hardware, Linux often uses platform_data to point 679 * to board-specific structures describing devices and how they 680 * are wired. That can include what ports are available, chip 681 * variants, which GPIO pins act in what additional roles, and so 682 * on. This shrinks the "Board Support Packages" (BSPs) and 683 * minimizes board-specific #ifdefs in drivers. 684 * @driver_data: Private pointer for driver specific info. 685 * @power: For device power management. 686 * See Documentation/power/devices.txt for details. 687 * @pm_domain: Provide callbacks that are executed during system suspend, 688 * hibernation, system resume and during runtime PM transitions 689 * along with subsystem-level and driver-level callbacks. 690 * @pins: For device pin management. 691 * See Documentation/pinctrl.txt for details. 692 * @numa_node: NUMA node this device is close to. 693 * @dma_mask: Dma mask (if dma'ble device). 694 * @coherent_dma_mask: Like dma_mask, but for alloc_coherent mapping as not all 695 * hardware supports 64-bit addresses for consistent allocations 696 * such descriptors. 697 * @dma_pfn_offset: offset of DMA memory range relatively of RAM 698 * @dma_parms: A low level driver may set these to teach IOMMU code about 699 * segment limitations. 700 * @dma_pools: Dma pools (if dma'ble device). 701 * @dma_mem: Internal for coherent mem override. 702 * @cma_area: Contiguous memory area for dma allocations 703 * @archdata: For arch-specific additions. 704 * @of_node: Associated device tree node. 705 * @acpi_node: Associated ACPI device node. 706 * @devt: For creating the sysfs "dev". 707 * @id: device instance 708 * @devres_lock: Spinlock to protect the resource of the device. 709 * @devres_head: The resources list of the device. 710 * @knode_class: The node used to add the device to the class list. 711 * @class: The class of the device. 712 * @groups: Optional attribute groups. 713 * @release: Callback to free the device after all references have 714 * gone away. This should be set by the allocator of the 715 * device (i.e. the bus driver that discovered the device). 716 * @iommu_group: IOMMU group the device belongs to. 717 * 718 * @offline_disabled: If set, the device is permanently online. 719 * @offline: Set after successful invocation of bus type's .offline(). 720 * 721 * At the lowest level, every device in a Linux system is represented by an 722 * instance of struct device. The device structure contains the information 723 * that the device model core needs to model the system. Most subsystems, 724 * however, track additional information about the devices they host. As a 725 * result, it is rare for devices to be represented by bare device structures; 726 * instead, that structure, like kobject structures, is usually embedded within 727 * a higher-level representation of the device. 728 */ 729 struct device { 730 struct device *parent; 731 732 struct device_private *p; 733 734 struct kobject kobj; 735 const char *init_name; /* initial name of the device */ 736 const struct device_type *type; 737 738 struct mutex mutex; /* mutex to synchronize calls to 739 * its driver. 740 */ 741 742 struct bus_type *bus; /* type of bus device is on */ 743 struct device_driver *driver; /* which driver has allocated this 744 device */ 745 void *platform_data; /* Platform specific data, device 746 core doesn't touch it */ 747 void *driver_data; /* Driver data, set and get with 748 dev_set/get_drvdata */ 749 struct dev_pm_info power; 750 struct dev_pm_domain *pm_domain; 751 752 #ifdef CONFIG_PINCTRL 753 struct dev_pin_info *pins; 754 #endif 755 756 #ifdef CONFIG_NUMA 757 int numa_node; /* NUMA node this device is close to */ 758 #endif 759 u64 *dma_mask; /* dma mask (if dma'able device) */ 760 u64 coherent_dma_mask;/* Like dma_mask, but for 761 alloc_coherent mappings as 762 not all hardware supports 763 64 bit addresses for consistent 764 allocations such descriptors. */ 765 unsigned long dma_pfn_offset; 766 767 struct device_dma_parameters *dma_parms; 768 769 struct list_head dma_pools; /* dma pools (if dma'ble) */ 770 771 struct dma_coherent_mem *dma_mem; /* internal for coherent mem 772 override */ 773 #ifdef CONFIG_DMA_CMA 774 struct cma *cma_area; /* contiguous memory area for dma 775 allocations */ 776 #endif 777 /* arch specific additions */ 778 struct dev_archdata archdata; 779 780 struct device_node *of_node; /* associated device tree node */ 781 struct acpi_dev_node acpi_node; /* associated ACPI device node */ 782 783 dev_t devt; /* dev_t, creates the sysfs "dev" */ 784 u32 id; /* device instance */ 785 786 spinlock_t devres_lock; 787 struct list_head devres_head; 788 789 struct klist_node knode_class; 790 struct class *class; 791 const struct attribute_group **groups; /* optional groups */ 792 793 void (*release)(struct device *dev); 794 struct iommu_group *iommu_group; 795 796 bool offline_disabled:1; 797 bool offline:1; 798 }; 799 800 static inline struct device *kobj_to_dev(struct kobject *kobj) 801 { 802 return container_of(kobj, struct device, kobj); 803 } 804 805 /* Get the wakeup routines, which depend on struct device */ 806 #include <linux/pm_wakeup.h> 807 808 static inline const char *dev_name(const struct device *dev) 809 { 810 /* Use the init name until the kobject becomes available */ 811 if (dev->init_name) 812 return dev->init_name; 813 814 return kobject_name(&dev->kobj); 815 } 816 817 extern __printf(2, 3) 818 int dev_set_name(struct device *dev, const char *name, ...); 819 820 #ifdef CONFIG_NUMA 821 static inline int dev_to_node(struct device *dev) 822 { 823 return dev->numa_node; 824 } 825 static inline void set_dev_node(struct device *dev, int node) 826 { 827 dev->numa_node = node; 828 } 829 #else 830 static inline int dev_to_node(struct device *dev) 831 { 832 return -1; 833 } 834 static inline void set_dev_node(struct device *dev, int node) 835 { 836 } 837 #endif 838 839 static inline void *dev_get_drvdata(const struct device *dev) 840 { 841 return dev->driver_data; 842 } 843 844 static inline void dev_set_drvdata(struct device *dev, void *data) 845 { 846 dev->driver_data = data; 847 } 848 849 static inline struct pm_subsys_data *dev_to_psd(struct device *dev) 850 { 851 return dev ? dev->power.subsys_data : NULL; 852 } 853 854 static inline unsigned int dev_get_uevent_suppress(const struct device *dev) 855 { 856 return dev->kobj.uevent_suppress; 857 } 858 859 static inline void dev_set_uevent_suppress(struct device *dev, int val) 860 { 861 dev->kobj.uevent_suppress = val; 862 } 863 864 static inline int device_is_registered(struct device *dev) 865 { 866 return dev->kobj.state_in_sysfs; 867 } 868 869 static inline void device_enable_async_suspend(struct device *dev) 870 { 871 if (!dev->power.is_prepared) 872 dev->power.async_suspend = true; 873 } 874 875 static inline void device_disable_async_suspend(struct device *dev) 876 { 877 if (!dev->power.is_prepared) 878 dev->power.async_suspend = false; 879 } 880 881 static inline bool device_async_suspend_enabled(struct device *dev) 882 { 883 return !!dev->power.async_suspend; 884 } 885 886 static inline void pm_suspend_ignore_children(struct device *dev, bool enable) 887 { 888 dev->power.ignore_children = enable; 889 } 890 891 static inline void dev_pm_syscore_device(struct device *dev, bool val) 892 { 893 #ifdef CONFIG_PM_SLEEP 894 dev->power.syscore = val; 895 #endif 896 } 897 898 static inline void device_lock(struct device *dev) 899 { 900 mutex_lock(&dev->mutex); 901 } 902 903 static inline int device_trylock(struct device *dev) 904 { 905 return mutex_trylock(&dev->mutex); 906 } 907 908 static inline void device_unlock(struct device *dev) 909 { 910 mutex_unlock(&dev->mutex); 911 } 912 913 void driver_init(void); 914 915 /* 916 * High level routines for use by the bus drivers 917 */ 918 extern int __must_check device_register(struct device *dev); 919 extern void device_unregister(struct device *dev); 920 extern void device_initialize(struct device *dev); 921 extern int __must_check device_add(struct device *dev); 922 extern void device_del(struct device *dev); 923 extern int device_for_each_child(struct device *dev, void *data, 924 int (*fn)(struct device *dev, void *data)); 925 extern struct device *device_find_child(struct device *dev, void *data, 926 int (*match)(struct device *dev, void *data)); 927 extern int device_rename(struct device *dev, const char *new_name); 928 extern int device_move(struct device *dev, struct device *new_parent, 929 enum dpm_order dpm_order); 930 extern const char *device_get_devnode(struct device *dev, 931 umode_t *mode, kuid_t *uid, kgid_t *gid, 932 const char **tmp); 933 934 static inline bool device_supports_offline(struct device *dev) 935 { 936 return dev->bus && dev->bus->offline && dev->bus->online; 937 } 938 939 extern void lock_device_hotplug(void); 940 extern void unlock_device_hotplug(void); 941 extern int lock_device_hotplug_sysfs(void); 942 extern int device_offline(struct device *dev); 943 extern int device_online(struct device *dev); 944 /* 945 * Root device objects for grouping under /sys/devices 946 */ 947 extern struct device *__root_device_register(const char *name, 948 struct module *owner); 949 950 /* This is a macro to avoid include problems with THIS_MODULE */ 951 #define root_device_register(name) \ 952 __root_device_register(name, THIS_MODULE) 953 954 extern void root_device_unregister(struct device *root); 955 956 static inline void *dev_get_platdata(const struct device *dev) 957 { 958 return dev->platform_data; 959 } 960 961 /* 962 * Manual binding of a device to driver. See drivers/base/bus.c 963 * for information on use. 964 */ 965 extern int __must_check device_bind_driver(struct device *dev); 966 extern void device_release_driver(struct device *dev); 967 extern int __must_check device_attach(struct device *dev); 968 extern int __must_check driver_attach(struct device_driver *drv); 969 extern int __must_check device_reprobe(struct device *dev); 970 971 /* 972 * Easy functions for dynamically creating devices on the fly 973 */ 974 extern struct device *device_create_vargs(struct class *cls, 975 struct device *parent, 976 dev_t devt, 977 void *drvdata, 978 const char *fmt, 979 va_list vargs); 980 extern __printf(5, 6) 981 struct device *device_create(struct class *cls, struct device *parent, 982 dev_t devt, void *drvdata, 983 const char *fmt, ...); 984 extern __printf(6, 7) 985 struct device *device_create_with_groups(struct class *cls, 986 struct device *parent, dev_t devt, void *drvdata, 987 const struct attribute_group **groups, 988 const char *fmt, ...); 989 extern void device_destroy(struct class *cls, dev_t devt); 990 991 /* 992 * Platform "fixup" functions - allow the platform to have their say 993 * about devices and actions that the general device layer doesn't 994 * know about. 995 */ 996 /* Notify platform of device discovery */ 997 extern int (*platform_notify)(struct device *dev); 998 999 extern int (*platform_notify_remove)(struct device *dev); 1000 1001 1002 /* 1003 * get_device - atomically increment the reference count for the device. 1004 * 1005 */ 1006 extern struct device *get_device(struct device *dev); 1007 extern void put_device(struct device *dev); 1008 1009 #ifdef CONFIG_DEVTMPFS 1010 extern int devtmpfs_create_node(struct device *dev); 1011 extern int devtmpfs_delete_node(struct device *dev); 1012 extern int devtmpfs_mount(const char *mntdir); 1013 #else 1014 static inline int devtmpfs_create_node(struct device *dev) { return 0; } 1015 static inline int devtmpfs_delete_node(struct device *dev) { return 0; } 1016 static inline int devtmpfs_mount(const char *mountpoint) { return 0; } 1017 #endif 1018 1019 /* drivers/base/power/shutdown.c */ 1020 extern void device_shutdown(void); 1021 1022 /* debugging and troubleshooting/diagnostic helpers. */ 1023 extern const char *dev_driver_string(const struct device *dev); 1024 1025 1026 #ifdef CONFIG_PRINTK 1027 1028 extern __printf(3, 0) 1029 int dev_vprintk_emit(int level, const struct device *dev, 1030 const char *fmt, va_list args); 1031 extern __printf(3, 4) 1032 int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...); 1033 1034 extern __printf(3, 4) 1035 int dev_printk(const char *level, const struct device *dev, 1036 const char *fmt, ...); 1037 extern __printf(2, 3) 1038 int dev_emerg(const struct device *dev, const char *fmt, ...); 1039 extern __printf(2, 3) 1040 int dev_alert(const struct device *dev, const char *fmt, ...); 1041 extern __printf(2, 3) 1042 int dev_crit(const struct device *dev, const char *fmt, ...); 1043 extern __printf(2, 3) 1044 int dev_err(const struct device *dev, const char *fmt, ...); 1045 extern __printf(2, 3) 1046 int dev_warn(const struct device *dev, const char *fmt, ...); 1047 extern __printf(2, 3) 1048 int dev_notice(const struct device *dev, const char *fmt, ...); 1049 extern __printf(2, 3) 1050 int _dev_info(const struct device *dev, const char *fmt, ...); 1051 1052 #else 1053 1054 static inline __printf(3, 0) 1055 int dev_vprintk_emit(int level, const struct device *dev, 1056 const char *fmt, va_list args) 1057 { return 0; } 1058 static inline __printf(3, 4) 1059 int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...) 1060 { return 0; } 1061 1062 static inline int __dev_printk(const char *level, const struct device *dev, 1063 struct va_format *vaf) 1064 { return 0; } 1065 static inline __printf(3, 4) 1066 int dev_printk(const char *level, const struct device *dev, 1067 const char *fmt, ...) 1068 { return 0; } 1069 1070 static inline __printf(2, 3) 1071 int dev_emerg(const struct device *dev, const char *fmt, ...) 1072 { return 0; } 1073 static inline __printf(2, 3) 1074 int dev_crit(const struct device *dev, const char *fmt, ...) 1075 { return 0; } 1076 static inline __printf(2, 3) 1077 int dev_alert(const struct device *dev, const char *fmt, ...) 1078 { return 0; } 1079 static inline __printf(2, 3) 1080 int dev_err(const struct device *dev, const char *fmt, ...) 1081 { return 0; } 1082 static inline __printf(2, 3) 1083 int dev_warn(const struct device *dev, const char *fmt, ...) 1084 { return 0; } 1085 static inline __printf(2, 3) 1086 int dev_notice(const struct device *dev, const char *fmt, ...) 1087 { return 0; } 1088 static inline __printf(2, 3) 1089 int _dev_info(const struct device *dev, const char *fmt, ...) 1090 { return 0; } 1091 1092 #endif 1093 1094 /* 1095 * Stupid hackaround for existing uses of non-printk uses dev_info 1096 * 1097 * Note that the definition of dev_info below is actually _dev_info 1098 * and a macro is used to avoid redefining dev_info 1099 */ 1100 1101 #define dev_info(dev, fmt, arg...) _dev_info(dev, fmt, ##arg) 1102 1103 #if defined(CONFIG_DYNAMIC_DEBUG) 1104 #define dev_dbg(dev, format, ...) \ 1105 do { \ 1106 dynamic_dev_dbg(dev, format, ##__VA_ARGS__); \ 1107 } while (0) 1108 #elif defined(DEBUG) 1109 #define dev_dbg(dev, format, arg...) \ 1110 dev_printk(KERN_DEBUG, dev, format, ##arg) 1111 #else 1112 #define dev_dbg(dev, format, arg...) \ 1113 ({ \ 1114 if (0) \ 1115 dev_printk(KERN_DEBUG, dev, format, ##arg); \ 1116 0; \ 1117 }) 1118 #endif 1119 1120 #define dev_level_ratelimited(dev_level, dev, fmt, ...) \ 1121 do { \ 1122 static DEFINE_RATELIMIT_STATE(_rs, \ 1123 DEFAULT_RATELIMIT_INTERVAL, \ 1124 DEFAULT_RATELIMIT_BURST); \ 1125 if (__ratelimit(&_rs)) \ 1126 dev_level(dev, fmt, ##__VA_ARGS__); \ 1127 } while (0) 1128 1129 #define dev_emerg_ratelimited(dev, fmt, ...) \ 1130 dev_level_ratelimited(dev_emerg, dev, fmt, ##__VA_ARGS__) 1131 #define dev_alert_ratelimited(dev, fmt, ...) \ 1132 dev_level_ratelimited(dev_alert, dev, fmt, ##__VA_ARGS__) 1133 #define dev_crit_ratelimited(dev, fmt, ...) \ 1134 dev_level_ratelimited(dev_crit, dev, fmt, ##__VA_ARGS__) 1135 #define dev_err_ratelimited(dev, fmt, ...) \ 1136 dev_level_ratelimited(dev_err, dev, fmt, ##__VA_ARGS__) 1137 #define dev_warn_ratelimited(dev, fmt, ...) \ 1138 dev_level_ratelimited(dev_warn, dev, fmt, ##__VA_ARGS__) 1139 #define dev_notice_ratelimited(dev, fmt, ...) \ 1140 dev_level_ratelimited(dev_notice, dev, fmt, ##__VA_ARGS__) 1141 #define dev_info_ratelimited(dev, fmt, ...) \ 1142 dev_level_ratelimited(dev_info, dev, fmt, ##__VA_ARGS__) 1143 #if defined(CONFIG_DYNAMIC_DEBUG) 1144 /* descriptor check is first to prevent flooding with "callbacks suppressed" */ 1145 #define dev_dbg_ratelimited(dev, fmt, ...) \ 1146 do { \ 1147 static DEFINE_RATELIMIT_STATE(_rs, \ 1148 DEFAULT_RATELIMIT_INTERVAL, \ 1149 DEFAULT_RATELIMIT_BURST); \ 1150 DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \ 1151 if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT) && \ 1152 __ratelimit(&_rs)) \ 1153 __dynamic_dev_dbg(&descriptor, dev, fmt, \ 1154 ##__VA_ARGS__); \ 1155 } while (0) 1156 #elif defined(DEBUG) 1157 #define dev_dbg_ratelimited(dev, fmt, ...) \ 1158 do { \ 1159 static DEFINE_RATELIMIT_STATE(_rs, \ 1160 DEFAULT_RATELIMIT_INTERVAL, \ 1161 DEFAULT_RATELIMIT_BURST); \ 1162 if (__ratelimit(&_rs)) \ 1163 dev_printk(KERN_DEBUG, dev, fmt, ##__VA_ARGS__); \ 1164 } while (0) 1165 #else 1166 #define dev_dbg_ratelimited(dev, fmt, ...) \ 1167 no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) 1168 #endif 1169 1170 #ifdef VERBOSE_DEBUG 1171 #define dev_vdbg dev_dbg 1172 #else 1173 #define dev_vdbg(dev, format, arg...) \ 1174 ({ \ 1175 if (0) \ 1176 dev_printk(KERN_DEBUG, dev, format, ##arg); \ 1177 0; \ 1178 }) 1179 #endif 1180 1181 /* 1182 * dev_WARN*() acts like dev_printk(), but with the key difference of 1183 * using WARN/WARN_ONCE to include file/line information and a backtrace. 1184 */ 1185 #define dev_WARN(dev, format, arg...) \ 1186 WARN(1, "%s %s: " format, dev_driver_string(dev), dev_name(dev), ## arg); 1187 1188 #define dev_WARN_ONCE(dev, condition, format, arg...) \ 1189 WARN_ONCE(condition, "%s %s: " format, \ 1190 dev_driver_string(dev), dev_name(dev), ## arg) 1191 1192 /* Create alias, so I can be autoloaded. */ 1193 #define MODULE_ALIAS_CHARDEV(major,minor) \ 1194 MODULE_ALIAS("char-major-" __stringify(major) "-" __stringify(minor)) 1195 #define MODULE_ALIAS_CHARDEV_MAJOR(major) \ 1196 MODULE_ALIAS("char-major-" __stringify(major) "-*") 1197 1198 #ifdef CONFIG_SYSFS_DEPRECATED 1199 extern long sysfs_deprecated; 1200 #else 1201 #define sysfs_deprecated 0 1202 #endif 1203 1204 /** 1205 * module_driver() - Helper macro for drivers that don't do anything 1206 * special in module init/exit. This eliminates a lot of boilerplate. 1207 * Each module may only use this macro once, and calling it replaces 1208 * module_init() and module_exit(). 1209 * 1210 * @__driver: driver name 1211 * @__register: register function for this driver type 1212 * @__unregister: unregister function for this driver type 1213 * @...: Additional arguments to be passed to __register and __unregister. 1214 * 1215 * Use this macro to construct bus specific macros for registering 1216 * drivers, and do not use it on its own. 1217 */ 1218 #define module_driver(__driver, __register, __unregister, ...) \ 1219 static int __init __driver##_init(void) \ 1220 { \ 1221 return __register(&(__driver) , ##__VA_ARGS__); \ 1222 } \ 1223 module_init(__driver##_init); \ 1224 static void __exit __driver##_exit(void) \ 1225 { \ 1226 __unregister(&(__driver) , ##__VA_ARGS__); \ 1227 } \ 1228 module_exit(__driver##_exit); 1229 1230 #endif /* _DEVICE_H_ */
1 /* 2 * kobject.h - generic kernel object infrastructure. 3 * 4 * Copyright (c) 2002-2003 Patrick Mochel 5 * Copyright (c) 2002-2003 Open Source Development Labs 6 * Copyright (c) 2006-2008 Greg Kroah-Hartman <greg@kroah.com> 7 * Copyright (c) 2006-2008 Novell Inc. 8 * 9 * This file is released under the GPLv2. 10 * 11 * Please read Documentation/kobject.txt before using the kobject 12 * interface, ESPECIALLY the parts about reference counts and object 13 * destructors. 14 */ 15 16 #ifndef _KOBJECT_H_ 17 #define _KOBJECT_H_ 18 19 #include <linux/types.h> 20 #include <linux/list.h> 21 #include <linux/sysfs.h> 22 #include <linux/compiler.h> 23 #include <linux/spinlock.h> 24 #include <linux/kref.h> 25 #include <linux/kobject_ns.h> 26 #include <linux/kernel.h> 27 #include <linux/wait.h> 28 #include <linux/atomic.h> 29 #include <linux/workqueue.h> 30 31 #define UEVENT_HELPER_PATH_LEN 256 32 #define UEVENT_NUM_ENVP 32 /* number of env pointers */ 33 #define UEVENT_BUFFER_SIZE 2048 /* buffer for the variables */ 34 35 #ifdef CONFIG_UEVENT_HELPER 36 /* path to the userspace helper executed on an event */ 37 extern char uevent_helper[]; 38 #endif 39 40 /* counter to tag the uevent, read only except for the kobject core */ 41 extern u64 uevent_seqnum; 42 43 /* 44 * The actions here must match the index to the string array 45 * in lib/kobject_uevent.c 46 * 47 * Do not add new actions here without checking with the driver-core 48 * maintainers. Action strings are not meant to express subsystem 49 * or device specific properties. In most cases you want to send a 50 * kobject_uevent_env(kobj, KOBJ_CHANGE, env) with additional event 51 * specific variables added to the event environment. 52 */ 53 enum kobject_action { 54 KOBJ_ADD, 55 KOBJ_REMOVE, 56 KOBJ_CHANGE, 57 KOBJ_MOVE, 58 KOBJ_ONLINE, 59 KOBJ_OFFLINE, 60 KOBJ_MAX 61 }; 62 63 struct kobject { 64 const char *name; 65 struct list_head entry; 66 struct kobject *parent; 67 struct kset *kset; 68 struct kobj_type *ktype; 69 struct kernfs_node *sd; 70 struct kref kref; 71 #ifdef CONFIG_DEBUG_KOBJECT_RELEASE 72 struct delayed_work release; 73 #endif 74 unsigned int state_initialized:1; 75 unsigned int state_in_sysfs:1; 76 unsigned int state_add_uevent_sent:1; 77 unsigned int state_remove_uevent_sent:1; 78 unsigned int uevent_suppress:1; 79 }; 80 81 extern __printf(2, 3) 82 int kobject_set_name(struct kobject *kobj, const char *name, ...); 83 extern int kobject_set_name_vargs(struct kobject *kobj, const char *fmt, 84 va_list vargs); 85 86 static inline const char *kobject_name(const struct kobject *kobj) 87 { 88 return kobj->name; 89 } 90 91 extern void kobject_init(struct kobject *kobj, struct kobj_type *ktype); 92 extern __printf(3, 4) __must_check 93 int kobject_add(struct kobject *kobj, struct kobject *parent, 94 const char *fmt, ...); 95 extern __printf(4, 5) __must_check 96 int kobject_init_and_add(struct kobject *kobj, 97 struct kobj_type *ktype, struct kobject *parent, 98 const char *fmt, ...); 99 100 extern void kobject_del(struct kobject *kobj); 101 102 extern struct kobject * __must_check kobject_create(void); 103 extern struct kobject * __must_check kobject_create_and_add(const char *name, 104 struct kobject *parent); 105 106 extern int __must_check kobject_rename(struct kobject *, const char *new_name); 107 extern int __must_check kobject_move(struct kobject *, struct kobject *); 108 109 extern struct kobject *kobject_get(struct kobject *kobj); 110 extern void kobject_put(struct kobject *kobj); 111 112 extern const void *kobject_namespace(struct kobject *kobj); 113 extern char *kobject_get_path(struct kobject *kobj, gfp_t flag); 114 115 struct kobj_type { 116 void (*release)(struct kobject *kobj); 117 const struct sysfs_ops *sysfs_ops; 118 struct attribute **default_attrs; 119 const struct kobj_ns_type_operations *(*child_ns_type)(struct kobject *kobj); 120 const void *(*namespace)(struct kobject *kobj); 121 }; 122 123 struct kobj_uevent_env { 124 char *argv[3]; 125 char *envp[UEVENT_NUM_ENVP]; 126 int envp_idx; 127 char buf[UEVENT_BUFFER_SIZE]; 128 int buflen; 129 }; 130 131 struct kset_uevent_ops { 132 int (* const filter)(struct kset *kset, struct kobject *kobj); 133 const char *(* const name)(struct kset *kset, struct kobject *kobj); 134 int (* const uevent)(struct kset *kset, struct kobject *kobj, 135 struct kobj_uevent_env *env); 136 }; 137 138 struct kobj_attribute { 139 struct attribute attr; 140 ssize_t (*show)(struct kobject *kobj, struct kobj_attribute *attr, 141 char *buf); 142 ssize_t (*store)(struct kobject *kobj, struct kobj_attribute *attr, 143 const char *buf, size_t count); 144 }; 145 146 extern const struct sysfs_ops kobj_sysfs_ops; 147 148 struct sock; 149 150 /** 151 * struct kset - a set of kobjects of a specific type, belonging to a specific subsystem. 152 * 153 * A kset defines a group of kobjects. They can be individually 154 * different "types" but overall these kobjects all want to be grouped 155 * together and operated on in the same manner. ksets are used to 156 * define the attribute callbacks and other common events that happen to 157 * a kobject. 158 * 159 * @list: the list of all kobjects for this kset 160 * @list_lock: a lock for iterating over the kobjects 161 * @kobj: the embedded kobject for this kset (recursion, isn't it fun...) 162 * @uevent_ops: the set of uevent operations for this kset. These are 163 * called whenever a kobject has something happen to it so that the kset 164 * can add new environment variables, or filter out the uevents if so 165 * desired. 166 */ 167 struct kset { 168 struct list_head list; 169 spinlock_t list_lock; 170 struct kobject kobj; 171 const struct kset_uevent_ops *uevent_ops; 172 }; 173 174 extern void kset_init(struct kset *kset); 175 extern int __must_check kset_register(struct kset *kset); 176 extern void kset_unregister(struct kset *kset); 177 extern struct kset * __must_check kset_create_and_add(const char *name, 178 const struct kset_uevent_ops *u, 179 struct kobject *parent_kobj); 180 181 static inline struct kset *to_kset(struct kobject *kobj) 182 { 183 return kobj ? container_of(kobj, struct kset, kobj) : NULL; 184 } 185 186 static inline struct kset *kset_get(struct kset *k) 187 { 188 return k ? to_kset(kobject_get(&k->kobj)) : NULL; 189 } 190 191 static inline void kset_put(struct kset *k) 192 { 193 kobject_put(&k->kobj); 194 } 195 196 static inline struct kobj_type *get_ktype(struct kobject *kobj) 197 { 198 return kobj->ktype; 199 } 200 201 extern struct kobject *kset_find_obj(struct kset *, const char *); 202 203 /* The global /sys/kernel/ kobject for people to chain off of */ 204 extern struct kobject *kernel_kobj; 205 /* The global /sys/kernel/mm/ kobject for people to chain off of */ 206 extern struct kobject *mm_kobj; 207 /* The global /sys/hypervisor/ kobject for people to chain off of */ 208 extern struct kobject *hypervisor_kobj; 209 /* The global /sys/power/ kobject for people to chain off of */ 210 extern struct kobject *power_kobj; 211 /* The global /sys/firmware/ kobject for people to chain off of */ 212 extern struct kobject *firmware_kobj; 213 214 int kobject_uevent(struct kobject *kobj, enum kobject_action action); 215 int kobject_uevent_env(struct kobject *kobj, enum kobject_action action, 216 char *envp[]); 217 218 __printf(2, 3) 219 int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...); 220 221 int kobject_action_type(const char *buf, size_t count, 222 enum kobject_action *type); 223 224 #endif /* _KOBJECT_H_ */
1 /* 2 * pci.h 3 * 4 * PCI defines and function prototypes 5 * Copyright 1994, Drew Eckhardt 6 * Copyright 1997--1999 Martin Mares <mj@ucw.cz> 7 * 8 * For more information, please consult the following manuals (look at 9 * http://www.pcisig.com/ for how to get them): 10 * 11 * PCI BIOS Specification 12 * PCI Local Bus Specification 13 * PCI to PCI Bridge Specification 14 * PCI System Design Guide 15 */ 16 #ifndef LINUX_PCI_H 17 #define LINUX_PCI_H 18 19 20 #include <linux/mod_devicetable.h> 21 22 #include <linux/types.h> 23 #include <linux/init.h> 24 #include <linux/ioport.h> 25 #include <linux/list.h> 26 #include <linux/compiler.h> 27 #include <linux/errno.h> 28 #include <linux/kobject.h> 29 #include <linux/atomic.h> 30 #include <linux/device.h> 31 #include <linux/io.h> 32 #include <uapi/linux/pci.h> 33 34 #include <linux/pci_ids.h> 35 36 /* 37 * The PCI interface treats multi-function devices as independent 38 * devices. The slot/function address of each device is encoded 39 * in a single byte as follows: 40 * 41 * 7:3 = slot 42 * 2:0 = function 43 * 44 * PCI_DEVFN(), PCI_SLOT(), and PCI_FUNC() are defined in uapi/linux/pci.h. 45 * In the interest of not exposing interfaces to user-space unnecessarily, 46 * the following kernel-only defines are being added here. 47 */ 48 #define PCI_DEVID(bus, devfn) ((((u16)bus) << 8) | devfn) 49 /* return bus from PCI devid = ((u16)bus_number) << 8) | devfn */ 50 #define PCI_BUS_NUM(x) (((x) >> 8) & 0xff) 51 52 /* pci_slot represents a physical slot */ 53 struct pci_slot { 54 struct pci_bus *bus; /* The bus this slot is on */ 55 struct list_head list; /* node in list of slots on this bus */ 56 struct hotplug_slot *hotplug; /* Hotplug info (migrate over time) */ 57 unsigned char number; /* PCI_SLOT(pci_dev->devfn) */ 58 struct kobject kobj; 59 }; 60 61 static inline const char *pci_slot_name(const struct pci_slot *slot) 62 { 63 return kobject_name(&slot->kobj); 64 } 65 66 /* File state for mmap()s on /proc/bus/pci/X/Y */ 67 enum pci_mmap_state { 68 pci_mmap_io, 69 pci_mmap_mem 70 }; 71 72 /* This defines the direction arg to the DMA mapping routines. */ 73 #define PCI_DMA_BIDIRECTIONAL 0 74 #define PCI_DMA_TODEVICE 1 75 #define PCI_DMA_FROMDEVICE 2 76 #define PCI_DMA_NONE 3 77 78 /* 79 * For PCI devices, the region numbers are assigned this way: 80 */ 81 enum { 82 /* #0-5: standard PCI resources */ 83 PCI_STD_RESOURCES, 84 PCI_STD_RESOURCE_END = 5, 85 86 /* #6: expansion ROM resource */ 87 PCI_ROM_RESOURCE, 88 89 /* device specific resources */ 90 #ifdef CONFIG_PCI_IOV 91 PCI_IOV_RESOURCES, 92 PCI_IOV_RESOURCE_END = PCI_IOV_RESOURCES + PCI_SRIOV_NUM_BARS - 1, 93 #endif 94 95 /* resources assigned to buses behind the bridge */ 96 #define PCI_BRIDGE_RESOURCE_NUM 4 97 98 PCI_BRIDGE_RESOURCES, 99 PCI_BRIDGE_RESOURCE_END = PCI_BRIDGE_RESOURCES + 100 PCI_BRIDGE_RESOURCE_NUM - 1, 101 102 /* total resources associated with a PCI device */ 103 PCI_NUM_RESOURCES, 104 105 /* preserve this for compatibility */ 106 DEVICE_COUNT_RESOURCE = PCI_NUM_RESOURCES, 107 }; 108 109 typedef int __bitwise pci_power_t; 110 111 #define PCI_D0 ((pci_power_t __force) 0) 112 #define PCI_D1 ((pci_power_t __force) 1) 113 #define PCI_D2 ((pci_power_t __force) 2) 114 #define PCI_D3hot ((pci_power_t __force) 3) 115 #define PCI_D3cold ((pci_power_t __force) 4) 116 #define PCI_UNKNOWN ((pci_power_t __force) 5) 117 #define PCI_POWER_ERROR ((pci_power_t __force) -1) 118 119 /* Remember to update this when the list above changes! */ 120 extern const char *pci_power_names[]; 121 122 static inline const char *pci_power_name(pci_power_t state) 123 { 124 return pci_power_names[1 + (int) state]; 125 } 126 127 #define PCI_PM_D2_DELAY 200 128 #define PCI_PM_D3_WAIT 10 129 #define PCI_PM_D3COLD_WAIT 100 130 #define PCI_PM_BUS_WAIT 50 131 132 /** The pci_channel state describes connectivity between the CPU and 133 * the pci device. If some PCI bus between here and the pci device 134 * has crashed or locked up, this info is reflected here. 135 */ 136 typedef unsigned int __bitwise pci_channel_state_t; 137 138 enum pci_channel_state { 139 /* I/O channel is in normal state */ 140 pci_channel_io_normal = (__force pci_channel_state_t) 1, 141 142 /* I/O to channel is blocked */ 143 pci_channel_io_frozen = (__force pci_channel_state_t) 2, 144 145 /* PCI card is dead */ 146 pci_channel_io_perm_failure = (__force pci_channel_state_t) 3, 147 }; 148 149 typedef unsigned int __bitwise pcie_reset_state_t; 150 151 enum pcie_reset_state { 152 /* Reset is NOT asserted (Use to deassert reset) */ 153 pcie_deassert_reset = (__force pcie_reset_state_t) 1, 154 155 /* Use #PERST to reset PCIe device */ 156 pcie_warm_reset = (__force pcie_reset_state_t) 2, 157 158 /* Use PCIe Hot Reset to reset device */ 159 pcie_hot_reset = (__force pcie_reset_state_t) 3 160 }; 161 162 typedef unsigned short __bitwise pci_dev_flags_t; 163 enum pci_dev_flags { 164 /* INTX_DISABLE in PCI_COMMAND register disables MSI 165 * generation too. 166 */ 167 PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG = (__force pci_dev_flags_t) (1 << 0), 168 /* Device configuration is irrevocably lost if disabled into D3 */ 169 PCI_DEV_FLAGS_NO_D3 = (__force pci_dev_flags_t) (1 << 1), 170 /* Provide indication device is assigned by a Virtual Machine Manager */ 171 PCI_DEV_FLAGS_ASSIGNED = (__force pci_dev_flags_t) (1 << 2), 172 /* Flag for quirk use to store if quirk-specific ACS is enabled */ 173 PCI_DEV_FLAGS_ACS_ENABLED_QUIRK = (__force pci_dev_flags_t) (1 << 3), 174 /* Flag to indicate the device uses dma_alias_devfn */ 175 PCI_DEV_FLAGS_DMA_ALIAS_DEVFN = (__force pci_dev_flags_t) (1 << 4), 176 /* Use a PCIe-to-PCI bridge alias even if !pci_is_pcie */ 177 PCI_DEV_FLAG_PCIE_BRIDGE_ALIAS = (__force pci_dev_flags_t) (1 << 5), 178 }; 179 180 enum pci_irq_reroute_variant { 181 INTEL_IRQ_REROUTE_VARIANT = 1, 182 MAX_IRQ_REROUTE_VARIANTS = 3 183 }; 184 185 typedef unsigned short __bitwise pci_bus_flags_t; 186 enum pci_bus_flags { 187 PCI_BUS_FLAGS_NO_MSI = (__force pci_bus_flags_t) 1, 188 PCI_BUS_FLAGS_NO_MMRBC = (__force pci_bus_flags_t) 2, 189 }; 190 191 /* These values come from the PCI Express Spec */ 192 enum pcie_link_width { 193 PCIE_LNK_WIDTH_RESRV = 0x00, 194 PCIE_LNK_X1 = 0x01, 195 PCIE_LNK_X2 = 0x02, 196 PCIE_LNK_X4 = 0x04, 197 PCIE_LNK_X8 = 0x08, 198 PCIE_LNK_X12 = 0x0C, 199 PCIE_LNK_X16 = 0x10, 200 PCIE_LNK_X32 = 0x20, 201 PCIE_LNK_WIDTH_UNKNOWN = 0xFF, 202 }; 203 204 /* Based on the PCI Hotplug Spec, but some values are made up by us */ 205 enum pci_bus_speed { 206 PCI_SPEED_33MHz = 0x00, 207 PCI_SPEED_66MHz = 0x01, 208 PCI_SPEED_66MHz_PCIX = 0x02, 209 PCI_SPEED_100MHz_PCIX = 0x03, 210 PCI_SPEED_133MHz_PCIX = 0x04, 211 PCI_SPEED_66MHz_PCIX_ECC = 0x05, 212 PCI_SPEED_100MHz_PCIX_ECC = 0x06, 213 PCI_SPEED_133MHz_PCIX_ECC = 0x07, 214 PCI_SPEED_66MHz_PCIX_266 = 0x09, 215 PCI_SPEED_100MHz_PCIX_266 = 0x0a, 216 PCI_SPEED_133MHz_PCIX_266 = 0x0b, 217 AGP_UNKNOWN = 0x0c, 218 AGP_1X = 0x0d, 219 AGP_2X = 0x0e, 220 AGP_4X = 0x0f, 221 AGP_8X = 0x10, 222 PCI_SPEED_66MHz_PCIX_533 = 0x11, 223 PCI_SPEED_100MHz_PCIX_533 = 0x12, 224 PCI_SPEED_133MHz_PCIX_533 = 0x13, 225 PCIE_SPEED_2_5GT = 0x14, 226 PCIE_SPEED_5_0GT = 0x15, 227 PCIE_SPEED_8_0GT = 0x16, 228 PCI_SPEED_UNKNOWN = 0xff, 229 }; 230 231 struct pci_cap_saved_data { 232 u16 cap_nr; 233 bool cap_extended; 234 unsigned int size; 235 u32 data[0]; 236 }; 237 238 struct pci_cap_saved_state { 239 struct hlist_node next; 240 struct pci_cap_saved_data cap; 241 }; 242 243 struct pcie_link_state; 244 struct pci_vpd; 245 struct pci_sriov; 246 struct pci_ats; 247 248 /* 249 * The pci_dev structure is used to describe PCI devices. 250 */ 251 struct pci_dev { 252 struct list_head bus_list; /* node in per-bus list */ 253 struct pci_bus *bus; /* bus this device is on */ 254 struct pci_bus *subordinate; /* bus this device bridges to */ 255 256 void *sysdata; /* hook for sys-specific extension */ 257 struct proc_dir_entry *procent; /* device entry in /proc/bus/pci */ 258 struct pci_slot *slot; /* Physical slot this device is in */ 259 260 unsigned int devfn; /* encoded device & function index */ 261 unsigned short vendor; 262 unsigned short device; 263 unsigned short subsystem_vendor; 264 unsigned short subsystem_device; 265 unsigned int class; /* 3 bytes: (base,sub,prog-if) */ 266 u8 revision; /* PCI revision, low byte of class word */ 267 u8 hdr_type; /* PCI header type (`multi' flag masked out) */ 268 u8 pcie_cap; /* PCIe capability offset */ 269 u8 msi_cap; /* MSI capability offset */ 270 u8 msix_cap; /* MSI-X capability offset */ 271 u8 pcie_mpss:3; /* PCIe Max Payload Size Supported */ 272 u8 rom_base_reg; /* which config register controls the ROM */ 273 u8 pin; /* which interrupt pin this device uses */ 274 u16 pcie_flags_reg; /* cached PCIe Capabilities Register */ 275 u8 dma_alias_devfn;/* devfn of DMA alias, if any */ 276 277 struct pci_driver *driver; /* which driver has allocated this device */ 278 u64 dma_mask; /* Mask of the bits of bus address this 279 device implements. Normally this is 280 0xffffffff. You only need to change 281 this if your device has broken DMA 282 or supports 64-bit transfers. */ 283 284 struct device_dma_parameters dma_parms; 285 286 pci_power_t current_state; /* Current operating state. In ACPI-speak, 287 this is D0-D3, D0 being fully functional, 288 and D3 being off. */ 289 u8 pm_cap; /* PM capability offset */ 290 unsigned int pme_support:5; /* Bitmask of states from which PME# 291 can be generated */ 292 unsigned int pme_interrupt:1; 293 unsigned int pme_poll:1; /* Poll device's PME status bit */ 294 unsigned int d1_support:1; /* Low power state D1 is supported */ 295 unsigned int d2_support:1; /* Low power state D2 is supported */ 296 unsigned int no_d1d2:1; /* D1 and D2 are forbidden */ 297 unsigned int no_d3cold:1; /* D3cold is forbidden */ 298 unsigned int d3cold_allowed:1; /* D3cold is allowed by user */ 299 unsigned int mmio_always_on:1; /* disallow turning off io/mem 300 decoding during bar sizing */ 301 unsigned int wakeup_prepared:1; 302 unsigned int runtime_d3cold:1; /* whether go through runtime 303 D3cold, not set for devices 304 powered on/off by the 305 corresponding bridge */ 306 unsigned int d3_delay; /* D3->D0 transition time in ms */ 307 unsigned int d3cold_delay; /* D3cold->D0 transition time in ms */ 308 309 #ifdef CONFIG_PCIEASPM 310 struct pcie_link_state *link_state; /* ASPM link state */ 311 #endif 312 313 pci_channel_state_t error_state; /* current connectivity state */ 314 struct device dev; /* Generic device interface */ 315 316 int cfg_size; /* Size of configuration space */ 317 318 /* 319 * Instead of touching interrupt line and base address registers 320 * directly, use the values stored here. They might be different! 321 */ 322 unsigned int irq; 323 struct resource resource[DEVICE_COUNT_RESOURCE]; /* I/O and memory regions + expansion ROMs */ 324 325 bool match_driver; /* Skip attaching driver */ 326 /* These fields are used by common fixups */ 327 unsigned int transparent:1; /* Subtractive decode PCI bridge */ 328 unsigned int multifunction:1;/* Part of multi-function device */ 329 /* keep track of device state */ 330 unsigned int is_added:1; 331 unsigned int is_busmaster:1; /* device is busmaster */ 332 unsigned int no_msi:1; /* device may not use msi */ 333 unsigned int block_cfg_access:1; /* config space access is blocked */ 334 unsigned int broken_parity_status:1; /* Device generates false positive parity */ 335 unsigned int irq_reroute_variant:2; /* device needs IRQ rerouting variant */ 336 unsigned int msi_enabled:1; 337 unsigned int msix_enabled:1; 338 unsigned int ari_enabled:1; /* ARI forwarding */ 339 unsigned int is_managed:1; 340 unsigned int needs_freset:1; /* Dev requires fundamental reset */ 341 unsigned int state_saved:1; 342 unsigned int is_physfn:1; 343 unsigned int is_virtfn:1; 344 unsigned int reset_fn:1; 345 unsigned int is_hotplug_bridge:1; 346 unsigned int __aer_firmware_first_valid:1; 347 unsigned int __aer_firmware_first:1; 348 unsigned int broken_intx_masking:1; 349 unsigned int io_window_1k:1; /* Intel P2P bridge 1K I/O windows */ 350 pci_dev_flags_t dev_flags; 351 atomic_t enable_cnt; /* pci_enable_device has been called */ 352 353 u32 saved_config_space[16]; /* config space saved at suspend time */ 354 struct hlist_head saved_cap_space; 355 struct bin_attribute *rom_attr; /* attribute descriptor for sysfs ROM entry */ 356 int rom_attr_enabled; /* has display of the rom attribute been enabled? */ 357 struct bin_attribute *res_attr[DEVICE_COUNT_RESOURCE]; /* sysfs file for resources */ 358 struct bin_attribute *res_attr_wc[DEVICE_COUNT_RESOURCE]; /* sysfs file for WC mapping of resources */ 359 #ifdef CONFIG_PCI_MSI 360 struct list_head msi_list; 361 const struct attribute_group **msi_irq_groups; 362 #endif 363 struct pci_vpd *vpd; 364 #ifdef CONFIG_PCI_ATS 365 union { 366 struct pci_sriov *sriov; /* SR-IOV capability related */ 367 struct pci_dev *physfn; /* the PF this VF is associated with */ 368 }; 369 struct pci_ats *ats; /* Address Translation Service */ 370 #endif 371 phys_addr_t rom; /* Physical address of ROM if it's not from the BAR */ 372 size_t romlen; /* Length of ROM if it's not from the BAR */ 373 char *driver_override; /* Driver name to force a match */ 374 }; 375 376 static inline struct pci_dev *pci_physfn(struct pci_dev *dev) 377 { 378 #ifdef CONFIG_PCI_IOV 379 if (dev->is_virtfn) 380 dev = dev->physfn; 381 #endif 382 return dev; 383 } 384 385 struct pci_dev *pci_alloc_dev(struct pci_bus *bus); 386 387 #define to_pci_dev(n) container_of(n, struct pci_dev, dev) 388 #define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL) 389 390 static inline int pci_channel_offline(struct pci_dev *pdev) 391 { 392 return (pdev->error_state != pci_channel_io_normal); 393 } 394 395 struct pci_host_bridge_window { 396 struct list_head list; 397 struct resource *res; /* host bridge aperture (CPU address) */ 398 resource_size_t offset; /* bus address + offset = CPU address */ 399 }; 400 401 struct pci_host_bridge { 402 struct device dev; 403 struct pci_bus *bus; /* root bus */ 404 struct list_head windows; /* pci_host_bridge_windows */ 405 void (*release_fn)(struct pci_host_bridge *); 406 void *release_data; 407 }; 408 409 #define to_pci_host_bridge(n) container_of(n, struct pci_host_bridge, dev) 410 void pci_set_host_bridge_release(struct pci_host_bridge *bridge, 411 void (*release_fn)(struct pci_host_bridge *), 412 void *release_data); 413 414 int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge); 415 416 /* 417 * The first PCI_BRIDGE_RESOURCE_NUM PCI bus resources (those that correspond 418 * to P2P or CardBus bridge windows) go in a table. Additional ones (for 419 * buses below host bridges or subtractive decode bridges) go in the list. 420 * Use pci_bus_for_each_resource() to iterate through all the resources. 421 */ 422 423 /* 424 * PCI_SUBTRACTIVE_DECODE means the bridge forwards the window implicitly 425 * and there's no way to program the bridge with the details of the window. 426 * This does not apply to ACPI _CRS windows, even with the _DEC subtractive- 427 * decode bit set, because they are explicit and can be programmed with _SRS. 428 */ 429 #define PCI_SUBTRACTIVE_DECODE 0x1 430 431 struct pci_bus_resource { 432 struct list_head list; 433 struct resource *res; 434 unsigned int flags; 435 }; 436 437 #define PCI_REGION_FLAG_MASK 0x0fU /* These bits of resource flags tell us the PCI region flags */ 438 439 struct pci_bus { 440 struct list_head node; /* node in list of buses */ 441 struct pci_bus *parent; /* parent bus this bridge is on */ 442 struct list_head children; /* list of child buses */ 443 struct list_head devices; /* list of devices on this bus */ 444 struct pci_dev *self; /* bridge device as seen by parent */ 445 struct list_head slots; /* list of slots on this bus */ 446 struct resource *resource[PCI_BRIDGE_RESOURCE_NUM]; 447 struct list_head resources; /* address space routed to this bus */ 448 struct resource busn_res; /* bus numbers routed to this bus */ 449 450 struct pci_ops *ops; /* configuration access functions */ 451 struct msi_chip *msi; /* MSI controller */ 452 void *sysdata; /* hook for sys-specific extension */ 453 struct proc_dir_entry *procdir; /* directory entry in /proc/bus/pci */ 454 455 unsigned char number; /* bus number */ 456 unsigned char primary; /* number of primary bridge */ 457 unsigned char max_bus_speed; /* enum pci_bus_speed */ 458 unsigned char cur_bus_speed; /* enum pci_bus_speed */ 459 460 char name[48]; 461 462 unsigned short bridge_ctl; /* manage NO_ISA/FBB/et al behaviors */ 463 pci_bus_flags_t bus_flags; /* inherited by child buses */ 464 struct device *bridge; 465 struct device dev; 466 struct bin_attribute *legacy_io; /* legacy I/O for this bus */ 467 struct bin_attribute *legacy_mem; /* legacy mem */ 468 unsigned int is_added:1; 469 }; 470 471 #define to_pci_bus(n) container_of(n, struct pci_bus, dev) 472 473 /* 474 * Returns true if the PCI bus is root (behind host-PCI bridge), 475 * false otherwise 476 * 477 * Some code assumes that "bus->self == NULL" means that bus is a root bus. 478 * This is incorrect because "virtual" buses added for SR-IOV (via 479 * virtfn_add_bus()) have "bus->self == NULL" but are not root buses. 480 */ 481 static inline bool pci_is_root_bus(struct pci_bus *pbus) 482 { 483 return !(pbus->parent); 484 } 485 486 /** 487 * pci_is_bridge - check if the PCI device is a bridge 488 * @dev: PCI device 489 * 490 * Return true if the PCI device is bridge whether it has subordinate 491 * or not. 492 */ 493 static inline bool pci_is_bridge(struct pci_dev *dev) 494 { 495 return dev->hdr_type == PCI_HEADER_TYPE_BRIDGE || 496 dev->hdr_type == PCI_HEADER_TYPE_CARDBUS; 497 } 498 499 static inline struct pci_dev *pci_upstream_bridge(struct pci_dev *dev) 500 { 501 dev = pci_physfn(dev); 502 if (pci_is_root_bus(dev->bus)) 503 return NULL; 504 505 return dev->bus->self; 506 } 507 508 #ifdef CONFIG_PCI_MSI 509 static inline bool pci_dev_msi_enabled(struct pci_dev *pci_dev) 510 { 511 return pci_dev->msi_enabled || pci_dev->msix_enabled; 512 } 513 #else 514 static inline bool pci_dev_msi_enabled(struct pci_dev *pci_dev) { return false; } 515 #endif 516 517 /* 518 * Error values that may be returned by PCI functions. 519 */ 520 #define PCIBIOS_SUCCESSFUL 0x00 521 #define PCIBIOS_FUNC_NOT_SUPPORTED 0x81 522 #define PCIBIOS_BAD_VENDOR_ID 0x83 523 #define PCIBIOS_DEVICE_NOT_FOUND 0x86 524 #define PCIBIOS_BAD_REGISTER_NUMBER 0x87 525 #define PCIBIOS_SET_FAILED 0x88 526 #define PCIBIOS_BUFFER_TOO_SMALL 0x89 527 528 /* 529 * Translate above to generic errno for passing back through non-PCI code. 530 */ 531 static inline int pcibios_err_to_errno(int err) 532 { 533 if (err <= PCIBIOS_SUCCESSFUL) 534 return err; /* Assume already errno */ 535 536 switch (err) { 537 case PCIBIOS_FUNC_NOT_SUPPORTED: 538 return -ENOENT; 539 case PCIBIOS_BAD_VENDOR_ID: 540 return -ENOTTY; 541 case PCIBIOS_DEVICE_NOT_FOUND: 542 return -ENODEV; 543 case PCIBIOS_BAD_REGISTER_NUMBER: 544 return -EFAULT; 545 case PCIBIOS_SET_FAILED: 546 return -EIO; 547 case PCIBIOS_BUFFER_TOO_SMALL: 548 return -ENOSPC; 549 } 550 551 return -ERANGE; 552 } 553 554 /* Low-level architecture-dependent routines */ 555 556 struct pci_ops { 557 int (*read)(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *val); 558 int (*write)(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 val); 559 }; 560 561 /* 562 * ACPI needs to be able to access PCI config space before we've done a 563 * PCI bus scan and created pci_bus structures. 564 */ 565 int raw_pci_read(unsigned int domain, unsigned int bus, unsigned int devfn, 566 int reg, int len, u32 *val); 567 int raw_pci_write(unsigned int domain, unsigned int bus, unsigned int devfn, 568 int reg, int len, u32 val); 569 570 struct pci_bus_region { 571 dma_addr_t start; 572 dma_addr_t end; 573 }; 574 575 struct pci_dynids { 576 spinlock_t lock; /* protects list, index */ 577 struct list_head list; /* for IDs added at runtime */ 578 }; 579 580 581 /* 582 * PCI Error Recovery System (PCI-ERS). If a PCI device driver provides 583 * a set of callbacks in struct pci_error_handlers, that device driver 584 * will be notified of PCI bus errors, and will be driven to recovery 585 * when an error occurs. 586 */ 587 588 typedef unsigned int __bitwise pci_ers_result_t; 589 590 enum pci_ers_result { 591 /* no result/none/not supported in device driver */ 592 PCI_ERS_RESULT_NONE = (__force pci_ers_result_t) 1, 593 594 /* Device driver can recover without slot reset */ 595 PCI_ERS_RESULT_CAN_RECOVER = (__force pci_ers_result_t) 2, 596 597 /* Device driver wants slot to be reset. */ 598 PCI_ERS_RESULT_NEED_RESET = (__force pci_ers_result_t) 3, 599 600 /* Device has completely failed, is unrecoverable */ 601 PCI_ERS_RESULT_DISCONNECT = (__force pci_ers_result_t) 4, 602 603 /* Device driver is fully recovered and operational */ 604 PCI_ERS_RESULT_RECOVERED = (__force pci_ers_result_t) 5, 605 606 /* No AER capabilities registered for the driver */ 607 PCI_ERS_RESULT_NO_AER_DRIVER = (__force pci_ers_result_t) 6, 608 }; 609 610 /* PCI bus error event callbacks */ 611 struct pci_error_handlers { 612 /* PCI bus error detected on this device */ 613 pci_ers_result_t (*error_detected)(struct pci_dev *dev, 614 enum pci_channel_state error); 615 616 /* MMIO has been re-enabled, but not DMA */ 617 pci_ers_result_t (*mmio_enabled)(struct pci_dev *dev); 618 619 /* PCI Express link has been reset */ 620 pci_ers_result_t (*link_reset)(struct pci_dev *dev); 621 622 /* PCI slot has been reset */ 623 pci_ers_result_t (*slot_reset)(struct pci_dev *dev); 624 625 /* PCI function reset prepare or completed */ 626 void (*reset_notify)(struct pci_dev *dev, bool prepare); 627 628 /* Device driver may resume normal operations */ 629 void (*resume)(struct pci_dev *dev); 630 }; 631 632 633 struct module; 634 struct pci_driver { 635 struct list_head node; 636 const char *name; 637 const struct pci_device_id *id_table; /* must be non-NULL for probe to be called */ 638 int (*probe) (struct pci_dev *dev, const struct pci_device_id *id); /* New device inserted */ 639 void (*remove) (struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */ 640 int (*suspend) (struct pci_dev *dev, pm_message_t state); /* Device suspended */ 641 int (*suspend_late) (struct pci_dev *dev, pm_message_t state); 642 int (*resume_early) (struct pci_dev *dev); 643 int (*resume) (struct pci_dev *dev); /* Device woken up */ 644 void (*shutdown) (struct pci_dev *dev); 645 int (*sriov_configure) (struct pci_dev *dev, int num_vfs); /* PF pdev */ 646 const struct pci_error_handlers *err_handler; 647 struct device_driver driver; 648 struct pci_dynids dynids; 649 }; 650 651 #define to_pci_driver(drv) container_of(drv, struct pci_driver, driver) 652 653 /** 654 * DEFINE_PCI_DEVICE_TABLE - macro used to describe a pci device table 655 * @_table: device table name 656 * 657 * This macro is deprecated and should not be used in new code. 658 */ 659 #define DEFINE_PCI_DEVICE_TABLE(_table) \ 660 const struct pci_device_id _table[] 661 662 /** 663 * PCI_DEVICE - macro used to describe a specific pci device 664 * @vend: the 16 bit PCI Vendor ID 665 * @dev: the 16 bit PCI Device ID 666 * 667 * This macro is used to create a struct pci_device_id that matches a 668 * specific device. The subvendor and subdevice fields will be set to 669 * PCI_ANY_ID. 670 */ 671 #define PCI_DEVICE(vend,dev) \ 672 .vendor = (vend), .device = (dev), \ 673 .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID 674 675 /** 676 * PCI_DEVICE_SUB - macro used to describe a specific pci device with subsystem 677 * @vend: the 16 bit PCI Vendor ID 678 * @dev: the 16 bit PCI Device ID 679 * @subvend: the 16 bit PCI Subvendor ID 680 * @subdev: the 16 bit PCI Subdevice ID 681 * 682 * This macro is used to create a struct pci_device_id that matches a 683 * specific device with subsystem information. 684 */ 685 #define PCI_DEVICE_SUB(vend, dev, subvend, subdev) \ 686 .vendor = (vend), .device = (dev), \ 687 .subvendor = (subvend), .subdevice = (subdev) 688 689 /** 690 * PCI_DEVICE_CLASS - macro used to describe a specific pci device class 691 * @dev_class: the class, subclass, prog-if triple for this device 692 * @dev_class_mask: the class mask for this device 693 * 694 * This macro is used to create a struct pci_device_id that matches a 695 * specific PCI class. The vendor, device, subvendor, and subdevice 696 * fields will be set to PCI_ANY_ID. 697 */ 698 #define PCI_DEVICE_CLASS(dev_class,dev_class_mask) \ 699 .class = (dev_class), .class_mask = (dev_class_mask), \ 700 .vendor = PCI_ANY_ID, .device = PCI_ANY_ID, \ 701 .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID 702 703 /** 704 * PCI_VDEVICE - macro used to describe a specific pci device in short form 705 * @vend: the vendor name 706 * @dev: the 16 bit PCI Device ID 707 * 708 * This macro is used to create a struct pci_device_id that matches a 709 * specific PCI device. The subvendor, and subdevice fields will be set 710 * to PCI_ANY_ID. The macro allows the next field to follow as the device 711 * private data. 712 */ 713 714 #define PCI_VDEVICE(vend, dev) \ 715 .vendor = PCI_VENDOR_ID_##vend, .device = (dev), \ 716 .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID, 0, 0 717 718 /* these external functions are only available when PCI support is enabled */ 719 #ifdef CONFIG_PCI 720 721 void pcie_bus_configure_settings(struct pci_bus *bus); 722 723 enum pcie_bus_config_types { 724 PCIE_BUS_TUNE_OFF, 725 PCIE_BUS_SAFE, 726 PCIE_BUS_PERFORMANCE, 727 PCIE_BUS_PEER2PEER, 728 }; 729 730 extern enum pcie_bus_config_types pcie_bus_config; 731 732 extern struct bus_type pci_bus_type; 733 734 /* Do NOT directly access these two variables, unless you are arch-specific PCI 735 * code, or PCI core code. */ 736 extern struct list_head pci_root_buses; /* list of all known PCI buses */ 737 /* Some device drivers need know if PCI is initiated */ 738 int no_pci_devices(void); 739 740 void pcibios_resource_survey_bus(struct pci_bus *bus); 741 void pcibios_add_bus(struct pci_bus *bus); 742 void pcibios_remove_bus(struct pci_bus *bus); 743 void pcibios_fixup_bus(struct pci_bus *); 744 int __must_check pcibios_enable_device(struct pci_dev *, int mask); 745 /* Architecture-specific versions may override this (weak) */ 746 char *pcibios_setup(char *str); 747 748 /* Used only when drivers/pci/setup.c is used */ 749 resource_size_t pcibios_align_resource(void *, const struct resource *, 750 resource_size_t, 751 resource_size_t); 752 void pcibios_update_irq(struct pci_dev *, int irq); 753 754 /* Weak but can be overriden by arch */ 755 void pci_fixup_cardbus(struct pci_bus *); 756 757 /* Generic PCI functions used internally */ 758 759 void pcibios_resource_to_bus(struct pci_bus *bus, struct pci_bus_region *region, 760 struct resource *res); 761 void pcibios_bus_to_resource(struct pci_bus *bus, struct resource *res, 762 struct pci_bus_region *region); 763 void pcibios_scan_specific_bus(int busn); 764 struct pci_bus *pci_find_bus(int domain, int busnr); 765 void pci_bus_add_devices(const struct pci_bus *bus); 766 struct pci_bus *pci_scan_bus_parented(struct device *parent, int bus, 767 struct pci_ops *ops, void *sysdata); 768 struct pci_bus *pci_scan_bus(int bus, struct pci_ops *ops, void *sysdata); 769 struct pci_bus *pci_create_root_bus(struct device *parent, int bus, 770 struct pci_ops *ops, void *sysdata, 771 struct list_head *resources); 772 int pci_bus_insert_busn_res(struct pci_bus *b, int bus, int busmax); 773 int pci_bus_update_busn_res_end(struct pci_bus *b, int busmax); 774 void pci_bus_release_busn_res(struct pci_bus *b); 775 struct pci_bus *pci_scan_root_bus(struct device *parent, int bus, 776 struct pci_ops *ops, void *sysdata, 777 struct list_head *resources); 778 struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, 779 int busnr); 780 void pcie_update_link_speed(struct pci_bus *bus, u16 link_status); 781 struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr, 782 const char *name, 783 struct hotplug_slot *hotplug); 784 void pci_destroy_slot(struct pci_slot *slot); 785 int pci_scan_slot(struct pci_bus *bus, int devfn); 786 struct pci_dev *pci_scan_single_device(struct pci_bus *bus, int devfn); 787 void pci_device_add(struct pci_dev *dev, struct pci_bus *bus); 788 unsigned int pci_scan_child_bus(struct pci_bus *bus); 789 void pci_bus_add_device(struct pci_dev *dev); 790 void pci_read_bridge_bases(struct pci_bus *child); 791 struct resource *pci_find_parent_resource(const struct pci_dev *dev, 792 struct resource *res); 793 u8 pci_swizzle_interrupt_pin(const struct pci_dev *dev, u8 pin); 794 int pci_get_interrupt_pin(struct pci_dev *dev, struct pci_dev **bridge); 795 u8 pci_common_swizzle(struct pci_dev *dev, u8 *pinp); 796 struct pci_dev *pci_dev_get(struct pci_dev *dev); 797 void pci_dev_put(struct pci_dev *dev); 798 void pci_remove_bus(struct pci_bus *b); 799 void pci_stop_and_remove_bus_device(struct pci_dev *dev); 800 void pci_stop_and_remove_bus_device_locked(struct pci_dev *dev); 801 void pci_stop_root_bus(struct pci_bus *bus); 802 void pci_remove_root_bus(struct pci_bus *bus); 803 void pci_setup_cardbus(struct pci_bus *bus); 804 void pci_sort_breadthfirst(void); 805 #define dev_is_pci(d) ((d)->bus == &pci_bus_type) 806 #define dev_is_pf(d) ((dev_is_pci(d) ? to_pci_dev(d)->is_physfn : false)) 807 #define dev_num_vf(d) ((dev_is_pci(d) ? pci_num_vf(to_pci_dev(d)) : 0)) 808 809 /* Generic PCI functions exported to card drivers */ 810 811 enum pci_lost_interrupt_reason { 812 PCI_LOST_IRQ_NO_INFORMATION = 0, 813 PCI_LOST_IRQ_DISABLE_MSI, 814 PCI_LOST_IRQ_DISABLE_MSIX, 815 PCI_LOST_IRQ_DISABLE_ACPI, 816 }; 817 enum pci_lost_interrupt_reason pci_lost_interrupt(struct pci_dev *dev); 818 int pci_find_capability(struct pci_dev *dev, int cap); 819 int pci_find_next_capability(struct pci_dev *dev, u8 pos, int cap); 820 int pci_find_ext_capability(struct pci_dev *dev, int cap); 821 int pci_find_next_ext_capability(struct pci_dev *dev, int pos, int cap); 822 int pci_find_ht_capability(struct pci_dev *dev, int ht_cap); 823 int pci_find_next_ht_capability(struct pci_dev *dev, int pos, int ht_cap); 824 struct pci_bus *pci_find_next_bus(const struct pci_bus *from); 825 826 struct pci_dev *pci_get_device(unsigned int vendor, unsigned int device, 827 struct pci_dev *from); 828 struct pci_dev *pci_get_subsys(unsigned int vendor, unsigned int device, 829 unsigned int ss_vendor, unsigned int ss_device, 830 struct pci_dev *from); 831 struct pci_dev *pci_get_slot(struct pci_bus *bus, unsigned int devfn); 832 struct pci_dev *pci_get_domain_bus_and_slot(int domain, unsigned int bus, 833 unsigned int devfn); 834 static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus, 835 unsigned int devfn) 836 { 837 return pci_get_domain_bus_and_slot(0, bus, devfn); 838 } 839 struct pci_dev *pci_get_class(unsigned int class, struct pci_dev *from); 840 int pci_dev_present(const struct pci_device_id *ids); 841 842 int pci_bus_read_config_byte(struct pci_bus *bus, unsigned int devfn, 843 int where, u8 *val); 844 int pci_bus_read_config_word(struct pci_bus *bus, unsigned int devfn, 845 int where, u16 *val); 846 int pci_bus_read_config_dword(struct pci_bus *bus, unsigned int devfn, 847 int where, u32 *val); 848 int pci_bus_write_config_byte(struct pci_bus *bus, unsigned int devfn, 849 int where, u8 val); 850 int pci_bus_write_config_word(struct pci_bus *bus, unsigned int devfn, 851 int where, u16 val); 852 int pci_bus_write_config_dword(struct pci_bus *bus, unsigned int devfn, 853 int where, u32 val); 854 struct pci_ops *pci_bus_set_ops(struct pci_bus *bus, struct pci_ops *ops); 855 856 static inline int pci_read_config_byte(const struct pci_dev *dev, int where, u8 *val) 857 { 858 return pci_bus_read_config_byte(dev->bus, dev->devfn, where, val); 859 } 860 static inline int pci_read_config_word(const struct pci_dev *dev, int where, u16 *val) 861 { 862 return pci_bus_read_config_word(dev->bus, dev->devfn, where, val); 863 } 864 static inline int pci_read_config_dword(const struct pci_dev *dev, int where, 865 u32 *val) 866 { 867 return pci_bus_read_config_dword(dev->bus, dev->devfn, where, val); 868 } 869 static inline int pci_write_config_byte(const struct pci_dev *dev, int where, u8 val) 870 { 871 return pci_bus_write_config_byte(dev->bus, dev->devfn, where, val); 872 } 873 static inline int pci_write_config_word(const struct pci_dev *dev, int where, u16 val) 874 { 875 return pci_bus_write_config_word(dev->bus, dev->devfn, where, val); 876 } 877 static inline int pci_write_config_dword(const struct pci_dev *dev, int where, 878 u32 val) 879 { 880 return pci_bus_write_config_dword(dev->bus, dev->devfn, where, val); 881 } 882 883 int pcie_capability_read_word(struct pci_dev *dev, int pos, u16 *val); 884 int pcie_capability_read_dword(struct pci_dev *dev, int pos, u32 *val); 885 int pcie_capability_write_word(struct pci_dev *dev, int pos, u16 val); 886 int pcie_capability_write_dword(struct pci_dev *dev, int pos, u32 val); 887 int pcie_capability_clear_and_set_word(struct pci_dev *dev, int pos, 888 u16 clear, u16 set); 889 int pcie_capability_clear_and_set_dword(struct pci_dev *dev, int pos, 890 u32 clear, u32 set); 891 892 static inline int pcie_capability_set_word(struct pci_dev *dev, int pos, 893 u16 set) 894 { 895 return pcie_capability_clear_and_set_word(dev, pos, 0, set); 896 } 897 898 static inline int pcie_capability_set_dword(struct pci_dev *dev, int pos, 899 u32 set) 900 { 901 return pcie_capability_clear_and_set_dword(dev, pos, 0, set); 902 } 903 904 static inline int pcie_capability_clear_word(struct pci_dev *dev, int pos, 905 u16 clear) 906 { 907 return pcie_capability_clear_and_set_word(dev, pos, clear, 0); 908 } 909 910 static inline int pcie_capability_clear_dword(struct pci_dev *dev, int pos, 911 u32 clear) 912 { 913 return pcie_capability_clear_and_set_dword(dev, pos, clear, 0); 914 } 915 916 /* user-space driven config access */ 917 int pci_user_read_config_byte(struct pci_dev *dev, int where, u8 *val); 918 int pci_user_read_config_word(struct pci_dev *dev, int where, u16 *val); 919 int pci_user_read_config_dword(struct pci_dev *dev, int where, u32 *val); 920 int pci_user_write_config_byte(struct pci_dev *dev, int where, u8 val); 921 int pci_user_write_config_word(struct pci_dev *dev, int where, u16 val); 922 int pci_user_write_config_dword(struct pci_dev *dev, int where, u32 val); 923 924 int __must_check pci_enable_device(struct pci_dev *dev); 925 int __must_check pci_enable_device_io(struct pci_dev *dev); 926 int __must_check pci_enable_device_mem(struct pci_dev *dev); 927 int __must_check pci_reenable_device(struct pci_dev *); 928 int __must_check pcim_enable_device(struct pci_dev *pdev); 929 void pcim_pin_device(struct pci_dev *pdev); 930 931 static inline int pci_is_enabled(struct pci_dev *pdev) 932 { 933 return (atomic_read(&pdev->enable_cnt) > 0); 934 } 935 936 static inline int pci_is_managed(struct pci_dev *pdev) 937 { 938 return pdev->is_managed; 939 } 940 941 void pci_disable_device(struct pci_dev *dev); 942 943 extern unsigned int pcibios_max_latency; 944 void pci_set_master(struct pci_dev *dev); 945 void pci_clear_master(struct pci_dev *dev); 946 947 int pci_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state); 948 int pci_set_cacheline_size(struct pci_dev *dev); 949 #define HAVE_PCI_SET_MWI 950 int __must_check pci_set_mwi(struct pci_dev *dev); 951 int pci_try_set_mwi(struct pci_dev *dev); 952 void pci_clear_mwi(struct pci_dev *dev); 953 void pci_intx(struct pci_dev *dev, int enable); 954 bool pci_intx_mask_supported(struct pci_dev *dev); 955 bool pci_check_and_mask_intx(struct pci_dev *dev); 956 bool pci_check_and_unmask_intx(struct pci_dev *dev); 957 void pci_msi_off(struct pci_dev *dev); 958 int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size); 959 int pci_set_dma_seg_boundary(struct pci_dev *dev, unsigned long mask); 960 int pci_wait_for_pending(struct pci_dev *dev, int pos, u16 mask); 961 int pci_wait_for_pending_transaction(struct pci_dev *dev); 962 int pcix_get_max_mmrbc(struct pci_dev *dev); 963 int pcix_get_mmrbc(struct pci_dev *dev); 964 int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc); 965 int pcie_get_readrq(struct pci_dev *dev); 966 int pcie_set_readrq(struct pci_dev *dev, int rq); 967 int pcie_get_mps(struct pci_dev *dev); 968 int pcie_set_mps(struct pci_dev *dev, int mps); 969 int pcie_get_minimum_link(struct pci_dev *dev, enum pci_bus_speed *speed, 970 enum pcie_link_width *width); 971 int __pci_reset_function(struct pci_dev *dev); 972 int __pci_reset_function_locked(struct pci_dev *dev); 973 int pci_reset_function(struct pci_dev *dev); 974 int pci_try_reset_function(struct pci_dev *dev); 975 int pci_probe_reset_slot(struct pci_slot *slot); 976 int pci_reset_slot(struct pci_slot *slot); 977 int pci_try_reset_slot(struct pci_slot *slot); 978 int pci_probe_reset_bus(struct pci_bus *bus); 979 int pci_reset_bus(struct pci_bus *bus); 980 int pci_try_reset_bus(struct pci_bus *bus); 981 void pci_reset_secondary_bus(struct pci_dev *dev); 982 void pcibios_reset_secondary_bus(struct pci_dev *dev); 983 void pci_reset_bridge_secondary_bus(struct pci_dev *dev); 984 void pci_update_resource(struct pci_dev *dev, int resno); 985 int __must_check pci_assign_resource(struct pci_dev *dev, int i); 986 int __must_check pci_reassign_resource(struct pci_dev *dev, int i, resource_size_t add_size, resource_size_t align); 987 int pci_select_bars(struct pci_dev *dev, unsigned long flags); 988 bool pci_device_is_present(struct pci_dev *pdev); 989 990 /* ROM control related routines */ 991 int pci_enable_rom(struct pci_dev *pdev); 992 void pci_disable_rom(struct pci_dev *pdev); 993 void __iomem __must_check *pci_map_rom(struct pci_dev *pdev, size_t *size); 994 void pci_unmap_rom(struct pci_dev *pdev, void __iomem *rom); 995 size_t pci_get_rom_size(struct pci_dev *pdev, void __iomem *rom, size_t size); 996 void __iomem __must_check *pci_platform_rom(struct pci_dev *pdev, size_t *size); 997 998 /* Power management related routines */ 999 int pci_save_state(struct pci_dev *dev); 1000 void pci_restore_state(struct pci_dev *dev); 1001 struct pci_saved_state *pci_store_saved_state(struct pci_dev *dev); 1002 int pci_load_and_free_saved_state(struct pci_dev *dev, 1003 struct pci_saved_state **state); 1004 struct pci_cap_saved_state *pci_find_saved_cap(struct pci_dev *dev, char cap); 1005 struct pci_cap_saved_state *pci_find_saved_ext_cap(struct pci_dev *dev, 1006 u16 cap); 1007 int pci_add_cap_save_buffer(struct pci_dev *dev, char cap, unsigned int size); 1008 int pci_add_ext_cap_save_buffer(struct pci_dev *dev, 1009 u16 cap, unsigned int size); 1010 int __pci_complete_power_transition(struct pci_dev *dev, pci_power_t state); 1011 int pci_set_power_state(struct pci_dev *dev, pci_power_t state); 1012 pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); 1013 bool pci_pme_capable(struct pci_dev *dev, pci_power_t state); 1014 void pci_pme_active(struct pci_dev *dev, bool enable); 1015 int __pci_enable_wake(struct pci_dev *dev, pci_power_t state, 1016 bool runtime, bool enable); 1017 int pci_wake_from_d3(struct pci_dev *dev, bool enable); 1018 int pci_prepare_to_sleep(struct pci_dev *dev); 1019 int pci_back_from_sleep(struct pci_dev *dev); 1020 bool pci_dev_run_wake(struct pci_dev *dev); 1021 bool pci_check_pme_status(struct pci_dev *dev); 1022 void pci_pme_wakeup_bus(struct pci_bus *bus); 1023 1024 static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, 1025 bool enable) 1026 { 1027 return __pci_enable_wake(dev, state, false, enable); 1028 } 1029 1030 /* PCI Virtual Channel */ 1031 int pci_save_vc_state(struct pci_dev *dev); 1032 void pci_restore_vc_state(struct pci_dev *dev); 1033 void pci_allocate_vc_save_buffers(struct pci_dev *dev); 1034 1035 /* For use by arch with custom probe code */ 1036 void set_pcie_port_type(struct pci_dev *pdev); 1037 void set_pcie_hotplug_bridge(struct pci_dev *pdev); 1038 1039 /* Functions for PCI Hotplug drivers to use */ 1040 int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap); 1041 unsigned int pci_rescan_bus_bridge_resize(struct pci_dev *bridge); 1042 unsigned int pci_rescan_bus(struct pci_bus *bus); 1043 void pci_lock_rescan_remove(void); 1044 void pci_unlock_rescan_remove(void); 1045 1046 /* Vital product data routines */ 1047 ssize_t pci_read_vpd(struct pci_dev *dev, loff_t pos, size_t count, void *buf); 1048 ssize_t pci_write_vpd(struct pci_dev *dev, loff_t pos, size_t count, const void *buf); 1049 1050 /* Helper functions for low-level code (drivers/pci/setup-[bus,res].c) */ 1051 resource_size_t pcibios_retrieve_fw_addr(struct pci_dev *dev, int idx); 1052 void pci_bus_assign_resources(const struct pci_bus *bus); 1053 void pci_bus_size_bridges(struct pci_bus *bus); 1054 int pci_claim_resource(struct pci_dev *, int); 1055 void pci_assign_unassigned_resources(void); 1056 void pci_assign_unassigned_bridge_resources(struct pci_dev *bridge); 1057 void pci_assign_unassigned_bus_resources(struct pci_bus *bus); 1058 void pci_assign_unassigned_root_bus_resources(struct pci_bus *bus); 1059 void pdev_enable_device(struct pci_dev *); 1060 int pci_enable_resources(struct pci_dev *, int mask); 1061 void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *), 1062 int (*)(const struct pci_dev *, u8, u8)); 1063 #define HAVE_PCI_REQ_REGIONS 2 1064 int __must_check pci_request_regions(struct pci_dev *, const char *); 1065 int __must_check pci_request_regions_exclusive(struct pci_dev *, const char *); 1066 void pci_release_regions(struct pci_dev *); 1067 int __must_check pci_request_region(struct pci_dev *, int, const char *); 1068 int __must_check pci_request_region_exclusive(struct pci_dev *, int, const char *); 1069 void pci_release_region(struct pci_dev *, int); 1070 int pci_request_selected_regions(struct pci_dev *, int, const char *); 1071 int pci_request_selected_regions_exclusive(struct pci_dev *, int, const char *); 1072 void pci_release_selected_regions(struct pci_dev *, int); 1073 1074 /* drivers/pci/bus.c */ 1075 struct pci_bus *pci_bus_get(struct pci_bus *bus); 1076 void pci_bus_put(struct pci_bus *bus); 1077 void pci_add_resource(struct list_head *resources, struct resource *res); 1078 void pci_add_resource_offset(struct list_head *resources, struct resource *res, 1079 resource_size_t offset); 1080 void pci_free_resource_list(struct list_head *resources); 1081 void pci_bus_add_resource(struct pci_bus *bus, struct resource *res, unsigned int flags); 1082 struct resource *pci_bus_resource_n(const struct pci_bus *bus, int n); 1083 void pci_bus_remove_resources(struct pci_bus *bus); 1084 1085 #define pci_bus_for_each_resource(bus, res, i) \ 1086 for (i = 0; \ 1087 (res = pci_bus_resource_n(bus, i)) || i < PCI_BRIDGE_RESOURCE_NUM; \ 1088 i++) 1089 1090 int __must_check pci_bus_alloc_resource(struct pci_bus *bus, 1091 struct resource *res, resource_size_t size, 1092 resource_size_t align, resource_size_t min, 1093 unsigned long type_mask, 1094 resource_size_t (*alignf)(void *, 1095 const struct resource *, 1096 resource_size_t, 1097 resource_size_t), 1098 void *alignf_data); 1099 1100 static inline dma_addr_t pci_bus_address(struct pci_dev *pdev, int bar) 1101 { 1102 struct pci_bus_region region; 1103 1104 pcibios_resource_to_bus(pdev->bus, &region, &pdev->resource[bar]); 1105 return region.start; 1106 } 1107 1108 /* Proper probing supporting hot-pluggable devices */ 1109 int __must_check __pci_register_driver(struct pci_driver *, struct module *, 1110 const char *mod_name); 1111 1112 /* 1113 * pci_register_driver must be a macro so that KBUILD_MODNAME can be expanded 1114 */ 1115 #define pci_register_driver(driver) \ 1116 __pci_register_driver(driver, THIS_MODULE, KBUILD_MODNAME) 1117 1118 void pci_unregister_driver(struct pci_driver *dev); 1119 1120 /** 1121 * module_pci_driver() - Helper macro for registering a PCI driver 1122 * @__pci_driver: pci_driver struct 1123 * 1124 * Helper macro for PCI drivers which do not do anything special in module 1125 * init/exit. This eliminates a lot of boilerplate. Each module may only 1126 * use this macro once, and calling it replaces module_init() and module_exit() 1127 */ 1128 #define module_pci_driver(__pci_driver) \ 1129 module_driver(__pci_driver, pci_register_driver, \ 1130 pci_unregister_driver) 1131 1132 struct pci_driver *pci_dev_driver(const struct pci_dev *dev); 1133 int pci_add_dynid(struct pci_driver *drv, 1134 unsigned int vendor, unsigned int device, 1135 unsigned int subvendor, unsigned int subdevice, 1136 unsigned int class, unsigned int class_mask, 1137 unsigned long driver_data); 1138 const struct pci_device_id *pci_match_id(const struct pci_device_id *ids, 1139 struct pci_dev *dev); 1140 int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, 1141 int pass); 1142 1143 void pci_walk_bus(struct pci_bus *top, int (*cb)(struct pci_dev *, void *), 1144 void *userdata); 1145 int pci_cfg_space_size(struct pci_dev *dev); 1146 unsigned char pci_bus_max_busnr(struct pci_bus *bus); 1147 void pci_setup_bridge(struct pci_bus *bus); 1148 resource_size_t pcibios_window_alignment(struct pci_bus *bus, 1149 unsigned long type); 1150 1151 #define PCI_VGA_STATE_CHANGE_BRIDGE (1 << 0) 1152 #define PCI_VGA_STATE_CHANGE_DECODES (1 << 1) 1153 1154 int pci_set_vga_state(struct pci_dev *pdev, bool decode, 1155 unsigned int command_bits, u32 flags); 1156 /* kmem_cache style wrapper around pci_alloc_consistent() */ 1157 1158 #include <linux/pci-dma.h> 1159 #include <linux/dmapool.h> 1160 1161 #define pci_pool dma_pool 1162 #define pci_pool_create(name, pdev, size, align, allocation) \ 1163 dma_pool_create(name, &pdev->dev, size, align, allocation) 1164 #define pci_pool_destroy(pool) dma_pool_destroy(pool) 1165 #define pci_pool_alloc(pool, flags, handle) dma_pool_alloc(pool, flags, handle) 1166 #define pci_pool_free(pool, vaddr, addr) dma_pool_free(pool, vaddr, addr) 1167 1168 enum pci_dma_burst_strategy { 1169 PCI_DMA_BURST_INFINITY, /* make bursts as large as possible, 1170 strategy_parameter is N/A */ 1171 PCI_DMA_BURST_BOUNDARY, /* disconnect at every strategy_parameter 1172 byte boundaries */ 1173 PCI_DMA_BURST_MULTIPLE, /* disconnect at some multiple of 1174 strategy_parameter byte boundaries */ 1175 }; 1176 1177 struct msix_entry { 1178 u32 vector; /* kernel uses to write allocated vector */ 1179 u16 entry; /* driver uses to specify entry, OS writes */ 1180 }; 1181 1182 1183 #ifdef CONFIG_PCI_MSI 1184 int pci_msi_vec_count(struct pci_dev *dev); 1185 void pci_msi_shutdown(struct pci_dev *dev); 1186 void pci_disable_msi(struct pci_dev *dev); 1187 int pci_msix_vec_count(struct pci_dev *dev); 1188 int pci_enable_msix(struct pci_dev *dev, struct msix_entry *entries, int nvec); 1189 void pci_msix_shutdown(struct pci_dev *dev); 1190 void pci_disable_msix(struct pci_dev *dev); 1191 void pci_restore_msi_state(struct pci_dev *dev); 1192 int pci_msi_enabled(void); 1193 int pci_enable_msi_range(struct pci_dev *dev, int minvec, int maxvec); 1194 static inline int pci_enable_msi_exact(struct pci_dev *dev, int nvec) 1195 { 1196 int rc = pci_enable_msi_range(dev, nvec, nvec); 1197 if (rc < 0) 1198 return rc; 1199 return 0; 1200 } 1201 int pci_enable_msix_range(struct pci_dev *dev, struct msix_entry *entries, 1202 int minvec, int maxvec); 1203 static inline int pci_enable_msix_exact(struct pci_dev *dev, 1204 struct msix_entry *entries, int nvec) 1205 { 1206 int rc = pci_enable_msix_range(dev, entries, nvec, nvec); 1207 if (rc < 0) 1208 return rc; 1209 return 0; 1210 } 1211 #else 1212 static inline int pci_msi_vec_count(struct pci_dev *dev) { return -ENOSYS; } 1213 static inline void pci_msi_shutdown(struct pci_dev *dev) { } 1214 static inline void pci_disable_msi(struct pci_dev *dev) { } 1215 static inline int pci_msix_vec_count(struct pci_dev *dev) { return -ENOSYS; } 1216 static inline int pci_enable_msix(struct pci_dev *dev, 1217 struct msix_entry *entries, int nvec) 1218 { return -ENOSYS; } 1219 static inline void pci_msix_shutdown(struct pci_dev *dev) { } 1220 static inline void pci_disable_msix(struct pci_dev *dev) { } 1221 static inline void pci_restore_msi_state(struct pci_dev *dev) { } 1222 static inline int pci_msi_enabled(void) { return 0; } 1223 static inline int pci_enable_msi_range(struct pci_dev *dev, int minvec, 1224 int maxvec) 1225 { return -ENOSYS; } 1226 static inline int pci_enable_msi_exact(struct pci_dev *dev, int nvec) 1227 { return -ENOSYS; } 1228 static inline int pci_enable_msix_range(struct pci_dev *dev, 1229 struct msix_entry *entries, int minvec, int maxvec) 1230 { return -ENOSYS; } 1231 static inline int pci_enable_msix_exact(struct pci_dev *dev, 1232 struct msix_entry *entries, int nvec) 1233 { return -ENOSYS; } 1234 #endif 1235 1236 #ifdef CONFIG_PCIEPORTBUS 1237 extern bool pcie_ports_disabled; 1238 extern bool pcie_ports_auto; 1239 #else 1240 #define pcie_ports_disabled true 1241 #define pcie_ports_auto false 1242 #endif 1243 1244 #ifdef CONFIG_PCIEASPM 1245 bool pcie_aspm_support_enabled(void); 1246 #else 1247 static inline bool pcie_aspm_support_enabled(void) { return false; } 1248 #endif 1249 1250 #ifdef CONFIG_PCIEAER 1251 void pci_no_aer(void); 1252 bool pci_aer_available(void); 1253 #else 1254 static inline void pci_no_aer(void) { } 1255 static inline bool pci_aer_available(void) { return false; } 1256 #endif 1257 1258 #ifdef CONFIG_PCIE_ECRC 1259 void pcie_set_ecrc_checking(struct pci_dev *dev); 1260 void pcie_ecrc_get_policy(char *str); 1261 #else 1262 static inline void pcie_set_ecrc_checking(struct pci_dev *dev) { } 1263 static inline void pcie_ecrc_get_policy(char *str) { } 1264 #endif 1265 1266 #define pci_enable_msi(pdev) pci_enable_msi_exact(pdev, 1) 1267 1268 #ifdef CONFIG_HT_IRQ 1269 /* The functions a driver should call */ 1270 int ht_create_irq(struct pci_dev *dev, int idx); 1271 void ht_destroy_irq(unsigned int irq); 1272 #endif /* CONFIG_HT_IRQ */ 1273 1274 void pci_cfg_access_lock(struct pci_dev *dev); 1275 bool pci_cfg_access_trylock(struct pci_dev *dev); 1276 void pci_cfg_access_unlock(struct pci_dev *dev); 1277 1278 /* 1279 * PCI domain support. Sometimes called PCI segment (eg by ACPI), 1280 * a PCI domain is defined to be a set of PCI buses which share 1281 * configuration space. 1282 */ 1283 #ifdef CONFIG_PCI_DOMAINS 1284 extern int pci_domains_supported; 1285 #else 1286 enum { pci_domains_supported = 0 }; 1287 static inline int pci_domain_nr(struct pci_bus *bus) { return 0; } 1288 static inline int pci_proc_domain(struct pci_bus *bus) { return 0; } 1289 #endif /* CONFIG_PCI_DOMAINS */ 1290 1291 /* some architectures require additional setup to direct VGA traffic */ 1292 typedef int (*arch_set_vga_state_t)(struct pci_dev *pdev, bool decode, 1293 unsigned int command_bits, u32 flags); 1294 void pci_register_set_vga_state(arch_set_vga_state_t func); 1295 1296 #else /* CONFIG_PCI is not enabled */ 1297 1298 /* 1299 * If the system does not have PCI, clearly these return errors. Define 1300 * these as simple inline functions to avoid hair in drivers. 1301 */ 1302 1303 #define _PCI_NOP(o, s, t) \ 1304 static inline int pci_##o##_config_##s(struct pci_dev *dev, \ 1305 int where, t val) \ 1306 { return PCIBIOS_FUNC_NOT_SUPPORTED; } 1307 1308 #define _PCI_NOP_ALL(o, x) _PCI_NOP(o, byte, u8 x) \ 1309 _PCI_NOP(o, word, u16 x) \ 1310 _PCI_NOP(o, dword, u32 x) 1311 _PCI_NOP_ALL(read, *) 1312 _PCI_NOP_ALL(write,) 1313 1314 static inline struct pci_dev *pci_get_device(unsigned int vendor, 1315 unsigned int device, 1316 struct pci_dev *from) 1317 { return NULL; } 1318 1319 static inline struct pci_dev *pci_get_subsys(unsigned int vendor, 1320 unsigned int device, 1321 unsigned int ss_vendor, 1322 unsigned int ss_device, 1323 struct pci_dev *from) 1324 { return NULL; } 1325 1326 static inline struct pci_dev *pci_get_class(unsigned int class, 1327 struct pci_dev *from) 1328 { return NULL; } 1329 1330 #define pci_dev_present(ids) (0) 1331 #define no_pci_devices() (1) 1332 #define pci_dev_put(dev) do { } while (0) 1333 1334 static inline void pci_set_master(struct pci_dev *dev) { } 1335 static inline int pci_enable_device(struct pci_dev *dev) { return -EIO; } 1336 static inline void pci_disable_device(struct pci_dev *dev) { } 1337 static inline int pci_set_dma_mask(struct pci_dev *dev, u64 mask) 1338 { return -EIO; } 1339 static inline int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask) 1340 { return -EIO; } 1341 static inline int pci_set_dma_max_seg_size(struct pci_dev *dev, 1342 unsigned int size) 1343 { return -EIO; } 1344 static inline int pci_set_dma_seg_boundary(struct pci_dev *dev, 1345 unsigned long mask) 1346 { return -EIO; } 1347 static inline int pci_assign_resource(struct pci_dev *dev, int i) 1348 { return -EBUSY; } 1349 static inline int __pci_register_driver(struct pci_driver *drv, 1350 struct module *owner) 1351 { return 0; } 1352 static inline int pci_register_driver(struct pci_driver *drv) 1353 { return 0; } 1354 static inline void pci_unregister_driver(struct pci_driver *drv) { } 1355 static inline int pci_find_capability(struct pci_dev *dev, int cap) 1356 { return 0; } 1357 static inline int pci_find_next_capability(struct pci_dev *dev, u8 post, 1358 int cap) 1359 { return 0; } 1360 static inline int pci_find_ext_capability(struct pci_dev *dev, int cap) 1361 { return 0; } 1362 1363 /* Power management related routines */ 1364 static inline int pci_save_state(struct pci_dev *dev) { return 0; } 1365 static inline void pci_restore_state(struct pci_dev *dev) { } 1366 static inline int pci_set_power_state(struct pci_dev *dev, pci_power_t state) 1367 { return 0; } 1368 static inline int pci_wake_from_d3(struct pci_dev *dev, bool enable) 1369 { return 0; } 1370 static inline pci_power_t pci_choose_state(struct pci_dev *dev, 1371 pm_message_t state) 1372 { return PCI_D0; } 1373 static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, 1374 int enable) 1375 { return 0; } 1376 1377 static inline int pci_request_regions(struct pci_dev *dev, const char *res_name) 1378 { return -EIO; } 1379 static inline void pci_release_regions(struct pci_dev *dev) { } 1380 1381 #define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0) 1382 1383 static inline void pci_block_cfg_access(struct pci_dev *dev) { } 1384 static inline int pci_block_cfg_access_in_atomic(struct pci_dev *dev) 1385 { return 0; } 1386 static inline void pci_unblock_cfg_access(struct pci_dev *dev) { } 1387 1388 static inline struct pci_bus *pci_find_next_bus(const struct pci_bus *from) 1389 { return NULL; } 1390 static inline struct pci_dev *pci_get_slot(struct pci_bus *bus, 1391 unsigned int devfn) 1392 { return NULL; } 1393 static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus, 1394 unsigned int devfn) 1395 { return NULL; } 1396 1397 static inline int pci_domain_nr(struct pci_bus *bus) { return 0; } 1398 static inline struct pci_dev *pci_dev_get(struct pci_dev *dev) { return NULL; } 1399 1400 #define dev_is_pci(d) (false) 1401 #define dev_is_pf(d) (false) 1402 #define dev_num_vf(d) (0) 1403 #endif /* CONFIG_PCI */ 1404 1405 /* Include architecture-dependent settings and functions */ 1406 1407 #include <asm/pci.h> 1408 1409 /* these helpers provide future and backwards compatibility 1410 * for accessing popular PCI BAR info */ 1411 #define pci_resource_start(dev, bar) ((dev)->resource[(bar)].start) 1412 #define pci_resource_end(dev, bar) ((dev)->resource[(bar)].end) 1413 #define pci_resource_flags(dev, bar) ((dev)->resource[(bar)].flags) 1414 #define pci_resource_len(dev,bar) \ 1415 ((pci_resource_start((dev), (bar)) == 0 && \ 1416 pci_resource_end((dev), (bar)) == \ 1417 pci_resource_start((dev), (bar))) ? 0 : \ 1418 \ 1419 (pci_resource_end((dev), (bar)) - \ 1420 pci_resource_start((dev), (bar)) + 1)) 1421 1422 /* Similar to the helpers above, these manipulate per-pci_dev 1423 * driver-specific data. They are really just a wrapper around 1424 * the generic device structure functions of these calls. 1425 */ 1426 static inline void *pci_get_drvdata(struct pci_dev *pdev) 1427 { 1428 return dev_get_drvdata(&pdev->dev); 1429 } 1430 1431 static inline void pci_set_drvdata(struct pci_dev *pdev, void *data) 1432 { 1433 dev_set_drvdata(&pdev->dev, data); 1434 } 1435 1436 /* If you want to know what to call your pci_dev, ask this function. 1437 * Again, it's a wrapper around the generic device. 1438 */ 1439 static inline const char *pci_name(const struct pci_dev *pdev) 1440 { 1441 return dev_name(&pdev->dev); 1442 } 1443 1444 1445 /* Some archs don't want to expose struct resource to userland as-is 1446 * in sysfs and /proc 1447 */ 1448 #ifndef HAVE_ARCH_PCI_RESOURCE_TO_USER 1449 static inline void pci_resource_to_user(const struct pci_dev *dev, int bar, 1450 const struct resource *rsrc, resource_size_t *start, 1451 resource_size_t *end) 1452 { 1453 *start = rsrc->start; 1454 *end = rsrc->end; 1455 } 1456 #endif /* HAVE_ARCH_PCI_RESOURCE_TO_USER */ 1457 1458 1459 /* 1460 * The world is not perfect and supplies us with broken PCI devices. 1461 * For at least a part of these bugs we need a work-around, so both 1462 * generic (drivers/pci/quirks.c) and per-architecture code can define 1463 * fixup hooks to be called for particular buggy devices. 1464 */ 1465 1466 struct pci_fixup { 1467 u16 vendor; /* You can use PCI_ANY_ID here of course */ 1468 u16 device; /* You can use PCI_ANY_ID here of course */ 1469 u32 class; /* You can use PCI_ANY_ID here too */ 1470 unsigned int class_shift; /* should be 0, 8, 16 */ 1471 void (*hook)(struct pci_dev *dev); 1472 }; 1473 1474 enum pci_fixup_pass { 1475 pci_fixup_early, /* Before probing BARs */ 1476 pci_fixup_header, /* After reading configuration header */ 1477 pci_fixup_final, /* Final phase of device fixups */ 1478 pci_fixup_enable, /* pci_enable_device() time */ 1479 pci_fixup_resume, /* pci_device_resume() */ 1480 pci_fixup_suspend, /* pci_device_suspend() */ 1481 pci_fixup_resume_early, /* pci_device_resume_early() */ 1482 pci_fixup_suspend_late, /* pci_device_suspend_late() */ 1483 }; 1484 1485 /* Anonymous variables would be nice... */ 1486 #define DECLARE_PCI_FIXUP_SECTION(section, name, vendor, device, class, \ 1487 class_shift, hook) \ 1488 static const struct pci_fixup __PASTE(__pci_fixup_##name,__LINE__) __used \ 1489 __attribute__((__section__(#section), aligned((sizeof(void *))))) \ 1490 = { vendor, device, class, class_shift, hook }; 1491 1492 #define DECLARE_PCI_FIXUP_CLASS_EARLY(vendor, device, class, \ 1493 class_shift, hook) \ 1494 DECLARE_PCI_FIXUP_SECTION(.pci_fixup_early, \ 1495 hook, vendor, device, class, class_shift, hook) 1496 #define DECLARE_PCI_FIXUP_CLASS_HEADER(vendor, device, class, \ 1497 class_shift, hook) \ 1498 DECLARE_PCI_FIXUP_SECTION(.pci_fixup_header, \ 1499 hook, vendor, device, class, class_shift, hook) 1500 #define DECLARE_PCI_FIXUP_CLASS_FINAL(vendor, device, class, \ 1501 class_shift, hook) \ 1502 DECLARE_PCI_FIXUP_SECTION(.pci_fixup_final, \ 1503 hook, vendor, device, class, class_shift, hook) 1504 #define DECLARE_PCI_FIXUP_CLASS_ENABLE(vendor, device, class, \ 1505 class_shift, hook) \ 1506 DECLARE_PCI_FIXUP_SECTION(.pci_fixup_enable, \ 1507 hook, vendor, device, class, class_shift, hook) 1508 #define DECLARE_PCI_FIXUP_CLASS_RESUME(vendor, device, class, \ 1509 class_shift, hook) \ 1510 DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume, \ 1511 resume##hook, vendor, device, class, \ 1512 class_shift, hook) 1513 #define DECLARE_PCI_FIXUP_CLASS_RESUME_EARLY(vendor, device, class, \ 1514 class_shift, hook) \ 1515 DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume_early, \ 1516 resume_early##hook, vendor, device, \ 1517 class, class_shift, hook) 1518 #define DECLARE_PCI_FIXUP_CLASS_SUSPEND(vendor, device, class, \ 1519 class_shift, hook) \ 1520 DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \ 1521 suspend##hook, vendor, device, class, \ 1522 class_shift, hook) 1523 #define DECLARE_PCI_FIXUP_CLASS_SUSPEND_LATE(vendor, device, class, \ 1524 class_shift, hook) \ 1525 DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend_late, \ 1526 suspend_late##hook, vendor, device, \ 1527 class, class_shift, hook) 1528 1529 #define DECLARE_PCI_FIXUP_EARLY(vendor, device, hook) \ 1530 DECLARE_PCI_FIXUP_SECTION(.pci_fixup_early, \ 1531 hook, vendor, device, PCI_ANY_ID, 0, hook) 1532 #define DECLARE_PCI_FIXUP_HEADER(vendor, device, hook) \ 1533 DECLARE_PCI_FIXUP_SECTION(.pci_fixup_header, \ 1534 hook, vendor, device, PCI_ANY_ID, 0, hook) 1535 #define DECLARE_PCI_FIXUP_FINAL(vendor, device, hook) \ 1536 DECLARE_PCI_FIXUP_SECTION(.pci_fixup_final, \ 1537 hook, vendor, device, PCI_ANY_ID, 0, hook) 1538 #define DECLARE_PCI_FIXUP_ENABLE(vendor, device, hook) \ 1539 DECLARE_PCI_FIXUP_SECTION(.pci_fixup_enable, \ 1540 hook, vendor, device, PCI_ANY_ID, 0, hook) 1541 #define DECLARE_PCI_FIXUP_RESUME(vendor, device, hook) \ 1542 DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume, \ 1543 resume##hook, vendor, device, \ 1544 PCI_ANY_ID, 0, hook) 1545 #define DECLARE_PCI_FIXUP_RESUME_EARLY(vendor, device, hook) \ 1546 DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume_early, \ 1547 resume_early##hook, vendor, device, \ 1548 PCI_ANY_ID, 0, hook) 1549 #define DECLARE_PCI_FIXUP_SUSPEND(vendor, device, hook) \ 1550 DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \ 1551 suspend##hook, vendor, device, \ 1552 PCI_ANY_ID, 0, hook) 1553 #define DECLARE_PCI_FIXUP_SUSPEND_LATE(vendor, device, hook) \ 1554 DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend_late, \ 1555 suspend_late##hook, vendor, device, \ 1556 PCI_ANY_ID, 0, hook) 1557 1558 #ifdef CONFIG_PCI_QUIRKS 1559 void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev); 1560 struct pci_dev *pci_get_dma_source(struct pci_dev *dev); 1561 int pci_dev_specific_acs_enabled(struct pci_dev *dev, u16 acs_flags); 1562 void pci_dev_specific_enable_acs(struct pci_dev *dev); 1563 #else 1564 static inline void pci_fixup_device(enum pci_fixup_pass pass, 1565 struct pci_dev *dev) { } 1566 static inline struct pci_dev *pci_get_dma_source(struct pci_dev *dev) 1567 { 1568 return pci_dev_get(dev); 1569 } 1570 static inline int pci_dev_specific_acs_enabled(struct pci_dev *dev, 1571 u16 acs_flags) 1572 { 1573 return -ENOTTY; 1574 } 1575 static inline void pci_dev_specific_enable_acs(struct pci_dev *dev) { } 1576 #endif 1577 1578 void __iomem *pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen); 1579 void pcim_iounmap(struct pci_dev *pdev, void __iomem *addr); 1580 void __iomem * const *pcim_iomap_table(struct pci_dev *pdev); 1581 int pcim_iomap_regions(struct pci_dev *pdev, int mask, const char *name); 1582 int pcim_iomap_regions_request_all(struct pci_dev *pdev, int mask, 1583 const char *name); 1584 void pcim_iounmap_regions(struct pci_dev *pdev, int mask); 1585 1586 extern int pci_pci_problems; 1587 #define PCIPCI_FAIL 1 /* No PCI PCI DMA */ 1588 #define PCIPCI_TRITON 2 1589 #define PCIPCI_NATOMA 4 1590 #define PCIPCI_VIAETBF 8 1591 #define PCIPCI_VSFX 16 1592 #define PCIPCI_ALIMAGIK 32 /* Need low latency setting */ 1593 #define PCIAGP_FAIL 64 /* No PCI to AGP DMA */ 1594 1595 extern unsigned long pci_cardbus_io_size; 1596 extern unsigned long pci_cardbus_mem_size; 1597 extern u8 pci_dfl_cache_line_size; 1598 extern u8 pci_cache_line_size; 1599 1600 extern unsigned long pci_hotplug_io_size; 1601 extern unsigned long pci_hotplug_mem_size; 1602 1603 /* Architecture-specific versions may override these (weak) */ 1604 void pcibios_disable_device(struct pci_dev *dev); 1605 void pcibios_set_master(struct pci_dev *dev); 1606 int pcibios_set_pcie_reset_state(struct pci_dev *dev, 1607 enum pcie_reset_state state); 1608 int pcibios_add_device(struct pci_dev *dev); 1609 void pcibios_release_device(struct pci_dev *dev); 1610 void pcibios_penalize_isa_irq(int irq, int active); 1611 1612 #ifdef CONFIG_HIBERNATE_CALLBACKS 1613 extern struct dev_pm_ops pcibios_pm_ops; 1614 #endif 1615 1616 #ifdef CONFIG_PCI_MMCONFIG 1617 void __init pci_mmcfg_early_init(void); 1618 void __init pci_mmcfg_late_init(void); 1619 #else 1620 static inline void pci_mmcfg_early_init(void) { } 1621 static inline void pci_mmcfg_late_init(void) { } 1622 #endif 1623 1624 int pci_ext_cfg_avail(void); 1625 1626 void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar); 1627 1628 #ifdef CONFIG_PCI_IOV 1629 int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn); 1630 void pci_disable_sriov(struct pci_dev *dev); 1631 int pci_num_vf(struct pci_dev *dev); 1632 int pci_vfs_assigned(struct pci_dev *dev); 1633 int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs); 1634 int pci_sriov_get_totalvfs(struct pci_dev *dev); 1635 #else 1636 static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn) 1637 { return -ENODEV; } 1638 static inline void pci_disable_sriov(struct pci_dev *dev) { } 1639 static inline int pci_num_vf(struct pci_dev *dev) { return 0; } 1640 static inline int pci_vfs_assigned(struct pci_dev *dev) 1641 { return 0; } 1642 static inline int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs) 1643 { return 0; } 1644 static inline int pci_sriov_get_totalvfs(struct pci_dev *dev) 1645 { return 0; } 1646 #endif 1647 1648 #if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE) 1649 void pci_hp_create_module_link(struct pci_slot *pci_slot); 1650 void pci_hp_remove_module_link(struct pci_slot *pci_slot); 1651 #endif 1652 1653 /** 1654 * pci_pcie_cap - get the saved PCIe capability offset 1655 * @dev: PCI device 1656 * 1657 * PCIe capability offset is calculated at PCI device initialization 1658 * time and saved in the data structure. This function returns saved 1659 * PCIe capability offset. Using this instead of pci_find_capability() 1660 * reduces unnecessary search in the PCI configuration space. If you 1661 * need to calculate PCIe capability offset from raw device for some 1662 * reasons, please use pci_find_capability() instead. 1663 */ 1664 static inline int pci_pcie_cap(struct pci_dev *dev) 1665 { 1666 return dev->pcie_cap; 1667 } 1668 1669 /** 1670 * pci_is_pcie - check if the PCI device is PCI Express capable 1671 * @dev: PCI device 1672 * 1673 * Returns: true if the PCI device is PCI Express capable, false otherwise. 1674 */ 1675 static inline bool pci_is_pcie(struct pci_dev *dev) 1676 { 1677 return pci_pcie_cap(dev); 1678 } 1679 1680 /** 1681 * pcie_caps_reg - get the PCIe Capabilities Register 1682 * @dev: PCI device 1683 */ 1684 static inline u16 pcie_caps_reg(const struct pci_dev *dev) 1685 { 1686 return dev->pcie_flags_reg; 1687 } 1688 1689 /** 1690 * pci_pcie_type - get the PCIe device/port type 1691 * @dev: PCI device 1692 */ 1693 static inline int pci_pcie_type(const struct pci_dev *dev) 1694 { 1695 return (pcie_caps_reg(dev) & PCI_EXP_FLAGS_TYPE) >> 4; 1696 } 1697 1698 void pci_request_acs(void); 1699 bool pci_acs_enabled(struct pci_dev *pdev, u16 acs_flags); 1700 bool pci_acs_path_enabled(struct pci_dev *start, 1701 struct pci_dev *end, u16 acs_flags); 1702 1703 #define PCI_VPD_LRDT 0x80 /* Large Resource Data Type */ 1704 #define PCI_VPD_LRDT_ID(x) (x | PCI_VPD_LRDT) 1705 1706 /* Large Resource Data Type Tag Item Names */ 1707 #define PCI_VPD_LTIN_ID_STRING 0x02 /* Identifier String */ 1708 #define PCI_VPD_LTIN_RO_DATA 0x10 /* Read-Only Data */ 1709 #define PCI_VPD_LTIN_RW_DATA 0x11 /* Read-Write Data */ 1710 1711 #define PCI_VPD_LRDT_ID_STRING PCI_VPD_LRDT_ID(PCI_VPD_LTIN_ID_STRING) 1712 #define PCI_VPD_LRDT_RO_DATA PCI_VPD_LRDT_ID(PCI_VPD_LTIN_RO_DATA) 1713 #define PCI_VPD_LRDT_RW_DATA PCI_VPD_LRDT_ID(PCI_VPD_LTIN_RW_DATA) 1714 1715 /* Small Resource Data Type Tag Item Names */ 1716 #define PCI_VPD_STIN_END 0x78 /* End */ 1717 1718 #define PCI_VPD_SRDT_END PCI_VPD_STIN_END 1719 1720 #define PCI_VPD_SRDT_TIN_MASK 0x78 1721 #define PCI_VPD_SRDT_LEN_MASK 0x07 1722 1723 #define PCI_VPD_LRDT_TAG_SIZE 3 1724 #define PCI_VPD_SRDT_TAG_SIZE 1 1725 1726 #define PCI_VPD_INFO_FLD_HDR_SIZE 3 1727 1728 #define PCI_VPD_RO_KEYWORD_PARTNO "PN" 1729 #define PCI_VPD_RO_KEYWORD_MFR_ID "MN" 1730 #define PCI_VPD_RO_KEYWORD_VENDOR0 "V0" 1731 #define PCI_VPD_RO_KEYWORD_CHKSUM "RV" 1732 1733 /** 1734 * pci_vpd_lrdt_size - Extracts the Large Resource Data Type length 1735 * @lrdt: Pointer to the beginning of the Large Resource Data Type tag 1736 * 1737 * Returns the extracted Large Resource Data Type length. 1738 */ 1739 static inline u16 pci_vpd_lrdt_size(const u8 *lrdt) 1740 { 1741 return (u16)lrdt[1] + ((u16)lrdt[2] << 8); 1742 } 1743 1744 /** 1745 * pci_vpd_srdt_size - Extracts the Small Resource Data Type length 1746 * @lrdt: Pointer to the beginning of the Small Resource Data Type tag 1747 * 1748 * Returns the extracted Small Resource Data Type length. 1749 */ 1750 static inline u8 pci_vpd_srdt_size(const u8 *srdt) 1751 { 1752 return (*srdt) & PCI_VPD_SRDT_LEN_MASK; 1753 } 1754 1755 /** 1756 * pci_vpd_info_field_size - Extracts the information field length 1757 * @lrdt: Pointer to the beginning of an information field header 1758 * 1759 * Returns the extracted information field length. 1760 */ 1761 static inline u8 pci_vpd_info_field_size(const u8 *info_field) 1762 { 1763 return info_field[2]; 1764 } 1765 1766 /** 1767 * pci_vpd_find_tag - Locates the Resource Data Type tag provided 1768 * @buf: Pointer to buffered vpd data 1769 * @off: The offset into the buffer at which to begin the search 1770 * @len: The length of the vpd buffer 1771 * @rdt: The Resource Data Type to search for 1772 * 1773 * Returns the index where the Resource Data Type was found or 1774 * -ENOENT otherwise. 1775 */ 1776 int pci_vpd_find_tag(const u8 *buf, unsigned int off, unsigned int len, u8 rdt); 1777 1778 /** 1779 * pci_vpd_find_info_keyword - Locates an information field keyword in the VPD 1780 * @buf: Pointer to buffered vpd data 1781 * @off: The offset into the buffer at which to begin the search 1782 * @len: The length of the buffer area, relative to off, in which to search 1783 * @kw: The keyword to search for 1784 * 1785 * Returns the index where the information field keyword was found or 1786 * -ENOENT otherwise. 1787 */ 1788 int pci_vpd_find_info_keyword(const u8 *buf, unsigned int off, 1789 unsigned int len, const char *kw); 1790 1791 /* PCI <-> OF binding helpers */ 1792 #ifdef CONFIG_OF 1793 struct device_node; 1794 void pci_set_of_node(struct pci_dev *dev); 1795 void pci_release_of_node(struct pci_dev *dev); 1796 void pci_set_bus_of_node(struct pci_bus *bus); 1797 void pci_release_bus_of_node(struct pci_bus *bus); 1798 1799 /* Arch may override this (weak) */ 1800 struct device_node *pcibios_get_phb_of_node(struct pci_bus *bus); 1801 1802 static inline struct device_node * 1803 pci_device_to_OF_node(const struct pci_dev *pdev) 1804 { 1805 return pdev ? pdev->dev.of_node : NULL; 1806 } 1807 1808 static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus) 1809 { 1810 return bus ? bus->dev.of_node : NULL; 1811 } 1812 1813 #else /* CONFIG_OF */ 1814 static inline void pci_set_of_node(struct pci_dev *dev) { } 1815 static inline void pci_release_of_node(struct pci_dev *dev) { } 1816 static inline void pci_set_bus_of_node(struct pci_bus *bus) { } 1817 static inline void pci_release_bus_of_node(struct pci_bus *bus) { } 1818 #endif /* CONFIG_OF */ 1819 1820 #ifdef CONFIG_EEH 1821 static inline struct eeh_dev *pci_dev_to_eeh_dev(struct pci_dev *pdev) 1822 { 1823 return pdev->dev.archdata.edev; 1824 } 1825 #endif 1826 1827 int pci_for_each_dma_alias(struct pci_dev *pdev, 1828 int (*fn)(struct pci_dev *pdev, 1829 u16 alias, void *data), void *data); 1830 1831 /** 1832 * pci_find_upstream_pcie_bridge - find upstream PCIe-to-PCI bridge of a device 1833 * @pdev: the PCI device 1834 * 1835 * if the device is PCIE, return NULL 1836 * if the device isn't connected to a PCIe bridge (that is its parent is a 1837 * legacy PCI bridge and the bridge is directly connected to bus 0), return its 1838 * parent 1839 */ 1840 struct pci_dev *pci_find_upstream_pcie_bridge(struct pci_dev *pdev); 1841 1842 #endif /* LINUX_PCI_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-3.17-rc1.tar.xz drivers/media/radio/radio-maxiradio.ko 104_1a CPAchecker Bug Fixed 2016-06-04 01:35:43 L0239

Комментарий

Reported: 4 Jun 2016

[В начало]