extern void __VERIFIER_error() __attribute__ ((__noreturn__)); /* Generated by CIL v. 1.5.1 */ /* print_CIL_Input is false */ struct va_list; typedef __builtin_va_list __gnuc_va_list; typedef __gnuc_va_list va_list; typedef unsigned char __u8; typedef unsigned short __u16; typedef int __s32; typedef unsigned int __u32; typedef unsigned long long __u64; typedef signed char s8; typedef unsigned char u8; typedef unsigned short u16; typedef int s32; typedef unsigned int u32; typedef long long s64; typedef unsigned long long u64; typedef long __kernel_long_t; typedef unsigned long __kernel_ulong_t; typedef int __kernel_pid_t; typedef unsigned int __kernel_uid32_t; typedef unsigned int __kernel_gid32_t; typedef __kernel_ulong_t __kernel_size_t; typedef __kernel_long_t __kernel_ssize_t; typedef long long __kernel_loff_t; typedef __kernel_long_t __kernel_time_t; typedef __kernel_long_t __kernel_clock_t; typedef int __kernel_timer_t; typedef int __kernel_clockid_t; typedef __u32 __le32; struct kernel_symbol { unsigned long value ; char const *name ; }; struct module; typedef __u32 __kernel_dev_t; typedef __kernel_dev_t dev_t; typedef unsigned short umode_t; typedef __kernel_pid_t pid_t; typedef __kernel_clockid_t clockid_t; typedef _Bool bool; typedef __kernel_uid32_t uid_t; typedef __kernel_gid32_t gid_t; typedef __kernel_loff_t loff_t; typedef __kernel_size_t size_t; typedef __kernel_ssize_t ssize_t; typedef __kernel_time_t time_t; typedef __s32 int32_t; typedef __u32 uint32_t; typedef unsigned long sector_t; typedef unsigned long blkcnt_t; typedef u64 dma_addr_t; typedef unsigned int gfp_t; typedef unsigned int fmode_t; typedef unsigned int oom_flags_t; typedef u64 phys_addr_t; typedef phys_addr_t resource_size_t; struct __anonstruct_atomic_t_6 { int counter ; }; typedef struct __anonstruct_atomic_t_6 atomic_t; struct __anonstruct_atomic64_t_7 { long counter ; }; typedef struct __anonstruct_atomic64_t_7 atomic64_t; struct list_head { struct list_head *next ; struct list_head *prev ; }; struct hlist_node; struct hlist_head { struct hlist_node *first ; }; struct hlist_node { struct hlist_node *next ; struct hlist_node **pprev ; }; struct callback_head { struct callback_head *next ; void (*func)(struct callback_head * ) ; }; 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 ; }; struct __anonstruct____missing_field_name_9 { unsigned int a ; unsigned int b ; }; struct __anonstruct____missing_field_name_10 { u16 limit0 ; u16 base0 ; unsigned char base1 ; unsigned char type : 4 ; unsigned char s : 1 ; unsigned char dpl : 2 ; unsigned char p : 1 ; unsigned char limit : 4 ; unsigned char avl : 1 ; unsigned char l : 1 ; unsigned char d : 1 ; unsigned char g : 1 ; unsigned char base2 ; }; union __anonunion____missing_field_name_8 { struct __anonstruct____missing_field_name_9 __annonCompField4 ; struct __anonstruct____missing_field_name_10 __annonCompField5 ; }; struct desc_struct { union __anonunion____missing_field_name_8 __annonCompField6 ; }; typedef unsigned long pteval_t; typedef unsigned long pgdval_t; typedef unsigned long pgprotval_t; struct __anonstruct_pte_t_11 { pteval_t pte ; }; typedef struct __anonstruct_pte_t_11 pte_t; struct pgprot { pgprotval_t pgprot ; }; typedef struct pgprot pgprot_t; struct __anonstruct_pgd_t_12 { pgdval_t pgd ; }; typedef struct __anonstruct_pgd_t_12 pgd_t; struct page; typedef struct page *pgtable_t; struct file; struct seq_file; struct thread_struct; struct mm_struct; struct task_struct; struct cpumask; struct paravirt_callee_save { void *func ; }; struct pv_irq_ops { struct paravirt_callee_save save_fl ; struct paravirt_callee_save restore_fl ; struct paravirt_callee_save irq_disable ; struct paravirt_callee_save irq_enable ; void (*safe_halt)(void) ; void (*halt)(void) ; void (*adjust_exception_frame)(void) ; }; struct qspinlock { atomic_t val ; }; typedef struct qspinlock arch_spinlock_t; struct qrwlock { atomic_t cnts ; arch_spinlock_t lock ; }; typedef struct qrwlock arch_rwlock_t; typedef void (*ctor_fn_t)(void); struct va_format { char const *fmt ; va_list *va ; }; struct device; struct file_operations; struct completion; struct bug_entry { int bug_addr_disp ; int file_disp ; unsigned short line ; unsigned short flags ; }; struct timespec; struct compat_timespec; struct __anonstruct_futex_16 { u32 *uaddr ; u32 val ; u32 flags ; u32 bitset ; u64 time ; u32 *uaddr2 ; }; struct __anonstruct_nanosleep_17 { clockid_t clockid ; struct timespec *rmtp ; struct compat_timespec *compat_rmtp ; u64 expires ; }; struct pollfd; struct __anonstruct_poll_18 { struct pollfd *ufds ; int nfds ; int has_timeout ; unsigned long tv_sec ; unsigned long tv_nsec ; }; union __anonunion____missing_field_name_15 { struct __anonstruct_futex_16 futex ; struct __anonstruct_nanosleep_17 nanosleep ; struct __anonstruct_poll_18 poll ; }; struct restart_block { long (*fn)(struct restart_block * ) ; union __anonunion____missing_field_name_15 __annonCompField7 ; }; 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 ; }; union __anonunion____missing_field_name_19 { struct pt_regs *regs ; struct kernel_vm86_regs *vm86 ; }; struct math_emu_info { long ___orig_eip ; union __anonunion____missing_field_name_19 __annonCompField8 ; }; struct cpumask { unsigned long bits[128U] ; }; typedef struct cpumask cpumask_t; typedef struct cpumask *cpumask_var_t; struct static_key; struct fregs_state { u32 cwd ; u32 swd ; u32 twd ; u32 fip ; u32 fcs ; u32 foo ; u32 fos ; u32 st_space[20U] ; u32 status ; }; struct __anonstruct____missing_field_name_29 { u64 rip ; u64 rdp ; }; struct __anonstruct____missing_field_name_30 { u32 fip ; u32 fcs ; u32 foo ; u32 fos ; }; union __anonunion____missing_field_name_28 { struct __anonstruct____missing_field_name_29 __annonCompField12 ; struct __anonstruct____missing_field_name_30 __annonCompField13 ; }; union __anonunion____missing_field_name_31 { u32 padding1[12U] ; u32 sw_reserved[12U] ; }; struct fxregs_state { u16 cwd ; u16 swd ; u16 twd ; u16 fop ; union __anonunion____missing_field_name_28 __annonCompField14 ; u32 mxcsr ; u32 mxcsr_mask ; u32 st_space[32U] ; u32 xmm_space[64U] ; u32 padding[12U] ; union __anonunion____missing_field_name_31 __annonCompField15 ; }; struct swregs_state { u32 cwd ; u32 swd ; u32 twd ; u32 fip ; u32 fcs ; u32 foo ; u32 fos ; u32 st_space[20U] ; u8 ftop ; u8 changed ; u8 lookahead ; u8 no_update ; u8 rm ; u8 alimit ; struct math_emu_info *info ; u32 entry_eip ; }; struct xstate_header { u64 xfeatures ; u64 xcomp_bv ; u64 reserved[6U] ; }; struct xregs_state { struct fxregs_state i387 ; struct xstate_header header ; u8 __reserved[464U] ; }; union fpregs_state { struct fregs_state fsave ; struct fxregs_state fxsave ; struct swregs_state soft ; struct xregs_state xsave ; }; struct fpu { union fpregs_state state ; unsigned int last_cpu ; unsigned char fpstate_active ; unsigned char fpregs_active ; unsigned char counter ; }; struct seq_operations; struct perf_event; struct thread_struct { struct desc_struct tls_array[3U] ; unsigned long sp0 ; unsigned long sp ; unsigned short es ; unsigned short ds ; unsigned short fsindex ; unsigned short gsindex ; unsigned long fs ; unsigned long gs ; struct fpu fpu ; struct perf_event *ptrace_bps[4U] ; unsigned long debugreg6 ; unsigned long ptrace_dr7 ; unsigned long cr2 ; unsigned long trap_nr ; unsigned long error_code ; unsigned long *io_bitmap_ptr ; unsigned long iopl ; unsigned int io_bitmap_max ; }; typedef atomic64_t atomic_long_t; typedef int pao_T__; typedef int pao_T_____0; struct lockdep_map; struct stack_trace { unsigned int nr_entries ; unsigned int max_entries ; unsigned long *entries ; int skip ; }; struct lockdep_subclass_key { char __one_byte ; }; struct lock_class_key { struct lockdep_subclass_key subkeys[8U] ; }; 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 ; char const *name ; int name_version ; unsigned long contention_point[4U] ; unsigned long contending_point[4U] ; }; struct lockdep_map { struct lock_class_key *key ; struct lock_class *class_cache[2U] ; char const *name ; int cpu ; unsigned long ip ; }; 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 : 13 ; unsigned char irq_context : 2 ; unsigned char trylock : 1 ; unsigned char read : 2 ; unsigned char check : 1 ; unsigned char hardirqs_off : 1 ; unsigned short references : 12 ; unsigned int pin_count ; }; struct raw_spinlock { arch_spinlock_t raw_lock ; unsigned int magic ; unsigned int owner_cpu ; void *owner ; struct lockdep_map dep_map ; }; typedef struct raw_spinlock raw_spinlock_t; struct __anonstruct____missing_field_name_35 { u8 __padding[24U] ; struct lockdep_map dep_map ; }; union __anonunion____missing_field_name_34 { struct raw_spinlock rlock ; struct __anonstruct____missing_field_name_35 __annonCompField17 ; }; struct spinlock { union __anonunion____missing_field_name_34 __annonCompField18 ; }; typedef struct spinlock spinlock_t; struct __anonstruct_rwlock_t_36 { arch_rwlock_t raw_lock ; unsigned int magic ; unsigned int owner_cpu ; void *owner ; struct lockdep_map dep_map ; }; typedef struct __anonstruct_rwlock_t_36 rwlock_t; struct static_key { atomic_t enabled ; }; struct seqcount { unsigned int sequence ; struct lockdep_map dep_map ; }; typedef struct seqcount seqcount_t; struct __anonstruct_seqlock_t_45 { struct seqcount seqcount ; spinlock_t lock ; }; typedef struct __anonstruct_seqlock_t_45 seqlock_t; struct timespec { __kernel_time_t tv_sec ; long tv_nsec ; }; struct user_namespace; struct __anonstruct_kuid_t_46 { uid_t val ; }; typedef struct __anonstruct_kuid_t_46 kuid_t; struct __anonstruct_kgid_t_47 { gid_t val ; }; typedef struct __anonstruct_kgid_t_47 kgid_t; 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 ; }; struct vm_area_struct; struct __wait_queue_head { spinlock_t lock ; struct list_head task_list ; }; typedef struct __wait_queue_head wait_queue_head_t; struct __anonstruct_nodemask_t_48 { unsigned long bits[16U] ; }; typedef struct __anonstruct_nodemask_t_48 nodemask_t; struct optimistic_spin_queue { atomic_t tail ; }; struct mutex { atomic_t count ; spinlock_t wait_lock ; struct list_head wait_list ; struct task_struct *owner ; void *magic ; struct lockdep_map dep_map ; }; struct mutex_waiter { struct list_head list ; struct task_struct *task ; void *magic ; }; struct rw_semaphore; 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 ; }; struct completion { unsigned int done ; wait_queue_head_t wait ; }; union ktime { s64 tv64 ; }; typedef union ktime ktime_t; struct timer_list { struct hlist_node entry ; unsigned long expires ; void (*function)(unsigned long ) ; unsigned long data ; u32 flags ; int slack ; int start_pid ; void *start_site ; char start_comm[16U] ; struct lockdep_map lockdep_map ; }; struct hrtimer; enum hrtimer_restart; struct rb_node { unsigned long __rb_parent_color ; struct rb_node *rb_right ; struct rb_node *rb_left ; }; struct rb_root { struct rb_node *rb_node ; }; struct nsproxy; struct workqueue_struct; struct work_struct; struct work_struct { atomic_long_t data ; struct list_head entry ; void (*func)(struct work_struct * ) ; struct lockdep_map lockdep_map ; }; struct delayed_work { struct work_struct work ; struct timer_list timer ; struct workqueue_struct *wq ; int cpu ; }; struct execute_work { struct work_struct work ; }; struct resource { resource_size_t start ; resource_size_t end ; char const *name ; unsigned long flags ; struct resource *parent ; struct resource *sibling ; struct resource *child ; }; struct pci_dev; struct pm_message { int event ; }; typedef struct pm_message pm_message_t; 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 * ) ; }; enum rpm_status { RPM_ACTIVE = 0, RPM_RESUMING = 1, RPM_SUSPENDED = 2, RPM_SUSPENDING = 3 } ; enum rpm_request { RPM_REQ_NONE = 0, RPM_REQ_IDLE = 1, RPM_REQ_SUSPEND = 2, RPM_REQ_AUTOSUSPEND = 3, RPM_REQ_RESUME = 4 } ; struct wakeup_source; struct wake_irq; struct pm_subsys_data { spinlock_t lock ; unsigned int refcount ; struct list_head clock_list ; }; struct dev_pm_qos; struct dev_pm_info { pm_message_t power_state ; unsigned char can_wakeup : 1 ; unsigned char async_suspend : 1 ; 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 ; struct wake_irq *wakeirq ; atomic_t usage_count ; atomic_t child_count ; unsigned char disable_depth : 3 ; unsigned char idle_notification : 1 ; unsigned char request_pending : 1 ; unsigned char deferred_resume : 1 ; unsigned char run_wake : 1 ; unsigned char runtime_auto : 1 ; unsigned char no_callbacks : 1 ; unsigned char irq_safe : 1 ; unsigned char use_autosuspend : 1 ; unsigned char timer_autosuspends : 1 ; unsigned char memalloc_noio : 1 ; 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 ; }; struct dev_pm_domain { struct dev_pm_ops ops ; void (*detach)(struct device * , bool ) ; int (*activate)(struct device * ) ; void (*sync)(struct device * ) ; void (*dismiss)(struct device * ) ; }; struct pci_bus; struct __anonstruct_mm_context_t_115 { void *ldt ; int size ; unsigned short ia32_compat ; struct mutex lock ; void *vdso ; atomic_t perf_rdpmc_allowed ; }; typedef struct __anonstruct_mm_context_t_115 mm_context_t; struct bio_vec; struct llist_node; struct llist_node { struct llist_node *next ; }; struct call_single_data { struct llist_node llist ; void (*func)(void * ) ; void *info ; unsigned int flags ; }; struct cred; struct inode; struct arch_uprobe_task { unsigned long saved_scratch_register ; unsigned int saved_trap_nr ; unsigned int saved_tf ; }; enum uprobe_task_state { UTASK_RUNNING = 0, UTASK_SSTEP = 1, UTASK_SSTEP_ACK = 2, UTASK_SSTEP_TRAPPED = 3 } ; struct __anonstruct____missing_field_name_148 { struct arch_uprobe_task autask ; unsigned long vaddr ; }; struct __anonstruct____missing_field_name_149 { struct callback_head dup_xol_work ; unsigned long dup_xol_addr ; }; union __anonunion____missing_field_name_147 { struct __anonstruct____missing_field_name_148 __annonCompField33 ; struct __anonstruct____missing_field_name_149 __annonCompField34 ; }; struct uprobe; struct return_instance; struct uprobe_task { enum uprobe_task_state state ; union __anonunion____missing_field_name_147 __annonCompField35 ; struct uprobe *active_uprobe ; unsigned long xol_vaddr ; struct return_instance *return_instances ; unsigned int depth ; }; struct xol_area; struct uprobes_state { struct xol_area *xol_area ; }; struct address_space; struct mem_cgroup; typedef void compound_page_dtor(struct page * ); union __anonunion____missing_field_name_150 { struct address_space *mapping ; void *s_mem ; }; union __anonunion____missing_field_name_152 { unsigned long index ; void *freelist ; bool pfmemalloc ; }; struct __anonstruct____missing_field_name_156 { unsigned short inuse ; unsigned short objects : 15 ; unsigned char frozen : 1 ; }; union __anonunion____missing_field_name_155 { atomic_t _mapcount ; struct __anonstruct____missing_field_name_156 __annonCompField38 ; int units ; }; struct __anonstruct____missing_field_name_154 { union __anonunion____missing_field_name_155 __annonCompField39 ; atomic_t _count ; }; union __anonunion____missing_field_name_153 { unsigned long counters ; struct __anonstruct____missing_field_name_154 __annonCompField40 ; unsigned int active ; }; struct __anonstruct____missing_field_name_151 { union __anonunion____missing_field_name_152 __annonCompField37 ; union __anonunion____missing_field_name_153 __annonCompField41 ; }; struct __anonstruct____missing_field_name_158 { struct page *next ; int pages ; int pobjects ; }; struct slab; struct __anonstruct____missing_field_name_159 { compound_page_dtor *compound_dtor ; unsigned long compound_order ; }; union __anonunion____missing_field_name_157 { struct list_head lru ; struct __anonstruct____missing_field_name_158 __annonCompField43 ; struct slab *slab_page ; struct callback_head callback_head ; struct __anonstruct____missing_field_name_159 __annonCompField44 ; pgtable_t pmd_huge_pte ; }; struct kmem_cache; union __anonunion____missing_field_name_160 { unsigned long private ; spinlock_t *ptl ; struct kmem_cache *slab_cache ; struct page *first_page ; }; struct page { unsigned long flags ; union __anonunion____missing_field_name_150 __annonCompField36 ; struct __anonstruct____missing_field_name_151 __annonCompField42 ; union __anonunion____missing_field_name_157 __annonCompField45 ; union __anonunion____missing_field_name_160 __annonCompField46 ; struct mem_cgroup *mem_cgroup ; }; struct page_frag { struct page *page ; __u32 offset ; __u32 size ; }; struct __anonstruct_shared_161 { struct rb_node rb ; unsigned long rb_subtree_last ; }; struct anon_vma; struct vm_operations_struct; struct mempolicy; struct vm_area_struct { unsigned long vm_start ; unsigned long vm_end ; struct vm_area_struct *vm_next ; struct vm_area_struct *vm_prev ; struct rb_node vm_rb ; unsigned long rb_subtree_gap ; struct mm_struct *vm_mm ; pgprot_t vm_page_prot ; unsigned long vm_flags ; struct __anonstruct_shared_161 shared ; struct list_head anon_vma_chain ; struct anon_vma *anon_vma ; struct vm_operations_struct const *vm_ops ; unsigned long vm_pgoff ; struct file *vm_file ; void *vm_private_data ; struct mempolicy *vm_policy ; }; struct core_thread { struct task_struct *task ; struct core_thread *next ; }; struct core_state { atomic_t nr_threads ; struct core_thread dumper ; struct completion startup ; }; struct task_rss_stat { int events ; int count[3U] ; }; struct mm_rss_stat { atomic_long_t count[3U] ; }; struct kioctx_table; struct linux_binfmt; struct mmu_notifier_mm; struct mm_struct { struct vm_area_struct *mmap ; struct rb_root mm_rb ; u32 vmacache_seqnum ; unsigned long (*get_unmapped_area)(struct file * , unsigned long , unsigned long , unsigned long , unsigned long ) ; unsigned long mmap_base ; unsigned long mmap_legacy_base ; unsigned long task_size ; unsigned long highest_vm_end ; pgd_t *pgd ; atomic_t mm_users ; atomic_t mm_count ; atomic_long_t nr_ptes ; atomic_long_t nr_pmds ; int map_count ; spinlock_t page_table_lock ; struct rw_semaphore mmap_sem ; struct list_head mmlist ; unsigned long hiwater_rss ; unsigned long hiwater_vm ; unsigned long total_vm ; unsigned long locked_vm ; unsigned long pinned_vm ; unsigned long shared_vm ; unsigned long exec_vm ; unsigned long stack_vm ; unsigned long def_flags ; unsigned long start_code ; unsigned long end_code ; unsigned long start_data ; unsigned long end_data ; unsigned long start_brk ; unsigned long brk ; unsigned long start_stack ; unsigned long arg_start ; unsigned long arg_end ; unsigned long env_start ; unsigned long env_end ; unsigned long saved_auxv[46U] ; struct mm_rss_stat rss_stat ; struct linux_binfmt *binfmt ; cpumask_var_t cpu_vm_mask_var ; mm_context_t context ; unsigned long flags ; struct core_state *core_state ; spinlock_t ioctx_lock ; struct kioctx_table *ioctx_table ; struct task_struct *owner ; struct file *exe_file ; struct mmu_notifier_mm *mmu_notifier_mm ; struct cpumask cpumask_allocation ; unsigned long numa_next_scan ; unsigned long numa_scan_offset ; int numa_scan_seq ; bool tlb_flush_pending ; struct uprobes_state uprobes_state ; void *bd_addr ; }; typedef __u64 Elf64_Addr; typedef __u16 Elf64_Half; typedef __u32 Elf64_Word; typedef __u64 Elf64_Xword; 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 ; }; typedef struct elf64_sym Elf64_Sym; union __anonunion____missing_field_name_166 { unsigned long bitmap[4U] ; struct callback_head callback_head ; }; struct idr_layer { int prefix ; int layer ; struct idr_layer *ary[256U] ; int count ; union __anonunion____missing_field_name_166 __annonCompField47 ; }; 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 ; }; struct ida_bitmap { long nr_busy ; unsigned long bitmap[15U] ; }; struct ida { struct idr idr ; struct ida_bitmap *free_bitmap ; }; struct dentry; struct iattr; struct super_block; struct file_system_type; struct kernfs_open_node; struct kernfs_iattrs; struct kernfs_root; struct kernfs_elem_dir { unsigned long subdirs ; struct rb_root children ; struct kernfs_root *root ; }; struct kernfs_node; struct kernfs_elem_symlink { struct kernfs_node *target_kn ; }; struct kernfs_ops; struct kernfs_elem_attr { struct kernfs_ops const *ops ; struct kernfs_open_node *open ; loff_t size ; struct kernfs_node *notify_next ; }; union __anonunion____missing_field_name_171 { struct kernfs_elem_dir dir ; struct kernfs_elem_symlink symlink ; struct kernfs_elem_attr attr ; }; struct kernfs_node { atomic_t count ; atomic_t active ; struct lockdep_map dep_map ; struct kernfs_node *parent ; char const *name ; struct rb_node rb ; void const *ns ; unsigned int hash ; union __anonunion____missing_field_name_171 __annonCompField48 ; void *priv ; unsigned short flags ; umode_t mode ; unsigned int ino ; struct kernfs_iattrs *iattr ; }; 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 * , char const * , umode_t ) ; int (*rmdir)(struct kernfs_node * ) ; int (*rename)(struct kernfs_node * , struct kernfs_node * , char const * ) ; }; 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 ; }; struct kernfs_open_file { struct kernfs_node *kn ; struct file *file ; void *priv ; struct mutex mutex ; int event ; struct list_head list ; char *prealloc_buf ; size_t atomic_write_len ; bool mmapped ; struct vm_operations_struct const *vm_ops ; }; struct kernfs_ops { int (*seq_show)(struct seq_file * , void * ) ; void *(*seq_start)(struct seq_file * , loff_t * ) ; void *(*seq_next)(struct seq_file * , void * , loff_t * ) ; void (*seq_stop)(struct seq_file * , void * ) ; ssize_t (*read)(struct kernfs_open_file * , char * , size_t , loff_t ) ; size_t atomic_write_len ; bool prealloc ; ssize_t (*write)(struct kernfs_open_file * , char * , size_t , loff_t ) ; int (*mmap)(struct kernfs_open_file * , struct vm_area_struct * ) ; struct lock_class_key lockdep_key ; }; struct sock; struct kobject; enum kobj_ns_type { KOBJ_NS_TYPE_NONE = 0, KOBJ_NS_TYPE_NET = 1, KOBJ_NS_TYPES = 2 } ; struct kobj_ns_type_operations { enum kobj_ns_type type ; bool (*current_may_mount)(void) ; void *(*grab_current_ns)(void) ; void const *(*netlink_ns)(struct sock * ) ; void const *(*initial_ns)(void) ; void (*drop_ns)(void * ) ; }; struct bin_attribute; struct attribute { char const *name ; umode_t mode ; bool ignore_lockdep ; struct lock_class_key *key ; struct lock_class_key skey ; }; struct attribute_group { char const *name ; umode_t (*is_visible)(struct kobject * , struct attribute * , int ) ; struct attribute **attrs ; struct bin_attribute **bin_attrs ; }; 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 * ) ; }; struct sysfs_ops { ssize_t (*show)(struct kobject * , struct attribute * , char * ) ; ssize_t (*store)(struct kobject * , struct attribute * , char const * , size_t ) ; }; struct kref { atomic_t refcount ; }; struct kset; struct kobj_type; struct kobject { char const *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 : 1 ; unsigned char state_in_sysfs : 1 ; unsigned char state_add_uevent_sent : 1 ; unsigned char state_remove_uevent_sent : 1 ; unsigned char uevent_suppress : 1 ; }; struct kobj_type { void (*release)(struct kobject * ) ; struct sysfs_ops const *sysfs_ops ; struct attribute **default_attrs ; struct kobj_ns_type_operations const *(*child_ns_type)(struct kobject * ) ; void const *(*namespace)(struct kobject * ) ; }; struct kobj_uevent_env { char *argv[3U] ; char *envp[32U] ; int envp_idx ; char buf[2048U] ; int buflen ; }; struct kset_uevent_ops { int (* const filter)(struct kset * , struct kobject * ) ; char const *(* const name)(struct kset * , struct kobject * ) ; int (* const uevent)(struct kset * , struct kobject * , struct kobj_uevent_env * ) ; }; struct kset { struct list_head list ; spinlock_t list_lock ; struct kobject kobj ; struct kset_uevent_ops const *uevent_ops ; }; struct kernel_param; struct kernel_param_ops { unsigned int flags ; int (*set)(char const * , struct kernel_param const * ) ; int (*get)(char * , struct kernel_param const * ) ; void (*free)(void * ) ; }; struct kparam_string; struct kparam_array; union __anonunion____missing_field_name_172 { void *arg ; struct kparam_string const *str ; struct kparam_array const *arr ; }; struct kernel_param { char const *name ; struct module *mod ; struct kernel_param_ops const *ops ; u16 const perm ; s8 level ; u8 flags ; union __anonunion____missing_field_name_172 __annonCompField49 ; }; struct kparam_string { unsigned int maxlen ; char *string ; }; struct kparam_array { unsigned int max ; unsigned int elemsize ; unsigned int *num ; struct kernel_param_ops const *ops ; void *elem ; }; struct latch_tree_node { struct rb_node node[2U] ; }; struct mod_arch_specific { }; struct module_param_attrs; struct module_kobject { struct kobject kobj ; struct module *mod ; struct kobject *drivers_dir ; struct module_param_attrs *mp ; struct completion *kobj_completion ; }; 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 * , char const * , size_t ) ; void (*setup)(struct module * , char const * ) ; int (*test)(struct module * ) ; void (*free)(struct module * ) ; }; struct exception_table_entry; enum module_state { MODULE_STATE_LIVE = 0, MODULE_STATE_COMING = 1, MODULE_STATE_GOING = 2, MODULE_STATE_UNFORMED = 3 } ; struct mod_tree_node { struct module *mod ; struct latch_tree_node node ; }; struct module_sect_attrs; struct module_notes_attrs; struct tracepoint; struct trace_event_call; struct trace_enum_map; struct module { enum module_state state ; struct list_head list ; char name[56U] ; struct module_kobject mkobj ; struct module_attribute *modinfo_attrs ; char const *version ; char const *srcversion ; struct kobject *holders_dir ; struct kernel_symbol const *syms ; unsigned long const *crcs ; unsigned int num_syms ; struct mutex param_lock ; struct kernel_param *kp ; unsigned int num_kp ; unsigned int num_gpl_syms ; struct kernel_symbol const *gpl_syms ; unsigned long const *gpl_crcs ; struct kernel_symbol const *unused_syms ; unsigned long const *unused_crcs ; unsigned int num_unused_syms ; unsigned int num_unused_gpl_syms ; struct kernel_symbol const *unused_gpl_syms ; unsigned long const *unused_gpl_crcs ; bool sig_ok ; bool async_probe_requested ; struct kernel_symbol const *gpl_future_syms ; unsigned long const *gpl_future_crcs ; unsigned int num_gpl_future_syms ; unsigned int num_exentries ; struct exception_table_entry *extable ; int (*init)(void) ; void *module_init ; void *module_core ; unsigned int init_size ; unsigned int core_size ; unsigned int init_text_size ; unsigned int core_text_size ; struct mod_tree_node mtn_core ; struct mod_tree_node mtn_init ; 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 ; struct tracepoint * const *tracepoints_ptrs ; unsigned int num_trace_bprintk_fmt ; char const **trace_bprintk_fmt_start ; struct trace_event_call **trace_events ; unsigned int num_trace_events ; struct trace_enum_map **trace_enums ; unsigned int num_trace_enums ; unsigned int num_ftrace_callsites ; unsigned long *ftrace_callsites ; bool klp_alive ; struct list_head source_list ; struct list_head target_list ; void (*exit)(void) ; atomic_t refcnt ; ctor_fn_t (**ctors)(void) ; unsigned int num_ctors ; }; struct kernel_cap_struct { __u32 cap[2U] ; }; typedef struct kernel_cap_struct kernel_cap_t; struct plist_node { int prio ; struct list_head prio_list ; struct list_head node_list ; }; typedef unsigned long cputime_t; struct sem_undo_list; struct sysv_sem { struct sem_undo_list *undo_list ; }; struct user_struct; struct sysv_shm { struct list_head shm_clist ; }; struct __anonstruct_sigset_t_180 { unsigned long sig[1U] ; }; typedef struct __anonstruct_sigset_t_180 sigset_t; struct siginfo; typedef void __signalfn_t(int ); typedef __signalfn_t *__sighandler_t; typedef void __restorefn_t(void); typedef __restorefn_t *__sigrestore_t; union sigval { int sival_int ; void *sival_ptr ; }; typedef union sigval sigval_t; struct __anonstruct__kill_182 { __kernel_pid_t _pid ; __kernel_uid32_t _uid ; }; struct __anonstruct__timer_183 { __kernel_timer_t _tid ; int _overrun ; char _pad[0U] ; sigval_t _sigval ; int _sys_private ; }; struct __anonstruct__rt_184 { __kernel_pid_t _pid ; __kernel_uid32_t _uid ; sigval_t _sigval ; }; struct __anonstruct__sigchld_185 { __kernel_pid_t _pid ; __kernel_uid32_t _uid ; int _status ; __kernel_clock_t _utime ; __kernel_clock_t _stime ; }; struct __anonstruct__addr_bnd_187 { void *_lower ; void *_upper ; }; struct __anonstruct__sigfault_186 { void *_addr ; short _addr_lsb ; struct __anonstruct__addr_bnd_187 _addr_bnd ; }; struct __anonstruct__sigpoll_188 { long _band ; int _fd ; }; struct __anonstruct__sigsys_189 { void *_call_addr ; int _syscall ; unsigned int _arch ; }; union __anonunion__sifields_181 { int _pad[28U] ; struct __anonstruct__kill_182 _kill ; struct __anonstruct__timer_183 _timer ; struct __anonstruct__rt_184 _rt ; struct __anonstruct__sigchld_185 _sigchld ; struct __anonstruct__sigfault_186 _sigfault ; struct __anonstruct__sigpoll_188 _sigpoll ; struct __anonstruct__sigsys_189 _sigsys ; }; struct siginfo { int si_signo ; int si_errno ; int si_code ; union __anonunion__sifields_181 _sifields ; }; typedef struct siginfo siginfo_t; struct sigpending { struct list_head list ; sigset_t signal ; }; struct sigaction { __sighandler_t sa_handler ; unsigned long sa_flags ; __sigrestore_t sa_restorer ; sigset_t sa_mask ; }; struct k_sigaction { struct sigaction sa ; }; enum pid_type { PIDTYPE_PID = 0, PIDTYPE_PGID = 1, PIDTYPE_SID = 2, PIDTYPE_MAX = 3 } ; struct pid_namespace; struct upid { int nr ; struct pid_namespace *ns ; struct hlist_node pid_chain ; }; struct pid { atomic_t count ; unsigned int level ; struct hlist_head tasks[3U] ; struct callback_head rcu ; struct upid numbers[1U] ; }; struct pid_link { struct hlist_node node ; struct pid *pid ; }; struct percpu_counter { raw_spinlock_t lock ; s64 count ; struct list_head list ; s32 *counters ; }; struct seccomp_filter; struct seccomp { int mode ; struct seccomp_filter *filter ; }; struct rt_mutex_waiter; struct rlimit { __kernel_ulong_t rlim_cur ; __kernel_ulong_t rlim_max ; }; struct timerqueue_node { struct rb_node node ; ktime_t expires ; }; struct timerqueue_head { struct rb_root head ; struct timerqueue_node *next ; }; struct hrtimer_clock_base; struct hrtimer_cpu_base; enum hrtimer_restart { HRTIMER_NORESTART = 0, HRTIMER_RESTART = 1 } ; 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] ; }; struct hrtimer_clock_base { struct hrtimer_cpu_base *cpu_base ; int index ; clockid_t clockid ; struct timerqueue_head active ; ktime_t (*get_time)(void) ; ktime_t offset ; }; struct hrtimer_cpu_base { raw_spinlock_t lock ; seqcount_t seq ; struct hrtimer *running ; unsigned int cpu ; unsigned int active_bases ; unsigned int clock_was_set_seq ; bool migration_enabled ; bool nohz_active ; unsigned char in_hrtirq : 1 ; unsigned char hres_active : 1 ; unsigned char hang_detected : 1 ; ktime_t expires_next ; struct hrtimer *next_timer ; unsigned int nr_events ; unsigned int nr_retries ; unsigned int nr_hangs ; unsigned int max_hang_time ; struct hrtimer_clock_base clock_base[4U] ; }; struct task_io_accounting { u64 rchar ; u64 wchar ; u64 syscr ; u64 syscw ; u64 read_bytes ; u64 write_bytes ; u64 cancelled_write_bytes ; }; struct latency_record { unsigned long backtrace[12U] ; unsigned int count ; unsigned long time ; unsigned long max ; }; struct assoc_array_ptr; struct assoc_array { struct assoc_array_ptr *root ; unsigned long nr_leaves_on_tree ; }; typedef int32_t key_serial_t; typedef uint32_t key_perm_t; struct key; struct signal_struct; struct key_type; struct keyring_index_key { struct key_type *type ; char const *description ; size_t desc_len ; }; union __anonunion____missing_field_name_196 { struct list_head graveyard_link ; struct rb_node serial_node ; }; struct key_user; union __anonunion____missing_field_name_197 { time_t expiry ; time_t revoked_at ; }; struct __anonstruct____missing_field_name_199 { struct key_type *type ; char *description ; }; union __anonunion____missing_field_name_198 { struct keyring_index_key index_key ; struct __anonstruct____missing_field_name_199 __annonCompField52 ; }; union __anonunion_type_data_200 { struct list_head link ; unsigned long x[2U] ; void *p[2U] ; int reject_error ; }; union __anonunion_payload_202 { unsigned long value ; void *rcudata ; void *data ; void *data2[2U] ; }; union __anonunion____missing_field_name_201 { union __anonunion_payload_202 payload ; struct assoc_array keys ; }; struct key { atomic_t usage ; key_serial_t serial ; union __anonunion____missing_field_name_196 __annonCompField50 ; struct rw_semaphore sem ; struct key_user *user ; void *security ; union __anonunion____missing_field_name_197 __annonCompField51 ; time_t last_used_at ; kuid_t uid ; kgid_t gid ; key_perm_t perm ; unsigned short quotalen ; unsigned short datalen ; unsigned long flags ; union __anonunion____missing_field_name_198 __annonCompField53 ; union __anonunion_type_data_200 type_data ; union __anonunion____missing_field_name_201 __annonCompField54 ; }; struct audit_context; struct group_info { atomic_t usage ; int ngroups ; int nblocks ; kgid_t small_block[32U] ; kgid_t *blocks[0U] ; }; 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 ; }; struct percpu_ref; typedef void percpu_ref_func_t(struct percpu_ref * ); struct percpu_ref { atomic_long_t count ; unsigned long percpu_count_ptr ; percpu_ref_func_t *release ; percpu_ref_func_t *confirm_switch ; bool force_atomic ; struct callback_head rcu ; }; struct cgroup; struct cgroup_root; struct cgroup_subsys; struct cgroup_taskset; struct cgroup_subsys_state { struct cgroup *cgroup ; struct cgroup_subsys *ss ; struct percpu_ref refcnt ; struct cgroup_subsys_state *parent ; struct list_head sibling ; struct list_head children ; int id ; unsigned int flags ; u64 serial_nr ; struct callback_head callback_head ; struct work_struct destroy_work ; }; struct css_set { atomic_t refcount ; struct hlist_node hlist ; struct list_head tasks ; struct list_head mg_tasks ; struct list_head cgrp_links ; struct cgroup *dfl_cgrp ; struct cgroup_subsys_state *subsys[12U] ; struct list_head mg_preload_node ; struct list_head mg_node ; struct cgroup *mg_src_cgrp ; struct css_set *mg_dst_cset ; struct list_head e_cset_node[12U] ; struct callback_head callback_head ; }; struct cgroup { struct cgroup_subsys_state self ; unsigned long flags ; int id ; int populated_cnt ; struct kernfs_node *kn ; struct kernfs_node *procs_kn ; struct kernfs_node *populated_kn ; unsigned int subtree_control ; unsigned int child_subsys_mask ; struct cgroup_subsys_state *subsys[12U] ; struct cgroup_root *root ; struct list_head cset_links ; struct list_head e_csets[12U] ; struct list_head pidlists ; struct mutex pidlist_mutex ; wait_queue_head_t offline_waitq ; struct work_struct release_agent_work ; }; struct cgroup_root { struct kernfs_root *kf_root ; unsigned int subsys_mask ; int hierarchy_id ; struct cgroup cgrp ; atomic_t nr_cgrps ; struct list_head root_list ; unsigned int flags ; struct idr cgroup_idr ; char release_agent_path[4096U] ; char name[64U] ; }; struct cftype { char name[64U] ; int private ; umode_t mode ; size_t max_write_len ; unsigned int flags ; struct cgroup_subsys *ss ; struct list_head node ; struct kernfs_ops *kf_ops ; u64 (*read_u64)(struct cgroup_subsys_state * , struct cftype * ) ; s64 (*read_s64)(struct cgroup_subsys_state * , struct cftype * ) ; int (*seq_show)(struct seq_file * , void * ) ; void *(*seq_start)(struct seq_file * , loff_t * ) ; void *(*seq_next)(struct seq_file * , void * , loff_t * ) ; void (*seq_stop)(struct seq_file * , void * ) ; int (*write_u64)(struct cgroup_subsys_state * , struct cftype * , u64 ) ; int (*write_s64)(struct cgroup_subsys_state * , struct cftype * , s64 ) ; ssize_t (*write)(struct kernfs_open_file * , char * , size_t , loff_t ) ; struct lock_class_key lockdep_key ; }; struct cgroup_subsys { struct cgroup_subsys_state *(*css_alloc)(struct cgroup_subsys_state * ) ; int (*css_online)(struct cgroup_subsys_state * ) ; void (*css_offline)(struct cgroup_subsys_state * ) ; void (*css_released)(struct cgroup_subsys_state * ) ; void (*css_free)(struct cgroup_subsys_state * ) ; void (*css_reset)(struct cgroup_subsys_state * ) ; void (*css_e_css_changed)(struct cgroup_subsys_state * ) ; int (*can_attach)(struct cgroup_subsys_state * , struct cgroup_taskset * ) ; void (*cancel_attach)(struct cgroup_subsys_state * , struct cgroup_taskset * ) ; void (*attach)(struct cgroup_subsys_state * , struct cgroup_taskset * ) ; void (*fork)(struct task_struct * ) ; void (*exit)(struct cgroup_subsys_state * , struct cgroup_subsys_state * , struct task_struct * ) ; void (*bind)(struct cgroup_subsys_state * ) ; int disabled ; int early_init ; bool broken_hierarchy ; bool warned_broken_hierarchy ; int id ; char const *name ; struct cgroup_root *root ; struct idr css_idr ; struct list_head cfts ; struct cftype *dfl_cftypes ; struct cftype *legacy_cftypes ; unsigned int depends_on ; }; struct futex_pi_state; struct robust_list_head; struct bio_list; struct fs_struct; struct perf_event_context; struct blk_plug; struct nameidata; struct cfs_rq; struct task_group; struct sighand_struct { atomic_t count ; struct k_sigaction action[64U] ; spinlock_t siglock ; wait_queue_head_t signalfd_wqh ; }; 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 ; }; struct cpu_itimer { cputime_t expires ; cputime_t incr ; u32 error ; u32 incr_error ; }; struct cputime { cputime_t utime ; cputime_t stime ; }; struct task_cputime { cputime_t utime ; cputime_t stime ; unsigned long long sum_exec_runtime ; }; struct task_cputime_atomic { atomic64_t utime ; atomic64_t stime ; atomic64_t sum_exec_runtime ; }; struct thread_group_cputimer { struct task_cputime_atomic cputime_atomic ; int running ; }; struct autogroup; struct tty_struct; struct taskstats; struct tty_audit_buf; 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 : 1 ; unsigned char has_child_subreaper : 1 ; int posix_timer_id ; struct list_head posix_timers ; struct hrtimer real_timer ; struct pid *leader_pid ; ktime_t it_real_incr ; struct cpu_itimer it[2U] ; struct thread_group_cputimer cputimer ; struct task_cputime cputime_expires ; struct list_head cpu_timers[3U] ; struct pid *tty_old_pgrp ; int leader ; struct tty_struct *tty ; struct autogroup *autogroup ; seqlock_t stats_lock ; cputime_t utime ; cputime_t stime ; cputime_t cutime ; cputime_t cstime ; cputime_t gtime ; cputime_t cgtime ; struct cputime prev_cputime ; unsigned long nvcsw ; unsigned long nivcsw ; unsigned long cnvcsw ; unsigned long cnivcsw ; unsigned long min_flt ; unsigned long maj_flt ; unsigned long cmin_flt ; unsigned long cmaj_flt ; unsigned long inblock ; unsigned long oublock ; unsigned long cinblock ; unsigned long coublock ; unsigned long maxrss ; unsigned long cmaxrss ; struct task_io_accounting ioac ; unsigned long long sum_sched_runtime ; struct rlimit rlim[16U] ; struct pacct_struct pacct ; struct taskstats *stats ; unsigned int audit_tty ; unsigned int audit_tty_log_passwd ; struct tty_audit_buf *tty_audit_buf ; oom_flags_t oom_flags ; short oom_score_adj ; short oom_score_adj_min ; struct mutex cred_guard_mutex ; }; 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 ; }; struct backing_dev_info; struct reclaim_state; struct sched_info { unsigned long pcount ; unsigned long long run_delay ; unsigned long long last_arrival ; unsigned long long last_queued ; }; 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 ; }; struct wake_q_node { struct wake_q_node *next ; }; struct io_context; struct pipe_inode_info; struct uts_namespace; struct load_weight { unsigned long weight ; u32 inv_weight ; }; struct sched_avg { u64 last_runnable_update ; s64 decay_count ; unsigned long load_avg_contrib ; unsigned long utilization_avg_contrib ; u32 runnable_avg_sum ; u32 avg_period ; u32 running_avg_sum ; }; 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 ; }; 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 ; }; struct rt_rq; 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 ; }; 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 ; }; struct memcg_oom_info { struct mem_cgroup *memcg ; gfp_t gfp_mask ; int order ; unsigned char may_oom : 1 ; }; struct sched_class; struct files_struct; struct compat_robust_list_head; struct numa_group; struct ftrace_ret_stack; struct task_struct { long volatile 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 ; struct sched_class const *sched_class ; struct sched_entity se ; struct sched_rt_entity rt ; struct task_group *sched_task_group ; struct sched_dl_entity dl ; struct hlist_head preempt_notifiers ; unsigned int btrace_seq ; unsigned int policy ; int nr_cpus_allowed ; cpumask_t cpus_allowed ; unsigned long rcu_tasks_nvcsw ; bool rcu_tasks_holdout ; struct list_head rcu_tasks_holdout_list ; int rcu_tasks_idle_cpu ; struct sched_info sched_info ; struct list_head tasks ; struct plist_node pushable_tasks ; struct rb_node pushable_dl_tasks ; struct mm_struct *mm ; struct mm_struct *active_mm ; u32 vmacache_seqnum ; struct vm_area_struct *vmacache[4U] ; struct task_rss_stat rss_stat ; int exit_state ; int exit_code ; int exit_signal ; int pdeath_signal ; unsigned long jobctl ; unsigned int personality ; unsigned char in_execve : 1 ; unsigned char in_iowait : 1 ; unsigned char sched_reset_on_fork : 1 ; unsigned char sched_contributes_to_load : 1 ; unsigned char sched_migrated : 1 ; unsigned char memcg_kmem_skip_account : 1 ; unsigned char brk_randomized : 1 ; unsigned long atomic_flags ; struct restart_block restart_block ; pid_t pid ; pid_t tgid ; struct task_struct *real_parent ; struct task_struct *parent ; struct list_head children ; struct list_head sibling ; struct task_struct *group_leader ; struct list_head ptraced ; struct list_head ptrace_entry ; struct pid_link pids[3U] ; struct list_head thread_group ; struct list_head thread_node ; struct completion *vfork_done ; int *set_child_tid ; int *clear_child_tid ; cputime_t utime ; cputime_t stime ; cputime_t utimescaled ; cputime_t stimescaled ; cputime_t gtime ; struct cputime prev_cputime ; unsigned long nvcsw ; unsigned long nivcsw ; u64 start_time ; u64 real_start_time ; unsigned long min_flt ; unsigned long maj_flt ; struct task_cputime cputime_expires ; struct list_head cpu_timers[3U] ; struct cred const *real_cred ; struct cred const *cred ; char comm[16U] ; struct nameidata *nameidata ; 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 wake_q_node wake_q ; struct rb_root pi_waiters ; struct rb_node *pi_waiters_leftmost ; struct rt_mutex_waiter *pi_blocked_on ; struct mutex_waiter *blocked_on ; unsigned int irq_events ; unsigned long hardirq_enable_ip ; unsigned long hardirq_disable_ip ; unsigned int hardirq_enable_event ; unsigned int hardirq_disable_event ; int hardirqs_enabled ; int hardirq_context ; unsigned long softirq_disable_ip ; unsigned long softirq_enable_ip ; unsigned int softirq_disable_event ; unsigned int softirq_enable_event ; int softirqs_enabled ; int softirq_context ; u64 curr_chain_key ; int lockdep_depth ; unsigned int lockdep_recursion ; struct held_lock held_locks[48U] ; gfp_t lockdep_reclaim_gfp ; void *journal_info ; struct bio_list *bio_list ; struct blk_plug *plug ; struct reclaim_state *reclaim_state ; struct backing_dev_info *backing_dev_info ; struct io_context *io_context ; unsigned long ptrace_message ; siginfo_t *last_siginfo ; struct task_io_accounting ioac ; u64 acct_rss_mem1 ; u64 acct_vm_mem1 ; cputime_t acct_timexpd ; nodemask_t mems_allowed ; seqcount_t mems_allowed_seq ; int cpuset_mem_spread_rotor ; int cpuset_slab_spread_rotor ; struct css_set *cgroups ; struct list_head cg_list ; struct robust_list_head *robust_list ; struct compat_robust_list_head *compat_robust_list ; struct list_head pi_state_list ; struct futex_pi_state *pi_state_cache ; struct perf_event_context *perf_event_ctxp[2U] ; struct mutex perf_event_mutex ; struct list_head perf_event_list ; struct mempolicy *mempolicy ; short il_next ; short pref_node_fork ; int numa_scan_seq ; unsigned int numa_scan_period ; unsigned int numa_scan_period_max ; int numa_preferred_nid ; unsigned long numa_migrate_retry ; u64 node_stamp ; u64 last_task_numa_placement ; u64 last_sum_exec_runtime ; struct callback_head numa_work ; struct list_head numa_entry ; struct numa_group *numa_group ; unsigned long *numa_faults ; unsigned long total_numa_faults ; unsigned long numa_faults_locality[3U] ; unsigned long numa_pages_migrated ; struct callback_head rcu ; struct pipe_inode_info *splice_pipe ; struct page_frag task_frag ; struct task_delay_info *delays ; int make_it_fail ; int nr_dirtied ; int nr_dirtied_pause ; unsigned long dirty_paused_when ; int latency_record_count ; struct latency_record latency_record[32U] ; unsigned long timer_slack_ns ; unsigned long default_timer_slack_ns ; unsigned int kasan_depth ; int curr_ret_stack ; struct ftrace_ret_stack *ret_stack ; unsigned long long ftrace_timestamp ; atomic_t trace_overrun ; atomic_t tracing_graph_pause ; unsigned long trace ; unsigned long trace_recursion ; struct memcg_oom_info memcg_oom ; struct uprobe_task *utask ; unsigned int sequential_io ; unsigned int sequential_io_avg ; unsigned long task_state_change ; int pagefault_disabled ; }; struct device_attribute; struct ata_queued_cmd; struct ata_link; struct ata_taskfile; struct ata_port; typedef unsigned long kernel_ulong_t; struct pci_device_id { __u32 vendor ; __u32 device ; __u32 subvendor ; __u32 subdevice ; __u32 class ; __u32 class_mask ; kernel_ulong_t driver_data ; }; struct acpi_device_id { __u8 id[9U] ; kernel_ulong_t driver_data ; }; struct of_device_id { char name[32U] ; char type[32U] ; char compatible[128U] ; void const *data ; }; struct platform_device_id { char name[20U] ; kernel_ulong_t driver_data ; }; struct klist_node; struct klist_node { void *n_klist ; struct list_head n_node ; struct kref n_ref ; }; struct path; 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 ; struct seq_operations const *op ; int poll_event ; struct user_namespace *user_ns ; void *private ; }; 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 * ) ; }; struct pinctrl; struct pinctrl_state; struct dev_pin_info { struct pinctrl *p ; struct pinctrl_state *default_state ; struct pinctrl_state *sleep_state ; struct pinctrl_state *idle_state ; }; struct ratelimit_state { raw_spinlock_t lock ; int interval ; int burst ; int printed ; int missed ; unsigned long begin ; }; struct dma_map_ops; struct dev_archdata { struct dma_map_ops *dma_ops ; void *iommu ; }; struct pdev_archdata { }; struct device_private; struct device_driver; struct driver_private; struct class; struct subsys_private; struct bus_type; struct device_node; struct fwnode_handle; struct iommu_ops; struct iommu_group; struct bus_type { char const *name ; char const *dev_name ; struct device *dev_root ; struct device_attribute *dev_attrs ; struct attribute_group const **bus_groups ; struct attribute_group const **dev_groups ; struct attribute_group const **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 * ) ; struct dev_pm_ops const *pm ; struct iommu_ops const *iommu_ops ; struct subsys_private *p ; struct lock_class_key lock_key ; }; struct device_type; enum probe_type { PROBE_DEFAULT_STRATEGY = 0, PROBE_PREFER_ASYNCHRONOUS = 1, PROBE_FORCE_SYNCHRONOUS = 2 } ; struct device_driver { char const *name ; struct bus_type *bus ; struct module *owner ; char const *mod_name ; bool suppress_bind_attrs ; enum probe_type probe_type ; struct of_device_id const *of_match_table ; struct acpi_device_id const *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 * ) ; struct attribute_group const **groups ; struct dev_pm_ops const *pm ; struct driver_private *p ; }; struct class_attribute; struct class { char const *name ; struct module *owner ; struct class_attribute *class_attrs ; struct attribute_group const **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 * ) ; struct kobj_ns_type_operations const *ns_type ; void const *(*namespace)(struct device * ) ; struct dev_pm_ops const *pm ; struct subsys_private *p ; }; struct class_attribute { struct attribute attr ; ssize_t (*show)(struct class * , struct class_attribute * , char * ) ; ssize_t (*store)(struct class * , struct class_attribute * , char const * , size_t ) ; }; struct device_type { char const *name ; struct attribute_group const **groups ; int (*uevent)(struct device * , struct kobj_uevent_env * ) ; char *(*devnode)(struct device * , umode_t * , kuid_t * , kgid_t * ) ; void (*release)(struct device * ) ; struct dev_pm_ops const *pm ; }; struct device_attribute { struct attribute attr ; ssize_t (*show)(struct device * , struct device_attribute * , char * ) ; ssize_t (*store)(struct device * , struct device_attribute * , char const * , size_t ) ; }; struct device_dma_parameters { unsigned int max_segment_size ; unsigned long segment_boundary_mask ; }; struct dma_coherent_mem; struct cma; struct device { struct device *parent ; struct device_private *p ; struct kobject kobj ; char const *init_name ; struct device_type const *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 fwnode_handle *fwnode ; dev_t devt ; u32 id ; spinlock_t devres_lock ; struct list_head devres_head ; struct klist_node knode_class ; struct class *class ; struct attribute_group const **groups ; void (*release)(struct device * ) ; struct iommu_group *iommu_group ; bool offline_disabled ; bool offline ; }; struct wakeup_source { char const *name ; struct list_head entry ; spinlock_t lock ; struct wake_irq *wakeirq ; struct timer_list timer ; unsigned long timer_expires ; ktime_t total_time ; ktime_t max_time ; ktime_t last_time ; ktime_t start_prevent_time ; ktime_t prevent_sleep_time ; unsigned long event_count ; unsigned long active_count ; unsigned long relax_count ; unsigned long expire_count ; unsigned long wakeup_count ; bool active ; bool autosleep_enabled ; }; struct hotplug_slot; struct pci_slot { struct pci_bus *bus ; struct list_head list ; struct hotplug_slot *hotplug ; unsigned char number ; struct kobject kobj ; }; typedef int pci_power_t; typedef unsigned int pci_channel_state_t; enum pci_channel_state { pci_channel_io_normal = 1, pci_channel_io_frozen = 2, pci_channel_io_perm_failure = 3 } ; typedef unsigned short pci_dev_flags_t; typedef unsigned short pci_bus_flags_t; struct pcie_link_state; struct pci_vpd; struct pci_sriov; struct pci_ats; struct proc_dir_entry; struct pci_driver; union __anonunion____missing_field_name_220 { struct pci_sriov *sriov ; struct pci_dev *physfn ; }; 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 : 3 ; 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 : 5 ; unsigned char pme_interrupt : 1 ; unsigned char pme_poll : 1 ; unsigned char d1_support : 1 ; unsigned char d2_support : 1 ; unsigned char no_d1d2 : 1 ; unsigned char no_d3cold : 1 ; unsigned char d3cold_allowed : 1 ; unsigned char mmio_always_on : 1 ; unsigned char wakeup_prepared : 1 ; unsigned char runtime_d3cold : 1 ; unsigned char ignore_hotplug : 1 ; 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 : 1 ; unsigned char multifunction : 1 ; unsigned char is_added : 1 ; unsigned char is_busmaster : 1 ; unsigned char no_msi : 1 ; unsigned char no_64bit_msi : 1 ; unsigned char block_cfg_access : 1 ; unsigned char broken_parity_status : 1 ; unsigned char irq_reroute_variant : 2 ; unsigned char msi_enabled : 1 ; unsigned char msix_enabled : 1 ; unsigned char ari_enabled : 1 ; unsigned char is_managed : 1 ; unsigned char needs_freset : 1 ; unsigned char state_saved : 1 ; unsigned char is_physfn : 1 ; unsigned char is_virtfn : 1 ; unsigned char reset_fn : 1 ; unsigned char is_hotplug_bridge : 1 ; unsigned char __aer_firmware_first_valid : 1 ; unsigned char __aer_firmware_first : 1 ; unsigned char broken_intx_masking : 1 ; unsigned char io_window_1k : 1 ; unsigned char irq_managed : 1 ; unsigned char has_secondary_link : 1 ; 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 ; struct attribute_group const **msi_irq_groups ; struct pci_vpd *vpd ; union __anonunion____missing_field_name_220 __annonCompField58 ; struct pci_ats *ats ; phys_addr_t rom ; size_t romlen ; char *driver_override ; }; struct pci_ops; struct msi_controller; struct pci_bus { struct list_head node ; struct pci_bus *parent ; struct list_head children ; struct list_head devices ; struct pci_dev *self ; struct list_head slots ; struct resource *resource[4U] ; struct list_head resources ; struct resource busn_res ; struct pci_ops *ops ; struct msi_controller *msi ; void *sysdata ; struct proc_dir_entry *procdir ; unsigned char number ; unsigned char primary ; unsigned char max_bus_speed ; unsigned char cur_bus_speed ; char name[48U] ; unsigned short bridge_ctl ; pci_bus_flags_t bus_flags ; struct device *bridge ; struct device dev ; struct bin_attribute *legacy_io ; struct bin_attribute *legacy_mem ; unsigned char is_added : 1 ; }; struct pci_ops { void *(*map_bus)(struct pci_bus * , unsigned int , int ) ; int (*read)(struct pci_bus * , unsigned int , int , int , u32 * ) ; int (*write)(struct pci_bus * , unsigned int , int , int , u32 ) ; }; struct pci_dynids { spinlock_t lock ; struct list_head list ; }; typedef unsigned int pci_ers_result_t; 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 * ) ; }; struct pci_driver { struct list_head node ; char const *name ; struct pci_device_id const *id_table ; int (*probe)(struct pci_dev * , struct pci_device_id const * ) ; 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 ) ; struct pci_error_handlers const *err_handler ; struct device_driver driver ; struct pci_dynids dynids ; }; struct shrink_control { gfp_t gfp_mask ; unsigned long nr_to_scan ; int nid ; struct mem_cgroup *memcg ; }; struct shrinker { unsigned long (*count_objects)(struct shrinker * , struct shrink_control * ) ; unsigned long (*scan_objects)(struct shrinker * , struct shrink_control * ) ; int seeks ; long batch ; unsigned long flags ; struct list_head list ; atomic_long_t *nr_deferred ; }; struct file_ra_state; struct writeback_control; struct bdi_writeback; struct vm_fault { unsigned int flags ; unsigned long pgoff ; void *virtual_address ; struct page *cow_page ; struct page *page ; unsigned long max_pgoff ; pte_t *pte ; }; 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 (*pfn_mkwrite)(struct vm_area_struct * , struct vm_fault * ) ; int (*access)(struct vm_area_struct * , unsigned long , void * , int , int ) ; char const *(*name)(struct vm_area_struct * ) ; int (*set_policy)(struct vm_area_struct * , struct mempolicy * ) ; struct mempolicy *(*get_policy)(struct vm_area_struct * , unsigned long ) ; struct page *(*find_special_page)(struct vm_area_struct * , unsigned long ) ; }; 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 ; }; struct sg_table { struct scatterlist *sgl ; unsigned int nents ; unsigned int orig_nents ; }; struct dma_attrs { unsigned long flags[1U] ; }; enum dma_data_direction { DMA_BIDIRECTIONAL = 0, DMA_TO_DEVICE = 1, DMA_FROM_DEVICE = 2, DMA_NONE = 3 } ; 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 ; }; struct hlist_bl_node; struct hlist_bl_head { struct hlist_bl_node *first ; }; struct hlist_bl_node { struct hlist_bl_node *next ; struct hlist_bl_node **pprev ; }; struct __anonstruct____missing_field_name_224 { spinlock_t lock ; int count ; }; union __anonunion____missing_field_name_223 { struct __anonstruct____missing_field_name_224 __annonCompField59 ; }; struct lockref { union __anonunion____missing_field_name_223 __annonCompField60 ; }; struct vfsmount; struct __anonstruct____missing_field_name_226 { u32 hash ; u32 len ; }; union __anonunion____missing_field_name_225 { struct __anonstruct____missing_field_name_226 __annonCompField61 ; u64 hash_len ; }; struct qstr { union __anonunion____missing_field_name_225 __annonCompField62 ; unsigned char const *name ; }; struct dentry_operations; union __anonunion_d_u_227 { struct hlist_node d_alias ; struct callback_head d_rcu ; }; 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 ; struct dentry_operations const *d_op ; struct super_block *d_sb ; unsigned long d_time ; void *d_fsdata ; struct list_head d_lru ; struct list_head d_child ; struct list_head d_subdirs ; union __anonunion_d_u_227 d_u ; }; struct dentry_operations { int (*d_revalidate)(struct dentry * , unsigned int ) ; int (*d_weak_revalidate)(struct dentry * , unsigned int ) ; int (*d_hash)(struct dentry const * , struct qstr * ) ; int (*d_compare)(struct dentry const * , struct dentry const * , unsigned int , char const * , struct qstr const * ) ; int (*d_delete)(struct dentry const * ) ; void (*d_release)(struct dentry * ) ; void (*d_prune)(struct dentry * ) ; void (*d_iput)(struct dentry * , struct inode * ) ; char *(*d_dname)(struct dentry * , char * , int ) ; struct vfsmount *(*d_automount)(struct path * ) ; int (*d_manage)(struct dentry * , bool ) ; struct inode *(*d_select_inode)(struct dentry * , unsigned int ) ; }; struct path { struct vfsmount *mnt ; struct dentry *dentry ; }; struct list_lru_one { struct list_head list ; long nr_items ; }; struct list_lru_memcg { struct list_lru_one *lru[0U] ; }; struct list_lru_node { spinlock_t lock ; struct list_lru_one lru ; struct list_lru_memcg *memcg_lrus ; }; struct list_lru { struct list_lru_node *node ; struct list_head list ; }; struct __anonstruct____missing_field_name_231 { struct radix_tree_node *parent ; void *private_data ; }; union __anonunion____missing_field_name_230 { struct __anonstruct____missing_field_name_231 __annonCompField63 ; struct callback_head callback_head ; }; struct radix_tree_node { unsigned int path ; unsigned int count ; union __anonunion____missing_field_name_230 __annonCompField64 ; struct list_head private_list ; void *slots[64U] ; unsigned long tags[3U][1U] ; }; struct radix_tree_root { unsigned int height ; gfp_t gfp_mask ; struct radix_tree_node *rnode ; }; struct fiemap_extent { __u64 fe_logical ; __u64 fe_physical ; __u64 fe_length ; __u64 fe_reserved64[2U] ; __u32 fe_flags ; __u32 fe_reserved[3U] ; }; enum migrate_mode { MIGRATE_ASYNC = 0, MIGRATE_SYNC_LIGHT = 1, MIGRATE_SYNC = 2 } ; struct bio_set; struct bio; struct bio_integrity_payload; struct block_device; typedef void bio_end_io_t(struct bio * , int ); struct bio_vec { struct page *bv_page ; unsigned int bv_len ; unsigned int bv_offset ; }; struct bvec_iter { sector_t bi_sector ; unsigned int bi_size ; unsigned int bi_idx ; unsigned int bi_bvec_done ; }; union __anonunion____missing_field_name_234 { struct bio_integrity_payload *bi_integrity ; }; struct bio { struct bio *bi_next ; struct block_device *bi_bdev ; unsigned long bi_flags ; unsigned long bi_rw ; struct bvec_iter bi_iter ; unsigned int bi_phys_segments ; unsigned int bi_seg_front_size ; unsigned int bi_seg_back_size ; atomic_t __bi_remaining ; bio_end_io_t *bi_end_io ; void *bi_private ; struct io_context *bi_ioc ; struct cgroup_subsys_state *bi_css ; union __anonunion____missing_field_name_234 __annonCompField65 ; unsigned short bi_vcnt ; unsigned short bi_max_vecs ; atomic_t __bi_cnt ; struct bio_vec *bi_io_vec ; struct bio_set *bi_pool ; struct bio_vec bi_inline_vecs[0U] ; }; struct export_operations; struct hd_geometry; struct kiocb; struct poll_table_struct; struct kstatfs; struct swap_info_struct; struct iov_iter; 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 ; }; struct dquot; typedef __kernel_uid32_t projid_t; struct __anonstruct_kprojid_t_235 { projid_t val ; }; typedef struct __anonstruct_kprojid_t_235 kprojid_t; enum quota_type { USRQUOTA = 0, GRPQUOTA = 1, PRJQUOTA = 2 } ; typedef long long qsize_t; union __anonunion____missing_field_name_236 { kuid_t uid ; kgid_t gid ; kprojid_t projid ; }; struct kqid { union __anonunion____missing_field_name_236 __annonCompField66 ; enum quota_type type ; }; 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 ; }; struct quota_format_type; struct mem_dqinfo { struct quota_format_type *dqi_format ; int dqi_fmt_id ; struct list_head dqi_dirty_list ; unsigned long dqi_flags ; unsigned int dqi_bgrace ; unsigned int dqi_igrace ; qsize_t dqi_max_spc_limit ; qsize_t dqi_max_ino_limit ; void *dqi_priv ; }; 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 ; }; 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 * ) ; }; struct dquot_operations { int (*write_dquot)(struct dquot * ) ; struct dquot *(*alloc_dquot)(struct super_block * , int ) ; void (*destroy_dquot)(struct dquot * ) ; int (*acquire_dquot)(struct dquot * ) ; int (*release_dquot)(struct dquot * ) ; int (*mark_dirty)(struct dquot * ) ; int (*write_info)(struct super_block * , int ) ; qsize_t *(*get_reserved_space)(struct inode * ) ; int (*get_projid)(struct inode * , kprojid_t * ) ; }; struct qc_dqblk { int d_fieldmask ; u64 d_spc_hardlimit ; u64 d_spc_softlimit ; u64 d_ino_hardlimit ; u64 d_ino_softlimit ; u64 d_space ; u64 d_ino_count ; s64 d_ino_timer ; s64 d_spc_timer ; int d_ino_warns ; int d_spc_warns ; u64 d_rt_spc_hardlimit ; u64 d_rt_spc_softlimit ; u64 d_rt_space ; s64 d_rt_spc_timer ; int d_rt_spc_warns ; }; struct qc_type_state { unsigned int flags ; unsigned int spc_timelimit ; unsigned int ino_timelimit ; unsigned int rt_spc_timelimit ; unsigned int spc_warnlimit ; unsigned int ino_warnlimit ; unsigned int rt_spc_warnlimit ; unsigned long long ino ; blkcnt_t blocks ; blkcnt_t nextents ; }; struct qc_state { unsigned int s_incoredqs ; struct qc_type_state s_state[3U] ; }; struct qc_info { int i_fieldmask ; unsigned int i_flags ; unsigned int i_spc_timelimit ; unsigned int i_ino_timelimit ; unsigned int i_rt_spc_timelimit ; unsigned int i_spc_warnlimit ; unsigned int i_ino_warnlimit ; unsigned int i_rt_spc_warnlimit ; }; struct quotactl_ops { int (*quota_on)(struct super_block * , int , int , struct path * ) ; int (*quota_off)(struct super_block * , int ) ; int (*quota_enable)(struct super_block * , unsigned int ) ; int (*quota_disable)(struct super_block * , unsigned int ) ; int (*quota_sync)(struct super_block * , int ) ; int (*set_info)(struct super_block * , int , struct qc_info * ) ; int (*get_dqblk)(struct super_block * , struct kqid , struct qc_dqblk * ) ; int (*set_dqblk)(struct super_block * , struct kqid , struct qc_dqblk * ) ; int (*get_state)(struct super_block * , struct qc_state * ) ; int (*rm_xquota)(struct super_block * , unsigned int ) ; }; struct quota_format_type { int qf_fmt_id ; struct quota_format_ops const *qf_ops ; struct module *qf_owner ; struct quota_format_type *qf_next ; }; struct quota_info { unsigned int flags ; struct mutex dqio_mutex ; struct mutex dqonoff_mutex ; struct inode *files[3U] ; struct mem_dqinfo info[3U] ; struct quota_format_ops const *ops[3U] ; }; struct kiocb { struct file *ki_filp ; loff_t ki_pos ; void (*ki_complete)(struct kiocb * , long , long ) ; void *private ; int ki_flags ; }; struct address_space_operations { int (*writepage)(struct page * , struct writeback_control * ) ; int (*readpage)(struct file * , struct page * ) ; int (*writepages)(struct address_space * , struct writeback_control * ) ; int (*set_page_dirty)(struct page * ) ; int (*readpages)(struct file * , struct address_space * , struct list_head * , unsigned int ) ; int (*write_begin)(struct file * , struct address_space * , loff_t , unsigned int , unsigned int , struct page ** , void ** ) ; int (*write_end)(struct file * , struct address_space * , loff_t , unsigned int , unsigned int , struct page * , void * ) ; sector_t (*bmap)(struct address_space * , sector_t ) ; void (*invalidatepage)(struct page * , unsigned int , unsigned int ) ; int (*releasepage)(struct page * , gfp_t ) ; void (*freepage)(struct page * ) ; ssize_t (*direct_IO)(struct kiocb * , struct iov_iter * , loff_t ) ; int (*migratepage)(struct address_space * , struct page * , struct page * , enum migrate_mode ) ; int (*launder_page)(struct page * ) ; int (*is_partially_uptodate)(struct page * , unsigned long , unsigned long ) ; void (*is_dirty_writeback)(struct page * , bool * , bool * ) ; int (*error_remove_page)(struct address_space * , struct page * ) ; int (*swap_activate)(struct swap_info_struct * , struct file * , sector_t * ) ; void (*swap_deactivate)(struct file * ) ; }; struct address_space { struct inode *host ; struct radix_tree_root page_tree ; spinlock_t tree_lock ; atomic_t i_mmap_writable ; struct rb_root i_mmap ; struct rw_semaphore i_mmap_rwsem ; unsigned long nrpages ; unsigned long nrshadows ; unsigned long writeback_index ; struct address_space_operations const *a_ops ; unsigned long flags ; spinlock_t private_lock ; struct list_head private_list ; void *private_data ; }; struct request_queue; struct hd_struct; struct gendisk; 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 ; }; struct posix_acl; struct inode_operations; union __anonunion____missing_field_name_239 { unsigned int const i_nlink ; unsigned int __i_nlink ; }; union __anonunion____missing_field_name_240 { struct hlist_head i_dentry ; struct callback_head i_rcu ; }; struct file_lock_context; struct cdev; union __anonunion____missing_field_name_241 { struct pipe_inode_info *i_pipe ; struct block_device *i_bdev ; struct cdev *i_cdev ; char *i_link ; }; 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 ; struct inode_operations const *i_op ; struct super_block *i_sb ; struct address_space *i_mapping ; void *i_security ; unsigned long i_ino ; union __anonunion____missing_field_name_239 __annonCompField67 ; 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 ; unsigned long dirtied_time_when ; struct hlist_node i_hash ; struct list_head i_wb_list ; struct bdi_writeback *i_wb ; int i_wb_frn_winner ; u16 i_wb_frn_avg_time ; u16 i_wb_frn_history ; struct list_head i_lru ; struct list_head i_sb_list ; union __anonunion____missing_field_name_240 __annonCompField68 ; u64 i_version ; atomic_t i_count ; atomic_t i_dio_count ; atomic_t i_writecount ; atomic_t i_readcount ; struct file_operations const *i_fop ; struct file_lock_context *i_flctx ; struct address_space i_data ; struct list_head i_devices ; union __anonunion____missing_field_name_241 __annonCompField69 ; __u32 i_generation ; __u32 i_fsnotify_mask ; struct hlist_head i_fsnotify_marks ; void *i_private ; }; struct fown_struct { rwlock_t lock ; struct pid *pid ; enum pid_type pid_type ; kuid_t uid ; kuid_t euid ; int signum ; }; 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 ; }; union __anonunion_f_u_242 { struct llist_node fu_llist ; struct callback_head fu_rcuhead ; }; struct file { union __anonunion_f_u_242 f_u ; struct path f_path ; struct inode *f_inode ; struct file_operations const *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 ; struct cred const *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 ; }; typedef void *fl_owner_t; struct file_lock; struct file_lock_operations { void (*fl_copy_lock)(struct file_lock * , struct file_lock * ) ; void (*fl_release_private)(struct file_lock * ) ; }; struct lock_manager_operations { int (*lm_compare_owner)(struct file_lock * , struct file_lock * ) ; unsigned long (*lm_owner_key)(struct file_lock * ) ; fl_owner_t (*lm_get_owner)(fl_owner_t ) ; void (*lm_put_owner)(fl_owner_t ) ; void (*lm_notify)(struct file_lock * ) ; int (*lm_grant)(struct file_lock * , int ) ; bool (*lm_break)(struct file_lock * ) ; int (*lm_change)(struct file_lock * , int , struct list_head * ) ; void (*lm_setup)(struct file_lock * , void ** ) ; }; struct net; struct nlm_lockowner; struct nfs_lock_info { u32 state ; struct nlm_lockowner *owner ; struct list_head list ; }; struct nfs4_lock_state; struct nfs4_lock_info { struct nfs4_lock_state *owner ; }; struct fasync_struct; struct __anonstruct_afs_244 { struct list_head link ; int state ; }; union __anonunion_fl_u_243 { struct nfs_lock_info nfs_fl ; struct nfs4_lock_info nfs4_fl ; struct __anonstruct_afs_244 afs ; }; struct file_lock { struct file_lock *fl_next ; struct list_head fl_list ; struct hlist_node fl_link ; struct list_head fl_block ; fl_owner_t fl_owner ; unsigned int fl_flags ; unsigned char fl_type ; unsigned int fl_pid ; int fl_link_cpu ; struct pid *fl_nspid ; wait_queue_head_t fl_wait ; struct file *fl_file ; loff_t fl_start ; loff_t fl_end ; struct fasync_struct *fl_fasync ; unsigned long fl_break_time ; unsigned long fl_downgrade_time ; struct file_lock_operations const *fl_ops ; struct lock_manager_operations const *fl_lmops ; union __anonunion_fl_u_243 fl_u ; }; struct file_lock_context { spinlock_t flc_lock ; struct list_head flc_flock ; struct list_head flc_posix ; struct list_head flc_lease ; }; 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 ; }; 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] ; }; struct super_operations; struct xattr_handler; struct mtd_info; 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 ; struct super_operations const *s_op ; struct dquot_operations const *dq_op ; struct quotactl_ops const *s_qcop ; struct export_operations const *s_export_op ; unsigned long s_flags ; unsigned long s_iflags ; unsigned long s_magic ; struct dentry *s_root ; struct rw_semaphore s_umount ; int s_count ; atomic_t s_active ; void *s_security ; struct xattr_handler const **s_xattr ; struct list_head s_inodes ; struct hlist_bl_head s_anon ; struct list_head s_mounts ; struct block_device *s_bdev ; struct backing_dev_info *s_bdi ; struct mtd_info *s_mtd ; struct hlist_node s_instances ; unsigned int s_quota_types ; struct quota_info s_dquot ; struct sb_writers s_writers ; char s_id[32U] ; u8 s_uuid[16U] ; void *s_fs_info ; unsigned int s_max_links ; fmode_t s_mode ; u32 s_time_gran ; struct mutex s_vfs_rename_mutex ; char *s_subtype ; char *s_options ; struct dentry_operations const *s_d_op ; int cleancache_poolid ; struct shrinker s_shrink ; atomic_long_t s_remove_count ; int s_readonly_remount ; struct workqueue_struct *s_dio_done_wq ; struct hlist_head s_pins ; struct list_lru s_dentry_lru ; struct list_lru s_inode_lru ; struct callback_head rcu ; int s_stack_depth ; }; struct fiemap_extent_info { unsigned int fi_flags ; unsigned int fi_extents_mapped ; unsigned int fi_extents_max ; struct fiemap_extent *fi_extents_start ; }; struct dir_context; struct dir_context { int (*actor)(struct dir_context * , char const * , int , loff_t , u64 , unsigned int ) ; loff_t pos ; }; struct block_device_operations; 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 * , char const * , size_t , loff_t * ) ; ssize_t (*read_iter)(struct kiocb * , struct iov_iter * ) ; ssize_t (*write_iter)(struct kiocb * , struct iov_iter * ) ; int (*iterate)(struct file * , struct dir_context * ) ; unsigned int (*poll)(struct file * , struct poll_table_struct * ) ; long (*unlocked_ioctl)(struct file * , unsigned int , unsigned long ) ; long (*compat_ioctl)(struct file * , unsigned int , unsigned long ) ; int (*mmap)(struct file * , struct vm_area_struct * ) ; int (*mremap)(struct file * , struct vm_area_struct * ) ; int (*open)(struct inode * , struct file * ) ; int (*flush)(struct file * , fl_owner_t ) ; int (*release)(struct inode * , struct file * ) ; int (*fsync)(struct file * , loff_t , loff_t , int ) ; int (*aio_fsync)(struct kiocb * , int ) ; int (*fasync)(int , struct file * , int ) ; int (*lock)(struct file * , int , struct file_lock * ) ; ssize_t (*sendpage)(struct file * , struct page * , int , size_t , loff_t * , int ) ; unsigned long (*get_unmapped_area)(struct file * , unsigned long , unsigned long , unsigned long , unsigned long ) ; int (*check_flags)(int ) ; int (*flock)(struct file * , int , struct file_lock * ) ; ssize_t (*splice_write)(struct pipe_inode_info * , struct file * , loff_t * , size_t , unsigned int ) ; ssize_t (*splice_read)(struct file * , loff_t * , struct pipe_inode_info * , size_t , unsigned int ) ; int (*setlease)(struct file * , long , struct file_lock ** , void ** ) ; long (*fallocate)(struct file * , int , loff_t , loff_t ) ; void (*show_fdinfo)(struct seq_file * , struct file * ) ; }; struct inode_operations { struct dentry *(*lookup)(struct inode * , struct dentry * , unsigned int ) ; char const *(*follow_link)(struct dentry * , void ** ) ; int (*permission)(struct inode * , int ) ; struct posix_acl *(*get_acl)(struct inode * , int ) ; int (*readlink)(struct dentry * , char * , int ) ; void (*put_link)(struct inode * , 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 * , char const * ) ; 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 * , char const * , void const * , size_t , int ) ; ssize_t (*getxattr)(struct dentry * , char const * , void * , size_t ) ; ssize_t (*listxattr)(struct dentry * , char * , size_t ) ; int (*removexattr)(struct dentry * , char const * ) ; 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 ) ; }; struct super_operations { struct inode *(*alloc_inode)(struct super_block * ) ; void (*destroy_inode)(struct inode * ) ; void (*dirty_inode)(struct inode * , int ) ; int (*write_inode)(struct inode * , struct writeback_control * ) ; int (*drop_inode)(struct inode * ) ; void (*evict_inode)(struct inode * ) ; void (*put_super)(struct super_block * ) ; int (*sync_fs)(struct super_block * , int ) ; int (*freeze_super)(struct super_block * ) ; int (*freeze_fs)(struct super_block * ) ; int (*thaw_super)(struct super_block * ) ; int (*unfreeze_fs)(struct super_block * ) ; int (*statfs)(struct dentry * , struct kstatfs * ) ; int (*remount_fs)(struct super_block * , int * , char * ) ; void (*umount_begin)(struct super_block * ) ; int (*show_options)(struct seq_file * , struct dentry * ) ; int (*show_devname)(struct seq_file * , struct dentry * ) ; int (*show_path)(struct seq_file * , struct dentry * ) ; int (*show_stats)(struct seq_file * , struct dentry * ) ; ssize_t (*quota_read)(struct super_block * , int , char * , size_t , loff_t ) ; ssize_t (*quota_write)(struct super_block * , int , char const * , size_t , loff_t ) ; struct dquot **(*get_dquots)(struct inode * ) ; int (*bdev_try_to_free_page)(struct super_block * , struct page * , gfp_t ) ; long (*nr_cached_objects)(struct super_block * , struct shrink_control * ) ; long (*free_cached_objects)(struct super_block * , struct shrink_control * ) ; }; struct file_system_type { char const *name ; int fs_flags ; struct dentry *(*mount)(struct file_system_type * , int , char const * , 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 ; }; struct disk_stats { unsigned long sectors[2U] ; unsigned long ios[2U] ; unsigned long merges[2U] ; unsigned long ticks[2U] ; unsigned long io_ticks ; unsigned long time_in_queue ; }; struct partition_meta_info { char uuid[37U] ; u8 volname[64U] ; }; struct hd_struct { sector_t start_sect ; sector_t nr_sects ; seqcount_t nr_sects_seq ; sector_t alignment_offset ; unsigned int discard_alignment ; struct device __dev ; struct kobject *holder_dir ; int policy ; int partno ; struct partition_meta_info *info ; int make_it_fail ; unsigned long stamp ; atomic_t in_flight[2U] ; struct disk_stats *dkstats ; atomic_t ref ; struct callback_head callback_head ; }; struct disk_part_tbl { struct callback_head callback_head ; int len ; struct hd_struct *last_lookup ; struct hd_struct *part[] ; }; struct disk_events; struct timer_rand_state; struct blk_integrity; struct gendisk { int major ; int first_minor ; int minors ; char disk_name[32U] ; char *(*devnode)(struct gendisk * , umode_t * ) ; unsigned int events ; unsigned int async_events ; struct disk_part_tbl *part_tbl ; struct hd_struct part0 ; struct block_device_operations const *fops ; struct request_queue *queue ; void *private_data ; int flags ; struct device *driverfs_dev ; struct kobject *slave_dir ; struct timer_rand_state *random ; atomic_t sync_io ; struct disk_events *ev ; struct blk_integrity *integrity ; int node_id ; }; struct exception_table_entry { int insn ; int fixup ; }; enum irqreturn { IRQ_NONE = 0, IRQ_HANDLED = 1, IRQ_WAKE_THREAD = 2 } ; typedef enum irqreturn irqreturn_t; struct fprop_local_percpu { struct percpu_counter events ; unsigned int period ; raw_spinlock_t lock ; }; typedef int congested_fn(void * , int ); struct bdi_writeback_congested { unsigned long state ; atomic_t refcnt ; struct backing_dev_info *bdi ; int blkcg_id ; struct rb_node rb_node ; }; union __anonunion____missing_field_name_253 { struct work_struct release_work ; struct callback_head rcu ; }; struct bdi_writeback { struct backing_dev_info *bdi ; unsigned long state ; unsigned long last_old_flush ; struct list_head b_dirty ; struct list_head b_io ; struct list_head b_more_io ; struct list_head b_dirty_time ; spinlock_t list_lock ; struct percpu_counter stat[4U] ; struct bdi_writeback_congested *congested ; unsigned long bw_time_stamp ; unsigned long dirtied_stamp ; unsigned long written_stamp ; unsigned long write_bandwidth ; unsigned long avg_write_bandwidth ; unsigned long dirty_ratelimit ; unsigned long balanced_dirty_ratelimit ; struct fprop_local_percpu completions ; int dirty_exceeded ; spinlock_t work_lock ; struct list_head work_list ; struct delayed_work dwork ; struct percpu_ref refcnt ; struct fprop_local_percpu memcg_completions ; struct cgroup_subsys_state *memcg_css ; struct cgroup_subsys_state *blkcg_css ; struct list_head memcg_node ; struct list_head blkcg_node ; union __anonunion____missing_field_name_253 __annonCompField77 ; }; struct backing_dev_info { struct list_head bdi_list ; unsigned long ra_pages ; unsigned int capabilities ; congested_fn *congested_fn ; void *congested_data ; char *name ; unsigned int min_ratio ; unsigned int max_ratio ; unsigned int max_prop_frac ; atomic_long_t tot_write_bandwidth ; struct bdi_writeback wb ; struct radix_tree_root cgwb_tree ; struct rb_root cgwb_congested_tree ; atomic_t usage_cnt ; wait_queue_head_t wb_waitq ; struct device *dev ; struct timer_list laptop_mode_wb_timer ; struct dentry *debug_dir ; struct dentry *debug_stats ; }; typedef void *mempool_alloc_t(gfp_t , void * ); typedef void mempool_free_t(void * , void * ); struct mempool_s { spinlock_t lock ; int min_nr ; int curr_nr ; void **elements ; void *pool_data ; mempool_alloc_t *alloc ; mempool_free_t *free ; wait_queue_head_t wait ; }; typedef struct mempool_s mempool_t; union __anonunion____missing_field_name_254 { struct list_head q_node ; struct kmem_cache *__rcu_icq_cache ; }; union __anonunion____missing_field_name_255 { struct hlist_node ioc_node ; struct callback_head __rcu_head ; }; struct io_cq { struct request_queue *q ; struct io_context *ioc ; union __anonunion____missing_field_name_254 __annonCompField78 ; union __anonunion____missing_field_name_255 __annonCompField79 ; unsigned int flags ; }; struct io_context { atomic_long_t refcount ; atomic_t active_ref ; atomic_t nr_tasks ; spinlock_t lock ; unsigned short ioprio ; int nr_batch_requests ; unsigned long last_waited ; struct radix_tree_root icq_tree ; struct io_cq *icq_hint ; struct hlist_head icq_list ; struct work_struct release_work ; }; struct bio_integrity_payload { struct bio *bip_bio ; struct bvec_iter bip_iter ; bio_end_io_t *bip_end_io ; unsigned short bip_slab ; unsigned short bip_vcnt ; unsigned short bip_max_vcnt ; unsigned short bip_flags ; struct work_struct bip_work ; struct bio_vec *bip_vec ; struct bio_vec bip_inline_vecs[0U] ; }; struct bio_list { struct bio *head ; struct bio *tail ; }; struct bio_set { struct kmem_cache *bio_slab ; unsigned int front_pad ; mempool_t *bio_pool ; mempool_t *bvec_pool ; mempool_t *bio_integrity_pool ; mempool_t *bvec_integrity_pool ; spinlock_t rescue_lock ; struct bio_list rescue_list ; struct work_struct rescue_work ; struct workqueue_struct *rescue_workqueue ; }; struct bsg_class_device { struct device *class_dev ; struct device *parent ; int minor ; struct request_queue *queue ; struct kref ref ; void (*release)(struct device * ) ; }; struct elevator_queue; struct blk_trace; struct request; struct bsg_job; struct blkcg_gq; struct blk_flush_queue; typedef void rq_end_io_fn(struct request * , int ); struct request_list { struct request_queue *q ; struct blkcg_gq *blkg ; int count[2U] ; int starved[2U] ; mempool_t *rq_pool ; wait_queue_head_t wait[2U] ; unsigned int flags ; }; union __anonunion____missing_field_name_256 { struct call_single_data csd ; unsigned long fifo_time ; }; struct blk_mq_ctx; union __anonunion____missing_field_name_257 { struct hlist_node hash ; struct list_head ipi_list ; }; union __anonunion____missing_field_name_258 { struct rb_node rb_node ; void *completion_data ; }; struct __anonstruct_elv_260 { struct io_cq *icq ; void *priv[2U] ; }; struct __anonstruct_flush_261 { unsigned int seq ; struct list_head list ; rq_end_io_fn *saved_end_io ; }; union __anonunion____missing_field_name_259 { struct __anonstruct_elv_260 elv ; struct __anonstruct_flush_261 flush ; }; struct request { struct list_head queuelist ; union __anonunion____missing_field_name_256 __annonCompField80 ; struct request_queue *q ; struct blk_mq_ctx *mq_ctx ; u64 cmd_flags ; unsigned int cmd_type ; unsigned long atomic_flags ; int cpu ; unsigned int __data_len ; sector_t __sector ; struct bio *bio ; struct bio *biotail ; union __anonunion____missing_field_name_257 __annonCompField81 ; union __anonunion____missing_field_name_258 __annonCompField82 ; union __anonunion____missing_field_name_259 __annonCompField83 ; struct gendisk *rq_disk ; struct hd_struct *part ; unsigned long start_time ; struct request_list *rl ; unsigned long long start_time_ns ; unsigned long long io_start_time_ns ; unsigned short nr_phys_segments ; unsigned short nr_integrity_segments ; unsigned short ioprio ; void *special ; int tag ; int errors ; unsigned char __cmd[16U] ; unsigned char *cmd ; unsigned short cmd_len ; unsigned int extra_len ; unsigned int sense_len ; unsigned int resid_len ; void *sense ; unsigned long deadline ; struct list_head timeout_list ; unsigned int timeout ; int retries ; rq_end_io_fn *end_io ; void *end_io_data ; struct request *next_rq ; }; struct elevator_type; typedef int elevator_merge_fn(struct request_queue * , struct request ** , struct bio * ); typedef void elevator_merge_req_fn(struct request_queue * , struct request * , struct request * ); typedef void elevator_merged_fn(struct request_queue * , struct request * , int ); typedef int elevator_allow_merge_fn(struct request_queue * , struct request * , struct bio * ); typedef void elevator_bio_merged_fn(struct request_queue * , struct request * , struct bio * ); typedef int elevator_dispatch_fn(struct request_queue * , int ); typedef void elevator_add_req_fn(struct request_queue * , struct request * ); typedef struct request *elevator_request_list_fn(struct request_queue * , struct request * ); typedef void elevator_completed_req_fn(struct request_queue * , struct request * ); typedef int elevator_may_queue_fn(struct request_queue * , int ); typedef void elevator_init_icq_fn(struct io_cq * ); typedef void elevator_exit_icq_fn(struct io_cq * ); typedef int elevator_set_req_fn(struct request_queue * , struct request * , struct bio * , gfp_t ); typedef void elevator_put_req_fn(struct request * ); typedef void elevator_activate_req_fn(struct request_queue * , struct request * ); typedef void elevator_deactivate_req_fn(struct request_queue * , struct request * ); typedef int elevator_init_fn(struct request_queue * , struct elevator_type * ); typedef void elevator_exit_fn(struct elevator_queue * ); typedef void elevator_registered_fn(struct request_queue * ); struct elevator_ops { elevator_merge_fn *elevator_merge_fn ; elevator_merged_fn *elevator_merged_fn ; elevator_merge_req_fn *elevator_merge_req_fn ; elevator_allow_merge_fn *elevator_allow_merge_fn ; elevator_bio_merged_fn *elevator_bio_merged_fn ; elevator_dispatch_fn *elevator_dispatch_fn ; elevator_add_req_fn *elevator_add_req_fn ; elevator_activate_req_fn *elevator_activate_req_fn ; elevator_deactivate_req_fn *elevator_deactivate_req_fn ; elevator_completed_req_fn *elevator_completed_req_fn ; elevator_request_list_fn *elevator_former_req_fn ; elevator_request_list_fn *elevator_latter_req_fn ; elevator_init_icq_fn *elevator_init_icq_fn ; elevator_exit_icq_fn *elevator_exit_icq_fn ; elevator_set_req_fn *elevator_set_req_fn ; elevator_put_req_fn *elevator_put_req_fn ; elevator_may_queue_fn *elevator_may_queue_fn ; elevator_init_fn *elevator_init_fn ; elevator_exit_fn *elevator_exit_fn ; elevator_registered_fn *elevator_registered_fn ; }; struct elv_fs_entry { struct attribute attr ; ssize_t (*show)(struct elevator_queue * , char * ) ; ssize_t (*store)(struct elevator_queue * , char const * , size_t ) ; }; struct elevator_type { struct kmem_cache *icq_cache ; struct elevator_ops ops ; size_t icq_size ; size_t icq_align ; struct elv_fs_entry *elevator_attrs ; char elevator_name[16U] ; struct module *elevator_owner ; char icq_cache_name[21U] ; struct list_head list ; }; struct elevator_queue { struct elevator_type *type ; void *elevator_data ; struct kobject kobj ; struct mutex sysfs_lock ; unsigned char registered : 1 ; struct hlist_head hash[64U] ; }; typedef void request_fn_proc(struct request_queue * ); typedef void make_request_fn(struct request_queue * , struct bio * ); typedef int prep_rq_fn(struct request_queue * , struct request * ); typedef void unprep_rq_fn(struct request_queue * , struct request * ); struct bvec_merge_data { struct block_device *bi_bdev ; sector_t bi_sector ; unsigned int bi_size ; unsigned long bi_rw ; }; typedef int merge_bvec_fn(struct request_queue * , struct bvec_merge_data * , struct bio_vec * ); typedef void softirq_done_fn(struct request * ); typedef int dma_drain_needed_fn(struct request * ); typedef int lld_busy_fn(struct request_queue * ); typedef int bsg_job_fn(struct bsg_job * ); enum blk_eh_timer_return { BLK_EH_NOT_HANDLED = 0, BLK_EH_HANDLED = 1, BLK_EH_RESET_TIMER = 2 } ; typedef enum blk_eh_timer_return rq_timed_out_fn(struct request * ); struct blk_queue_tag { struct request **tag_index ; unsigned long *tag_map ; int busy ; int max_depth ; int real_max_depth ; atomic_t refcnt ; int alloc_policy ; int next_tag ; }; struct queue_limits { unsigned long bounce_pfn ; unsigned long seg_boundary_mask ; unsigned int max_hw_sectors ; unsigned int chunk_sectors ; unsigned int max_sectors ; unsigned int max_segment_size ; unsigned int physical_block_size ; unsigned int alignment_offset ; unsigned int io_min ; unsigned int io_opt ; unsigned int max_discard_sectors ; unsigned int max_write_same_sectors ; unsigned int discard_granularity ; unsigned int discard_alignment ; unsigned short logical_block_size ; unsigned short max_segments ; unsigned short max_integrity_segments ; unsigned char misaligned ; unsigned char discard_misaligned ; unsigned char cluster ; unsigned char discard_zeroes_data ; unsigned char raid_partial_stripes_expensive ; }; struct blk_mq_ops; struct blk_mq_hw_ctx; struct throtl_data; struct blk_mq_tag_set; struct request_queue { struct list_head queue_head ; struct request *last_merge ; struct elevator_queue *elevator ; int nr_rqs[2U] ; int nr_rqs_elvpriv ; struct request_list root_rl ; request_fn_proc *request_fn ; make_request_fn *make_request_fn ; prep_rq_fn *prep_rq_fn ; unprep_rq_fn *unprep_rq_fn ; merge_bvec_fn *merge_bvec_fn ; softirq_done_fn *softirq_done_fn ; rq_timed_out_fn *rq_timed_out_fn ; dma_drain_needed_fn *dma_drain_needed ; lld_busy_fn *lld_busy_fn ; struct blk_mq_ops *mq_ops ; unsigned int *mq_map ; struct blk_mq_ctx *queue_ctx ; unsigned int nr_queues ; struct blk_mq_hw_ctx **queue_hw_ctx ; unsigned int nr_hw_queues ; sector_t end_sector ; struct request *boundary_rq ; struct delayed_work delay_work ; struct backing_dev_info backing_dev_info ; void *queuedata ; unsigned long queue_flags ; int id ; gfp_t bounce_gfp ; spinlock_t __queue_lock ; spinlock_t *queue_lock ; struct kobject kobj ; struct kobject mq_kobj ; struct device *dev ; int rpm_status ; unsigned int nr_pending ; unsigned long nr_requests ; unsigned int nr_congestion_on ; unsigned int nr_congestion_off ; unsigned int nr_batching ; unsigned int dma_drain_size ; void *dma_drain_buffer ; unsigned int dma_pad_mask ; unsigned int dma_alignment ; struct blk_queue_tag *queue_tags ; struct list_head tag_busy_list ; unsigned int nr_sorted ; unsigned int in_flight[2U] ; unsigned int request_fn_active ; unsigned int rq_timeout ; struct timer_list timeout ; struct list_head timeout_list ; struct list_head icq_list ; unsigned long blkcg_pols[1U] ; struct blkcg_gq *root_blkg ; struct list_head blkg_list ; struct queue_limits limits ; unsigned int sg_timeout ; unsigned int sg_reserved_size ; int node ; struct blk_trace *blk_trace ; unsigned int flush_flags ; unsigned char flush_not_queueable : 1 ; struct blk_flush_queue *fq ; struct list_head requeue_list ; spinlock_t requeue_lock ; struct work_struct requeue_work ; struct mutex sysfs_lock ; int bypass_depth ; atomic_t mq_freeze_depth ; bsg_job_fn *bsg_job_fn ; int bsg_job_size ; struct bsg_class_device bsg_dev ; struct throtl_data *td ; struct callback_head callback_head ; wait_queue_head_t mq_freeze_wq ; struct percpu_ref mq_usage_counter ; struct list_head all_q_node ; struct blk_mq_tag_set *tag_set ; struct list_head tag_set_list ; }; struct blk_plug { struct list_head list ; struct list_head mq_list ; struct list_head cb_list ; }; struct blk_integrity_iter { void *prot_buf ; void *data_buf ; sector_t seed ; unsigned int data_size ; unsigned short interval ; char const *disk_name ; }; typedef int integrity_processing_fn(struct blk_integrity_iter * ); struct blk_integrity { integrity_processing_fn *generate_fn ; integrity_processing_fn *verify_fn ; unsigned short flags ; unsigned short tuple_size ; unsigned short interval ; unsigned short tag_size ; char const *name ; struct kobject kobj ; }; struct block_device_operations { int (*open)(struct block_device * , fmode_t ) ; void (*release)(struct gendisk * , fmode_t ) ; int (*rw_page)(struct block_device * , sector_t , struct page * , int ) ; int (*ioctl)(struct block_device * , fmode_t , unsigned int , unsigned long ) ; int (*compat_ioctl)(struct block_device * , fmode_t , unsigned int , unsigned long ) ; long (*direct_access)(struct block_device * , sector_t , void ** , unsigned long * , long ) ; unsigned int (*check_events)(struct gendisk * , unsigned int ) ; int (*media_changed)(struct gendisk * ) ; void (*unlock_native_capacity)(struct gendisk * ) ; int (*revalidate_disk)(struct gendisk * ) ; int (*getgeo)(struct block_device * , struct hd_geometry * ) ; void (*swap_slot_free_notify)(struct block_device * , unsigned long ) ; struct module *owner ; }; struct taskstats { __u16 version ; __u32 ac_exitcode ; __u8 ac_flag ; __u8 ac_nice ; __u64 cpu_count ; __u64 cpu_delay_total ; __u64 blkio_count ; __u64 blkio_delay_total ; __u64 swapin_count ; __u64 swapin_delay_total ; __u64 cpu_run_real_total ; __u64 cpu_run_virtual_total ; char ac_comm[32U] ; __u8 ac_sched ; __u8 ac_pad[3U] ; __u32 ac_uid ; __u32 ac_gid ; __u32 ac_pid ; __u32 ac_ppid ; __u32 ac_btime ; __u64 ac_etime ; __u64 ac_utime ; __u64 ac_stime ; __u64 ac_minflt ; __u64 ac_majflt ; __u64 coremem ; __u64 virtmem ; __u64 hiwater_rss ; __u64 hiwater_vm ; __u64 read_char ; __u64 write_char ; __u64 read_syscalls ; __u64 write_syscalls ; __u64 read_bytes ; __u64 write_bytes ; __u64 cancelled_write_bytes ; __u64 nvcsw ; __u64 nivcsw ; __u64 ac_utimescaled ; __u64 ac_stimescaled ; __u64 cpu_scaled_run_real_total ; __u64 freepages_count ; __u64 freepages_delay_total ; }; struct reclaim_state { unsigned long reclaimed_slab ; }; struct swap_extent { struct list_head list ; unsigned long start_page ; unsigned long nr_pages ; sector_t start_block ; }; struct swap_cluster_info { unsigned int data : 24 ; unsigned char flags ; }; struct percpu_cluster { struct swap_cluster_info index ; unsigned int next ; }; struct swap_info_struct { unsigned long flags ; short prio ; struct plist_node list ; struct plist_node avail_list ; signed char type ; unsigned int max ; unsigned char *swap_map ; struct swap_cluster_info *cluster_info ; struct swap_cluster_info free_cluster_head ; struct swap_cluster_info free_cluster_tail ; unsigned int lowest_bit ; unsigned int highest_bit ; unsigned int pages ; unsigned int inuse_pages ; unsigned int cluster_next ; unsigned int cluster_nr ; struct percpu_cluster *percpu_cluster ; struct swap_extent *curr_swap_extent ; struct swap_extent first_swap_extent ; struct block_device *bdev ; struct file *swap_file ; unsigned int old_block_size ; unsigned long *frontswap_map ; atomic_t frontswap_pages ; spinlock_t lock ; struct work_struct discard_work ; struct swap_cluster_info discard_cluster_head ; struct swap_cluster_info discard_cluster_tail ; }; typedef u64 async_cookie_t; struct scsi_sense_hdr { u8 response_code ; u8 sense_key ; u8 asc ; u8 ascq ; u8 byte4 ; u8 byte5 ; u8 byte6 ; u8 additional_length ; }; struct scsi_cmnd; enum scsi_device_state { SDEV_CREATED = 1, SDEV_RUNNING = 2, SDEV_CANCEL = 3, SDEV_DEL = 4, SDEV_QUIESCE = 5, SDEV_OFFLINE = 6, SDEV_TRANSPORT_OFFLINE = 7, SDEV_BLOCK = 8, SDEV_CREATED_BLOCK = 9 } ; struct Scsi_Host; struct scsi_target; struct scsi_dh_data; struct scsi_device { struct Scsi_Host *host ; struct request_queue *request_queue ; struct list_head siblings ; struct list_head same_target_siblings ; atomic_t device_busy ; atomic_t device_blocked ; spinlock_t list_lock ; struct list_head cmd_list ; struct list_head starved_entry ; struct scsi_cmnd *current_cmnd ; unsigned short queue_depth ; unsigned short max_queue_depth ; unsigned short last_queue_full_depth ; unsigned short last_queue_full_count ; unsigned long last_queue_full_time ; unsigned long queue_ramp_up_period ; unsigned long last_queue_ramp_up ; unsigned int id ; unsigned int channel ; u64 lun ; unsigned int manufacturer ; unsigned int sector_size ; void *hostdata ; char type ; char scsi_level ; char inq_periph_qual ; unsigned char inquiry_len ; unsigned char *inquiry ; char const *vendor ; char const *model ; char const *rev ; int vpd_pg83_len ; unsigned char *vpd_pg83 ; int vpd_pg80_len ; unsigned char *vpd_pg80 ; unsigned char current_tag ; struct scsi_target *sdev_target ; unsigned int sdev_bflags ; unsigned int eh_timeout ; unsigned char removable : 1 ; unsigned char changed : 1 ; unsigned char busy : 1 ; unsigned char lockable : 1 ; unsigned char locked : 1 ; unsigned char borken : 1 ; unsigned char disconnect : 1 ; unsigned char soft_reset : 1 ; unsigned char sdtr : 1 ; unsigned char wdtr : 1 ; unsigned char ppr : 1 ; unsigned char tagged_supported : 1 ; unsigned char simple_tags : 1 ; unsigned char was_reset : 1 ; unsigned char expecting_cc_ua : 1 ; unsigned char use_10_for_rw : 1 ; unsigned char use_10_for_ms : 1 ; unsigned char no_report_opcodes : 1 ; unsigned char no_write_same : 1 ; unsigned char use_16_for_rw : 1 ; unsigned char skip_ms_page_8 : 1 ; unsigned char skip_ms_page_3f : 1 ; unsigned char skip_vpd_pages : 1 ; unsigned char try_vpd_pages : 1 ; unsigned char use_192_bytes_for_3f : 1 ; unsigned char no_start_on_add : 1 ; unsigned char allow_restart : 1 ; unsigned char manage_start_stop : 1 ; unsigned char start_stop_pwr_cond : 1 ; unsigned char no_uld_attach : 1 ; unsigned char select_no_atn : 1 ; unsigned char fix_capacity : 1 ; unsigned char guess_capacity : 1 ; unsigned char retry_hwerror : 1 ; unsigned char last_sector_bug : 1 ; unsigned char no_read_disc_info : 1 ; unsigned char no_read_capacity_16 : 1 ; unsigned char try_rc_10_first : 1 ; unsigned char is_visible : 1 ; unsigned char wce_default_on : 1 ; unsigned char no_dif : 1 ; unsigned char broken_fua : 1 ; unsigned char lun_in_cdb : 1 ; atomic_t disk_events_disable_depth ; unsigned long supported_events[1U] ; unsigned long pending_events[1U] ; struct list_head event_list ; struct work_struct event_work ; unsigned int max_device_blocked ; atomic_t iorequest_cnt ; atomic_t iodone_cnt ; atomic_t ioerr_cnt ; struct device sdev_gendev ; struct device sdev_dev ; struct execute_work ew ; struct work_struct requeue_work ; struct scsi_dh_data *scsi_dh_data ; enum scsi_device_state sdev_state ; unsigned long sdev_data[0U] ; }; struct scsi_device_handler { struct list_head list ; struct module *module ; char const *name ; int (*check_sense)(struct scsi_device * , struct scsi_sense_hdr * ) ; struct scsi_dh_data *(*attach)(struct scsi_device * ) ; void (*detach)(struct scsi_device * ) ; int (*activate)(struct scsi_device * , void (*)(void * , int ) , void * ) ; int (*prep_fn)(struct scsi_device * , struct request * ) ; int (*set_params)(struct scsi_device * , char const * ) ; bool (*match)(struct scsi_device * ) ; }; struct scsi_dh_data { struct scsi_device_handler *scsi_dh ; struct scsi_device *sdev ; struct kref kref ; }; enum scsi_target_state { STARGET_CREATED = 1, STARGET_RUNNING = 2, STARGET_DEL = 3 } ; struct scsi_target { struct scsi_device *starget_sdev_user ; struct list_head siblings ; struct list_head devices ; struct device dev ; struct kref reap_ref ; unsigned int channel ; unsigned int id ; unsigned char create : 1 ; unsigned char single_lun : 1 ; unsigned char pdt_1f_for_no_lun : 1 ; unsigned char no_report_luns : 1 ; unsigned char expecting_lun_change : 1 ; atomic_t target_busy ; atomic_t target_blocked ; unsigned int can_queue ; unsigned int max_target_blocked ; char scsi_level ; enum scsi_target_state state ; void *hostdata ; unsigned long starget_data[0U] ; }; struct scsi_data_buffer { struct sg_table table ; unsigned int length ; int resid ; }; struct scsi_pointer { char *ptr ; int this_residual ; struct scatterlist *buffer ; int buffers_residual ; dma_addr_t dma_handle ; int volatile Status ; int volatile Message ; int volatile have_data_in ; int volatile sent_command ; int volatile phase ; }; struct scsi_cmnd { struct scsi_device *device ; struct list_head list ; struct list_head eh_entry ; struct delayed_work abort_work ; int eh_eflags ; unsigned long serial_number ; unsigned long jiffies_at_alloc ; int retries ; int allowed ; unsigned char prot_op ; unsigned char prot_type ; unsigned char prot_flags ; unsigned short cmd_len ; enum dma_data_direction sc_data_direction ; unsigned char *cmnd ; struct scsi_data_buffer sdb ; struct scsi_data_buffer *prot_sdb ; unsigned int underflow ; unsigned int transfersize ; struct request *request ; unsigned char *sense_buffer ; void (*scsi_done)(struct scsi_cmnd * ) ; struct scsi_pointer SCp ; unsigned char *host_scribble ; int result ; int flags ; unsigned char tag ; }; struct blk_mq_tags; struct blk_mq_cpu_notifier { struct list_head list ; void *data ; int (*notify)(void * , unsigned long , unsigned int ) ; }; struct blk_align_bitmap; struct blk_mq_ctxmap { unsigned int size ; unsigned int bits_per_word ; struct blk_align_bitmap *map ; }; struct __anonstruct____missing_field_name_273 { spinlock_t lock ; struct list_head dispatch ; }; struct blk_mq_hw_ctx { struct __anonstruct____missing_field_name_273 __annonCompField84 ; unsigned long state ; struct delayed_work run_work ; struct delayed_work delay_work ; cpumask_var_t cpumask ; int next_cpu ; int next_cpu_batch ; unsigned long flags ; struct request_queue *queue ; struct blk_flush_queue *fq ; void *driver_data ; struct blk_mq_ctxmap ctx_map ; unsigned int nr_ctx ; struct blk_mq_ctx **ctxs ; atomic_t wait_index ; struct blk_mq_tags *tags ; unsigned long queued ; unsigned long run ; unsigned long dispatched[10U] ; unsigned int numa_node ; unsigned int queue_num ; atomic_t nr_active ; struct blk_mq_cpu_notifier cpu_notifier ; struct kobject kobj ; }; struct blk_mq_tag_set { struct blk_mq_ops *ops ; unsigned int nr_hw_queues ; unsigned int queue_depth ; unsigned int reserved_tags ; unsigned int cmd_size ; int numa_node ; unsigned int timeout ; unsigned int flags ; void *driver_data ; struct blk_mq_tags **tags ; struct mutex tag_list_lock ; struct list_head tag_list ; }; struct blk_mq_queue_data { struct request *rq ; struct list_head *list ; bool last ; }; typedef int queue_rq_fn(struct blk_mq_hw_ctx * , struct blk_mq_queue_data const * ); typedef struct blk_mq_hw_ctx *map_queue_fn(struct request_queue * , int const ); typedef enum blk_eh_timer_return timeout_fn(struct request * , bool ); typedef int init_hctx_fn(struct blk_mq_hw_ctx * , void * , unsigned int ); typedef void exit_hctx_fn(struct blk_mq_hw_ctx * , unsigned int ); typedef int init_request_fn(void * , struct request * , unsigned int , unsigned int , unsigned int ); typedef void exit_request_fn(void * , struct request * , unsigned int , unsigned int ); struct blk_mq_ops { queue_rq_fn *queue_rq ; map_queue_fn *map_queue ; timeout_fn *timeout ; softirq_done_fn *complete ; init_hctx_fn *init_hctx ; exit_hctx_fn *exit_hctx ; init_request_fn *init_request ; exit_request_fn *exit_request ; }; struct scsi_host_cmd_pool; struct scsi_transport_template; struct scsi_host_template { struct module *module ; char const *name ; int (*detect)(struct scsi_host_template * ) ; int (*release)(struct Scsi_Host * ) ; char const *(*info)(struct Scsi_Host * ) ; int (*ioctl)(struct scsi_device * , int , void * ) ; int (*compat_ioctl)(struct scsi_device * , int , void * ) ; int (*queuecommand)(struct Scsi_Host * , struct scsi_cmnd * ) ; int (*eh_abort_handler)(struct scsi_cmnd * ) ; int (*eh_device_reset_handler)(struct scsi_cmnd * ) ; int (*eh_target_reset_handler)(struct scsi_cmnd * ) ; int (*eh_bus_reset_handler)(struct scsi_cmnd * ) ; int (*eh_host_reset_handler)(struct scsi_cmnd * ) ; int (*slave_alloc)(struct scsi_device * ) ; int (*slave_configure)(struct scsi_device * ) ; void (*slave_destroy)(struct scsi_device * ) ; int (*target_alloc)(struct scsi_target * ) ; void (*target_destroy)(struct scsi_target * ) ; int (*scan_finished)(struct Scsi_Host * , unsigned long ) ; void (*scan_start)(struct Scsi_Host * ) ; int (*change_queue_depth)(struct scsi_device * , int ) ; int (*bios_param)(struct scsi_device * , struct block_device * , sector_t , int * ) ; void (*unlock_native_capacity)(struct scsi_device * ) ; int (*show_info)(struct seq_file * , struct Scsi_Host * ) ; int (*write_info)(struct Scsi_Host * , char * , int ) ; enum blk_eh_timer_return (*eh_timed_out)(struct scsi_cmnd * ) ; int (*host_reset)(struct Scsi_Host * , int ) ; char const *proc_name ; struct proc_dir_entry *proc_dir ; int can_queue ; int this_id ; unsigned short sg_tablesize ; unsigned short sg_prot_tablesize ; unsigned int max_sectors ; unsigned long dma_boundary ; short cmd_per_lun ; unsigned char present ; int tag_alloc_policy ; unsigned char use_blk_tags : 1 ; unsigned char track_queue_depth : 1 ; unsigned char supported_mode : 2 ; unsigned char unchecked_isa_dma : 1 ; unsigned char use_clustering : 1 ; unsigned char emulated : 1 ; unsigned char skip_settle_delay : 1 ; unsigned char no_write_same : 1 ; unsigned char no_async_abort : 1 ; unsigned int max_host_blocked ; struct device_attribute **shost_attrs ; struct device_attribute **sdev_attrs ; struct list_head legacy_hosts ; u64 vendor_id ; unsigned int cmd_size ; struct scsi_host_cmd_pool *cmd_pool ; bool disable_blk_mq ; }; enum scsi_host_state { SHOST_CREATED = 1, SHOST_RUNNING = 2, SHOST_CANCEL = 3, SHOST_DEL = 4, SHOST_RECOVERY = 5, SHOST_CANCEL_RECOVERY = 6, SHOST_DEL_RECOVERY = 7 } ; union __anonunion____missing_field_name_274 { struct blk_queue_tag *bqt ; struct blk_mq_tag_set tag_set ; }; struct Scsi_Host { struct list_head __devices ; struct list_head __targets ; struct scsi_host_cmd_pool *cmd_pool ; spinlock_t free_list_lock ; struct list_head free_list ; struct list_head starved_list ; spinlock_t default_lock ; spinlock_t *host_lock ; struct mutex scan_mutex ; struct list_head eh_cmd_q ; struct task_struct *ehandler ; struct completion *eh_action ; wait_queue_head_t host_wait ; struct scsi_host_template *hostt ; struct scsi_transport_template *transportt ; union __anonunion____missing_field_name_274 __annonCompField85 ; atomic_t host_busy ; atomic_t host_blocked ; unsigned int host_failed ; unsigned int host_eh_scheduled ; unsigned int host_no ; int eh_deadline ; unsigned long last_reset ; unsigned int max_channel ; unsigned int max_id ; u64 max_lun ; unsigned int unique_id ; unsigned short max_cmd_len ; int this_id ; int can_queue ; short cmd_per_lun ; unsigned short sg_tablesize ; unsigned short sg_prot_tablesize ; unsigned int max_sectors ; unsigned long dma_boundary ; unsigned int nr_hw_queues ; unsigned long cmd_serial_number ; unsigned char active_mode : 2 ; unsigned char unchecked_isa_dma : 1 ; unsigned char use_clustering : 1 ; unsigned char host_self_blocked : 1 ; unsigned char reverse_ordering : 1 ; unsigned char tmf_in_progress : 1 ; unsigned char async_scan : 1 ; unsigned char eh_noresume : 1 ; unsigned char no_write_same : 1 ; unsigned char use_blk_mq : 1 ; unsigned char use_cmd_list : 1 ; char work_q_name[20U] ; struct workqueue_struct *work_q ; struct workqueue_struct *tmf_work_q ; unsigned char no_scsi2_lun_in_cdb : 1 ; unsigned int max_host_blocked ; unsigned int prot_capabilities ; unsigned char prot_guard_type ; struct request_queue *uspace_req_q ; unsigned long base ; unsigned long io_port ; unsigned char n_io_port ; unsigned char dma_channel ; unsigned int irq ; enum scsi_host_state shost_state ; struct device shost_gendev ; struct device shost_dev ; struct list_head sht_legacy_list ; void *shost_data ; struct device *dma_dev ; unsigned long hostdata[0U] ; }; struct ata_bmdma_prd { __le32 addr ; __le32 flags_len ; }; enum fwnode_type { FWNODE_INVALID = 0, FWNODE_OF = 1, FWNODE_ACPI = 2, FWNODE_PDATA = 3 } ; struct fwnode_handle { enum fwnode_type type ; struct fwnode_handle *secondary ; }; typedef u64 acpi_io_address; typedef void *acpi_handle; typedef u32 acpi_object_type; struct __anonstruct_integer_278 { acpi_object_type type ; u64 value ; }; struct __anonstruct_string_279 { acpi_object_type type ; u32 length ; char *pointer ; }; struct __anonstruct_buffer_280 { acpi_object_type type ; u32 length ; u8 *pointer ; }; struct __anonstruct_package_281 { acpi_object_type type ; u32 count ; union acpi_object *elements ; }; struct __anonstruct_reference_282 { acpi_object_type type ; acpi_object_type actual_type ; acpi_handle handle ; }; struct __anonstruct_processor_283 { acpi_object_type type ; u32 proc_id ; acpi_io_address pblk_address ; u32 pblk_length ; }; struct __anonstruct_power_resource_284 { acpi_object_type type ; u32 system_level ; u32 resource_order ; }; union acpi_object { acpi_object_type type ; struct __anonstruct_integer_278 integer ; struct __anonstruct_string_279 string ; struct __anonstruct_buffer_280 buffer ; struct __anonstruct_package_281 package ; struct __anonstruct_reference_282 reference ; struct __anonstruct_processor_283 processor ; struct __anonstruct_power_resource_284 power_resource ; }; struct platform_device; enum ata_lpm_policy { ATA_LPM_UNKNOWN = 0, ATA_LPM_MAX_POWER = 1, ATA_LPM_MED_POWER = 2, ATA_LPM_MIN_POWER = 3 } ; struct ata_port_operations; enum sw_activity { OFF = 0, BLINK_ON = 1, BLINK_OFF = 2 } ; struct ata_taskfile { unsigned long flags ; u8 protocol ; u8 ctl ; u8 hob_feature ; u8 hob_nsect ; u8 hob_lbal ; u8 hob_lbam ; u8 hob_lbah ; u8 feature ; u8 nsect ; u8 lbal ; u8 lbam ; u8 lbah ; u8 device ; u8 command ; u32 auxiliary ; }; struct ata_ioports { void *cmd_addr ; void *data_addr ; void *error_addr ; void *feature_addr ; void *nsect_addr ; void *lbal_addr ; void *lbam_addr ; void *lbah_addr ; void *device_addr ; void *status_addr ; void *command_addr ; void *altstatus_addr ; void *ctl_addr ; void *bmdma_addr ; void *scr_addr ; }; struct ata_host { spinlock_t lock ; struct device *dev ; void * const *iomap ; unsigned int n_ports ; unsigned int n_tags ; void *private_data ; struct ata_port_operations *ops ; unsigned long flags ; struct mutex eh_mutex ; struct task_struct *eh_owner ; struct ata_port *simplex_claimed ; struct ata_port *ports[0U] ; }; struct ata_device; struct ata_queued_cmd { struct ata_port *ap ; struct ata_device *dev ; struct scsi_cmnd *scsicmd ; void (*scsidone)(struct scsi_cmnd * ) ; struct ata_taskfile tf ; u8 cdb[16U] ; unsigned long flags ; unsigned int tag ; unsigned int n_elem ; unsigned int orig_n_elem ; int dma_dir ; unsigned int sect_size ; unsigned int nbytes ; unsigned int extrabytes ; unsigned int curbytes ; struct scatterlist sgent ; struct scatterlist *sg ; struct scatterlist *cursg ; unsigned int cursg_ofs ; unsigned int err_mask ; struct ata_taskfile result_tf ; void (*complete_fn)(struct ata_queued_cmd * ) ; void *private_data ; void *lldd_task ; }; struct ata_port_stats { unsigned long unhandled_irq ; unsigned long idle_irq ; unsigned long rw_reqbuf ; }; struct ata_ering_entry { unsigned int eflags ; unsigned int err_mask ; u64 timestamp ; }; struct ata_ering { int cursor ; struct ata_ering_entry ring[32U] ; }; union __anonunion____missing_field_name_294 { u16 id[256U] ; u32 gscr[128U] ; }; struct ata_device { struct ata_link *link ; unsigned int devno ; unsigned int horkage ; unsigned long flags ; struct scsi_device *sdev ; void *private_data ; union acpi_object *gtf_cache ; unsigned int gtf_filter ; void *zpodd ; struct device tdev ; u64 n_sectors ; u64 n_native_sectors ; unsigned int class ; unsigned long unpark_deadline ; u8 pio_mode ; u8 dma_mode ; u8 xfer_mode ; unsigned int xfer_shift ; unsigned int multi_count ; unsigned int max_sectors ; unsigned int cdb_len ; unsigned long pio_mask ; unsigned long mwdma_mask ; unsigned long udma_mask ; u16 cylinders ; u16 heads ; u16 sectors ; union __anonunion____missing_field_name_294 __annonCompField86 ; u8 devslp_timing[8U] ; u8 ncq_send_recv_cmds[16U] ; int spdn_cnt ; struct ata_ering ering ; }; struct ata_eh_info { struct ata_device *dev ; u32 serror ; unsigned int err_mask ; unsigned int action ; unsigned int dev_action[2U] ; unsigned int flags ; unsigned int probe_mask ; char desc[80U] ; int desc_len ; }; struct ata_eh_context { struct ata_eh_info i ; int tries[2U] ; int cmd_timeout_idx[2U][6U] ; unsigned int classes[2U] ; unsigned int did_probe_mask ; unsigned int unloaded_mask ; unsigned int saved_ncq_enabled ; u8 saved_xfer_mode[2U] ; unsigned long last_reset ; }; struct ata_acpi_drive { u32 pio ; u32 dma ; }; struct ata_acpi_gtm { struct ata_acpi_drive drive[2U] ; u32 flags ; }; struct ata_link { struct ata_port *ap ; int pmp ; struct device tdev ; unsigned int active_tag ; u32 sactive ; unsigned int flags ; u32 saved_scontrol ; unsigned int hw_sata_spd_limit ; unsigned int sata_spd_limit ; unsigned int sata_spd ; enum ata_lpm_policy lpm_policy ; struct ata_eh_info eh_info ; struct ata_eh_context eh_context ; struct ata_device device[2U] ; unsigned long last_lpm_change ; }; struct ata_port { struct Scsi_Host *scsi_host ; struct ata_port_operations *ops ; spinlock_t *lock ; unsigned long flags ; unsigned int pflags ; unsigned int print_id ; unsigned int local_port_no ; unsigned int port_no ; struct ata_ioports ioaddr ; u8 ctl ; u8 last_ctl ; struct ata_link *sff_pio_task_link ; struct delayed_work sff_pio_task ; struct ata_bmdma_prd *bmdma_prd ; dma_addr_t bmdma_prd_dma ; unsigned int pio_mask ; unsigned int mwdma_mask ; unsigned int udma_mask ; unsigned int cbl ; struct ata_queued_cmd qcmd[32U] ; unsigned long sas_tag_allocated ; unsigned int qc_active ; int nr_active_links ; unsigned int sas_last_tag ; struct ata_link link ; struct ata_link *slave_link ; int nr_pmp_links ; struct ata_link *pmp_link ; struct ata_link *excl_link ; struct ata_port_stats stats ; struct ata_host *host ; struct device *dev ; struct device tdev ; struct mutex scsi_scan_mutex ; struct delayed_work hotplug_task ; struct work_struct scsi_rescan_task ; unsigned int hsm_task_state ; u32 msg_enable ; struct list_head eh_done_q ; wait_queue_head_t eh_wait_q ; int eh_tries ; struct completion park_req_pending ; pm_message_t pm_mesg ; enum ata_lpm_policy target_lpm_policy ; struct timer_list fastdrain_timer ; unsigned long fastdrain_cnt ; int em_message_type ; void *private_data ; struct ata_acpi_gtm __acpi_init_gtm ; u8 sector_buf[512U] ; }; struct ata_port_operations { int (*qc_defer)(struct ata_queued_cmd * ) ; int (*check_atapi_dma)(struct ata_queued_cmd * ) ; void (*qc_prep)(struct ata_queued_cmd * ) ; unsigned int (*qc_issue)(struct ata_queued_cmd * ) ; bool (*qc_fill_rtf)(struct ata_queued_cmd * ) ; int (*cable_detect)(struct ata_port * ) ; unsigned long (*mode_filter)(struct ata_device * , unsigned long ) ; void (*set_piomode)(struct ata_port * , struct ata_device * ) ; void (*set_dmamode)(struct ata_port * , struct ata_device * ) ; int (*set_mode)(struct ata_link * , struct ata_device ** ) ; unsigned int (*read_id)(struct ata_device * , struct ata_taskfile * , u16 * ) ; void (*dev_config)(struct ata_device * ) ; void (*freeze)(struct ata_port * ) ; void (*thaw)(struct ata_port * ) ; int (*prereset)(struct ata_link * , unsigned long ) ; int (*softreset)(struct ata_link * , unsigned int * , unsigned long ) ; int (*hardreset)(struct ata_link * , unsigned int * , unsigned long ) ; void (*postreset)(struct ata_link * , unsigned int * ) ; int (*pmp_prereset)(struct ata_link * , unsigned long ) ; int (*pmp_softreset)(struct ata_link * , unsigned int * , unsigned long ) ; int (*pmp_hardreset)(struct ata_link * , unsigned int * , unsigned long ) ; void (*pmp_postreset)(struct ata_link * , unsigned int * ) ; void (*error_handler)(struct ata_port * ) ; void (*lost_interrupt)(struct ata_port * ) ; void (*post_internal_cmd)(struct ata_queued_cmd * ) ; void (*sched_eh)(struct ata_port * ) ; void (*end_eh)(struct ata_port * ) ; int (*scr_read)(struct ata_link * , unsigned int , u32 * ) ; int (*scr_write)(struct ata_link * , unsigned int , u32 ) ; void (*pmp_attach)(struct ata_port * ) ; void (*pmp_detach)(struct ata_port * ) ; int (*set_lpm)(struct ata_link * , enum ata_lpm_policy , unsigned int ) ; int (*port_suspend)(struct ata_port * , pm_message_t ) ; int (*port_resume)(struct ata_port * ) ; int (*port_start)(struct ata_port * ) ; void (*port_stop)(struct ata_port * ) ; void (*host_stop)(struct ata_host * ) ; void (*sff_dev_select)(struct ata_port * , unsigned int ) ; void (*sff_set_devctl)(struct ata_port * , u8 ) ; u8 (*sff_check_status)(struct ata_port * ) ; u8 (*sff_check_altstatus)(struct ata_port * ) ; void (*sff_tf_load)(struct ata_port * , struct ata_taskfile const * ) ; void (*sff_tf_read)(struct ata_port * , struct ata_taskfile * ) ; void (*sff_exec_command)(struct ata_port * , struct ata_taskfile const * ) ; unsigned int (*sff_data_xfer)(struct ata_device * , unsigned char * , unsigned int , int ) ; void (*sff_irq_on)(struct ata_port * ) ; bool (*sff_irq_check)(struct ata_port * ) ; void (*sff_irq_clear)(struct ata_port * ) ; void (*sff_drain_fifo)(struct ata_queued_cmd * ) ; void (*bmdma_setup)(struct ata_queued_cmd * ) ; void (*bmdma_start)(struct ata_queued_cmd * ) ; void (*bmdma_stop)(struct ata_queued_cmd * ) ; u8 (*bmdma_status)(struct ata_port * ) ; ssize_t (*em_show)(struct ata_port * , char * ) ; ssize_t (*em_store)(struct ata_port * , char const * , size_t ) ; ssize_t (*sw_activity_show)(struct ata_device * , char * ) ; ssize_t (*sw_activity_store)(struct ata_device * , enum sw_activity ) ; ssize_t (*transmit_led_message)(struct ata_port * , u32 , ssize_t ) ; void (*phy_reset)(struct ata_port * ) ; void (*eng_timeout)(struct ata_port * ) ; struct ata_port_operations const *inherits ; }; struct ata_port_info { unsigned long flags ; unsigned long link_flags ; unsigned long pio_mask ; unsigned long mwdma_mask ; unsigned long udma_mask ; struct ata_port_operations *port_ops ; void *private_data ; }; struct ata_timing { unsigned short mode ; unsigned short setup ; unsigned short act8b ; unsigned short rec8b ; unsigned short cyc8b ; unsigned short active ; unsigned short recover ; unsigned short dmack_hold ; unsigned short cycle ; unsigned short udma ; }; struct pci_bits { unsigned int reg ; unsigned int width ; unsigned long mask ; unsigned long val ; }; enum ata_link_iter_mode { ATA_LITER_EDGE = 0, ATA_LITER_HOST_FIRST = 1, ATA_LITER_PMP_FIRST = 2 } ; enum ata_dev_iter_mode { ATA_DITER_ENABLED = 0, ATA_DITER_ENABLED_REVERSE = 1, ATA_DITER_ALL = 2, ATA_DITER_ALL_REVERSE = 3 } ; struct mfd_cell; struct platform_device { char const *name ; int id ; bool id_auto ; struct device dev ; u32 num_resources ; struct resource *resource ; struct platform_device_id const *id_entry ; char *driver_override ; struct mfd_cell *mfd_cell ; struct pdev_archdata archdata ; }; struct tracepoint_func { void *func ; void *data ; }; struct tracepoint { char const *name ; struct static_key key ; void (*regfunc)(void) ; void (*unregfunc)(void) ; struct tracepoint_func *funcs ; }; struct trace_enum_map { char const *system ; char const *enum_string ; unsigned long enum_value ; }; struct seq_buf { char *buffer ; size_t size ; size_t len ; loff_t readpos ; }; struct trace_seq { unsigned char buffer[4096U] ; struct seq_buf seq ; int full ; }; union __anonunion___u_296 { struct tracepoint_func *__val ; char __c[1U] ; }; union __anonunion___u_298 { struct tracepoint_func *__val ; char __c[1U] ; }; union __anonunion___u_300 { struct tracepoint_func *__val ; char __c[1U] ; }; union __anonunion___u_302 { struct tracepoint_func *__val ; char __c[1U] ; }; union __anonunion___u_304 { struct tracepoint_func *__val ; char __c[1U] ; }; union __anonunion___u_306 { struct tracepoint_func *__val ; char __c[1U] ; }; union __anonunion___u_308 { struct tracepoint_func *__val ; char __c[1U] ; }; union __anonunion___u_310 { struct tracepoint_func *__val ; char __c[1U] ; }; struct pollfd { int fd ; short events ; short revents ; }; struct poll_table_struct { void (*_qproc)(struct file * , wait_queue_head_t * , struct poll_table_struct * ) ; unsigned long _key ; }; struct ring_buffer; struct ring_buffer_iter; union __anonunion____missing_field_name_320 { __u64 sample_period ; __u64 sample_freq ; }; union __anonunion____missing_field_name_321 { __u32 wakeup_events ; __u32 wakeup_watermark ; }; union __anonunion____missing_field_name_322 { __u64 bp_addr ; __u64 config1 ; }; union __anonunion____missing_field_name_323 { __u64 bp_len ; __u64 config2 ; }; struct perf_event_attr { __u32 type ; __u32 size ; __u64 config ; union __anonunion____missing_field_name_320 __annonCompField87 ; __u64 sample_type ; __u64 read_format ; unsigned char disabled : 1 ; unsigned char inherit : 1 ; unsigned char pinned : 1 ; unsigned char exclusive : 1 ; unsigned char exclude_user : 1 ; unsigned char exclude_kernel : 1 ; unsigned char exclude_hv : 1 ; unsigned char exclude_idle : 1 ; unsigned char mmap : 1 ; unsigned char comm : 1 ; unsigned char freq : 1 ; unsigned char inherit_stat : 1 ; unsigned char enable_on_exec : 1 ; unsigned char task : 1 ; unsigned char watermark : 1 ; unsigned char precise_ip : 2 ; unsigned char mmap_data : 1 ; unsigned char sample_id_all : 1 ; unsigned char exclude_host : 1 ; unsigned char exclude_guest : 1 ; unsigned char exclude_callchain_kernel : 1 ; unsigned char exclude_callchain_user : 1 ; unsigned char mmap2 : 1 ; unsigned char comm_exec : 1 ; unsigned char use_clockid : 1 ; unsigned long __reserved_1 : 38 ; union __anonunion____missing_field_name_321 __annonCompField88 ; __u32 bp_type ; union __anonunion____missing_field_name_322 __annonCompField89 ; union __anonunion____missing_field_name_323 __annonCompField90 ; __u64 branch_sample_type ; __u64 sample_regs_user ; __u32 sample_stack_user ; __s32 clockid ; __u64 sample_regs_intr ; __u32 aux_watermark ; __u32 __reserved_2 ; }; struct __anonstruct____missing_field_name_326 { unsigned char mem_op : 5 ; unsigned short mem_lvl : 14 ; unsigned char mem_snoop : 5 ; unsigned char mem_lock : 2 ; unsigned char mem_dtlb : 7 ; unsigned int mem_rsvd : 31 ; }; union perf_mem_data_src { __u64 val ; struct __anonstruct____missing_field_name_326 __annonCompField93 ; }; struct perf_branch_entry { __u64 from ; __u64 to ; unsigned char mispred : 1 ; unsigned char predicted : 1 ; unsigned char in_tx : 1 ; unsigned char abort : 1 ; unsigned long reserved : 60 ; }; struct mnt_namespace; struct ipc_namespace; struct nsproxy { atomic_t count ; struct uts_namespace *uts_ns ; struct ipc_namespace *ipc_ns ; struct mnt_namespace *mnt_ns ; struct pid_namespace *pid_ns_for_children ; struct net *net_ns ; }; struct proc_ns_operations; struct ns_common { atomic_long_t stashed ; struct proc_ns_operations const *ops ; unsigned int inum ; }; struct pidmap { atomic_t nr_free ; void *page ; }; struct fs_pin; struct pid_namespace { struct kref kref ; struct pidmap pidmap[128U] ; struct callback_head rcu ; int last_pid ; unsigned int nr_hashed ; struct task_struct *child_reaper ; struct kmem_cache *pid_cachep ; unsigned int level ; struct pid_namespace *parent ; struct vfsmount *proc_mnt ; struct dentry *proc_self ; struct dentry *proc_thread_self ; struct fs_pin *bacct ; struct user_namespace *user_ns ; struct work_struct proc_work ; kgid_t pid_gid ; int hide_pid ; int reboot ; struct ns_common ns ; }; struct __anonstruct_local_t_334 { atomic_long_t a ; }; typedef struct __anonstruct_local_t_334 local_t; struct __anonstruct_local64_t_335 { local_t a ; }; typedef struct __anonstruct_local64_t_335 local64_t; struct arch_hw_breakpoint { unsigned long address ; unsigned long mask ; u8 len ; u8 type ; }; struct pmu; typedef s32 compat_time_t; struct compat_timespec { compat_time_t tv_sec ; s32 tv_nsec ; }; struct ftrace_hash; struct ftrace_ops; struct ftrace_ops_hash { struct ftrace_hash *notrace_hash ; struct ftrace_hash *filter_hash ; struct mutex regex_lock ; }; struct ftrace_ops { void (*func)(unsigned long , unsigned long , struct ftrace_ops * , struct pt_regs * ) ; struct ftrace_ops *next ; unsigned long flags ; void *private ; int *disabled ; int nr_trampolines ; struct ftrace_ops_hash local_hash ; struct ftrace_ops_hash *func_hash ; struct ftrace_ops_hash old_hash ; unsigned long trampoline ; unsigned long trampoline_size ; }; struct ftrace_ret_stack { unsigned long ret ; unsigned long func ; unsigned long long calltime ; unsigned long long subtime ; unsigned long fp ; }; struct irq_work { unsigned long flags ; struct llist_node llnode ; void (*func)(struct irq_work * ) ; }; struct perf_regs { __u64 abi ; struct pt_regs *regs ; }; struct perf_callchain_entry { __u64 nr ; __u64 ip[127U] ; }; struct perf_raw_record { u32 size ; void *data ; }; struct perf_branch_stack { __u64 nr ; struct perf_branch_entry entries[0U] ; }; struct hw_perf_event_extra { u64 config ; unsigned int reg ; int alloc ; int idx ; }; struct __anonstruct____missing_field_name_346 { u64 config ; u64 last_tag ; unsigned long config_base ; unsigned long event_base ; int event_base_rdpmc ; int idx ; int last_cpu ; int flags ; struct hw_perf_event_extra extra_reg ; struct hw_perf_event_extra branch_reg ; }; struct __anonstruct____missing_field_name_347 { struct hrtimer hrtimer ; }; struct __anonstruct____missing_field_name_348 { struct list_head tp_list ; }; struct __anonstruct____missing_field_name_349 { int cqm_state ; u32 cqm_rmid ; struct list_head cqm_events_entry ; struct list_head cqm_groups_entry ; struct list_head cqm_group_entry ; }; struct __anonstruct____missing_field_name_350 { int itrace_started ; }; struct __anonstruct____missing_field_name_351 { struct arch_hw_breakpoint info ; struct list_head bp_list ; }; union __anonunion____missing_field_name_345 { struct __anonstruct____missing_field_name_346 __annonCompField94 ; struct __anonstruct____missing_field_name_347 __annonCompField95 ; struct __anonstruct____missing_field_name_348 __annonCompField96 ; struct __anonstruct____missing_field_name_349 __annonCompField97 ; struct __anonstruct____missing_field_name_350 __annonCompField98 ; struct __anonstruct____missing_field_name_351 __annonCompField99 ; }; struct hw_perf_event { union __anonunion____missing_field_name_345 __annonCompField100 ; struct task_struct *target ; int state ; local64_t prev_count ; u64 sample_period ; u64 last_period ; local64_t period_left ; u64 interrupts_seq ; u64 interrupts ; u64 freq_time_stamp ; u64 freq_count_stamp ; }; struct perf_cpu_context; struct pmu { struct list_head entry ; struct module *module ; struct device *dev ; struct attribute_group const **attr_groups ; char const *name ; int type ; int capabilities ; int *pmu_disable_count ; struct perf_cpu_context *pmu_cpu_context ; atomic_t exclusive_cnt ; int task_ctx_nr ; int hrtimer_interval_ms ; void (*pmu_enable)(struct pmu * ) ; void (*pmu_disable)(struct pmu * ) ; int (*event_init)(struct perf_event * ) ; void (*event_mapped)(struct perf_event * ) ; void (*event_unmapped)(struct perf_event * ) ; int (*add)(struct perf_event * , int ) ; void (*del)(struct perf_event * , int ) ; void (*start)(struct perf_event * , int ) ; void (*stop)(struct perf_event * , int ) ; void (*read)(struct perf_event * ) ; void (*start_txn)(struct pmu * ) ; int (*commit_txn)(struct pmu * ) ; void (*cancel_txn)(struct pmu * ) ; int (*event_idx)(struct perf_event * ) ; void (*sched_task)(struct perf_event_context * , bool ) ; size_t task_ctx_size ; u64 (*count)(struct perf_event * ) ; void *(*setup_aux)(int , void ** , int , bool ) ; void (*free_aux)(void * ) ; int (*filter_match)(struct perf_event * ) ; }; enum perf_event_active_state { PERF_EVENT_STATE_EXIT = -3, PERF_EVENT_STATE_ERROR = -2, PERF_EVENT_STATE_OFF = -1, PERF_EVENT_STATE_INACTIVE = 0, PERF_EVENT_STATE_ACTIVE = 1 } ; struct perf_sample_data; struct perf_cgroup; struct event_filter; struct perf_event { struct list_head event_entry ; struct list_head group_entry ; struct list_head sibling_list ; struct list_head migrate_entry ; struct hlist_node hlist_entry ; struct list_head active_entry ; int nr_siblings ; int group_flags ; struct perf_event *group_leader ; struct pmu *pmu ; enum perf_event_active_state state ; unsigned int attach_state ; local64_t count ; atomic64_t child_count ; u64 total_time_enabled ; u64 total_time_running ; u64 tstamp_enabled ; u64 tstamp_running ; u64 tstamp_stopped ; u64 shadow_ctx_time ; struct perf_event_attr attr ; u16 header_size ; u16 id_header_size ; u16 read_size ; struct hw_perf_event hw ; struct perf_event_context *ctx ; atomic_long_t refcount ; atomic64_t child_total_time_enabled ; atomic64_t child_total_time_running ; struct mutex child_mutex ; struct list_head child_list ; struct perf_event *parent ; int oncpu ; int cpu ; struct list_head owner_entry ; struct task_struct *owner ; struct mutex mmap_mutex ; atomic_t mmap_count ; struct ring_buffer *rb ; struct list_head rb_entry ; unsigned long rcu_batches ; int rcu_pending ; wait_queue_head_t waitq ; struct fasync_struct *fasync ; int pending_wakeup ; int pending_kill ; int pending_disable ; struct irq_work pending ; atomic_t event_limit ; void (*destroy)(struct perf_event * ) ; struct callback_head callback_head ; struct pid_namespace *ns ; u64 id ; u64 (*clock)(void) ; void (*overflow_handler)(struct perf_event * , struct perf_sample_data * , struct pt_regs * ) ; void *overflow_handler_context ; struct trace_event_call *tp_event ; struct event_filter *filter ; struct ftrace_ops ftrace_ops ; struct perf_cgroup *cgrp ; int cgrp_defer_enabled ; }; struct perf_event_context { struct pmu *pmu ; raw_spinlock_t lock ; struct mutex mutex ; struct list_head active_ctx_list ; struct list_head pinned_groups ; struct list_head flexible_groups ; struct list_head event_list ; int nr_events ; int nr_active ; int is_active ; int nr_stat ; int nr_freq ; int rotate_disable ; atomic_t refcount ; struct task_struct *task ; u64 time ; u64 timestamp ; struct perf_event_context *parent_ctx ; u64 parent_gen ; u64 generation ; int pin_count ; int nr_cgroups ; void *task_ctx_data ; struct callback_head callback_head ; struct delayed_work orphans_remove ; bool orphans_remove_sched ; }; struct perf_cpu_context { struct perf_event_context ctx ; struct perf_event_context *task_ctx ; int active_oncpu ; int exclusive ; raw_spinlock_t hrtimer_lock ; struct hrtimer hrtimer ; ktime_t hrtimer_interval ; unsigned int hrtimer_active ; struct pmu *unique_pmu ; struct perf_cgroup *cgrp ; }; struct perf_cgroup_info { u64 time ; u64 timestamp ; }; struct perf_cgroup { struct cgroup_subsys_state css ; struct perf_cgroup_info *info ; }; struct __anonstruct_tid_entry_353 { u32 pid ; u32 tid ; }; struct __anonstruct_cpu_entry_354 { u32 cpu ; u32 reserved ; }; struct perf_sample_data { u64 addr ; struct perf_raw_record *raw ; struct perf_branch_stack *br_stack ; u64 period ; u64 weight ; u64 txn ; union perf_mem_data_src data_src ; u64 type ; u64 ip ; struct __anonstruct_tid_entry_353 tid_entry ; u64 time ; u64 id ; u64 stream_id ; struct __anonstruct_cpu_entry_354 cpu_entry ; struct perf_callchain_entry *callchain ; struct perf_regs regs_user ; struct pt_regs regs_user_copy ; struct perf_regs regs_intr ; u64 stack_user_size ; }; struct trace_array; struct trace_buffer; struct tracer; struct bpf_prog; struct trace_print_flags { unsigned long mask ; char const *name ; }; struct trace_iterator; struct trace_event; struct trace_entry { unsigned short type ; unsigned char flags ; unsigned char preempt_count ; int pid ; }; struct trace_iterator { struct trace_array *tr ; struct tracer *trace ; struct trace_buffer *trace_buffer ; void *private ; int cpu_file ; struct mutex mutex ; struct ring_buffer_iter **buffer_iter ; unsigned long iter_flags ; struct trace_seq tmp_seq ; cpumask_var_t started ; bool snapshot ; struct trace_seq seq ; struct trace_entry *ent ; unsigned long lost_events ; int leftover ; int ent_size ; int cpu ; u64 ts ; loff_t pos ; long idx ; }; enum print_line_t; struct trace_event_functions { enum print_line_t (*trace)(struct trace_iterator * , int , struct trace_event * ) ; enum print_line_t (*raw)(struct trace_iterator * , int , struct trace_event * ) ; enum print_line_t (*hex)(struct trace_iterator * , int , struct trace_event * ) ; enum print_line_t (*binary)(struct trace_iterator * , int , struct trace_event * ) ; }; struct trace_event { struct hlist_node node ; struct list_head list ; int type ; struct trace_event_functions *funcs ; }; enum print_line_t { TRACE_TYPE_PARTIAL_LINE = 0, TRACE_TYPE_HANDLED = 1, TRACE_TYPE_UNHANDLED = 2, TRACE_TYPE_NO_CONSUME = 3 } ; enum trace_reg { TRACE_REG_REGISTER = 0, TRACE_REG_UNREGISTER = 1, TRACE_REG_PERF_REGISTER = 2, TRACE_REG_PERF_UNREGISTER = 3, TRACE_REG_PERF_OPEN = 4, TRACE_REG_PERF_CLOSE = 5, TRACE_REG_PERF_ADD = 6, TRACE_REG_PERF_DEL = 7 } ; struct trace_event_class { char const *system ; void *probe ; void *perf_probe ; int (*reg)(struct trace_event_call * , enum trace_reg , void * ) ; int (*define_fields)(struct trace_event_call * ) ; struct list_head *(*get_fields)(struct trace_event_call * ) ; struct list_head fields ; int (*raw_init)(struct trace_event_call * ) ; }; union __anonunion____missing_field_name_355 { char *name ; struct tracepoint *tp ; }; struct trace_event_call { struct list_head list ; struct trace_event_class *class ; union __anonunion____missing_field_name_355 __annonCompField102 ; struct trace_event event ; char *print_fmt ; struct event_filter *filter ; void *mod ; void *data ; int flags ; int perf_refcount ; struct hlist_head *perf_events ; struct bpf_prog *prog ; int (*perf_perm)(struct trace_event_call * , struct perf_event * ) ; }; struct trace_event_raw_ata_qc_issue { struct trace_entry ent ; unsigned int ata_port ; unsigned int ata_dev ; unsigned int tag ; unsigned char cmd ; unsigned char dev ; unsigned char lbal ; unsigned char lbam ; unsigned char lbah ; unsigned char nsect ; unsigned char feature ; unsigned char hob_lbal ; unsigned char hob_lbam ; unsigned char hob_lbah ; unsigned char hob_nsect ; unsigned char hob_feature ; unsigned char ctl ; unsigned char proto ; unsigned long flags ; char __data[0U] ; }; struct trace_event_raw_ata_qc_complete_template { struct trace_entry ent ; unsigned int ata_port ; unsigned int ata_dev ; unsigned int tag ; unsigned char status ; unsigned char dev ; unsigned char lbal ; unsigned char lbam ; unsigned char lbah ; unsigned char nsect ; unsigned char error ; unsigned char hob_lbal ; unsigned char hob_lbam ; unsigned char hob_lbah ; unsigned char hob_nsect ; unsigned char hob_feature ; unsigned char ctl ; unsigned long flags ; char __data[0U] ; }; struct trace_event_raw_ata_eh_link_autopsy { struct trace_entry ent ; unsigned int ata_port ; unsigned int ata_dev ; unsigned int eh_action ; unsigned int eh_err_mask ; char __data[0U] ; }; struct trace_event_raw_ata_eh_link_autopsy_qc { struct trace_entry ent ; unsigned int ata_port ; unsigned int ata_dev ; unsigned int tag ; unsigned int qc_flags ; unsigned int eh_err_mask ; char __data[0U] ; }; struct ata_force_param { char const *name ; unsigned int cbl ; int spd_limit ; unsigned long xfer_mask ; unsigned int horkage_on ; unsigned int horkage_off ; unsigned int lflags ; }; struct ata_force_ent { int port ; int device ; struct ata_force_param param ; }; struct ata_xfer_ent { int shift ; int bits ; u8 base ; }; struct ata_blacklist_entry { char const *model_num ; char const *model_rev ; unsigned long horkage ; }; typedef bool ldv_func_ret_type; typedef bool ldv_func_ret_type___0; typedef bool ldv_func_ret_type___1; typedef bool ldv_func_ret_type___2; typedef bool ldv_func_ret_type___3; typedef __u16 __be16; typedef __u32 __be32; typedef __u64 __le64; typedef __u64 __be64; typedef unsigned int uint; enum system_states { SYSTEM_BOOTING = 0, SYSTEM_RUNNING = 1, SYSTEM_HALT = 2, SYSTEM_POWER_OFF = 3, SYSTEM_RESTART = 4 } ; enum hrtimer_restart; struct klist { spinlock_t k_lock ; struct list_head k_list ; void (*get)(struct klist_node * ) ; void (*put)(struct klist_node * ) ; }; enum scsi_device_event { SDEV_EVT_MEDIA_CHANGE = 1, SDEV_EVT_INQUIRY_CHANGE_REPORTED = 2, SDEV_EVT_CAPACITY_CHANGE_REPORTED = 3, SDEV_EVT_SOFT_THRESHOLD_REACHED_REPORTED = 4, SDEV_EVT_MODE_PARAMETER_CHANGE_REPORTED = 5, SDEV_EVT_LUN_CHANGE_REPORTED = 6, SDEV_EVT_FIRST = 1, SDEV_EVT_LAST = 6, SDEV_EVT_MAXBITS = 7 } ; struct attribute_container { struct list_head node ; struct klist containers ; struct class *class ; struct attribute_group const *grp ; struct device_attribute **attrs ; int (*match)(struct attribute_container * , struct device * ) ; unsigned long flags ; }; struct transport_container; struct transport_container { struct attribute_container ac ; struct attribute_group const *statistics ; }; struct scsi_transport_template { struct transport_container host_attrs ; struct transport_container target_attrs ; struct transport_container device_attrs ; int (*user_scan)(struct Scsi_Host * , uint , uint , u64 ) ; int device_size ; int device_private_offset ; int target_size ; int target_private_offset ; int host_size ; unsigned char create_work_queue : 1 ; void (*eh_strategy_handler)(struct Scsi_Host * ) ; enum blk_eh_timer_return (*eh_timed_out)(struct scsi_cmnd * ) ; int (*it_nexus_response)(struct Scsi_Host * , u64 , int ) ; int (*tsk_mgmt_response)(struct Scsi_Host * , u64 , u64 , int ) ; }; struct hd_geometry { unsigned char heads ; unsigned char sectors ; unsigned short cylinders ; unsigned long start ; }; struct ata_scsi_args { struct ata_device *dev ; u16 *id ; struct scsi_cmnd *cmd ; void (*done)(struct scsi_cmnd * ) ; }; typedef unsigned int (*ata_xlat_func_t)(struct ata_queued_cmd * ); struct __wait_queue; typedef struct __wait_queue wait_queue_t; struct __wait_queue { unsigned int flags ; void *private ; int (*func)(wait_queue_t * , unsigned int , int , void * ) ; struct list_head task_list ; }; enum hrtimer_restart; union __anonunion___u_302___0 { struct tracepoint_func *__val ; char __c[1U] ; }; union __anonunion___u_304___0 { struct tracepoint_func *__val ; char __c[1U] ; }; union __anonunion___u_306___0 { struct tracepoint_func *__val ; char __c[1U] ; }; union __anonunion___u_308___0 { struct tracepoint_func *__val ; char __c[1U] ; }; struct ata_eh_cmd_timeout_ent { u8 const *commands ; unsigned long const *timeouts ; }; struct speed_down_verdict_arg { u64 since ; int xfer_ok ; int nr_errors[8U] ; }; struct __anonstruct_cmd_descr_310 { u8 command ; char const *text ; }; enum hrtimer_restart; struct transport_class { struct class class ; int (*setup)(struct transport_container * , struct device * , struct device * ) ; int (*configure)(struct transport_container * , struct device * , struct device * ) ; int (*remove)(struct transport_container * , struct device * , struct device * ) ; }; struct ata_internal { struct scsi_transport_template t ; struct device_attribute private_port_attrs[3U] ; struct device_attribute private_link_attrs[3U] ; struct device_attribute private_dev_attrs[9U] ; struct transport_container link_attr_cont ; struct transport_container dev_attr_cont ; struct device_attribute *link_attrs[4U] ; struct device_attribute *port_attrs[4U] ; struct device_attribute *dev_attrs[10U] ; }; struct __anonstruct_ata_class_names_285 { u32 value ; char *name ; }; struct __anonstruct_ata_err_names_287 { u32 value ; char *name ; }; struct __anonstruct_ata_xfer_names_289 { u32 value ; char *name ; }; struct ata_show_ering_arg { char *buf ; int written ; }; enum hrtimer_restart; enum hrtimer_restart; enum hrtimer_restart; enum kobject_action { KOBJ_ADD = 0, KOBJ_REMOVE = 1, KOBJ_CHANGE = 2, KOBJ_MOVE = 3, KOBJ_ONLINE = 4, KOBJ_OFFLINE = 5, KOBJ_MAX = 6 } ; typedef u64 acpi_size; typedef u32 acpi_status; typedef char *acpi_string; struct acpi_object_list { u32 count ; union acpi_object *pointer ; }; struct acpi_buffer { acpi_size length ; void *pointer ; }; struct acpi_driver; struct acpi_device; struct acpi_hotplug_profile { struct kobject kobj ; int (*scan_dependent)(struct acpi_device * ) ; void (*notify_online)(struct acpi_device * ) ; bool enabled ; bool demand_offline ; }; struct acpi_scan_handler { struct acpi_device_id const *ids ; struct list_head list_node ; bool (*match)(char * , struct acpi_device_id const ** ) ; int (*attach)(struct acpi_device * , struct acpi_device_id const * ) ; void (*detach)(struct acpi_device * ) ; void (*bind)(struct device * ) ; void (*unbind)(struct device * ) ; struct acpi_hotplug_profile hotplug ; }; struct acpi_hotplug_context { struct acpi_device *self ; int (*notify)(struct acpi_device * , u32 ) ; void (*uevent)(struct acpi_device * , u32 ) ; void (*fixup)(struct acpi_device * ) ; }; struct acpi_device_ops { int (*add)(struct acpi_device * ) ; int (*remove)(struct acpi_device * ) ; void (*notify)(struct acpi_device * , u32 ) ; }; struct acpi_driver { char name[80U] ; char class[80U] ; struct acpi_device_id const *ids ; unsigned int flags ; struct acpi_device_ops ops ; struct device_driver drv ; struct module *owner ; }; struct acpi_device_status { unsigned char present : 1 ; unsigned char enabled : 1 ; unsigned char show_in_ui : 1 ; unsigned char functional : 1 ; unsigned char battery_present : 1 ; unsigned int reserved : 27 ; }; struct acpi_device_flags { unsigned char dynamic_status : 1 ; unsigned char removable : 1 ; unsigned char ejectable : 1 ; unsigned char power_manageable : 1 ; unsigned char match_driver : 1 ; unsigned char initialized : 1 ; unsigned char visited : 1 ; unsigned char hotplug_notify : 1 ; unsigned char is_dock_station : 1 ; unsigned char of_compatible_ok : 1 ; unsigned char coherent_dma : 1 ; unsigned char cca_seen : 1 ; unsigned int reserved : 20 ; }; struct acpi_device_dir { struct proc_dir_entry *entry ; }; typedef char acpi_bus_id[8U]; typedef unsigned long acpi_bus_address; typedef char acpi_device_name[40U]; typedef char acpi_device_class[20U]; struct acpi_pnp_type { unsigned char hardware_id : 1 ; unsigned char bus_address : 1 ; unsigned char platform_id : 1 ; unsigned int reserved : 29 ; }; struct acpi_device_pnp { acpi_bus_id bus_id ; struct acpi_pnp_type type ; acpi_bus_address bus_address ; char *unique_id ; struct list_head ids ; acpi_device_name device_name ; acpi_device_class device_class ; union acpi_object *str_obj ; }; struct acpi_device_power_flags { unsigned char explicit_get : 1 ; unsigned char power_resources : 1 ; unsigned char inrush_current : 1 ; unsigned char power_removed : 1 ; unsigned char ignore_parent : 1 ; unsigned char dsw_present : 1 ; unsigned int reserved : 26 ; }; struct __anonstruct_flags_252 { unsigned char valid : 1 ; unsigned char explicit_set : 1 ; unsigned char reserved : 6 ; }; struct acpi_device_power_state { struct __anonstruct_flags_252 flags ; int power ; int latency ; struct list_head resources ; }; struct acpi_device_power { int state ; struct acpi_device_power_flags flags ; struct acpi_device_power_state states[5U] ; }; struct acpi_device_perf_flags { u8 reserved ; }; struct __anonstruct_flags_253 { unsigned char valid : 1 ; unsigned char reserved : 7 ; }; struct acpi_device_perf_state { struct __anonstruct_flags_253 flags ; u8 power ; u8 performance ; int latency ; }; struct acpi_device_perf { int state ; struct acpi_device_perf_flags flags ; int state_count ; struct acpi_device_perf_state *states ; }; struct acpi_device_wakeup_flags { unsigned char valid : 1 ; unsigned char run_wake : 1 ; unsigned char notifier_present : 1 ; unsigned char enabled : 1 ; }; struct acpi_device_wakeup_context { struct work_struct work ; struct device *dev ; }; struct acpi_device_wakeup { acpi_handle gpe_device ; u64 gpe_number ; u64 sleep_state ; struct list_head resources ; struct acpi_device_wakeup_flags flags ; struct acpi_device_wakeup_context context ; struct wakeup_source *ws ; int prepare_count ; }; struct acpi_device_data { union acpi_object const *pointer ; union acpi_object const *properties ; union acpi_object const *of_compatible ; }; struct acpi_gpio_mapping; struct acpi_device { int device_type ; acpi_handle handle ; struct fwnode_handle fwnode ; struct acpi_device *parent ; struct list_head children ; struct list_head node ; struct list_head wakeup_list ; struct list_head del_list ; struct acpi_device_status status ; struct acpi_device_flags flags ; struct acpi_device_pnp pnp ; struct acpi_device_power power ; struct acpi_device_wakeup wakeup ; struct acpi_device_perf performance ; struct acpi_device_dir dir ; struct acpi_device_data data ; struct acpi_scan_handler *handler ; struct acpi_hotplug_context *hp ; struct acpi_driver *driver ; struct acpi_gpio_mapping const *driver_gpios ; void *driver_data ; struct device dev ; unsigned int physical_node_count ; unsigned int dep_unmet ; struct list_head physical_node_list ; struct mutex physical_node_lock ; void (*remove)(struct acpi_device * ) ; }; struct acpi_gpio_params { unsigned int crs_entry_index ; unsigned int line_index ; bool active_low ; }; struct acpi_gpio_mapping { char const *name ; struct acpi_gpio_params const *data ; unsigned int size ; }; struct ata_acpi_gtf { u8 tf[7U] ; }; union __anonunion_data_285 { struct ata_port *ap ; struct ata_device *dev ; }; struct ata_acpi_hotplug_context { struct acpi_hotplug_context hp ; union __anonunion_data_285 data ; }; struct notifier_block; enum hrtimer_restart; struct notifier_block { int (*notifier_call)(struct notifier_block * , unsigned long , void * ) ; struct notifier_block *next ; int priority ; }; struct blocking_notifier_head { struct rw_semaphore rwsem ; struct notifier_block *head ; }; struct plist_head { struct list_head node_list ; }; struct rm_feature_desc { __be16 feature_code ; unsigned char curr : 1 ; unsigned char persistent : 1 ; unsigned char feature_version : 4 ; unsigned char reserved1 : 2 ; __u8 add_len ; unsigned char lock : 1 ; unsigned char dbml : 1 ; unsigned char pvnt_jmpr : 1 ; unsigned char eject : 1 ; unsigned char load : 1 ; unsigned char mech_type : 3 ; __u8 reserved2 ; __u8 reserved3 ; __u8 reserved4 ; }; struct pm_qos_flags_request { struct list_head node ; s32 flags ; }; enum dev_pm_qos_req_type { DEV_PM_QOS_RESUME_LATENCY = 1, DEV_PM_QOS_LATENCY_TOLERANCE = 2, DEV_PM_QOS_FLAGS = 3 } ; union __anonunion_data_284 { struct plist_node pnode ; struct pm_qos_flags_request flr ; }; struct dev_pm_qos_request { enum dev_pm_qos_req_type type ; union __anonunion_data_284 data ; struct device *dev ; }; enum pm_qos_type { PM_QOS_UNITIALIZED = 0, PM_QOS_MAX = 1, PM_QOS_MIN = 2, PM_QOS_SUM = 3 } ; struct pm_qos_constraints { struct plist_head list ; s32 target_value ; s32 default_value ; s32 no_constraint_value ; enum pm_qos_type type ; struct blocking_notifier_head *notifiers ; }; struct pm_qos_flags { struct list_head list ; s32 effective_flags ; }; struct dev_pm_qos { struct pm_qos_constraints resume_latency ; struct pm_qos_constraints latency_tolerance ; struct pm_qos_flags flags ; struct dev_pm_qos_request *resume_latency_req ; struct dev_pm_qos_request *latency_tolerance_req ; struct dev_pm_qos_request *flags_req ; }; enum odd_mech_type { ODD_MECH_TYPE_SLOT = 0, ODD_MECH_TYPE_DRAWER = 1, ODD_MECH_TYPE_UNSUPPORTED = 2 } ; struct zpodd { enum odd_mech_type mech_type ; struct ata_device *dev ; bool from_notify ; bool zp_ready ; unsigned long last_ready ; bool zp_sampled ; bool powered_off ; }; void ldv__builtin_va_end(__builtin_va_list * ) ; __inline static long ldv__builtin_expect(long exp , long c ) ; void ldv__builtin_va_start(__builtin_va_list * ) ; __inline static void __read_once_size(void const volatile *p , void *res , int size ) { { switch (size) { case 1: *((__u8 *)res) = *((__u8 volatile *)p); goto ldv_880; case 2: *((__u16 *)res) = *((__u16 volatile *)p); goto ldv_880; case 4: *((__u32 *)res) = *((__u32 volatile *)p); goto ldv_880; case 8: *((__u64 *)res) = *((__u64 volatile *)p); goto ldv_880; default: __asm__ volatile ("": : : "memory"); __builtin_memcpy(res, (void const *)p, (unsigned long )size); __asm__ volatile ("": : : "memory"); } ldv_880: ; return; } } extern struct pv_irq_ops pv_irq_ops ; __inline static unsigned long __ffs(unsigned long word ) { { __asm__ ("rep; bsf %1,%0": "=r" (word): "rm" (word)); return (word); } } __inline static int ffs(int x ) { int r ; { __asm__ ("bsfl %1,%0": "=r" (r): "rm" (x), "0" (-1)); return (r + 1); } } __inline static int fls(int x ) { int r ; { __asm__ ("bsrl %1,%0": "=r" (r): "rm" (x), "0" (-1)); return (r + 1); } } __inline static bool is_power_of_2(unsigned long n ) { { return ((bool )(n != 0UL && ((n - 1UL) & n) == 0UL)); } } extern int printk(char const * , ...) ; extern void print_hex_dump(char const * , char const * , int , int , int , void const * , size_t , bool ) ; extern unsigned long simple_strtoul(char const * , char ** , unsigned int ) ; extern int snprintf(char * , size_t , char const * , ...) ; bool ldv_is_err(void const *ptr ) ; __inline static void INIT_LIST_HEAD(struct list_head *list ) { { list->next = list; list->prev = list; return; } } extern void __bad_percpu_size(void) ; extern void warn_slowpath_fmt(char const * , int const , char const * , ...) ; extern void warn_slowpath_null(char const * , int const ) ; extern struct task_struct *current_task ; __inline static struct task_struct *get_current(void) { struct task_struct *pfo_ret__ ; { switch (8UL) { case 1UL: __asm__ ("movb %%gs:%P1,%0": "=q" (pfo_ret__): "p" (& current_task)); goto ldv_3129; case 2UL: __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& current_task)); goto ldv_3129; case 4UL: __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& current_task)); goto ldv_3129; case 8UL: __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& current_task)); goto ldv_3129; default: __bad_percpu_size(); } ldv_3129: ; return (pfo_ret__); } } extern void *memcpy(void * , void const * , size_t ) ; extern void *memset(void * , int , size_t ) ; extern size_t strlen(char const * ) ; extern int strcmp(char const * , char const * ) ; extern int strcasecmp(char const * , char const * ) ; extern int strncasecmp(char const * , char const * , size_t ) ; extern char *strchr(char const * , int ) ; extern char *strim(char * ) ; __inline static char *strstrip(char *str ) { char *tmp ; { tmp = strim(str); return (tmp); } } extern __kernel_size_t strnlen(char const * , __kernel_size_t ) ; __inline static unsigned long arch_local_save_flags(void) { unsigned long __ret ; unsigned long __edi ; unsigned long __esi ; unsigned long __edx ; unsigned long __ecx ; unsigned long __eax ; long tmp ; { __edi = __edi; __esi = __esi; __edx = __edx; __ecx = __ecx; __eax = __eax; tmp = ldv__builtin_expect((unsigned long )pv_irq_ops.save_fl.func == (unsigned long )((void *)0), 0L); if (tmp != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"./arch/x86/include/asm/paravirt.h"), "i" (831), "i" (12UL)); ldv_4860: ; goto ldv_4860; } else { } __asm__ volatile ("771:\n\tcall *%c2;\n772:\n.pushsection .parainstructions,\"a\"\n .balign 8 \n .quad 771b\n .byte %c1\n .byte 772b-771b\n .short %c3\n.popsection\n": "=a" (__eax): [paravirt_typenum] "i" (43UL), [paravirt_opptr] "i" (& pv_irq_ops.save_fl.func), [paravirt_clobber] "i" (1): "memory", "cc"); __ret = __eax; return (__ret); } } __inline static bool IS_ERR(void const *ptr ) ; __inline static int arch_irqs_disabled_flags(unsigned long flags ) { { return ((flags & 512UL) == 0UL); } } extern void __xadd_wrong_size(void) ; __inline static int atomic_read(atomic_t const *v ) { int __var ; { __var = 0; return ((int )*((int const volatile *)(& v->counter))); } } __inline static int atomic_add_return(int i , atomic_t *v ) { int __ret ; { __ret = i; switch (4UL) { case 1UL: __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; xaddb %b0, %1\n": "+q" (__ret), "+m" (v->counter): : "memory", "cc"); goto ldv_5659; case 2UL: __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; xaddw %w0, %1\n": "+r" (__ret), "+m" (v->counter): : "memory", "cc"); goto ldv_5659; case 4UL: __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; xaddl %0, %1\n": "+r" (__ret), "+m" (v->counter): : "memory", "cc"); goto ldv_5659; case 8UL: __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; xaddq %q0, %1\n": "+r" (__ret), "+m" (v->counter): : "memory", "cc"); goto ldv_5659; default: __xadd_wrong_size(); } ldv_5659: ; return (__ret + i); } } extern int __preempt_count ; __inline static int preempt_count(void) { int pfo_ret__ ; { switch (4UL) { case 1UL: __asm__ ("movb %%gs:%1,%0": "=q" (pfo_ret__): "m" (__preempt_count)); goto ldv_6002; case 2UL: __asm__ ("movw %%gs:%1,%0": "=r" (pfo_ret__): "m" (__preempt_count)); goto ldv_6002; case 4UL: __asm__ ("movl %%gs:%1,%0": "=r" (pfo_ret__): "m" (__preempt_count)); goto ldv_6002; case 8UL: __asm__ ("movq %%gs:%1,%0": "=r" (pfo_ret__): "m" (__preempt_count)); goto ldv_6002; default: __bad_percpu_size(); } ldv_6002: ; return (pfo_ret__ & 2147483647); } } __inline static void __preempt_count_add(int val ) { int pao_ID__ ; { pao_ID__ = 0; switch (4UL) { case 1UL: ; if (pao_ID__ == 1) { __asm__ ("incb %%gs:%0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decb %%gs:%0": "+m" (__preempt_count)); } else { __asm__ ("addb %1, %%gs:%0": "+m" (__preempt_count): "qi" (val)); } goto ldv_6059; case 2UL: ; if (pao_ID__ == 1) { __asm__ ("incw %%gs:%0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decw %%gs:%0": "+m" (__preempt_count)); } else { __asm__ ("addw %1, %%gs:%0": "+m" (__preempt_count): "ri" (val)); } goto ldv_6059; case 4UL: ; if (pao_ID__ == 1) { __asm__ ("incl %%gs:%0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decl %%gs:%0": "+m" (__preempt_count)); } else { __asm__ ("addl %1, %%gs:%0": "+m" (__preempt_count): "ri" (val)); } goto ldv_6059; case 8UL: ; if (pao_ID__ == 1) { __asm__ ("incq %%gs:%0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decq %%gs:%0": "+m" (__preempt_count)); } else { __asm__ ("addq %1, %%gs:%0": "+m" (__preempt_count): "re" (val)); } goto ldv_6059; default: __bad_percpu_size(); } ldv_6059: ; return; } } __inline static void __preempt_count_sub(int val ) { int pao_ID__ ; { pao_ID__ = 0; switch (4UL) { case 1UL: ; if (pao_ID__ == 1) { __asm__ ("incb %%gs:%0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decb %%gs:%0": "+m" (__preempt_count)); } else { __asm__ ("addb %1, %%gs:%0": "+m" (__preempt_count): "qi" (- val)); } goto ldv_6071; case 2UL: ; if (pao_ID__ == 1) { __asm__ ("incw %%gs:%0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decw %%gs:%0": "+m" (__preempt_count)); } else { __asm__ ("addw %1, %%gs:%0": "+m" (__preempt_count): "ri" (- val)); } goto ldv_6071; case 4UL: ; if (pao_ID__ == 1) { __asm__ ("incl %%gs:%0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decl %%gs:%0": "+m" (__preempt_count)); } else { __asm__ ("addl %1, %%gs:%0": "+m" (__preempt_count): "ri" (- val)); } goto ldv_6071; case 8UL: ; if (pao_ID__ == 1) { __asm__ ("incq %%gs:%0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decq %%gs:%0": "+m" (__preempt_count)); } else { __asm__ ("addq %1, %%gs:%0": "+m" (__preempt_count): "re" (- val)); } goto ldv_6071; default: __bad_percpu_size(); } ldv_6071: ; return; } } extern int debug_locks ; extern void lockdep_init_map(struct lockdep_map * , char const * , struct lock_class_key * , int ) ; extern int lock_is_held(struct lockdep_map * ) ; extern void lockdep_rcu_suspicious(char const * , int const , char const * ) ; __inline static int static_key_count(struct static_key *key ) { int tmp ; { tmp = atomic_read((atomic_t const *)(& key->enabled)); return (tmp); } } __inline static bool static_key_false(struct static_key *key ) { int tmp ; long tmp___0 ; { tmp = static_key_count(key); tmp___0 = ldv__builtin_expect(tmp > 0, 0L); if (tmp___0 != 0L) { return (1); } else { } return (0); } } extern void __raw_spin_lock_init(raw_spinlock_t * , char const * , struct lock_class_key * ) ; extern void _raw_spin_lock(raw_spinlock_t * ) ; extern unsigned long _raw_spin_lock_irqsave(raw_spinlock_t * ) ; extern void _raw_spin_unlock(raw_spinlock_t * ) ; extern void _raw_spin_unlock_irqrestore(raw_spinlock_t * , unsigned long ) ; __inline static raw_spinlock_t *spinlock_check(spinlock_t *lock ) { { return (& lock->__annonCompField18.rlock); } } __inline static void spin_lock(spinlock_t *lock ) { { _raw_spin_lock(& lock->__annonCompField18.rlock); return; } } __inline static void spin_unlock(spinlock_t *lock ) { { _raw_spin_unlock(& lock->__annonCompField18.rlock); return; } } __inline static void spin_unlock_irqrestore(spinlock_t *lock , unsigned long flags ) { { _raw_spin_unlock_irqrestore(& lock->__annonCompField18.rlock, flags); return; } } extern void __init_waitqueue_head(wait_queue_head_t * , char const * , struct lock_class_key * ) ; extern void __mutex_init(struct mutex * , char const * , struct lock_class_key * ) ; __inline static void init_completion(struct completion *x ) { struct lock_class_key __key ; { x->done = 0U; __init_waitqueue_head(& x->wait, "&x->wait", & __key); return; } } extern unsigned long wait_for_completion_timeout(struct completion * , unsigned long ) ; extern void complete(struct completion * ) ; extern unsigned long volatile jiffies ; extern unsigned long __msecs_to_jiffies(unsigned int const ) ; __inline static unsigned long msecs_to_jiffies(unsigned int const m ) { unsigned long tmp___0 ; { tmp___0 = __msecs_to_jiffies(m); return (tmp___0); } } extern bool rcu_is_watching(void) ; extern bool rcu_lockdep_current_cpu_online(void) ; extern struct lockdep_map rcu_sched_lock_map ; extern int debug_lockdep_rcu_enabled(void) ; __inline static int rcu_read_lock_sched_held(void) { int lockdep_opinion ; int tmp ; bool tmp___0 ; int tmp___1 ; bool tmp___2 ; int tmp___3 ; int tmp___4 ; unsigned long _flags ; int tmp___5 ; int tmp___6 ; { lockdep_opinion = 0; tmp = debug_lockdep_rcu_enabled(); if (tmp == 0) { return (1); } else { } tmp___0 = rcu_is_watching(); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { return (0); } else { } tmp___2 = rcu_lockdep_current_cpu_online(); if (tmp___2) { tmp___3 = 0; } else { tmp___3 = 1; } if (tmp___3) { return (0); } else { } if (debug_locks != 0) { lockdep_opinion = lock_is_held(& rcu_sched_lock_map); } else { } if (lockdep_opinion != 0) { tmp___6 = 1; } else { tmp___4 = preempt_count(); if (tmp___4 != 0) { tmp___6 = 1; } else { _flags = arch_local_save_flags(); tmp___5 = arch_irqs_disabled_flags(_flags); if (tmp___5 != 0) { tmp___6 = 1; } else { tmp___6 = 0; } } } return (tmp___6); } } __inline static void rcu_read_lock_sched_notrace(void) { { __preempt_count_add(1); __asm__ volatile ("": : : "memory"); return; } } __inline static void rcu_read_unlock_sched_notrace(void) { { __asm__ volatile ("": : : "memory"); __preempt_count_sub(1); return; } } extern void init_timer_key(struct timer_list * , unsigned int , char const * , struct lock_class_key * ) ; extern void delayed_work_timer_fn(unsigned long ) ; extern void __init_work(struct work_struct * , int ) ; extern bool queue_work_on(int , struct workqueue_struct * , struct work_struct * ) ; bool ldv_queue_work_on_5(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_7(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; extern bool queue_delayed_work_on(int , struct workqueue_struct * , struct delayed_work * , unsigned long ) ; bool ldv_queue_delayed_work_on_6(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; bool ldv_queue_delayed_work_on_9(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; extern void flush_workqueue(struct workqueue_struct * ) ; void ldv_flush_workqueue_8(struct workqueue_struct *ldv_func_arg1 ) ; extern bool cancel_delayed_work_sync(struct delayed_work * ) ; bool ldv_cancel_delayed_work_sync_10(struct delayed_work *ldv_func_arg1 ) ; extern unsigned int ioread32(void * ) ; __inline static char const *kobject_name(struct kobject const *kobj ) { { return ((char const *)kobj->name); } } extern void kfree(void const * ) ; extern void *__kmalloc(size_t , gfp_t ) ; __inline static void *kmalloc(size_t size , gfp_t flags ) { void *tmp___2 ; { tmp___2 = __kmalloc(size, flags); return (tmp___2); } } __inline static void *kzalloc(size_t size , gfp_t flags ) { void *tmp ; { tmp = kmalloc(size, flags | 32768U); return (tmp); } } extern void *malloc(size_t ) ; extern void *calloc(size_t , size_t ) ; extern int __VERIFIER_nondet_int(void) ; extern unsigned long __VERIFIER_nondet_ulong(void) ; extern void *__VERIFIER_nondet_pointer(void) ; extern void __VERIFIER_assume(int ) ; void *ldv_malloc(size_t size ) { void *p ; void *tmp ; int tmp___0 ; { tmp___0 = __VERIFIER_nondet_int(); if (tmp___0 != 0) { return ((void *)0); } else { tmp = malloc(size); p = tmp; __VERIFIER_assume((unsigned long )p != (unsigned long )((void *)0)); return (p); } } } void *ldv_zalloc(size_t size ) { void *p ; void *tmp ; int tmp___0 ; { tmp___0 = __VERIFIER_nondet_int(); if (tmp___0 != 0) { return ((void *)0); } else { tmp = calloc(1UL, size); p = tmp; __VERIFIER_assume((unsigned long )p != (unsigned long )((void *)0)); return (p); } } } void *ldv_init_zalloc(size_t size ) { void *p ; void *tmp ; { tmp = calloc(1UL, size); p = tmp; __VERIFIER_assume((unsigned long )p != (unsigned long )((void *)0)); return (p); } } void *ldv_memset(void *s , int c , size_t n ) { void *tmp ; { tmp = memset(s, c, n); return (tmp); } } int ldv_undef_int(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); return (tmp); } } void *ldv_undef_ptr(void) { void *tmp ; { tmp = __VERIFIER_nondet_pointer(); return (tmp); } } unsigned long ldv_undef_ulong(void) { unsigned long tmp ; { tmp = __VERIFIER_nondet_ulong(); return (tmp); } } __inline static void ldv_stop(void) { { LDV_STOP: ; goto LDV_STOP; } } __inline static long ldv__builtin_expect(long exp , long c ) { { return (exp); } } int ldv_state_variable_47 ; int ldv_state_variable_20 ; struct work_struct *ldv_work_struct_3_1 ; struct trace_event_call *event_class_ata_eh_link_autopsy_qc_group0 ; int ldv_state_variable_30 ; int ldv_state_variable_0 ; int ldv_state_variable_45 ; int ldv_work_1_1 ; int ldv_state_variable_12 ; int ldv_state_variable_22 ; int ldv_state_variable_14 ; int ldv_state_variable_37 ; int ldv_state_variable_29 ; int ldv_state_variable_17 ; int ldv_state_variable_51 ; struct work_struct *ldv_work_struct_2_0 ; int ldv_state_variable_19 ; int ldv_state_variable_27 ; int ldv_state_variable_9 ; struct work_struct *ldv_work_struct_2_2 ; int ref_cnt ; int ldv_state_variable_42 ; int ldv_work_3_3 ; int ldv_state_variable_7 ; int ldv_state_variable_23 ; struct work_struct *ldv_work_struct_3_3 ; struct device_attribute *dev_attr_sw_activity_group0 ; struct device_attribute *dev_attr_em_message_group0 ; struct work_struct *ldv_work_struct_1_1 ; int ldv_work_1_3 ; struct work_struct *ldv_work_struct_2_1 ; struct work_struct *ldv_work_struct_3_2 ; int ldv_state_variable_6 ; int ldv_state_variable_50 ; struct ata_queued_cmd *ata_sff_port_ops_group1 ; int ldv_state_variable_26 ; struct ata_link *ata_base_port_ops_group0 ; int ldv_state_variable_28 ; struct trace_event_call *event_class_ata_eh_link_autopsy_group0 ; struct ata_queued_cmd *ata_bmdma_port_ops_group1 ; int ldv_state_variable_44 ; int LDV_IN_INTERRUPT = 1; int ldv_state_variable_38 ; struct ata_taskfile const *ata_sff_port_ops_group3 ; struct ata_link *sata_pmp_port_ops_group0 ; int ldv_state_variable_39 ; struct device *dev_attr_em_message_group1 ; struct device *dev_attr_link_power_management_policy_group1 ; int ldv_state_variable_3 ; struct ata_port *ata_bmdma_port_ops_group0 ; int ldv_state_variable_31 ; int ldv_work_1_0 ; struct device *dev_attr_unload_heads_group1 ; int ldv_state_variable_4 ; int ldv_work_2_1 ; int ldv_state_variable_36 ; int ldv_state_variable_8 ; int ldv_state_variable_46 ; int ldv_state_variable_15 ; struct work_struct *ldv_work_struct_1_3 ; int ldv_state_variable_48 ; int ldv_state_variable_5 ; int ldv_state_variable_21 ; int ldv_state_variable_33 ; int ldv_state_variable_13 ; struct ata_queued_cmd *ata_dummy_port_ops_group0 ; int ldv_work_3_2 ; int ldv_work_3_0 ; struct work_struct *ldv_work_struct_2_3 ; struct ata_port *ata_base_port_ops_group1 ; int ldv_state_variable_49 ; int ldv_state_variable_24 ; struct ata_port *ata_sff_port_ops_group2 ; int ldv_state_variable_1 ; int ldv_state_variable_41 ; int ldv_state_variable_40 ; struct work_struct *ldv_work_struct_1_0 ; int ldv_state_variable_10 ; int ldv_state_variable_16 ; int ldv_work_3_1 ; struct device_attribute *dev_attr_unload_heads_group0 ; struct device_attribute *dev_attr_link_power_management_policy_group0 ; int ldv_state_variable_2 ; int ldv_state_variable_43 ; int ldv_state_variable_25 ; int ldv_work_2_0 ; struct device *ata_port_pm_ops_group1 ; struct trace_event_call *event_class_ata_qc_issue_group0 ; struct work_struct *ldv_work_struct_3_0 ; struct ata_port *ata_dummy_port_ops_group1 ; struct device *dev_attr_sw_activity_group1 ; int ldv_state_variable_11 ; int ldv_work_1_2 ; int ldv_state_variable_18 ; struct work_struct *ldv_work_struct_1_2 ; struct ata_link *ata_sff_port_ops_group0 ; int ldv_work_2_2 ; int ldv_state_variable_32 ; struct trace_event_call *event_class_ata_qc_complete_template_group0 ; int ldv_state_variable_34 ; int ldv_work_2_3 ; int ldv_state_variable_35 ; void work_init_3(void) ; void ldv_initialize_ata_port_operations_39(void) ; void ldv_initialize_trace_event_class_45(void) ; void call_and_disable_work_1(struct work_struct *work ) ; void ldv_initialize_device_attribute_32(void) ; void call_and_disable_all_2(int state ) ; void ldv_initialize_ata_port_operations_10(void) ; void ldv_initialize_ata_port_operations_37(void) ; void ldv_initialize_ata_port_operations_5(void) ; void activate_work_1(struct work_struct *work , int state ) ; void ldv_dev_pm_ops_41(void) ; void ldv_initialize_device_attribute_28(void) ; void disable_work_1(struct work_struct *work ) ; void ldv_initialize_device_attribute_35(void) ; void work_init_1(void) ; void ldv_initialize_ata_port_operations_40(void) ; void ldv_initialize_ata_port_operations_9(void) ; void ldv_initialize_trace_event_class_44(void) ; void ldv_initialize_trace_event_class_46(void) ; void invoke_work_2(void) ; void ldv_initialize_ata_port_operations_11(void) ; void ldv_initialize_ata_port_operations_4(void) ; void work_init_2(void) ; void ldv_initialize_device_attribute_33(void) ; void call_and_disable_all_1(int state ) ; void activate_work_2(struct work_struct *work , int state ) ; void ldv_initialize_device_attribute_31(void) ; void ldv_initialize_device_attribute_36(void) ; void ldv_initialize_trace_event_class_47(void) ; void ldv_initialize_ata_port_operations_8(void) ; void ldv_initialize_ata_port_operations_43(void) ; void disable_work_2(struct work_struct *work ) ; void ldv_initialize_device_attribute_34(void) ; void invoke_work_1(void) ; void ldv_initialize_device_attribute_27(void) ; void call_and_disable_work_2(struct work_struct *work ) ; extern int ___ratelimit(struct ratelimit_state * , char const * ) ; extern void *__devres_alloc(void (*)(struct device * , void * ) , size_t , gfp_t , char const * ) ; extern void devres_free(void * ) ; extern void devres_add(struct device * , void * ) ; extern void *devres_open_group(struct device * , void * , gfp_t ) ; extern void devres_remove_group(struct device * , void * ) ; extern int devres_release_group(struct device * , void * ) ; __inline static char const *dev_name(struct device const *dev ) { char const *tmp ; { if ((unsigned long )dev->init_name != (unsigned long )((char const */* const */)0)) { return ((char const *)dev->init_name); } else { } tmp = kobject_name(& dev->kobj); return (tmp); } } __inline static void *dev_get_drvdata(struct device const *dev ) { { return ((void *)dev->driver_data); } } __inline static void dev_set_drvdata(struct device *dev , void *data ) { { dev->driver_data = data; return; } } extern void dev_printk(char const * , struct device const * , char const * , ...) ; extern void dev_err(struct device const * , char const * , ...) ; extern int pci_bus_read_config_byte(struct pci_bus * , unsigned int , int , u8 * ) ; extern int pci_bus_read_config_word(struct pci_bus * , unsigned int , int , u16 * ) ; extern int pci_bus_read_config_dword(struct pci_bus * , unsigned int , int , u32 * ) ; __inline static int pci_read_config_byte(struct pci_dev const *dev , int where , u8 *val ) { int tmp ; { tmp = pci_bus_read_config_byte(dev->bus, dev->devfn, where, val); return (tmp); } } __inline static int pci_read_config_word(struct pci_dev const *dev , int where , u16 *val ) { int tmp ; { tmp = pci_bus_read_config_word(dev->bus, dev->devfn, where, val); return (tmp); } } __inline static int pci_read_config_dword(struct pci_dev const *dev , int where , u32 *val ) { int tmp ; { tmp = pci_bus_read_config_dword(dev->bus, dev->devfn, where, val); return (tmp); } } extern int pcim_enable_device(struct pci_dev * ) ; extern void pci_disable_device(struct pci_dev * ) ; extern void pci_set_master(struct pci_dev * ) ; extern int pci_save_state(struct pci_dev * ) ; extern void pci_restore_state(struct pci_dev * ) ; extern int pci_set_power_state(struct pci_dev * , pci_power_t ) ; __inline static void *lowmem_page_address(struct page const *page ) { { return ((void *)((unsigned long )((unsigned long long )(((long )page + 24189255811072L) / 64L) << 12) + 0xffff880000000000UL)); } } __inline static struct page *sg_page(struct scatterlist *sg ) { long tmp ; long tmp___0 ; { tmp = ldv__builtin_expect(sg->sg_magic != 2271560481UL, 0L); if (tmp != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"include/linux/scatterlist.h"), "i" (123), "i" (12UL)); ldv_25681: ; goto ldv_25681; } else { } tmp___0 = ldv__builtin_expect((long )((int )sg->page_link) & 1L, 0L); if (tmp___0 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"include/linux/scatterlist.h"), "i" (124), "i" (12UL)); ldv_25682: ; goto ldv_25682; } else { } return ((struct page *)(sg->page_link & 0xfffffffffffffffcUL)); } } __inline static void *sg_virt(struct scatterlist *sg ) { struct page *tmp ; void *tmp___0 ; { tmp = sg_page(sg); tmp___0 = lowmem_page_address((struct page const *)tmp); return (tmp___0 + (unsigned long )sg->offset); } } extern struct scatterlist *sg_next(struct scatterlist * ) ; extern void sg_init_one(struct scatterlist * , void const * , unsigned int ) ; __inline static int valid_dma_direction(int dma_direction ) { { return ((dma_direction == 0 || dma_direction == 1) || dma_direction == 2); } } __inline static void kmemcheck_mark_initialized(void *address , unsigned int n ) { { return; } } extern void debug_dma_map_sg(struct device * , struct scatterlist * , int , int , int ) ; extern void debug_dma_unmap_sg(struct device * , struct scatterlist * , int , int ) ; extern struct dma_map_ops *dma_ops ; __inline static struct dma_map_ops *get_dma_ops(struct device *dev ) { long tmp ; { tmp = ldv__builtin_expect((unsigned long )dev == (unsigned long )((struct device *)0), 0L); if (tmp != 0L || (unsigned long )dev->archdata.dma_ops == (unsigned long )((struct dma_map_ops *)0)) { return (dma_ops); } else { return (dev->archdata.dma_ops); } } } __inline static int dma_map_sg_attrs(struct device *dev , struct scatterlist *sg , int nents , enum dma_data_direction dir , struct dma_attrs *attrs ) { struct dma_map_ops *ops ; struct dma_map_ops *tmp ; int i ; int ents ; struct scatterlist *s ; void *tmp___0 ; int tmp___1 ; long tmp___2 ; long tmp___3 ; { tmp = get_dma_ops(dev); ops = tmp; i = 0; s = sg; goto ldv_26473; ldv_26472: tmp___0 = sg_virt(s); kmemcheck_mark_initialized(tmp___0, s->length); i = i + 1; s = sg_next(s); ldv_26473: ; if (i < nents) { goto ldv_26472; } else { } tmp___1 = valid_dma_direction((int )dir); tmp___2 = ldv__builtin_expect(tmp___1 == 0, 0L); if (tmp___2 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"include/asm-generic/dma-mapping-common.h"), "i" (56), "i" (12UL)); ldv_26475: ; goto ldv_26475; } else { } ents = (*(ops->map_sg))(dev, sg, nents, dir, attrs); tmp___3 = ldv__builtin_expect(ents < 0, 0L); if (tmp___3 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"include/asm-generic/dma-mapping-common.h"), "i" (58), "i" (12UL)); ldv_26476: ; goto ldv_26476; } else { } debug_dma_map_sg(dev, sg, nents, ents, (int )dir); return (ents); } } __inline static void dma_unmap_sg_attrs(struct device *dev , struct scatterlist *sg , int nents , enum dma_data_direction dir , struct dma_attrs *attrs ) { struct dma_map_ops *ops ; struct dma_map_ops *tmp ; int tmp___0 ; long tmp___1 ; { tmp = get_dma_ops(dev); ops = tmp; tmp___0 = valid_dma_direction((int )dir); tmp___1 = ldv__builtin_expect(tmp___0 == 0, 0L); if (tmp___1 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"include/asm-generic/dma-mapping-common.h"), "i" (70), "i" (12UL)); ldv_26485: ; goto ldv_26485; } else { } debug_dma_unmap_sg(dev, sg, nents, (int )dir); if ((unsigned long )ops->unmap_sg != (unsigned long )((void (*)(struct device * , struct scatterlist * , int , enum dma_data_direction , struct dma_attrs * ))0)) { (*(ops->unmap_sg))(dev, sg, nents, dir, attrs); } else { } return; } } __inline static void *pci_get_drvdata(struct pci_dev *pdev ) { void *tmp ; { tmp = dev_get_drvdata((struct device const *)(& pdev->dev)); return (tmp); } } extern void msleep(unsigned int ) ; extern int devm_request_threaded_irq(struct device * , unsigned int , irqreturn_t (*)(int , void * ) , irqreturn_t (*)(int , void * ) , unsigned long , char const * , void * ) ; __inline static int devm_request_irq(struct device *dev , unsigned int irq , irqreturn_t (*handler)(int , void * ) , unsigned long irqflags , char const *devname , void *dev_id ) { int tmp ; { tmp = devm_request_threaded_irq(dev, irq, handler, (irqreturn_t (*)(int , void * ))0, irqflags, devname, dev_id); return (tmp); } } extern void devm_free_irq(struct device * , unsigned int , void * ) ; extern async_cookie_t async_schedule(void (*)(void * , async_cookie_t ) , void * ) ; extern void async_synchronize_cookie(async_cookie_t ) ; extern bool glob_match(char const * , char const * ) ; extern void scsi_remove_host(struct Scsi_Host * ) ; extern void scsi_host_put(struct Scsi_Host * ) ; __inline static bool ata_id_has_flush_ext(u16 const *id ) { { if (((int )*(id + 83UL) & 49152) != 16384) { return (0); } else { } return (((int )*(id + 83UL) & 8192) != 0); } } __inline static bool ata_id_has_lba48(u16 const *id ) { { if (((int )*(id + 83UL) & 49152) != 16384) { return (0); } else { } if ((((((unsigned long long )*(id + 103UL) << 48) | ((unsigned long long )*(id + 102UL) << 32)) | ((unsigned long long )*(id + 101UL) << 16)) | (unsigned long long )*(id + 100UL)) == 0ULL) { return (0); } else { } return (((int )*(id + 83UL) & 1024) != 0); } } __inline static bool ata_id_hpa_enabled(u16 const *id ) { { if (((int )*(id + 83UL) & 49152) != 16384) { return (0); } else { } if (((int )*(id + 87UL) & 49152) != 16384) { return (0); } else { } if (((int )*(id + 85UL) & 1024) == 0) { return (0); } else { } return (((int )*(id + 82UL) & 1024) != 0); } } __inline static bool ata_id_has_sense_reporting(u16 const *id ) { { if ((int )((short )*(id + 86UL)) >= 0) { return (0); } else { } return (((int )*(id + 119UL) & 64) != 0); } } __inline static bool ata_id_sense_reporting_enabled(u16 const *id ) { { if ((int )((short )*(id + 86UL)) >= 0) { return (0); } else { } return (((int )*(id + 120UL) & 64) != 0); } } __inline static unsigned int ata_id_major_version(u16 const *id ) { unsigned int mver ; { if ((unsigned int )((unsigned short )*(id + 80UL)) == 65535U) { return (0U); } else { } mver = 14U; goto ldv_38499; ldv_38498: ; if (((int )*(id + 80UL) >> (int )mver) & 1) { goto ldv_38497; } else { } mver = mver - 1U; ldv_38499: ; if (mver != 0U) { goto ldv_38498; } else { } ldv_38497: ; return (mver); } } __inline static bool ata_id_is_sata(u16 const *id ) { { if ((unsigned int )((unsigned short )*(id + 93UL)) == 0U && (int )((short )*(id + 80UL)) > 31) { return (1); } else { } return (0); } } __inline static bool ata_id_has_tpm(u16 const *id ) { unsigned int tmp ; { tmp = ata_id_major_version(id); if (tmp <= 7U) { return (0); } else { } if (((int )*(id + 48UL) & 49152) != 16384) { return (0); } else { } return (((int )*(id + 48UL) & 1) != 0); } } __inline static bool ata_id_has_ncq_send_and_recv(u16 const *id ) { { return (((unsigned long )*(id + 77UL) & 64UL) != 0UL); } } __inline static bool ata_id_current_chs_valid(u16 const *id ) { { return ((bool )(((((int )*(id + 53UL) & 1 && (unsigned int )((unsigned short )*(id + 54UL)) != 0U) && (unsigned int )((unsigned short )*(id + 55UL)) != 0U) && (unsigned int )((unsigned short )*(id + 55UL)) <= 16U) && (unsigned int )((unsigned short )*(id + 56UL)) != 0U)); } } __inline static bool ata_id_is_cfa(u16 const *id ) { { if ((unsigned int )((unsigned short )*id) == 33930U || (unsigned int )((unsigned short )*id) == 33866U) { return (1); } else { } return (((int )*(id + 83UL) & 49156) == 16388); } } __inline static bool ata_drive_40wire(u16 const *dev_id ) { bool tmp ; { tmp = ata_id_is_sata(dev_id); if ((int )tmp) { return (0); } else { } if (((int )*(dev_id + 93UL) & 57344) == 24576) { return (0); } else { } return (1); } } __inline static bool ata_drive_40wire_relaxed(u16 const *dev_id ) { { if (((int )*(dev_id + 93UL) & 8192) != 0) { return (0); } else { } return (1); } } __inline static int atapi_cdb_len(u16 const *dev_id ) { u16 tmp ; { tmp = (unsigned int )((u16 )*dev_id) & 3U; switch ((int )tmp) { case 0: ; return (12); case 1: ; return (16); default: ; return (-1); } } } __inline static int atapi_command_packet_set(u16 const *dev_id ) { { return (((int )((unsigned short )*dev_id) >> 8) & 31); } } __inline static bool atapi_id_dmadir(u16 const *dev_id ) { unsigned int tmp ; { tmp = ata_id_major_version(dev_id); return ((bool )(tmp > 6U && (int )((short )*(dev_id + 62UL)) < 0)); } } __inline static bool lba_28_ok(u64 block , u32 n_block ) { { return ((bool )((u64 )n_block + block <= 268435454ULL && n_block <= 256U)); } } __inline static bool lba_48_ok(u64 block , u32 n_block ) { { return ((bool )(((u64 )n_block + block) - 1ULL <= 281474976710655ULL && n_block <= 65536U)); } } unsigned long const sata_deb_timing_normal[3U] ; unsigned long const sata_deb_timing_hotplug[3U] ; unsigned long const sata_deb_timing_long[3U] ; struct ata_port_operations ata_dummy_port_ops ; struct ata_port_info const ata_dummy_port_info ; __inline static unsigned int ata_prot_flags(u8 prot ) { { switch ((int )prot) { case 1: ; return (0U); case 2: ; return (1U); case 3: ; return (2U); case 4: ; return (6U); case 5: ; return (8U); case 6: ; return (9U); case 7: ; return (10U); } return (0U); } } __inline static int ata_is_nodata(u8 prot ) { unsigned int tmp ; { tmp = ata_prot_flags((int )prot); return ((tmp & 3U) == 0U); } } __inline static int ata_is_pio(u8 prot ) { unsigned int tmp ; { tmp = ata_prot_flags((int )prot); return ((int )tmp & 1); } } __inline static int ata_is_dma(u8 prot ) { unsigned int tmp ; { tmp = ata_prot_flags((int )prot); return ((int )tmp & 2); } } __inline static int ata_is_ncq(u8 prot ) { unsigned int tmp ; { tmp = ata_prot_flags((int )prot); return ((int )tmp & 4); } } __inline static int ata_is_data(u8 prot ) { unsigned int tmp ; { tmp = ata_prot_flags((int )prot); return ((int )tmp & 3); } } __inline static unsigned long const *sata_ehc_deb_timing(struct ata_eh_context *ehc ) { { if ((int )ehc->i.flags & 1) { return ((unsigned long const *)(& sata_deb_timing_hotplug)); } else { return ((unsigned long const *)(& sata_deb_timing_normal)); } } } __inline static int ata_port_is_dummy(struct ata_port *ap ) { { return ((unsigned long )ap->ops == (unsigned long )(& ata_dummy_port_ops)); } } int sata_set_spd(struct ata_link *link ) ; int ata_std_prereset(struct ata_link *link , unsigned long deadline ) ; int ata_wait_after_reset(struct ata_link *link , unsigned long deadline , int (*check_ready)(struct ata_link * ) ) ; int sata_link_debounce(struct ata_link *link , unsigned long const *params , unsigned long deadline ) ; int sata_link_resume(struct ata_link *link , unsigned long const *params , unsigned long deadline ) ; int sata_link_scr_lpm(struct ata_link *link , enum ata_lpm_policy policy , bool spm_wakeup ) ; int sata_link_hardreset(struct ata_link *link , unsigned long const *timing , unsigned long deadline , bool *online , int (*check_ready)(struct ata_link * ) ) ; int sata_std_hardreset(struct ata_link *link , unsigned int *class , unsigned long deadline ) ; void ata_std_postreset(struct ata_link *link , unsigned int *classes ) ; struct ata_host *ata_host_alloc(struct device *dev , int max_ports ) ; struct ata_host *ata_host_alloc_pinfo(struct device *dev , struct ata_port_info const * const *ppi , int n_ports ) ; int ata_slave_link_init(struct ata_port *ap ) ; int ata_host_start(struct ata_host *host ) ; int ata_host_register(struct ata_host *host , struct scsi_host_template *sht ) ; int ata_host_activate(struct ata_host *host , int irq , irqreturn_t (*irq_handler)(int , void * ) , unsigned long irq_flags , struct scsi_host_template *sht ) ; void ata_host_detach(struct ata_host *host ) ; void ata_host_init(struct ata_host *host , struct device *dev , struct ata_port_operations *ops ) ; int ata_scsi_queuecmd(struct Scsi_Host *shost , struct scsi_cmnd *cmd ) ; int sata_scr_valid(struct ata_link *link ) ; int sata_scr_read(struct ata_link *link , int reg , u32 *val ) ; int sata_scr_write(struct ata_link *link , int reg , u32 val ) ; int sata_scr_write_flush(struct ata_link *link , int reg , u32 val ) ; bool ata_link_online(struct ata_link *link ) ; bool ata_link_offline(struct ata_link *link ) ; int ata_host_suspend(struct ata_host *host , pm_message_t mesg ) ; void ata_host_resume(struct ata_host *host ) ; void ata_sas_port_suspend(struct ata_port *ap ) ; void ata_sas_port_resume(struct ata_port *ap ) ; int ata_ratelimit(void) ; void ata_msleep(struct ata_port *ap , unsigned int msecs ) ; u32 ata_wait_register(struct ata_port *ap , void *reg , u32 mask , u32 val , unsigned long interval , unsigned long timeout ) ; int atapi_cmd_type(u8 opcode ) ; void ata_tf_to_fis(struct ata_taskfile const *tf , u8 pmp , int is_cmd , u8 *fis ) ; void ata_tf_from_fis(u8 const *fis , struct ata_taskfile *tf ) ; unsigned long ata_pack_xfermask(unsigned long pio_mask , unsigned long mwdma_mask , unsigned long udma_mask ) ; void ata_unpack_xfermask(unsigned long xfer_mask , unsigned long *pio_mask , unsigned long *mwdma_mask , unsigned long *udma_mask ) ; u8 ata_xfer_mask2mode(unsigned long xfer_mask ) ; unsigned long ata_xfer_mode2mask(u8 xfer_mode ) ; int ata_xfer_mode2shift(unsigned long xfer_mode ) ; char const *ata_mode_string(unsigned long xfer_mask ) ; unsigned long ata_id_xfermask(u16 const *id ) ; int ata_std_qc_defer(struct ata_queued_cmd *qc ) ; void ata_noop_qc_prep(struct ata_queued_cmd *qc ) ; void ata_sg_init(struct ata_queued_cmd *qc , struct scatterlist *sg , unsigned int n_elem ) ; unsigned int ata_dev_classify(struct ata_taskfile const *tf ) ; void ata_dev_disable(struct ata_device *dev ) ; void ata_id_string(u16 const *id , unsigned char *s , unsigned int ofs , unsigned int len ) ; void ata_id_c_string(u16 const *id , unsigned char *s , unsigned int ofs , unsigned int len ) ; unsigned int ata_do_dev_read_id(struct ata_device *dev , struct ata_taskfile *tf , u16 *id ) ; void ata_qc_complete(struct ata_queued_cmd *qc ) ; int ata_qc_complete_multiple(struct ata_port *ap , u32 qc_active ) ; void ata_scsi_simulate(struct ata_device *dev , struct scsi_cmnd *cmd ) ; int ata_std_bios_param(struct scsi_device *sdev , struct block_device *bdev , sector_t capacity , int *geom ) ; void ata_scsi_unlock_native_capacity(struct scsi_device *sdev ) ; int ata_scsi_slave_config(struct scsi_device *sdev ) ; void ata_scsi_slave_destroy(struct scsi_device *sdev ) ; int ata_scsi_change_queue_depth(struct scsi_device *sdev , int queue_depth ) ; int __ata_change_queue_depth(struct ata_port *ap , struct scsi_device *sdev , int queue_depth ) ; struct ata_device *ata_dev_pair(struct ata_device *adev ) ; int ata_do_set_mode(struct ata_link *link , struct ata_device **r_failed_dev ) ; bool sata_lpm_ignore_phy_events(struct ata_link *link ) ; int ata_cable_40wire(struct ata_port *ap ) ; int ata_cable_80wire(struct ata_port *ap ) ; int ata_cable_sata(struct ata_port *ap ) ; int ata_cable_ignore(struct ata_port *ap ) ; int ata_cable_unknown(struct ata_port *ap ) ; unsigned int ata_pio_need_iordy(struct ata_device const *adev ) ; struct ata_timing const *ata_timing_find_mode(u8 xfer_mode ) ; int ata_timing_compute(struct ata_device *adev , unsigned short speed , struct ata_timing *t , int T , int UT ) ; void ata_timing_merge(struct ata_timing const *a , struct ata_timing const *b , struct ata_timing *m , unsigned int what ) ; u8 ata_timing_cycle2mode(unsigned int xfer_shift , int cycle ) ; int pci_test_config_bits(struct pci_dev *pdev , struct pci_bits const *bits ) ; void ata_pci_remove_one(struct pci_dev *pdev ) ; void ata_pci_device_do_suspend(struct pci_dev *pdev , pm_message_t mesg ) ; int ata_pci_device_do_resume(struct pci_dev *pdev ) ; int ata_pci_device_suspend(struct pci_dev *pdev , pm_message_t mesg ) ; int ata_pci_device_resume(struct pci_dev *pdev ) ; int ata_platform_remove_one(struct platform_device *pdev ) ; void ata_port_schedule_eh(struct ata_port *ap ) ; void ata_port_wait_eh(struct ata_port *ap ) ; int ata_link_abort(struct ata_link *link ) ; int ata_port_abort(struct ata_port *ap ) ; int ata_port_freeze(struct ata_port *ap ) ; int sata_async_notification(struct ata_port *ap ) ; void ata_eh_freeze_port(struct ata_port *ap ) ; void ata_eh_thaw_port(struct ata_port *ap ) ; void ata_eh_qc_complete(struct ata_queued_cmd *qc ) ; void ata_eh_qc_retry(struct ata_queued_cmd *qc ) ; void ata_eh_analyze_ncq_error(struct ata_link *link ) ; void ata_do_eh(struct ata_port *ap , int (*prereset)(struct ata_link * , unsigned long ) , int (*softreset)(struct ata_link * , unsigned int * , unsigned long ) , int (*hardreset)(struct ata_link * , unsigned int * , unsigned long ) , void (*postreset)(struct ata_link * , unsigned int * ) ) ; void ata_std_error_handler(struct ata_port *ap ) ; void ata_std_sched_eh(struct ata_port *ap ) ; void ata_std_end_eh(struct ata_port *ap ) ; int ata_link_nr_enabled(struct ata_link *link ) ; struct ata_port_operations const ata_base_port_ops ; struct ata_port_operations const sata_port_ops ; __inline static bool sata_pmp_supported(struct ata_port *ap ) { { return ((ap->flags & 524288UL) != 0UL); } } __inline static bool sata_pmp_attached(struct ata_port *ap ) { { return (ap->nr_pmp_links != 0); } } __inline static int ata_is_host_link(struct ata_link const *link ) { { return ((unsigned long )((struct ata_link const *)(& (link->ap)->link)) == (unsigned long )link || (unsigned long )((struct ata_link const *)(link->ap)->slave_link) == (unsigned long )link); } } void ata_port_printk(struct ata_port const *ap , char const *level , char const *fmt , ...) ; void ata_link_printk(struct ata_link const *link , char const *level , char const *fmt , ...) ; void ata_dev_printk(struct ata_device const *dev , char const *level , char const *fmt , ...) ; void ata_print_version(struct device const *dev , char const *version ) ; void __ata_ehi_push_desc(struct ata_eh_info *ehi , char const *fmt , ...) ; void ata_ehi_push_desc(struct ata_eh_info *ehi , char const *fmt , ...) ; void ata_ehi_clear_desc(struct ata_eh_info *ehi ) ; void ata_port_desc(struct ata_port *ap , char const *fmt , ...) ; void ata_port_pbar_desc(struct ata_port *ap , int bar , ssize_t offset , char const *name ) ; __inline static unsigned int ata_tag_valid(unsigned int tag ) { { return (tag <= 31U); } } __inline static unsigned int ata_tag_internal(unsigned int tag ) { { return (tag == 31U); } } __inline static unsigned int ata_class_enabled(unsigned int class ) { { return ((unsigned int )((((class == 1U || class == 3U) || class == 5U) || class == 7U) || class == 9U)); } } __inline static unsigned int ata_dev_enabled(struct ata_device const *dev ) { unsigned int tmp ; { tmp = ata_class_enabled(dev->class); return (tmp); } } __inline static int ata_link_max_devices(struct ata_link const *link ) { int tmp ; { tmp = ata_is_host_link(link); if (tmp != 0 && (int )(link->ap)->flags & 1) { return (2); } else { } return (1); } } struct ata_link *ata_link_next(struct ata_link *link , struct ata_port *ap , enum ata_link_iter_mode mode ) ; struct ata_device *ata_dev_next(struct ata_device *dev , struct ata_link *link , enum ata_dev_iter_mode mode ) ; __inline static int ata_ncq_enabled(struct ata_device *dev ) { { return ((dev->flags & 12296UL) == 8UL); } } __inline static struct ata_queued_cmd *__ata_qc_from_tag(struct ata_port *ap , unsigned int tag ) { unsigned int tmp ; long tmp___0 ; { tmp = ata_tag_valid(tag); tmp___0 = ldv__builtin_expect(tmp != 0U, 1L); if (tmp___0 != 0L) { return ((struct ata_queued_cmd *)(& ap->qcmd) + (unsigned long )tag); } else { } return ((struct ata_queued_cmd *)0); } } __inline static struct ata_queued_cmd *ata_qc_from_tag(struct ata_port *ap , unsigned int tag ) { struct ata_queued_cmd *qc ; struct ata_queued_cmd *tmp ; long tmp___0 ; { tmp = __ata_qc_from_tag(ap, tag); qc = tmp; tmp___0 = ldv__builtin_expect((unsigned long )qc == (unsigned long )((struct ata_queued_cmd *)0), 0L); if (tmp___0 != 0L || (unsigned long )(ap->ops)->error_handler == (unsigned long )((void (*)(struct ata_port * ))0)) { return (qc); } else { } if ((qc->flags & 65537UL) == 1UL) { return (qc); } else { } return ((struct ata_queued_cmd *)0); } } __inline static void ata_tf_init(struct ata_device *dev , struct ata_taskfile *tf ) { { memset((void *)tf, 0, 32UL); tf->ctl = ((dev->link)->ap)->ctl; if (dev->devno == 0U) { tf->device = 160U; } else { tf->device = 176U; } return; } } __inline static void ata_qc_reinit(struct ata_queued_cmd *qc ) { unsigned int tmp ; unsigned int tmp___0 ; { qc->dma_dir = 3; qc->sg = (struct scatterlist *)0; qc->flags = 0UL; qc->cursg = (struct scatterlist *)0; qc->cursg_ofs = 0U; tmp___0 = 0U; qc->curbytes = tmp___0; tmp = tmp___0; qc->extrabytes = tmp; qc->nbytes = tmp; qc->n_elem = 0U; qc->err_mask = 0U; qc->sect_size = 512U; ata_tf_init(qc->dev, & qc->tf); qc->result_tf.command = 64U; qc->result_tf.feature = 0U; return; } } __inline static unsigned long ata_deadline(unsigned long from_jiffies , unsigned long timeout_msecs ) { unsigned long tmp ; { tmp = msecs_to_jiffies((unsigned int const )timeout_msecs); return (tmp + from_jiffies); } } __inline static int ata_dma_enabled(struct ata_device *adev ) { { return ((unsigned int )adev->dma_mode != 255U); } } extern int __pm_runtime_set_status(struct device * , unsigned int ) ; extern void pm_runtime_enable(struct device * ) ; extern void __pm_runtime_disable(struct device * , bool ) ; __inline static bool pm_runtime_suspended(struct device *dev ) { { return ((bool )((unsigned int )dev->power.runtime_status == 2U && (unsigned int )*((unsigned char *)dev + 1048UL) == 0U)); } } __inline static int pm_runtime_set_active(struct device *dev ) { int tmp ; { tmp = __pm_runtime_set_status(dev, 0U); return (tmp); } } __inline static void pm_runtime_disable(struct device *dev ) { { __pm_runtime_disable(dev, 1); return; } } __inline static void *platform_get_drvdata(struct platform_device const *pdev ) { void *tmp ; { tmp = dev_get_drvdata(& pdev->dev); return (tmp); } } __inline static bool seq_buf_has_overflowed(struct seq_buf *s ) { { return (s->len > s->size); } } __inline static bool trace_seq_has_overflowed(struct trace_seq *s ) { bool tmp ; int tmp___0 ; { if (s->full != 0) { tmp___0 = 1; } else { tmp = seq_buf_has_overflowed(& s->seq); if ((int )tmp) { tmp___0 = 1; } else { tmp___0 = 0; } } return ((bool )tmp___0); } } extern void trace_seq_printf(struct trace_seq * , char const * , ...) ; char const *libata_trace_parse_status(struct trace_seq *p , unsigned char status ) ; char const *libata_trace_parse_eh_action(struct trace_seq *p , unsigned int eh_action ) ; char const *libata_trace_parse_eh_err_mask(struct trace_seq *p , unsigned int eh_err_mask ) ; char const *libata_trace_parse_qc_flags(struct trace_seq *p , unsigned int qc_flags ) ; struct tracepoint __tracepoint_ata_qc_issue ; __inline static void trace_ata_qc_issue(struct ata_queued_cmd *qc ) { struct tracepoint_func *it_func_ptr ; void *it_func ; void *__data ; struct tracepoint_func *________p1 ; struct tracepoint_func *_________p1 ; union __anonunion___u_296 __u ; bool __warned ; int tmp ; int tmp___0 ; bool tmp___1 ; struct tracepoint_func *________p1___0 ; struct tracepoint_func *_________p1___0 ; union __anonunion___u_298 __u___0 ; bool __warned___0 ; int tmp___2 ; int tmp___3 ; { tmp___1 = static_key_false(& __tracepoint_ata_qc_issue.key); if ((int )tmp___1) { rcu_read_lock_sched_notrace(); __read_once_size((void const volatile *)(& __tracepoint_ata_qc_issue.funcs), (void *)(& __u.__c), 8); _________p1 = __u.__val; ________p1 = _________p1; tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { tmp___0 = rcu_read_lock_sched_held(); if (tmp___0 == 0) { __warned = 1; lockdep_rcu_suspicious("include/trace/events/libata.h", 198, "suspicious rcu_dereference_check() usage"); } else { } } else { } it_func_ptr = ________p1; if ((unsigned long )it_func_ptr != (unsigned long )((struct tracepoint_func *)0)) { ldv_44875: it_func = it_func_ptr->func; __data = it_func_ptr->data; (*((void (*)(void * , struct ata_queued_cmd * ))it_func))(__data, qc); it_func_ptr = it_func_ptr + 1; if ((unsigned long )it_func_ptr->func != (unsigned long )((void *)0)) { goto ldv_44875; } else { } } else { } rcu_read_unlock_sched_notrace(); } else { } rcu_read_lock_sched_notrace(); __read_once_size((void const volatile *)(& __tracepoint_ata_qc_issue.funcs), (void *)(& __u___0.__c), 8); _________p1___0 = __u___0.__val; ________p1___0 = _________p1___0; tmp___2 = debug_lockdep_rcu_enabled(); if (tmp___2 != 0 && ! __warned___0) { tmp___3 = rcu_read_lock_sched_held(); if (tmp___3 == 0) { __warned___0 = 1; lockdep_rcu_suspicious("include/trace/events/libata.h", 198, "suspicious rcu_dereference_check() usage"); } else { } } else { } rcu_read_unlock_sched_notrace(); return; } } struct tracepoint __tracepoint_ata_qc_complete_internal ; __inline static void trace_ata_qc_complete_internal(struct ata_queued_cmd *qc ) { struct tracepoint_func *it_func_ptr ; void *it_func ; void *__data ; struct tracepoint_func *________p1 ; struct tracepoint_func *_________p1 ; union __anonunion___u_300 __u ; bool __warned ; int tmp ; int tmp___0 ; bool tmp___1 ; struct tracepoint_func *________p1___0 ; struct tracepoint_func *_________p1___0 ; union __anonunion___u_302 __u___0 ; bool __warned___0 ; int tmp___2 ; int tmp___3 ; { tmp___1 = static_key_false(& __tracepoint_ata_qc_complete_internal.key); if ((int )tmp___1) { rcu_read_lock_sched_notrace(); __read_once_size((void const volatile *)(& __tracepoint_ata_qc_complete_internal.funcs), (void *)(& __u.__c), 8); _________p1 = __u.__val; ________p1 = _________p1; tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { tmp___0 = rcu_read_lock_sched_held(); if (tmp___0 == 0) { __warned = 1; lockdep_rcu_suspicious("include/trace/events/libata.h", 258, "suspicious rcu_dereference_check() usage"); } else { } } else { } it_func_ptr = ________p1; if ((unsigned long )it_func_ptr != (unsigned long )((struct tracepoint_func *)0)) { ldv_44926: it_func = it_func_ptr->func; __data = it_func_ptr->data; (*((void (*)(void * , struct ata_queued_cmd * ))it_func))(__data, qc); it_func_ptr = it_func_ptr + 1; if ((unsigned long )it_func_ptr->func != (unsigned long )((void *)0)) { goto ldv_44926; } else { } } else { } rcu_read_unlock_sched_notrace(); } else { } rcu_read_lock_sched_notrace(); __read_once_size((void const volatile *)(& __tracepoint_ata_qc_complete_internal.funcs), (void *)(& __u___0.__c), 8); _________p1___0 = __u___0.__val; ________p1___0 = _________p1___0; tmp___2 = debug_lockdep_rcu_enabled(); if (tmp___2 != 0 && ! __warned___0) { tmp___3 = rcu_read_lock_sched_held(); if (tmp___3 == 0) { __warned___0 = 1; lockdep_rcu_suspicious("include/trace/events/libata.h", 258, "suspicious rcu_dereference_check() usage"); } else { } } else { } rcu_read_unlock_sched_notrace(); return; } } struct tracepoint __tracepoint_ata_qc_complete_failed ; __inline static void trace_ata_qc_complete_failed(struct ata_queued_cmd *qc ) { struct tracepoint_func *it_func_ptr ; void *it_func ; void *__data ; struct tracepoint_func *________p1 ; struct tracepoint_func *_________p1 ; union __anonunion___u_304 __u ; bool __warned ; int tmp ; int tmp___0 ; bool tmp___1 ; struct tracepoint_func *________p1___0 ; struct tracepoint_func *_________p1___0 ; union __anonunion___u_306 __u___0 ; bool __warned___0 ; int tmp___2 ; int tmp___3 ; { tmp___1 = static_key_false(& __tracepoint_ata_qc_complete_failed.key); if ((int )tmp___1) { rcu_read_lock_sched_notrace(); __read_once_size((void const volatile *)(& __tracepoint_ata_qc_complete_failed.funcs), (void *)(& __u.__c), 8); _________p1 = __u.__val; ________p1 = _________p1; tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { tmp___0 = rcu_read_lock_sched_held(); if (tmp___0 == 0) { __warned = 1; lockdep_rcu_suspicious("include/trace/events/libata.h", 262, "suspicious rcu_dereference_check() usage"); } else { } } else { } it_func_ptr = ________p1; if ((unsigned long )it_func_ptr != (unsigned long )((struct tracepoint_func *)0)) { ldv_44977: it_func = it_func_ptr->func; __data = it_func_ptr->data; (*((void (*)(void * , struct ata_queued_cmd * ))it_func))(__data, qc); it_func_ptr = it_func_ptr + 1; if ((unsigned long )it_func_ptr->func != (unsigned long )((void *)0)) { goto ldv_44977; } else { } } else { } rcu_read_unlock_sched_notrace(); } else { } rcu_read_lock_sched_notrace(); __read_once_size((void const volatile *)(& __tracepoint_ata_qc_complete_failed.funcs), (void *)(& __u___0.__c), 8); _________p1___0 = __u___0.__val; ________p1___0 = _________p1___0; tmp___2 = debug_lockdep_rcu_enabled(); if (tmp___2 != 0 && ! __warned___0) { tmp___3 = rcu_read_lock_sched_held(); if (tmp___3 == 0) { __warned___0 = 1; lockdep_rcu_suspicious("include/trace/events/libata.h", 262, "suspicious rcu_dereference_check() usage"); } else { } } else { } rcu_read_unlock_sched_notrace(); return; } } struct tracepoint __tracepoint_ata_qc_complete_done ; __inline static void trace_ata_qc_complete_done(struct ata_queued_cmd *qc ) { struct tracepoint_func *it_func_ptr ; void *it_func ; void *__data ; struct tracepoint_func *________p1 ; struct tracepoint_func *_________p1 ; union __anonunion___u_308 __u ; bool __warned ; int tmp ; int tmp___0 ; bool tmp___1 ; struct tracepoint_func *________p1___0 ; struct tracepoint_func *_________p1___0 ; union __anonunion___u_310 __u___0 ; bool __warned___0 ; int tmp___2 ; int tmp___3 ; { tmp___1 = static_key_false(& __tracepoint_ata_qc_complete_done.key); if ((int )tmp___1) { rcu_read_lock_sched_notrace(); __read_once_size((void const volatile *)(& __tracepoint_ata_qc_complete_done.funcs), (void *)(& __u.__c), 8); _________p1 = __u.__val; ________p1 = _________p1; tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { tmp___0 = rcu_read_lock_sched_held(); if (tmp___0 == 0) { __warned = 1; lockdep_rcu_suspicious("include/trace/events/libata.h", 266, "suspicious rcu_dereference_check() usage"); } else { } } else { } it_func_ptr = ________p1; if ((unsigned long )it_func_ptr != (unsigned long )((struct tracepoint_func *)0)) { ldv_45028: it_func = it_func_ptr->func; __data = it_func_ptr->data; (*((void (*)(void * , struct ata_queued_cmd * ))it_func))(__data, qc); it_func_ptr = it_func_ptr + 1; if ((unsigned long )it_func_ptr->func != (unsigned long )((void *)0)) { goto ldv_45028; } else { } } else { } rcu_read_unlock_sched_notrace(); } else { } rcu_read_lock_sched_notrace(); __read_once_size((void const volatile *)(& __tracepoint_ata_qc_complete_done.funcs), (void *)(& __u___0.__c), 8); _________p1___0 = __u___0.__val; ________p1___0 = _________p1___0; tmp___2 = debug_lockdep_rcu_enabled(); if (tmp___2 != 0 && ! __warned___0) { tmp___3 = rcu_read_lock_sched_held(); if (tmp___3 == 0) { __warned___0 = 1; lockdep_rcu_suspicious("include/trace/events/libata.h", 266, "suspicious rcu_dereference_check() usage"); } else { } } else { } rcu_read_unlock_sched_notrace(); return; } } struct tracepoint __tracepoint_ata_eh_link_autopsy ; struct tracepoint __tracepoint_ata_eh_link_autopsy_qc ; static char const __tpstrtab_ata_qc_issue[13U] = { 'a', 't', 'a', '_', 'q', 'c', '_', 'i', 's', 's', 'u', 'e', '\000'}; struct tracepoint __tracepoint_ata_qc_issue = {(char const *)(& __tpstrtab_ata_qc_issue), {{0}}, (void (*)(void))0, (void (*)(void))0, (struct tracepoint_func *)0}; static char const __tpstrtab_ata_qc_complete_internal[25U] = { 'a', 't', 'a', '_', 'q', 'c', '_', 'c', 'o', 'm', 'p', 'l', 'e', 't', 'e', '_', 'i', 'n', 't', 'e', 'r', 'n', 'a', 'l', '\000'}; struct tracepoint __tracepoint_ata_qc_complete_internal = {(char const *)(& __tpstrtab_ata_qc_complete_internal), {{0}}, (void (*)(void))0, (void (*)(void))0, (struct tracepoint_func *)0}; static char const __tpstrtab_ata_qc_complete_failed[23U] = { 'a', 't', 'a', '_', 'q', 'c', '_', 'c', 'o', 'm', 'p', 'l', 'e', 't', 'e', '_', 'f', 'a', 'i', 'l', 'e', 'd', '\000'}; struct tracepoint __tracepoint_ata_qc_complete_failed = {(char const *)(& __tpstrtab_ata_qc_complete_failed), {{0}}, (void (*)(void))0, (void (*)(void))0, (struct tracepoint_func *)0}; static char const __tpstrtab_ata_qc_complete_done[21U] = { 'a', 't', 'a', '_', 'q', 'c', '_', 'c', 'o', 'm', 'p', 'l', 'e', 't', 'e', '_', 'd', 'o', 'n', 'e', '\000'}; struct tracepoint __tracepoint_ata_qc_complete_done = {(char const *)(& __tpstrtab_ata_qc_complete_done), {{0}}, (void (*)(void))0, (void (*)(void))0, (struct tracepoint_func *)0}; static char const __tpstrtab_ata_eh_link_autopsy[20U] = { 'a', 't', 'a', '_', 'e', 'h', '_', 'l', 'i', 'n', 'k', '_', 'a', 'u', 't', 'o', 'p', 's', 'y', '\000'}; struct tracepoint __tracepoint_ata_eh_link_autopsy = {(char const *)(& __tpstrtab_ata_eh_link_autopsy), {{0}}, (void (*)(void))0, (void (*)(void))0, (struct tracepoint_func *)0}; static char const __tpstrtab_ata_eh_link_autopsy_qc[23U] = { 'a', 't', 'a', '_', 'e', 'h', '_', 'l', 'i', 'n', 'k', '_', 'a', 'u', 't', 'o', 'p', 's', 'y', '_', 'q', 'c', '\000'}; struct tracepoint __tracepoint_ata_eh_link_autopsy_qc = {(char const *)(& __tpstrtab_ata_eh_link_autopsy_qc), {{0}}, (void (*)(void))0, (void (*)(void))0, (struct tracepoint_func *)0}; extern char const *trace_print_symbols_seq(struct trace_seq * , unsigned long , struct trace_print_flags const * ) ; extern int trace_raw_output_prep(struct trace_iterator * , struct trace_event * ) ; __inline static enum print_line_t trace_handle_return(struct trace_seq *s ) { bool tmp ; { tmp = trace_seq_has_overflowed(s); return ((int )tmp ? 0 : 1); } } extern int trace_event_reg(struct trace_event_call * , enum trace_reg , void * ) ; extern int trace_event_raw_init(struct trace_event_call * ) ; extern int trace_define_field(struct trace_event_call * , char const * , char const * , int , int , int , int ) ; static enum print_line_t trace_raw_output_ata_qc_issue(struct trace_iterator *iter , int flags , struct trace_event *trace_event ) { struct trace_seq *s ; struct trace_seq *p ; struct trace_event_raw_ata_qc_issue *field ; int ret ; struct trace_print_flags symbols[91U] ; char const *tmp ; struct trace_print_flags symbols___0[9U] ; char const *tmp___0 ; enum print_line_t tmp___1 ; { s = & iter->seq; p = & iter->tmp_seq; field = (struct trace_event_raw_ata_qc_issue *)iter->ent; ret = trace_raw_output_prep(iter, trace_event); if (ret != 1) { return ((enum print_line_t )ret); } else { } symbols[0].mask = 8UL; symbols[0].name = "ATA_CMD_DEV_RESET"; symbols[1].mask = 229UL; symbols[1].name = "ATA_CMD_CHK_POWER"; symbols[2].mask = 226UL; symbols[2].name = "ATA_CMD_STANDBY"; symbols[3].mask = 227UL; symbols[3].name = "ATA_CMD_IDLE"; symbols[4].mask = 144UL; symbols[4].name = "ATA_CMD_EDD"; symbols[5].mask = 146UL; symbols[5].name = "ATA_CMD_DOWNLOAD_MICRO"; symbols[6].mask = 147UL; symbols[6].name = "ATA_CMD_DOWNLOAD_MICRO_DMA"; symbols[7].mask = 0UL; symbols[7].name = "ATA_CMD_NOP"; symbols[8].mask = 231UL; symbols[8].name = "ATA_CMD_FLUSH"; symbols[9].mask = 234UL; symbols[9].name = "ATA_CMD_FLUSH_EXT"; symbols[10].mask = 236UL; symbols[10].name = "ATA_CMD_ID_ATA"; symbols[11].mask = 161UL; symbols[11].name = "ATA_CMD_ID_ATAPI"; symbols[12].mask = 162UL; symbols[12].name = "ATA_CMD_SERVICE"; symbols[13].mask = 200UL; symbols[13].name = "ATA_CMD_READ"; symbols[14].mask = 37UL; symbols[14].name = "ATA_CMD_READ_EXT"; symbols[15].mask = 38UL; symbols[15].name = "ATA_CMD_READ_QUEUED"; symbols[16].mask = 43UL; symbols[16].name = "ATA_CMD_READ_STREAM_EXT"; symbols[17].mask = 42UL; symbols[17].name = "ATA_CMD_READ_STREAM_DMA_EXT"; symbols[18].mask = 202UL; symbols[18].name = "ATA_CMD_WRITE"; symbols[19].mask = 53UL; symbols[19].name = "ATA_CMD_WRITE_EXT"; symbols[20].mask = 54UL; symbols[20].name = "ATA_CMD_WRITE_QUEUED"; symbols[21].mask = 59UL; symbols[21].name = "ATA_CMD_WRITE_STREAM_EXT"; symbols[22].mask = 58UL; symbols[22].name = "ATA_CMD_WRITE_STREAM_DMA_EXT"; symbols[23].mask = 61UL; symbols[23].name = "ATA_CMD_WRITE_FUA_EXT"; symbols[24].mask = 62UL; symbols[24].name = "ATA_CMD_WRITE_QUEUED_FUA_EXT"; symbols[25].mask = 96UL; symbols[25].name = "ATA_CMD_FPDMA_READ"; symbols[26].mask = 97UL; symbols[26].name = "ATA_CMD_FPDMA_WRITE"; symbols[27].mask = 100UL; symbols[27].name = "ATA_CMD_FPDMA_SEND"; symbols[28].mask = 101UL; symbols[28].name = "ATA_CMD_FPDMA_RECV"; symbols[29].mask = 32UL; symbols[29].name = "ATA_CMD_PIO_READ"; symbols[30].mask = 36UL; symbols[30].name = "ATA_CMD_PIO_READ_EXT"; symbols[31].mask = 48UL; symbols[31].name = "ATA_CMD_PIO_WRITE"; symbols[32].mask = 52UL; symbols[32].name = "ATA_CMD_PIO_WRITE_EXT"; symbols[33].mask = 196UL; symbols[33].name = "ATA_CMD_READ_MULTI"; symbols[34].mask = 41UL; symbols[34].name = "ATA_CMD_READ_MULTI_EXT"; symbols[35].mask = 197UL; symbols[35].name = "ATA_CMD_WRITE_MULTI"; symbols[36].mask = 57UL; symbols[36].name = "ATA_CMD_WRITE_MULTI_EXT"; symbols[37].mask = 206UL; symbols[37].name = "ATA_CMD_WRITE_MULTI_FUA_EXT"; symbols[38].mask = 239UL; symbols[38].name = "ATA_CMD_SET_FEATURES"; symbols[39].mask = 198UL; symbols[39].name = "ATA_CMD_SET_MULTI"; symbols[40].mask = 160UL; symbols[40].name = "ATA_CMD_PACKET"; symbols[41].mask = 64UL; symbols[41].name = "ATA_CMD_VERIFY"; symbols[42].mask = 66UL; symbols[42].name = "ATA_CMD_VERIFY_EXT"; symbols[43].mask = 69UL; symbols[43].name = "ATA_CMD_WRITE_UNCORR_EXT"; symbols[44].mask = 224UL; symbols[44].name = "ATA_CMD_STANDBYNOW1"; symbols[45].mask = 225UL; symbols[45].name = "ATA_CMD_IDLEIMMEDIATE"; symbols[46].mask = 230UL; symbols[46].name = "ATA_CMD_SLEEP"; symbols[47].mask = 145UL; symbols[47].name = "ATA_CMD_INIT_DEV_PARAMS"; symbols[48].mask = 248UL; symbols[48].name = "ATA_CMD_READ_NATIVE_MAX"; symbols[49].mask = 39UL; symbols[49].name = "ATA_CMD_READ_NATIVE_MAX_EXT"; symbols[50].mask = 249UL; symbols[50].name = "ATA_CMD_SET_MAX"; symbols[51].mask = 55UL; symbols[51].name = "ATA_CMD_SET_MAX_EXT"; symbols[52].mask = 47UL; symbols[52].name = "ATA_CMD_READ_LOG_EXT"; symbols[53].mask = 63UL; symbols[53].name = "ATA_CMD_WRITE_LOG_EXT"; symbols[54].mask = 71UL; symbols[54].name = "ATA_CMD_READ_LOG_DMA_EXT"; symbols[55].mask = 87UL; symbols[55].name = "ATA_CMD_WRITE_LOG_DMA_EXT"; symbols[56].mask = 91UL; symbols[56].name = "ATA_CMD_TRUSTED_NONDATA"; symbols[57].mask = 92UL; symbols[57].name = "ATA_CMD_TRUSTED_RCV"; symbols[58].mask = 93UL; symbols[58].name = "ATA_CMD_TRUSTED_RCV_DMA"; symbols[59].mask = 94UL; symbols[59].name = "ATA_CMD_TRUSTED_SND"; symbols[60].mask = 95UL; symbols[60].name = "ATA_CMD_TRUSTED_SND_DMA"; symbols[61].mask = 228UL; symbols[61].name = "ATA_CMD_PMP_READ"; symbols[62].mask = 233UL; symbols[62].name = "ATA_CMD_PMP_READ_DMA"; symbols[63].mask = 232UL; symbols[63].name = "ATA_CMD_PMP_WRITE"; symbols[64].mask = 235UL; symbols[64].name = "ATA_CMD_PMP_WRITE_DMA"; symbols[65].mask = 177UL; symbols[65].name = "ATA_CMD_CONF_OVERLAY"; symbols[66].mask = 241UL; symbols[66].name = "ATA_CMD_SEC_SET_PASS"; symbols[67].mask = 242UL; symbols[67].name = "ATA_CMD_SEC_UNLOCK"; symbols[68].mask = 243UL; symbols[68].name = "ATA_CMD_SEC_ERASE_PREP"; symbols[69].mask = 244UL; symbols[69].name = "ATA_CMD_SEC_ERASE_UNIT"; symbols[70].mask = 245UL; symbols[70].name = "ATA_CMD_SEC_FREEZE_LOCK"; symbols[71].mask = 246UL; symbols[71].name = "ATA_CMD_SEC_DISABLE_PASS"; symbols[72].mask = 81UL; symbols[72].name = "ATA_CMD_CONFIG_STREAM"; symbols[73].mask = 176UL; symbols[73].name = "ATA_CMD_SMART"; symbols[74].mask = 222UL; symbols[74].name = "ATA_CMD_MEDIA_LOCK"; symbols[75].mask = 223UL; symbols[75].name = "ATA_CMD_MEDIA_UNLOCK"; symbols[76].mask = 6UL; symbols[76].name = "ATA_CMD_DSM"; symbols[77].mask = 209UL; symbols[77].name = "ATA_CMD_CHK_MED_CRD_TYP"; symbols[78].mask = 3UL; symbols[78].name = "ATA_CMD_CFA_REQ_EXT_ERR"; symbols[79].mask = 56UL; symbols[79].name = "ATA_CMD_CFA_WRITE_NE"; symbols[80].mask = 135UL; symbols[80].name = "ATA_CMD_CFA_TRANS_SECT"; symbols[81].mask = 192UL; symbols[81].name = "ATA_CMD_CFA_ERASE"; symbols[82].mask = 205UL; symbols[82].name = "ATA_CMD_CFA_WRITE_MULT_NE"; symbols[83].mask = 11UL; symbols[83].name = "ATA_CMD_REQ_SENSE_DATA"; symbols[84].mask = 180UL; symbols[84].name = "ATA_CMD_SANITIZE_DEVICE"; symbols[85].mask = 16UL; symbols[85].name = "ATA_CMD_RESTORE"; symbols[86].mask = 34UL; symbols[86].name = "ATA_CMD_READ_LONG"; symbols[87].mask = 35UL; symbols[87].name = "ATA_CMD_READ_LONG_ONCE"; symbols[88].mask = 50UL; symbols[88].name = "ATA_CMD_WRITE_LONG"; symbols[89].mask = 51UL; symbols[89].name = "ATA_CMD_WRITE_LONG_ONCE"; symbols[90].mask = 0xffffffffffffffffUL; symbols[90].name = (char const *)0; tmp = trace_print_symbols_seq(p, (unsigned long )field->cmd, (struct trace_print_flags const *)(& symbols)); symbols___0[0].mask = 0UL; symbols___0[0].name = "ATA_PROT_UNKNOWN"; symbols___0[1].mask = 1UL; symbols___0[1].name = "ATA_PROT_NODATA"; symbols___0[2].mask = 2UL; symbols___0[2].name = "ATA_PROT_PIO"; symbols___0[3].mask = 3UL; symbols___0[3].name = "ATA_PROT_DMA"; symbols___0[4].mask = 4UL; symbols___0[4].name = "ATA_PROT_NCQ"; symbols___0[5].mask = 5UL; symbols___0[5].name = "ATAPI_PROT_NODATA"; symbols___0[6].mask = 6UL; symbols___0[6].name = "ATAPI_PROT_PIO"; symbols___0[7].mask = 7UL; symbols___0[7].name = "ATAPI_PROT_DMA"; symbols___0[8].mask = 0xffffffffffffffffUL; symbols___0[8].name = (char const *)0; tmp___0 = trace_print_symbols_seq(p, (unsigned long )field->proto, (struct trace_print_flags const *)(& symbols___0)); trace_seq_printf(s, "ata_port=%u ata_dev=%u tag=%d proto=%s cmd=%s tf=(%02x/%02x:%02x:%02x:%02x:%02x/%02x:%02x:%02x:%02x:%02x/%02x)\n", field->ata_port, field->ata_dev, field->tag, tmp___0, tmp, (int )field->cmd, (int )field->feature, (int )field->nsect, (int )field->lbal, (int )field->lbam, (int )field->lbah, (int )field->hob_feature, (int )field->hob_nsect, (int )field->hob_lbal, (int )field->hob_lbam, (int )field->hob_lbah, (int )field->dev); tmp___1 = trace_handle_return(s); return (tmp___1); } } static enum print_line_t trace_raw_output_ata_qc_complete_template(struct trace_iterator *iter , int flags , struct trace_event *trace_event ) { struct trace_seq *s ; struct trace_seq *p ; struct trace_event_raw_ata_qc_complete_template *field ; int ret ; char const *tmp ; char const *tmp___0 ; enum print_line_t tmp___1 ; { s = & iter->seq; p = & iter->tmp_seq; field = (struct trace_event_raw_ata_qc_complete_template *)iter->ent; ret = trace_raw_output_prep(iter, trace_event); if (ret != 1) { return ((enum print_line_t )ret); } else { } tmp = libata_trace_parse_status(p, (int )field->status); tmp___0 = libata_trace_parse_qc_flags(p, (unsigned int )field->flags); trace_seq_printf(s, "ata_port=%u ata_dev=%u tag=%d flags=%s status=%s res=(%02x/%02x:%02x:%02x:%02x:%02x/%02x:%02x:%02x:%02x:%02x/%02x)\n", field->ata_port, field->ata_dev, field->tag, tmp___0, tmp, (int )field->status, (int )field->error, (int )field->nsect, (int )field->lbal, (int )field->lbam, (int )field->lbah, (int )field->hob_feature, (int )field->hob_nsect, (int )field->hob_lbal, (int )field->hob_lbam, (int )field->hob_lbah, (int )field->dev); tmp___1 = trace_handle_return(s); return (tmp___1); } } static enum print_line_t trace_raw_output_ata_eh_link_autopsy(struct trace_iterator *iter , int flags , struct trace_event *trace_event ) { struct trace_seq *s ; struct trace_seq *p ; struct trace_event_raw_ata_eh_link_autopsy *field ; int ret ; char const *tmp ; char const *tmp___0 ; enum print_line_t tmp___1 ; { s = & iter->seq; p = & iter->tmp_seq; field = (struct trace_event_raw_ata_eh_link_autopsy *)iter->ent; ret = trace_raw_output_prep(iter, trace_event); if (ret != 1) { return ((enum print_line_t )ret); } else { } tmp = libata_trace_parse_eh_err_mask(p, field->eh_err_mask); tmp___0 = libata_trace_parse_eh_action(p, field->eh_action); trace_seq_printf(s, "ata_port=%u ata_dev=%u eh_action=%s err_mask=%s\n", field->ata_port, field->ata_dev, tmp___0, tmp); tmp___1 = trace_handle_return(s); return (tmp___1); } } static enum print_line_t trace_raw_output_ata_eh_link_autopsy_qc(struct trace_iterator *iter , int flags , struct trace_event *trace_event ) { struct trace_seq *s ; struct trace_seq *p ; struct trace_event_raw_ata_eh_link_autopsy_qc *field ; int ret ; char const *tmp ; char const *tmp___0 ; enum print_line_t tmp___1 ; { s = & iter->seq; p = & iter->tmp_seq; field = (struct trace_event_raw_ata_eh_link_autopsy_qc *)iter->ent; ret = trace_raw_output_prep(iter, trace_event); if (ret != 1) { return ((enum print_line_t )ret); } else { } tmp = libata_trace_parse_eh_err_mask(p, field->eh_err_mask); tmp___0 = libata_trace_parse_qc_flags(p, field->qc_flags); trace_seq_printf(s, "ata_port=%u ata_dev=%u tag=%d flags=%s err_mask=%s\n", field->ata_port, field->ata_dev, field->tag, tmp___0, tmp); tmp___1 = trace_handle_return(s); return (tmp___1); } } static int trace_event_define_fields_ata_qc_issue(struct trace_event_call *event_call ) { int ret ; { ret = trace_define_field(event_call, "unsigned int", "ata_port", 8, 4, 0, 0); if (ret != 0) { return (ret); } else { } ret = trace_define_field(event_call, "unsigned int", "ata_dev", 12, 4, 0, 0); if (ret != 0) { return (ret); } else { } ret = trace_define_field(event_call, "unsigned int", "tag", 16, 4, 0, 0); if (ret != 0) { return (ret); } else { } ret = trace_define_field(event_call, "unsigned char", "cmd", 20, 1, 0, 0); if (ret != 0) { return (ret); } else { } ret = trace_define_field(event_call, "unsigned char", "dev", 21, 1, 0, 0); if (ret != 0) { return (ret); } else { } ret = trace_define_field(event_call, "unsigned char", "lbal", 22, 1, 0, 0); if (ret != 0) { return (ret); } else { } ret = trace_define_field(event_call, "unsigned char", "lbam", 23, 1, 0, 0); if (ret != 0) { return (ret); } else { } ret = trace_define_field(event_call, "unsigned char", "lbah", 24, 1, 0, 0); if (ret != 0) { return (ret); } else { } ret = trace_define_field(event_call, "unsigned char", "nsect", 25, 1, 0, 0); if (ret != 0) { return (ret); } else { } ret = trace_define_field(event_call, "unsigned char", "feature", 26, 1, 0, 0); if (ret != 0) { return (ret); } else { } ret = trace_define_field(event_call, "unsigned char", "hob_lbal", 27, 1, 0, 0); if (ret != 0) { return (ret); } else { } ret = trace_define_field(event_call, "unsigned char", "hob_lbam", 28, 1, 0, 0); if (ret != 0) { return (ret); } else { } ret = trace_define_field(event_call, "unsigned char", "hob_lbah", 29, 1, 0, 0); if (ret != 0) { return (ret); } else { } ret = trace_define_field(event_call, "unsigned char", "hob_nsect", 30, 1, 0, 0); if (ret != 0) { return (ret); } else { } ret = trace_define_field(event_call, "unsigned char", "hob_feature", 31, 1, 0, 0); if (ret != 0) { return (ret); } else { } ret = trace_define_field(event_call, "unsigned char", "ctl", 32, 1, 0, 0); if (ret != 0) { return (ret); } else { } ret = trace_define_field(event_call, "unsigned char", "proto", 33, 1, 0, 0); if (ret != 0) { return (ret); } else { } ret = trace_define_field(event_call, "unsigned long", "flags", 40, 8, 0, 0); if (ret != 0) { return (ret); } else { } return (ret); } } static int trace_event_define_fields_ata_qc_complete_template(struct trace_event_call *event_call ) { int ret ; { ret = trace_define_field(event_call, "unsigned int", "ata_port", 8, 4, 0, 0); if (ret != 0) { return (ret); } else { } ret = trace_define_field(event_call, "unsigned int", "ata_dev", 12, 4, 0, 0); if (ret != 0) { return (ret); } else { } ret = trace_define_field(event_call, "unsigned int", "tag", 16, 4, 0, 0); if (ret != 0) { return (ret); } else { } ret = trace_define_field(event_call, "unsigned char", "status", 20, 1, 0, 0); if (ret != 0) { return (ret); } else { } ret = trace_define_field(event_call, "unsigned char", "dev", 21, 1, 0, 0); if (ret != 0) { return (ret); } else { } ret = trace_define_field(event_call, "unsigned char", "lbal", 22, 1, 0, 0); if (ret != 0) { return (ret); } else { } ret = trace_define_field(event_call, "unsigned char", "lbam", 23, 1, 0, 0); if (ret != 0) { return (ret); } else { } ret = trace_define_field(event_call, "unsigned char", "lbah", 24, 1, 0, 0); if (ret != 0) { return (ret); } else { } ret = trace_define_field(event_call, "unsigned char", "nsect", 25, 1, 0, 0); if (ret != 0) { return (ret); } else { } ret = trace_define_field(event_call, "unsigned char", "error", 26, 1, 0, 0); if (ret != 0) { return (ret); } else { } ret = trace_define_field(event_call, "unsigned char", "hob_lbal", 27, 1, 0, 0); if (ret != 0) { return (ret); } else { } ret = trace_define_field(event_call, "unsigned char", "hob_lbam", 28, 1, 0, 0); if (ret != 0) { return (ret); } else { } ret = trace_define_field(event_call, "unsigned char", "hob_lbah", 29, 1, 0, 0); if (ret != 0) { return (ret); } else { } ret = trace_define_field(event_call, "unsigned char", "hob_nsect", 30, 1, 0, 0); if (ret != 0) { return (ret); } else { } ret = trace_define_field(event_call, "unsigned char", "hob_feature", 31, 1, 0, 0); if (ret != 0) { return (ret); } else { } ret = trace_define_field(event_call, "unsigned char", "ctl", 32, 1, 0, 0); if (ret != 0) { return (ret); } else { } ret = trace_define_field(event_call, "unsigned long", "flags", 40, 8, 0, 0); if (ret != 0) { return (ret); } else { } return (ret); } } static int trace_event_define_fields_ata_eh_link_autopsy(struct trace_event_call *event_call ) { int ret ; { ret = trace_define_field(event_call, "unsigned int", "ata_port", 8, 4, 0, 0); if (ret != 0) { return (ret); } else { } ret = trace_define_field(event_call, "unsigned int", "ata_dev", 12, 4, 0, 0); if (ret != 0) { return (ret); } else { } ret = trace_define_field(event_call, "unsigned int", "eh_action", 16, 4, 0, 0); if (ret != 0) { return (ret); } else { } ret = trace_define_field(event_call, "unsigned int", "eh_err_mask", 20, 4, 0, 0); if (ret != 0) { return (ret); } else { } return (ret); } } static int trace_event_define_fields_ata_eh_link_autopsy_qc(struct trace_event_call *event_call ) { int ret ; { ret = trace_define_field(event_call, "unsigned int", "ata_port", 8, 4, 0, 0); if (ret != 0) { return (ret); } else { } ret = trace_define_field(event_call, "unsigned int", "ata_dev", 12, 4, 0, 0); if (ret != 0) { return (ret); } else { } ret = trace_define_field(event_call, "unsigned int", "tag", 16, 4, 0, 0); if (ret != 0) { return (ret); } else { } ret = trace_define_field(event_call, "unsigned int", "qc_flags", 20, 4, 0, 0); if (ret != 0) { return (ret); } else { } ret = trace_define_field(event_call, "unsigned int", "eh_err_mask", 24, 4, 0, 0); if (ret != 0) { return (ret); } else { } return (ret); } } atomic_t ata_print_id ; int atapi_passthru16 ; int libata_fua ; int libata_noacpi ; int libata_allow_tpm ; struct device_type ata_port_type ; struct ata_link *ata_dev_phys_link(struct ata_device *dev ) ; void ata_force_cbl(struct ata_port *ap ) ; u64 ata_tf_to_lba(struct ata_taskfile const *tf ) ; u64 ata_tf_to_lba48(struct ata_taskfile const *tf ) ; struct ata_queued_cmd *ata_qc_new_init(struct ata_device *dev , int tag ) ; int ata_build_rw_tf(struct ata_taskfile *tf , struct ata_device *dev , u64 block , u32 n_block , unsigned int tf_flags , unsigned int tag ) ; u64 ata_tf_read_block(struct ata_taskfile const *tf , struct ata_device *dev ) ; unsigned int ata_exec_internal(struct ata_device *dev , struct ata_taskfile *tf , u8 const *cdb , int dma_dir , void *buf , unsigned int buflen , unsigned long timeout ) ; unsigned int ata_exec_internal_sg(struct ata_device *dev , struct ata_taskfile *tf , u8 const *cdb , int dma_dir , struct scatterlist *sgl , unsigned int n_elem , unsigned long timeout ) ; int ata_wait_ready(struct ata_link *link , unsigned long deadline , int (*check_ready)(struct ata_link * ) ) ; int ata_dev_read_id(struct ata_device *dev , unsigned int *p_class , unsigned int flags , u16 *id ) ; int ata_dev_reread_id(struct ata_device *dev , unsigned int readid_flags ) ; int ata_dev_revalidate(struct ata_device *dev , unsigned int new_class , unsigned int readid_flags ) ; int ata_dev_configure(struct ata_device *dev ) ; int sata_down_spd_limit(struct ata_link *link , u32 spd_limit ) ; int ata_down_xfermask_limit(struct ata_device *dev , unsigned int sel ) ; unsigned int ata_dev_set_feature(struct ata_device *dev , u8 enable , u8 feature ) ; void ata_sg_clean(struct ata_queued_cmd *qc ) ; void ata_qc_free(struct ata_queued_cmd *qc ) ; void ata_qc_issue(struct ata_queued_cmd *qc ) ; void __ata_qc_complete(struct ata_queued_cmd *qc ) ; int atapi_check_dma(struct ata_queued_cmd *qc ) ; void swap_buf_le16(u16 *buf , unsigned int buf_words ) ; bool ata_phys_link_online(struct ata_link *link ) ; bool ata_phys_link_offline(struct ata_link *link ) ; void ata_dev_init(struct ata_device *dev ) ; void ata_link_init(struct ata_port *ap , struct ata_link *link , int pmp ) ; int sata_link_init_spd(struct ata_link *link ) ; struct ata_port *ata_port_alloc(struct ata_host *host ) ; char const *sata_spd_string(unsigned int spd ) ; int ata_port_probe(struct ata_port *ap ) ; void __ata_port_probe(struct ata_port *ap ) ; unsigned int ata_acpi_gtf_filter ; void ata_acpi_dissociate(struct ata_host *host ) ; int ata_acpi_on_devcfg(struct ata_device *dev ) ; int ata_scsi_add_hosts(struct ata_host *host , struct scsi_host_template *sht ) ; void ata_scsi_scan_host(struct ata_port *ap , int sync ) ; void ata_scsi_hotplug(struct work_struct *work ) ; void ata_scsi_dev_rescan(struct work_struct *work ) ; int ata_bus_probe(struct ata_port *ap ) ; int ata_sas_allocate_tag(struct ata_port *ap ) ; void ata_sas_free_tag(unsigned int tag , struct ata_port *ap ) ; unsigned long ata_internal_cmd_timeout(struct ata_device *dev , u8 cmd ) ; void ata_internal_cmd_timed_out(struct ata_device *dev , u8 cmd ) ; void ata_eh_acquire(struct ata_port *ap ) ; void ata_eh_release(struct ata_port *ap ) ; void ata_eh_fastdrain_timerfn(unsigned long arg ) ; void ata_qc_schedule_eh(struct ata_queued_cmd *qc ) ; unsigned int ata_read_log_page(struct ata_device *dev , u8 log , u8 page , void *buf , unsigned int sectors ) ; int ata_set_mode(struct ata_link *link , struct ata_device **r_failed_dev ) ; int sata_pmp_scr_read(struct ata_link *link , int reg , u32 *r_val ) ; int sata_pmp_scr_write(struct ata_link *link , int reg , u32 val ) ; void ata_sff_flush_pio_task(struct ata_port *ap ) ; void ata_sff_port_init(struct ata_port *ap ) ; int ata_sff_init(void) ; void ata_sff_exit(void) ; void zpodd_init(struct ata_device *dev ) ; void zpodd_exit(struct ata_device *dev ) ; __inline static bool zpodd_dev_enabled(struct ata_device *dev ) { { return ((unsigned long )dev->zpodd != (unsigned long )((void *)0)); } } struct scsi_transport_template *ata_scsi_transport_template ; void ata_tlink_delete(struct ata_link *link ) ; int ata_tport_add(struct device *parent , struct ata_port *ap ) ; void ata_tport_delete(struct ata_port *ap ) ; struct scsi_transport_template *ata_attach_transport(void) ; void ata_release_transport(struct scsi_transport_template *t ) ; int libata_transport_init(void) ; void libata_transport_exit(void) ; unsigned long const sata_deb_timing_normal[3U] = { 5UL, 100UL, 2000UL}; unsigned long const sata_deb_timing_hotplug[3U] = { 25UL, 500UL, 2000UL}; unsigned long const sata_deb_timing_long[3U] = { 100UL, 2000UL, 5000UL}; struct ata_port_operations const ata_base_port_ops = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & ata_std_prereset, 0, 0, & ata_std_postreset, 0, 0, 0, 0, & ata_std_error_handler, 0, 0, & ata_std_sched_eh, & ata_std_end_eh, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; struct ata_port_operations const sata_port_ops = {& ata_std_qc_defer, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & sata_std_hardreset, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & ata_base_port_ops}; static unsigned int ata_dev_init_params(struct ata_device *dev , u16 heads , u16 sectors ) ; static unsigned int ata_dev_set_xfermode(struct ata_device *dev ) ; static void ata_dev_xfermask(struct ata_device *dev ) ; static unsigned long ata_dev_blacklisted(struct ata_device const *dev ) ; atomic_t ata_print_id = {0}; static struct ata_force_ent *ata_force_tbl ; static int ata_force_tbl_size ; static char ata_force_param_buf[4096U] ; static int atapi_enabled = 1; static int atapi_dmadir = 0; int atapi_passthru16 = 1; int libata_fua = 0; static int ata_ignore_hpa ; static int libata_dma_mask = 7; static int ata_probe_timeout ; int libata_noacpi = 0; int libata_allow_tpm = 0; static int atapi_an ; static bool ata_sstatus_online(u32 sstatus ) { { return ((sstatus & 15U) == 3U); } } struct ata_link *ata_link_next(struct ata_link *link , struct ata_port *ap , enum ata_link_iter_mode mode ) { long tmp ; bool tmp___0 ; bool tmp___1 ; long tmp___2 ; long tmp___3 ; { tmp = ldv__builtin_expect((long )(((unsigned int )mode != 0U && (unsigned int )mode != 2U) && (unsigned int )mode != 1U), 0L); if (tmp != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-core.c"), "i" (198), "i" (12UL)); ldv_49107: ; goto ldv_49107; } else { } if ((unsigned long )link == (unsigned long )((struct ata_link *)0)) { switch ((unsigned int )mode) { case 0U: ; case 2U: tmp___0 = sata_pmp_attached(ap); if ((int )tmp___0) { return (ap->pmp_link); } else { } case 1U: ; return (& ap->link); } } else { } if ((unsigned long )(& ap->link) == (unsigned long )link) { switch ((unsigned int )mode) { case 1U: tmp___1 = sata_pmp_attached(ap); if ((int )tmp___1) { return (ap->pmp_link); } else { } case 2U: tmp___2 = ldv__builtin_expect((unsigned long )ap->slave_link != (unsigned long )((struct ata_link *)0), 0L); if (tmp___2 != 0L) { return (ap->slave_link); } else { } case 0U: ; return ((struct ata_link *)0); } } else { } tmp___3 = ldv__builtin_expect((unsigned long )ap->slave_link == (unsigned long )link, 0L); if (tmp___3 != 0L) { return ((struct ata_link *)0); } else { } link = link + 1; if ((unsigned long )link < (unsigned long )(ap->pmp_link + (unsigned long )ap->nr_pmp_links)) { return (link); } else { } if ((unsigned int )mode == 2U) { return (& ap->link); } else { } return ((struct ata_link *)0); } } struct ata_device *ata_dev_next(struct ata_device *dev , struct ata_link *link , enum ata_dev_iter_mode mode ) { long tmp ; int tmp___0 ; int tmp___1 ; unsigned int tmp___2 ; { tmp = ldv__builtin_expect((long )((((unsigned int )mode != 0U && (unsigned int )mode != 1U) && (unsigned int )mode != 2U) && (unsigned int )mode != 3U), 0L); if (tmp != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-core.c"), "i" (257), "i" (12UL)); ldv_49119: ; goto ldv_49119; } else { } if ((unsigned long )dev == (unsigned long )((struct ata_device *)0)) { switch ((unsigned int )mode) { case 0U: ; case 2U: dev = (struct ata_device *)(& link->device); goto check; case 1U: ; case 3U: tmp___0 = ata_link_max_devices((struct ata_link const *)link); dev = (struct ata_device *)(& link->device) + ((unsigned long )tmp___0 + 0xffffffffffffffffUL); goto check; } } else { } next: ; switch ((unsigned int )mode) { case 0U: ; case 2U: dev = dev + 1; tmp___1 = ata_link_max_devices((struct ata_link const *)link); if ((unsigned long )dev < (unsigned long )((struct ata_device *)(& link->device) + (unsigned long )tmp___1)) { goto check; } else { } return ((struct ata_device *)0); case 1U: ; case 3U: dev = dev - 1; if ((unsigned long )dev >= (unsigned long )((struct ata_device *)(& link->device))) { goto check; } else { } return ((struct ata_device *)0); } check: ; if ((unsigned int )mode == 0U || (unsigned int )mode == 1U) { tmp___2 = ata_dev_enabled((struct ata_device const *)dev); if (tmp___2 == 0U) { goto next; } else { } } else { } return (dev); } } struct ata_link *ata_dev_phys_link(struct ata_device *dev ) { struct ata_port *ap ; { ap = (dev->link)->ap; if ((unsigned long )ap->slave_link == (unsigned long )((struct ata_link *)0)) { return (dev->link); } else { } if (dev->devno == 0U) { return (& ap->link); } else { } return (ap->slave_link); } } void ata_force_cbl(struct ata_port *ap ) { int i ; struct ata_force_ent const *fe ; { i = ata_force_tbl_size + -1; goto ldv_49141; ldv_49140: fe = (struct ata_force_ent const *)ata_force_tbl + (unsigned long )i; if ((int )fe->port != -1 && (unsigned int )fe->port != ap->print_id) { goto ldv_49139; } else { } if ((unsigned int )fe->param.cbl == 0U) { goto ldv_49139; } else { } ap->cbl = fe->param.cbl; ata_port_printk((struct ata_port const *)ap, "\r", "FORCE: cable set to %s\n", fe->param.name); return; ldv_49139: i = i - 1; ldv_49141: ; if (i >= 0) { goto ldv_49140; } else { } return; } } static void ata_force_link_limits(struct ata_link *link ) { bool did_spd ; int linkno ; int i ; int tmp ; struct ata_force_ent const *fe ; { did_spd = 0; linkno = link->pmp; tmp = ata_is_host_link((struct ata_link const *)link); if (tmp != 0) { linkno = linkno + 15; } else { } i = ata_force_tbl_size + -1; goto ldv_49152; ldv_49151: fe = (struct ata_force_ent const *)ata_force_tbl + (unsigned long )i; if ((int )fe->port != -1 && (unsigned int )fe->port != (link->ap)->print_id) { goto ldv_49150; } else { } if ((int )fe->device != -1 && (int )fe->device != linkno) { goto ldv_49150; } else { } if (! did_spd && (int )fe->param.spd_limit != 0) { link->hw_sata_spd_limit = (unsigned int )((1 << fe->param.spd_limit) + -1); ata_link_printk((struct ata_link const *)link, "\r", "FORCE: PHY spd limit set to %s\n", fe->param.name); did_spd = 1; } else { } if ((unsigned int )fe->param.lflags != 0U) { link->flags = link->flags | (unsigned int )fe->param.lflags; ata_link_printk((struct ata_link const *)link, "\r", "FORCE: link flag 0x%x forced -> 0x%x\n", fe->param.lflags, link->flags); } else { } ldv_49150: i = i - 1; ldv_49152: ; if (i >= 0) { goto ldv_49151; } else { } return; } } static void ata_force_xfermask(struct ata_device *dev ) { int devno ; int alt_devno ; int i ; int tmp ; struct ata_force_ent const *fe ; unsigned long pio_mask ; unsigned long mwdma_mask ; unsigned long udma_mask ; { devno = (int )((unsigned int )(dev->link)->pmp + dev->devno); alt_devno = devno; tmp = ata_is_host_link((struct ata_link const *)dev->link); if (tmp != 0) { alt_devno = alt_devno + 15; } else { } i = ata_force_tbl_size + -1; goto ldv_49166; ldv_49165: fe = (struct ata_force_ent const *)ata_force_tbl + (unsigned long )i; if ((int )fe->port != -1 && (unsigned int )fe->port != ((dev->link)->ap)->print_id) { goto ldv_49164; } else { } if (((int )fe->device != -1 && (int )fe->device != devno) && (int )fe->device != alt_devno) { goto ldv_49164; } else { } if ((unsigned long )fe->param.xfer_mask == 0UL) { goto ldv_49164; } else { } ata_unpack_xfermask(fe->param.xfer_mask, & pio_mask, & mwdma_mask, & udma_mask); if (udma_mask != 0UL) { dev->udma_mask = udma_mask; } else if (mwdma_mask != 0UL) { dev->udma_mask = 0UL; dev->mwdma_mask = mwdma_mask; } else { dev->udma_mask = 0UL; dev->mwdma_mask = 0UL; dev->pio_mask = pio_mask; } ata_dev_printk((struct ata_device const *)dev, "\r", "FORCE: xfer_mask set to %s\n", fe->param.name); return; ldv_49164: i = i - 1; ldv_49166: ; if (i >= 0) { goto ldv_49165; } else { } return; } } static void ata_force_horkage(struct ata_device *dev ) { int devno ; int alt_devno ; int i ; int tmp ; struct ata_force_ent const *fe ; { devno = (int )((unsigned int )(dev->link)->pmp + dev->devno); alt_devno = devno; tmp = ata_is_host_link((struct ata_link const *)dev->link); if (tmp != 0) { alt_devno = alt_devno + 15; } else { } i = 0; goto ldv_49177; ldv_49176: fe = (struct ata_force_ent const *)ata_force_tbl + (unsigned long )i; if ((int )fe->port != -1 && (unsigned int )fe->port != ((dev->link)->ap)->print_id) { goto ldv_49175; } else { } if (((int )fe->device != -1 && (int )fe->device != devno) && (int )fe->device != alt_devno) { goto ldv_49175; } else { } if ((~ dev->horkage & (unsigned int )fe->param.horkage_on) == 0U && (dev->horkage & (unsigned int )fe->param.horkage_off) == 0U) { goto ldv_49175; } else { } dev->horkage = dev->horkage | (unsigned int )fe->param.horkage_on; dev->horkage = dev->horkage & (unsigned int )(~ fe->param.horkage_off); ata_dev_printk((struct ata_device const *)dev, "\r", "FORCE: horkage modified (%s)\n", fe->param.name); ldv_49175: i = i + 1; ldv_49177: ; if (i < ata_force_tbl_size) { goto ldv_49176; } else { } return; } } int atapi_cmd_type(u8 opcode ) { { switch ((int )opcode) { case 40: ; case 168: ; return (0); case 42: ; case 170: ; case 46: ; return (1); case 190: ; case 185: ; return (2); case 133: ; case 161: ; if (atapi_passthru16 != 0) { return (3); } else { } default: ; return (4); } } } void ata_tf_to_fis(struct ata_taskfile const *tf , u8 pmp , int is_cmd , u8 *fis ) { { *fis = 39U; *(fis + 1UL) = (unsigned int )pmp & 15U; if (is_cmd != 0) { *(fis + 1UL) = (u8 )((unsigned int )*(fis + 1UL) | 128U); } else { } *(fis + 2UL) = tf->command; *(fis + 3UL) = tf->feature; *(fis + 4UL) = tf->lbal; *(fis + 5UL) = tf->lbam; *(fis + 6UL) = tf->lbah; *(fis + 7UL) = tf->device; *(fis + 8UL) = tf->hob_lbal; *(fis + 9UL) = tf->hob_lbam; *(fis + 10UL) = tf->hob_lbah; *(fis + 11UL) = tf->hob_feature; *(fis + 12UL) = tf->nsect; *(fis + 13UL) = tf->hob_nsect; *(fis + 14UL) = 0U; *(fis + 15UL) = tf->ctl; *(fis + 16UL) = (u8 )tf->auxiliary; *(fis + 17UL) = (u8 )(tf->auxiliary >> 8); *(fis + 18UL) = (u8 )(tf->auxiliary >> 16); *(fis + 19UL) = (u8 )(tf->auxiliary >> 24); return; } } void ata_tf_from_fis(u8 const *fis , struct ata_taskfile *tf ) { { tf->command = *(fis + 2UL); tf->feature = *(fis + 3UL); tf->lbal = *(fis + 4UL); tf->lbam = *(fis + 5UL); tf->lbah = *(fis + 6UL); tf->device = *(fis + 7UL); tf->hob_lbal = *(fis + 8UL); tf->hob_lbam = *(fis + 9UL); tf->hob_lbah = *(fis + 10UL); tf->nsect = *(fis + 12UL); tf->hob_nsect = *(fis + 13UL); return; } } static u8 const ata_rw_cmds[24U] = { 196U, 197U, 41U, 57U, 0U, 0U, 0U, 206U, 32U, 48U, 36U, 52U, 0U, 0U, 0U, 0U, 200U, 202U, 37U, 53U, 0U, 0U, 0U, 61U}; static int ata_rwcmd_protocol(struct ata_taskfile *tf , struct ata_device *dev ) { u8 cmd ; int index ; int fua ; int lba48 ; int write ; { fua = (tf->flags & 32UL) != 0UL ? 4 : 0; lba48 = (int )tf->flags & 1 ? 2 : 0; write = (tf->flags & 8UL) != 0UL; if ((dev->flags & 4096UL) != 0UL) { tf->protocol = 2U; index = dev->multi_count != 0U ? 0 : 8; } else if (lba48 != 0 && (((dev->link)->ap)->flags & 256UL) != 0UL) { tf->protocol = 2U; index = dev->multi_count != 0U ? 0 : 8; } else { tf->protocol = 3U; index = 16; } cmd = ata_rw_cmds[((index + fua) + lba48) + write]; if ((unsigned int )cmd != 0U) { tf->command = cmd; return (0); } else { } return (-1); } } u64 ata_tf_read_block(struct ata_taskfile const *tf , struct ata_device *dev ) { u64 block ; u32 cyl ; u32 head ; u32 sect ; { block = 0ULL; if ((unsigned long )dev == (unsigned long )((struct ata_device *)0) || ((unsigned long )tf->flags & 16UL) != 0UL) { if ((int )tf->flags & 1) { block = ((unsigned long long )tf->hob_lbah << 40) | block; block = ((unsigned long long )tf->hob_lbam << 32) | block; block = ((unsigned long long )tf->hob_lbal << 24) | block; } else { block = (u64 )(((int )tf->device & 15) << 24) | block; } block = (u64 )((int )tf->lbah << 16) | block; block = (u64 )((int )tf->lbam << 8) | block; block = (u64 )tf->lbal | block; } else { cyl = (u32 )((int )tf->lbam | ((int )tf->lbah << 8)); head = (u32 )tf->device & 15U; sect = (u32 )tf->lbal; if (sect == 0U) { ata_dev_printk((struct ata_device const *)dev, "\f", "device reported invalid CHS sector 0\n"); sect = 1U; } else { } block = (u64 )((((u32 )dev->heads * cyl + head) * (u32 )dev->sectors + sect) - 1U); } return (block); } } int ata_build_rw_tf(struct ata_taskfile *tf , struct ata_device *dev , u64 block , u32 n_block , unsigned int tf_flags , unsigned int tag ) { bool tmp ; int tmp___0 ; bool tmp___1 ; bool tmp___2 ; int tmp___3 ; long tmp___4 ; u32 sect ; u32 head ; u32 cyl ; u32 track ; bool tmp___5 ; int tmp___6 ; int tmp___7 ; long tmp___8 ; int tmp___9 ; long tmp___10 ; { tf->flags = tf->flags | 6UL; tf->flags = tf->flags | (unsigned long )tf_flags; tmp___9 = ata_ncq_enabled(dev); if (tmp___9 != 0) { tmp___10 = ldv__builtin_expect(tag != 31U, 1L); if (tmp___10 != 0L) { tmp = lba_48_ok(block, n_block); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { return (-34); } else { } tf->protocol = 4U; tf->flags = tf->flags | 17UL; if ((tf->flags & 8UL) != 0UL) { tf->command = 97U; } else { tf->command = 96U; } tf->nsect = (int )((u8 )tag) << 3U; tf->hob_feature = (u8 )(n_block >> 8); tf->feature = (u8 )n_block; tf->hob_lbah = (u8 )(block >> 40); tf->hob_lbam = (u8 )(block >> 32); tf->hob_lbal = (u8 )(block >> 24); tf->lbah = (u8 )(block >> 16); tf->lbam = (u8 )(block >> 8); tf->lbal = (u8 )block; tf->device = 64U; if ((tf->flags & 32UL) != 0UL) { tf->device = (u8 )((unsigned int )tf->device | 128U); } else { } } else { goto _L; } } else _L: /* CIL Label */ if ((int )dev->flags & 1) { tf->flags = tf->flags | 16UL; tmp___2 = lba_28_ok(block, n_block); if ((int )tmp___2) { tf->device = (unsigned int )tf->device | ((unsigned int )((u8 )(block >> 24)) & 15U); } else { tmp___1 = lba_48_ok(block, n_block); if ((int )tmp___1) { if ((dev->flags & 2UL) == 0UL) { return (-34); } else { } tf->flags = tf->flags | 1UL; tf->hob_nsect = (u8 )(n_block >> 8); tf->hob_lbah = (u8 )(block >> 40); tf->hob_lbam = (u8 )(block >> 32); tf->hob_lbal = (u8 )(block >> 24); } else { return (-34); } } tmp___3 = ata_rwcmd_protocol(tf, dev); tmp___4 = ldv__builtin_expect(tmp___3 < 0, 0L); if (tmp___4 != 0L) { return (-22); } else { } tf->nsect = (u8 )n_block; tf->lbah = (u8 )(block >> 16); tf->lbam = (u8 )(block >> 8); tf->lbal = (u8 )block; tf->device = (u8 )((unsigned int )tf->device | 64U); } else { tmp___5 = lba_28_ok(block, n_block); if (tmp___5) { tmp___6 = 0; } else { tmp___6 = 1; } if (tmp___6) { return (-34); } else { } tmp___7 = ata_rwcmd_protocol(tf, dev); tmp___8 = ldv__builtin_expect(tmp___7 < 0, 0L); if (tmp___8 != 0L) { return (-22); } else { } track = (unsigned int )block / (unsigned int )dev->sectors; cyl = track / (u32 )dev->heads; head = track % (u32 )dev->heads; sect = (unsigned int )block % (unsigned int )dev->sectors + 1U; if (((cyl >> 16 != 0U || head >> 4 != 0U) || sect >> 8 != 0U) || sect == 0U) { return (-34); } else { } tf->nsect = (u8 )n_block; tf->lbal = (u8 )sect; tf->lbam = (u8 )cyl; tf->lbah = (u8 )(cyl >> 8); tf->device = (int )tf->device | (int )((u8 )head); } return (0); } } unsigned long ata_pack_xfermask(unsigned long pio_mask , unsigned long mwdma_mask , unsigned long udma_mask ) { { return (((pio_mask & 127UL) | ((mwdma_mask << 7) & 3968UL)) | ((udma_mask << 12) & 1044480UL)); } } void ata_unpack_xfermask(unsigned long xfer_mask , unsigned long *pio_mask , unsigned long *mwdma_mask , unsigned long *udma_mask ) { { if ((unsigned long )pio_mask != (unsigned long )((unsigned long *)0UL)) { *pio_mask = xfer_mask & 127UL; } else { } if ((unsigned long )mwdma_mask != (unsigned long )((unsigned long *)0UL)) { *mwdma_mask = (xfer_mask & 3968UL) >> 7; } else { } if ((unsigned long )udma_mask != (unsigned long )((unsigned long *)0UL)) { *udma_mask = (xfer_mask & 1044480UL) >> 12; } else { } return; } } static struct ata_xfer_ent const ata_xfer_tbl[4U] = { {0, 7, 8U}, {7, 5, 32U}, {12, 8, 64U}, {-1, 0, (unsigned char)0}}; u8 ata_xfer_mask2mode(unsigned long xfer_mask ) { int highbit ; int tmp ; struct ata_xfer_ent const *ent ; { tmp = fls((int )xfer_mask); highbit = tmp + -1; ent = (struct ata_xfer_ent const *)(& ata_xfer_tbl); goto ldv_49254; ldv_49253: ; if ((int )ent->shift <= highbit && (int )ent->shift + (int )ent->bits > highbit) { return (((int )((u8 )ent->base) + (int )((u8 )highbit)) - (int )((u8 )ent->shift)); } else { } ent = ent + 1; ldv_49254: ; if ((int )ent->shift >= 0) { goto ldv_49253; } else { } return (255U); } } unsigned long ata_xfer_mode2mask(u8 xfer_mode ) { struct ata_xfer_ent const *ent ; { ent = (struct ata_xfer_ent const *)(& ata_xfer_tbl); goto ldv_49261; ldv_49260: ; if ((int )((unsigned char )ent->base) <= (int )xfer_mode && (int )xfer_mode < (int )ent->base + (int )ent->bits) { return ((unsigned long )(((2 << (((int )ent->shift + (int )xfer_mode) - (int )ent->base)) + -1) & - (1 << ent->shift))); } else { } ent = ent + 1; ldv_49261: ; if ((int )ent->shift >= 0) { goto ldv_49260; } else { } return (0UL); } } int ata_xfer_mode2shift(unsigned long xfer_mode ) { struct ata_xfer_ent const *ent ; { ent = (struct ata_xfer_ent const *)(& ata_xfer_tbl); goto ldv_49268; ldv_49267: ; if ((unsigned long )ent->base <= xfer_mode && (unsigned long )((int )ent->base + (int )ent->bits) > xfer_mode) { return ((int )ent->shift); } else { } ent = ent + 1; ldv_49268: ; if ((int )ent->shift >= 0) { goto ldv_49267; } else { } return (-1); } } char const *ata_mode_string(unsigned long xfer_mask ) { char const *xfer_mode_str[20U] ; int highbit ; int tmp ; { xfer_mode_str[0] = "PIO0"; xfer_mode_str[1] = "PIO1"; xfer_mode_str[2] = "PIO2"; xfer_mode_str[3] = "PIO3"; xfer_mode_str[4] = "PIO4"; xfer_mode_str[5] = "PIO5"; xfer_mode_str[6] = "PIO6"; xfer_mode_str[7] = "MWDMA0"; xfer_mode_str[8] = "MWDMA1"; xfer_mode_str[9] = "MWDMA2"; xfer_mode_str[10] = "MWDMA3"; xfer_mode_str[11] = "MWDMA4"; xfer_mode_str[12] = "UDMA/16"; xfer_mode_str[13] = "UDMA/25"; xfer_mode_str[14] = "UDMA/33"; xfer_mode_str[15] = "UDMA/44"; xfer_mode_str[16] = "UDMA/66"; xfer_mode_str[17] = "UDMA/100"; xfer_mode_str[18] = "UDMA/133"; xfer_mode_str[19] = "UDMA7"; tmp = fls((int )xfer_mask); highbit = tmp + -1; if (highbit >= 0 && (unsigned int )highbit <= 19U) { return (xfer_mode_str[highbit]); } else { } return (""); } } char const *sata_spd_string(unsigned int spd ) { char const *spd_str[3U] ; { spd_str[0] = "1.5 Gbps"; spd_str[1] = "3.0 Gbps"; spd_str[2] = "6.0 Gbps"; if (spd == 0U || spd - 1U > 2U) { return (""); } else { } return (spd_str[spd - 1U]); } } unsigned int ata_dev_classify(struct ata_taskfile const *tf ) { { if ((unsigned int )((unsigned char )tf->lbam) == 0U && (unsigned int )((unsigned char )tf->lbah) == 0U) { return (1U); } else { } if ((unsigned int )((unsigned char )tf->lbam) == 20U && (unsigned int )((unsigned char )tf->lbah) == 235U) { return (3U); } else { } if ((unsigned int )((unsigned char )tf->lbam) == 105U && (unsigned int )((unsigned char )tf->lbah) == 150U) { return (5U); } else { } if ((unsigned int )((unsigned char )tf->lbam) == 60U && (unsigned int )((unsigned char )tf->lbah) == 195U) { return (7U); } else { } if ((unsigned int )((unsigned char )tf->lbam) == 205U && (unsigned int )((unsigned char )tf->lbah) == 171U) { return (9U); } else { } return (0U); } } void ata_id_string(u16 const *id , unsigned char *s , unsigned int ofs , unsigned int len ) { unsigned int c ; long tmp ; { tmp = ldv__builtin_expect((long )((int )len) & 1L, 0L); if (tmp != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-core.c"), "i" (1124), "i" (12UL)); ldv_49293: ; goto ldv_49293; } else { } goto ldv_49295; ldv_49294: c = (unsigned int )((int )((unsigned short )*(id + (unsigned long )ofs)) >> 8); *s = (unsigned char )c; s = s + 1; c = (unsigned int )*(id + (unsigned long )ofs) & 255U; *s = (unsigned char )c; s = s + 1; ofs = ofs + 1U; len = len - 2U; ldv_49295: ; if (len != 0U) { goto ldv_49294; } else { } return; } } void ata_id_c_string(u16 const *id , unsigned char *s , unsigned int ofs , unsigned int len ) { unsigned char *p ; __kernel_size_t tmp ; { ata_id_string(id, s, ofs, len - 1U); tmp = strnlen((char const *)s, (__kernel_size_t )(len - 1U)); p = s + tmp; goto ldv_49305; ldv_49304: p = p - 1; ldv_49305: ; if ((unsigned long )p > (unsigned long )s && (unsigned int )*(p + 0xffffffffffffffffUL) == 32U) { goto ldv_49304; } else { } *p = 0U; return; } } static u64 ata_id_n_sectors(u16 const *id ) { bool tmp ; bool tmp___0 ; { if (((int )*(id + 49UL) & 512) != 0) { tmp = ata_id_has_lba48(id); if ((int )tmp) { return (((((unsigned long long )*(id + 103UL) << 48) | ((unsigned long long )*(id + 102UL) << 32)) | ((unsigned long long )*(id + 101UL) << 16)) | (unsigned long long )*(id + 100UL)); } else { return ((u64 )(((unsigned int )*(id + 61UL) << 16) | (unsigned int )*(id + 60UL))); } } else { tmp___0 = ata_id_current_chs_valid(id); if ((int )tmp___0) { return ((u64 )(((int )*(id + 54UL) * (int )*(id + 55UL)) * (int )*(id + 56UL))); } else { return ((u64 )(((int )*(id + 1UL) * (int )*(id + 3UL)) * (int )*(id + 6UL))); } } } } u64 ata_tf_to_lba48(struct ata_taskfile const *tf ) { u64 sectors ; { sectors = 0ULL; sectors = ((unsigned long long )tf->hob_lbah << 40) | sectors; sectors = ((unsigned long long )tf->hob_lbam << 32) | sectors; sectors = ((unsigned long long )tf->hob_lbal << 24) | sectors; sectors = (u64 )((int )tf->lbah << 16) | sectors; sectors = (u64 )((int )tf->lbam << 8) | sectors; sectors = (u64 )tf->lbal | sectors; return (sectors); } } u64 ata_tf_to_lba(struct ata_taskfile const *tf ) { u64 sectors ; { sectors = 0ULL; sectors = (u64 )(((int )tf->device & 15) << 24) | sectors; sectors = (u64 )((int )tf->lbah << 16) | sectors; sectors = (u64 )((int )tf->lbam << 8) | sectors; sectors = (u64 )tf->lbal | sectors; return (sectors); } } static int ata_read_native_max_address(struct ata_device *dev , u64 *max_sectors ) { unsigned int err_mask ; struct ata_taskfile tf ; int lba48 ; bool tmp ; u64 tmp___0 ; u64 tmp___1 ; { tmp = ata_id_has_lba48((u16 const *)(& dev->__annonCompField86.id)); lba48 = (int )tmp; ata_tf_init(dev, & tf); tf.flags = tf.flags | 6UL; if (lba48 != 0) { tf.command = 39U; tf.flags = tf.flags | 1UL; } else { tf.command = 248U; } tf.protocol = (u8 )((unsigned int )tf.protocol | 1U); tf.device = (u8 )((unsigned int )tf.device | 64U); err_mask = ata_exec_internal(dev, & tf, (u8 const *)0U, 3, (void *)0, 0U, 0UL); if (err_mask != 0U) { ata_dev_printk((struct ata_device const *)dev, "\f", "failed to read native max address (err_mask=0x%x)\n", err_mask); if (err_mask == 1U && ((int )tf.feature & 4) != 0) { return (-13); } else { } return (-5); } else { } if (lba48 != 0) { tmp___0 = ata_tf_to_lba48((struct ata_taskfile const *)(& tf)); *max_sectors = tmp___0 + 1ULL; } else { tmp___1 = ata_tf_to_lba((struct ata_taskfile const *)(& tf)); *max_sectors = tmp___1 + 1ULL; } if ((dev->horkage & 64U) != 0U) { *max_sectors = *max_sectors - 1ULL; } else { } return (0); } } static int ata_set_max_sectors(struct ata_device *dev , u64 new_sectors ) { unsigned int err_mask ; struct ata_taskfile tf ; int lba48 ; bool tmp ; { tmp = ata_id_has_lba48((u16 const *)(& dev->__annonCompField86.id)); lba48 = (int )tmp; new_sectors = new_sectors - 1ULL; ata_tf_init(dev, & tf); tf.flags = tf.flags | 6UL; if (lba48 != 0) { tf.command = 55U; tf.flags = tf.flags | 1UL; tf.hob_lbal = (u8 )(new_sectors >> 24); tf.hob_lbam = (u8 )(new_sectors >> 32); tf.hob_lbah = (u8 )(new_sectors >> 40); } else { tf.command = 249U; tf.device = (unsigned int )tf.device | ((unsigned int )((u8 )(new_sectors >> 24)) & 15U); } tf.protocol = (u8 )((unsigned int )tf.protocol | 1U); tf.device = (u8 )((unsigned int )tf.device | 64U); tf.lbal = (u8 )new_sectors; tf.lbam = (u8 )(new_sectors >> 8); tf.lbah = (u8 )(new_sectors >> 16); err_mask = ata_exec_internal(dev, & tf, (u8 const *)0U, 3, (void *)0, 0U, 0UL); if (err_mask != 0U) { ata_dev_printk((struct ata_device const *)dev, "\f", "failed to set max address (err_mask=0x%x)\n", err_mask); if (err_mask == 1U && ((int )tf.feature & 20) != 0) { return (-13); } else { } return (-5); } else { } return (0); } } static int ata_hpa_resize(struct ata_device *dev ) { struct ata_eh_context *ehc ; int print_info ; bool unlock_hpa ; u64 sectors ; u64 tmp ; u64 native_sectors ; int rc ; bool tmp___0 ; int tmp___1 ; u64 new_sectors ; u64 tmp___2 ; { ehc = & (dev->link)->eh_context; print_info = (int )ehc->i.flags & 262144; unlock_hpa = (bool )(ata_ignore_hpa != 0 || (dev->flags & 262144UL) != 0UL); tmp = ata_id_n_sectors((u16 const *)(& dev->__annonCompField86.id)); sectors = tmp; if ((dev->class != 1U && dev->class != 9U) || ((int )dev->__annonCompField86.id[49] & 512) == 0) { return (0); } else { tmp___0 = ata_id_hpa_enabled((u16 const *)(& dev->__annonCompField86.id)); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { return (0); } else if ((dev->horkage & 16U) != 0U) { return (0); } else { } } rc = ata_read_native_max_address(dev, & native_sectors); if (rc != 0) { if (rc == -13 || ! unlock_hpa) { ata_dev_printk((struct ata_device const *)dev, "\f", "HPA support seems broken, skipping HPA handling\n"); dev->horkage = dev->horkage | 16U; if (rc == -13) { rc = 0; } else { } } else { } return (rc); } else { } dev->n_native_sectors = native_sectors; if (native_sectors <= sectors || ! unlock_hpa) { if (print_info == 0 || native_sectors == sectors) { return (0); } else { } if (native_sectors > sectors) { ata_dev_printk((struct ata_device const *)dev, "\016", "HPA detected: current %llu, native %llu\n", sectors, native_sectors); } else if (native_sectors < sectors) { ata_dev_printk((struct ata_device const *)dev, "\f", "native sectors (%llu) is smaller than sectors (%llu)\n", native_sectors, sectors); } else { } return (0); } else { } rc = ata_set_max_sectors(dev, native_sectors); if (rc == -13) { ata_dev_printk((struct ata_device const *)dev, "\f", "device aborted resize (%llu -> %llu), skipping HPA handling\n", sectors, native_sectors); dev->horkage = dev->horkage | 16U; return (0); } else if (rc != 0) { return (rc); } else { } rc = ata_dev_reread_id(dev, 0U); if (rc != 0) { ata_dev_printk((struct ata_device const *)dev, "\v", "failed to re-read IDENTIFY data after HPA resizing\n"); return (rc); } else { } if (print_info != 0) { tmp___2 = ata_id_n_sectors((u16 const *)(& dev->__annonCompField86.id)); new_sectors = tmp___2; ata_dev_printk((struct ata_device const *)dev, "\016", "HPA unlocked: %llu -> %llu, native %llu\n", sectors, new_sectors, native_sectors); } else { } return (0); } } __inline static void ata_dump_id(u16 const *id ) { { return; } } unsigned long ata_id_xfermask(u16 const *id ) { unsigned long pio_mask ; unsigned long mwdma_mask ; unsigned long udma_mask ; u8 mode ; int pio ; int dma ; bool tmp ; unsigned long tmp___0 ; { if (((int )*(id + 53UL) & 2) != 0) { pio_mask = (unsigned long )*(id + 64UL) & 3UL; pio_mask = pio_mask << 3; pio_mask = pio_mask | 7UL; } else { mode = (u8 )((int )((unsigned short )*(id + 51UL)) >> 8); if ((unsigned int )mode <= 4U) { pio_mask = (unsigned long )((2 << (int )mode) + -1); } else { pio_mask = 1UL; } } mwdma_mask = (unsigned long )*(id + 63UL) & 7UL; tmp = ata_id_is_cfa(id); if ((int )tmp) { pio = (int )*(id + 163UL) & 7; dma = ((int )((unsigned short )*(id + 163UL)) >> 3) & 7; if (pio != 0) { pio_mask = pio_mask | 32UL; } else { } if (pio > 1) { pio_mask = pio_mask | 64UL; } else { } if (dma != 0) { mwdma_mask = mwdma_mask | 8UL; } else { } if (dma > 1) { mwdma_mask = mwdma_mask | 16UL; } else { } } else { } udma_mask = 0UL; if (((int )*(id + 53UL) & 4) != 0) { udma_mask = (unsigned long )*(id + 88UL) & 255UL; } else { } tmp___0 = ata_pack_xfermask(pio_mask, mwdma_mask, udma_mask); return (tmp___0); } } static void ata_qc_complete_internal(struct ata_queued_cmd *qc ) { struct completion *waiting ; { waiting = (struct completion *)qc->private_data; complete(waiting); return; } } unsigned int ata_exec_internal_sg(struct ata_device *dev , struct ata_taskfile *tf , u8 const *cdb , int dma_dir , struct scatterlist *sgl , unsigned int n_elem , unsigned long timeout ) { struct ata_link *link ; struct ata_port *ap ; u8 command ; int auto_timeout ; struct ata_queued_cmd *qc ; unsigned int tag ; unsigned int preempted_tag ; u32 preempted_sactive ; u32 preempted_qc_active ; int preempted_nr_active_links ; struct completion wait ; unsigned long flags ; unsigned int err_mask ; int rc ; raw_spinlock_t *tmp ; unsigned int i ; unsigned int buflen ; struct scatterlist *sg ; unsigned long tmp___0 ; unsigned long tmp___1 ; raw_spinlock_t *tmp___2 ; raw_spinlock_t *tmp___3 ; { link = dev->link; ap = link->ap; command = tf->command; auto_timeout = 0; init_completion(& wait); wait = wait; tmp = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp); if ((ap->pflags & 4U) != 0U) { spin_unlock_irqrestore(ap->lock, flags); return (64U); } else { } if ((unsigned long )(ap->ops)->error_handler != (unsigned long )((void (*)(struct ata_port * ))0)) { tag = 31U; } else { tag = 0U; } qc = __ata_qc_from_tag(ap, tag); qc->tag = tag; qc->scsicmd = (struct scsi_cmnd *)0; qc->ap = ap; qc->dev = dev; ata_qc_reinit(qc); preempted_tag = link->active_tag; preempted_sactive = link->sactive; preempted_qc_active = ap->qc_active; preempted_nr_active_links = ap->nr_active_links; link->active_tag = 4210818301U; link->sactive = 0U; ap->qc_active = 0U; ap->nr_active_links = 0; qc->tf = *tf; if ((unsigned long )cdb != (unsigned long )((u8 const *)0U)) { memcpy((void *)(& qc->cdb), (void const *)cdb, 16UL); } else { } if (((unsigned int )tf->protocol == 7U && (dev->flags & 1024UL) != 0UL) && dma_dir == 2) { qc->tf.feature = (u8 )((unsigned int )qc->tf.feature | 4U); } else { } qc->flags = qc->flags | 16UL; qc->dma_dir = dma_dir; if (dma_dir != 3) { buflen = 0U; i = 0U; sg = sgl; goto ldv_49389; ldv_49388: buflen = sg->length + buflen; i = i + 1U; sg = sg_next(sg); ldv_49389: ; if (i < n_elem) { goto ldv_49388; } else { } ata_sg_init(qc, sgl, n_elem); qc->nbytes = buflen; } else { } qc->private_data = (void *)(& wait); qc->complete_fn = & ata_qc_complete_internal; ata_qc_issue(qc); spin_unlock_irqrestore(ap->lock, flags); if (timeout == 0UL) { if (ata_probe_timeout != 0) { timeout = (unsigned long )(ata_probe_timeout * 1000); } else { timeout = ata_internal_cmd_timeout(dev, (int )command); auto_timeout = 1; } } else { } if ((unsigned long )(ap->ops)->error_handler != (unsigned long )((void (*)(struct ata_port * ))0)) { ata_eh_release(ap); } else { } tmp___0 = msecs_to_jiffies((unsigned int const )timeout); tmp___1 = wait_for_completion_timeout(& wait, tmp___0); rc = (int )tmp___1; if ((unsigned long )(ap->ops)->error_handler != (unsigned long )((void (*)(struct ata_port * ))0)) { ata_eh_acquire(ap); } else { } ata_sff_flush_pio_task(ap); if (rc == 0) { tmp___2 = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp___2); if ((int )qc->flags & 1) { qc->err_mask = qc->err_mask | 4U; if ((unsigned long )(ap->ops)->error_handler != (unsigned long )((void (*)(struct ata_port * ))0)) { ata_port_freeze(ap); } else { ata_qc_complete(qc); } if ((ap->msg_enable & 8U) != 0U) { ata_dev_printk((struct ata_device const *)dev, "\f", "qc timeout (cmd 0x%x)\n", (int )command); } else { } } else { } spin_unlock_irqrestore(ap->lock, flags); } else { } if ((unsigned long )(ap->ops)->post_internal_cmd != (unsigned long )((void (*)(struct ata_queued_cmd * ))0)) { (*((ap->ops)->post_internal_cmd))(qc); } else { } if ((qc->flags & 65536UL) != 0UL) { if (((int )qc->result_tf.command & 33) != 0) { qc->err_mask = qc->err_mask | 1U; } else { } if (qc->err_mask == 0U) { qc->err_mask = qc->err_mask | 256U; } else { } if ((qc->err_mask & 4294967039U) != 0U) { qc->err_mask = qc->err_mask & 4294967039U; } else { } } else { } tmp___3 = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp___3); *tf = qc->result_tf; err_mask = qc->err_mask; ata_qc_free(qc); link->active_tag = preempted_tag; link->sactive = preempted_sactive; ap->qc_active = preempted_qc_active; ap->nr_active_links = preempted_nr_active_links; spin_unlock_irqrestore(ap->lock, flags); if ((err_mask & 4U) != 0U && auto_timeout != 0) { ata_internal_cmd_timed_out(dev, (int )command); } else { } return (err_mask); } } unsigned int ata_exec_internal(struct ata_device *dev , struct ata_taskfile *tf , u8 const *cdb , int dma_dir , void *buf , unsigned int buflen , unsigned long timeout ) { struct scatterlist *psg ; struct scatterlist sg ; unsigned int n_elem ; int __ret_warn_on ; long tmp ; unsigned int tmp___0 ; { psg = (struct scatterlist *)0; n_elem = 0U; if (dma_dir != 3) { __ret_warn_on = (unsigned long )buf == (unsigned long )((void *)0); tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-core.c", 1745); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); sg_init_one(& sg, (void const *)buf, buflen); psg = & sg; n_elem = n_elem + 1U; } else { } tmp___0 = ata_exec_internal_sg(dev, tf, cdb, dma_dir, psg, n_elem, timeout); return (tmp___0); } } unsigned int ata_pio_need_iordy(struct ata_device const *adev ) { bool tmp ; { if ((((adev->link)->ap)->pflags & 256U) != 0U) { return (0U); } else { } if ((((adev->link)->ap)->flags & 65536UL) != 0UL) { return (0U); } else { } tmp = ata_id_is_cfa((u16 const *)(& adev->__annonCompField86.id)); if ((int )tmp && ((unsigned int )((unsigned char )adev->pio_mode) == 13U || (unsigned int )((unsigned char )adev->pio_mode) == 14U)) { return (0U); } else { } if ((unsigned int )((unsigned char )adev->pio_mode) > 10U) { return (1U); } else { } if (((int )adev->__annonCompField86.id[49] & 2048) != 0) { return (1U); } else { } return (0U); } } static u32 ata_pio_mask_no_iordy(struct ata_device const *adev ) { u16 pio ; { if (((int )adev->__annonCompField86.id[53] & 2) != 0) { pio = adev->__annonCompField86.id[67]; if ((unsigned int )pio != 0U) { if ((unsigned int )pio > 240U) { return (3U); } else { } return (7U); } else { } } else { } return (3U); } } unsigned int ata_do_dev_read_id(struct ata_device *dev , struct ata_taskfile *tf , u16 *id ) { unsigned int tmp ; { tmp = ata_exec_internal(dev, tf, (u8 const *)0U, 2, (void *)id, 512U, 0UL); return (tmp); } } int ata_dev_read_id(struct ata_device *dev , unsigned int *p_class , unsigned int flags , u16 *id ) { struct ata_port *ap ; unsigned int class ; struct ata_taskfile tf ; unsigned int err_mask ; char const *reason ; bool is_semb ; int may_fallback ; int tried_spinup ; int rc ; bool tmp ; int tmp___0 ; unsigned int tmp___1 ; { ap = (dev->link)->ap; class = *p_class; err_mask = 0U; is_semb = class == 7U; may_fallback = 1; tried_spinup = 0; if ((ap->msg_enable & 32U) != 0U) { ata_dev_printk((struct ata_device const *)dev, "\017", "%s: ENTER\n", "ata_dev_read_id"); } else { } retry: ata_tf_init(dev, & tf); switch (class) { case 7U: class = 1U; case 1U: ; case 9U: tf.command = 236U; goto ldv_49443; case 3U: tf.command = 161U; goto ldv_49443; default: rc = -19; reason = "unsupported class"; goto err_out; } ldv_49443: tf.protocol = 2U; tf.flags = tf.flags | 6UL; tf.flags = tf.flags | 64UL; if ((unsigned long )(ap->ops)->read_id != (unsigned long )((unsigned int (*)(struct ata_device * , struct ata_taskfile * , u16 * ))0)) { err_mask = (*((ap->ops)->read_id))(dev, & tf, id); } else { err_mask = ata_do_dev_read_id(dev, & tf, id); } if (err_mask != 0U) { if ((err_mask & 512U) != 0U) { ata_dev_printk((struct ata_device const *)dev, "\017", "NODEV after polling detection\n"); return (-2); } else { } if ((int )is_semb) { ata_dev_printk((struct ata_device const *)dev, "\016", "IDENTIFY failed on device w/ SEMB sig, disabled\n"); *p_class = 8U; return (0); } else { } if (err_mask == 1U && ((int )tf.feature & 4) != 0) { if (may_fallback != 0) { may_fallback = 0; if (class == 1U) { class = 3U; } else { class = 1U; } goto retry; } else { } ata_dev_printk((struct ata_device const *)dev, "\017", "both IDENTIFYs aborted, assuming NODEV\n"); return (-2); } else { } rc = -5; reason = "I/O error"; goto err_out; } else { } if ((dev->horkage & 65536U) != 0U) { ata_dev_printk((struct ata_device const *)dev, "\017", "dumping IDENTIFY data, class=%d may_fallback=%d tried_spinup=%d\n", class, may_fallback, tried_spinup); print_hex_dump("\017", "", 2, 16, 2, (void const *)id, 512UL, 1); } else { } may_fallback = 0; swap_buf_le16(id, 256U); rc = -22; reason = "device reports invalid type"; if (class == 1U || class == 9U) { if ((int )((short )*id) < 0) { tmp = ata_id_is_cfa((u16 const *)id); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { goto err_out; } else { } } else { } if (((ap->host)->flags & 8UL) != 0UL && (int )((short )*id) >= 0) { ata_dev_printk((struct ata_device const *)dev, "\017", "host indicates ignore ATA devices, ignored\n"); return (-2); } else { } } else if ((int )((short )*id) >= 0) { goto err_out; } else { } if (tried_spinup == 0 && ((unsigned int )*(id + 2UL) == 14280U || (unsigned int )*(id + 2UL) == 29580U)) { tried_spinup = 1; err_mask = ata_dev_set_feature(dev, 7, 0); if (err_mask != 0U && (unsigned int )*(id + 2UL) != 29580U) { rc = -5; reason = "SPINUP failed"; goto err_out; } else { } if ((unsigned int )*(id + 2UL) == 14280U) { goto retry; } else { } } else { } if ((int )flags & 1 && (class == 1U || class == 9U)) { tmp___1 = ata_id_major_version((u16 const *)id); if (tmp___1 <= 3U || ((int )*(id + 49UL) & 512) == 0) { err_mask = ata_dev_init_params(dev, (int )*(id + 3UL), (int )*(id + 6UL)); if (err_mask != 0U) { rc = -5; reason = "INIT_DEV_PARAMS failed"; goto err_out; } else { } flags = flags & 4294967294U; goto retry; } else { } } else { } *p_class = class; return (0); err_out: ; if ((ap->msg_enable & 8U) != 0U) { ata_dev_printk((struct ata_device const *)dev, "\f", "failed to IDENTIFY (%s, err_mask=0x%x)\n", reason, err_mask); } else { } return (rc); } } static int ata_do_link_spd_horkage(struct ata_device *dev ) { struct ata_link *plink ; struct ata_link *tmp ; u32 target ; u32 target_limit ; int tmp___0 ; char const *tmp___1 ; { tmp = ata_dev_phys_link(dev); plink = tmp; tmp___0 = sata_scr_valid(plink); if (tmp___0 == 0) { return (0); } else { } if ((dev->horkage & 8192U) != 0U) { target = 1U; } else { return (0); } target_limit = (u32 )((1 << (int )target) + -1); if (plink->sata_spd_limit <= target_limit) { return (0); } else { } plink->sata_spd_limit = target_limit; if (plink->sata_spd > target) { tmp___1 = sata_spd_string(target); ata_dev_printk((struct ata_device const *)dev, "\016", "applying link speed limit horkage to %s\n", tmp___1); return (-11); } else { } return (0); } } __inline static u8 ata_dev_knobble(struct ata_device *dev ) { struct ata_port *ap ; unsigned long tmp ; bool tmp___0 ; int tmp___1 ; int tmp___2 ; { ap = (dev->link)->ap; tmp = ata_dev_blacklisted((struct ata_device const *)dev); if ((tmp & 1024UL) != 0UL) { return (0U); } else { } if (ap->cbl == 6U) { tmp___0 = ata_id_is_sata((u16 const *)(& dev->__annonCompField86.id)); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { tmp___2 = 1; } else { tmp___2 = 0; } } else { tmp___2 = 0; } return ((u8 )tmp___2); } } static int ata_dev_config_ncq(struct ata_device *dev , char *desc , size_t desc_sz ) { struct ata_port *ap ; int hdepth ; int ddepth ; unsigned int err_mask ; char *aa_desc ; int _min1 ; int _min2 ; u8 *cmds ; bool tmp ; { ap = (dev->link)->ap; hdepth = 0; ddepth = ((int )dev->__annonCompField86.id[75] & 31) + 1; aa_desc = (char *)""; if (((int )dev->__annonCompField86.id[76] & 256) == 0) { *desc = 0; return (0); } else { } if ((dev->horkage & 4U) != 0U) { snprintf(desc, desc_sz, "NCQ (not used)"); return (0); } else { } if ((ap->flags & 1024UL) != 0UL) { _min1 = (ap->scsi_host)->can_queue; _min2 = 31; hdepth = _min1 < _min2 ? _min1 : _min2; dev->flags = dev->flags | 8UL; } else { } if (((dev->horkage & 32768U) == 0U && (ap->flags & 16384UL) != 0UL) && (((unsigned int )dev->__annonCompField86.id[76] != 0U && (unsigned int )dev->__annonCompField86.id[76] != 65535U) && ((int )dev->__annonCompField86.id[78] & 4) != 0)) { err_mask = ata_dev_set_feature(dev, 16, 2); if (err_mask != 0U) { ata_dev_printk((struct ata_device const *)dev, "\v", "failed to enable AA (error_mask=0x%x)\n", err_mask); if (err_mask != 1U) { dev->horkage = dev->horkage | 32768U; return (-5); } else { } } else { aa_desc = (char *)", AA"; } } else { } if (hdepth >= ddepth) { snprintf(desc, desc_sz, "NCQ (depth %d)%s", ddepth, aa_desc); } else { snprintf(desc, desc_sz, "NCQ (depth %d/%d)%s", hdepth, ddepth, aa_desc); } if ((ap->flags & 1048576UL) != 0UL) { tmp = ata_id_has_ncq_send_and_recv((u16 const *)(& dev->__annonCompField86.id)); if ((int )tmp) { err_mask = ata_read_log_page(dev, 19, 0, (void *)(& ap->sector_buf), 1U); if (err_mask != 0U) { ata_dev_printk((struct ata_device const *)dev, "\017", "failed to get NCQ Send/Recv Log Emask 0x%x\n", err_mask); } else { cmds = (u8 *)(& dev->ncq_send_recv_cmds); dev->flags = dev->flags | 524288UL; memcpy((void *)cmds, (void const *)(& ap->sector_buf), 16UL); if ((dev->horkage & 524288U) != 0U) { ata_dev_printk((struct ata_device const *)dev, "\017", "disabling queued TRIM support\n"); *(cmds + 4UL) = (unsigned int )*(cmds + 4UL) & 254U; } else { } } } else { } } else { } return (0); } } static void ata_dev_config_sense_reporting(struct ata_device *dev ) { unsigned int err_mask ; bool tmp ; int tmp___0 ; bool tmp___1 ; { tmp = ata_id_has_sense_reporting((u16 const *)(& dev->__annonCompField86.id)); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { return; } else { } tmp___1 = ata_id_sense_reporting_enabled((u16 const *)(& dev->__annonCompField86.id)); if ((int )tmp___1) { return; } else { } err_mask = ata_dev_set_feature(dev, 195, 1); if (err_mask != 0U) { ata_dev_printk((struct ata_device const *)dev, "\017", "failed to enable Sense Data Reporting, Emask 0x%x\n", err_mask); } else { } return; } } int ata_dev_configure(struct ata_device *dev ) { struct ata_port *ap ; struct ata_eh_context *ehc ; int print_info ; u16 const *id ; unsigned long xfer_mask ; unsigned int err_mask ; char revbuf[7U] ; char fwrevbuf[9U] ; char modelbuf[41U] ; int rc ; unsigned int tmp ; unsigned long tmp___0 ; unsigned int tmp___1 ; bool tmp___2 ; bool tmp___3 ; unsigned int max ; unsigned int cnt ; bool tmp___4 ; bool tmp___5 ; char const *lba_desc ; char ncq_desc[24U] ; bool tmp___6 ; bool tmp___7 ; char const *tmp___8 ; bool tmp___9 ; char const *tmp___10 ; u8 *sata_setting ; int i ; int j ; char const *cdb_intr_string ; char const *atapi_an_string ; char const *dma_dir_string ; u32 sntf ; bool tmp___11 ; int tmp___12 ; int tmp___13 ; bool tmp___14 ; char const *tmp___15 ; u8 tmp___16 ; int tmp___17 ; unsigned int __min1 ; unsigned int __min2 ; { ap = (dev->link)->ap; ehc = & (dev->link)->eh_context; print_info = (int )ehc->i.flags & 262144; id = (u16 const *)(& dev->__annonCompField86.id); tmp = ata_dev_enabled((struct ata_device const *)dev); if (tmp == 0U && (ap->msg_enable & 2U) != 0U) { ata_dev_printk((struct ata_device const *)dev, "\016", "%s: ENTER/EXIT -- nodev\n", "ata_dev_configure"); return (0); } else { } if ((ap->msg_enable & 4U) != 0U) { ata_dev_printk((struct ata_device const *)dev, "\017", "%s: ENTER\n", "ata_dev_configure"); } else { } tmp___0 = ata_dev_blacklisted((struct ata_device const *)dev); dev->horkage = dev->horkage | (unsigned int )tmp___0; ata_force_horkage(dev); if ((dev->horkage & 32U) != 0U) { ata_dev_printk((struct ata_device const *)dev, "\016", "unsupported device, disabling\n"); ata_dev_disable(dev); return (0); } else { } if ((atapi_enabled == 0 || (ap->flags & 64UL) != 0UL) && dev->class == 3U) { ata_dev_printk((struct ata_device const *)dev, "\f", "WARNING: ATAPI is %s, device ignored\n", atapi_enabled != 0 ? (char *)"not supported with this driver" : (char *)"disabled"); ata_dev_disable(dev); return (0); } else { } rc = ata_do_link_spd_horkage(dev); if (rc != 0) { return (rc); } else { } if ((dev->horkage & 2097152U) != 0U && ((int )*(id + 76UL) & 14) == 2) { dev->horkage = dev->horkage | 1048576U; } else { } if ((dev->horkage & 1048576U) != 0U) { ata_dev_printk((struct ata_device const *)dev, "\f", "LPM support broken, forcing max_power\n"); ((dev->link)->ap)->target_lpm_policy = 1; } else { } rc = ata_acpi_on_devcfg(dev); if (rc != 0) { return (rc); } else { } rc = ata_hpa_resize(dev); if (rc != 0) { return (rc); } else { } if ((ap->msg_enable & 4U) != 0U) { ata_dev_printk((struct ata_device const *)dev, "\017", "%s: cfg 49:%04x 82:%04x 83:%04x 84:%04x 85:%04x 86:%04x 87:%04x 88:%04x\n", "ata_dev_configure", (int )*(id + 49UL), (int )*(id + 82UL), (int )*(id + 83UL), (int )*(id + 84UL), (int )*(id + 85UL), (int )*(id + 86UL), (int )*(id + 87UL), (int )*(id + 88UL)); } else { } dev->flags = dev->flags & 0xfffffffffffff000UL; dev->max_sectors = 0U; dev->cdb_len = 0U; dev->n_sectors = 0ULL; dev->cylinders = 0U; dev->heads = 0U; dev->sectors = 0U; dev->multi_count = 0U; xfer_mask = ata_id_xfermask(id); if ((ap->msg_enable & 4U) != 0U) { ata_dump_id(id); } else { } ata_id_c_string((u16 const *)(& dev->__annonCompField86.id), (unsigned char *)(& fwrevbuf), 23U, 9U); ata_id_c_string((u16 const *)(& dev->__annonCompField86.id), (unsigned char *)(& modelbuf), 27U, 41U); if (dev->class == 1U || dev->class == 9U) { tmp___3 = ata_id_is_cfa(id); if ((int )tmp___3) { if ((int )*(id + 162UL) & 1) { ata_dev_printk((struct ata_device const *)dev, "\f", "supports DRM functions and may not be fully accessible\n"); } else { } snprintf((char *)(& revbuf), 7UL, "CFA"); } else { tmp___1 = ata_id_major_version(id); snprintf((char *)(& revbuf), 7UL, "ATA-%d", tmp___1); tmp___2 = ata_id_has_tpm(id); if ((int )tmp___2) { ata_dev_printk((struct ata_device const *)dev, "\f", "supports DRM functions and may not be fully accessible\n"); } else { } } dev->n_sectors = ata_id_n_sectors(id); if ((unsigned int )((int )dev->__annonCompField86.id[47] >> 8) == 128U && ((int )dev->__annonCompField86.id[59] & 256) != 0) { max = (unsigned int )dev->__annonCompField86.id[47] & 255U; cnt = (unsigned int )dev->__annonCompField86.id[59] & 255U; tmp___4 = is_power_of_2((unsigned long )max); if ((int )tmp___4) { tmp___5 = is_power_of_2((unsigned long )cnt); if ((int )tmp___5) { if (cnt <= max) { dev->multi_count = cnt; } else { } } else { } } else { } } else { } if (((int )*(id + 49UL) & 512) != 0) { lba_desc = "LBA"; dev->flags = dev->flags | 1UL; tmp___7 = ata_id_has_lba48(id); if ((int )tmp___7) { dev->flags = dev->flags | 2UL; lba_desc = "LBA48"; if (dev->n_sectors > 268435455ULL) { tmp___6 = ata_id_has_flush_ext(id); if ((int )tmp___6) { dev->flags = dev->flags | 16UL; } else { } } else { } } else { } rc = ata_dev_config_ncq(dev, (char *)(& ncq_desc), 24UL); if (rc != 0) { return (rc); } else { } if ((int )ap->msg_enable & 1 && print_info != 0) { tmp___8 = ata_mode_string(xfer_mask); ata_dev_printk((struct ata_device const *)dev, "\016", "%s: %s, %s, max %s\n", (char *)(& revbuf), (char *)(& modelbuf), (char *)(& fwrevbuf), tmp___8); ata_dev_printk((struct ata_device const *)dev, "\016", "%llu sectors, multi %u: %s %s\n", dev->n_sectors, dev->multi_count, lba_desc, (char *)(& ncq_desc)); } else { } } else { dev->cylinders = *(id + 1UL); dev->heads = *(id + 3UL); dev->sectors = *(id + 6UL); tmp___9 = ata_id_current_chs_valid(id); if ((int )tmp___9) { dev->cylinders = *(id + 54UL); dev->heads = *(id + 55UL); dev->sectors = *(id + 56UL); } else { } if ((int )ap->msg_enable & 1 && print_info != 0) { tmp___10 = ata_mode_string(xfer_mask); ata_dev_printk((struct ata_device const *)dev, "\016", "%s: %s, %s, max %s\n", (char *)(& revbuf), (char *)(& modelbuf), (char *)(& fwrevbuf), tmp___10); ata_dev_printk((struct ata_device const *)dev, "\016", "%llu sectors, multi %u, CHS %u/%u/%u\n", dev->n_sectors, dev->multi_count, (int )dev->cylinders, (int )dev->heads, (int )dev->sectors); } else { } } if (((int )dev->__annonCompField86.id[78] & 256) != 0) { sata_setting = (u8 *)(& ap->sector_buf); dev->flags = dev->flags | 134217728UL; err_mask = ata_read_log_page(dev, 48, 8, (void *)sata_setting, 1U); if (err_mask != 0U) { ata_dev_printk((struct ata_device const *)dev, "\017", "failed to get Identify Device Data, Emask 0x%x\n", err_mask); } else { i = 0; goto ldv_49497; ldv_49496: j = i + 48; dev->devslp_timing[i] = *(sata_setting + (unsigned long )j); i = i + 1; ldv_49497: ; if (i <= 7) { goto ldv_49496; } else { } } } else { } ata_dev_config_sense_reporting(dev); dev->cdb_len = 16U; } else if (dev->class == 3U) { cdb_intr_string = ""; atapi_an_string = ""; dma_dir_string = ""; rc = atapi_cdb_len(id); if (rc <= 11 || rc > 16) { if ((ap->msg_enable & 8U) != 0U) { ata_dev_printk((struct ata_device const *)dev, "\f", "unsupported CDB len\n"); } else { } rc = -22; goto err_out_nosup; } else { } dev->cdb_len = (unsigned int )rc; if ((atapi_an != 0 && (ap->flags & 262144UL) != 0UL) && (((unsigned int )((unsigned short )*(id + 76UL)) != 0U && (unsigned int )((unsigned short )*(id + 76UL)) != 65535U) && ((int )*(id + 78UL) & 32) != 0)) { tmp___11 = sata_pmp_attached(ap); if (tmp___11) { tmp___12 = 0; } else { tmp___12 = 1; } if (tmp___12) { goto _L; } else { tmp___13 = sata_scr_read(& ap->link, 4, & sntf); if (tmp___13 == 0) { _L: /* CIL Label */ err_mask = ata_dev_set_feature(dev, 16, 5); if (err_mask != 0U) { ata_dev_printk((struct ata_device const *)dev, "\v", "failed to enable ATAPI AN (err_mask=0x%x)\n", err_mask); } else { dev->flags = dev->flags | 128UL; atapi_an_string = ", ATAPI AN"; } } else { } } } else { } if (((int )dev->__annonCompField86.id[0] & 96) == 32) { dev->flags = dev->flags | 4UL; cdb_intr_string = ", CDB intr"; } else { } if (atapi_dmadir != 0 || (dev->horkage & 262144U) != 0U) { dev->flags = dev->flags | 1024UL; dma_dir_string = ", DMADIR"; } else { tmp___14 = atapi_id_dmadir((u16 const *)(& dev->__annonCompField86.id)); if ((int )tmp___14) { dev->flags = dev->flags | 1024UL; dma_dir_string = ", DMADIR"; } else { } } if (((int )dev->__annonCompField86.id[77] & 16) != 0) { dev->flags = dev->flags | 67108864UL; zpodd_init(dev); } else { } if ((int )ap->msg_enable & 1 && print_info != 0) { tmp___15 = ata_mode_string(xfer_mask); ata_dev_printk((struct ata_device const *)dev, "\016", "ATAPI: %s, %s, max %s%s%s%s\n", (char *)(& modelbuf), (char *)(& fwrevbuf), tmp___15, cdb_intr_string, atapi_an_string, dma_dir_string); } else { } } else { } dev->max_sectors = 256U; if ((dev->flags & 2UL) != 0UL) { dev->max_sectors = 65535U; } else { } tmp___16 = ata_dev_knobble(dev); if ((unsigned int )tmp___16 != 0U) { if ((int )ap->msg_enable & 1 && print_info != 0) { ata_dev_printk((struct ata_device const *)dev, "\016", "applying bridge limits\n"); } else { } dev->udma_mask = dev->udma_mask & 63UL; dev->max_sectors = 256U; } else { } if (dev->class == 3U) { tmp___17 = atapi_command_packet_set(id); if (tmp___17 == 1) { dev->max_sectors = 65535U; dev->horkage = dev->horkage | 512U; } else { } } else { } if ((dev->horkage & 8U) != 0U) { __min1 = 128U; __min2 = dev->max_sectors; dev->max_sectors = __min1 < __min2 ? __min1 : __min2; } else { } if ((dev->horkage & 131072U) != 0U) { dev->max_sectors = 65535U; } else { } if ((unsigned long )(ap->ops)->dev_config != (unsigned long )((void (*)(struct ata_device * ))0)) { (*((ap->ops)->dev_config))(dev); } else { } if ((int )dev->horkage & 1) { if (print_info != 0) { ata_dev_printk((struct ata_device const *)dev, "\f", "Drive reports diagnostics failure. This may indicate a drive\n"); ata_dev_printk((struct ata_device const *)dev, "\f", "fault or invalid emulation. Contact drive vendor for information.\n"); } else { } } else { } if ((dev->horkage & 4096U) != 0U && print_info != 0) { ata_dev_printk((struct ata_device const *)dev, "\f", "WARNING: device requires firmware update to be fully functional\n"); ata_dev_printk((struct ata_device const *)dev, "\f", " contact the vendor or visit http://ata.wiki.kernel.org\n"); } else { } return (0); err_out_nosup: ; if ((ap->msg_enable & 4U) != 0U) { ata_dev_printk((struct ata_device const *)dev, "\017", "%s: EXIT, err\n", "ata_dev_configure"); } else { } return (rc); } } int ata_cable_40wire(struct ata_port *ap ) { { return (1); } } int ata_cable_80wire(struct ata_port *ap ) { { return (2); } } int ata_cable_unknown(struct ata_port *ap ) { { return (4); } } int ata_cable_ignore(struct ata_port *ap ) { { return (5); } } int ata_cable_sata(struct ata_port *ap ) { { return (6); } } int ata_bus_probe(struct ata_port *ap ) { unsigned int classes[2U] ; int tries[2U] ; int rc ; struct ata_device *dev ; unsigned int tmp ; int tmp___0 ; bool tmp___1 ; int _min1 ; int _min2 ; { dev = ata_dev_next((struct ata_device *)0, & ap->link, 2); goto ldv_49530; ldv_49529: tries[dev->devno] = 3; dev = ata_dev_next(dev, & ap->link, 2); ldv_49530: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_49529; } else { } retry: dev = ata_dev_next((struct ata_device *)0, & ap->link, 2); goto ldv_49534; ldv_49533: dev->pio_mode = 8U; dev->dma_mode = 255U; if ((unsigned long )(ap->ops)->set_piomode != (unsigned long )((void (*)(struct ata_port * , struct ata_device * ))0)) { (*((ap->ops)->set_piomode))(ap, dev); } else { } dev = ata_dev_next(dev, & ap->link, 2); ldv_49534: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_49533; } else { } (*((ap->ops)->phy_reset))(ap); dev = ata_dev_next((struct ata_device *)0, & ap->link, 2); goto ldv_49537; ldv_49536: ; if (dev->class != 0U) { classes[dev->devno] = dev->class; } else { classes[dev->devno] = 10U; } dev->class = 0U; dev = ata_dev_next(dev, & ap->link, 2); ldv_49537: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_49536; } else { } dev = ata_dev_next((struct ata_device *)0, & ap->link, 3); goto ldv_49542; ldv_49541: ; if (tries[dev->devno] != 0) { dev->class = classes[dev->devno]; } else { } tmp = ata_dev_enabled((struct ata_device const *)dev); if (tmp == 0U) { goto ldv_49539; } else { } rc = ata_dev_read_id(dev, & dev->class, 1U, (u16 *)(& dev->__annonCompField86.id)); if (rc != 0) { goto fail; } else { } ldv_49539: dev = ata_dev_next(dev, & ap->link, 3); ldv_49542: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_49541; } else { } if ((unsigned long )(ap->ops)->cable_detect != (unsigned long )((int (*)(struct ata_port * ))0)) { tmp___0 = (*((ap->ops)->cable_detect))(ap); ap->cbl = (unsigned int )tmp___0; } else { } dev = ata_dev_next((struct ata_device *)0, & ap->link, 0); goto ldv_49545; ldv_49544: tmp___1 = ata_id_is_sata((u16 const *)(& dev->__annonCompField86.id)); if ((int )tmp___1) { ap->cbl = 6U; } else { } dev = ata_dev_next(dev, & ap->link, 0); ldv_49545: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_49544; } else { } dev = ata_dev_next((struct ata_device *)0, & ap->link, 0); goto ldv_49548; ldv_49547: ap->link.eh_context.i.flags = ap->link.eh_context.i.flags | 262144U; rc = ata_dev_configure(dev); ap->link.eh_context.i.flags = ap->link.eh_context.i.flags & 4294705151U; if (rc != 0) { goto fail; } else { } dev = ata_dev_next(dev, & ap->link, 0); ldv_49548: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_49547; } else { } rc = ata_set_mode(& ap->link, & dev); if (rc != 0) { goto fail; } else { } dev = ata_dev_next((struct ata_device *)0, & ap->link, 0); goto ldv_49551; ldv_49550: ; return (0); dev = ata_dev_next(dev, & ap->link, 0); ldv_49551: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_49550; } else { } return (-19); fail: tries[dev->devno] = tries[dev->devno] - 1; switch (rc) { case -22: tries[dev->devno] = 0; goto ldv_49554; case -19: _min1 = tries[dev->devno]; _min2 = 1; tries[dev->devno] = _min1 < _min2 ? _min1 : _min2; case -5: ; if (tries[dev->devno] == 1) { sata_down_spd_limit(& ap->link, 0U); ata_down_xfermask_limit(dev, 0U); } else { } } ldv_49554: ; if (tries[dev->devno] == 0) { ata_dev_disable(dev); } else { } goto retry; } } static void sata_print_link_status(struct ata_link *link ) { u32 sstatus ; u32 scontrol ; u32 tmp ; int tmp___0 ; char const *tmp___1 ; bool tmp___2 ; { tmp___0 = sata_scr_read(link, 0, & sstatus); if (tmp___0 != 0) { return; } else { } sata_scr_read(link, 2, & scontrol); tmp___2 = ata_phys_link_online(link); if ((int )tmp___2) { tmp = (sstatus >> 4) & 15U; tmp___1 = sata_spd_string(tmp); ata_link_printk((struct ata_link const *)link, "\016", "SATA link up %s (SStatus %X SControl %X)\n", tmp___1, sstatus, scontrol); } else { ata_link_printk((struct ata_link const *)link, "\016", "SATA link down (SStatus %X SControl %X)\n", sstatus, scontrol); } return; } } struct ata_device *ata_dev_pair(struct ata_device *adev ) { struct ata_link *link ; struct ata_device *pair ; unsigned int tmp ; { link = adev->link; pair = (struct ata_device *)(& link->device) + (unsigned long )(1U - adev->devno); tmp = ata_dev_enabled((struct ata_device const *)pair); if (tmp == 0U) { return ((struct ata_device *)0); } else { } return (pair); } } int sata_down_spd_limit(struct ata_link *link , u32 spd_limit ) { u32 sstatus ; u32 spd ; u32 mask ; int rc ; int bit ; int tmp ; bool tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; char const *tmp___4 ; { tmp = sata_scr_valid(link); if (tmp == 0) { return (-95); } else { } rc = sata_scr_read(link, 0, & sstatus); if (rc == 0) { tmp___0 = ata_sstatus_online(sstatus); if ((int )tmp___0) { spd = (sstatus >> 4) & 15U; } else { spd = link->sata_spd; } } else { spd = link->sata_spd; } mask = link->sata_spd_limit; if (mask <= 1U) { return (-22); } else { } tmp___1 = fls((int )mask); bit = tmp___1 + -1; mask = (u32 )(~ (1 << bit)) & mask; if (spd > 1U) { mask = (u32 )((1 << (int )(spd - 1U)) + -1) & mask; } else { mask = mask & 1U; } if (mask == 0U) { return (-22); } else { } if (spd_limit != 0U) { if (((u32 )((1 << (int )spd_limit) + -1) & mask) != 0U) { mask = (u32 )((1 << (int )spd_limit) + -1) & mask; } else { tmp___2 = ffs((int )mask); bit = tmp___2 + -1; mask = (u32 )(1 << bit); } } else { } link->sata_spd_limit = mask; tmp___3 = fls((int )mask); tmp___4 = sata_spd_string((unsigned int )tmp___3); ata_link_printk((struct ata_link const *)link, "\f", "limiting SATA link speed to %s\n", tmp___4); return (0); } } static int __sata_set_spd_needed(struct ata_link *link , u32 *scontrol ) { struct ata_link *host_link ; u32 limit ; u32 target ; u32 spd ; int tmp ; int tmp___0 ; { host_link = & (link->ap)->link; limit = link->sata_spd_limit; tmp = ata_is_host_link((struct ata_link const *)link); if (tmp == 0 && host_link->sata_spd != 0U) { limit = (u32 )((1 << (int )host_link->sata_spd) + -1) & limit; } else { } if (limit == 4294967295U) { target = 0U; } else { tmp___0 = fls((int )limit); target = (u32 )tmp___0; } spd = (*scontrol >> 4) & 15U; *scontrol = (*scontrol & 4294967055U) | ((target << 4) & 255U); return (spd != target); } } static int sata_set_spd_needed(struct ata_link *link ) { u32 scontrol ; int tmp ; int tmp___0 ; { tmp = sata_scr_read(link, 2, & scontrol); if (tmp != 0) { return (1); } else { } tmp___0 = __sata_set_spd_needed(link, & scontrol); return (tmp___0); } } int sata_set_spd(struct ata_link *link ) { u32 scontrol ; int rc ; int tmp ; { rc = sata_scr_read(link, 2, & scontrol); if (rc != 0) { return (rc); } else { } tmp = __sata_set_spd_needed(link, & scontrol); if (tmp == 0) { return (0); } else { } rc = sata_scr_write(link, 2, scontrol); if (rc != 0) { return (rc); } else { } return (1); } } static struct ata_timing const ata_timing[23U] = { {8U, 70U, 290U, 240U, 600U, 165U, 150U, 0U, 600U, 0U}, {9U, 50U, 290U, 93U, 383U, 125U, 100U, 0U, 383U, 0U}, {10U, 30U, 290U, 40U, 330U, 100U, 90U, 0U, 240U, 0U}, {11U, 30U, 80U, 70U, 180U, 80U, 70U, 0U, 180U, 0U}, {12U, 25U, 70U, 25U, 120U, 70U, 25U, 0U, 120U, 0U}, {13U, 15U, 65U, 25U, 100U, 65U, 25U, 0U, 100U, 0U}, {14U, 10U, 55U, 20U, 80U, 55U, 20U, 0U, 80U, 0U}, {16U, 120U, 0U, 0U, 0U, 480U, 480U, 50U, 960U, 0U}, {17U, 90U, 0U, 0U, 0U, 240U, 240U, 30U, 480U, 0U}, {18U, 60U, 0U, 0U, 0U, 120U, 120U, 20U, 240U, 0U}, {32U, 60U, 0U, 0U, 0U, 215U, 215U, 20U, 480U, 0U}, {33U, 45U, 0U, 0U, 0U, 80U, 50U, 5U, 150U, 0U}, {34U, 25U, 0U, 0U, 0U, 70U, 25U, 5U, 120U, 0U}, {35U, 25U, 0U, 0U, 0U, 65U, 25U, 5U, 100U, 0U}, {36U, 25U, 0U, 0U, 0U, 55U, 20U, 5U, 80U, 0U}, {64U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 120U}, {65U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 80U}, {66U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 60U}, {67U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 45U}, {68U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 30U}, {69U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 20U}, {70U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 15U}, {255U, (unsigned short)0, (unsigned short)0, (unsigned short)0, (unsigned short)0, (unsigned short)0, (unsigned short)0, (unsigned short)0, (unsigned short)0, (unsigned short)0}}; static void ata_timing_quantize(struct ata_timing const *t , struct ata_timing *q , int T , int UT ) { { q->setup = (int )t->setup * 1000 != 0 ? (unsigned int )((unsigned short )(((int )t->setup * 1000 + -1) / T)) + 1U : 0U; q->act8b = (int )t->act8b * 1000 != 0 ? (unsigned int )((unsigned short )(((int )t->act8b * 1000 + -1) / T)) + 1U : 0U; q->rec8b = (int )t->rec8b * 1000 != 0 ? (unsigned int )((unsigned short )(((int )t->rec8b * 1000 + -1) / T)) + 1U : 0U; q->cyc8b = (int )t->cyc8b * 1000 != 0 ? (unsigned int )((unsigned short )(((int )t->cyc8b * 1000 + -1) / T)) + 1U : 0U; q->active = (int )t->active * 1000 != 0 ? (unsigned int )((unsigned short )(((int )t->active * 1000 + -1) / T)) + 1U : 0U; q->recover = (int )t->recover * 1000 != 0 ? (unsigned int )((unsigned short )(((int )t->recover * 1000 + -1) / T)) + 1U : 0U; q->dmack_hold = (int )t->dmack_hold * 1000 != 0 ? (unsigned int )((unsigned short )(((int )t->dmack_hold * 1000 + -1) / T)) + 1U : 0U; q->cycle = (int )t->cycle * 1000 != 0 ? (unsigned int )((unsigned short )(((int )t->cycle * 1000 + -1) / T)) + 1U : 0U; q->udma = (int )t->udma * 1000 != 0 ? (unsigned int )((unsigned short )(((int )t->udma * 1000 + -1) / UT)) + 1U : 0U; return; } } void ata_timing_merge(struct ata_timing const *a , struct ata_timing const *b , struct ata_timing *m , unsigned int what ) { unsigned short _max1 ; unsigned short _max2 ; unsigned short _max1___0 ; unsigned short _max2___0 ; unsigned short _max1___1 ; unsigned short _max2___1 ; unsigned short _max1___2 ; unsigned short _max2___2 ; unsigned short _max1___3 ; unsigned short _max2___3 ; unsigned short _max1___4 ; unsigned short _max2___4 ; unsigned short _max1___5 ; unsigned short _max2___5 ; unsigned short _max1___6 ; unsigned short _max2___6 ; unsigned short _max1___7 ; unsigned short _max2___7 ; { if ((int )what & 1) { _max1 = a->setup; _max2 = b->setup; m->setup = (unsigned short )((int )_max1 > (int )_max2 ? _max1 : _max2); } else { } if ((what & 2U) != 0U) { _max1___0 = a->act8b; _max2___0 = b->act8b; m->act8b = (unsigned short )((int )_max1___0 > (int )_max2___0 ? _max1___0 : _max2___0); } else { } if ((what & 4U) != 0U) { _max1___1 = a->rec8b; _max2___1 = b->rec8b; m->rec8b = (unsigned short )((int )_max1___1 > (int )_max2___1 ? _max1___1 : _max2___1); } else { } if ((what & 8U) != 0U) { _max1___2 = a->cyc8b; _max2___2 = b->cyc8b; m->cyc8b = (unsigned short )((int )_max1___2 > (int )_max2___2 ? _max1___2 : _max2___2); } else { } if ((what & 16U) != 0U) { _max1___3 = a->active; _max2___3 = b->active; m->active = (unsigned short )((int )_max1___3 > (int )_max2___3 ? _max1___3 : _max2___3); } else { } if ((what & 32U) != 0U) { _max1___4 = a->recover; _max2___4 = b->recover; m->recover = (unsigned short )((int )_max1___4 > (int )_max2___4 ? _max1___4 : _max2___4); } else { } if ((what & 64U) != 0U) { _max1___5 = a->dmack_hold; _max2___5 = b->dmack_hold; m->dmack_hold = (unsigned short )((int )_max1___5 > (int )_max2___5 ? _max1___5 : _max2___5); } else { } if ((what & 128U) != 0U) { _max1___6 = a->cycle; _max2___6 = b->cycle; m->cycle = (unsigned short )((int )_max1___6 > (int )_max2___6 ? _max1___6 : _max2___6); } else { } if ((what & 256U) != 0U) { _max1___7 = a->udma; _max2___7 = b->udma; m->udma = (unsigned short )((int )_max1___7 > (int )_max2___7 ? _max1___7 : _max2___7); } else { } return; } } struct ata_timing const *ata_timing_find_mode(u8 xfer_mode ) { struct ata_timing const *t ; bool __warned ; int __ret_warn_once ; int __ret_warn_on ; long tmp ; long tmp___0 ; long tmp___1 ; { t = (struct ata_timing const *)(& ata_timing); goto ldv_49642; ldv_49641: t = t + 1; ldv_49642: ; if ((int )((unsigned short )xfer_mode) > (int )((unsigned short )t->mode)) { goto ldv_49641; } else { } if ((int )((unsigned short )xfer_mode) == (int )((unsigned short )t->mode)) { return (t); } else { } __ret_warn_once = 1; tmp___1 = ldv__builtin_expect(__ret_warn_once != 0, 0L); if (tmp___1 != 0L) { __ret_warn_on = ! __warned; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_fmt("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-core.c", 2997, "%s: unable to find timing for xfer_mode 0x%x\n", "ata_timing_find_mode", (int )xfer_mode); } else { } tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { __warned = 1; } else { } } else { } ldv__builtin_expect(__ret_warn_once != 0, 0L); return ((struct ata_timing const *)0); } } int ata_timing_compute(struct ata_device *adev , unsigned short speed , struct ata_timing *t , int T , int UT ) { u16 const *id ; struct ata_timing const *s ; struct ata_timing p ; bool tmp ; int tmp___0 ; { id = (u16 const *)(& adev->__annonCompField86.id); s = ata_timing_find_mode((int )((u8 )speed)); if ((unsigned long )s == (unsigned long )((struct ata_timing const *)0)) { return (-22); } else { } memcpy((void *)t, (void const *)s, 20UL); if (((int )*(id + 53UL) & 2) != 0) { memset((void *)(& p), 0, 20UL); if ((unsigned int )speed > 7U && (unsigned int )speed <= 15U) { if ((unsigned int )speed <= 10U) { p.cyc8b = *(id + 67UL); p.cycle = p.cyc8b; } else if ((unsigned int )speed <= 12U) { p.cyc8b = *(id + 68UL); p.cycle = p.cyc8b; } else if ((unsigned int )speed == 13U) { tmp = ata_id_is_cfa(id); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { p.cyc8b = *(id + 68UL); p.cycle = p.cyc8b; } else { } } else { } } else if ((unsigned int )speed > 31U && (unsigned int )speed <= 34U) { p.cycle = *(id + 65UL); } else { } ata_timing_merge((struct ata_timing const *)(& p), (struct ata_timing const *)t, t, 136U); } else { } ata_timing_quantize((struct ata_timing const *)t, t, T, UT); if ((unsigned int )speed > 14U) { ata_timing_compute(adev, (int )adev->pio_mode, & p, T, UT); ata_timing_merge((struct ata_timing const *)(& p), (struct ata_timing const *)t, t, 511U); } else { } if ((int )t->act8b + (int )t->rec8b < (int )t->cyc8b) { t->act8b = (int )t->act8b + (int )((unsigned short )(((int )t->cyc8b - ((int )t->act8b + (int )t->rec8b)) / 2)); t->rec8b = (int )t->cyc8b - (int )t->act8b; } else { } if ((int )t->active + (int )t->recover < (int )t->cycle) { t->active = (int )t->active + (int )((unsigned short )(((int )t->cycle - ((int )t->active + (int )t->recover)) / 2)); t->recover = (int )t->cycle - (int )t->active; } else { } if ((int )t->active + (int )t->recover > (int )t->cycle) { t->cycle = (int )t->active + (int )t->recover; } else { } return (0); } } u8 ata_timing_cycle2mode(unsigned int xfer_shift , int cycle ) { u8 base_mode ; u8 last_mode ; struct ata_xfer_ent const *ent ; struct ata_timing const *t ; unsigned short this_cycle ; int tmp ; { base_mode = 255U; last_mode = 255U; ent = (struct ata_xfer_ent const *)(& ata_xfer_tbl); goto ldv_49669; ldv_49668: ; if ((unsigned int )ent->shift == xfer_shift) { base_mode = ent->base; } else { } ent = ent + 1; ldv_49669: ; if ((int )ent->shift >= 0) { goto ldv_49668; } else { } t = ata_timing_find_mode((int )base_mode); goto ldv_49679; ldv_49678: ; switch (xfer_shift) { case 0U: ; case 7U: this_cycle = t->cycle; goto ldv_49674; case 12U: this_cycle = t->udma; goto ldv_49674; default: ; return (255U); } ldv_49674: ; if ((int )this_cycle < cycle) { goto ldv_49677; } else { } last_mode = (u8 )t->mode; t = t + 1; ldv_49679: ; if ((unsigned long )t != (unsigned long )((struct ata_timing const *)0)) { tmp = ata_xfer_mode2shift((unsigned long )t->mode); if ((unsigned int )tmp == xfer_shift) { goto ldv_49678; } else { goto ldv_49677; } } else { } ldv_49677: ; return (last_mode); } } int ata_down_xfermask_limit(struct ata_device *dev , unsigned int sel ) { char buf[32U] ; unsigned long orig_mask ; unsigned long xfer_mask ; unsigned long pio_mask ; unsigned long mwdma_mask ; unsigned long udma_mask ; int quiet ; int highbit ; int tmp ; int tmp___0 ; int tmp___1 ; unsigned long tmp___2 ; char const *tmp___3 ; char const *tmp___4 ; char const *tmp___5 ; { quiet = (int )sel < 0; sel = sel & 2147483647U; orig_mask = ata_pack_xfermask(dev->pio_mask, dev->mwdma_mask, dev->udma_mask); xfer_mask = orig_mask; ata_unpack_xfermask(xfer_mask, & pio_mask, & mwdma_mask, & udma_mask); switch (sel) { case 0U: tmp = fls((int )pio_mask); highbit = tmp + -1; pio_mask = (unsigned long )(~ (1 << highbit)) & pio_mask; goto ldv_49693; case 1U: ; if (udma_mask != 0UL) { tmp___0 = fls((int )udma_mask); highbit = tmp___0 + -1; udma_mask = (unsigned long )(~ (1 << highbit)) & udma_mask; if (udma_mask == 0UL) { return (-2); } else { } } else if (mwdma_mask != 0UL) { tmp___1 = fls((int )mwdma_mask); highbit = tmp___1 + -1; mwdma_mask = (unsigned long )(~ (1 << highbit)) & mwdma_mask; if (mwdma_mask == 0UL) { return (-2); } else { } } else { } goto ldv_49693; case 2U: udma_mask = udma_mask & 7UL; goto ldv_49693; case 4U: pio_mask = pio_mask & 1UL; case 3U: mwdma_mask = 0UL; udma_mask = 0UL; goto ldv_49693; default: __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-core.c"), "i" (3191), "i" (12UL)); ldv_49699: ; goto ldv_49699; } ldv_49693: tmp___2 = ata_pack_xfermask(pio_mask, mwdma_mask, udma_mask); xfer_mask = tmp___2 & xfer_mask; if ((xfer_mask & 127UL) == 0UL || xfer_mask == orig_mask) { return (-2); } else { } if (quiet == 0) { if ((xfer_mask & 1048448UL) != 0UL) { tmp___3 = ata_mode_string(xfer_mask & 127UL); tmp___4 = ata_mode_string(xfer_mask); snprintf((char *)(& buf), 32UL, "%s:%s", tmp___4, tmp___3); } else { tmp___5 = ata_mode_string(xfer_mask); snprintf((char *)(& buf), 32UL, "%s", tmp___5); } ata_dev_printk((struct ata_device const *)dev, "\f", "limiting speed to %s\n", (char *)(& buf)); } else { } ata_unpack_xfermask(xfer_mask, & dev->pio_mask, & dev->mwdma_mask, & dev->udma_mask); return (0); } } static int ata_dev_set_mode(struct ata_device *dev ) { struct ata_port *ap ; struct ata_eh_context *ehc ; bool nosetxfer ; char const *dev_err_whine ; int ign_dev_err ; unsigned int err_mask ; int rc ; bool tmp ; bool tmp___0 ; unsigned int tmp___1 ; unsigned long tmp___2 ; u8 tmp___3 ; unsigned long tmp___4 ; char const *tmp___5 ; { ap = (dev->link)->ap; ehc = & (dev->link)->eh_context; nosetxfer = (dev->horkage & 16384U) != 0U; dev_err_whine = ""; ign_dev_err = 0; err_mask = 0U; dev->flags = dev->flags & 0xffffffffffffefffUL; if (dev->xfer_shift == 0U) { dev->flags = dev->flags | 4096UL; } else { } if ((int )nosetxfer && (ap->flags & 2UL) != 0UL) { tmp = ata_id_is_sata((u16 const *)(& dev->__annonCompField86.id)); if ((int )tmp) { dev_err_whine = " (SET_XFERMODE skipped)"; } else { goto _L; } } else { _L: /* CIL Label */ if ((int )nosetxfer) { ata_dev_printk((struct ata_device const *)dev, "\f", "NOSETXFER but PATA detected - can\'t skip SETXFER, might malfunction\n"); } else { } err_mask = ata_dev_set_xfermode(dev); } if ((err_mask & 4294967294U) != 0U) { goto fail; } else { } ehc->i.flags = ehc->i.flags | 1048576U; rc = ata_dev_revalidate(dev, 0U, 0U); ehc->i.flags = ehc->i.flags & 4293918719U; if (rc != 0) { return (rc); } else { } if (dev->xfer_shift == 0U) { tmp___0 = ata_id_is_cfa((u16 const *)(& dev->__annonCompField86.id)); if ((int )tmp___0) { ign_dev_err = 1; } else { } tmp___1 = ata_id_major_version((u16 const *)(& dev->__annonCompField86.id)); if (tmp___1 == 0U && (unsigned int )dev->pio_mode <= 10U) { ign_dev_err = 1; } else { } if (((int )dev->__annonCompField86.id[49] & 2048) == 0 && (unsigned int )dev->pio_mode <= 10U) { ign_dev_err = 1; } else { } } else { } if ((dev->xfer_shift == 7U && (unsigned int )dev->dma_mode == 32U) && ((int )dev->__annonCompField86.id[63] >> 8) & 1) { ign_dev_err = 1; } else { } tmp___2 = ata_id_xfermask((u16 const *)(& dev->__annonCompField86.id)); tmp___3 = ata_xfer_mask2mode(tmp___2); if ((int )dev->xfer_mode == (int )tmp___3) { ign_dev_err = 1; } else { } if ((int )err_mask & 1) { if (ign_dev_err == 0) { goto fail; } else { dev_err_whine = " (device error ignored)"; } } else { } tmp___4 = ata_xfer_mode2mask((int )dev->xfer_mode); tmp___5 = ata_mode_string(tmp___4); ata_dev_printk((struct ata_device const *)dev, "\016", "configured for %s%s\n", tmp___5, dev_err_whine); return (0); fail: ata_dev_printk((struct ata_device const *)dev, "\v", "failed to set xfermode (err_mask=0x%x)\n", err_mask); return (-5); } } int ata_do_set_mode(struct ata_link *link , struct ata_device **r_failed_dev ) { struct ata_port *ap ; struct ata_device *dev ; int rc ; int used_dma ; int found ; unsigned long pio_mask ; unsigned long dma_mask ; unsigned int mode_mask ; bool tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; { ap = link->ap; rc = 0; used_dma = 0; found = 0; dev = ata_dev_next((struct ata_device *)0, link, 0); goto ldv_49724; ldv_49723: mode_mask = 1U; if (dev->class == 3U) { mode_mask = 2U; } else { tmp = ata_id_is_cfa((u16 const *)(& dev->__annonCompField86.id)); if ((int )tmp) { mode_mask = 4U; } else { } } ata_dev_xfermask(dev); ata_force_xfermask(dev); pio_mask = ata_pack_xfermask(dev->pio_mask, 0UL, 0UL); if (((unsigned int )libata_dma_mask & mode_mask) != 0U) { dma_mask = ata_pack_xfermask(0UL, dev->mwdma_mask, dev->udma_mask); } else { dma_mask = 0UL; } dev->pio_mode = ata_xfer_mask2mode(pio_mask); dev->dma_mode = ata_xfer_mask2mode(dma_mask); found = 1; tmp___0 = ata_dma_enabled(dev); if (tmp___0 != 0) { used_dma = 1; } else { } dev = ata_dev_next(dev, link, 0); ldv_49724: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_49723; } else { } if (found == 0) { goto out; } else { } dev = ata_dev_next((struct ata_device *)0, link, 0); goto ldv_49728; ldv_49727: ; if ((unsigned int )dev->pio_mode == 255U) { ata_dev_printk((struct ata_device const *)dev, "\f", "no PIO support\n"); rc = -22; goto out; } else { } dev->xfer_mode = dev->pio_mode; dev->xfer_shift = 0U; if ((unsigned long )(ap->ops)->set_piomode != (unsigned long )((void (*)(struct ata_port * , struct ata_device * ))0)) { (*((ap->ops)->set_piomode))(ap, dev); } else { } dev = ata_dev_next(dev, link, 0); ldv_49728: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_49727; } else { } dev = ata_dev_next((struct ata_device *)0, link, 0); goto ldv_49732; ldv_49731: tmp___1 = ata_dma_enabled(dev); if (tmp___1 == 0) { goto ldv_49730; } else { } dev->xfer_mode = dev->dma_mode; tmp___2 = ata_xfer_mode2shift((unsigned long )dev->dma_mode); dev->xfer_shift = (unsigned int )tmp___2; if ((unsigned long )(ap->ops)->set_dmamode != (unsigned long )((void (*)(struct ata_port * , struct ata_device * ))0)) { (*((ap->ops)->set_dmamode))(ap, dev); } else { } ldv_49730: dev = ata_dev_next(dev, link, 0); ldv_49732: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_49731; } else { } dev = ata_dev_next((struct ata_device *)0, link, 0); goto ldv_49735; ldv_49734: rc = ata_dev_set_mode(dev); if (rc != 0) { goto out; } else { } dev = ata_dev_next(dev, link, 0); ldv_49735: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_49734; } else { } if (used_dma != 0 && (int )(ap->host)->flags & 1) { (ap->host)->simplex_claimed = ap; } else { } out: ; if (rc != 0) { *r_failed_dev = dev; } else { } return (rc); } } int ata_wait_ready(struct ata_link *link , unsigned long deadline , int (*check_ready)(struct ata_link * ) ) { unsigned long start ; unsigned long nodev_deadline ; int warned ; int __ret_warn_on ; long tmp ; unsigned long now ; int ready ; int tmp___0 ; bool tmp___1 ; int tmp___2 ; bool tmp___3 ; { start = jiffies; warned = 0; if ((((link->ap)->host)->flags & 4UL) != 0UL) { nodev_deadline = ata_deadline(start, 2000UL); } else { nodev_deadline = ata_deadline(start, 800UL); } __ret_warn_on = (unsigned long )(link->ap)->slave_link == (unsigned long )link; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-core.c", 3434); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); if ((long )(deadline - nodev_deadline) < 0L) { nodev_deadline = deadline; } else { } ldv_49775: now = jiffies; tmp___0 = (*check_ready)(link); ready = tmp___0; if (ready > 0) { return (0); } else { } if (ready == -19) { tmp___3 = ata_link_online(link); if ((int )tmp___3) { ready = 0; } else if (((link->ap)->flags & 2UL) != 0UL) { tmp___1 = ata_link_offline(link); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { if ((long )(now - nodev_deadline) < 0L) { ready = 0; } else { } } else { } } else { } } else { } if (ready != 0) { return (ready); } else { } if ((long )(deadline - now) < 0L) { return (-16); } else { } if ((warned == 0 && (long )((start - now) + 1250UL) < 0L) && deadline - now > 750UL) { ata_link_printk((struct ata_link const *)link, "\f", "link is slow to respond, please be patient (ready=%d)\n", tmp___0); warned = 1; } else { } ata_msleep(link->ap, 50U); goto ldv_49775; } } int ata_wait_after_reset(struct ata_link *link , unsigned long deadline , int (*check_ready)(struct ata_link * ) ) { int tmp ; { ata_msleep(link->ap, 150U); tmp = ata_wait_ready(link, deadline, check_ready); return (tmp); } } int sata_link_debounce(struct ata_link *link , unsigned long const *params , unsigned long deadline ) { unsigned long interval ; unsigned long duration ; unsigned long last_jiffies ; unsigned long t ; u32 last ; u32 cur ; int rc ; unsigned long tmp ; { interval = *params; duration = *(params + 1UL); t = ata_deadline(jiffies, *(params + 2UL)); if ((long )(t - deadline) < 0L) { deadline = t; } else { } rc = sata_scr_read(link, 0, & cur); if (rc != 0) { return (rc); } else { } cur = cur & 15U; last = cur; last_jiffies = jiffies; ldv_49819: ata_msleep(link->ap, (unsigned int )interval); rc = sata_scr_read(link, 0, & cur); if (rc != 0) { return (rc); } else { } cur = cur & 15U; if (cur == last) { if (cur == 1U && (long )((unsigned long )jiffies - deadline) < 0L) { goto ldv_49806; } else { } tmp = ata_deadline(last_jiffies, duration); if ((long )(tmp - (unsigned long )jiffies) < 0L) { return (0); } else { } goto ldv_49806; } else { } last = cur; last_jiffies = jiffies; if ((long )(deadline - (unsigned long )jiffies) < 0L) { return (-32); } else { } ldv_49806: ; goto ldv_49819; } } int sata_link_resume(struct ata_link *link , unsigned long const *params , unsigned long deadline ) { int tries ; u32 scontrol ; u32 serror ; int rc ; { tries = 5; rc = sata_scr_read(link, 2, & scontrol); if (rc != 0) { return (rc); } else { } ldv_49829: scontrol = (scontrol & 240U) | 768U; rc = sata_scr_write(link, 2, scontrol); if (rc != 0) { return (rc); } else { } ata_msleep(link->ap, 200U); rc = sata_scr_read(link, 2, & scontrol); if (rc != 0) { return (rc); } else { } if ((scontrol & 3855U) != 768U) { tries = tries - 1; if (tries != 0) { goto ldv_49829; } else { goto ldv_49830; } } else { } ldv_49830: ; if ((scontrol & 3855U) != 768U) { ata_link_printk((struct ata_link const *)link, "\f", "failed to resume link (SControl %X)\n", scontrol); return (0); } else { } if (tries <= 4) { ata_link_printk((struct ata_link const *)link, "\f", "link resume succeeded after %d retries\n", 5 - tries); } else { } rc = sata_link_debounce(link, params, deadline); if (rc != 0) { return (rc); } else { } rc = sata_scr_read(link, 1, & serror); if (rc == 0) { rc = sata_scr_write(link, 1, serror); } else { } return (rc != -22 ? rc : 0); } } int sata_link_scr_lpm(struct ata_link *link , enum ata_lpm_policy policy , bool spm_wakeup ) { struct ata_eh_context *ehc ; bool woken_up ; u32 scontrol ; int rc ; int tmp ; int __ret_warn_on ; long tmp___0 ; int tmp___1 ; { ehc = & link->eh_context; woken_up = 0; rc = sata_scr_read(link, 2, & scontrol); if (rc != 0) { return (rc); } else { } switch ((unsigned int )policy) { case 1U: scontrol = scontrol | 1792U; if ((int )spm_wakeup) { scontrol = scontrol | 16384U; woken_up = 1; } else { } goto ldv_49841; case 2U: scontrol = scontrol & 4294967039U; scontrol = scontrol | 1536U; goto ldv_49841; case 3U: tmp = ata_link_nr_enabled(link); if (tmp > 0) { scontrol = scontrol & 4294965503U; } else { scontrol = scontrol & 4294967280U; scontrol = scontrol | 4U; } goto ldv_49841; default: __ret_warn_on = 1; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-core.c", 3697); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); } ldv_49841: rc = sata_scr_write(link, 2, scontrol); if (rc != 0) { return (rc); } else { } if ((int )woken_up) { msleep(10U); } else { } ehc->i.serror = ehc->i.serror & 4294901759U; tmp___1 = sata_scr_write(link, 1, 65536U); return (tmp___1); } } int ata_std_prereset(struct ata_link *link , unsigned long deadline ) { struct ata_port *ap ; struct ata_eh_context *ehc ; unsigned long const *timing ; unsigned long const *tmp ; int rc ; bool tmp___0 ; { ap = link->ap; ehc = & link->eh_context; tmp = sata_ehc_deb_timing(ehc); timing = tmp; if ((ehc->i.action & 4U) != 0U) { return (0); } else { } if ((ap->flags & 2UL) != 0UL) { rc = sata_link_resume(link, timing, deadline); if (rc != 0 && rc != -95) { ata_link_printk((struct ata_link const *)link, "\f", "failed to resume link for reset (errno=%d)\n", rc); } else { } } else { } tmp___0 = ata_phys_link_offline(link); if ((int )tmp___0) { ehc->i.action = ehc->i.action & 4294967293U; } else { } return (0); } } int sata_link_hardreset(struct ata_link *link , unsigned long const *timing , unsigned long deadline , bool *online , int (*check_ready)(struct ata_link * ) ) { u32 scontrol ; int rc ; int tmp ; bool tmp___0 ; unsigned long pmp_deadline ; bool tmp___1 ; int tmp___2 ; { if ((unsigned long )online != (unsigned long )((bool *)0)) { *online = 0; } else { } tmp = sata_set_spd_needed(link); if (tmp != 0) { rc = sata_scr_read(link, 2, & scontrol); if (rc != 0) { goto out; } else { } scontrol = (scontrol & 240U) | 772U; rc = sata_scr_write(link, 2, scontrol); if (rc != 0) { goto out; } else { } sata_set_spd(link); } else { } rc = sata_scr_read(link, 2, & scontrol); if (rc != 0) { goto out; } else { } scontrol = (scontrol & 240U) | 769U; rc = sata_scr_write_flush(link, 2, scontrol); if (rc != 0) { goto out; } else { } ata_msleep(link->ap, 1U); rc = sata_link_resume(link, timing, deadline); if (rc != 0) { goto out; } else { } tmp___0 = ata_phys_link_offline(link); if ((int )tmp___0) { goto out; } else { } if ((unsigned long )online != (unsigned long )((bool *)0)) { *online = 1; } else { } tmp___1 = sata_pmp_supported(link->ap); if ((int )tmp___1) { tmp___2 = ata_is_host_link((struct ata_link const *)link); if (tmp___2 != 0) { if ((unsigned long )check_ready != (unsigned long )((int (*)(struct ata_link * ))0)) { pmp_deadline = ata_deadline(jiffies, 5000UL); if ((long )(deadline - pmp_deadline) < 0L) { pmp_deadline = deadline; } else { } ata_wait_ready(link, pmp_deadline, check_ready); } else { } rc = -11; goto out; } else { } } else { } rc = 0; if ((unsigned long )check_ready != (unsigned long )((int (*)(struct ata_link * ))0)) { rc = ata_wait_ready(link, deadline, check_ready); } else { } out: ; if (rc != 0 && rc != -11) { if ((unsigned long )online != (unsigned long )((bool *)0)) { *online = 0; } else { } ata_link_printk((struct ata_link const *)link, "\v", "COMRESET failed (errno=%d)\n", rc); } else { } return (rc); } } int sata_std_hardreset(struct ata_link *link , unsigned int *class , unsigned long deadline ) { unsigned long const *timing ; unsigned long const *tmp ; bool online ; int rc ; { tmp = sata_ehc_deb_timing(& link->eh_context); timing = tmp; rc = sata_link_hardreset(link, timing, deadline, & online, (int (*)(struct ata_link * ))0); return ((int )online ? -11 : rc); } } void ata_std_postreset(struct ata_link *link , unsigned int *classes ) { u32 serror ; int tmp ; { tmp = sata_scr_read(link, 1, & serror); if (tmp == 0) { sata_scr_write(link, 1, serror); } else { } sata_print_link_status(link); return; } } static int ata_dev_same_device(struct ata_device *dev , unsigned int new_class , u16 const *new_id ) { u16 const *old_id ; unsigned char model[2U][41U] ; unsigned char serial[2U][21U] ; int tmp ; int tmp___0 ; { old_id = (u16 const *)(& dev->__annonCompField86.id); if (dev->class != new_class) { ata_dev_printk((struct ata_device const *)dev, "\016", "class mismatch %d != %d\n", dev->class, new_class); return (0); } else { } ata_id_c_string(old_id, (unsigned char *)(& model), 27U, 41U); ata_id_c_string(new_id, (unsigned char *)(& model) + 1U, 27U, 41U); ata_id_c_string(old_id, (unsigned char *)(& serial), 10U, 21U); ata_id_c_string(new_id, (unsigned char *)(& serial) + 1U, 10U, 21U); tmp = strcmp((char const *)(& model), (char const *)(& model) + 1U); if (tmp != 0) { ata_dev_printk((struct ata_device const *)dev, "\016", "model number mismatch \'%s\' != \'%s\'\n", (unsigned char *)(& model), (unsigned char *)(& model) + 1U); return (0); } else { } tmp___0 = strcmp((char const *)(& serial), (char const *)(& serial) + 1U); if (tmp___0 != 0) { ata_dev_printk((struct ata_device const *)dev, "\016", "serial number mismatch \'%s\' != \'%s\'\n", (unsigned char *)(& serial), (unsigned char *)(& serial) + 1U); return (0); } else { } return (1); } } int ata_dev_reread_id(struct ata_device *dev , unsigned int readid_flags ) { unsigned int class ; u16 *id ; int rc ; int tmp ; { class = dev->class; id = (u16 *)(& ((dev->link)->ap)->sector_buf); rc = ata_dev_read_id(dev, & class, readid_flags, id); if (rc != 0) { return (rc); } else { } tmp = ata_dev_same_device(dev, class, (u16 const *)id); if (tmp == 0) { return (-19); } else { } memcpy((void *)(& dev->__annonCompField86.id), (void const *)id, 512UL); return (0); } } int ata_dev_revalidate(struct ata_device *dev , unsigned int new_class , unsigned int readid_flags ) { u64 n_sectors ; u64 n_native_sectors ; int rc ; unsigned int tmp ; unsigned int tmp___0 ; { n_sectors = dev->n_sectors; n_native_sectors = dev->n_native_sectors; tmp = ata_dev_enabled((struct ata_device const *)dev); if (tmp == 0U) { return (-19); } else { } tmp___0 = ata_class_enabled(new_class); if ((((tmp___0 != 0U && new_class != 1U) && new_class != 3U) && new_class != 9U) && new_class != 7U) { ata_dev_printk((struct ata_device const *)dev, "\016", "class mismatch %u != %u\n", dev->class, new_class); rc = -19; goto fail; } else { } rc = ata_dev_reread_id(dev, readid_flags); if (rc != 0) { goto fail; } else { } rc = ata_dev_configure(dev); if (rc != 0) { goto fail; } else { } if ((dev->class != 1U || n_sectors == 0ULL) || dev->n_sectors == n_sectors) { return (0); } else { } ata_dev_printk((struct ata_device const *)dev, "\f", "n_sectors mismatch %llu != %llu\n", n_sectors, dev->n_sectors); if ((dev->n_native_sectors == n_native_sectors && dev->n_sectors > n_sectors) && dev->n_sectors == n_native_sectors) { ata_dev_printk((struct ata_device const *)dev, "\f", "new n_sectors matches native, probably late HPA unlock, n_sectors updated\n"); return (0); } else { } if (((dev->n_native_sectors == n_native_sectors && dev->n_sectors < n_sectors) && n_sectors == n_native_sectors) && (dev->horkage & 16U) == 0U) { ata_dev_printk((struct ata_device const *)dev, "\f", "old n_sectors matches native, probably late HPA lock, will try to unlock HPA\n"); dev->flags = dev->flags | 262144UL; rc = -5; } else { rc = -19; } dev->n_native_sectors = n_native_sectors; dev->n_sectors = n_sectors; fail: ata_dev_printk((struct ata_device const *)dev, "\v", "revalidation failed (errno=%d)\n", rc); return (rc); } } static struct ata_blacklist_entry const ata_device_blacklist[93U] = { {"WDC AC11000H", (char const *)0, 2UL}, {"WDC AC22100H", (char const *)0, 2UL}, {"WDC AC32500H", (char const *)0, 2UL}, {"WDC AC33100H", (char const *)0, 2UL}, {"WDC AC31600H", (char const *)0, 2UL}, {"WDC AC32100H", "24.09P07", 2UL}, {"WDC AC23200L", "21.10N21", 2UL}, {"Compaq CRD-8241B", (char const *)0, 2UL}, {"CRD-8400B", (char const *)0, 2UL}, {"CRD-848[02]B", (char const *)0, 2UL}, {"CRD-84", (char const *)0, 2UL}, {"SanDisk SDP3B", (char const *)0, 2UL}, {"SanDisk SDP3B-64", (char const *)0, 2UL}, {"SANYO CD-ROM CRD", (char const *)0, 2UL}, {"HITACHI CDR-8", (char const *)0, 2UL}, {"HITACHI CDR-8[34]35", (char const *)0, 2UL}, {"Toshiba CD-ROM XM-6202B", (char const *)0, 2UL}, {"TOSHIBA CD-ROM XM-1702BC", (char const *)0, 2UL}, {"CD-532E-A", (char const *)0, 2UL}, {"E-IDE CD-ROM CR-840", (char const *)0, 2UL}, {"CD-ROM Drive/F5A", (char const *)0, 2UL}, {"WPI CDD-820", (char const *)0, 2UL}, {"SAMSUNG CD-ROM SC-148C", (char const *)0, 2UL}, {"SAMSUNG CD-ROM SC", (char const *)0, 2UL}, {"ATAPI CD-ROM DRIVE 40X MAXIMUM", (char const *)0, 2UL}, {"_NEC DV5800A", (char const *)0, 2UL}, {"SAMSUNG CD-ROM SN-124", "N001", 2UL}, {"Seagate STT20000A", (char const *)0, 2UL}, {" 2GB ATA Flash Disk", "ADMA428M", 2UL}, {"Config Disk", (char const *)0, 32UL}, {"TORiSAN DVD-ROM DRD-N216", (char const *)0, 8UL}, {"QUANTUM DAT DAT72-000", (char const *)0, 2048UL}, {"Slimtype DVD A DS8A8SH", (char const *)0, 131072UL}, {"Slimtype DVD A DS8A9SH", (char const *)0, 131072UL}, {"WDC WD740ADFD-00", (char const *)0, 4UL}, {"WDC WD740ADFD-00NLR1", (char const *)0, 4UL}, {"FUJITSU MHT2060BH", (char const *)0, 4UL}, {"Maxtor *", "BANC*", 4UL}, {"Maxtor 7V300F0", "VA111630", 4UL}, {"ST380817AS", "3.42", 4UL}, {"ST3160023AS", "3.42", 4UL}, {"OCZ CORE_SSD", "02.10104", 4UL}, {"ST31500341AS", "SD1[5-9]", 4100UL}, {"ST31000333AS", "SD1[5-9]", 4100UL}, {"ST3640[36]23AS", "SD1[5-9]", 4100UL}, {"ST3320[68]13AS", "SD1[5-9]", 4100UL}, {"ST1000LM024 HN-M101MBB", "2AR10001", 32768UL}, {"ST1000LM024 HN-M101MBB", "2BA30001", 32768UL}, {"HTS541060G9SA00", "MB3OC60D", 4UL}, {"HTS541080G9SA00", "MB4OC60D", 4UL}, {"HTS541010G9SA00", "MBZOC60D", 4UL}, {"C300-CTFDDAC128MAG", "0001", 4UL}, {"HDS724040KLSA80", "KFAOA20N", 16UL}, {"WDC WD3200JD-00KLB0", "WD-WCAMR1130137", 16UL}, {"WDC WD2500JD-00HBB0", "WD-WMAL71490727", 16UL}, {"MAXTOR 6L080L4", "A93.0500", 16UL}, {"OCZ-VERTEX", "1.30", 16UL}, {"ST340823A", (char const *)0, 64UL}, {"ST320413A", (char const *)0, 64UL}, {"ST310211A", (char const *)0, 64UL}, {"QUANTUM FIREBALLlct10 05", "A03.0900", 256UL}, {"TSSTcorp CDDVDW SH-S202[HJN]", "SB0[01]", 256UL}, {"MTRON MSP-SATA*", (char const *)0, 1024UL}, {"BUFFALO HD-QSU2/R5", (char const *)0, 1024UL}, {"WD My Book", (char const *)0, 8192UL}, {"Seagate FreeAgent GoFlex", (char const *)0, 8192UL}, {"PIONEER DVD-RW DVRTD08", (char const *)0, 16384UL}, {"PIONEER DVD-RW DVRTD08A", (char const *)0, 16384UL}, {"PIONEER DVD-RW DVR-215", (char const *)0, 16384UL}, {"PIONEER DVD-RW DVR-212D", (char const *)0, 16384UL}, {"PIONEER DVD-RW DVR-216D", (char const *)0, 16384UL}, {"Micron_M500_*", (char const *)0, 4718592UL}, {"Crucial_CT*M500*", (char const *)0, 4718592UL}, {"Micron_M5[15]0*", "MU01", 4718592UL}, {"Crucial_CT*M550*", "MU01", 4718592UL}, {"Crucial_CT*MX100*", "MU01", 4718592UL}, {"Samsung SSD 8*", (char const *)0, 4718592UL}, {"INTEL*SSDSC2MH*", (char const *)0, 0UL}, {"Micron*", (char const *)0, 4194304UL}, {"Crucial*", (char const *)0, 4194304UL}, {"INTEL*SSD*", (char const *)0, 4194304UL}, {"SSD*INTEL*", (char const *)0, 4194304UL}, {"Samsung*SSD*", (char const *)0, 4194304UL}, {"SAMSUNG*SSD*", (char const *)0, 4194304UL}, {"ST[1248][0248]0[FH]*", (char const *)0, 4194304UL}, {"WDC WD800JD-*", (char const *)0, 2097152UL}, {"WDC WD1200JD-*", (char const *)0, 2097152UL}, {"WDC WD1600JD-*", (char const *)0, 2097152UL}, {"WDC WD2000JD-*", (char const *)0, 2097152UL}, {"WDC WD2500JD-*", (char const *)0, 2097152UL}, {"WDC WD3000JD-*", (char const *)0, 2097152UL}, {"WDC WD3200JD-*", (char const *)0, 2097152UL}}; static unsigned long ata_dev_blacklisted(struct ata_device const *dev ) { unsigned char model_num[41U] ; unsigned char model_rev[9U] ; struct ata_blacklist_entry const *ad ; bool tmp ; bool tmp___0 ; { ad = (struct ata_blacklist_entry const *)(& ata_device_blacklist); ata_id_c_string((u16 const *)(& dev->__annonCompField86.id), (unsigned char *)(& model_num), 27U, 41U); ata_id_c_string((u16 const *)(& dev->__annonCompField86.id), (unsigned char *)(& model_rev), 23U, 9U); goto ldv_49922; ldv_49921: tmp___0 = glob_match(ad->model_num, (char const *)(& model_num)); if ((int )tmp___0) { if ((unsigned long )ad->model_rev == (unsigned long )((char const */* const */)0)) { return ((unsigned long )ad->horkage); } else { } tmp = glob_match(ad->model_rev, (char const *)(& model_rev)); if ((int )tmp) { return ((unsigned long )ad->horkage); } else { } } else { } ad = ad + 1; ldv_49922: ; if ((unsigned long )ad->model_num != (unsigned long )((char const */* const */)0)) { goto ldv_49921; } else { } return (0UL); } } static int ata_dma_blacklisted(struct ata_device const *dev ) { { if ((((dev->link)->ap)->flags & 512UL) != 0UL && ((unsigned long )dev->flags & 4UL) != 0UL) { return (1); } else { } return (((unsigned int )dev->horkage & 2U) != 0U); } } static int ata_is_40wire(struct ata_device *dev ) { bool tmp ; bool tmp___0 ; { if ((dev->horkage & 256U) != 0U) { tmp = ata_drive_40wire_relaxed((u16 const *)(& dev->__annonCompField86.id)); return ((int )tmp); } else { } tmp___0 = ata_drive_40wire((u16 const *)(& dev->__annonCompField86.id)); return ((int )tmp___0); } } static int cable_is_40wire(struct ata_port *ap ) { struct ata_link *link ; struct ata_device *dev ; int tmp ; { if (ap->cbl == 1U) { return (1); } else { } if (ap->cbl == 2U || ap->cbl == 6U) { return (0); } else { } if (ap->cbl == 3U) { return (0); } else { } link = ata_link_next((struct ata_link *)0, ap, 0); goto ldv_49939; ldv_49938: dev = ata_dev_next((struct ata_device *)0, link, 0); goto ldv_49936; ldv_49935: tmp = ata_is_40wire(dev); if (tmp == 0) { return (0); } else { } dev = ata_dev_next(dev, link, 0); ldv_49936: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_49935; } else { } link = ata_link_next(link, ap, 0); ldv_49939: ; if ((unsigned long )link != (unsigned long )((struct ata_link *)0)) { goto ldv_49938; } else { } return (1); } } static void ata_dev_xfermask(struct ata_device *dev ) { struct ata_link *link ; struct ata_port *ap ; struct ata_host *host ; unsigned long xfer_mask ; unsigned long tmp ; unsigned long tmp___0 ; struct ata_device *tmp___1 ; int tmp___2 ; u32 tmp___3 ; int tmp___4 ; { link = dev->link; ap = link->ap; host = ap->host; xfer_mask = ata_pack_xfermask((unsigned long )ap->pio_mask, (unsigned long )ap->mwdma_mask, (unsigned long )ap->udma_mask); tmp = ata_pack_xfermask(dev->pio_mask, dev->mwdma_mask, dev->udma_mask); xfer_mask = tmp & xfer_mask; tmp___0 = ata_id_xfermask((u16 const *)(& dev->__annonCompField86.id)); xfer_mask = tmp___0 & xfer_mask; tmp___1 = ata_dev_pair(dev); if ((unsigned long )tmp___1 != (unsigned long )((struct ata_device *)0)) { xfer_mask = xfer_mask & 0xffffffffffffff9fUL; xfer_mask = xfer_mask & 0xfffffffffffff3ffUL; } else { } tmp___2 = ata_dma_blacklisted((struct ata_device const *)dev); if (tmp___2 != 0) { xfer_mask = xfer_mask & 0xfffffffffff0007fUL; ata_dev_printk((struct ata_device const *)dev, "\f", "device is on DMA blacklist, disabling DMA\n"); } else { } if (((int )host->flags & 1 && (unsigned long )host->simplex_claimed != (unsigned long )((struct ata_port *)0)) && (unsigned long )host->simplex_claimed != (unsigned long )ap) { xfer_mask = xfer_mask & 0xfffffffffff0007fUL; ata_dev_printk((struct ata_device const *)dev, "\f", "simplex DMA is claimed by other device, disabling DMA\n"); } else { } if ((ap->flags & 65536UL) != 0UL) { tmp___3 = ata_pio_mask_no_iordy((struct ata_device const *)dev); xfer_mask = (unsigned long )tmp___3 & xfer_mask; } else { } if ((unsigned long )(ap->ops)->mode_filter != (unsigned long )((unsigned long (*)(struct ata_device * , unsigned long ))0)) { xfer_mask = (*((ap->ops)->mode_filter))(dev, xfer_mask); } else { } if ((xfer_mask & 1015808UL) != 0UL) { tmp___4 = cable_is_40wire(ap); if (tmp___4 != 0) { ata_dev_printk((struct ata_device const *)dev, "\f", "limited to UDMA/33 due to 40-wire cable\n"); xfer_mask = xfer_mask & 0xfffffffffff07fffUL; } else { } } else { } ata_unpack_xfermask(xfer_mask, & dev->pio_mask, & dev->mwdma_mask, & dev->udma_mask); return; } } static unsigned int ata_dev_set_xfermode(struct ata_device *dev ) { struct ata_taskfile tf ; unsigned int err_mask ; unsigned int tmp ; { ata_tf_init(dev, & tf); tf.command = 239U; tf.feature = 3U; tf.flags = tf.flags | 70UL; tf.protocol = 1U; tmp = ata_pio_need_iordy((struct ata_device const *)dev); if (tmp != 0U) { tf.nsect = dev->xfer_mode; } else if (((int )dev->__annonCompField86.id[49] & 2048) != 0) { tf.nsect = 1U; } else { return (0U); } err_mask = ata_exec_internal(dev, & tf, (u8 const *)0U, 3, (void *)0, 0U, 0UL); return (err_mask); } } unsigned int ata_dev_set_feature(struct ata_device *dev , u8 enable , u8 feature ) { struct ata_taskfile tf ; unsigned int err_mask ; { ata_tf_init(dev, & tf); tf.command = 239U; tf.feature = enable; tf.flags = tf.flags | 6UL; tf.protocol = 1U; tf.nsect = feature; err_mask = ata_exec_internal(dev, & tf, (u8 const *)0U, 3, (void *)0, 0U, 0UL); return (err_mask); } } static char const __kstrtab_ata_dev_set_feature[20U] = { 'a', 't', 'a', '_', 'd', 'e', 'v', '_', 's', 'e', 't', '_', 'f', 'e', 'a', 't', 'u', 'r', 'e', '\000'}; struct kernel_symbol const __ksymtab_ata_dev_set_feature ; struct kernel_symbol const __ksymtab_ata_dev_set_feature = {(unsigned long )(& ata_dev_set_feature), (char const *)(& __kstrtab_ata_dev_set_feature)}; static unsigned int ata_dev_init_params(struct ata_device *dev , u16 heads , u16 sectors ) { struct ata_taskfile tf ; unsigned int err_mask ; { if ((((unsigned int )sectors == 0U || (unsigned int )sectors > 255U) || (unsigned int )heads == 0U) || (unsigned int )heads > 16U) { return (128U); } else { } ata_tf_init(dev, & tf); tf.command = 145U; tf.flags = tf.flags | 6UL; tf.protocol = 1U; tf.nsect = (u8 )sectors; tf.device = (u8 )((int )((signed char )tf.device) | ((int )((signed char )((unsigned int )((unsigned char )heads) + 255U)) & 15)); err_mask = ata_exec_internal(dev, & tf, (u8 const *)0U, 3, (void *)0, 0U, 0UL); if (err_mask == 1U && ((int )tf.feature & 4) != 0) { err_mask = 0U; } else { } return (err_mask); } } void ata_sg_clean(struct ata_queued_cmd *qc ) { struct ata_port *ap ; struct scatterlist *sg ; int dir ; bool __warned ; int __ret_warn_once ; int __ret_warn_on ; long tmp ; long tmp___0 ; long tmp___1 ; { ap = qc->ap; sg = qc->sg; dir = qc->dma_dir; __ret_warn_once = (unsigned long )sg == (unsigned long )((struct scatterlist *)0); tmp___1 = ldv__builtin_expect(__ret_warn_once != 0, 0L); if (tmp___1 != 0L) { __ret_warn_on = ! __warned; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-core.c", 4605); } else { } tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { __warned = 1; } else { } } else { } ldv__builtin_expect(__ret_warn_once != 0, 0L); if (qc->n_elem != 0U) { dma_unmap_sg_attrs(ap->dev, sg, (int )qc->orig_n_elem, (enum dma_data_direction )dir, (struct dma_attrs *)0); } else { } qc->flags = qc->flags & 0xfffffffffffffffdUL; qc->sg = (struct scatterlist *)0; return; } } int atapi_check_dma(struct ata_queued_cmd *qc ) { struct ata_port *ap ; long tmp ; int tmp___0 ; { ap = qc->ap; if (((qc->dev)->horkage & 2048U) == 0U) { tmp = ldv__builtin_expect((qc->nbytes & 15U) != 0U, 0L); if (tmp != 0L) { return (1); } else { } } else { } if ((unsigned long )(ap->ops)->check_atapi_dma != (unsigned long )((int (*)(struct ata_queued_cmd * ))0)) { tmp___0 = (*((ap->ops)->check_atapi_dma))(qc); return (tmp___0); } else { } return (0); } } int ata_std_qc_defer(struct ata_queued_cmd *qc ) { struct ata_link *link ; unsigned int tmp ; unsigned int tmp___0 ; { link = (qc->dev)->link; if ((unsigned int )qc->tf.protocol == 4U) { tmp = ata_tag_valid(link->active_tag); if (tmp == 0U) { return (0); } else { } } else { tmp___0 = ata_tag_valid(link->active_tag); if (tmp___0 == 0U && link->sactive == 0U) { return (0); } else { } } return (1); } } void ata_noop_qc_prep(struct ata_queued_cmd *qc ) { { return; } } void ata_sg_init(struct ata_queued_cmd *qc , struct scatterlist *sg , unsigned int n_elem ) { { qc->sg = sg; qc->n_elem = n_elem; qc->cursg = qc->sg; return; } } static int ata_sg_setup(struct ata_queued_cmd *qc ) { struct ata_port *ap ; unsigned int n_elem ; int tmp ; { ap = qc->ap; tmp = dma_map_sg_attrs(ap->dev, qc->sg, (int )qc->n_elem, (enum dma_data_direction )qc->dma_dir, (struct dma_attrs *)0); n_elem = (unsigned int )tmp; if (n_elem == 0U) { return (-1); } else { } qc->orig_n_elem = qc->n_elem; qc->n_elem = n_elem; qc->flags = qc->flags | 2UL; return (0); } } void swap_buf_le16(u16 *buf , unsigned int buf_words ) { { return; } } struct ata_queued_cmd *ata_qc_new_init(struct ata_device *dev , int tag ) { struct ata_port *ap ; struct ata_queued_cmd *qc ; long tmp ; { ap = (dev->link)->ap; tmp = ldv__builtin_expect((ap->pflags & 4U) != 0U, 0L); if (tmp != 0L) { return ((struct ata_queued_cmd *)0); } else { } if ((ap->flags & 16777216UL) != 0UL) { tag = ata_sas_allocate_tag(ap); if (tag < 0) { return ((struct ata_queued_cmd *)0); } else { } } else { } qc = __ata_qc_from_tag(ap, (unsigned int )tag); qc->tag = (unsigned int )tag; qc->scsicmd = (struct scsi_cmnd *)0; qc->ap = ap; qc->dev = dev; ata_qc_reinit(qc); return (qc); } } void ata_qc_free(struct ata_queued_cmd *qc ) { struct ata_port *ap ; unsigned int tag ; bool __warned ; int __ret_warn_once ; int __ret_warn_on ; long tmp ; long tmp___0 ; long tmp___1 ; unsigned int tmp___2 ; long tmp___3 ; { __ret_warn_once = (unsigned long )qc == (unsigned long )((struct ata_queued_cmd *)0); tmp___1 = ldv__builtin_expect(__ret_warn_once != 0, 0L); if (tmp___1 != 0L) { __ret_warn_on = ! __warned; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-core.c", 4804); } else { } tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { __warned = 1; } else { } } else { } ldv__builtin_expect(__ret_warn_once != 0, 0L); ap = qc->ap; qc->flags = 0UL; tag = qc->tag; tmp___2 = ata_tag_valid(tag); tmp___3 = ldv__builtin_expect(tmp___2 != 0U, 1L); if (tmp___3 != 0L) { qc->tag = 4210818301U; if ((ap->flags & 16777216UL) != 0UL) { ata_sas_free_tag(tag, ap); } else { } } else { } return; } } void __ata_qc_complete(struct ata_queued_cmd *qc ) { struct ata_port *ap ; struct ata_link *link ; bool __warned ; int __ret_warn_once ; int __ret_warn_on ; long tmp ; long tmp___0 ; long tmp___1 ; bool __warned___0 ; int __ret_warn_once___0 ; int __ret_warn_on___0 ; long tmp___2 ; long tmp___3 ; long tmp___4 ; long tmp___5 ; long tmp___6 ; { __ret_warn_once = (unsigned long )qc == (unsigned long )((struct ata_queued_cmd *)0); tmp___1 = ldv__builtin_expect(__ret_warn_once != 0, 0L); if (tmp___1 != 0L) { __ret_warn_on = ! __warned; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-core.c", 4821); } else { } tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { __warned = 1; } else { } } else { } ldv__builtin_expect(__ret_warn_once != 0, 0L); __ret_warn_once___0 = (qc->flags & 1UL) == 0UL; tmp___4 = ldv__builtin_expect(__ret_warn_once___0 != 0, 0L); if (tmp___4 != 0L) { __ret_warn_on___0 = ! __warned___0; tmp___2 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___2 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-core.c", 4822); } else { } tmp___3 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___3 != 0L) { __warned___0 = 1; } else { } } else { } ldv__builtin_expect(__ret_warn_once___0 != 0, 0L); ap = qc->ap; link = (qc->dev)->link; tmp___5 = ldv__builtin_expect((qc->flags & 2UL) != 0UL, 1L); if (tmp___5 != 0L) { ata_sg_clean(qc); } else { } if ((unsigned int )qc->tf.protocol == 4U) { link->sactive = link->sactive & (u32 )(~ (1 << (int )qc->tag)); if (link->sactive == 0U) { ap->nr_active_links = ap->nr_active_links - 1; } else { } } else { link->active_tag = 4210818301U; ap->nr_active_links = ap->nr_active_links - 1; } tmp___6 = ldv__builtin_expect((long )((qc->flags & 32UL) != 0UL && (unsigned long )ap->excl_link == (unsigned long )link), 0L); if (tmp___6 != 0L) { ap->excl_link = (struct ata_link *)0; } else { } qc->flags = qc->flags & 0xfffffffffffffffeUL; ap->qc_active = ap->qc_active & (unsigned int )(~ (1 << (int )qc->tag)); (*(qc->complete_fn))(qc); return; } } static void fill_result_tf(struct ata_queued_cmd *qc ) { struct ata_port *ap ; { ap = qc->ap; qc->result_tf.flags = qc->tf.flags; (*((ap->ops)->qc_fill_rtf))(qc); return; } } static void ata_verify_xfer(struct ata_queued_cmd *qc ) { struct ata_device *dev ; int tmp ; int tmp___0 ; { dev = qc->dev; tmp = ata_is_nodata((int )qc->tf.protocol); if (tmp != 0) { return; } else { } if (dev->mwdma_mask != 0UL || dev->udma_mask != 0UL) { tmp___0 = ata_is_pio((int )qc->tf.protocol); if (tmp___0 != 0) { return; } else { } } else { } dev->flags = dev->flags & 0xfffffffffffeffffUL; return; } } void ata_qc_complete(struct ata_queued_cmd *qc ) { struct ata_port *ap ; struct ata_device *dev ; struct ata_eh_info *ehi ; long tmp ; unsigned int tmp___0 ; long tmp___1 ; long tmp___2 ; bool __warned ; int __ret_warn_once ; int __ret_warn_on ; long tmp___3 ; long tmp___4 ; long tmp___5 ; long tmp___6 ; { ap = qc->ap; if ((unsigned long )(ap->ops)->error_handler != (unsigned long )((void (*)(struct ata_port * ))0)) { dev = qc->dev; ehi = & (dev->link)->eh_info; tmp = ldv__builtin_expect(qc->err_mask != 0U, 0L); if (tmp != 0L) { qc->flags = qc->flags | 65536UL; } else { } tmp___0 = ata_tag_internal(qc->tag); tmp___1 = ldv__builtin_expect(tmp___0 != 0U, 0L); if (tmp___1 != 0L) { fill_result_tf(qc); trace_ata_qc_complete_internal(qc); __ata_qc_complete(qc); return; } else { } tmp___2 = ldv__builtin_expect((qc->flags & 65536UL) != 0UL, 0L); if (tmp___2 != 0L) { fill_result_tf(qc); trace_ata_qc_complete_failed(qc); ata_qc_schedule_eh(qc); return; } else { } __ret_warn_once = (ap->pflags & 4U) != 0U; tmp___5 = ldv__builtin_expect(__ret_warn_once != 0, 0L); if (tmp___5 != 0L) { __ret_warn_on = ! __warned; tmp___3 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___3 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-core.c", 4937); } else { } tmp___4 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___4 != 0L) { __warned = 1; } else { } } else { } ldv__builtin_expect(__ret_warn_once != 0, 0L); if ((qc->flags & 16UL) != 0UL) { fill_result_tf(qc); } else { } trace_ata_qc_complete_done(qc); switch ((int )qc->tf.command) { case 239: ; if ((unsigned int )qc->tf.feature != 2U && (unsigned int )qc->tf.feature != 130U) { goto ldv_50063; } else { } case 145: ; case 198: ehi->dev_action[dev->devno] = ehi->dev_action[dev->devno] | 1U; ata_port_schedule_eh(ap); goto ldv_50063; case 230: dev->flags = dev->flags | 32768UL; goto ldv_50063; } ldv_50063: tmp___6 = ldv__builtin_expect((dev->flags & 65536UL) != 0UL, 0L); if (tmp___6 != 0L) { ata_verify_xfer(qc); } else { } __ata_qc_complete(qc); } else { if ((qc->flags & 262144UL) != 0UL) { return; } else { } if (qc->err_mask != 0U || (qc->flags & 16UL) != 0UL) { fill_result_tf(qc); } else { } __ata_qc_complete(qc); } return; } } int ata_qc_complete_multiple(struct ata_port *ap , u32 qc_active ) { int nr_done ; u32 done_mask ; long tmp ; struct ata_queued_cmd *qc ; unsigned int tag ; unsigned long tmp___0 ; { nr_done = 0; done_mask = ap->qc_active ^ qc_active; tmp = ldv__builtin_expect((done_mask & qc_active) != 0U, 0L); if (tmp != 0L) { ata_port_printk((struct ata_port const *)ap, "\v", "illegal qc_active transition (%08x->%08x)\n", ap->qc_active, qc_active); return (-22); } else { } goto ldv_50076; ldv_50075: tmp___0 = __ffs((unsigned long )done_mask); tag = (unsigned int )tmp___0; qc = ata_qc_from_tag(ap, tag); if ((unsigned long )qc != (unsigned long )((struct ata_queued_cmd *)0)) { ata_qc_complete(qc); nr_done = nr_done + 1; } else { } done_mask = (u32 )(~ (1 << (int )tag)) & done_mask; ldv_50076: ; if (done_mask != 0U) { goto ldv_50075; } else { } return (nr_done); } } void ata_qc_issue(struct ata_queued_cmd *qc ) { struct ata_port *ap ; struct ata_link *link ; u8 prot ; bool __warned ; int __ret_warn_once ; unsigned int tmp ; int tmp___0 ; int __ret_warn_on ; long tmp___1 ; long tmp___2 ; long tmp___3 ; bool __warned___0 ; int __ret_warn_once___0 ; int __ret_warn_on___0 ; long tmp___4 ; long tmp___5 ; long tmp___6 ; bool __warned___1 ; int __ret_warn_once___1 ; int __ret_warn_on___1 ; long tmp___7 ; long tmp___8 ; long tmp___9 ; int tmp___10 ; bool __warned___2 ; int __ret_warn_once___2 ; int tmp___11 ; int __ret_warn_on___2 ; long tmp___12 ; long tmp___13 ; long tmp___14 ; long tmp___15 ; int tmp___16 ; int tmp___17 ; int tmp___18 ; long tmp___19 ; unsigned int tmp___20 ; long tmp___21 ; { ap = qc->ap; link = (qc->dev)->link; prot = qc->tf.protocol; if ((unsigned long )(ap->ops)->error_handler != (unsigned long )((void (*)(struct ata_port * ))0)) { tmp = ata_tag_valid(link->active_tag); if (tmp != 0U) { tmp___0 = 1; } else { tmp___0 = 0; } } else { tmp___0 = 0; } __ret_warn_once = tmp___0; tmp___3 = ldv__builtin_expect(__ret_warn_once != 0, 0L); if (tmp___3 != 0L) { __ret_warn_on = ! __warned; tmp___1 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-core.c", 5051); } else { } tmp___2 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___2 != 0L) { __warned = 1; } else { } } else { } ldv__builtin_expect(__ret_warn_once != 0, 0L); tmp___10 = ata_is_ncq((int )prot); if (tmp___10 != 0) { __ret_warn_once___0 = (link->sactive & (u32 )(1 << (int )qc->tag)) != 0U; tmp___6 = ldv__builtin_expect(__ret_warn_once___0 != 0, 0L); if (tmp___6 != 0L) { __ret_warn_on___0 = ! __warned___0; tmp___4 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___4 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-core.c", 5054); } else { } tmp___5 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___5 != 0L) { __warned___0 = 1; } else { } } else { } ldv__builtin_expect(__ret_warn_once___0 != 0, 0L); if (link->sactive == 0U) { ap->nr_active_links = ap->nr_active_links + 1; } else { } link->sactive = link->sactive | (u32 )(1 << (int )qc->tag); } else { __ret_warn_once___1 = link->sactive != 0U; tmp___9 = ldv__builtin_expect(__ret_warn_once___1 != 0, 0L); if (tmp___9 != 0L) { __ret_warn_on___1 = ! __warned___1; tmp___7 = ldv__builtin_expect(__ret_warn_on___1 != 0, 0L); if (tmp___7 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-core.c", 5060); } else { } tmp___8 = ldv__builtin_expect(__ret_warn_on___1 != 0, 0L); if (tmp___8 != 0L) { __warned___1 = 1; } else { } } else { } ldv__builtin_expect(__ret_warn_once___1 != 0, 0L); ap->nr_active_links = ap->nr_active_links + 1; link->active_tag = qc->tag; } qc->flags = qc->flags | 1UL; ap->qc_active = ap->qc_active | (unsigned int )(1 << (int )qc->tag); tmp___11 = ata_is_data((int )prot); __ret_warn_once___2 = tmp___11 != 0 && (((unsigned long )qc->sg == (unsigned long )((struct scatterlist *)0) || qc->n_elem == 0U) || qc->nbytes == 0U); tmp___14 = ldv__builtin_expect(__ret_warn_once___2 != 0, 0L); if (tmp___14 != 0L) { __ret_warn_on___2 = ! __warned___2; tmp___12 = ldv__builtin_expect(__ret_warn_on___2 != 0, 0L); if (tmp___12 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-core.c", 5074); } else { } tmp___13 = ldv__builtin_expect(__ret_warn_on___2 != 0, 0L); if (tmp___13 != 0L) { __warned___2 = 1; } else { } } else { } tmp___15 = ldv__builtin_expect(__ret_warn_once___2 != 0, 0L); if (tmp___15 != 0L) { goto sys_err; } else { } tmp___17 = ata_is_dma((int )prot); if (tmp___17 != 0) { goto _L; } else { tmp___18 = ata_is_pio((int )prot); if (tmp___18 != 0 && (ap->flags & 128UL) != 0UL) { _L: /* CIL Label */ tmp___16 = ata_sg_setup(qc); if (tmp___16 != 0) { goto sys_err; } else { } } else { } } tmp___19 = ldv__builtin_expect(((qc->dev)->flags & 32768UL) != 0UL, 0L); if (tmp___19 != 0L) { link->eh_info.action = link->eh_info.action | 6U; ata_ehi_push_desc(& link->eh_info, "waking up from sleep"); ata_link_abort(link); return; } else { } (*((ap->ops)->qc_prep))(qc); trace_ata_qc_issue(qc); tmp___20 = (*((ap->ops)->qc_issue))(qc); qc->err_mask = qc->err_mask | tmp___20; tmp___21 = ldv__builtin_expect(qc->err_mask != 0U, 0L); if (tmp___21 != 0L) { goto err; } else { } return; sys_err: qc->err_mask = qc->err_mask | 64U; err: ata_qc_complete(qc); return; } } int sata_scr_valid(struct ata_link *link ) { struct ata_port *ap ; { ap = link->ap; return ((ap->flags & 2UL) != 0UL && (unsigned long )(ap->ops)->scr_read != (unsigned long )((int (*)(struct ata_link * , unsigned int , u32 * ))0)); } } int sata_scr_read(struct ata_link *link , int reg , u32 *val ) { int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; { tmp___1 = ata_is_host_link((struct ata_link const *)link); if (tmp___1 != 0) { tmp___0 = sata_scr_valid(link); if (tmp___0 != 0) { tmp = (*(((link->ap)->ops)->scr_read))(link, (unsigned int )reg, val); return (tmp); } else { } return (-95); } else { } tmp___2 = sata_pmp_scr_read(link, reg, val); return (tmp___2); } } int sata_scr_write(struct ata_link *link , int reg , u32 val ) { int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; { tmp___1 = ata_is_host_link((struct ata_link const *)link); if (tmp___1 != 0) { tmp___0 = sata_scr_valid(link); if (tmp___0 != 0) { tmp = (*(((link->ap)->ops)->scr_write))(link, (unsigned int )reg, val); return (tmp); } else { } return (-95); } else { } tmp___2 = sata_pmp_scr_write(link, reg, val); return (tmp___2); } } int sata_scr_write_flush(struct ata_link *link , int reg , u32 val ) { int rc ; int tmp ; int tmp___0 ; int tmp___1 ; { tmp___0 = ata_is_host_link((struct ata_link const *)link); if (tmp___0 != 0) { tmp = sata_scr_valid(link); if (tmp != 0) { rc = (*(((link->ap)->ops)->scr_write))(link, (unsigned int )reg, val); if (rc == 0) { rc = (*(((link->ap)->ops)->scr_read))(link, (unsigned int )reg, & val); } else { } return (rc); } else { } return (-95); } else { } tmp___1 = sata_pmp_scr_write(link, reg, val); return (tmp___1); } } bool ata_phys_link_online(struct ata_link *link ) { u32 sstatus ; int tmp ; bool tmp___0 ; { tmp = sata_scr_read(link, 0, & sstatus); if (tmp == 0) { tmp___0 = ata_sstatus_online(sstatus); if ((int )tmp___0) { return (1); } else { } } else { } return (0); } } bool ata_phys_link_offline(struct ata_link *link ) { u32 sstatus ; int tmp ; bool tmp___0 ; int tmp___1 ; { tmp = sata_scr_read(link, 0, & sstatus); if (tmp == 0) { tmp___0 = ata_sstatus_online(sstatus); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { return (1); } else { } } else { } return (0); } } bool ata_link_online(struct ata_link *link ) { struct ata_link *slave ; int __ret_warn_on ; long tmp ; bool tmp___0 ; bool tmp___1 ; int tmp___2 ; { slave = (link->ap)->slave_link; __ret_warn_on = (unsigned long )link == (unsigned long )slave; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-core.c", 5276); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); tmp___0 = ata_phys_link_online(link); if ((int )tmp___0) { tmp___2 = 1; } else if ((unsigned long )slave != (unsigned long )((struct ata_link *)0)) { tmp___1 = ata_phys_link_online(slave); if ((int )tmp___1) { tmp___2 = 1; } else { tmp___2 = 0; } } else { tmp___2 = 0; } return ((bool )tmp___2); } } bool ata_link_offline(struct ata_link *link ) { struct ata_link *slave ; int __ret_warn_on ; long tmp ; bool tmp___0 ; bool tmp___1 ; int tmp___2 ; { slave = (link->ap)->slave_link; __ret_warn_on = (unsigned long )link == (unsigned long )slave; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-core.c", 5302); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); tmp___0 = ata_phys_link_offline(link); if ((int )tmp___0) { if ((unsigned long )slave == (unsigned long )((struct ata_link *)0)) { tmp___2 = 1; } else { tmp___1 = ata_phys_link_offline(slave); if ((int )tmp___1) { tmp___2 = 1; } else { tmp___2 = 0; } } } else { tmp___2 = 0; } return ((bool )tmp___2); } } static void ata_port_request_pm(struct ata_port *ap , pm_message_t mesg , unsigned int action , unsigned int ehi_flags , bool async ) { struct ata_link *link ; unsigned long flags ; int __ret_warn_on ; long tmp ; raw_spinlock_t *tmp___0 ; int __ret_warn_on___0 ; long tmp___1 ; { if ((ap->pflags & 262144U) != 0U) { ata_port_wait_eh(ap); __ret_warn_on = (ap->pflags & 262144U) != 0U; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-core.c", 5321); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); } else { } tmp___0 = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp___0); ap->pm_mesg = mesg; ap->pflags = ap->pflags | 262144U; link = ata_link_next((struct ata_link *)0, ap, 1); goto ldv_50161; ldv_50160: link->eh_info.action = link->eh_info.action | action; link->eh_info.flags = link->eh_info.flags | ehi_flags; link = ata_link_next(link, ap, 1); ldv_50161: ; if ((unsigned long )link != (unsigned long )((struct ata_link *)0)) { goto ldv_50160; } else { } ata_port_schedule_eh(ap); spin_unlock_irqrestore(ap->lock, flags); if (! async) { ata_port_wait_eh(ap); __ret_warn_on___0 = (ap->pflags & 262144U) != 0U; tmp___1 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-core.c", 5340); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); } else { } return; } } static unsigned int const ata_port_suspend_ehi = 28U; static void ata_port_suspend(struct ata_port *ap , pm_message_t mesg ) { { ata_port_request_pm(ap, mesg, 0U, ata_port_suspend_ehi, 0); return; } } static void ata_port_suspend_async(struct ata_port *ap , pm_message_t mesg ) { { ata_port_request_pm(ap, mesg, 0U, ata_port_suspend_ehi, 1); return; } } static int ata_port_pm_suspend(struct device *dev ) { struct ata_port *ap ; struct device const *__mptr ; bool tmp ; struct pm_message __constr_expr_0___0 ; { __mptr = (struct device const *)dev; ap = (struct ata_port *)__mptr + 0xffffffffffffc450UL; tmp = pm_runtime_suspended(dev); if ((int )tmp) { return (0); } else { } __constr_expr_0___0.event = 2; ata_port_suspend(ap, __constr_expr_0___0); return (0); } } static int ata_port_pm_freeze(struct device *dev ) { struct ata_port *ap ; struct device const *__mptr ; bool tmp ; struct pm_message __constr_expr_0___0 ; { __mptr = (struct device const *)dev; ap = (struct ata_port *)__mptr + 0xffffffffffffc450UL; tmp = pm_runtime_suspended(dev); if ((int )tmp) { return (0); } else { } __constr_expr_0___0.event = 1; ata_port_suspend(ap, __constr_expr_0___0); return (0); } } static int ata_port_pm_poweroff(struct device *dev ) { struct pm_message __constr_expr_0___0 ; struct device const *__mptr ; { __constr_expr_0___0.event = 4; __mptr = (struct device const *)dev; ata_port_suspend((struct ata_port *)__mptr + 0xffffffffffffc450UL, __constr_expr_0___0); return (0); } } static unsigned int const ata_port_resume_ehi = 12U; static void ata_port_resume(struct ata_port *ap , pm_message_t mesg ) { { ata_port_request_pm(ap, mesg, 6U, ata_port_resume_ehi, 0); return; } } static void ata_port_resume_async(struct ata_port *ap , pm_message_t mesg ) { { ata_port_request_pm(ap, mesg, 6U, ata_port_resume_ehi, 1); return; } } static int ata_port_pm_resume(struct device *dev ) { struct pm_message __constr_expr_0___0 ; struct device const *__mptr ; { __constr_expr_0___0.event = 16; __mptr = (struct device const *)dev; ata_port_resume_async((struct ata_port *)__mptr + 0xffffffffffffc450UL, __constr_expr_0___0); pm_runtime_disable(dev); pm_runtime_set_active(dev); pm_runtime_enable(dev); return (0); } } static int ata_port_runtime_idle(struct device *dev ) { struct ata_port *ap ; struct device const *__mptr ; struct ata_link *link ; struct ata_device *adev ; bool tmp ; int tmp___0 ; { __mptr = (struct device const *)dev; ap = (struct ata_port *)__mptr + 0xffffffffffffc450UL; link = ata_link_next((struct ata_link *)0, ap, 1); goto ldv_50221; ldv_50220: adev = ata_dev_next((struct ata_device *)0, link, 0); goto ldv_50218; ldv_50217: ; if (adev->class == 3U) { tmp = zpodd_dev_enabled(adev); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { return (-16); } else { } } else { } adev = ata_dev_next(adev, link, 0); ldv_50218: ; if ((unsigned long )adev != (unsigned long )((struct ata_device *)0)) { goto ldv_50217; } else { } link = ata_link_next(link, ap, 1); ldv_50221: ; if ((unsigned long )link != (unsigned long )((struct ata_link *)0)) { goto ldv_50220; } else { } return (0); } } static int ata_port_runtime_suspend(struct device *dev ) { struct pm_message __constr_expr_0___0 ; struct device const *__mptr ; { __constr_expr_0___0.event = 1026; __mptr = (struct device const *)dev; ata_port_suspend((struct ata_port *)__mptr + 0xffffffffffffc450UL, __constr_expr_0___0); return (0); } } static int ata_port_runtime_resume(struct device *dev ) { struct pm_message __constr_expr_0___0 ; struct device const *__mptr ; { __constr_expr_0___0.event = 1040; __mptr = (struct device const *)dev; ata_port_resume((struct ata_port *)__mptr + 0xffffffffffffc450UL, __constr_expr_0___0); return (0); } } static struct dev_pm_ops const ata_port_pm_ops = {0, 0, & ata_port_pm_suspend, & ata_port_pm_resume, & ata_port_pm_freeze, & ata_port_pm_resume, & ata_port_pm_poweroff, & ata_port_pm_resume, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & ata_port_runtime_suspend, & ata_port_runtime_resume, & ata_port_runtime_idle}; void ata_sas_port_suspend(struct ata_port *ap ) { struct pm_message __constr_expr_0___0 ; { __constr_expr_0___0.event = 2; ata_port_suspend_async(ap, __constr_expr_0___0); return; } } static char const __kstrtab_ata_sas_port_suspend[21U] = { 'a', 't', 'a', '_', 's', 'a', 's', '_', 'p', 'o', 'r', 't', '_', 's', 'u', 's', 'p', 'e', 'n', 'd', '\000'}; struct kernel_symbol const __ksymtab_ata_sas_port_suspend ; struct kernel_symbol const __ksymtab_ata_sas_port_suspend = {(unsigned long )(& ata_sas_port_suspend), (char const *)(& __kstrtab_ata_sas_port_suspend)}; void ata_sas_port_resume(struct ata_port *ap ) { struct pm_message __constr_expr_0___0 ; { __constr_expr_0___0.event = 16; ata_port_resume_async(ap, __constr_expr_0___0); return; } } static char const __kstrtab_ata_sas_port_resume[20U] = { 'a', 't', 'a', '_', 's', 'a', 's', '_', 'p', 'o', 'r', 't', '_', 'r', 'e', 's', 'u', 'm', 'e', '\000'}; struct kernel_symbol const __ksymtab_ata_sas_port_resume ; struct kernel_symbol const __ksymtab_ata_sas_port_resume = {(unsigned long )(& ata_sas_port_resume), (char const *)(& __kstrtab_ata_sas_port_resume)}; int ata_host_suspend(struct ata_host *host , pm_message_t mesg ) { { (host->dev)->power.power_state = mesg; return (0); } } void ata_host_resume(struct ata_host *host ) { struct pm_message __constr_expr_0___0 ; { __constr_expr_0___0.event = 0; (host->dev)->power.power_state = __constr_expr_0___0; return; } } struct device_type ata_port_type = {"ata_port", 0, 0, 0, 0, & ata_port_pm_ops}; void ata_dev_init(struct ata_device *dev ) { struct ata_link *link ; struct ata_link *tmp ; struct ata_port *ap ; unsigned long flags ; raw_spinlock_t *tmp___0 ; { tmp = ata_dev_phys_link(dev); link = tmp; ap = link->ap; link->sata_spd_limit = link->hw_sata_spd_limit; link->sata_spd = 0U; tmp___0 = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp___0); dev->flags = dev->flags & 0xffffffffff000000UL; dev->horkage = 0U; spin_unlock_irqrestore(ap->lock, flags); memset((void *)dev + 1480UL, 0, 632UL); dev->pio_mask = 4294967295UL; dev->mwdma_mask = 4294967295UL; dev->udma_mask = 4294967295UL; return; } } void ata_link_init(struct ata_port *ap , struct ata_link *link , int pmp ) { int i ; struct ata_device *dev ; { memset((void *)link + 1432UL, 0, 360UL); link->ap = ap; link->pmp = pmp; link->active_tag = 4210818301U; link->hw_sata_spd_limit = 4294967295U; i = 0; goto ldv_50284; ldv_50283: dev = (struct ata_device *)(& link->device) + (unsigned long )i; dev->link = link; dev->devno = (unsigned int )(((long )dev - (long )(& link->device)) / 2632L); dev->gtf_filter = ata_acpi_gtf_filter; ata_dev_init(dev); i = i + 1; ldv_50284: ; if (i <= 1) { goto ldv_50283; } else { } return; } } int sata_link_init_spd(struct ata_link *link ) { u8 spd ; int rc ; { rc = sata_scr_read(link, 2, & link->saved_scontrol); if (rc != 0) { return (rc); } else { } spd = (unsigned int )((u8 )(link->saved_scontrol >> 4)) & 15U; if ((unsigned int )spd != 0U) { link->hw_sata_spd_limit = link->hw_sata_spd_limit & (unsigned int )((1 << (int )spd) + -1); } else { } ata_force_link_limits(link); link->sata_spd_limit = link->hw_sata_spd_limit; return (0); } } struct ata_port *ata_port_alloc(struct ata_host *host ) { struct ata_port *ap ; void *tmp ; struct lock_class_key __key ; struct lock_class_key __key___0 ; atomic_long_t __constr_expr_0___0 ; struct lock_class_key __key___1 ; struct lock_class_key __key___2 ; atomic_long_t __constr_expr_1___0 ; struct lock_class_key __key___3 ; struct lock_class_key __key___4 ; { tmp = kzalloc(18112UL, 208U); ap = (struct ata_port *)tmp; if ((unsigned long )ap == (unsigned long )((struct ata_port *)0)) { return ((struct ata_port *)0); } else { } ap->pflags = ap->pflags | 132U; ap->lock = & host->lock; ap->print_id = 4294967295U; ap->local_port_no = 4294967295U; ap->host = host; ap->dev = host->dev; ap->msg_enable = 137U; __mutex_init(& ap->scsi_scan_mutex, "&ap->scsi_scan_mutex", & __key); __init_work(& ap->hotplug_task.work, 0); __constr_expr_0___0.counter = 137438953408L; ap->hotplug_task.work.data = __constr_expr_0___0; lockdep_init_map(& ap->hotplug_task.work.lockdep_map, "(&(&ap->hotplug_task)->work)", & __key___0, 0); INIT_LIST_HEAD(& ap->hotplug_task.work.entry); ap->hotplug_task.work.func = & ata_scsi_hotplug; init_timer_key(& ap->hotplug_task.timer, 2097152U, "(&(&ap->hotplug_task)->timer)", & __key___1); ap->hotplug_task.timer.function = & delayed_work_timer_fn; ap->hotplug_task.timer.data = (unsigned long )(& ap->hotplug_task); __init_work(& ap->scsi_rescan_task, 0); __constr_expr_1___0.counter = 137438953408L; ap->scsi_rescan_task.data = __constr_expr_1___0; lockdep_init_map(& ap->scsi_rescan_task.lockdep_map, "(&ap->scsi_rescan_task)", & __key___2, 0); INIT_LIST_HEAD(& ap->scsi_rescan_task.entry); ap->scsi_rescan_task.func = & ata_scsi_dev_rescan; INIT_LIST_HEAD(& ap->eh_done_q); __init_waitqueue_head(& ap->eh_wait_q, "&ap->eh_wait_q", & __key___3); init_completion(& ap->park_req_pending); init_timer_key(& ap->fastdrain_timer, 1048576U, "(&ap->fastdrain_timer)", & __key___4); ap->fastdrain_timer.function = & ata_eh_fastdrain_timerfn; ap->fastdrain_timer.data = (unsigned long )ap; ap->cbl = 0U; ata_link_init(ap, & ap->link, 0); ata_sff_port_init(ap); return (ap); } } static void ata_host_release(struct device *gendev , void *res ) { struct ata_host *host ; void *tmp ; int i ; struct ata_port *ap ; { tmp = dev_get_drvdata((struct device const *)gendev); host = (struct ata_host *)tmp; i = 0; goto ldv_50312; ldv_50311: ap = host->ports[i]; if ((unsigned long )ap == (unsigned long )((struct ata_port *)0)) { goto ldv_50310; } else { } if ((unsigned long )ap->scsi_host != (unsigned long )((struct Scsi_Host *)0)) { scsi_host_put(ap->scsi_host); } else { } kfree((void const *)ap->pmp_link); kfree((void const *)ap->slave_link); kfree((void const *)ap); host->ports[i] = (struct ata_port *)0; ldv_50310: i = i + 1; ldv_50312: ; if ((unsigned int )i < host->n_ports) { goto ldv_50311; } else { } dev_set_drvdata(gendev, (void *)0); return; } } struct ata_host *ata_host_alloc(struct device *dev , int max_ports ) { struct ata_host *host ; size_t sz ; int i ; void *tmp ; void *tmp___0 ; struct lock_class_key __key ; struct lock_class_key __key___0 ; struct ata_port *ap ; { tmp = devres_open_group(dev, (void *)0, 208U); if ((unsigned long )tmp == (unsigned long )((void *)0)) { return ((struct ata_host *)0); } else { } sz = ((unsigned long )(max_ports + 1) + 37UL) * 8UL; tmp___0 = __devres_alloc(& ata_host_release, sz, 208U, "ata_host_release"); host = (struct ata_host *)tmp___0; if ((unsigned long )host == (unsigned long )((struct ata_host *)0)) { goto err_out; } else { } devres_add(dev, (void *)host); dev_set_drvdata(dev, (void *)host); spinlock_check(& host->lock); __raw_spin_lock_init(& host->lock.__annonCompField18.rlock, "&(&host->lock)->rlock", & __key); __mutex_init(& host->eh_mutex, "&host->eh_mutex", & __key___0); host->dev = dev; host->n_ports = (unsigned int )max_ports; i = 0; goto ldv_50326; ldv_50325: ap = ata_port_alloc(host); if ((unsigned long )ap == (unsigned long )((struct ata_port *)0)) { goto err_out; } else { } ap->port_no = (unsigned int )i; host->ports[i] = ap; i = i + 1; ldv_50326: ; if (i < max_ports) { goto ldv_50325; } else { } devres_remove_group(dev, (void *)0); return (host); err_out: devres_release_group(dev, (void *)0); return ((struct ata_host *)0); } } struct ata_host *ata_host_alloc_pinfo(struct device *dev , struct ata_port_info const * const *ppi , int n_ports ) { struct ata_port_info const *pi ; struct ata_host *host ; int i ; int j ; struct ata_port *ap ; int tmp ; { host = ata_host_alloc(dev, n_ports); if ((unsigned long )host == (unsigned long )((struct ata_host *)0)) { return ((struct ata_host *)0); } else { } i = 0; j = 0; pi = (struct ata_port_info const *)0; goto ldv_50339; ldv_50338: ap = host->ports[i]; if ((unsigned long )*(ppi + (unsigned long )j) != (unsigned long )((struct ata_port_info const */* const */)0)) { tmp = j; j = j + 1; pi = *(ppi + (unsigned long )tmp); } else { } ap->pio_mask = (unsigned int )pi->pio_mask; ap->mwdma_mask = (unsigned int )pi->mwdma_mask; ap->udma_mask = (unsigned int )pi->udma_mask; ap->flags = ap->flags | (unsigned long )pi->flags; ap->link.flags = ap->link.flags | (unsigned int )pi->link_flags; ap->ops = pi->port_ops; if ((unsigned long )host->ops == (unsigned long )((struct ata_port_operations *)0) && (unsigned long )((struct ata_port_operations *)pi->port_ops) != (unsigned long )(& ata_dummy_port_ops)) { host->ops = pi->port_ops; } else { } i = i + 1; ldv_50339: ; if ((unsigned int )i < host->n_ports) { goto ldv_50338; } else { } return (host); } } int ata_slave_link_init(struct ata_port *ap ) { struct ata_link *link ; int __ret_warn_on ; long tmp ; int __ret_warn_on___0 ; long tmp___0 ; void *tmp___1 ; { __ret_warn_on = (unsigned long )ap->slave_link != (unsigned long )((struct ata_link *)0); tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-core.c", 5866); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); __ret_warn_on___0 = (ap->flags & 524288UL) != 0UL; tmp___0 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-core.c", 5867); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); tmp___1 = kzalloc(7064UL, 208U); link = (struct ata_link *)tmp___1; if ((unsigned long )link == (unsigned long )((struct ata_link *)0)) { return (-12); } else { } ata_link_init(ap, link, 1); ap->slave_link = link; return (0); } } static void ata_host_stop(struct device *gendev , void *res ) { struct ata_host *host ; void *tmp ; int i ; int __ret_warn_on ; long tmp___0 ; struct ata_port *ap ; { tmp = dev_get_drvdata((struct device const *)gendev); host = (struct ata_host *)tmp; __ret_warn_on = (host->flags & 2UL) == 0UL; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-core.c", 5883); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); i = 0; goto ldv_50359; ldv_50358: ap = host->ports[i]; if ((unsigned long )(ap->ops)->port_stop != (unsigned long )((void (*)(struct ata_port * ))0)) { (*((ap->ops)->port_stop))(ap); } else { } i = i + 1; ldv_50359: ; if ((unsigned int )i < host->n_ports) { goto ldv_50358; } else { } if ((unsigned long )(host->ops)->host_stop != (unsigned long )((void (*)(struct ata_host * ))0)) { (*((host->ops)->host_stop))(host); } else { } return; } } static void ata_finalize_port_ops(struct ata_port_operations *ops ) { spinlock_t lock ; struct ata_port_operations const *cur ; void **begin ; void **end ; void **pp ; void **inherit ; bool tmp ; { lock.__annonCompField18.rlock.raw_lock.val.counter = 0; lock.__annonCompField18.rlock.magic = 3735899821U; lock.__annonCompField18.rlock.owner_cpu = 4294967295U; lock.__annonCompField18.rlock.owner = (void *)-1; lock.__annonCompField18.rlock.dep_map.key = 0; lock.__annonCompField18.rlock.dep_map.class_cache[0] = 0; lock.__annonCompField18.rlock.dep_map.class_cache[1] = 0; lock.__annonCompField18.rlock.dep_map.name = "lock"; lock.__annonCompField18.rlock.dep_map.cpu = 0; lock.__annonCompField18.rlock.dep_map.ip = 0UL; begin = (void **)ops; end = (void **)(& ops->inherits); if ((unsigned long )ops == (unsigned long )((struct ata_port_operations *)0) || (unsigned long )ops->inherits == (unsigned long )((struct ata_port_operations const *)0)) { return; } else { } spin_lock(& lock); cur = ops->inherits; goto ldv_50375; ldv_50374: inherit = (void **)cur; pp = begin; goto ldv_50372; ldv_50371: ; if ((unsigned long )*pp == (unsigned long )((void *)0)) { *pp = *inherit; } else { } pp = pp + 1; inherit = inherit + 1; ldv_50372: ; if ((unsigned long )pp < (unsigned long )end) { goto ldv_50371; } else { } cur = cur->inherits; ldv_50375: ; if ((unsigned long )cur != (unsigned long )((struct ata_port_operations const *)0)) { goto ldv_50374; } else { } pp = begin; goto ldv_50378; ldv_50377: tmp = IS_ERR((void const *)*pp); if ((int )tmp) { *pp = (void *)0; } else { } pp = pp + 1; ldv_50378: ; if ((unsigned long )pp < (unsigned long )end) { goto ldv_50377; } else { } ops->inherits = (struct ata_port_operations const *)0; spin_unlock(& lock); return; } } int ata_host_start(struct ata_host *host ) { int have_stop ; void *start_dr ; int i ; int rc ; struct ata_port *ap ; int tmp ; struct ata_port *ap___0 ; struct ata_port *ap___1 ; { have_stop = 0; start_dr = (void *)0; if ((host->flags & 2UL) != 0UL) { return (0); } else { } ata_finalize_port_ops(host->ops); i = 0; goto ldv_50389; ldv_50388: ap = host->ports[i]; ata_finalize_port_ops(ap->ops); if ((unsigned long )host->ops == (unsigned long )((struct ata_port_operations *)0)) { tmp = ata_port_is_dummy(ap); if (tmp == 0) { host->ops = ap->ops; } else { } } else { } if ((unsigned long )(ap->ops)->port_stop != (unsigned long )((void (*)(struct ata_port * ))0)) { have_stop = 1; } else { } i = i + 1; ldv_50389: ; if ((unsigned int )i < host->n_ports) { goto ldv_50388; } else { } if ((unsigned long )(host->ops)->host_stop != (unsigned long )((void (*)(struct ata_host * ))0)) { have_stop = 1; } else { } if (have_stop != 0) { start_dr = __devres_alloc(& ata_host_stop, 0UL, 208U, "ata_host_stop"); if ((unsigned long )start_dr == (unsigned long )((void *)0)) { return (-12); } else { } } else { } i = 0; goto ldv_50394; ldv_50393: ap___0 = host->ports[i]; if ((unsigned long )(ap___0->ops)->port_start != (unsigned long )((int (*)(struct ata_port * ))0)) { rc = (*((ap___0->ops)->port_start))(ap___0); if (rc != 0) { if (rc != -19) { dev_err((struct device const *)host->dev, "failed to start port %d (errno=%d)\n", i, rc); } else { } goto err_out; } else { } } else { } ata_eh_freeze_port(ap___0); i = i + 1; ldv_50394: ; if ((unsigned int )i < host->n_ports) { goto ldv_50393; } else { } if ((unsigned long )start_dr != (unsigned long )((void *)0)) { devres_add(host->dev, start_dr); } else { } host->flags = host->flags | 2UL; return (0); err_out: ; goto ldv_50398; ldv_50397: ap___1 = host->ports[i]; if ((unsigned long )(ap___1->ops)->port_stop != (unsigned long )((void (*)(struct ata_port * ))0)) { (*((ap___1->ops)->port_stop))(ap___1); } else { } ldv_50398: i = i - 1; if (i >= 0) { goto ldv_50397; } else { } devres_free(start_dr); return (rc); } } void ata_host_init(struct ata_host *host , struct device *dev , struct ata_port_operations *ops ) { struct lock_class_key __key ; struct lock_class_key __key___0 ; { spinlock_check(& host->lock); __raw_spin_lock_init(& host->lock.__annonCompField18.rlock, "&(&host->lock)->rlock", & __key); __mutex_init(& host->eh_mutex, "&host->eh_mutex", & __key___0); host->n_tags = 31U; host->dev = dev; host->ops = ops; return; } } void __ata_port_probe(struct ata_port *ap ) { struct ata_eh_info *ehi ; unsigned long flags ; raw_spinlock_t *tmp ; { ehi = & ap->link.eh_info; tmp = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp); ehi->probe_mask = ehi->probe_mask | 3U; ehi->action = ehi->action | 6U; ehi->flags = ehi->flags | 12U; ap->pflags = ap->pflags & 4294967167U; ap->pflags = ap->pflags | 16U; ata_port_schedule_eh(ap); spin_unlock_irqrestore(ap->lock, flags); return; } } int ata_port_probe(struct ata_port *ap ) { int rc ; { rc = 0; if ((unsigned long )(ap->ops)->error_handler != (unsigned long )((void (*)(struct ata_port * ))0)) { __ata_port_probe(ap); ata_port_wait_eh(ap); } else { rc = ata_bus_probe(ap); } return (rc); } } static void async_port_probe(void *data , async_cookie_t cookie ) { struct ata_port *ap ; { ap = (struct ata_port *)data; if (((ap->host)->flags & 4UL) == 0UL && ap->port_no != 0U) { async_synchronize_cookie(cookie); } else { } ata_port_probe(ap); async_synchronize_cookie(cookie); ata_scsi_scan_host(ap, 1); return; } } int ata_host_register(struct ata_host *host , struct scsi_host_template *sht ) { int i ; int rc ; int _min1 ; int _max1 ; int _max2 ; int _min2 ; int __ret_warn_on ; long tmp ; int tmp___0 ; struct ata_port *ap ; unsigned long xfer_mask ; char const *tmp___1 ; int tmp___2 ; struct ata_port *ap___0 ; { _max1 = sht->can_queue; _max2 = 1; _min1 = _max1 > _max2 ? _max1 : _max2; _min2 = 31; host->n_tags = (unsigned int )(_min1 < _min2 ? _min1 : _min2); if ((host->flags & 2UL) == 0UL) { dev_err((struct device const *)host->dev, "BUG: trying to register unstarted host\n"); __ret_warn_on = 1; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-core.c", 6125); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); return (-22); } else { } i = (int )host->n_ports; goto ldv_50442; ldv_50441: kfree((void const *)host->ports[i]); i = i + 1; ldv_50442: ; if ((unsigned long )host->ports[i] != (unsigned long )((struct ata_port *)0)) { goto ldv_50441; } else { } i = 0; goto ldv_50445; ldv_50444: tmp___0 = atomic_add_return(1, & ata_print_id); (host->ports[i])->print_id = (unsigned int )tmp___0; (host->ports[i])->local_port_no = (unsigned int )(i + 1); i = i + 1; ldv_50445: ; if ((unsigned int )i < host->n_ports) { goto ldv_50444; } else { } i = 0; goto ldv_50449; ldv_50448: rc = ata_tport_add(host->dev, host->ports[i]); if (rc != 0) { goto err_tadd; } else { } i = i + 1; ldv_50449: ; if ((unsigned int )i < host->n_ports) { goto ldv_50448; } else { } rc = ata_scsi_add_hosts(host, sht); if (rc != 0) { goto err_tadd; } else { } i = 0; goto ldv_50454; ldv_50453: ap = host->ports[i]; if (ap->cbl == 0U && (ap->flags & 2UL) != 0UL) { ap->cbl = 6U; } else { } sata_link_init_spd(& ap->link); if ((unsigned long )ap->slave_link != (unsigned long )((struct ata_link *)0)) { sata_link_init_spd(ap->slave_link); } else { } xfer_mask = ata_pack_xfermask((unsigned long )ap->pio_mask, (unsigned long )ap->mwdma_mask, (unsigned long )ap->udma_mask); tmp___2 = ata_port_is_dummy(ap); if (tmp___2 == 0) { tmp___1 = ata_mode_string(xfer_mask); ata_port_printk((struct ata_port const *)ap, "\016", "%cATA max %s %s\n", (ap->flags & 2UL) != 0UL ? 83 : 80, tmp___1, (char *)(& ap->link.eh_info.desc)); ata_ehi_clear_desc(& ap->link.eh_info); } else { ata_port_printk((struct ata_port const *)ap, "\016", "DUMMY\n"); } i = i + 1; ldv_50454: ; if ((unsigned int )i < host->n_ports) { goto ldv_50453; } else { } i = 0; goto ldv_50458; ldv_50457: ap___0 = host->ports[i]; async_schedule(& async_port_probe, (void *)ap___0); i = i + 1; ldv_50458: ; if ((unsigned int )i < host->n_ports) { goto ldv_50457; } else { } return (0); err_tadd: ; goto ldv_50461; ldv_50460: ata_tport_delete(host->ports[i]); ldv_50461: i = i - 1; if (i >= 0) { goto ldv_50460; } else { } return (rc); } } int ata_host_activate(struct ata_host *host , int irq , irqreturn_t (*irq_handler)(int , void * ) , unsigned long irq_flags , struct scsi_host_template *sht ) { int i ; int rc ; int __ret_warn_on ; long tmp ; int tmp___0 ; char const *tmp___1 ; { rc = ata_host_start(host); if (rc != 0) { return (rc); } else { } if (irq == 0) { __ret_warn_on = (unsigned long )irq_handler != (unsigned long )((irqreturn_t (*)(int , void * ))0); tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-core.c", 6233); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); tmp___0 = ata_host_register(host, sht); return (tmp___0); } else { } tmp___1 = dev_name((struct device const *)host->dev); rc = devm_request_irq(host->dev, (unsigned int )irq, irq_handler, irq_flags, tmp___1, (void *)host); if (rc != 0) { return (rc); } else { } i = 0; goto ldv_50475; ldv_50474: ata_port_desc(host->ports[i], "irq %d", irq); i = i + 1; ldv_50475: ; if ((unsigned int )i < host->n_ports) { goto ldv_50474; } else { } rc = ata_host_register(host, sht); if (rc != 0) { devm_free_irq(host->dev, (unsigned int )irq, (void *)host); } else { } return (rc); } } static void ata_port_detach(struct ata_port *ap ) { unsigned long flags ; struct ata_link *link ; struct ata_device *dev ; raw_spinlock_t *tmp ; int __ret_warn_on ; long tmp___0 ; bool tmp___1 ; int i ; { if ((unsigned long )(ap->ops)->error_handler == (unsigned long )((void (*)(struct ata_port * ))0)) { goto skip_eh; } else { } tmp = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp); ap->pflags = ap->pflags | 512U; ata_port_schedule_eh(ap); spin_unlock_irqrestore(ap->lock, flags); ata_port_wait_eh(ap); __ret_warn_on = (ap->pflags & 1024U) == 0U; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-core.c", 6283); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); ldv_cancel_delayed_work_sync_10(& ap->hotplug_task); skip_eh: link = ata_link_next((struct ata_link *)0, ap, 1); goto ldv_50493; ldv_50492: dev = ata_dev_next((struct ata_device *)0, link, 2); goto ldv_50490; ldv_50489: tmp___1 = zpodd_dev_enabled(dev); if ((int )tmp___1) { zpodd_exit(dev); } else { } dev = ata_dev_next(dev, link, 2); ldv_50490: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_50489; } else { } link = ata_link_next(link, ap, 1); ldv_50493: ; if ((unsigned long )link != (unsigned long )((struct ata_link *)0)) { goto ldv_50492; } else { } if ((unsigned long )ap->pmp_link != (unsigned long )((struct ata_link *)0)) { i = 0; goto ldv_50497; ldv_50496: ata_tlink_delete(ap->pmp_link + (unsigned long )i); i = i + 1; ldv_50497: ; if (i <= 14) { goto ldv_50496; } else { } } else { } scsi_remove_host(ap->scsi_host); ata_tport_delete(ap); return; } } void ata_host_detach(struct ata_host *host ) { int i ; { i = 0; goto ldv_50504; ldv_50503: ata_port_detach(host->ports[i]); i = i + 1; ldv_50504: ; if ((unsigned int )i < host->n_ports) { goto ldv_50503; } else { } ata_acpi_dissociate(host); return; } } void ata_pci_remove_one(struct pci_dev *pdev ) { struct ata_host *host ; void *tmp ; { tmp = pci_get_drvdata(pdev); host = (struct ata_host *)tmp; ata_host_detach(host); return; } } int pci_test_config_bits(struct pci_dev *pdev , struct pci_bits const *bits ) { unsigned long tmp ; u8 tmp8 ; u16 tmp16 ; u32 tmp32 ; { tmp = 0UL; switch (bits->width) { case 1U: tmp8 = 0U; pci_read_config_byte((struct pci_dev const *)pdev, (int )bits->reg, & tmp8); tmp = (unsigned long )tmp8; goto ldv_50517; case 2U: tmp16 = 0U; pci_read_config_word((struct pci_dev const *)pdev, (int )bits->reg, & tmp16); tmp = (unsigned long )tmp16; goto ldv_50517; case 4U: tmp32 = 0U; pci_read_config_dword((struct pci_dev const *)pdev, (int )bits->reg, & tmp32); tmp = (unsigned long )tmp32; goto ldv_50517; default: ; return (-22); } ldv_50517: tmp = (unsigned long )bits->mask & tmp; return ((unsigned long )bits->val == tmp); } } void ata_pci_device_do_suspend(struct pci_dev *pdev , pm_message_t mesg ) { { pci_save_state(pdev); pci_disable_device(pdev); if ((mesg.event & 6) != 0) { pci_set_power_state(pdev, 3); } else { } return; } } int ata_pci_device_do_resume(struct pci_dev *pdev ) { int rc ; { pci_set_power_state(pdev, 0); pci_restore_state(pdev); rc = pcim_enable_device(pdev); if (rc != 0) { dev_err((struct device const *)(& pdev->dev), "failed to enable device after resume (%d)\n", rc); return (rc); } else { } pci_set_master(pdev); return (0); } } int ata_pci_device_suspend(struct pci_dev *pdev , pm_message_t mesg ) { struct ata_host *host ; void *tmp ; int rc ; { tmp = pci_get_drvdata(pdev); host = (struct ata_host *)tmp; rc = 0; rc = ata_host_suspend(host, mesg); if (rc != 0) { return (rc); } else { } ata_pci_device_do_suspend(pdev, mesg); return (0); } } int ata_pci_device_resume(struct pci_dev *pdev ) { struct ata_host *host ; void *tmp ; int rc ; { tmp = pci_get_drvdata(pdev); host = (struct ata_host *)tmp; rc = ata_pci_device_do_resume(pdev); if (rc == 0) { ata_host_resume(host); } else { } return (rc); } } int ata_platform_remove_one(struct platform_device *pdev ) { struct ata_host *host ; void *tmp ; { tmp = platform_get_drvdata((struct platform_device const *)pdev); host = (struct ata_host *)tmp; ata_host_detach(host); return (0); } } static int ata_parse_force_one(char **cur , struct ata_force_ent *force_ent , char const **reason ) { struct ata_force_param force_tbl[53U] ; char *start ; char *p ; char *id ; char *val ; char *endp ; struct ata_force_param const *match_fp ; int nr_matches ; int i ; char *tmp ; unsigned long tmp___0 ; unsigned long tmp___1 ; struct ata_force_param const *fp ; size_t tmp___2 ; int tmp___3 ; int tmp___4 ; { force_tbl[0].name = "40c"; force_tbl[0].cbl = 1U; force_tbl[0].spd_limit = 0; force_tbl[0].xfer_mask = 0UL; force_tbl[0].horkage_on = 0U; force_tbl[0].horkage_off = 0U; force_tbl[0].lflags = 0U; force_tbl[1].name = "80c"; force_tbl[1].cbl = 2U; force_tbl[1].spd_limit = 0; force_tbl[1].xfer_mask = 0UL; force_tbl[1].horkage_on = 0U; force_tbl[1].horkage_off = 0U; force_tbl[1].lflags = 0U; force_tbl[2].name = "short40c"; force_tbl[2].cbl = 3U; force_tbl[2].spd_limit = 0; force_tbl[2].xfer_mask = 0UL; force_tbl[2].horkage_on = 0U; force_tbl[2].horkage_off = 0U; force_tbl[2].lflags = 0U; force_tbl[3].name = "unk"; force_tbl[3].cbl = 4U; force_tbl[3].spd_limit = 0; force_tbl[3].xfer_mask = 0UL; force_tbl[3].horkage_on = 0U; force_tbl[3].horkage_off = 0U; force_tbl[3].lflags = 0U; force_tbl[4].name = "ign"; force_tbl[4].cbl = 5U; force_tbl[4].spd_limit = 0; force_tbl[4].xfer_mask = 0UL; force_tbl[4].horkage_on = 0U; force_tbl[4].horkage_off = 0U; force_tbl[4].lflags = 0U; force_tbl[5].name = "sata"; force_tbl[5].cbl = 6U; force_tbl[5].spd_limit = 0; force_tbl[5].xfer_mask = 0UL; force_tbl[5].horkage_on = 0U; force_tbl[5].horkage_off = 0U; force_tbl[5].lflags = 0U; force_tbl[6].name = "1.5Gbps"; force_tbl[6].cbl = 0U; force_tbl[6].spd_limit = 1; force_tbl[6].xfer_mask = 0UL; force_tbl[6].horkage_on = 0U; force_tbl[6].horkage_off = 0U; force_tbl[6].lflags = 0U; force_tbl[7].name = "3.0Gbps"; force_tbl[7].cbl = 0U; force_tbl[7].spd_limit = 2; force_tbl[7].xfer_mask = 0UL; force_tbl[7].horkage_on = 0U; force_tbl[7].horkage_off = 0U; force_tbl[7].lflags = 0U; force_tbl[8].name = "noncq"; force_tbl[8].cbl = 0U; force_tbl[8].spd_limit = 0; force_tbl[8].xfer_mask = 0UL; force_tbl[8].horkage_on = 4U; force_tbl[8].horkage_off = 0U; force_tbl[8].lflags = 0U; force_tbl[9].name = "ncq"; force_tbl[9].cbl = 0U; force_tbl[9].spd_limit = 0; force_tbl[9].xfer_mask = 0UL; force_tbl[9].horkage_on = 0U; force_tbl[9].horkage_off = 4U; force_tbl[9].lflags = 0U; force_tbl[10].name = "noncqtrim"; force_tbl[10].cbl = 0U; force_tbl[10].spd_limit = 0; force_tbl[10].xfer_mask = 0UL; force_tbl[10].horkage_on = 524288U; force_tbl[10].horkage_off = 0U; force_tbl[10].lflags = 0U; force_tbl[11].name = "ncqtrim"; force_tbl[11].cbl = 0U; force_tbl[11].spd_limit = 0; force_tbl[11].xfer_mask = 0UL; force_tbl[11].horkage_on = 0U; force_tbl[11].horkage_off = 524288U; force_tbl[11].lflags = 0U; force_tbl[12].name = "dump_id"; force_tbl[12].cbl = 0U; force_tbl[12].spd_limit = 0; force_tbl[12].xfer_mask = 0UL; force_tbl[12].horkage_on = 65536U; force_tbl[12].horkage_off = 0U; force_tbl[12].lflags = 0U; force_tbl[13].name = "pio0"; force_tbl[13].cbl = 0U; force_tbl[13].spd_limit = 0; force_tbl[13].xfer_mask = 1UL; force_tbl[13].horkage_on = 0U; force_tbl[13].horkage_off = 0U; force_tbl[13].lflags = 0U; force_tbl[14].name = "pio1"; force_tbl[14].cbl = 0U; force_tbl[14].spd_limit = 0; force_tbl[14].xfer_mask = 2UL; force_tbl[14].horkage_on = 0U; force_tbl[14].horkage_off = 0U; force_tbl[14].lflags = 0U; force_tbl[15].name = "pio2"; force_tbl[15].cbl = 0U; force_tbl[15].spd_limit = 0; force_tbl[15].xfer_mask = 4UL; force_tbl[15].horkage_on = 0U; force_tbl[15].horkage_off = 0U; force_tbl[15].lflags = 0U; force_tbl[16].name = "pio3"; force_tbl[16].cbl = 0U; force_tbl[16].spd_limit = 0; force_tbl[16].xfer_mask = 8UL; force_tbl[16].horkage_on = 0U; force_tbl[16].horkage_off = 0U; force_tbl[16].lflags = 0U; force_tbl[17].name = "pio4"; force_tbl[17].cbl = 0U; force_tbl[17].spd_limit = 0; force_tbl[17].xfer_mask = 16UL; force_tbl[17].horkage_on = 0U; force_tbl[17].horkage_off = 0U; force_tbl[17].lflags = 0U; force_tbl[18].name = "pio5"; force_tbl[18].cbl = 0U; force_tbl[18].spd_limit = 0; force_tbl[18].xfer_mask = 32UL; force_tbl[18].horkage_on = 0U; force_tbl[18].horkage_off = 0U; force_tbl[18].lflags = 0U; force_tbl[19].name = "pio6"; force_tbl[19].cbl = 0U; force_tbl[19].spd_limit = 0; force_tbl[19].xfer_mask = 64UL; force_tbl[19].horkage_on = 0U; force_tbl[19].horkage_off = 0U; force_tbl[19].lflags = 0U; force_tbl[20].name = "mwdma0"; force_tbl[20].cbl = 0U; force_tbl[20].spd_limit = 0; force_tbl[20].xfer_mask = 128UL; force_tbl[20].horkage_on = 0U; force_tbl[20].horkage_off = 0U; force_tbl[20].lflags = 0U; force_tbl[21].name = "mwdma1"; force_tbl[21].cbl = 0U; force_tbl[21].spd_limit = 0; force_tbl[21].xfer_mask = 256UL; force_tbl[21].horkage_on = 0U; force_tbl[21].horkage_off = 0U; force_tbl[21].lflags = 0U; force_tbl[22].name = "mwdma2"; force_tbl[22].cbl = 0U; force_tbl[22].spd_limit = 0; force_tbl[22].xfer_mask = 512UL; force_tbl[22].horkage_on = 0U; force_tbl[22].horkage_off = 0U; force_tbl[22].lflags = 0U; force_tbl[23].name = "mwdma3"; force_tbl[23].cbl = 0U; force_tbl[23].spd_limit = 0; force_tbl[23].xfer_mask = 1024UL; force_tbl[23].horkage_on = 0U; force_tbl[23].horkage_off = 0U; force_tbl[23].lflags = 0U; force_tbl[24].name = "mwdma4"; force_tbl[24].cbl = 0U; force_tbl[24].spd_limit = 0; force_tbl[24].xfer_mask = 2048UL; force_tbl[24].horkage_on = 0U; force_tbl[24].horkage_off = 0U; force_tbl[24].lflags = 0U; force_tbl[25].name = "udma0"; force_tbl[25].cbl = 0U; force_tbl[25].spd_limit = 0; force_tbl[25].xfer_mask = 4096UL; force_tbl[25].horkage_on = 0U; force_tbl[25].horkage_off = 0U; force_tbl[25].lflags = 0U; force_tbl[26].name = "udma16"; force_tbl[26].cbl = 0U; force_tbl[26].spd_limit = 0; force_tbl[26].xfer_mask = 4096UL; force_tbl[26].horkage_on = 0U; force_tbl[26].horkage_off = 0U; force_tbl[26].lflags = 0U; force_tbl[27].name = "udma/16"; force_tbl[27].cbl = 0U; force_tbl[27].spd_limit = 0; force_tbl[27].xfer_mask = 4096UL; force_tbl[27].horkage_on = 0U; force_tbl[27].horkage_off = 0U; force_tbl[27].lflags = 0U; force_tbl[28].name = "udma1"; force_tbl[28].cbl = 0U; force_tbl[28].spd_limit = 0; force_tbl[28].xfer_mask = 8192UL; force_tbl[28].horkage_on = 0U; force_tbl[28].horkage_off = 0U; force_tbl[28].lflags = 0U; force_tbl[29].name = "udma25"; force_tbl[29].cbl = 0U; force_tbl[29].spd_limit = 0; force_tbl[29].xfer_mask = 8192UL; force_tbl[29].horkage_on = 0U; force_tbl[29].horkage_off = 0U; force_tbl[29].lflags = 0U; force_tbl[30].name = "udma/25"; force_tbl[30].cbl = 0U; force_tbl[30].spd_limit = 0; force_tbl[30].xfer_mask = 8192UL; force_tbl[30].horkage_on = 0U; force_tbl[30].horkage_off = 0U; force_tbl[30].lflags = 0U; force_tbl[31].name = "udma2"; force_tbl[31].cbl = 0U; force_tbl[31].spd_limit = 0; force_tbl[31].xfer_mask = 16384UL; force_tbl[31].horkage_on = 0U; force_tbl[31].horkage_off = 0U; force_tbl[31].lflags = 0U; force_tbl[32].name = "udma33"; force_tbl[32].cbl = 0U; force_tbl[32].spd_limit = 0; force_tbl[32].xfer_mask = 16384UL; force_tbl[32].horkage_on = 0U; force_tbl[32].horkage_off = 0U; force_tbl[32].lflags = 0U; force_tbl[33].name = "udma/33"; force_tbl[33].cbl = 0U; force_tbl[33].spd_limit = 0; force_tbl[33].xfer_mask = 16384UL; force_tbl[33].horkage_on = 0U; force_tbl[33].horkage_off = 0U; force_tbl[33].lflags = 0U; force_tbl[34].name = "udma3"; force_tbl[34].cbl = 0U; force_tbl[34].spd_limit = 0; force_tbl[34].xfer_mask = 32768UL; force_tbl[34].horkage_on = 0U; force_tbl[34].horkage_off = 0U; force_tbl[34].lflags = 0U; force_tbl[35].name = "udma44"; force_tbl[35].cbl = 0U; force_tbl[35].spd_limit = 0; force_tbl[35].xfer_mask = 32768UL; force_tbl[35].horkage_on = 0U; force_tbl[35].horkage_off = 0U; force_tbl[35].lflags = 0U; force_tbl[36].name = "udma/44"; force_tbl[36].cbl = 0U; force_tbl[36].spd_limit = 0; force_tbl[36].xfer_mask = 32768UL; force_tbl[36].horkage_on = 0U; force_tbl[36].horkage_off = 0U; force_tbl[36].lflags = 0U; force_tbl[37].name = "udma4"; force_tbl[37].cbl = 0U; force_tbl[37].spd_limit = 0; force_tbl[37].xfer_mask = 65536UL; force_tbl[37].horkage_on = 0U; force_tbl[37].horkage_off = 0U; force_tbl[37].lflags = 0U; force_tbl[38].name = "udma66"; force_tbl[38].cbl = 0U; force_tbl[38].spd_limit = 0; force_tbl[38].xfer_mask = 65536UL; force_tbl[38].horkage_on = 0U; force_tbl[38].horkage_off = 0U; force_tbl[38].lflags = 0U; force_tbl[39].name = "udma/66"; force_tbl[39].cbl = 0U; force_tbl[39].spd_limit = 0; force_tbl[39].xfer_mask = 65536UL; force_tbl[39].horkage_on = 0U; force_tbl[39].horkage_off = 0U; force_tbl[39].lflags = 0U; force_tbl[40].name = "udma5"; force_tbl[40].cbl = 0U; force_tbl[40].spd_limit = 0; force_tbl[40].xfer_mask = 131072UL; force_tbl[40].horkage_on = 0U; force_tbl[40].horkage_off = 0U; force_tbl[40].lflags = 0U; force_tbl[41].name = "udma100"; force_tbl[41].cbl = 0U; force_tbl[41].spd_limit = 0; force_tbl[41].xfer_mask = 131072UL; force_tbl[41].horkage_on = 0U; force_tbl[41].horkage_off = 0U; force_tbl[41].lflags = 0U; force_tbl[42].name = "udma/100"; force_tbl[42].cbl = 0U; force_tbl[42].spd_limit = 0; force_tbl[42].xfer_mask = 131072UL; force_tbl[42].horkage_on = 0U; force_tbl[42].horkage_off = 0U; force_tbl[42].lflags = 0U; force_tbl[43].name = "udma6"; force_tbl[43].cbl = 0U; force_tbl[43].spd_limit = 0; force_tbl[43].xfer_mask = 262144UL; force_tbl[43].horkage_on = 0U; force_tbl[43].horkage_off = 0U; force_tbl[43].lflags = 0U; force_tbl[44].name = "udma133"; force_tbl[44].cbl = 0U; force_tbl[44].spd_limit = 0; force_tbl[44].xfer_mask = 262144UL; force_tbl[44].horkage_on = 0U; force_tbl[44].horkage_off = 0U; force_tbl[44].lflags = 0U; force_tbl[45].name = "udma/133"; force_tbl[45].cbl = 0U; force_tbl[45].spd_limit = 0; force_tbl[45].xfer_mask = 262144UL; force_tbl[45].horkage_on = 0U; force_tbl[45].horkage_off = 0U; force_tbl[45].lflags = 0U; force_tbl[46].name = "udma7"; force_tbl[46].cbl = 0U; force_tbl[46].spd_limit = 0; force_tbl[46].xfer_mask = 524288UL; force_tbl[46].horkage_on = 0U; force_tbl[46].horkage_off = 0U; force_tbl[46].lflags = 0U; force_tbl[47].name = "nohrst"; force_tbl[47].cbl = 0U; force_tbl[47].spd_limit = 0; force_tbl[47].xfer_mask = 0UL; force_tbl[47].horkage_on = 0U; force_tbl[47].horkage_off = 0U; force_tbl[47].lflags = 2U; force_tbl[48].name = "nosrst"; force_tbl[48].cbl = 0U; force_tbl[48].spd_limit = 0; force_tbl[48].xfer_mask = 0UL; force_tbl[48].horkage_on = 0U; force_tbl[48].horkage_off = 0U; force_tbl[48].lflags = 4U; force_tbl[49].name = "norst"; force_tbl[49].cbl = 0U; force_tbl[49].spd_limit = 0; force_tbl[49].xfer_mask = 0UL; force_tbl[49].horkage_on = 0U; force_tbl[49].horkage_off = 0U; force_tbl[49].lflags = 6U; force_tbl[50].name = "rstonce"; force_tbl[50].cbl = 0U; force_tbl[50].spd_limit = 0; force_tbl[50].xfer_mask = 0UL; force_tbl[50].horkage_on = 0U; force_tbl[50].horkage_off = 0U; force_tbl[50].lflags = 512U; force_tbl[51].name = "atapi_dmadir"; force_tbl[51].cbl = 0U; force_tbl[51].spd_limit = 0; force_tbl[51].xfer_mask = 0UL; force_tbl[51].horkage_on = 262144U; force_tbl[51].horkage_off = 0U; force_tbl[51].lflags = 0U; force_tbl[52].name = "disable"; force_tbl[52].cbl = 0U; force_tbl[52].spd_limit = 0; force_tbl[52].xfer_mask = 0UL; force_tbl[52].horkage_on = 32U; force_tbl[52].horkage_off = 0U; force_tbl[52].lflags = 0U; start = *cur; p = *cur; match_fp = (struct ata_force_param const *)0; nr_matches = 0; goto ldv_50561; ldv_50560: p = p + 1; ldv_50561: ; if ((int )((signed char )*p) != 0 && (int )((signed char )*p) != 44) { goto ldv_50560; } else { } if ((int )((signed char )*p) == 0) { *cur = p; } else { *cur = p + 1UL; } *p = 0; p = strchr((char const *)start, 58); if ((unsigned long )p == (unsigned long )((char *)0)) { val = strstrip(start); goto parse_val; } else { } *p = 0; id = strstrip(start); val = strstrip(p + 1UL); p = strchr((char const *)id, 46); if ((unsigned long )p != (unsigned long )((char *)0)) { tmp = p; p = p + 1; *tmp = 0; tmp___0 = simple_strtoul((char const *)p, & endp, 10U); force_ent->device = (int )tmp___0; if ((unsigned long )p == (unsigned long )endp || (int )((signed char )*endp) != 0) { *reason = "invalid device"; return (-22); } else { } } else { } tmp___1 = simple_strtoul((char const *)id, & endp, 10U); force_ent->port = (int )tmp___1; if ((unsigned long )p == (unsigned long )endp || (int )((signed char )*endp) != 0) { *reason = "invalid port/link"; return (-22); } else { } parse_val: i = 0; goto ldv_50570; ldv_50569: fp = (struct ata_force_param const *)(& force_tbl) + (unsigned long )i; tmp___2 = strlen((char const *)val); tmp___3 = strncasecmp((char const *)val, fp->name, tmp___2); if (tmp___3 != 0) { goto ldv_50567; } else { } nr_matches = nr_matches + 1; match_fp = fp; tmp___4 = strcasecmp((char const *)val, fp->name); if (tmp___4 == 0) { nr_matches = 1; goto ldv_50568; } else { } ldv_50567: i = i + 1; ldv_50570: ; if ((unsigned int )i <= 52U) { goto ldv_50569; } else { } ldv_50568: ; if (nr_matches == 0) { *reason = "unknown value"; return (-22); } else { } if (nr_matches > 1) { *reason = "ambigious value"; return (-22); } else { } force_ent->param = *match_fp; return (0); } } static void ata_parse_force_param(void) { int idx ; int size ; int last_port ; int last_device ; char *p ; char *cur ; char *next ; void *tmp ; char const *reason ; struct ata_force_ent te ; int tmp___0 ; int tmp___1 ; { idx = 0; size = 1; last_port = -1; last_device = -1; p = (char *)(& ata_force_param_buf); goto ldv_50582; ldv_50581: ; if ((int )((signed char )*p) == 44) { size = size + 1; } else { } p = p + 1; ldv_50582: ; if ((int )((signed char )*p) != 0) { goto ldv_50581; } else { } tmp = kzalloc((unsigned long )size * 48UL, 208U); ata_force_tbl = (struct ata_force_ent *)tmp; if ((unsigned long )ata_force_tbl == (unsigned long )((struct ata_force_ent *)0)) { printk("\fata: failed to extend force table, libata.force ignored\n"); return; } else { } cur = (char *)(& ata_force_param_buf); goto ldv_50588; ldv_50587: reason = ""; te.port = -1; te.device = -1; te.param.name = 0; te.param.cbl = 0U; te.param.spd_limit = 0; te.param.xfer_mask = 0UL; te.param.horkage_on = 0U; te.param.horkage_off = 0U; te.param.lflags = 0U; next = cur; tmp___0 = ata_parse_force_one(& next, & te, & reason); if (tmp___0 != 0) { printk("\fata: failed to parse force parameter \"%s\" (%s)\n", cur, reason); goto ldv_50586; } else { } if (te.port == -1) { te.port = last_port; te.device = last_device; } else { } tmp___1 = idx; idx = idx + 1; *(ata_force_tbl + (unsigned long )tmp___1) = te; last_port = te.port; last_device = te.device; ldv_50586: cur = next; ldv_50588: ; if ((int )((signed char )*cur) != 0) { goto ldv_50587; } else { } ata_force_tbl_size = idx; return; } } static int ata_init(void) { int rc ; { ata_parse_force_param(); rc = ata_sff_init(); if (rc != 0) { kfree((void const *)ata_force_tbl); return (rc); } else { } libata_transport_init(); ata_scsi_transport_template = ata_attach_transport(); if ((unsigned long )ata_scsi_transport_template == (unsigned long )((struct scsi_transport_template *)0)) { ata_sff_exit(); rc = -12; goto err_out; } else { } printk("\017libata version 3.00 loaded.\n"); return (0); err_out: ; return (rc); } } static void ata_exit(void) { { ata_release_transport(ata_scsi_transport_template); libata_transport_exit(); ata_sff_exit(); kfree((void const *)ata_force_tbl); return; } } static struct ratelimit_state ratelimit = {{{{0}}, 3735899821U, 4294967295U, (void *)-1, {0, {0, 0}, "ratelimit.lock", 0, 0UL}}, 50, 1, 0, 0, 0UL}; int ata_ratelimit(void) { int tmp ; { tmp = ___ratelimit(& ratelimit, "ata_ratelimit"); return (tmp); } } void ata_msleep(struct ata_port *ap , unsigned int msecs ) { bool owns_eh ; struct task_struct *tmp ; int tmp___0 ; { if ((unsigned long )ap != (unsigned long )((struct ata_port *)0)) { tmp = get_current(); if ((unsigned long )(ap->host)->eh_owner == (unsigned long )tmp) { tmp___0 = 1; } else { tmp___0 = 0; } } else { tmp___0 = 0; } owns_eh = (bool )tmp___0; if ((int )owns_eh) { ata_eh_release(ap); } else { } msleep(msecs); if ((int )owns_eh) { ata_eh_acquire(ap); } else { } return; } } u32 ata_wait_register(struct ata_port *ap , void *reg , u32 mask , u32 val , unsigned long interval , unsigned long timeout ) { unsigned long deadline ; u32 tmp ; { tmp = ioread32(reg); deadline = ata_deadline(jiffies, timeout); goto ldv_50636; ldv_50635: ata_msleep(ap, (unsigned int )interval); tmp = ioread32(reg); ldv_50636: ; if ((tmp & mask) == val && (long )((unsigned long )jiffies - deadline) < 0L) { goto ldv_50635; } else { } return (tmp); } } bool sata_lpm_ignore_phy_events(struct ata_link *link ) { unsigned long lpm_timeout ; unsigned long tmp ; { tmp = msecs_to_jiffies(10000U); lpm_timeout = link->last_lpm_change + tmp; if ((unsigned int )link->lpm_policy > 1U) { return (1); } else { } if ((link->flags & 1024U) != 0U && (long )((unsigned long )jiffies - lpm_timeout) < 0L) { return (1); } else { } return (0); } } static char const __kstrtab_sata_lpm_ignore_phy_events[27U] = { 's', 'a', 't', 'a', '_', 'l', 'p', 'm', '_', 'i', 'g', 'n', 'o', 'r', 'e', '_', 'p', 'h', 'y', '_', 'e', 'v', 'e', 'n', 't', 's', '\000'}; struct kernel_symbol const __ksymtab_sata_lpm_ignore_phy_events ; struct kernel_symbol const __ksymtab_sata_lpm_ignore_phy_events = {(unsigned long )(& sata_lpm_ignore_phy_events), (char const *)(& __kstrtab_sata_lpm_ignore_phy_events)}; static unsigned int ata_dummy_qc_issue(struct ata_queued_cmd *qc ) { { return (64U); } } static void ata_dummy_error_handler(struct ata_port *ap ) { { return; } } struct ata_port_operations ata_dummy_port_ops = {0, 0, & ata_noop_qc_prep, & ata_dummy_qc_issue, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & ata_dummy_error_handler, 0, 0, & ata_std_sched_eh, & ata_std_end_eh, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; struct ata_port_info const ata_dummy_port_info = {0UL, 0UL, 0UL, 0UL, 0UL, & ata_dummy_port_ops, 0}; void ata_port_printk(struct ata_port const *ap , char const *level , char const *fmt , ...) { struct va_format vaf ; va_list args ; { ldv__builtin_va_start((va_list *)(& args)); vaf.fmt = fmt; vaf.va = & args; printk("%sata%u: %pV", level, ap->print_id, & vaf); ldv__builtin_va_end((va_list *)(& args)); return; } } static char const __kstrtab_ata_port_printk[16U] = { 'a', 't', 'a', '_', 'p', 'o', 'r', 't', '_', 'p', 'r', 'i', 'n', 't', 'k', '\000'}; struct kernel_symbol const __ksymtab_ata_port_printk ; struct kernel_symbol const __ksymtab_ata_port_printk = {(unsigned long )(& ata_port_printk), (char const *)(& __kstrtab_ata_port_printk)}; void ata_link_printk(struct ata_link const *link , char const *level , char const *fmt , ...) { struct va_format vaf ; va_list args ; bool tmp ; { ldv__builtin_va_start((va_list *)(& args)); vaf.fmt = fmt; vaf.va = & args; tmp = sata_pmp_attached(link->ap); if ((int )tmp || (unsigned long )(link->ap)->slave_link != (unsigned long )((struct ata_link *)0)) { printk("%sata%u.%02u: %pV", level, (link->ap)->print_id, link->pmp, & vaf); } else { printk("%sata%u: %pV", level, (link->ap)->print_id, & vaf); } ldv__builtin_va_end((va_list *)(& args)); return; } } static char const __kstrtab_ata_link_printk[16U] = { 'a', 't', 'a', '_', 'l', 'i', 'n', 'k', '_', 'p', 'r', 'i', 'n', 't', 'k', '\000'}; struct kernel_symbol const __ksymtab_ata_link_printk ; struct kernel_symbol const __ksymtab_ata_link_printk = {(unsigned long )(& ata_link_printk), (char const *)(& __kstrtab_ata_link_printk)}; void ata_dev_printk(struct ata_device const *dev , char const *level , char const *fmt , ...) { struct va_format vaf ; va_list args ; { ldv__builtin_va_start((va_list *)(& args)); vaf.fmt = fmt; vaf.va = & args; printk("%sata%u.%02u: %pV", level, ((dev->link)->ap)->print_id, (unsigned int )(dev->link)->pmp + (unsigned int )dev->devno, & vaf); ldv__builtin_va_end((va_list *)(& args)); return; } } static char const __kstrtab_ata_dev_printk[15U] = { 'a', 't', 'a', '_', 'd', 'e', 'v', '_', 'p', 'r', 'i', 'n', 't', 'k', '\000'}; struct kernel_symbol const __ksymtab_ata_dev_printk ; struct kernel_symbol const __ksymtab_ata_dev_printk = {(unsigned long )(& ata_dev_printk), (char const *)(& __kstrtab_ata_dev_printk)}; void ata_print_version(struct device const *dev , char const *version ) { { dev_printk("\017", dev, "version %s\n", version); return; } } static char const __kstrtab_ata_print_version[18U] = { 'a', 't', 'a', '_', 'p', 'r', 'i', 'n', 't', '_', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\000'}; struct kernel_symbol const __ksymtab_ata_print_version ; struct kernel_symbol const __ksymtab_ata_print_version = {(unsigned long )(& ata_print_version), (char const *)(& __kstrtab_ata_print_version)}; static char const __kstrtab_sata_deb_timing_normal[23U] = { 's', 'a', 't', 'a', '_', 'd', 'e', 'b', '_', 't', 'i', 'm', 'i', 'n', 'g', '_', 'n', 'o', 'r', 'm', 'a', 'l', '\000'}; struct kernel_symbol const __ksymtab_sata_deb_timing_normal ; struct kernel_symbol const __ksymtab_sata_deb_timing_normal = {(unsigned long )(& sata_deb_timing_normal), (char const *)(& __kstrtab_sata_deb_timing_normal)}; static char const __kstrtab_sata_deb_timing_hotplug[24U] = { 's', 'a', 't', 'a', '_', 'd', 'e', 'b', '_', 't', 'i', 'm', 'i', 'n', 'g', '_', 'h', 'o', 't', 'p', 'l', 'u', 'g', '\000'}; struct kernel_symbol const __ksymtab_sata_deb_timing_hotplug ; struct kernel_symbol const __ksymtab_sata_deb_timing_hotplug = {(unsigned long )(& sata_deb_timing_hotplug), (char const *)(& __kstrtab_sata_deb_timing_hotplug)}; static char const __kstrtab_sata_deb_timing_long[21U] = { 's', 'a', 't', 'a', '_', 'd', 'e', 'b', '_', 't', 'i', 'm', 'i', 'n', 'g', '_', 'l', 'o', 'n', 'g', '\000'}; struct kernel_symbol const __ksymtab_sata_deb_timing_long ; struct kernel_symbol const __ksymtab_sata_deb_timing_long = {(unsigned long )(& sata_deb_timing_long), (char const *)(& __kstrtab_sata_deb_timing_long)}; static char const __kstrtab_ata_base_port_ops[18U] = { 'a', 't', 'a', '_', 'b', 'a', 's', 'e', '_', 'p', 'o', 'r', 't', '_', 'o', 'p', 's', '\000'}; struct kernel_symbol const __ksymtab_ata_base_port_ops ; struct kernel_symbol const __ksymtab_ata_base_port_ops = {(unsigned long )(& ata_base_port_ops), (char const *)(& __kstrtab_ata_base_port_ops)}; static char const __kstrtab_sata_port_ops[14U] = { 's', 'a', 't', 'a', '_', 'p', 'o', 'r', 't', '_', 'o', 'p', 's', '\000'}; struct kernel_symbol const __ksymtab_sata_port_ops ; struct kernel_symbol const __ksymtab_sata_port_ops = {(unsigned long )(& sata_port_ops), (char const *)(& __kstrtab_sata_port_ops)}; static char const __kstrtab_ata_dummy_port_ops[19U] = { 'a', 't', 'a', '_', 'd', 'u', 'm', 'm', 'y', '_', 'p', 'o', 'r', 't', '_', 'o', 'p', 's', '\000'}; struct kernel_symbol const __ksymtab_ata_dummy_port_ops ; struct kernel_symbol const __ksymtab_ata_dummy_port_ops = {(unsigned long )(& ata_dummy_port_ops), (char const *)(& __kstrtab_ata_dummy_port_ops)}; static char const __kstrtab_ata_dummy_port_info[20U] = { 'a', 't', 'a', '_', 'd', 'u', 'm', 'm', 'y', '_', 'p', 'o', 'r', 't', '_', 'i', 'n', 'f', 'o', '\000'}; struct kernel_symbol const __ksymtab_ata_dummy_port_info ; struct kernel_symbol const __ksymtab_ata_dummy_port_info = {(unsigned long )(& ata_dummy_port_info), (char const *)(& __kstrtab_ata_dummy_port_info)}; static char const __kstrtab_ata_link_next[14U] = { 'a', 't', 'a', '_', 'l', 'i', 'n', 'k', '_', 'n', 'e', 'x', 't', '\000'}; struct kernel_symbol const __ksymtab_ata_link_next ; struct kernel_symbol const __ksymtab_ata_link_next = {(unsigned long )(& ata_link_next), (char const *)(& __kstrtab_ata_link_next)}; static char const __kstrtab_ata_dev_next[13U] = { 'a', 't', 'a', '_', 'd', 'e', 'v', '_', 'n', 'e', 'x', 't', '\000'}; struct kernel_symbol const __ksymtab_ata_dev_next ; struct kernel_symbol const __ksymtab_ata_dev_next = {(unsigned long )(& ata_dev_next), (char const *)(& __kstrtab_ata_dev_next)}; static char const __kstrtab_ata_std_bios_param[19U] = { 'a', 't', 'a', '_', 's', 't', 'd', '_', 'b', 'i', 'o', 's', '_', 'p', 'a', 'r', 'a', 'm', '\000'}; struct kernel_symbol const __ksymtab_ata_std_bios_param ; struct kernel_symbol const __ksymtab_ata_std_bios_param = {(unsigned long )(& ata_std_bios_param), (char const *)(& __kstrtab_ata_std_bios_param)}; static char const __kstrtab_ata_scsi_unlock_native_capacity[32U] = { 'a', 't', 'a', '_', 's', 'c', 's', 'i', '_', 'u', 'n', 'l', 'o', 'c', 'k', '_', 'n', 'a', 't', 'i', 'v', 'e', '_', 'c', 'a', 'p', 'a', 'c', 'i', 't', 'y', '\000'}; struct kernel_symbol const __ksymtab_ata_scsi_unlock_native_capacity ; struct kernel_symbol const __ksymtab_ata_scsi_unlock_native_capacity = {(unsigned long )(& ata_scsi_unlock_native_capacity), (char const *)(& __kstrtab_ata_scsi_unlock_native_capacity)}; static char const __kstrtab_ata_host_init[14U] = { 'a', 't', 'a', '_', 'h', 'o', 's', 't', '_', 'i', 'n', 'i', 't', '\000'}; struct kernel_symbol const __ksymtab_ata_host_init ; struct kernel_symbol const __ksymtab_ata_host_init = {(unsigned long )(& ata_host_init), (char const *)(& __kstrtab_ata_host_init)}; static char const __kstrtab_ata_host_alloc[15U] = { 'a', 't', 'a', '_', 'h', 'o', 's', 't', '_', 'a', 'l', 'l', 'o', 'c', '\000'}; struct kernel_symbol const __ksymtab_ata_host_alloc ; struct kernel_symbol const __ksymtab_ata_host_alloc = {(unsigned long )(& ata_host_alloc), (char const *)(& __kstrtab_ata_host_alloc)}; static char const __kstrtab_ata_host_alloc_pinfo[21U] = { 'a', 't', 'a', '_', 'h', 'o', 's', 't', '_', 'a', 'l', 'l', 'o', 'c', '_', 'p', 'i', 'n', 'f', 'o', '\000'}; struct kernel_symbol const __ksymtab_ata_host_alloc_pinfo ; struct kernel_symbol const __ksymtab_ata_host_alloc_pinfo = {(unsigned long )(& ata_host_alloc_pinfo), (char const *)(& __kstrtab_ata_host_alloc_pinfo)}; static char const __kstrtab_ata_slave_link_init[20U] = { 'a', 't', 'a', '_', 's', 'l', 'a', 'v', 'e', '_', 'l', 'i', 'n', 'k', '_', 'i', 'n', 'i', 't', '\000'}; struct kernel_symbol const __ksymtab_ata_slave_link_init ; struct kernel_symbol const __ksymtab_ata_slave_link_init = {(unsigned long )(& ata_slave_link_init), (char const *)(& __kstrtab_ata_slave_link_init)}; static char const __kstrtab_ata_host_start[15U] = { 'a', 't', 'a', '_', 'h', 'o', 's', 't', '_', 's', 't', 'a', 'r', 't', '\000'}; struct kernel_symbol const __ksymtab_ata_host_start ; struct kernel_symbol const __ksymtab_ata_host_start = {(unsigned long )(& ata_host_start), (char const *)(& __kstrtab_ata_host_start)}; static char const __kstrtab_ata_host_register[18U] = { 'a', 't', 'a', '_', 'h', 'o', 's', 't', '_', 'r', 'e', 'g', 'i', 's', 't', 'e', 'r', '\000'}; struct kernel_symbol const __ksymtab_ata_host_register ; struct kernel_symbol const __ksymtab_ata_host_register = {(unsigned long )(& ata_host_register), (char const *)(& __kstrtab_ata_host_register)}; static char const __kstrtab_ata_host_activate[18U] = { 'a', 't', 'a', '_', 'h', 'o', 's', 't', '_', 'a', 'c', 't', 'i', 'v', 'a', 't', 'e', '\000'}; struct kernel_symbol const __ksymtab_ata_host_activate ; struct kernel_symbol const __ksymtab_ata_host_activate = {(unsigned long )(& ata_host_activate), (char const *)(& __kstrtab_ata_host_activate)}; static char const __kstrtab_ata_host_detach[16U] = { 'a', 't', 'a', '_', 'h', 'o', 's', 't', '_', 'd', 'e', 't', 'a', 'c', 'h', '\000'}; struct kernel_symbol const __ksymtab_ata_host_detach ; struct kernel_symbol const __ksymtab_ata_host_detach = {(unsigned long )(& ata_host_detach), (char const *)(& __kstrtab_ata_host_detach)}; static char const __kstrtab_ata_sg_init[12U] = { 'a', 't', 'a', '_', 's', 'g', '_', 'i', 'n', 'i', 't', '\000'}; struct kernel_symbol const __ksymtab_ata_sg_init ; struct kernel_symbol const __ksymtab_ata_sg_init = {(unsigned long )(& ata_sg_init), (char const *)(& __kstrtab_ata_sg_init)}; static char const __kstrtab_ata_qc_complete[16U] = { 'a', 't', 'a', '_', 'q', 'c', '_', 'c', 'o', 'm', 'p', 'l', 'e', 't', 'e', '\000'}; struct kernel_symbol const __ksymtab_ata_qc_complete ; struct kernel_symbol const __ksymtab_ata_qc_complete = {(unsigned long )(& ata_qc_complete), (char const *)(& __kstrtab_ata_qc_complete)}; static char const __kstrtab_ata_qc_complete_multiple[25U] = { 'a', 't', 'a', '_', 'q', 'c', '_', 'c', 'o', 'm', 'p', 'l', 'e', 't', 'e', '_', 'm', 'u', 'l', 't', 'i', 'p', 'l', 'e', '\000'}; struct kernel_symbol const __ksymtab_ata_qc_complete_multiple ; struct kernel_symbol const __ksymtab_ata_qc_complete_multiple = {(unsigned long )(& ata_qc_complete_multiple), (char const *)(& __kstrtab_ata_qc_complete_multiple)}; static char const __kstrtab_atapi_cmd_type[15U] = { 'a', 't', 'a', 'p', 'i', '_', 'c', 'm', 'd', '_', 't', 'y', 'p', 'e', '\000'}; struct kernel_symbol const __ksymtab_atapi_cmd_type ; struct kernel_symbol const __ksymtab_atapi_cmd_type = {(unsigned long )(& atapi_cmd_type), (char const *)(& __kstrtab_atapi_cmd_type)}; static char const __kstrtab_ata_tf_to_fis[14U] = { 'a', 't', 'a', '_', 't', 'f', '_', 't', 'o', '_', 'f', 'i', 's', '\000'}; struct kernel_symbol const __ksymtab_ata_tf_to_fis ; struct kernel_symbol const __ksymtab_ata_tf_to_fis = {(unsigned long )(& ata_tf_to_fis), (char const *)(& __kstrtab_ata_tf_to_fis)}; static char const __kstrtab_ata_tf_from_fis[16U] = { 'a', 't', 'a', '_', 't', 'f', '_', 'f', 'r', 'o', 'm', '_', 'f', 'i', 's', '\000'}; struct kernel_symbol const __ksymtab_ata_tf_from_fis ; struct kernel_symbol const __ksymtab_ata_tf_from_fis = {(unsigned long )(& ata_tf_from_fis), (char const *)(& __kstrtab_ata_tf_from_fis)}; static char const __kstrtab_ata_pack_xfermask[18U] = { 'a', 't', 'a', '_', 'p', 'a', 'c', 'k', '_', 'x', 'f', 'e', 'r', 'm', 'a', 's', 'k', '\000'}; struct kernel_symbol const __ksymtab_ata_pack_xfermask ; struct kernel_symbol const __ksymtab_ata_pack_xfermask = {(unsigned long )(& ata_pack_xfermask), (char const *)(& __kstrtab_ata_pack_xfermask)}; static char const __kstrtab_ata_unpack_xfermask[20U] = { 'a', 't', 'a', '_', 'u', 'n', 'p', 'a', 'c', 'k', '_', 'x', 'f', 'e', 'r', 'm', 'a', 's', 'k', '\000'}; struct kernel_symbol const __ksymtab_ata_unpack_xfermask ; struct kernel_symbol const __ksymtab_ata_unpack_xfermask = {(unsigned long )(& ata_unpack_xfermask), (char const *)(& __kstrtab_ata_unpack_xfermask)}; static char const __kstrtab_ata_xfer_mask2mode[19U] = { 'a', 't', 'a', '_', 'x', 'f', 'e', 'r', '_', 'm', 'a', 's', 'k', '2', 'm', 'o', 'd', 'e', '\000'}; struct kernel_symbol const __ksymtab_ata_xfer_mask2mode ; struct kernel_symbol const __ksymtab_ata_xfer_mask2mode = {(unsigned long )(& ata_xfer_mask2mode), (char const *)(& __kstrtab_ata_xfer_mask2mode)}; static char const __kstrtab_ata_xfer_mode2mask[19U] = { 'a', 't', 'a', '_', 'x', 'f', 'e', 'r', '_', 'm', 'o', 'd', 'e', '2', 'm', 'a', 's', 'k', '\000'}; struct kernel_symbol const __ksymtab_ata_xfer_mode2mask ; struct kernel_symbol const __ksymtab_ata_xfer_mode2mask = {(unsigned long )(& ata_xfer_mode2mask), (char const *)(& __kstrtab_ata_xfer_mode2mask)}; static char const __kstrtab_ata_xfer_mode2shift[20U] = { 'a', 't', 'a', '_', 'x', 'f', 'e', 'r', '_', 'm', 'o', 'd', 'e', '2', 's', 'h', 'i', 'f', 't', '\000'}; struct kernel_symbol const __ksymtab_ata_xfer_mode2shift ; struct kernel_symbol const __ksymtab_ata_xfer_mode2shift = {(unsigned long )(& ata_xfer_mode2shift), (char const *)(& __kstrtab_ata_xfer_mode2shift)}; static char const __kstrtab_ata_mode_string[16U] = { 'a', 't', 'a', '_', 'm', 'o', 'd', 'e', '_', 's', 't', 'r', 'i', 'n', 'g', '\000'}; struct kernel_symbol const __ksymtab_ata_mode_string ; struct kernel_symbol const __ksymtab_ata_mode_string = {(unsigned long )(& ata_mode_string), (char const *)(& __kstrtab_ata_mode_string)}; static char const __kstrtab_ata_id_xfermask[16U] = { 'a', 't', 'a', '_', 'i', 'd', '_', 'x', 'f', 'e', 'r', 'm', 'a', 's', 'k', '\000'}; struct kernel_symbol const __ksymtab_ata_id_xfermask ; struct kernel_symbol const __ksymtab_ata_id_xfermask = {(unsigned long )(& ata_id_xfermask), (char const *)(& __kstrtab_ata_id_xfermask)}; static char const __kstrtab_ata_do_set_mode[16U] = { 'a', 't', 'a', '_', 'd', 'o', '_', 's', 'e', 't', '_', 'm', 'o', 'd', 'e', '\000'}; struct kernel_symbol const __ksymtab_ata_do_set_mode ; struct kernel_symbol const __ksymtab_ata_do_set_mode = {(unsigned long )(& ata_do_set_mode), (char const *)(& __kstrtab_ata_do_set_mode)}; static char const __kstrtab_ata_std_qc_defer[17U] = { 'a', 't', 'a', '_', 's', 't', 'd', '_', 'q', 'c', '_', 'd', 'e', 'f', 'e', 'r', '\000'}; struct kernel_symbol const __ksymtab_ata_std_qc_defer ; struct kernel_symbol const __ksymtab_ata_std_qc_defer = {(unsigned long )(& ata_std_qc_defer), (char const *)(& __kstrtab_ata_std_qc_defer)}; static char const __kstrtab_ata_noop_qc_prep[17U] = { 'a', 't', 'a', '_', 'n', 'o', 'o', 'p', '_', 'q', 'c', '_', 'p', 'r', 'e', 'p', '\000'}; struct kernel_symbol const __ksymtab_ata_noop_qc_prep ; struct kernel_symbol const __ksymtab_ata_noop_qc_prep = {(unsigned long )(& ata_noop_qc_prep), (char const *)(& __kstrtab_ata_noop_qc_prep)}; static char const __kstrtab_ata_dev_disable[16U] = { 'a', 't', 'a', '_', 'd', 'e', 'v', '_', 'd', 'i', 's', 'a', 'b', 'l', 'e', '\000'}; struct kernel_symbol const __ksymtab_ata_dev_disable ; struct kernel_symbol const __ksymtab_ata_dev_disable = {(unsigned long )(& ata_dev_disable), (char const *)(& __kstrtab_ata_dev_disable)}; static char const __kstrtab_sata_set_spd[13U] = { 's', 'a', 't', 'a', '_', 's', 'e', 't', '_', 's', 'p', 'd', '\000'}; struct kernel_symbol const __ksymtab_sata_set_spd ; struct kernel_symbol const __ksymtab_sata_set_spd = {(unsigned long )(& sata_set_spd), (char const *)(& __kstrtab_sata_set_spd)}; static char const __kstrtab_ata_wait_after_reset[21U] = { 'a', 't', 'a', '_', 'w', 'a', 'i', 't', '_', 'a', 'f', 't', 'e', 'r', '_', 'r', 'e', 's', 'e', 't', '\000'}; struct kernel_symbol const __ksymtab_ata_wait_after_reset ; struct kernel_symbol const __ksymtab_ata_wait_after_reset = {(unsigned long )(& ata_wait_after_reset), (char const *)(& __kstrtab_ata_wait_after_reset)}; static char const __kstrtab_sata_link_debounce[19U] = { 's', 'a', 't', 'a', '_', 'l', 'i', 'n', 'k', '_', 'd', 'e', 'b', 'o', 'u', 'n', 'c', 'e', '\000'}; struct kernel_symbol const __ksymtab_sata_link_debounce ; struct kernel_symbol const __ksymtab_sata_link_debounce = {(unsigned long )(& sata_link_debounce), (char const *)(& __kstrtab_sata_link_debounce)}; static char const __kstrtab_sata_link_resume[17U] = { 's', 'a', 't', 'a', '_', 'l', 'i', 'n', 'k', '_', 'r', 'e', 's', 'u', 'm', 'e', '\000'}; struct kernel_symbol const __ksymtab_sata_link_resume ; struct kernel_symbol const __ksymtab_sata_link_resume = {(unsigned long )(& sata_link_resume), (char const *)(& __kstrtab_sata_link_resume)}; static char const __kstrtab_sata_link_scr_lpm[18U] = { 's', 'a', 't', 'a', '_', 'l', 'i', 'n', 'k', '_', 's', 'c', 'r', '_', 'l', 'p', 'm', '\000'}; struct kernel_symbol const __ksymtab_sata_link_scr_lpm ; struct kernel_symbol const __ksymtab_sata_link_scr_lpm = {(unsigned long )(& sata_link_scr_lpm), (char const *)(& __kstrtab_sata_link_scr_lpm)}; static char const __kstrtab_ata_std_prereset[17U] = { 'a', 't', 'a', '_', 's', 't', 'd', '_', 'p', 'r', 'e', 'r', 'e', 's', 'e', 't', '\000'}; struct kernel_symbol const __ksymtab_ata_std_prereset ; struct kernel_symbol const __ksymtab_ata_std_prereset = {(unsigned long )(& ata_std_prereset), (char const *)(& __kstrtab_ata_std_prereset)}; static char const __kstrtab_sata_link_hardreset[20U] = { 's', 'a', 't', 'a', '_', 'l', 'i', 'n', 'k', '_', 'h', 'a', 'r', 'd', 'r', 'e', 's', 'e', 't', '\000'}; struct kernel_symbol const __ksymtab_sata_link_hardreset ; struct kernel_symbol const __ksymtab_sata_link_hardreset = {(unsigned long )(& sata_link_hardreset), (char const *)(& __kstrtab_sata_link_hardreset)}; static char const __kstrtab_sata_std_hardreset[19U] = { 's', 'a', 't', 'a', '_', 's', 't', 'd', '_', 'h', 'a', 'r', 'd', 'r', 'e', 's', 'e', 't', '\000'}; struct kernel_symbol const __ksymtab_sata_std_hardreset ; struct kernel_symbol const __ksymtab_sata_std_hardreset = {(unsigned long )(& sata_std_hardreset), (char const *)(& __kstrtab_sata_std_hardreset)}; static char const __kstrtab_ata_std_postreset[18U] = { 'a', 't', 'a', '_', 's', 't', 'd', '_', 'p', 'o', 's', 't', 'r', 'e', 's', 'e', 't', '\000'}; struct kernel_symbol const __ksymtab_ata_std_postreset ; struct kernel_symbol const __ksymtab_ata_std_postreset = {(unsigned long )(& ata_std_postreset), (char const *)(& __kstrtab_ata_std_postreset)}; static char const __kstrtab_ata_dev_classify[17U] = { 'a', 't', 'a', '_', 'd', 'e', 'v', '_', 'c', 'l', 'a', 's', 's', 'i', 'f', 'y', '\000'}; struct kernel_symbol const __ksymtab_ata_dev_classify ; struct kernel_symbol const __ksymtab_ata_dev_classify = {(unsigned long )(& ata_dev_classify), (char const *)(& __kstrtab_ata_dev_classify)}; static char const __kstrtab_ata_dev_pair[13U] = { 'a', 't', 'a', '_', 'd', 'e', 'v', '_', 'p', 'a', 'i', 'r', '\000'}; struct kernel_symbol const __ksymtab_ata_dev_pair ; struct kernel_symbol const __ksymtab_ata_dev_pair = {(unsigned long )(& ata_dev_pair), (char const *)(& __kstrtab_ata_dev_pair)}; static char const __kstrtab_ata_ratelimit[14U] = { 'a', 't', 'a', '_', 'r', 'a', 't', 'e', 'l', 'i', 'm', 'i', 't', '\000'}; struct kernel_symbol const __ksymtab_ata_ratelimit ; struct kernel_symbol const __ksymtab_ata_ratelimit = {(unsigned long )(& ata_ratelimit), (char const *)(& __kstrtab_ata_ratelimit)}; static char const __kstrtab_ata_msleep[11U] = { 'a', 't', 'a', '_', 'm', 's', 'l', 'e', 'e', 'p', '\000'}; struct kernel_symbol const __ksymtab_ata_msleep ; struct kernel_symbol const __ksymtab_ata_msleep = {(unsigned long )(& ata_msleep), (char const *)(& __kstrtab_ata_msleep)}; static char const __kstrtab_ata_wait_register[18U] = { 'a', 't', 'a', '_', 'w', 'a', 'i', 't', '_', 'r', 'e', 'g', 'i', 's', 't', 'e', 'r', '\000'}; struct kernel_symbol const __ksymtab_ata_wait_register ; struct kernel_symbol const __ksymtab_ata_wait_register = {(unsigned long )(& ata_wait_register), (char const *)(& __kstrtab_ata_wait_register)}; static char const __kstrtab_ata_scsi_queuecmd[18U] = { 'a', 't', 'a', '_', 's', 'c', 's', 'i', '_', 'q', 'u', 'e', 'u', 'e', 'c', 'm', 'd', '\000'}; struct kernel_symbol const __ksymtab_ata_scsi_queuecmd ; struct kernel_symbol const __ksymtab_ata_scsi_queuecmd = {(unsigned long )(& ata_scsi_queuecmd), (char const *)(& __kstrtab_ata_scsi_queuecmd)}; static char const __kstrtab_ata_scsi_slave_config[22U] = { 'a', 't', 'a', '_', 's', 'c', 's', 'i', '_', 's', 'l', 'a', 'v', 'e', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\000'}; struct kernel_symbol const __ksymtab_ata_scsi_slave_config ; struct kernel_symbol const __ksymtab_ata_scsi_slave_config = {(unsigned long )(& ata_scsi_slave_config), (char const *)(& __kstrtab_ata_scsi_slave_config)}; static char const __kstrtab_ata_scsi_slave_destroy[23U] = { 'a', 't', 'a', '_', 's', 'c', 's', 'i', '_', 's', 'l', 'a', 'v', 'e', '_', 'd', 'e', 's', 't', 'r', 'o', 'y', '\000'}; struct kernel_symbol const __ksymtab_ata_scsi_slave_destroy ; struct kernel_symbol const __ksymtab_ata_scsi_slave_destroy = {(unsigned long )(& ata_scsi_slave_destroy), (char const *)(& __kstrtab_ata_scsi_slave_destroy)}; static char const __kstrtab_ata_scsi_change_queue_depth[28U] = { 'a', 't', 'a', '_', 's', 'c', 's', 'i', '_', 'c', 'h', 'a', 'n', 'g', 'e', '_', 'q', 'u', 'e', 'u', 'e', '_', 'd', 'e', 'p', 't', 'h', '\000'}; struct kernel_symbol const __ksymtab_ata_scsi_change_queue_depth ; struct kernel_symbol const __ksymtab_ata_scsi_change_queue_depth = {(unsigned long )(& ata_scsi_change_queue_depth), (char const *)(& __kstrtab_ata_scsi_change_queue_depth)}; static char const __kstrtab___ata_change_queue_depth[25U] = { '_', '_', 'a', 't', 'a', '_', 'c', 'h', 'a', 'n', 'g', 'e', '_', 'q', 'u', 'e', 'u', 'e', '_', 'd', 'e', 'p', 't', 'h', '\000'}; struct kernel_symbol const __ksymtab___ata_change_queue_depth ; struct kernel_symbol const __ksymtab___ata_change_queue_depth = {(unsigned long )(& __ata_change_queue_depth), (char const *)(& __kstrtab___ata_change_queue_depth)}; static char const __kstrtab_sata_scr_valid[15U] = { 's', 'a', 't', 'a', '_', 's', 'c', 'r', '_', 'v', 'a', 'l', 'i', 'd', '\000'}; struct kernel_symbol const __ksymtab_sata_scr_valid ; struct kernel_symbol const __ksymtab_sata_scr_valid = {(unsigned long )(& sata_scr_valid), (char const *)(& __kstrtab_sata_scr_valid)}; static char const __kstrtab_sata_scr_read[14U] = { 's', 'a', 't', 'a', '_', 's', 'c', 'r', '_', 'r', 'e', 'a', 'd', '\000'}; struct kernel_symbol const __ksymtab_sata_scr_read ; struct kernel_symbol const __ksymtab_sata_scr_read = {(unsigned long )(& sata_scr_read), (char const *)(& __kstrtab_sata_scr_read)}; static char const __kstrtab_sata_scr_write[15U] = { 's', 'a', 't', 'a', '_', 's', 'c', 'r', '_', 'w', 'r', 'i', 't', 'e', '\000'}; struct kernel_symbol const __ksymtab_sata_scr_write ; struct kernel_symbol const __ksymtab_sata_scr_write = {(unsigned long )(& sata_scr_write), (char const *)(& __kstrtab_sata_scr_write)}; static char const __kstrtab_sata_scr_write_flush[21U] = { 's', 'a', 't', 'a', '_', 's', 'c', 'r', '_', 'w', 'r', 'i', 't', 'e', '_', 'f', 'l', 'u', 's', 'h', '\000'}; struct kernel_symbol const __ksymtab_sata_scr_write_flush ; struct kernel_symbol const __ksymtab_sata_scr_write_flush = {(unsigned long )(& sata_scr_write_flush), (char const *)(& __kstrtab_sata_scr_write_flush)}; static char const __kstrtab_ata_link_online[16U] = { 'a', 't', 'a', '_', 'l', 'i', 'n', 'k', '_', 'o', 'n', 'l', 'i', 'n', 'e', '\000'}; struct kernel_symbol const __ksymtab_ata_link_online ; struct kernel_symbol const __ksymtab_ata_link_online = {(unsigned long )(& ata_link_online), (char const *)(& __kstrtab_ata_link_online)}; static char const __kstrtab_ata_link_offline[17U] = { 'a', 't', 'a', '_', 'l', 'i', 'n', 'k', '_', 'o', 'f', 'f', 'l', 'i', 'n', 'e', '\000'}; struct kernel_symbol const __ksymtab_ata_link_offline ; struct kernel_symbol const __ksymtab_ata_link_offline = {(unsigned long )(& ata_link_offline), (char const *)(& __kstrtab_ata_link_offline)}; static char const __kstrtab_ata_host_suspend[17U] = { 'a', 't', 'a', '_', 'h', 'o', 's', 't', '_', 's', 'u', 's', 'p', 'e', 'n', 'd', '\000'}; struct kernel_symbol const __ksymtab_ata_host_suspend ; struct kernel_symbol const __ksymtab_ata_host_suspend = {(unsigned long )(& ata_host_suspend), (char const *)(& __kstrtab_ata_host_suspend)}; static char const __kstrtab_ata_host_resume[16U] = { 'a', 't', 'a', '_', 'h', 'o', 's', 't', '_', 'r', 'e', 's', 'u', 'm', 'e', '\000'}; struct kernel_symbol const __ksymtab_ata_host_resume ; struct kernel_symbol const __ksymtab_ata_host_resume = {(unsigned long )(& ata_host_resume), (char const *)(& __kstrtab_ata_host_resume)}; static char const __kstrtab_ata_id_string[14U] = { 'a', 't', 'a', '_', 'i', 'd', '_', 's', 't', 'r', 'i', 'n', 'g', '\000'}; struct kernel_symbol const __ksymtab_ata_id_string ; struct kernel_symbol const __ksymtab_ata_id_string = {(unsigned long )(& ata_id_string), (char const *)(& __kstrtab_ata_id_string)}; static char const __kstrtab_ata_id_c_string[16U] = { 'a', 't', 'a', '_', 'i', 'd', '_', 'c', '_', 's', 't', 'r', 'i', 'n', 'g', '\000'}; struct kernel_symbol const __ksymtab_ata_id_c_string ; struct kernel_symbol const __ksymtab_ata_id_c_string = {(unsigned long )(& ata_id_c_string), (char const *)(& __kstrtab_ata_id_c_string)}; static char const __kstrtab_ata_do_dev_read_id[19U] = { 'a', 't', 'a', '_', 'd', 'o', '_', 'd', 'e', 'v', '_', 'r', 'e', 'a', 'd', '_', 'i', 'd', '\000'}; struct kernel_symbol const __ksymtab_ata_do_dev_read_id ; struct kernel_symbol const __ksymtab_ata_do_dev_read_id = {(unsigned long )(& ata_do_dev_read_id), (char const *)(& __kstrtab_ata_do_dev_read_id)}; static char const __kstrtab_ata_scsi_simulate[18U] = { 'a', 't', 'a', '_', 's', 'c', 's', 'i', '_', 's', 'i', 'm', 'u', 'l', 'a', 't', 'e', '\000'}; struct kernel_symbol const __ksymtab_ata_scsi_simulate ; struct kernel_symbol const __ksymtab_ata_scsi_simulate = {(unsigned long )(& ata_scsi_simulate), (char const *)(& __kstrtab_ata_scsi_simulate)}; static char const __kstrtab_ata_pio_need_iordy[19U] = { 'a', 't', 'a', '_', 'p', 'i', 'o', '_', 'n', 'e', 'e', 'd', '_', 'i', 'o', 'r', 'd', 'y', '\000'}; struct kernel_symbol const __ksymtab_ata_pio_need_iordy ; struct kernel_symbol const __ksymtab_ata_pio_need_iordy = {(unsigned long )(& ata_pio_need_iordy), (char const *)(& __kstrtab_ata_pio_need_iordy)}; static char const __kstrtab_ata_timing_find_mode[21U] = { 'a', 't', 'a', '_', 't', 'i', 'm', 'i', 'n', 'g', '_', 'f', 'i', 'n', 'd', '_', 'm', 'o', 'd', 'e', '\000'}; struct kernel_symbol const __ksymtab_ata_timing_find_mode ; struct kernel_symbol const __ksymtab_ata_timing_find_mode = {(unsigned long )(& ata_timing_find_mode), (char const *)(& __kstrtab_ata_timing_find_mode)}; static char const __kstrtab_ata_timing_compute[19U] = { 'a', 't', 'a', '_', 't', 'i', 'm', 'i', 'n', 'g', '_', 'c', 'o', 'm', 'p', 'u', 't', 'e', '\000'}; struct kernel_symbol const __ksymtab_ata_timing_compute ; struct kernel_symbol const __ksymtab_ata_timing_compute = {(unsigned long )(& ata_timing_compute), (char const *)(& __kstrtab_ata_timing_compute)}; static char const __kstrtab_ata_timing_merge[17U] = { 'a', 't', 'a', '_', 't', 'i', 'm', 'i', 'n', 'g', '_', 'm', 'e', 'r', 'g', 'e', '\000'}; struct kernel_symbol const __ksymtab_ata_timing_merge ; struct kernel_symbol const __ksymtab_ata_timing_merge = {(unsigned long )(& ata_timing_merge), (char const *)(& __kstrtab_ata_timing_merge)}; static char const __kstrtab_ata_timing_cycle2mode[22U] = { 'a', 't', 'a', '_', 't', 'i', 'm', 'i', 'n', 'g', '_', 'c', 'y', 'c', 'l', 'e', '2', 'm', 'o', 'd', 'e', '\000'}; struct kernel_symbol const __ksymtab_ata_timing_cycle2mode ; struct kernel_symbol const __ksymtab_ata_timing_cycle2mode = {(unsigned long )(& ata_timing_cycle2mode), (char const *)(& __kstrtab_ata_timing_cycle2mode)}; static char const __kstrtab_pci_test_config_bits[21U] = { 'p', 'c', 'i', '_', 't', 'e', 's', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g', '_', 'b', 'i', 't', 's', '\000'}; struct kernel_symbol const __ksymtab_pci_test_config_bits ; struct kernel_symbol const __ksymtab_pci_test_config_bits = {(unsigned long )(& pci_test_config_bits), (char const *)(& __kstrtab_pci_test_config_bits)}; static char const __kstrtab_ata_pci_remove_one[19U] = { 'a', 't', 'a', '_', 'p', 'c', 'i', '_', 'r', 'e', 'm', 'o', 'v', 'e', '_', 'o', 'n', 'e', '\000'}; struct kernel_symbol const __ksymtab_ata_pci_remove_one ; struct kernel_symbol const __ksymtab_ata_pci_remove_one = {(unsigned long )(& ata_pci_remove_one), (char const *)(& __kstrtab_ata_pci_remove_one)}; static char const __kstrtab_ata_pci_device_do_suspend[26U] = { 'a', 't', 'a', '_', 'p', 'c', 'i', '_', 'd', 'e', 'v', 'i', 'c', 'e', '_', 'd', 'o', '_', 's', 'u', 's', 'p', 'e', 'n', 'd', '\000'}; struct kernel_symbol const __ksymtab_ata_pci_device_do_suspend ; struct kernel_symbol const __ksymtab_ata_pci_device_do_suspend = {(unsigned long )(& ata_pci_device_do_suspend), (char const *)(& __kstrtab_ata_pci_device_do_suspend)}; static char const __kstrtab_ata_pci_device_do_resume[25U] = { 'a', 't', 'a', '_', 'p', 'c', 'i', '_', 'd', 'e', 'v', 'i', 'c', 'e', '_', 'd', 'o', '_', 'r', 'e', 's', 'u', 'm', 'e', '\000'}; struct kernel_symbol const __ksymtab_ata_pci_device_do_resume ; struct kernel_symbol const __ksymtab_ata_pci_device_do_resume = {(unsigned long )(& ata_pci_device_do_resume), (char const *)(& __kstrtab_ata_pci_device_do_resume)}; static char const __kstrtab_ata_pci_device_suspend[23U] = { 'a', 't', 'a', '_', 'p', 'c', 'i', '_', 'd', 'e', 'v', 'i', 'c', 'e', '_', 's', 'u', 's', 'p', 'e', 'n', 'd', '\000'}; struct kernel_symbol const __ksymtab_ata_pci_device_suspend ; struct kernel_symbol const __ksymtab_ata_pci_device_suspend = {(unsigned long )(& ata_pci_device_suspend), (char const *)(& __kstrtab_ata_pci_device_suspend)}; static char const __kstrtab_ata_pci_device_resume[22U] = { 'a', 't', 'a', '_', 'p', 'c', 'i', '_', 'd', 'e', 'v', 'i', 'c', 'e', '_', 'r', 'e', 's', 'u', 'm', 'e', '\000'}; struct kernel_symbol const __ksymtab_ata_pci_device_resume ; struct kernel_symbol const __ksymtab_ata_pci_device_resume = {(unsigned long )(& ata_pci_device_resume), (char const *)(& __kstrtab_ata_pci_device_resume)}; static char const __kstrtab_ata_platform_remove_one[24U] = { 'a', 't', 'a', '_', 'p', 'l', 'a', 't', 'f', 'o', 'r', 'm', '_', 'r', 'e', 'm', 'o', 'v', 'e', '_', 'o', 'n', 'e', '\000'}; struct kernel_symbol const __ksymtab_ata_platform_remove_one ; struct kernel_symbol const __ksymtab_ata_platform_remove_one = {(unsigned long )(& ata_platform_remove_one), (char const *)(& __kstrtab_ata_platform_remove_one)}; static char const __kstrtab___ata_ehi_push_desc[20U] = { '_', '_', 'a', 't', 'a', '_', 'e', 'h', 'i', '_', 'p', 'u', 's', 'h', '_', 'd', 'e', 's', 'c', '\000'}; struct kernel_symbol const __ksymtab___ata_ehi_push_desc ; struct kernel_symbol const __ksymtab___ata_ehi_push_desc = {(unsigned long )(& __ata_ehi_push_desc), (char const *)(& __kstrtab___ata_ehi_push_desc)}; static char const __kstrtab_ata_ehi_push_desc[18U] = { 'a', 't', 'a', '_', 'e', 'h', 'i', '_', 'p', 'u', 's', 'h', '_', 'd', 'e', 's', 'c', '\000'}; struct kernel_symbol const __ksymtab_ata_ehi_push_desc ; struct kernel_symbol const __ksymtab_ata_ehi_push_desc = {(unsigned long )(& ata_ehi_push_desc), (char const *)(& __kstrtab_ata_ehi_push_desc)}; static char const __kstrtab_ata_ehi_clear_desc[19U] = { 'a', 't', 'a', '_', 'e', 'h', 'i', '_', 'c', 'l', 'e', 'a', 'r', '_', 'd', 'e', 's', 'c', '\000'}; struct kernel_symbol const __ksymtab_ata_ehi_clear_desc ; struct kernel_symbol const __ksymtab_ata_ehi_clear_desc = {(unsigned long )(& ata_ehi_clear_desc), (char const *)(& __kstrtab_ata_ehi_clear_desc)}; static char const __kstrtab_ata_port_desc[14U] = { 'a', 't', 'a', '_', 'p', 'o', 'r', 't', '_', 'd', 'e', 's', 'c', '\000'}; struct kernel_symbol const __ksymtab_ata_port_desc ; struct kernel_symbol const __ksymtab_ata_port_desc = {(unsigned long )(& ata_port_desc), (char const *)(& __kstrtab_ata_port_desc)}; static char const __kstrtab_ata_port_pbar_desc[19U] = { 'a', 't', 'a', '_', 'p', 'o', 'r', 't', '_', 'p', 'b', 'a', 'r', '_', 'd', 'e', 's', 'c', '\000'}; struct kernel_symbol const __ksymtab_ata_port_pbar_desc ; struct kernel_symbol const __ksymtab_ata_port_pbar_desc = {(unsigned long )(& ata_port_pbar_desc), (char const *)(& __kstrtab_ata_port_pbar_desc)}; static char const __kstrtab_ata_port_schedule_eh[21U] = { 'a', 't', 'a', '_', 'p', 'o', 'r', 't', '_', 's', 'c', 'h', 'e', 'd', 'u', 'l', 'e', '_', 'e', 'h', '\000'}; struct kernel_symbol const __ksymtab_ata_port_schedule_eh ; struct kernel_symbol const __ksymtab_ata_port_schedule_eh = {(unsigned long )(& ata_port_schedule_eh), (char const *)(& __kstrtab_ata_port_schedule_eh)}; static char const __kstrtab_ata_link_abort[15U] = { 'a', 't', 'a', '_', 'l', 'i', 'n', 'k', '_', 'a', 'b', 'o', 'r', 't', '\000'}; struct kernel_symbol const __ksymtab_ata_link_abort ; struct kernel_symbol const __ksymtab_ata_link_abort = {(unsigned long )(& ata_link_abort), (char const *)(& __kstrtab_ata_link_abort)}; static char const __kstrtab_ata_port_abort[15U] = { 'a', 't', 'a', '_', 'p', 'o', 'r', 't', '_', 'a', 'b', 'o', 'r', 't', '\000'}; struct kernel_symbol const __ksymtab_ata_port_abort ; struct kernel_symbol const __ksymtab_ata_port_abort = {(unsigned long )(& ata_port_abort), (char const *)(& __kstrtab_ata_port_abort)}; static char const __kstrtab_ata_port_freeze[16U] = { 'a', 't', 'a', '_', 'p', 'o', 'r', 't', '_', 'f', 'r', 'e', 'e', 'z', 'e', '\000'}; struct kernel_symbol const __ksymtab_ata_port_freeze ; struct kernel_symbol const __ksymtab_ata_port_freeze = {(unsigned long )(& ata_port_freeze), (char const *)(& __kstrtab_ata_port_freeze)}; static char const __kstrtab_sata_async_notification[24U] = { 's', 'a', 't', 'a', '_', 'a', 's', 'y', 'n', 'c', '_', 'n', 'o', 't', 'i', 'f', 'i', 'c', 'a', 't', 'i', 'o', 'n', '\000'}; struct kernel_symbol const __ksymtab_sata_async_notification ; struct kernel_symbol const __ksymtab_sata_async_notification = {(unsigned long )(& sata_async_notification), (char const *)(& __kstrtab_sata_async_notification)}; static char const __kstrtab_ata_eh_freeze_port[19U] = { 'a', 't', 'a', '_', 'e', 'h', '_', 'f', 'r', 'e', 'e', 'z', 'e', '_', 'p', 'o', 'r', 't', '\000'}; struct kernel_symbol const __ksymtab_ata_eh_freeze_port ; struct kernel_symbol const __ksymtab_ata_eh_freeze_port = {(unsigned long )(& ata_eh_freeze_port), (char const *)(& __kstrtab_ata_eh_freeze_port)}; static char const __kstrtab_ata_eh_thaw_port[17U] = { 'a', 't', 'a', '_', 'e', 'h', '_', 't', 'h', 'a', 'w', '_', 'p', 'o', 'r', 't', '\000'}; struct kernel_symbol const __ksymtab_ata_eh_thaw_port ; struct kernel_symbol const __ksymtab_ata_eh_thaw_port = {(unsigned long )(& ata_eh_thaw_port), (char const *)(& __kstrtab_ata_eh_thaw_port)}; static char const __kstrtab_ata_eh_qc_complete[19U] = { 'a', 't', 'a', '_', 'e', 'h', '_', 'q', 'c', '_', 'c', 'o', 'm', 'p', 'l', 'e', 't', 'e', '\000'}; struct kernel_symbol const __ksymtab_ata_eh_qc_complete ; struct kernel_symbol const __ksymtab_ata_eh_qc_complete = {(unsigned long )(& ata_eh_qc_complete), (char const *)(& __kstrtab_ata_eh_qc_complete)}; static char const __kstrtab_ata_eh_qc_retry[16U] = { 'a', 't', 'a', '_', 'e', 'h', '_', 'q', 'c', '_', 'r', 'e', 't', 'r', 'y', '\000'}; struct kernel_symbol const __ksymtab_ata_eh_qc_retry ; struct kernel_symbol const __ksymtab_ata_eh_qc_retry = {(unsigned long )(& ata_eh_qc_retry), (char const *)(& __kstrtab_ata_eh_qc_retry)}; static char const __kstrtab_ata_eh_analyze_ncq_error[25U] = { 'a', 't', 'a', '_', 'e', 'h', '_', 'a', 'n', 'a', 'l', 'y', 'z', 'e', '_', 'n', 'c', 'q', '_', 'e', 'r', 'r', 'o', 'r', '\000'}; struct kernel_symbol const __ksymtab_ata_eh_analyze_ncq_error ; struct kernel_symbol const __ksymtab_ata_eh_analyze_ncq_error = {(unsigned long )(& ata_eh_analyze_ncq_error), (char const *)(& __kstrtab_ata_eh_analyze_ncq_error)}; static char const __kstrtab_ata_do_eh[10U] = { 'a', 't', 'a', '_', 'd', 'o', '_', 'e', 'h', '\000'}; struct kernel_symbol const __ksymtab_ata_do_eh ; struct kernel_symbol const __ksymtab_ata_do_eh = {(unsigned long )(& ata_do_eh), (char const *)(& __kstrtab_ata_do_eh)}; static char const __kstrtab_ata_std_error_handler[22U] = { 'a', 't', 'a', '_', 's', 't', 'd', '_', 'e', 'r', 'r', 'o', 'r', '_', 'h', 'a', 'n', 'd', 'l', 'e', 'r', '\000'}; struct kernel_symbol const __ksymtab_ata_std_error_handler ; struct kernel_symbol const __ksymtab_ata_std_error_handler = {(unsigned long )(& ata_std_error_handler), (char const *)(& __kstrtab_ata_std_error_handler)}; static char const __kstrtab_ata_cable_40wire[17U] = { 'a', 't', 'a', '_', 'c', 'a', 'b', 'l', 'e', '_', '4', '0', 'w', 'i', 'r', 'e', '\000'}; struct kernel_symbol const __ksymtab_ata_cable_40wire ; struct kernel_symbol const __ksymtab_ata_cable_40wire = {(unsigned long )(& ata_cable_40wire), (char const *)(& __kstrtab_ata_cable_40wire)}; static char const __kstrtab_ata_cable_80wire[17U] = { 'a', 't', 'a', '_', 'c', 'a', 'b', 'l', 'e', '_', '8', '0', 'w', 'i', 'r', 'e', '\000'}; struct kernel_symbol const __ksymtab_ata_cable_80wire ; struct kernel_symbol const __ksymtab_ata_cable_80wire = {(unsigned long )(& ata_cable_80wire), (char const *)(& __kstrtab_ata_cable_80wire)}; static char const __kstrtab_ata_cable_unknown[18U] = { 'a', 't', 'a', '_', 'c', 'a', 'b', 'l', 'e', '_', 'u', 'n', 'k', 'n', 'o', 'w', 'n', '\000'}; struct kernel_symbol const __ksymtab_ata_cable_unknown ; struct kernel_symbol const __ksymtab_ata_cable_unknown = {(unsigned long )(& ata_cable_unknown), (char const *)(& __kstrtab_ata_cable_unknown)}; static char const __kstrtab_ata_cable_ignore[17U] = { 'a', 't', 'a', '_', 'c', 'a', 'b', 'l', 'e', '_', 'i', 'g', 'n', 'o', 'r', 'e', '\000'}; struct kernel_symbol const __ksymtab_ata_cable_ignore ; struct kernel_symbol const __ksymtab_ata_cable_ignore = {(unsigned long )(& ata_cable_ignore), (char const *)(& __kstrtab_ata_cable_ignore)}; static char const __kstrtab_ata_cable_sata[15U] = { 'a', 't', 'a', '_', 'c', 'a', 'b', 'l', 'e', '_', 's', 'a', 't', 'a', '\000'}; struct kernel_symbol const __ksymtab_ata_cable_sata ; struct kernel_symbol const __ksymtab_ata_cable_sata = {(unsigned long )(& ata_cable_sata), (char const *)(& __kstrtab_ata_cable_sata)}; extern int ldv_poweroff_noirq_41(void) ; int ldv_retval_20 ; extern int ldv_restore_noirq_41(void) ; int ldv_retval_18 ; int ldv_retval_2 ; int ldv_retval_5 ; int ldv_retval_0 ; extern int ldv_restore_early_41(void) ; extern int ldv_prepare_41(void) ; int ldv_retval_11 ; int ldv_retval_1 ; int ldv_retval_15 ; int ldv_retval_16 ; extern int ldv_poweroff_late_41(void) ; extern int ldv_suspend_noirq_41(void) ; extern int ldv_resume_noirq_41(void) ; void ldv_check_final_state(void) ; int ldv_retval_8 ; int ldv_retval_7 ; int ldv_retval_19 ; int ldv_retval_14 ; int ldv_retval_17 ; extern int ldv_freeze_noirq_41(void) ; int ldv_retval_12 ; extern int ldv_freeze_late_41(void) ; extern void ldv_initialize(void) ; int ldv_retval_6 ; extern int ldv_complete_41(void) ; extern int ldv_thaw_noirq_41(void) ; int ldv_retval_21 ; int ldv_retval_13 ; int ldv_retval_9 ; int ldv_retval_10 ; extern int ldv_suspend_late_41(void) ; extern int ldv_thaw_early_41(void) ; int ldv_retval_4 ; extern int ldv_resume_early_41(void) ; int ldv_retval_3 ; void ldv_initialize_ata_port_operations_39(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(7064UL); ata_base_port_ops_group0 = (struct ata_link *)tmp; tmp___0 = ldv_init_zalloc(18112UL); ata_base_port_ops_group1 = (struct ata_port *)tmp___0; return; } } void ldv_initialize_trace_event_class_45(void) { void *tmp ; { tmp = ldv_init_zalloc(144UL); event_class_ata_eh_link_autopsy_group0 = (struct trace_event_call *)tmp; return; } } void call_and_disable_work_1(struct work_struct *work ) { { if ((ldv_work_1_0 == 2 || ldv_work_1_0 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_1_0) { ata_scsi_hotplug(work); ldv_work_1_0 = 1; return; } else { } if ((ldv_work_1_1 == 2 || ldv_work_1_1 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_1_1) { ata_scsi_hotplug(work); ldv_work_1_1 = 1; return; } else { } if ((ldv_work_1_2 == 2 || ldv_work_1_2 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_1_2) { ata_scsi_hotplug(work); ldv_work_1_2 = 1; return; } else { } if ((ldv_work_1_3 == 2 || ldv_work_1_3 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_1_3) { ata_scsi_hotplug(work); ldv_work_1_3 = 1; return; } else { } return; } } void call_and_disable_all_2(int state ) { { if (ldv_work_2_0 == state) { call_and_disable_work_2(ldv_work_struct_2_0); } else { } if (ldv_work_2_1 == state) { call_and_disable_work_2(ldv_work_struct_2_1); } else { } if (ldv_work_2_2 == state) { call_and_disable_work_2(ldv_work_struct_2_2); } else { } if (ldv_work_2_3 == state) { call_and_disable_work_2(ldv_work_struct_2_3); } else { } return; } } void ldv_initialize_ata_port_operations_37(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(18112UL); ata_dummy_port_ops_group1 = (struct ata_port *)tmp; tmp___0 = ldv_init_zalloc(240UL); ata_dummy_port_ops_group0 = (struct ata_queued_cmd *)tmp___0; return; } } void activate_work_1(struct work_struct *work , int state ) { { if (ldv_work_1_0 == 0) { ldv_work_struct_1_0 = work; ldv_work_1_0 = state; return; } else { } if (ldv_work_1_1 == 0) { ldv_work_struct_1_1 = work; ldv_work_1_1 = state; return; } else { } if (ldv_work_1_2 == 0) { ldv_work_struct_1_2 = work; ldv_work_1_2 = state; return; } else { } if (ldv_work_1_3 == 0) { ldv_work_struct_1_3 = work; ldv_work_1_3 = state; return; } else { } return; } } void ldv_dev_pm_ops_41(void) { void *tmp ; { tmp = ldv_init_zalloc(1416UL); ata_port_pm_ops_group1 = (struct device *)tmp; return; } } void disable_work_1(struct work_struct *work ) { { if ((ldv_work_1_0 == 3 || ldv_work_1_0 == 2) && (unsigned long )ldv_work_struct_1_0 == (unsigned long )work) { ldv_work_1_0 = 1; } else { } if ((ldv_work_1_1 == 3 || ldv_work_1_1 == 2) && (unsigned long )ldv_work_struct_1_1 == (unsigned long )work) { ldv_work_1_1 = 1; } else { } if ((ldv_work_1_2 == 3 || ldv_work_1_2 == 2) && (unsigned long )ldv_work_struct_1_2 == (unsigned long )work) { ldv_work_1_2 = 1; } else { } if ((ldv_work_1_3 == 3 || ldv_work_1_3 == 2) && (unsigned long )ldv_work_struct_1_3 == (unsigned long )work) { ldv_work_1_3 = 1; } else { } return; } } void work_init_1(void) { { ldv_work_1_0 = 0; ldv_work_1_1 = 0; ldv_work_1_2 = 0; ldv_work_1_3 = 0; return; } } void ldv_initialize_ata_port_operations_40(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(18112UL); ata_dummy_port_ops_group1 = (struct ata_port *)tmp; tmp___0 = ldv_init_zalloc(240UL); ata_dummy_port_ops_group0 = (struct ata_queued_cmd *)tmp___0; return; } } void ldv_initialize_trace_event_class_44(void) { void *tmp ; { tmp = ldv_init_zalloc(144UL); event_class_ata_eh_link_autopsy_qc_group0 = (struct trace_event_call *)tmp; return; } } void ldv_initialize_trace_event_class_46(void) { void *tmp ; { tmp = ldv_init_zalloc(144UL); event_class_ata_qc_complete_template_group0 = (struct trace_event_call *)tmp; return; } } void invoke_work_2(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_work_2_0 == 2 || ldv_work_2_0 == 3) { ldv_work_2_0 = 4; ata_scsi_dev_rescan(ldv_work_struct_2_0); ldv_work_2_0 = 1; } else { } goto ldv_51570; case 1: ; if (ldv_work_2_1 == 2 || ldv_work_2_1 == 3) { ldv_work_2_1 = 4; ata_scsi_dev_rescan(ldv_work_struct_2_0); ldv_work_2_1 = 1; } else { } goto ldv_51570; case 2: ; if (ldv_work_2_2 == 2 || ldv_work_2_2 == 3) { ldv_work_2_2 = 4; ata_scsi_dev_rescan(ldv_work_struct_2_0); ldv_work_2_2 = 1; } else { } goto ldv_51570; case 3: ; if (ldv_work_2_3 == 2 || ldv_work_2_3 == 3) { ldv_work_2_3 = 4; ata_scsi_dev_rescan(ldv_work_struct_2_0); ldv_work_2_3 = 1; } else { } goto ldv_51570; default: ldv_stop(); } ldv_51570: ; return; } } void work_init_2(void) { { ldv_work_2_0 = 0; ldv_work_2_1 = 0; ldv_work_2_2 = 0; ldv_work_2_3 = 0; return; } } void call_and_disable_all_1(int state ) { { if (ldv_work_1_0 == state) { call_and_disable_work_1(ldv_work_struct_1_0); } else { } if (ldv_work_1_1 == state) { call_and_disable_work_1(ldv_work_struct_1_1); } else { } if (ldv_work_1_2 == state) { call_and_disable_work_1(ldv_work_struct_1_2); } else { } if (ldv_work_1_3 == state) { call_and_disable_work_1(ldv_work_struct_1_3); } else { } return; } } void activate_work_2(struct work_struct *work , int state ) { { if (ldv_work_2_0 == 0) { ldv_work_struct_2_0 = work; ldv_work_2_0 = state; return; } else { } if (ldv_work_2_1 == 0) { ldv_work_struct_2_1 = work; ldv_work_2_1 = state; return; } else { } if (ldv_work_2_2 == 0) { ldv_work_struct_2_2 = work; ldv_work_2_2 = state; return; } else { } if (ldv_work_2_3 == 0) { ldv_work_struct_2_3 = work; ldv_work_2_3 = state; return; } else { } return; } } void ldv_initialize_trace_event_class_47(void) { void *tmp ; { tmp = ldv_init_zalloc(144UL); event_class_ata_qc_issue_group0 = (struct trace_event_call *)tmp; return; } } void ldv_initialize_ata_port_operations_43(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(7064UL); ata_base_port_ops_group0 = (struct ata_link *)tmp; tmp___0 = ldv_init_zalloc(18112UL); ata_base_port_ops_group1 = (struct ata_port *)tmp___0; return; } } void disable_work_2(struct work_struct *work ) { { if ((ldv_work_2_0 == 3 || ldv_work_2_0 == 2) && (unsigned long )ldv_work_struct_2_0 == (unsigned long )work) { ldv_work_2_0 = 1; } else { } if ((ldv_work_2_1 == 3 || ldv_work_2_1 == 2) && (unsigned long )ldv_work_struct_2_1 == (unsigned long )work) { ldv_work_2_1 = 1; } else { } if ((ldv_work_2_2 == 3 || ldv_work_2_2 == 2) && (unsigned long )ldv_work_struct_2_2 == (unsigned long )work) { ldv_work_2_2 = 1; } else { } if ((ldv_work_2_3 == 3 || ldv_work_2_3 == 2) && (unsigned long )ldv_work_struct_2_3 == (unsigned long )work) { ldv_work_2_3 = 1; } else { } return; } } void invoke_work_1(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_work_1_0 == 2 || ldv_work_1_0 == 3) { ldv_work_1_0 = 4; ata_scsi_hotplug(ldv_work_struct_1_0); ldv_work_1_0 = 1; } else { } goto ldv_51600; case 1: ; if (ldv_work_1_1 == 2 || ldv_work_1_1 == 3) { ldv_work_1_1 = 4; ata_scsi_hotplug(ldv_work_struct_1_0); ldv_work_1_1 = 1; } else { } goto ldv_51600; case 2: ; if (ldv_work_1_2 == 2 || ldv_work_1_2 == 3) { ldv_work_1_2 = 4; ata_scsi_hotplug(ldv_work_struct_1_0); ldv_work_1_2 = 1; } else { } goto ldv_51600; case 3: ; if (ldv_work_1_3 == 2 || ldv_work_1_3 == 3) { ldv_work_1_3 = 4; ata_scsi_hotplug(ldv_work_struct_1_0); ldv_work_1_3 = 1; } else { } goto ldv_51600; default: ldv_stop(); } ldv_51600: ; return; } } void call_and_disable_work_2(struct work_struct *work ) { { if ((ldv_work_2_0 == 2 || ldv_work_2_0 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_2_0) { ata_scsi_dev_rescan(work); ldv_work_2_0 = 1; return; } else { } if ((ldv_work_2_1 == 2 || ldv_work_2_1 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_2_1) { ata_scsi_dev_rescan(work); ldv_work_2_1 = 1; return; } else { } if ((ldv_work_2_2 == 2 || ldv_work_2_2 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_2_2) { ata_scsi_dev_rescan(work); ldv_work_2_2 = 1; return; } else { } if ((ldv_work_2_3 == 2 || ldv_work_2_3 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_2_3) { ata_scsi_dev_rescan(work); ldv_work_2_3 = 1; return; } else { } return; } } void ldv_main_exported_4(void) ; void ldv_main_exported_5(void) ; void ldv_main_exported_35(void) ; void ldv_main_exported_27(void) ; void ldv_main_exported_33(void) ; void ldv_main_exported_32(void) ; void ldv_main_exported_28(void) ; void ldv_main_exported_36(void) ; void ldv_main_exported_34(void) ; void ldv_main_exported_30(void) ; void ldv_main_exported_29(void) ; void ldv_main_exported_31(void) ; void ldv_main_exported_25(void) ; void ldv_main_exported_21(void) ; void ldv_main_exported_26(void) ; void ldv_main_exported_17(void) ; void ldv_main_exported_12(void) ; void ldv_main_exported_20(void) ; void ldv_main_exported_15(void) ; void ldv_main_exported_14(void) ; void ldv_main_exported_22(void) ; void ldv_main_exported_18(void) ; void ldv_main_exported_24(void) ; void ldv_main_exported_23(void) ; void ldv_main_exported_13(void) ; void ldv_main_exported_16(void) ; void ldv_main_exported_19(void) ; void ldv_main_exported_8(void) ; void ldv_main_exported_6(void) ; void ldv_main_exported_11(void) ; void ldv_main_exported_7(void) ; void ldv_main_exported_10(void) ; void ldv_main_exported_9(void) ; int main(void) { void *ldvarg29 ; void *tmp ; enum trace_reg ldvarg30 ; int ldvarg48 ; struct trace_event *ldvarg47 ; void *tmp___0 ; struct trace_iterator *ldvarg46 ; void *tmp___1 ; int ldvarg84 ; struct trace_iterator *ldvarg82 ; void *tmp___2 ; struct trace_event *ldvarg83 ; void *tmp___3 ; struct ata_link *ldvarg85 ; void *tmp___4 ; struct ata_queued_cmd *ldvarg88 ; void *tmp___5 ; unsigned int *ldvarg87 ; void *tmp___6 ; unsigned long ldvarg86 ; enum trace_reg ldvarg93 ; void *ldvarg92 ; void *tmp___7 ; int ldvarg110 ; struct trace_iterator *ldvarg108 ; void *tmp___8 ; struct trace_event *ldvarg109 ; void *tmp___9 ; unsigned int *ldvarg111 ; void *tmp___10 ; unsigned long ldvarg112 ; struct trace_iterator *ldvarg116 ; void *tmp___11 ; struct trace_event *ldvarg117 ; void *tmp___12 ; int ldvarg118 ; enum trace_reg ldvarg123 ; void *ldvarg122 ; void *tmp___13 ; struct ata_link *ldvarg127 ; void *tmp___14 ; unsigned int *ldvarg129 ; void *tmp___15 ; struct ata_queued_cmd *ldvarg130 ; void *tmp___16 ; unsigned long ldvarg128 ; enum trace_reg ldvarg140 ; void *ldvarg139 ; void *tmp___17 ; unsigned int *ldvarg142 ; void *tmp___18 ; unsigned long ldvarg141 ; int tmp___19 ; int tmp___20 ; int tmp___21 ; int tmp___22 ; int tmp___23 ; int tmp___24 ; int tmp___25 ; int tmp___26 ; int tmp___27 ; int tmp___28 ; int tmp___29 ; int tmp___30 ; int tmp___31 ; int tmp___32 ; int tmp___33 ; int tmp___34 ; int tmp___35 ; { tmp = ldv_init_zalloc(1UL); ldvarg29 = tmp; tmp___0 = ldv_init_zalloc(48UL); ldvarg47 = (struct trace_event *)tmp___0; tmp___1 = ldv_init_zalloc(8560UL); ldvarg46 = (struct trace_iterator *)tmp___1; tmp___2 = ldv_init_zalloc(8560UL); ldvarg82 = (struct trace_iterator *)tmp___2; tmp___3 = ldv_init_zalloc(48UL); ldvarg83 = (struct trace_event *)tmp___3; tmp___4 = ldv_init_zalloc(7064UL); ldvarg85 = (struct ata_link *)tmp___4; tmp___5 = ldv_init_zalloc(240UL); ldvarg88 = (struct ata_queued_cmd *)tmp___5; tmp___6 = ldv_init_zalloc(4UL); ldvarg87 = (unsigned int *)tmp___6; tmp___7 = ldv_init_zalloc(1UL); ldvarg92 = tmp___7; tmp___8 = ldv_init_zalloc(8560UL); ldvarg108 = (struct trace_iterator *)tmp___8; tmp___9 = ldv_init_zalloc(48UL); ldvarg109 = (struct trace_event *)tmp___9; tmp___10 = ldv_init_zalloc(4UL); ldvarg111 = (unsigned int *)tmp___10; tmp___11 = ldv_init_zalloc(8560UL); ldvarg116 = (struct trace_iterator *)tmp___11; tmp___12 = ldv_init_zalloc(48UL); ldvarg117 = (struct trace_event *)tmp___12; tmp___13 = ldv_init_zalloc(1UL); ldvarg122 = tmp___13; tmp___14 = ldv_init_zalloc(7064UL); ldvarg127 = (struct ata_link *)tmp___14; tmp___15 = ldv_init_zalloc(4UL); ldvarg129 = (unsigned int *)tmp___15; tmp___16 = ldv_init_zalloc(240UL); ldvarg130 = (struct ata_queued_cmd *)tmp___16; tmp___17 = ldv_init_zalloc(1UL); ldvarg139 = tmp___17; tmp___18 = ldv_init_zalloc(4UL); ldvarg142 = (unsigned int *)tmp___18; ldv_initialize(); ldv_memset((void *)(& ldvarg30), 0, 4UL); ldv_memset((void *)(& ldvarg48), 0, 4UL); ldv_memset((void *)(& ldvarg84), 0, 4UL); ldv_memset((void *)(& ldvarg86), 0, 8UL); ldv_memset((void *)(& ldvarg93), 0, 4UL); ldv_memset((void *)(& ldvarg110), 0, 4UL); ldv_memset((void *)(& ldvarg112), 0, 8UL); ldv_memset((void *)(& ldvarg118), 0, 4UL); ldv_memset((void *)(& ldvarg123), 0, 4UL); ldv_memset((void *)(& ldvarg128), 0, 8UL); ldv_memset((void *)(& ldvarg140), 0, 4UL); ldv_memset((void *)(& ldvarg141), 0, 8UL); ldv_state_variable_33 = 0; ldv_state_variable_32 = 0; ldv_state_variable_21 = 0; ldv_state_variable_7 = 0; ldv_state_variable_26 = 0; ldv_state_variable_17 = 0; work_init_2(); ldv_state_variable_2 = 1; work_init_1(); ldv_state_variable_1 = 1; ldv_state_variable_18 = 0; ldv_state_variable_30 = 0; ldv_state_variable_16 = 0; ldv_state_variable_44 = 0; ldv_state_variable_27 = 0; ldv_state_variable_25 = 0; ldv_state_variable_28 = 0; ldv_state_variable_40 = 0; ldv_state_variable_20 = 0; ldv_state_variable_14 = 0; ldv_state_variable_49 = 0; ldv_state_variable_24 = 0; ldv_state_variable_10 = 0; ldv_state_variable_31 = 0; ldv_state_variable_35 = 0; ldv_state_variable_11 = 0; ldv_state_variable_48 = 0; ldv_state_variable_42 = 0; ldv_state_variable_22 = 0; ref_cnt = 0; ldv_state_variable_0 = 1; ldv_state_variable_46 = 0; ldv_state_variable_13 = 0; ldv_state_variable_23 = 0; ldv_state_variable_29 = 0; ldv_state_variable_6 = 0; ldv_state_variable_50 = 0; ldv_state_variable_39 = 0; ldv_state_variable_36 = 0; work_init_3(); ldv_state_variable_3 = 1; ldv_state_variable_51 = 0; ldv_state_variable_9 = 0; ldv_state_variable_41 = 0; ldv_state_variable_12 = 0; ldv_state_variable_47 = 0; ldv_state_variable_15 = 0; ldv_state_variable_38 = 0; ldv_state_variable_8 = 0; ldv_state_variable_4 = 0; ldv_state_variable_34 = 0; ldv_state_variable_45 = 0; ldv_state_variable_37 = 0; ldv_state_variable_43 = 0; ldv_state_variable_19 = 0; ldv_state_variable_5 = 0; ldv_51897: tmp___19 = __VERIFIER_nondet_int(); switch (tmp___19) { case 0: ; if (ldv_state_variable_33 != 0) { ldv_main_exported_33(); } else { } goto ldv_51746; case 1: ; if (ldv_state_variable_32 != 0) { ldv_main_exported_32(); } else { } goto ldv_51746; case 2: ; if (ldv_state_variable_21 != 0) { ldv_main_exported_21(); } else { } goto ldv_51746; case 3: ; if (ldv_state_variable_7 != 0) { ldv_main_exported_7(); } else { } goto ldv_51746; case 4: ; if (ldv_state_variable_26 != 0) { ldv_main_exported_26(); } else { } goto ldv_51746; case 5: ; if (ldv_state_variable_17 != 0) { ldv_main_exported_17(); } else { } goto ldv_51746; case 6: ; if (ldv_state_variable_2 != 0) { invoke_work_2(); } else { } goto ldv_51746; case 7: ; if (ldv_state_variable_1 != 0) { invoke_work_1(); } else { } goto ldv_51746; case 8: ; if (ldv_state_variable_18 != 0) { ldv_main_exported_18(); } else { } goto ldv_51746; case 9: ; if (ldv_state_variable_30 != 0) { ldv_main_exported_30(); } else { } goto ldv_51746; case 10: ; if (ldv_state_variable_16 != 0) { ldv_main_exported_16(); } else { } goto ldv_51746; case 11: ; if (ldv_state_variable_44 != 0) { tmp___20 = __VERIFIER_nondet_int(); switch (tmp___20) { case 0: ; if (ldv_state_variable_44 == 1) { trace_event_define_fields_ata_eh_link_autopsy_qc(event_class_ata_eh_link_autopsy_qc_group0); ldv_state_variable_44 = 1; } else { } goto ldv_51759; case 1: ; if (ldv_state_variable_44 == 1) { trace_event_raw_init(event_class_ata_eh_link_autopsy_qc_group0); ldv_state_variable_44 = 1; } else { } goto ldv_51759; case 2: ; if (ldv_state_variable_44 == 1) { trace_event_reg(event_class_ata_eh_link_autopsy_qc_group0, ldvarg30, ldvarg29); ldv_state_variable_44 = 1; } else { } goto ldv_51759; default: ldv_stop(); } ldv_51759: ; } else { } goto ldv_51746; case 12: ; if (ldv_state_variable_27 != 0) { ldv_main_exported_27(); } else { } goto ldv_51746; case 13: ; if (ldv_state_variable_25 != 0) { ldv_main_exported_25(); } else { } goto ldv_51746; case 14: ; if (ldv_state_variable_28 != 0) { ldv_main_exported_28(); } else { } goto ldv_51746; case 15: ; if (ldv_state_variable_40 != 0) { tmp___21 = __VERIFIER_nondet_int(); switch (tmp___21) { case 0: ; if (ldv_state_variable_40 == 1) { ata_dummy_qc_issue(ata_dummy_port_ops_group0); ldv_state_variable_40 = 1; } else { } goto ldv_51768; case 1: ; if (ldv_state_variable_40 == 1) { ata_dummy_error_handler(ata_dummy_port_ops_group1); ldv_state_variable_40 = 1; } else { } goto ldv_51768; case 2: ; if (ldv_state_variable_40 == 1) { ata_std_sched_eh(ata_dummy_port_ops_group1); ldv_state_variable_40 = 1; } else { } goto ldv_51768; case 3: ; if (ldv_state_variable_40 == 1) { ata_noop_qc_prep(ata_dummy_port_ops_group0); ldv_state_variable_40 = 1; } else { } goto ldv_51768; case 4: ; if (ldv_state_variable_40 == 1) { ata_std_end_eh(ata_dummy_port_ops_group1); ldv_state_variable_40 = 1; } else { } goto ldv_51768; default: ldv_stop(); } ldv_51768: ; } else { } goto ldv_51746; case 16: ; if (ldv_state_variable_20 != 0) { ldv_main_exported_20(); } else { } goto ldv_51746; case 17: ; if (ldv_state_variable_14 != 0) { ldv_main_exported_14(); } else { } goto ldv_51746; case 18: ; if (ldv_state_variable_49 != 0) { tmp___22 = __VERIFIER_nondet_int(); switch (tmp___22) { case 0: ; if (ldv_state_variable_49 == 1) { trace_raw_output_ata_eh_link_autopsy(ldvarg46, ldvarg48, ldvarg47); ldv_state_variable_49 = 1; } else { } goto ldv_51778; default: ldv_stop(); } ldv_51778: ; } else { } goto ldv_51746; case 19: ; if (ldv_state_variable_24 != 0) { ldv_main_exported_24(); } else { } goto ldv_51746; case 20: ; if (ldv_state_variable_10 != 0) { ldv_main_exported_10(); } else { } goto ldv_51746; case 21: ; if (ldv_state_variable_31 != 0) { ldv_main_exported_31(); } else { } goto ldv_51746; case 22: ; if (ldv_state_variable_35 != 0) { ldv_main_exported_35(); } else { } goto ldv_51746; case 23: ; if (ldv_state_variable_11 != 0) { ldv_main_exported_11(); } else { } goto ldv_51746; case 24: ; if (ldv_state_variable_48 != 0) { tmp___23 = __VERIFIER_nondet_int(); switch (tmp___23) { case 0: ; if (ldv_state_variable_48 == 1) { trace_raw_output_ata_eh_link_autopsy_qc(ldvarg82, ldvarg84, ldvarg83); ldv_state_variable_48 = 1; } else { } goto ldv_51787; default: ldv_stop(); } ldv_51787: ; } else { } goto ldv_51746; case 25: ; if (ldv_state_variable_42 != 0) { tmp___24 = __VERIFIER_nondet_int(); switch (tmp___24) { case 0: ; if (ldv_state_variable_42 == 1) { ata_std_qc_defer(ldvarg88); ldv_state_variable_42 = 1; } else { } goto ldv_51791; case 1: ; if (ldv_state_variable_42 == 1) { sata_std_hardreset(ldvarg85, ldvarg87, ldvarg86); ldv_state_variable_42 = 1; } else { } goto ldv_51791; default: ldv_stop(); } ldv_51791: ; } else { } goto ldv_51746; case 26: ; if (ldv_state_variable_22 != 0) { ldv_main_exported_22(); } else { } goto ldv_51746; case 27: ; if (ldv_state_variable_0 != 0) { tmp___25 = __VERIFIER_nondet_int(); switch (tmp___25) { case 0: ; if (ldv_state_variable_0 == 3 && ref_cnt == 0) { ata_exit(); ldv_state_variable_0 = 2; goto ldv_final; } else { } goto ldv_51798; case 1: ; if (ldv_state_variable_0 == 1) { ldv_retval_0 = ata_init(); if (ldv_retval_0 == 0) { ldv_state_variable_0 = 3; ldv_state_variable_5 = 1; ldv_initialize_ata_port_operations_5(); ldv_state_variable_19 = 1; ldv_state_variable_43 = 1; ldv_initialize_ata_port_operations_43(); ldv_state_variable_37 = 1; ldv_initialize_ata_port_operations_37(); ldv_state_variable_45 = 1; ldv_initialize_trace_event_class_45(); ldv_state_variable_34 = 1; ldv_initialize_device_attribute_34(); ldv_state_variable_4 = 1; ldv_initialize_ata_port_operations_4(); ldv_state_variable_8 = 1; ldv_initialize_ata_port_operations_8(); ldv_state_variable_38 = 1; ldv_state_variable_15 = 1; ldv_state_variable_47 = 1; ldv_initialize_trace_event_class_47(); ldv_state_variable_12 = 1; ldv_state_variable_41 = 1; ldv_dev_pm_ops_41(); ldv_state_variable_9 = 1; ldv_initialize_ata_port_operations_9(); ldv_state_variable_51 = 1; ldv_state_variable_36 = 1; ldv_initialize_device_attribute_36(); ldv_state_variable_39 = 1; ldv_initialize_ata_port_operations_39(); ldv_state_variable_50 = 1; ldv_state_variable_6 = 1; ldv_state_variable_29 = 1; ldv_state_variable_23 = 1; ldv_state_variable_13 = 1; ldv_state_variable_46 = 1; ldv_initialize_trace_event_class_46(); ldv_state_variable_22 = 1; ldv_state_variable_42 = 1; ldv_state_variable_48 = 1; ldv_state_variable_11 = 1; ldv_initialize_ata_port_operations_11(); ldv_state_variable_35 = 1; ldv_initialize_device_attribute_35(); ldv_state_variable_31 = 1; ldv_initialize_device_attribute_31(); ldv_state_variable_10 = 1; ldv_initialize_ata_port_operations_10(); ldv_state_variable_24 = 1; ldv_state_variable_49 = 1; ldv_state_variable_14 = 1; ldv_state_variable_20 = 1; ldv_state_variable_40 = 1; ldv_initialize_ata_port_operations_40(); ldv_state_variable_28 = 1; ldv_initialize_device_attribute_28(); ldv_state_variable_25 = 1; ldv_state_variable_27 = 1; ldv_initialize_device_attribute_27(); ldv_state_variable_44 = 1; ldv_initialize_trace_event_class_44(); ldv_state_variable_16 = 1; ldv_state_variable_30 = 1; ldv_state_variable_18 = 1; ldv_state_variable_17 = 1; ldv_state_variable_26 = 1; ldv_state_variable_7 = 1; ldv_state_variable_21 = 1; ldv_state_variable_32 = 1; ldv_initialize_device_attribute_32(); ldv_state_variable_33 = 1; ldv_initialize_device_attribute_33(); } else { } if (ldv_retval_0 != 0) { ldv_state_variable_0 = 2; goto ldv_final; } else { } } else { } goto ldv_51798; default: ldv_stop(); } ldv_51798: ; } else { } goto ldv_51746; case 28: ; if (ldv_state_variable_46 != 0) { tmp___26 = __VERIFIER_nondet_int(); switch (tmp___26) { case 0: ; if (ldv_state_variable_46 == 1) { trace_event_define_fields_ata_qc_complete_template(event_class_ata_qc_complete_template_group0); ldv_state_variable_46 = 1; } else { } goto ldv_51803; case 1: ; if (ldv_state_variable_46 == 1) { trace_event_raw_init(event_class_ata_qc_complete_template_group0); ldv_state_variable_46 = 1; } else { } goto ldv_51803; case 2: ; if (ldv_state_variable_46 == 1) { trace_event_reg(event_class_ata_qc_complete_template_group0, ldvarg93, ldvarg92); ldv_state_variable_46 = 1; } else { } goto ldv_51803; default: ldv_stop(); } ldv_51803: ; } else { } goto ldv_51746; case 29: ; if (ldv_state_variable_13 != 0) { ldv_main_exported_13(); } else { } goto ldv_51746; case 30: ; if (ldv_state_variable_23 != 0) { ldv_main_exported_23(); } else { } goto ldv_51746; case 31: ; if (ldv_state_variable_29 != 0) { ldv_main_exported_29(); } else { } goto ldv_51746; case 32: ; if (ldv_state_variable_6 != 0) { ldv_main_exported_6(); } else { } goto ldv_51746; case 33: ; if (ldv_state_variable_50 != 0) { tmp___27 = __VERIFIER_nondet_int(); switch (tmp___27) { case 0: ; if (ldv_state_variable_50 == 1) { trace_raw_output_ata_qc_complete_template(ldvarg108, ldvarg110, ldvarg109); ldv_state_variable_50 = 1; } else { } goto ldv_51813; default: ldv_stop(); } ldv_51813: ; } else { } goto ldv_51746; case 34: ; if (ldv_state_variable_39 != 0) { tmp___28 = __VERIFIER_nondet_int(); switch (tmp___28) { case 0: ; if (ldv_state_variable_39 == 1) { ata_std_error_handler(ata_base_port_ops_group1); ldv_state_variable_39 = 1; } else { } goto ldv_51817; case 1: ; if (ldv_state_variable_39 == 1) { ata_std_sched_eh(ata_base_port_ops_group1); ldv_state_variable_39 = 1; } else { } goto ldv_51817; case 2: ; if (ldv_state_variable_39 == 1) { ata_std_prereset(ata_base_port_ops_group0, ldvarg112); ldv_state_variable_39 = 1; } else { } goto ldv_51817; case 3: ; if (ldv_state_variable_39 == 1) { ata_std_postreset(ata_base_port_ops_group0, ldvarg111); ldv_state_variable_39 = 1; } else { } goto ldv_51817; case 4: ; if (ldv_state_variable_39 == 1) { ata_std_end_eh(ata_base_port_ops_group1); ldv_state_variable_39 = 1; } else { } goto ldv_51817; default: ldv_stop(); } ldv_51817: ; } else { } goto ldv_51746; case 35: ; if (ldv_state_variable_36 != 0) { ldv_main_exported_36(); } else { } goto ldv_51746; case 36: ; goto ldv_51746; case 37: ; if (ldv_state_variable_51 != 0) { tmp___29 = __VERIFIER_nondet_int(); switch (tmp___29) { case 0: ; if (ldv_state_variable_51 == 1) { trace_raw_output_ata_qc_issue(ldvarg116, ldvarg118, ldvarg117); ldv_state_variable_51 = 1; } else { } goto ldv_51827; default: ldv_stop(); } ldv_51827: ; } else { } goto ldv_51746; case 38: ; if (ldv_state_variable_9 != 0) { ldv_main_exported_9(); } else { } goto ldv_51746; case 39: ; if (ldv_state_variable_41 != 0) { tmp___30 = __VERIFIER_nondet_int(); switch (tmp___30) { case 0: ; if (ldv_state_variable_41 == 15) { ldv_retval_21 = ata_port_pm_resume(ata_port_pm_ops_group1); if (ldv_retval_21 == 0) { ldv_state_variable_41 = 16; } else { } } else { } goto ldv_51832; case 1: ; if (ldv_state_variable_41 == 2) { ata_port_runtime_idle(ata_port_pm_ops_group1); ldv_state_variable_41 = 2; } else { } if (ldv_state_variable_41 == 1) { ata_port_runtime_idle(ata_port_pm_ops_group1); ldv_state_variable_41 = 1; } else { } goto ldv_51832; case 2: ; if (ldv_state_variable_41 == 2) { ldv_retval_20 = ata_port_runtime_resume(ata_port_pm_ops_group1); if (ldv_retval_20 == 0) { ldv_state_variable_41 = 1; ref_cnt = ref_cnt - 1; } else { } } else { } goto ldv_51832; case 3: ; if (ldv_state_variable_41 == 3) { ldv_retval_19 = ata_port_pm_suspend(ata_port_pm_ops_group1); if (ldv_retval_19 == 0) { ldv_state_variable_41 = 4; } else { } } else { } goto ldv_51832; case 4: ; if (ldv_state_variable_41 == 14) { ldv_retval_18 = ata_port_pm_resume(ata_port_pm_ops_group1); if (ldv_retval_18 == 0) { ldv_state_variable_41 = 16; } else { } } else { } goto ldv_51832; case 5: ; if (ldv_state_variable_41 == 1) { ldv_retval_17 = ata_port_runtime_suspend(ata_port_pm_ops_group1); if (ldv_retval_17 == 0) { ldv_state_variable_41 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_51832; case 6: ; if (ldv_state_variable_41 == 3) { ldv_retval_16 = ata_port_pm_poweroff(ata_port_pm_ops_group1); if (ldv_retval_16 == 0) { ldv_state_variable_41 = 5; } else { } } else { } goto ldv_51832; case 7: ; if (ldv_state_variable_41 == 3) { ldv_retval_15 = ata_port_pm_freeze(ata_port_pm_ops_group1); if (ldv_retval_15 == 0) { ldv_state_variable_41 = 6; } else { } } else { } goto ldv_51832; case 8: ; if (ldv_state_variable_41 == 13) { ldv_retval_14 = ata_port_pm_resume(ata_port_pm_ops_group1); if (ldv_retval_14 == 0) { ldv_state_variable_41 = 16; } else { } } else { } goto ldv_51832; case 9: ; if (ldv_state_variable_41 == 4) { ldv_retval_13 = ldv_suspend_late_41(); if (ldv_retval_13 == 0) { ldv_state_variable_41 = 7; } else { } } else { } goto ldv_51832; case 10: ; if (ldv_state_variable_41 == 10) { ldv_retval_12 = ldv_restore_early_41(); if (ldv_retval_12 == 0) { ldv_state_variable_41 = 14; } else { } } else { } goto ldv_51832; case 11: ; if (ldv_state_variable_41 == 7) { ldv_retval_11 = ldv_resume_early_41(); if (ldv_retval_11 == 0) { ldv_state_variable_41 = 13; } else { } } else { } goto ldv_51832; case 12: ; if (ldv_state_variable_41 == 12) { ldv_retval_10 = ldv_thaw_early_41(); if (ldv_retval_10 == 0) { ldv_state_variable_41 = 15; } else { } } else { } goto ldv_51832; case 13: ; if (ldv_state_variable_41 == 8) { ldv_retval_9 = ldv_resume_noirq_41(); if (ldv_retval_9 == 0) { ldv_state_variable_41 = 13; } else { } } else { } goto ldv_51832; case 14: ; if (ldv_state_variable_41 == 6) { ldv_retval_8 = ldv_freeze_noirq_41(); if (ldv_retval_8 == 0) { ldv_state_variable_41 = 11; } else { } } else { } goto ldv_51832; case 15: ; if (ldv_state_variable_41 == 1) { ldv_retval_7 = ldv_prepare_41(); if (ldv_retval_7 == 0) { ldv_state_variable_41 = 3; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_51832; case 16: ; if (ldv_state_variable_41 == 6) { ldv_retval_6 = ldv_freeze_late_41(); if (ldv_retval_6 == 0) { ldv_state_variable_41 = 12; } else { } } else { } goto ldv_51832; case 17: ; if (ldv_state_variable_41 == 11) { ldv_retval_5 = ldv_thaw_noirq_41(); if (ldv_retval_5 == 0) { ldv_state_variable_41 = 15; } else { } } else { } goto ldv_51832; case 18: ; if (ldv_state_variable_41 == 5) { ldv_retval_4 = ldv_poweroff_noirq_41(); if (ldv_retval_4 == 0) { ldv_state_variable_41 = 9; } else { } } else { } goto ldv_51832; case 19: ; if (ldv_state_variable_41 == 5) { ldv_retval_3 = ldv_poweroff_late_41(); if (ldv_retval_3 == 0) { ldv_state_variable_41 = 10; } else { } } else { } goto ldv_51832; case 20: ; if (ldv_state_variable_41 == 9) { ldv_retval_2 = ldv_restore_noirq_41(); if (ldv_retval_2 == 0) { ldv_state_variable_41 = 14; } else { } } else { } goto ldv_51832; case 21: ; if (ldv_state_variable_41 == 4) { ldv_retval_1 = ldv_suspend_noirq_41(); if (ldv_retval_1 == 0) { ldv_state_variable_41 = 8; } else { } } else { } goto ldv_51832; case 22: ; if (ldv_state_variable_41 == 16) { ldv_complete_41(); ldv_state_variable_41 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_51832; default: ldv_stop(); } ldv_51832: ; } else { } goto ldv_51746; case 40: ; if (ldv_state_variable_12 != 0) { ldv_main_exported_12(); } else { } goto ldv_51746; case 41: ; if (ldv_state_variable_47 != 0) { tmp___31 = __VERIFIER_nondet_int(); switch (tmp___31) { case 0: ; if (ldv_state_variable_47 == 1) { trace_event_define_fields_ata_qc_issue(event_class_ata_qc_issue_group0); ldv_state_variable_47 = 1; } else { } goto ldv_51859; case 1: ; if (ldv_state_variable_47 == 1) { trace_event_raw_init(event_class_ata_qc_issue_group0); ldv_state_variable_47 = 1; } else { } goto ldv_51859; case 2: ; if (ldv_state_variable_47 == 1) { trace_event_reg(event_class_ata_qc_issue_group0, ldvarg123, ldvarg122); ldv_state_variable_47 = 1; } else { } goto ldv_51859; default: ldv_stop(); } ldv_51859: ; } else { } goto ldv_51746; case 42: ; if (ldv_state_variable_15 != 0) { ldv_main_exported_15(); } else { } goto ldv_51746; case 43: ; if (ldv_state_variable_38 != 0) { tmp___32 = __VERIFIER_nondet_int(); switch (tmp___32) { case 0: ; if (ldv_state_variable_38 == 1) { ata_std_qc_defer(ldvarg130); ldv_state_variable_38 = 1; } else { } goto ldv_51866; case 1: ; if (ldv_state_variable_38 == 1) { sata_std_hardreset(ldvarg127, ldvarg129, ldvarg128); ldv_state_variable_38 = 1; } else { } goto ldv_51866; default: ldv_stop(); } ldv_51866: ; } else { } goto ldv_51746; case 44: ; if (ldv_state_variable_8 != 0) { ldv_main_exported_8(); } else { } goto ldv_51746; case 45: ; if (ldv_state_variable_4 != 0) { ldv_main_exported_4(); } else { } goto ldv_51746; case 46: ; if (ldv_state_variable_34 != 0) { ldv_main_exported_34(); } else { } goto ldv_51746; case 47: ; if (ldv_state_variable_45 != 0) { tmp___33 = __VERIFIER_nondet_int(); switch (tmp___33) { case 0: ; if (ldv_state_variable_45 == 1) { trace_event_define_fields_ata_eh_link_autopsy(event_class_ata_eh_link_autopsy_group0); ldv_state_variable_45 = 1; } else { } goto ldv_51874; case 1: ; if (ldv_state_variable_45 == 1) { trace_event_raw_init(event_class_ata_eh_link_autopsy_group0); ldv_state_variable_45 = 1; } else { } goto ldv_51874; case 2: ; if (ldv_state_variable_45 == 1) { trace_event_reg(event_class_ata_eh_link_autopsy_group0, ldvarg140, ldvarg139); ldv_state_variable_45 = 1; } else { } goto ldv_51874; default: ldv_stop(); } ldv_51874: ; } else { } goto ldv_51746; case 48: ; if (ldv_state_variable_37 != 0) { tmp___34 = __VERIFIER_nondet_int(); switch (tmp___34) { case 0: ; if (ldv_state_variable_37 == 1) { ata_dummy_qc_issue(ata_dummy_port_ops_group0); ldv_state_variable_37 = 1; } else { } goto ldv_51880; case 1: ; if (ldv_state_variable_37 == 1) { ata_dummy_error_handler(ata_dummy_port_ops_group1); ldv_state_variable_37 = 1; } else { } goto ldv_51880; case 2: ; if (ldv_state_variable_37 == 1) { ata_std_sched_eh(ata_dummy_port_ops_group1); ldv_state_variable_37 = 1; } else { } goto ldv_51880; case 3: ; if (ldv_state_variable_37 == 1) { ata_noop_qc_prep(ata_dummy_port_ops_group0); ldv_state_variable_37 = 1; } else { } goto ldv_51880; case 4: ; if (ldv_state_variable_37 == 1) { ata_std_end_eh(ata_dummy_port_ops_group1); ldv_state_variable_37 = 1; } else { } goto ldv_51880; default: ldv_stop(); } ldv_51880: ; } else { } goto ldv_51746; case 49: ; if (ldv_state_variable_43 != 0) { tmp___35 = __VERIFIER_nondet_int(); switch (tmp___35) { case 0: ; if (ldv_state_variable_43 == 1) { ata_std_error_handler(ata_base_port_ops_group1); ldv_state_variable_43 = 1; } else { } goto ldv_51888; case 1: ; if (ldv_state_variable_43 == 1) { ata_std_postreset(ata_base_port_ops_group0, ldvarg142); ldv_state_variable_43 = 1; } else { } goto ldv_51888; case 2: ; if (ldv_state_variable_43 == 1) { ata_std_end_eh(ata_base_port_ops_group1); ldv_state_variable_43 = 1; } else { } goto ldv_51888; case 3: ; if (ldv_state_variable_43 == 1) { ata_std_sched_eh(ata_base_port_ops_group1); ldv_state_variable_43 = 1; } else { } goto ldv_51888; case 4: ; if (ldv_state_variable_43 == 1) { ata_std_prereset(ata_base_port_ops_group0, ldvarg141); ldv_state_variable_43 = 1; } else { } goto ldv_51888; default: ldv_stop(); } ldv_51888: ; } else { } goto ldv_51746; case 50: ; if (ldv_state_variable_19 != 0) { ldv_main_exported_19(); } else { } goto ldv_51746; case 51: ; if (ldv_state_variable_5 != 0) { ldv_main_exported_5(); } else { } goto ldv_51746; default: ldv_stop(); } ldv_51746: ; goto ldv_51897; ldv_final: ldv_check_final_state(); return 0; } } __inline static bool IS_ERR(void const *ptr ) { bool tmp ; { tmp = ldv_is_err(ptr); return (tmp); } } bool ldv_queue_work_on_5(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_6(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_7(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_8(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_9(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_cancel_delayed_work_sync_10(struct delayed_work *ldv_func_arg1 ) { ldv_func_ret_type___3 ldv_func_res ; bool tmp ; { tmp = cancel_delayed_work_sync(ldv_func_arg1); ldv_func_res = tmp; disable_work_2(& ldv_func_arg1->work); return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; __inline static void set_bit(long nr , unsigned long volatile *addr ) { { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; bts %1,%0": "+m" (*((long volatile *)addr)): "Ir" (nr): "memory"); return; } } __inline static void clear_bit(long nr , unsigned long volatile *addr ) { { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; btr %1,%0": "+m" (*((long volatile *)addr)): "Ir" (nr)); return; } } __inline static int test_and_set_bit(long nr , unsigned long volatile *addr ) { char c ; { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; bts %2, %0; setc %1": "+m" (*addr), "=qm" (c): "Ir" (nr): "memory"); return ((int )((signed char )c) != 0); } } __inline static __u32 __arch_swab32(__u32 val ) { { __asm__ ("bswapl %0": "=r" (val): "0" (val)); return (val); } } __inline static __u64 __arch_swab64(__u64 val ) { { __asm__ ("bswapq %0": "=r" (val): "0" (val)); return (val); } } __inline static __u16 __fswab16(__u16 val ) { { return ((__u16 )((int )((short )((int )val << 8)) | (int )((short )((int )val >> 8)))); } } __inline static __u32 __fswab32(__u32 val ) { __u32 tmp ; { tmp = __arch_swab32(val); return (tmp); } } __inline static __u64 __fswab64(__u64 val ) { __u64 tmp ; { tmp = __arch_swab64(val); return (tmp); } } extern void __might_fault(char const * , int ) ; extern int kstrtoll(char const * , unsigned int , long long * ) ; __inline static int kstrtol(char const *s , unsigned int base , long *res ) { int tmp ; { tmp = kstrtoll(s, base, (long long *)res); return (tmp); } } extern enum system_states system_state ; extern int memcmp(void const * , void const * , size_t ) ; extern int strncmp(char const * , char const * , __kernel_size_t ) ; __inline static bool IS_ERR(void const *ptr ) ; extern void _raw_spin_unlock_irq(raw_spinlock_t * ) ; __inline static void spin_unlock_irq(spinlock_t *lock ) { { _raw_spin_unlock_irq(& lock->__annonCompField18.rlock); return; } } extern void mutex_lock_nested(struct mutex * , unsigned int ) ; extern void mutex_unlock(struct mutex * ) ; extern unsigned int jiffies_to_msecs(unsigned long const ) ; extern unsigned long round_jiffies_relative(unsigned long ) ; extern struct workqueue_struct *system_long_wq ; bool ldv_queue_work_on_21(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_23(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_22(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; bool ldv_queue_delayed_work_on_25(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; void ldv_flush_workqueue_24(struct workqueue_struct *ldv_func_arg1 ) ; __inline static bool queue_delayed_work(struct workqueue_struct *wq , struct delayed_work *dwork , unsigned long delay ) { bool tmp ; { tmp = ldv_queue_delayed_work_on_22(8192, wq, dwork, delay); return (tmp); } } extern bool capable(int ) ; extern unsigned long _copy_from_user(void * , void const * , unsigned int ) ; extern unsigned long _copy_to_user(void * , void const * , unsigned int ) ; extern void __copy_from_user_overflow(void) ; extern void __copy_to_user_overflow(void) ; __inline static unsigned long copy_from_user(void *to , void const *from , unsigned long n ) { int sz ; unsigned long tmp ; long tmp___0 ; { tmp = __builtin_object_size((void const *)to, 0); sz = (int )tmp; __might_fault("./arch/x86/include/asm/uaccess.h", 697); tmp___0 = ldv__builtin_expect((long )(sz < 0 || (unsigned long )sz >= n), 1L); if (tmp___0 != 0L) { n = _copy_from_user(to, from, (unsigned int )n); } else { __copy_from_user_overflow(); } return (n); } } __inline static unsigned long copy_to_user(void *to , void const *from , unsigned long n ) { int sz ; unsigned long tmp ; long tmp___0 ; { tmp = __builtin_object_size(from, 0); sz = (int )tmp; __might_fault("./arch/x86/include/asm/uaccess.h", 732); tmp___0 = ldv__builtin_expect((long )(sz < 0 || (unsigned long )sz >= n), 1L); if (tmp___0 != 0L) { n = _copy_to_user(to, from, (unsigned int )n); } else { __copy_to_user_overflow(); } return (n); } } __inline static struct page *sg_page___0(struct scatterlist *sg ) { long tmp ; long tmp___0 ; { tmp = ldv__builtin_expect(sg->sg_magic != 2271560481UL, 0L); if (tmp != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"include/linux/scatterlist.h"), "i" (123), "i" (12UL)); ldv_31169: ; goto ldv_31169; } else { } tmp___0 = ldv__builtin_expect((long )((int )sg->page_link) & 1L, 0L); if (tmp___0 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"include/linux/scatterlist.h"), "i" (124), "i" (12UL)); ldv_31170: ; goto ldv_31170; } else { } return ((struct page *)(sg->page_link & 0xfffffffffffffffcUL)); } } extern size_t sg_copy_from_buffer(struct scatterlist * , unsigned int , void const * , size_t ) ; extern size_t sg_copy_to_buffer(struct scatterlist * , unsigned int , void * , size_t ) ; __inline static unsigned int blk_rq_bytes(struct request const *rq ) { { return ((unsigned int )rq->__data_len); } } extern void blk_queue_max_hw_sectors(struct request_queue * , unsigned int ) ; extern void blk_queue_update_dma_pad(struct request_queue * , unsigned int ) ; extern int blk_queue_dma_drain(struct request_queue * , dma_drain_needed_fn * , void * , unsigned int ) ; extern void blk_queue_update_dma_alignment(struct request_queue * , int ) ; extern void blk_queue_flush_queueable(struct request_queue * , bool ) ; extern struct blk_queue_tag *blk_init_tags(int , int ) ; extern unsigned char const scsi_command_size_tbl[8U] ; extern bool scsi_normalize_sense(u8 const * , int , struct scsi_sense_hdr * ) ; __inline static bool shost_use_blk_mq(struct Scsi_Host *shost ) { { return ((int )shost->use_blk_mq != 0); } } extern struct Scsi_Host *scsi_host_alloc(struct scsi_host_template * , int ) ; extern int scsi_add_host_with_dma(struct Scsi_Host * , struct device * , struct device * ) ; extern void scsi_rescan_device(struct device * ) ; extern struct scsi_device *__scsi_add_device(struct Scsi_Host * , uint , uint , u64 , void * ) ; extern void scsi_remove_device(struct scsi_device * ) ; extern int scsi_device_get(struct scsi_device * ) ; extern void scsi_device_put(struct scsi_device * ) ; extern int scsi_change_queue_depth(struct scsi_device * , int ) ; extern int scsi_device_set_state(struct scsi_device * , enum scsi_device_state ) ; extern void sdev_evt_send_simple(struct scsi_device * , enum scsi_device_event , gfp_t ) ; extern int scsi_execute(struct scsi_device * , unsigned char const * , int , void * , unsigned int , unsigned char * , int , int , u64 , int * ) ; __inline static unsigned int scsi_sg_count(struct scsi_cmnd *cmd ) { { return (cmd->sdb.table.nents); } } __inline static struct scatterlist *scsi_sglist(struct scsi_cmnd *cmd ) { { return (cmd->sdb.table.sgl); } } __inline static unsigned int scsi_bufflen(struct scsi_cmnd *cmd ) { { return (cmd->sdb.length); } } extern void scsi_build_sense_buffer(int , u8 * , u8 , u8 , u8 ) ; extern void scsi_set_sense_information(u8 * , u64 ) ; __inline static int scsi_init_shared_tag_map(struct Scsi_Host *shost , int depth ) { bool tmp ; { tmp = shost_use_blk_mq(shost); if ((int )tmp) { return (0); } else { } if ((unsigned long )shost->__annonCompField85.bqt == (unsigned long )((struct blk_queue_tag *)0)) { shost->__annonCompField85.bqt = blk_init_tags(depth, (shost->hostt)->tag_alloc_policy); if ((unsigned long )shost->__annonCompField85.bqt == (unsigned long )((struct blk_queue_tag *)0)) { return (-12); } else { } } else { } return (0); } } __inline static bool ata_id_has_fua(u16 const *id ) { { if (((int )*(id + 84UL) & 49152) != 16384) { return (0); } else { } return (((int )*(id + 84UL) & 64) != 0); } } __inline static bool ata_id_has_flush(u16 const *id ) { { if (((int )*(id + 83UL) & 49152) != 16384) { return (0); } else { } return (((int )*(id + 83UL) & 4096) != 0); } } __inline static u32 ata_id_logical_sector_size(u16 const *id ) { { if (((int )*(id + 106UL) & 53248) == 20480) { return ((u32 )((unsigned long )(((int )*(id + 118UL) << 16) + (int )*(id + 117UL))) * 2U); } else { } return (512U); } } __inline static u8 ata_id_log2_per_physical_sector(u16 const *id ) { { if (((int )*(id + 106UL) & 57344) == 24576) { return ((unsigned int )((u8 )*(id + 106UL)) & 15U); } else { } return (0U); } } __inline static u16 ata_id_logical_sector_offset(u16 const *id , u8 log2_per_phys ) { u16 word_209 ; u16 first ; { word_209 = *(id + 209UL); if ((unsigned int )log2_per_phys > 1U && ((int )word_209 & 49152) == 16384) { first = (unsigned int )word_209 & 16383U; if ((unsigned int )first != 0U) { return ((int )((u16 )(1 << (int )log2_per_phys)) - (int )first); } else { } } else { } return (0U); } } __inline static bool ata_id_rahead_enabled(u16 const *id ) { { if (((int )*(id + 87UL) & 49152) != 16384) { return (0); } else { } return (((int )*(id + 85UL) & 64) != 0); } } __inline static bool ata_id_wcache_enabled(u16 const *id ) { { if (((int )*(id + 87UL) & 49152) != 16384) { return (0); } else { } return (((int )*(id + 85UL) & 32) != 0); } } __inline static unsigned int ata_id_major_version___0(u16 const *id ) { unsigned int mver ; { if ((unsigned int )((unsigned short )*(id + 80UL)) == 65535U) { return (0U); } else { } mver = 14U; goto ldv_35718; ldv_35717: ; if (((int )*(id + 80UL) >> (int )mver) & 1) { goto ldv_35716; } else { } mver = mver - 1U; ldv_35718: ; if (mver != 0U) { goto ldv_35717; } else { } ldv_35716: ; return (mver); } } __inline static bool ata_id_has_unload(u16 const *id ) { unsigned int tmp ; { tmp = ata_id_major_version___0(id); if ((tmp > 6U && ((int )*(id + 84UL) & 49152) == 16384) && ((int )*(id + 84UL) & 8192) != 0) { return (1); } else { } return (0); } } __inline static bool ata_id_has_wwn(u16 const *id ) { { return (((int )*(id + 87UL) & 49408) == 16640); } } __inline static int ata_id_form_factor(u16 const *id ) { u16 val ; unsigned int tmp ; { val = *(id + 168UL); tmp = ata_id_major_version___0(id); if ((tmp <= 6U || (unsigned int )val == 0U) || (unsigned int )val == 65535U) { return (0); } else { } val = (unsigned int )val & 15U; if ((unsigned int )val > 5U) { return (0); } else { } return ((int )val); } } __inline static int ata_id_rotation_rate(u16 const *id ) { u16 val ; unsigned int tmp ; { val = *(id + 217UL); tmp = ata_id_major_version___0(id); if ((tmp <= 6U || (unsigned int )val == 0U) || (unsigned int )val == 65535U) { return (0); } else { } if ((unsigned int )val > 1U && (unsigned int )val <= 1024U) { return (0); } else { } return ((int )val); } } __inline static bool ata_id_has_trim(u16 const *id ) { unsigned int tmp ; { tmp = ata_id_major_version___0(id); if (tmp > 6U && (int )*(id + 169UL) & 1) { return (1); } else { } return (0); } } __inline static bool ata_id_has_zero_after_trim(u16 const *id ) { bool tmp ; { tmp = ata_id_has_trim(id); if ((int )tmp && ((int )*(id + 69UL) & 16416) == 16416) { return (1); } else { } return (0); } } __inline static unsigned int ata_set_lba_range_entries(void *_buffer , unsigned int buf_size , u64 sector , unsigned long count ) { __le64 *buffer ; unsigned int i ; unsigned int used_bytes ; u64 entry ; unsigned int tmp ; { buffer = (__le64 *)_buffer; i = 0U; goto ldv_35805; ldv_35804: entry = ((unsigned long long )(65535UL < count ? 65535UL : count) << 48) | sector; tmp = i; i = i + 1U; *(buffer + (unsigned long )tmp) = entry; if (count <= 65535UL) { goto ldv_35803; } else { } count = count - 65535UL; sector = sector + 65535ULL; ldv_35805: ; if (buf_size / 8U > i) { goto ldv_35804; } else { } ldv_35803: used_bytes = (i * 8U + 511U) & 4294966784U; memset((void *)buffer + (unsigned long )i, 0, (size_t )(used_bytes - i * 8U)); return (used_bytes); } } struct device_attribute dev_attr_link_power_management_policy ; struct device_attribute dev_attr_unload_heads ; struct device_attribute dev_attr_em_message_type ; struct device_attribute dev_attr_em_message ; struct device_attribute dev_attr_sw_activity ; __inline static int is_multi_taskfile(struct ata_taskfile *tf ) { { return (((((unsigned int )tf->command == 196U || (unsigned int )tf->command == 197U) || (unsigned int )tf->command == 41U) || (unsigned int )tf->command == 57U) || (unsigned int )tf->command == 206U); } } int ata_scsi_ioctl(struct scsi_device *scsidev , int cmd , void *arg ) ; int ata_sas_scsi_ioctl(struct ata_port *ap , struct scsi_device *scsidev , int cmd , void *arg ) ; void ata_sas_port_destroy(struct ata_port *ap ) ; struct ata_port *ata_sas_port_alloc(struct ata_host *host , struct ata_port_info *port_info , struct Scsi_Host *shost ) ; void ata_sas_async_probe(struct ata_port *ap ) ; int ata_sas_sync_probe(struct ata_port *ap ) ; int ata_sas_port_init(struct ata_port *ap ) ; int ata_sas_port_start(struct ata_port *ap ) ; void ata_sas_port_stop(struct ata_port *ap ) ; int ata_sas_slave_configure(struct scsi_device *sdev , struct ata_port *ap ) ; int ata_sas_queuecmd(struct scsi_cmnd *cmd , struct ata_port *ap ) ; struct device_attribute *ata_common_sdev_attrs[2U] ; __inline static bool ata_fpdma_dsm_supported(struct ata_device *dev ) { { return ((bool )((dev->flags & 524288UL) != 0UL && (int )dev->ncq_send_recv_cmds[4] & 1)); } } __inline static unsigned int ata_qc_raw_nbytes(struct ata_queued_cmd *qc ) { unsigned int _min1 ; unsigned int _min2 ; { _min1 = qc->extrabytes; _min2 = qc->nbytes; return (qc->nbytes - (_min1 < _min2 ? _min1 : _min2)); } } __inline static int ata_try_flush_cache(struct ata_device const *dev ) { bool tmp ; bool tmp___0 ; bool tmp___1 ; int tmp___2 ; { tmp = ata_id_wcache_enabled((u16 const *)(& dev->__annonCompField86.id)); if ((int )tmp) { tmp___2 = 1; } else { tmp___0 = ata_id_has_flush((u16 const *)(& dev->__annonCompField86.id)); if ((int )tmp___0) { tmp___2 = 1; } else { tmp___1 = ata_id_has_flush_ext((u16 const *)(& dev->__annonCompField86.id)); if ((int )tmp___1) { tmp___2 = 1; } else { tmp___2 = 0; } } } return (tmp___2); } } __inline static struct ata_port *ata_shost_to_port(struct Scsi_Host *host ) { { return (*((struct ata_port **)(& host->hostdata))); } } extern bool pm_freezing ; extern bool system_entering_hibernation(void) ; __inline static void put_unaligned_be16(u16 val , void *p ) { __u16 tmp ; { tmp = __fswab16((int )val); *((__be16 *)p) = tmp; return; } } __inline static void put_unaligned_be32(u32 val , void *p ) { __u32 tmp ; { tmp = __fswab32(val); *((__be32 *)p) = tmp; return; } } __inline static void put_unaligned_be64(u64 val , void *p ) { __u64 tmp ; { tmp = __fswab64(val); *((__be64 *)p) = tmp; return; } } int ata_task_ioctl(struct scsi_device *scsidev , void *arg ) ; int ata_cmd_ioctl(struct scsi_device *scsidev , void *arg ) ; int ata_scsi_offline_dev(struct ata_device *dev ) ; void ata_scsi_set_sense(struct scsi_cmnd *cmd , u8 sk , u8 asc , u8 ascq ) ; void ata_scsi_set_sense_information(struct scsi_cmnd *cmd , struct ata_taskfile const *tf ) ; void ata_scsi_media_change_notify(struct ata_device *dev ) ; int ata_scsi_user_scan(struct Scsi_Host *shost , unsigned int channel , unsigned int id , u64 lun ) ; static spinlock_t ata_scsi_rbuf_lock = {{{{{0}}, 3735899821U, 4294967295U, (void *)-1, {0, {0, 0}, "ata_scsi_rbuf_lock", 0, 0UL}}}}; static u8 ata_scsi_rbuf[4096U] ; static struct ata_device *__ata_scsi_find_dev(struct ata_port *ap , struct scsi_device const *scsidev ) ; static struct ata_device *ata_scsi_find_dev(struct ata_port *ap , struct scsi_device const *scsidev ) ; static u8 const def_rw_recovery_mpage[12U] = { 1U, 10U, 128U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U}; static u8 const def_cache_mpage[20U] = { 8U, 18U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U}; static u8 const def_control_mpage[12U] = { 10U, 10U, 2U, 0U, 0U, 0U, 0U, 0U, 255U, 255U, 0U, 30U}; static char const *ata_lpm_policy_names[4U] = { "max_performance", "max_performance", "medium_power", "min_power"}; static ssize_t ata_scsi_lpm_store(struct device *device , struct device_attribute *attr , char const *buf , size_t count ) { struct Scsi_Host *shost ; struct device const *__mptr ; struct ata_port *ap ; struct ata_port *tmp ; struct ata_link *link ; struct ata_device *dev ; enum ata_lpm_policy policy ; unsigned long flags ; char const *name ; size_t tmp___0 ; int tmp___1 ; raw_spinlock_t *tmp___2 ; { __mptr = (struct device const *)device; shost = (struct Scsi_Host *)__mptr + 0xfffffffffffff6c0UL; tmp = ata_shost_to_port(shost); ap = tmp; policy = 1; goto ldv_43412; ldv_43411: name = ata_lpm_policy_names[(unsigned int )policy]; tmp___0 = strlen(name); tmp___1 = strncmp(name, buf, tmp___0); if (tmp___1 == 0) { goto ldv_43410; } else { } policy = (enum ata_lpm_policy )((unsigned int )policy + 1U); ldv_43412: ; if ((unsigned int )policy <= 3U) { goto ldv_43411; } else { } ldv_43410: ; if ((unsigned int )policy == 4U) { return (-22L); } else { } tmp___2 = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp___2); link = ata_link_next((struct ata_link *)0, ap, 0); goto ldv_43423; ldv_43422: dev = ata_dev_next((struct ata_device *)0, & ap->link, 0); goto ldv_43420; ldv_43419: ; if ((dev->horkage & 1048576U) != 0U) { count = 0xffffffffffffffa1UL; goto out_unlock; } else { } dev = ata_dev_next(dev, & ap->link, 0); ldv_43420: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_43419; } else { } link = ata_link_next(link, ap, 0); ldv_43423: ; if ((unsigned long )link != (unsigned long )((struct ata_link *)0)) { goto ldv_43422; } else { } ap->target_lpm_policy = policy; ata_port_schedule_eh(ap); out_unlock: spin_unlock_irqrestore(ap->lock, flags); return ((ssize_t )count); } } static ssize_t ata_scsi_lpm_show(struct device *dev , struct device_attribute *attr , char *buf ) { struct Scsi_Host *shost ; struct device const *__mptr ; struct ata_port *ap ; struct ata_port *tmp ; int tmp___0 ; { __mptr = (struct device const *)dev; shost = (struct Scsi_Host *)__mptr + 0xfffffffffffff6c0UL; tmp = ata_shost_to_port(shost); ap = tmp; if ((unsigned int )ap->target_lpm_policy > 3U) { return (-22L); } else { } tmp___0 = snprintf(buf, 4096UL, "%s\n", ata_lpm_policy_names[(unsigned int )ap->target_lpm_policy]); return ((ssize_t )tmp___0); } } struct device_attribute dev_attr_link_power_management_policy = {{"link_power_management_policy", 420U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & ata_scsi_lpm_show, & ata_scsi_lpm_store}; static char const __kstrtab_dev_attr_link_power_management_policy[38U] = { 'd', 'e', 'v', '_', 'a', 't', 't', 'r', '_', 'l', 'i', 'n', 'k', '_', 'p', 'o', 'w', 'e', 'r', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'm', 'e', 'n', 't', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\000'}; struct kernel_symbol const __ksymtab_dev_attr_link_power_management_policy ; struct kernel_symbol const __ksymtab_dev_attr_link_power_management_policy = {(unsigned long )(& dev_attr_link_power_management_policy), (char const *)(& __kstrtab_dev_attr_link_power_management_policy)}; static ssize_t ata_scsi_park_show(struct device *device , struct device_attribute *attr , char *buf ) { struct scsi_device *sdev ; struct device const *__mptr ; struct ata_port *ap ; struct ata_link *link ; struct ata_device *dev ; unsigned long flags ; unsigned long now ; unsigned int msecs ; int rc ; raw_spinlock_t *tmp ; int tmp___0 ; int tmp___1 ; { __mptr = (struct device const *)device; sdev = (struct scsi_device *)__mptr + 0xfffffffffffffe28UL; msecs = msecs; rc = 0; ap = ata_shost_to_port(sdev->host); tmp = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp); dev = ata_scsi_find_dev(ap, (struct scsi_device const *)sdev); if ((unsigned long )dev == (unsigned long )((struct ata_device *)0)) { rc = -19; goto unlock; } else { } if ((dev->flags & 131072UL) != 0UL) { rc = -95; goto unlock; } else { } link = dev->link; now = jiffies; if (((ap->pflags & 2U) != 0U && (link->eh_context.unloaded_mask & (unsigned int )(1 << (int )dev->devno)) != 0U) && (long )(now - dev->unpark_deadline) < 0L) { msecs = jiffies_to_msecs(dev->unpark_deadline - now); } else { msecs = 0U; } unlock: spin_unlock_irq(ap->lock); if (rc == 0) { tmp___0 = snprintf(buf, 20UL, "%u\n", msecs); tmp___1 = tmp___0; } else { tmp___1 = rc; } return ((ssize_t )tmp___1); } } static ssize_t ata_scsi_park_store(struct device *device , struct device_attribute *attr , char const *buf , size_t len ) { struct scsi_device *sdev ; struct device const *__mptr ; struct ata_port *ap ; struct ata_device *dev ; long input ; unsigned long flags ; int rc ; raw_spinlock_t *tmp ; long tmp___0 ; { __mptr = (struct device const *)device; sdev = (struct scsi_device *)__mptr + 0xfffffffffffffe28UL; rc = kstrtol(buf, 10U, & input); if (rc != 0) { return ((ssize_t )rc); } else { } if (input < -2L) { return (-22L); } else { } if (input > 30000L) { rc = -75; input = 30000L; } else { } ap = ata_shost_to_port(sdev->host); tmp = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp); dev = ata_scsi_find_dev(ap, (struct scsi_device const *)sdev); tmp___0 = ldv__builtin_expect((unsigned long )dev == (unsigned long )((struct ata_device *)0), 0L); if (tmp___0 != 0L) { rc = -19; goto unlock; } else { } if (dev->class != 1U && dev->class != 9U) { rc = -95; goto unlock; } else { } if (input >= 0L) { if ((dev->flags & 131072UL) != 0UL) { rc = -95; goto unlock; } else { } dev->unpark_deadline = ata_deadline(jiffies, (unsigned long )input); (dev->link)->eh_info.dev_action[dev->devno] = (dev->link)->eh_info.dev_action[dev->devno] | 32U; ata_port_schedule_eh(ap); complete(& ap->park_req_pending); } else { switch (input) { case -1L: dev->flags = dev->flags & 0xfffffffffffdffffUL; goto ldv_43499; case -2L: dev->flags = dev->flags | 131072UL; goto ldv_43499; } ldv_43499: ; } unlock: spin_unlock_irqrestore(ap->lock, flags); return ((ssize_t )(rc != 0 ? (size_t )rc : len)); } } struct device_attribute dev_attr_unload_heads = {{"unload_heads", 420U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & ata_scsi_park_show, & ata_scsi_park_store}; static char const __kstrtab_dev_attr_unload_heads[22U] = { 'd', 'e', 'v', '_', 'a', 't', 't', 'r', '_', 'u', 'n', 'l', 'o', 'a', 'd', '_', 'h', 'e', 'a', 'd', 's', '\000'}; struct kernel_symbol const __ksymtab_dev_attr_unload_heads ; struct kernel_symbol const __ksymtab_dev_attr_unload_heads = {(unsigned long )(& dev_attr_unload_heads), (char const *)(& __kstrtab_dev_attr_unload_heads)}; void ata_scsi_set_sense(struct scsi_cmnd *cmd , u8 sk , u8 asc , u8 ascq ) { { if ((unsigned long )cmd == (unsigned long )((struct scsi_cmnd *)0)) { return; } else { } cmd->result = 134217730; scsi_build_sense_buffer(0, cmd->sense_buffer, (int )sk, (int )asc, (int )ascq); return; } } void ata_scsi_set_sense_information(struct scsi_cmnd *cmd , struct ata_taskfile const *tf ) { u64 information ; { if ((unsigned long )cmd == (unsigned long )((struct scsi_cmnd *)0)) { return; } else { } information = ata_tf_read_block(tf, (struct ata_device *)0); scsi_set_sense_information(cmd->sense_buffer, information); return; } } static ssize_t ata_scsi_em_message_store(struct device *dev , struct device_attribute *attr , char const *buf , size_t count ) { struct Scsi_Host *shost ; struct device const *__mptr ; struct ata_port *ap ; struct ata_port *tmp ; ssize_t tmp___0 ; { __mptr = (struct device const *)dev; shost = (struct Scsi_Host *)__mptr + 0xfffffffffffff6c0UL; tmp = ata_shost_to_port(shost); ap = tmp; if ((unsigned long )(ap->ops)->em_store != (unsigned long )((ssize_t (*)(struct ata_port * , char const * , size_t ))0) && (ap->flags & 2097152UL) != 0UL) { tmp___0 = (*((ap->ops)->em_store))(ap, buf, count); return (tmp___0); } else { } return (-22L); } } static ssize_t ata_scsi_em_message_show(struct device *dev , struct device_attribute *attr , char *buf ) { struct Scsi_Host *shost ; struct device const *__mptr ; struct ata_port *ap ; struct ata_port *tmp ; ssize_t tmp___0 ; { __mptr = (struct device const *)dev; shost = (struct Scsi_Host *)__mptr + 0xfffffffffffff6c0UL; tmp = ata_shost_to_port(shost); ap = tmp; if ((unsigned long )(ap->ops)->em_show != (unsigned long )((ssize_t (*)(struct ata_port * , char * ))0) && (ap->flags & 2097152UL) != 0UL) { tmp___0 = (*((ap->ops)->em_show))(ap, buf); return (tmp___0); } else { } return (-22L); } } struct device_attribute dev_attr_em_message = {{"em_message", 420U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & ata_scsi_em_message_show, & ata_scsi_em_message_store}; static char const __kstrtab_dev_attr_em_message[20U] = { 'd', 'e', 'v', '_', 'a', 't', 't', 'r', '_', 'e', 'm', '_', 'm', 'e', 's', 's', 'a', 'g', 'e', '\000'}; struct kernel_symbol const __ksymtab_dev_attr_em_message ; struct kernel_symbol const __ksymtab_dev_attr_em_message = {(unsigned long )(& dev_attr_em_message), (char const *)(& __kstrtab_dev_attr_em_message)}; static ssize_t ata_scsi_em_message_type_show(struct device *dev , struct device_attribute *attr , char *buf ) { struct Scsi_Host *shost ; struct device const *__mptr ; struct ata_port *ap ; struct ata_port *tmp ; int tmp___0 ; { __mptr = (struct device const *)dev; shost = (struct Scsi_Host *)__mptr + 0xfffffffffffff6c0UL; tmp = ata_shost_to_port(shost); ap = tmp; tmp___0 = snprintf(buf, 23UL, "%d\n", ap->em_message_type); return ((ssize_t )tmp___0); } } struct device_attribute dev_attr_em_message_type = {{"em_message_type", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & ata_scsi_em_message_type_show, (ssize_t (*)(struct device * , struct device_attribute * , char const * , size_t ))0}; static char const __kstrtab_dev_attr_em_message_type[25U] = { 'd', 'e', 'v', '_', 'a', 't', 't', 'r', '_', 'e', 'm', '_', 'm', 'e', 's', 's', 'a', 'g', 'e', '_', 't', 'y', 'p', 'e', '\000'}; struct kernel_symbol const __ksymtab_dev_attr_em_message_type ; struct kernel_symbol const __ksymtab_dev_attr_em_message_type = {(unsigned long )(& dev_attr_em_message_type), (char const *)(& __kstrtab_dev_attr_em_message_type)}; static ssize_t ata_scsi_activity_show(struct device *dev , struct device_attribute *attr , char *buf ) { struct scsi_device *sdev ; struct device const *__mptr ; struct ata_port *ap ; struct ata_port *tmp ; struct ata_device *atadev ; struct ata_device *tmp___0 ; ssize_t tmp___1 ; { __mptr = (struct device const *)dev; sdev = (struct scsi_device *)__mptr + 0xfffffffffffffe28UL; tmp = ata_shost_to_port(sdev->host); ap = tmp; tmp___0 = ata_scsi_find_dev(ap, (struct scsi_device const *)sdev); atadev = tmp___0; if (((unsigned long )atadev != (unsigned long )((struct ata_device *)0) && (unsigned long )(ap->ops)->sw_activity_show != (unsigned long )((ssize_t (*)(struct ata_device * , char * ))0)) && (ap->flags & 4194304UL) != 0UL) { tmp___1 = (*((ap->ops)->sw_activity_show))(atadev, buf); return (tmp___1); } else { } return (-22L); } } static ssize_t ata_scsi_activity_store(struct device *dev , struct device_attribute *attr , char const *buf , size_t count ) { struct scsi_device *sdev ; struct device const *__mptr ; struct ata_port *ap ; struct ata_port *tmp ; struct ata_device *atadev ; struct ata_device *tmp___0 ; enum sw_activity val ; int rc ; unsigned long tmp___1 ; ssize_t tmp___2 ; { __mptr = (struct device const *)dev; sdev = (struct scsi_device *)__mptr + 0xfffffffffffffe28UL; tmp = ata_shost_to_port(sdev->host); ap = tmp; tmp___0 = ata_scsi_find_dev(ap, (struct scsi_device const *)sdev); atadev = tmp___0; if (((unsigned long )atadev != (unsigned long )((struct ata_device *)0) && (unsigned long )(ap->ops)->sw_activity_store != (unsigned long )((ssize_t (*)(struct ata_device * , enum sw_activity ))0)) && (ap->flags & 4194304UL) != 0UL) { tmp___1 = simple_strtoul(buf, (char **)0, 0U); val = (enum sw_activity )tmp___1; switch ((unsigned int )val) { case 0U: ; case 1U: ; case 2U: tmp___2 = (*((ap->ops)->sw_activity_store))(atadev, val); rc = (int )tmp___2; if (rc == 0) { return ((ssize_t )count); } else { return ((ssize_t )rc); } } } else { } return (-22L); } } struct device_attribute dev_attr_sw_activity = {{"sw_activity", 420U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & ata_scsi_activity_show, & ata_scsi_activity_store}; static char const __kstrtab_dev_attr_sw_activity[21U] = { 'd', 'e', 'v', '_', 'a', 't', 't', 'r', '_', 's', 'w', '_', 'a', 'c', 't', 'i', 'v', 'i', 't', 'y', '\000'}; struct kernel_symbol const __ksymtab_dev_attr_sw_activity ; struct kernel_symbol const __ksymtab_dev_attr_sw_activity = {(unsigned long )(& dev_attr_sw_activity), (char const *)(& __kstrtab_dev_attr_sw_activity)}; struct device_attribute *ata_common_sdev_attrs[2U] = { & dev_attr_unload_heads, (struct device_attribute *)0}; static char const __kstrtab_ata_common_sdev_attrs[22U] = { 'a', 't', 'a', '_', 'c', 'o', 'm', 'm', 'o', 'n', '_', 's', 'd', 'e', 'v', '_', 'a', 't', 't', 'r', 's', '\000'}; struct kernel_symbol const __ksymtab_ata_common_sdev_attrs ; struct kernel_symbol const __ksymtab_ata_common_sdev_attrs = {(unsigned long )(& ata_common_sdev_attrs), (char const *)(& __kstrtab_ata_common_sdev_attrs)}; static void ata_scsi_invalid_field(struct scsi_cmnd *cmd ) { { ata_scsi_set_sense(cmd, 5, 36, 0); (*(cmd->scsi_done))(cmd); return; } } int ata_std_bios_param(struct scsi_device *sdev , struct block_device *bdev , sector_t capacity , int *geom ) { int _res ; { *geom = 255; *(geom + 1UL) = 63; _res = (int )(capacity % 16065UL); capacity = capacity / 16065UL; *(geom + 2UL) = (int )capacity; return (0); } } void ata_scsi_unlock_native_capacity(struct scsi_device *sdev ) { struct ata_port *ap ; struct ata_port *tmp ; struct ata_device *dev ; unsigned long flags ; raw_spinlock_t *tmp___0 ; { tmp = ata_shost_to_port(sdev->host); ap = tmp; tmp___0 = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp___0); dev = ata_scsi_find_dev(ap, (struct scsi_device const *)sdev); if ((unsigned long )dev != (unsigned long )((struct ata_device *)0) && dev->n_sectors < dev->n_native_sectors) { dev->flags = dev->flags | 262144UL; (dev->link)->eh_info.action = (dev->link)->eh_info.action | 6U; ata_port_schedule_eh(ap); } else { } spin_unlock_irqrestore(ap->lock, flags); ata_port_wait_eh(ap); return; } } static int ata_get_identity(struct ata_port *ap , struct scsi_device *sdev , void *arg ) { struct ata_device *dev ; struct ata_device *tmp ; u16 *dst ; char buf[40U] ; unsigned long tmp___0 ; unsigned long tmp___1 ; unsigned long tmp___2 ; unsigned long tmp___3 ; { tmp = ata_scsi_find_dev(ap, (struct scsi_device const *)sdev); dev = tmp; dst = (u16 *)arg; if ((unsigned long )dev == (unsigned long )((struct ata_device *)0)) { return (-42); } else { } tmp___0 = copy_to_user((void *)dst, (void const *)(& dev->__annonCompField86.id), 512UL); if (tmp___0 != 0UL) { return (-14); } else { } ata_id_string((u16 const *)(& dev->__annonCompField86.id), (unsigned char *)(& buf), 27U, 40U); tmp___1 = copy_to_user((void *)dst + 27U, (void const *)(& buf), 40UL); if (tmp___1 != 0UL) { return (-14); } else { } ata_id_string((u16 const *)(& dev->__annonCompField86.id), (unsigned char *)(& buf), 23U, 8U); tmp___2 = copy_to_user((void *)dst + 23U, (void const *)(& buf), 8UL); if (tmp___2 != 0UL) { return (-14); } else { } ata_id_string((u16 const *)(& dev->__annonCompField86.id), (unsigned char *)(& buf), 10U, 20U); tmp___3 = copy_to_user((void *)dst + 10U, (void const *)(& buf), 20UL); if (tmp___3 != 0UL) { return (-14); } else { } return (0); } } int ata_cmd_ioctl(struct scsi_device *scsidev , void *arg ) { int rc ; u8 scsi_cmd[16U] ; u8 args[4U] ; u8 *argbuf ; u8 *sensebuf ; int argsize ; enum dma_data_direction data_dir ; int cmd_result ; unsigned long tmp ; void *tmp___0 ; void *tmp___1 ; u8 *desc ; struct scsi_sense_hdr sshdr ; unsigned long tmp___2 ; unsigned long tmp___3 ; { rc = 0; argbuf = (u8 *)0U; sensebuf = (u8 *)0U; argsize = 0; if ((unsigned long )arg == (unsigned long )((void *)0)) { return (-22); } else { } tmp = copy_from_user((void *)(& args), (void const *)arg, 4UL); if (tmp != 0UL) { return (-14); } else { } tmp___0 = kzalloc(96UL, 16U); sensebuf = (u8 *)tmp___0; if ((unsigned long )sensebuf == (unsigned long )((u8 *)0U)) { return (-12); } else { } memset((void *)(& scsi_cmd), 0, 16UL); if ((unsigned int )args[3] != 0U) { argsize = (int )args[3] * 512; tmp___1 = kmalloc((size_t )argsize, 208U); argbuf = (u8 *)tmp___1; if ((unsigned long )argbuf == (unsigned long )((u8 *)0U)) { rc = -12; goto error; } else { } scsi_cmd[1] = 8U; scsi_cmd[2] = 14U; data_dir = 2; } else { scsi_cmd[1] = 6U; scsi_cmd[2] = 32U; data_dir = 3; } scsi_cmd[0] = 133U; scsi_cmd[4] = args[2]; if ((unsigned int )args[0] == 176U) { scsi_cmd[6] = args[3]; scsi_cmd[8] = args[1]; scsi_cmd[10] = 79U; scsi_cmd[12] = 194U; } else { scsi_cmd[6] = args[1]; } scsi_cmd[14] = args[0]; cmd_result = scsi_execute(scsidev, (unsigned char const *)(& scsi_cmd), (int )data_dir, (void *)argbuf, (unsigned int )argsize, sensebuf, 2500, 5, 0ULL, (int *)0); if ((unsigned int )cmd_result >> 24 == 8U) { desc = sensebuf + 8UL; cmd_result = cmd_result & 16777215; if ((cmd_result & 2) != 0) { scsi_normalize_sense((u8 const *)sensebuf, 96, & sshdr); if (((unsigned int )sshdr.sense_key == 1U && (unsigned int )sshdr.asc == 0U) && (unsigned int )sshdr.ascq == 29U) { cmd_result = cmd_result & -3; } else { } } else { } if ((unsigned int )*sensebuf == 114U && (unsigned int )*desc == 9U) { args[0] = *(desc + 13UL); args[1] = *(desc + 3UL); args[2] = *(desc + 5UL); tmp___2 = copy_to_user(arg, (void const *)(& args), 4UL); if (tmp___2 != 0UL) { rc = -14; } else { } } else { } } else { } if (cmd_result != 0) { rc = -5; goto error; } else { } if ((unsigned long )argbuf != (unsigned long )((u8 *)0U)) { tmp___3 = copy_to_user(arg + 4UL, (void const *)argbuf, (unsigned long )argsize); if (tmp___3 != 0UL) { rc = -14; } else { } } else { } error: kfree((void const *)sensebuf); kfree((void const *)argbuf); return (rc); } } int ata_task_ioctl(struct scsi_device *scsidev , void *arg ) { int rc ; u8 scsi_cmd[16U] ; u8 args[7U] ; u8 *sensebuf ; int cmd_result ; unsigned long tmp ; void *tmp___0 ; u8 *desc ; struct scsi_sense_hdr sshdr ; unsigned long tmp___1 ; { rc = 0; sensebuf = (u8 *)0U; if ((unsigned long )arg == (unsigned long )((void *)0)) { return (-22); } else { } tmp = copy_from_user((void *)(& args), (void const *)arg, 7UL); if (tmp != 0UL) { return (-14); } else { } tmp___0 = kzalloc(96UL, 16U); sensebuf = (u8 *)tmp___0; if ((unsigned long )sensebuf == (unsigned long )((u8 *)0U)) { return (-12); } else { } memset((void *)(& scsi_cmd), 0, 16UL); scsi_cmd[0] = 133U; scsi_cmd[1] = 6U; scsi_cmd[2] = 32U; scsi_cmd[4] = args[1]; scsi_cmd[6] = args[2]; scsi_cmd[8] = args[3]; scsi_cmd[10] = args[4]; scsi_cmd[12] = args[5]; scsi_cmd[13] = (unsigned int )args[6] & 79U; scsi_cmd[14] = args[0]; cmd_result = scsi_execute(scsidev, (unsigned char const *)(& scsi_cmd), 3, (void *)0, 0U, sensebuf, 2500, 5, 0ULL, (int *)0); if ((unsigned int )cmd_result >> 24 == 8U) { desc = sensebuf + 8UL; cmd_result = cmd_result & 16777215; if ((cmd_result & 2) != 0) { scsi_normalize_sense((u8 const *)sensebuf, 96, & sshdr); if (((unsigned int )sshdr.sense_key == 1U && (unsigned int )sshdr.asc == 0U) && (unsigned int )sshdr.ascq == 29U) { cmd_result = cmd_result & -3; } else { } } else { } if ((unsigned int )*sensebuf == 114U && (unsigned int )*desc == 9U) { args[0] = *(desc + 13UL); args[1] = *(desc + 3UL); args[2] = *(desc + 5UL); args[3] = *(desc + 7UL); args[4] = *(desc + 9UL); args[5] = *(desc + 11UL); args[6] = *(desc + 12UL); tmp___1 = copy_to_user(arg, (void const *)(& args), 7UL); if (tmp___1 != 0UL) { rc = -14; } else { } } else { } } else { } if (cmd_result != 0) { rc = -5; goto error; } else { } error: kfree((void const *)sensebuf); return (rc); } } static int ata_ioc32(struct ata_port *ap ) { { if ((ap->flags & 128UL) != 0UL) { return (1); } else { } if ((ap->pflags & 1048576U) != 0U) { return (1); } else { } return (0); } } int ata_sas_scsi_ioctl(struct ata_port *ap , struct scsi_device *scsidev , int cmd , void *arg ) { int val ; int rc ; unsigned long flags ; raw_spinlock_t *tmp ; unsigned long tmp___0 ; raw_spinlock_t *tmp___1 ; int tmp___2 ; int tmp___3 ; bool tmp___4 ; int tmp___5 ; bool tmp___6 ; int tmp___7 ; int tmp___8 ; bool tmp___9 ; int tmp___10 ; bool tmp___11 ; int tmp___12 ; int tmp___13 ; { val = -22; rc = -22; switch (cmd) { case 777: tmp = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp); val = ata_ioc32(ap); spin_unlock_irqrestore(ap->lock, flags); tmp___0 = copy_to_user(arg, (void const *)(& val), 1UL); if (tmp___0 != 0UL) { return (-14); } else { } return (0); case 804: val = (int )((long )arg); rc = 0; tmp___1 = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp___1); if ((ap->pflags & 2097152U) != 0U) { if (val != 0) { ap->pflags = ap->pflags | 1048576U; } else { ap->pflags = ap->pflags & 4293918719U; } } else { tmp___2 = ata_ioc32(ap); if (tmp___2 != val) { rc = -22; } else { } } spin_unlock_irqrestore(ap->lock, flags); return (rc); case 781: tmp___3 = ata_get_identity(ap, scsidev, arg); return (tmp___3); case 799: tmp___4 = capable(21); if (tmp___4) { tmp___5 = 0; } else { tmp___5 = 1; } if (tmp___5) { return (-13); } else { tmp___6 = capable(17); if (tmp___6) { tmp___7 = 0; } else { tmp___7 = 1; } if (tmp___7) { return (-13); } else { } } tmp___8 = ata_cmd_ioctl(scsidev, arg); return (tmp___8); case 798: tmp___9 = capable(21); if (tmp___9) { tmp___10 = 0; } else { tmp___10 = 1; } if (tmp___10) { return (-13); } else { tmp___11 = capable(17); if (tmp___11) { tmp___12 = 0; } else { tmp___12 = 1; } if (tmp___12) { return (-13); } else { } } tmp___13 = ata_task_ioctl(scsidev, arg); return (tmp___13); default: rc = -25; goto ldv_43728; } ldv_43728: ; return (rc); } } static char const __kstrtab_ata_sas_scsi_ioctl[19U] = { 'a', 't', 'a', '_', 's', 'a', 's', '_', 's', 'c', 's', 'i', '_', 'i', 'o', 'c', 't', 'l', '\000'}; struct kernel_symbol const __ksymtab_ata_sas_scsi_ioctl ; struct kernel_symbol const __ksymtab_ata_sas_scsi_ioctl = {(unsigned long )(& ata_sas_scsi_ioctl), (char const *)(& __kstrtab_ata_sas_scsi_ioctl)}; int ata_scsi_ioctl(struct scsi_device *scsidev , int cmd , void *arg ) { struct ata_port *tmp ; int tmp___0 ; { tmp = ata_shost_to_port(scsidev->host); tmp___0 = ata_sas_scsi_ioctl(tmp, scsidev, cmd, arg); return (tmp___0); } } static char const __kstrtab_ata_scsi_ioctl[15U] = { 'a', 't', 'a', '_', 's', 'c', 's', 'i', '_', 'i', 'o', 'c', 't', 'l', '\000'}; struct kernel_symbol const __ksymtab_ata_scsi_ioctl ; struct kernel_symbol const __ksymtab_ata_scsi_ioctl = {(unsigned long )(& ata_scsi_ioctl), (char const *)(& __kstrtab_ata_scsi_ioctl)}; static struct ata_queued_cmd *ata_scsi_qc_new(struct ata_device *dev , struct scsi_cmnd *cmd ) { struct ata_queued_cmd *qc ; { qc = ata_qc_new_init(dev, (cmd->request)->tag); if ((unsigned long )qc != (unsigned long )((struct ata_queued_cmd *)0)) { qc->scsicmd = cmd; qc->scsidone = cmd->scsi_done; qc->sg = scsi_sglist(cmd); qc->n_elem = scsi_sg_count(cmd); } else { cmd->result = 40; (*(cmd->scsi_done))(cmd); } return (qc); } } static void ata_qc_set_pc_nbytes(struct ata_queued_cmd *qc ) { struct scsi_cmnd *scmd ; unsigned int tmp ; { scmd = qc->scsicmd; qc->extrabytes = (scmd->request)->extra_len; tmp = scsi_bufflen(scmd); qc->nbytes = tmp + qc->extrabytes; return; } } static void ata_dump_status(unsigned int id , struct ata_taskfile *tf ) { u8 stat ; u8 err ; { stat = tf->command; err = tf->feature; printk("\fata%u: status=0x%02x { ", id, (int )stat); if ((int )((signed char )stat) < 0) { printk("Busy }\n"); } else { if (((int )stat & 64) != 0) { printk("DriveReady "); } else { } if (((int )stat & 32) != 0) { printk("DeviceFault "); } else { } if (((int )stat & 16) != 0) { printk("SeekComplete "); } else { } if (((int )stat & 8) != 0) { printk("DataRequest "); } else { } if (((int )stat & 4) != 0) { printk("CorrectedError "); } else { } if (((int )stat & 2) != 0) { printk("Sense "); } else { } if ((int )stat & 1) { printk("Error "); } else { } printk("}\n"); if ((unsigned int )err != 0U) { printk("\fata%u: error=0x%02x { ", id, (int )err); if (((int )err & 4) != 0) { printk("DriveStatusError "); } else { } if ((int )((signed char )err) < 0) { if (((int )err & 4) != 0) { printk("BadCRC "); } else { printk("Sector "); } } else { } if (((int )err & 64) != 0) { printk("UncorrectableError "); } else { } if (((int )err & 16) != 0) { printk("SectorIdNotFound "); } else { } if (((int )err & 2) != 0) { printk("TrackZeroNotFound "); } else { } if ((int )err & 1) { printk("AddrMarkNotFound "); } else { } printk("}\n"); } else { } } return; } } static void ata_to_sense_error(unsigned int id , u8 drv_stat , u8 drv_err , u8 *sk , u8 *asc , u8 *ascq , int verbose ) { int i ; unsigned char sense_table[14U][4U] ; unsigned char stat_table[6U][4U] ; { sense_table[0][0] = 209U; sense_table[0][1] = 11U; sense_table[0][2] = 0U; sense_table[0][3] = 0U; sense_table[1][0] = 208U; sense_table[1][1] = 11U; sense_table[1][2] = 0U; sense_table[1][3] = 0U; sense_table[2][0] = 97U; sense_table[2][1] = 4U; sense_table[2][2] = 0U; sense_table[2][3] = 0U; sense_table[3][0] = 132U; sense_table[3][1] = 11U; sense_table[3][2] = 71U; sense_table[3][3] = 0U; sense_table[4][0] = 55U; sense_table[4][1] = 2U; sense_table[4][2] = 4U; sense_table[4][3] = 0U; sense_table[5][0] = 9U; sense_table[5][1] = 2U; sense_table[5][2] = 4U; sense_table[5][3] = 0U; sense_table[6][0] = 1U; sense_table[6][1] = 3U; sense_table[6][2] = 19U; sense_table[6][3] = 0U; sense_table[7][0] = 2U; sense_table[7][1] = 4U; sense_table[7][2] = 0U; sense_table[7][3] = 0U; sense_table[8][0] = 8U; sense_table[8][1] = 2U; sense_table[8][2] = 4U; sense_table[8][3] = 0U; sense_table[9][0] = 16U; sense_table[9][1] = 5U; sense_table[9][2] = 33U; sense_table[9][3] = 0U; sense_table[10][0] = 32U; sense_table[10][1] = 6U; sense_table[10][2] = 40U; sense_table[10][3] = 0U; sense_table[11][0] = 64U; sense_table[11][1] = 3U; sense_table[11][2] = 17U; sense_table[11][3] = 4U; sense_table[12][0] = 128U; sense_table[12][1] = 3U; sense_table[12][2] = 17U; sense_table[12][3] = 4U; sense_table[13][0] = 255U; sense_table[13][1] = 255U; sense_table[13][2] = 255U; sense_table[13][3] = 255U; stat_table[0][0] = 128U; stat_table[0][1] = 11U; stat_table[0][2] = 71U; stat_table[0][3] = 0U; stat_table[1][0] = 64U; stat_table[1][1] = 5U; stat_table[1][2] = 33U; stat_table[1][3] = 4U; stat_table[2][0] = 32U; stat_table[2][1] = 4U; stat_table[2][2] = 68U; stat_table[2][3] = 0U; stat_table[3][0] = 8U; stat_table[3][1] = 11U; stat_table[3][2] = 71U; stat_table[3][3] = 0U; stat_table[4][0] = 4U; stat_table[4][1] = 1U; stat_table[4][2] = 17U; stat_table[4][3] = 0U; stat_table[5][0] = 255U; stat_table[5][1] = 255U; stat_table[5][2] = 255U; stat_table[5][3] = 255U; if ((int )((signed char )drv_stat) < 0) { drv_err = 0U; } else { } if ((unsigned int )drv_err != 0U) { i = 0; goto ldv_43782; ldv_43781: ; if (((int )sense_table[i][0] & (int )drv_err) == (int )sense_table[i][0]) { *sk = sense_table[i][1]; *asc = sense_table[i][2]; *ascq = sense_table[i][3]; goto translate_done; } else { } i = i + 1; ldv_43782: ; if ((unsigned int )sense_table[i][0] != 255U) { goto ldv_43781; } else { } } else { } i = 0; goto ldv_43785; ldv_43784: ; if ((unsigned int )((int )stat_table[i][0] & (int )drv_stat) != 0U) { *sk = stat_table[i][1]; *asc = stat_table[i][2]; *ascq = stat_table[i][3]; goto translate_done; } else { } i = i + 1; ldv_43785: ; if ((unsigned int )stat_table[i][0] != 255U) { goto ldv_43784; } else { } *sk = 11U; *asc = 0U; *ascq = 0U; translate_done: ; if (verbose != 0) { printk("\vata%u: translated ATA stat/err 0x%02x/%02x to SCSI SK/ASC/ASCQ 0x%x/%02x/%02x\n", id, (int )drv_stat, (int )drv_err, (int )*sk, (int )*asc, (int )*ascq); } else { } return; } } static void ata_gen_passthru_sense(struct ata_queued_cmd *qc ) { struct scsi_cmnd *cmd ; struct ata_taskfile *tf ; unsigned char *sb ; unsigned char *desc ; int verbose ; { cmd = qc->scsicmd; tf = & qc->result_tf; sb = cmd->sense_buffer; desc = sb + 8UL; verbose = (unsigned long )((qc->ap)->ops)->error_handler == (unsigned long )((void (*)(struct ata_port * ))0); memset((void *)sb, 0, 96UL); cmd->result = 134217730; if (qc->err_mask != 0U || ((int )tf->command & 169) != 0) { ata_to_sense_error((qc->ap)->print_id, (int )tf->command, (int )tf->feature, sb + 1U, sb + 2U, sb + 3U, verbose); *(sb + 1UL) = (unsigned int )*(sb + 1UL) & 15U; } else { *(sb + 1UL) = 1U; *(sb + 2UL) = 0U; *(sb + 3UL) = 29U; } *sb = 114U; *desc = 9U; *(sb + 7UL) = 14U; *(desc + 1UL) = 12U; *(desc + 2UL) = 0U; *(desc + 3UL) = tf->feature; *(desc + 5UL) = tf->nsect; *(desc + 7UL) = tf->lbal; *(desc + 9UL) = tf->lbam; *(desc + 11UL) = tf->lbah; *(desc + 12UL) = tf->device; *(desc + 13UL) = tf->command; if ((int )tf->flags & 1) { *(desc + 2UL) = (unsigned int )*(desc + 2UL) | 1U; *(desc + 4UL) = tf->hob_nsect; *(desc + 6UL) = tf->hob_lbal; *(desc + 8UL) = tf->hob_lbam; *(desc + 10UL) = tf->hob_lbah; } else { } return; } } static void ata_gen_ata_sense(struct ata_queued_cmd *qc ) { struct ata_device *dev ; struct scsi_cmnd *cmd ; struct ata_taskfile *tf ; unsigned char *sb ; unsigned char *desc ; int verbose ; u64 block ; { dev = qc->dev; cmd = qc->scsicmd; tf = & qc->result_tf; sb = cmd->sense_buffer; desc = sb + 8UL; verbose = (unsigned long )((qc->ap)->ops)->error_handler == (unsigned long )((void (*)(struct ata_port * ))0); memset((void *)sb, 0, 96UL); cmd->result = 134217730; *sb = 114U; if (qc->err_mask != 0U || ((int )tf->command & 169) != 0) { ata_to_sense_error((qc->ap)->print_id, (int )tf->command, (int )tf->feature, sb + 1U, sb + 2U, sb + 3U, verbose); *(sb + 1UL) = (unsigned int )*(sb + 1UL) & 15U; } else { } block = ata_tf_read_block((struct ata_taskfile const *)(& qc->result_tf), dev); *(sb + 7UL) = 12U; *desc = 0U; *(desc + 1UL) = 10U; *(desc + 2UL) = (unsigned int )*(desc + 2UL) | 128U; *(desc + 6UL) = (unsigned char )(block >> 40); *(desc + 7UL) = (unsigned char )(block >> 32); *(desc + 8UL) = (unsigned char )(block >> 24); *(desc + 9UL) = (unsigned char )(block >> 16); *(desc + 10UL) = (unsigned char )(block >> 8); *(desc + 11UL) = (unsigned char )block; return; } } static void ata_scsi_sdev_config(struct scsi_device *sdev ) { { sdev->use_10_for_rw = 1U; sdev->use_10_for_ms = 1U; sdev->no_report_opcodes = 1U; sdev->no_write_same = 1U; sdev->max_device_blocked = 1U; return; } } static int atapi_drain_needed(struct request *rq ) { long tmp ; unsigned int tmp___0 ; int tmp___1 ; { tmp = ldv__builtin_expect(rq->cmd_type != 2U, 1L); if (tmp != 0L) { return (0); } else { } tmp___0 = blk_rq_bytes((struct request const *)rq); if (tmp___0 == 0U || (int )rq->cmd_flags & 1) { return (0); } else { } tmp___1 = atapi_cmd_type((int )*(rq->cmd)); return (tmp___1 == 4); } } static int ata_scsi_dev_config(struct scsi_device *sdev , struct ata_device *dev ) { struct request_queue *q ; bool tmp ; int tmp___0 ; void *buf ; int depth ; int _min1 ; int _min2 ; int _min1___0 ; int _min2___0 ; { q = sdev->request_queue; tmp = ata_id_has_unload((u16 const *)(& dev->__annonCompField86.id)); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { dev->flags = dev->flags | 131072UL; } else { } blk_queue_max_hw_sectors(q, dev->max_sectors); if (dev->class == 3U) { sdev->sector_size = 512U; blk_queue_update_dma_pad(q, 3U); buf = kmalloc(16384UL, q->bounce_gfp | 208U); if ((unsigned long )buf == (unsigned long )((void *)0)) { ata_dev_printk((struct ata_device const *)dev, "\v", "drain buffer allocation failed\n"); return (-12); } else { } blk_queue_dma_drain(q, & atapi_drain_needed, buf, 16384U); } else { sdev->sector_size = ata_id_logical_sector_size((u16 const *)(& dev->__annonCompField86.id)); sdev->manage_start_stop = 1U; } if (sdev->sector_size > 4096U) { ata_dev_printk((struct ata_device const *)dev, "\f", "sector_size=%u > PAGE_SIZE, PIO may malfunction\n", sdev->sector_size); } else { } blk_queue_update_dma_alignment(q, (int )(sdev->sector_size - 1U)); if ((dev->flags & 128UL) != 0UL) { set_bit(1L, (unsigned long volatile *)(& sdev->supported_events)); } else { } if ((dev->flags & 8UL) != 0UL) { _min1 = (sdev->host)->can_queue; _min2 = ((int )dev->__annonCompField86.id[75] & 31) + 1; depth = _min1 < _min2 ? _min1 : _min2; _min1___0 = 31; _min2___0 = depth; depth = _min1___0 < _min2___0 ? _min1___0 : _min2___0; scsi_change_queue_depth(sdev, depth); } else { } blk_queue_flush_queueable(q, 0); dev->sdev = sdev; return (0); } } int ata_scsi_slave_config(struct scsi_device *sdev ) { struct ata_port *ap ; struct ata_port *tmp ; struct ata_device *dev ; struct ata_device *tmp___0 ; int rc ; { tmp = ata_shost_to_port(sdev->host); ap = tmp; tmp___0 = __ata_scsi_find_dev(ap, (struct scsi_device const *)sdev); dev = tmp___0; rc = 0; ata_scsi_sdev_config(sdev); if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { rc = ata_scsi_dev_config(sdev, dev); } else { } return (rc); } } void ata_scsi_slave_destroy(struct scsi_device *sdev ) { struct ata_port *ap ; struct ata_port *tmp ; struct request_queue *q ; unsigned long flags ; struct ata_device *dev ; raw_spinlock_t *tmp___0 ; { tmp = ata_shost_to_port(sdev->host); ap = tmp; q = sdev->request_queue; if ((unsigned long )(ap->ops)->error_handler == (unsigned long )((void (*)(struct ata_port * ))0)) { return; } else { } tmp___0 = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp___0); dev = __ata_scsi_find_dev(ap, (struct scsi_device const *)sdev); if ((unsigned long )dev != (unsigned long )((struct ata_device *)0) && (unsigned long )dev->sdev != (unsigned long )((struct scsi_device *)0)) { dev->sdev = (struct scsi_device *)0; dev->flags = dev->flags | 16777216UL; ata_port_schedule_eh(ap); } else { } spin_unlock_irqrestore(ap->lock, flags); kfree((void const *)q->dma_drain_buffer); q->dma_drain_buffer = (void *)0; q->dma_drain_size = 0U; return; } } int __ata_change_queue_depth(struct ata_port *ap , struct scsi_device *sdev , int queue_depth ) { struct ata_device *dev ; unsigned long flags ; unsigned int tmp ; raw_spinlock_t *tmp___0 ; int tmp___1 ; int _min1 ; int _min2 ; int _min1___0 ; int _min2___0 ; int _min1___1 ; int _min2___1 ; int tmp___2 ; { if (queue_depth <= 0 || (int )sdev->queue_depth == queue_depth) { return ((int )sdev->queue_depth); } else { } dev = ata_scsi_find_dev(ap, (struct scsi_device const *)sdev); if ((unsigned long )dev == (unsigned long )((struct ata_device *)0)) { return ((int )sdev->queue_depth); } else { tmp = ata_dev_enabled((struct ata_device const *)dev); if (tmp == 0U) { return ((int )sdev->queue_depth); } else { } } tmp___0 = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp___0); dev->flags = dev->flags & 0xffffffffffffdfffUL; if (queue_depth == 1) { dev->flags = dev->flags | 8192UL; queue_depth = 1; } else { tmp___1 = ata_ncq_enabled(dev); if (tmp___1 == 0) { dev->flags = dev->flags | 8192UL; queue_depth = 1; } else { } } spin_unlock_irqrestore(ap->lock, flags); _min1 = queue_depth; _min2 = (sdev->host)->can_queue; queue_depth = _min1 < _min2 ? _min1 : _min2; _min1___0 = queue_depth; _min2___0 = ((int )dev->__annonCompField86.id[75] & 31) + 1; queue_depth = _min1___0 < _min2___0 ? _min1___0 : _min2___0; _min1___1 = queue_depth; _min2___1 = 31; queue_depth = _min1___1 < _min2___1 ? _min1___1 : _min2___1; if ((int )sdev->queue_depth == queue_depth) { return (-22); } else { } tmp___2 = scsi_change_queue_depth(sdev, queue_depth); return (tmp___2); } } int ata_scsi_change_queue_depth(struct scsi_device *sdev , int queue_depth ) { struct ata_port *ap ; struct ata_port *tmp ; int tmp___0 ; { tmp = ata_shost_to_port(sdev->host); ap = tmp; tmp___0 = __ata_change_queue_depth(ap, sdev, queue_depth); return (tmp___0); } } static unsigned int ata_scsi_start_stop_xlat(struct ata_queued_cmd *qc ) { struct scsi_cmnd *scmd ; struct ata_taskfile *tf ; u8 const *cdb ; bool tmp ; { scmd = qc->scsicmd; tf = & qc->tf; cdb = (u8 const *)scmd->cmnd; if ((unsigned int )scmd->cmd_len <= 4U) { goto invalid_fld; } else { } tf->flags = tf->flags | 6UL; tf->protocol = 1U; if (((int )*(cdb + 4UL) & 2) != 0) { goto invalid_fld; } else { } if ((((int )((unsigned char )*(cdb + 4UL)) >> 4) & 15) != 0) { goto invalid_fld; } else { } if ((int )*(cdb + 4UL) & 1) { tf->nsect = 1U; if ((int )(qc->dev)->flags & 1) { tf->flags = tf->flags | 16UL; tf->lbah = 0U; tf->lbam = 0U; tf->lbal = 0U; tf->device = (u8 )((unsigned int )tf->device | 64U); } else { tf->lbal = 1U; tf->lbam = 0U; tf->lbah = 0U; } tf->command = 64U; } else { if (((qc->ap)->flags & 2048UL) != 0UL && (unsigned int )system_state == 3U) { goto skip; } else { } if (((qc->ap)->flags & 4096UL) != 0UL) { tmp = system_entering_hibernation(); if ((int )tmp) { goto skip; } else { } } else { } tf->command = 224U; } return (0U); invalid_fld: ata_scsi_set_sense(scmd, 5, 36, 0); return (1U); skip: scmd->result = 0; return (1U); } } static unsigned int ata_scsi_flush_xlat(struct ata_queued_cmd *qc ) { struct ata_taskfile *tf ; { tf = & qc->tf; tf->flags = tf->flags | 4UL; tf->protocol = 1U; if (((qc->dev)->flags & 16UL) != 0UL) { tf->command = 234U; } else { tf->command = 231U; } qc->flags = qc->flags | 8UL; return (0U); } } static void scsi_6_lba_len(u8 const *cdb , u64 *plba , u32 *plen ) { u64 lba ; u32 len ; { lba = 0ULL; lba = (((unsigned long long )*(cdb + 1UL) & 31ULL) << 16) | lba; lba = ((unsigned long long )*(cdb + 2UL) << 8) | lba; lba = (unsigned long long )*(cdb + 3UL) | lba; len = (u32 )*(cdb + 4UL); *plba = lba; *plen = len; return; } } static void scsi_10_lba_len(u8 const *cdb , u64 *plba , u32 *plen ) { u64 lba ; u32 len ; { lba = 0ULL; len = 0U; lba = ((unsigned long long )*(cdb + 2UL) << 24) | lba; lba = ((unsigned long long )*(cdb + 3UL) << 16) | lba; lba = ((unsigned long long )*(cdb + 4UL) << 8) | lba; lba = (unsigned long long )*(cdb + 5UL) | lba; len = ((unsigned int )*(cdb + 7UL) << 8) | len; len = (u32 )*(cdb + 8UL) | len; *plba = lba; *plen = len; return; } } static void scsi_16_lba_len(u8 const *cdb , u64 *plba , u32 *plen ) { u64 lba ; u32 len ; { lba = 0ULL; len = 0U; lba = ((unsigned long long )*(cdb + 2UL) << 56) | lba; lba = ((unsigned long long )*(cdb + 3UL) << 48) | lba; lba = ((unsigned long long )*(cdb + 4UL) << 40) | lba; lba = ((unsigned long long )*(cdb + 5UL) << 32) | lba; lba = ((unsigned long long )*(cdb + 6UL) << 24) | lba; lba = ((unsigned long long )*(cdb + 7UL) << 16) | lba; lba = ((unsigned long long )*(cdb + 8UL) << 8) | lba; lba = (unsigned long long )*(cdb + 9UL) | lba; len = ((unsigned int )*(cdb + 10UL) << 24) | len; len = ((unsigned int )*(cdb + 11UL) << 16) | len; len = ((unsigned int )*(cdb + 12UL) << 8) | len; len = (u32 )*(cdb + 13UL) | len; *plba = lba; *plen = len; return; } } static unsigned int ata_scsi_verify_xlat(struct ata_queued_cmd *qc ) { struct scsi_cmnd *scmd ; struct ata_taskfile *tf ; struct ata_device *dev ; u64 dev_sectors ; u8 const *cdb ; u64 block ; u32 n_block ; bool tmp ; bool tmp___0 ; u32 sect ; u32 head ; u32 cyl ; u32 track ; bool tmp___1 ; int tmp___2 ; { scmd = qc->scsicmd; tf = & qc->tf; dev = qc->dev; dev_sectors = (qc->dev)->n_sectors; cdb = (u8 const *)scmd->cmnd; tf->flags = tf->flags | 6UL; tf->protocol = 1U; if ((unsigned int )((unsigned char )*cdb) == 47U) { if ((unsigned int )scmd->cmd_len <= 9U) { goto invalid_fld; } else { } scsi_10_lba_len(cdb, & block, & n_block); } else if ((unsigned int )((unsigned char )*cdb) == 143U) { if ((unsigned int )scmd->cmd_len <= 15U) { goto invalid_fld; } else { } scsi_16_lba_len(cdb, & block, & n_block); } else { goto invalid_fld; } if (n_block == 0U) { goto nothing_to_do; } else { } if (block >= dev_sectors) { goto out_of_range; } else { } if ((u64 )n_block + block > dev_sectors) { goto out_of_range; } else { } if ((int )dev->flags & 1) { tf->flags = tf->flags | 16UL; tmp___0 = lba_28_ok(block, n_block); if ((int )tmp___0) { tf->command = 64U; tf->device = (unsigned int )tf->device | ((unsigned int )((u8 )(block >> 24)) & 15U); } else { tmp = lba_48_ok(block, n_block); if ((int )tmp) { if ((dev->flags & 2UL) == 0UL) { goto out_of_range; } else { } tf->flags = tf->flags | 1UL; tf->command = 66U; tf->hob_nsect = (u8 )(n_block >> 8); tf->hob_lbah = (u8 )(block >> 40); tf->hob_lbam = (u8 )(block >> 32); tf->hob_lbal = (u8 )(block >> 24); } else { goto out_of_range; } } tf->nsect = (u8 )n_block; tf->lbah = (u8 )(block >> 16); tf->lbam = (u8 )(block >> 8); tf->lbal = (u8 )block; tf->device = (u8 )((unsigned int )tf->device | 64U); } else { tmp___1 = lba_28_ok(block, n_block); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { goto out_of_range; } else { } track = (unsigned int )block / (unsigned int )dev->sectors; cyl = track / (u32 )dev->heads; head = track % (u32 )dev->heads; sect = (unsigned int )block % (unsigned int )dev->sectors + 1U; if (((cyl >> 16 != 0U || head >> 4 != 0U) || sect >> 8 != 0U) || sect == 0U) { goto out_of_range; } else { } tf->command = 64U; tf->nsect = (u8 )n_block; tf->lbal = (u8 )sect; tf->lbam = (u8 )cyl; tf->lbah = (u8 )(cyl >> 8); tf->device = (int )tf->device | (int )((u8 )head); } return (0U); invalid_fld: ata_scsi_set_sense(scmd, 5, 36, 0); return (1U); out_of_range: ata_scsi_set_sense(scmd, 5, 33, 0); return (1U); nothing_to_do: scmd->result = 0; return (1U); } } static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc ) { struct scsi_cmnd *scmd ; u8 const *cdb ; unsigned int tf_flags ; u64 block ; u32 n_block ; int rc ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; { scmd = qc->scsicmd; cdb = (u8 const *)scmd->cmnd; tf_flags = 0U; if (((unsigned int )((unsigned char )*cdb) == 42U || (unsigned int )((unsigned char )*cdb) == 10U) || (unsigned int )((unsigned char )*cdb) == 138U) { tf_flags = tf_flags | 8U; } else { } switch ((int )*cdb) { case 40: ; case 42: tmp = ldv__builtin_expect((unsigned int )scmd->cmd_len <= 9U, 0L); if (tmp != 0L) { goto invalid_fld; } else { } scsi_10_lba_len(cdb, & block, & n_block); if (((int )*(cdb + 1UL) & 8) != 0) { tf_flags = tf_flags | 32U; } else { } goto ldv_43926; case 8: ; case 10: tmp___0 = ldv__builtin_expect((unsigned int )scmd->cmd_len <= 5U, 0L); if (tmp___0 != 0L) { goto invalid_fld; } else { } scsi_6_lba_len(cdb, & block, & n_block); if (n_block == 0U) { n_block = 256U; } else { } goto ldv_43926; case 136: ; case 138: tmp___1 = ldv__builtin_expect((unsigned int )scmd->cmd_len <= 15U, 0L); if (tmp___1 != 0L) { goto invalid_fld; } else { } scsi_16_lba_len(cdb, & block, & n_block); if (((int )*(cdb + 1UL) & 8) != 0) { tf_flags = tf_flags | 32U; } else { } goto ldv_43926; default: ; goto invalid_fld; } ldv_43926: ; if (n_block == 0U) { goto nothing_to_do; } else { } qc->flags = qc->flags | 8UL; qc->nbytes = (scmd->device)->sector_size * n_block; rc = ata_build_rw_tf(& qc->tf, qc->dev, block, n_block, tf_flags, qc->tag); tmp___2 = ldv__builtin_expect(rc == 0, 1L); if (tmp___2 != 0L) { return (0U); } else { } if (rc == -34) { goto out_of_range; } else { } invalid_fld: ata_scsi_set_sense(scmd, 5, 36, 0); return (1U); out_of_range: ata_scsi_set_sense(scmd, 5, 33, 0); return (1U); nothing_to_do: scmd->result = 0; return (1U); } } static void ata_scsi_qc_complete(struct ata_queued_cmd *qc ) { struct ata_port *ap ; struct scsi_cmnd *cmd ; u8 *cdb ; int need_sense ; { ap = qc->ap; cmd = qc->scsicmd; cdb = cmd->cmnd; need_sense = qc->err_mask != 0U; if (((unsigned int )*cdb == 133U || (unsigned int )*cdb == 161U) && (((int )*(cdb + 2UL) & 32) != 0 || need_sense != 0)) { ata_gen_passthru_sense(qc); } else if ((qc->flags & 131072UL) != 0UL) { cmd->result = 2; } else if (need_sense == 0) { cmd->result = 0; } else { ata_gen_ata_sense(qc); } if (need_sense != 0 && (unsigned long )(ap->ops)->error_handler == (unsigned long )((void (*)(struct ata_port * ))0)) { ata_dump_status(ap->print_id, & qc->result_tf); } else { } (*(qc->scsidone))(cmd); ata_qc_free(qc); return; } } static int ata_scsi_translate(struct ata_device *dev , struct scsi_cmnd *cmd , unsigned int (*xlat_func)(struct ata_queued_cmd * ) ) { struct ata_port *ap ; struct ata_queued_cmd *qc ; int rc ; unsigned int tmp ; long tmp___0 ; unsigned int tmp___1 ; struct scatterlist *tmp___2 ; unsigned int tmp___3 ; { ap = (dev->link)->ap; qc = ata_scsi_qc_new(dev, cmd); if ((unsigned long )qc == (unsigned long )((struct ata_queued_cmd *)0)) { goto err_mem; } else { } if ((unsigned int )cmd->sc_data_direction == 2U || (unsigned int )cmd->sc_data_direction == 1U) { tmp = scsi_bufflen(cmd); tmp___0 = ldv__builtin_expect(tmp == 0U, 0L); if (tmp___0 != 0L) { ata_dev_printk((struct ata_device const *)dev, "\f", "WARNING: zero len r/w req\n"); goto err_did; } else { } tmp___1 = scsi_sg_count(cmd); tmp___2 = scsi_sglist(cmd); ata_sg_init(qc, tmp___2, tmp___1); qc->dma_dir = (int )cmd->sc_data_direction; } else { } qc->complete_fn = & ata_scsi_qc_complete; tmp___3 = (*xlat_func)(qc); if (tmp___3 != 0U) { goto early_finish; } else { } if ((unsigned long )(ap->ops)->qc_defer != (unsigned long )((int (*)(struct ata_queued_cmd * ))0)) { rc = (*((ap->ops)->qc_defer))(qc); if (rc != 0) { goto defer; } else { } } else { } ata_qc_issue(qc); return (0); early_finish: ata_qc_free(qc); (*(cmd->scsi_done))(cmd); return (0); err_did: ata_qc_free(qc); cmd->result = 458752; (*(cmd->scsi_done))(cmd); err_mem: ; return (0); defer: ata_qc_free(qc); if (rc == 1) { return (4182); } else { return (4181); } } } static void *ata_scsi_rbuf_get(struct scsi_cmnd *cmd , bool copy_in , unsigned long *flags ) { raw_spinlock_t *tmp ; unsigned int tmp___0 ; struct scatterlist *tmp___1 ; { tmp = spinlock_check(& ata_scsi_rbuf_lock); *flags = _raw_spin_lock_irqsave(tmp); memset((void *)(& ata_scsi_rbuf), 0, 4096UL); if ((int )copy_in) { tmp___0 = scsi_sg_count(cmd); tmp___1 = scsi_sglist(cmd); sg_copy_to_buffer(tmp___1, tmp___0, (void *)(& ata_scsi_rbuf), 4096UL); } else { } return ((void *)(& ata_scsi_rbuf)); } } __inline static void ata_scsi_rbuf_put(struct scsi_cmnd *cmd , bool copy_out , unsigned long *flags ) { unsigned int tmp ; struct scatterlist *tmp___0 ; { if ((int )copy_out) { tmp = scsi_sg_count(cmd); tmp___0 = scsi_sglist(cmd); sg_copy_from_buffer(tmp___0, tmp, (void const *)(& ata_scsi_rbuf), 4096UL); } else { } spin_unlock_irqrestore(& ata_scsi_rbuf_lock, *flags); return; } } static void ata_scsi_rbuf_fill(struct ata_scsi_args *args , unsigned int (*actor)(struct ata_scsi_args * , u8 * ) ) { u8 *rbuf ; unsigned int rc ; struct scsi_cmnd *cmd ; unsigned long flags ; void *tmp ; { cmd = args->cmd; tmp = ata_scsi_rbuf_get(cmd, 0, & flags); rbuf = (u8 *)tmp; rc = (*actor)(args, rbuf); ata_scsi_rbuf_put(cmd, rc == 0U, & flags); if (rc == 0U) { cmd->result = 0; } else { } (*(args->done))(cmd); return; } } static unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args , u8 *rbuf ) { u8 versions[6U] ; u8 versions_zbc[8U] ; u8 hdr[5U] ; int tmp ; { versions[0] = 0U; versions[1] = 96U; versions[2] = 3U; versions[3] = 32U; versions[4] = 2U; versions[5] = 96U; versions_zbc[0] = 0U; versions_zbc[1] = 160U; versions_zbc[2] = 4U; versions_zbc[3] = 192U; versions_zbc[4] = 4U; versions_zbc[5] = 96U; versions_zbc[6] = 96U; versions_zbc[7] = 32U; hdr[0] = 0U; hdr[1] = 0U; hdr[2] = 5U; hdr[3] = 2U; hdr[4] = 91U; if (((int )*(args->id) & 128) != 0) { hdr[1] = (u8 )((unsigned int )hdr[1] | 128U); } else { } if ((args->dev)->class == 9U) { hdr[0] = 20U; hdr[2] = 6U; } else { } memcpy((void *)rbuf, (void const *)(& hdr), 5UL); memcpy((void *)rbuf + 8U, (void const *)"ATA ", 8UL); ata_id_string((u16 const *)args->id, rbuf + 16U, 27U, 16U); ata_id_string((u16 const *)args->id, rbuf + 32U, 25U, 4U); tmp = strncmp((char const *)rbuf + 32U, " ", 4UL); if (tmp == 0) { ata_id_string((u16 const *)args->id, rbuf + 32U, 23U, 4U); } else { } if ((unsigned int )*(rbuf + 32UL) == 0U || (unsigned int )*(rbuf + 32UL) == 32U) { memcpy((void *)rbuf + 32U, (void const *)"n/a ", 4UL); } else { } if ((args->dev)->class == 9U) { memcpy((void *)rbuf + 58U, (void const *)(& versions_zbc), 8UL); } else { memcpy((void *)rbuf + 58U, (void const *)(& versions), 6UL); } return (0U); } } static unsigned int ata_scsiop_inq_00(struct ata_scsi_args *args , u8 *rbuf ) { u8 pages[7U] ; { pages[0] = 0U; pages[1] = 128U; pages[2] = 131U; pages[3] = 137U; pages[4] = 176U; pages[5] = 177U; pages[6] = 178U; *(rbuf + 3UL) = 7U; memcpy((void *)rbuf + 4U, (void const *)(& pages), 7UL); return (0U); } } static unsigned int ata_scsiop_inq_80(struct ata_scsi_args *args , u8 *rbuf ) { u8 hdr[4U] ; { hdr[0] = 0U; hdr[1] = 128U; hdr[2] = 0U; hdr[3] = 20U; memcpy((void *)rbuf, (void const *)(& hdr), 4UL); ata_id_string((u16 const *)args->id, rbuf + 4U, 10U, 20U); return (0U); } } static unsigned int ata_scsiop_inq_83(struct ata_scsi_args *args , u8 *rbuf ) { int sat_model_serial_desc_len ; int num ; bool tmp ; { sat_model_serial_desc_len = 68; *(rbuf + 1UL) = 131U; num = 4; *(rbuf + (unsigned long )num) = 2U; *(rbuf + ((unsigned long )num + 3UL)) = 20U; num = num + 4; ata_id_string((u16 const *)args->id, rbuf + (unsigned long )num, 10U, 20U); num = num + 20; *(rbuf + (unsigned long )num) = 2U; *(rbuf + ((unsigned long )num + 1UL)) = 1U; *(rbuf + ((unsigned long )num + 3UL)) = (u8 )sat_model_serial_desc_len; num = num + 4; memcpy((void *)rbuf + (unsigned long )num, (void const *)"ATA ", 8UL); num = num + 8; ata_id_string((u16 const *)args->id, rbuf + (unsigned long )num, 27U, 40U); num = num + 40; ata_id_string((u16 const *)args->id, rbuf + (unsigned long )num, 10U, 20U); num = num + 20; tmp = ata_id_has_wwn((u16 const *)args->id); if ((int )tmp) { *(rbuf + (unsigned long )num) = 1U; *(rbuf + ((unsigned long )num + 1UL)) = 3U; *(rbuf + ((unsigned long )num + 3UL)) = 8U; num = num + 4; ata_id_string((u16 const *)args->id, rbuf + (unsigned long )num, 108U, 8U); num = num + 8; } else { } *(rbuf + 3UL) = (unsigned int )((u8 )num) + 252U; return (0U); } } static unsigned int ata_scsiop_inq_89(struct ata_scsi_args *args , u8 *rbuf ) { struct ata_taskfile tf ; { memset((void *)(& tf), 0, 32UL); *(rbuf + 1UL) = 137U; *(rbuf + 2UL) = 2U; *(rbuf + 3UL) = 56U; memcpy((void *)rbuf + 8U, (void const *)"linux ", 8UL); memcpy((void *)rbuf + 16U, (void const *)"libata ", 16UL); memcpy((void *)rbuf + 32U, (void const *)"3.00", 4UL); tf.command = 64U; tf.lbal = 1U; tf.nsect = 1U; ata_tf_to_fis((struct ata_taskfile const *)(& tf), 0, 1, rbuf + 36UL); *(rbuf + 36UL) = 52U; *(rbuf + 56UL) = 236U; memcpy((void *)rbuf + 60U, (void const *)args->id, 512UL); return (0U); } } static unsigned int ata_scsiop_inq_b0(struct ata_scsi_args *args , u8 *rbuf ) { u16 min_io_sectors ; u8 tmp ; bool tmp___0 ; { *(rbuf + 1UL) = 176U; *(rbuf + 3UL) = 60U; tmp = ata_id_log2_per_physical_sector((u16 const *)args->id); min_io_sectors = (u16 )(1 << (int )tmp); put_unaligned_be16((int )min_io_sectors, (void *)rbuf + 6U); tmp___0 = ata_id_has_trim((u16 const *)args->id); if ((int )tmp___0) { put_unaligned_be64(4194240ULL, (void *)rbuf + 36U); put_unaligned_be32(1U, (void *)rbuf + 28U); } else { } return (0U); } } static unsigned int ata_scsiop_inq_b1(struct ata_scsi_args *args , u8 *rbuf ) { int form_factor ; int tmp ; int media_rotation_rate ; int tmp___0 ; { tmp = ata_id_form_factor((u16 const *)args->id); form_factor = tmp; tmp___0 = ata_id_rotation_rate((u16 const *)args->id); media_rotation_rate = tmp___0; *(rbuf + 1UL) = 177U; *(rbuf + 3UL) = 60U; *(rbuf + 4UL) = (u8 )(media_rotation_rate >> 8); *(rbuf + 5UL) = (u8 )media_rotation_rate; *(rbuf + 7UL) = (u8 )form_factor; return (0U); } } static unsigned int ata_scsiop_inq_b2(struct ata_scsi_args *args , u8 *rbuf ) { { *(rbuf + 1UL) = 178U; *(rbuf + 3UL) = 4U; *(rbuf + 5UL) = 64U; return (0U); } } static unsigned int ata_scsiop_noop(struct ata_scsi_args *args , u8 *rbuf ) { { return (0U); } } static void modecpy(u8 *dest , u8 const *src , int n , bool changeable ) { { if ((int )changeable) { memcpy((void *)dest, (void const *)src, 2UL); memset((void *)dest + 2U, 0, (size_t )(n + -2)); } else { memcpy((void *)dest, (void const *)src, (size_t )n); } return; } } static unsigned int ata_msense_caching(u16 *id , u8 *buf , bool changeable ) { bool tmp ; bool tmp___0 ; int tmp___1 ; { modecpy(buf, (u8 const *)(& def_cache_mpage), 20, (int )changeable); if ((int )changeable) { *(buf + 2UL) = (u8 )((unsigned int )*(buf + 2UL) | 4U); } else { tmp = ata_id_wcache_enabled((u16 const *)id); if ((int )tmp) { *(buf + 2UL) = (u8 )((unsigned int )*(buf + 2UL) | 4U); } else { } } if (! changeable) { tmp___0 = ata_id_rahead_enabled((u16 const *)id); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { *(buf + 12UL) = (u8 )((unsigned int )*(buf + 12UL) | 32U); } else { } } else { } return (20U); } } static unsigned int ata_msense_ctl_mode(u8 *buf , bool changeable ) { { modecpy(buf, (u8 const *)(& def_control_mpage), 12, (int )changeable); return (12U); } } static unsigned int ata_msense_rw_recovery(u8 *buf , bool changeable ) { { modecpy(buf, (u8 const *)(& def_rw_recovery_mpage), 12, (int )changeable); return (12U); } } static int ata_dev_supports_fua(u16 *id ) { unsigned char model[41U] ; unsigned char fw[9U] ; bool tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; { if (libata_fua == 0) { return (0); } else { } tmp = ata_id_has_fua((u16 const *)id); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { return (0); } else { } ata_id_c_string((u16 const *)id, (unsigned char *)(& model), 27U, 41U); ata_id_c_string((u16 const *)id, (unsigned char *)(& fw), 23U, 9U); tmp___1 = strcmp((char const *)(& model), "Maxtor"); if (tmp___1 != 0) { return (1); } else { } tmp___2 = strcmp((char const *)(& fw), "BANC1G10"); if (tmp___2 != 0) { return (1); } else { } return (0); } } static unsigned int ata_scsiop_mode_sense(struct ata_scsi_args *args , u8 *rbuf ) { struct ata_device *dev ; u8 *scsicmd ; u8 *p ; u8 sat_blk_desc[8U] ; u8 pg ; u8 spg ; unsigned int ebd ; unsigned int page_control ; unsigned int six_byte ; u8 dpofua ; unsigned int tmp ; unsigned int tmp___0 ; unsigned int tmp___1 ; unsigned int tmp___2 ; unsigned int tmp___3 ; unsigned int tmp___4 ; int tmp___5 ; unsigned int output_len ; { dev = args->dev; scsicmd = (args->cmd)->cmnd; p = rbuf; sat_blk_desc[0] = 0U; sat_blk_desc[1] = 0U; sat_blk_desc[2] = 0U; sat_blk_desc[3] = 0U; sat_blk_desc[4] = 0U; sat_blk_desc[5] = 0U; sat_blk_desc[6] = 2U; sat_blk_desc[7] = 0U; six_byte = (unsigned int )*scsicmd == 26U; ebd = ((int )*(scsicmd + 1UL) & 8) == 0; page_control = (unsigned int )((int )*(scsicmd + 2UL) >> 6); switch (page_control) { case 0U: ; case 1U: ; case 2U: ; goto ldv_44064; case 3U: ; goto saving_not_supp; default: ; goto invalid_fld; } ldv_44064: ; if (six_byte != 0U) { p = p + (ebd != 0U ? 12UL : 4UL); } else { p = p + (ebd != 0U ? 16UL : 8UL); } pg = (unsigned int )*(scsicmd + 2UL) & 63U; spg = *(scsicmd + 3UL); if ((unsigned int )spg != 0U && (unsigned int )spg != 255U) { goto invalid_fld; } else { } switch ((int )pg) { case 1: tmp = ata_msense_rw_recovery(p, page_control == 1U); p = p + (unsigned long )tmp; goto ldv_44070; case 8: tmp___0 = ata_msense_caching(args->id, p, page_control == 1U); p = p + (unsigned long )tmp___0; goto ldv_44070; case 10: tmp___1 = ata_msense_ctl_mode(p, page_control == 1U); p = p + (unsigned long )tmp___1; goto ldv_44070; case 63: tmp___2 = ata_msense_rw_recovery(p, page_control == 1U); p = p + (unsigned long )tmp___2; tmp___3 = ata_msense_caching(args->id, p, page_control == 1U); p = p + (unsigned long )tmp___3; tmp___4 = ata_msense_ctl_mode(p, page_control == 1U); p = p + (unsigned long )tmp___4; goto ldv_44070; default: ; goto invalid_fld; } ldv_44070: dpofua = 0U; tmp___5 = ata_dev_supports_fua(args->id); if ((tmp___5 != 0 && (dev->flags & 2UL) != 0UL) && ((dev->flags & 4096UL) == 0UL || dev->multi_count != 0U)) { dpofua = 16U; } else { } if (six_byte != 0U) { *rbuf = (unsigned int )((int )((u8 )((long )p)) - (int )((u8 )((long )rbuf))) + 255U; *(rbuf + 2UL) = (u8 )((int )*(rbuf + 2UL) | (int )dpofua); if (ebd != 0U) { *(rbuf + 3UL) = 8U; memcpy((void *)rbuf + 4U, (void const *)(& sat_blk_desc), 8UL); } else { } } else { output_len = ((unsigned int )((long )p) - (unsigned int )((long )rbuf)) + 4294967294U; *rbuf = (u8 )(output_len >> 8); *(rbuf + 1UL) = (u8 )output_len; *(rbuf + 3UL) = (u8 )((int )*(rbuf + 3UL) | (int )dpofua); if (ebd != 0U) { *(rbuf + 7UL) = 8U; memcpy((void *)rbuf + 8U, (void const *)(& sat_blk_desc), 8UL); } else { } } return (0U); invalid_fld: ata_scsi_set_sense(args->cmd, 5, 36, 0); return (1U); saving_not_supp: ata_scsi_set_sense(args->cmd, 5, 57, 0); return (1U); } } static unsigned int ata_scsiop_read_cap(struct ata_scsi_args *args , u8 *rbuf ) { struct ata_device *dev ; u64 last_lba ; u32 sector_size ; u8 log2_per_phys ; u16 lowest_aligned ; bool tmp ; bool tmp___0 ; { dev = args->dev; last_lba = dev->n_sectors - 1ULL; sector_size = ata_id_logical_sector_size((u16 const *)(& dev->__annonCompField86.id)); log2_per_phys = ata_id_log2_per_physical_sector((u16 const *)(& dev->__annonCompField86.id)); lowest_aligned = ata_id_logical_sector_offset((u16 const *)(& dev->__annonCompField86.id), (int )log2_per_phys); if ((unsigned int )*((args->cmd)->cmnd) == 37U) { if (last_lba > 4294967294ULL) { last_lba = 4294967295ULL; } else { } *rbuf = (u8 )(last_lba >> 24); *(rbuf + 1UL) = (u8 )(last_lba >> 16); *(rbuf + 2UL) = (u8 )(last_lba >> 8); *(rbuf + 3UL) = (u8 )last_lba; *(rbuf + 4UL) = (u8 )(sector_size >> 24); *(rbuf + 5UL) = (u8 )(sector_size >> 16); *(rbuf + 6UL) = (u8 )(sector_size >> 8); *(rbuf + 7UL) = (u8 )sector_size; } else { *rbuf = (u8 )(last_lba >> 56); *(rbuf + 1UL) = (u8 )(last_lba >> 48); *(rbuf + 2UL) = (u8 )(last_lba >> 40); *(rbuf + 3UL) = (u8 )(last_lba >> 32); *(rbuf + 4UL) = (u8 )(last_lba >> 24); *(rbuf + 5UL) = (u8 )(last_lba >> 16); *(rbuf + 6UL) = (u8 )(last_lba >> 8); *(rbuf + 7UL) = (u8 )last_lba; *(rbuf + 8UL) = (u8 )(sector_size >> 24); *(rbuf + 9UL) = (u8 )(sector_size >> 16); *(rbuf + 10UL) = (u8 )(sector_size >> 8); *(rbuf + 11UL) = (u8 )sector_size; *(rbuf + 12UL) = 0U; *(rbuf + 13UL) = log2_per_phys; *(rbuf + 14UL) = (unsigned int )((u8 )((int )lowest_aligned >> 8)) & 63U; *(rbuf + 15UL) = (u8 )lowest_aligned; tmp___0 = ata_id_has_trim((u16 const *)args->id); if ((int )tmp___0) { *(rbuf + 14UL) = (u8 )((unsigned int )*(rbuf + 14UL) | 128U); tmp = ata_id_has_zero_after_trim((u16 const *)args->id); if ((int )tmp && (dev->horkage & 4194304U) != 0U) { ata_dev_printk((struct ata_device const *)dev, "\016", "Enabling discard_zeroes_data\n"); *(rbuf + 14UL) = (u8 )((unsigned int )*(rbuf + 14UL) | 64U); } else { } } else { } } return (0U); } } static unsigned int ata_scsiop_report_luns(struct ata_scsi_args *args , u8 *rbuf ) { { *(rbuf + 3UL) = 8U; return (0U); } } static void atapi_sense_complete(struct ata_queued_cmd *qc ) { { if (qc->err_mask != 0U && (qc->err_mask & 1U) == 0U) { ata_gen_passthru_sense(qc); } else { } (*(qc->scsidone))(qc->scsicmd); ata_qc_free(qc); return; } } __inline static int ata_pio_use_silly(struct ata_port *ap ) { { return ((int )ap->flags & 128); } } static void atapi_request_sense(struct ata_queued_cmd *qc ) { struct ata_port *ap ; struct scsi_cmnd *cmd ; int tmp ; { ap = qc->ap; cmd = qc->scsicmd; memset((void *)cmd->sense_buffer, 0, 96UL); if ((unsigned long )(ap->ops)->sff_tf_read != (unsigned long )((void (*)(struct ata_port * , struct ata_taskfile * ))0)) { (*((ap->ops)->sff_tf_read))(ap, & qc->tf); } else { } *(cmd->sense_buffer) = 112U; *(cmd->sense_buffer + 2UL) = (int )qc->tf.feature >> 4; ata_qc_reinit(qc); sg_init_one(& qc->sgent, (void const *)cmd->sense_buffer, 96U); ata_sg_init(qc, & qc->sgent, 1U); qc->dma_dir = 2; memset((void *)(& qc->cdb), 0, (size_t )(qc->dev)->cdb_len); qc->cdb[0] = 3U; qc->cdb[4] = 96U; qc->tf.flags = qc->tf.flags | 6UL; qc->tf.command = 160U; tmp = ata_pio_use_silly(ap); if (tmp != 0) { qc->tf.protocol = 7U; qc->tf.feature = (u8 )((unsigned int )qc->tf.feature | 1U); } else { qc->tf.protocol = 6U; qc->tf.lbam = 96U; qc->tf.lbah = 0U; } qc->nbytes = 96U; qc->complete_fn = & atapi_sense_complete; ata_qc_issue(qc); return; } } static void atapi_qc_complete(struct ata_queued_cmd *qc ) { struct scsi_cmnd *cmd ; unsigned int err_mask ; long tmp ; u8 *scsicmd ; unsigned long flags ; u8 *buf ; void *tmp___0 ; long tmp___1 ; long tmp___2 ; { cmd = qc->scsicmd; err_mask = qc->err_mask; tmp = ldv__builtin_expect((long )((unsigned long )((qc->ap)->ops)->error_handler != (unsigned long )((void (*)(struct ata_port * ))0) && (err_mask != 0U || (qc->flags & 131072UL) != 0UL)), 0L); if (tmp != 0L) { if ((qc->flags & 131072UL) == 0UL) { ata_gen_passthru_sense(qc); } else { } if ((unsigned int )qc->cdb[0] == 30U && (unsigned long )(qc->dev)->sdev != (unsigned long )((struct scsi_device *)0)) { ((qc->dev)->sdev)->locked = 0U; } else { } (qc->scsicmd)->result = 2; (*(qc->scsidone))(cmd); ata_qc_free(qc); return; } else { } tmp___2 = ldv__builtin_expect((long )((int )err_mask) & 1L, 0L); if (tmp___2 != 0L) { cmd->result = 2; atapi_request_sense(qc); return; } else { tmp___1 = ldv__builtin_expect(err_mask != 0U, 0L); if (tmp___1 != 0L) { ata_gen_passthru_sense(qc); } else { scsicmd = cmd->cmnd; if ((unsigned int )*scsicmd == 18U && ((int )*(scsicmd + 1UL) & 3) == 0) { tmp___0 = ata_scsi_rbuf_get(cmd, 1, & flags); buf = (u8 *)tmp___0; if ((unsigned int )*(buf + 2UL) == 0U) { *(buf + 2UL) = 5U; *(buf + 3UL) = 50U; } else { } ata_scsi_rbuf_put(cmd, 1, & flags); } else { } cmd->result = 0; } } (*(qc->scsidone))(cmd); ata_qc_free(qc); return; } } static unsigned int atapi_xlat(struct ata_queued_cmd *qc ) { struct scsi_cmnd *scmd ; struct ata_device *dev ; int nodata ; int using_pio ; unsigned int nbytes ; int tmp ; unsigned int _min1 ; unsigned int tmp___0 ; unsigned int _min2 ; { scmd = qc->scsicmd; dev = qc->dev; nodata = (unsigned int )scmd->sc_data_direction == 3U; using_pio = nodata == 0 && (dev->flags & 4096UL) != 0UL; memset((void *)(& qc->cdb), 0, (size_t )dev->cdb_len); memcpy((void *)(& qc->cdb), (void const *)scmd->cmnd, (size_t )scmd->cmd_len); qc->complete_fn = & atapi_qc_complete; qc->tf.flags = qc->tf.flags | 6UL; if ((unsigned int )scmd->sc_data_direction == 1U) { qc->tf.flags = qc->tf.flags | 8UL; } else { } qc->tf.command = 160U; ata_qc_set_pc_nbytes(qc); if (nodata == 0 && using_pio == 0) { tmp = atapi_check_dma(qc); if (tmp != 0) { using_pio = 1; } else { } } else { } tmp___0 = ata_qc_raw_nbytes(qc); _min1 = tmp___0; _min2 = 64512U; nbytes = _min1 < _min2 ? _min1 : _min2; if ((int )nbytes & 1) { nbytes = nbytes + 1U; } else { } qc->tf.lbam = (u8 )nbytes; qc->tf.lbah = (u8 )(nbytes >> 8); if (nodata != 0) { qc->tf.protocol = 5U; } else if (using_pio != 0) { qc->tf.protocol = 6U; } else { qc->tf.protocol = 7U; qc->tf.feature = (u8 )((unsigned int )qc->tf.feature | 1U); if ((dev->flags & 1024UL) != 0UL && (unsigned int )scmd->sc_data_direction != 1U) { qc->tf.feature = (u8 )((unsigned int )qc->tf.feature | 4U); } else { } } return (0U); } } static struct ata_device *ata_find_dev(struct ata_port *ap , int devno ) { int tmp ; long tmp___0 ; long tmp___1 ; bool tmp___2 ; int tmp___3 ; { tmp___2 = sata_pmp_attached(ap); if (tmp___2) { tmp___3 = 0; } else { tmp___3 = 1; } if (tmp___3) { tmp = ata_link_max_devices((struct ata_link const *)(& ap->link)); tmp___0 = ldv__builtin_expect(tmp > devno, 1L); if (tmp___0 != 0L) { return ((struct ata_device *)(& ap->link.device) + (unsigned long )devno); } else { } } else { tmp___1 = ldv__builtin_expect(ap->nr_pmp_links > devno, 1L); if (tmp___1 != 0L) { return ((struct ata_device *)(& (ap->pmp_link + (unsigned long )devno)->device)); } else { } } return ((struct ata_device *)0); } } static struct ata_device *__ata_scsi_find_dev(struct ata_port *ap , struct scsi_device const *scsidev ) { int devno ; long tmp ; long tmp___0 ; bool tmp___1 ; int tmp___2 ; struct ata_device *tmp___3 ; { tmp___1 = sata_pmp_attached(ap); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { tmp = ldv__builtin_expect((long )((unsigned int )scsidev->channel != 0U || (unsigned long long )scsidev->lun != 0ULL), 0L); if (tmp != 0L) { return ((struct ata_device *)0); } else { } devno = (int )scsidev->id; } else { tmp___0 = ldv__builtin_expect((long )((unsigned int )scsidev->id != 0U || (unsigned long long )scsidev->lun != 0ULL), 0L); if (tmp___0 != 0L) { return ((struct ata_device *)0); } else { } devno = (int )scsidev->channel; } tmp___3 = ata_find_dev(ap, devno); return (tmp___3); } } static struct ata_device *ata_scsi_find_dev(struct ata_port *ap , struct scsi_device const *scsidev ) { struct ata_device *dev ; struct ata_device *tmp ; unsigned int tmp___0 ; int tmp___1 ; long tmp___2 ; { tmp = __ata_scsi_find_dev(ap, scsidev); dev = tmp; if ((unsigned long )dev == (unsigned long )((struct ata_device *)0)) { tmp___1 = 1; } else { tmp___0 = ata_dev_enabled((struct ata_device const *)dev); if (tmp___0 == 0U) { tmp___1 = 1; } else { tmp___1 = 0; } } tmp___2 = ldv__builtin_expect((long )tmp___1, 0L); if (tmp___2 != 0L) { return ((struct ata_device *)0); } else { } return (dev); } } static u8 ata_scsi_map_proto(u8 byte1 ) { { switch (((int )byte1 & 30) >> 1) { case 3: ; return (1U); case 6: ; case 10: ; case 11: ; return (3U); case 4: ; case 5: ; return (2U); case 0: ; case 1: ; case 8: ; case 9: ; case 7: ; case 12: ; case 15: ; default: ; goto ldv_44150; } ldv_44150: ; return (0U); } } static unsigned int ata_scsi_pass_thru(struct ata_queued_cmd *qc ) { struct ata_taskfile *tf ; struct scsi_cmnd *scmd ; struct ata_device *dev ; u8 const *cdb ; u8 tmp ; int tmp___0 ; unsigned int multi_count ; int tmp___1 ; { tf = & qc->tf; scmd = qc->scsicmd; dev = qc->dev; cdb = (u8 const *)scmd->cmnd; tmp = ata_scsi_map_proto((int )*(cdb + 1UL)); tf->protocol = tmp; if ((unsigned int )tmp == 0U) { goto invalid_fld; } else { } if ((unsigned int )((unsigned char )*cdb) == 133U) { if ((int )*(cdb + 1UL) & 1) { tf->hob_feature = *(cdb + 3UL); tf->hob_nsect = *(cdb + 5UL); tf->hob_lbal = *(cdb + 7UL); tf->hob_lbam = *(cdb + 9UL); tf->hob_lbah = *(cdb + 11UL); tf->flags = tf->flags | 1UL; } else { tf->flags = tf->flags & 0xfffffffffffffffeUL; } tf->feature = *(cdb + 4UL); tf->nsect = *(cdb + 6UL); tf->lbal = *(cdb + 8UL); tf->lbam = *(cdb + 10UL); tf->lbah = *(cdb + 12UL); tf->device = *(cdb + 13UL); tf->command = *(cdb + 14UL); } else { tf->flags = tf->flags & 0xfffffffffffffffeUL; tf->feature = *(cdb + 3UL); tf->nsect = *(cdb + 4UL); tf->lbal = *(cdb + 5UL); tf->lbam = *(cdb + 6UL); tf->lbah = *(cdb + 7UL); tf->device = *(cdb + 8UL); tf->command = *(cdb + 9UL); } tf->device = dev->devno != 0U ? (u8 )((unsigned int )tf->device | 16U) : (unsigned int )tf->device & 239U; switch ((int )tf->command) { case 34: ; case 35: ; case 50: ; case 51: ; if ((unsigned int )tf->protocol != 2U || (unsigned int )tf->nsect != 1U) { goto invalid_fld; } else { } qc->sect_size = scsi_bufflen(scmd); goto ldv_44163; case 56: ; case 135: ; case 205: ; case 200: ; case 37: ; case 38: ; case 96: ; case 196: ; case 41: ; case 32: ; case 36: ; case 42: ; case 43: ; case 64: ; case 66: ; case 202: ; case 53: ; case 61: ; case 54: ; case 62: ; case 97: ; case 197: ; case 57: ; case 206: ; case 48: ; case 52: ; case 58: ; case 59: qc->sect_size = (scmd->device)->sector_size; goto ldv_44163; default: qc->sect_size = 512U; } ldv_44163: tf->flags = tf->flags | 6UL; if ((unsigned int )scmd->sc_data_direction == 1U) { tf->flags = tf->flags | 8UL; } else { } qc->flags = qc->flags | 80UL; ata_qc_set_pc_nbytes(qc); if ((unsigned int )tf->protocol == 3U && (unsigned int )dev->dma_mode == 0U) { goto invalid_fld; } else { } if (((int )*(cdb + 1UL) & 224) != 0) { tmp___0 = is_multi_taskfile(tf); if (tmp___0 == 0) { goto invalid_fld; } else { } } else { } tmp___1 = is_multi_taskfile(tf); if (tmp___1 != 0) { multi_count = (unsigned int )(1 << ((int )((unsigned char )*(cdb + 1UL)) >> 5)); if (dev->multi_count != multi_count) { ata_dev_printk((struct ata_device const *)dev, "\f", "invalid multi_count %u ignored\n", multi_count); } else { } } else { } if ((unsigned int )tf->command == 239U && (unsigned int )tf->feature == 3U) { goto invalid_fld; } else { } if (((unsigned int )tf->command > 91U && (unsigned int )tf->command <= 95U) && libata_allow_tpm == 0) { goto invalid_fld; } else { } return (0U); invalid_fld: ata_scsi_set_sense(scmd, 5, 36, 0); return (1U); } } static unsigned int ata_scsi_write_same_xlat(struct ata_queued_cmd *qc ) { struct ata_taskfile *tf ; struct scsi_cmnd *scmd ; struct ata_device *dev ; u8 const *cdb ; u64 block ; u32 n_block ; u32 size ; void *buf ; long tmp ; long tmp___0 ; long tmp___1 ; unsigned int tmp___2 ; struct scatterlist *tmp___3 ; struct page *tmp___4 ; int tmp___5 ; bool tmp___6 ; { tf = & qc->tf; scmd = qc->scsicmd; dev = qc->dev; cdb = (u8 const *)scmd->cmnd; tmp = ldv__builtin_expect((unsigned int )dev->dma_mode == 0U, 0L); if (tmp != 0L) { goto invalid_fld; } else { } tmp___0 = ldv__builtin_expect((unsigned int )scmd->cmd_len <= 15U, 0L); if (tmp___0 != 0L) { goto invalid_fld; } else { } scsi_16_lba_len(cdb, & block, & n_block); tmp___1 = ldv__builtin_expect(((int )*(cdb + 1UL) & 8) == 0, 0L); if (tmp___1 != 0L) { goto invalid_fld; } else { } tmp___2 = scsi_sg_count(scmd); if (tmp___2 == 0U) { goto invalid_fld; } else { } tmp___3 = scsi_sglist(scmd); tmp___4 = sg_page___0(tmp___3); buf = lowmem_page_address((struct page const *)tmp___4); size = ata_set_lba_range_entries(buf, 512U, block, (unsigned long )n_block); tmp___5 = ata_ncq_enabled(dev); if (tmp___5 != 0) { tmp___6 = ata_fpdma_dsm_supported(dev); if ((int )tmp___6) { tf->protocol = 4U; tf->command = 100U; tf->hob_nsect = 0U; tf->nsect = (int )((u8 )qc->tag) << 3U; tf->hob_feature = (u8 )(size / 512U >> 8); tf->feature = (u8 )(size / 512U); tf->auxiliary = 1U; } else { goto _L; } } else { _L: /* CIL Label */ tf->protocol = 3U; tf->hob_feature = 0U; tf->feature = 1U; tf->hob_nsect = (u8 )(size / 512U >> 8); tf->nsect = (u8 )(size / 512U); tf->command = 6U; } tf->flags = tf->flags | 15UL; ata_qc_set_pc_nbytes(qc); return (0U); invalid_fld: ata_scsi_set_sense(scmd, 5, 36, 0); return (1U); } } static int ata_mselect_caching(struct ata_queued_cmd *qc , u8 const *buf , int len ) { struct ata_taskfile *tf ; struct ata_device *dev ; char mpage[20U] ; u8 wce ; int tmp ; { tf = & qc->tf; dev = qc->dev; if (len != 18) { return (-22); } else { } wce = (unsigned int )((u8 )*buf) & 4U; ata_msense_caching((u16 *)(& dev->__annonCompField86.id), (u8 *)(& mpage), 0); mpage[2] = (int )mpage[2] & -5; mpage[2] = (int )mpage[2] | (int )((char )wce); tmp = memcmp((void const *)(& mpage) + 2U, (void const *)buf, 18UL); if (tmp != 0) { return (-22); } else { } tf->flags = tf->flags | 6UL; tf->protocol = 1U; tf->nsect = 0U; tf->command = 239U; tf->feature = (unsigned int )wce != 0U ? 2U : 130U; return (0); } } static unsigned int ata_scsi_mode_select_xlat(struct ata_queued_cmd *qc ) { struct scsi_cmnd *scmd ; u8 const *cdb ; u8 const *p ; u8 pg ; u8 spg ; unsigned int six_byte ; unsigned int pg_len ; unsigned int hdr_len ; unsigned int bd_len ; int len ; unsigned int tmp ; struct scatterlist *tmp___0 ; struct scatterlist *tmp___1 ; struct page *tmp___2 ; void *tmp___3 ; int tmp___4 ; { scmd = qc->scsicmd; cdb = (u8 const *)scmd->cmnd; six_byte = (unsigned int )((unsigned char )*cdb) == 21U; if (six_byte != 0U) { if ((unsigned int )scmd->cmd_len <= 4U) { goto invalid_fld; } else { } len = (int )*(cdb + 4UL); hdr_len = 4U; } else { if ((unsigned int )scmd->cmd_len <= 8U) { goto invalid_fld; } else { } len = ((int )*(cdb + 7UL) << 8) + (int )*(cdb + 8UL); hdr_len = 8U; } if (((int )*(cdb + 1UL) & 17) != 16) { goto invalid_fld; } else { } tmp = scsi_sg_count(scmd); if (tmp == 0U) { goto invalid_param_len; } else { tmp___0 = scsi_sglist(scmd); if (tmp___0->length < (unsigned int )len) { goto invalid_param_len; } else { } } tmp___1 = scsi_sglist(scmd); tmp___2 = sg_page___0(tmp___1); tmp___3 = lowmem_page_address((struct page const *)tmp___2); p = (u8 const *)tmp___3; if ((unsigned int )len < hdr_len) { goto invalid_param_len; } else { } if (six_byte != 0U) { bd_len = (unsigned int )*(p + 3UL); } else { bd_len = (unsigned int )(((int )*(p + 6UL) << 8) + (int )*(p + 7UL)); } len = (int )((unsigned int )len - hdr_len); p = p + (unsigned long )hdr_len; if ((unsigned int )len < bd_len) { goto invalid_param_len; } else { } if (bd_len != 0U && bd_len != 8U) { goto invalid_param; } else { } len = (int )((unsigned int )len - bd_len); p = p + (unsigned long )bd_len; if (len == 0) { goto skip; } else { } pg = (unsigned int )((u8 )*p) & 63U; if (((int )*p & 64) != 0) { if (len <= 3) { goto invalid_param_len; } else { } spg = *(p + 1UL); pg_len = (unsigned int )(((int )*(p + 2UL) << 8) | (int )*(p + 3UL)); p = p + 4UL; len = len + -4; } else { if (len <= 1) { goto invalid_param_len; } else { } spg = 0U; pg_len = (unsigned int )*(p + 1UL); p = p + 2UL; len = len + -2; } if ((unsigned int )spg != 0U && (unsigned int )spg != 255U) { goto invalid_param; } else { } if ((unsigned int )len < pg_len) { goto invalid_param_len; } else { } switch ((int )pg) { case 8: tmp___4 = ata_mselect_caching(qc, p, (int )pg_len); if (tmp___4 < 0) { goto invalid_param; } else { } goto ldv_44233; default: ; goto invalid_param; } ldv_44233: ; if ((unsigned int )len > pg_len) { goto invalid_param; } else { } return (0U); invalid_fld: ata_scsi_set_sense(scmd, 5, 36, 0); return (1U); invalid_param: ata_scsi_set_sense(scmd, 5, 38, 0); return (1U); invalid_param_len: ata_scsi_set_sense(scmd, 5, 26, 0); return (1U); skip: scmd->result = 0; return (1U); } } __inline static ata_xlat_func_t ata_get_xlat_func(struct ata_device *dev , u8 cmd ) { int tmp ; { switch ((int )cmd) { case 8: ; case 40: ; case 136: ; case 10: ; case 42: ; case 138: ; return (& ata_scsi_rw_xlat); case 147: ; return (& ata_scsi_write_same_xlat); case 53: tmp = ata_try_flush_cache((struct ata_device const *)dev); if (tmp != 0) { return (& ata_scsi_flush_xlat); } else { } goto ldv_44247; case 47: ; case 143: ; return (& ata_scsi_verify_xlat); case 161: ; case 133: ; return (& ata_scsi_pass_thru); case 21: ; case 85: ; return (& ata_scsi_mode_select_xlat); case 27: ; return (& ata_scsi_start_stop_xlat); } ldv_44247: ; return ((unsigned int (*)(struct ata_queued_cmd * ))0); } } __inline static void ata_scsi_dump_cdb(struct ata_port *ap , struct scsi_cmnd *cmd ) { { return; } } __inline static int __ata_scsi_queuecmd(struct scsi_cmnd *scmd , struct ata_device *dev ) { u8 scsi_op ; unsigned int (*xlat_func)(struct ata_queued_cmd * ) ; int rc ; long tmp ; long tmp___0 ; int len ; long tmp___1 ; long tmp___2 ; long tmp___3 ; { scsi_op = *(scmd->cmnd); rc = 0; if (dev->class == 1U || dev->class == 9U) { tmp = ldv__builtin_expect((long )((unsigned int )scmd->cmd_len == 0U || (unsigned int )scmd->cmd_len > dev->cdb_len), 0L); if (tmp != 0L) { goto bad_cdb_len; } else { } xlat_func = ata_get_xlat_func(dev, (int )scsi_op); } else { tmp___0 = ldv__builtin_expect((unsigned int )scmd->cmd_len == 0U, 0L); if (tmp___0 != 0L) { goto bad_cdb_len; } else { } xlat_func = (unsigned int (*)(struct ata_queued_cmd * ))0; tmp___3 = ldv__builtin_expect((long )((unsigned int )scsi_op != 133U || atapi_passthru16 == 0), 1L); if (tmp___3 != 0L) { len = (int )scsi_command_size_tbl[((int )scsi_op >> 5) & 7]; tmp___1 = ldv__builtin_expect((long )((int )scmd->cmd_len < len || (unsigned int )len > dev->cdb_len), 0L); if (tmp___1 != 0L) { goto bad_cdb_len; } else { } xlat_func = & atapi_xlat; } else { tmp___2 = ldv__builtin_expect((unsigned int )scmd->cmd_len > 16U, 0L); if (tmp___2 != 0L) { goto bad_cdb_len; } else { } xlat_func = ata_get_xlat_func(dev, (int )scsi_op); } } if ((unsigned long )xlat_func != (unsigned long )((unsigned int (*)(struct ata_queued_cmd * ))0)) { rc = ata_scsi_translate(dev, scmd, xlat_func); } else { ata_scsi_simulate(dev, scmd); } return (rc); bad_cdb_len: scmd->result = 458752; (*(scmd->scsi_done))(scmd); return (0); } } int ata_scsi_queuecmd(struct Scsi_Host *shost , struct scsi_cmnd *cmd ) { struct ata_port *ap ; struct ata_device *dev ; struct scsi_device *scsidev ; int rc ; unsigned long irq_flags ; raw_spinlock_t *tmp ; long tmp___0 ; { scsidev = cmd->device; rc = 0; ap = ata_shost_to_port(shost); tmp = spinlock_check(ap->lock); irq_flags = _raw_spin_lock_irqsave(tmp); ata_scsi_dump_cdb(ap, cmd); dev = ata_scsi_find_dev(ap, (struct scsi_device const *)scsidev); tmp___0 = ldv__builtin_expect((unsigned long )dev != (unsigned long )((struct ata_device *)0), 1L); if (tmp___0 != 0L) { rc = __ata_scsi_queuecmd(cmd, dev); } else { cmd->result = 262144; (*(cmd->scsi_done))(cmd); } spin_unlock_irqrestore(ap->lock, irq_flags); return (rc); } } void ata_scsi_simulate(struct ata_device *dev , struct scsi_cmnd *cmd ) { struct ata_scsi_args args ; u8 const *scsicmd ; u8 tmp8 ; { scsicmd = (u8 const *)cmd->cmnd; args.dev = dev; args.id = (u16 *)(& dev->__annonCompField86.id); args.cmd = cmd; args.done = cmd->scsi_done; switch ((int )*scsicmd) { case 4: ata_scsi_invalid_field(cmd); goto ldv_44288; case 18: ; if (((int )*(scsicmd + 1UL) & 2) != 0) { ata_scsi_invalid_field(cmd); } else if (((int )*(scsicmd + 1UL) & 1) == 0) { ata_scsi_rbuf_fill(& args, & ata_scsiop_inq_std); } else { switch ((int )*(scsicmd + 2UL)) { case 0: ata_scsi_rbuf_fill(& args, & ata_scsiop_inq_00); goto ldv_44291; case 128: ata_scsi_rbuf_fill(& args, & ata_scsiop_inq_80); goto ldv_44291; case 131: ata_scsi_rbuf_fill(& args, & ata_scsiop_inq_83); goto ldv_44291; case 137: ata_scsi_rbuf_fill(& args, & ata_scsiop_inq_89); goto ldv_44291; case 176: ata_scsi_rbuf_fill(& args, & ata_scsiop_inq_b0); goto ldv_44291; case 177: ata_scsi_rbuf_fill(& args, & ata_scsiop_inq_b1); goto ldv_44291; case 178: ata_scsi_rbuf_fill(& args, & ata_scsiop_inq_b2); goto ldv_44291; default: ata_scsi_invalid_field(cmd); goto ldv_44291; } ldv_44291: ; } goto ldv_44288; case 26: ; case 90: ata_scsi_rbuf_fill(& args, & ata_scsiop_mode_sense); goto ldv_44288; case 37: ata_scsi_rbuf_fill(& args, & ata_scsiop_read_cap); goto ldv_44288; case 158: ; if (((int )*(scsicmd + 1UL) & 31) == 16) { ata_scsi_rbuf_fill(& args, & ata_scsiop_read_cap); } else { ata_scsi_invalid_field(cmd); } goto ldv_44288; case 160: ata_scsi_rbuf_fill(& args, & ata_scsiop_report_luns); goto ldv_44288; case 3: ata_scsi_set_sense(cmd, 0, 0, 0); cmd->result = 134217728; (*(cmd->scsi_done))(cmd); goto ldv_44288; case 53: ; case 1: ; case 11: ; case 43: ; case 0: ata_scsi_rbuf_fill(& args, & ata_scsiop_noop); goto ldv_44288; case 29: tmp8 = (unsigned int )((u8 )*(scsicmd + 1UL)) & 247U; if (((unsigned int )tmp8 == 4U && (unsigned int )((unsigned char )*(scsicmd + 3UL)) == 0U) && (unsigned int )((unsigned char )*(scsicmd + 4UL)) == 0U) { ata_scsi_rbuf_fill(& args, & ata_scsiop_noop); } else { ata_scsi_invalid_field(cmd); } goto ldv_44288; default: ata_scsi_set_sense(cmd, 5, 32, 0); (*(cmd->scsi_done))(cmd); goto ldv_44288; } ldv_44288: ; return; } } int ata_scsi_add_hosts(struct ata_host *host , struct scsi_host_template *sht ) { int i ; int rc ; struct ata_port *ap ; struct Scsi_Host *shost ; int tmp ; struct Scsi_Host *shost___0 ; { i = 0; goto ldv_44323; ldv_44322: ap = host->ports[i]; rc = -12; shost = scsi_host_alloc(sht, 8); if ((unsigned long )shost == (unsigned long )((struct Scsi_Host *)0)) { goto err_alloc; } else { } shost->eh_noresume = 1U; *((struct ata_port **)(& shost->hostdata)) = ap; ap->scsi_host = shost; shost->transportt = ata_scsi_transport_template; shost->unique_id = ap->print_id; shost->max_id = 16U; shost->max_lun = 1ULL; shost->max_channel = 1U; shost->max_cmd_len = 16U; shost->no_write_same = 1U; shost->max_host_blocked = 1U; tmp = scsi_init_shared_tag_map(shost, (int )host->n_tags); if (tmp != 0) { goto err_add; } else { } rc = scsi_add_host_with_dma(ap->scsi_host, & ap->tdev, (ap->host)->dev); if (rc != 0) { goto err_add; } else { } i = i + 1; ldv_44323: ; if ((unsigned int )i < host->n_ports) { goto ldv_44322; } else { } return (0); err_add: scsi_host_put((host->ports[i])->scsi_host); err_alloc: ; goto ldv_44327; ldv_44326: shost___0 = (host->ports[i])->scsi_host; scsi_remove_host(shost___0); scsi_host_put(shost___0); ldv_44327: i = i - 1; if (i >= 0) { goto ldv_44326; } else { } return (rc); } } void ata_scsi_scan_host(struct ata_port *ap , int sync ) { int tries ; struct ata_device *last_failed_dev ; struct ata_link *link ; struct ata_device *dev ; struct scsi_device *sdev ; int channel ; int id ; int tmp ; bool tmp___0 ; int tmp___1 ; unsigned long tmp___2 ; { tries = 5; last_failed_dev = (struct ata_device *)0; repeat: link = ata_link_next((struct ata_link *)0, ap, 0); goto ldv_44346; ldv_44345: dev = ata_dev_next((struct ata_device *)0, link, 0); goto ldv_44343; ldv_44342: channel = 0; id = 0; if ((unsigned long )dev->sdev != (unsigned long )((struct scsi_device *)0)) { goto ldv_44341; } else { } tmp = ata_is_host_link((struct ata_link const *)link); if (tmp != 0) { id = (int )dev->devno; } else { channel = link->pmp; } sdev = __scsi_add_device(ap->scsi_host, (uint )channel, (uint )id, 0ULL, (void *)0); tmp___0 = IS_ERR((void const *)sdev); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { dev->sdev = sdev; scsi_device_put(sdev); } else { dev->sdev = (struct scsi_device *)0; } ldv_44341: dev = ata_dev_next(dev, link, 0); ldv_44343: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_44342; } else { } link = ata_link_next(link, ap, 0); ldv_44346: ; if ((unsigned long )link != (unsigned long )((struct ata_link *)0)) { goto ldv_44345; } else { } link = ata_link_next((struct ata_link *)0, ap, 0); goto ldv_44353; ldv_44352: dev = ata_dev_next((struct ata_device *)0, link, 0); goto ldv_44350; ldv_44349: ; if ((unsigned long )dev->sdev == (unsigned long )((struct scsi_device *)0)) { goto exit_loop; } else { } dev = ata_dev_next(dev, link, 0); ldv_44350: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_44349; } else { } link = ata_link_next(link, ap, 0); ldv_44353: ; if ((unsigned long )link != (unsigned long )((struct ata_link *)0)) { goto ldv_44352; } else { } exit_loop: ; if ((unsigned long )link == (unsigned long )((struct ata_link *)0)) { return; } else { } if (sync != 0) { if ((unsigned long )dev != (unsigned long )last_failed_dev) { msleep(100U); last_failed_dev = dev; goto repeat; } else { } tries = tries - 1; if (tries != 0) { msleep(100U); goto repeat; } else { } ata_port_printk((struct ata_port const *)ap, "\v", "WARNING: synchronous SCSI scan failed without making any progress, switching to async\n"); } else { } tmp___2 = round_jiffies_relative(250UL); queue_delayed_work(system_long_wq, & ap->hotplug_task, tmp___2); return; } } int ata_scsi_offline_dev(struct ata_device *dev ) { { if ((unsigned long )dev->sdev != (unsigned long )((struct scsi_device *)0)) { scsi_device_set_state(dev->sdev, 6); return (1); } else { } return (0); } } static void ata_scsi_remove_dev(struct ata_device *dev ) { struct ata_port *ap ; struct scsi_device *sdev ; unsigned long flags ; raw_spinlock_t *tmp ; int __ret_warn_on ; long tmp___0 ; int tmp___1 ; char const *tmp___2 ; { ap = (dev->link)->ap; mutex_lock_nested(& (ap->scsi_host)->scan_mutex, 0U); tmp = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp); sdev = dev->sdev; dev->sdev = (struct scsi_device *)0; if ((unsigned long )sdev != (unsigned long )((struct scsi_device *)0)) { tmp___1 = scsi_device_get(sdev); if (tmp___1 == 0) { scsi_device_set_state(sdev, 6); } else { __ret_warn_on = 1; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-scsi.c", 3870); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); sdev = (struct scsi_device *)0; } } else { } spin_unlock_irqrestore(ap->lock, flags); mutex_unlock(& (ap->scsi_host)->scan_mutex); if ((unsigned long )sdev != (unsigned long )((struct scsi_device *)0)) { tmp___2 = dev_name((struct device const *)(& sdev->sdev_gendev)); ata_dev_printk((struct ata_device const *)dev, "\016", "detaching (SCSI %s)\n", tmp___2); scsi_remove_device(sdev); scsi_device_put(sdev); } else { } return; } } static void ata_scsi_handle_link_detach(struct ata_link *link ) { struct ata_port *ap ; struct ata_device *dev ; unsigned long flags ; raw_spinlock_t *tmp ; bool tmp___0 ; { ap = link->ap; dev = ata_dev_next((struct ata_device *)0, link, 2); goto ldv_44380; ldv_44379: ; if ((dev->flags & 33554432UL) == 0UL) { goto ldv_44375; } else { } tmp = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp); dev->flags = dev->flags & 0xfffffffffdffffffUL; spin_unlock_irqrestore(ap->lock, flags); tmp___0 = zpodd_dev_enabled(dev); if ((int )tmp___0) { zpodd_exit(dev); } else { } ata_scsi_remove_dev(dev); ldv_44375: dev = ata_dev_next(dev, link, 2); ldv_44380: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_44379; } else { } return; } } void ata_scsi_media_change_notify(struct ata_device *dev ) { { if ((unsigned long )dev->sdev != (unsigned long )((struct scsi_device *)0)) { sdev_evt_send_simple(dev->sdev, 1, 32U); } else { } return; } } void ata_scsi_hotplug(struct work_struct *work ) { struct ata_port *ap ; struct work_struct const *__mptr ; int i ; { __mptr = (struct work_struct const *)work; ap = (struct ata_port *)__mptr + 0xffffffffffffbe28UL; if ((ap->pflags & 512U) != 0U) { return; } else { } goto ldv_44393; ldv_44392: msleep(10U); ldv_44393: ; if ((int )pm_freezing) { goto ldv_44392; } else { } mutex_lock_nested(& ap->scsi_scan_mutex, 0U); ata_scsi_handle_link_detach(& ap->link); if ((unsigned long )ap->pmp_link != (unsigned long )((struct ata_link *)0)) { i = 0; goto ldv_44396; ldv_44395: ata_scsi_handle_link_detach(ap->pmp_link + (unsigned long )i); i = i + 1; ldv_44396: ; if (i <= 14) { goto ldv_44395; } else { } } else { } ata_scsi_scan_host(ap, 0); mutex_unlock(& ap->scsi_scan_mutex); return; } } int ata_scsi_user_scan(struct Scsi_Host *shost , unsigned int channel , unsigned int id , u64 lun ) { struct ata_port *ap ; struct ata_port *tmp ; unsigned long flags ; int devno ; int rc ; bool tmp___0 ; int tmp___1 ; raw_spinlock_t *tmp___2 ; struct ata_link *link ; struct ata_eh_info *ehi ; struct ata_device *dev ; struct ata_device *tmp___3 ; struct ata_eh_info *ehi___0 ; { tmp = ata_shost_to_port(shost); ap = tmp; rc = 0; if ((unsigned long )(ap->ops)->error_handler == (unsigned long )((void (*)(struct ata_port * ))0)) { return (-95); } else { } if (lun != 0xffffffffffffffffULL && lun != 0ULL) { return (-22); } else { } tmp___0 = sata_pmp_attached(ap); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { if (channel != 4294967295U && channel != 0U) { return (-22); } else { } devno = (int )id; } else { if (id != 4294967295U && id != 0U) { return (-22); } else { } devno = (int )channel; } tmp___2 = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp___2); if (devno == -1) { link = ata_link_next((struct ata_link *)0, ap, 0); goto ldv_44414; ldv_44413: ehi = & link->eh_info; ehi->probe_mask = ehi->probe_mask | 3U; ehi->action = ehi->action | 6U; link = ata_link_next(link, ap, 0); ldv_44414: ; if ((unsigned long )link != (unsigned long )((struct ata_link *)0)) { goto ldv_44413; } else { } } else { tmp___3 = ata_find_dev(ap, devno); dev = tmp___3; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { ehi___0 = & (dev->link)->eh_info; ehi___0->probe_mask = ehi___0->probe_mask | (unsigned int )(1 << (int )dev->devno); ehi___0->action = ehi___0->action | 6U; } else { rc = -22; } } if (rc == 0) { ata_port_schedule_eh(ap); spin_unlock_irqrestore(ap->lock, flags); ata_port_wait_eh(ap); } else { spin_unlock_irqrestore(ap->lock, flags); } return (rc); } } void ata_scsi_dev_rescan(struct work_struct *work ) { struct ata_port *ap ; struct work_struct const *__mptr ; struct ata_link *link ; struct ata_device *dev ; unsigned long flags ; raw_spinlock_t *tmp ; struct scsi_device *sdev ; int tmp___0 ; raw_spinlock_t *tmp___1 ; { __mptr = (struct work_struct const *)work; ap = (struct ata_port *)__mptr + 0xffffffffffffbd48UL; mutex_lock_nested(& ap->scsi_scan_mutex, 0U); tmp = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp); link = ata_link_next((struct ata_link *)0, ap, 0); goto ldv_44439; ldv_44438: dev = ata_dev_next((struct ata_device *)0, link, 0); goto ldv_44436; ldv_44435: sdev = dev->sdev; if ((unsigned long )sdev == (unsigned long )((struct scsi_device *)0)) { goto ldv_44431; } else { } tmp___0 = scsi_device_get(sdev); if (tmp___0 != 0) { goto ldv_44431; } else { } spin_unlock_irqrestore(ap->lock, flags); scsi_rescan_device(& sdev->sdev_gendev); scsi_device_put(sdev); tmp___1 = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp___1); ldv_44431: dev = ata_dev_next(dev, link, 0); ldv_44436: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_44435; } else { } link = ata_link_next(link, ap, 0); ldv_44439: ; if ((unsigned long )link != (unsigned long )((struct ata_link *)0)) { goto ldv_44438; } else { } spin_unlock_irqrestore(ap->lock, flags); mutex_unlock(& ap->scsi_scan_mutex); return; } } struct ata_port *ata_sas_port_alloc(struct ata_host *host , struct ata_port_info *port_info , struct Scsi_Host *shost ) { struct ata_port *ap ; { ap = ata_port_alloc(host); if ((unsigned long )ap == (unsigned long )((struct ata_port *)0)) { return ((struct ata_port *)0); } else { } ap->port_no = 0U; ap->lock = & host->lock; ap->pio_mask = (unsigned int )port_info->pio_mask; ap->mwdma_mask = (unsigned int )port_info->mwdma_mask; ap->udma_mask = (unsigned int )port_info->udma_mask; ap->flags = ap->flags | port_info->flags; ap->ops = port_info->port_ops; ap->cbl = 6U; return (ap); } } static char const __kstrtab_ata_sas_port_alloc[19U] = { 'a', 't', 'a', '_', 's', 'a', 's', '_', 'p', 'o', 'r', 't', '_', 'a', 'l', 'l', 'o', 'c', '\000'}; struct kernel_symbol const __ksymtab_ata_sas_port_alloc ; struct kernel_symbol const __ksymtab_ata_sas_port_alloc = {(unsigned long )(& ata_sas_port_alloc), (char const *)(& __kstrtab_ata_sas_port_alloc)}; int ata_sas_port_start(struct ata_port *ap ) { { if ((unsigned long )(ap->ops)->error_handler == (unsigned long )((void (*)(struct ata_port * ))0)) { ap->pflags = ap->pflags & 4294967291U; } else { } return (0); } } static char const __kstrtab_ata_sas_port_start[19U] = { 'a', 't', 'a', '_', 's', 'a', 's', '_', 'p', 'o', 'r', 't', '_', 's', 't', 'a', 'r', 't', '\000'}; struct kernel_symbol const __ksymtab_ata_sas_port_start ; struct kernel_symbol const __ksymtab_ata_sas_port_start = {(unsigned long )(& ata_sas_port_start), (char const *)(& __kstrtab_ata_sas_port_start)}; void ata_sas_port_stop(struct ata_port *ap ) { { return; } } static char const __kstrtab_ata_sas_port_stop[18U] = { 'a', 't', 'a', '_', 's', 'a', 's', '_', 'p', 'o', 'r', 't', '_', 's', 't', 'o', 'p', '\000'}; struct kernel_symbol const __ksymtab_ata_sas_port_stop ; struct kernel_symbol const __ksymtab_ata_sas_port_stop = {(unsigned long )(& ata_sas_port_stop), (char const *)(& __kstrtab_ata_sas_port_stop)}; void ata_sas_async_probe(struct ata_port *ap ) { { __ata_port_probe(ap); return; } } static char const __kstrtab_ata_sas_async_probe[20U] = { 'a', 't', 'a', '_', 's', 'a', 's', '_', 'a', 's', 'y', 'n', 'c', '_', 'p', 'r', 'o', 'b', 'e', '\000'}; struct kernel_symbol const __ksymtab_ata_sas_async_probe ; struct kernel_symbol const __ksymtab_ata_sas_async_probe = {(unsigned long )(& ata_sas_async_probe), (char const *)(& __kstrtab_ata_sas_async_probe)}; int ata_sas_sync_probe(struct ata_port *ap ) { int tmp ; { tmp = ata_port_probe(ap); return (tmp); } } static char const __kstrtab_ata_sas_sync_probe[19U] = { 'a', 't', 'a', '_', 's', 'a', 's', '_', 's', 'y', 'n', 'c', '_', 'p', 'r', 'o', 'b', 'e', '\000'}; struct kernel_symbol const __ksymtab_ata_sas_sync_probe ; struct kernel_symbol const __ksymtab_ata_sas_sync_probe = {(unsigned long )(& ata_sas_sync_probe), (char const *)(& __kstrtab_ata_sas_sync_probe)}; int ata_sas_port_init(struct ata_port *ap ) { int rc ; int tmp ; int tmp___0 ; { tmp = (*((ap->ops)->port_start))(ap); rc = tmp; if (rc != 0) { return (rc); } else { } tmp___0 = atomic_add_return(1, & ata_print_id); ap->print_id = (unsigned int )tmp___0; return (0); } } static char const __kstrtab_ata_sas_port_init[18U] = { 'a', 't', 'a', '_', 's', 'a', 's', '_', 'p', 'o', 'r', 't', '_', 'i', 'n', 'i', 't', '\000'}; struct kernel_symbol const __ksymtab_ata_sas_port_init ; struct kernel_symbol const __ksymtab_ata_sas_port_init = {(unsigned long )(& ata_sas_port_init), (char const *)(& __kstrtab_ata_sas_port_init)}; void ata_sas_port_destroy(struct ata_port *ap ) { { if ((unsigned long )(ap->ops)->port_stop != (unsigned long )((void (*)(struct ata_port * ))0)) { (*((ap->ops)->port_stop))(ap); } else { } kfree((void const *)ap); return; } } static char const __kstrtab_ata_sas_port_destroy[21U] = { 'a', 't', 'a', '_', 's', 'a', 's', '_', 'p', 'o', 'r', 't', '_', 'd', 'e', 's', 't', 'r', 'o', 'y', '\000'}; struct kernel_symbol const __ksymtab_ata_sas_port_destroy ; struct kernel_symbol const __ksymtab_ata_sas_port_destroy = {(unsigned long )(& ata_sas_port_destroy), (char const *)(& __kstrtab_ata_sas_port_destroy)}; int ata_sas_slave_configure(struct scsi_device *sdev , struct ata_port *ap ) { { ata_scsi_sdev_config(sdev); ata_scsi_dev_config(sdev, (struct ata_device *)(& ap->link.device)); return (0); } } static char const __kstrtab_ata_sas_slave_configure[24U] = { 'a', 't', 'a', '_', 's', 'a', 's', '_', 's', 'l', 'a', 'v', 'e', '_', 'c', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'e', '\000'}; struct kernel_symbol const __ksymtab_ata_sas_slave_configure ; struct kernel_symbol const __ksymtab_ata_sas_slave_configure = {(unsigned long )(& ata_sas_slave_configure), (char const *)(& __kstrtab_ata_sas_slave_configure)}; int ata_sas_queuecmd(struct scsi_cmnd *cmd , struct ata_port *ap ) { int rc ; unsigned int tmp ; long tmp___0 ; { rc = 0; ata_scsi_dump_cdb(ap, cmd); tmp = ata_dev_enabled((struct ata_device const *)(& ap->link.device)); tmp___0 = ldv__builtin_expect(tmp != 0U, 1L); if (tmp___0 != 0L) { rc = __ata_scsi_queuecmd(cmd, (struct ata_device *)(& ap->link.device)); } else { cmd->result = 262144; (*(cmd->scsi_done))(cmd); } return (rc); } } static char const __kstrtab_ata_sas_queuecmd[17U] = { 'a', 't', 'a', '_', 's', 'a', 's', '_', 'q', 'u', 'e', 'u', 'e', 'c', 'm', 'd', '\000'}; struct kernel_symbol const __ksymtab_ata_sas_queuecmd ; struct kernel_symbol const __ksymtab_ata_sas_queuecmd = {(unsigned long )(& ata_sas_queuecmd), (char const *)(& __kstrtab_ata_sas_queuecmd)}; int ata_sas_allocate_tag(struct ata_port *ap ) { unsigned int max_queue ; unsigned int i ; unsigned int tag ; int tmp ; { max_queue = (ap->host)->n_tags; i = 0U; tag = ap->sas_last_tag + 1U; goto ldv_44550; ldv_44549: tag = tag < max_queue ? tag : 0U; if (tag == 31U) { goto ldv_44548; } else { } tmp = test_and_set_bit((long )tag, (unsigned long volatile *)(& ap->sas_tag_allocated)); if (tmp == 0) { ap->sas_last_tag = tag; return ((int )tag); } else { } ldv_44548: i = i + 1U; tag = tag + 1U; ldv_44550: ; if (i < max_queue) { goto ldv_44549; } else { } return (-1); } } void ata_sas_free_tag(unsigned int tag , struct ata_port *ap ) { { clear_bit((long )tag, (unsigned long volatile *)(& ap->sas_tag_allocated)); return; } } void ldv_initialize_device_attribute_32(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(48UL); dev_attr_em_message_group0 = (struct device_attribute *)tmp; tmp___0 = ldv_init_zalloc(1416UL); dev_attr_em_message_group1 = (struct device *)tmp___0; return; } } void ldv_initialize_device_attribute_28(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(48UL); dev_attr_sw_activity_group0 = (struct device_attribute *)tmp; tmp___0 = ldv_init_zalloc(1416UL); dev_attr_sw_activity_group1 = (struct device *)tmp___0; return; } } void ldv_initialize_device_attribute_35(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(48UL); dev_attr_link_power_management_policy_group0 = (struct device_attribute *)tmp; tmp___0 = ldv_init_zalloc(1416UL); dev_attr_link_power_management_policy_group1 = (struct device *)tmp___0; return; } } void ldv_initialize_device_attribute_33(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(48UL); dev_attr_unload_heads_group0 = (struct device_attribute *)tmp; tmp___0 = ldv_init_zalloc(1416UL); dev_attr_unload_heads_group1 = (struct device *)tmp___0; return; } } void ldv_initialize_device_attribute_31(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(48UL); dev_attr_em_message_group0 = (struct device_attribute *)tmp; tmp___0 = ldv_init_zalloc(1416UL); dev_attr_em_message_group1 = (struct device *)tmp___0; return; } } void ldv_initialize_device_attribute_36(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(48UL); dev_attr_link_power_management_policy_group0 = (struct device_attribute *)tmp; tmp___0 = ldv_init_zalloc(1416UL); dev_attr_link_power_management_policy_group1 = (struct device *)tmp___0; return; } } void ldv_initialize_device_attribute_34(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(48UL); dev_attr_unload_heads_group0 = (struct device_attribute *)tmp; tmp___0 = ldv_init_zalloc(1416UL); dev_attr_unload_heads_group1 = (struct device *)tmp___0; return; } } void ldv_initialize_device_attribute_27(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(48UL); dev_attr_sw_activity_group0 = (struct device_attribute *)tmp; tmp___0 = ldv_init_zalloc(1416UL); dev_attr_sw_activity_group1 = (struct device *)tmp___0; return; } } void ldv_main_exported_35(void) { char *ldvarg69 ; void *tmp ; size_t ldvarg68 ; char *ldvarg67 ; void *tmp___0 ; int tmp___1 ; { tmp = ldv_init_zalloc(1UL); ldvarg69 = (char *)tmp; tmp___0 = ldv_init_zalloc(1UL); ldvarg67 = (char *)tmp___0; ldv_memset((void *)(& ldvarg68), 0, 8UL); tmp___1 = __VERIFIER_nondet_int(); switch (tmp___1) { case 0: ; if (ldv_state_variable_35 == 1) { ata_scsi_lpm_store(dev_attr_link_power_management_policy_group1, dev_attr_link_power_management_policy_group0, (char const *)ldvarg69, ldvarg68); ldv_state_variable_35 = 1; } else { } goto ldv_44587; case 1: ; if (ldv_state_variable_35 == 1) { ata_scsi_lpm_show(dev_attr_link_power_management_policy_group1, dev_attr_link_power_management_policy_group0, ldvarg67); ldv_state_variable_35 = 1; } else { } goto ldv_44587; default: ldv_stop(); } ldv_44587: ; return; } } void ldv_main_exported_27(void) { char *ldvarg33 ; void *tmp ; char *ldvarg31 ; void *tmp___0 ; size_t ldvarg32 ; int tmp___1 ; { tmp = ldv_init_zalloc(1UL); ldvarg33 = (char *)tmp; tmp___0 = ldv_init_zalloc(1UL); ldvarg31 = (char *)tmp___0; ldv_memset((void *)(& ldvarg32), 0, 8UL); tmp___1 = __VERIFIER_nondet_int(); switch (tmp___1) { case 0: ; if (ldv_state_variable_27 == 1) { ata_scsi_activity_store(dev_attr_sw_activity_group1, dev_attr_sw_activity_group0, (char const *)ldvarg33, ldvarg32); ldv_state_variable_27 = 1; } else { } goto ldv_44597; case 1: ; if (ldv_state_variable_27 == 1) { ata_scsi_activity_show(dev_attr_sw_activity_group1, dev_attr_sw_activity_group0, ldvarg31); ldv_state_variable_27 = 1; } else { } goto ldv_44597; default: ldv_stop(); } ldv_44597: ; return; } } void ldv_main_exported_33(void) { char *ldvarg2 ; void *tmp ; char *ldvarg0 ; void *tmp___0 ; size_t ldvarg1 ; int tmp___1 ; { tmp = ldv_init_zalloc(1UL); ldvarg2 = (char *)tmp; tmp___0 = ldv_init_zalloc(1UL); ldvarg0 = (char *)tmp___0; ldv_memset((void *)(& ldvarg1), 0, 8UL); tmp___1 = __VERIFIER_nondet_int(); switch (tmp___1) { case 0: ; if (ldv_state_variable_33 == 1) { ata_scsi_park_store(dev_attr_unload_heads_group1, dev_attr_unload_heads_group0, (char const *)ldvarg2, ldvarg1); ldv_state_variable_33 = 1; } else { } goto ldv_44607; case 1: ; if (ldv_state_variable_33 == 1) { ata_scsi_park_show(dev_attr_unload_heads_group1, dev_attr_unload_heads_group0, ldvarg0); ldv_state_variable_33 = 1; } else { } goto ldv_44607; default: ldv_stop(); } ldv_44607: ; return; } } void ldv_main_exported_32(void) { char *ldvarg5 ; void *tmp ; char *ldvarg3 ; void *tmp___0 ; size_t ldvarg4 ; int tmp___1 ; { tmp = ldv_init_zalloc(1UL); ldvarg5 = (char *)tmp; tmp___0 = ldv_init_zalloc(1UL); ldvarg3 = (char *)tmp___0; ldv_memset((void *)(& ldvarg4), 0, 8UL); tmp___1 = __VERIFIER_nondet_int(); switch (tmp___1) { case 0: ; if (ldv_state_variable_32 == 1) { ata_scsi_em_message_store(dev_attr_em_message_group1, dev_attr_em_message_group0, (char const *)ldvarg5, ldvarg4); ldv_state_variable_32 = 1; } else { } goto ldv_44617; case 1: ; if (ldv_state_variable_32 == 1) { ata_scsi_em_message_show(dev_attr_em_message_group1, dev_attr_em_message_group0, ldvarg3); ldv_state_variable_32 = 1; } else { } goto ldv_44617; default: ldv_stop(); } ldv_44617: ; return; } } void ldv_main_exported_28(void) { size_t ldvarg38 ; char *ldvarg37 ; void *tmp ; char *ldvarg39 ; void *tmp___0 ; int tmp___1 ; { tmp = ldv_init_zalloc(1UL); ldvarg37 = (char *)tmp; tmp___0 = ldv_init_zalloc(1UL); ldvarg39 = (char *)tmp___0; ldv_memset((void *)(& ldvarg38), 0, 8UL); tmp___1 = __VERIFIER_nondet_int(); switch (tmp___1) { case 0: ; if (ldv_state_variable_28 == 1) { ata_scsi_activity_store(dev_attr_sw_activity_group1, dev_attr_sw_activity_group0, (char const *)ldvarg39, ldvarg38); ldv_state_variable_28 = 1; } else { } goto ldv_44627; case 1: ; if (ldv_state_variable_28 == 1) { ata_scsi_activity_show(dev_attr_sw_activity_group1, dev_attr_sw_activity_group0, ldvarg37); ldv_state_variable_28 = 1; } else { } goto ldv_44627; default: ldv_stop(); } ldv_44627: ; return; } } void ldv_main_exported_36(void) { char *ldvarg115 ; void *tmp ; size_t ldvarg114 ; char *ldvarg113 ; void *tmp___0 ; int tmp___1 ; { tmp = ldv_init_zalloc(1UL); ldvarg115 = (char *)tmp; tmp___0 = ldv_init_zalloc(1UL); ldvarg113 = (char *)tmp___0; ldv_memset((void *)(& ldvarg114), 0, 8UL); tmp___1 = __VERIFIER_nondet_int(); switch (tmp___1) { case 0: ; if (ldv_state_variable_36 == 1) { ata_scsi_lpm_store(dev_attr_link_power_management_policy_group1, dev_attr_link_power_management_policy_group0, (char const *)ldvarg115, ldvarg114); ldv_state_variable_36 = 1; } else { } goto ldv_44637; case 1: ; if (ldv_state_variable_36 == 1) { ata_scsi_lpm_show(dev_attr_link_power_management_policy_group1, dev_attr_link_power_management_policy_group0, ldvarg113); ldv_state_variable_36 = 1; } else { } goto ldv_44637; default: ldv_stop(); } ldv_44637: ; return; } } void ldv_main_exported_34(void) { size_t ldvarg137 ; char *ldvarg138 ; void *tmp ; char *ldvarg136 ; void *tmp___0 ; int tmp___1 ; { tmp = ldv_init_zalloc(1UL); ldvarg138 = (char *)tmp; tmp___0 = ldv_init_zalloc(1UL); ldvarg136 = (char *)tmp___0; ldv_memset((void *)(& ldvarg137), 0, 8UL); tmp___1 = __VERIFIER_nondet_int(); switch (tmp___1) { case 0: ; if (ldv_state_variable_34 == 1) { ata_scsi_park_store(dev_attr_unload_heads_group1, dev_attr_unload_heads_group0, (char const *)ldvarg138, ldvarg137); ldv_state_variable_34 = 1; } else { } goto ldv_44647; case 1: ; if (ldv_state_variable_34 == 1) { ata_scsi_park_show(dev_attr_unload_heads_group1, dev_attr_unload_heads_group0, ldvarg136); ldv_state_variable_34 = 1; } else { } goto ldv_44647; default: ldv_stop(); } ldv_44647: ; return; } } void ldv_main_exported_30(void) { struct device *ldvarg23 ; void *tmp ; struct device_attribute *ldvarg25 ; void *tmp___0 ; char *ldvarg24 ; void *tmp___1 ; int tmp___2 ; { tmp = ldv_init_zalloc(1416UL); ldvarg23 = (struct device *)tmp; tmp___0 = ldv_init_zalloc(48UL); ldvarg25 = (struct device_attribute *)tmp___0; tmp___1 = ldv_init_zalloc(1UL); ldvarg24 = (char *)tmp___1; tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_30 == 1) { ata_scsi_em_message_type_show(ldvarg23, ldvarg25, ldvarg24); ldv_state_variable_30 = 1; } else { } goto ldv_44657; default: ldv_stop(); } ldv_44657: ; return; } } void ldv_main_exported_29(void) { struct device *ldvarg100 ; void *tmp ; char *ldvarg101 ; void *tmp___0 ; struct device_attribute *ldvarg102 ; void *tmp___1 ; int tmp___2 ; { tmp = ldv_init_zalloc(1416UL); ldvarg100 = (struct device *)tmp; tmp___0 = ldv_init_zalloc(1UL); ldvarg101 = (char *)tmp___0; tmp___1 = ldv_init_zalloc(48UL); ldvarg102 = (struct device_attribute *)tmp___1; tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_29 == 1) { ata_scsi_em_message_type_show(ldvarg100, ldvarg102, ldvarg101); ldv_state_variable_29 = 1; } else { } goto ldv_44666; default: ldv_stop(); } ldv_44666: ; return; } } void ldv_main_exported_31(void) { char *ldvarg64 ; void *tmp ; char *ldvarg66 ; void *tmp___0 ; size_t ldvarg65 ; int tmp___1 ; { tmp = ldv_init_zalloc(1UL); ldvarg64 = (char *)tmp; tmp___0 = ldv_init_zalloc(1UL); ldvarg66 = (char *)tmp___0; ldv_memset((void *)(& ldvarg65), 0, 8UL); tmp___1 = __VERIFIER_nondet_int(); switch (tmp___1) { case 0: ; if (ldv_state_variable_31 == 1) { ata_scsi_em_message_store(dev_attr_em_message_group1, dev_attr_em_message_group0, (char const *)ldvarg66, ldvarg65); ldv_state_variable_31 = 1; } else { } goto ldv_44675; case 1: ; if (ldv_state_variable_31 == 1) { ata_scsi_em_message_show(dev_attr_em_message_group1, dev_attr_em_message_group0, ldvarg64); ldv_state_variable_31 = 1; } else { } goto ldv_44675; default: ldv_stop(); } ldv_44675: ; return; } } bool ldv_queue_work_on_21(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_22(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_23(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_24(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_25(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; extern int vscnprintf(char * , size_t , char const * , va_list * ) ; __inline static int list_empty(struct list_head const *head ) { { return ((unsigned long )((struct list_head const *)head->next) == (unsigned long )head); } } __inline static void __list_splice(struct list_head const *list , struct list_head *prev , struct list_head *next ) { struct list_head *first ; struct list_head *last ; { first = list->next; last = list->prev; first->prev = prev; prev->next = first; last->next = next; next->prev = last; return; } } __inline static void list_splice_init(struct list_head *list , struct list_head *head ) { int tmp ; { tmp = list_empty((struct list_head const *)list); if (tmp == 0) { __list_splice((struct list_head const *)list, head, head->next); INIT_LIST_HEAD(list); } else { } return; } } __inline static unsigned long arch_local_save_flags___0(void) { unsigned long __ret ; unsigned long __edi ; unsigned long __esi ; unsigned long __edx ; unsigned long __ecx ; unsigned long __eax ; long tmp ; { __edi = __edi; __esi = __esi; __edx = __edx; __ecx = __ecx; __eax = __eax; tmp = ldv__builtin_expect((unsigned long )pv_irq_ops.save_fl.func == (unsigned long )((void *)0), 0L); if (tmp != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"./arch/x86/include/asm/paravirt.h"), "i" (831), "i" (12UL)); ldv_4860: ; goto ldv_4860; } else { } __asm__ volatile ("771:\n\tcall *%c2;\n772:\n.pushsection .parainstructions,\"a\"\n .balign 8 \n .quad 771b\n .byte %c1\n .byte 772b-771b\n .short %c3\n.popsection\n": "=a" (__eax): [paravirt_typenum] "i" (43UL), [paravirt_opptr] "i" (& pv_irq_ops.save_fl.func), [paravirt_clobber] "i" (1): "memory", "cc"); __ret = __eax; return (__ret); } } __inline static void rep_nop(void) { { __asm__ volatile ("rep; nop": : : "memory"); return; } } __inline static void cpu_relax(void) { { rep_nop(); return; } } __inline static bool static_key_false___0(struct static_key *key ) { int tmp ; long tmp___0 ; { tmp = static_key_count(key); tmp___0 = ldv__builtin_expect(tmp > 0, 0L); if (tmp___0 != 0L) { return (1); } else { } return (0); } } __inline static void queued_spin_unlock_wait(struct qspinlock *lock ) { int tmp ; { goto ldv_6470; ldv_6469: cpu_relax(); ldv_6470: tmp = atomic_read((atomic_t const *)(& lock->val)); if (((unsigned int )tmp & 255U) != 0U) { goto ldv_6469; } else { } return; } } __inline static void spin_unlock_wait(spinlock_t *lock ) { { queued_spin_unlock_wait(& lock->__annonCompField18.rlock.raw_lock); return; } } extern void __wake_up(wait_queue_head_t * , unsigned int , int , void * ) ; extern void prepare_to_wait(wait_queue_head_t * , wait_queue_t * , int ) ; extern void finish_wait(wait_queue_head_t * , wait_queue_t * ) ; extern int autoremove_wake_function(wait_queue_t * , unsigned int , int , void * ) ; __inline static void reinit_completion(struct completion *x ) { { x->done = 0U; return; } } __inline static u64 get_jiffies_64(void) { { return ((u64 )jiffies); } } __inline static int rcu_read_lock_sched_held___0(void) { int lockdep_opinion ; int tmp ; bool tmp___0 ; int tmp___1 ; bool tmp___2 ; int tmp___3 ; int tmp___4 ; unsigned long _flags ; int tmp___5 ; int tmp___6 ; { lockdep_opinion = 0; tmp = debug_lockdep_rcu_enabled(); if (tmp == 0) { return (1); } else { } tmp___0 = rcu_is_watching(); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { return (0); } else { } tmp___2 = rcu_lockdep_current_cpu_online(); if (tmp___2) { tmp___3 = 0; } else { tmp___3 = 1; } if (tmp___3) { return (0); } else { } if (debug_locks != 0) { lockdep_opinion = lock_is_held(& rcu_sched_lock_map); } else { } if (lockdep_opinion != 0) { tmp___6 = 1; } else { tmp___4 = preempt_count(); if (tmp___4 != 0) { tmp___6 = 1; } else { _flags = arch_local_save_flags___0(); tmp___5 = arch_irqs_disabled_flags(_flags); if (tmp___5 != 0) { tmp___6 = 1; } else { tmp___6 = 0; } } } return (tmp___6); } } extern void add_timer(struct timer_list * ) ; extern int del_timer_sync(struct timer_list * ) ; extern struct workqueue_struct *system_wq ; bool ldv_queue_work_on_35(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_37(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_36(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; bool ldv_queue_delayed_work_on_39(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; void ldv_flush_workqueue_38(struct workqueue_struct *ldv_func_arg1 ) ; __inline static bool queue_work(struct workqueue_struct *wq , struct work_struct *work ) { bool tmp ; { tmp = ldv_queue_work_on_35(8192, wq, work); return (tmp); } } __inline static bool queue_delayed_work___0(struct workqueue_struct *wq , struct delayed_work *dwork , unsigned long delay ) { bool tmp ; { tmp = ldv_queue_delayed_work_on_36(8192, wq, dwork, delay); return (tmp); } } __inline static bool schedule_work(struct work_struct *work ) { bool tmp ; { tmp = queue_work(system_wq, work); return (tmp); } } __inline static bool schedule_delayed_work(struct delayed_work *dwork , unsigned long delay ) { bool tmp ; { tmp = queue_delayed_work___0(system_wq, dwork, delay); return (tmp); } } extern long schedule_timeout_uninterruptible(long ) ; extern void schedule(void) ; extern void blk_abort_request(struct request * ) ; __inline static int scsi_host_in_recovery(struct Scsi_Host *shost ) { { return ((((unsigned int )shost->shost_state == 5U || (unsigned int )shost->shost_state == 6U) || (unsigned int )shost->shost_state == 7U) || (unsigned int )*((unsigned char *)shost + 856UL) != 0U); } } extern void scsi_eh_finish_cmd(struct scsi_cmnd * , struct list_head * ) ; extern void scsi_eh_flush_done_q(struct list_head * ) ; extern size_t __scsi_format_command(char * , size_t , unsigned char const * , size_t ) ; extern void scsi_schedule_eh(struct Scsi_Host * ) ; __inline static bool ata_id_has_hipm(u16 const *id ) { u16 val ; { val = *(id + 76UL); if ((unsigned int )val == 0U || (unsigned int )val == 65535U) { return (0); } else { } return (((int )val & 512) != 0); } } __inline static bool ata_id_has_dipm(u16 const *id ) { u16 val ; { val = *(id + 78UL); if ((unsigned int )val == 0U || (unsigned int )val == 65535U) { return (0); } else { } return (((int )val & 8) != 0); } } __inline static bool ata_id_has_read_log_dma_ext(u16 const *id ) { { if ((int )((short )*(id + 86UL)) >= 0) { return (0); } else { } if (((int )*(id + 119UL) & 49160) == 16392 || ((int )*(id + 120UL) & 49160) == 16392) { return (1); } else { } return (0); } } __inline static int ata_is_atapi(u8 prot ) { unsigned int tmp ; { tmp = ata_prot_flags((int )prot); return ((int )tmp & 8); } } void ata_scsi_port_error_handler(struct Scsi_Host *host , struct ata_port *ap ) ; void ata_scsi_cmd_error_handler(struct Scsi_Host *host , struct ata_port *ap , struct list_head *eh_work_q ) ; __inline static void ata_ehi_hotplugged(struct ata_eh_info *ehi ) { { ehi->probe_mask = ehi->probe_mask | 3U; ehi->flags = ehi->flags | 1U; ehi->action = ehi->action | 14U; ehi->err_mask = ehi->err_mask | 16U; return; } } __inline static void trace_ata_eh_link_autopsy(struct ata_device *dev , unsigned int eh_action , unsigned int eh_err_mask ) { struct tracepoint_func *it_func_ptr ; void *it_func ; void *__data ; struct tracepoint_func *________p1 ; struct tracepoint_func *_________p1 ; union __anonunion___u_302___0 __u ; bool __warned ; int tmp ; int tmp___0 ; bool tmp___1 ; struct tracepoint_func *________p1___0 ; struct tracepoint_func *_________p1___0 ; union __anonunion___u_304___0 __u___0 ; bool __warned___0 ; int tmp___2 ; int tmp___3 ; { tmp___1 = static_key_false___0(& __tracepoint_ata_eh_link_autopsy.key); if ((int )tmp___1) { rcu_read_lock_sched_notrace(); __read_once_size((void const volatile *)(& __tracepoint_ata_eh_link_autopsy.funcs), (void *)(& __u.__c), 8); _________p1 = __u.__val; ________p1 = _________p1; tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { tmp___0 = rcu_read_lock_sched_held___0(); if (tmp___0 == 0) { __warned = 1; lockdep_rcu_suspicious("include/trace/events/libata.h", 292, "suspicious rcu_dereference_check() usage"); } else { } } else { } it_func_ptr = ________p1; if ((unsigned long )it_func_ptr != (unsigned long )((struct tracepoint_func *)0)) { ldv_43705: it_func = it_func_ptr->func; __data = it_func_ptr->data; (*((void (*)(void * , struct ata_device * , unsigned int , unsigned int ))it_func))(__data, dev, eh_action, eh_err_mask); it_func_ptr = it_func_ptr + 1; if ((unsigned long )it_func_ptr->func != (unsigned long )((void *)0)) { goto ldv_43705; } else { } } else { } rcu_read_unlock_sched_notrace(); } else { } rcu_read_lock_sched_notrace(); __read_once_size((void const volatile *)(& __tracepoint_ata_eh_link_autopsy.funcs), (void *)(& __u___0.__c), 8); _________p1___0 = __u___0.__val; ________p1___0 = _________p1___0; tmp___2 = debug_lockdep_rcu_enabled(); if (tmp___2 != 0 && ! __warned___0) { tmp___3 = rcu_read_lock_sched_held___0(); if (tmp___3 == 0) { __warned___0 = 1; lockdep_rcu_suspicious("include/trace/events/libata.h", 292, "suspicious rcu_dereference_check() usage"); } else { } } else { } rcu_read_unlock_sched_notrace(); return; } } __inline static void trace_ata_eh_link_autopsy_qc(struct ata_queued_cmd *qc ) { struct tracepoint_func *it_func_ptr ; void *it_func ; void *__data ; struct tracepoint_func *________p1 ; struct tracepoint_func *_________p1 ; union __anonunion___u_306___0 __u ; bool __warned ; int tmp ; int tmp___0 ; bool tmp___1 ; struct tracepoint_func *________p1___0 ; struct tracepoint_func *_________p1___0 ; union __anonunion___u_308___0 __u___0 ; bool __warned___0 ; int tmp___2 ; int tmp___3 ; { tmp___1 = static_key_false___0(& __tracepoint_ata_eh_link_autopsy_qc.key); if ((int )tmp___1) { rcu_read_lock_sched_notrace(); __read_once_size((void const volatile *)(& __tracepoint_ata_eh_link_autopsy_qc.funcs), (void *)(& __u.__c), 8); _________p1 = __u.__val; ________p1 = _________p1; tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { tmp___0 = rcu_read_lock_sched_held___0(); if (tmp___0 == 0) { __warned = 1; lockdep_rcu_suspicious("include/trace/events/libata.h", 320, "suspicious rcu_dereference_check() usage"); } else { } } else { } it_func_ptr = ________p1; if ((unsigned long )it_func_ptr != (unsigned long )((struct tracepoint_func *)0)) { ldv_43762: it_func = it_func_ptr->func; __data = it_func_ptr->data; (*((void (*)(void * , struct ata_queued_cmd * ))it_func))(__data, qc); it_func_ptr = it_func_ptr + 1; if ((unsigned long )it_func_ptr->func != (unsigned long )((void *)0)) { goto ldv_43762; } else { } } else { } rcu_read_unlock_sched_notrace(); } else { } rcu_read_lock_sched_notrace(); __read_once_size((void const volatile *)(& __tracepoint_ata_eh_link_autopsy_qc.funcs), (void *)(& __u___0.__c), 8); _________p1___0 = __u___0.__val; ________p1___0 = _________p1___0; tmp___2 = debug_lockdep_rcu_enabled(); if (tmp___2 != 0 && ! __warned___0) { tmp___3 = rcu_read_lock_sched_held___0(); if (tmp___3 == 0) { __warned___0 = 1; lockdep_rcu_suspicious("include/trace/events/libata.h", 320, "suspicious rcu_dereference_check() usage"); } else { } } else { } rcu_read_unlock_sched_notrace(); return; } } int ata_acpi_on_suspend(struct ata_port *ap ) ; void ata_acpi_on_resume(struct ata_port *ap ) ; void ata_acpi_on_disable(struct ata_device *dev ) ; void ata_acpi_set_state(struct ata_port *ap , pm_message_t state ) ; enum blk_eh_timer_return ata_scsi_timed_out(struct scsi_cmnd *cmd ) ; void ata_scsi_error(struct Scsi_Host *host ) ; void ata_eh_detach_dev(struct ata_device *dev ) ; void ata_eh_about_to_do(struct ata_link *link , struct ata_device *dev , unsigned int action ) ; void ata_eh_done(struct ata_link *link , struct ata_device *dev , unsigned int action ) ; void ata_eh_autopsy(struct ata_port *ap ) ; char const *ata_get_cmd_descript(u8 command ) ; void ata_eh_report(struct ata_port *ap ) ; int ata_eh_reset(struct ata_link *link , int classify , int (*prereset)(struct ata_link * , unsigned long ) , int (*softreset)(struct ata_link * , unsigned int * , unsigned long ) , int (*hardreset)(struct ata_link * , unsigned int * , unsigned long ) , void (*postreset)(struct ata_link * , unsigned int * ) ) ; int ata_eh_recover(struct ata_port *ap , int (*prereset)(struct ata_link * , unsigned long ) , int (*softreset)(struct ata_link * , unsigned int * , unsigned long ) , int (*hardreset)(struct ata_link * , unsigned int * , unsigned long ) , void (*postreset)(struct ata_link * , unsigned int * ) , struct ata_link **r_failed_link ) ; void ata_eh_finish(struct ata_port *ap ) ; int ata_ering_map(struct ata_ering *ering , int (*map_fn)(struct ata_ering_entry * , void * ) , void *arg ) ; unsigned int atapi_eh_tur(struct ata_device *dev , u8 *r_sense_key ) ; unsigned int atapi_eh_request_sense(struct ata_device *dev , u8 *sense_buf , u8 dfl_sense_key ) ; int sata_pmp_set_lpm(struct ata_link *link , enum ata_lpm_policy policy , unsigned int hints ) ; int sata_pmp_attach(struct ata_device *dev ) ; void zpodd_on_suspend(struct ata_device *dev ) ; void zpodd_post_poweron(struct ata_device *dev ) ; static unsigned long const ata_eh_reset_timeouts[5U] = { 10000UL, 10000UL, 35000UL, 5000UL, 0xffffffffffffffffUL}; static unsigned long const ata_eh_identify_timeouts[4U] = { 5000UL, 10000UL, 30000UL, 0xffffffffffffffffUL}; static unsigned long const ata_eh_flush_timeouts[4U] = { 15000UL, 15000UL, 30000UL, 0xffffffffffffffffUL}; static unsigned long const ata_eh_other_timeouts[3U] = { 5000UL, 10000UL, 0xffffffffffffffffUL}; static u8 const __constr_expr_0[3] = { 236U, 161U, 0U}; static u8 const __constr_expr_1[3] = { 248U, 39U, 0U}; static u8 const __constr_expr_2[3] = { 249U, 55U, 0U}; static u8 const __constr_expr_3[2] = { 239U, 0U}; static u8 const __constr_expr_4[2] = { 145U, 0U}; static u8 const __constr_expr_5[3] = { 231U, 234U, 0U}; static struct ata_eh_cmd_timeout_ent const ata_eh_cmd_timeout_table[6U] = { {(u8 const *)(& __constr_expr_0), (unsigned long const *)(& ata_eh_identify_timeouts)}, {(u8 const *)(& __constr_expr_1), (unsigned long const *)(& ata_eh_other_timeouts)}, {(u8 const *)(& __constr_expr_2), (unsigned long const *)(& ata_eh_other_timeouts)}, {(u8 const *)(& __constr_expr_3), (unsigned long const *)(& ata_eh_other_timeouts)}, {(u8 const *)(& __constr_expr_4), (unsigned long const *)(& ata_eh_other_timeouts)}, {(u8 const *)(& __constr_expr_5), (unsigned long const *)(& ata_eh_flush_timeouts)}}; static void __ata_port_freeze(struct ata_port *ap ) ; static void ata_eh_handle_port_suspend(struct ata_port *ap ) ; static void ata_eh_handle_port_resume(struct ata_port *ap ) ; static void __ata_ehi_pushv_desc(struct ata_eh_info *ehi , char const *fmt , va_list *args ) { int tmp ; { tmp = vscnprintf((char *)(& ehi->desc) + (unsigned long )ehi->desc_len, (size_t )(80 - ehi->desc_len), fmt, args); ehi->desc_len = ehi->desc_len + tmp; return; } } void __ata_ehi_push_desc(struct ata_eh_info *ehi , char const *fmt , ...) { va_list args ; { ldv__builtin_va_start((va_list *)(& args)); __ata_ehi_pushv_desc(ehi, fmt, (va_list *)(& args)); ldv__builtin_va_end((va_list *)(& args)); return; } } void ata_ehi_push_desc(struct ata_eh_info *ehi , char const *fmt , ...) { va_list args ; { if (ehi->desc_len != 0) { __ata_ehi_push_desc(ehi, ", "); } else { } ldv__builtin_va_start((va_list *)(& args)); __ata_ehi_pushv_desc(ehi, fmt, (va_list *)(& args)); ldv__builtin_va_end((va_list *)(& args)); return; } } void ata_ehi_clear_desc(struct ata_eh_info *ehi ) { { ehi->desc[0] = 0; ehi->desc_len = 0; return; } } void ata_port_desc(struct ata_port *ap , char const *fmt , ...) { va_list args ; int __ret_warn_on ; long tmp ; { __ret_warn_on = (ap->pflags & 128U) == 0U; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-eh.c", 260); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); if (ap->link.eh_info.desc_len != 0) { __ata_ehi_push_desc(& ap->link.eh_info, " "); } else { } ldv__builtin_va_start((va_list *)(& args)); __ata_ehi_pushv_desc(& ap->link.eh_info, fmt, (va_list *)(& args)); ldv__builtin_va_end((va_list *)(& args)); return; } } void ata_port_pbar_desc(struct ata_port *ap , int bar , ssize_t offset , char const *name ) { struct pci_dev *pdev ; struct device const *__mptr ; char *type ; unsigned long long start ; unsigned long long len ; { __mptr = (struct device const *)(ap->host)->dev; pdev = (struct pci_dev *)__mptr + 0xffffffffffffff68UL; type = (char *)""; if ((pdev->resource[bar].flags & 512UL) != 0UL) { type = (char *)"m"; } else if ((pdev->resource[bar].flags & 256UL) != 0UL) { type = (char *)"i"; } else { } start = pdev->resource[bar].start; len = pdev->resource[bar].start != 0ULL || pdev->resource[bar].end != pdev->resource[bar].start ? (pdev->resource[bar].end - pdev->resource[bar].start) + 1ULL : 0ULL; if (offset < 0L) { ata_port_desc(ap, "%s %s%llu@0x%llx", name, type, len, start); } else { ata_port_desc(ap, "%s 0x%llx", name, start + (unsigned long long )offset); } return; } } static int ata_lookup_timeout_table(u8 cmd ) { int i ; u8 const *cur ; { i = 0; goto ldv_44178; ldv_44177: cur = ata_eh_cmd_timeout_table[i].commands; goto ldv_44175; ldv_44174: ; if ((int )((unsigned char )*cur) == (int )cmd) { return (i); } else { } cur = cur + 1; ldv_44175: ; if ((unsigned int )((unsigned char )*cur) != 0U) { goto ldv_44174; } else { } i = i + 1; ldv_44178: ; if (i <= 5) { goto ldv_44177; } else { } return (-1); } } unsigned long ata_internal_cmd_timeout(struct ata_device *dev , u8 cmd ) { struct ata_eh_context *ehc ; int ent ; int tmp ; int idx ; { ehc = & (dev->link)->eh_context; tmp = ata_lookup_timeout_table((int )cmd); ent = tmp; if (ent < 0) { return (5000UL); } else { } idx = ehc->cmd_timeout_idx[dev->devno][ent]; return ((unsigned long )*(ata_eh_cmd_timeout_table[ent].timeouts + (unsigned long )idx)); } } void ata_internal_cmd_timed_out(struct ata_device *dev , u8 cmd ) { struct ata_eh_context *ehc ; int ent ; int tmp ; int idx ; { ehc = & (dev->link)->eh_context; tmp = ata_lookup_timeout_table((int )cmd); ent = tmp; if (ent < 0) { return; } else { } idx = ehc->cmd_timeout_idx[dev->devno][ent]; if ((unsigned long )*(ata_eh_cmd_timeout_table[ent].timeouts + ((unsigned long )idx + 1UL)) != 0xffffffffffffffffUL) { ehc->cmd_timeout_idx[dev->devno][ent] = ehc->cmd_timeout_idx[dev->devno][ent] + 1; } else { } return; } } static void ata_ering_record(struct ata_ering *ering , unsigned int eflags , unsigned int err_mask ) { struct ata_ering_entry *ent ; int __ret_warn_on ; long tmp ; { __ret_warn_on = err_mask == 0U; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-eh.c", 383); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); ering->cursor = ering->cursor + 1; ering->cursor = ering->cursor % 32; ent = (struct ata_ering_entry *)(& ering->ring) + (unsigned long )ering->cursor; ent->eflags = eflags; ent->err_mask = err_mask; ent->timestamp = get_jiffies_64(); return; } } static struct ata_ering_entry *ata_ering_top(struct ata_ering *ering ) { struct ata_ering_entry *ent ; { ent = (struct ata_ering_entry *)(& ering->ring) + (unsigned long )ering->cursor; if (ent->err_mask != 0U) { return (ent); } else { } return ((struct ata_ering_entry *)0); } } int ata_ering_map(struct ata_ering *ering , int (*map_fn)(struct ata_ering_entry * , void * ) , void *arg ) { int idx ; int rc ; struct ata_ering_entry *ent ; { rc = 0; idx = ering->cursor; ldv_44217: ent = (struct ata_ering_entry *)(& ering->ring) + (unsigned long )idx; if (ent->err_mask == 0U) { goto ldv_44216; } else { } rc = (*map_fn)(ent, arg); if (rc != 0) { goto ldv_44216; } else { } idx = (idx + 31) % 32; if (ering->cursor != idx) { goto ldv_44217; } else { } ldv_44216: ; return (rc); } } static int ata_ering_clear_cb(struct ata_ering_entry *ent , void *void_arg ) { { ent->eflags = ent->eflags | 2147483648U; return (0); } } static void ata_ering_clear(struct ata_ering *ering ) { { ata_ering_map(ering, & ata_ering_clear_cb, (void *)0); return; } } static unsigned int ata_eh_dev_action(struct ata_device *dev ) { struct ata_eh_context *ehc ; { ehc = & (dev->link)->eh_context; return (ehc->i.action | ehc->i.dev_action[dev->devno]); } } static void ata_eh_clear_action(struct ata_link *link , struct ata_device *dev , struct ata_eh_info *ehi , unsigned int action ) { struct ata_device *tdev ; int __ret_warn_on ; long tmp ; { if ((unsigned long )dev == (unsigned long )((struct ata_device *)0)) { ehi->action = ehi->action & ~ action; tdev = ata_dev_next((struct ata_device *)0, link, 2); goto ldv_44237; ldv_44236: ehi->dev_action[tdev->devno] = ehi->dev_action[tdev->devno] & ~ action; tdev = ata_dev_next(tdev, link, 2); ldv_44237: ; if ((unsigned long )tdev != (unsigned long )((struct ata_device *)0)) { goto ldv_44236; } else { } } else { __ret_warn_on = (action & 33U) == 0U; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-eh.c", 453); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); if ((ehi->action & action) != 0U) { tdev = ata_dev_next((struct ata_device *)0, link, 2); goto ldv_44242; ldv_44241: ehi->dev_action[tdev->devno] = ehi->dev_action[tdev->devno] | (ehi->action & action); tdev = ata_dev_next(tdev, link, 2); ldv_44242: ; if ((unsigned long )tdev != (unsigned long )((struct ata_device *)0)) { goto ldv_44241; } else { } ehi->action = ehi->action & ~ action; } else { } ehi->dev_action[dev->devno] = ehi->dev_action[dev->devno] & ~ action; } return; } } void ata_eh_acquire(struct ata_port *ap ) { bool __warned ; int __ret_warn_once ; int __ret_warn_on ; long tmp ; long tmp___0 ; long tmp___1 ; { mutex_lock_nested(& (ap->host)->eh_mutex, 0U); __ret_warn_once = (unsigned long )(ap->host)->eh_owner != (unsigned long )((struct task_struct *)0); tmp___1 = ldv__builtin_expect(__ret_warn_once != 0, 0L); if (tmp___1 != 0L) { __ret_warn_on = ! __warned; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-eh.c", 482); } else { } tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { __warned = 1; } else { } } else { } ldv__builtin_expect(__ret_warn_once != 0, 0L); (ap->host)->eh_owner = get_current(); return; } } void ata_eh_release(struct ata_port *ap ) { bool __warned ; int __ret_warn_once ; struct task_struct *tmp ; int __ret_warn_on ; long tmp___0 ; long tmp___1 ; long tmp___2 ; { tmp = get_current(); __ret_warn_once = (unsigned long )(ap->host)->eh_owner != (unsigned long )tmp; tmp___2 = ldv__builtin_expect(__ret_warn_once != 0, 0L); if (tmp___2 != 0L) { __ret_warn_on = ! __warned; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-eh.c", 498); } else { } tmp___1 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___1 != 0L) { __warned = 1; } else { } } else { } ldv__builtin_expect(__ret_warn_once != 0, 0L); (ap->host)->eh_owner = (struct task_struct *)0; mutex_unlock(& (ap->host)->eh_mutex); return; } } enum blk_eh_timer_return ata_scsi_timed_out(struct scsi_cmnd *cmd ) { struct Scsi_Host *host ; struct ata_port *ap ; struct ata_port *tmp ; unsigned long flags ; struct ata_queued_cmd *qc ; enum blk_eh_timer_return ret ; raw_spinlock_t *tmp___0 ; int __ret_warn_on ; long tmp___1 ; { host = (cmd->device)->host; tmp = ata_shost_to_port(host); ap = tmp; if ((unsigned long )(ap->ops)->error_handler != (unsigned long )((void (*)(struct ata_port * ))0)) { ret = 0; goto out; } else { } ret = 1; tmp___0 = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp___0); qc = ata_qc_from_tag(ap, ap->link.active_tag); if ((unsigned long )qc != (unsigned long )((struct ata_queued_cmd *)0)) { __ret_warn_on = (unsigned long )qc->scsicmd != (unsigned long )cmd; tmp___1 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-eh.c", 541); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); qc->flags = qc->flags | 262144UL; qc->err_mask = qc->err_mask | 4U; ret = 0; } else { } spin_unlock_irqrestore(ap->lock, flags); out: ; return (ret); } } static void ata_eh_unload(struct ata_port *ap ) { struct ata_link *link ; struct ata_device *dev ; unsigned long flags ; raw_spinlock_t *tmp ; { link = ata_link_next((struct ata_link *)0, ap, 2); goto ldv_44284; ldv_44283: sata_scr_write(link, 2, link->saved_scontrol & 4080U); dev = ata_dev_next((struct ata_device *)0, link, 2); goto ldv_44281; ldv_44280: ata_dev_disable(dev); dev = ata_dev_next(dev, link, 2); ldv_44281: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_44280; } else { } link = ata_link_next(link, ap, 2); ldv_44284: ; if ((unsigned long )link != (unsigned long )((struct ata_link *)0)) { goto ldv_44283; } else { } tmp = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp); ata_port_freeze(ap); ap->pflags = ap->pflags & 4294967294U; ap->pflags = ap->pflags | 1024U; spin_unlock_irqrestore(ap->lock, flags); return; } } void ata_scsi_error(struct Scsi_Host *host ) { struct ata_port *ap ; struct ata_port *tmp ; unsigned long flags ; struct list_head eh_work_q ; raw_spinlock_t *tmp___0 ; int __ret_warn_on ; int tmp___1 ; int tmp___2 ; long tmp___3 ; { tmp = ata_shost_to_port(host); ap = tmp; eh_work_q.next = & eh_work_q; eh_work_q.prev = & eh_work_q; tmp___0 = spinlock_check(host->host_lock); flags = _raw_spin_lock_irqsave(tmp___0); list_splice_init(& host->eh_cmd_q, & eh_work_q); spin_unlock_irqrestore(host->host_lock, flags); ata_scsi_cmd_error_handler(host, ap, & eh_work_q); ata_scsi_port_error_handler(host, ap); if (host->host_failed != 0U) { tmp___2 = 1; } else { tmp___1 = list_empty((struct list_head const *)(& eh_work_q)); if (tmp___1 == 0) { tmp___2 = 1; } else { tmp___2 = 0; } } __ret_warn_on = tmp___2; tmp___3 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___3 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-eh.c", 609); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); return; } } void ata_scsi_cmd_error_handler(struct Scsi_Host *host , struct ata_port *ap , struct list_head *eh_work_q ) { int i ; unsigned long flags ; struct scsi_cmnd *scmd ; struct scsi_cmnd *tmp ; int nr_timedout ; raw_spinlock_t *tmp___0 ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct ata_queued_cmd *qc ; struct list_head const *__mptr___1 ; { ata_sff_flush_pio_task(ap); if ((unsigned long )(ap->ops)->error_handler != (unsigned long )((void (*)(struct ata_port * ))0)) { nr_timedout = 0; tmp___0 = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp___0); if ((unsigned long )(ap->ops)->lost_interrupt != (unsigned long )((void (*)(struct ata_port * ))0)) { (*((ap->ops)->lost_interrupt))(ap); } else { } __mptr = (struct list_head const *)eh_work_q->next; scmd = (struct scsi_cmnd *)__mptr + 0xffffffffffffffe8UL; __mptr___0 = (struct list_head const *)scmd->eh_entry.next; tmp = (struct scsi_cmnd *)__mptr___0 + 0xffffffffffffffe8UL; goto ldv_44324; ldv_44323: i = 0; goto ldv_44322; ldv_44321: qc = __ata_qc_from_tag(ap, (unsigned int )i); if ((int )qc->flags & 1 && (unsigned long )qc->scsicmd == (unsigned long )scmd) { goto ldv_44320; } else { } i = i + 1; ldv_44322: ; if (i <= 31) { goto ldv_44321; } else { } ldv_44320: ; if (i <= 31) { if ((qc->flags & 65536UL) == 0UL) { qc->err_mask = qc->err_mask | 4U; qc->flags = qc->flags | 65536UL; nr_timedout = nr_timedout + 1; } else { } } else { scmd->retries = scmd->allowed; scsi_eh_finish_cmd(scmd, & ap->eh_done_q); } scmd = tmp; __mptr___1 = (struct list_head const *)tmp->eh_entry.next; tmp = (struct scsi_cmnd *)__mptr___1 + 0xffffffffffffffe8UL; ldv_44324: ; if ((unsigned long )(& scmd->eh_entry) != (unsigned long )eh_work_q) { goto ldv_44323; } else { } if (nr_timedout != 0) { __ata_port_freeze(ap); } else { } spin_unlock_irqrestore(ap->lock, flags); ap->eh_tries = 5; } else { spin_unlock_wait(ap->lock); } return; } } static char const __kstrtab_ata_scsi_cmd_error_handler[27U] = { 'a', 't', 'a', '_', 's', 'c', 's', 'i', '_', 'c', 'm', 'd', '_', 'e', 'r', 'r', 'o', 'r', '_', 'h', 'a', 'n', 'd', 'l', 'e', 'r', '\000'}; struct kernel_symbol const __ksymtab_ata_scsi_cmd_error_handler ; struct kernel_symbol const __ksymtab_ata_scsi_cmd_error_handler = {(unsigned long )(& ata_scsi_cmd_error_handler), (char const *)(& __kstrtab_ata_scsi_cmd_error_handler)}; void ata_scsi_port_error_handler(struct Scsi_Host *host , struct ata_port *ap ) { unsigned long flags ; struct ata_link *link ; raw_spinlock_t *tmp ; struct ata_eh_context *ehc ; struct ata_device *dev ; int devno ; int tmp___0 ; raw_spinlock_t *tmp___1 ; int __ret_warn_on ; struct ata_queued_cmd *tmp___2 ; long tmp___3 ; raw_spinlock_t *tmp___4 ; { if ((unsigned long )(ap->ops)->error_handler != (unsigned long )((void (*)(struct ata_port * ))0)) { ata_eh_acquire(ap); repeat: del_timer_sync(& ap->fastdrain_timer); ata_eh_handle_port_resume(ap); tmp = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp); link = ata_link_next((struct ata_link *)0, ap, 1); goto ldv_44352; ldv_44351: ehc = & link->eh_context; memset((void *)(& link->eh_context), 0, 208UL); link->eh_context.i = link->eh_info; memset((void *)(& link->eh_info), 0, 120UL); dev = ata_dev_next((struct ata_device *)0, link, 0); goto ldv_44349; ldv_44348: devno = (int )dev->devno; ehc->saved_xfer_mode[devno] = dev->xfer_mode; tmp___0 = ata_ncq_enabled(dev); if (tmp___0 != 0) { ehc->saved_ncq_enabled = ehc->saved_ncq_enabled | (unsigned int )(1 << devno); } else { } dev = ata_dev_next(dev, link, 0); ldv_44349: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_44348; } else { } link = ata_link_next(link, ap, 1); ldv_44352: ; if ((unsigned long )link != (unsigned long )((struct ata_link *)0)) { goto ldv_44351; } else { } ap->pflags = ap->pflags | 2U; ap->pflags = ap->pflags & 4294967294U; ap->excl_link = (struct ata_link *)0; spin_unlock_irqrestore(ap->lock, flags); if ((ap->pflags & 131584U) == 0U) { (*((ap->ops)->error_handler))(ap); } else { if ((ap->pflags & 512U) != 0U && (ap->pflags & 1024U) == 0U) { ata_eh_unload(ap); } else { } ata_eh_finish(ap); } ata_eh_handle_port_suspend(ap); tmp___1 = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp___1); if ((int )ap->pflags & 1) { ap->eh_tries = ap->eh_tries - 1; if (ap->eh_tries != 0) { spin_unlock_irqrestore(ap->lock, flags); goto repeat; } else { } ata_port_printk((struct ata_port const *)ap, "\v", "EH pending after %d tries, giving up\n", 5); ap->pflags = ap->pflags & 4294967294U; } else { } link = ata_link_next((struct ata_link *)0, ap, 1); goto ldv_44358; ldv_44357: memset((void *)(& link->eh_info), 0, 120UL); link = ata_link_next(link, ap, 1); ldv_44358: ; if ((unsigned long )link != (unsigned long )((struct ata_link *)0)) { goto ldv_44357; } else { } (*((ap->ops)->end_eh))(ap); spin_unlock_irqrestore(ap->lock, flags); ata_eh_release(ap); } else { tmp___2 = ata_qc_from_tag(ap, ap->link.active_tag); __ret_warn_on = (unsigned long )tmp___2 == (unsigned long )((struct ata_queued_cmd *)0); tmp___3 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___3 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-eh.c", 808); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); (*((ap->ops)->eng_timeout))(ap); } scsi_eh_flush_done_q(& ap->eh_done_q); tmp___4 = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp___4); if ((ap->pflags & 16U) != 0U) { ap->pflags = ap->pflags & 4294967279U; } else if ((ap->pflags & 64U) != 0U) { schedule_delayed_work(& ap->hotplug_task, 0UL); } else { } if ((ap->pflags & 8U) != 0U) { ata_port_printk((struct ata_port const *)ap, "\016", "EH complete\n"); } else { } ap->pflags = ap->pflags & 4294967223U; ap->pflags = ap->pflags & 4294967293U; __wake_up(& ap->eh_wait_q, 3U, 0, (void *)0); spin_unlock_irqrestore(ap->lock, flags); return; } } static char const __kstrtab_ata_scsi_port_error_handler[28U] = { 'a', 't', 'a', '_', 's', 'c', 's', 'i', '_', 'p', 'o', 'r', 't', '_', 'e', 'r', 'r', 'o', 'r', '_', 'h', 'a', 'n', 'd', 'l', 'e', 'r', '\000'}; struct kernel_symbol const __ksymtab_ata_scsi_port_error_handler ; struct kernel_symbol const __ksymtab_ata_scsi_port_error_handler = {(unsigned long )(& ata_scsi_port_error_handler), (char const *)(& __kstrtab_ata_scsi_port_error_handler)}; void ata_port_wait_eh(struct ata_port *ap ) { unsigned long flags ; wait_queue_t wait ; struct task_struct *tmp ; raw_spinlock_t *tmp___0 ; raw_spinlock_t *tmp___1 ; int tmp___2 ; { tmp = get_current(); wait.flags = 0U; wait.private = (void *)tmp; wait.func = & autoremove_wake_function; wait.task_list.next = & wait.task_list; wait.task_list.prev = & wait.task_list; retry: tmp___0 = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp___0); goto ldv_44386; ldv_44385: prepare_to_wait(& ap->eh_wait_q, & wait, 2); spin_unlock_irqrestore(ap->lock, flags); schedule(); tmp___1 = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp___1); ldv_44386: ; if ((ap->pflags & 3U) != 0U) { goto ldv_44385; } else { } finish_wait(& ap->eh_wait_q, & wait); spin_unlock_irqrestore(ap->lock, flags); tmp___2 = scsi_host_in_recovery(ap->scsi_host); if (tmp___2 != 0) { ata_msleep(ap, 10U); goto retry; } else { } return; } } static char const __kstrtab_ata_port_wait_eh[17U] = { 'a', 't', 'a', '_', 'p', 'o', 'r', 't', '_', 'w', 'a', 'i', 't', '_', 'e', 'h', '\000'}; struct kernel_symbol const __ksymtab_ata_port_wait_eh ; struct kernel_symbol const __ksymtab_ata_port_wait_eh = {(unsigned long )(& ata_port_wait_eh), (char const *)(& __kstrtab_ata_port_wait_eh)}; static int ata_eh_nr_in_flight(struct ata_port *ap ) { unsigned int tag ; int nr ; struct ata_queued_cmd *tmp ; { nr = 0; tag = 0U; goto ldv_44401; ldv_44400: tmp = ata_qc_from_tag(ap, tag); if ((unsigned long )tmp != (unsigned long )((struct ata_queued_cmd *)0)) { nr = nr + 1; } else { } tag = tag + 1U; ldv_44401: ; if (tag <= 30U) { goto ldv_44400; } else { } return (nr); } } void ata_eh_fastdrain_timerfn(unsigned long arg ) { struct ata_port *ap ; unsigned long flags ; int cnt ; raw_spinlock_t *tmp ; unsigned int tag ; struct ata_queued_cmd *qc ; struct ata_queued_cmd *tmp___0 ; { ap = (struct ata_port *)arg; tmp = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp); cnt = ata_eh_nr_in_flight(ap); if (cnt == 0) { goto out_unlock; } else { } if ((unsigned long )cnt == ap->fastdrain_cnt) { tag = 0U; goto ldv_44416; ldv_44415: tmp___0 = ata_qc_from_tag(ap, tag); qc = tmp___0; if ((unsigned long )qc != (unsigned long )((struct ata_queued_cmd *)0)) { qc->err_mask = qc->err_mask | 4U; } else { } tag = tag + 1U; ldv_44416: ; if (tag <= 30U) { goto ldv_44415; } else { } ata_port_freeze(ap); } else { ap->fastdrain_cnt = (unsigned long )cnt; ap->fastdrain_timer.expires = ata_deadline(jiffies, 3000UL); add_timer(& ap->fastdrain_timer); } out_unlock: spin_unlock_irqrestore(ap->lock, flags); return; } } static void ata_eh_set_pending(struct ata_port *ap , int fastdrain ) { int cnt ; { if ((int )ap->pflags & 1) { return; } else { } ap->pflags = ap->pflags | 1U; if (fastdrain == 0) { return; } else { } cnt = ata_eh_nr_in_flight(ap); if (cnt == 0) { return; } else { } ap->fastdrain_cnt = (unsigned long )cnt; ap->fastdrain_timer.expires = ata_deadline(jiffies, 3000UL); add_timer(& ap->fastdrain_timer); return; } } void ata_qc_schedule_eh(struct ata_queued_cmd *qc ) { struct ata_port *ap ; struct request_queue *q ; unsigned long flags ; int __ret_warn_on ; long tmp ; raw_spinlock_t *tmp___0 ; { ap = qc->ap; q = ((qc->scsicmd)->device)->request_queue; __ret_warn_on = (unsigned long )(ap->ops)->error_handler == (unsigned long )((void (*)(struct ata_port * ))0); tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-eh.c", 975); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); qc->flags = qc->flags | 65536UL; ata_eh_set_pending(ap, 1); tmp___0 = spinlock_check(q->queue_lock); flags = _raw_spin_lock_irqsave(tmp___0); blk_abort_request((qc->scsicmd)->request); spin_unlock_irqrestore(q->queue_lock, flags); return; } } void ata_std_sched_eh(struct ata_port *ap ) { int __ret_warn_on ; long tmp ; { __ret_warn_on = (unsigned long )(ap->ops)->error_handler == (unsigned long )((void (*)(struct ata_port * ))0); tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-eh.c", 999); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); if ((ap->pflags & 128U) != 0U) { return; } else { } ata_eh_set_pending(ap, 1); scsi_schedule_eh(ap->scsi_host); return; } } static char const __kstrtab_ata_std_sched_eh[17U] = { 'a', 't', 'a', '_', 's', 't', 'd', '_', 's', 'c', 'h', 'e', 'd', '_', 'e', 'h', '\000'}; struct kernel_symbol const __ksymtab_ata_std_sched_eh ; struct kernel_symbol const __ksymtab_ata_std_sched_eh = {(unsigned long )(& ata_std_sched_eh), (char const *)(& __kstrtab_ata_std_sched_eh)}; void ata_std_end_eh(struct ata_port *ap ) { struct Scsi_Host *host ; { host = ap->scsi_host; host->host_eh_scheduled = 0U; return; } } static char const __kstrtab_ata_std_end_eh[15U] = { 'a', 't', 'a', '_', 's', 't', 'd', '_', 'e', 'n', 'd', '_', 'e', 'h', '\000'}; struct kernel_symbol const __ksymtab_ata_std_end_eh ; struct kernel_symbol const __ksymtab_ata_std_end_eh = {(unsigned long )(& ata_std_end_eh), (char const *)(& __kstrtab_ata_std_end_eh)}; void ata_port_schedule_eh(struct ata_port *ap ) { { (*((ap->ops)->sched_eh))(ap); return; } } static int ata_do_link_abort(struct ata_port *ap , struct ata_link *link ) { int tag ; int nr_aborted ; int __ret_warn_on ; long tmp ; struct ata_queued_cmd *qc ; struct ata_queued_cmd *tmp___0 ; { nr_aborted = 0; __ret_warn_on = (unsigned long )(ap->ops)->error_handler == (unsigned long )((void (*)(struct ata_port * ))0); tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-eh.c", 1052); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); ata_eh_set_pending(ap, 0); tag = 0; goto ldv_44470; ldv_44469: tmp___0 = ata_qc_from_tag(ap, (unsigned int )tag); qc = tmp___0; if ((unsigned long )qc != (unsigned long )((struct ata_queued_cmd *)0) && ((unsigned long )link == (unsigned long )((struct ata_link *)0) || (unsigned long )(qc->dev)->link == (unsigned long )link)) { qc->flags = qc->flags | 65536UL; ata_qc_complete(qc); nr_aborted = nr_aborted + 1; } else { } tag = tag + 1; ldv_44470: ; if (tag <= 31) { goto ldv_44469; } else { } if (nr_aborted == 0) { ata_port_schedule_eh(ap); } else { } return (nr_aborted); } } int ata_link_abort(struct ata_link *link ) { int tmp ; { tmp = ata_do_link_abort(link->ap, link); return (tmp); } } int ata_port_abort(struct ata_port *ap ) { int tmp ; { tmp = ata_do_link_abort(ap, (struct ata_link *)0); return (tmp); } } static void __ata_port_freeze(struct ata_port *ap ) { int __ret_warn_on ; long tmp ; { __ret_warn_on = (unsigned long )(ap->ops)->error_handler == (unsigned long )((void (*)(struct ata_port * ))0); tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-eh.c", 1127); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); if ((unsigned long )(ap->ops)->freeze != (unsigned long )((void (*)(struct ata_port * ))0)) { (*((ap->ops)->freeze))(ap); } else { } ap->pflags = ap->pflags | 4U; return; } } int ata_port_freeze(struct ata_port *ap ) { int nr_aborted ; int __ret_warn_on ; long tmp ; { __ret_warn_on = (unsigned long )(ap->ops)->error_handler == (unsigned long )((void (*)(struct ata_port * ))0); tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-eh.c", 1155); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); __ata_port_freeze(ap); nr_aborted = ata_port_abort(ap); return (nr_aborted); } } int sata_async_notification(struct ata_port *ap ) { u32 sntf ; int rc ; struct ata_device *dev ; bool tmp ; int tmp___0 ; struct ata_link *link ; bool tmp___1 ; int tmp___2 ; { if ((ap->flags & 262144UL) == 0UL) { return (0); } else { } rc = sata_scr_read(& ap->link, 4, & sntf); if (rc == 0) { sata_scr_write(& ap->link, 4, sntf); } else { } tmp___1 = sata_pmp_attached(ap); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2 || rc != 0) { tmp = sata_pmp_attached(ap); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { dev = (struct ata_device *)(& ap->link.device); if (dev->class == 3U && (dev->flags & 128UL) != 0UL) { ata_scsi_media_change_notify(dev); } else { } return (0); } else { ata_port_schedule_eh(ap); return (1); } } else { link = ata_link_next((struct ata_link *)0, ap, 0); goto ldv_44498; ldv_44497: ; if (((u32 )(1 << link->pmp) & sntf) == 0U) { goto ldv_44496; } else { } if (((struct ata_device *)(& link->device))->class == 3U && (((struct ata_device *)(& link->device))->flags & 128UL) != 0UL) { ata_scsi_media_change_notify((struct ata_device *)(& link->device)); } else { } ldv_44496: link = ata_link_next(link, ap, 0); ldv_44498: ; if ((unsigned long )link != (unsigned long )((struct ata_link *)0)) { goto ldv_44497; } else { } if ((sntf & 32768U) != 0U) { ata_port_schedule_eh(ap); return (1); } else { } return (0); } } } void ata_eh_freeze_port(struct ata_port *ap ) { unsigned long flags ; raw_spinlock_t *tmp ; { if ((unsigned long )(ap->ops)->error_handler == (unsigned long )((void (*)(struct ata_port * ))0)) { return; } else { } tmp = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp); __ata_port_freeze(ap); spin_unlock_irqrestore(ap->lock, flags); return; } } void ata_eh_thaw_port(struct ata_port *ap ) { unsigned long flags ; raw_spinlock_t *tmp ; { if ((unsigned long )(ap->ops)->error_handler == (unsigned long )((void (*)(struct ata_port * ))0)) { return; } else { } tmp = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp); ap->pflags = ap->pflags & 4294967291U; if ((unsigned long )(ap->ops)->thaw != (unsigned long )((void (*)(struct ata_port * ))0)) { (*((ap->ops)->thaw))(ap); } else { } spin_unlock_irqrestore(ap->lock, flags); return; } } static void ata_eh_scsidone(struct scsi_cmnd *scmd ) { { return; } } static void __ata_eh_qc_complete(struct ata_queued_cmd *qc ) { struct ata_port *ap ; struct scsi_cmnd *scmd ; unsigned long flags ; raw_spinlock_t *tmp ; int __ret_warn_on ; unsigned int tmp___0 ; long tmp___1 ; { ap = qc->ap; scmd = qc->scsicmd; tmp = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp); qc->scsidone = & ata_eh_scsidone; __ata_qc_complete(qc); tmp___0 = ata_tag_valid(qc->tag); __ret_warn_on = tmp___0 != 0U; tmp___1 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-eh.c", 1299); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); spin_unlock_irqrestore(ap->lock, flags); scsi_eh_finish_cmd(scmd, & ap->eh_done_q); return; } } void ata_eh_qc_complete(struct ata_queued_cmd *qc ) { struct scsi_cmnd *scmd ; { scmd = qc->scsicmd; scmd->retries = scmd->allowed; __ata_eh_qc_complete(qc); return; } } void ata_eh_qc_retry(struct ata_queued_cmd *qc ) { struct scsi_cmnd *scmd ; { scmd = qc->scsicmd; if (qc->err_mask == 0U) { scmd->allowed = scmd->allowed + 1; } else { } __ata_eh_qc_complete(qc); return; } } void ata_dev_disable(struct ata_device *dev ) { unsigned int tmp ; { tmp = ata_dev_enabled((struct ata_device const *)dev); if (tmp == 0U) { return; } else { } if ((int )((dev->link)->ap)->msg_enable & 1) { ata_dev_printk((struct ata_device const *)dev, "\f", "disabled\n"); } else { } ata_acpi_on_disable(dev); ata_down_xfermask_limit(dev, 2147483652U); dev->class = dev->class + 1U; ata_ering_clear(& dev->ering); return; } } void ata_eh_detach_dev(struct ata_device *dev ) { struct ata_link *link ; struct ata_port *ap ; struct ata_eh_context *ehc ; unsigned long flags ; raw_spinlock_t *tmp ; int tmp___0 ; { link = dev->link; ap = link->ap; ehc = & link->eh_context; ata_dev_disable(dev); tmp = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp); dev->flags = dev->flags & 0xfffffffffeffffffUL; tmp___0 = ata_scsi_offline_dev(dev); if (tmp___0 != 0) { dev->flags = dev->flags | 33554432UL; ap->pflags = ap->pflags | 64U; } else { } ata_eh_clear_action(link, dev, & link->eh_info, 33U); ata_eh_clear_action(link, dev, & link->eh_context.i, 33U); ehc->saved_xfer_mode[dev->devno] = 0U; ehc->saved_ncq_enabled = ehc->saved_ncq_enabled & (unsigned int )(~ (1 << (int )dev->devno)); spin_unlock_irqrestore(ap->lock, flags); return; } } void ata_eh_about_to_do(struct ata_link *link , struct ata_device *dev , unsigned int action ) { struct ata_port *ap ; struct ata_eh_info *ehi ; struct ata_eh_context *ehc ; unsigned long flags ; raw_spinlock_t *tmp ; { ap = link->ap; ehi = & link->eh_info; ehc = & link->eh_context; tmp = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp); ata_eh_clear_action(link, dev, ehi, action); if ((ehc->i.flags & 8U) == 0U && (unsigned long )ap->slave_link != (unsigned long )link) { ap->pflags = ap->pflags | 8U; } else { } spin_unlock_irqrestore(ap->lock, flags); return; } } void ata_eh_done(struct ata_link *link , struct ata_device *dev , unsigned int action ) { struct ata_eh_context *ehc ; { ehc = & link->eh_context; ata_eh_clear_action(link, dev, & ehc->i, action); return; } } static char const *ata_err_string(unsigned int err_mask ) { { if ((err_mask & 32U) != 0U) { return ("host bus error"); } else { } if ((err_mask & 16U) != 0U) { return ("ATA bus error"); } else { } if ((err_mask & 4U) != 0U) { return ("timeout"); } else { } if ((err_mask & 2U) != 0U) { return ("HSM violation"); } else { } if ((err_mask & 64U) != 0U) { return ("internal error"); } else { } if ((err_mask & 8U) != 0U) { return ("media error"); } else { } if ((err_mask & 128U) != 0U) { return ("invalid argument"); } else { } if ((int )err_mask & 1) { return ("device error"); } else { } return ("unknown error"); } } unsigned int ata_read_log_page(struct ata_device *dev , u8 log , u8 page , void *buf , unsigned int sectors ) { struct ata_taskfile tf ; unsigned int err_mask ; bool dma ; bool tmp ; { dma = 0; retry: ata_tf_init(dev, & tf); if ((unsigned int )dev->dma_mode != 0U) { tmp = ata_id_has_read_log_dma_ext((u16 const *)(& dev->__annonCompField86.id)); if ((int )tmp) { if ((dev->horkage & 8388608U) == 0U) { tf.command = 71U; tf.protocol = 3U; dma = 1; } else { tf.command = 47U; tf.protocol = 2U; dma = 0; } } else { tf.command = 47U; tf.protocol = 2U; dma = 0; } } else { tf.command = 47U; tf.protocol = 2U; dma = 0; } tf.lbal = log; tf.lbam = page; tf.nsect = (u8 )sectors; tf.hob_nsect = (u8 )(sectors >> 8); tf.flags = tf.flags | 7UL; err_mask = ata_exec_internal(dev, & tf, (u8 const *)0U, 2, buf, sectors * 512U, 0UL); if (err_mask != 0U && (int )dma) { dev->horkage = dev->horkage | 8388608U; ata_dev_printk((struct ata_device const *)dev, "\f", "READ LOG DMA EXT failed, trying unqueued\n"); goto retry; } else { } return (err_mask); } } static int ata_eh_read_log_10h(struct ata_device *dev , int *tag , struct ata_taskfile *tf ) { u8 *buf ; unsigned int err_mask ; u8 csum ; int i ; { buf = (u8 *)(& ((dev->link)->ap)->sector_buf); err_mask = ata_read_log_page(dev, 16, 0, (void *)buf, 1U); if (err_mask != 0U) { return (-5); } else { } csum = 0U; i = 0; goto ldv_44591; ldv_44590: csum = (int )*(buf + (unsigned long )i) + (int )csum; i = i + 1; ldv_44591: ; if (i <= 511) { goto ldv_44590; } else { } if ((unsigned int )csum != 0U) { ata_dev_printk((struct ata_device const *)dev, "\f", "invalid checksum 0x%x on log page 10h\n", (int )csum); } else { } if ((int )((signed char )*buf) < 0) { return (-2); } else { } *tag = (int )*buf & 31; tf->command = *(buf + 2UL); tf->feature = *(buf + 3UL); tf->lbal = *(buf + 4UL); tf->lbam = *(buf + 5UL); tf->lbah = *(buf + 6UL); tf->device = *(buf + 7UL); tf->hob_lbal = *(buf + 8UL); tf->hob_lbam = *(buf + 9UL); tf->hob_lbah = *(buf + 10UL); tf->nsect = *(buf + 12UL); tf->hob_nsect = *(buf + 13UL); if (((int )dev->__annonCompField86.id[78] & 128) != 0) { tf->auxiliary = (u32 )((((int )*(buf + 14UL) << 16) | ((int )*(buf + 15UL) << 8)) | (int )*(buf + 16UL)); } else { } return (0); } } unsigned int atapi_eh_tur(struct ata_device *dev , u8 *r_sense_key ) { u8 cdb[16U] ; unsigned int tmp ; struct ata_taskfile tf ; unsigned int err_mask ; { cdb[0] = 0U; cdb[1] = 0U; cdb[2] = 0U; cdb[3] = 0U; cdb[4] = 0U; cdb[5] = 0U; tmp = 6U; while (1) { if (tmp >= 16U) { break; } else { } cdb[tmp] = (unsigned char)0; tmp = tmp + 1U; } ata_tf_init(dev, & tf); tf.flags = tf.flags | 6UL; tf.command = 160U; tf.protocol = 5U; err_mask = ata_exec_internal(dev, & tf, (u8 const *)(& cdb), 3, (void *)0, 0U, 0UL); if (err_mask == 1U) { *r_sense_key = (u8 )((int )tf.feature >> 4); } else { } return (err_mask); } } static u32 ata_eh_request_sense(struct ata_queued_cmd *qc , struct scsi_cmnd *cmd ) { struct ata_device *dev ; struct ata_taskfile tf ; unsigned int err_mask ; bool tmp ; int tmp___0 ; { dev = qc->dev; if ((unsigned long )cmd == (unsigned long )((struct scsi_cmnd *)0)) { return (0U); } else { } ata_dev_printk((struct ata_device const *)dev, "\f", "request sense\n"); tmp = ata_id_sense_reporting_enabled((u16 const *)(& dev->__annonCompField86.id)); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { ata_dev_printk((struct ata_device const *)qc->dev, "\f", "sense data reporting disabled\n"); return (0U); } else { } ata_tf_init(dev, & tf); tf.flags = tf.flags | 6UL; tf.flags = tf.flags | 17UL; tf.command = 11U; tf.protocol = 1U; err_mask = ata_exec_internal(dev, & tf, (u8 const *)0U, 3, (void *)0, 0U, 0UL); if (((((int )tf.command & 2) != 0 || (unsigned int )tf.lbah != 0U) || (unsigned int )tf.lbam != 0U) || (unsigned int )tf.lbal != 0U) { ata_scsi_set_sense(cmd, (int )tf.lbah, (int )tf.lbam, (int )tf.lbal); qc->flags = qc->flags | 131072UL; ata_dev_printk((struct ata_device const *)dev, "\f", "sense data %02x/%02x/%02x\n", (int )tf.lbah, (int )tf.lbam, (int )tf.lbal); } else { ata_dev_printk((struct ata_device const *)dev, "\f", "request sense failed stat %02x emask %x\n", (int )tf.command, err_mask); } return (err_mask); } } unsigned int atapi_eh_request_sense(struct ata_device *dev , u8 *sense_buf , u8 dfl_sense_key ) { u8 cdb[16U] ; unsigned int tmp ; struct ata_port *ap ; struct ata_taskfile tf ; unsigned int tmp___0 ; { cdb[0] = 3U; cdb[1] = 0U; cdb[2] = 0U; cdb[3] = 0U; cdb[4] = 96U; cdb[5] = 0U; tmp = 6U; while (1) { if (tmp >= 16U) { break; } else { } cdb[tmp] = (unsigned char)0; tmp = tmp + 1U; } ap = (dev->link)->ap; memset((void *)sense_buf, 0, 96UL); *sense_buf = 112U; *(sense_buf + 2UL) = dfl_sense_key; ata_tf_init(dev, & tf); tf.flags = tf.flags | 6UL; tf.command = 160U; if ((ap->flags & 128UL) != 0UL) { tf.protocol = 7U; tf.feature = (u8 )((unsigned int )tf.feature | 1U); } else { tf.protocol = 6U; tf.lbam = 96U; tf.lbah = 0U; } tmp___0 = ata_exec_internal(dev, & tf, (u8 const *)(& cdb), 2, (void *)sense_buf, 96U, 0UL); return (tmp___0); } } static void ata_eh_analyze_serror(struct ata_link *link ) { struct ata_eh_context *ehc ; u32 serror ; unsigned int err_mask ; unsigned int action ; u32 hotplug_mask ; int tmp ; { ehc = & link->eh_context; serror = ehc->i.serror; err_mask = 0U; action = 0U; if ((serror & 768U) != 0U) { err_mask = err_mask | 16U; action = action | 6U; } else { } if ((serror & 1024U) != 0U) { err_mask = err_mask | 2U; action = action | 6U; } else { } if ((serror & 2048U) != 0U) { err_mask = err_mask | 64U; action = action | 6U; } else { } if ((unsigned int )link->lpm_policy > 1U) { hotplug_mask = 0U; } else if ((link->flags & 64U) == 0U) { hotplug_mask = 67174400U; } else { tmp = ata_is_host_link((struct ata_link const *)link); if (tmp != 0) { hotplug_mask = 67174400U; } else { hotplug_mask = 65536U; } } if ((serror & hotplug_mask) != 0U) { ata_ehi_hotplugged(& ehc->i); } else { } ehc->i.err_mask = ehc->i.err_mask | err_mask; ehc->i.action = ehc->i.action | action; return; } } void ata_eh_analyze_ncq_error(struct ata_link *link ) { struct ata_port *ap ; struct ata_eh_context *ehc ; struct ata_device *dev ; struct ata_queued_cmd *qc ; struct ata_taskfile tf ; int tag ; int rc ; char sense_key ; char asc ; char ascq ; { ap = link->ap; ehc = & link->eh_context; dev = (struct ata_device *)(& link->device); if ((ap->pflags & 4U) != 0U) { return; } else { } if (link->sactive == 0U || (ehc->i.err_mask & 1U) == 0U) { return; } else { } tag = 0; goto ldv_44635; ldv_44634: qc = __ata_qc_from_tag(ap, (unsigned int )tag); if ((qc->flags & 65536UL) == 0UL) { goto ldv_44633; } else { } if (qc->err_mask != 0U) { return; } else { } ldv_44633: tag = tag + 1; ldv_44635: ; if (tag <= 31) { goto ldv_44634; } else { } memset((void *)(& tf), 0, 32UL); rc = ata_eh_read_log_10h(dev, & tag, & tf); if (rc != 0) { ata_link_printk((struct ata_link const *)link, "\v", "failed to read log page 10h (errno=%d)\n", rc); return; } else { } if ((link->sactive & (u32 )(1 << tag)) == 0U) { ata_link_printk((struct ata_link const *)link, "\v", "log page 10h reported inactive tag %d\n", tag); return; } else { } qc = __ata_qc_from_tag(ap, (unsigned int )tag); memcpy((void *)(& qc->result_tf), (void const *)(& tf), 32UL); qc->result_tf.flags = 19UL; qc->err_mask = qc->err_mask | 1025U; if (qc->result_tf.auxiliary != 0U) { sense_key = (char )(qc->result_tf.auxiliary >> 16); asc = (char )(qc->result_tf.auxiliary >> 8); ascq = (char )qc->result_tf.auxiliary; ata_dev_printk((struct ata_device const *)dev, "\017", "NCQ Autosense %02x/%02x/%02x\n", (int )sense_key, (int )asc, (int )ascq); ata_scsi_set_sense(qc->scsicmd, (int )((u8 )sense_key), (int )((u8 )asc), (int )((u8 )ascq)); ata_scsi_set_sense_information(qc->scsicmd, (struct ata_taskfile const *)(& qc->result_tf)); qc->flags = qc->flags | 131072UL; } else { } ehc->i.err_mask = ehc->i.err_mask & 4294967294U; return; } } static unsigned int ata_eh_analyze_tf(struct ata_queued_cmd *qc , struct ata_taskfile const *tf ) { unsigned int tmp ; unsigned int action ; u8 stat ; u8 err ; { action = 0U; stat = tf->command; err = tf->feature; if (((int )stat & 200) != 64) { qc->err_mask = qc->err_mask | 2U; return (6U); } else { } if ((((int )stat & 2) != 0 && ((int )stat & 32) == 0) && (qc->flags & 131072UL) == 0UL) { if (((qc->ap)->pflags & 4U) == 0U) { tmp = ata_eh_request_sense(qc, qc->scsicmd); if (tmp != 0U) { qc->err_mask = qc->err_mask | tmp; } else { ata_scsi_set_sense_information(qc->scsicmd, tf); } } else { ata_dev_printk((struct ata_device const *)qc->dev, "\f", "sense data available but port frozen\n"); } } else { } if ((qc->flags & 131072UL) != 0UL) { return (0U); } else { } if (((int )stat & 33) != 0) { qc->err_mask = qc->err_mask | 1U; } else { return (0U); } switch ((qc->dev)->class) { case 1U: ; case 9U: ; if ((int )((signed char )err) < 0) { qc->err_mask = qc->err_mask | 16U; } else { } if (((int )err & 65) != 0) { qc->err_mask = qc->err_mask | 8U; } else { } if (((int )err & 16) != 0) { qc->err_mask = qc->err_mask | 128U; } else { } goto ldv_44650; case 3U: ; if (((qc->ap)->pflags & 4U) == 0U) { tmp = atapi_eh_request_sense(qc->dev, (qc->scsicmd)->sense_buffer, (int )qc->result_tf.feature >> 4); if (tmp == 0U) { qc->flags = qc->flags | 131072UL; } else { qc->err_mask = qc->err_mask | tmp; } } else { } } ldv_44650: ; if ((qc->err_mask & 22U) != 0U) { action = action | 6U; } else { } return (action); } } static int ata_eh_categorize_error(unsigned int eflags , unsigned int err_mask , int *xfer_ok ) { int base ; { base = 0; if ((eflags & 2U) == 0U) { *xfer_ok = 1; } else { } if (*xfer_ok == 0) { base = 4; } else { } if ((err_mask & 16U) != 0U) { return (base + 1); } else { } if ((err_mask & 4U) != 0U) { return (base + 2); } else { } if ((int )eflags & 1) { if ((err_mask & 2U) != 0U) { return (base + 2); } else { } if ((err_mask & 137U) == 1U) { return (base + 3); } else { } } else { } return (0); } } static int speed_down_verdict_cb(struct ata_ering_entry *ent , void *void_arg ) { struct speed_down_verdict_arg *arg ; int cat ; { arg = (struct speed_down_verdict_arg *)void_arg; if ((int )ent->eflags < 0 || ent->timestamp < arg->since) { return (-1); } else { } cat = ata_eh_categorize_error(ent->eflags, ent->err_mask, & arg->xfer_ok); arg->nr_errors[cat] = arg->nr_errors[cat] + 1; return (0); } } static unsigned int ata_eh_speed_down_verdict(struct ata_device *dev ) { u64 j5mins ; u64 j10mins ; u64 j64 ; u64 tmp ; struct speed_down_verdict_arg arg ; unsigned int verdict ; u64 _min1 ; unsigned long long _min2 ; u64 _min1___0 ; unsigned long long _min2___0 ; { j5mins = 75000ULL; j10mins = 150000ULL; tmp = get_jiffies_64(); j64 = tmp; verdict = 0U; memset((void *)(& arg), 0, 48UL); _min1 = j64; _min2 = j5mins; arg.since = j64 - (unsigned long long )((unsigned long long const )_min1 < (unsigned long long const )_min2 ? (unsigned long long const )_min1 : _min2); ata_ering_map(& dev->ering, & speed_down_verdict_cb, (void *)(& arg)); if (arg.nr_errors[5] + arg.nr_errors[6] > 1) { verdict = verdict | 14U; } else { } if (arg.nr_errors[6] + arg.nr_errors[7] > 1) { verdict = verdict | 9U; } else { } if ((arg.nr_errors[1] + arg.nr_errors[2]) + arg.nr_errors[3] > 6) { verdict = verdict | 4U; } else { } memset((void *)(& arg), 0, 48UL); _min1___0 = j64; _min2___0 = j10mins; arg.since = j64 - (unsigned long long )((unsigned long long const )_min1___0 < (unsigned long long const )_min2___0 ? (unsigned long long const )_min1___0 : _min2___0); ata_ering_map(& dev->ering, & speed_down_verdict_cb, (void *)(& arg)); if (arg.nr_errors[2] + arg.nr_errors[3] > 3) { verdict = verdict | 1U; } else { } if (arg.nr_errors[1] + arg.nr_errors[2] > 3 || arg.nr_errors[3] > 6) { verdict = verdict | 2U; } else { } return (verdict); } } static unsigned int ata_eh_speed_down(struct ata_device *dev , unsigned int eflags , unsigned int err_mask ) { struct ata_link *link ; struct ata_link *tmp ; int xfer_ok ; unsigned int verdict ; unsigned int action ; int tmp___0 ; int tmp___1 ; int dma_dnxfer_sel[2U] ; int pio_dnxfer_sel[2U] ; int sel ; int tmp___2 ; int tmp___3 ; { tmp = ata_dev_phys_link(dev); link = tmp; xfer_ok = 0; action = 0U; tmp___0 = ata_eh_categorize_error(eflags, err_mask, & xfer_ok); if (tmp___0 == 0) { return (0U); } else { } ata_ering_record(& dev->ering, eflags, err_mask); verdict = ata_eh_speed_down_verdict(dev); if ((int )verdict & 1 && (dev->flags & 12296UL) == 8UL) { dev->flags = dev->flags | 8192UL; ata_dev_printk((struct ata_device const *)dev, "\f", "NCQ disabled due to excessive errors\n"); goto done; } else { } if ((verdict & 2U) != 0U) { tmp___1 = sata_down_spd_limit(link, 0U); if (tmp___1 == 0) { action = action | 6U; goto done; } else { } if (dev->spdn_cnt <= 1) { dma_dnxfer_sel[0] = 1; dma_dnxfer_sel[1] = 2; pio_dnxfer_sel[0] = 0; pio_dnxfer_sel[1] = 4; if (dev->xfer_shift != 0U) { sel = dma_dnxfer_sel[dev->spdn_cnt]; } else { sel = pio_dnxfer_sel[dev->spdn_cnt]; } dev->spdn_cnt = dev->spdn_cnt + 1; tmp___2 = ata_down_xfermask_limit(dev, (unsigned int )sel); if (tmp___2 == 0) { action = action | 6U; goto done; } else { } } else { } } else { } if ((((verdict & 4U) != 0U && dev->spdn_cnt > 1) && ((link->ap)->cbl != 6U || dev->class == 3U)) && dev->xfer_shift != 0U) { tmp___3 = ata_down_xfermask_limit(dev, 3U); if (tmp___3 == 0) { dev->spdn_cnt = 0; action = action | 6U; goto done; } else { } } else { } return (0U); done: ; if ((verdict & 8U) == 0U) { ata_ering_clear(& dev->ering); } else { } return (action); } } __inline static int ata_eh_worth_retry(struct ata_queued_cmd *qc ) { { if ((qc->err_mask & 8U) != 0U) { return (0); } else { } if ((qc->flags & 8UL) != 0UL) { return (1); } else { } if ((qc->err_mask & 128U) != 0U) { return (0); } else { } return (qc->err_mask != 1U); } } static void ata_eh_link_autopsy(struct ata_link *link ) { struct ata_port *ap ; struct ata_eh_context *ehc ; struct ata_device *dev ; unsigned int all_err_mask ; unsigned int eflags ; int tag ; u32 serror ; int rc ; struct ata_queued_cmd *qc ; struct ata_queued_cmd *tmp ; struct ata_link *tmp___0 ; unsigned int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; unsigned int tmp___5 ; unsigned int tmp___6 ; { ap = link->ap; ehc = & link->eh_context; all_err_mask = 0U; eflags = 0U; if ((ehc->i.flags & 4U) != 0U) { return; } else { } rc = sata_scr_read(link, 1, & serror); if (rc == 0) { ehc->i.serror = ehc->i.serror | serror; ata_eh_analyze_serror(link); } else if (rc != -95) { ehc->i.probe_mask = ehc->i.probe_mask | 3U; ehc->i.action = ehc->i.action | 6U; ehc->i.err_mask = ehc->i.err_mask | 256U; } else { } ata_eh_analyze_ncq_error(link); if ((ehc->i.err_mask & 4294967039U) != 0U) { ehc->i.err_mask = ehc->i.err_mask & 4294967039U; } else { } all_err_mask = ehc->i.err_mask | all_err_mask; tag = 0; goto ldv_44712; ldv_44711: tmp = __ata_qc_from_tag(ap, (unsigned int )tag); qc = tmp; if ((qc->flags & 65536UL) == 0UL) { goto ldv_44710; } else { tmp___0 = ata_dev_phys_link(qc->dev); if ((unsigned long )tmp___0 != (unsigned long )link) { goto ldv_44710; } else { } } qc->err_mask = qc->err_mask | ehc->i.err_mask; tmp___1 = ata_eh_analyze_tf(qc, (struct ata_taskfile const *)(& qc->result_tf)); ehc->i.action = ehc->i.action | tmp___1; if ((qc->err_mask & 16U) != 0U) { qc->err_mask = qc->err_mask & 4294967158U; } else { } if ((qc->err_mask & 4294967039U) != 0U) { qc->err_mask = qc->err_mask & 4294967039U; } else { } if ((qc->flags & 131072UL) != 0UL) { qc->err_mask = qc->err_mask & 4294967038U; } else { } tmp___2 = ata_eh_worth_retry(qc); if (tmp___2 != 0) { qc->flags = qc->flags | 128UL; } else { } ehc->i.dev = qc->dev; all_err_mask = qc->err_mask | all_err_mask; if ((qc->flags & 8UL) != 0UL) { eflags = eflags | 1U; } else { } trace_ata_eh_link_autopsy_qc(qc); ldv_44710: tag = tag + 1; ldv_44712: ; if (tag <= 31) { goto ldv_44711; } else { } if ((ap->pflags & 4U) != 0U || (all_err_mask & 6U) != 0U) { ehc->i.action = ehc->i.action | 6U; } else if (((int )eflags & 1 && all_err_mask != 0U) || ((eflags & 1U) == 0U && (all_err_mask & 4294967294U) != 0U)) { ehc->i.action = ehc->i.action | 1U; } else { } if ((unsigned long )ehc->i.dev != (unsigned long )((struct ata_device *)0)) { ehc->i.dev_action[(ehc->i.dev)->devno] = ehc->i.dev_action[(ehc->i.dev)->devno] | (ehc->i.action & 33U); ehc->i.action = ehc->i.action & 4294967262U; } else { } if ((all_err_mask & 4U) != 0U) { tmp___3 = ata_is_host_link((struct ata_link const *)link); if (tmp___3 == 0) { ap->link.eh_context.i.err_mask = ap->link.eh_context.i.err_mask | 4U; } else { } } else { } dev = ehc->i.dev; if ((unsigned long )dev == (unsigned long )((struct ata_device *)0)) { tmp___4 = ata_link_max_devices((struct ata_link const *)link); if (tmp___4 == 1) { tmp___5 = ata_dev_enabled((struct ata_device const *)(& link->device)); if (tmp___5 != 0U) { dev = (struct ata_device *)(& link->device); } else { } } else { } } else { } if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { if ((dev->flags & 65536UL) != 0UL) { eflags = eflags | 2U; } else { } tmp___6 = ata_eh_speed_down(dev, eflags, all_err_mask); ehc->i.action = ehc->i.action | tmp___6; } else { } trace_ata_eh_link_autopsy(dev, ehc->i.action, all_err_mask); return; } } void ata_eh_autopsy(struct ata_port *ap ) { struct ata_link *link ; struct ata_eh_context *mehc ; struct ata_eh_context *sehc ; bool tmp ; { link = ata_link_next((struct ata_link *)0, ap, 0); goto ldv_44719; ldv_44718: ata_eh_link_autopsy(link); link = ata_link_next(link, ap, 0); ldv_44719: ; if ((unsigned long )link != (unsigned long )((struct ata_link *)0)) { goto ldv_44718; } else { } if ((unsigned long )ap->slave_link != (unsigned long )((struct ata_link *)0)) { mehc = & ap->link.eh_context; sehc = & (ap->slave_link)->eh_context; sehc->i.flags = sehc->i.flags | (mehc->i.flags & 12U); ata_eh_link_autopsy(ap->slave_link); ata_eh_about_to_do(ap->slave_link, (struct ata_device *)0, 15U); mehc->i.action = mehc->i.action | sehc->i.action; mehc->i.dev_action[1] = mehc->i.dev_action[1] | sehc->i.dev_action[1]; mehc->i.flags = mehc->i.flags | sehc->i.flags; ata_eh_done(ap->slave_link, (struct ata_device *)0, 15U); } else { } tmp = sata_pmp_attached(ap); if ((int )tmp) { ata_eh_link_autopsy(& ap->link); } else { } return; } } char const *ata_get_cmd_descript(u8 command ) { struct __anonstruct_cmd_descr_310 cmd_descr[90U] ; unsigned int i ; { cmd_descr[0].command = 8U; cmd_descr[0].text = "DEVICE RESET"; cmd_descr[1].command = 229U; cmd_descr[1].text = "CHECK POWER MODE"; cmd_descr[2].command = 226U; cmd_descr[2].text = "STANDBY"; cmd_descr[3].command = 227U; cmd_descr[3].text = "IDLE"; cmd_descr[4].command = 144U; cmd_descr[4].text = "EXECUTE DEVICE DIAGNOSTIC"; cmd_descr[5].command = 146U; cmd_descr[5].text = "DOWNLOAD MICROCODE"; cmd_descr[6].command = 147U; cmd_descr[6].text = "DOWNLOAD MICROCODE DMA"; cmd_descr[7].command = 0U; cmd_descr[7].text = "NOP"; cmd_descr[8].command = 231U; cmd_descr[8].text = "FLUSH CACHE"; cmd_descr[9].command = 234U; cmd_descr[9].text = "FLUSH CACHE EXT"; cmd_descr[10].command = 236U; cmd_descr[10].text = "IDENTIFY DEVICE"; cmd_descr[11].command = 161U; cmd_descr[11].text = "IDENTIFY PACKET DEVICE"; cmd_descr[12].command = 162U; cmd_descr[12].text = "SERVICE"; cmd_descr[13].command = 200U; cmd_descr[13].text = "READ DMA"; cmd_descr[14].command = 37U; cmd_descr[14].text = "READ DMA EXT"; cmd_descr[15].command = 38U; cmd_descr[15].text = "READ DMA QUEUED"; cmd_descr[16].command = 43U; cmd_descr[16].text = "READ STREAM EXT"; cmd_descr[17].command = 42U; cmd_descr[17].text = "READ STREAM DMA EXT"; cmd_descr[18].command = 202U; cmd_descr[18].text = "WRITE DMA"; cmd_descr[19].command = 53U; cmd_descr[19].text = "WRITE DMA EXT"; cmd_descr[20].command = 54U; cmd_descr[20].text = "WRITE DMA QUEUED EXT"; cmd_descr[21].command = 59U; cmd_descr[21].text = "WRITE STREAM EXT"; cmd_descr[22].command = 58U; cmd_descr[22].text = "WRITE STREAM DMA EXT"; cmd_descr[23].command = 61U; cmd_descr[23].text = "WRITE DMA FUA EXT"; cmd_descr[24].command = 62U; cmd_descr[24].text = "WRITE DMA QUEUED FUA EXT"; cmd_descr[25].command = 96U; cmd_descr[25].text = "READ FPDMA QUEUED"; cmd_descr[26].command = 97U; cmd_descr[26].text = "WRITE FPDMA QUEUED"; cmd_descr[27].command = 100U; cmd_descr[27].text = "SEND FPDMA QUEUED"; cmd_descr[28].command = 101U; cmd_descr[28].text = "RECEIVE FPDMA QUEUED"; cmd_descr[29].command = 32U; cmd_descr[29].text = "READ SECTOR(S)"; cmd_descr[30].command = 36U; cmd_descr[30].text = "READ SECTOR(S) EXT"; cmd_descr[31].command = 48U; cmd_descr[31].text = "WRITE SECTOR(S)"; cmd_descr[32].command = 52U; cmd_descr[32].text = "WRITE SECTOR(S) EXT"; cmd_descr[33].command = 196U; cmd_descr[33].text = "READ MULTIPLE"; cmd_descr[34].command = 41U; cmd_descr[34].text = "READ MULTIPLE EXT"; cmd_descr[35].command = 197U; cmd_descr[35].text = "WRITE MULTIPLE"; cmd_descr[36].command = 57U; cmd_descr[36].text = "WRITE MULTIPLE EXT"; cmd_descr[37].command = 206U; cmd_descr[37].text = "WRITE MULTIPLE FUA EXT"; cmd_descr[38].command = 239U; cmd_descr[38].text = "SET FEATURES"; cmd_descr[39].command = 198U; cmd_descr[39].text = "SET MULTIPLE MODE"; cmd_descr[40].command = 64U; cmd_descr[40].text = "READ VERIFY SECTOR(S)"; cmd_descr[41].command = 66U; cmd_descr[41].text = "READ VERIFY SECTOR(S) EXT"; cmd_descr[42].command = 69U; cmd_descr[42].text = "WRITE UNCORRECTABLE EXT"; cmd_descr[43].command = 224U; cmd_descr[43].text = "STANDBY IMMEDIATE"; cmd_descr[44].command = 225U; cmd_descr[44].text = "IDLE IMMEDIATE"; cmd_descr[45].command = 230U; cmd_descr[45].text = "SLEEP"; cmd_descr[46].command = 145U; cmd_descr[46].text = "INITIALIZE DEVICE PARAMETERS"; cmd_descr[47].command = 248U; cmd_descr[47].text = "READ NATIVE MAX ADDRESS"; cmd_descr[48].command = 39U; cmd_descr[48].text = "READ NATIVE MAX ADDRESS EXT"; cmd_descr[49].command = 249U; cmd_descr[49].text = "SET MAX ADDRESS"; cmd_descr[50].command = 55U; cmd_descr[50].text = "SET MAX ADDRESS EXT"; cmd_descr[51].command = 47U; cmd_descr[51].text = "READ LOG EXT"; cmd_descr[52].command = 63U; cmd_descr[52].text = "WRITE LOG EXT"; cmd_descr[53].command = 71U; cmd_descr[53].text = "READ LOG DMA EXT"; cmd_descr[54].command = 87U; cmd_descr[54].text = "WRITE LOG DMA EXT"; cmd_descr[55].command = 91U; cmd_descr[55].text = "TRUSTED NON-DATA"; cmd_descr[56].command = 92U; cmd_descr[56].text = "TRUSTED RECEIVE"; cmd_descr[57].command = 93U; cmd_descr[57].text = "TRUSTED RECEIVE DMA"; cmd_descr[58].command = 94U; cmd_descr[58].text = "TRUSTED SEND"; cmd_descr[59].command = 95U; cmd_descr[59].text = "TRUSTED SEND DMA"; cmd_descr[60].command = 228U; cmd_descr[60].text = "READ BUFFER"; cmd_descr[61].command = 233U; cmd_descr[61].text = "READ BUFFER DMA"; cmd_descr[62].command = 232U; cmd_descr[62].text = "WRITE BUFFER"; cmd_descr[63].command = 235U; cmd_descr[63].text = "WRITE BUFFER DMA"; cmd_descr[64].command = 177U; cmd_descr[64].text = "DEVICE CONFIGURATION OVERLAY"; cmd_descr[65].command = 241U; cmd_descr[65].text = "SECURITY SET PASSWORD"; cmd_descr[66].command = 242U; cmd_descr[66].text = "SECURITY UNLOCK"; cmd_descr[67].command = 243U; cmd_descr[67].text = "SECURITY ERASE PREPARE"; cmd_descr[68].command = 244U; cmd_descr[68].text = "SECURITY ERASE UNIT"; cmd_descr[69].command = 245U; cmd_descr[69].text = "SECURITY FREEZE LOCK"; cmd_descr[70].command = 246U; cmd_descr[70].text = "SECURITY DISABLE PASSWORD"; cmd_descr[71].command = 81U; cmd_descr[71].text = "CONFIGURE STREAM"; cmd_descr[72].command = 176U; cmd_descr[72].text = "SMART"; cmd_descr[73].command = 222U; cmd_descr[73].text = "DOOR LOCK"; cmd_descr[74].command = 223U; cmd_descr[74].text = "DOOR UNLOCK"; cmd_descr[75].command = 6U; cmd_descr[75].text = "DATA SET MANAGEMENT"; cmd_descr[76].command = 209U; cmd_descr[76].text = "CHECK MEDIA CARD TYPE"; cmd_descr[77].command = 3U; cmd_descr[77].text = "CFA REQUEST EXTENDED OLD_ERROR"; cmd_descr[78].command = 56U; cmd_descr[78].text = "CFA WRITE SECTORS WITHOUT ERASE"; cmd_descr[79].command = 135U; cmd_descr[79].text = "CFA TRANSLATE SECTOR"; cmd_descr[80].command = 192U; cmd_descr[80].text = "CFA ERASE SECTORS"; cmd_descr[81].command = 205U; cmd_descr[81].text = "CFA WRITE MULTIPLE WITHOUT ERASE"; cmd_descr[82].command = 11U; cmd_descr[82].text = "REQUEST SENSE DATA EXT"; cmd_descr[83].command = 180U; cmd_descr[83].text = "SANITIZE DEVICE"; cmd_descr[84].command = 34U; cmd_descr[84].text = "READ LONG (with retries)"; cmd_descr[85].command = 35U; cmd_descr[85].text = "READ LONG (without retries)"; cmd_descr[86].command = 50U; cmd_descr[86].text = "WRITE LONG (with retries)"; cmd_descr[87].command = 51U; cmd_descr[87].text = "WRITE LONG (without retries)"; cmd_descr[88].command = 16U; cmd_descr[88].text = "RECALIBRATE"; cmd_descr[89].command = 0U; cmd_descr[89].text = (char const *)0; i = 0U; goto ldv_44732; ldv_44731: ; if ((int )cmd_descr[i].command == (int )command) { return (cmd_descr[i].text); } else { } i = i + 1U; ldv_44732: ; if ((unsigned long )cmd_descr[i].text != (unsigned long )((char const */* const */)0)) { goto ldv_44731; } else { } return ((char const *)0); } } static char const __kstrtab_ata_get_cmd_descript[21U] = { 'a', 't', 'a', '_', 'g', 'e', 't', '_', 'c', 'm', 'd', '_', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', '\000'}; struct kernel_symbol const __ksymtab_ata_get_cmd_descript ; struct kernel_symbol const __ksymtab_ata_get_cmd_descript = {(unsigned long )(& ata_get_cmd_descript), (char const *)(& __kstrtab_ata_get_cmd_descript)}; static void ata_eh_link_report(struct ata_link *link ) { struct ata_port *ap ; struct ata_eh_context *ehc ; char const *frozen ; char const *desc ; char tries_buf[6U] ; unsigned int tmp ; int tag ; int nr_failed ; struct ata_queued_cmd *qc ; struct ata_queued_cmd *tmp___0 ; struct ata_link *tmp___1 ; struct ata_queued_cmd *qc___0 ; struct ata_queued_cmd *tmp___2 ; struct ata_taskfile *cmd ; struct ata_taskfile *res ; char data_buf[20U] ; unsigned int tmp___3 ; char cdb_buf[70U] ; unsigned int tmp___4 ; struct ata_link *tmp___5 ; char const *dma_str[3U] ; char const *prot_str[8U] ; u8 const *cdb ; size_t cdb_len ; char const *descr ; char const *tmp___6 ; int tmp___7 ; char const *tmp___8 ; { ap = link->ap; ehc = & link->eh_context; tries_buf[0] = '\000'; tmp = 1U; while (1) { if (tmp >= 6U) { break; } else { } tries_buf[tmp] = (char)0; tmp = tmp + 1U; } nr_failed = 0; if ((ehc->i.flags & 8U) != 0U) { return; } else { } desc = (char const *)0; if ((int )((signed char )ehc->i.desc[0]) != 0) { desc = (char const *)(& ehc->i.desc); } else { } tag = 0; goto ldv_44754; ldv_44753: tmp___0 = __ata_qc_from_tag(ap, (unsigned int )tag); qc = tmp___0; if ((qc->flags & 65536UL) == 0UL) { goto ldv_44752; } else { tmp___1 = ata_dev_phys_link(qc->dev); if ((unsigned long )tmp___1 != (unsigned long )link) { goto ldv_44752; } else if ((qc->flags & 64UL) != 0UL && qc->err_mask == 1U) { goto ldv_44752; } else { } } if ((qc->flags & 131072UL) != 0UL && qc->err_mask == 0U) { goto ldv_44752; } else { } nr_failed = nr_failed + 1; ldv_44752: tag = tag + 1; ldv_44754: ; if (tag <= 31) { goto ldv_44753; } else { } if (nr_failed == 0 && ehc->i.err_mask == 0U) { return; } else { } frozen = ""; if ((ap->pflags & 4U) != 0U) { frozen = " frozen"; } else { } if (ap->eh_tries <= 4) { snprintf((char *)(& tries_buf), 6UL, " t%d", ap->eh_tries); } else { } if ((unsigned long )ehc->i.dev != (unsigned long )((struct ata_device *)0)) { ata_dev_printk((struct ata_device const *)ehc->i.dev, "\v", "exception Emask 0x%x SAct 0x%x SErr 0x%x action 0x%x%s%s\n", ehc->i.err_mask, link->sactive, ehc->i.serror, ehc->i.action, frozen, (char *)(& tries_buf)); if ((unsigned long )desc != (unsigned long )((char const *)0)) { ata_dev_printk((struct ata_device const *)ehc->i.dev, "\v", "%s\n", desc); } else { } } else { ata_link_printk((struct ata_link const *)link, "\v", "exception Emask 0x%x SAct 0x%x SErr 0x%x action 0x%x%s%s\n", ehc->i.err_mask, link->sactive, ehc->i.serror, ehc->i.action, frozen, (char *)(& tries_buf)); if ((unsigned long )desc != (unsigned long )((char const *)0)) { ata_link_printk((struct ata_link const *)link, "\v", "%s\n", desc); } else { } } if (ehc->i.serror != 0U) { ata_link_printk((struct ata_link const *)link, "\v", "SError: { %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s}\n", (int )ehc->i.serror & 1 ? (char *)"RecovData " : (char *)"", (ehc->i.serror & 2U) != 0U ? (char *)"RecovComm " : (char *)"", (ehc->i.serror & 256U) != 0U ? (char *)"UnrecovData " : (char *)"", (ehc->i.serror & 512U) != 0U ? (char *)"Persist " : (char *)"", (ehc->i.serror & 1024U) != 0U ? (char *)"Proto " : (char *)"", (ehc->i.serror & 2048U) != 0U ? (char *)"HostInt " : (char *)"", (ehc->i.serror & 65536U) != 0U ? (char *)"PHYRdyChg " : (char *)"", (ehc->i.serror & 131072U) != 0U ? (char *)"PHYInt " : (char *)"", (ehc->i.serror & 262144U) != 0U ? (char *)"CommWake " : (char *)"", (ehc->i.serror & 524288U) != 0U ? (char *)"10B8B " : (char *)"", (ehc->i.serror & 1048576U) != 0U ? (char *)"Dispar " : (char *)"", (ehc->i.serror & 2097152U) != 0U ? (char *)"BadCRC " : (char *)"", (ehc->i.serror & 4194304U) != 0U ? (char *)"Handshk " : (char *)"", (ehc->i.serror & 8388608U) != 0U ? (char *)"LinkSeq " : (char *)"", (ehc->i.serror & 16777216U) != 0U ? (char *)"TrStaTrns " : (char *)"", (ehc->i.serror & 33554432U) != 0U ? (char *)"UnrecFIS " : (char *)"", (ehc->i.serror & 67108864U) != 0U ? (char *)"DevExch " : (char *)""); } else { } tag = 0; goto ldv_44768; ldv_44767: tmp___2 = __ata_qc_from_tag(ap, (unsigned int )tag); qc___0 = tmp___2; cmd = & qc___0->tf; res = & qc___0->result_tf; data_buf[0] = '\000'; tmp___3 = 1U; while (1) { if (tmp___3 >= 20U) { break; } else { } data_buf[tmp___3] = (char)0; tmp___3 = tmp___3 + 1U; } cdb_buf[0] = '\000'; tmp___4 = 1U; while (1) { if (tmp___4 >= 70U) { break; } else { } cdb_buf[tmp___4] = (char)0; tmp___4 = tmp___4 + 1U; } if ((qc___0->flags & 65536UL) == 0UL) { goto ldv_44761; } else { tmp___5 = ata_dev_phys_link(qc___0->dev); if ((unsigned long )tmp___5 != (unsigned long )link) { goto ldv_44761; } else if (qc___0->err_mask == 0U) { goto ldv_44761; } else { } } if (qc___0->dma_dir != 3) { dma_str[0] = "bidi"; dma_str[1] = "out"; dma_str[2] = "in"; prot_str[0] = 0; prot_str[1] = 0; prot_str[2] = "pio"; prot_str[3] = "dma"; prot_str[4] = "ncq"; prot_str[5] = 0; prot_str[6] = "pio"; prot_str[7] = "dma"; snprintf((char *)(& data_buf), 20UL, " %s %u %s", prot_str[(int )qc___0->tf.protocol], qc___0->nbytes, dma_str[qc___0->dma_dir]); } else { } tmp___7 = ata_is_atapi((int )qc___0->tf.protocol); if (tmp___7 != 0) { cdb = (u8 const *)(& qc___0->cdb); cdb_len = (size_t )(qc___0->dev)->cdb_len; if ((unsigned long )qc___0->scsicmd != (unsigned long )((struct scsi_cmnd *)0)) { cdb = (u8 const *)(qc___0->scsicmd)->cmnd; cdb_len = (size_t )(qc___0->scsicmd)->cmd_len; } else { } __scsi_format_command((char *)(& cdb_buf), 70UL, cdb, cdb_len); } else { tmp___6 = ata_get_cmd_descript((int )cmd->command); descr = tmp___6; if ((unsigned long )descr != (unsigned long )((char const *)0)) { ata_dev_printk((struct ata_device const *)qc___0->dev, "\v", "failed command: %s\n", descr); } else { } } tmp___8 = ata_err_string(qc___0->err_mask); ata_dev_printk((struct ata_device const *)qc___0->dev, "\v", "cmd %02x/%02x:%02x:%02x:%02x:%02x/%02x:%02x:%02x:%02x:%02x/%02x tag %d%s\n %sres %02x/%02x:%02x:%02x:%02x:%02x/%02x:%02x:%02x:%02x:%02x/%02x Emask 0x%x (%s)%s\n", (int )cmd->command, (int )cmd->feature, (int )cmd->nsect, (int )cmd->lbal, (int )cmd->lbam, (int )cmd->lbah, (int )cmd->hob_feature, (int )cmd->hob_nsect, (int )cmd->hob_lbal, (int )cmd->hob_lbam, (int )cmd->hob_lbah, (int )cmd->device, qc___0->tag, (char *)(& data_buf), (char *)(& cdb_buf), (int )res->command, (int )res->feature, (int )res->nsect, (int )res->lbal, (int )res->lbam, (int )res->lbah, (int )res->hob_feature, (int )res->hob_nsect, (int )res->hob_lbal, (int )res->hob_lbam, (int )res->hob_lbah, (int )res->device, qc___0->err_mask, tmp___8, (qc___0->err_mask & 1024U) != 0U ? (char *)" " : (char *)""); if (((int )res->command & 235) != 0) { if ((int )((signed char )res->command) < 0) { ata_dev_printk((struct ata_device const *)qc___0->dev, "\v", "status: { Busy }\n"); } else { ata_dev_printk((struct ata_device const *)qc___0->dev, "\v", "status: { %s%s%s%s%s}\n", ((int )res->command & 64) != 0 ? (char *)"DRDY " : (char *)"", ((int )res->command & 32) != 0 ? (char *)"DF " : (char *)"", ((int )res->command & 8) != 0 ? (char *)"DRQ " : (char *)"", ((int )res->command & 2) != 0 ? (char *)"SENSE " : (char *)"", (int )res->command & 1 ? (char *)"ERR " : (char *)""); } } else { } if ((unsigned int )cmd->command != 160U && ((int )res->feature & 213) != 0) { ata_dev_printk((struct ata_device const *)qc___0->dev, "\v", "error: { %s%s%s%s%s}\n", (int )((signed char )res->feature) < 0 ? (char *)"ICRC " : (char *)"", ((int )res->feature & 64) != 0 ? (char *)"UNC " : (char *)"", (int )res->feature & 1 ? (char *)"AMNF " : (char *)"", ((int )res->feature & 16) != 0 ? (char *)"IDNF " : (char *)"", ((int )res->feature & 4) != 0 ? (char *)"ABRT " : (char *)""); } else { } ldv_44761: tag = tag + 1; ldv_44768: ; if (tag <= 31) { goto ldv_44767; } else { } return; } } void ata_eh_report(struct ata_port *ap ) { struct ata_link *link ; { link = ata_link_next((struct ata_link *)0, ap, 1); goto ldv_44775; ldv_44774: ata_eh_link_report(link); link = ata_link_next(link, ap, 1); ldv_44775: ; if ((unsigned long )link != (unsigned long )((struct ata_link *)0)) { goto ldv_44774; } else { } return; } } static int ata_do_reset(struct ata_link *link , int (*reset)(struct ata_link * , unsigned int * , unsigned long ) , unsigned int *classes , unsigned long deadline , bool clear_classes ) { struct ata_device *dev ; int tmp ; { if ((int )clear_classes) { dev = ata_dev_next((struct ata_device *)0, link, 2); goto ldv_44786; ldv_44785: *(classes + (unsigned long )dev->devno) = 0U; dev = ata_dev_next(dev, link, 2); ldv_44786: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_44785; } else { } } else { } tmp = (*reset)(link, classes, deadline); return (tmp); } } static int ata_eh_followup_srst_needed(struct ata_link *link , int rc ) { bool tmp ; bool tmp___0 ; int tmp___1 ; { if ((link->flags & 4U) != 0U) { return (0); } else { tmp = ata_link_offline(link); if ((int )tmp) { return (0); } else { } } if (rc == -11) { return (1); } else { } tmp___0 = sata_pmp_supported(link->ap); if ((int )tmp___0) { tmp___1 = ata_is_host_link((struct ata_link const *)link); if (tmp___1 != 0) { return (1); } else { } } else { } return (0); } } int ata_eh_reset(struct ata_link *link , int classify , int (*prereset)(struct ata_link * , unsigned long ) , int (*softreset)(struct ata_link * , unsigned int * , unsigned long ) , int (*hardreset)(struct ata_link * , unsigned int * , unsigned long ) , void (*postreset)(struct ata_link * , unsigned int * ) ) { struct ata_port *ap ; struct ata_link *slave ; struct ata_eh_context *ehc ; struct ata_eh_context *sehc ; unsigned int *classes ; unsigned int lflags ; int verbose ; int max_tries ; int try ; struct ata_link *failed_link ; struct ata_device *dev ; unsigned long deadline ; unsigned long now ; int (*reset)(struct ata_link * , unsigned int * , unsigned long ) ; unsigned long flags ; u32 sstatus ; int nr_unknown ; int rc ; int __ret_warn_on ; long tmp ; raw_spinlock_t *tmp___0 ; unsigned long deadline___0 ; unsigned long tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; int tmp___6 ; int tmp___7 ; struct ata_link *tmp___8 ; bool tmp___9 ; int tmp___10 ; int tmp___11 ; int tmp___12 ; raw_spinlock_t *tmp___13 ; unsigned int tmp___14 ; struct ata_link *tmp___15 ; bool tmp___16 ; struct ata_link *tmp___17 ; bool tmp___18 ; raw_spinlock_t *tmp___19 ; int tmp___20 ; int tmp___21 ; int tmp___22 ; unsigned long delta ; unsigned int tmp___23 ; long tmp___24 ; int tmp___25 ; { ap = link->ap; slave = ap->slave_link; ehc = & link->eh_context; sehc = (unsigned long )slave != (unsigned long )((struct ata_link *)0) ? & slave->eh_context : (struct ata_eh_context *)0; classes = (unsigned int *)(& ehc->classes); lflags = link->flags; verbose = (ehc->i.flags & 8U) == 0U; max_tries = 0; try = 0; goto ldv_44819; ldv_44818: max_tries = max_tries + 1; ldv_44819: ; if ((unsigned long )ata_eh_reset_timeouts[max_tries] != 0xffffffffffffffffUL) { goto ldv_44818; } else { } if ((link->flags & 512U) != 0U) { max_tries = 1; } else { } if ((link->flags & 2U) != 0U) { hardreset = (int (*)(struct ata_link * , unsigned int * , unsigned long ))0; } else { } if ((link->flags & 4U) != 0U) { softreset = (int (*)(struct ata_link * , unsigned int * , unsigned long ))0; } else { } if ((ehc->i.flags & 196608U) != 0U) { now = jiffies; __ret_warn_on = (long )(now - ehc->last_reset) < 0L; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-eh.c", 2765); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); deadline = ata_deadline(ehc->last_reset, 5000UL); if ((long )(now - deadline) < 0L) { schedule_timeout_uninterruptible((long )(deadline - now)); } else { } } else { } tmp___0 = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp___0); ap->pflags = ap->pflags | 256U; spin_unlock_irqrestore(ap->lock, flags); ata_eh_about_to_do(link, (struct ata_device *)0, 6U); dev = ata_dev_next((struct ata_device *)0, link, 2); goto ldv_44839; ldv_44838: dev->pio_mode = 8U; dev->dma_mode = 255U; if ((unsigned long )(ap->ops)->set_piomode != (unsigned long )((void (*)(struct ata_port * , struct ata_device * ))0)) { (*((ap->ops)->set_piomode))(ap, dev); } else { } dev = ata_dev_next(dev, link, 2); ldv_44839: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_44838; } else { } reset = (int (*)(struct ata_link * , unsigned int * , unsigned long ))0; ehc->i.action = ehc->i.action & 4294967289U; if ((unsigned long )hardreset != (unsigned long )((int (*)(struct ata_link * , unsigned int * , unsigned long ))0)) { reset = hardreset; ehc->i.action = ehc->i.action | 4U; } else if ((unsigned long )softreset != (unsigned long )((int (*)(struct ata_link * , unsigned int * , unsigned long ))0)) { reset = softreset; ehc->i.action = ehc->i.action | 2U; } else { } if ((unsigned long )prereset != (unsigned long )((int (*)(struct ata_link * , unsigned long ))0)) { tmp___1 = ata_deadline(jiffies, 10000UL); deadline___0 = tmp___1; if ((unsigned long )slave != (unsigned long )((struct ata_link *)0)) { sehc->i.action = sehc->i.action & 4294967289U; sehc->i.action = sehc->i.action | ehc->i.action; } else { } rc = (*prereset)(link, deadline___0); if ((unsigned long )slave != (unsigned long )((struct ata_link *)0) && (rc == 0 || rc == -2)) { tmp___2 = (*prereset)(slave, deadline___0); if (tmp___2 != -2) { rc = tmp___2; } else { } ehc->i.action = ehc->i.action | sehc->i.action; } else { } if (rc != 0) { if (rc == -2) { ata_link_printk((struct ata_link const *)link, "\017", "port disabled--ignoring\n"); ehc->i.action = ehc->i.action & 4294967289U; dev = ata_dev_next((struct ata_device *)0, link, 2); goto ldv_44844; ldv_44843: *(classes + (unsigned long )dev->devno) = 10U; dev = ata_dev_next(dev, link, 2); ldv_44844: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_44843; } else { } rc = 0; } else { ata_link_printk((struct ata_link const *)link, "\v", "prereset failed (errno=%d)\n", rc); } goto out; } else { } if ((unsigned long )reset != (unsigned long )((int (*)(struct ata_link * , unsigned int * , unsigned long ))0) && (ehc->i.action & 6U) == 0U) { dev = ata_dev_next((struct ata_device *)0, link, 2); goto ldv_44848; ldv_44847: *(classes + (unsigned long )dev->devno) = 10U; dev = ata_dev_next(dev, link, 2); ldv_44848: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_44847; } else { } if ((ap->pflags & 4U) != 0U) { tmp___3 = ata_is_host_link((struct ata_link const *)link); if (tmp___3 != 0) { ata_eh_thaw_port(ap); } else { } } else { } rc = 0; goto out; } else { } } else { } retry: tmp___4 = ata_is_host_link((struct ata_link const *)link); if (tmp___4 != 0) { ata_eh_freeze_port(ap); } else { } tmp___5 = try; try = try + 1; deadline = ata_deadline(jiffies, ata_eh_reset_timeouts[tmp___5]); if ((unsigned long )reset != (unsigned long )((int (*)(struct ata_link * , unsigned int * , unsigned long ))0)) { if (verbose != 0) { ata_link_printk((struct ata_link const *)link, "\016", "%s resetting link\n", (unsigned long )reset == (unsigned long )softreset ? (char *)"soft" : (char *)"hard"); } else { } ehc->last_reset = jiffies; if ((unsigned long )reset == (unsigned long )hardreset) { ehc->i.flags = ehc->i.flags | 131072U; } else { ehc->i.flags = ehc->i.flags | 65536U; } rc = ata_do_reset(link, reset, classes, deadline, 1); if (rc != 0 && rc != -11) { failed_link = link; goto fail; } else { } if ((unsigned long )slave != (unsigned long )((struct ata_link *)0) && (unsigned long )reset == (unsigned long )hardreset) { if (verbose != 0) { ata_link_printk((struct ata_link const *)slave, "\016", "hard resetting link\n"); } else { } ata_eh_about_to_do(slave, (struct ata_device *)0, 6U); tmp___6 = ata_do_reset(slave, reset, classes, deadline, 0); switch (tmp___6) { case -11: rc = -11; case 0: ; goto ldv_44855; default: failed_link = slave; rc = tmp___6; goto fail; } ldv_44855: ; } else { } if ((unsigned long )reset == (unsigned long )hardreset) { tmp___7 = ata_eh_followup_srst_needed(link, rc); if (tmp___7 != 0) { reset = softreset; if ((unsigned long )reset == (unsigned long )((int (*)(struct ata_link * , unsigned int * , unsigned long ))0)) { ata_link_printk((struct ata_link const *)link, "\v", "follow-up softreset required but no softreset available\n"); failed_link = link; rc = -22; goto fail; } else { } ata_eh_about_to_do(link, (struct ata_device *)0, 6U); rc = ata_do_reset(link, reset, classes, deadline, 1); if (rc != 0) { failed_link = link; goto fail; } else { } } else { } } else { } } else { if (verbose != 0) { ata_link_printk((struct ata_link const *)link, "\016", "no reset method available, skipping reset\n"); } else { } if ((lflags & 24U) == 0U) { lflags = lflags | 8U; } else { } } dev = ata_dev_next((struct ata_device *)0, link, 2); goto ldv_44859; ldv_44858: dev->pio_mode = 8U; dev->flags = dev->flags & 0xffffffffffff7fffUL; tmp___8 = ata_dev_phys_link(dev); tmp___9 = ata_phys_link_offline(tmp___8); if ((int )tmp___9) { goto ldv_44857; } else { } if ((lflags & 8U) != 0U) { *(classes + (unsigned long )dev->devno) = 1U; } else if ((lflags & 16U) != 0U) { *(classes + (unsigned long )dev->devno) = 8U; } else { } ldv_44857: dev = ata_dev_next(dev, link, 2); ldv_44859: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_44858; } else { } tmp___10 = sata_scr_read(link, 0, & sstatus); if (tmp___10 == 0) { link->sata_spd = (sstatus >> 4) & 15U; } else { } if ((unsigned long )slave != (unsigned long )((struct ata_link *)0)) { tmp___11 = sata_scr_read(slave, 0, & sstatus); if (tmp___11 == 0) { slave->sata_spd = (sstatus >> 4) & 15U; } else { } } else { } tmp___12 = ata_is_host_link((struct ata_link const *)link); if (tmp___12 != 0) { ata_eh_thaw_port(ap); } else { } if ((unsigned long )postreset != (unsigned long )((void (*)(struct ata_link * , unsigned int * ))0)) { (*postreset)(link, classes); if ((unsigned long )slave != (unsigned long )((struct ata_link *)0)) { (*postreset)(slave, classes); } else { } } else { } tmp___13 = spinlock_check((link->ap)->lock); flags = _raw_spin_lock_irqsave(tmp___13); memset((void *)(& link->eh_info), 0, 120UL); if ((unsigned long )slave != (unsigned long )((struct ata_link *)0)) { memset((void *)(& slave->eh_info), 0, 120UL); } else { } ap->pflags = ap->pflags & 4294967294U; spin_unlock_irqrestore((link->ap)->lock, flags); if ((ap->pflags & 4U) != 0U) { ata_eh_thaw_port(ap); } else { } nr_unknown = 0; dev = ata_dev_next((struct ata_device *)0, link, 2); goto ldv_44865; ldv_44864: tmp___17 = ata_dev_phys_link(dev); tmp___18 = ata_phys_link_online(tmp___17); if ((int )tmp___18) { if (*(classes + (unsigned long )dev->devno) == 0U) { ata_dev_printk((struct ata_device const *)dev, "\017", "link online but device misclassified\n"); *(classes + (unsigned long )dev->devno) = 10U; nr_unknown = nr_unknown + 1; } else { } } else { tmp___15 = ata_dev_phys_link(dev); tmp___16 = ata_phys_link_offline(tmp___15); if ((int )tmp___16) { tmp___14 = ata_class_enabled(*(classes + (unsigned long )dev->devno)); if (tmp___14 != 0U) { ata_dev_printk((struct ata_device const *)dev, "\017", "link offline, clearing class %d to NONE\n", *(classes + (unsigned long )dev->devno)); } else { } *(classes + (unsigned long )dev->devno) = 10U; } else if (*(classes + (unsigned long )dev->devno) == 0U) { ata_dev_printk((struct ata_device const *)dev, "\017", "link status unknown, clearing UNKNOWN to NONE\n"); *(classes + (unsigned long )dev->devno) = 10U; } else { } } dev = ata_dev_next(dev, link, 2); ldv_44865: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_44864; } else { } if (classify != 0 && nr_unknown != 0) { if (try < max_tries) { ata_link_printk((struct ata_link const *)link, "\f", "link online but %d devices misclassified, retrying\n", nr_unknown); failed_link = link; rc = -11; goto fail; } else { } ata_link_printk((struct ata_link const *)link, "\f", "link online but %d devices misclassified, device detection might fail\n", nr_unknown); } else { } ata_eh_done(link, (struct ata_device *)0, 6U); if ((unsigned long )slave != (unsigned long )((struct ata_link *)0)) { ata_eh_done(slave, (struct ata_device *)0, 6U); } else { } ehc->last_reset = jiffies; ehc->i.action = ehc->i.action | 1U; link->lpm_policy = 0; rc = 0; out: ehc->i.flags = ehc->i.flags & 4294967294U; if ((unsigned long )slave != (unsigned long )((struct ata_link *)0)) { sehc->i.flags = sehc->i.flags & 4294967294U; } else { } tmp___19 = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp___19); ap->pflags = ap->pflags & 4294967039U; spin_unlock_irqrestore(ap->lock, flags); return (rc); fail: tmp___20 = ata_is_host_link((struct ata_link const *)link); if (tmp___20 == 0) { tmp___21 = sata_scr_read(link, 0, & sstatus); if (tmp___21 != 0) { rc = -85; } else { } } else { } if (try >= max_tries) { tmp___22 = ata_is_host_link((struct ata_link const *)link); if (tmp___22 != 0) { ata_eh_thaw_port(ap); } else { } goto out; } else { } now = jiffies; if ((long )(now - deadline) < 0L) { delta = deadline - now; tmp___23 = jiffies_to_msecs(delta); ata_link_printk((struct ata_link const *)failed_link, "\f", "reset failed (errno=%d), retrying in %u secs\n", rc, (tmp___23 + 999U) / 1000U); ata_eh_release(ap); goto ldv_44878; ldv_44877: tmp___24 = schedule_timeout_uninterruptible((long )delta); delta = (unsigned long )tmp___24; ldv_44878: ; if (delta != 0UL) { goto ldv_44877; } else { } ata_eh_acquire(ap); } else { } if (rc == -85) { tmp___25 = ata_is_host_link((struct ata_link const *)link); if (tmp___25 != 0) { ata_eh_thaw_port(ap); } else { } goto out; } else { } if (max_tries + -1 == try) { sata_down_spd_limit(link, 0U); if ((unsigned long )slave != (unsigned long )((struct ata_link *)0)) { sata_down_spd_limit(slave, 0U); } else { } } else if (rc == -32) { sata_down_spd_limit(failed_link, 0U); } else { } if ((unsigned long )hardreset != (unsigned long )((int (*)(struct ata_link * , unsigned int * , unsigned long ))0)) { reset = hardreset; } else { } goto retry; } } __inline static void ata_eh_pull_park_action(struct ata_port *ap ) { struct ata_link *link ; struct ata_device *dev ; unsigned long flags ; raw_spinlock_t *tmp ; struct ata_eh_info *ehi ; { tmp = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp); reinit_completion(& ap->park_req_pending); link = ata_link_next((struct ata_link *)0, ap, 0); goto ldv_44894; ldv_44893: dev = ata_dev_next((struct ata_device *)0, link, 2); goto ldv_44891; ldv_44890: ehi = & link->eh_info; link->eh_context.i.dev_action[dev->devno] = link->eh_context.i.dev_action[dev->devno] | (ehi->dev_action[dev->devno] & 32U); ata_eh_clear_action(link, dev, ehi, 32U); dev = ata_dev_next(dev, link, 2); ldv_44891: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_44890; } else { } link = ata_link_next(link, ap, 0); ldv_44894: ; if ((unsigned long )link != (unsigned long )((struct ata_link *)0)) { goto ldv_44893; } else { } spin_unlock_irqrestore(ap->lock, flags); return; } } static void ata_eh_park_issue_cmd(struct ata_device *dev , int park ) { struct ata_eh_context *ehc ; struct ata_taskfile tf ; unsigned int err_mask ; { ehc = & (dev->link)->eh_context; ata_tf_init(dev, & tf); if (park != 0) { ehc->unloaded_mask = ehc->unloaded_mask | (unsigned int )(1 << (int )dev->devno); tf.command = 225U; tf.feature = 68U; tf.lbal = 76U; tf.lbam = 78U; tf.lbah = 85U; } else { ehc->unloaded_mask = ehc->unloaded_mask & (unsigned int )(~ (1 << (int )dev->devno)); tf.command = 229U; } tf.flags = tf.flags | 6UL; tf.protocol = (u8 )((unsigned int )tf.protocol | 1U); err_mask = ata_exec_internal(dev, & tf, (u8 const *)0U, 3, (void *)0, 0U, 0UL); if (park != 0 && (err_mask != 0U || (unsigned int )tf.lbal != 196U)) { ata_dev_printk((struct ata_device const *)dev, "\v", "head unload failed!\n"); ehc->unloaded_mask = ehc->unloaded_mask & (unsigned int )(~ (1 << (int )dev->devno)); } else { } return; } } static int ata_eh_revalidate_and_attach(struct ata_link *link , struct ata_device **r_failed_dev ) { struct ata_port *ap ; struct ata_eh_context *ehc ; struct ata_device *dev ; unsigned int new_mask ; unsigned long flags ; int rc ; unsigned int action ; unsigned int tmp ; unsigned int readid_flags ; int __ret_warn_on ; long tmp___0 ; struct ata_link *tmp___1 ; bool tmp___2 ; unsigned int tmp___3 ; unsigned int tmp___4 ; int tmp___5 ; int tmp___6 ; raw_spinlock_t *tmp___7 ; { ap = link->ap; ehc = & link->eh_context; new_mask = 0U; rc = 0; dev = ata_dev_next((struct ata_device *)0, link, 3); goto ldv_44923; ldv_44922: tmp = ata_eh_dev_action(dev); action = tmp; readid_flags = 0U; if ((ehc->i.flags & 196608U) != 0U) { readid_flags = readid_flags | 1U; } else { } if ((int )action & 1) { tmp___4 = ata_dev_enabled((struct ata_device const *)dev); if (tmp___4 != 0U) { __ret_warn_on = dev->class == 5U; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-eh.c", 3218); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); tmp___1 = ata_dev_phys_link(dev); tmp___2 = ata_phys_link_offline(tmp___1); if ((int )tmp___2) { rc = -5; goto err; } else { } ata_eh_about_to_do(link, dev, 1U); rc = ata_dev_revalidate(dev, ehc->classes[dev->devno], readid_flags); if (rc != 0) { goto err; } else { } ata_eh_done(link, dev, 1U); ehc->i.flags = ehc->i.flags | 524288U; schedule_work(& ap->scsi_rescan_task); } else { goto _L; } } else _L: /* CIL Label */ if (dev->class == 0U && ehc->tries[dev->devno] != 0) { tmp___3 = ata_class_enabled(ehc->classes[dev->devno]); if (tmp___3 != 0U) { dev->class = ehc->classes[dev->devno]; if (dev->class == 5U) { rc = sata_pmp_attach(dev); } else { rc = ata_dev_read_id(dev, & dev->class, readid_flags, (u16 *)(& dev->__annonCompField86.id)); } ehc->classes[dev->devno] = dev->class; dev->class = 0U; switch (rc) { case 0: ata_ering_clear(& dev->ering); new_mask = (unsigned int )(1 << (int )dev->devno) | new_mask; goto ldv_44919; case -2: ata_eh_thaw_port(ap); goto ldv_44919; default: ; goto err; } ldv_44919: ; } else { } } else { } dev = ata_dev_next(dev, link, 3); ldv_44923: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_44922; } else { } if ((ehc->i.flags & 196608U) != 0U) { tmp___6 = ata_is_host_link((struct ata_link const *)link); if (tmp___6 != 0) { if ((unsigned long )(ap->ops)->cable_detect != (unsigned long )((int (*)(struct ata_port * ))0)) { tmp___5 = (*((ap->ops)->cable_detect))(ap); ap->cbl = (unsigned int )tmp___5; } else { } ata_force_cbl(ap); } else { } } else { } dev = ata_dev_next((struct ata_device *)0, link, 2); goto ldv_44930; ldv_44929: ; if (((unsigned int )(1 << (int )dev->devno) & new_mask) == 0U) { goto ldv_44925; } else { } dev->class = ehc->classes[dev->devno]; if (dev->class == 5U) { goto ldv_44925; } else { } ehc->i.flags = ehc->i.flags | 262144U; rc = ata_dev_configure(dev); ehc->i.flags = ehc->i.flags & 4294705151U; if (rc != 0) { dev->class = 0U; goto err; } else { } tmp___7 = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp___7); ap->pflags = ap->pflags | 64U; spin_unlock_irqrestore(ap->lock, flags); ehc->i.flags = ehc->i.flags | 524288U; ldv_44925: dev = ata_dev_next(dev, link, 2); ldv_44930: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_44929; } else { } return (0); err: *r_failed_dev = dev; return (rc); } } int ata_set_mode(struct ata_link *link , struct ata_device **r_failed_dev ) { struct ata_port *ap ; struct ata_device *dev ; int rc ; struct ata_ering_entry *ent ; struct ata_eh_context *ehc ; u8 saved_xfer_mode ; u8 saved_ncq ; int tmp ; { ap = link->ap; dev = ata_dev_next((struct ata_device *)0, link, 0); goto ldv_44941; ldv_44940: ; if ((dev->flags & 65536UL) == 0UL) { ent = ata_ering_top(& dev->ering); if ((unsigned long )ent != (unsigned long )((struct ata_ering_entry *)0)) { ent->eflags = ent->eflags & 4294967293U; } else { } } else { } dev = ata_dev_next(dev, link, 0); ldv_44941: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_44940; } else { } if ((unsigned long )(ap->ops)->set_mode != (unsigned long )((int (*)(struct ata_link * , struct ata_device ** ))0)) { rc = (*((ap->ops)->set_mode))(link, r_failed_dev); } else { rc = ata_do_set_mode(link, r_failed_dev); } dev = ata_dev_next((struct ata_device *)0, link, 0); goto ldv_44947; ldv_44946: ehc = & link->eh_context; saved_xfer_mode = ehc->saved_xfer_mode[dev->devno]; saved_ncq = (ehc->saved_ncq_enabled & (unsigned int )(1 << (int )dev->devno)) != 0U; if ((int )dev->xfer_mode != (int )saved_xfer_mode) { dev->flags = dev->flags | 65536UL; } else { tmp = ata_ncq_enabled(dev); if (tmp != (int )saved_ncq) { dev->flags = dev->flags | 65536UL; } else { } } dev = ata_dev_next(dev, link, 0); ldv_44947: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_44946; } else { } return (rc); } } static int atapi_eh_clear_ua(struct ata_device *dev ) { int i ; u8 *sense_buffer ; u8 sense_key ; unsigned int err_mask ; { i = 0; goto ldv_44957; ldv_44956: sense_buffer = (u8 *)(& ((dev->link)->ap)->sector_buf); sense_key = 0U; err_mask = atapi_eh_tur(dev, & sense_key); if (err_mask != 0U && err_mask != 1U) { ata_dev_printk((struct ata_device const *)dev, "\f", "TEST_UNIT_READY failed (err_mask=0x%x)\n", err_mask); return (-5); } else { } if (err_mask == 0U || (unsigned int )sense_key != 6U) { return (0); } else { } err_mask = atapi_eh_request_sense(dev, sense_buffer, (int )sense_key); if (err_mask != 0U) { ata_dev_printk((struct ata_device const *)dev, "\f", "failed to clear UNIT ATTENTION (err_mask=0x%x)\n", err_mask); return (-5); } else { } i = i + 1; ldv_44957: ; if (i <= 4) { goto ldv_44956; } else { } ata_dev_printk((struct ata_device const *)dev, "\f", "UNIT ATTENTION persists after %d tries\n", 5); return (0); } } static int ata_eh_maybe_retry_flush(struct ata_device *dev ) { struct ata_link *link ; struct ata_port *ap ; struct ata_queued_cmd *qc ; struct ata_taskfile tf ; unsigned int err_mask ; int rc ; unsigned int tmp ; int _max1 ; int _max2 ; { link = dev->link; ap = link->ap; rc = 0; tmp = ata_tag_valid(link->active_tag); if (tmp == 0U) { return (0); } else { } qc = __ata_qc_from_tag(ap, link->active_tag); if ((unsigned long )qc->dev != (unsigned long )dev || ((unsigned int )qc->tf.command != 234U && (unsigned int )qc->tf.command != 231U)) { return (0); } else { } if ((int )qc->err_mask & 1) { return (0); } else { } ata_tf_init(dev, & tf); tf.command = qc->tf.command; tf.flags = tf.flags | 4UL; tf.protocol = 1U; ata_dev_printk((struct ata_device const *)dev, "\f", "retrying FLUSH 0x%x Emask 0x%x\n", (int )tf.command, qc->err_mask); err_mask = ata_exec_internal(dev, & tf, (u8 const *)0U, 3, (void *)0, 0U, 0UL); if (err_mask == 0U) { _max1 = (qc->scsicmd)->allowed; _max2 = 1; (qc->scsicmd)->allowed = _max1 > _max2 ? _max1 : _max2; } else { ata_dev_printk((struct ata_device const *)dev, "\f", "FLUSH failed Emask 0x%x\n", err_mask); rc = -5; if ((int )err_mask & 1) { qc->err_mask = qc->err_mask | 1U; qc->result_tf = tf; if ((ap->pflags & 4U) == 0U) { rc = 0; } else { } } else { } } return (rc); } } static int ata_eh_set_lpm(struct ata_link *link , enum ata_lpm_policy policy , struct ata_device **r_failed_dev ) { struct ata_port *ap ; int tmp ; struct ata_eh_context *ehc ; struct ata_device *dev ; struct ata_device *link_dev ; struct ata_device *lpm_dev ; enum ata_lpm_policy old_policy ; bool no_dipm ; unsigned int hints ; unsigned int err_mask ; int rc ; bool hipm ; bool tmp___0 ; bool dipm ; bool tmp___1 ; bool tmp___2 ; { tmp = ata_is_host_link((struct ata_link const *)link); ap = tmp != 0 ? link->ap : (struct ata_port *)0; ehc = & link->eh_context; link_dev = (struct ata_device *)0; lpm_dev = (struct ata_device *)0; old_policy = link->lpm_policy; no_dipm = ((link->ap)->flags & 8388608UL) != 0UL; hints = 3U; if ((link->flags & 256U) != 0U || ((unsigned long )ap != (unsigned long )((struct ata_port *)0) && (unsigned long )(ap->ops)->set_lpm == (unsigned long )((int (*)(struct ata_link * , enum ata_lpm_policy , unsigned int ))0))) { return (0); } else { } dev = ata_dev_next((struct ata_device *)0, link, 0); goto ldv_44990; ldv_44989: tmp___0 = ata_id_has_hipm((u16 const *)(& dev->__annonCompField86.id)); hipm = tmp___0; tmp___1 = ata_id_has_dipm((u16 const *)(& dev->__annonCompField86.id)); dipm = (bool )((int )tmp___1 && ! no_dipm); if ((unsigned long )link_dev == (unsigned long )((struct ata_device *)0)) { link_dev = dev; } else { } if ((unsigned long )lpm_dev == (unsigned long )((struct ata_device *)0) && ((int )hipm || (int )dipm)) { lpm_dev = dev; } else { } hints = hints & 4294967294U; if (! hipm) { hints = hints & 4294967293U; } else { } if ((unsigned int )policy != 3U && (int )dipm) { err_mask = ata_dev_set_feature(dev, 144, 3); if (err_mask != 0U && err_mask != 1U) { ata_dev_printk((struct ata_device const *)dev, "\f", "failed to disable DIPM, Emask 0x%x\n", err_mask); rc = -5; goto fail; } else { } } else { } dev = ata_dev_next(dev, link, 0); ldv_44990: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_44989; } else { } if ((unsigned long )ap != (unsigned long )((struct ata_port *)0)) { rc = (*((ap->ops)->set_lpm))(link, policy, hints); if (rc == 0 && (unsigned long )ap->slave_link != (unsigned long )((struct ata_link *)0)) { rc = (*((ap->ops)->set_lpm))(ap->slave_link, policy, hints); } else { } } else { rc = sata_pmp_set_lpm(link, policy, hints); } if (rc != 0) { if (rc == -95) { link->flags = link->flags | 256U; return (0); } else { } dev = (unsigned long )lpm_dev != (unsigned long )((struct ata_device *)0) ? lpm_dev : link_dev; goto fail; } else { } link->lpm_policy = policy; if ((unsigned long )ap != (unsigned long )((struct ata_port *)0) && (unsigned long )ap->slave_link != (unsigned long )((struct ata_link *)0)) { (ap->slave_link)->lpm_policy = policy; } else { } dev = ata_dev_next((struct ata_device *)0, link, 0); goto ldv_44993; ldv_44992: ; if ((unsigned int )policy == 3U && ! no_dipm) { tmp___2 = ata_id_has_dipm((u16 const *)(& dev->__annonCompField86.id)); if ((int )tmp___2) { err_mask = ata_dev_set_feature(dev, 16, 3); if (err_mask != 0U && err_mask != 1U) { ata_dev_printk((struct ata_device const *)dev, "\f", "failed to enable DIPM, Emask 0x%x\n", err_mask); rc = -5; goto fail; } else { } } else { } } else { } dev = ata_dev_next(dev, link, 0); ldv_44993: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_44992; } else { } link->last_lpm_change = jiffies; link->flags = link->flags | 1024U; return (0); fail: link->lpm_policy = old_policy; if ((unsigned long )ap != (unsigned long )((struct ata_port *)0) && (unsigned long )ap->slave_link != (unsigned long )((struct ata_link *)0)) { (ap->slave_link)->lpm_policy = old_policy; } else { } if ((unsigned long )dev == (unsigned long )((struct ata_device *)0) || ehc->tries[dev->devno] <= 2) { ata_link_printk((struct ata_link const *)link, "\f", "disabling LPM on the link\n"); link->flags = link->flags | 256U; } else { } if ((unsigned long )r_failed_dev != (unsigned long )((struct ata_device **)0)) { *r_failed_dev = dev; } else { } return (rc); } } int ata_link_nr_enabled(struct ata_link *link ) { struct ata_device *dev ; int cnt ; { cnt = 0; dev = ata_dev_next((struct ata_device *)0, link, 0); goto ldv_45001; ldv_45000: cnt = cnt + 1; dev = ata_dev_next(dev, link, 0); ldv_45001: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_45000; } else { } return (cnt); } } static int ata_link_nr_vacant(struct ata_link *link ) { struct ata_device *dev ; int cnt ; { cnt = 0; dev = ata_dev_next((struct ata_device *)0, link, 2); goto ldv_45009; ldv_45008: ; if (dev->class == 0U) { cnt = cnt + 1; } else { } dev = ata_dev_next(dev, link, 2); ldv_45009: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_45008; } else { } return (cnt); } } static int ata_eh_skip_recovery(struct ata_link *link ) { struct ata_port *ap ; struct ata_eh_context *ehc ; struct ata_device *dev ; int tmp ; { ap = link->ap; ehc = & link->eh_context; if ((link->flags & 64U) != 0U) { return (1); } else { } if ((ehc->i.flags & 16U) != 0U) { return (1); } else { } if ((ap->pflags & 4U) != 0U) { return (0); } else { tmp = ata_link_nr_enabled(link); if (tmp != 0) { return (0); } else { } } if ((ehc->i.action & 6U) != 0U && (ehc->i.flags & 196608U) == 0U) { return (0); } else { } dev = ata_dev_next((struct ata_device *)0, link, 2); goto ldv_45018; ldv_45017: ; if (dev->class == 0U && ehc->classes[dev->devno] != 10U) { return (0); } else { } dev = ata_dev_next(dev, link, 2); ldv_45018: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_45017; } else { } return (1); } } static int ata_count_probe_trials_cb(struct ata_ering_entry *ent , void *void_arg ) { u64 interval ; unsigned long tmp ; u64 now ; u64 tmp___0 ; int *trials ; u64 _min1 ; u64 _min2 ; { tmp = msecs_to_jiffies(60000U); interval = (u64 )tmp; tmp___0 = get_jiffies_64(); now = tmp___0; trials = (int *)void_arg; if ((int )ent->eflags < 0) { return (-1); } else { _min1 = now; _min2 = interval; if (ent->timestamp < now - (_min1 < _min2 ? _min1 : _min2)) { return (-1); } else { } } *trials = *trials + 1; return (0); } } static int ata_eh_schedule_probe(struct ata_device *dev ) { struct ata_eh_context *ehc ; struct ata_link *link ; struct ata_link *tmp ; int trials ; int tmp___0 ; { ehc = & (dev->link)->eh_context; tmp = ata_dev_phys_link(dev); link = tmp; trials = 0; if ((ehc->i.probe_mask & (unsigned int )(1 << (int )dev->devno)) == 0U || (ehc->did_probe_mask & (unsigned int )(1 << (int )dev->devno)) != 0U) { return (0); } else { } ata_eh_detach_dev(dev); ata_dev_init(dev); ehc->did_probe_mask = ehc->did_probe_mask | (unsigned int )(1 << (int )dev->devno); ehc->i.action = ehc->i.action | 6U; ehc->saved_xfer_mode[dev->devno] = 0U; ehc->saved_ncq_enabled = ehc->saved_ncq_enabled & (unsigned int )(~ (1 << (int )dev->devno)); if ((unsigned int )link->lpm_policy > 1U) { tmp___0 = ata_is_host_link((struct ata_link const *)link); if (tmp___0 != 0) { (*(((link->ap)->ops)->set_lpm))(link, 1, 1U); } else { sata_pmp_set_lpm(link, 1, 1U); } } else { } ata_ering_record(& dev->ering, 0U, 256U); ata_ering_map(& dev->ering, & ata_count_probe_trials_cb, (void *)(& trials)); if (trials > 2) { sata_down_spd_limit(link, 1U); } else { } return (1); } } static int ata_eh_handle_dev_fail(struct ata_device *dev , int err ) { struct ata_eh_context *ehc ; int _min1 ; int _min2 ; struct ata_link *tmp ; struct ata_link *tmp___0 ; bool tmp___1 ; int tmp___2 ; unsigned int tmp___3 ; { ehc = & (dev->link)->eh_context; if (err != -11) { ehc->tries[dev->devno] = ehc->tries[dev->devno] - 1; } else { } switch (err) { case -19: ehc->i.probe_mask = ehc->i.probe_mask | (unsigned int )(1 << (int )dev->devno); case -22: _min1 = ehc->tries[dev->devno]; _min2 = 1; ehc->tries[dev->devno] = _min1 < _min2 ? _min1 : _min2; case -5: ; if (ehc->tries[dev->devno] == 1) { tmp = ata_dev_phys_link(dev); sata_down_spd_limit(tmp, 0U); if ((unsigned int )dev->pio_mode > 8U) { ata_down_xfermask_limit(dev, 0U); } else { } } else { } } tmp___3 = ata_dev_enabled((struct ata_device const *)dev); if (tmp___3 != 0U && ehc->tries[dev->devno] == 0) { ata_dev_disable(dev); tmp___0 = ata_dev_phys_link(dev); tmp___1 = ata_phys_link_offline(tmp___0); if ((int )tmp___1) { ata_eh_detach_dev(dev); } else { } tmp___2 = ata_eh_schedule_probe(dev); if (tmp___2 != 0) { ehc->tries[dev->devno] = 3; memset((void *)(& ehc->cmd_timeout_idx) + (unsigned long )dev->devno, 0, 24UL); } else { } return (1); } else { ehc->i.action = ehc->i.action | 6U; return (0); } } } int ata_eh_recover(struct ata_port *ap , int (*prereset)(struct ata_link * , unsigned long ) , int (*softreset)(struct ata_link * , unsigned int * , unsigned long ) , int (*hardreset)(struct ata_link * , unsigned int * , unsigned long ) , void (*postreset)(struct ata_link * , unsigned int * ) , struct ata_link **r_failed_link ) { struct ata_link *link ; struct ata_device *dev ; int rc ; int nr_fails ; unsigned long flags ; unsigned long deadline ; struct ata_eh_context *ehc ; raw_spinlock_t *tmp ; unsigned int tmp___0 ; struct ata_eh_context *ehc___0 ; int tmp___1 ; struct ata_eh_context *ehc___1 ; int tmp___2 ; unsigned long now ; struct ata_eh_context *ehc___2 ; unsigned long tmp___3 ; struct ata_eh_context *ehc___3 ; bool tmp___4 ; int tmp___5 ; bool tmp___6 ; bool tmp___7 ; { link = ata_link_next((struct ata_link *)0, ap, 0); goto ldv_45069; ldv_45068: ehc = & link->eh_context; if ((ehc->i.action & 8U) != 0U) { ata_eh_about_to_do(link, (struct ata_device *)0, 8U); tmp = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp); link->flags = link->flags & 4294967231U; spin_unlock_irqrestore(ap->lock, flags); ata_eh_done(link, (struct ata_device *)0, 8U); } else { } dev = ata_dev_next((struct ata_device *)0, link, 2); goto ldv_45066; ldv_45065: ; if ((link->flags & 32U) != 0U) { ehc->tries[dev->devno] = 1; } else { ehc->tries[dev->devno] = 3; } ehc->i.action = ehc->i.action | (ehc->i.dev_action[dev->devno] & 4294967262U); ehc->i.dev_action[dev->devno] = ehc->i.dev_action[dev->devno] & 33U; if ((dev->flags & 16777216UL) != 0UL) { ata_eh_detach_dev(dev); } else { } tmp___0 = ata_dev_enabled((struct ata_device const *)dev); if (tmp___0 == 0U) { ata_eh_schedule_probe(dev); } else { } dev = ata_dev_next(dev, link, 2); ldv_45066: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_45065; } else { } link = ata_link_next(link, ap, 0); ldv_45069: ; if ((unsigned long )link != (unsigned long )((struct ata_link *)0)) { goto ldv_45068; } else { } retry: rc = 0; if ((ap->pflags & 512U) != 0U) { goto out; } else { } link = ata_link_next((struct ata_link *)0, ap, 0); goto ldv_45078; ldv_45077: ehc___0 = & link->eh_context; tmp___1 = ata_eh_skip_recovery(link); if (tmp___1 != 0) { ehc___0->i.action = 0U; } else { } dev = ata_dev_next((struct ata_device *)0, link, 2); goto ldv_45075; ldv_45074: ehc___0->classes[dev->devno] = 0U; dev = ata_dev_next(dev, link, 2); ldv_45075: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_45074; } else { } link = ata_link_next(link, ap, 0); ldv_45078: ; if ((unsigned long )link != (unsigned long )((struct ata_link *)0)) { goto ldv_45077; } else { } link = ata_link_next((struct ata_link *)0, ap, 0); goto ldv_45083; ldv_45082: ehc___1 = & link->eh_context; if ((ehc___1->i.action & 6U) == 0U) { goto ldv_45081; } else { } tmp___2 = ata_link_nr_vacant(link); rc = ata_eh_reset(link, tmp___2, prereset, softreset, hardreset, postreset); if (rc != 0) { ata_link_printk((struct ata_link const *)link, "\v", "reset failed, giving up\n"); goto out; } else { } ldv_45081: link = ata_link_next(link, ap, 0); ldv_45083: ; if ((unsigned long )link != (unsigned long )((struct ata_link *)0)) { goto ldv_45082; } else { } ldv_45114: ata_eh_pull_park_action(ap); deadline = jiffies; link = ata_link_next((struct ata_link *)0, ap, 0); goto ldv_45105; ldv_45104: dev = ata_dev_next((struct ata_device *)0, link, 2); goto ldv_45102; ldv_45101: ehc___2 = & link->eh_context; if (dev->class != 1U && dev->class != 9U) { goto ldv_45088; } else { } if ((ehc___2->i.dev_action[dev->devno] & 32U) == 0U) { goto ldv_45088; } else { } tmp___3 = dev->unpark_deadline; if ((long )(deadline - tmp___3) < 0L) { deadline = tmp___3; } else if ((long )((unsigned long )jiffies - tmp___3) >= 0L) { goto ldv_45088; } else { } if ((ehc___2->unloaded_mask & (unsigned int )(1 << (int )dev->devno)) != 0U) { goto ldv_45088; } else { } ata_eh_park_issue_cmd(dev, 1); ldv_45088: dev = ata_dev_next(dev, link, 2); ldv_45102: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_45101; } else { } link = ata_link_next(link, ap, 0); ldv_45105: ; if ((unsigned long )link != (unsigned long )((struct ata_link *)0)) { goto ldv_45104; } else { } now = jiffies; if ((long )(now - deadline) >= 0L) { goto ldv_45113; } else { } ata_eh_release(ap); deadline = wait_for_completion_timeout(& ap->park_req_pending, deadline - now); ata_eh_acquire(ap); if (deadline != 0UL) { goto ldv_45114; } else { } ldv_45113: link = ata_link_next((struct ata_link *)0, ap, 0); goto ldv_45120; ldv_45119: dev = ata_dev_next((struct ata_device *)0, link, 2); goto ldv_45117; ldv_45116: ; if ((link->eh_context.unloaded_mask & (unsigned int )(1 << (int )dev->devno)) == 0U) { goto ldv_45115; } else { } ata_eh_park_issue_cmd(dev, 0); ata_eh_done(link, dev, 32U); ldv_45115: dev = ata_dev_next(dev, link, 2); ldv_45117: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_45116; } else { } link = ata_link_next(link, ap, 0); ldv_45120: ; if ((unsigned long )link != (unsigned long )((struct ata_link *)0)) { goto ldv_45119; } else { } nr_fails = 0; link = ata_link_next((struct ata_link *)0, ap, 2); goto ldv_45136; ldv_45135: ehc___3 = & link->eh_context; tmp___4 = sata_pmp_attached(ap); if ((int )tmp___4) { tmp___5 = ata_is_host_link((struct ata_link const *)link); if (tmp___5 != 0) { goto config_lpm; } else { } } else { } rc = ata_eh_revalidate_and_attach(link, & dev); if (rc != 0) { goto rest_fail; } else { } if (((struct ata_device *)(& link->device))->class == 5U) { ehc___3->i.action = 0U; return (0); } else { } if ((ehc___3->i.flags & 524288U) != 0U) { rc = ata_set_mode(link, & dev); if (rc != 0) { goto rest_fail; } else { } ehc___3->i.flags = ehc___3->i.flags & 4294443007U; } else { } if ((ehc___3->i.flags & 196608U) != 0U) { dev = ata_dev_next((struct ata_device *)0, link, 2); goto ldv_45127; ldv_45126: ; if (dev->class != 3U) { goto ldv_45125; } else { } rc = atapi_eh_clear_ua(dev); if (rc != 0) { goto rest_fail; } else { } tmp___6 = zpodd_dev_enabled(dev); if ((int )tmp___6) { zpodd_post_poweron(dev); } else { } ldv_45125: dev = ata_dev_next(dev, link, 2); ldv_45127: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_45126; } else { } } else { } dev = ata_dev_next((struct ata_device *)0, link, 2); goto ldv_45131; ldv_45130: ; if (dev->class != 1U && dev->class != 9U) { goto ldv_45129; } else { } rc = ata_eh_maybe_retry_flush(dev); if (rc != 0) { goto rest_fail; } else { } ldv_45129: dev = ata_dev_next(dev, link, 2); ldv_45131: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_45130; } else { } config_lpm: ; if ((unsigned int )link->lpm_policy != (unsigned int )ap->target_lpm_policy) { rc = ata_eh_set_lpm(link, ap->target_lpm_policy, & dev); if (rc != 0) { goto rest_fail; } else { } } else { } ehc___3->i.flags = 0U; goto ldv_45133; rest_fail: nr_fails = nr_fails + 1; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { ata_eh_handle_dev_fail(dev, rc); } else { } if ((ap->pflags & 4U) != 0U) { tmp___7 = sata_pmp_attached(ap); if ((int )tmp___7) { goto out; } else { } goto ldv_45134; } else { } ldv_45133: link = ata_link_next(link, ap, 2); ldv_45136: ; if ((unsigned long )link != (unsigned long )((struct ata_link *)0)) { goto ldv_45135; } else { } ldv_45134: ; if (nr_fails != 0) { goto retry; } else { } out: ; if (rc != 0 && (unsigned long )r_failed_link != (unsigned long )((struct ata_link **)0)) { *r_failed_link = link; } else { } return (rc); } } void ata_eh_finish(struct ata_port *ap ) { int tag ; struct ata_queued_cmd *qc ; struct ata_queued_cmd *tmp ; int __ret_warn_on ; long tmp___0 ; { tag = 0; goto ldv_45144; ldv_45143: tmp = __ata_qc_from_tag(ap, (unsigned int )tag); qc = tmp; if ((qc->flags & 65536UL) == 0UL) { goto ldv_45142; } else { } if (qc->err_mask != 0U) { if ((qc->flags & 128UL) != 0UL) { ata_eh_qc_retry(qc); } else { ata_eh_qc_complete(qc); } } else if ((qc->flags & 131072UL) != 0UL) { ata_eh_qc_complete(qc); } else { memset((void *)(& qc->result_tf), 0, 32UL); ata_eh_qc_retry(qc); } ldv_45142: tag = tag + 1; ldv_45144: ; if (tag <= 31) { goto ldv_45143; } else { } __ret_warn_on = ap->nr_active_links != 0; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-eh.c", 4086); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); ap->nr_active_links = 0; return; } } void ata_do_eh(struct ata_port *ap , int (*prereset)(struct ata_link * , unsigned long ) , int (*softreset)(struct ata_link * , unsigned int * , unsigned long ) , int (*hardreset)(struct ata_link * , unsigned int * , unsigned long ) , void (*postreset)(struct ata_link * , unsigned int * ) ) { struct ata_device *dev ; int rc ; { ata_eh_autopsy(ap); ata_eh_report(ap); rc = ata_eh_recover(ap, prereset, softreset, hardreset, postreset, (struct ata_link **)0); if (rc != 0) { dev = ata_dev_next((struct ata_device *)0, & ap->link, 2); goto ldv_45158; ldv_45157: ata_dev_disable(dev); dev = ata_dev_next(dev, & ap->link, 2); ldv_45158: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_45157; } else { } } else { } ata_eh_finish(ap); return; } } void ata_std_error_handler(struct ata_port *ap ) { struct ata_port_operations *ops ; int (*hardreset)(struct ata_link * , unsigned int * , unsigned long ) ; int tmp ; { ops = ap->ops; hardreset = ops->hardreset; if ((unsigned long )hardreset == (unsigned long )(& sata_std_hardreset)) { tmp = sata_scr_valid(& ap->link); if (tmp == 0) { hardreset = (int (*)(struct ata_link * , unsigned int * , unsigned long ))0; } else { } } else { } ata_do_eh(ap, ops->prereset, ops->softreset, hardreset, ops->postreset); return; } } static void ata_eh_handle_port_suspend(struct ata_port *ap ) { unsigned long flags ; int rc ; struct ata_device *dev ; raw_spinlock_t *tmp ; int __ret_warn_on ; long tmp___0 ; bool tmp___1 ; raw_spinlock_t *tmp___2 ; { rc = 0; tmp = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp); if ((ap->pflags & 262144U) == 0U || (ap->pm_mesg.event & 16) != 0) { spin_unlock_irqrestore(ap->lock, flags); return; } else { } spin_unlock_irqrestore(ap->lock, flags); __ret_warn_on = (ap->pflags & 131072U) != 0U; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-eh.c", 4170); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); if ((ap->pm_mesg.event & 1024) != 0) { dev = ata_dev_next((struct ata_device *)0, & ap->link, 0); goto ldv_45177; ldv_45176: tmp___1 = zpodd_dev_enabled(dev); if ((int )tmp___1) { zpodd_on_suspend(dev); } else { } dev = ata_dev_next(dev, & ap->link, 0); ldv_45177: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_45176; } else { } } else { } rc = ata_acpi_on_suspend(ap); if (rc != 0) { goto out; } else { } ata_eh_freeze_port(ap); if ((unsigned long )(ap->ops)->port_suspend != (unsigned long )((int (*)(struct ata_port * , pm_message_t ))0)) { rc = (*((ap->ops)->port_suspend))(ap, ap->pm_mesg); } else { } ata_acpi_set_state(ap, ap->pm_mesg); out: tmp___2 = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp___2); ap->pflags = ap->pflags & 4294705151U; if (rc == 0) { ap->pflags = ap->pflags | 131072U; } else if ((ap->pflags & 4U) != 0U) { ata_port_schedule_eh(ap); } else { } spin_unlock_irqrestore(ap->lock, flags); return; } } static void ata_eh_handle_port_resume(struct ata_port *ap ) { struct ata_link *link ; struct ata_device *dev ; unsigned long flags ; int rc ; raw_spinlock_t *tmp ; int __ret_warn_on ; long tmp___0 ; raw_spinlock_t *tmp___1 ; { rc = 0; tmp = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp); if ((ap->pflags & 262144U) == 0U || (ap->pm_mesg.event & 16) == 0) { spin_unlock_irqrestore(ap->lock, flags); return; } else { } spin_unlock_irqrestore(ap->lock, flags); __ret_warn_on = (ap->pflags & 131072U) == 0U; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-eh.c", 4236); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); link = ata_link_next((struct ata_link *)0, ap, 1); goto ldv_45199; ldv_45198: dev = ata_dev_next((struct ata_device *)0, link, 2); goto ldv_45196; ldv_45195: ata_ering_clear(& dev->ering); dev = ata_dev_next(dev, link, 2); ldv_45196: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_45195; } else { } link = ata_link_next(link, ap, 1); ldv_45199: ; if ((unsigned long )link != (unsigned long )((struct ata_link *)0)) { goto ldv_45198; } else { } ata_acpi_set_state(ap, ap->pm_mesg); if ((unsigned long )(ap->ops)->port_resume != (unsigned long )((int (*)(struct ata_port * ))0)) { rc = (*((ap->ops)->port_resume))(ap); } else { } ata_acpi_on_resume(ap); tmp___1 = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp___1); ap->pflags = ap->pflags & 4294574079U; spin_unlock_irqrestore(ap->lock, flags); return; } } bool ldv_queue_work_on_35(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_36(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_37(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_38(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_39(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; extern int sprintf(char * , char const * , ...) ; extern void jiffies_to_timespec(unsigned long const , struct timespec * ) ; bool ldv_queue_work_on_49(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_51(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_50(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; bool ldv_queue_delayed_work_on_53(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; void ldv_flush_workqueue_52(struct workqueue_struct *ldv_func_arg1 ) ; extern int dev_set_name(struct device * , char const * , ...) ; __inline static void device_enable_async_suspend(struct device *dev ) { { if (! dev->power.is_prepared) { dev->power.async_suspend = 1U; } else { } return; } } extern void device_initialize(struct device * ) ; extern int device_add(struct device * ) ; extern void device_del(struct device * ) ; extern struct device *get_device(struct device * ) ; extern void put_device(struct device * ) ; extern int attribute_container_register(struct attribute_container * ) ; extern int attribute_container_unregister(struct attribute_container * ) ; extern void transport_remove_device(struct device * ) ; extern void transport_add_device(struct device * ) ; extern void transport_setup_device(struct device * ) ; extern void transport_configure_device(struct device * ) ; extern void transport_destroy_device(struct device * ) ; __inline static int transport_container_register(struct transport_container *tc ) { int tmp ; { tmp = attribute_container_register(& tc->ac); return (tmp); } } __inline static void transport_container_unregister(struct transport_container *tc ) { int tmp ; long tmp___0 ; { tmp = attribute_container_unregister(& tc->ac); tmp___0 = ldv__builtin_expect(tmp != 0, 0L); if (tmp___0 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"include/linux/transport_class.h"), "i" (93), "i" (12UL)); ldv_32755: ; goto ldv_32755; } else { } return; } } extern int transport_class_register(struct transport_class * ) ; extern void transport_class_unregister(struct transport_class * ) ; __inline static unsigned int ata_id_major_version___1(u16 const *id ) { unsigned int mver ; { if ((unsigned int )((unsigned short )*(id + 80UL)) == 65535U) { return (0U); } else { } mver = 14U; goto ldv_35465; ldv_35464: ; if (((int )*(id + 80UL) >> (int )mver) & 1) { goto ldv_35463; } else { } mver = mver - 1U; ldv_35465: ; if (mver != 0U) { goto ldv_35464; } else { } ldv_35463: ; return (mver); } } __inline static bool ata_id_has_trim___0(u16 const *id ) { unsigned int tmp ; { tmp = ata_id_major_version___1(id); if (tmp > 6U && (int )*(id + 169UL) & 1) { return (1); } else { } return (0); } } extern void pm_runtime_forbid(struct device * ) ; void ata_acpi_bind_port(struct ata_port *ap ) ; void ata_acpi_bind_dev(struct ata_device *dev ) ; struct scsi_transport_template *ata_scsi_transport_template ; int ata_tlink_add(struct ata_link *link ) ; static int ata_tdev_add(struct ata_device *ata_dev ) ; static void ata_tdev_delete(struct ata_device *ata_dev ) ; static struct __anonstruct_ata_class_names_285 ata_class_names[11U] = { {0U, (char *)"unknown"}, {1U, (char *)"ata"}, {2U, (char *)"ata"}, {3U, (char *)"atapi"}, {4U, (char *)"atapi"}, {5U, (char *)"pmp"}, {6U, (char *)"pmp"}, {7U, (char *)"semb"}, {8U, (char *)"semb"}, {9U, (char *)"zac"}, {10U, (char *)"none"}}; static ssize_t get_ata_class_names(u32 table_key , char *buf ) { ssize_t len ; int i ; int tmp ; int tmp___0 ; { len = 0L; i = 0; goto ldv_42133; ldv_42132: ; if (ata_class_names[i].value == table_key) { tmp = sprintf(buf + (unsigned long )len, "%s", ata_class_names[i].name); len = (ssize_t )tmp + len; goto ldv_42131; } else { } i = i + 1; ldv_42133: ; if ((unsigned int )i <= 10U) { goto ldv_42132; } else { } ldv_42131: tmp___0 = sprintf(buf + (unsigned long )len, "\n"); len = (ssize_t )tmp___0 + len; return (len); } } static struct __anonstruct_ata_err_names_287 ata_err_names[11U] = { {1U, (char *)"DeviceError"}, {2U, (char *)"HostStateMachineError"}, {4U, (char *)"Timeout"}, {8U, (char *)"MediaError"}, {16U, (char *)"BusError"}, {32U, (char *)"HostBusError"}, {64U, (char *)"SystemError"}, {128U, (char *)"InvalidArg"}, {256U, (char *)"Unknown"}, {512U, (char *)"NoDeviceHint"}, {1024U, (char *)"NCQError"}}; static ssize_t get_ata_err_names(u32 table_key , char *buf ) { char *prefix ; ssize_t len ; int i ; int tmp ; int tmp___0 ; { prefix = (char *)""; len = 0L; i = 0; goto ldv_42148; ldv_42147: ; if ((ata_err_names[i].value & table_key) != 0U) { tmp = sprintf(buf + (unsigned long )len, "%s%s", prefix, ata_err_names[i].name); len = (ssize_t )tmp + len; prefix = (char *)", "; } else { } i = i + 1; ldv_42148: ; if ((unsigned int )i <= 10U) { goto ldv_42147; } else { } tmp___0 = sprintf(buf + (unsigned long )len, "\n"); len = (ssize_t )tmp___0 + len; return (len); } } static struct __anonstruct_ata_xfer_names_289 ata_xfer_names[24U] = { {71U, (char *)"XFER_UDMA_7"}, {70U, (char *)"XFER_UDMA_6"}, {69U, (char *)"XFER_UDMA_5"}, {68U, (char *)"XFER_UDMA_4"}, {67U, (char *)"XFER_UDMA_3"}, {66U, (char *)"XFER_UDMA_2"}, {65U, (char *)"XFER_UDMA_1"}, {64U, (char *)"XFER_UDMA_0"}, {36U, (char *)"XFER_MW_DMA_4"}, {35U, (char *)"XFER_MW_DMA_3"}, {34U, (char *)"XFER_MW_DMA_2"}, {33U, (char *)"XFER_MW_DMA_1"}, {32U, (char *)"XFER_MW_DMA_0"}, {18U, (char *)"XFER_SW_DMA_2"}, {17U, (char *)"XFER_SW_DMA_1"}, {16U, (char *)"XFER_SW_DMA_0"}, {14U, (char *)"XFER_PIO_6"}, {13U, (char *)"XFER_PIO_5"}, {12U, (char *)"XFER_PIO_4"}, {11U, (char *)"XFER_PIO_3"}, {10U, (char *)"XFER_PIO_2"}, {9U, (char *)"XFER_PIO_1"}, {8U, (char *)"XFER_PIO_0"}, {0U, (char *)"XFER_PIO_SLOW"}}; static ssize_t get_ata_xfer_names(u32 table_key , char *buf ) { char *prefix ; ssize_t len ; int i ; int tmp ; int tmp___0 ; { prefix = (char *)""; len = 0L; i = 0; goto ldv_42164; ldv_42163: ; if ((ata_xfer_names[i].value & table_key) != 0U) { tmp = sprintf(buf + (unsigned long )len, "%s%s", prefix, ata_xfer_names[i].name); len = (ssize_t )tmp + len; prefix = (char *)", "; } else { } i = i + 1; ldv_42164: ; if ((unsigned int )i <= 23U) { goto ldv_42163; } else { } tmp___0 = sprintf(buf + (unsigned long )len, "\n"); len = (ssize_t )tmp___0 + len; return (len); } } static ssize_t show_ata_port_nr_pmp_links(struct device *dev , struct device_attribute *attr , char *buf ) { struct ata_port *ap ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev->parent; ap = (struct ata_port *)__mptr + 0xffffffffffffc450UL; tmp = snprintf(buf, 20UL, "%d\n", ap->nr_pmp_links); return ((ssize_t )tmp); } } static struct device_attribute dev_attr_nr_pmp_links = {{"nr_pmp_links", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_ata_port_nr_pmp_links, (ssize_t (*)(struct device * , struct device_attribute * , char const * , size_t ))0}; static ssize_t show_ata_port_idle_irq(struct device *dev , struct device_attribute *attr , char *buf ) { struct ata_port *ap ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev->parent; ap = (struct ata_port *)__mptr + 0xffffffffffffc450UL; tmp = snprintf(buf, 20UL, "%ld\n", ap->stats.idle_irq); return ((ssize_t )tmp); } } static struct device_attribute dev_attr_idle_irq = {{"idle_irq", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_ata_port_idle_irq, (ssize_t (*)(struct device * , struct device_attribute * , char const * , size_t ))0}; static ssize_t show_ata_port_port_no(struct device *dev , struct device_attribute *attr , char *buf ) { struct ata_port *ap ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev->parent; ap = (struct ata_port *)__mptr + 0xffffffffffffc450UL; tmp = snprintf(buf, 20UL, "%u\n", ap->local_port_no); return ((ssize_t )tmp); } } static struct device_attribute dev_attr_port_no = {{"port_no", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_ata_port_port_no, (ssize_t (*)(struct device * , struct device_attribute * , char const * , size_t ))0}; static struct transport_class ata_port_class = {{"ata_port", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, (int (*)(struct transport_container * , struct device * , struct device * ))0, (int (*)(struct transport_container * , struct device * , struct device * ))0, (int (*)(struct transport_container * , struct device * , struct device * ))0}; static void ata_tport_release(struct device *dev ) { { put_device(dev->parent); return; } } static int ata_is_port(struct device const *dev ) { { return ((unsigned long )((void (*)(struct device * ))dev->release) == (unsigned long )(& ata_tport_release)); } } static int ata_tport_match(struct attribute_container *cont , struct device *dev ) { int tmp ; { tmp = ata_is_port((struct device const *)dev); if (tmp == 0) { return (0); } else { } return ((unsigned long )(& ata_scsi_transport_template->host_attrs.ac) == (unsigned long )cont); } } void ata_tport_delete(struct ata_port *ap ) { struct device *dev ; { dev = & ap->tdev; ata_tlink_delete(& ap->link); transport_remove_device(dev); device_del(dev); transport_destroy_device(dev); put_device(dev); return; } } int ata_tport_add(struct device *parent , struct ata_port *ap ) { int error ; struct device *dev ; { dev = & ap->tdev; device_initialize(dev); dev->type = (struct device_type const *)(& ata_port_type); dev->parent = get_device(parent); dev->release = & ata_tport_release; dev_set_name(dev, "ata%d", ap->print_id); transport_setup_device(dev); ata_acpi_bind_port(ap); error = device_add(dev); if (error != 0) { goto tport_err; } else { } device_enable_async_suspend(dev); pm_runtime_set_active(dev); pm_runtime_enable(dev); pm_runtime_forbid(dev); transport_add_device(dev); transport_configure_device(dev); error = ata_tlink_add(& ap->link); if (error != 0) { goto tport_link_err; } else { } return (0); tport_link_err: transport_remove_device(dev); device_del(dev); tport_err: transport_destroy_device(dev); put_device(dev); return (error); } } static int noop(int x ) { { return (x); } } static ssize_t show_ata_link_hw_sata_spd_limit(struct device *dev , struct device_attribute *attr , char *buf ) { struct ata_link *link ; struct device const *__mptr ; int tmp ; char const *tmp___0 ; int tmp___1 ; { __mptr = (struct device const *)dev->parent; link = (struct ata_link *)__mptr + 0xfffffffffffffff0UL; tmp = fls((int )link->hw_sata_spd_limit); tmp___0 = sata_spd_string((unsigned int )tmp); tmp___1 = sprintf(buf, "%s\n", tmp___0); return ((ssize_t )tmp___1); } } static struct device_attribute dev_attr_hw_sata_spd_limit = {{"hw_sata_spd_limit", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_ata_link_hw_sata_spd_limit, (ssize_t (*)(struct device * , struct device_attribute * , char const * , size_t ))0}; static ssize_t show_ata_link_sata_spd_limit(struct device *dev , struct device_attribute *attr , char *buf ) { struct ata_link *link ; struct device const *__mptr ; int tmp ; char const *tmp___0 ; int tmp___1 ; { __mptr = (struct device const *)dev->parent; link = (struct ata_link *)__mptr + 0xfffffffffffffff0UL; tmp = fls((int )link->sata_spd_limit); tmp___0 = sata_spd_string((unsigned int )tmp); tmp___1 = sprintf(buf, "%s\n", tmp___0); return ((ssize_t )tmp___1); } } static struct device_attribute dev_attr_sata_spd_limit = {{"sata_spd_limit", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_ata_link_sata_spd_limit, (ssize_t (*)(struct device * , struct device_attribute * , char const * , size_t ))0}; static ssize_t show_ata_link_sata_spd(struct device *dev , struct device_attribute *attr , char *buf ) { struct ata_link *link ; struct device const *__mptr ; int tmp ; char const *tmp___0 ; int tmp___1 ; { __mptr = (struct device const *)dev->parent; link = (struct ata_link *)__mptr + 0xfffffffffffffff0UL; tmp = noop((int )link->sata_spd); tmp___0 = sata_spd_string((unsigned int )tmp); tmp___1 = sprintf(buf, "%s\n", tmp___0); return ((ssize_t )tmp___1); } } static struct device_attribute dev_attr_sata_spd = {{"sata_spd", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_ata_link_sata_spd, (ssize_t (*)(struct device * , struct device_attribute * , char const * , size_t ))0}; static struct transport_class ata_link_class = {{"ata_link", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, (int (*)(struct transport_container * , struct device * , struct device * ))0, (int (*)(struct transport_container * , struct device * , struct device * ))0, (int (*)(struct transport_container * , struct device * , struct device * ))0}; static void ata_tlink_release(struct device *dev ) { { put_device(dev->parent); return; } } static int ata_is_link(struct device const *dev ) { { return ((unsigned long )((void (*)(struct device * ))dev->release) == (unsigned long )(& ata_tlink_release)); } } static int ata_tlink_match(struct attribute_container *cont , struct device *dev ) { struct ata_internal *i ; struct scsi_transport_template const *__mptr ; int tmp ; { __mptr = (struct scsi_transport_template const *)ata_scsi_transport_template; i = (struct ata_internal *)__mptr; tmp = ata_is_link((struct device const *)dev); if (tmp == 0) { return (0); } else { } return ((unsigned long )(& i->link_attr_cont.ac) == (unsigned long )cont); } } void ata_tlink_delete(struct ata_link *link ) { struct device *dev ; struct ata_device *ata_dev ; { dev = & link->tdev; ata_dev = ata_dev_next((struct ata_device *)0, link, 2); goto ldv_42338; ldv_42337: ata_tdev_delete(ata_dev); ata_dev = ata_dev_next(ata_dev, link, 2); ldv_42338: ; if ((unsigned long )ata_dev != (unsigned long )((struct ata_device *)0)) { goto ldv_42337; } else { } transport_remove_device(dev); device_del(dev); transport_destroy_device(dev); put_device(dev); return; } } int ata_tlink_add(struct ata_link *link ) { struct device *dev ; struct ata_port *ap ; struct ata_device *ata_dev ; int error ; int tmp ; { dev = & link->tdev; ap = link->ap; device_initialize(dev); dev->parent = get_device(& ap->tdev); dev->release = & ata_tlink_release; tmp = ata_is_host_link((struct ata_link const *)link); if (tmp != 0) { dev_set_name(dev, "link%d", ap->print_id); } else { dev_set_name(dev, "link%d.%d", ap->print_id, link->pmp); } transport_setup_device(dev); error = device_add(dev); if (error != 0) { goto tlink_err; } else { } transport_add_device(dev); transport_configure_device(dev); ata_dev = ata_dev_next((struct ata_device *)0, link, 2); goto ldv_42350; ldv_42349: error = ata_tdev_add(ata_dev); if (error != 0) { goto tlink_dev_err; } else { } ata_dev = ata_dev_next(ata_dev, link, 2); ldv_42350: ; if ((unsigned long )ata_dev != (unsigned long )((struct ata_device *)0)) { goto ldv_42349; } else { } return (0); tlink_dev_err: ; goto ldv_42353; ldv_42352: ata_tdev_delete(ata_dev); ldv_42353: ata_dev = ata_dev - 1; if ((unsigned long )ata_dev >= (unsigned long )((struct ata_device *)(& link->device))) { goto ldv_42352; } else { } transport_remove_device(dev); device_del(dev); tlink_err: transport_destroy_device(dev); put_device(dev); return (error); } } static ssize_t show_ata_dev_class(struct device *dev , struct device_attribute *attr , char *buf ) { struct ata_device *ata_dev ; struct device const *__mptr ; ssize_t tmp ; { __mptr = (struct device const *)dev->parent; ata_dev = (struct ata_device *)__mptr + 0xffffffffffffffc0UL; tmp = get_ata_class_names(ata_dev->class, buf); return (tmp); } } static struct device_attribute dev_attr_class = {{"class", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_ata_dev_class, (ssize_t (*)(struct device * , struct device_attribute * , char const * , size_t ))0}; static ssize_t show_ata_dev_pio_mode(struct device *dev , struct device_attribute *attr , char *buf ) { struct ata_device *ata_dev ; struct device const *__mptr ; ssize_t tmp ; { __mptr = (struct device const *)dev->parent; ata_dev = (struct ata_device *)__mptr + 0xffffffffffffffc0UL; tmp = get_ata_xfer_names((u32 )ata_dev->pio_mode, buf); return (tmp); } } static struct device_attribute dev_attr_pio_mode = {{"pio_mode", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_ata_dev_pio_mode, (ssize_t (*)(struct device * , struct device_attribute * , char const * , size_t ))0}; static ssize_t show_ata_dev_dma_mode(struct device *dev , struct device_attribute *attr , char *buf ) { struct ata_device *ata_dev ; struct device const *__mptr ; ssize_t tmp ; { __mptr = (struct device const *)dev->parent; ata_dev = (struct ata_device *)__mptr + 0xffffffffffffffc0UL; tmp = get_ata_xfer_names((u32 )ata_dev->dma_mode, buf); return (tmp); } } static struct device_attribute dev_attr_dma_mode = {{"dma_mode", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_ata_dev_dma_mode, (ssize_t (*)(struct device * , struct device_attribute * , char const * , size_t ))0}; static ssize_t show_ata_dev_xfer_mode(struct device *dev , struct device_attribute *attr , char *buf ) { struct ata_device *ata_dev ; struct device const *__mptr ; ssize_t tmp ; { __mptr = (struct device const *)dev->parent; ata_dev = (struct ata_device *)__mptr + 0xffffffffffffffc0UL; tmp = get_ata_xfer_names((u32 )ata_dev->xfer_mode, buf); return (tmp); } } static struct device_attribute dev_attr_xfer_mode = {{"xfer_mode", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_ata_dev_xfer_mode, (ssize_t (*)(struct device * , struct device_attribute * , char const * , size_t ))0}; static ssize_t show_ata_dev_spdn_cnt(struct device *dev , struct device_attribute *attr , char *buf ) { struct ata_device *ata_dev ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev->parent; ata_dev = (struct ata_device *)__mptr + 0xffffffffffffffc0UL; tmp = snprintf(buf, 20UL, "%d\n", ata_dev->spdn_cnt); return ((ssize_t )tmp); } } static struct device_attribute dev_attr_spdn_cnt = {{"spdn_cnt", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_ata_dev_spdn_cnt, (ssize_t (*)(struct device * , struct device_attribute * , char const * , size_t ))0}; static int ata_show_ering(struct ata_ering_entry *ent , void *void_arg ) { struct ata_show_ering_arg *arg ; struct timespec time ; int tmp ; ssize_t tmp___0 ; { arg = (struct ata_show_ering_arg *)void_arg; jiffies_to_timespec((unsigned long const )ent->timestamp, & time); tmp = sprintf(arg->buf + (unsigned long )arg->written, "[%5lu.%06lu]", time.tv_sec, time.tv_nsec); arg->written = arg->written + tmp; tmp___0 = get_ata_err_names(ent->err_mask, arg->buf + (unsigned long )arg->written); arg->written = (int )((unsigned int )arg->written + (unsigned int )tmp___0); return (0); } } static ssize_t show_ata_dev_ering(struct device *dev , struct device_attribute *attr , char *buf ) { struct ata_device *ata_dev ; struct device const *__mptr ; struct ata_show_ering_arg arg ; { __mptr = (struct device const *)dev->parent; ata_dev = (struct ata_device *)__mptr + 0xffffffffffffffc0UL; arg.buf = buf; arg.written = 0; ata_ering_map(& ata_dev->ering, & ata_show_ering, (void *)(& arg)); return ((ssize_t )arg.written); } } static struct device_attribute dev_attr_ering = {{"ering", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_ata_dev_ering, (ssize_t (*)(struct device * , struct device_attribute * , char const * , size_t ))0}; static ssize_t show_ata_dev_id(struct device *dev , struct device_attribute *attr , char *buf ) { struct ata_device *ata_dev ; struct device const *__mptr ; int written ; int i ; int tmp ; { __mptr = (struct device const *)dev->parent; ata_dev = (struct ata_device *)__mptr + 0xffffffffffffffc0UL; written = 0; i = 0; if (ata_dev->class == 5U) { return (0L); } else { } i = 0; goto ldv_42502; ldv_42501: tmp = snprintf(buf + (unsigned long )written, 20UL, "%04x%c", (int )ata_dev->__annonCompField86.id[i], ((i + 1) & 7) != 0 ? 32 : 10); written = tmp + written; i = i + 1; ldv_42502: ; if (i <= 255) { goto ldv_42501; } else { } return ((ssize_t )written); } } static struct device_attribute dev_attr_id = {{"id", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_ata_dev_id, (ssize_t (*)(struct device * , struct device_attribute * , char const * , size_t ))0}; static ssize_t show_ata_dev_gscr(struct device *dev , struct device_attribute *attr , char *buf ) { struct ata_device *ata_dev ; struct device const *__mptr ; int written ; int i ; int tmp ; { __mptr = (struct device const *)dev->parent; ata_dev = (struct ata_device *)__mptr + 0xffffffffffffffc0UL; written = 0; i = 0; if (ata_dev->class != 5U) { return (0L); } else { } i = 0; goto ldv_42528; ldv_42527: tmp = snprintf(buf + (unsigned long )written, 20UL, "%08x%c", ata_dev->__annonCompField86.gscr[i], ((i + 1) & 3) != 0 ? 32 : 10); written = tmp + written; i = i + 1; ldv_42528: ; if (i <= 127) { goto ldv_42527; } else { } return ((ssize_t )written); } } static struct device_attribute dev_attr_gscr = {{"gscr", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_ata_dev_gscr, (ssize_t (*)(struct device * , struct device_attribute * , char const * , size_t ))0}; static ssize_t show_ata_dev_trim(struct device *dev , struct device_attribute *attr , char *buf ) { struct ata_device *ata_dev ; struct device const *__mptr ; unsigned char *mode ; bool tmp ; bool tmp___0 ; int tmp___1 ; int tmp___2 ; { __mptr = (struct device const *)dev->parent; ata_dev = (struct ata_device *)__mptr + 0xffffffffffffffc0UL; tmp___0 = ata_id_has_trim___0((u16 const *)(& ata_dev->__annonCompField86.id)); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { mode = (unsigned char *)"unsupported"; } else if ((ata_dev->horkage & 524288U) != 0U) { mode = (unsigned char *)"forced_unqueued"; } else { tmp = ata_fpdma_dsm_supported(ata_dev); if ((int )tmp) { mode = (unsigned char *)"queued"; } else { mode = (unsigned char *)"unqueued"; } } tmp___2 = snprintf(buf, 20UL, "%s\n", mode); return ((ssize_t )tmp___2); } } static struct device_attribute dev_attr_trim = {{"trim", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_ata_dev_trim, (ssize_t (*)(struct device * , struct device_attribute * , char const * , size_t ))0}; static struct transport_class ata_dev_class = {{"ata_device", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, (int (*)(struct transport_container * , struct device * , struct device * ))0, (int (*)(struct transport_container * , struct device * , struct device * ))0, (int (*)(struct transport_container * , struct device * , struct device * ))0}; static void ata_tdev_release(struct device *dev ) { { put_device(dev->parent); return; } } static int ata_is_ata_dev(struct device const *dev ) { { return ((unsigned long )((void (*)(struct device * ))dev->release) == (unsigned long )(& ata_tdev_release)); } } static int ata_tdev_match(struct attribute_container *cont , struct device *dev ) { struct ata_internal *i ; struct scsi_transport_template const *__mptr ; int tmp ; { __mptr = (struct scsi_transport_template const *)ata_scsi_transport_template; i = (struct ata_internal *)__mptr; tmp = ata_is_ata_dev((struct device const *)dev); if (tmp == 0) { return (0); } else { } return ((unsigned long )(& i->dev_attr_cont.ac) == (unsigned long )cont); } } static void ata_tdev_free(struct ata_device *dev ) { { transport_destroy_device(& dev->tdev); put_device(& dev->tdev); return; } } static void ata_tdev_delete(struct ata_device *ata_dev ) { struct device *dev ; { dev = & ata_dev->tdev; transport_remove_device(dev); device_del(dev); ata_tdev_free(ata_dev); return; } } static int ata_tdev_add(struct ata_device *ata_dev ) { struct device *dev ; struct ata_link *link ; struct ata_port *ap ; int error ; int tmp ; { dev = & ata_dev->tdev; link = ata_dev->link; ap = link->ap; device_initialize(dev); dev->parent = get_device(& link->tdev); dev->release = & ata_tdev_release; tmp = ata_is_host_link((struct ata_link const *)link); if (tmp != 0) { dev_set_name(dev, "dev%d.%d", ap->print_id, ata_dev->devno); } else { dev_set_name(dev, "dev%d.%d.0", ap->print_id, link->pmp); } transport_setup_device(dev); ata_acpi_bind_dev(ata_dev); error = device_add(dev); if (error != 0) { ata_tdev_free(ata_dev); return (error); } else { } transport_add_device(dev); transport_configure_device(dev); return (0); } } struct scsi_transport_template *ata_attach_transport(void) { struct ata_internal *i ; int count ; void *tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; { tmp = kzalloc(1768UL, 208U); i = (struct ata_internal *)tmp; if ((unsigned long )i == (unsigned long )((struct ata_internal *)0)) { return ((struct scsi_transport_template *)0); } else { } i->t.eh_strategy_handler = & ata_scsi_error; i->t.eh_timed_out = & ata_scsi_timed_out; i->t.user_scan = & ata_scsi_user_scan; i->t.host_attrs.ac.attrs = (struct device_attribute **)(& i->port_attrs); i->t.host_attrs.ac.class = & ata_port_class.class; i->t.host_attrs.ac.match = & ata_tport_match; transport_container_register(& i->t.host_attrs); i->link_attr_cont.ac.class = & ata_link_class.class; i->link_attr_cont.ac.attrs = (struct device_attribute **)(& i->link_attrs); i->link_attr_cont.ac.match = & ata_tlink_match; transport_container_register(& i->link_attr_cont); i->dev_attr_cont.ac.class = & ata_dev_class.class; i->dev_attr_cont.ac.attrs = (struct device_attribute **)(& i->dev_attrs); i->dev_attr_cont.ac.match = & ata_tdev_match; transport_container_register(& i->dev_attr_cont); count = 0; i->private_port_attrs[count] = dev_attr_nr_pmp_links; i->private_port_attrs[count].attr.mode = 292U; i->port_attrs[count] = (struct device_attribute *)(& i->private_port_attrs) + (unsigned long )count; count = count + 1; i->private_port_attrs[count] = dev_attr_idle_irq; i->private_port_attrs[count].attr.mode = 292U; i->port_attrs[count] = (struct device_attribute *)(& i->private_port_attrs) + (unsigned long )count; count = count + 1; i->private_port_attrs[count] = dev_attr_port_no; i->private_port_attrs[count].attr.mode = 292U; i->port_attrs[count] = (struct device_attribute *)(& i->private_port_attrs) + (unsigned long )count; count = count + 1; tmp___0 = ldv__builtin_expect(count > 3, 0L); if (tmp___0 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-transport.c"), "i" (738), "i" (12UL)); ldv_42598: ; goto ldv_42598; } else { } i->port_attrs[count] = (struct device_attribute *)0; count = 0; i->private_link_attrs[count] = dev_attr_hw_sata_spd_limit; i->private_link_attrs[count].attr.mode = 292U; i->link_attrs[count] = (struct device_attribute *)(& i->private_link_attrs) + (unsigned long )count; count = count + 1; i->private_link_attrs[count] = dev_attr_sata_spd_limit; i->private_link_attrs[count].attr.mode = 292U; i->link_attrs[count] = (struct device_attribute *)(& i->private_link_attrs) + (unsigned long )count; count = count + 1; i->private_link_attrs[count] = dev_attr_sata_spd; i->private_link_attrs[count].attr.mode = 292U; i->link_attrs[count] = (struct device_attribute *)(& i->private_link_attrs) + (unsigned long )count; count = count + 1; tmp___1 = ldv__builtin_expect(count > 3, 0L); if (tmp___1 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-transport.c"), "i" (745), "i" (12UL)); ldv_42599: ; goto ldv_42599; } else { } i->link_attrs[count] = (struct device_attribute *)0; count = 0; i->private_dev_attrs[count] = dev_attr_class; i->private_dev_attrs[count].attr.mode = 292U; i->dev_attrs[count] = (struct device_attribute *)(& i->private_dev_attrs) + (unsigned long )count; count = count + 1; i->private_dev_attrs[count] = dev_attr_pio_mode; i->private_dev_attrs[count].attr.mode = 292U; i->dev_attrs[count] = (struct device_attribute *)(& i->private_dev_attrs) + (unsigned long )count; count = count + 1; i->private_dev_attrs[count] = dev_attr_dma_mode; i->private_dev_attrs[count].attr.mode = 292U; i->dev_attrs[count] = (struct device_attribute *)(& i->private_dev_attrs) + (unsigned long )count; count = count + 1; i->private_dev_attrs[count] = dev_attr_xfer_mode; i->private_dev_attrs[count].attr.mode = 292U; i->dev_attrs[count] = (struct device_attribute *)(& i->private_dev_attrs) + (unsigned long )count; count = count + 1; i->private_dev_attrs[count] = dev_attr_spdn_cnt; i->private_dev_attrs[count].attr.mode = 292U; i->dev_attrs[count] = (struct device_attribute *)(& i->private_dev_attrs) + (unsigned long )count; count = count + 1; i->private_dev_attrs[count] = dev_attr_ering; i->private_dev_attrs[count].attr.mode = 292U; i->dev_attrs[count] = (struct device_attribute *)(& i->private_dev_attrs) + (unsigned long )count; count = count + 1; i->private_dev_attrs[count] = dev_attr_id; i->private_dev_attrs[count].attr.mode = 292U; i->dev_attrs[count] = (struct device_attribute *)(& i->private_dev_attrs) + (unsigned long )count; count = count + 1; i->private_dev_attrs[count] = dev_attr_gscr; i->private_dev_attrs[count].attr.mode = 292U; i->dev_attrs[count] = (struct device_attribute *)(& i->private_dev_attrs) + (unsigned long )count; count = count + 1; i->private_dev_attrs[count] = dev_attr_trim; i->private_dev_attrs[count].attr.mode = 292U; i->dev_attrs[count] = (struct device_attribute *)(& i->private_dev_attrs) + (unsigned long )count; count = count + 1; tmp___2 = ldv__builtin_expect(count > 9, 0L); if (tmp___2 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-transport.c"), "i" (758), "i" (12UL)); ldv_42600: ; goto ldv_42600; } else { } i->dev_attrs[count] = (struct device_attribute *)0; return (& i->t); } } void ata_release_transport(struct scsi_transport_template *t ) { struct ata_internal *i ; struct scsi_transport_template const *__mptr ; { __mptr = (struct scsi_transport_template const *)t; i = (struct ata_internal *)__mptr; transport_container_unregister(& i->t.host_attrs); transport_container_unregister(& i->link_attr_cont); transport_container_unregister(& i->dev_attr_cont); kfree((void const *)i); return; } } int libata_transport_init(void) { int error ; { error = transport_class_register(& ata_link_class); if (error != 0) { goto out_unregister_transport; } else { } error = transport_class_register(& ata_port_class); if (error != 0) { goto out_unregister_link; } else { } error = transport_class_register(& ata_dev_class); if (error != 0) { goto out_unregister_port; } else { } return (0); out_unregister_port: transport_class_unregister(& ata_port_class); out_unregister_link: transport_class_unregister(& ata_link_class); out_unregister_transport: ; return (error); } } void libata_transport_exit(void) { { transport_class_unregister(& ata_link_class); transport_class_unregister(& ata_port_class); transport_class_unregister(& ata_dev_class); return; } } void ldv_main_exported_25(void) { struct device *ldvarg34 ; void *tmp ; struct device_attribute *ldvarg36 ; void *tmp___0 ; char *ldvarg35 ; void *tmp___1 ; int tmp___2 ; { tmp = ldv_init_zalloc(1416UL); ldvarg34 = (struct device *)tmp; tmp___0 = ldv_init_zalloc(48UL); ldvarg36 = (struct device_attribute *)tmp___0; tmp___1 = ldv_init_zalloc(1UL); ldvarg35 = (char *)tmp___1; tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_25 == 1) { show_ata_port_idle_irq(ldvarg34, ldvarg36, ldvarg35); ldv_state_variable_25 = 1; } else { } goto ldv_42624; default: ldv_stop(); } ldv_42624: ; return; } } void ldv_main_exported_21(void) { struct device *ldvarg6 ; void *tmp ; char *ldvarg7 ; void *tmp___0 ; struct device_attribute *ldvarg8 ; void *tmp___1 ; int tmp___2 ; { tmp = ldv_init_zalloc(1416UL); ldvarg6 = (struct device *)tmp; tmp___0 = ldv_init_zalloc(1UL); ldvarg7 = (char *)tmp___0; tmp___1 = ldv_init_zalloc(48UL); ldvarg8 = (struct device_attribute *)tmp___1; tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_21 == 1) { show_ata_link_sata_spd(ldvarg6, ldvarg8, ldvarg7); ldv_state_variable_21 = 1; } else { } goto ldv_42633; default: ldv_stop(); } ldv_42633: ; return; } } void ldv_main_exported_26(void) { char *ldvarg15 ; void *tmp ; struct device_attribute *ldvarg16 ; void *tmp___0 ; struct device *ldvarg14 ; void *tmp___1 ; int tmp___2 ; { tmp = ldv_init_zalloc(1UL); ldvarg15 = (char *)tmp; tmp___0 = ldv_init_zalloc(48UL); ldvarg16 = (struct device_attribute *)tmp___0; tmp___1 = ldv_init_zalloc(1416UL); ldvarg14 = (struct device *)tmp___1; tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_26 == 1) { show_ata_port_nr_pmp_links(ldvarg14, ldvarg16, ldvarg15); ldv_state_variable_26 = 1; } else { } goto ldv_42642; default: ldv_stop(); } ldv_42642: ; return; } } void ldv_main_exported_17(void) { struct device_attribute *ldvarg19 ; void *tmp ; struct device *ldvarg17 ; void *tmp___0 ; char *ldvarg18 ; void *tmp___1 ; int tmp___2 ; { tmp = ldv_init_zalloc(48UL); ldvarg19 = (struct device_attribute *)tmp; tmp___0 = ldv_init_zalloc(1416UL); ldvarg17 = (struct device *)tmp___0; tmp___1 = ldv_init_zalloc(1UL); ldvarg18 = (char *)tmp___1; tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_17 == 1) { show_ata_dev_xfer_mode(ldvarg17, ldvarg19, ldvarg18); ldv_state_variable_17 = 1; } else { } goto ldv_42651; default: ldv_stop(); } ldv_42651: ; return; } } void ldv_main_exported_12(void) { struct device *ldvarg119 ; void *tmp ; char *ldvarg120 ; void *tmp___0 ; struct device_attribute *ldvarg121 ; void *tmp___1 ; int tmp___2 ; { tmp = ldv_init_zalloc(1416UL); ldvarg119 = (struct device *)tmp; tmp___0 = ldv_init_zalloc(1UL); ldvarg120 = (char *)tmp___0; tmp___1 = ldv_init_zalloc(48UL); ldvarg121 = (struct device_attribute *)tmp___1; tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_12 == 1) { show_ata_dev_trim(ldvarg119, ldvarg121, ldvarg120); ldv_state_variable_12 = 1; } else { } goto ldv_42660; default: ldv_stop(); } ldv_42660: ; return; } } void ldv_main_exported_20(void) { struct device *ldvarg40 ; void *tmp ; struct device_attribute *ldvarg42 ; void *tmp___0 ; char *ldvarg41 ; void *tmp___1 ; int tmp___2 ; { tmp = ldv_init_zalloc(1416UL); ldvarg40 = (struct device *)tmp; tmp___0 = ldv_init_zalloc(48UL); ldvarg42 = (struct device_attribute *)tmp___0; tmp___1 = ldv_init_zalloc(1UL); ldvarg41 = (char *)tmp___1; tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_20 == 1) { show_ata_dev_class(ldvarg40, ldvarg42, ldvarg41); ldv_state_variable_20 = 1; } else { } goto ldv_42669; default: ldv_stop(); } ldv_42669: ; return; } } void ldv_main_exported_15(void) { struct device_attribute *ldvarg126 ; void *tmp ; char *ldvarg125 ; void *tmp___0 ; struct device *ldvarg124 ; void *tmp___1 ; int tmp___2 ; { tmp = ldv_init_zalloc(48UL); ldvarg126 = (struct device_attribute *)tmp; tmp___0 = ldv_init_zalloc(1UL); ldvarg125 = (char *)tmp___0; tmp___1 = ldv_init_zalloc(1416UL); ldvarg124 = (struct device *)tmp___1; tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_15 == 1) { show_ata_dev_ering(ldvarg124, ldvarg126, ldvarg125); ldv_state_variable_15 = 1; } else { } goto ldv_42678; default: ldv_stop(); } ldv_42678: ; return; } } void ldv_main_exported_14(void) { char *ldvarg44 ; void *tmp ; struct device *ldvarg43 ; void *tmp___0 ; struct device_attribute *ldvarg45 ; void *tmp___1 ; int tmp___2 ; { tmp = ldv_init_zalloc(1UL); ldvarg44 = (char *)tmp; tmp___0 = ldv_init_zalloc(1416UL); ldvarg43 = (struct device *)tmp___0; tmp___1 = ldv_init_zalloc(48UL); ldvarg45 = (struct device_attribute *)tmp___1; tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_14 == 1) { show_ata_dev_id(ldvarg43, ldvarg45, ldvarg44); ldv_state_variable_14 = 1; } else { } goto ldv_42687; default: ldv_stop(); } ldv_42687: ; return; } } void ldv_main_exported_22(void) { char *ldvarg90 ; void *tmp ; struct device *ldvarg89 ; void *tmp___0 ; struct device_attribute *ldvarg91 ; void *tmp___1 ; int tmp___2 ; { tmp = ldv_init_zalloc(1UL); ldvarg90 = (char *)tmp; tmp___0 = ldv_init_zalloc(1416UL); ldvarg89 = (struct device *)tmp___0; tmp___1 = ldv_init_zalloc(48UL); ldvarg91 = (struct device_attribute *)tmp___1; tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_22 == 1) { show_ata_link_sata_spd_limit(ldvarg89, ldvarg91, ldvarg90); ldv_state_variable_22 = 1; } else { } goto ldv_42696; default: ldv_stop(); } ldv_42696: ; return; } } void ldv_main_exported_18(void) { struct device_attribute *ldvarg22 ; void *tmp ; struct device *ldvarg20 ; void *tmp___0 ; char *ldvarg21 ; void *tmp___1 ; int tmp___2 ; { tmp = ldv_init_zalloc(48UL); ldvarg22 = (struct device_attribute *)tmp; tmp___0 = ldv_init_zalloc(1416UL); ldvarg20 = (struct device *)tmp___0; tmp___1 = ldv_init_zalloc(1UL); ldvarg21 = (char *)tmp___1; tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_18 == 1) { show_ata_dev_dma_mode(ldvarg20, ldvarg22, ldvarg21); ldv_state_variable_18 = 1; } else { } goto ldv_42705; default: ldv_stop(); } ldv_42705: ; return; } } void ldv_main_exported_24(void) { char *ldvarg50 ; void *tmp ; struct device *ldvarg49 ; void *tmp___0 ; struct device_attribute *ldvarg51 ; void *tmp___1 ; int tmp___2 ; { tmp = ldv_init_zalloc(1UL); ldvarg50 = (char *)tmp; tmp___0 = ldv_init_zalloc(1416UL); ldvarg49 = (struct device *)tmp___0; tmp___1 = ldv_init_zalloc(48UL); ldvarg51 = (struct device_attribute *)tmp___1; tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_24 == 1) { show_ata_port_port_no(ldvarg49, ldvarg51, ldvarg50); ldv_state_variable_24 = 1; } else { } goto ldv_42714; default: ldv_stop(); } ldv_42714: ; return; } } void ldv_main_exported_23(void) { struct device_attribute *ldvarg99 ; void *tmp ; struct device *ldvarg97 ; void *tmp___0 ; char *ldvarg98 ; void *tmp___1 ; int tmp___2 ; { tmp = ldv_init_zalloc(48UL); ldvarg99 = (struct device_attribute *)tmp; tmp___0 = ldv_init_zalloc(1416UL); ldvarg97 = (struct device *)tmp___0; tmp___1 = ldv_init_zalloc(1UL); ldvarg98 = (char *)tmp___1; tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_23 == 1) { show_ata_link_hw_sata_spd_limit(ldvarg97, ldvarg99, ldvarg98); ldv_state_variable_23 = 1; } else { } goto ldv_42723; default: ldv_stop(); } ldv_42723: ; return; } } void ldv_main_exported_13(void) { struct device_attribute *ldvarg96 ; void *tmp ; struct device *ldvarg94 ; void *tmp___0 ; char *ldvarg95 ; void *tmp___1 ; int tmp___2 ; { tmp = ldv_init_zalloc(48UL); ldvarg96 = (struct device_attribute *)tmp; tmp___0 = ldv_init_zalloc(1416UL); ldvarg94 = (struct device *)tmp___0; tmp___1 = ldv_init_zalloc(1UL); ldvarg95 = (char *)tmp___1; tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_13 == 1) { show_ata_dev_gscr(ldvarg94, ldvarg96, ldvarg95); ldv_state_variable_13 = 1; } else { } goto ldv_42732; default: ldv_stop(); } ldv_42732: ; return; } } void ldv_main_exported_16(void) { struct device_attribute *ldvarg28 ; void *tmp ; struct device *ldvarg26 ; void *tmp___0 ; char *ldvarg27 ; void *tmp___1 ; int tmp___2 ; { tmp = ldv_init_zalloc(48UL); ldvarg28 = (struct device_attribute *)tmp; tmp___0 = ldv_init_zalloc(1416UL); ldvarg26 = (struct device *)tmp___0; tmp___1 = ldv_init_zalloc(1UL); ldvarg27 = (char *)tmp___1; tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_16 == 1) { show_ata_dev_spdn_cnt(ldvarg26, ldvarg28, ldvarg27); ldv_state_variable_16 = 1; } else { } goto ldv_42741; default: ldv_stop(); } ldv_42741: ; return; } } void ldv_main_exported_19(void) { char *ldvarg144 ; void *tmp ; struct device *ldvarg143 ; void *tmp___0 ; struct device_attribute *ldvarg145 ; void *tmp___1 ; int tmp___2 ; { tmp = ldv_init_zalloc(1UL); ldvarg144 = (char *)tmp; tmp___0 = ldv_init_zalloc(1416UL); ldvarg143 = (struct device *)tmp___0; tmp___1 = ldv_init_zalloc(48UL); ldvarg145 = (struct device_attribute *)tmp___1; tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_19 == 1) { show_ata_dev_pio_mode(ldvarg143, ldvarg145, ldvarg144); ldv_state_variable_19 = 1; } else { } goto ldv_42750; default: ldv_stop(); } ldv_42750: ; return; } } bool ldv_queue_work_on_49(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_50(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_51(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_52(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_53(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_63(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_65(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_64(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; bool ldv_queue_delayed_work_on_67(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; void ldv_flush_workqueue_66(struct workqueue_struct *ldv_func_arg1 ) ; __inline static unsigned int seq_buf_used(struct seq_buf *s ) { size_t _min1 ; size_t _min2 ; { _min1 = s->len; _min2 = s->size; return ((unsigned int )(_min1 < _min2 ? _min1 : _min2)); } } __inline static unsigned char *trace_seq_buffer_ptr(struct trace_seq *s ) { unsigned int tmp ; { tmp = seq_buf_used(& s->seq); return ((unsigned char *)(& s->buffer) + (unsigned long )tmp); } } extern void trace_seq_putc(struct trace_seq * , unsigned char ) ; char const *libata_trace_parse_status(struct trace_seq *p , unsigned char status ) { char const *ret ; unsigned char *tmp ; { tmp = trace_seq_buffer_ptr(p); ret = (char const *)tmp; trace_seq_printf(p, "{ "); if ((int )((signed char )status) < 0) { trace_seq_printf(p, "BUSY "); } else { } if (((int )status & 64) != 0) { trace_seq_printf(p, "DRDY "); } else { } if (((int )status & 32) != 0) { trace_seq_printf(p, "DF "); } else { } if (((int )status & 16) != 0) { trace_seq_printf(p, "DSC "); } else { } if (((int )status & 8) != 0) { trace_seq_printf(p, "DRQ "); } else { } if (((int )status & 4) != 0) { trace_seq_printf(p, "CORR "); } else { } if (((int )status & 2) != 0) { trace_seq_printf(p, "SENSE "); } else { } if ((int )status & 1) { trace_seq_printf(p, "ERR "); } else { } trace_seq_putc(p, 125); trace_seq_putc(p, 0); return (ret); } } char const *libata_trace_parse_eh_action(struct trace_seq *p , unsigned int eh_action ) { char const *ret ; unsigned char *tmp ; { tmp = trace_seq_buffer_ptr(p); ret = (char const *)tmp; trace_seq_printf(p, "%x", eh_action); if (eh_action != 0U) { trace_seq_printf(p, "{ "); if ((int )eh_action & 1) { trace_seq_printf(p, "REVALIDATE "); } else { } if ((eh_action & 6U) != 0U) { trace_seq_printf(p, "RESET "); } else if ((eh_action & 2U) != 0U) { trace_seq_printf(p, "SOFTRESET "); } else if ((eh_action & 4U) != 0U) { trace_seq_printf(p, "HARDRESET "); } else { } if ((eh_action & 8U) != 0U) { trace_seq_printf(p, "ENABLE_LINK "); } else { } if ((eh_action & 32U) != 0U) { trace_seq_printf(p, "PARK "); } else { } trace_seq_putc(p, 125); } else { } trace_seq_putc(p, 0); return (ret); } } char const *libata_trace_parse_eh_err_mask(struct trace_seq *p , unsigned int eh_err_mask ) { char const *ret ; unsigned char *tmp ; { tmp = trace_seq_buffer_ptr(p); ret = (char const *)tmp; trace_seq_printf(p, "%x", eh_err_mask); if (eh_err_mask != 0U) { trace_seq_printf(p, "{ "); if ((int )eh_err_mask & 1) { trace_seq_printf(p, "DEV "); } else { } if ((eh_err_mask & 2U) != 0U) { trace_seq_printf(p, "HSM "); } else { } if ((eh_err_mask & 4U) != 0U) { trace_seq_printf(p, "TIMEOUT "); } else { } if ((eh_err_mask & 8U) != 0U) { trace_seq_printf(p, "MEDIA "); } else { } if ((eh_err_mask & 16U) != 0U) { trace_seq_printf(p, "ATA_BUS "); } else { } if ((eh_err_mask & 32U) != 0U) { trace_seq_printf(p, "HOST_BUS "); } else { } if ((eh_err_mask & 64U) != 0U) { trace_seq_printf(p, "SYSTEM "); } else { } if ((eh_err_mask & 128U) != 0U) { trace_seq_printf(p, "INVALID "); } else { } if ((eh_err_mask & 256U) != 0U) { trace_seq_printf(p, "OTHER "); } else { } if ((eh_err_mask & 512U) != 0U) { trace_seq_printf(p, "NODEV_HINT "); } else { } if ((eh_err_mask & 1024U) != 0U) { trace_seq_printf(p, "NCQ "); } else { } trace_seq_putc(p, 125); } else { } trace_seq_putc(p, 0); return (ret); } } char const *libata_trace_parse_qc_flags(struct trace_seq *p , unsigned int qc_flags ) { char const *ret ; unsigned char *tmp ; { tmp = trace_seq_buffer_ptr(p); ret = (char const *)tmp; trace_seq_printf(p, "%x", qc_flags); if (qc_flags != 0U) { trace_seq_printf(p, "{ "); if ((int )qc_flags & 1) { trace_seq_printf(p, "ACTIVE "); } else { } if ((qc_flags & 2U) != 0U) { trace_seq_printf(p, "DMAMAP "); } else { } if ((qc_flags & 8U) != 0U) { trace_seq_printf(p, "IO "); } else { } if ((qc_flags & 16U) != 0U) { trace_seq_printf(p, "RESULT_TF "); } else { } if ((qc_flags & 32U) != 0U) { trace_seq_printf(p, "CLEAR_EXCL "); } else { } if ((qc_flags & 64U) != 0U) { trace_seq_printf(p, "QUIET "); } else { } if ((qc_flags & 128U) != 0U) { trace_seq_printf(p, "RETRY "); } else { } if ((qc_flags & 65536U) != 0U) { trace_seq_printf(p, "FAILED "); } else { } if ((qc_flags & 131072U) != 0U) { trace_seq_printf(p, "SENSE_VALID "); } else { } if ((qc_flags & 262144U) != 0U) { trace_seq_printf(p, "EH_SCHEDULED "); } else { } trace_seq_putc(p, 125); } else { } trace_seq_putc(p, 0); return (ret); } } bool ldv_queue_work_on_63(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_64(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_65(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_66(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_67(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; __inline static int constant_test_bit(long nr , unsigned long const volatile *addr ) { { return ((int )((unsigned long )*(addr + (unsigned long )(nr >> 6)) >> ((int )nr & 63)) & 1); } } __inline static unsigned long arch_local_save_flags___1(void) { unsigned long __ret ; unsigned long __edi ; unsigned long __esi ; unsigned long __edx ; unsigned long __ecx ; unsigned long __eax ; long tmp ; { __edi = __edi; __esi = __esi; __edx = __edx; __ecx = __ecx; __eax = __eax; tmp = ldv__builtin_expect((unsigned long )pv_irq_ops.save_fl.func == (unsigned long )((void *)0), 0L); if (tmp != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"./arch/x86/include/asm/paravirt.h"), "i" (831), "i" (12UL)); ldv_4860: ; goto ldv_4860; } else { } __asm__ volatile ("771:\n\tcall *%c2;\n772:\n.pushsection .parainstructions,\"a\"\n .balign 8 \n .quad 771b\n .byte %c1\n .byte 772b-771b\n .short %c3\n.popsection\n": "=a" (__eax): [paravirt_typenum] "i" (43UL), [paravirt_opptr] "i" (& pv_irq_ops.save_fl.func), [paravirt_clobber] "i" (1): "memory", "cc"); __ret = __eax; return (__ret); } } __inline static void arch_local_irq_restore(unsigned long f ) { unsigned long __edi ; unsigned long __esi ; unsigned long __edx ; unsigned long __ecx ; unsigned long __eax ; long tmp ; { __edi = __edi; __esi = __esi; __edx = __edx; __ecx = __ecx; __eax = __eax; tmp = ldv__builtin_expect((unsigned long )pv_irq_ops.restore_fl.func == (unsigned long )((void *)0), 0L); if (tmp != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"./arch/x86/include/asm/paravirt.h"), "i" (836), "i" (12UL)); ldv_4870: ; goto ldv_4870; } else { } __asm__ volatile ("771:\n\tcall *%c2;\n772:\n.pushsection .parainstructions,\"a\"\n .balign 8 \n .quad 771b\n .byte %c1\n .byte 772b-771b\n .short %c3\n.popsection\n": "=a" (__eax): [paravirt_typenum] "i" (44UL), [paravirt_opptr] "i" (& pv_irq_ops.restore_fl.func), [paravirt_clobber] "i" (1), "D" (f): "memory", "cc"); return; } } __inline static void arch_local_irq_disable(void) { unsigned long __edi ; unsigned long __esi ; unsigned long __edx ; unsigned long __ecx ; unsigned long __eax ; long tmp ; { __edi = __edi; __esi = __esi; __edx = __edx; __ecx = __ecx; __eax = __eax; tmp = ldv__builtin_expect((unsigned long )pv_irq_ops.irq_disable.func == (unsigned long )((void *)0), 0L); if (tmp != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"./arch/x86/include/asm/paravirt.h"), "i" (841), "i" (12UL)); ldv_4879: ; goto ldv_4879; } else { } __asm__ volatile ("771:\n\tcall *%c2;\n772:\n.pushsection .parainstructions,\"a\"\n .balign 8 \n .quad 771b\n .byte %c1\n .byte 772b-771b\n .short %c3\n.popsection\n": "=a" (__eax): [paravirt_typenum] "i" (45UL), [paravirt_opptr] "i" (& pv_irq_ops.irq_disable.func), [paravirt_clobber] "i" (1): "memory", "cc"); return; } } __inline static unsigned long arch_local_irq_save(void) { unsigned long f ; { f = arch_local_save_flags___1(); arch_local_irq_disable(); return (f); } } extern void trace_hardirqs_on(void) ; extern void trace_hardirqs_off(void) ; extern void _raw_spin_lock_irq(raw_spinlock_t * ) ; __inline static void spin_lock_irq(spinlock_t *lock ) { { _raw_spin_lock_irq(& lock->__annonCompField18.rlock); return; } } extern struct workqueue_struct *__alloc_workqueue_key(char const * , unsigned int , int , struct lock_class_key * , char const * , ...) ; extern void destroy_workqueue(struct workqueue_struct * ) ; void ldv_destroy_workqueue_83(struct workqueue_struct *ldv_func_arg1 ) ; bool ldv_queue_work_on_77(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_79(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_78(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; bool ldv_queue_delayed_work_on_81(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; void ldv_flush_workqueue_80(struct workqueue_struct *ldv_func_arg1 ) ; bool ldv_cancel_delayed_work_sync_82(struct delayed_work *ldv_func_arg1 ) ; __inline static bool queue_work___0(struct workqueue_struct *wq , struct work_struct *work ) { bool tmp ; { tmp = ldv_queue_work_on_77(8192, wq, work); return (tmp); } } __inline static bool queue_delayed_work___1(struct workqueue_struct *wq , struct delayed_work *dwork , unsigned long delay ) { bool tmp ; { tmp = ldv_queue_delayed_work_on_78(8192, wq, dwork, delay); return (tmp); } } extern unsigned int ioread8(void * ) ; extern unsigned int ioread16(void * ) ; extern void iowrite8(u8 , void * ) ; extern void iowrite32(u32 , void * ) ; extern void ioread16_rep(void * , void * , unsigned long ) ; extern void ioread32_rep(void * , void * , unsigned long ) ; extern void iowrite16_rep(void * , void const * , unsigned long ) ; extern void iowrite32_rep(void * , void const * , unsigned long ) ; __inline static void outb(unsigned char value , int port ) { { __asm__ volatile ("outb %b0, %w1": : "a" (value), "Nd" (port)); return; } } __inline static unsigned char inb(int port ) { unsigned char value ; { __asm__ volatile ("inb %w1, %b0": "=a" (value): "Nd" (port)); return (value); } } void activate_work_3(struct work_struct *work , int state ) ; void call_and_disable_work_3(struct work_struct *work ) ; void disable_work_3(struct work_struct *work ) ; void invoke_work_3(void) ; void call_and_disable_all_3(int state ) ; extern char const *dev_driver_string(struct device const * ) ; extern void dev_warn(struct device const * , char const * , ...) ; extern void pcim_pin_device(struct pci_dev * ) ; __inline static int PageSlab(struct page const *page ) { int tmp ; { tmp = constant_test_bit(7L, (unsigned long const volatile *)(& page->flags)); return (tmp); } } __inline static int PageHighMem(struct page const *page ) { { return (0); } } __inline static struct page *sg_page___1(struct scatterlist *sg ) { long tmp ; long tmp___0 ; { tmp = ldv__builtin_expect(sg->sg_magic != 2271560481UL, 0L); if (tmp != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"include/linux/scatterlist.h"), "i" (123), "i" (12UL)); ldv_25683: ; goto ldv_25683; } else { } tmp___0 = ldv__builtin_expect((long )((int )sg->page_link) & 1L, 0L); if (tmp___0 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"include/linux/scatterlist.h"), "i" (124), "i" (12UL)); ldv_25684: ; goto ldv_25684; } else { } return ((struct page *)(sg->page_link & 0xfffffffffffffffcUL)); } } extern int dma_supported(struct device * , u64 ) ; extern int dma_set_mask(struct device * , u64 ) ; __inline static int dma_set_coherent_mask(struct device *dev , u64 mask ) { int tmp ; { tmp = dma_supported(dev, mask); if (tmp == 0) { return (-5); } else { } dev->coherent_dma_mask = mask; return (0); } } extern void *dmam_alloc_coherent(struct device * , size_t , dma_addr_t * , gfp_t ) ; extern void * const *pcim_iomap_table(struct pci_dev * ) ; extern int pcim_iomap_regions(struct pci_dev * , int , char const * ) ; extern void __const_udelay(unsigned long ) ; __inline static bool ata_ok(u8 status ) { { return (((int )status & 233) == 64); } } __inline static void pagefault_disabled_inc(void) { struct task_struct *tmp ; { tmp = get_current(); tmp->pagefault_disabled = tmp->pagefault_disabled + 1; return; } } __inline static void pagefault_disabled_dec(void) { struct task_struct *tmp ; int __ret_warn_on ; struct task_struct *tmp___0 ; long tmp___1 ; { tmp = get_current(); tmp->pagefault_disabled = tmp->pagefault_disabled - 1; tmp___0 = get_current(); __ret_warn_on = tmp___0->pagefault_disabled < 0; tmp___1 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_null("include/linux/uaccess.h", 15); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); return; } } __inline static void pagefault_disable(void) { { pagefault_disabled_inc(); __asm__ volatile ("": : : "memory"); return; } } __inline static void pagefault_enable(void) { { __asm__ volatile ("": : : "memory"); pagefault_disabled_dec(); return; } } __inline static void *kmap_atomic(struct page *page ) { void *tmp ; { __preempt_count_add(1); __asm__ volatile ("": : : "memory"); pagefault_disable(); tmp = lowmem_page_address((struct page const *)page); return (tmp); } } __inline static void __kunmap_atomic(void *addr ) { { pagefault_enable(); __asm__ volatile ("": : : "memory"); __preempt_count_sub(1); return; } } __inline static void ata_qc_set_polling(struct ata_queued_cmd *qc ) { { qc->tf.ctl = (u8 )((unsigned int )qc->tf.ctl | 2U); return; } } __inline static unsigned int ac_err_mask(u8 status ) { { if (((int )status & 136) != 0) { return (2U); } else { } if (((int )status & 33) != 0) { return (1U); } else { } return (0U); } } __inline static unsigned int __ac_err_mask(u8 status ) { unsigned int mask ; unsigned int tmp ; { tmp = ac_err_mask((int )status); mask = tmp; if (mask == 0U) { return (256U); } else { } return (mask); } } __inline static int ata_check_ready(u8 status ) { { if ((int )((signed char )status) >= 0) { return (1); } else { } if ((unsigned int )status == 255U) { return (-19); } else { } return (0); } } struct ata_port_operations const ata_sff_port_ops ; struct ata_port_operations const ata_bmdma32_port_ops ; void ata_sff_dev_select(struct ata_port *ap , unsigned int device ) ; u8 ata_sff_check_status(struct ata_port *ap ) ; void ata_sff_pause(struct ata_port *ap ) ; void ata_sff_dma_pause(struct ata_port *ap ) ; int ata_sff_busy_sleep(struct ata_port *ap , unsigned long tmout_pat , unsigned long tmout ) ; int ata_sff_wait_ready(struct ata_link *link , unsigned long deadline ) ; void ata_sff_tf_load(struct ata_port *ap , struct ata_taskfile const *tf ) ; void ata_sff_tf_read(struct ata_port *ap , struct ata_taskfile *tf ) ; void ata_sff_exec_command(struct ata_port *ap , struct ata_taskfile const *tf ) ; unsigned int ata_sff_data_xfer(struct ata_device *dev , unsigned char *buf , unsigned int buflen , int rw ) ; unsigned int ata_sff_data_xfer32(struct ata_device *dev , unsigned char *buf , unsigned int buflen , int rw ) ; unsigned int ata_sff_data_xfer_noirq(struct ata_device *dev , unsigned char *buf , unsigned int buflen , int rw ) ; void ata_sff_irq_on(struct ata_port *ap ) ; int ata_sff_hsm_move(struct ata_port *ap , struct ata_queued_cmd *qc , u8 status , int in_wq ) ; void ata_sff_queue_work(struct work_struct *work ) ; void ata_sff_queue_delayed_work(struct delayed_work *dwork , unsigned long delay ) ; void ata_sff_queue_pio_task(struct ata_link *link , unsigned long delay ) ; unsigned int ata_sff_qc_issue(struct ata_queued_cmd *qc ) ; bool ata_sff_qc_fill_rtf(struct ata_queued_cmd *qc ) ; unsigned int ata_sff_port_intr(struct ata_port *ap , struct ata_queued_cmd *qc ) ; irqreturn_t ata_sff_interrupt(int irq , void *dev_instance ) ; void ata_sff_lost_interrupt(struct ata_port *ap ) ; void ata_sff_freeze(struct ata_port *ap ) ; void ata_sff_thaw(struct ata_port *ap ) ; int ata_sff_prereset(struct ata_link *link , unsigned long deadline ) ; unsigned int ata_sff_dev_classify(struct ata_device *dev , int present , u8 *r_err ) ; int ata_sff_wait_after_reset(struct ata_link *link , unsigned int devmask , unsigned long deadline ) ; int ata_sff_softreset(struct ata_link *link , unsigned int *classes , unsigned long deadline ) ; int sata_sff_hardreset(struct ata_link *link , unsigned int *class , unsigned long deadline ) ; void ata_sff_postreset(struct ata_link *link , unsigned int *classes ) ; void ata_sff_drain_fifo(struct ata_queued_cmd *qc ) ; void ata_sff_error_handler(struct ata_port *ap ) ; void ata_sff_std_ports(struct ata_ioports *ioaddr ) ; int ata_pci_sff_init_host(struct ata_host *host ) ; int ata_pci_sff_prepare_host(struct pci_dev *pdev , struct ata_port_info const * const *ppi , struct ata_host **r_host ) ; int ata_pci_sff_activate_host(struct ata_host *host , irqreturn_t (*irq_handler)(int , void * ) , struct scsi_host_template *sht ) ; int ata_pci_sff_init_one(struct pci_dev *pdev , struct ata_port_info const * const *ppi , struct scsi_host_template *sht , void *host_priv , int hflag ) ; struct ata_port_operations const ata_bmdma_port_ops ; void ata_bmdma_qc_prep(struct ata_queued_cmd *qc ) ; unsigned int ata_bmdma_qc_issue(struct ata_queued_cmd *qc ) ; void ata_bmdma_dumb_qc_prep(struct ata_queued_cmd *qc ) ; unsigned int ata_bmdma_port_intr(struct ata_port *ap , struct ata_queued_cmd *qc ) ; irqreturn_t ata_bmdma_interrupt(int irq , void *dev_instance ) ; void ata_bmdma_error_handler(struct ata_port *ap ) ; void ata_bmdma_post_internal_cmd(struct ata_queued_cmd *qc ) ; void ata_bmdma_irq_clear(struct ata_port *ap ) ; void ata_bmdma_setup(struct ata_queued_cmd *qc ) ; void ata_bmdma_start(struct ata_queued_cmd *qc ) ; void ata_bmdma_stop(struct ata_queued_cmd *qc ) ; u8 ata_bmdma_status(struct ata_port *ap ) ; int ata_bmdma_port_start(struct ata_port *ap ) ; int ata_bmdma_port_start32(struct ata_port *ap ) ; int ata_pci_bmdma_clear_simplex(struct pci_dev *pdev ) ; void ata_pci_bmdma_init(struct ata_host *host ) ; int ata_pci_bmdma_prepare_host(struct pci_dev *pdev , struct ata_port_info const * const *ppi , struct ata_host **r_host ) ; int ata_pci_bmdma_init_one(struct pci_dev *pdev , struct ata_port_info const * const *ppi , struct scsi_host_template *sht , void *host_priv , int hflags ) ; __inline static u8 ata_sff_busy_wait(struct ata_port *ap , unsigned int bits , unsigned int max ) { u8 status ; { ldv_42590: __const_udelay(42950UL); status = (*((ap->ops)->sff_check_status))(ap); max = max - 1U; if (((unsigned int )status != 255U && ((unsigned int )status & bits) != 0U) && max != 0U) { goto ldv_42590; } else { } return (status); } } __inline static u8 ata_wait_idle(struct ata_port *ap ) { u8 status ; u8 tmp ; { tmp = ata_sff_busy_wait(ap, 136U, 1000U); status = tmp; return (status); } } static struct workqueue_struct *ata_sff_wq ; struct ata_port_operations const ata_sff_port_ops = {0, 0, & ata_noop_qc_prep, & ata_sff_qc_issue, & ata_sff_qc_fill_rtf, 0, 0, 0, 0, 0, 0, 0, & ata_sff_freeze, & ata_sff_thaw, & ata_sff_prereset, & ata_sff_softreset, & sata_sff_hardreset, & ata_sff_postreset, 0, 0, 0, 0, & ata_sff_error_handler, & ata_sff_lost_interrupt, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & ata_sff_dev_select, 0, & ata_sff_check_status, 0, & ata_sff_tf_load, & ata_sff_tf_read, & ata_sff_exec_command, & ata_sff_data_xfer, 0, 0, 0, & ata_sff_drain_fifo, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & ata_base_port_ops}; static char const __kstrtab_ata_sff_port_ops[17U] = { 'a', 't', 'a', '_', 's', 'f', 'f', '_', 'p', 'o', 'r', 't', '_', 'o', 'p', 's', '\000'}; struct kernel_symbol const __ksymtab_ata_sff_port_ops ; struct kernel_symbol const __ksymtab_ata_sff_port_ops = {(unsigned long )(& ata_sff_port_ops), (char const *)(& __kstrtab_ata_sff_port_ops)}; u8 ata_sff_check_status(struct ata_port *ap ) { unsigned int tmp ; { tmp = ioread8(ap->ioaddr.status_addr); return ((u8 )tmp); } } static char const __kstrtab_ata_sff_check_status[21U] = { 'a', 't', 'a', '_', 's', 'f', 'f', '_', 'c', 'h', 'e', 'c', 'k', '_', 's', 't', 'a', 't', 'u', 's', '\000'}; struct kernel_symbol const __ksymtab_ata_sff_check_status ; struct kernel_symbol const __ksymtab_ata_sff_check_status = {(unsigned long )(& ata_sff_check_status), (char const *)(& __kstrtab_ata_sff_check_status)}; static u8 ata_sff_altstatus(struct ata_port *ap ) { u8 tmp ; unsigned int tmp___0 ; { if ((unsigned long )(ap->ops)->sff_check_altstatus != (unsigned long )((u8 (*)(struct ata_port * ))0)) { tmp = (*((ap->ops)->sff_check_altstatus))(ap); return (tmp); } else { } tmp___0 = ioread8(ap->ioaddr.altstatus_addr); return ((u8 )tmp___0); } } static u8 ata_sff_irq_status(struct ata_port *ap ) { u8 status ; { if ((unsigned long )(ap->ops)->sff_check_altstatus != (unsigned long )((u8 (*)(struct ata_port * ))0) || (unsigned long )ap->ioaddr.altstatus_addr != (unsigned long )((void *)0)) { status = ata_sff_altstatus(ap); if ((int )((signed char )status) < 0) { return (status); } else { } } else { } status = (*((ap->ops)->sff_check_status))(ap); return (status); } } static void ata_sff_sync(struct ata_port *ap ) { { if ((unsigned long )(ap->ops)->sff_check_altstatus != (unsigned long )((u8 (*)(struct ata_port * ))0)) { (*((ap->ops)->sff_check_altstatus))(ap); } else if ((unsigned long )ap->ioaddr.altstatus_addr != (unsigned long )((void *)0)) { ioread8(ap->ioaddr.altstatus_addr); } else { } return; } } void ata_sff_pause(struct ata_port *ap ) { { ata_sff_sync(ap); __const_udelay(2000UL); return; } } static char const __kstrtab_ata_sff_pause[14U] = { 'a', 't', 'a', '_', 's', 'f', 'f', '_', 'p', 'a', 'u', 's', 'e', '\000'}; struct kernel_symbol const __ksymtab_ata_sff_pause ; struct kernel_symbol const __ksymtab_ata_sff_pause = {(unsigned long )(& ata_sff_pause), (char const *)(& __kstrtab_ata_sff_pause)}; void ata_sff_dma_pause(struct ata_port *ap ) { { if ((unsigned long )(ap->ops)->sff_check_altstatus != (unsigned long )((u8 (*)(struct ata_port * ))0) || (unsigned long )ap->ioaddr.altstatus_addr != (unsigned long )((void *)0)) { ata_sff_altstatus(ap); return; } else { } __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-sff.c"), "i" (196), "i" (12UL)); ldv_42931: ; goto ldv_42931; } } static char const __kstrtab_ata_sff_dma_pause[18U] = { 'a', 't', 'a', '_', 's', 'f', 'f', '_', 'd', 'm', 'a', '_', 'p', 'a', 'u', 's', 'e', '\000'}; struct kernel_symbol const __ksymtab_ata_sff_dma_pause ; struct kernel_symbol const __ksymtab_ata_sff_dma_pause = {(unsigned long )(& ata_sff_dma_pause), (char const *)(& __kstrtab_ata_sff_dma_pause)}; int ata_sff_busy_sleep(struct ata_port *ap , unsigned long tmout_pat , unsigned long tmout ) { unsigned long timer_start ; unsigned long timeout ; u8 status ; { status = ata_sff_busy_wait(ap, 128U, 300U); timer_start = jiffies; timeout = ata_deadline(timer_start, tmout_pat); goto ldv_42954; ldv_42953: ata_msleep(ap, 50U); status = ata_sff_busy_wait(ap, 128U, 3U); ldv_42954: ; if (((unsigned int )status != 255U && (int )((signed char )status) < 0) && (long )((unsigned long )jiffies - timeout) < 0L) { goto ldv_42953; } else { } if ((unsigned int )status != 255U && (int )((signed char )status) < 0) { ata_port_printk((struct ata_port const *)ap, "\f", "port is slow to respond, please be patient (Status 0x%x)\n", (int )status); } else { } timeout = ata_deadline(timer_start, tmout); goto ldv_42963; ldv_42962: ata_msleep(ap, 50U); status = (*((ap->ops)->sff_check_status))(ap); ldv_42963: ; if (((unsigned int )status != 255U && (int )((signed char )status) < 0) && (long )((unsigned long )jiffies - timeout) < 0L) { goto ldv_42962; } else { } if ((unsigned int )status == 255U) { return (-19); } else { } if ((int )((signed char )status) < 0) { ata_port_printk((struct ata_port const *)ap, "\v", "port failed to respond (%lu secs, Status 0x%x)\n", (tmout + 999UL) / 1000UL, (int )status); return (-16); } else { } return (0); } } static char const __kstrtab_ata_sff_busy_sleep[19U] = { 'a', 't', 'a', '_', 's', 'f', 'f', '_', 'b', 'u', 's', 'y', '_', 's', 'l', 'e', 'e', 'p', '\000'}; struct kernel_symbol const __ksymtab_ata_sff_busy_sleep ; struct kernel_symbol const __ksymtab_ata_sff_busy_sleep = {(unsigned long )(& ata_sff_busy_sleep), (char const *)(& __kstrtab_ata_sff_busy_sleep)}; static int ata_sff_check_ready(struct ata_link *link ) { u8 status ; u8 tmp ; int tmp___0 ; { tmp = (*(((link->ap)->ops)->sff_check_status))(link->ap); status = tmp; tmp___0 = ata_check_ready((int )status); return (tmp___0); } } int ata_sff_wait_ready(struct ata_link *link , unsigned long deadline ) { int tmp ; { tmp = ata_wait_ready(link, deadline, & ata_sff_check_ready); return (tmp); } } static char const __kstrtab_ata_sff_wait_ready[19U] = { 'a', 't', 'a', '_', 's', 'f', 'f', '_', 'w', 'a', 'i', 't', '_', 'r', 'e', 'a', 'd', 'y', '\000'}; struct kernel_symbol const __ksymtab_ata_sff_wait_ready ; struct kernel_symbol const __ksymtab_ata_sff_wait_ready = {(unsigned long )(& ata_sff_wait_ready), (char const *)(& __kstrtab_ata_sff_wait_ready)}; static void ata_sff_set_devctl(struct ata_port *ap , u8 ctl ) { { if ((unsigned long )(ap->ops)->sff_set_devctl != (unsigned long )((void (*)(struct ata_port * , u8 ))0)) { (*((ap->ops)->sff_set_devctl))(ap, (int )ctl); } else { iowrite8((int )ctl, ap->ioaddr.ctl_addr); } return; } } void ata_sff_dev_select(struct ata_port *ap , unsigned int device ) { u8 tmp ; { if (device == 0U) { tmp = 160U; } else { tmp = 176U; } iowrite8((int )tmp, ap->ioaddr.device_addr); ata_sff_pause(ap); return; } } static char const __kstrtab_ata_sff_dev_select[19U] = { 'a', 't', 'a', '_', 's', 'f', 'f', '_', 'd', 'e', 'v', '_', 's', 'e', 'l', 'e', 'c', 't', '\000'}; struct kernel_symbol const __ksymtab_ata_sff_dev_select ; struct kernel_symbol const __ksymtab_ata_sff_dev_select = {(unsigned long )(& ata_sff_dev_select), (char const *)(& __kstrtab_ata_sff_dev_select)}; static void ata_dev_select(struct ata_port *ap , unsigned int device , unsigned int wait , unsigned int can_sleep ) { { if ((ap->msg_enable & 4U) != 0U) { ata_port_printk((struct ata_port const *)ap, "\016", "ata_dev_select: ENTER, device %u, wait %u\n", device, wait); } else { } if (wait != 0U) { ata_wait_idle(ap); } else { } (*((ap->ops)->sff_dev_select))(ap, device); if (wait != 0U) { if (can_sleep != 0U && ap->link.device[device].class == 3U) { ata_msleep(ap, 150U); } else { } ata_wait_idle(ap); } else { } return; } } void ata_sff_irq_on(struct ata_port *ap ) { struct ata_ioports *ioaddr ; { ioaddr = & ap->ioaddr; if ((unsigned long )(ap->ops)->sff_irq_on != (unsigned long )((void (*)(struct ata_port * ))0)) { (*((ap->ops)->sff_irq_on))(ap); return; } else { } ap->ctl = (unsigned int )ap->ctl & 253U; ap->last_ctl = ap->ctl; if ((unsigned long )(ap->ops)->sff_set_devctl != (unsigned long )((void (*)(struct ata_port * , u8 ))0) || (unsigned long )ioaddr->ctl_addr != (unsigned long )((void *)0)) { ata_sff_set_devctl(ap, (int )ap->ctl); } else { } ata_wait_idle(ap); if ((unsigned long )(ap->ops)->sff_irq_clear != (unsigned long )((void (*)(struct ata_port * ))0)) { (*((ap->ops)->sff_irq_clear))(ap); } else { } return; } } static char const __kstrtab_ata_sff_irq_on[15U] = { 'a', 't', 'a', '_', 's', 'f', 'f', '_', 'i', 'r', 'q', '_', 'o', 'n', '\000'}; struct kernel_symbol const __ksymtab_ata_sff_irq_on ; struct kernel_symbol const __ksymtab_ata_sff_irq_on = {(unsigned long )(& ata_sff_irq_on), (char const *)(& __kstrtab_ata_sff_irq_on)}; void ata_sff_tf_load(struct ata_port *ap , struct ata_taskfile const *tf ) { struct ata_ioports *ioaddr ; unsigned int is_addr ; bool __warned ; int __ret_warn_once ; int __ret_warn_on ; long tmp ; long tmp___0 ; long tmp___1 ; { ioaddr = & ap->ioaddr; is_addr = (unsigned int )tf->flags & 2U; if ((int )((unsigned char )tf->ctl) != (int )ap->last_ctl) { if ((unsigned long )ioaddr->ctl_addr != (unsigned long )((void *)0)) { iowrite8((int )tf->ctl, ioaddr->ctl_addr); } else { } ap->last_ctl = tf->ctl; ata_wait_idle(ap); } else { } if (is_addr != 0U && (int )tf->flags & 1) { __ret_warn_once = (unsigned long )ioaddr->ctl_addr == (unsigned long )((void *)0); tmp___1 = ldv__builtin_expect(__ret_warn_once != 0, 0L); if (tmp___1 != 0L) { __ret_warn_on = ! __warned; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-sff.c", 426); } else { } tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { __warned = 1; } else { } } else { } ldv__builtin_expect(__ret_warn_once != 0, 0L); iowrite8((int )tf->hob_feature, ioaddr->feature_addr); iowrite8((int )tf->hob_nsect, ioaddr->nsect_addr); iowrite8((int )tf->hob_lbal, ioaddr->lbal_addr); iowrite8((int )tf->hob_lbam, ioaddr->lbam_addr); iowrite8((int )tf->hob_lbah, ioaddr->lbah_addr); } else { } if (is_addr != 0U) { iowrite8((int )tf->feature, ioaddr->feature_addr); iowrite8((int )tf->nsect, ioaddr->nsect_addr); iowrite8((int )tf->lbal, ioaddr->lbal_addr); iowrite8((int )tf->lbam, ioaddr->lbam_addr); iowrite8((int )tf->lbah, ioaddr->lbah_addr); } else { } if (((unsigned long )tf->flags & 4UL) != 0UL) { iowrite8((int )tf->device, ioaddr->device_addr); } else { } ata_wait_idle(ap); return; } } static char const __kstrtab_ata_sff_tf_load[16U] = { 'a', 't', 'a', '_', 's', 'f', 'f', '_', 't', 'f', '_', 'l', 'o', 'a', 'd', '\000'}; struct kernel_symbol const __ksymtab_ata_sff_tf_load ; struct kernel_symbol const __ksymtab_ata_sff_tf_load = {(unsigned long )(& ata_sff_tf_load), (char const *)(& __kstrtab_ata_sff_tf_load)}; void ata_sff_tf_read(struct ata_port *ap , struct ata_taskfile *tf ) { struct ata_ioports *ioaddr ; unsigned int tmp ; unsigned int tmp___0 ; unsigned int tmp___1 ; unsigned int tmp___2 ; unsigned int tmp___3 ; unsigned int tmp___4 ; unsigned int tmp___5 ; unsigned int tmp___6 ; unsigned int tmp___7 ; unsigned int tmp___8 ; unsigned int tmp___9 ; bool __warned ; int __ret_warn_once ; int __ret_warn_on ; long tmp___10 ; long tmp___11 ; long tmp___12 ; long tmp___13 ; { ioaddr = & ap->ioaddr; tf->command = ata_sff_check_status(ap); tmp = ioread8(ioaddr->error_addr); tf->feature = (u8 )tmp; tmp___0 = ioread8(ioaddr->nsect_addr); tf->nsect = (u8 )tmp___0; tmp___1 = ioread8(ioaddr->lbal_addr); tf->lbal = (u8 )tmp___1; tmp___2 = ioread8(ioaddr->lbam_addr); tf->lbam = (u8 )tmp___2; tmp___3 = ioread8(ioaddr->lbah_addr); tf->lbah = (u8 )tmp___3; tmp___4 = ioread8(ioaddr->device_addr); tf->device = (u8 )tmp___4; if ((int )tf->flags & 1) { tmp___13 = ldv__builtin_expect((unsigned long )ioaddr->ctl_addr != (unsigned long )((void *)0), 1L); if (tmp___13 != 0L) { iowrite8((int )((unsigned int )tf->ctl | 128U), ioaddr->ctl_addr); tmp___5 = ioread8(ioaddr->error_addr); tf->hob_feature = (u8 )tmp___5; tmp___6 = ioread8(ioaddr->nsect_addr); tf->hob_nsect = (u8 )tmp___6; tmp___7 = ioread8(ioaddr->lbal_addr); tf->hob_lbal = (u8 )tmp___7; tmp___8 = ioread8(ioaddr->lbam_addr); tf->hob_lbam = (u8 )tmp___8; tmp___9 = ioread8(ioaddr->lbah_addr); tf->hob_lbah = (u8 )tmp___9; iowrite8((int )tf->ctl, ioaddr->ctl_addr); ap->last_ctl = tf->ctl; } else { __ret_warn_once = 1; tmp___12 = ldv__builtin_expect(__ret_warn_once != 0, 0L); if (tmp___12 != 0L) { __ret_warn_on = ! __warned; tmp___10 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___10 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-sff.c", 499); } else { } tmp___11 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___11 != 0L) { __warned = 1; } else { } } else { } ldv__builtin_expect(__ret_warn_once != 0, 0L); } } else { } return; } } static char const __kstrtab_ata_sff_tf_read[16U] = { 'a', 't', 'a', '_', 's', 'f', 'f', '_', 't', 'f', '_', 'r', 'e', 'a', 'd', '\000'}; struct kernel_symbol const __ksymtab_ata_sff_tf_read ; struct kernel_symbol const __ksymtab_ata_sff_tf_read = {(unsigned long )(& ata_sff_tf_read), (char const *)(& __kstrtab_ata_sff_tf_read)}; void ata_sff_exec_command(struct ata_port *ap , struct ata_taskfile const *tf ) { { iowrite8((int )tf->command, ap->ioaddr.command_addr); ata_sff_pause(ap); return; } } static char const __kstrtab_ata_sff_exec_command[21U] = { 'a', 't', 'a', '_', 's', 'f', 'f', '_', 'e', 'x', 'e', 'c', '_', 'c', 'o', 'm', 'm', 'a', 'n', 'd', '\000'}; struct kernel_symbol const __ksymtab_ata_sff_exec_command ; struct kernel_symbol const __ksymtab_ata_sff_exec_command = {(unsigned long )(& ata_sff_exec_command), (char const *)(& __kstrtab_ata_sff_exec_command)}; __inline static void ata_tf_to_host(struct ata_port *ap , struct ata_taskfile const *tf ) { { (*((ap->ops)->sff_tf_load))(ap, tf); (*((ap->ops)->sff_exec_command))(ap, tf); return; } } unsigned int ata_sff_data_xfer(struct ata_device *dev , unsigned char *buf , unsigned int buflen , int rw ) { struct ata_port *ap ; void *data_addr ; unsigned int words ; unsigned char pad[2U] ; long tmp ; { ap = (dev->link)->ap; data_addr = ap->ioaddr.data_addr; words = buflen >> 1; if (rw == 0) { ioread16_rep(data_addr, (void *)buf, (unsigned long )words); } else { iowrite16_rep(data_addr, (void const *)buf, (unsigned long )words); } tmp = ldv__builtin_expect((long )((int )buflen) & 1L, 0L); if (tmp != 0L) { pad[0] = (unsigned char)0; pad[1] = (unsigned char)0; buf = buf + (unsigned long )(buflen - 1U); if (rw == 0) { ioread16_rep(data_addr, (void *)(& pad), 1UL); *buf = pad[0]; } else { pad[0] = *buf; iowrite16_rep(data_addr, (void const *)(& pad), 1UL); } words = words + 1U; } else { } return (words << 1); } } static char const __kstrtab_ata_sff_data_xfer[18U] = { 'a', 't', 'a', '_', 's', 'f', 'f', '_', 'd', 'a', 't', 'a', '_', 'x', 'f', 'e', 'r', '\000'}; struct kernel_symbol const __ksymtab_ata_sff_data_xfer ; struct kernel_symbol const __ksymtab_ata_sff_data_xfer = {(unsigned long )(& ata_sff_data_xfer), (char const *)(& __kstrtab_ata_sff_data_xfer)}; unsigned int ata_sff_data_xfer32(struct ata_device *dev , unsigned char *buf , unsigned int buflen , int rw ) { struct ata_port *ap ; void *data_addr ; unsigned int words ; int slop ; unsigned int tmp ; unsigned char pad[4U] ; long tmp___0 ; { ap = (dev->link)->ap; data_addr = ap->ioaddr.data_addr; words = buflen >> 2; slop = (int )buflen & 3; if ((ap->pflags & 1048576U) == 0U) { tmp = ata_sff_data_xfer(dev, buf, buflen, rw); return (tmp); } else { } if (rw == 0) { ioread32_rep(data_addr, (void *)buf, (unsigned long )words); } else { iowrite32_rep(data_addr, (void const *)buf, (unsigned long )words); } tmp___0 = ldv__builtin_expect(slop != 0, 0L); if (tmp___0 != 0L) { pad[0] = (unsigned char)0; pad[1] = (unsigned char)0; pad[2] = (unsigned char)0; pad[3] = (unsigned char)0; buf = buf + (unsigned long )(buflen - (unsigned int )slop); if (rw == 0) { if (slop <= 2) { ioread16_rep(data_addr, (void *)(& pad), 1UL); } else { ioread32_rep(data_addr, (void *)(& pad), 1UL); } memcpy((void *)buf, (void const *)(& pad), (size_t )slop); } else { memcpy((void *)(& pad), (void const *)buf, (size_t )slop); if (slop <= 2) { iowrite16_rep(data_addr, (void const *)(& pad), 1UL); } else { iowrite32_rep(data_addr, (void const *)(& pad), 1UL); } } } else { } return ((buflen + 1U) & 4294967294U); } } static char const __kstrtab_ata_sff_data_xfer32[20U] = { 'a', 't', 'a', '_', 's', 'f', 'f', '_', 'd', 'a', 't', 'a', '_', 'x', 'f', 'e', 'r', '3', '2', '\000'}; struct kernel_symbol const __ksymtab_ata_sff_data_xfer32 ; struct kernel_symbol const __ksymtab_ata_sff_data_xfer32 = {(unsigned long )(& ata_sff_data_xfer32), (char const *)(& __kstrtab_ata_sff_data_xfer32)}; unsigned int ata_sff_data_xfer_noirq(struct ata_device *dev , unsigned char *buf , unsigned int buflen , int rw ) { unsigned long flags ; unsigned int consumed ; int tmp ; { flags = arch_local_irq_save(); trace_hardirqs_off(); consumed = ata_sff_data_xfer32(dev, buf, buflen, rw); tmp = arch_irqs_disabled_flags(flags); if (tmp != 0) { arch_local_irq_restore(flags); trace_hardirqs_off(); } else { trace_hardirqs_on(); arch_local_irq_restore(flags); } return (consumed); } } static char const __kstrtab_ata_sff_data_xfer_noirq[24U] = { 'a', 't', 'a', '_', 's', 'f', 'f', '_', 'd', 'a', 't', 'a', '_', 'x', 'f', 'e', 'r', '_', 'n', 'o', 'i', 'r', 'q', '\000'}; struct kernel_symbol const __ksymtab_ata_sff_data_xfer_noirq ; struct kernel_symbol const __ksymtab_ata_sff_data_xfer_noirq = {(unsigned long )(& ata_sff_data_xfer_noirq), (char const *)(& __kstrtab_ata_sff_data_xfer_noirq)}; static void ata_pio_sector(struct ata_queued_cmd *qc ) { int do_write ; struct ata_port *ap ; struct page *page ; unsigned int offset ; unsigned char *buf ; unsigned long flags ; void *tmp ; int tmp___0 ; void *tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; { do_write = (int )qc->tf.flags & 8; ap = qc->ap; if (qc->curbytes == qc->nbytes - qc->sect_size) { ap->hsm_task_state = 3U; } else { } page = sg_page___1(qc->cursg); offset = (qc->cursg)->offset + qc->cursg_ofs; page = (struct page *)-24189255811072L + ((unsigned long )(((long )page + 24189255811072L) / 64L) + (unsigned long )(offset >> 12)); offset = offset & 4095U; tmp___2 = PageHighMem((struct page const *)page); if (tmp___2 != 0) { flags = arch_local_irq_save(); trace_hardirqs_off(); tmp = kmap_atomic(page); buf = (unsigned char *)tmp; (*((ap->ops)->sff_data_xfer))(qc->dev, buf + (unsigned long )offset, qc->sect_size, do_write); __kunmap_atomic((void *)buf); tmp___0 = arch_irqs_disabled_flags(flags); if (tmp___0 != 0) { arch_local_irq_restore(flags); trace_hardirqs_off(); } else { trace_hardirqs_on(); arch_local_irq_restore(flags); } } else { tmp___1 = lowmem_page_address((struct page const *)page); buf = (unsigned char *)tmp___1; (*((ap->ops)->sff_data_xfer))(qc->dev, buf + (unsigned long )offset, qc->sect_size, do_write); } if (do_write == 0) { tmp___3 = PageSlab((struct page const *)page); if (tmp___3 == 0) { tmp___4 = 1; } else { tmp___4 = 0; } } else { tmp___4 = 0; } qc->curbytes = qc->curbytes + qc->sect_size; qc->cursg_ofs = qc->cursg_ofs + qc->sect_size; if (qc->cursg_ofs == (qc->cursg)->length) { qc->cursg = sg_next(qc->cursg); qc->cursg_ofs = 0U; } else { } return; } } static void ata_pio_sectors(struct ata_queued_cmd *qc ) { unsigned int nsect ; bool __warned ; int __ret_warn_once ; int __ret_warn_on ; long tmp ; long tmp___0 ; long tmp___1 ; unsigned int _min1 ; unsigned int _min2 ; unsigned int tmp___2 ; int tmp___3 ; { tmp___3 = is_multi_taskfile(& qc->tf); if (tmp___3 != 0) { __ret_warn_once = (qc->dev)->multi_count == 0U; tmp___1 = ldv__builtin_expect(__ret_warn_once != 0, 0L); if (tmp___1 != 0L) { __ret_warn_on = ! __warned; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-sff.c", 765); } else { } tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { __warned = 1; } else { } } else { } ldv__builtin_expect(__ret_warn_once != 0, 0L); _min1 = (qc->nbytes - qc->curbytes) / qc->sect_size; _min2 = (qc->dev)->multi_count; nsect = _min1 < _min2 ? _min1 : _min2; goto ldv_43184; ldv_43183: ata_pio_sector(qc); ldv_43184: tmp___2 = nsect; nsect = nsect - 1U; if (tmp___2 != 0U) { goto ldv_43183; } else { } } else { ata_pio_sector(qc); } ata_sff_sync(qc->ap); return; } } static void atapi_send_cdb(struct ata_port *ap , struct ata_queued_cmd *qc ) { bool __warned ; int __ret_warn_once ; int __ret_warn_on ; long tmp ; long tmp___0 ; long tmp___1 ; { __ret_warn_once = (qc->dev)->cdb_len <= 11U; tmp___1 = ldv__builtin_expect(__ret_warn_once != 0, 0L); if (tmp___1 != 0L) { __ret_warn_on = ! __warned; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-sff.c", 792); } else { } tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { __warned = 1; } else { } } else { } ldv__builtin_expect(__ret_warn_once != 0, 0L); (*((ap->ops)->sff_data_xfer))(qc->dev, (unsigned char *)(& qc->cdb), (qc->dev)->cdb_len, 1); ata_sff_sync(ap); switch ((int )qc->tf.protocol) { case 6: ap->hsm_task_state = 2U; goto ldv_43196; case 5: ap->hsm_task_state = 3U; goto ldv_43196; case 7: ap->hsm_task_state = 3U; (*((ap->ops)->bmdma_start))(qc); goto ldv_43196; default: __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-sff.c"), "i" (813), "i" (12UL)); ldv_43200: ; goto ldv_43200; } ldv_43196: ; return; } } static int __atapi_pio_bytes(struct ata_queued_cmd *qc , unsigned int bytes ) { int rw ; struct ata_port *ap ; struct ata_device *dev ; struct ata_eh_info *ehi ; struct scatterlist *sg ; struct page *page ; unsigned char *buf ; unsigned int offset ; unsigned int count ; unsigned int consumed ; long tmp ; unsigned int _min1 ; unsigned int _min2 ; unsigned int _min1___0 ; unsigned int _min2___0 ; unsigned long flags ; void *tmp___0 ; int tmp___1 ; void *tmp___2 ; int tmp___3 ; unsigned int _min1___1 ; unsigned int _min2___1 ; { rw = (qc->tf.flags & 8UL) != 0UL; ap = qc->ap; dev = qc->dev; ehi = & (dev->link)->eh_info; next_sg: sg = qc->cursg; tmp = ldv__builtin_expect((unsigned long )sg == (unsigned long )((struct scatterlist *)0), 0L); if (tmp != 0L) { ata_ehi_push_desc(ehi, "unexpected or too much trailing data buf=%u cur=%u bytes=%u", qc->nbytes, qc->curbytes, bytes); return (-1); } else { } page = sg_page___1(sg); offset = sg->offset + qc->cursg_ofs; page = (struct page *)-24189255811072L + ((unsigned long )(((long )page + 24189255811072L) / 64L) + (unsigned long )(offset >> 12)); offset = offset & 4095U; _min1 = sg->length - qc->cursg_ofs; _min2 = bytes; count = _min1 < _min2 ? _min1 : _min2; _min1___0 = count; _min2___0 = 4096U - offset; count = _min1___0 < _min2___0 ? _min1___0 : _min2___0; tmp___3 = PageHighMem((struct page const *)page); if (tmp___3 != 0) { flags = arch_local_irq_save(); trace_hardirqs_off(); tmp___0 = kmap_atomic(page); buf = (unsigned char *)tmp___0; consumed = (*((ap->ops)->sff_data_xfer))(dev, buf + (unsigned long )offset, count, rw); __kunmap_atomic((void *)buf); tmp___1 = arch_irqs_disabled_flags(flags); if (tmp___1 != 0) { arch_local_irq_restore(flags); trace_hardirqs_off(); } else { trace_hardirqs_on(); arch_local_irq_restore(flags); } } else { tmp___2 = lowmem_page_address((struct page const *)page); buf = (unsigned char *)tmp___2; consumed = (*((ap->ops)->sff_data_xfer))(dev, buf + (unsigned long )offset, count, rw); } _min1___1 = bytes; _min2___1 = consumed; bytes = bytes - (_min1___1 < _min2___1 ? _min1___1 : _min2___1); qc->curbytes = qc->curbytes + count; qc->cursg_ofs = qc->cursg_ofs + count; if (qc->cursg_ofs == sg->length) { qc->cursg = sg_next(qc->cursg); qc->cursg_ofs = 0U; } else { } if (bytes != 0U) { goto next_sg; } else { } return (0); } } static void atapi_pio_bytes(struct ata_queued_cmd *qc ) { struct ata_port *ap ; struct ata_device *dev ; struct ata_eh_info *ehi ; unsigned int ireason ; unsigned int bc_lo ; unsigned int bc_hi ; unsigned int bytes ; int i_write ; int do_write ; long tmp ; long tmp___0 ; long tmp___1 ; int tmp___2 ; long tmp___3 ; { ap = qc->ap; dev = qc->dev; ehi = & (dev->link)->eh_info; do_write = (qc->tf.flags & 8UL) != 0UL; (*((ap->ops)->sff_tf_read))(ap, & qc->result_tf); ireason = (unsigned int )qc->result_tf.nsect; bc_lo = (unsigned int )qc->result_tf.lbam; bc_hi = (unsigned int )qc->result_tf.lbah; bytes = (bc_hi << 8) | bc_lo; tmp = ldv__builtin_expect((long )((int )ireason) & 1L, 0L); if (tmp != 0L) { goto atapi_check; } else { } i_write = (ireason & 2U) == 0U; tmp___0 = ldv__builtin_expect(do_write != i_write, 0L); if (tmp___0 != 0L) { goto atapi_check; } else { } tmp___1 = ldv__builtin_expect(bytes == 0U, 0L); if (tmp___1 != 0L) { goto atapi_check; } else { } tmp___2 = __atapi_pio_bytes(qc, bytes); tmp___3 = ldv__builtin_expect(tmp___2 != 0, 0L); if (tmp___3 != 0L) { goto err_out; } else { } ata_sff_sync(ap); return; atapi_check: ata_ehi_push_desc(ehi, "ATAPI check failed (ireason=0x%x bytes=%u)", ireason, bytes); err_out: qc->err_mask = qc->err_mask | 2U; ap->hsm_task_state = 4U; return; } } __inline static int ata_hsm_ok_in_wq(struct ata_port *ap , struct ata_queued_cmd *qc ) { int tmp ; { if ((qc->tf.flags & 64UL) != 0UL) { return (1); } else { } if (ap->hsm_task_state == 1U) { if ((unsigned int )qc->tf.protocol == 2U && (qc->tf.flags & 8UL) != 0UL) { return (1); } else { } tmp = ata_is_atapi((int )qc->tf.protocol); if (tmp != 0 && ((qc->dev)->flags & 4UL) == 0UL) { return (1); } else { } } else { } return (0); } } static void ata_hsm_qc_complete(struct ata_queued_cmd *qc , int in_wq ) { struct ata_port *ap ; unsigned long flags ; raw_spinlock_t *tmp ; long tmp___0 ; long tmp___1 ; raw_spinlock_t *tmp___2 ; { ap = qc->ap; if ((unsigned long )(ap->ops)->error_handler != (unsigned long )((void (*)(struct ata_port * ))0)) { if (in_wq != 0) { tmp = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp); qc = ata_qc_from_tag(ap, qc->tag); if ((unsigned long )qc != (unsigned long )((struct ata_queued_cmd *)0)) { tmp___0 = ldv__builtin_expect((qc->err_mask & 2U) == 0U, 1L); if (tmp___0 != 0L) { ata_sff_irq_on(ap); ata_qc_complete(qc); } else { ata_port_freeze(ap); } } else { } spin_unlock_irqrestore(ap->lock, flags); } else { tmp___1 = ldv__builtin_expect((qc->err_mask & 2U) == 0U, 1L); if (tmp___1 != 0L) { ata_qc_complete(qc); } else { ata_port_freeze(ap); } } } else if (in_wq != 0) { tmp___2 = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp___2); ata_sff_irq_on(ap); ata_qc_complete(qc); spin_unlock_irqrestore(ap->lock, flags); } else { ata_qc_complete(qc); } return; } } int ata_sff_hsm_move(struct ata_port *ap , struct ata_queued_cmd *qc , u8 status , int in_wq ) { struct ata_link *link ; struct ata_eh_info *ehi ; unsigned long flags ; int poll_next ; bool __warned ; int __ret_warn_once ; int __ret_warn_on ; long tmp ; long tmp___0 ; long tmp___1 ; bool __warned___0 ; int __ret_warn_once___0 ; int tmp___2 ; int __ret_warn_on___0 ; long tmp___3 ; long tmp___4 ; long tmp___5 ; long tmp___6 ; long tmp___7 ; long tmp___8 ; raw_spinlock_t *tmp___9 ; long tmp___10 ; long tmp___11 ; long tmp___12 ; long tmp___13 ; long tmp___14 ; unsigned int tmp___15 ; bool tmp___16 ; int tmp___17 ; long tmp___18 ; bool __warned___1 ; int __ret_warn_once___1 ; int __ret_warn_on___1 ; long tmp___19 ; long tmp___20 ; long tmp___21 ; { link = (qc->dev)->link; ehi = & link->eh_info; flags = 0UL; __ret_warn_once = (qc->flags & 1UL) == 0UL; tmp___1 = ldv__builtin_expect(__ret_warn_once != 0, 0L); if (tmp___1 != 0L) { __ret_warn_on = ! __warned; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-sff.c", 1054); } else { } tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { __warned = 1; } else { } } else { } ldv__builtin_expect(__ret_warn_once != 0, 0L); tmp___2 = ata_hsm_ok_in_wq(ap, qc); __ret_warn_once___0 = tmp___2 != in_wq; tmp___5 = ldv__builtin_expect(__ret_warn_once___0 != 0, 0L); if (tmp___5 != 0L) { __ret_warn_on___0 = ! __warned___0; tmp___3 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___3 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-sff.c", 1060); } else { } tmp___4 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___4 != 0L) { __warned___0 = 1; } else { } } else { } ldv__builtin_expect(__ret_warn_once___0 != 0, 0L); fsm_start: ; switch (ap->hsm_task_state) { case 1U: poll_next = (int )qc->tf.flags & 64; tmp___7 = ldv__builtin_expect(((int )status & 8) == 0, 0L); if (tmp___7 != 0L) { tmp___6 = ldv__builtin_expect(((int )status & 33) != 0, 1L); if (tmp___6 != 0L) { qc->err_mask = qc->err_mask | 1U; } else { ata_ehi_push_desc(ehi, "ST_FIRST: !(DRQ|ERR|DF)"); qc->err_mask = qc->err_mask | 2U; } ap->hsm_task_state = 4U; goto fsm_start; } else { } tmp___8 = ldv__builtin_expect(((int )status & 33) != 0, 0L); if (tmp___8 != 0L) { if (((qc->dev)->horkage & 512U) == 0U) { ata_ehi_push_desc(ehi, "ST_FIRST: DRQ=1 with device error, dev_stat 0x%X", (int )status); qc->err_mask = qc->err_mask | 2U; ap->hsm_task_state = 4U; goto fsm_start; } else { } } else { } if (in_wq != 0) { tmp___9 = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp___9); } else { } if ((unsigned int )qc->tf.protocol == 2U) { ap->hsm_task_state = 2U; ata_pio_sectors(qc); } else { atapi_send_cdb(ap, qc); } if (in_wq != 0) { spin_unlock_irqrestore(ap->lock, flags); } else { } goto ldv_43294; case 2U: ; if ((unsigned int )qc->tf.protocol == 6U) { if (((int )status & 8) == 0) { ap->hsm_task_state = 3U; goto fsm_start; } else { } tmp___10 = ldv__builtin_expect(((int )status & 33) != 0, 0L); if (tmp___10 != 0L) { ata_ehi_push_desc(ehi, "ST-ATAPI: DRQ=1 with device error, dev_stat 0x%X", (int )status); qc->err_mask = qc->err_mask | 2U; ap->hsm_task_state = 4U; goto fsm_start; } else { } atapi_pio_bytes(qc); tmp___11 = ldv__builtin_expect(ap->hsm_task_state == 4U, 0L); if (tmp___11 != 0L) { goto fsm_start; } else { } } else { tmp___13 = ldv__builtin_expect(((int )status & 8) == 0, 0L); if (tmp___13 != 0L) { tmp___12 = ldv__builtin_expect(((int )status & 33) != 0, 1L); if (tmp___12 != 0L) { qc->err_mask = qc->err_mask | 1U; if ((int )(qc->dev)->horkage & 1) { qc->err_mask = qc->err_mask | 512U; } else { } } else { ata_ehi_push_desc(ehi, "ST-ATA: DRQ=0 without device error, dev_stat 0x%X", (int )status); qc->err_mask = qc->err_mask | 514U; } ap->hsm_task_state = 4U; goto fsm_start; } else { } tmp___14 = ldv__builtin_expect(((int )status & 33) != 0, 0L); if (tmp___14 != 0L) { qc->err_mask = qc->err_mask | 1U; if ((qc->tf.flags & 8UL) == 0UL) { ata_pio_sectors(qc); status = ata_wait_idle(ap); } else { } if (((int )status & 136) != 0) { ata_ehi_push_desc(ehi, "ST-ATA: BUSY|DRQ persists on ERR|DF, dev_stat 0x%X", (int )status); qc->err_mask = qc->err_mask | 2U; } else { } if ((unsigned int )status == 127U) { qc->err_mask = qc->err_mask | 512U; } else { } ap->hsm_task_state = 4U; goto fsm_start; } else { } ata_pio_sectors(qc); if (ap->hsm_task_state == 3U && (qc->tf.flags & 8UL) == 0UL) { status = ata_wait_idle(ap); goto fsm_start; } else { } } poll_next = 1; goto ldv_43294; case 3U: tmp___16 = ata_ok((int )status); if (tmp___16) { tmp___17 = 0; } else { tmp___17 = 1; } tmp___18 = ldv__builtin_expect((long )tmp___17, 0L); if (tmp___18 != 0L) { tmp___15 = __ac_err_mask((int )status); qc->err_mask = qc->err_mask | tmp___15; ap->hsm_task_state = 4U; goto fsm_start; } else { } __ret_warn_once___1 = (qc->err_mask & 3U) != 0U; tmp___21 = ldv__builtin_expect(__ret_warn_once___1 != 0, 0L); if (tmp___21 != 0L) { __ret_warn_on___1 = ! __warned___1; tmp___19 = ldv__builtin_expect(__ret_warn_on___1 != 0, 0L); if (tmp___19 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-sff.c", 1279); } else { } tmp___20 = ldv__builtin_expect(__ret_warn_on___1 != 0, 0L); if (tmp___20 != 0L) { __warned___1 = 1; } else { } } else { } ldv__builtin_expect(__ret_warn_once___1 != 0, 0L); ap->hsm_task_state = 0U; ata_hsm_qc_complete(qc, in_wq); poll_next = 0; goto ldv_43294; case 4U: ap->hsm_task_state = 0U; ata_hsm_qc_complete(qc, in_wq); poll_next = 0; goto ldv_43294; default: poll_next = 0; __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-sff.c"), "i" (1299), "i" (12UL)); ldv_43304: ; goto ldv_43304; } ldv_43294: ; return (poll_next); } } static char const __kstrtab_ata_sff_hsm_move[17U] = { 'a', 't', 'a', '_', 's', 'f', 'f', '_', 'h', 's', 'm', '_', 'm', 'o', 'v', 'e', '\000'}; struct kernel_symbol const __ksymtab_ata_sff_hsm_move ; struct kernel_symbol const __ksymtab_ata_sff_hsm_move = {(unsigned long )(& ata_sff_hsm_move), (char const *)(& __kstrtab_ata_sff_hsm_move)}; void ata_sff_queue_work(struct work_struct *work ) { { queue_work___0(ata_sff_wq, work); return; } } static char const __kstrtab_ata_sff_queue_work[19U] = { 'a', 't', 'a', '_', 's', 'f', 'f', '_', 'q', 'u', 'e', 'u', 'e', '_', 'w', 'o', 'r', 'k', '\000'}; struct kernel_symbol const __ksymtab_ata_sff_queue_work ; struct kernel_symbol const __ksymtab_ata_sff_queue_work = {(unsigned long )(& ata_sff_queue_work), (char const *)(& __kstrtab_ata_sff_queue_work)}; void ata_sff_queue_delayed_work(struct delayed_work *dwork , unsigned long delay ) { { queue_delayed_work___1(ata_sff_wq, dwork, delay); return; } } static char const __kstrtab_ata_sff_queue_delayed_work[27U] = { 'a', 't', 'a', '_', 's', 'f', 'f', '_', 'q', 'u', 'e', 'u', 'e', '_', 'd', 'e', 'l', 'a', 'y', 'e', 'd', '_', 'w', 'o', 'r', 'k', '\000'}; struct kernel_symbol const __ksymtab_ata_sff_queue_delayed_work ; struct kernel_symbol const __ksymtab_ata_sff_queue_delayed_work = {(unsigned long )(& ata_sff_queue_delayed_work), (char const *)(& __kstrtab_ata_sff_queue_delayed_work)}; void ata_sff_queue_pio_task(struct ata_link *link , unsigned long delay ) { struct ata_port *ap ; int __ret_warn_on ; long tmp ; unsigned long tmp___0 ; { ap = link->ap; __ret_warn_on = (unsigned long )ap->sff_pio_task_link != (unsigned long )((struct ata_link *)0) && (unsigned long )ap->sff_pio_task_link != (unsigned long )link; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-sff.c", 1323); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); ap->sff_pio_task_link = link; tmp___0 = msecs_to_jiffies((unsigned int const )delay); ata_sff_queue_delayed_work(& ap->sff_pio_task, tmp___0); return; } } static char const __kstrtab_ata_sff_queue_pio_task[23U] = { 'a', 't', 'a', '_', 's', 'f', 'f', '_', 'q', 'u', 'e', 'u', 'e', '_', 'p', 'i', 'o', '_', 't', 'a', 's', 'k', '\000'}; struct kernel_symbol const __ksymtab_ata_sff_queue_pio_task ; struct kernel_symbol const __ksymtab_ata_sff_queue_pio_task = {(unsigned long )(& ata_sff_queue_pio_task), (char const *)(& __kstrtab_ata_sff_queue_pio_task)}; void ata_sff_flush_pio_task(struct ata_port *ap ) { { ldv_cancel_delayed_work_sync_82(& ap->sff_pio_task); spin_lock_irq(ap->lock); ap->hsm_task_state = 0U; spin_unlock_irq(ap->lock); ap->sff_pio_task_link = (struct ata_link *)0; if ((ap->msg_enable & 32U) != 0U) { ata_port_printk((struct ata_port const *)ap, "\017", "%s: EXIT\n", "ata_sff_flush_pio_task"); } else { } return; } } static void ata_sff_pio_task(struct work_struct *work ) { struct ata_port *ap ; struct work_struct const *__mptr ; struct ata_link *link ; struct ata_queued_cmd *qc ; u8 status ; int poll_next ; long tmp ; bool __warned ; int __ret_warn_once ; int __ret_warn_on ; long tmp___0 ; long tmp___1 ; long tmp___2 ; { __mptr = (struct work_struct const *)work; ap = (struct ata_port *)__mptr + 0xffffffffffffff48UL; link = ap->sff_pio_task_link; tmp = ldv__builtin_expect((unsigned long )ap->sff_pio_task_link == (unsigned long )((struct ata_link *)0), 0L); if (tmp != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-sff.c"), "i" (1364), "i" (12UL)); ldv_43366: ; goto ldv_43366; } else { } qc = ata_qc_from_tag(ap, link->active_tag); if ((unsigned long )qc == (unsigned long )((struct ata_queued_cmd *)0)) { ap->sff_pio_task_link = (struct ata_link *)0; return; } else { } fsm_start: __ret_warn_once = ap->hsm_task_state == 0U; tmp___2 = ldv__builtin_expect(__ret_warn_once != 0, 0L); if (tmp___2 != 0L) { __ret_warn_on = ! __warned; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-sff.c", 1373); } else { } tmp___1 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___1 != 0L) { __warned = 1; } else { } } else { } ldv__builtin_expect(__ret_warn_once != 0, 0L); status = ata_sff_busy_wait(ap, 128U, 5U); if ((int )((signed char )status) < 0) { ata_msleep(ap, 2U); status = ata_sff_busy_wait(ap, 128U, 10U); if ((int )((signed char )status) < 0) { ata_sff_queue_pio_task(link, 16UL); return; } else { } } else { } ap->sff_pio_task_link = (struct ata_link *)0; poll_next = ata_sff_hsm_move(ap, qc, (int )status, 1); if (poll_next != 0) { goto fsm_start; } else { } return; } } unsigned int ata_sff_qc_issue(struct ata_queued_cmd *qc ) { struct ata_port *ap ; struct ata_link *link ; bool __warned ; int __ret_warn_once ; int __ret_warn_on ; long tmp ; long tmp___0 ; long tmp___1 ; { ap = qc->ap; link = (qc->dev)->link; if ((ap->flags & 512UL) != 0UL) { qc->tf.flags = qc->tf.flags | 64UL; } else { } ata_dev_select(ap, (qc->dev)->devno, 1U, 0U); switch ((int )qc->tf.protocol) { case 1: ; if ((qc->tf.flags & 64UL) != 0UL) { ata_qc_set_polling(qc); } else { } ata_tf_to_host(ap, (struct ata_taskfile const *)(& qc->tf)); ap->hsm_task_state = 3U; if ((qc->tf.flags & 64UL) != 0UL) { ata_sff_queue_pio_task(link, 0UL); } else { } goto ldv_43379; case 2: ; if ((qc->tf.flags & 64UL) != 0UL) { ata_qc_set_polling(qc); } else { } ata_tf_to_host(ap, (struct ata_taskfile const *)(& qc->tf)); if ((qc->tf.flags & 8UL) != 0UL) { ap->hsm_task_state = 1U; ata_sff_queue_pio_task(link, 0UL); } else { ap->hsm_task_state = 2U; if ((qc->tf.flags & 64UL) != 0UL) { ata_sff_queue_pio_task(link, 0UL); } else { } } goto ldv_43379; case 6: ; case 5: ; if ((qc->tf.flags & 64UL) != 0UL) { ata_qc_set_polling(qc); } else { } ata_tf_to_host(ap, (struct ata_taskfile const *)(& qc->tf)); ap->hsm_task_state = 1U; if (((qc->dev)->flags & 4UL) == 0UL || (qc->tf.flags & 64UL) != 0UL) { ata_sff_queue_pio_task(link, 0UL); } else { } goto ldv_43379; default: __ret_warn_once = 1; tmp___1 = ldv__builtin_expect(__ret_warn_once != 0, 0L); if (tmp___1 != 0L) { __ret_warn_on = ! __warned; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-sff.c", 1493); } else { } tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { __warned = 1; } else { } } else { } ldv__builtin_expect(__ret_warn_once != 0, 0L); return (64U); } ldv_43379: ; return (0U); } } static char const __kstrtab_ata_sff_qc_issue[17U] = { 'a', 't', 'a', '_', 's', 'f', 'f', '_', 'q', 'c', '_', 'i', 's', 's', 'u', 'e', '\000'}; struct kernel_symbol const __ksymtab_ata_sff_qc_issue ; struct kernel_symbol const __ksymtab_ata_sff_qc_issue = {(unsigned long )(& ata_sff_qc_issue), (char const *)(& __kstrtab_ata_sff_qc_issue)}; bool ata_sff_qc_fill_rtf(struct ata_queued_cmd *qc ) { { (*(((qc->ap)->ops)->sff_tf_read))(qc->ap, & qc->result_tf); return (1); } } static char const __kstrtab_ata_sff_qc_fill_rtf[20U] = { 'a', 't', 'a', '_', 's', 'f', 'f', '_', 'q', 'c', '_', 'f', 'i', 'l', 'l', '_', 'r', 't', 'f', '\000'}; struct kernel_symbol const __ksymtab_ata_sff_qc_fill_rtf ; struct kernel_symbol const __ksymtab_ata_sff_qc_fill_rtf = {(unsigned long )(& ata_sff_qc_fill_rtf), (char const *)(& __kstrtab_ata_sff_qc_fill_rtf)}; static unsigned int ata_sff_idle_irq(struct ata_port *ap ) { { ap->stats.idle_irq = ap->stats.idle_irq + 1UL; return (0U); } } static unsigned int __ata_sff_port_intr(struct ata_port *ap , struct ata_queued_cmd *qc , bool hsmv_on_idle ) { u8 status ; unsigned int tmp ; unsigned int tmp___0 ; unsigned int tmp___1 ; { switch (ap->hsm_task_state) { case 1U: ; if (((qc->dev)->flags & 4UL) == 0UL) { tmp = ata_sff_idle_irq(ap); return (tmp); } else { } goto ldv_43416; case 0U: tmp___0 = ata_sff_idle_irq(ap); return (tmp___0); default: ; goto ldv_43416; } ldv_43416: status = ata_sff_irq_status(ap); if ((int )((signed char )status) < 0) { if ((int )hsmv_on_idle) { qc->err_mask = qc->err_mask | 2U; ap->hsm_task_state = 4U; } else { tmp___1 = ata_sff_idle_irq(ap); return (tmp___1); } } else { } if ((unsigned long )(ap->ops)->sff_irq_clear != (unsigned long )((void (*)(struct ata_port * ))0)) { (*((ap->ops)->sff_irq_clear))(ap); } else { } ata_sff_hsm_move(ap, qc, (int )status, 0); return (1U); } } unsigned int ata_sff_port_intr(struct ata_port *ap , struct ata_queued_cmd *qc ) { unsigned int tmp ; { tmp = __ata_sff_port_intr(ap, qc, 0); return (tmp); } } static char const __kstrtab_ata_sff_port_intr[18U] = { 'a', 't', 'a', '_', 's', 'f', 'f', '_', 'p', 'o', 'r', 't', '_', 'i', 'n', 't', 'r', '\000'}; struct kernel_symbol const __ksymtab_ata_sff_port_intr ; struct kernel_symbol const __ksymtab_ata_sff_port_intr = {(unsigned long )(& ata_sff_port_intr), (char const *)(& __kstrtab_ata_sff_port_intr)}; __inline static irqreturn_t __ata_sff_interrupt(int irq , void *dev_instance , unsigned int (*port_intr)(struct ata_port * , struct ata_queued_cmd * ) ) { struct ata_host *host ; bool retried ; unsigned int i ; unsigned int handled ; unsigned int idle ; unsigned int polling ; unsigned long flags ; raw_spinlock_t *tmp ; struct ata_port *ap ; struct ata_queued_cmd *qc ; unsigned int tmp___0 ; bool retry ; struct ata_port *ap___0 ; bool tmp___1 ; int tmp___2 ; u8 tmp___3 ; { host = (struct ata_host *)dev_instance; retried = 0; tmp = spinlock_check(& host->lock); flags = _raw_spin_lock_irqsave(tmp); retry: polling = 0U; idle = polling; handled = idle; i = 0U; goto ldv_43452; ldv_43451: ap = host->ports[i]; qc = ata_qc_from_tag(ap, ap->link.active_tag); if ((unsigned long )qc != (unsigned long )((struct ata_queued_cmd *)0)) { if ((qc->tf.flags & 64UL) == 0UL) { tmp___0 = (*port_intr)(ap, qc); handled = tmp___0 | handled; } else { polling = (unsigned int )(1 << (int )i) | polling; } } else { idle = (unsigned int )(1 << (int )i) | idle; } i = i + 1U; ldv_43452: ; if (host->n_ports > i) { goto ldv_43451; } else { } if (handled == 0U && ! retried) { retry = 0; i = 0U; goto ldv_43458; ldv_43457: ap___0 = host->ports[i]; if (((unsigned int )(1 << (int )i) & polling) != 0U) { goto ldv_43456; } else { } if ((unsigned long )(ap___0->ops)->sff_irq_check == (unsigned long )((bool (*)(struct ata_port * ))0)) { goto ldv_43456; } else { tmp___1 = (*((ap___0->ops)->sff_irq_check))(ap___0); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { goto ldv_43456; } else { } } if (((unsigned int )(1 << (int )i) & idle) != 0U) { (*((ap___0->ops)->sff_check_status))(ap___0); if ((unsigned long )(ap___0->ops)->sff_irq_clear != (unsigned long )((void (*)(struct ata_port * ))0)) { (*((ap___0->ops)->sff_irq_clear))(ap___0); } else { } } else { tmp___3 = (*((ap___0->ops)->sff_check_status))(ap___0); if ((int )((signed char )tmp___3) >= 0) { retry = ((int )retry | 1) != 0; } else { } } ldv_43456: i = i + 1U; ldv_43458: ; if (host->n_ports > i) { goto ldv_43457; } else { } if ((int )retry) { retried = 1; goto retry; } else { } } else { } spin_unlock_irqrestore(& host->lock, flags); return (handled != 0U); } } irqreturn_t ata_sff_interrupt(int irq , void *dev_instance ) { irqreturn_t tmp ; { tmp = __ata_sff_interrupt(irq, dev_instance, & ata_sff_port_intr); return (tmp); } } static char const __kstrtab_ata_sff_interrupt[18U] = { 'a', 't', 'a', '_', 's', 'f', 'f', '_', 'i', 'n', 't', 'e', 'r', 'r', 'u', 'p', 't', '\000'}; struct kernel_symbol const __ksymtab_ata_sff_interrupt ; struct kernel_symbol const __ksymtab_ata_sff_interrupt = {(unsigned long )(& ata_sff_interrupt), (char const *)(& __kstrtab_ata_sff_interrupt)}; void ata_sff_lost_interrupt(struct ata_port *ap ) { u8 status ; struct ata_queued_cmd *qc ; { qc = ata_qc_from_tag(ap, ap->link.active_tag); if ((unsigned long )qc == (unsigned long )((struct ata_queued_cmd *)0) || (qc->tf.flags & 64UL) != 0UL) { return; } else { } status = ata_sff_altstatus(ap); if ((int )((signed char )status) < 0) { return; } else { } ata_port_printk((struct ata_port const *)ap, "\f", "lost interrupt (Status 0x%x)\n", (int )status); ata_sff_port_intr(ap, qc); return; } } static char const __kstrtab_ata_sff_lost_interrupt[23U] = { 'a', 't', 'a', '_', 's', 'f', 'f', '_', 'l', 'o', 's', 't', '_', 'i', 'n', 't', 'e', 'r', 'r', 'u', 'p', 't', '\000'}; struct kernel_symbol const __ksymtab_ata_sff_lost_interrupt ; struct kernel_symbol const __ksymtab_ata_sff_lost_interrupt = {(unsigned long )(& ata_sff_lost_interrupt), (char const *)(& __kstrtab_ata_sff_lost_interrupt)}; void ata_sff_freeze(struct ata_port *ap ) { { ap->ctl = (u8 )((unsigned int )ap->ctl | 2U); ap->last_ctl = ap->ctl; if ((unsigned long )(ap->ops)->sff_set_devctl != (unsigned long )((void (*)(struct ata_port * , u8 ))0) || (unsigned long )ap->ioaddr.ctl_addr != (unsigned long )((void *)0)) { ata_sff_set_devctl(ap, (int )ap->ctl); } else { } (*((ap->ops)->sff_check_status))(ap); if ((unsigned long )(ap->ops)->sff_irq_clear != (unsigned long )((void (*)(struct ata_port * ))0)) { (*((ap->ops)->sff_irq_clear))(ap); } else { } return; } } static char const __kstrtab_ata_sff_freeze[15U] = { 'a', 't', 'a', '_', 's', 'f', 'f', '_', 'f', 'r', 'e', 'e', 'z', 'e', '\000'}; struct kernel_symbol const __ksymtab_ata_sff_freeze ; struct kernel_symbol const __ksymtab_ata_sff_freeze = {(unsigned long )(& ata_sff_freeze), (char const *)(& __kstrtab_ata_sff_freeze)}; void ata_sff_thaw(struct ata_port *ap ) { { (*((ap->ops)->sff_check_status))(ap); if ((unsigned long )(ap->ops)->sff_irq_clear != (unsigned long )((void (*)(struct ata_port * ))0)) { (*((ap->ops)->sff_irq_clear))(ap); } else { } ata_sff_irq_on(ap); return; } } static char const __kstrtab_ata_sff_thaw[13U] = { 'a', 't', 'a', '_', 's', 'f', 'f', '_', 't', 'h', 'a', 'w', '\000'}; struct kernel_symbol const __ksymtab_ata_sff_thaw ; struct kernel_symbol const __ksymtab_ata_sff_thaw = {(unsigned long )(& ata_sff_thaw), (char const *)(& __kstrtab_ata_sff_thaw)}; int ata_sff_prereset(struct ata_link *link , unsigned long deadline ) { struct ata_eh_context *ehc ; int rc ; bool tmp ; int tmp___0 ; { ehc = & link->eh_context; rc = ata_std_prereset(link, deadline); if (rc != 0) { return (rc); } else { } if ((ehc->i.action & 4U) != 0U) { return (0); } else { } tmp = ata_link_offline(link); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { rc = ata_sff_wait_ready(link, deadline); if (rc != 0 && rc != -19) { ata_link_printk((struct ata_link const *)link, "\f", "device not ready (errno=%d), forcing hardreset\n", rc); ehc->i.action = ehc->i.action | 4U; } else { } } else { } return (0); } } static char const __kstrtab_ata_sff_prereset[17U] = { 'a', 't', 'a', '_', 's', 'f', 'f', '_', 'p', 'r', 'e', 'r', 'e', 's', 'e', 't', '\000'}; struct kernel_symbol const __ksymtab_ata_sff_prereset ; struct kernel_symbol const __ksymtab_ata_sff_prereset = {(unsigned long )(& ata_sff_prereset), (char const *)(& __kstrtab_ata_sff_prereset)}; static unsigned int ata_devchk(struct ata_port *ap , unsigned int device ) { struct ata_ioports *ioaddr ; u8 nsect ; u8 lbal ; unsigned int tmp ; unsigned int tmp___0 ; { ioaddr = & ap->ioaddr; (*((ap->ops)->sff_dev_select))(ap, device); iowrite8(85, ioaddr->nsect_addr); iowrite8(170, ioaddr->lbal_addr); iowrite8(170, ioaddr->nsect_addr); iowrite8(85, ioaddr->lbal_addr); iowrite8(85, ioaddr->nsect_addr); iowrite8(170, ioaddr->lbal_addr); tmp = ioread8(ioaddr->nsect_addr); nsect = (u8 )tmp; tmp___0 = ioread8(ioaddr->lbal_addr); lbal = (u8 )tmp___0; if ((unsigned int )nsect == 85U && (unsigned int )lbal == 170U) { return (1U); } else { } return (0U); } } unsigned int ata_sff_dev_classify(struct ata_device *dev , int present , u8 *r_err ) { struct ata_port *ap ; struct ata_taskfile tf ; unsigned int class ; u8 err ; u8 tmp ; { ap = (dev->link)->ap; (*((ap->ops)->sff_dev_select))(ap, dev->devno); memset((void *)(& tf), 0, 32UL); (*((ap->ops)->sff_tf_read))(ap, & tf); err = tf.feature; if ((unsigned long )r_err != (unsigned long )((u8 *)0U)) { *r_err = err; } else { } if ((unsigned int )err == 0U) { dev->horkage = dev->horkage | 1U; } else if ((unsigned int )err == 1U) { } else if (dev->devno == 0U && (unsigned int )err == 129U) { } else { return (10U); } class = ata_dev_classify((struct ata_taskfile const *)(& tf)); if (class == 0U) { if (present != 0 && (int )dev->horkage & 1) { class = 1U; } else { class = 10U; } } else if (class == 1U) { tmp = (*((ap->ops)->sff_check_status))(ap); if ((unsigned int )tmp == 0U) { class = 10U; } else { } } else { } return (class); } } static char const __kstrtab_ata_sff_dev_classify[21U] = { 'a', 't', 'a', '_', 's', 'f', 'f', '_', 'd', 'e', 'v', '_', 'c', 'l', 'a', 's', 's', 'i', 'f', 'y', '\000'}; struct kernel_symbol const __ksymtab_ata_sff_dev_classify ; struct kernel_symbol const __ksymtab_ata_sff_dev_classify = {(unsigned long )(& ata_sff_dev_classify), (char const *)(& __kstrtab_ata_sff_dev_classify)}; int ata_sff_wait_after_reset(struct ata_link *link , unsigned int devmask , unsigned long deadline ) { struct ata_port *ap ; struct ata_ioports *ioaddr ; unsigned int dev0 ; unsigned int dev1 ; int rc ; int ret ; int i ; u8 nsect ; u8 lbal ; unsigned int tmp ; unsigned int tmp___0 ; { ap = link->ap; ioaddr = & ap->ioaddr; dev0 = devmask & 1U; dev1 = devmask & 2U; ret = 0; ata_msleep(ap, 150U); rc = ata_sff_wait_ready(link, deadline); if (rc != 0) { return (rc); } else { } if (dev1 != 0U) { (*((ap->ops)->sff_dev_select))(ap, 1U); i = 0; goto ldv_43559; ldv_43558: tmp = ioread8(ioaddr->nsect_addr); nsect = (u8 )tmp; tmp___0 = ioread8(ioaddr->lbal_addr); lbal = (u8 )tmp___0; if ((unsigned int )nsect == 1U && (unsigned int )lbal == 1U) { goto ldv_43557; } else { } ata_msleep(ap, 50U); i = i + 1; ldv_43559: ; if (i <= 1) { goto ldv_43558; } else { } ldv_43557: rc = ata_sff_wait_ready(link, deadline); if (rc != 0) { if (rc != -19) { return (rc); } else { } ret = rc; } else { } } else { } (*((ap->ops)->sff_dev_select))(ap, 0U); if (dev1 != 0U) { (*((ap->ops)->sff_dev_select))(ap, 1U); } else { } if (dev0 != 0U) { (*((ap->ops)->sff_dev_select))(ap, 0U); } else { } return (ret); } } static char const __kstrtab_ata_sff_wait_after_reset[25U] = { 'a', 't', 'a', '_', 's', 'f', 'f', '_', 'w', 'a', 'i', 't', '_', 'a', 'f', 't', 'e', 'r', '_', 'r', 'e', 's', 'e', 't', '\000'}; struct kernel_symbol const __ksymtab_ata_sff_wait_after_reset ; struct kernel_symbol const __ksymtab_ata_sff_wait_after_reset = {(unsigned long )(& ata_sff_wait_after_reset), (char const *)(& __kstrtab_ata_sff_wait_after_reset)}; static int ata_bus_softreset(struct ata_port *ap , unsigned int devmask , unsigned long deadline ) { struct ata_ioports *ioaddr ; int tmp ; { ioaddr = & ap->ioaddr; if ((unsigned long )ap->ioaddr.ctl_addr != (unsigned long )((void *)0)) { iowrite8((int )ap->ctl, ioaddr->ctl_addr); __const_udelay(85900UL); iowrite8((int )((unsigned int )ap->ctl | 4U), ioaddr->ctl_addr); __const_udelay(85900UL); iowrite8((int )ap->ctl, ioaddr->ctl_addr); ap->last_ctl = ap->ctl; } else { } tmp = ata_sff_wait_after_reset(& ap->link, devmask, deadline); return (tmp); } } int ata_sff_softreset(struct ata_link *link , unsigned int *classes , unsigned long deadline ) { struct ata_port *ap ; unsigned int slave_possible ; unsigned int devmask ; int rc ; u8 err ; unsigned int tmp ; unsigned int tmp___0 ; int tmp___1 ; { ap = link->ap; slave_possible = (unsigned int )ap->flags & 1U; devmask = 0U; tmp = ata_devchk(ap, 0U); if (tmp != 0U) { devmask = devmask | 1U; } else { } if (slave_possible != 0U) { tmp___0 = ata_devchk(ap, 1U); if (tmp___0 != 0U) { devmask = devmask | 2U; } else { } } else { } (*((ap->ops)->sff_dev_select))(ap, 0U); rc = ata_bus_softreset(ap, devmask, deadline); if (rc != 0) { if (rc != -19) { ata_link_printk((struct ata_link const *)link, "\v", "SRST failed (errno=%d)\n", rc); return (rc); } else { tmp___1 = sata_scr_valid(link); if (tmp___1 != 0) { ata_link_printk((struct ata_link const *)link, "\v", "SRST failed (errno=%d)\n", rc); return (rc); } else { } } } else { } *classes = ata_sff_dev_classify((struct ata_device *)(& link->device), (int )devmask & 1, & err); if (slave_possible != 0U && (unsigned int )err != 129U) { *(classes + 1UL) = ata_sff_dev_classify((struct ata_device *)(& link->device) + 1UL, (int )devmask & 2, & err); } else { } return (0); } } static char const __kstrtab_ata_sff_softreset[18U] = { 'a', 't', 'a', '_', 's', 'f', 'f', '_', 's', 'o', 'f', 't', 'r', 'e', 's', 'e', 't', '\000'}; struct kernel_symbol const __ksymtab_ata_sff_softreset ; struct kernel_symbol const __ksymtab_ata_sff_softreset = {(unsigned long )(& ata_sff_softreset), (char const *)(& __kstrtab_ata_sff_softreset)}; int sata_sff_hardreset(struct ata_link *link , unsigned int *class , unsigned long deadline ) { struct ata_eh_context *ehc ; unsigned long const *timing ; unsigned long const *tmp ; bool online ; int rc ; { ehc = & link->eh_context; tmp = sata_ehc_deb_timing(ehc); timing = tmp; rc = sata_link_hardreset(link, timing, deadline, & online, & ata_sff_check_ready); if ((int )online) { *class = ata_sff_dev_classify((struct ata_device *)(& link->device), 1, (u8 *)0U); } else { } return (rc); } } static char const __kstrtab_sata_sff_hardreset[19U] = { 's', 'a', 't', 'a', '_', 's', 'f', 'f', '_', 'h', 'a', 'r', 'd', 'r', 'e', 's', 'e', 't', '\000'}; struct kernel_symbol const __ksymtab_sata_sff_hardreset ; struct kernel_symbol const __ksymtab_sata_sff_hardreset = {(unsigned long )(& sata_sff_hardreset), (char const *)(& __kstrtab_sata_sff_hardreset)}; void ata_sff_postreset(struct ata_link *link , unsigned int *classes ) { struct ata_port *ap ; { ap = link->ap; ata_std_postreset(link, classes); if (*classes != 10U) { (*((ap->ops)->sff_dev_select))(ap, 1U); } else { } if (*(classes + 1UL) != 10U) { (*((ap->ops)->sff_dev_select))(ap, 0U); } else { } if (*classes == 10U && *(classes + 1UL) == 10U) { return; } else { } if ((unsigned long )(ap->ops)->sff_set_devctl != (unsigned long )((void (*)(struct ata_port * , u8 ))0) || (unsigned long )ap->ioaddr.ctl_addr != (unsigned long )((void *)0)) { ata_sff_set_devctl(ap, (int )ap->ctl); ap->last_ctl = ap->ctl; } else { } return; } } static char const __kstrtab_ata_sff_postreset[18U] = { 'a', 't', 'a', '_', 's', 'f', 'f', '_', 'p', 'o', 's', 't', 'r', 'e', 's', 'e', 't', '\000'}; struct kernel_symbol const __ksymtab_ata_sff_postreset ; struct kernel_symbol const __ksymtab_ata_sff_postreset = {(unsigned long )(& ata_sff_postreset), (char const *)(& __kstrtab_ata_sff_postreset)}; void ata_sff_drain_fifo(struct ata_queued_cmd *qc ) { int count ; struct ata_port *ap ; u8 tmp ; { if ((unsigned long )qc == (unsigned long )((struct ata_queued_cmd *)0) || qc->dma_dir == 1) { return; } else { } ap = qc->ap; count = 0; goto ldv_43631; ldv_43630: ioread16(ap->ioaddr.data_addr); count = count + 2; ldv_43631: tmp = (*((ap->ops)->sff_check_status))(ap); if (((int )tmp & 8) != 0 && count <= 65535) { goto ldv_43630; } else { } if (count != 0) { ata_port_printk((struct ata_port const *)ap, "\017", "drained %d bytes to clear DRQ\n", count); } else { } return; } } static char const __kstrtab_ata_sff_drain_fifo[19U] = { 'a', 't', 'a', '_', 's', 'f', 'f', '_', 'd', 'r', 'a', 'i', 'n', '_', 'f', 'i', 'f', 'o', '\000'}; struct kernel_symbol const __ksymtab_ata_sff_drain_fifo ; struct kernel_symbol const __ksymtab_ata_sff_drain_fifo = {(unsigned long )(& ata_sff_drain_fifo), (char const *)(& __kstrtab_ata_sff_drain_fifo)}; void ata_sff_error_handler(struct ata_port *ap ) { int (*softreset)(struct ata_link * , unsigned int * , unsigned long ) ; int (*hardreset)(struct ata_link * , unsigned int * , unsigned long ) ; struct ata_queued_cmd *qc ; unsigned long flags ; raw_spinlock_t *tmp ; int tmp___0 ; { softreset = (ap->ops)->softreset; hardreset = (ap->ops)->hardreset; qc = __ata_qc_from_tag(ap, ap->link.active_tag); if ((unsigned long )qc != (unsigned long )((struct ata_queued_cmd *)0) && (qc->flags & 65536UL) == 0UL) { qc = (struct ata_queued_cmd *)0; } else { } tmp = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp); if ((unsigned long )(ap->ops)->sff_drain_fifo != (unsigned long )((void (*)(struct ata_queued_cmd * ))0)) { (*((ap->ops)->sff_drain_fifo))(qc); } else { } spin_unlock_irqrestore(ap->lock, flags); if ((unsigned long )hardreset == (unsigned long )(& sata_std_hardreset) || (unsigned long )hardreset == (unsigned long )(& sata_sff_hardreset)) { tmp___0 = sata_scr_valid(& ap->link); if (tmp___0 == 0) { hardreset = (int (*)(struct ata_link * , unsigned int * , unsigned long ))0; } else { } } else { } ata_do_eh(ap, (ap->ops)->prereset, softreset, hardreset, (ap->ops)->postreset); return; } } static char const __kstrtab_ata_sff_error_handler[22U] = { 'a', 't', 'a', '_', 's', 'f', 'f', '_', 'e', 'r', 'r', 'o', 'r', '_', 'h', 'a', 'n', 'd', 'l', 'e', 'r', '\000'}; struct kernel_symbol const __ksymtab_ata_sff_error_handler ; struct kernel_symbol const __ksymtab_ata_sff_error_handler = {(unsigned long )(& ata_sff_error_handler), (char const *)(& __kstrtab_ata_sff_error_handler)}; void ata_sff_std_ports(struct ata_ioports *ioaddr ) { { ioaddr->data_addr = ioaddr->cmd_addr; ioaddr->error_addr = ioaddr->cmd_addr + 1UL; ioaddr->feature_addr = ioaddr->cmd_addr + 1UL; ioaddr->nsect_addr = ioaddr->cmd_addr + 2UL; ioaddr->lbal_addr = ioaddr->cmd_addr + 3UL; ioaddr->lbam_addr = ioaddr->cmd_addr + 4UL; ioaddr->lbah_addr = ioaddr->cmd_addr + 5UL; ioaddr->device_addr = ioaddr->cmd_addr + 6UL; ioaddr->status_addr = ioaddr->cmd_addr + 7UL; ioaddr->command_addr = ioaddr->cmd_addr + 7UL; return; } } static char const __kstrtab_ata_sff_std_ports[18U] = { 'a', 't', 'a', '_', 's', 'f', 'f', '_', 's', 't', 'd', '_', 'p', 'o', 'r', 't', 's', '\000'}; struct kernel_symbol const __ksymtab_ata_sff_std_ports ; struct kernel_symbol const __ksymtab_ata_sff_std_ports = {(unsigned long )(& ata_sff_std_ports), (char const *)(& __kstrtab_ata_sff_std_ports)}; static int ata_resources_present(struct pci_dev *pdev , int port ) { int i ; { port = port * 2; i = 0; goto ldv_43673; ldv_43672: ; if (pdev->resource[port + i].start == 0ULL || ((pdev->resource[port + i].start == 0ULL && pdev->resource[port + i].end == pdev->resource[port + i].start) || pdev->resource[port + i].end - pdev->resource[port + i].start == 0xffffffffffffffffULL)) { return (0); } else { } i = i + 1; ldv_43673: ; if (i <= 1) { goto ldv_43672; } else { } return (1); } } int ata_pci_sff_init_host(struct ata_host *host ) { struct device *gdev ; struct pci_dev *pdev ; struct device const *__mptr ; unsigned int mask ; int i ; int rc ; struct ata_port *ap ; int base ; void * const *iomap ; int tmp ; int tmp___0 ; char const *tmp___1 ; void *tmp___2 ; { gdev = host->dev; __mptr = (struct device const *)gdev; pdev = (struct pci_dev *)__mptr + 0xffffffffffffff68UL; mask = 0U; i = 0; goto ldv_43690; ldv_43689: ap = host->ports[i]; base = i * 2; tmp = ata_port_is_dummy(ap); if (tmp != 0) { goto ldv_43688; } else { } tmp___0 = ata_resources_present(pdev, i); if (tmp___0 == 0) { ap->ops = & ata_dummy_port_ops; goto ldv_43688; } else { } tmp___1 = dev_driver_string((struct device const *)gdev); rc = pcim_iomap_regions(pdev, 3 << base, tmp___1); if (rc != 0) { dev_warn((struct device const *)gdev, "failed to request/iomap BARs for port %d (errno=%d)\n", i, rc); if (rc == -16) { pcim_pin_device(pdev); } else { } ap->ops = & ata_dummy_port_ops; goto ldv_43688; } else { } iomap = pcim_iomap_table(pdev); host->iomap = iomap; ap->ioaddr.cmd_addr = *(iomap + (unsigned long )base); tmp___2 = (void *)((unsigned long )*(iomap + ((unsigned long )base + 1UL)) | 2UL); ap->ioaddr.ctl_addr = tmp___2; ap->ioaddr.altstatus_addr = tmp___2; ata_sff_std_ports(& ap->ioaddr); ata_port_desc(ap, "cmd 0x%llx ctl 0x%llx", pdev->resource[base].start, pdev->resource[base + 1].start); mask = (unsigned int )(1 << i) | mask; ldv_43688: i = i + 1; ldv_43690: ; if (i <= 1) { goto ldv_43689; } else { } if (mask == 0U) { dev_err((struct device const *)gdev, "no available native port\n"); return (-19); } else { } return (0); } } static char const __kstrtab_ata_pci_sff_init_host[22U] = { 'a', 't', 'a', '_', 'p', 'c', 'i', '_', 's', 'f', 'f', '_', 'i', 'n', 'i', 't', '_', 'h', 'o', 's', 't', '\000'}; struct kernel_symbol const __ksymtab_ata_pci_sff_init_host ; struct kernel_symbol const __ksymtab_ata_pci_sff_init_host = {(unsigned long )(& ata_pci_sff_init_host), (char const *)(& __kstrtab_ata_pci_sff_init_host)}; int ata_pci_sff_prepare_host(struct pci_dev *pdev , struct ata_port_info const * const *ppi , struct ata_host **r_host ) { struct ata_host *host ; int rc ; void *tmp ; { tmp = devres_open_group(& pdev->dev, (void *)0, 208U); if ((unsigned long )tmp == (unsigned long )((void *)0)) { return (-12); } else { } host = ata_host_alloc_pinfo(& pdev->dev, ppi, 2); if ((unsigned long )host == (unsigned long )((struct ata_host *)0)) { dev_err((struct device const *)(& pdev->dev), "failed to allocate ATA host\n"); rc = -12; goto err_out; } else { } rc = ata_pci_sff_init_host(host); if (rc != 0) { goto err_out; } else { } devres_remove_group(& pdev->dev, (void *)0); *r_host = host; return (0); err_out: devres_release_group(& pdev->dev, (void *)0); return (rc); } } static char const __kstrtab_ata_pci_sff_prepare_host[25U] = { 'a', 't', 'a', '_', 'p', 'c', 'i', '_', 's', 'f', 'f', '_', 'p', 'r', 'e', 'p', 'a', 'r', 'e', '_', 'h', 'o', 's', 't', '\000'}; struct kernel_symbol const __ksymtab_ata_pci_sff_prepare_host ; struct kernel_symbol const __ksymtab_ata_pci_sff_prepare_host = {(unsigned long )(& ata_pci_sff_prepare_host), (char const *)(& __kstrtab_ata_pci_sff_prepare_host)}; int ata_pci_sff_activate_host(struct ata_host *host , irqreturn_t (*irq_handler)(int , void * ) , struct scsi_host_template *sht ) { struct device *dev ; struct pci_dev *pdev ; struct device const *__mptr ; char const *drv_name ; char const *tmp ; int legacy_mode ; int rc ; u8 tmp8 ; u8 mask ; void *tmp___0 ; int i ; int tmp___1 ; int tmp___2 ; int tmp___3 ; { dev = host->dev; __mptr = (struct device const *)dev; pdev = (struct pci_dev *)__mptr + 0xffffffffffffff68UL; tmp = dev_driver_string((struct device const *)host->dev); drv_name = tmp; legacy_mode = 0; rc = ata_host_start(host); if (rc != 0) { return (rc); } else { } if (pdev->class >> 8 == 257U) { pci_read_config_byte((struct pci_dev const *)pdev, 9, & tmp8); mask = 5U; if (((int )tmp8 & (int )mask) != (int )mask) { legacy_mode = 1; } else { } } else { } tmp___0 = devres_open_group(dev, (void *)0, 208U); if ((unsigned long )tmp___0 == (unsigned long )((void *)0)) { return (-12); } else { } if (legacy_mode == 0 && pdev->irq != 0U) { rc = devm_request_irq(dev, pdev->irq, irq_handler, 128UL, drv_name, (void *)host); if (rc != 0) { goto out; } else { } i = 0; goto ldv_43734; ldv_43733: tmp___1 = ata_port_is_dummy(host->ports[i]); if (tmp___1 != 0) { goto ldv_43732; } else { } ata_port_desc(host->ports[i], "irq %d", pdev->irq); ldv_43732: i = i + 1; ldv_43734: ; if (i <= 1) { goto ldv_43733; } else { } } else if (legacy_mode != 0) { tmp___2 = ata_port_is_dummy(host->ports[0]); if (tmp___2 == 0) { rc = devm_request_irq(dev, 14U, irq_handler, 128UL, drv_name, (void *)host); if (rc != 0) { goto out; } else { } ata_port_desc(host->ports[0], "irq %d", 14); } else { } tmp___3 = ata_port_is_dummy(host->ports[1]); if (tmp___3 == 0) { rc = devm_request_irq(dev, 15U, irq_handler, 128UL, drv_name, (void *)host); if (rc != 0) { goto out; } else { } ata_port_desc(host->ports[1], "irq %d", 15); } else { } } else { } rc = ata_host_register(host, sht); out: ; if (rc == 0) { devres_remove_group(dev, (void *)0); } else { devres_release_group(dev, (void *)0); } return (rc); } } static char const __kstrtab_ata_pci_sff_activate_host[26U] = { 'a', 't', 'a', '_', 'p', 'c', 'i', '_', 's', 'f', 'f', '_', 'a', 'c', 't', 'i', 'v', 'a', 't', 'e', '_', 'h', 'o', 's', 't', '\000'}; struct kernel_symbol const __ksymtab_ata_pci_sff_activate_host ; struct kernel_symbol const __ksymtab_ata_pci_sff_activate_host = {(unsigned long )(& ata_pci_sff_activate_host), (char const *)(& __kstrtab_ata_pci_sff_activate_host)}; static struct ata_port_info const *ata_sff_find_valid_pi(struct ata_port_info const * const *ppi ) { int i ; { i = 0; goto ldv_43750; ldv_43749: ; if ((unsigned long )((struct ata_port_operations *)(*(ppi + (unsigned long )i))->port_ops) != (unsigned long )(& ata_dummy_port_ops)) { return ((struct ata_port_info const *)*(ppi + (unsigned long )i)); } else { } i = i + 1; ldv_43750: ; if (i <= 1 && (unsigned long )*(ppi + (unsigned long )i) != (unsigned long )((struct ata_port_info const */* const */)0)) { goto ldv_43749; } else { } return ((struct ata_port_info const *)0); } } static int ata_pci_init_one(struct pci_dev *pdev , struct ata_port_info const * const *ppi , struct scsi_host_template *sht , void *host_priv , int hflags , bool bmdma ) { struct device *dev ; struct ata_port_info const *pi ; struct ata_host *host ; int rc ; void *tmp ; { dev = & pdev->dev; host = (struct ata_host *)0; pi = ata_sff_find_valid_pi(ppi); if ((unsigned long )pi == (unsigned long )((struct ata_port_info const *)0)) { dev_err((struct device const *)(& pdev->dev), "no valid port_info specified\n"); return (-22); } else { } tmp = devres_open_group(dev, (void *)0, 208U); if ((unsigned long )tmp == (unsigned long )((void *)0)) { return (-12); } else { } rc = pcim_enable_device(pdev); if (rc != 0) { goto out; } else { } if ((int )bmdma) { rc = ata_pci_bmdma_prepare_host(pdev, ppi, & host); } else { rc = ata_pci_sff_prepare_host(pdev, ppi, & host); } if (rc != 0) { goto out; } else { } host->private_data = host_priv; host->flags = host->flags | (unsigned long )hflags; if ((int )bmdma) { pci_set_master(pdev); rc = ata_pci_sff_activate_host(host, & ata_bmdma_interrupt, sht); } else { rc = ata_pci_sff_activate_host(host, & ata_sff_interrupt, sht); } out: ; if (rc == 0) { devres_remove_group(& pdev->dev, (void *)0); } else { devres_release_group(& pdev->dev, (void *)0); } return (rc); } } int ata_pci_sff_init_one(struct pci_dev *pdev , struct ata_port_info const * const *ppi , struct scsi_host_template *sht , void *host_priv , int hflag ) { int tmp ; { tmp = ata_pci_init_one(pdev, ppi, sht, host_priv, hflag, 0); return (tmp); } } static char const __kstrtab_ata_pci_sff_init_one[21U] = { 'a', 't', 'a', '_', 'p', 'c', 'i', '_', 's', 'f', 'f', '_', 'i', 'n', 'i', 't', '_', 'o', 'n', 'e', '\000'}; struct kernel_symbol const __ksymtab_ata_pci_sff_init_one ; struct kernel_symbol const __ksymtab_ata_pci_sff_init_one = {(unsigned long )(& ata_pci_sff_init_one), (char const *)(& __kstrtab_ata_pci_sff_init_one)}; struct ata_port_operations const ata_bmdma_port_ops = {0, 0, & ata_bmdma_qc_prep, & ata_bmdma_qc_issue, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & ata_bmdma_error_handler, 0, & ata_bmdma_post_internal_cmd, 0, 0, 0, 0, 0, 0, 0, 0, 0, & ata_bmdma_port_start, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & ata_bmdma_irq_clear, 0, & ata_bmdma_setup, & ata_bmdma_start, & ata_bmdma_stop, & ata_bmdma_status, 0, 0, 0, 0, 0, 0, 0, & ata_sff_port_ops}; static char const __kstrtab_ata_bmdma_port_ops[19U] = { 'a', 't', 'a', '_', 'b', 'm', 'd', 'm', 'a', '_', 'p', 'o', 'r', 't', '_', 'o', 'p', 's', '\000'}; struct kernel_symbol const __ksymtab_ata_bmdma_port_ops ; struct kernel_symbol const __ksymtab_ata_bmdma_port_ops = {(unsigned long )(& ata_bmdma_port_ops), (char const *)(& __kstrtab_ata_bmdma_port_ops)}; struct ata_port_operations const ata_bmdma32_port_ops = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & ata_bmdma_port_start32, 0, 0, 0, 0, 0, 0, 0, 0, 0, & ata_sff_data_xfer32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & ata_bmdma_port_ops}; static char const __kstrtab_ata_bmdma32_port_ops[21U] = { 'a', 't', 'a', '_', 'b', 'm', 'd', 'm', 'a', '3', '2', '_', 'p', 'o', 'r', 't', '_', 'o', 'p', 's', '\000'}; struct kernel_symbol const __ksymtab_ata_bmdma32_port_ops ; struct kernel_symbol const __ksymtab_ata_bmdma32_port_ops = {(unsigned long )(& ata_bmdma32_port_ops), (char const *)(& __kstrtab_ata_bmdma32_port_ops)}; static void ata_bmdma_fill_sg(struct ata_queued_cmd *qc ) { struct ata_port *ap ; struct ata_bmdma_prd *prd ; struct scatterlist *sg ; unsigned int si ; unsigned int pi ; u32 addr ; u32 offset ; u32 sg_len ; u32 len ; { ap = qc->ap; prd = ap->bmdma_prd; pi = 0U; si = 0U; sg = qc->sg; goto ldv_43813; ldv_43812: addr = (unsigned int )sg->dma_address; sg_len = sg->dma_length; goto ldv_43810; ldv_43809: offset = addr & 65535U; len = sg_len; if (offset + sg_len > 65536U) { len = 65536U - offset; } else { } (prd + (unsigned long )pi)->addr = addr; (prd + (unsigned long )pi)->flags_len = len & 65535U; pi = pi + 1U; sg_len = sg_len - len; addr = addr + len; ldv_43810: ; if (sg_len != 0U) { goto ldv_43809; } else { } si = si + 1U; sg = sg_next(sg); ldv_43813: ; if (qc->n_elem > si) { goto ldv_43812; } else { } (prd + (unsigned long )(pi - 1U))->flags_len = (prd + (unsigned long )(pi - 1U))->flags_len | 2147483648U; return; } } static void ata_bmdma_fill_sg_dumb(struct ata_queued_cmd *qc ) { struct ata_port *ap ; struct ata_bmdma_prd *prd ; struct scatterlist *sg ; unsigned int si ; unsigned int pi ; u32 addr ; u32 offset ; u32 sg_len ; u32 len ; u32 blen ; { ap = qc->ap; prd = ap->bmdma_prd; pi = 0U; si = 0U; sg = qc->sg; goto ldv_43832; ldv_43831: addr = (unsigned int )sg->dma_address; sg_len = sg->dma_length; goto ldv_43829; ldv_43828: offset = addr & 65535U; len = sg_len; if (offset + sg_len > 65536U) { len = 65536U - offset; } else { } blen = len & 65535U; (prd + (unsigned long )pi)->addr = addr; if (blen == 0U) { (prd + (unsigned long )pi)->flags_len = 32768U; blen = 32768U; pi = pi + 1U; (prd + (unsigned long )pi)->addr = addr + 32768U; } else { } (prd + (unsigned long )pi)->flags_len = blen; pi = pi + 1U; sg_len = sg_len - len; addr = addr + len; ldv_43829: ; if (sg_len != 0U) { goto ldv_43828; } else { } si = si + 1U; sg = sg_next(sg); ldv_43832: ; if (qc->n_elem > si) { goto ldv_43831; } else { } (prd + (unsigned long )(pi - 1U))->flags_len = (prd + (unsigned long )(pi - 1U))->flags_len | 2147483648U; return; } } void ata_bmdma_qc_prep(struct ata_queued_cmd *qc ) { { if ((qc->flags & 2UL) == 0UL) { return; } else { } ata_bmdma_fill_sg(qc); return; } } static char const __kstrtab_ata_bmdma_qc_prep[18U] = { 'a', 't', 'a', '_', 'b', 'm', 'd', 'm', 'a', '_', 'q', 'c', '_', 'p', 'r', 'e', 'p', '\000'}; struct kernel_symbol const __ksymtab_ata_bmdma_qc_prep ; struct kernel_symbol const __ksymtab_ata_bmdma_qc_prep = {(unsigned long )(& ata_bmdma_qc_prep), (char const *)(& __kstrtab_ata_bmdma_qc_prep)}; void ata_bmdma_dumb_qc_prep(struct ata_queued_cmd *qc ) { { if ((qc->flags & 2UL) == 0UL) { return; } else { } ata_bmdma_fill_sg_dumb(qc); return; } } static char const __kstrtab_ata_bmdma_dumb_qc_prep[23U] = { 'a', 't', 'a', '_', 'b', 'm', 'd', 'm', 'a', '_', 'd', 'u', 'm', 'b', '_', 'q', 'c', '_', 'p', 'r', 'e', 'p', '\000'}; struct kernel_symbol const __ksymtab_ata_bmdma_dumb_qc_prep ; struct kernel_symbol const __ksymtab_ata_bmdma_dumb_qc_prep = {(unsigned long )(& ata_bmdma_dumb_qc_prep), (char const *)(& __kstrtab_ata_bmdma_dumb_qc_prep)}; unsigned int ata_bmdma_qc_issue(struct ata_queued_cmd *qc ) { struct ata_port *ap ; struct ata_link *link ; unsigned int tmp ; int tmp___0 ; bool __warned ; int __ret_warn_once ; int __ret_warn_on ; long tmp___1 ; long tmp___2 ; long tmp___3 ; bool __warned___0 ; int __ret_warn_once___0 ; int __ret_warn_on___0 ; long tmp___4 ; long tmp___5 ; long tmp___6 ; int __ret_warn_on___1 ; long tmp___7 ; { ap = qc->ap; link = (qc->dev)->link; tmp___0 = ata_is_dma((int )qc->tf.protocol); if (tmp___0 == 0) { tmp = ata_sff_qc_issue(qc); return (tmp); } else { } ata_dev_select(ap, (qc->dev)->devno, 1U, 0U); switch ((int )qc->tf.protocol) { case 3: __ret_warn_once = (qc->tf.flags & 64UL) != 0UL; tmp___3 = ldv__builtin_expect(__ret_warn_once != 0, 0L); if (tmp___3 != 0L) { __ret_warn_on = ! __warned; tmp___1 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-sff.c", 2805); } else { } tmp___2 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___2 != 0L) { __warned = 1; } else { } } else { } ldv__builtin_expect(__ret_warn_once != 0, 0L); (*((ap->ops)->sff_tf_load))(ap, (struct ata_taskfile const *)(& qc->tf)); (*((ap->ops)->bmdma_setup))(qc); (*((ap->ops)->bmdma_start))(qc); ap->hsm_task_state = 3U; goto ldv_43865; case 7: __ret_warn_once___0 = (qc->tf.flags & 64UL) != 0UL; tmp___6 = ldv__builtin_expect(__ret_warn_once___0 != 0, 0L); if (tmp___6 != 0L) { __ret_warn_on___0 = ! __warned___0; tmp___4 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___4 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-sff.c", 2814); } else { } tmp___5 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___5 != 0L) { __warned___0 = 1; } else { } } else { } ldv__builtin_expect(__ret_warn_once___0 != 0, 0L); (*((ap->ops)->sff_tf_load))(ap, (struct ata_taskfile const *)(& qc->tf)); (*((ap->ops)->bmdma_setup))(qc); ap->hsm_task_state = 1U; if (((qc->dev)->flags & 4UL) == 0UL) { ata_sff_queue_pio_task(link, 0UL); } else { } goto ldv_43865; default: __ret_warn_on___1 = 1; tmp___7 = ldv__builtin_expect(__ret_warn_on___1 != 0, 0L); if (tmp___7 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-sff.c", 2826); } else { } ldv__builtin_expect(__ret_warn_on___1 != 0, 0L); return (64U); } ldv_43865: ; return (0U); } } static char const __kstrtab_ata_bmdma_qc_issue[19U] = { 'a', 't', 'a', '_', 'b', 'm', 'd', 'm', 'a', '_', 'q', 'c', '_', 'i', 's', 's', 'u', 'e', '\000'}; struct kernel_symbol const __ksymtab_ata_bmdma_qc_issue ; struct kernel_symbol const __ksymtab_ata_bmdma_qc_issue = {(unsigned long )(& ata_bmdma_qc_issue), (char const *)(& __kstrtab_ata_bmdma_qc_issue)}; unsigned int ata_bmdma_port_intr(struct ata_port *ap , struct ata_queued_cmd *qc ) { struct ata_eh_info *ehi ; u8 host_stat ; bool bmdma_stopped ; unsigned int handled ; unsigned int tmp ; long tmp___0 ; int tmp___1 ; long tmp___2 ; int tmp___3 ; { ehi = & ap->link.eh_info; host_stat = 0U; bmdma_stopped = 0; if (ap->hsm_task_state == 3U) { tmp___1 = ata_is_dma((int )qc->tf.protocol); if (tmp___1 != 0) { host_stat = (*((ap->ops)->bmdma_status))(ap); if (((int )host_stat & 4) == 0) { tmp = ata_sff_idle_irq(ap); return (tmp); } else { } (*((ap->ops)->bmdma_stop))(qc); bmdma_stopped = 1; tmp___0 = ldv__builtin_expect(((int )host_stat & 2) != 0, 0L); if (tmp___0 != 0L) { qc->err_mask = qc->err_mask | 32U; ap->hsm_task_state = 4U; } else { } } else { } } else { } handled = __ata_sff_port_intr(ap, qc, (int )bmdma_stopped); tmp___2 = ldv__builtin_expect(qc->err_mask != 0U, 0L); if (tmp___2 != 0L) { tmp___3 = ata_is_dma((int )qc->tf.protocol); if (tmp___3 != 0) { ata_ehi_push_desc(ehi, "BMDMA stat 0x%x", (int )host_stat); } else { } } else { } return (handled); } } static char const __kstrtab_ata_bmdma_port_intr[20U] = { 'a', 't', 'a', '_', 'b', 'm', 'd', 'm', 'a', '_', 'p', 'o', 'r', 't', '_', 'i', 'n', 't', 'r', '\000'}; struct kernel_symbol const __ksymtab_ata_bmdma_port_intr ; struct kernel_symbol const __ksymtab_ata_bmdma_port_intr = {(unsigned long )(& ata_bmdma_port_intr), (char const *)(& __kstrtab_ata_bmdma_port_intr)}; irqreturn_t ata_bmdma_interrupt(int irq , void *dev_instance ) { irqreturn_t tmp ; { tmp = __ata_sff_interrupt(irq, dev_instance, & ata_bmdma_port_intr); return (tmp); } } static char const __kstrtab_ata_bmdma_interrupt[20U] = { 'a', 't', 'a', '_', 'b', 'm', 'd', 'm', 'a', '_', 'i', 'n', 't', 'e', 'r', 'r', 'u', 'p', 't', '\000'}; struct kernel_symbol const __ksymtab_ata_bmdma_interrupt ; struct kernel_symbol const __ksymtab_ata_bmdma_interrupt = {(unsigned long )(& ata_bmdma_interrupt), (char const *)(& __kstrtab_ata_bmdma_interrupt)}; void ata_bmdma_error_handler(struct ata_port *ap ) { struct ata_queued_cmd *qc ; unsigned long flags ; bool thaw ; raw_spinlock_t *tmp ; u8 host_stat ; int tmp___0 ; { thaw = 0; qc = __ata_qc_from_tag(ap, ap->link.active_tag); if ((unsigned long )qc != (unsigned long )((struct ata_queued_cmd *)0) && (qc->flags & 65536UL) == 0UL) { qc = (struct ata_queued_cmd *)0; } else { } tmp = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp); if ((unsigned long )qc != (unsigned long )((struct ata_queued_cmd *)0)) { tmp___0 = ata_is_dma((int )qc->tf.protocol); if (tmp___0 != 0) { host_stat = (*((ap->ops)->bmdma_status))(ap); if (qc->err_mask == 4U && ((int )host_stat & 2) != 0) { qc->err_mask = 32U; thaw = 1; } else { } (*((ap->ops)->bmdma_stop))(qc); if ((int )thaw) { (*((ap->ops)->sff_check_status))(ap); if ((unsigned long )(ap->ops)->sff_irq_clear != (unsigned long )((void (*)(struct ata_port * ))0)) { (*((ap->ops)->sff_irq_clear))(ap); } else { } } else { } } else { } } else { } spin_unlock_irqrestore(ap->lock, flags); if ((int )thaw) { ata_eh_thaw_port(ap); } else { } ata_sff_error_handler(ap); return; } } static char const __kstrtab_ata_bmdma_error_handler[24U] = { 'a', 't', 'a', '_', 'b', 'm', 'd', 'm', 'a', '_', 'e', 'r', 'r', 'o', 'r', '_', 'h', 'a', 'n', 'd', 'l', 'e', 'r', '\000'}; struct kernel_symbol const __ksymtab_ata_bmdma_error_handler ; struct kernel_symbol const __ksymtab_ata_bmdma_error_handler = {(unsigned long )(& ata_bmdma_error_handler), (char const *)(& __kstrtab_ata_bmdma_error_handler)}; void ata_bmdma_post_internal_cmd(struct ata_queued_cmd *qc ) { struct ata_port *ap ; unsigned long flags ; raw_spinlock_t *tmp ; int tmp___0 ; { ap = qc->ap; tmp___0 = ata_is_dma((int )qc->tf.protocol); if (tmp___0 != 0) { tmp = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp); (*((ap->ops)->bmdma_stop))(qc); spin_unlock_irqrestore(ap->lock, flags); } else { } return; } } static char const __kstrtab_ata_bmdma_post_internal_cmd[28U] = { 'a', 't', 'a', '_', 'b', 'm', 'd', 'm', 'a', '_', 'p', 'o', 's', 't', '_', 'i', 'n', 't', 'e', 'r', 'n', 'a', 'l', '_', 'c', 'm', 'd', '\000'}; struct kernel_symbol const __ksymtab_ata_bmdma_post_internal_cmd ; struct kernel_symbol const __ksymtab_ata_bmdma_post_internal_cmd = {(unsigned long )(& ata_bmdma_post_internal_cmd), (char const *)(& __kstrtab_ata_bmdma_post_internal_cmd)}; void ata_bmdma_irq_clear(struct ata_port *ap ) { void *mmio ; unsigned int tmp ; { mmio = ap->ioaddr.bmdma_addr; if ((unsigned long )mmio == (unsigned long )((void *)0)) { return; } else { } tmp = ioread8(mmio + 2UL); iowrite8((int )((u8 )tmp), mmio + 2UL); return; } } static char const __kstrtab_ata_bmdma_irq_clear[20U] = { 'a', 't', 'a', '_', 'b', 'm', 'd', 'm', 'a', '_', 'i', 'r', 'q', '_', 'c', 'l', 'e', 'a', 'r', '\000'}; struct kernel_symbol const __ksymtab_ata_bmdma_irq_clear ; struct kernel_symbol const __ksymtab_ata_bmdma_irq_clear = {(unsigned long )(& ata_bmdma_irq_clear), (char const *)(& __kstrtab_ata_bmdma_irq_clear)}; void ata_bmdma_setup(struct ata_queued_cmd *qc ) { struct ata_port *ap ; unsigned int rw ; u8 dmactl ; unsigned int tmp ; { ap = qc->ap; rw = (unsigned int )qc->tf.flags & 8U; __asm__ volatile ("mfence": : : "memory"); iowrite32((u32 )ap->bmdma_prd_dma, ap->ioaddr.bmdma_addr + 4UL); tmp = ioread8(ap->ioaddr.bmdma_addr); dmactl = (u8 )tmp; dmactl = (unsigned int )dmactl & 246U; if (rw == 0U) { dmactl = (u8 )((unsigned int )dmactl | 8U); } else { } iowrite8((int )dmactl, ap->ioaddr.bmdma_addr); (*((ap->ops)->sff_exec_command))(ap, (struct ata_taskfile const *)(& qc->tf)); return; } } static char const __kstrtab_ata_bmdma_setup[16U] = { 'a', 't', 'a', '_', 'b', 'm', 'd', 'm', 'a', '_', 's', 'e', 't', 'u', 'p', '\000'}; struct kernel_symbol const __ksymtab_ata_bmdma_setup ; struct kernel_symbol const __ksymtab_ata_bmdma_setup = {(unsigned long )(& ata_bmdma_setup), (char const *)(& __kstrtab_ata_bmdma_setup)}; void ata_bmdma_start(struct ata_queued_cmd *qc ) { struct ata_port *ap ; u8 dmactl ; unsigned int tmp ; { ap = qc->ap; tmp = ioread8(ap->ioaddr.bmdma_addr); dmactl = (u8 )tmp; iowrite8((int )((unsigned int )dmactl | 1U), ap->ioaddr.bmdma_addr); return; } } static char const __kstrtab_ata_bmdma_start[16U] = { 'a', 't', 'a', '_', 'b', 'm', 'd', 'm', 'a', '_', 's', 't', 'a', 'r', 't', '\000'}; struct kernel_symbol const __ksymtab_ata_bmdma_start ; struct kernel_symbol const __ksymtab_ata_bmdma_start = {(unsigned long )(& ata_bmdma_start), (char const *)(& __kstrtab_ata_bmdma_start)}; void ata_bmdma_stop(struct ata_queued_cmd *qc ) { struct ata_port *ap ; void *mmio ; unsigned int tmp ; { ap = qc->ap; mmio = ap->ioaddr.bmdma_addr; tmp = ioread8(mmio); iowrite8((int )((u8 )tmp) & 254, mmio); ata_sff_dma_pause(ap); return; } } static char const __kstrtab_ata_bmdma_stop[15U] = { 'a', 't', 'a', '_', 'b', 'm', 'd', 'm', 'a', '_', 's', 't', 'o', 'p', '\000'}; struct kernel_symbol const __ksymtab_ata_bmdma_stop ; struct kernel_symbol const __ksymtab_ata_bmdma_stop = {(unsigned long )(& ata_bmdma_stop), (char const *)(& __kstrtab_ata_bmdma_stop)}; u8 ata_bmdma_status(struct ata_port *ap ) { unsigned int tmp ; { tmp = ioread8(ap->ioaddr.bmdma_addr + 2UL); return ((u8 )tmp); } } static char const __kstrtab_ata_bmdma_status[17U] = { 'a', 't', 'a', '_', 'b', 'm', 'd', 'm', 'a', '_', 's', 't', 'a', 't', 'u', 's', '\000'}; struct kernel_symbol const __ksymtab_ata_bmdma_status ; struct kernel_symbol const __ksymtab_ata_bmdma_status = {(unsigned long )(& ata_bmdma_status), (char const *)(& __kstrtab_ata_bmdma_status)}; int ata_bmdma_port_start(struct ata_port *ap ) { void *tmp ; { if (ap->mwdma_mask != 0U || ap->udma_mask != 0U) { tmp = dmam_alloc_coherent((ap->host)->dev, 2048UL, & ap->bmdma_prd_dma, 208U); ap->bmdma_prd = (struct ata_bmdma_prd *)tmp; if ((unsigned long )ap->bmdma_prd == (unsigned long )((struct ata_bmdma_prd *)0)) { return (-12); } else { } } else { } return (0); } } static char const __kstrtab_ata_bmdma_port_start[21U] = { 'a', 't', 'a', '_', 'b', 'm', 'd', 'm', 'a', '_', 'p', 'o', 'r', 't', '_', 's', 't', 'a', 'r', 't', '\000'}; struct kernel_symbol const __ksymtab_ata_bmdma_port_start ; struct kernel_symbol const __ksymtab_ata_bmdma_port_start = {(unsigned long )(& ata_bmdma_port_start), (char const *)(& __kstrtab_ata_bmdma_port_start)}; int ata_bmdma_port_start32(struct ata_port *ap ) { int tmp ; { ap->pflags = ap->pflags | 3145728U; tmp = ata_bmdma_port_start(ap); return (tmp); } } static char const __kstrtab_ata_bmdma_port_start32[23U] = { 'a', 't', 'a', '_', 'b', 'm', 'd', 'm', 'a', '_', 'p', 'o', 'r', 't', '_', 's', 't', 'a', 'r', 't', '3', '2', '\000'}; struct kernel_symbol const __ksymtab_ata_bmdma_port_start32 ; struct kernel_symbol const __ksymtab_ata_bmdma_port_start32 = {(unsigned long )(& ata_bmdma_port_start32), (char const *)(& __kstrtab_ata_bmdma_port_start32)}; int ata_pci_bmdma_clear_simplex(struct pci_dev *pdev ) { unsigned long bmdma ; u8 simplex ; { bmdma = (unsigned long )pdev->resource[4].start; if (bmdma == 0UL) { return (-2); } else { } simplex = inb((int )((unsigned int )bmdma + 2U)); outb((int )simplex & 96, (int )((unsigned int )bmdma + 2U)); simplex = inb((int )((unsigned int )bmdma + 2U)); if ((int )((signed char )simplex) < 0) { return (-95); } else { } return (0); } } static char const __kstrtab_ata_pci_bmdma_clear_simplex[28U] = { 'a', 't', 'a', '_', 'p', 'c', 'i', '_', 'b', 'm', 'd', 'm', 'a', '_', 'c', 'l', 'e', 'a', 'r', '_', 's', 'i', 'm', 'p', 'l', 'e', 'x', '\000'}; struct kernel_symbol const __ksymtab_ata_pci_bmdma_clear_simplex ; struct kernel_symbol const __ksymtab_ata_pci_bmdma_clear_simplex = {(unsigned long )(& ata_pci_bmdma_clear_simplex), (char const *)(& __kstrtab_ata_pci_bmdma_clear_simplex)}; static void ata_bmdma_nodma(struct ata_host *host , char const *reason ) { int i ; { dev_err((struct device const *)host->dev, "BMDMA: %s, falling back to PIO\n", reason); i = 0; goto ldv_44038; ldv_44037: (host->ports[i])->mwdma_mask = 0U; (host->ports[i])->udma_mask = 0U; i = i + 1; ldv_44038: ; if (i <= 1) { goto ldv_44037; } else { } return; } } void ata_pci_bmdma_init(struct ata_host *host ) { struct device *gdev ; struct pci_dev *pdev ; struct device const *__mptr ; int i ; int rc ; char const *tmp ; struct ata_port *ap ; void *bmdma ; int tmp___0 ; unsigned int tmp___1 ; { gdev = host->dev; __mptr = (struct device const *)gdev; pdev = (struct pci_dev *)__mptr + 0xffffffffffffff68UL; if (pdev->resource[4].start == 0ULL) { ata_bmdma_nodma(host, "BAR4 is zero"); return; } else { } rc = dma_set_mask(& pdev->dev, 4294967295ULL); if (rc != 0) { ata_bmdma_nodma(host, "failed to set dma mask"); } else { } if (rc == 0) { rc = dma_set_coherent_mask(& pdev->dev, 4294967295ULL); if (rc != 0) { ata_bmdma_nodma(host, "failed to set consistent dma mask"); } else { } } else { } tmp = dev_driver_string((struct device const *)gdev); rc = pcim_iomap_regions(pdev, 16, tmp); if (rc != 0) { ata_bmdma_nodma(host, "failed to request/iomap BAR4"); return; } else { } host->iomap = pcim_iomap_table(pdev); i = 0; goto ldv_44053; ldv_44052: ap = host->ports[i]; bmdma = *(host->iomap + 4UL) + (unsigned long )(i * 8); tmp___0 = ata_port_is_dummy(ap); if (tmp___0 != 0) { goto ldv_44051; } else { } ap->ioaddr.bmdma_addr = bmdma; if ((ap->flags & 32768UL) == 0UL) { tmp___1 = ioread8(bmdma + 2UL); if ((tmp___1 & 128U) != 0U) { host->flags = host->flags | 1UL; } else { } } else { } ata_port_desc(ap, "bmdma 0x%llx", pdev->resource[4].start + (resource_size_t )(i * 8)); ldv_44051: i = i + 1; ldv_44053: ; if (i <= 1) { goto ldv_44052; } else { } return; } } static char const __kstrtab_ata_pci_bmdma_init[19U] = { 'a', 't', 'a', '_', 'p', 'c', 'i', '_', 'b', 'm', 'd', 'm', 'a', '_', 'i', 'n', 'i', 't', '\000'}; struct kernel_symbol const __ksymtab_ata_pci_bmdma_init ; struct kernel_symbol const __ksymtab_ata_pci_bmdma_init = {(unsigned long )(& ata_pci_bmdma_init), (char const *)(& __kstrtab_ata_pci_bmdma_init)}; int ata_pci_bmdma_prepare_host(struct pci_dev *pdev , struct ata_port_info const * const *ppi , struct ata_host **r_host ) { int rc ; { rc = ata_pci_sff_prepare_host(pdev, ppi, r_host); if (rc != 0) { return (rc); } else { } ata_pci_bmdma_init(*r_host); return (0); } } static char const __kstrtab_ata_pci_bmdma_prepare_host[27U] = { 'a', 't', 'a', '_', 'p', 'c', 'i', '_', 'b', 'm', 'd', 'm', 'a', '_', 'p', 'r', 'e', 'p', 'a', 'r', 'e', '_', 'h', 'o', 's', 't', '\000'}; struct kernel_symbol const __ksymtab_ata_pci_bmdma_prepare_host ; struct kernel_symbol const __ksymtab_ata_pci_bmdma_prepare_host = {(unsigned long )(& ata_pci_bmdma_prepare_host), (char const *)(& __kstrtab_ata_pci_bmdma_prepare_host)}; int ata_pci_bmdma_init_one(struct pci_dev *pdev , struct ata_port_info const * const *ppi , struct scsi_host_template *sht , void *host_priv , int hflags ) { int tmp ; { tmp = ata_pci_init_one(pdev, ppi, sht, host_priv, hflags, 1); return (tmp); } } static char const __kstrtab_ata_pci_bmdma_init_one[23U] = { 'a', 't', 'a', '_', 'p', 'c', 'i', '_', 'b', 'm', 'd', 'm', 'a', '_', 'i', 'n', 'i', 't', '_', 'o', 'n', 'e', '\000'}; struct kernel_symbol const __ksymtab_ata_pci_bmdma_init_one ; struct kernel_symbol const __ksymtab_ata_pci_bmdma_init_one = {(unsigned long )(& ata_pci_bmdma_init_one), (char const *)(& __kstrtab_ata_pci_bmdma_init_one)}; void ata_sff_port_init(struct ata_port *ap ) { struct lock_class_key __key ; atomic_long_t __constr_expr_0___0 ; struct lock_class_key __key___0 ; { __init_work(& ap->sff_pio_task.work, 0); __constr_expr_0___0.counter = 137438953408L; ap->sff_pio_task.work.data = __constr_expr_0___0; lockdep_init_map(& ap->sff_pio_task.work.lockdep_map, "(&(&ap->sff_pio_task)->work)", & __key, 0); INIT_LIST_HEAD(& ap->sff_pio_task.work.entry); ap->sff_pio_task.work.func = & ata_sff_pio_task; init_timer_key(& ap->sff_pio_task.timer, 2097152U, "(&(&ap->sff_pio_task)->timer)", & __key___0); ap->sff_pio_task.timer.function = & delayed_work_timer_fn; ap->sff_pio_task.timer.data = (unsigned long )(& ap->sff_pio_task); ap->ctl = 8U; ap->last_ctl = 255U; return; } } int ata_sff_init(void) { struct lock_class_key __key ; char const *__lock_name ; struct workqueue_struct *tmp ; { __lock_name = "\"ata_sff\""; tmp = __alloc_workqueue_key("ata_sff", 8U, 512, & __key, __lock_name); ata_sff_wq = tmp; if ((unsigned long )ata_sff_wq == (unsigned long )((struct workqueue_struct *)0)) { return (-12); } else { } return (0); } } void ata_sff_exit(void) { { ldv_destroy_workqueue_83(ata_sff_wq); return; } } extern int ldv_probe_10(void) ; extern int ldv_release_11(void) ; extern int ldv_probe_11(void) ; extern int ldv_release_10(void) ; void work_init_3(void) { { ldv_work_3_0 = 0; ldv_work_3_1 = 0; ldv_work_3_2 = 0; ldv_work_3_3 = 0; return; } } void ldv_initialize_ata_port_operations_10(void) { void *tmp ; void *tmp___0 ; void *tmp___1 ; void *tmp___2 ; { tmp = ldv_init_zalloc(7064UL); ata_sff_port_ops_group0 = (struct ata_link *)tmp; tmp___0 = ldv_init_zalloc(18112UL); ata_sff_port_ops_group2 = (struct ata_port *)tmp___0; tmp___1 = ldv_init_zalloc(240UL); ata_sff_port_ops_group1 = (struct ata_queued_cmd *)tmp___1; tmp___2 = ldv_init_zalloc(32UL); ata_sff_port_ops_group3 = (struct ata_taskfile const *)tmp___2; return; } } void activate_work_3(struct work_struct *work , int state ) { { if (ldv_work_3_0 == 0) { ldv_work_struct_3_0 = work; ldv_work_3_0 = state; return; } else { } if (ldv_work_3_1 == 0) { ldv_work_struct_3_1 = work; ldv_work_3_1 = state; return; } else { } if (ldv_work_3_2 == 0) { ldv_work_struct_3_2 = work; ldv_work_3_2 = state; return; } else { } if (ldv_work_3_3 == 0) { ldv_work_struct_3_3 = work; ldv_work_3_3 = state; return; } else { } return; } } void call_and_disable_work_3(struct work_struct *work ) { { if ((ldv_work_3_0 == 2 || ldv_work_3_0 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_3_0) { ata_sff_pio_task(work); ldv_work_3_0 = 1; return; } else { } if ((ldv_work_3_1 == 2 || ldv_work_3_1 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_3_1) { ata_sff_pio_task(work); ldv_work_3_1 = 1; return; } else { } if ((ldv_work_3_2 == 2 || ldv_work_3_2 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_3_2) { ata_sff_pio_task(work); ldv_work_3_2 = 1; return; } else { } if ((ldv_work_3_3 == 2 || ldv_work_3_3 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_3_3) { ata_sff_pio_task(work); ldv_work_3_3 = 1; return; } else { } return; } } void disable_work_3(struct work_struct *work ) { { if ((ldv_work_3_0 == 3 || ldv_work_3_0 == 2) && (unsigned long )ldv_work_struct_3_0 == (unsigned long )work) { ldv_work_3_0 = 1; } else { } if ((ldv_work_3_1 == 3 || ldv_work_3_1 == 2) && (unsigned long )ldv_work_struct_3_1 == (unsigned long )work) { ldv_work_3_1 = 1; } else { } if ((ldv_work_3_2 == 3 || ldv_work_3_2 == 2) && (unsigned long )ldv_work_struct_3_2 == (unsigned long )work) { ldv_work_3_2 = 1; } else { } if ((ldv_work_3_3 == 3 || ldv_work_3_3 == 2) && (unsigned long )ldv_work_struct_3_3 == (unsigned long )work) { ldv_work_3_3 = 1; } else { } return; } } void ldv_initialize_ata_port_operations_9(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(240UL); ata_bmdma_port_ops_group1 = (struct ata_queued_cmd *)tmp; tmp___0 = ldv_init_zalloc(18112UL); ata_bmdma_port_ops_group0 = (struct ata_port *)tmp___0; return; } } void ldv_initialize_ata_port_operations_11(void) { void *tmp ; void *tmp___0 ; void *tmp___1 ; void *tmp___2 ; { tmp = ldv_init_zalloc(7064UL); ata_sff_port_ops_group0 = (struct ata_link *)tmp; tmp___0 = ldv_init_zalloc(18112UL); ata_sff_port_ops_group2 = (struct ata_port *)tmp___0; tmp___1 = ldv_init_zalloc(240UL); ata_sff_port_ops_group1 = (struct ata_queued_cmd *)tmp___1; tmp___2 = ldv_init_zalloc(32UL); ata_sff_port_ops_group3 = (struct ata_taskfile const *)tmp___2; return; } } void ldv_initialize_ata_port_operations_8(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(240UL); ata_bmdma_port_ops_group1 = (struct ata_queued_cmd *)tmp; tmp___0 = ldv_init_zalloc(18112UL); ata_bmdma_port_ops_group0 = (struct ata_port *)tmp___0; return; } } void invoke_work_3(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_work_3_0 == 2 || ldv_work_3_0 == 3) { ldv_work_3_0 = 4; ata_sff_pio_task(ldv_work_struct_3_0); ldv_work_3_0 = 1; } else { } goto ldv_44151; case 1: ; if (ldv_work_3_1 == 2 || ldv_work_3_1 == 3) { ldv_work_3_1 = 4; ata_sff_pio_task(ldv_work_struct_3_0); ldv_work_3_1 = 1; } else { } goto ldv_44151; case 2: ; if (ldv_work_3_2 == 2 || ldv_work_3_2 == 3) { ldv_work_3_2 = 4; ata_sff_pio_task(ldv_work_struct_3_0); ldv_work_3_2 = 1; } else { } goto ldv_44151; case 3: ; if (ldv_work_3_3 == 2 || ldv_work_3_3 == 3) { ldv_work_3_3 = 4; ata_sff_pio_task(ldv_work_struct_3_0); ldv_work_3_3 = 1; } else { } goto ldv_44151; default: ldv_stop(); } ldv_44151: ; return; } } void call_and_disable_all_3(int state ) { { if (ldv_work_3_0 == state) { call_and_disable_work_3(ldv_work_struct_3_0); } else { } if (ldv_work_3_1 == state) { call_and_disable_work_3(ldv_work_struct_3_1); } else { } if (ldv_work_3_2 == state) { call_and_disable_work_3(ldv_work_struct_3_2); } else { } if (ldv_work_3_3 == state) { call_and_disable_work_3(ldv_work_struct_3_3); } else { } return; } } void ldv_main_exported_8(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_state_variable_8 == 1) { ata_bmdma_error_handler(ata_bmdma_port_ops_group0); ldv_state_variable_8 = 1; } else { } goto ldv_44163; case 1: ; if (ldv_state_variable_8 == 1) { ata_bmdma_start(ata_bmdma_port_ops_group1); ldv_state_variable_8 = 1; } else { } goto ldv_44163; case 2: ; if (ldv_state_variable_8 == 1) { ata_bmdma_stop(ata_bmdma_port_ops_group1); ldv_state_variable_8 = 1; } else { } goto ldv_44163; case 3: ; if (ldv_state_variable_8 == 1) { ata_bmdma_setup(ata_bmdma_port_ops_group1); ldv_state_variable_8 = 1; } else { } goto ldv_44163; case 4: ; if (ldv_state_variable_8 == 1) { ata_bmdma_irq_clear(ata_bmdma_port_ops_group0); ldv_state_variable_8 = 1; } else { } goto ldv_44163; case 5: ; if (ldv_state_variable_8 == 1) { ata_bmdma_qc_issue(ata_bmdma_port_ops_group1); ldv_state_variable_8 = 1; } else { } goto ldv_44163; case 6: ; if (ldv_state_variable_8 == 1) { ata_bmdma_status(ata_bmdma_port_ops_group0); ldv_state_variable_8 = 1; } else { } goto ldv_44163; case 7: ; if (ldv_state_variable_8 == 1) { ata_bmdma_post_internal_cmd(ata_bmdma_port_ops_group1); ldv_state_variable_8 = 1; } else { } goto ldv_44163; case 8: ; if (ldv_state_variable_8 == 1) { ata_bmdma_port_start(ata_bmdma_port_ops_group0); ldv_state_variable_8 = 1; } else { } goto ldv_44163; case 9: ; if (ldv_state_variable_8 == 1) { ata_bmdma_qc_prep(ata_bmdma_port_ops_group1); ldv_state_variable_8 = 1; } else { } goto ldv_44163; default: ldv_stop(); } ldv_44163: ; return; } } void ldv_main_exported_6(void) { struct ata_port *ldvarg103 ; void *tmp ; unsigned char *ldvarg107 ; void *tmp___0 ; struct ata_device *ldvarg105 ; void *tmp___1 ; unsigned int ldvarg106 ; int ldvarg104 ; int tmp___2 ; { tmp = ldv_init_zalloc(18112UL); ldvarg103 = (struct ata_port *)tmp; tmp___0 = ldv_init_zalloc(1UL); ldvarg107 = (unsigned char *)tmp___0; tmp___1 = ldv_init_zalloc(2632UL); ldvarg105 = (struct ata_device *)tmp___1; ldv_memset((void *)(& ldvarg106), 0, 4UL); ldv_memset((void *)(& ldvarg104), 0, 4UL); tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_6 == 1) { ata_sff_data_xfer32(ldvarg105, ldvarg107, ldvarg106, ldvarg104); ldv_state_variable_6 = 1; } else { } goto ldv_44183; case 1: ; if (ldv_state_variable_6 == 1) { ata_bmdma_port_start32(ldvarg103); ldv_state_variable_6 = 1; } else { } goto ldv_44183; default: ldv_stop(); } ldv_44183: ; return; } } void ldv_main_exported_11(void) { unsigned long ldvarg75 ; unsigned int *ldvarg76 ; void *tmp ; unsigned int *ldvarg74 ; void *tmp___0 ; struct ata_device *ldvarg79 ; void *tmp___1 ; unsigned long ldvarg72 ; unsigned int *ldvarg71 ; void *tmp___2 ; int ldvarg78 ; unsigned int ldvarg80 ; struct ata_taskfile *ldvarg70 ; void *tmp___3 ; unsigned long ldvarg73 ; unsigned int ldvarg77 ; unsigned char *ldvarg81 ; void *tmp___4 ; int tmp___5 ; { tmp = ldv_init_zalloc(4UL); ldvarg76 = (unsigned int *)tmp; tmp___0 = ldv_init_zalloc(4UL); ldvarg74 = (unsigned int *)tmp___0; tmp___1 = ldv_init_zalloc(2632UL); ldvarg79 = (struct ata_device *)tmp___1; tmp___2 = ldv_init_zalloc(4UL); ldvarg71 = (unsigned int *)tmp___2; tmp___3 = ldv_init_zalloc(32UL); ldvarg70 = (struct ata_taskfile *)tmp___3; tmp___4 = ldv_init_zalloc(1UL); ldvarg81 = (unsigned char *)tmp___4; ldv_memset((void *)(& ldvarg75), 0, 8UL); ldv_memset((void *)(& ldvarg72), 0, 8UL); ldv_memset((void *)(& ldvarg78), 0, 4UL); ldv_memset((void *)(& ldvarg80), 0, 4UL); ldv_memset((void *)(& ldvarg73), 0, 8UL); ldv_memset((void *)(& ldvarg77), 0, 4UL); tmp___5 = __VERIFIER_nondet_int(); switch (tmp___5) { case 0: ; if (ldv_state_variable_11 == 1) { ata_sff_error_handler(ata_sff_port_ops_group2); ldv_state_variable_11 = 1; } else { } if (ldv_state_variable_11 == 2) { ata_sff_error_handler(ata_sff_port_ops_group2); ldv_state_variable_11 = 2; } else { } goto ldv_44202; case 1: ; if (ldv_state_variable_11 == 1) { ata_sff_check_status(ata_sff_port_ops_group2); ldv_state_variable_11 = 1; } else { } if (ldv_state_variable_11 == 2) { ata_sff_check_status(ata_sff_port_ops_group2); ldv_state_variable_11 = 2; } else { } goto ldv_44202; case 2: ; if (ldv_state_variable_11 == 1) { ata_sff_exec_command(ata_sff_port_ops_group2, ata_sff_port_ops_group3); ldv_state_variable_11 = 1; } else { } if (ldv_state_variable_11 == 2) { ata_sff_exec_command(ata_sff_port_ops_group2, ata_sff_port_ops_group3); ldv_state_variable_11 = 2; } else { } goto ldv_44202; case 3: ; if (ldv_state_variable_11 == 1) { ata_sff_thaw(ata_sff_port_ops_group2); ldv_state_variable_11 = 1; } else { } if (ldv_state_variable_11 == 2) { ata_sff_thaw(ata_sff_port_ops_group2); ldv_state_variable_11 = 2; } else { } goto ldv_44202; case 4: ; if (ldv_state_variable_11 == 1) { ata_sff_data_xfer(ldvarg79, ldvarg81, ldvarg80, ldvarg78); ldv_state_variable_11 = 1; } else { } if (ldv_state_variable_11 == 2) { ata_sff_data_xfer(ldvarg79, ldvarg81, ldvarg80, ldvarg78); ldv_state_variable_11 = 2; } else { } goto ldv_44202; case 5: ; if (ldv_state_variable_11 == 1) { ata_sff_dev_select(ata_sff_port_ops_group2, ldvarg77); ldv_state_variable_11 = 1; } else { } if (ldv_state_variable_11 == 2) { ata_sff_dev_select(ata_sff_port_ops_group2, ldvarg77); ldv_state_variable_11 = 2; } else { } goto ldv_44202; case 6: ; if (ldv_state_variable_11 == 1) { ata_sff_qc_fill_rtf(ata_sff_port_ops_group1); ldv_state_variable_11 = 1; } else { } if (ldv_state_variable_11 == 2) { ata_sff_qc_fill_rtf(ata_sff_port_ops_group1); ldv_state_variable_11 = 2; } else { } goto ldv_44202; case 7: ; if (ldv_state_variable_11 == 1) { ata_sff_drain_fifo(ata_sff_port_ops_group1); ldv_state_variable_11 = 1; } else { } if (ldv_state_variable_11 == 2) { ata_sff_drain_fifo(ata_sff_port_ops_group1); ldv_state_variable_11 = 2; } else { } goto ldv_44202; case 8: ; if (ldv_state_variable_11 == 1) { sata_sff_hardreset(ata_sff_port_ops_group0, ldvarg76, ldvarg75); ldv_state_variable_11 = 1; } else { } if (ldv_state_variable_11 == 2) { sata_sff_hardreset(ata_sff_port_ops_group0, ldvarg76, ldvarg75); ldv_state_variable_11 = 2; } else { } goto ldv_44202; case 9: ; if (ldv_state_variable_11 == 1) { ata_sff_freeze(ata_sff_port_ops_group2); ldv_state_variable_11 = 1; } else { } if (ldv_state_variable_11 == 2) { ata_sff_freeze(ata_sff_port_ops_group2); ldv_state_variable_11 = 2; } else { } goto ldv_44202; case 10: ; if (ldv_state_variable_11 == 1) { ata_sff_qc_issue(ata_sff_port_ops_group1); ldv_state_variable_11 = 1; } else { } if (ldv_state_variable_11 == 2) { ata_sff_qc_issue(ata_sff_port_ops_group1); ldv_state_variable_11 = 2; } else { } goto ldv_44202; case 11: ; if (ldv_state_variable_11 == 1) { ata_sff_softreset(ata_sff_port_ops_group0, ldvarg74, ldvarg73); ldv_state_variable_11 = 1; } else { } if (ldv_state_variable_11 == 2) { ata_sff_softreset(ata_sff_port_ops_group0, ldvarg74, ldvarg73); ldv_state_variable_11 = 2; } else { } goto ldv_44202; case 12: ; if (ldv_state_variable_11 == 1) { ata_sff_prereset(ata_sff_port_ops_group0, ldvarg72); ldv_state_variable_11 = 1; } else { } if (ldv_state_variable_11 == 2) { ata_sff_prereset(ata_sff_port_ops_group0, ldvarg72); ldv_state_variable_11 = 2; } else { } goto ldv_44202; case 13: ; if (ldv_state_variable_11 == 1) { ata_sff_postreset(ata_sff_port_ops_group0, ldvarg71); ldv_state_variable_11 = 1; } else { } if (ldv_state_variable_11 == 2) { ata_sff_postreset(ata_sff_port_ops_group0, ldvarg71); ldv_state_variable_11 = 2; } else { } goto ldv_44202; case 14: ; if (ldv_state_variable_11 == 1) { ata_sff_tf_load(ata_sff_port_ops_group2, ata_sff_port_ops_group3); ldv_state_variable_11 = 1; } else { } if (ldv_state_variable_11 == 2) { ata_sff_tf_load(ata_sff_port_ops_group2, ata_sff_port_ops_group3); ldv_state_variable_11 = 2; } else { } goto ldv_44202; case 15: ; if (ldv_state_variable_11 == 1) { ata_noop_qc_prep(ata_sff_port_ops_group1); ldv_state_variable_11 = 1; } else { } if (ldv_state_variable_11 == 2) { ata_noop_qc_prep(ata_sff_port_ops_group1); ldv_state_variable_11 = 2; } else { } goto ldv_44202; case 16: ; if (ldv_state_variable_11 == 1) { ata_sff_lost_interrupt(ata_sff_port_ops_group2); ldv_state_variable_11 = 1; } else { } if (ldv_state_variable_11 == 2) { ata_sff_lost_interrupt(ata_sff_port_ops_group2); ldv_state_variable_11 = 2; } else { } goto ldv_44202; case 17: ; if (ldv_state_variable_11 == 2) { ata_sff_tf_read(ata_sff_port_ops_group2, ldvarg70); ldv_state_variable_11 = 2; } else { } goto ldv_44202; case 18: ; if (ldv_state_variable_11 == 2) { ldv_release_11(); ldv_state_variable_11 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_44202; case 19: ; if (ldv_state_variable_11 == 1) { ldv_probe_11(); ldv_state_variable_11 = 2; ref_cnt = ref_cnt + 1; } else { } goto ldv_44202; default: ldv_stop(); } ldv_44202: ; return; } } void ldv_main_exported_7(void) { struct ata_port *ldvarg9 ; void *tmp ; unsigned int ldvarg12 ; int ldvarg10 ; unsigned char *ldvarg13 ; void *tmp___0 ; struct ata_device *ldvarg11 ; void *tmp___1 ; int tmp___2 ; { tmp = ldv_init_zalloc(18112UL); ldvarg9 = (struct ata_port *)tmp; tmp___0 = ldv_init_zalloc(1UL); ldvarg13 = (unsigned char *)tmp___0; tmp___1 = ldv_init_zalloc(2632UL); ldvarg11 = (struct ata_device *)tmp___1; ldv_memset((void *)(& ldvarg12), 0, 4UL); ldv_memset((void *)(& ldvarg10), 0, 4UL); tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_7 == 1) { ata_sff_data_xfer32(ldvarg11, ldvarg13, ldvarg12, ldvarg10); ldv_state_variable_7 = 1; } else { } goto ldv_44232; case 1: ; if (ldv_state_variable_7 == 1) { ata_bmdma_port_start32(ldvarg9); ldv_state_variable_7 = 1; } else { } goto ldv_44232; default: ldv_stop(); } ldv_44232: ; return; } } void ldv_main_exported_10(void) { struct ata_taskfile *ldvarg52 ; void *tmp ; unsigned long ldvarg55 ; unsigned int *ldvarg53 ; void *tmp___0 ; struct ata_device *ldvarg61 ; void *tmp___1 ; unsigned int *ldvarg58 ; void *tmp___2 ; unsigned long ldvarg54 ; unsigned long ldvarg57 ; unsigned int ldvarg62 ; unsigned int *ldvarg56 ; void *tmp___3 ; unsigned int ldvarg59 ; int ldvarg60 ; unsigned char *ldvarg63 ; void *tmp___4 ; int tmp___5 ; { tmp = ldv_init_zalloc(32UL); ldvarg52 = (struct ata_taskfile *)tmp; tmp___0 = ldv_init_zalloc(4UL); ldvarg53 = (unsigned int *)tmp___0; tmp___1 = ldv_init_zalloc(2632UL); ldvarg61 = (struct ata_device *)tmp___1; tmp___2 = ldv_init_zalloc(4UL); ldvarg58 = (unsigned int *)tmp___2; tmp___3 = ldv_init_zalloc(4UL); ldvarg56 = (unsigned int *)tmp___3; tmp___4 = ldv_init_zalloc(1UL); ldvarg63 = (unsigned char *)tmp___4; ldv_memset((void *)(& ldvarg55), 0, 8UL); ldv_memset((void *)(& ldvarg54), 0, 8UL); ldv_memset((void *)(& ldvarg57), 0, 8UL); ldv_memset((void *)(& ldvarg62), 0, 4UL); ldv_memset((void *)(& ldvarg59), 0, 4UL); ldv_memset((void *)(& ldvarg60), 0, 4UL); tmp___5 = __VERIFIER_nondet_int(); switch (tmp___5) { case 0: ; if (ldv_state_variable_10 == 1) { ata_sff_error_handler(ata_sff_port_ops_group2); ldv_state_variable_10 = 1; } else { } if (ldv_state_variable_10 == 2) { ata_sff_error_handler(ata_sff_port_ops_group2); ldv_state_variable_10 = 2; } else { } goto ldv_44251; case 1: ; if (ldv_state_variable_10 == 1) { ata_sff_check_status(ata_sff_port_ops_group2); ldv_state_variable_10 = 1; } else { } if (ldv_state_variable_10 == 2) { ata_sff_check_status(ata_sff_port_ops_group2); ldv_state_variable_10 = 2; } else { } goto ldv_44251; case 2: ; if (ldv_state_variable_10 == 1) { ata_sff_data_xfer(ldvarg61, ldvarg63, ldvarg62, ldvarg60); ldv_state_variable_10 = 1; } else { } if (ldv_state_variable_10 == 2) { ata_sff_data_xfer(ldvarg61, ldvarg63, ldvarg62, ldvarg60); ldv_state_variable_10 = 2; } else { } goto ldv_44251; case 3: ; if (ldv_state_variable_10 == 1) { ata_sff_thaw(ata_sff_port_ops_group2); ldv_state_variable_10 = 1; } else { } if (ldv_state_variable_10 == 2) { ata_sff_thaw(ata_sff_port_ops_group2); ldv_state_variable_10 = 2; } else { } goto ldv_44251; case 4: ; if (ldv_state_variable_10 == 1) { ata_sff_exec_command(ata_sff_port_ops_group2, ata_sff_port_ops_group3); ldv_state_variable_10 = 1; } else { } if (ldv_state_variable_10 == 2) { ata_sff_exec_command(ata_sff_port_ops_group2, ata_sff_port_ops_group3); ldv_state_variable_10 = 2; } else { } goto ldv_44251; case 5: ; if (ldv_state_variable_10 == 1) { ata_sff_dev_select(ata_sff_port_ops_group2, ldvarg59); ldv_state_variable_10 = 1; } else { } if (ldv_state_variable_10 == 2) { ata_sff_dev_select(ata_sff_port_ops_group2, ldvarg59); ldv_state_variable_10 = 2; } else { } goto ldv_44251; case 6: ; if (ldv_state_variable_10 == 1) { ata_sff_qc_fill_rtf(ata_sff_port_ops_group1); ldv_state_variable_10 = 1; } else { } if (ldv_state_variable_10 == 2) { ata_sff_qc_fill_rtf(ata_sff_port_ops_group1); ldv_state_variable_10 = 2; } else { } goto ldv_44251; case 7: ; if (ldv_state_variable_10 == 1) { ata_sff_drain_fifo(ata_sff_port_ops_group1); ldv_state_variable_10 = 1; } else { } if (ldv_state_variable_10 == 2) { ata_sff_drain_fifo(ata_sff_port_ops_group1); ldv_state_variable_10 = 2; } else { } goto ldv_44251; case 8: ; if (ldv_state_variable_10 == 1) { sata_sff_hardreset(ata_sff_port_ops_group0, ldvarg58, ldvarg57); ldv_state_variable_10 = 1; } else { } if (ldv_state_variable_10 == 2) { sata_sff_hardreset(ata_sff_port_ops_group0, ldvarg58, ldvarg57); ldv_state_variable_10 = 2; } else { } goto ldv_44251; case 9: ; if (ldv_state_variable_10 == 1) { ata_sff_freeze(ata_sff_port_ops_group2); ldv_state_variable_10 = 1; } else { } if (ldv_state_variable_10 == 2) { ata_sff_freeze(ata_sff_port_ops_group2); ldv_state_variable_10 = 2; } else { } goto ldv_44251; case 10: ; if (ldv_state_variable_10 == 1) { ata_sff_qc_issue(ata_sff_port_ops_group1); ldv_state_variable_10 = 1; } else { } if (ldv_state_variable_10 == 2) { ata_sff_qc_issue(ata_sff_port_ops_group1); ldv_state_variable_10 = 2; } else { } goto ldv_44251; case 11: ; if (ldv_state_variable_10 == 1) { ata_sff_softreset(ata_sff_port_ops_group0, ldvarg56, ldvarg55); ldv_state_variable_10 = 1; } else { } if (ldv_state_variable_10 == 2) { ata_sff_softreset(ata_sff_port_ops_group0, ldvarg56, ldvarg55); ldv_state_variable_10 = 2; } else { } goto ldv_44251; case 12: ; if (ldv_state_variable_10 == 1) { ata_sff_prereset(ata_sff_port_ops_group0, ldvarg54); ldv_state_variable_10 = 1; } else { } if (ldv_state_variable_10 == 2) { ata_sff_prereset(ata_sff_port_ops_group0, ldvarg54); ldv_state_variable_10 = 2; } else { } goto ldv_44251; case 13: ; if (ldv_state_variable_10 == 1) { ata_sff_postreset(ata_sff_port_ops_group0, ldvarg53); ldv_state_variable_10 = 1; } else { } if (ldv_state_variable_10 == 2) { ata_sff_postreset(ata_sff_port_ops_group0, ldvarg53); ldv_state_variable_10 = 2; } else { } goto ldv_44251; case 14: ; if (ldv_state_variable_10 == 1) { ata_sff_tf_load(ata_sff_port_ops_group2, ata_sff_port_ops_group3); ldv_state_variable_10 = 1; } else { } if (ldv_state_variable_10 == 2) { ata_sff_tf_load(ata_sff_port_ops_group2, ata_sff_port_ops_group3); ldv_state_variable_10 = 2; } else { } goto ldv_44251; case 15: ; if (ldv_state_variable_10 == 1) { ata_noop_qc_prep(ata_sff_port_ops_group1); ldv_state_variable_10 = 1; } else { } if (ldv_state_variable_10 == 2) { ata_noop_qc_prep(ata_sff_port_ops_group1); ldv_state_variable_10 = 2; } else { } goto ldv_44251; case 16: ; if (ldv_state_variable_10 == 1) { ata_sff_lost_interrupt(ata_sff_port_ops_group2); ldv_state_variable_10 = 1; } else { } if (ldv_state_variable_10 == 2) { ata_sff_lost_interrupt(ata_sff_port_ops_group2); ldv_state_variable_10 = 2; } else { } goto ldv_44251; case 17: ; if (ldv_state_variable_10 == 2) { ata_sff_tf_read(ata_sff_port_ops_group2, ldvarg52); ldv_state_variable_10 = 2; } else { } goto ldv_44251; case 18: ; if (ldv_state_variable_10 == 2) { ldv_release_10(); ldv_state_variable_10 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_44251; case 19: ; if (ldv_state_variable_10 == 1) { ldv_probe_10(); ldv_state_variable_10 = 2; ref_cnt = ref_cnt + 1; } else { } goto ldv_44251; default: ldv_stop(); } ldv_44251: ; return; } } void ldv_main_exported_9(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_state_variable_9 == 1) { ata_bmdma_error_handler(ata_bmdma_port_ops_group0); ldv_state_variable_9 = 1; } else { } goto ldv_44276; case 1: ; if (ldv_state_variable_9 == 1) { ata_bmdma_start(ata_bmdma_port_ops_group1); ldv_state_variable_9 = 1; } else { } goto ldv_44276; case 2: ; if (ldv_state_variable_9 == 1) { ata_bmdma_stop(ata_bmdma_port_ops_group1); ldv_state_variable_9 = 1; } else { } goto ldv_44276; case 3: ; if (ldv_state_variable_9 == 1) { ata_bmdma_setup(ata_bmdma_port_ops_group1); ldv_state_variable_9 = 1; } else { } goto ldv_44276; case 4: ; if (ldv_state_variable_9 == 1) { ata_bmdma_irq_clear(ata_bmdma_port_ops_group0); ldv_state_variable_9 = 1; } else { } goto ldv_44276; case 5: ; if (ldv_state_variable_9 == 1) { ata_bmdma_qc_issue(ata_bmdma_port_ops_group1); ldv_state_variable_9 = 1; } else { } goto ldv_44276; case 6: ; if (ldv_state_variable_9 == 1) { ata_bmdma_status(ata_bmdma_port_ops_group0); ldv_state_variable_9 = 1; } else { } goto ldv_44276; case 7: ; if (ldv_state_variable_9 == 1) { ata_bmdma_post_internal_cmd(ata_bmdma_port_ops_group1); ldv_state_variable_9 = 1; } else { } goto ldv_44276; case 8: ; if (ldv_state_variable_9 == 1) { ata_bmdma_port_start(ata_bmdma_port_ops_group0); ldv_state_variable_9 = 1; } else { } goto ldv_44276; case 9: ; if (ldv_state_variable_9 == 1) { ata_bmdma_qc_prep(ata_bmdma_port_ops_group1); ldv_state_variable_9 = 1; } else { } goto ldv_44276; default: ldv_stop(); } ldv_44276: ; return; } } bool ldv_queue_work_on_77(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_78(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_79(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_80(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_81(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_cancel_delayed_work_sync_82(struct delayed_work *ldv_func_arg1 ) { ldv_func_ret_type___3 ldv_func_res ; bool tmp ; { tmp = cancel_delayed_work_sync(ldv_func_arg1); ldv_func_res = tmp; disable_work_2(& ldv_func_arg1->work); return (ldv_func_res); } } void ldv_destroy_workqueue_83(struct workqueue_struct *ldv_func_arg1 ) { { destroy_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } __inline static long ldv__builtin_expect(long exp , long c ) ; bool ldv_queue_work_on_95(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_97(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_96(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; bool ldv_queue_delayed_work_on_99(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; void ldv_flush_workqueue_98(struct workqueue_struct *ldv_func_arg1 ) ; __inline static int ata_link_active(struct ata_link *link ) { unsigned int tmp ; { tmp = ata_tag_valid(link->active_tag); return (tmp != 0U || link->sactive != 0U); } } struct ata_port_operations const sata_pmp_port_ops ; int sata_pmp_qc_defer_cmd_switch(struct ata_queued_cmd *qc ) ; void sata_pmp_error_handler(struct ata_port *ap ) ; struct ata_port_operations const sata_pmp_port_ops = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & ata_std_prereset, 0, & sata_std_hardreset, & ata_std_postreset, & sata_pmp_error_handler, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & sata_port_ops}; static unsigned int sata_pmp_read(struct ata_link *link , int reg , u32 *r_val ) { struct ata_port *ap ; struct ata_device *pmp_dev ; struct ata_taskfile tf ; unsigned int err_mask ; { ap = link->ap; pmp_dev = (struct ata_device *)(& ap->link.device); ata_tf_init(pmp_dev, & tf); tf.command = 228U; tf.protocol = 1U; tf.flags = tf.flags | 7UL; tf.feature = (u8 )reg; tf.device = (u8 )link->pmp; err_mask = ata_exec_internal(pmp_dev, & tf, (u8 const *)0U, 3, (void *)0, 0U, 3000UL); if (err_mask != 0U) { return (err_mask); } else { } *r_val = (u32 )((((int )tf.nsect | ((int )tf.lbal << 8)) | ((int )tf.lbam << 16)) | ((int )tf.lbah << 24)); return (0U); } } static unsigned int sata_pmp_write(struct ata_link *link , int reg , u32 val ) { struct ata_port *ap ; struct ata_device *pmp_dev ; struct ata_taskfile tf ; unsigned int tmp ; { ap = link->ap; pmp_dev = (struct ata_device *)(& ap->link.device); ata_tf_init(pmp_dev, & tf); tf.command = 232U; tf.protocol = 1U; tf.flags = tf.flags | 7UL; tf.feature = (u8 )reg; tf.device = (u8 )link->pmp; tf.nsect = (u8 )val; tf.lbal = (u8 )(val >> 8); tf.lbam = (u8 )(val >> 16); tf.lbah = (u8 )(val >> 24); tmp = ata_exec_internal(pmp_dev, & tf, (u8 const *)0U, 3, (void *)0, 0U, 3000UL); return (tmp); } } int sata_pmp_qc_defer_cmd_switch(struct ata_queued_cmd *qc ) { struct ata_link *link ; struct ata_port *ap ; int tmp ; int tmp___0 ; { link = (qc->dev)->link; ap = link->ap; if ((unsigned long )ap->excl_link == (unsigned long )((struct ata_link *)0) || (unsigned long )ap->excl_link == (unsigned long )link) { if (ap->nr_active_links == 0) { qc->flags = qc->flags | 32UL; tmp = ata_std_qc_defer(qc); return (tmp); } else { tmp___0 = ata_link_active(link); if (tmp___0 != 0) { qc->flags = qc->flags | 32UL; tmp = ata_std_qc_defer(qc); return (tmp); } else { } } ap->excl_link = link; } else { } return (2); } } int sata_pmp_scr_read(struct ata_link *link , int reg , u32 *r_val ) { unsigned int err_mask ; { if (reg > 2) { return (-22); } else { } err_mask = sata_pmp_read(link, reg, r_val); if (err_mask != 0U) { ata_link_printk((struct ata_link const *)link, "\f", "failed to read SCR %d (Emask=0x%x)\n", reg, err_mask); return (-5); } else { } return (0); } } int sata_pmp_scr_write(struct ata_link *link , int reg , u32 val ) { unsigned int err_mask ; { if (reg > 2) { return (-22); } else { } err_mask = sata_pmp_write(link, reg, val); if (err_mask != 0U) { ata_link_printk((struct ata_link const *)link, "\f", "failed to write SCR %d (Emask=0x%x)\n", reg, err_mask); return (-5); } else { } return (0); } } int sata_pmp_set_lpm(struct ata_link *link , enum ata_lpm_policy policy , unsigned int hints ) { int tmp ; { tmp = sata_link_scr_lpm(link, policy, 1); return (tmp); } } static int sata_pmp_read_gscr(struct ata_device *dev , u32 *gscr ) { int gscr_to_read[7U] ; int i ; int reg ; unsigned int err_mask ; { gscr_to_read[0] = 0; gscr_to_read[1] = 1; gscr_to_read[2] = 2; gscr_to_read[3] = 32; gscr_to_read[4] = 33; gscr_to_read[5] = 64; gscr_to_read[6] = 96; i = 0; goto ldv_41364; ldv_41363: reg = gscr_to_read[i]; err_mask = sata_pmp_read(dev->link, reg, gscr + (unsigned long )reg); if (err_mask != 0U) { ata_dev_printk((struct ata_device const *)dev, "\v", "failed to read PMP GSCR[%d] (Emask=0x%x)\n", reg, err_mask); return (-5); } else { } i = i + 1; ldv_41364: ; if ((unsigned int )i <= 6U) { goto ldv_41363; } else { } return (0); } } static char const *sata_pmp_spec_rev_str(u32 const *gscr ) { u32 rev ; { rev = *(gscr + 1UL); if ((rev & 8U) != 0U) { return ("1.2"); } else { } if ((rev & 4U) != 0U) { return ("1.1"); } else { } if ((rev & 2U) != 0U) { return ("1.0"); } else { } return (""); } } static int sata_pmp_configure(struct ata_device *dev , int print_info ) { struct ata_port *ap ; u32 *gscr ; u16 vendor ; u16 devid ; unsigned int err_mask ; char const *reason ; int nr_ports ; int rc ; u32 reg ; char const *tmp ; { ap = (dev->link)->ap; gscr = (u32 *)(& dev->__annonCompField86.gscr); vendor = (u16 )*gscr; devid = (u16 )(*gscr >> 16); err_mask = 0U; nr_ports = (int )*(gscr + 2UL) & 15; if (nr_ports <= 0 || nr_ports > 15) { rc = -22; reason = "invalid nr_ports"; goto fail; } else { } if ((ap->flags & 262144UL) != 0UL && (*(gscr + 64UL) & 8U) != 0U) { dev->flags = dev->flags | 128UL; } else { } err_mask = sata_pmp_write(dev->link, 33, 65536U); if (err_mask != 0U) { rc = -5; reason = "failed to write GSCR_ERROR_EN"; goto fail; } else { } if ((unsigned int )vendor == 4245U && ((unsigned int )devid == 14118U || (unsigned int )devid == 14374U)) { err_mask = sata_pmp_read(& ap->link, 129, & reg); if (err_mask != 0U) { rc = -5; reason = "failed to read Sil3x26 Private Register"; goto fail; } else { } reg = reg & 4294967294U; err_mask = sata_pmp_write(& ap->link, 129, reg); if (err_mask != 0U) { rc = -5; reason = "failed to write Sil3x26 Private Register"; goto fail; } else { } } else { } if (print_info != 0) { tmp = sata_pmp_spec_rev_str((u32 const *)gscr); ata_dev_printk((struct ata_device const *)dev, "\016", "Port Multiplier %s, 0x%04x:0x%04x r%d, %d ports, feat 0x%x/0x%x\n", tmp, (int )vendor, (int )devid, (*(gscr + 1UL) >> 8) & 255U, nr_ports, *(gscr + 96UL), *(gscr + 64UL)); if ((dev->flags & 128UL) == 0UL) { ata_dev_printk((struct ata_device const *)dev, "\016", "Asynchronous notification not supported, hotplug won\'t work on fan-out ports. Use warm-plug instead.\n"); } else { } } else { } return (0); fail: ata_dev_printk((struct ata_device const *)dev, "\v", "failed to configure Port Multiplier (%s, Emask=0x%x)\n", reason, err_mask); return (rc); } } static int sata_pmp_init_links(struct ata_port *ap , int nr_ports ) { struct ata_link *pmp_link ; int i ; int err ; void *tmp ; struct ata_link *link ; struct ata_eh_context *ehc ; { pmp_link = ap->pmp_link; if ((unsigned long )pmp_link == (unsigned long )((struct ata_link *)0)) { tmp = kzalloc(105960UL, 16U); pmp_link = (struct ata_link *)tmp; if ((unsigned long )pmp_link == (unsigned long )((struct ata_link *)0)) { return (-12); } else { } i = 0; goto ldv_41392; ldv_41391: ata_link_init(ap, pmp_link + (unsigned long )i, i); i = i + 1; ldv_41392: ; if (i <= 14) { goto ldv_41391; } else { } ap->pmp_link = pmp_link; i = 0; goto ldv_41396; ldv_41395: err = ata_tlink_add(pmp_link + (unsigned long )i); if (err != 0) { goto err_tlink; } else { } i = i + 1; ldv_41396: ; if (i <= 14) { goto ldv_41395; } else { } } else { } i = 0; goto ldv_41401; ldv_41400: link = pmp_link + (unsigned long )i; ehc = & link->eh_context; link->flags = 0U; ehc->i.probe_mask = ehc->i.probe_mask | 3U; ehc->i.action = ehc->i.action | 6U; i = i + 1; ldv_41401: ; if (i < nr_ports) { goto ldv_41400; } else { } return (0); err_tlink: ; goto ldv_41404; ldv_41403: ata_tlink_delete(pmp_link + (unsigned long )i); ldv_41404: i = i - 1; if (i >= 0) { goto ldv_41403; } else { } kfree((void const *)pmp_link); ap->pmp_link = (struct ata_link *)0; return (err); } } static void sata_pmp_quirks(struct ata_port *ap ) { u32 *gscr ; u16 vendor ; u16 devid ; struct ata_link *link ; { gscr = (u32 *)(& ((struct ata_device *)(& ap->link.device))->__annonCompField86.gscr); vendor = (u16 )*gscr; devid = (u16 )(*gscr >> 16); if ((unsigned int )vendor == 4245U && ((unsigned int )devid == 14118U || (unsigned int )devid == 14374U)) { link = ata_link_next((struct ata_link *)0, ap, 0); goto ldv_41414; ldv_41413: link->flags = link->flags | 256U; if (link->pmp <= 4) { link->flags = link->flags | 12U; } else { } if (link->pmp == 5) { link->flags = link->flags | 20U; } else { } link = ata_link_next(link, ap, 0); ldv_41414: ; if ((unsigned long )link != (unsigned long )((struct ata_link *)0)) { goto ldv_41413; } else { } } else if ((unsigned int )vendor == 4245U && (unsigned int )devid == 18211U) { link = ata_link_next((struct ata_link *)0, ap, 0); goto ldv_41417; ldv_41416: link->flags = link->flags | 268U; link = ata_link_next(link, ap, 0); ldv_41417: ; if ((unsigned long )link != (unsigned long )((struct ata_link *)0)) { goto ldv_41416; } else { } } else if ((unsigned int )vendor == 4245U && (unsigned int )devid == 18214U) { link = ata_link_next((struct ata_link *)0, ap, 0); goto ldv_41420; ldv_41419: link->flags = link->flags | 256U; if (link->pmp <= 5) { link->flags = link->flags | 12U; } else { } if (link->pmp == 6) { link->flags = link->flags | 20U; } else { } link = ata_link_next(link, ap, 0); ldv_41420: ; if ((unsigned long )link != (unsigned long )((struct ata_link *)0)) { goto ldv_41419; } else { } } else if ((unsigned int )vendor == 4245U && ((((unsigned int )devid == 22307U || (unsigned int )devid == 22323U) || (unsigned int )devid == 22324U) || (unsigned int )devid == 22340U)) { (ap->pmp_link + ((unsigned long )ap->nr_pmp_links + 0xffffffffffffffffUL))->flags = (ap->pmp_link + ((unsigned long )ap->nr_pmp_links + 0xffffffffffffffffUL))->flags | 32U; } else if ((unsigned int )vendor == 6523U && ((unsigned int )devid == 9042U || (unsigned int )devid == 805U)) { link = ata_link_next((struct ata_link *)0, ap, 0); goto ldv_41423; ldv_41422: link->flags = link->flags | 268U; link = ata_link_next(link, ap, 0); ldv_41423: ; if ((unsigned long )link != (unsigned long )((struct ata_link *)0)) { goto ldv_41422; } else { } } else { } return; } } int sata_pmp_attach(struct ata_device *dev ) { struct ata_link *link ; struct ata_port *ap ; unsigned long flags ; struct ata_link *tlink ; int rc ; bool tmp ; int tmp___0 ; int tmp___1 ; int __ret_warn_on ; long tmp___2 ; raw_spinlock_t *tmp___3 ; int __ret_warn_on___0 ; long tmp___4 ; { link = dev->link; ap = link->ap; tmp = sata_pmp_supported(ap); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { ata_dev_printk((struct ata_device const *)dev, "\v", "host does not support Port Multiplier\n"); return (-22); } else { } tmp___1 = ata_is_host_link((struct ata_link const *)link); if (tmp___1 == 0) { ata_dev_printk((struct ata_device const *)dev, "\v", "Port Multipliers cannot be nested\n"); return (-22); } else { } if (dev->devno != 0U) { ata_dev_printk((struct ata_device const *)dev, "\v", "Port Multiplier must be the first device\n"); return (-22); } else { } __ret_warn_on = link->pmp != 0; tmp___2 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___2 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-pmp.c", 503); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); link->pmp = 15; rc = sata_pmp_read_gscr(dev, (u32 *)(& dev->__annonCompField86.gscr)); if (rc != 0) { goto fail; } else { } rc = sata_pmp_configure(dev, 1); if (rc != 0) { goto fail; } else { } rc = sata_pmp_init_links(ap, (int )dev->__annonCompField86.gscr[2] & 15); if (rc != 0) { ata_dev_printk((struct ata_device const *)dev, "\016", "failed to initialize PMP links\n"); goto fail; } else { } tmp___3 = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp___3); __ret_warn_on___0 = ap->nr_pmp_links != 0; tmp___4 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___4 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-pmp.c", 524); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); ap->nr_pmp_links = (int )dev->__annonCompField86.gscr[2] & 15; spin_unlock_irqrestore(ap->lock, flags); sata_pmp_quirks(ap); if ((unsigned long )(ap->ops)->pmp_attach != (unsigned long )((void (*)(struct ata_port * ))0)) { (*((ap->ops)->pmp_attach))(ap); } else { } tlink = ata_link_next((struct ata_link *)0, ap, 0); goto ldv_41442; ldv_41441: sata_link_init_spd(tlink); tlink = ata_link_next(tlink, ap, 0); ldv_41442: ; if ((unsigned long )tlink != (unsigned long )((struct ata_link *)0)) { goto ldv_41441; } else { } return (0); fail: link->pmp = 0; return (rc); } } static void sata_pmp_detach(struct ata_device *dev ) { struct ata_link *link ; struct ata_port *ap ; struct ata_link *tlink ; unsigned long flags ; int __ret_warn_on ; int tmp ; long tmp___0 ; raw_spinlock_t *tmp___1 ; { link = dev->link; ap = link->ap; ata_dev_printk((struct ata_device const *)dev, "\016", "Port Multiplier detaching\n"); tmp = ata_is_host_link((struct ata_link const *)link); __ret_warn_on = (tmp == 0 || dev->devno != 0U) || link->pmp != 15; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/13180/dscv_tempdir/dscv/ri/08_1a/drivers/ata/libata-pmp.c", 563); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); if ((unsigned long )(ap->ops)->pmp_detach != (unsigned long )((void (*)(struct ata_port * ))0)) { (*((ap->ops)->pmp_detach))(ap); } else { } tlink = ata_link_next((struct ata_link *)0, ap, 0); goto ldv_41454; ldv_41453: ata_eh_detach_dev((struct ata_device *)(& tlink->device)); tlink = ata_link_next(tlink, ap, 0); ldv_41454: ; if ((unsigned long )tlink != (unsigned long )((struct ata_link *)0)) { goto ldv_41453; } else { } tmp___1 = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp___1); ap->nr_pmp_links = 0; link->pmp = 0; spin_unlock_irqrestore(ap->lock, flags); return; } } static int sata_pmp_same_pmp(struct ata_device *dev , u32 const *new_gscr ) { u32 const *old_gscr ; u16 old_vendor ; u16 new_vendor ; u16 old_devid ; u16 new_devid ; int old_nr_ports ; int new_nr_ports ; { old_gscr = (u32 const *)(& dev->__annonCompField86.gscr); old_vendor = (u16 )*old_gscr; new_vendor = (u16 )*new_gscr; old_devid = (u16 )(*old_gscr >> 16); new_devid = (u16 )(*new_gscr >> 16); old_nr_ports = (int )*(old_gscr + 2UL) & 15; new_nr_ports = (int )*(new_gscr + 2UL) & 15; if ((int )old_vendor != (int )new_vendor) { ata_dev_printk((struct ata_device const *)dev, "\016", "Port Multiplier vendor mismatch \'0x%x\' != \'0x%x\'\n", (int )old_vendor, (int )new_vendor); return (0); } else { } if ((int )old_devid != (int )new_devid) { ata_dev_printk((struct ata_device const *)dev, "\016", "Port Multiplier device ID mismatch \'0x%x\' != \'0x%x\'\n", (int )old_devid, (int )new_devid); return (0); } else { } if (old_nr_ports != new_nr_ports) { ata_dev_printk((struct ata_device const *)dev, "\016", "Port Multiplier nr_ports mismatch \'0x%x\' != \'0x%x\'\n", old_nr_ports, new_nr_ports); return (0); } else { } return (1); } } static int sata_pmp_revalidate(struct ata_device *dev , unsigned int new_class ) { struct ata_link *link ; struct ata_port *ap ; u32 *gscr ; int rc ; unsigned int tmp ; unsigned int tmp___0 ; int tmp___1 ; { link = dev->link; ap = link->ap; gscr = (u32 *)(& ap->sector_buf); ata_eh_about_to_do(link, (struct ata_device *)0, 1U); tmp = ata_dev_enabled((struct ata_device const *)dev); if (tmp == 0U) { rc = -19; goto fail; } else { } tmp___0 = ata_class_enabled(new_class); if (tmp___0 != 0U && new_class != 5U) { rc = -19; goto fail; } else { } rc = sata_pmp_read_gscr(dev, gscr); if (rc != 0) { goto fail; } else { } tmp___1 = sata_pmp_same_pmp(dev, (u32 const *)gscr); if (tmp___1 == 0) { rc = -19; goto fail; } else { } memcpy((void *)(& dev->__annonCompField86.gscr), (void const *)gscr, 512UL); rc = sata_pmp_configure(dev, 0); if (rc != 0) { goto fail; } else { } ata_eh_done(link, (struct ata_device *)0, 1U); return (0); fail: ata_dev_printk((struct ata_device const *)dev, "\v", "PMP revalidation failed (errno=%d)\n", rc); return (rc); } } static int sata_pmp_revalidate_quick(struct ata_device *dev ) { unsigned int err_mask ; u32 prod_id ; { err_mask = sata_pmp_read(dev->link, 0, & prod_id); if (err_mask != 0U) { ata_dev_printk((struct ata_device const *)dev, "\v", "failed to read PMP product ID (Emask=0x%x)\n", err_mask); return (-5); } else { } if (dev->__annonCompField86.gscr[0] != prod_id) { ata_dev_printk((struct ata_device const *)dev, "\v", "PMP product ID mismatch\n"); return (-5); } else { } return (0); } } static int sata_pmp_eh_recover_pmp(struct ata_port *ap , int (*prereset)(struct ata_link * , unsigned long ) , int (*softreset)(struct ata_link * , unsigned int * , unsigned long ) , int (*hardreset)(struct ata_link * , unsigned int * , unsigned long ) , void (*postreset)(struct ata_link * , unsigned int * ) ) { struct ata_link *link ; struct ata_eh_context *ehc ; struct ata_device *dev ; int tries ; int detach ; int rc ; int reval_failed ; struct ata_link *tlink ; struct ata_eh_context *ehc___0 ; int _min1 ; int _min2 ; { link = & ap->link; ehc = & link->eh_context; dev = (struct ata_device *)(& link->device); tries = 5; detach = 0; rc = 0; reval_failed = 0; if ((dev->flags & 16777216UL) != 0UL) { detach = 1; goto fail; } else { } retry: ehc->classes[0] = 0U; if ((ehc->i.action & 6U) != 0U) { rc = ata_eh_reset(link, 0, prereset, softreset, hardreset, postreset); if (rc != 0) { ata_link_printk((struct ata_link const *)link, "\v", "failed to reset PMP, giving up\n"); goto fail; } else { } tlink = ata_link_next((struct ata_link *)0, ap, 0); goto ldv_41503; ldv_41502: ehc___0 = & tlink->eh_context; ehc___0->i.probe_mask = ehc___0->i.probe_mask | 3U; ehc___0->i.action = ehc___0->i.action | 6U; tlink = ata_link_next(tlink, ap, 0); ldv_41503: ; if ((unsigned long )tlink != (unsigned long )((struct ata_link *)0)) { goto ldv_41502; } else { } } else { } if ((int )ehc->i.action & 1) { rc = sata_pmp_revalidate(dev, ehc->classes[0]); } else { rc = sata_pmp_revalidate_quick(dev); } if (rc != 0) { tries = tries - 1; if (rc == -19) { ehc->i.probe_mask = ehc->i.probe_mask | 3U; detach = 1; _min1 = tries; _min2 = 2; tries = _min1 < _min2 ? _min1 : _min2; } else { } if (tries != 0) { if (reval_failed != 0) { sata_down_spd_limit(link, 0U); } else { reval_failed = 1; } ehc->i.action = ehc->i.action | 6U; goto retry; } else { ata_dev_printk((struct ata_device const *)dev, "\v", "failed to recover PMP after %d tries, giving up\n", 5); goto fail; } } else { } ehc->i.flags = 0U; return (0); fail: sata_pmp_detach(dev); if (detach != 0) { ata_eh_detach_dev(dev); } else { ata_dev_disable(dev); } return (rc); } } static int sata_pmp_eh_handle_disabled_links(struct ata_port *ap ) { struct ata_link *link ; unsigned long flags ; int rc ; raw_spinlock_t *tmp ; unsigned long tmp___0 ; raw_spinlock_t *tmp___1 ; { tmp = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp); link = ata_link_next((struct ata_link *)0, ap, 0); goto ldv_41522; ldv_41521: ; if ((link->flags & 64U) == 0U) { goto ldv_41517; } else { } spin_unlock_irqrestore(ap->lock, flags); tmp___0 = ata_deadline(jiffies, 5000UL); sata_link_hardreset(link, (unsigned long const *)(& sata_deb_timing_normal), tmp___0, (bool *)0, (int (*)(struct ata_link * ))0); rc = sata_scr_write(link, 1, 65536U); if (rc != 0) { ata_link_printk((struct ata_link const *)link, "\v", "failed to clear SError.N (errno=%d)\n", rc); return (rc); } else { } tmp___1 = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp___1); ldv_41517: link = ata_link_next(link, ap, 0); ldv_41522: ; if ((unsigned long )link != (unsigned long )((struct ata_link *)0)) { goto ldv_41521; } else { } spin_unlock_irqrestore(ap->lock, flags); return (0); } } static int sata_pmp_handle_link_fail(struct ata_link *link , int *link_tries ) { struct ata_port *ap ; unsigned long flags ; raw_spinlock_t *tmp ; { ap = link->ap; if (*(link_tries + (unsigned long )link->pmp) != 0) { *(link_tries + (unsigned long )link->pmp) = *(link_tries + (unsigned long )link->pmp) - 1; if (*(link_tries + (unsigned long )link->pmp) != 0) { return (1); } else { } } else { } if ((link->flags & 64U) == 0U) { ata_link_printk((struct ata_link const *)link, "\f", "failed to recover link after %d tries, disabling\n", 3); tmp = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp); link->flags = link->flags | 64U; spin_unlock_irqrestore(ap->lock, flags); } else { } ata_dev_disable((struct ata_device *)(& link->device)); link->eh_context.i.action = 0U; return (0); } } static int sata_pmp_eh_recover(struct ata_port *ap ) { struct ata_port_operations *ops ; int pmp_tries ; int link_tries[15U] ; struct ata_link *pmp_link ; struct ata_device *pmp_dev ; struct ata_eh_context *pmp_ehc ; u32 *gscr ; struct ata_link *link ; struct ata_device *dev ; unsigned int err_mask ; u32 gscr_error ; u32 sntf ; int cnt ; int rc ; bool tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; bool tmp___3 ; int tmp___4 ; { ops = ap->ops; pmp_link = & ap->link; pmp_dev = (struct ata_device *)(& pmp_link->device); pmp_ehc = & pmp_link->eh_context; gscr = (u32 *)(& pmp_dev->__annonCompField86.gscr); pmp_tries = 5; link = ata_link_next((struct ata_link *)0, ap, 0); goto ldv_41551; ldv_41550: link_tries[link->pmp] = 3; link = ata_link_next(link, ap, 0); ldv_41551: ; if ((unsigned long )link != (unsigned long )((struct ata_link *)0)) { goto ldv_41550; } else { } retry: tmp = sata_pmp_attached(ap); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { rc = ata_eh_recover(ap, ops->prereset, ops->softreset, ops->hardreset, ops->postreset, (struct ata_link **)0); if (rc != 0) { dev = ata_dev_next((struct ata_device *)0, & ap->link, 2); goto ldv_41555; ldv_41554: ata_dev_disable(dev); dev = ata_dev_next(dev, & ap->link, 2); ldv_41555: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_41554; } else { } return (rc); } else { } if (pmp_dev->class != 5U) { return (0); } else { } link = ata_link_next((struct ata_link *)0, ap, 0); goto ldv_41558; ldv_41557: link_tries[link->pmp] = 3; link = ata_link_next(link, ap, 0); ldv_41558: ; if ((unsigned long )link != (unsigned long )((struct ata_link *)0)) { goto ldv_41557; } else { } } else { } rc = sata_pmp_eh_recover_pmp(ap, ops->prereset, ops->softreset, ops->hardreset, ops->postreset); if (rc != 0) { goto pmp_fail; } else { } if ((*(gscr + 96UL) & 8U) != 0U) { *(gscr + 96UL) = *(gscr + 96UL) & 4294967287U; err_mask = sata_pmp_write(pmp_link, 96, *(gscr + 96UL)); if (err_mask != 0U) { ata_link_printk((struct ata_link const *)pmp_link, "\f", "failed to disable NOTIFY (err_mask=0x%x)\n", err_mask); goto pmp_fail; } else { } } else { } rc = sata_pmp_eh_handle_disabled_links(ap); if (rc != 0) { goto pmp_fail; } else { } rc = ata_eh_recover(ap, ops->pmp_prereset, ops->pmp_softreset, ops->pmp_hardreset, ops->pmp_postreset, & link); if (rc != 0) { goto link_fail; } else { } rc = sata_scr_read(& ap->link, 4, & sntf); if (rc == 0) { sata_scr_write(& ap->link, 4, sntf); } else { } link = ata_link_next((struct ata_link *)0, ap, 0); goto ldv_41563; ldv_41562: ; if ((unsigned int )link->lpm_policy > 1U) { return (0); } else { } link = ata_link_next(link, ap, 0); ldv_41563: ; if ((unsigned long )link != (unsigned long )((struct ata_link *)0)) { goto ldv_41562; } else { } if ((pmp_dev->flags & 128UL) != 0UL) { *(gscr + 96UL) = *(gscr + 96UL) | 8U; err_mask = sata_pmp_write(pmp_link, 96, *(gscr + 96UL)); if (err_mask != 0U) { ata_dev_printk((struct ata_device const *)pmp_dev, "\v", "failed to write PMP_FEAT_EN (Emask=0x%x)\n", err_mask); rc = -5; goto pmp_fail; } else { } } else { } err_mask = sata_pmp_read(pmp_link, 32, & gscr_error); if (err_mask != 0U) { ata_dev_printk((struct ata_device const *)pmp_dev, "\v", "failed to read PMP_GSCR_ERROR (Emask=0x%x)\n", err_mask); rc = -5; goto pmp_fail; } else { } cnt = 0; link = ata_link_next((struct ata_link *)0, ap, 0); goto ldv_41567; ldv_41566: ; if (((u32 )(1 << link->pmp) & gscr_error) == 0U) { goto ldv_41565; } else { } tmp___1 = sata_pmp_handle_link_fail(link, (int *)(& link_tries)); if (tmp___1 != 0) { ata_ehi_hotplugged(& link->eh_context.i); cnt = cnt + 1; } else { ata_link_printk((struct ata_link const *)link, "\f", "PHY status changed but maxed out on retries, giving up\n"); ata_link_printk((struct ata_link const *)link, "\f", "Manually issue scan to resume this link\n"); } ldv_41565: link = ata_link_next(link, ap, 0); ldv_41567: ; if ((unsigned long )link != (unsigned long )((struct ata_link *)0)) { goto ldv_41566; } else { } if (cnt != 0) { ata_port_printk((struct ata_port const *)ap, "\016", "PMP SError.N set for some ports, repeating recovery\n"); goto retry; } else { } return (0); link_fail: tmp___2 = sata_pmp_handle_link_fail(link, (int *)(& link_tries)); if (tmp___2 != 0) { pmp_ehc->i.action = pmp_ehc->i.action | 6U; goto retry; } else { } pmp_fail: ; if ((ap->pflags & 512U) != 0U) { return (rc); } else { } tmp___3 = sata_pmp_attached(ap); if (tmp___3) { tmp___4 = 0; } else { tmp___4 = 1; } if (tmp___4) { goto retry; } else { } pmp_tries = pmp_tries - 1; if (pmp_tries != 0) { pmp_ehc->i.action = pmp_ehc->i.action | 6U; goto retry; } else { } ata_port_printk((struct ata_port const *)ap, "\v", "failed to recover PMP after %d tries, giving up\n", 5); sata_pmp_detach(pmp_dev); ata_dev_disable(pmp_dev); return (rc); } } void sata_pmp_error_handler(struct ata_port *ap ) { { ata_eh_autopsy(ap); ata_eh_report(ap); sata_pmp_eh_recover(ap); ata_eh_finish(ap); return; } } static char const __kstrtab_sata_pmp_port_ops[18U] = { 's', 'a', 't', 'a', '_', 'p', 'm', 'p', '_', 'p', 'o', 'r', 't', '_', 'o', 'p', 's', '\000'}; struct kernel_symbol const __ksymtab_sata_pmp_port_ops ; struct kernel_symbol const __ksymtab_sata_pmp_port_ops = {(unsigned long )(& sata_pmp_port_ops), (char const *)(& __kstrtab_sata_pmp_port_ops)}; static char const __kstrtab_sata_pmp_qc_defer_cmd_switch[29U] = { 's', 'a', 't', 'a', '_', 'p', 'm', 'p', '_', 'q', 'c', '_', 'd', 'e', 'f', 'e', 'r', '_', 'c', 'm', 'd', '_', 's', 'w', 'i', 't', 'c', 'h', '\000'}; struct kernel_symbol const __ksymtab_sata_pmp_qc_defer_cmd_switch ; struct kernel_symbol const __ksymtab_sata_pmp_qc_defer_cmd_switch = {(unsigned long )(& sata_pmp_qc_defer_cmd_switch), (char const *)(& __kstrtab_sata_pmp_qc_defer_cmd_switch)}; static char const __kstrtab_sata_pmp_error_handler[23U] = { 's', 'a', 't', 'a', '_', 'p', 'm', 'p', '_', 'e', 'r', 'r', 'o', 'r', '_', 'h', 'a', 'n', 'd', 'l', 'e', 'r', '\000'}; struct kernel_symbol const __ksymtab_sata_pmp_error_handler ; struct kernel_symbol const __ksymtab_sata_pmp_error_handler = {(unsigned long )(& sata_pmp_error_handler), (char const *)(& __kstrtab_sata_pmp_error_handler)}; void ldv_initialize_ata_port_operations_5(void) { void *tmp ; { tmp = ldv_init_zalloc(7064UL); sata_pmp_port_ops_group0 = (struct ata_link *)tmp; return; } } void ldv_initialize_ata_port_operations_4(void) { void *tmp ; { tmp = ldv_init_zalloc(7064UL); sata_pmp_port_ops_group0 = (struct ata_link *)tmp; return; } } void ldv_main_exported_4(void) { unsigned long ldvarg132 ; unsigned int *ldvarg133 ; void *tmp ; struct ata_port *ldvarg135 ; void *tmp___0 ; unsigned int *ldvarg134 ; void *tmp___1 ; unsigned long ldvarg131 ; int tmp___2 ; { tmp = ldv_init_zalloc(4UL); ldvarg133 = (unsigned int *)tmp; tmp___0 = ldv_init_zalloc(18112UL); ldvarg135 = (struct ata_port *)tmp___0; tmp___1 = ldv_init_zalloc(4UL); ldvarg134 = (unsigned int *)tmp___1; ldv_memset((void *)(& ldvarg132), 0, 8UL); ldv_memset((void *)(& ldvarg131), 0, 8UL); tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_4 == 1) { sata_pmp_error_handler(ldvarg135); ldv_state_variable_4 = 1; } else { } goto ldv_41607; case 1: ; if (ldv_state_variable_4 == 1) { ata_std_postreset(sata_pmp_port_ops_group0, ldvarg134); ldv_state_variable_4 = 1; } else { } goto ldv_41607; case 2: ; if (ldv_state_variable_4 == 1) { sata_std_hardreset(sata_pmp_port_ops_group0, ldvarg133, ldvarg132); ldv_state_variable_4 = 1; } else { } goto ldv_41607; case 3: ; if (ldv_state_variable_4 == 1) { ata_std_prereset(sata_pmp_port_ops_group0, ldvarg131); ldv_state_variable_4 = 1; } else { } goto ldv_41607; default: ldv_stop(); } ldv_41607: ; return; } } void ldv_main_exported_5(void) { unsigned int *ldvarg148 ; void *tmp ; unsigned int *ldvarg149 ; void *tmp___0 ; unsigned long ldvarg146 ; struct ata_port *ldvarg150 ; void *tmp___1 ; unsigned long ldvarg147 ; int tmp___2 ; { tmp = ldv_init_zalloc(4UL); ldvarg148 = (unsigned int *)tmp; tmp___0 = ldv_init_zalloc(4UL); ldvarg149 = (unsigned int *)tmp___0; tmp___1 = ldv_init_zalloc(18112UL); ldvarg150 = (struct ata_port *)tmp___1; ldv_memset((void *)(& ldvarg146), 0, 8UL); ldv_memset((void *)(& ldvarg147), 0, 8UL); tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_5 == 1) { sata_pmp_error_handler(ldvarg150); ldv_state_variable_5 = 1; } else { } goto ldv_41621; case 1: ; if (ldv_state_variable_5 == 1) { ata_std_postreset(sata_pmp_port_ops_group0, ldvarg149); ldv_state_variable_5 = 1; } else { } goto ldv_41621; case 2: ; if (ldv_state_variable_5 == 1) { sata_std_hardreset(sata_pmp_port_ops_group0, ldvarg148, ldvarg147); ldv_state_variable_5 = 1; } else { } goto ldv_41621; case 3: ; if (ldv_state_variable_5 == 1) { ata_std_prereset(sata_pmp_port_ops_group0, ldvarg146); ldv_state_variable_5 = 1; } else { } goto ldv_41621; default: ldv_stop(); } ldv_41621: ; return; } } bool ldv_queue_work_on_95(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_96(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_97(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_98(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_99(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_109(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_111(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_110(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; bool ldv_queue_delayed_work_on_113(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; void ldv_flush_workqueue_112(struct workqueue_struct *ldv_func_arg1 ) ; extern int kobject_uevent_env(struct kobject * , enum kobject_action , char ** ) ; extern void set_primary_fwnode(struct device * , struct fwnode_handle * ) ; extern acpi_status acpi_evaluate_object(acpi_handle , acpi_string , struct acpi_object_list * , struct acpi_buffer * ) ; __inline static bool is_acpi_node(struct fwnode_handle *fwnode ) { { return ((bool )((unsigned long )fwnode != (unsigned long )((struct fwnode_handle *)0) && (unsigned int )fwnode->type == 2U)); } } __inline static struct acpi_device *to_acpi_node(struct fwnode_handle *fwnode ) { struct fwnode_handle const *__mptr ; struct acpi_device *tmp___0 ; bool tmp___1 ; { tmp___1 = is_acpi_node(fwnode); if ((int )tmp___1) { __mptr = (struct fwnode_handle const *)fwnode; tmp___0 = (struct acpi_device *)__mptr + 0xfffffffffffffff0UL; } else { tmp___0 = (struct acpi_device *)0; } return (tmp___0); } } __inline static struct fwnode_handle *acpi_fwnode_handle(struct acpi_device *adev ) { { return (& adev->fwnode); } } extern void acpi_initialize_hp_context(struct acpi_device * , struct acpi_hotplug_context * , int (*)(struct acpi_device * , u32 ) , void (*)(struct acpi_device * , u32 ) ) ; extern int acpi_bus_set_power(acpi_handle , int ) ; extern struct acpi_device *acpi_find_child_device(struct acpi_device * , u64 , bool ) ; extern int acpi_pm_device_sleep_state(struct device * , int * , int ) ; __inline static acpi_handle acpi_device_handle(struct acpi_device *adev ) { { return ((unsigned long )adev != (unsigned long )((struct acpi_device *)0) ? adev->handle : (acpi_handle )0); } } __inline static void acpi_preset_companion(struct device *dev , struct acpi_device *parent , u64 addr ) { struct acpi_device *tmp___0 ; struct fwnode_handle *tmp___1 ; struct fwnode_handle *tmp___2 ; struct acpi_device *tmp___3 ; { tmp___3 = acpi_find_child_device(parent, addr, 0); if ((unsigned long )tmp___3 != (unsigned long )((struct acpi_device *)0)) { tmp___0 = acpi_find_child_device(parent, addr, 0); tmp___1 = acpi_fwnode_handle(tmp___0); tmp___2 = tmp___1; } else { tmp___2 = (struct fwnode_handle *)0; } set_primary_fwnode(dev, tmp___2); return; } } __inline static struct ata_acpi_gtm const *ata_acpi_init_gtm(struct ata_port *ap ) { { if ((ap->pflags & 524288U) != 0U) { return ((struct ata_acpi_gtm const *)(& ap->__acpi_init_gtm)); } else { } return ((struct ata_acpi_gtm const *)0); } } int ata_acpi_stm(struct ata_port *ap , struct ata_acpi_gtm const *stm ) ; int ata_acpi_gtm(struct ata_port *ap , struct ata_acpi_gtm *gtm ) ; unsigned long ata_acpi_gtm_xfermask(struct ata_device *dev , struct ata_acpi_gtm const *gtm ) ; int ata_acpi_cbl_80wire(struct ata_port *ap , struct ata_acpi_gtm const *gtm ) ; acpi_handle ata_dev_acpi_handle(struct ata_device *dev ) ; bool zpodd_zpready(struct ata_device *dev ) ; void zpodd_enable_run_wake(struct ata_device *dev ) ; void zpodd_disable_run_wake(struct ata_device *dev ) ; unsigned int ata_acpi_gtf_filter = 7U; static void ata_acpi_clear_gtf(struct ata_device *dev ) { { kfree((void const *)dev->gtf_cache); dev->gtf_cache = (union acpi_object *)0; return; } } acpi_handle ata_dev_acpi_handle(struct ata_device *dev ) { struct acpi_device *tmp ; acpi_handle tmp___0 ; acpi_handle tmp___1 ; { if ((dev->flags & 268435456UL) == 0UL) { tmp = to_acpi_node(dev->tdev.fwnode); tmp___0 = acpi_device_handle(tmp); tmp___1 = tmp___0; } else { tmp___1 = (acpi_handle )0; } return (tmp___1); } } static void ata_acpi_detach_device(struct ata_port *ap , struct ata_device *dev ) { struct ata_link *tlink ; struct ata_device *tdev ; { if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { dev->flags = dev->flags | 16777216UL; } else { tlink = ata_link_next((struct ata_link *)0, ap, 0); goto ldv_43504; ldv_43503: tdev = ata_dev_next((struct ata_device *)0, tlink, 2); goto ldv_43501; ldv_43500: tdev->flags = tdev->flags | 16777216UL; tdev = ata_dev_next(tdev, tlink, 2); ldv_43501: ; if ((unsigned long )tdev != (unsigned long )((struct ata_device *)0)) { goto ldv_43500; } else { } tlink = ata_link_next(tlink, ap, 0); ldv_43504: ; if ((unsigned long )tlink != (unsigned long )((struct ata_link *)0)) { goto ldv_43503; } else { } } ata_port_schedule_eh(ap); return; } } static void ata_acpi_handle_hotplug(struct ata_port *ap , struct ata_device *dev , u32 event ) { struct ata_eh_info *ehi ; int wait ; unsigned long flags ; raw_spinlock_t *tmp ; { ehi = & ap->link.eh_info; wait = 0; tmp = spinlock_check(ap->lock); flags = _raw_spin_lock_irqsave(tmp); switch (event) { case 0U: ; case 1U: ata_ehi_push_desc(ehi, "ACPI event"); ata_ehi_hotplugged(ehi); ata_port_freeze(ap); goto ldv_43519; case 3U: ata_ehi_push_desc(ehi, "ACPI event"); ata_acpi_detach_device(ap, dev); wait = 1; goto ldv_43519; } ldv_43519: spin_unlock_irqrestore(ap->lock, flags); if (wait != 0) { ata_port_wait_eh(ap); } else { } return; } } static int ata_acpi_dev_notify_dock(struct acpi_device *adev , u32 event ) { struct ata_device *dev ; struct acpi_hotplug_context const *__mptr ; { __mptr = (struct acpi_hotplug_context const *)adev->hp; dev = ((struct ata_acpi_hotplug_context *)__mptr)->data.dev; ata_acpi_handle_hotplug((dev->link)->ap, dev, event); return (0); } } static int ata_acpi_ap_notify_dock(struct acpi_device *adev , u32 event ) { struct acpi_hotplug_context const *__mptr ; { __mptr = (struct acpi_hotplug_context const *)adev->hp; ata_acpi_handle_hotplug(((struct ata_acpi_hotplug_context *)__mptr)->data.ap, (struct ata_device *)0, event); return (0); } } static void ata_acpi_uevent(struct ata_port *ap , struct ata_device *dev , u32 event ) { struct kobject *kobj ; char event_string[20U] ; char *envp[2U] ; { kobj = (struct kobject *)0; envp[0] = (char *)(& event_string); envp[1] = (char *)0; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { if ((unsigned long )dev->sdev != (unsigned long )((struct scsi_device *)0)) { kobj = & (dev->sdev)->sdev_gendev.kobj; } else { } } else { kobj = & (ap->dev)->kobj; } if ((unsigned long )kobj != (unsigned long )((struct kobject *)0)) { snprintf((char *)(& event_string), 20UL, "BAY_EVENT=%d", event); kobject_uevent_env(kobj, 2, (char **)(& envp)); } else { } return; } } static void ata_acpi_ap_uevent(struct acpi_device *adev , u32 event ) { struct acpi_hotplug_context const *__mptr ; { __mptr = (struct acpi_hotplug_context const *)adev->hp; ata_acpi_uevent(((struct ata_acpi_hotplug_context *)__mptr)->data.ap, (struct ata_device *)0, event); return; } } static void ata_acpi_dev_uevent(struct acpi_device *adev , u32 event ) { struct ata_device *dev ; struct acpi_hotplug_context const *__mptr ; { __mptr = (struct acpi_hotplug_context const *)adev->hp; dev = ((struct ata_acpi_hotplug_context *)__mptr)->data.dev; ata_acpi_uevent((dev->link)->ap, dev, event); return; } } void ata_acpi_bind_port(struct ata_port *ap ) { struct acpi_device *host_companion ; struct acpi_device *tmp ; struct acpi_device *adev ; struct ata_acpi_hotplug_context *context ; int tmp___0 ; void *tmp___1 ; { tmp = to_acpi_node(((ap->host)->dev)->fwnode); host_companion = tmp; if ((libata_noacpi != 0 || (ap->flags & 131072UL) != 0UL) || (unsigned long )host_companion == (unsigned long )((struct acpi_device *)0)) { return; } else { } acpi_preset_companion(& ap->tdev, host_companion, (u64 )ap->port_no); tmp___0 = ata_acpi_gtm(ap, & ap->__acpi_init_gtm); if (tmp___0 == 0) { ap->pflags = ap->pflags | 524288U; } else { } adev = to_acpi_node(ap->tdev.fwnode); if ((unsigned long )adev == (unsigned long )((struct acpi_device *)0) || (unsigned long )adev->hp != (unsigned long )((struct acpi_hotplug_context *)0)) { return; } else { } tmp___1 = kzalloc(40UL, 208U); context = (struct ata_acpi_hotplug_context *)tmp___1; if ((unsigned long )context == (unsigned long )((struct ata_acpi_hotplug_context *)0)) { return; } else { } context->data.ap = ap; acpi_initialize_hp_context(adev, & context->hp, & ata_acpi_ap_notify_dock, & ata_acpi_ap_uevent); return; } } void ata_acpi_bind_dev(struct ata_device *dev ) { struct ata_port *ap ; struct acpi_device *port_companion ; struct acpi_device *tmp ; struct acpi_device *host_companion ; struct acpi_device *tmp___0 ; struct acpi_device *parent ; struct acpi_device *adev ; struct ata_acpi_hotplug_context *context ; u64 adr ; bool tmp___1 ; int tmp___2 ; void *tmp___3 ; { ap = (dev->link)->ap; tmp = to_acpi_node(ap->tdev.fwnode); port_companion = tmp; tmp___0 = to_acpi_node(((ap->host)->dev)->fwnode); host_companion = tmp___0; if ((libata_noacpi != 0 || (unsigned long )host_companion == (unsigned long )((struct acpi_device *)0)) || ((ap->flags & 131072UL) == 0UL && (unsigned long )port_companion == (unsigned long )((struct acpi_device *)0))) { return; } else { } if ((ap->flags & 131072UL) != 0UL) { tmp___1 = sata_pmp_attached(ap); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { adr = (u64 )((ap->port_no << 16) | 65535U); } else { adr = (u64 )((ap->port_no << 16) | (unsigned int )(dev->link)->pmp); } parent = host_companion; } else { adr = (u64 )dev->devno; parent = port_companion; } acpi_preset_companion(& dev->tdev, parent, adr); adev = to_acpi_node(dev->tdev.fwnode); if ((unsigned long )adev == (unsigned long )((struct acpi_device *)0) || (unsigned long )adev->hp != (unsigned long )((struct acpi_hotplug_context *)0)) { return; } else { } tmp___3 = kzalloc(40UL, 208U); context = (struct ata_acpi_hotplug_context *)tmp___3; if ((unsigned long )context == (unsigned long )((struct ata_acpi_hotplug_context *)0)) { return; } else { } context->data.dev = dev; acpi_initialize_hp_context(adev, & context->hp, & ata_acpi_dev_notify_dock, & ata_acpi_dev_uevent); return; } } void ata_acpi_dissociate(struct ata_host *host ) { int i ; struct ata_port *ap ; struct ata_acpi_gtm const *gtm ; struct ata_acpi_gtm const *tmp ; struct acpi_device *tmp___0 ; acpi_handle tmp___1 ; { i = 0; goto ldv_43578; ldv_43577: ap = host->ports[i]; tmp = ata_acpi_init_gtm(ap); gtm = tmp; tmp___0 = to_acpi_node(ap->tdev.fwnode); tmp___1 = acpi_device_handle(tmp___0); if ((unsigned long )tmp___1 != (unsigned long )((acpi_handle )0) && (unsigned long )gtm != (unsigned long )((struct ata_acpi_gtm const *)0)) { ata_acpi_stm(ap, gtm); } else { } i = i + 1; ldv_43578: ; if ((unsigned int )i < host->n_ports) { goto ldv_43577; } else { } return; } } int ata_acpi_gtm(struct ata_port *ap , struct ata_acpi_gtm *gtm ) { struct acpi_buffer output ; union acpi_object *out_obj ; acpi_status status ; int rc ; acpi_handle handle ; struct acpi_device *tmp ; acpi_handle tmp___0 ; { output.length = 0xffffffffffffffffULL; output.pointer = 0; rc = 0; tmp = to_acpi_node(ap->tdev.fwnode); tmp___0 = acpi_device_handle(tmp); handle = tmp___0; if ((unsigned long )handle == (unsigned long )((acpi_handle )0)) { return (-22); } else { } status = acpi_evaluate_object(handle, (char *)"_GTM", (struct acpi_object_list *)0, & output); rc = -2; if (status == 5U) { goto out_free; } else { } rc = -22; if (status != 0U) { ata_port_printk((struct ata_port const *)ap, "\v", "ACPI get timing mode failed (AE 0x%x)\n", status); goto out_free; } else { } out_obj = (union acpi_object *)output.pointer; if (out_obj->type != 3U) { ata_port_printk((struct ata_port const *)ap, "\f", "_GTM returned unexpected object type 0x%x\n", out_obj->type); goto out_free; } else { } if (out_obj->buffer.length != 20U) { ata_port_printk((struct ata_port const *)ap, "\v", "_GTM returned invalid length %d\n", out_obj->buffer.length); goto out_free; } else { } memcpy((void *)gtm, (void const *)out_obj->buffer.pointer, 20UL); rc = 0; out_free: kfree((void const *)output.pointer); return (rc); } } static char const __kstrtab_ata_acpi_gtm[13U] = { 'a', 't', 'a', '_', 'a', 'c', 'p', 'i', '_', 'g', 't', 'm', '\000'}; struct kernel_symbol const __ksymtab_ata_acpi_gtm ; struct kernel_symbol const __ksymtab_ata_acpi_gtm = {(unsigned long )(& ata_acpi_gtm), (char const *)(& __kstrtab_ata_acpi_gtm)}; int ata_acpi_stm(struct ata_port *ap , struct ata_acpi_gtm const *stm ) { acpi_status status ; struct ata_acpi_gtm stm_buf ; struct acpi_object_list input ; union acpi_object in_params[3U] ; struct acpi_device *tmp ; acpi_handle tmp___0 ; { stm_buf = *stm; in_params[0].type = 3U; in_params[0].buffer.length = 20U; in_params[0].buffer.pointer = (u8 *)(& stm_buf); in_params[1].type = 3U; in_params[1].buffer.length = 512U; in_params[1].buffer.pointer = (u8 *)(& ap->link.device[0].__annonCompField86.id); in_params[2].type = 3U; in_params[2].buffer.length = 512U; in_params[2].buffer.pointer = (u8 *)(& ap->link.device[1].__annonCompField86.id); input.count = 3U; input.pointer = (union acpi_object *)(& in_params); tmp = to_acpi_node(ap->tdev.fwnode); tmp___0 = acpi_device_handle(tmp); status = acpi_evaluate_object(tmp___0, (char *)"_STM", & input, (struct acpi_buffer *)0); if (status == 5U) { return (-2); } else { } if (status != 0U) { ata_port_printk((struct ata_port const *)ap, "\v", "ACPI set timing mode failed (status=0x%x)\n", status); return (-22); } else { } return (0); } } static char const __kstrtab_ata_acpi_stm[13U] = { 'a', 't', 'a', '_', 'a', 'c', 'p', 'i', '_', 's', 't', 'm', '\000'}; struct kernel_symbol const __ksymtab_ata_acpi_stm ; struct kernel_symbol const __ksymtab_ata_acpi_stm = {(unsigned long )(& ata_acpi_stm), (char const *)(& __kstrtab_ata_acpi_stm)}; static int ata_dev_get_GTF(struct ata_device *dev , struct ata_acpi_gtf **gtf ) { struct ata_port *ap ; acpi_status status ; struct acpi_buffer output ; union acpi_object *out_obj ; int rc ; acpi_handle tmp ; union acpi_object *tmp___0 ; { ap = (dev->link)->ap; rc = 0; if ((unsigned long )dev->gtf_cache != (unsigned long )((union acpi_object *)0)) { out_obj = dev->gtf_cache; goto done; } else { } output.length = 0xffffffffffffffffULL; output.pointer = (void *)0; if ((ap->msg_enable & 4U) != 0U) { ata_dev_printk((struct ata_device const *)dev, "\017", "%s: ENTER: port#: %d\n", "ata_dev_get_GTF", ap->port_no); } else { } tmp = ata_dev_acpi_handle(dev); status = acpi_evaluate_object(tmp, (char *)"_GTF", (struct acpi_object_list *)0, & output); tmp___0 = (union acpi_object *)output.pointer; dev->gtf_cache = tmp___0; out_obj = tmp___0; if (status != 0U) { if (status != 5U) { ata_dev_printk((struct ata_device const *)dev, "\f", "_GTF evaluation failed (AE 0x%x)\n", status); rc = -22; } else { } goto out_free; } else { } if (output.length == 0ULL || (unsigned long )output.pointer == (unsigned long )((void *)0)) { if ((ap->msg_enable & 4U) != 0U) { ata_dev_printk((struct ata_device const *)dev, "\017", "%s: Run _GTF: length or ptr is NULL (0x%llx, 0x%p)\n", "ata_dev_get_GTF", output.length, output.pointer); } else { } rc = -22; goto out_free; } else { } if (out_obj->type != 3U) { ata_dev_printk((struct ata_device const *)dev, "\f", "_GTF unexpected object type 0x%x\n", out_obj->type); rc = -22; goto out_free; } else { } if (out_obj->buffer.length % 7U != 0U) { ata_dev_printk((struct ata_device const *)dev, "\f", "unexpected _GTF length (%d)\n", out_obj->buffer.length); rc = -22; goto out_free; } else { } done: rc = (int )(out_obj->buffer.length / 7U); if ((unsigned long )gtf != (unsigned long )((struct ata_acpi_gtf **)0)) { *gtf = (struct ata_acpi_gtf *)out_obj->buffer.pointer; if ((ap->msg_enable & 4U) != 0U) { ata_dev_printk((struct ata_device const *)dev, "\017", "%s: returning gtf=%p, gtf_count=%d\n", "ata_dev_get_GTF", *gtf, rc); } else { } } else { } return (rc); out_free: ata_acpi_clear_gtf(dev); return (rc); } } unsigned long ata_acpi_gtm_xfermask(struct ata_device *dev , struct ata_acpi_gtm const *gtm ) { unsigned long xfer_mask ; unsigned int type ; int unit ; u8 mode ; unsigned long tmp ; unsigned long tmp___0 ; { xfer_mask = 0UL; unit = (int )dev->devno; if (((unsigned int )gtm->flags & 16U) == 0U) { unit = 0; } else { } mode = ata_timing_cycle2mode(0U, (int )gtm->drive[unit].pio); tmp = ata_xfer_mode2mask((int )mode); xfer_mask = tmp | xfer_mask; if (((unsigned int )gtm->flags & (unsigned int )(1 << unit * 2)) == 0U) { type = 7U; } else { type = 12U; } mode = ata_timing_cycle2mode(type, (int )gtm->drive[unit].dma); tmp___0 = ata_xfer_mode2mask((int )mode); xfer_mask = tmp___0 | xfer_mask; return (xfer_mask); } } static char const __kstrtab_ata_acpi_gtm_xfermask[22U] = { 'a', 't', 'a', '_', 'a', 'c', 'p', 'i', '_', 'g', 't', 'm', '_', 'x', 'f', 'e', 'r', 'm', 'a', 's', 'k', '\000'}; struct kernel_symbol const __ksymtab_ata_acpi_gtm_xfermask ; struct kernel_symbol const __ksymtab_ata_acpi_gtm_xfermask = {(unsigned long )(& ata_acpi_gtm_xfermask), (char const *)(& __kstrtab_ata_acpi_gtm_xfermask)}; int ata_acpi_cbl_80wire(struct ata_port *ap , struct ata_acpi_gtm const *gtm ) { struct ata_device *dev ; unsigned long xfer_mask ; unsigned long udma_mask ; { dev = ata_dev_next((struct ata_device *)0, & ap->link, 0); goto ldv_43650; ldv_43649: xfer_mask = ata_acpi_gtm_xfermask(dev, gtm); ata_unpack_xfermask(xfer_mask, (unsigned long *)0UL, (unsigned long *)0UL, & udma_mask); if ((udma_mask & 0xfffffffffffffff8UL) != 0UL) { return (1); } else { } dev = ata_dev_next(dev, & ap->link, 0); ldv_43650: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_43649; } else { } return (0); } } static char const __kstrtab_ata_acpi_cbl_80wire[20U] = { 'a', 't', 'a', '_', 'a', 'c', 'p', 'i', '_', 'c', 'b', 'l', '_', '8', '0', 'w', 'i', 'r', 'e', '\000'}; struct kernel_symbol const __ksymtab_ata_acpi_cbl_80wire ; struct kernel_symbol const __ksymtab_ata_acpi_cbl_80wire = {(unsigned long )(& ata_acpi_cbl_80wire), (char const *)(& __kstrtab_ata_acpi_cbl_80wire)}; static void ata_acpi_gtf_to_tf(struct ata_device *dev , struct ata_acpi_gtf const *gtf , struct ata_taskfile *tf ) { { ata_tf_init(dev, tf); tf->flags = tf->flags | 6UL; tf->protocol = 1U; tf->feature = gtf->tf[0]; tf->nsect = gtf->tf[1]; tf->lbal = gtf->tf[2]; tf->lbam = gtf->tf[3]; tf->lbah = gtf->tf[4]; tf->device = gtf->tf[5]; tf->command = gtf->tf[6]; return; } } static int ata_acpi_filter_tf(struct ata_device *dev , struct ata_taskfile const *tf , struct ata_taskfile const *ptf ) { { if ((int )dev->gtf_filter & 1) { if ((unsigned int )((unsigned char )tf->command) == 239U && (unsigned int )((unsigned char )tf->feature) == 3U) { return (1); } else { } } else { } if ((dev->gtf_filter & 2U) != 0U) { if ((unsigned int )((unsigned char )tf->command) == 177U && (unsigned int )((unsigned char )tf->feature) == 193U) { return (1); } else { } if ((unsigned int )((unsigned char )tf->command) == 245U) { return (1); } else { } if ((((unsigned long )ptf == (unsigned long )((struct ata_taskfile const *)0) || (unsigned int )((unsigned char )ptf->command) != 248U) && (unsigned int )((unsigned char )tf->command) == 249U) && ((unsigned int )((unsigned char )tf->feature) == 2U || (unsigned int )((unsigned char )tf->feature) == 4U)) { return (1); } else { } } else { } if ((unsigned int )((unsigned char )tf->command) == 239U && (unsigned int )((unsigned char )tf->feature) == 16U) { if ((dev->gtf_filter & 4U) != 0U && (unsigned int )((unsigned char )tf->nsect) == 3U) { return (1); } else { } if ((dev->gtf_filter & 8U) != 0U && ((unsigned int )((unsigned char )tf->nsect) == 1U || (unsigned int )((unsigned char )tf->nsect) == 4U)) { return (1); } else { } if ((dev->gtf_filter & 16U) != 0U && (unsigned int )((unsigned char )tf->nsect) == 2U) { return (1); } else { } } else { } return (0); } } static int ata_acpi_run_tf(struct ata_device *dev , struct ata_acpi_gtf const *gtf , struct ata_acpi_gtf const *prev_gtf ) { struct ata_taskfile *pptf ; struct ata_taskfile tf ; struct ata_taskfile ptf ; struct ata_taskfile rtf ; unsigned int err_mask ; char const *level ; char const *descr ; char msg[60U] ; int rc ; int tmp ; { pptf = (struct ata_taskfile *)0; if (((((((unsigned int )gtf->tf[0] == 0U && (unsigned int )gtf->tf[1] == 0U) && (unsigned int )gtf->tf[2] == 0U) && (unsigned int )gtf->tf[3] == 0U) && (unsigned int )gtf->tf[4] == 0U) && (unsigned int )gtf->tf[5] == 0U) && (unsigned int )gtf->tf[6] == 0U) { return (0); } else { } ata_acpi_gtf_to_tf(dev, gtf, & tf); if ((unsigned long )prev_gtf != (unsigned long )((struct ata_acpi_gtf const *)0)) { ata_acpi_gtf_to_tf(dev, prev_gtf, & ptf); pptf = & ptf; } else { } tmp = ata_acpi_filter_tf(dev, (struct ata_taskfile const *)(& tf), (struct ata_taskfile const *)pptf); if (tmp == 0) { rtf = tf; err_mask = ata_exec_internal(dev, & rtf, (u8 const *)0U, 3, (void *)0, 0U, 0UL); switch (err_mask) { case 0U: level = "\017"; snprintf((char *)(& msg), 60UL, "succeeded"); rc = 1; goto ldv_43685; case 1U: level = "\016"; snprintf((char *)(& msg), 60UL, "rejected by device (Stat=0x%02x Err=0x%02x)", (int )rtf.command, (int )rtf.feature); rc = 0; goto ldv_43685; default: level = "\v"; snprintf((char *)(& msg), 60UL, "failed (Emask=0x%x Stat=0x%02x Err=0x%02x)", err_mask, (int )rtf.command, (int )rtf.feature); rc = -5; goto ldv_43685; } ldv_43685: ; } else { level = "\016"; snprintf((char *)(& msg), 60UL, "filtered out"); rc = 0; } descr = ata_get_cmd_descript((int )tf.command); ata_dev_printk((struct ata_device const *)dev, level, "ACPI cmd %02x/%02x:%02x:%02x:%02x:%02x:%02x (%s) %s\n", (int )tf.command, (int )tf.feature, (int )tf.nsect, (int )tf.lbal, (int )tf.lbam, (int )tf.lbah, (int )tf.device, (unsigned long )descr != (unsigned long )((char const *)0) ? descr : "unknown", (char *)(& msg)); return (rc); } } static int ata_acpi_exec_tfs(struct ata_device *dev , int *nr_executed ) { struct ata_acpi_gtf *gtf ; struct ata_acpi_gtf *pgtf ; int gtf_count ; int i ; int rc ; { gtf = (struct ata_acpi_gtf *)0; pgtf = (struct ata_acpi_gtf *)0; rc = ata_dev_get_GTF(dev, & gtf); if (rc < 0) { return (rc); } else { } gtf_count = rc; i = 0; goto ldv_43699; ldv_43698: rc = ata_acpi_run_tf(dev, (struct ata_acpi_gtf const *)gtf, (struct ata_acpi_gtf const *)pgtf); if (rc < 0) { goto ldv_43697; } else { } if (rc != 0) { *nr_executed = *nr_executed + 1; pgtf = gtf; } else { } i = i + 1; gtf = gtf + 1; ldv_43699: ; if (i < gtf_count) { goto ldv_43698; } else { } ldv_43697: ata_acpi_clear_gtf(dev); if (rc < 0) { return (rc); } else { } return (0); } } static int ata_acpi_push_id(struct ata_device *dev ) { struct ata_port *ap ; acpi_status status ; struct acpi_object_list input ; union acpi_object in_params[1U] ; acpi_handle tmp ; { ap = (dev->link)->ap; if ((ap->msg_enable & 4U) != 0U) { ata_dev_printk((struct ata_device const *)dev, "\017", "%s: ix = %d, port#: %d\n", "ata_acpi_push_id", dev->devno, ap->port_no); } else { } input.count = 1U; input.pointer = (union acpi_object *)(& in_params); in_params[0].type = 3U; in_params[0].buffer.length = 512U; in_params[0].buffer.pointer = (u8 *)(& dev->__annonCompField86.id); swap_buf_le16((u16 *)(& dev->__annonCompField86.id), 256U); tmp = ata_dev_acpi_handle(dev); status = acpi_evaluate_object(tmp, (char *)"_SDD", & input, (struct acpi_buffer *)0); swap_buf_le16((u16 *)(& dev->__annonCompField86.id), 256U); if (status == 5U) { return (-2); } else { } if (status != 0U) { ata_dev_printk((struct ata_device const *)dev, "\f", "ACPI _SDD failed (AE 0x%x)\n", status); return (-5); } else { } return (0); } } int ata_acpi_on_suspend(struct ata_port *ap ) { { return (0); } } void ata_acpi_on_resume(struct ata_port *ap ) { struct ata_acpi_gtm const *gtm ; struct ata_acpi_gtm const *tmp ; struct ata_device *dev ; unsigned int tmp___0 ; acpi_handle tmp___1 ; int tmp___2 ; unsigned int tmp___3 ; struct acpi_device *tmp___4 ; acpi_handle tmp___5 ; { tmp = ata_acpi_init_gtm(ap); gtm = tmp; tmp___4 = to_acpi_node(ap->tdev.fwnode); tmp___5 = acpi_device_handle(tmp___4); if ((unsigned long )tmp___5 != (unsigned long )((acpi_handle )0) && (unsigned long )gtm != (unsigned long )((struct ata_acpi_gtm const *)0)) { ata_acpi_stm(ap, gtm); dev = ata_dev_next((struct ata_device *)0, & ap->link, 2); goto ldv_43717; ldv_43716: ata_acpi_clear_gtf(dev); tmp___0 = ata_dev_enabled((struct ata_device const *)dev); if (tmp___0 != 0U) { tmp___1 = ata_dev_acpi_handle(dev); if ((unsigned long )tmp___1 != (unsigned long )((acpi_handle )0)) { tmp___2 = ata_dev_get_GTF(dev, (struct ata_acpi_gtf **)0); if (tmp___2 >= 0) { dev->flags = dev->flags | 32UL; } else { } } else { } } else { } dev = ata_dev_next(dev, & ap->link, 2); ldv_43717: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_43716; } else { } } else { dev = ata_dev_next((struct ata_device *)0, & ap->link, 2); goto ldv_43720; ldv_43719: ata_acpi_clear_gtf(dev); tmp___3 = ata_dev_enabled((struct ata_device const *)dev); if (tmp___3 != 0U) { dev->flags = dev->flags | 32UL; } else { } dev = ata_dev_next(dev, & ap->link, 2); ldv_43720: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_43719; } else { } } return; } } static int ata_acpi_choose_suspend_state(struct ata_device *dev , bool runtime ) { int d_max_in ; bool tmp ; int tmp___0 ; bool tmp___1 ; int tmp___2 ; int tmp___3 ; { d_max_in = 4; if (! runtime) { goto out; } else { } if (dev->class == 3U) { tmp = zpodd_dev_enabled(dev); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { d_max_in = 3; } else { tmp___1 = zpodd_zpready(dev); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { d_max_in = 3; } else { } } } else { } out: tmp___3 = acpi_pm_device_sleep_state(& dev->tdev, (int *)0, d_max_in); return (tmp___3); } } static void sata_acpi_set_state(struct ata_port *ap , pm_message_t state ) { bool runtime ; struct ata_device *dev ; acpi_handle handle ; int acpi_state ; bool tmp ; bool tmp___0 ; { runtime = (state.event & 1024) != 0; dev = ata_dev_next((struct ata_device *)0, & ap->link, 0); goto ldv_43738; ldv_43737: handle = ata_dev_acpi_handle(dev); if ((unsigned long )handle == (unsigned long )((acpi_handle )0)) { goto ldv_43736; } else { } if ((state.event & 16) == 0) { acpi_state = ata_acpi_choose_suspend_state(dev, (int )runtime); if (acpi_state == 0) { goto ldv_43736; } else { } if ((int )runtime) { tmp = zpodd_dev_enabled(dev); if ((int )tmp) { if (acpi_state == 4) { zpodd_enable_run_wake(dev); } else { } } else { } } else { } acpi_bus_set_power(handle, acpi_state); } else { if ((int )runtime) { tmp___0 = zpodd_dev_enabled(dev); if ((int )tmp___0) { zpodd_disable_run_wake(dev); } else { } } else { } acpi_bus_set_power(handle, 0); } ldv_43736: dev = ata_dev_next(dev, & ap->link, 0); ldv_43738: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_43737; } else { } return; } } static void pata_acpi_set_state(struct ata_port *ap , pm_message_t state ) { struct ata_device *dev ; acpi_handle port_handle ; struct acpi_device *tmp ; acpi_handle dev_handle ; acpi_handle tmp___0 ; { tmp = to_acpi_node(ap->tdev.fwnode); port_handle = acpi_device_handle(tmp); if ((unsigned long )port_handle == (unsigned long )((acpi_handle )0)) { return; } else { } if ((state.event & 16) != 0) { acpi_bus_set_power(port_handle, 0); } else { } dev = ata_dev_next((struct ata_device *)0, & ap->link, 0); goto ldv_43749; ldv_43748: tmp___0 = ata_dev_acpi_handle(dev); dev_handle = tmp___0; if ((unsigned long )dev_handle == (unsigned long )((acpi_handle )0)) { goto ldv_43747; } else { } acpi_bus_set_power(dev_handle, (state.event & 16) != 0 ? 0 : 4); ldv_43747: dev = ata_dev_next(dev, & ap->link, 0); ldv_43749: ; if ((unsigned long )dev != (unsigned long )((struct ata_device *)0)) { goto ldv_43748; } else { } if ((state.event & 16) == 0) { acpi_bus_set_power(port_handle, 4); } else { } return; } } void ata_acpi_set_state(struct ata_port *ap , pm_message_t state ) { { if ((ap->flags & 131072UL) != 0UL) { sata_acpi_set_state(ap, state); } else { pata_acpi_set_state(ap, state); } return; } } int ata_acpi_on_devcfg(struct ata_device *dev ) { struct ata_port *ap ; struct ata_eh_context *ehc ; int acpi_sata ; int nr_executed ; int rc ; acpi_handle tmp ; { ap = (dev->link)->ap; ehc = & ap->link.eh_context; acpi_sata = (int )ap->flags & 131072; nr_executed = 0; tmp = ata_dev_acpi_handle(dev); if ((unsigned long )tmp == (unsigned long )((acpi_handle )0)) { return (0); } else { } if ((dev->flags & 32UL) == 0UL && (acpi_sata == 0 || (ehc->i.flags & 131072U) == 0U)) { return (0); } else { } if (acpi_sata != 0) { rc = ata_acpi_push_id(dev); if (rc != 0 && rc != -2) { goto acpi_err; } else { } } else { } rc = ata_acpi_exec_tfs(dev, & nr_executed); if (rc != 0) { goto acpi_err; } else { } dev->flags = dev->flags & 0xffffffffffffffdfUL; if (nr_executed != 0) { rc = ata_dev_reread_id(dev, 0U); if (rc < 0) { ata_dev_printk((struct ata_device const *)dev, "\v", "failed to IDENTIFY after ACPI commands\n"); return (rc); } else { } } else { } return (0); acpi_err: ; if ((rc == -22 && nr_executed == 0) && (ap->pflags & 4U) == 0U) { return (0); } else { } if ((dev->flags & 64UL) == 0UL) { dev->flags = dev->flags | 64UL; return (rc); } else { } dev->flags = dev->flags | 268435456UL; ata_dev_printk((struct ata_device const *)dev, "\f", "ACPI: failed the second time, disabled\n"); if (nr_executed == 0 && (ap->pflags & 4U) == 0U) { return (0); } else { } return (rc); } } void ata_acpi_on_disable(struct ata_device *dev ) { { ata_acpi_clear_gtf(dev); return; } } bool ldv_queue_work_on_109(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_110(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_111(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_112(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_113(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_123(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_125(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_124(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; bool ldv_queue_delayed_work_on_127(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; void ldv_flush_workqueue_126(struct workqueue_struct *ldv_func_arg1 ) ; extern acpi_status acpi_install_notify_handler(acpi_handle , u32 , void (*)(acpi_handle , u32 , void * ) , void * ) ; extern acpi_status acpi_remove_notify_handler(acpi_handle , u32 , void (*)(acpi_handle , u32 , void * ) ) ; extern int acpi_pm_device_run_wake(struct device * , bool ) ; __inline static bool acpi_device_can_poweroff(struct acpi_device *adev ) { { return ((int )adev->power.states[4].flags.valid != 0); } } extern int __pm_runtime_resume(struct device * , int ) ; __inline static void device_set_run_wake(struct device *dev , bool enable ) { { dev->power.run_wake = (unsigned char )enable; return; } } __inline static int pm_runtime_resume(struct device *dev ) { int tmp ; { tmp = __pm_runtime_resume(dev, 0); return (tmp); } } extern int dev_pm_qos_expose_flags(struct device * , s32 ) ; extern void sdev_disable_disk_events(struct scsi_device * ) ; extern void sdev_enable_disk_events(struct scsi_device * ) ; static int zpodd_poweroff_delay = 30; static int eject_tray(struct ata_device *dev ) { struct ata_taskfile tf ; char cdb[12U] ; unsigned int tmp ; { cdb[0] = 27; cdb[1] = 0; cdb[2] = 0; cdb[3] = 0; cdb[4] = 2; cdb[5] = 0; cdb[6] = 0; cdb[7] = 0; cdb[8] = 0; cdb[9] = 0; cdb[10] = 0; cdb[11] = 0; ata_tf_init(dev, & tf); tf.flags = 6UL; tf.command = 160U; tf.protocol = 5U; tmp = ata_exec_internal(dev, & tf, (u8 const *)(& cdb), 3, (void *)0, 0U, 0UL); return ((int )tmp); } } static enum odd_mech_type zpodd_get_mech_type(struct ata_device *dev ) { char buf[16U] ; unsigned int ret ; struct rm_feature_desc *desc ; struct ata_taskfile tf ; char cdb[12U] ; __u16 tmp ; { desc = (struct rm_feature_desc *)(& buf) + 8U; cdb[0] = 70; cdb[1] = 2; cdb[2] = 0; cdb[3] = 3; cdb[4] = 0; cdb[5] = 0; cdb[6] = 0; cdb[7] = 0; cdb[8] = 16; cdb[9] = 0; cdb[10] = 0; cdb[11] = 0; ata_tf_init(dev, & tf); tf.flags = 6UL; tf.command = 160U; tf.protocol = 6U; tf.lbam = 16U; ret = ata_exec_internal(dev, & tf, (u8 const *)(& cdb), 2, (void *)(& buf), 16U, 0UL); if (ret != 0U) { return (2); } else { } tmp = __fswab16((int )desc->feature_code); if ((unsigned int )tmp != 3U) { return (2); } else { } if (((unsigned int )*((unsigned char *)desc + 4UL) == 0U && (unsigned int )*((unsigned char *)desc + 4UL) == 0U) && (unsigned int )*((unsigned char *)desc + 4UL) != 0U) { return (0); } else if (((unsigned int )*((unsigned char *)desc + 4UL) == 32U && (unsigned int )*((unsigned char *)desc + 4UL) == 0U) && (unsigned int )*((unsigned char *)desc + 4UL) != 0U) { return (1); } else { return (2); } } } static bool zpready(struct ata_device *dev ) { u8 sense_key ; u8 *sense_buf ; unsigned int ret ; unsigned int asc ; unsigned int ascq ; unsigned int add_len ; struct zpodd *zpodd ; { zpodd = (struct zpodd *)dev->zpodd; ret = atapi_eh_tur(dev, & sense_key); if (ret == 0U || (unsigned int )sense_key != 2U) { return (0); } else { } sense_buf = (u8 *)(& ((dev->link)->ap)->sector_buf); ret = atapi_eh_request_sense(dev, sense_buf, (int )sense_key); if (ret != 0U) { return (0); } else { } if (((int )*sense_buf & 127) != 112) { return (0); } else { } add_len = (unsigned int )*(sense_buf + 7UL); if (add_len <= 5U) { return (0); } else { } asc = (unsigned int )*(sense_buf + 12UL); ascq = (unsigned int )*(sense_buf + 13UL); if ((unsigned int )zpodd->mech_type == 0U) { return (asc == 58U); } else { return ((bool )(asc == 58U && ascq == 1U)); } } } void zpodd_on_suspend(struct ata_device *dev ) { struct zpodd *zpodd ; unsigned long expires ; bool tmp ; int tmp___0 ; unsigned long tmp___1 ; { zpodd = (struct zpodd *)dev->zpodd; tmp = zpready(dev); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { zpodd->zp_sampled = 0; zpodd->zp_ready = 0; return; } else { } if (! zpodd->zp_sampled) { zpodd->zp_sampled = 1; zpodd->last_ready = jiffies; return; } else { } tmp___1 = msecs_to_jiffies((unsigned int const )(zpodd_poweroff_delay * 1000)); expires = zpodd->last_ready + tmp___1; if ((long )((unsigned long )jiffies - expires) < 0L) { return; } else { } zpodd->zp_ready = 1; return; } } bool zpodd_zpready(struct ata_device *dev ) { struct zpodd *zpodd ; { zpodd = (struct zpodd *)dev->zpodd; return (zpodd->zp_ready); } } void zpodd_enable_run_wake(struct ata_device *dev ) { struct zpodd *zpodd ; { zpodd = (struct zpodd *)dev->zpodd; sdev_disable_disk_events(dev->sdev); zpodd->powered_off = 1; device_set_run_wake(& dev->tdev, 1); acpi_pm_device_run_wake(& dev->tdev, 1); return; } } void zpodd_disable_run_wake(struct ata_device *dev ) { struct zpodd *zpodd ; { zpodd = (struct zpodd *)dev->zpodd; if ((int )zpodd->powered_off) { acpi_pm_device_run_wake(& dev->tdev, 0); device_set_run_wake(& dev->tdev, 0); } else { } return; } } void zpodd_post_poweron(struct ata_device *dev ) { struct zpodd *zpodd ; { zpodd = (struct zpodd *)dev->zpodd; if (! zpodd->powered_off) { return; } else { } zpodd->powered_off = 0; if ((int )zpodd->from_notify) { zpodd->from_notify = 0; if ((unsigned int )zpodd->mech_type == 1U) { eject_tray(dev); } else { } } else { } zpodd->zp_sampled = 0; zpodd->zp_ready = 0; sdev_enable_disk_events(dev->sdev); return; } } static void zpodd_wake_dev(acpi_handle handle , u32 event , void *context ) { struct ata_device *ata_dev ; struct zpodd *zpodd ; struct device *dev ; bool tmp ; { ata_dev = (struct ata_device *)context; zpodd = (struct zpodd *)ata_dev->zpodd; dev = & (ata_dev->sdev)->sdev_gendev; if (event == 2U) { tmp = pm_runtime_suspended(dev); if ((int )tmp) { zpodd->from_notify = 1; pm_runtime_resume(dev); } else { } } else { } return; } } static void ata_acpi_add_pm_notifier(struct ata_device *dev ) { acpi_handle handle ; acpi_handle tmp ; { tmp = ata_dev_acpi_handle(dev); handle = tmp; acpi_install_notify_handler(handle, 1U, & zpodd_wake_dev, (void *)dev); return; } } static void ata_acpi_remove_pm_notifier(struct ata_device *dev ) { acpi_handle handle ; acpi_handle tmp ; { tmp = ata_dev_acpi_handle(dev); handle = tmp; acpi_remove_notify_handler(handle, 1U, & zpodd_wake_dev); return; } } void zpodd_init(struct ata_device *dev ) { struct acpi_device *adev ; struct acpi_device *tmp ; enum odd_mech_type mech_type ; struct zpodd *zpodd ; bool tmp___0 ; int tmp___1 ; void *tmp___2 ; { tmp = to_acpi_node(dev->tdev.fwnode); adev = tmp; if ((unsigned long )dev->zpodd != (unsigned long )((void *)0) || (unsigned long )adev == (unsigned long )((struct acpi_device *)0)) { return; } else { tmp___0 = acpi_device_can_poweroff(adev); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { return; } else { } } mech_type = zpodd_get_mech_type(dev); if ((unsigned int )mech_type == 2U) { return; } else { } tmp___2 = kzalloc(40UL, 208U); zpodd = (struct zpodd *)tmp___2; if ((unsigned long )zpodd == (unsigned long )((struct zpodd *)0)) { return; } else { } zpodd->mech_type = mech_type; ata_acpi_add_pm_notifier(dev); zpodd->dev = dev; dev->zpodd = (void *)zpodd; dev_pm_qos_expose_flags(& dev->tdev, 0); return; } } void zpodd_exit(struct ata_device *dev ) { { ata_acpi_remove_pm_notifier(dev); kfree((void const *)dev->zpodd); dev->zpodd = (void *)0; return; } } bool ldv_queue_work_on_123(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_124(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_125(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_126(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_127(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } extern void *memset(void * , int , size_t ) ; __inline static void ldv_error(void) { { ERROR: ; __VERIFIER_error(); } } bool ldv_is_err(void const *ptr ) { { return ((unsigned long )ptr > 2012UL); } } void *ldv_err_ptr(long error ) { { return ((void *)(2012L - error)); } } long ldv_ptr_err(void const *ptr ) { { return ((long )(2012UL - (unsigned long )ptr)); } } bool ldv_is_err_or_null(void const *ptr ) { bool tmp ; int tmp___0 ; { if ((unsigned long )ptr == (unsigned long )((void const *)0)) { tmp___0 = 1; } else { tmp = ldv_is_err(ptr); if ((int )tmp) { tmp___0 = 1; } else { tmp___0 = 0; } } return ((bool )tmp___0); } } int ldv_module_refcounter = 1; void ldv_module_get(struct module *module ) { { if ((unsigned long )module != (unsigned long )((struct module *)0)) { ldv_module_refcounter = ldv_module_refcounter + 1; } else { } return; } } int ldv_try_module_get(struct module *module ) { int module_get_succeeded ; { if ((unsigned long )module != (unsigned long )((struct module *)0)) { module_get_succeeded = ldv_undef_int(); if (module_get_succeeded == 1) { ldv_module_refcounter = ldv_module_refcounter + 1; return (1); } else { return (0); } } else { } return (0); } } void ldv_module_put(struct module *module ) { { if ((unsigned long )module != (unsigned long )((struct module *)0)) { if (ldv_module_refcounter <= 1) { ldv_error(); } else { } ldv_module_refcounter = ldv_module_refcounter - 1; } else { } return; } } void ldv_module_put_and_exit(void) { { ldv_module_put((struct module *)1); LDV_STOP: ; goto LDV_STOP; } } unsigned int ldv_module_refcount(void) { { return ((unsigned int )(ldv_module_refcounter + -1)); } } void ldv_check_final_state(void) { { if (ldv_module_refcounter != 1) { ldv_error(); } else { } return; } }