extern void __VERIFIER_error() __attribute__ ((__noreturn__)); /* Generated by CIL v. 1.5.1 */ /* print_CIL_Input is false */ typedef signed char __s8; typedef unsigned char __u8; typedef short __s16; typedef unsigned short __u16; typedef int __s32; typedef unsigned int __u32; typedef long long __s64; typedef unsigned long long __u64; typedef unsigned char u8; typedef short s16; 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 __u16 __le16; typedef __u32 __le32; 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 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 module; typedef void (*ctor_fn_t)(void); struct file_operations; struct device; struct completion; struct pt_regs; struct pid; typedef u16 __ticket_t; typedef u32 __ticketpair_t; struct __raw_tickets { __ticket_t head ; __ticket_t tail ; }; union __anonunion_ldv_2023_8 { __ticketpair_t head_tail ; struct __raw_tickets tickets ; }; struct arch_spinlock { union __anonunion_ldv_2023_8 ldv_2023 ; }; typedef struct arch_spinlock arch_spinlock_t; struct __anonstruct_ldv_2030_10 { u32 read ; s32 write ; }; union __anonunion_arch_rwlock_t_9 { s64 lock ; struct __anonstruct_ldv_2030_10 ldv_2030 ; }; typedef union __anonunion_arch_rwlock_t_9 arch_rwlock_t; struct task_struct; struct lockdep_map; struct mm_struct; 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_ldv_2147_12 { unsigned int a ; unsigned int b ; }; struct __anonstruct_ldv_2162_13 { 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_ldv_2163_11 { struct __anonstruct_ldv_2147_12 ldv_2147 ; struct __anonstruct_ldv_2162_13 ldv_2162 ; }; struct desc_struct { union __anonunion_ldv_2163_11 ldv_2163 ; }; typedef unsigned long pgdval_t; typedef unsigned long pgprotval_t; struct pgprot { pgprotval_t pgprot ; }; typedef struct pgprot pgprot_t; struct __anonstruct_pgd_t_15 { pgdval_t pgd ; }; typedef struct __anonstruct_pgd_t_15 pgd_t; struct page; typedef struct page *pgtable_t; struct file; struct seq_file; struct thread_struct; struct cpumask; 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_ldv_2766_18 { struct pt_regs *regs ; struct kernel_vm86_regs *vm86 ; }; struct math_emu_info { long ___orig_eip ; union __anonunion_ldv_2766_18 ldv_2766 ; }; struct bug_entry { int bug_addr_disp ; int file_disp ; unsigned short line ; unsigned short flags ; }; struct cpumask { unsigned long bits[64U] ; }; typedef struct cpumask cpumask_t; typedef struct cpumask *cpumask_var_t; struct static_key; struct seq_operations; struct i387_fsave_struct { u32 cwd ; u32 swd ; u32 twd ; u32 fip ; u32 fcs ; u32 foo ; u32 fos ; u32 st_space[20U] ; u32 status ; }; struct __anonstruct_ldv_5121_23 { u64 rip ; u64 rdp ; }; struct __anonstruct_ldv_5127_24 { u32 fip ; u32 fcs ; u32 foo ; u32 fos ; }; union __anonunion_ldv_5128_22 { struct __anonstruct_ldv_5121_23 ldv_5121 ; struct __anonstruct_ldv_5127_24 ldv_5127 ; }; union __anonunion_ldv_5137_25 { u32 padding1[12U] ; u32 sw_reserved[12U] ; }; struct i387_fxsave_struct { u16 cwd ; u16 swd ; u16 twd ; u16 fop ; union __anonunion_ldv_5128_22 ldv_5128 ; u32 mxcsr ; u32 mxcsr_mask ; u32 st_space[32U] ; u32 xmm_space[64U] ; u32 padding[12U] ; union __anonunion_ldv_5137_25 ldv_5137 ; }; struct i387_soft_struct { u32 cwd ; u32 swd ; u32 twd ; u32 fip ; u32 fcs ; u32 foo ; u32 fos ; u32 st_space[20U] ; u8 ftop ; u8 changed ; u8 lookahead ; u8 no_update ; u8 rm ; u8 alimit ; struct math_emu_info *info ; u32 entry_eip ; }; struct ymmh_struct { u32 ymmh_space[64U] ; }; struct xsave_hdr_struct { u64 xstate_bv ; u64 reserved1[2U] ; u64 reserved2[5U] ; }; struct xsave_struct { struct i387_fxsave_struct i387 ; struct xsave_hdr_struct xsave_hdr ; struct ymmh_struct ymmh ; }; union thread_xstate { struct i387_fsave_struct fsave ; struct i387_fxsave_struct fxsave ; struct i387_soft_struct soft ; struct xsave_struct xsave ; }; struct fpu { unsigned int last_cpu ; unsigned int has_fpu ; union thread_xstate *state ; }; struct kmem_cache; struct perf_event; struct thread_struct { struct desc_struct tls_array[3U] ; unsigned long sp0 ; unsigned long sp ; unsigned long usersp ; unsigned short es ; unsigned short ds ; unsigned short fsindex ; unsigned short gsindex ; unsigned long fs ; unsigned long gs ; struct perf_event *ptrace_bps[4U] ; unsigned long debugreg6 ; unsigned long ptrace_dr7 ; unsigned long cr2 ; unsigned long trap_nr ; unsigned long error_code ; struct fpu fpu ; unsigned long *io_bitmap_ptr ; unsigned long iopl ; unsigned int io_bitmap_max ; }; typedef atomic64_t atomic_long_t; struct stack_trace { unsigned int nr_entries ; unsigned int max_entries ; unsigned long *entries ; int skip ; }; struct lockdep_subclass_key { char __one_byte ; } __attribute__((__packed__)) ; 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 : 2 ; unsigned char hardirqs_off : 1 ; unsigned short references : 11 ; }; 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_ldv_5956_29 { u8 __padding[24U] ; struct lockdep_map dep_map ; }; union __anonunion_ldv_5957_28 { struct raw_spinlock rlock ; struct __anonstruct_ldv_5956_29 ldv_5956 ; }; struct spinlock { union __anonunion_ldv_5957_28 ldv_5957 ; }; typedef struct spinlock spinlock_t; struct __anonstruct_rwlock_t_30 { arch_rwlock_t raw_lock ; unsigned int magic ; unsigned int owner_cpu ; void *owner ; struct lockdep_map dep_map ; }; typedef struct __anonstruct_rwlock_t_30 rwlock_t; struct mutex { atomic_t count ; spinlock_t wait_lock ; struct list_head wait_list ; struct task_struct *owner ; char const *name ; void *magic ; struct lockdep_map dep_map ; }; struct mutex_waiter { struct list_head list ; struct task_struct *task ; void *magic ; }; struct timespec; struct seqcount { unsigned int sequence ; }; typedef struct seqcount seqcount_t; struct timespec { __kernel_time_t tv_sec ; long tv_nsec ; }; struct user_namespace; typedef uid_t kuid_t; typedef gid_t 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 __wait_queue_head { spinlock_t lock ; struct list_head task_list ; }; typedef struct __wait_queue_head wait_queue_head_t; struct __anonstruct_nodemask_t_36 { unsigned long bits[16U] ; }; typedef struct __anonstruct_nodemask_t_36 nodemask_t; struct rw_semaphore; struct rw_semaphore { long count ; raw_spinlock_t wait_lock ; struct list_head wait_list ; struct lockdep_map dep_map ; }; struct completion { unsigned int done ; wait_queue_head_t wait ; }; struct notifier_block; union ktime { s64 tv64 ; }; typedef union ktime ktime_t; struct tvec_base; struct timer_list { struct list_head entry ; unsigned long expires ; struct tvec_base *base ; void (*function)(unsigned long ) ; unsigned long data ; int slack ; int start_pid ; void *start_site ; char start_comm[16U] ; struct lockdep_map lockdep_map ; }; struct hrtimer; enum hrtimer_restart; 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 ; int cpu ; }; struct notifier_block { int (*notifier_call)(struct notifier_block * , unsigned long , void * ) ; struct notifier_block *next ; int priority ; }; 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 pm_subsys_data { spinlock_t lock ; unsigned int refcount ; }; struct dev_pm_qos_request; struct pm_qos_constraints; 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 ignore_children ; bool early_init ; spinlock_t lock ; struct list_head entry ; struct completion completion ; struct wakeup_source *wakeup ; bool wakeup_path ; bool syscore ; struct timer_list suspend_timer ; unsigned long timer_expires ; struct work_struct work ; wait_queue_head_t wait_queue ; atomic_t usage_count ; atomic_t child_count ; unsigned char disable_depth : 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 ; 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 dev_pm_qos_request *pq_req ; struct pm_subsys_data *subsys_data ; struct pm_qos_constraints *constraints ; }; struct dev_pm_domain { struct dev_pm_ops ops ; }; struct __anonstruct_mm_context_t_101 { void *ldt ; int size ; unsigned short ia32_compat ; struct mutex lock ; void *vdso ; }; typedef struct __anonstruct_mm_context_t_101 mm_context_t; struct vm_area_struct; 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 cred; 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; 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 ; void *(*grab_current_ns)(void) ; void const *(*netlink_ns)(struct sock * ) ; void const *(*initial_ns)(void) ; void (*drop_ns)(void * ) ; }; 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 { 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 ) ; void const *(*namespace)(struct kobject * , struct attribute const * ) ; }; struct sysfs_dirent; 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 sysfs_dirent *sd ; struct kref kref ; 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 *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 { 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_ldv_13767_134 { void *arg ; struct kparam_string const *str ; struct kparam_array const *arr ; }; struct kernel_param { char const *name ; struct kernel_param_ops const *ops ; u16 perm ; s16 level ; union __anonunion_ldv_13767_134 ldv_13767 ; }; 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 static_key { atomic_t enabled ; }; struct tracepoint; 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 kernel_symbol { unsigned long value ; char const *name ; }; 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 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 } ; struct module_ref { unsigned long incs ; unsigned long decs ; }; struct module_sect_attrs; struct module_notes_attrs; struct ftrace_event_call; 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 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 ; 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 ; 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 ftrace_event_call **trace_events ; unsigned int num_trace_events ; struct list_head source_list ; struct list_head target_list ; struct task_struct *waiter ; void (*exit)(void) ; struct module_ref *refptr ; ctor_fn_t (**ctors)(void) ; unsigned int num_ctors ; }; struct kmem_cache_cpu { void **freelist ; unsigned long tid ; struct page *page ; struct page *partial ; unsigned int stat[26U] ; }; struct kmem_cache_node { spinlock_t list_lock ; unsigned long nr_partial ; struct list_head partial ; atomic_long_t nr_slabs ; atomic_long_t total_objects ; struct list_head full ; }; struct kmem_cache_order_objects { unsigned long x ; }; struct kmem_cache { struct kmem_cache_cpu *cpu_slab ; unsigned long flags ; unsigned long min_partial ; int size ; int object_size ; int offset ; int cpu_partial ; struct kmem_cache_order_objects oo ; struct kmem_cache_order_objects max ; struct kmem_cache_order_objects min ; gfp_t allocflags ; int refcount ; void (*ctor)(void * ) ; int inuse ; int align ; int reserved ; char const *name ; struct list_head list ; struct kobject kobj ; int remote_node_defrag_ratio ; struct kmem_cache_node *node[1024U] ; }; enum irqreturn { IRQ_NONE = 0, IRQ_HANDLED = 1, IRQ_WAKE_THREAD = 2 } ; typedef enum irqreturn irqreturn_t; struct exception_table_entry { int insn ; int fixup ; }; 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 resolution ; ktime_t (*get_time)(void) ; ktime_t softirq_time ; ktime_t offset ; }; struct hrtimer_cpu_base { raw_spinlock_t lock ; unsigned int active_bases ; unsigned int clock_was_set ; ktime_t expires_next ; int hres_active ; int hang_detected ; unsigned long nr_events ; unsigned long nr_retries ; unsigned long nr_hangs ; ktime_t max_hang_time ; struct hrtimer_clock_base clock_base[3U] ; }; typedef unsigned long kernel_ulong_t; struct usb_device_id { __u16 match_flags ; __u16 idVendor ; __u16 idProduct ; __u16 bcdDevice_lo ; __u16 bcdDevice_hi ; __u8 bDeviceClass ; __u8 bDeviceSubClass ; __u8 bDeviceProtocol ; __u8 bInterfaceClass ; __u8 bInterfaceSubClass ; __u8 bInterfaceProtocol ; __u8 bInterfaceNumber ; kernel_ulong_t driver_info ; }; struct of_device_id { char name[32U] ; char type[32U] ; char compatible[128U] ; void const *data ; }; struct usb_descriptor_header { __u8 bLength ; __u8 bDescriptorType ; }; struct usb_device_descriptor { __u8 bLength ; __u8 bDescriptorType ; __le16 bcdUSB ; __u8 bDeviceClass ; __u8 bDeviceSubClass ; __u8 bDeviceProtocol ; __u8 bMaxPacketSize0 ; __le16 idVendor ; __le16 idProduct ; __le16 bcdDevice ; __u8 iManufacturer ; __u8 iProduct ; __u8 iSerialNumber ; __u8 bNumConfigurations ; }; struct usb_config_descriptor { __u8 bLength ; __u8 bDescriptorType ; __le16 wTotalLength ; __u8 bNumInterfaces ; __u8 bConfigurationValue ; __u8 iConfiguration ; __u8 bmAttributes ; __u8 bMaxPower ; }; struct usb_interface_descriptor { __u8 bLength ; __u8 bDescriptorType ; __u8 bInterfaceNumber ; __u8 bAlternateSetting ; __u8 bNumEndpoints ; __u8 bInterfaceClass ; __u8 bInterfaceSubClass ; __u8 bInterfaceProtocol ; __u8 iInterface ; }; struct usb_endpoint_descriptor { __u8 bLength ; __u8 bDescriptorType ; __u8 bEndpointAddress ; __u8 bmAttributes ; __le16 wMaxPacketSize ; __u8 bInterval ; __u8 bRefresh ; __u8 bSynchAddress ; }; struct usb_ss_ep_comp_descriptor { __u8 bLength ; __u8 bDescriptorType ; __u8 bMaxBurst ; __u8 bmAttributes ; __le16 wBytesPerInterval ; }; struct usb_interface_assoc_descriptor { __u8 bLength ; __u8 bDescriptorType ; __u8 bFirstInterface ; __u8 bInterfaceCount ; __u8 bFunctionClass ; __u8 bFunctionSubClass ; __u8 bFunctionProtocol ; __u8 iFunction ; }; struct usb_bos_descriptor { __u8 bLength ; __u8 bDescriptorType ; __le16 wTotalLength ; __u8 bNumDeviceCaps ; }; struct usb_ext_cap_descriptor { __u8 bLength ; __u8 bDescriptorType ; __u8 bDevCapabilityType ; __le32 bmAttributes ; }; struct usb_ss_cap_descriptor { __u8 bLength ; __u8 bDescriptorType ; __u8 bDevCapabilityType ; __u8 bmAttributes ; __le16 wSpeedSupported ; __u8 bFunctionalitySupport ; __u8 bU1devExitLat ; __le16 bU2DevExitLat ; }; struct usb_ss_container_id_descriptor { __u8 bLength ; __u8 bDescriptorType ; __u8 bDevCapabilityType ; __u8 bReserved ; __u8 ContainerID[16U] ; }; enum usb_device_speed { USB_SPEED_UNKNOWN = 0, USB_SPEED_LOW = 1, USB_SPEED_FULL = 2, USB_SPEED_HIGH = 3, USB_SPEED_WIRELESS = 4, USB_SPEED_SUPER = 5 } ; enum usb_device_state { USB_STATE_NOTATTACHED = 0, USB_STATE_ATTACHED = 1, USB_STATE_POWERED = 2, USB_STATE_RECONNECTING = 3, USB_STATE_UNAUTHENTICATED = 4, USB_STATE_DEFAULT = 5, USB_STATE_ADDRESS = 6, USB_STATE_CONFIGURED = 7, USB_STATE_SUSPENDED = 8 } ; enum usb3_link_state { USB3_LPM_U0 = 0, USB3_LPM_U1 = 1, USB3_LPM_U2 = 2, USB3_LPM_U3 = 3 } ; struct klist_node; struct klist_node { void *n_klist ; struct list_head n_node ; struct kref n_ref ; }; struct dma_map_ops; struct dev_archdata { void *acpi_handle ; struct dma_map_ops *dma_ops ; void *iommu ; }; struct device_private; struct device_driver; struct driver_private; struct class; struct subsys_private; struct bus_type; struct device_node; struct iommu_ops; struct iommu_group; struct bus_attribute { struct attribute attr ; ssize_t (*show)(struct bus_type * , char * ) ; ssize_t (*store)(struct bus_type * , char const * , size_t ) ; }; struct device_attribute; struct driver_attribute; struct bus_type { char const *name ; char const *dev_name ; struct device *dev_root ; struct bus_attribute *bus_attrs ; struct device_attribute *dev_attrs ; struct driver_attribute *drv_attrs ; 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 (*suspend)(struct device * , pm_message_t ) ; int (*resume)(struct device * ) ; struct dev_pm_ops const *pm ; struct iommu_ops *iommu_ops ; struct subsys_private *p ; }; struct device_type; struct device_driver { char const *name ; struct bus_type *bus ; struct module *owner ; char const *mod_name ; bool suppress_bind_attrs ; struct of_device_id const *of_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 driver_attribute { struct attribute attr ; ssize_t (*show)(struct device_driver * , char * ) ; ssize_t (*store)(struct device_driver * , char const * , size_t ) ; }; struct class_attribute; struct class { char const *name ; struct module *owner ; struct class_attribute *class_attrs ; struct device_attribute *dev_attrs ; struct bin_attribute *dev_bin_attrs ; 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 ) ; void const *(*namespace)(struct class * , struct class_attribute const * ) ; }; 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 * ) ; 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 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 ; struct dev_pm_info power ; struct dev_pm_domain *pm_domain ; int numa_node ; u64 *dma_mask ; u64 coherent_dma_mask ; struct device_dma_parameters *dma_parms ; struct list_head dma_pools ; struct dma_coherent_mem *dma_mem ; struct dev_archdata archdata ; struct device_node *of_node ; 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 ; }; struct wakeup_source { char const *name ; struct list_head entry ; spinlock_t lock ; struct timer_list timer ; unsigned long timer_expires ; ktime_t total_time ; ktime_t max_time ; ktime_t last_time ; ktime_t start_prevent_time ; ktime_t prevent_sleep_time ; unsigned long event_count ; unsigned long active_count ; unsigned long relax_count ; unsigned long expire_count ; unsigned long wakeup_count ; bool active ; bool autosleep_enabled ; }; 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 nameidata; struct path; struct vfsmount; struct __anonstruct_ldv_17645_138 { u32 hash ; u32 len ; }; union __anonunion_ldv_17647_137 { struct __anonstruct_ldv_17645_138 ldv_17645 ; u64 hash_len ; }; struct qstr { union __anonunion_ldv_17647_137 ldv_17647 ; unsigned char const *name ; }; struct inode; struct dentry_operations; struct super_block; union __anonunion_d_u_139 { struct list_head d_child ; 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] ; unsigned int d_count ; spinlock_t d_lock ; struct dentry_operations const *d_op ; struct super_block *d_sb ; unsigned long d_time ; void *d_fsdata ; struct list_head d_lru ; union __anonunion_d_u_139 d_u ; struct list_head d_subdirs ; struct hlist_node d_alias ; }; struct dentry_operations { int (*d_revalidate)(struct dentry * , unsigned int ) ; int (*d_hash)(struct dentry const * , struct inode const * , struct qstr * ) ; int (*d_compare)(struct dentry const * , struct inode const * , struct dentry const * , struct inode 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 path { struct vfsmount *mnt ; struct dentry *dentry ; }; struct radix_tree_node; struct radix_tree_root { unsigned int height ; gfp_t gfp_mask ; struct radix_tree_node *rnode ; }; 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 kernel_cap_struct { __u32 cap[2U] ; }; typedef struct kernel_cap_struct kernel_cap_t; struct fiemap_extent { __u64 fe_logical ; __u64 fe_physical ; __u64 fe_length ; __u64 fe_reserved64[2U] ; __u32 fe_flags ; __u32 fe_reserved[3U] ; }; struct shrink_control { gfp_t gfp_mask ; unsigned long nr_to_scan ; }; struct shrinker { int (*shrink)(struct shrinker * , struct shrink_control * ) ; int seeks ; long batch ; struct list_head list ; atomic_long_t nr_in_batch ; }; enum migrate_mode { MIGRATE_ASYNC = 0, MIGRATE_SYNC_LIGHT = 1, MIGRATE_SYNC = 2 } ; struct block_device; struct io_context; struct export_operations; struct iovec; struct kiocb; struct pipe_inode_info; struct poll_table_struct; struct kstatfs; struct swap_info_struct; 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 percpu_counter { raw_spinlock_t lock ; s64 count ; struct list_head list ; s32 *counters ; }; struct fs_disk_quota { __s8 d_version ; __s8 d_flags ; __u16 d_fieldmask ; __u32 d_id ; __u64 d_blk_hardlimit ; __u64 d_blk_softlimit ; __u64 d_ino_hardlimit ; __u64 d_ino_softlimit ; __u64 d_bcount ; __u64 d_icount ; __s32 d_itimer ; __s32 d_btimer ; __u16 d_iwarns ; __u16 d_bwarns ; __s32 d_padding2 ; __u64 d_rtb_hardlimit ; __u64 d_rtb_softlimit ; __u64 d_rtbcount ; __s32 d_rtbtimer ; __u16 d_rtbwarns ; __s16 d_padding3 ; char d_padding4[8U] ; }; struct fs_qfilestat { __u64 qfs_ino ; __u64 qfs_nblks ; __u32 qfs_nextents ; }; typedef struct fs_qfilestat fs_qfilestat_t; struct fs_quota_stat { __s8 qs_version ; __u16 qs_flags ; __s8 qs_pad ; fs_qfilestat_t qs_uquota ; fs_qfilestat_t qs_gquota ; __u32 qs_incoredqs ; __s32 qs_btimelimit ; __s32 qs_itimelimit ; __s32 qs_rtbtimelimit ; __u16 qs_bwarnlimit ; __u16 qs_iwarnlimit ; }; struct dquot; typedef __kernel_uid32_t projid_t; typedef projid_t kprojid_t; struct if_dqinfo { __u64 dqi_bgrace ; __u64 dqi_igrace ; __u32 dqi_flags ; __u32 dqi_valid ; }; enum quota_type { USRQUOTA = 0, GRPQUOTA = 1, PRJQUOTA = 2 } ; typedef long long qsize_t; union __anonunion_ldv_18823_141 { kuid_t uid ; kgid_t gid ; kprojid_t projid ; }; struct kqid { union __anonunion_ldv_18823_141 ldv_18823 ; 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_maxblimit ; qsize_t dqi_maxilimit ; 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 * ) ; }; struct quotactl_ops { int (*quota_on)(struct super_block * , int , int , struct path * ) ; int (*quota_on_meta)(struct super_block * , int , int ) ; int (*quota_off)(struct super_block * , int ) ; int (*quota_sync)(struct super_block * , int ) ; int (*get_info)(struct super_block * , int , struct if_dqinfo * ) ; int (*set_info)(struct super_block * , int , struct if_dqinfo * ) ; int (*get_dqblk)(struct super_block * , struct kqid , struct fs_disk_quota * ) ; int (*set_dqblk)(struct super_block * , struct kqid , struct fs_disk_quota * ) ; int (*get_xstate)(struct super_block * , struct fs_quota_stat * ) ; int (*set_xstate)(struct super_block * , unsigned int , int ) ; }; 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 rw_semaphore dqptr_sem ; struct inode *files[2U] ; struct mem_dqinfo info[2U] ; struct quota_format_ops const *ops[2U] ; }; struct address_space; struct writeback_control; union __anonunion_arg_143 { char *buf ; void *data ; }; struct __anonstruct_read_descriptor_t_142 { size_t written ; size_t count ; union __anonunion_arg_143 arg ; int error ; }; typedef struct __anonstruct_read_descriptor_t_142 read_descriptor_t; 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 long ) ; int (*releasepage)(struct page * , gfp_t ) ; void (*freepage)(struct page * ) ; ssize_t (*direct_IO)(int , struct kiocb * , struct iovec const * , loff_t , unsigned long ) ; int (*get_xip_mem)(struct address_space * , unsigned long , int , void ** , unsigned long * ) ; int (*migratepage)(struct address_space * , struct page * , struct page * , enum migrate_mode ) ; int (*launder_page)(struct page * ) ; int (*is_partially_uptodate)(struct page * , read_descriptor_t * , unsigned long ) ; 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 backing_dev_info; struct address_space { struct inode *host ; struct radix_tree_root page_tree ; spinlock_t tree_lock ; unsigned int i_mmap_writable ; struct rb_root i_mmap ; struct list_head i_mmap_nonlinear ; struct mutex i_mmap_mutex ; unsigned long nrpages ; unsigned long writeback_index ; struct address_space_operations const *a_ops ; unsigned long flags ; struct backing_dev_info *backing_dev_info ; spinlock_t private_lock ; struct list_head private_list ; struct address_space *assoc_mapping ; }; 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_ldv_19259_144 { unsigned int const i_nlink ; unsigned int __i_nlink ; }; union __anonunion_ldv_19279_145 { struct hlist_head i_dentry ; struct callback_head i_rcu ; }; struct file_lock; struct cdev; union __anonunion_ldv_19295_146 { struct pipe_inode_info *i_pipe ; struct block_device *i_bdev ; struct cdev *i_cdev ; }; 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_ldv_19259_144 ldv_19259 ; dev_t i_rdev ; loff_t i_size ; struct timespec i_atime ; struct timespec i_mtime ; struct timespec i_ctime ; spinlock_t i_lock ; unsigned short i_bytes ; unsigned int i_blkbits ; blkcnt_t i_blocks ; unsigned long i_state ; struct mutex i_mutex ; unsigned long dirtied_when ; struct hlist_node i_hash ; struct list_head i_wb_list ; struct list_head i_lru ; struct list_head i_sb_list ; union __anonunion_ldv_19279_145 ldv_19279 ; u64 i_version ; atomic_t i_count ; atomic_t i_dio_count ; atomic_t i_writecount ; struct file_operations const *i_fop ; struct file_lock *i_flock ; struct address_space i_data ; struct dquot *i_dquot[2U] ; struct list_head i_devices ; union __anonunion_ldv_19295_146 ldv_19295 ; __u32 i_generation ; __u32 i_fsnotify_mask ; struct hlist_head i_fsnotify_marks ; atomic_t i_readcount ; 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_147 { struct list_head fu_list ; struct callback_head fu_rcuhead ; }; struct file { union __anonunion_f_u_147 f_u ; struct path f_path ; struct file_operations const *f_op ; spinlock_t f_lock ; int f_sb_list_cpu ; atomic_long_t f_count ; unsigned int f_flags ; fmode_t f_mode ; 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 ; unsigned long f_mnt_write_state ; }; struct files_struct; typedef struct files_struct *fl_owner_t; 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 * ) ; void (*lm_notify)(struct file_lock * ) ; int (*lm_grant)(struct file_lock * , struct file_lock * , int ) ; void (*lm_break)(struct file_lock * ) ; int (*lm_change)(struct file_lock ** , int ) ; }; 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_149 { struct list_head link ; int state ; }; union __anonunion_fl_u_148 { struct nfs_lock_info nfs_fl ; struct nfs4_lock_info nfs4_fl ; struct __anonstruct_afs_149 afs ; }; struct file_lock { struct file_lock *fl_next ; struct list_head fl_link ; struct list_head fl_block ; fl_owner_t fl_owner ; unsigned int fl_flags ; unsigned char fl_type ; unsigned int fl_pid ; 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_148 fl_u ; }; 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 file_system_type; 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_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_files ; struct list_head s_mounts ; struct list_head s_dentry_lru ; int s_nr_dentry_unused ; spinlock_t s_inode_lru_lock ; struct list_head s_inode_lru ; int s_nr_inodes_unused ; struct block_device *s_bdev ; struct backing_dev_info *s_bdi ; struct mtd_info *s_mtd ; struct hlist_node s_instances ; struct quota_info s_dquot ; struct sb_writers s_writers ; char s_id[32U] ; u8 s_uuid[16U] ; void *s_fs_info ; unsigned int s_max_links ; fmode_t s_mode ; u32 s_time_gran ; struct mutex s_vfs_rename_mutex ; char *s_subtype ; char *s_options ; 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 fiemap_extent_info { unsigned int fi_flags ; unsigned int fi_extents_mapped ; unsigned int fi_extents_max ; struct fiemap_extent *fi_extents_start ; }; 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 (*aio_read)(struct kiocb * , struct iovec const * , unsigned long , loff_t ) ; ssize_t (*aio_write)(struct kiocb * , struct iovec const * , unsigned long , loff_t ) ; int (*readdir)(struct file * , void * , int (*)(void * , char const * , int , loff_t , u64 , unsigned int ) ) ; 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 (*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 ** ) ; long (*fallocate)(struct file * , int , loff_t , loff_t ) ; }; struct inode_operations { struct dentry *(*lookup)(struct inode * , struct dentry * , unsigned int ) ; void *(*follow_link)(struct dentry * , struct nameidata * ) ; int (*permission)(struct inode * , int ) ; struct posix_acl *(*get_acl)(struct inode * , int ) ; int (*readlink)(struct dentry * , char * , int ) ; void (*put_link)(struct dentry * , struct nameidata * , void * ) ; int (*create)(struct inode * , struct dentry * , umode_t , bool ) ; int (*link)(struct dentry * , struct inode * , struct dentry * ) ; int (*unlink)(struct inode * , struct dentry * ) ; int (*symlink)(struct inode * , struct dentry * , 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 * ) ; void (*truncate)(struct inode * ) ; 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 * ) ; }; struct super_operations { struct inode *(*alloc_inode)(struct super_block * ) ; void (*destroy_inode)(struct inode * ) ; void (*dirty_inode)(struct inode * , int ) ; int (*write_inode)(struct inode * , struct writeback_control * ) ; int (*drop_inode)(struct inode * ) ; void (*evict_inode)(struct inode * ) ; void (*put_super)(struct super_block * ) ; int (*sync_fs)(struct super_block * , int ) ; int (*freeze_fs)(struct super_block * ) ; int (*unfreeze_fs)(struct super_block * ) ; int (*statfs)(struct dentry * , struct kstatfs * ) ; int (*remount_fs)(struct super_block * , int * , char * ) ; void (*umount_begin)(struct super_block * ) ; int (*show_options)(struct seq_file * , struct dentry * ) ; int (*show_devname)(struct seq_file * , struct dentry * ) ; int (*show_path)(struct seq_file * , struct dentry * ) ; int (*show_stats)(struct seq_file * , struct dentry * ) ; ssize_t (*quota_read)(struct super_block * , int , char * , size_t , loff_t ) ; ssize_t (*quota_write)(struct super_block * , int , char const * , size_t , loff_t ) ; int (*bdev_try_to_free_page)(struct super_block * , struct page * , gfp_t ) ; int (*nr_cached_objects)(struct super_block * ) ; void (*free_cached_objects)(struct super_block * , int ) ; }; 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 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 uprobe; struct uprobe_task { enum uprobe_task_state state ; struct arch_uprobe_task autask ; struct uprobe *active_uprobe ; unsigned long xol_vaddr ; unsigned long vaddr ; }; struct xol_area { wait_queue_head_t wq ; atomic_t slot_count ; unsigned long *bitmap ; struct page *page ; unsigned long vaddr ; }; struct uprobes_state { struct xol_area *xol_area ; }; union __anonunion_ldv_21385_151 { unsigned long index ; void *freelist ; bool pfmemalloc ; }; struct __anonstruct_ldv_21395_155 { unsigned short inuse ; unsigned short objects : 15 ; unsigned char frozen : 1 ; }; union __anonunion_ldv_21397_154 { atomic_t _mapcount ; struct __anonstruct_ldv_21395_155 ldv_21395 ; int units ; }; struct __anonstruct_ldv_21399_153 { union __anonunion_ldv_21397_154 ldv_21397 ; atomic_t _count ; }; union __anonunion_ldv_21400_152 { unsigned long counters ; struct __anonstruct_ldv_21399_153 ldv_21399 ; }; struct __anonstruct_ldv_21401_150 { union __anonunion_ldv_21385_151 ldv_21385 ; union __anonunion_ldv_21400_152 ldv_21400 ; }; struct __anonstruct_ldv_21408_157 { struct page *next ; int pages ; int pobjects ; }; struct slab; struct __anonstruct_ldv_21414_158 { struct kmem_cache *slab_cache ; struct slab *slab_page ; }; union __anonunion_ldv_21415_156 { struct list_head lru ; struct __anonstruct_ldv_21408_157 ldv_21408 ; struct list_head list ; struct __anonstruct_ldv_21414_158 ldv_21414 ; }; union __anonunion_ldv_21420_159 { unsigned long private ; struct kmem_cache *slab ; struct page *first_page ; }; struct page { unsigned long flags ; struct address_space *mapping ; struct __anonstruct_ldv_21401_150 ldv_21401 ; union __anonunion_ldv_21415_156 ldv_21415 ; union __anonunion_ldv_21420_159 ldv_21420 ; unsigned long debug_flags ; }; struct page_frag { struct page *page ; __u32 offset ; __u32 size ; }; struct __anonstruct_linear_161 { struct rb_node rb ; unsigned long rb_subtree_last ; }; union __anonunion_shared_160 { struct __anonstruct_linear_161 linear ; struct list_head nonlinear ; }; struct anon_vma; struct vm_operations_struct; struct mempolicy; struct vm_area_struct { struct mm_struct *vm_mm ; unsigned long vm_start ; unsigned long vm_end ; struct vm_area_struct *vm_next ; struct vm_area_struct *vm_prev ; pgprot_t vm_page_prot ; unsigned long vm_flags ; struct rb_node vm_rb ; union __anonunion_shared_160 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 mm_rss_stat { atomic_long_t count[3U] ; }; struct linux_binfmt; struct mmu_notifier_mm; struct mm_struct { struct vm_area_struct *mmap ; struct rb_root mm_rb ; struct vm_area_struct *mmap_cache ; unsigned long (*get_unmapped_area)(struct file * , unsigned long , unsigned long , unsigned long , unsigned long ) ; void (*unmap_area)(struct mm_struct * , unsigned long ) ; unsigned long mmap_base ; unsigned long task_size ; unsigned long cached_hole_size ; unsigned long free_area_cache ; pgd_t *pgd ; atomic_t mm_users ; atomic_t mm_count ; 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 nr_ptes ; 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[44U] ; 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 hlist_head ioctx_list ; struct task_struct *owner ; struct file *exe_file ; struct mmu_notifier_mm *mmu_notifier_mm ; pgtable_t pmd_huge_pte ; struct cpumask cpumask_allocation ; struct uprobes_state uprobes_state ; }; typedef unsigned long cputime_t; struct sem_undo_list; struct sysv_sem { struct sem_undo_list *undo_list ; }; struct siginfo; struct __anonstruct_sigset_t_162 { unsigned long sig[1U] ; }; typedef struct __anonstruct_sigset_t_162 sigset_t; typedef void __signalfn_t(int ); typedef __signalfn_t *__sighandler_t; typedef void __restorefn_t(void); typedef __restorefn_t *__sigrestore_t; struct sigaction { __sighandler_t sa_handler ; unsigned long sa_flags ; __sigrestore_t sa_restorer ; sigset_t sa_mask ; }; struct k_sigaction { struct sigaction sa ; }; union sigval { int sival_int ; void *sival_ptr ; }; typedef union sigval sigval_t; struct __anonstruct__kill_164 { __kernel_pid_t _pid ; __kernel_uid32_t _uid ; }; struct __anonstruct__timer_165 { __kernel_timer_t _tid ; int _overrun ; char _pad[0U] ; sigval_t _sigval ; int _sys_private ; }; struct __anonstruct__rt_166 { __kernel_pid_t _pid ; __kernel_uid32_t _uid ; sigval_t _sigval ; }; struct __anonstruct__sigchld_167 { __kernel_pid_t _pid ; __kernel_uid32_t _uid ; int _status ; __kernel_clock_t _utime ; __kernel_clock_t _stime ; }; struct __anonstruct__sigfault_168 { void *_addr ; short _addr_lsb ; }; struct __anonstruct__sigpoll_169 { long _band ; int _fd ; }; struct __anonstruct__sigsys_170 { void *_call_addr ; int _syscall ; unsigned int _arch ; }; union __anonunion__sifields_163 { int _pad[28U] ; struct __anonstruct__kill_164 _kill ; struct __anonstruct__timer_165 _timer ; struct __anonstruct__rt_166 _rt ; struct __anonstruct__sigchld_167 _sigchld ; struct __anonstruct__sigfault_168 _sigfault ; struct __anonstruct__sigpoll_169 _sigpoll ; struct __anonstruct__sigsys_170 _sigsys ; }; struct siginfo { int si_signo ; int si_errno ; int si_code ; union __anonunion__sifields_163 _sifields ; }; typedef struct siginfo siginfo_t; struct user_struct; struct sigpending { struct list_head list ; sigset_t signal ; }; struct seccomp_filter; struct seccomp { int mode ; struct seccomp_filter *filter ; }; struct plist_head { struct list_head node_list ; }; struct plist_node { int prio ; struct list_head prio_list ; struct list_head node_list ; }; struct rt_mutex_waiter; struct rlimit { unsigned long rlim_cur ; unsigned long rlim_max ; }; 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 ; }; typedef int32_t key_serial_t; typedef uint32_t key_perm_t; struct key; struct signal_struct; struct key_type; struct keyring_list; union __anonunion_ldv_22238_173 { struct list_head graveyard_link ; struct rb_node serial_node ; }; struct key_user; union __anonunion_ldv_22247_174 { time_t expiry ; time_t revoked_at ; }; union __anonunion_type_data_175 { struct list_head link ; unsigned long x[2U] ; void *p[2U] ; int reject_error ; }; union __anonunion_payload_176 { unsigned long value ; void *rcudata ; void *data ; struct keyring_list *subscriptions ; }; struct key { atomic_t usage ; key_serial_t serial ; union __anonunion_ldv_22238_173 ldv_22238 ; struct key_type *type ; struct rw_semaphore sem ; struct key_user *user ; void *security ; union __anonunion_ldv_22247_174 ldv_22247 ; time_t last_used_at ; kuid_t uid ; kgid_t gid ; key_perm_t perm ; unsigned short quotalen ; unsigned short datalen ; unsigned long flags ; char *description ; union __anonunion_type_data_175 type_data ; union __anonunion_payload_176 payload ; }; struct audit_context; struct group_info { atomic_t usage ; int ngroups ; int nblocks ; kgid_t small_block[32U] ; kgid_t *blocks[0U] ; }; struct thread_group_cred { atomic_t usage ; pid_t tgid ; spinlock_t lock ; struct key *session_keyring ; struct key *process_keyring ; struct callback_head rcu ; }; 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 *thread_keyring ; struct key *request_key_auth ; struct thread_group_cred *tgcred ; void *security ; struct user_struct *user ; struct user_namespace *user_ns ; struct group_info *group_info ; struct callback_head rcu ; }; struct llist_node; struct llist_node { struct llist_node *next ; }; struct futex_pi_state; struct robust_list_head; struct bio_list; struct fs_struct; struct perf_event_context; struct blk_plug; struct cfs_rq; struct task_group; struct io_event { __u64 data ; __u64 obj ; __s64 res ; __s64 res2 ; }; struct iovec { void *iov_base ; __kernel_size_t iov_len ; }; struct kioctx; union __anonunion_ki_obj_177 { void *user ; struct task_struct *tsk ; }; struct eventfd_ctx; struct kiocb { struct list_head ki_run_list ; unsigned long ki_flags ; int ki_users ; unsigned int ki_key ; struct file *ki_filp ; struct kioctx *ki_ctx ; int (*ki_cancel)(struct kiocb * , struct io_event * ) ; ssize_t (*ki_retry)(struct kiocb * ) ; void (*ki_dtor)(struct kiocb * ) ; union __anonunion_ki_obj_177 ki_obj ; __u64 ki_user_data ; loff_t ki_pos ; void *private ; unsigned short ki_opcode ; size_t ki_nbytes ; char *ki_buf ; size_t ki_left ; struct iovec ki_inline_vec ; struct iovec *ki_iovec ; unsigned long ki_nr_segs ; unsigned long ki_cur_seg ; struct list_head ki_list ; struct list_head ki_batch ; struct eventfd_ctx *ki_eventfd ; }; struct aio_ring_info { unsigned long mmap_base ; unsigned long mmap_size ; struct page **ring_pages ; spinlock_t ring_lock ; long nr_pages ; unsigned int nr ; unsigned int tail ; struct page *internal_pages[8U] ; }; struct kioctx { atomic_t users ; int dead ; struct mm_struct *mm ; unsigned long user_id ; struct hlist_node list ; wait_queue_head_t wait ; spinlock_t ctx_lock ; int reqs_active ; struct list_head active_reqs ; struct list_head run_list ; unsigned int max_reqs ; struct aio_ring_info ring_info ; struct delayed_work wq ; struct callback_head callback_head ; }; 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 task_cputime { cputime_t utime ; cputime_t stime ; unsigned long long sum_exec_runtime ; }; struct thread_group_cputimer { struct task_cputime cputime ; int running ; raw_spinlock_t lock ; }; struct autogroup; struct tty_struct; struct taskstats; struct tty_audit_buf; struct signal_struct { atomic_t sigcnt ; atomic_t live ; int nr_threads ; 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 ; struct list_head posix_timers ; struct hrtimer real_timer ; struct pid *leader_pid ; ktime_t it_real_incr ; struct cpu_itimer it[2U] ; struct thread_group_cputimer cputimer ; struct task_cputime cputime_expires ; struct list_head cpu_timers[3U] ; struct pid *tty_old_pgrp ; int leader ; struct tty_struct *tty ; struct autogroup *autogroup ; cputime_t utime ; cputime_t stime ; cputime_t cutime ; cputime_t cstime ; cputime_t gtime ; cputime_t cgtime ; cputime_t prev_utime ; cputime_t prev_stime ; unsigned long nvcsw ; unsigned long nivcsw ; unsigned long cnvcsw ; unsigned long cnivcsw ; unsigned long min_flt ; unsigned long maj_flt ; unsigned long cmin_flt ; unsigned long cmaj_flt ; unsigned long inblock ; unsigned long oublock ; unsigned long cinblock ; unsigned long coublock ; unsigned long maxrss ; unsigned long cmaxrss ; struct task_io_accounting ioac ; unsigned long long sum_sched_runtime ; struct rlimit rlim[16U] ; struct pacct_struct pacct ; struct taskstats *stats ; unsigned int audit_tty ; struct tty_audit_buf *tty_audit_buf ; struct rw_semaphore group_rwsem ; int oom_score_adj ; int oom_score_adj_min ; struct mutex cred_guard_mutex ; }; struct user_struct { atomic_t __count ; atomic_t processes ; atomic_t files ; 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 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 ; struct timespec blkio_start ; struct timespec blkio_end ; u64 blkio_delay ; u64 swapin_delay ; u32 blkio_count ; u32 swapin_count ; struct timespec freepages_start ; struct timespec freepages_end ; u64 freepages_delay ; u32 freepages_count ; }; struct rq; struct sched_class { struct sched_class const *next ; void (*enqueue_task)(struct rq * , struct task_struct * , int ) ; void (*dequeue_task)(struct rq * , struct task_struct * , int ) ; void (*yield_task)(struct rq * ) ; bool (*yield_to_task)(struct rq * , struct task_struct * , bool ) ; void (*check_preempt_curr)(struct rq * , struct task_struct * , int ) ; struct task_struct *(*pick_next_task)(struct rq * ) ; void (*put_prev_task)(struct rq * , struct task_struct * ) ; int (*select_task_rq)(struct task_struct * , int , int ) ; void (*pre_schedule)(struct rq * , struct task_struct * ) ; void (*post_schedule)(struct rq * ) ; void (*task_waking)(struct task_struct * ) ; void (*task_woken)(struct rq * , struct task_struct * ) ; void (*set_cpus_allowed)(struct task_struct * , struct cpumask const * ) ; void (*rq_online)(struct rq * ) ; void (*rq_offline)(struct rq * ) ; void (*set_curr_task)(struct rq * ) ; void (*task_tick)(struct rq * , struct task_struct * , int ) ; void (*task_fork)(struct task_struct * ) ; void (*switched_from)(struct rq * , struct task_struct * ) ; void (*switched_to)(struct rq * , struct task_struct * ) ; void (*prio_changed)(struct rq * , struct task_struct * , int ) ; unsigned int (*get_rr_interval)(struct rq * , struct task_struct * ) ; void (*task_move_group)(struct task_struct * , int ) ; }; struct load_weight { unsigned long weight ; unsigned long inv_weight ; }; 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 ; struct sched_entity *parent ; struct cfs_rq *cfs_rq ; struct cfs_rq *my_q ; }; struct rt_rq; struct sched_rt_entity { struct list_head run_list ; unsigned long timeout ; 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 mem_cgroup; struct memcg_batch_info { int do_batch ; struct mem_cgroup *memcg ; unsigned long nr_pages ; unsigned long memsw_nr_pages ; }; struct css_set; struct compat_robust_list_head; 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 ; 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 hlist_head preempt_notifiers ; unsigned char fpu_counter ; unsigned int policy ; int nr_cpus_allowed ; cpumask_t cpus_allowed ; struct sched_info sched_info ; struct list_head tasks ; struct plist_node pushable_tasks ; struct mm_struct *mm ; struct mm_struct *active_mm ; unsigned char brk_randomized : 1 ; int exit_state ; int exit_code ; int exit_signal ; int pdeath_signal ; unsigned int jobctl ; unsigned int personality ; unsigned char did_exec : 1 ; unsigned char in_execve : 1 ; unsigned char in_iowait : 1 ; unsigned char no_new_privs : 1 ; unsigned char sched_reset_on_fork : 1 ; unsigned char sched_contributes_to_load : 1 ; pid_t pid ; pid_t tgid ; unsigned long stack_canary ; 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 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 ; cputime_t prev_utime ; cputime_t prev_stime ; unsigned long nvcsw ; unsigned long nivcsw ; struct timespec start_time ; struct timespec 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] ; int link_count ; int total_link_count ; struct sysv_sem sysvsem ; 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 plist_head pi_waiters ; 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 ; struct callback_head rcu ; struct pipe_inode_info *splice_pipe ; struct page_frag task_frag ; struct task_delay_info *delays ; int make_it_fail ; int nr_dirtied ; int nr_dirtied_pause ; unsigned long dirty_paused_when ; int latency_record_count ; struct latency_record latency_record[32U] ; unsigned long timer_slack_ns ; unsigned long default_timer_slack_ns ; unsigned long trace ; unsigned long trace_recursion ; struct memcg_batch_info memcg_batch ; atomic_t ptrace_bp_refcnt ; struct uprobe_task *utask ; }; struct usb_device; struct usb_driver; struct wusb_dev; struct ep_device; struct usb_host_endpoint { struct usb_endpoint_descriptor desc ; struct usb_ss_ep_comp_descriptor ss_ep_comp ; struct list_head urb_list ; void *hcpriv ; struct ep_device *ep_dev ; unsigned char *extra ; int extralen ; int enabled ; }; struct usb_host_interface { struct usb_interface_descriptor desc ; int extralen ; unsigned char *extra ; struct usb_host_endpoint *endpoint ; char *string ; }; enum usb_interface_condition { USB_INTERFACE_UNBOUND = 0, USB_INTERFACE_BINDING = 1, USB_INTERFACE_BOUND = 2, USB_INTERFACE_UNBINDING = 3 } ; struct usb_interface { struct usb_host_interface *altsetting ; struct usb_host_interface *cur_altsetting ; unsigned int num_altsetting ; struct usb_interface_assoc_descriptor *intf_assoc ; int minor ; enum usb_interface_condition condition ; unsigned char sysfs_files_created : 1 ; unsigned char ep_devs_created : 1 ; unsigned char unregistering : 1 ; unsigned char needs_remote_wakeup : 1 ; unsigned char needs_altsetting0 : 1 ; unsigned char needs_binding : 1 ; unsigned char reset_running : 1 ; unsigned char resetting_device : 1 ; struct device dev ; struct device *usb_dev ; atomic_t pm_usage_cnt ; struct work_struct reset_ws ; }; struct usb_interface_cache { unsigned int num_altsetting ; struct kref ref ; struct usb_host_interface altsetting[0U] ; }; struct usb_host_config { struct usb_config_descriptor desc ; char *string ; struct usb_interface_assoc_descriptor *intf_assoc[16U] ; struct usb_interface *interface[32U] ; struct usb_interface_cache *intf_cache[32U] ; unsigned char *extra ; int extralen ; }; struct usb_host_bos { struct usb_bos_descriptor *desc ; struct usb_ext_cap_descriptor *ext_cap ; struct usb_ss_cap_descriptor *ss_cap ; struct usb_ss_container_id_descriptor *ss_id ; }; struct usb_devmap { unsigned long devicemap[2U] ; }; struct mon_bus; struct usb_bus { struct device *controller ; int busnum ; char const *bus_name ; u8 uses_dma ; u8 uses_pio_for_control ; u8 otg_port ; unsigned char is_b_host : 1 ; unsigned char b_hnp_enable : 1 ; unsigned char no_stop_on_short : 1 ; unsigned int sg_tablesize ; int devnum_next ; struct usb_devmap devmap ; struct usb_device *root_hub ; struct usb_bus *hs_companion ; struct list_head bus_list ; int bandwidth_allocated ; int bandwidth_int_reqs ; int bandwidth_isoc_reqs ; struct mon_bus *mon_bus ; int monitored ; }; struct usb_tt; enum usb_device_removable { USB_DEVICE_REMOVABLE_UNKNOWN = 0, USB_DEVICE_REMOVABLE = 1, USB_DEVICE_FIXED = 2 } ; struct usb3_lpm_parameters { unsigned int mel ; unsigned int pel ; unsigned int sel ; int timeout ; }; struct usb_device { int devnum ; char devpath[16U] ; u32 route ; enum usb_device_state state ; enum usb_device_speed speed ; struct usb_tt *tt ; int ttport ; unsigned int toggle[2U] ; struct usb_device *parent ; struct usb_bus *bus ; struct usb_host_endpoint ep0 ; struct device dev ; struct usb_device_descriptor descriptor ; struct usb_host_bos *bos ; struct usb_host_config *config ; struct usb_host_config *actconfig ; struct usb_host_endpoint *ep_in[16U] ; struct usb_host_endpoint *ep_out[16U] ; char **rawdescriptors ; unsigned short bus_mA ; u8 portnum ; u8 level ; unsigned char can_submit : 1 ; unsigned char persist_enabled : 1 ; unsigned char have_langid : 1 ; unsigned char authorized : 1 ; unsigned char authenticated : 1 ; unsigned char wusb : 1 ; unsigned char lpm_capable : 1 ; unsigned char usb2_hw_lpm_capable : 1 ; unsigned char usb2_hw_lpm_enabled : 1 ; unsigned char usb3_lpm_enabled : 1 ; int string_langid ; char *product ; char *manufacturer ; char *serial ; struct list_head filelist ; int maxchild ; u32 quirks ; atomic_t urbnum ; unsigned long active_duration ; unsigned long connect_time ; unsigned char do_remote_wakeup : 1 ; unsigned char reset_resume : 1 ; struct wusb_dev *wusb_dev ; int slot_id ; enum usb_device_removable removable ; struct usb3_lpm_parameters u1_params ; struct usb3_lpm_parameters u2_params ; unsigned int lpm_disable_count ; }; struct usb_dynids { spinlock_t lock ; struct list_head list ; }; struct usbdrv_wrap { struct device_driver driver ; int for_devices ; }; struct usb_driver { char const *name ; int (*probe)(struct usb_interface * , struct usb_device_id const * ) ; void (*disconnect)(struct usb_interface * ) ; int (*unlocked_ioctl)(struct usb_interface * , unsigned int , void * ) ; int (*suspend)(struct usb_interface * , pm_message_t ) ; int (*resume)(struct usb_interface * ) ; int (*reset_resume)(struct usb_interface * ) ; int (*pre_reset)(struct usb_interface * ) ; int (*post_reset)(struct usb_interface * ) ; struct usb_device_id const *id_table ; struct usb_dynids dynids ; struct usbdrv_wrap drvwrap ; unsigned char no_dynamic_id : 1 ; unsigned char supports_autosuspend : 1 ; unsigned char disable_hub_initiated_lpm : 1 ; unsigned char soft_unbind : 1 ; }; struct usb_device_driver { char const *name ; int (*probe)(struct usb_device * ) ; void (*disconnect)(struct usb_device * ) ; int (*suspend)(struct usb_device * , pm_message_t ) ; int (*resume)(struct usb_device * , pm_message_t ) ; struct usbdrv_wrap drvwrap ; unsigned char supports_autosuspend : 1 ; }; struct usb_iso_packet_descriptor { unsigned int offset ; unsigned int length ; unsigned int actual_length ; int status ; }; struct urb; struct usb_anchor { struct list_head urb_list ; wait_queue_head_t wait ; spinlock_t lock ; unsigned char poisoned : 1 ; }; struct scatterlist; struct urb { struct kref kref ; void *hcpriv ; atomic_t use_count ; atomic_t reject ; int unlinked ; struct list_head urb_list ; struct list_head anchor_list ; struct usb_anchor *anchor ; struct usb_device *dev ; struct usb_host_endpoint *ep ; unsigned int pipe ; unsigned int stream_id ; int status ; unsigned int transfer_flags ; void *transfer_buffer ; dma_addr_t transfer_dma ; struct scatterlist *sg ; int num_mapped_sgs ; int num_sgs ; u32 transfer_buffer_length ; u32 actual_length ; unsigned char *setup_packet ; dma_addr_t setup_dma ; int start_frame ; int number_of_packets ; int interval ; int error_count ; void *context ; void (*complete)(struct urb * ) ; struct usb_iso_packet_descriptor iso_frame_desc[0U] ; }; struct hc_driver; struct usb_phy; struct dma_pool; struct usb_hcd { struct usb_bus self ; struct kref kref ; char const *product_desc ; int speed ; char irq_descr[24U] ; struct timer_list rh_timer ; struct urb *status_urb ; struct work_struct wakeup_work ; struct hc_driver const *driver ; struct usb_phy *phy ; unsigned long flags ; unsigned char rh_registered : 1 ; unsigned char rh_pollable : 1 ; unsigned char msix_enabled : 1 ; unsigned char uses_new_polling : 1 ; unsigned char wireless : 1 ; unsigned char authorized_default : 1 ; unsigned char has_tt : 1 ; unsigned int irq ; void *regs ; resource_size_t rsrc_start ; resource_size_t rsrc_len ; unsigned int power_budget ; struct mutex *bandwidth_mutex ; struct usb_hcd *shared_hcd ; struct usb_hcd *primary_hcd ; struct dma_pool *pool[4U] ; int state ; unsigned long hcd_priv[0U] ; }; struct hc_driver { char const *description ; char const *product_desc ; size_t hcd_priv_size ; irqreturn_t (*irq)(struct usb_hcd * ) ; int flags ; int (*reset)(struct usb_hcd * ) ; int (*start)(struct usb_hcd * ) ; int (*pci_suspend)(struct usb_hcd * , bool ) ; int (*pci_resume)(struct usb_hcd * , bool ) ; void (*stop)(struct usb_hcd * ) ; void (*shutdown)(struct usb_hcd * ) ; int (*get_frame_number)(struct usb_hcd * ) ; int (*urb_enqueue)(struct usb_hcd * , struct urb * , gfp_t ) ; int (*urb_dequeue)(struct usb_hcd * , struct urb * , int ) ; int (*map_urb_for_dma)(struct usb_hcd * , struct urb * , gfp_t ) ; void (*unmap_urb_for_dma)(struct usb_hcd * , struct urb * ) ; void (*endpoint_disable)(struct usb_hcd * , struct usb_host_endpoint * ) ; void (*endpoint_reset)(struct usb_hcd * , struct usb_host_endpoint * ) ; int (*hub_status_data)(struct usb_hcd * , char * ) ; int (*hub_control)(struct usb_hcd * , u16 , u16 , u16 , char * , u16 ) ; int (*bus_suspend)(struct usb_hcd * ) ; int (*bus_resume)(struct usb_hcd * ) ; int (*start_port_reset)(struct usb_hcd * , unsigned int ) ; void (*relinquish_port)(struct usb_hcd * , int ) ; int (*port_handed_over)(struct usb_hcd * , int ) ; void (*clear_tt_buffer_complete)(struct usb_hcd * , struct usb_host_endpoint * ) ; int (*alloc_dev)(struct usb_hcd * , struct usb_device * ) ; void (*free_dev)(struct usb_hcd * , struct usb_device * ) ; int (*alloc_streams)(struct usb_hcd * , struct usb_device * , struct usb_host_endpoint ** , unsigned int , unsigned int , gfp_t ) ; int (*free_streams)(struct usb_hcd * , struct usb_device * , struct usb_host_endpoint ** , unsigned int , gfp_t ) ; int (*add_endpoint)(struct usb_hcd * , struct usb_device * , struct usb_host_endpoint * ) ; int (*drop_endpoint)(struct usb_hcd * , struct usb_device * , struct usb_host_endpoint * ) ; int (*check_bandwidth)(struct usb_hcd * , struct usb_device * ) ; void (*reset_bandwidth)(struct usb_hcd * , struct usb_device * ) ; int (*address_device)(struct usb_hcd * , struct usb_device * ) ; int (*update_hub_device)(struct usb_hcd * , struct usb_device * , struct usb_tt * , gfp_t ) ; int (*reset_device)(struct usb_hcd * , struct usb_device * ) ; int (*update_device)(struct usb_hcd * , struct usb_device * ) ; int (*set_usb2_hw_lpm)(struct usb_hcd * , struct usb_device * , int ) ; int (*enable_usb3_lpm_timeout)(struct usb_hcd * , struct usb_device * , enum usb3_link_state ) ; int (*disable_usb3_lpm_timeout)(struct usb_hcd * , struct usb_device * , enum usb3_link_state ) ; }; struct usb_tt { struct usb_device *hub ; int multi ; unsigned int think_time ; spinlock_t lock ; struct list_head clear_list ; struct work_struct clear_work ; }; struct seq_file { char *buf ; size_t size ; size_t from ; size_t count ; loff_t index ; loff_t read_pos ; u64 version ; struct mutex lock ; struct seq_operations const *op ; int poll_event ; 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 vm_fault { unsigned int flags ; unsigned long pgoff ; void *virtual_address ; struct page *page ; }; 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 * ) ; int (*page_mkwrite)(struct vm_area_struct * , struct vm_fault * ) ; int (*access)(struct vm_area_struct * , unsigned long , void * , int , int ) ; int (*set_policy)(struct vm_area_struct * , struct mempolicy * ) ; struct mempolicy *(*get_policy)(struct vm_area_struct * , unsigned long ) ; int (*migrate)(struct vm_area_struct * , nodemask_t const * , nodemask_t const * , unsigned long ) ; int (*remap_pages)(struct vm_area_struct * , unsigned long , unsigned long , 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 find_interface_arg { int minor ; struct device_driver *drv ; }; typedef int ldv_func_ret_type___2; struct _ddebug { char const *modname ; char const *function ; char const *filename ; char const *format ; unsigned int lineno : 18 ; unsigned char flags ; }; struct atomic_notifier_head; struct exec_domain; struct map_segment; struct exec_domain { char const *name ; void (*handler)(int , struct pt_regs * ) ; unsigned char pers_low ; unsigned char pers_high ; unsigned long *signal_map ; unsigned long *signal_invmap ; struct map_segment *err_map ; struct map_segment *socktype_map ; struct map_segment *sockopt_map ; struct map_segment *af_map ; struct module *module ; struct exec_domain *next ; }; struct __anonstruct_mm_segment_t_27 { unsigned long seg ; }; typedef struct __anonstruct_mm_segment_t_27 mm_segment_t; struct compat_timespec; struct __anonstruct_futex_32 { u32 *uaddr ; u32 val ; u32 flags ; u32 bitset ; u64 time ; u32 *uaddr2 ; }; struct __anonstruct_nanosleep_33 { clockid_t clockid ; struct timespec *rmtp ; struct compat_timespec *compat_rmtp ; u64 expires ; }; struct pollfd; struct __anonstruct_poll_34 { struct pollfd *ufds ; int nfds ; int has_timeout ; unsigned long tv_sec ; unsigned long tv_nsec ; }; union __anonunion_ldv_6369_31 { struct __anonstruct_futex_32 futex ; struct __anonstruct_nanosleep_33 nanosleep ; struct __anonstruct_poll_34 poll ; }; struct restart_block { long (*fn)(struct restart_block * ) ; union __anonunion_ldv_6369_31 ldv_6369 ; }; struct thread_info { struct task_struct *task ; struct exec_domain *exec_domain ; __u32 flags ; __u32 status ; __u32 cpu ; int preempt_count ; mm_segment_t addr_limit ; struct restart_block restart_block ; void *sysenter_return ; unsigned char sig_on_uaccess_error : 1 ; unsigned char uaccess_err : 1 ; }; 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; struct atomic_notifier_head { spinlock_t lock ; struct notifier_block *head ; }; struct usb_qualifier_descriptor { __u8 bLength ; __u8 bDescriptorType ; __le16 bcdUSB ; __u8 bDeviceClass ; __u8 bDeviceSubClass ; __u8 bDeviceProtocol ; __u8 bMaxPacketSize0 ; __u8 bNumConfigurations ; __u8 bRESERVED ; }; struct usb_otg_descriptor { __u8 bLength ; __u8 bDescriptorType ; __u8 bmAttributes ; }; struct usb_set_sel_req { __u8 u1_sel ; __u8 u1_pel ; __le16 u2_sel ; __le16 u2_pel ; }; enum usb_port_connect_type { USB_PORT_CONNECT_TYPE_UNKNOWN = 0, USB_PORT_CONNECT_TYPE_HOT_PLUG = 1, USB_PORT_CONNECT_TYPE_HARD_WIRED = 2, USB_PORT_NOT_USED = 3 } ; struct usbdevfs_hub_portinfo { char nports ; char port[127U] ; }; typedef s32 compat_time_t; typedef s32 compat_long_t; typedef u32 compat_uptr_t; struct compat_timespec { compat_time_t tv_sec ; s32 tv_nsec ; }; struct compat_robust_list { compat_uptr_t next ; }; struct compat_robust_list_head { struct compat_robust_list list ; compat_long_t futex_offset ; compat_uptr_t list_op_pending ; }; struct usb_port_status { __le16 wPortStatus ; __le16 wPortChange ; }; struct usb_hub_status { __le16 wHubStatus ; __le16 wHubChange ; }; struct __anonstruct_hs_205 { __u8 DeviceRemovable[4U] ; __u8 PortPwrCtrlMask[4U] ; }; struct __anonstruct_ss_206 { __u8 bHubHdrDecLat ; __le16 wHubDelay ; __le16 DeviceRemovable ; }; union __anonunion_u_204 { struct __anonstruct_hs_205 hs ; struct __anonstruct_ss_206 ss ; }; struct usb_hub_descriptor { __u8 bDescLength ; __u8 bDescriptorType ; __u8 bNbrPorts ; __le16 wHubCharacteristics ; __u8 bPwrOn2PwrGood ; __u8 bHubContrCurrent ; union __anonunion_u_204 u ; }; struct usb_tt_clear { struct list_head clear_list ; unsigned int tt ; u16 devinfo ; struct usb_hcd *hcd ; struct usb_host_endpoint *ep ; }; enum usb_phy_events { USB_EVENT_NONE = 0, USB_EVENT_VBUS = 1, USB_EVENT_ID = 2, USB_EVENT_CHARGER = 3, USB_EVENT_ENUMERATED = 4 } ; enum usb_phy_type { USB_PHY_TYPE_UNDEFINED = 0, USB_PHY_TYPE_USB2 = 1, USB_PHY_TYPE_USB3 = 2 } ; enum usb_otg_state { OTG_STATE_UNDEFINED = 0, OTG_STATE_B_IDLE = 1, OTG_STATE_B_SRP_INIT = 2, OTG_STATE_B_PERIPHERAL = 3, OTG_STATE_B_WAIT_ACON = 4, OTG_STATE_B_HOST = 5, OTG_STATE_A_IDLE = 6, OTG_STATE_A_WAIT_VRISE = 7, OTG_STATE_A_WAIT_BCON = 8, OTG_STATE_A_HOST = 9, OTG_STATE_A_SUSPEND = 10, OTG_STATE_A_PERIPHERAL = 11, OTG_STATE_A_WAIT_VFALL = 12, OTG_STATE_A_VBUS_ERR = 13 } ; struct usb_otg; struct usb_phy_io_ops { int (*read)(struct usb_phy * , u32 ) ; int (*write)(struct usb_phy * , u32 , u32 ) ; }; struct usb_phy { struct device *dev ; char const *label ; unsigned int flags ; enum usb_phy_type type ; enum usb_otg_state state ; enum usb_phy_events last_event ; struct usb_otg *otg ; struct device *io_dev ; struct usb_phy_io_ops *io_ops ; void *io_priv ; struct atomic_notifier_head notifier ; u16 port_status ; u16 port_change ; struct list_head head ; int (*init)(struct usb_phy * ) ; void (*shutdown)(struct usb_phy * ) ; int (*set_power)(struct usb_phy * , unsigned int ) ; int (*set_suspend)(struct usb_phy * , int ) ; int (*notify_connect)(struct usb_phy * , int ) ; int (*notify_disconnect)(struct usb_phy * , int ) ; }; struct usb_gadget; struct usb_otg { u8 default_a ; struct usb_phy *phy ; struct usb_bus *host ; struct usb_gadget *gadget ; int (*set_host)(struct usb_otg * , struct usb_bus * ) ; int (*set_peripheral)(struct usb_otg * , struct usb_gadget * ) ; int (*set_vbus)(struct usb_otg * , bool ) ; int (*start_srp)(struct usb_otg * ) ; int (*start_hnp)(struct usb_otg * ) ; }; typedef void *acpi_handle; struct dev_state; struct usb_port { struct usb_device *child ; struct device dev ; struct dev_state *port_owner ; enum usb_port_connect_type connect_type ; }; union __anonunion_status_216 { struct usb_hub_status hub ; struct usb_port_status port ; }; struct usb_hub { struct device *intfdev ; struct usb_device *hdev ; struct kref kref ; struct urb *urb ; char (*buffer)[8U] ; union __anonunion_status_216 *status ; struct mutex status_mutex ; int error ; int nerrors ; struct list_head event_list ; unsigned long event_bits[1U] ; unsigned long change_bits[1U] ; unsigned long busy_bits[1U] ; unsigned long removed_bits[1U] ; unsigned long wakeup_bits[1U] ; struct usb_hub_descriptor *descriptor ; struct usb_tt tt ; unsigned int mA_per_port ; unsigned char limited_power : 1 ; unsigned char quiescing : 1 ; unsigned char disconnected : 1 ; unsigned char has_indicators : 1 ; u8 indicator[31U] ; struct delayed_work leds ; struct delayed_work init_work ; struct usb_port **ports ; }; enum hub_activation_type { HUB_INIT = 0, HUB_INIT2 = 1, HUB_INIT3 = 2, HUB_POST_RESET = 3, HUB_RESUME = 4, HUB_RESET_RESUME = 5 } ; enum hub_quiescing_type { HUB_DISCONNECT = 0, HUB_PRE_RESET = 1, HUB_SUSPEND = 2 } ; union __anonunion_218 { struct usb_hub_status hub ; struct usb_port_status port ; }; typedef int ldv_func_ret_type___4; typedef __u64 __le64; 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) ; }; enum hrtimer_restart; struct workqueue_struct; 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 uts_namespace; struct mnt_namespace; struct ipc_namespace; struct net; 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 ; struct net *net_ns ; }; struct new_utsname { char sysname[65U] ; char nodename[65U] ; char release[65U] ; char version[65U] ; char machine[65U] ; char domainname[65U] ; }; struct uts_namespace { struct kref kref ; struct new_utsname name ; struct user_namespace *user_ns ; }; struct pdev_archdata { }; struct platform_device_id { char name[20U] ; kernel_ulong_t driver_data ; }; 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 ; struct mfd_cell *mfd_cell ; struct pdev_archdata archdata ; }; struct usb_ctrlrequest { __u8 bRequestType ; __u8 bRequest ; __le16 wValue ; __le16 wIndex ; __le16 wLength ; }; struct usb_mon_operations { void (*urb_submit)(struct usb_bus * , struct urb * ) ; void (*urb_submit_error)(struct usb_bus * , struct urb * , int ) ; void (*urb_complete)(struct usb_bus * , struct urb * , int ) ; }; struct usb_busmap { unsigned long busmap[1U] ; }; enum hrtimer_restart; enum hrtimer_restart; struct usb_sg_request { int status ; size_t bytes ; spinlock_t lock ; struct usb_device *dev ; int pipe ; int entries ; struct urb **urbs ; int count ; struct completion complete ; }; typedef u16 wchar_t; enum utf16_endian { UTF16_HOST_ENDIAN = 0, UTF16_LITTLE_ENDIAN = 1, UTF16_BIG_ENDIAN = 2 } ; struct api_context { struct completion done ; int status ; }; struct set_config_request { struct usb_device *udev ; int config ; struct work_struct work ; struct list_head node ; }; enum hrtimer_restart; struct usb_dynid { struct list_head node ; struct usb_device_id id ; }; struct usb_dev_cap_header { __u8 bLength ; __u8 bDescriptorType ; __u8 bDevCapabilityType ; }; enum hrtimer_restart; enum hrtimer_restart; struct usb_class_driver { char *name ; char *(*devnode)(struct device * , umode_t * ) ; struct file_operations const *fops ; int minor_base ; }; struct usb_class { struct kref kref ; struct class *class ; }; enum hrtimer_restart; enum hrtimer_restart; enum hrtimer_restart; struct ep_device { struct usb_endpoint_descriptor *desc ; struct usb_device *udev ; struct device dev ; }; enum hrtimer_restart; struct __large_struct { unsigned long buf[100U] ; }; 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 ; }; typedef struct poll_table_struct poll_table; struct usbdevfs_ctrltransfer { __u8 bRequestType ; __u8 bRequest ; __u16 wValue ; __u16 wIndex ; __u16 wLength ; __u32 timeout ; void *data ; }; struct usbdevfs_bulktransfer { unsigned int ep ; unsigned int len ; unsigned int timeout ; void *data ; }; struct usbdevfs_setinterface { unsigned int interface ; unsigned int altsetting ; }; struct usbdevfs_disconnectsignal { unsigned int signr ; void *context ; }; struct usbdevfs_getdriver { unsigned int interface ; char driver[256U] ; }; struct usbdevfs_connectinfo { unsigned int devnum ; unsigned char slow ; }; struct usbdevfs_iso_packet_desc { unsigned int length ; unsigned int actual_length ; unsigned int status ; }; struct usbdevfs_urb { unsigned char type ; unsigned char endpoint ; int status ; unsigned int flags ; void *buffer ; int buffer_length ; int actual_length ; int start_frame ; int number_of_packets ; int error_count ; unsigned int signr ; void *usercontext ; struct usbdevfs_iso_packet_desc iso_frame_desc[0U] ; }; struct usbdevfs_ioctl { int ifno ; int ioctl_code ; void *data ; }; struct usbdevfs_disconnect_claim { unsigned int interface ; unsigned int flags ; char driver[256U] ; }; typedef u32 compat_caddr_t; typedef s32 compat_int_t; typedef u32 compat_uint_t; struct usbdevfs_ctrltransfer32 { u8 bRequestType ; u8 bRequest ; u16 wValue ; u16 wIndex ; u16 wLength ; u32 timeout ; compat_caddr_t data ; }; struct usbdevfs_bulktransfer32 { compat_uint_t ep ; compat_uint_t len ; compat_uint_t timeout ; compat_caddr_t data ; }; struct usbdevfs_disconnectsignal32 { compat_int_t signr ; compat_caddr_t context ; }; struct usbdevfs_urb32 { unsigned char type ; unsigned char endpoint ; compat_int_t status ; compat_uint_t flags ; compat_caddr_t buffer ; compat_int_t buffer_length ; compat_int_t actual_length ; compat_int_t start_frame ; compat_int_t number_of_packets ; compat_int_t error_count ; compat_uint_t signr ; compat_caddr_t usercontext ; struct usbdevfs_iso_packet_desc iso_frame_desc[0U] ; }; struct usbdevfs_ioctl32 { s32 ifno ; s32 ioctl_code ; compat_caddr_t data ; }; struct cdev { struct kobject kobj ; struct module *owner ; struct file_operations const *ops ; struct list_head list ; dev_t dev ; unsigned int count ; }; struct uid_gid_extent { u32 first ; u32 lower_first ; u32 count ; }; struct uid_gid_map { u32 nr_extents ; struct uid_gid_extent extent[5U] ; }; struct user_namespace { struct uid_gid_map uid_map ; struct uid_gid_map gid_map ; struct uid_gid_map projid_map ; struct kref kref ; struct user_namespace *parent ; kuid_t owner ; kgid_t group ; }; struct dev_state { struct list_head list ; struct usb_device *dev ; struct file *file ; spinlock_t lock ; struct list_head async_pending ; struct list_head async_completed ; wait_queue_head_t wait ; unsigned int discsignr ; struct pid *disc_pid ; struct cred const *cred ; void *disccontext ; unsigned long ifclaimed ; u32 secid ; u32 disabled_bulk_eps ; }; struct async { struct list_head asynclist ; struct dev_state *ps ; struct pid *pid ; struct cred const *cred ; unsigned int signr ; unsigned int ifnum ; void *userbuffer ; void *userurb ; struct urb *urb ; unsigned int mem_usage ; int status ; u32 secid ; u8 bulk_addr ; u8 bulk_status ; }; enum snoop_when { SUBMIT = 0, COMPLETE = 1 } ; typedef int ldv_func_ret_type___6; enum hrtimer_restart; struct blocking_notifier_head { struct rw_semaphore rwsem ; struct notifier_block *head ; }; enum hrtimer_restart; enum hrtimer_restart; enum hrtimer_restart; struct device_connect_event { atomic_t count ; wait_queue_head_t wait ; }; struct class_info { int class ; char *class_name ; }; typedef __kernel_long_t __kernel_off_t; typedef __u32 nlink_t; typedef __kernel_off_t off_t; enum hrtimer_restart; struct pci_dev; struct pci_bus; struct pci_device_id { __u32 vendor ; __u32 device ; __u32 subvendor ; __u32 subdevice ; __u32 class ; __u32 class_mask ; kernel_ulong_t driver_data ; }; 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_ldv_15481_136 { 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 ; unsigned char pcie_mpss : 3 ; u8 rom_base_reg ; u8 pin ; u16 pcie_flags_reg ; struct pci_driver *driver ; u64 dma_mask ; struct device_dma_parameters dma_parms ; pci_power_t current_state ; int 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 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] ; 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 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 is_pcie : 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 ; 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 kset *msi_kset ; struct pci_vpd *vpd ; union __anonunion_ldv_15481_136 ldv_15481 ; struct pci_ats *ats ; }; struct pci_ops; 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 ; 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 { 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 (*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 * ) ; struct pci_error_handlers const *err_handler ; struct device_driver driver ; struct pci_dynids dynids ; }; typedef int read_proc_t(char * , char ** , off_t , int , int * , void * ); typedef int write_proc_t(struct file * , char const * , unsigned long , void * ); struct proc_dir_entry { unsigned int low_ino ; umode_t mode ; nlink_t nlink ; kuid_t uid ; kgid_t gid ; loff_t size ; struct inode_operations const *proc_iops ; struct file_operations const *proc_fops ; struct proc_dir_entry *next ; struct proc_dir_entry *parent ; struct proc_dir_entry *subdir ; void *data ; read_proc_t *read_proc ; write_proc_t *write_proc ; atomic_t count ; int pde_users ; struct completion *pde_unload_completion ; struct list_head pde_openers ; spinlock_t pde_unload_lock ; u8 namelen ; char name[] ; }; enum companion_action { SET_HS_COMPANION = 0, CLEAR_HS_COMPANION = 1, WAIT_FOR_COMPANIONS = 2 } ; enum hrtimer_restart; typedef u64 acpi_size; typedef u64 acpi_io_address; typedef u32 acpi_status; typedef char *acpi_string; typedef u32 acpi_object_type; struct __anonstruct_integer_179 { acpi_object_type type ; u64 value ; }; struct __anonstruct_string_180 { acpi_object_type type ; u32 length ; char *pointer ; }; struct __anonstruct_buffer_181 { acpi_object_type type ; u32 length ; u8 *pointer ; }; struct __anonstruct_package_182 { acpi_object_type type ; u32 count ; union acpi_object *elements ; }; struct __anonstruct_reference_183 { acpi_object_type type ; acpi_object_type actual_type ; acpi_handle handle ; }; struct __anonstruct_processor_184 { acpi_object_type type ; u32 proc_id ; acpi_io_address pblk_address ; u32 pblk_length ; }; struct __anonstruct_power_resource_185 { acpi_object_type type ; u32 system_level ; u32 resource_order ; }; union acpi_object { acpi_object_type type ; struct __anonstruct_integer_179 integer ; struct __anonstruct_string_180 string ; struct __anonstruct_buffer_181 buffer ; struct __anonstruct_package_182 package ; struct __anonstruct_reference_183 reference ; struct __anonstruct_processor_184 processor ; struct __anonstruct_power_resource_185 power_resource ; }; struct acpi_object_list { u32 count ; union acpi_object *pointer ; }; struct acpi_buffer { acpi_size length ; void *pointer ; }; struct acpi_pld_info { u8 revision ; u8 ignore_color ; u32 color ; u16 width ; u16 height ; u8 user_visible ; u8 dock ; u8 lid ; u8 panel ; u8 vertical_position ; u8 horizontal_position ; u8 shape ; u8 group_orientation ; u8 group_token ; u8 group_position ; u8 bay ; u8 ejectable ; u8 ospm_eject_required ; u8 cabinet_number ; u8 card_cage_number ; u8 reference ; u8 rotation ; u8 order ; u8 reserved ; u16 vertical_offset ; u16 horizontal_offset ; }; struct acpi_bus_type { struct list_head list ; struct bus_type *bus ; int (*find_device)(struct device * , acpi_handle ** ) ; int (*find_bridge)(struct device * , acpi_handle ** ) ; }; long ldv__builtin_expect(long exp , long c ) ; extern int printk(char const * , ...) ; extern int snprintf(char * , size_t , char const * , ...) ; extern char *kasprintf(gfp_t , char const * , ...) ; __inline static void INIT_LIST_HEAD(struct list_head *list ) { { list->next = list; list->prev = list; return; } } __inline static void atomic_set(atomic_t *v , int i ) { { v->counter = i; return; } } extern int mutex_trylock(struct mutex * ) ; int ldv_mutex_trylock_4(struct mutex *ldv_func_arg1 ) ; extern void mutex_unlock(struct mutex * ) ; void ldv_mutex_unlock_2(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_5(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_7(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_9(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_11(struct mutex *ldv_func_arg1 ) ; extern void mutex_lock(struct mutex * ) ; void ldv_mutex_lock_1(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_3(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_6(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_8(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_10(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_cred_guard_mutex(struct mutex *lock ) ; void ldv_mutex_unlock_cred_guard_mutex(struct mutex *lock ) ; void ldv_mutex_lock_lock(struct mutex *lock ) ; void ldv_mutex_unlock_lock(struct mutex *lock ) ; void ldv_mutex_lock_mtx(struct mutex *lock ) ; void ldv_mutex_unlock_mtx(struct mutex *lock ) ; void ldv_mutex_lock_mutex(struct mutex *lock ) ; int ldv_mutex_trylock_mutex(struct mutex *lock ) ; void ldv_mutex_unlock_mutex(struct mutex *lock ) ; extern unsigned long volatile jiffies ; extern int add_uevent_var(struct kobj_uevent_env * , char const * , ...) ; extern struct module __this_module ; 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 msleep(unsigned int ) ; extern int __bus_register(struct bus_type * , struct lock_class_key * ) ; extern void bus_unregister(struct bus_type * ) ; extern struct device *bus_find_device(struct bus_type * , struct device * , void * , int (*)(struct device * , void * ) ) ; extern int bus_register_notifier(struct bus_type * , struct notifier_block * ) ; extern int bus_unregister_notifier(struct bus_type * , struct notifier_block * ) ; extern int dev_set_name(struct device * , char const * , ...) ; __inline static int dev_to_node(struct device *dev ) { { return (dev->numa_node); } } __inline static void set_dev_node(struct device *dev , int node ) { { dev->numa_node = node; return; } } __inline static int device_trylock(struct device *dev ) { int tmp ; { tmp = ldv_mutex_trylock_4(& dev->mutex); return (tmp); } } extern void device_initialize(struct device * ) ; extern struct device *get_device(struct device * ) ; extern void put_device(struct device * ) ; extern void pm_runtime_set_autosuspend_delay(struct device * , int ) ; struct usb_interface *usb_get_intf(struct usb_interface *intf ) ; void usb_put_intf(struct usb_interface *intf ) ; int __usb_get_extra_descriptor(char *buffer , unsigned int size , unsigned char type , void **ptr ) ; struct usb_device *usb_get_dev(struct usb_device *dev ) ; void usb_put_dev(struct usb_device *dev ) ; int usb_lock_device_for_reset(struct usb_device *udev , struct usb_interface const *iface ) ; int usb_get_current_frame_number(struct usb_device *dev ) ; struct usb_interface *usb_find_interface(struct usb_driver *drv , int minor ) ; struct usb_interface *usb_ifnum_to_if(struct usb_device const *dev , unsigned int ifnum ) ; struct usb_host_interface *usb_altnum_to_altsetting(struct usb_interface const *intf , unsigned int altnum ) ; struct usb_host_interface *usb_find_alt_setting(struct usb_host_config *config , unsigned int iface_num , unsigned int alt_num ) ; struct bus_type usb_bus_type ; int usb_register_driver(struct usb_driver *new_driver , struct module *owner , char const *mod_name ) ; void usb_deregister(struct usb_driver *driver ) ; int usb_register_device_driver(struct usb_device_driver *new_udriver , struct module *owner ) ; void usb_deregister_device_driver(struct usb_device_driver *udriver ) ; int usb_disabled(void) ; void *usb_alloc_coherent(struct usb_device *dev , size_t size , gfp_t mem_flags , dma_addr_t *dma ) ; void usb_free_coherent(struct usb_device *dev , size_t size , void *addr , dma_addr_t dma ) ; struct dentry *usb_debug_root ; __inline static struct usb_hcd *bus_to_hcd(struct usb_bus *bus ) { struct usb_bus const *__mptr ; { __mptr = (struct usb_bus const *)bus; return ((struct usb_hcd *)__mptr); } } int usb_hcd_get_frame_number(struct usb_device *udev ) ; struct usb_hcd *usb_get_hcd(struct usb_hcd *hcd ) ; void usb_put_hcd(struct usb_hcd *hcd ) ; void *hcd_buffer_alloc(struct usb_bus *bus , size_t size , gfp_t mem_flags , dma_addr_t *dma ) ; void hcd_buffer_free(struct usb_bus *bus , size_t size , void *addr , dma_addr_t dma ) ; struct usb_device *usb_alloc_dev(struct usb_device *parent , struct usb_bus *bus , unsigned int port1 ) ; void usb_destroy_configuration(struct usb_device *dev ) ; extern struct dentry *debugfs_create_file(char const * , umode_t , struct dentry * , void * , struct file_operations const * ) ; extern struct dentry *debugfs_create_dir(char const * , struct dentry * ) ; extern void debugfs_remove(struct dentry * ) ; int usb_create_sysfs_dev_files(struct usb_device *udev ) ; void usb_remove_sysfs_dev_files(struct usb_device *udev ) ; void usb_create_sysfs_intf_files(struct usb_interface *intf ) ; void usb_remove_sysfs_intf_files(struct usb_interface *intf ) ; void usb_enable_endpoint(struct usb_device *dev , struct usb_host_endpoint *ep , bool reset_ep ) ; void usb_release_bos_descriptor(struct usb_device *dev ) ; int usb_hub_init(void) ; void usb_hub_cleanup(void) ; int usb_major_init(void) ; void usb_major_cleanup(void) ; int usb_suspend(struct device *dev , pm_message_t msg ) ; int usb_resume(struct device *dev , pm_message_t msg ) ; int usb_resume_complete(struct device *dev ) ; int usb_runtime_suspend(struct device *dev ) ; int usb_runtime_resume(struct device *dev ) ; int usb_runtime_idle(struct device *dev ) ; struct device_type usb_device_type ; struct device_type usb_if_device_type ; struct usb_device_driver usb_generic_driver ; __inline static int is_usb_interface(struct device const *dev ) { { return ((unsigned long )((struct device_type const *)dev->type) == (unsigned long )((struct device_type const *)(& usb_if_device_type))); } } char const *usbcore_name ; struct attribute_group const *usb_device_groups[3U] ; struct usb_driver usbfs_driver ; struct file_operations const usbfs_devices_fops ; int usb_devio_init(void) ; void usb_devio_cleanup(void) ; int usb_acpi_register(void) ; void usb_acpi_unregister(void) ; char const *usbcore_name = "usbcore"; static bool nousb ; static int usb_autosuspend_delay = 2; struct usb_host_interface *usb_find_alt_setting(struct usb_host_config *config , unsigned int iface_num , unsigned int alt_num ) { struct usb_interface_cache *intf_cache ; int i ; { intf_cache = 0; i = 0; goto ldv_32072; ldv_32071: ; if ((unsigned int )(config->intf_cache[i])->altsetting[0].desc.bInterfaceNumber == iface_num) { intf_cache = config->intf_cache[i]; goto ldv_32070; } else { } i = i + 1; ldv_32072: ; if ((int )config->desc.bNumInterfaces > i) { goto ldv_32071; } else { } ldv_32070: ; if ((unsigned long )intf_cache == (unsigned long )((struct usb_interface_cache *)0)) { return (0); } else { } i = 0; goto ldv_32074; ldv_32073: ; if ((unsigned int )intf_cache->altsetting[i].desc.bAlternateSetting == alt_num) { return ((struct usb_host_interface *)(& intf_cache->altsetting) + (unsigned long )i); } else { } i = i + 1; ldv_32074: ; if ((unsigned int )i < intf_cache->num_altsetting) { goto ldv_32073; } else { } printk("\017Did not find alt setting %u for intf %u, config %u\n", alt_num, iface_num, (int )config->desc.bConfigurationValue); return (0); } } struct usb_interface *usb_ifnum_to_if(struct usb_device const *dev , unsigned int ifnum ) { struct usb_host_config *config ; int i ; { config = dev->actconfig; if ((unsigned long )config == (unsigned long )((struct usb_host_config *)0)) { return (0); } else { } i = 0; goto ldv_32091; ldv_32090: ; if ((unsigned int )((config->interface[i])->altsetting)->desc.bInterfaceNumber == ifnum) { return (config->interface[i]); } else { } i = i + 1; ldv_32091: ; if ((int )config->desc.bNumInterfaces > i) { goto ldv_32090; } else { } return (0); } } struct usb_host_interface *usb_altnum_to_altsetting(struct usb_interface const *intf , unsigned int altnum ) { int i ; { i = 0; goto ldv_32106; ldv_32105: ; if ((unsigned int )(intf->altsetting + (unsigned long )i)->desc.bAlternateSetting == altnum) { return ((struct usb_host_interface *)intf->altsetting + (unsigned long )i); } else { } i = i + 1; ldv_32106: ; if ((unsigned int )i < (unsigned int )intf->num_altsetting) { goto ldv_32105; } else { } return (0); } } static int __find_interface(struct device *dev , void *data ) { struct find_interface_arg *arg ; struct usb_interface *intf ; int tmp ; struct device const *__mptr ; { arg = (struct find_interface_arg *)data; tmp = is_usb_interface((struct device const *)dev); if (tmp == 0) { return (0); } else { } if ((unsigned long )dev->driver != (unsigned long )arg->drv) { return (0); } else { } __mptr = (struct device const *)dev; intf = (struct usb_interface *)__mptr + 0xffffffffffffffd0UL; return (intf->minor == arg->minor); } } struct usb_interface *usb_find_interface(struct usb_driver *drv , int minor ) { struct find_interface_arg argb ; struct device *dev ; struct device const *__mptr ; struct usb_interface *tmp ; { argb.minor = minor; argb.drv = & drv->drvwrap.driver; dev = bus_find_device(& usb_bus_type, 0, (void *)(& argb), & __find_interface); put_device(dev); if ((unsigned long )dev != (unsigned long )((struct device *)0)) { __mptr = (struct device const *)dev; tmp = (struct usb_interface *)__mptr + 0xffffffffffffffd0UL; } else { tmp = 0; } return (tmp); } } static void usb_release_dev(struct device *dev ) { struct usb_device *udev ; struct usb_hcd *hcd ; struct device const *__mptr ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; hcd = bus_to_hcd(udev->bus); usb_destroy_configuration(udev); usb_release_bos_descriptor(udev); usb_put_hcd(hcd); kfree((void const *)udev->product); kfree((void const *)udev->manufacturer); kfree((void const *)udev->serial); kfree((void const *)udev); return; } } static int usb_dev_uevent(struct device *dev , struct kobj_uevent_env *env ) { struct usb_device *usb_dev ; struct device const *__mptr ; int tmp ; int tmp___0 ; { __mptr = (struct device const *)dev; usb_dev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; tmp = add_uevent_var(env, "BUSNUM=%03d", (usb_dev->bus)->busnum); if (tmp != 0) { return (-12); } else { } tmp___0 = add_uevent_var(env, "DEVNUM=%03d", usb_dev->devnum); if (tmp___0 != 0) { return (-12); } else { } return (0); } } static int usb_dev_prepare(struct device *dev ) { { return (0); } } static void usb_dev_complete(struct device *dev ) { { usb_resume_complete(dev); return; } } static int usb_dev_suspend(struct device *dev ) { struct pm_message __constr_expr_0 ; int tmp ; { __constr_expr_0.event = 2; tmp = usb_suspend(dev, __constr_expr_0); return (tmp); } } static int usb_dev_resume(struct device *dev ) { struct pm_message __constr_expr_0 ; int tmp ; { __constr_expr_0.event = 16; tmp = usb_resume(dev, __constr_expr_0); return (tmp); } } static int usb_dev_freeze(struct device *dev ) { struct pm_message __constr_expr_0 ; int tmp ; { __constr_expr_0.event = 1; tmp = usb_suspend(dev, __constr_expr_0); return (tmp); } } static int usb_dev_thaw(struct device *dev ) { struct pm_message __constr_expr_0 ; int tmp ; { __constr_expr_0.event = 32; tmp = usb_resume(dev, __constr_expr_0); return (tmp); } } static int usb_dev_poweroff(struct device *dev ) { struct pm_message __constr_expr_0 ; int tmp ; { __constr_expr_0.event = 4; tmp = usb_suspend(dev, __constr_expr_0); return (tmp); } } static int usb_dev_restore(struct device *dev ) { struct pm_message __constr_expr_0 ; int tmp ; { __constr_expr_0.event = 64; tmp = usb_resume(dev, __constr_expr_0); return (tmp); } } static struct dev_pm_ops const usb_device_pm_ops = {& usb_dev_prepare, & usb_dev_complete, & usb_dev_suspend, & usb_dev_resume, & usb_dev_freeze, & usb_dev_thaw, & usb_dev_poweroff, & usb_dev_restore, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & usb_runtime_suspend, & usb_runtime_resume, & usb_runtime_idle}; static char *usb_devnode(struct device *dev , umode_t *mode ) { struct usb_device *usb_dev ; struct device const *__mptr ; char *tmp ; { __mptr = (struct device const *)dev; usb_dev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; tmp = kasprintf(208U, "bus/usb/%03d/%03d", (usb_dev->bus)->busnum, usb_dev->devnum); return (tmp); } } struct device_type usb_device_type = {"usb_device", 0, & usb_dev_uevent, & usb_devnode, & usb_release_dev, & usb_device_pm_ops}; static unsigned int usb_bus_is_wusb(struct usb_bus *bus ) { struct usb_hcd *hcd ; struct usb_bus const *__mptr ; { __mptr = (struct usb_bus const *)bus; hcd = (struct usb_hcd *)__mptr; return ((unsigned int )hcd->wireless); } } struct usb_device *usb_alloc_dev(struct usb_device *parent , struct usb_bus *bus , unsigned int port1 ) { struct usb_device *dev ; struct usb_hcd *usb_hcd ; struct usb_bus const *__mptr ; unsigned int root_hub ; void *tmp ; struct usb_hcd *tmp___0 ; struct usb_hcd *tmp___1 ; struct usb_hcd *tmp___2 ; int tmp___3 ; int tmp___4 ; long tmp___5 ; unsigned int tmp___6 ; { __mptr = (struct usb_bus const *)bus; usb_hcd = (struct usb_hcd *)__mptr; root_hub = 0U; tmp = kzalloc(1744UL, 208U); dev = (struct usb_device *)tmp; if ((unsigned long )dev == (unsigned long )((struct usb_device *)0)) { return (0); } else { } tmp___0 = bus_to_hcd(bus); tmp___1 = usb_get_hcd(tmp___0); if ((unsigned long )tmp___1 == (unsigned long )((struct usb_hcd *)0)) { kfree((void const *)dev); return (0); } else { } if ((unsigned long )(usb_hcd->driver)->alloc_dev != (unsigned long )((int (*/* const */)(struct usb_hcd * , struct usb_device * ))0) && (unsigned long )parent != (unsigned long )((struct usb_device *)0)) { tmp___3 = (*((usb_hcd->driver)->alloc_dev))(usb_hcd, dev); if (tmp___3 == 0) { tmp___2 = bus_to_hcd(bus); usb_put_hcd(tmp___2); kfree((void const *)dev); return (0); } else { } } else { } device_initialize(& dev->dev); dev->dev.bus = & usb_bus_type; dev->dev.type = (struct device_type const *)(& usb_device_type); dev->dev.groups = (struct attribute_group const **)(& usb_device_groups); dev->dev.dma_mask = (bus->controller)->dma_mask; tmp___4 = dev_to_node(bus->controller); set_dev_node(& dev->dev, tmp___4); dev->state = USB_STATE_ATTACHED; dev->lpm_disable_count = 1U; atomic_set(& dev->urbnum, 0); INIT_LIST_HEAD(& dev->ep0.urb_list); dev->ep0.desc.bLength = 7U; dev->ep0.desc.bDescriptorType = 5U; usb_enable_endpoint(dev, & dev->ep0, 0); dev->can_submit = 1U; tmp___5 = ldv__builtin_expect((unsigned long )parent == (unsigned long )((struct usb_device *)0), 0L); if (tmp___5 != 0L) { dev->devpath[0] = 48; dev->route = 0U; dev->dev.parent = bus->controller; dev_set_name(& dev->dev, "usb%d", bus->busnum); root_hub = 1U; } else { if ((int )((signed char )parent->devpath[0]) == 48) { snprintf((char *)(& dev->devpath), 16UL, "%d", port1); dev->route = 0U; } else { snprintf((char *)(& dev->devpath), 16UL, "%s.%d", (char *)(& parent->devpath), port1); if (port1 <= 14U) { dev->route = parent->route + (port1 << ((int )parent->level + -1) * 4); } else { dev->route = parent->route + (u32 )(15 << ((int )parent->level + -1) * 4); } } dev->dev.parent = & parent->dev; dev_set_name(& dev->dev, "%d-%s", bus->busnum, (char *)(& dev->devpath)); } dev->portnum = (u8 )port1; dev->bus = bus; dev->parent = parent; INIT_LIST_HEAD(& dev->filelist); pm_runtime_set_autosuspend_delay(& dev->dev, usb_autosuspend_delay * 1000); dev->connect_time = jiffies; dev->active_duration = - jiffies; if (root_hub != 0U) { dev->authorized = 1U; } else { dev->authorized = usb_hcd->authorized_default; tmp___6 = usb_bus_is_wusb(bus); dev->wusb = tmp___6 != 0U; } return (dev); } } struct usb_device *usb_get_dev(struct usb_device *dev ) { { if ((unsigned long )dev != (unsigned long )((struct usb_device *)0)) { get_device(& dev->dev); } else { } return (dev); } } void usb_put_dev(struct usb_device *dev ) { { if ((unsigned long )dev != (unsigned long )((struct usb_device *)0)) { put_device(& dev->dev); } else { } return; } } struct usb_interface *usb_get_intf(struct usb_interface *intf ) { { if ((unsigned long )intf != (unsigned long )((struct usb_interface *)0)) { get_device(& intf->dev); } else { } return (intf); } } void usb_put_intf(struct usb_interface *intf ) { { if ((unsigned long )intf != (unsigned long )((struct usb_interface *)0)) { put_device(& intf->dev); } else { } return; } } int usb_lock_device_for_reset(struct usb_device *udev , struct usb_interface const *iface ) { unsigned long jiffies_expire ; int tmp ; { jiffies_expire = (unsigned long )jiffies + 250UL; if ((unsigned int )udev->state == 0U) { return (-19); } else { } if ((unsigned int )udev->state == 8U) { return (-113); } else { } if ((unsigned long )iface != (unsigned long )((struct usb_interface const *)0) && ((unsigned int )iface->condition == 3U || (unsigned int )iface->condition == 0U)) { return (-4); } else { } goto ldv_32258; ldv_32257: ; if ((1 != 0 && 1 != 0) && (long )jiffies_expire - (long )jiffies < 0L) { return (-16); } else { } msleep(15U); if ((unsigned int )udev->state == 0U) { return (-19); } else { } if ((unsigned int )udev->state == 8U) { return (-113); } else { } if ((unsigned long )iface != (unsigned long )((struct usb_interface const *)0) && ((unsigned int )iface->condition == 3U || (unsigned int )iface->condition == 0U)) { return (-4); } else { } ldv_32258: tmp = device_trylock(& udev->dev); if (tmp == 0) { goto ldv_32257; } else { } return (0); } } int usb_get_current_frame_number(struct usb_device *dev ) { int tmp ; { tmp = usb_hcd_get_frame_number(dev); return (tmp); } } int __usb_get_extra_descriptor(char *buffer , unsigned int size , unsigned char type , void **ptr ) { struct usb_descriptor_header *header ; { goto ldv_32284; ldv_32283: header = (struct usb_descriptor_header *)buffer; if ((unsigned int )header->bLength <= 1U) { printk("\v%s: bogus descriptor, type %d length %d\n", usbcore_name, (int )header->bDescriptorType, (int )header->bLength); return (-1); } else { } if ((int )header->bDescriptorType == (int )type) { *ptr = (void *)header; return (0); } else { } buffer = buffer + (unsigned long )header->bLength; size = size - (unsigned int )header->bLength; ldv_32284: ; if (size > 1U) { goto ldv_32283; } else { } return (-1); } } void *usb_alloc_coherent(struct usb_device *dev , size_t size , gfp_t mem_flags , dma_addr_t *dma ) { void *tmp ; { if ((unsigned long )dev == (unsigned long )((struct usb_device *)0) || (unsigned long )dev->bus == (unsigned long )((struct usb_bus *)0)) { return (0); } else { } tmp = hcd_buffer_alloc(dev->bus, size, mem_flags, dma); return (tmp); } } void usb_free_coherent(struct usb_device *dev , size_t size , void *addr , dma_addr_t dma ) { { if ((unsigned long )dev == (unsigned long )((struct usb_device *)0) || (unsigned long )dev->bus == (unsigned long )((struct usb_bus *)0)) { return; } else { } if ((unsigned long )addr == (unsigned long )((void *)0)) { return; } else { } hcd_buffer_free(dev->bus, size, addr, dma); return; } } int usb_disabled(void) { { return ((int )nousb); } } static int usb_bus_notify(struct notifier_block *nb , unsigned long action , void *data ) { struct device *dev ; struct device const *__mptr ; struct device const *__mptr___0 ; struct device const *__mptr___1 ; struct device const *__mptr___2 ; { dev = (struct device *)data; switch (action) { case 1UL: ; if ((unsigned long )dev->type == (unsigned long )((struct device_type const *)(& usb_device_type))) { __mptr = (struct device const *)dev; usb_create_sysfs_dev_files((struct usb_device *)__mptr + 0xffffffffffffff78UL); } else if ((unsigned long )dev->type == (unsigned long )((struct device_type const *)(& usb_if_device_type))) { __mptr___0 = (struct device const *)dev; usb_create_sysfs_intf_files((struct usb_interface *)__mptr___0 + 0xffffffffffffffd0UL); } else { } goto ldv_32355; case 2UL: ; if ((unsigned long )dev->type == (unsigned long )((struct device_type const *)(& usb_device_type))) { __mptr___1 = (struct device const *)dev; usb_remove_sysfs_dev_files((struct usb_device *)__mptr___1 + 0xffffffffffffff78UL); } else if ((unsigned long )dev->type == (unsigned long )((struct device_type const *)(& usb_if_device_type))) { __mptr___2 = (struct device const *)dev; usb_remove_sysfs_intf_files((struct usb_interface *)__mptr___2 + 0xffffffffffffffd0UL); } else { } goto ldv_32355; } ldv_32355: ; return (0); } } static struct notifier_block usb_bus_nb = {& usb_bus_notify, 0, 0}; static struct dentry *usb_debug_devices ; static int usb_debugfs_init(void) { { usb_debug_root = debugfs_create_dir("usb", 0); if ((unsigned long )usb_debug_root == (unsigned long )((struct dentry *)0)) { return (-2); } else { } usb_debug_devices = debugfs_create_file("devices", 292, usb_debug_root, 0, & usbfs_devices_fops); if ((unsigned long )usb_debug_devices == (unsigned long )((struct dentry *)0)) { debugfs_remove(usb_debug_root); usb_debug_root = 0; return (-2); } else { } return (0); } } static void usb_debugfs_cleanup(void) { { debugfs_remove(usb_debug_devices); debugfs_remove(usb_debug_root); return; } } static int usb_init(void) { int retval ; struct lock_class_key __key ; int tmp ; { if ((int )nousb) { printk("\016%s: USB support disabled\n", usbcore_name); return (0); } else { } retval = usb_debugfs_init(); if (retval != 0) { goto out; } else { } usb_acpi_register(); tmp = __bus_register(& usb_bus_type, & __key); retval = tmp; if (retval != 0) { goto bus_register_failed; } else { } retval = bus_register_notifier(& usb_bus_type, & usb_bus_nb); if (retval != 0) { goto bus_notifier_failed; } else { } retval = usb_major_init(); if (retval != 0) { goto major_init_failed; } else { } retval = usb_register_driver(& usbfs_driver, & __this_module, "usbcore"); if (retval != 0) { goto driver_register_failed; } else { } retval = usb_devio_init(); if (retval != 0) { goto usb_devio_init_failed; } else { } retval = usb_hub_init(); if (retval != 0) { goto hub_init_failed; } else { } retval = usb_register_device_driver(& usb_generic_driver, & __this_module); if (retval == 0) { goto out; } else { } usb_hub_cleanup(); hub_init_failed: usb_devio_cleanup(); usb_devio_init_failed: usb_deregister(& usbfs_driver); driver_register_failed: usb_major_cleanup(); major_init_failed: bus_unregister_notifier(& usb_bus_type, & usb_bus_nb); bus_notifier_failed: bus_unregister(& usb_bus_type); bus_register_failed: usb_acpi_unregister(); usb_debugfs_cleanup(); out: ; return (retval); } } static void usb_exit(void) { { if ((int )nousb) { return; } else { } usb_deregister_device_driver(& usb_generic_driver); usb_major_cleanup(); usb_deregister(& usbfs_driver); usb_devio_cleanup(); usb_hub_cleanup(); bus_unregister_notifier(& usb_bus_type, & usb_bus_nb); bus_unregister(& usb_bus_type); usb_acpi_unregister(); usb_debugfs_cleanup(); return; } } void ldv_check_final_state(void) ; void ldv_initialize(void) ; extern void ldv_handler_precall(void) ; extern int __VERIFIER_nondet_int(void) ; int LDV_IN_INTERRUPT ; void ldv_main0_sequence_infinite_withcheck_stateful(void) { struct device *var_group1 ; umode_t *var_usb_devnode_16_p1 ; struct notifier_block *var_group3 ; unsigned long var_usb_bus_notify_35_p1 ; void *var_usb_bus_notify_35_p2 ; int ldv_s_usb_device_type_device_type ; int tmp ; int tmp___0 ; int tmp___1 ; { ldv_s_usb_device_type_device_type = 0; LDV_IN_INTERRUPT = 1; ldv_initialize(); ldv_handler_precall(); tmp = usb_init(); if (tmp != 0) { goto ldv_final; } else { } goto ldv_32440; ldv_32439: tmp___0 = __VERIFIER_nondet_int(); switch (tmp___0) { case 0: ldv_handler_precall(); usb_dev_prepare(var_group1); goto ldv_32426; case 1: ldv_handler_precall(); usb_dev_complete(var_group1); goto ldv_32426; case 2: ldv_handler_precall(); usb_dev_suspend(var_group1); goto ldv_32426; case 3: ldv_handler_precall(); usb_dev_resume(var_group1); goto ldv_32426; case 4: ldv_handler_precall(); usb_dev_freeze(var_group1); goto ldv_32426; case 5: ldv_handler_precall(); usb_dev_thaw(var_group1); goto ldv_32426; case 6: ldv_handler_precall(); usb_dev_poweroff(var_group1); goto ldv_32426; case 7: ldv_handler_precall(); usb_dev_restore(var_group1); goto ldv_32426; case 8: ; if (ldv_s_usb_device_type_device_type == 0) { ldv_handler_precall(); usb_release_dev(var_group1); ldv_s_usb_device_type_device_type = 0; } else { } goto ldv_32426; case 9: ; goto ldv_32426; case 10: ldv_handler_precall(); usb_devnode(var_group1, var_usb_devnode_16_p1); goto ldv_32426; case 11: ldv_handler_precall(); usb_bus_notify(var_group3, var_usb_bus_notify_35_p1, var_usb_bus_notify_35_p2); goto ldv_32426; default: ; goto ldv_32426; } ldv_32426: ; ldv_32440: tmp___1 = __VERIFIER_nondet_int(); if (tmp___1 != 0 || ldv_s_usb_device_type_device_type != 0) { goto ldv_32439; } else { } ldv_handler_precall(); usb_exit(); ldv_final: ldv_check_final_state(); return; } } void ldv_mutex_lock_1(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_2(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_3(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_4(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___2 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_5(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_6(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mtx(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_7(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mtx(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_8(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mtx(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_9(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mtx(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_10(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_11(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } __inline static void set_bit(unsigned int 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(int 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_clear_bit(int nr , unsigned long volatile *addr ) { int oldbit ; { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; btr %2,%1\n\tsbb %0,%0": "=r" (oldbit), "+m" (*((long volatile *)addr)): "Ir" (nr): "memory"); return (oldbit); } } __inline static int variable_test_bit(int nr , unsigned long const volatile *addr ) { int oldbit ; { __asm__ volatile ("bt %2,%1\n\tsbb %0,%0": "=r" (oldbit): "m" (*((unsigned long *)addr)), "Ir" (nr)); return (oldbit); } } extern unsigned long find_next_zero_bit(unsigned long const * , unsigned long , unsigned long ) ; extern int __printk_ratelimit(char const * ) ; extern int __dynamic_pr_debug(struct _ddebug * , char const * , ...) ; extern int __dynamic_dev_dbg(struct _ddebug * , struct device const * , char const * , ...) ; extern void __might_sleep(char const * , int , int ) ; extern void __list_add(struct list_head * , struct list_head * , struct list_head * ) ; __inline static void list_add_tail(struct list_head *new , struct list_head *head ) { { __list_add(new, head->prev, head); return; } } extern void __list_del_entry(struct list_head * ) ; extern void list_del(struct list_head * ) ; __inline static void list_del_init(struct list_head *entry ) { { __list_del_entry(entry); INIT_LIST_HEAD(entry); return; } } __inline static int list_empty(struct list_head const *head ) { { return ((unsigned long )((struct list_head const *)head->next) == (unsigned long )head); } } extern void __bad_percpu_size(void) ; 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_2860; case 2UL: __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& current_task)); goto ldv_2860; case 4UL: __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& current_task)); goto ldv_2860; case 8UL: __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& current_task)); goto ldv_2860; default: __bad_percpu_size(); } ldv_2860: ; return (pfo_ret__); } } extern int memcmp(void const * , void const * , size_t ) ; extern size_t strlen(char const * ) ; extern char *kstrdup(char const * , gfp_t ) ; extern void warn_slowpath_null(char const * , int const ) ; __inline static long IS_ERR(void const *ptr ) { long tmp ; { tmp = ldv__builtin_expect((unsigned long )ptr > 0xfffffffffffff000UL, 0L); return (tmp); } } __inline static int atomic_read(atomic_t const *v ) { { return ((int )*((int volatile *)(& v->counter))); } } __inline static int atomic_sub_and_test(int i , atomic_t *v ) { unsigned char c ; { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; subl %2,%0; sete %1": "+m" (v->counter), "=qm" (c): "ir" (i): "memory"); return ((int )c); } } __inline static void atomic_inc(atomic_t *v ) { { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; incl %0": "+m" (v->counter)); return; } } extern void lockdep_init_map(struct lockdep_map * , char const * , struct lock_class_key * , int ) ; extern void __mutex_init(struct mutex * , char const * , struct lock_class_key * ) ; int ldv_mutex_trylock_28(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_24(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_26(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_29(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_31(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_33(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_35(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_37(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_39(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_41(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_43(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_45(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_46(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_47(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_23(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_25(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_27(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_30(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_32(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_34(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_36(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_38(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_40(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_42(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_44(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_bandwidth_mutex(struct mutex *lock ) ; void ldv_mutex_unlock_bandwidth_mutex(struct mutex *lock ) ; void ldv_mutex_lock_status_mutex(struct mutex *lock ) ; void ldv_mutex_unlock_status_mutex(struct mutex *lock ) ; void ldv_mutex_lock_usb_address0_mutex(struct mutex *lock ) ; void ldv_mutex_unlock_usb_address0_mutex(struct mutex *lock ) ; __inline static int test_ti_thread_flag(struct thread_info *ti , int flag ) { int tmp ; { tmp = variable_test_bit(flag, (unsigned long const volatile *)(& ti->flags)); return (tmp); } } extern void __raw_spin_lock_init(raw_spinlock_t * , char const * , struct lock_class_key * ) ; extern void _raw_spin_lock_irq(raw_spinlock_t * ) ; extern unsigned long _raw_spin_lock_irqsave(raw_spinlock_t * ) ; extern void _raw_spin_unlock_irq(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->ldv_5957.rlock); } } __inline static void spin_lock_irq(spinlock_t *lock ) { { _raw_spin_lock_irq(& lock->ldv_5957.rlock); return; } } __inline static void spin_unlock_irq(spinlock_t *lock ) { { _raw_spin_unlock_irq(& lock->ldv_5957.rlock); return; } } __inline static void spin_unlock_irqrestore(spinlock_t *lock , unsigned long flags ) { { _raw_spin_unlock_irqrestore(& lock->ldv_5957.rlock, flags); 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 * ) ; extern void down_read(struct rw_semaphore * ) ; extern void up_read(struct rw_semaphore * ) ; extern unsigned long msecs_to_jiffies(unsigned int const ) ; 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 schedule_work(struct work_struct * ) ; extern bool schedule_delayed_work(struct delayed_work * , unsigned long ) ; extern bool flush_work(struct work_struct * ) ; extern bool cancel_delayed_work_sync(struct delayed_work * ) ; __inline static void kref_init(struct kref *kref ) { { atomic_set(& kref->refcount, 1); return; } } __inline static void kref_get(struct kref *kref ) { int __ret_warn_on ; int tmp ; long tmp___0 ; { tmp = atomic_read((atomic_t const *)(& kref->refcount)); __ret_warn_on = tmp == 0; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("include/linux/kref.h", 42); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); atomic_inc(& kref->refcount); return; } } __inline static int kref_sub(struct kref *kref , unsigned int count , void (*release)(struct kref * ) ) { int __ret_warn_on ; long tmp ; int tmp___0 ; { __ret_warn_on = (unsigned long )release == (unsigned long )((void (*)(struct kref * ))0); tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("include/linux/kref.h", 67); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); tmp___0 = atomic_sub_and_test((int )count, & kref->refcount); if (tmp___0 != 0) { (*release)(kref); return (1); } else { } return (0); } } __inline static int kref_put(struct kref *kref , void (*release)(struct kref * ) ) { int tmp ; { tmp = kref_sub(kref, 1U, release); return (tmp); } } extern void schedule(void) ; extern int wake_up_process(struct task_struct * ) ; __inline static int test_tsk_thread_flag(struct task_struct *tsk , int flag ) { int tmp ; { tmp = test_ti_thread_flag((struct thread_info *)tsk->stack, flag); return (tmp); } } __inline static int signal_pending(struct task_struct *p ) { int tmp ; long tmp___0 ; { tmp = test_tsk_thread_flag(p, 2); tmp___0 = ldv__builtin_expect(tmp != 0, 0L); return ((int )tmp___0); } } __inline static int usb_endpoint_dir_in(struct usb_endpoint_descriptor const *epd ) { { return ((int )((signed char )epd->bEndpointAddress) < 0); } } __inline static int usb_endpoint_xfer_int(struct usb_endpoint_descriptor const *epd ) { { return (((int )epd->bmAttributes & 3) == 3); } } __inline static int usb_endpoint_is_int_in(struct usb_endpoint_descriptor const *epd ) { int tmp ; int tmp___0 ; int tmp___1 ; { tmp = usb_endpoint_xfer_int(epd); if (tmp != 0) { tmp___0 = usb_endpoint_dir_in(epd); if (tmp___0 != 0) { tmp___1 = 1; } else { tmp___1 = 0; } } else { tmp___1 = 0; } return (tmp___1); } } __inline static int usb_endpoint_maxp(struct usb_endpoint_descriptor const *epd ) { { return ((int )epd->wMaxPacketSize); } } extern char const *usb_speed_string(enum usb_device_speed ) ; extern void device_set_wakeup_capable(struct device * , bool ) ; extern int device_init_wakeup(struct device * , bool ) ; __inline static void device_enable_async_suspend(struct device *dev ) { { if (! dev->power.is_prepared) { dev->power.async_suspend = 1U; } else { } return; } } __inline static void device_lock(struct device *dev ) { { ldv_mutex_lock_27(& dev->mutex); return; } } __inline static void device_unlock(struct device *dev ) { { ldv_mutex_unlock_29(& dev->mutex); return; } } extern int device_register(struct device * ) ; extern void device_unregister(struct device * ) ; extern int device_add(struct device * ) ; extern void device_del(struct device * ) ; extern void *dev_get_drvdata(struct device const * ) ; extern int dev_set_drvdata(struct device * , void * ) ; extern int dev_printk(char const * , struct device const * , char const * , ...) ; extern int dev_err(struct device const * , char const * , ...) ; extern int dev_warn(struct device const * , char const * , ...) ; extern int _dev_info(struct device const * , char const * , ...) ; extern int __pm_runtime_suspend(struct device * , int ) ; 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 ) ; extern void __pm_runtime_use_autosuspend(struct device * , bool ) ; __inline static void pm_runtime_get_noresume(struct device *dev ) { { atomic_inc(& dev->power.usage_count); return; } } __inline static void pm_runtime_mark_last_busy(struct device *dev ) { { *((unsigned long volatile *)(& dev->power.last_busy)) = jiffies; return; } } __inline static int pm_runtime_put_sync_autosuspend(struct device *dev ) { int tmp ; { tmp = __pm_runtime_suspend(dev, 12); return (tmp); } } __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_set_suspended(struct device *dev ) { { __pm_runtime_set_status(dev, 2U); return; } } __inline static void pm_runtime_disable(struct device *dev ) { { __pm_runtime_disable(dev, 1); return; } } __inline static void pm_runtime_use_autosuspend(struct device *dev ) { { __pm_runtime_use_autosuspend(dev, 1); return; } } __inline static void *usb_get_intfdata(struct usb_interface *intf ) { void *tmp ; { tmp = dev_get_drvdata((struct device const *)(& intf->dev)); return (tmp); } } __inline static void usb_set_intfdata(struct usb_interface *intf , void *data ) { { dev_set_drvdata(& intf->dev, data); return; } } __inline static struct usb_device *interface_to_usbdev(struct usb_interface *intf ) { struct device const *__mptr ; { __mptr = (struct device const *)intf->dev.parent; return ((struct usb_device *)__mptr + 0xffffffffffffff78UL); } } struct usb_device *usb_hub_find_child(struct usb_device *hdev , int port1 ) ; int usb_reset_device(struct usb_device *udev ) ; void usb_queue_reset_device(struct usb_interface *iface ) ; void usb_enable_autosuspend(struct usb_device *udev ) ; void usb_disable_autosuspend(struct usb_device *udev ) ; int usb_autopm_get_interface(struct usb_interface *intf ) ; void usb_autopm_put_interface(struct usb_interface *intf ) ; void usb_autopm_put_interface_async(struct usb_interface *intf ) ; void usb_autopm_get_interface_no_resume(struct usb_interface *intf ) ; void usb_autopm_put_interface_no_suspend(struct usb_interface *intf ) ; __inline static void usb_mark_last_busy(struct usb_device *udev ) { { pm_runtime_mark_last_busy(& udev->dev); return; } } int usb_disable_lpm(struct usb_device *udev ) ; void usb_enable_lpm(struct usb_device *udev ) ; int usb_unlocked_disable_lpm(struct usb_device *udev ) ; void usb_unlocked_enable_lpm(struct usb_device *udev ) ; int usb_disable_ltm(struct usb_device *udev ) ; void usb_enable_ltm(struct usb_device *udev ) ; __inline static bool usb_device_supports_ltm(struct usb_device *udev ) { { if (((unsigned int )udev->speed != 5U || (unsigned long )udev->bos == (unsigned long )((struct usb_host_bos *)0)) || (unsigned long )(udev->bos)->ss_cap == (unsigned long )((struct usb_ss_cap_descriptor *)0)) { return (0); } else { } return (((int )((udev->bos)->ss_cap)->bmAttributes & 2) != 0); } } __inline static void usb_fill_int_urb(struct urb *urb , struct usb_device *dev , unsigned int pipe , void *transfer_buffer , int buffer_length , void (*complete_fn)(struct urb * ) , void *context , int interval ) { { urb->dev = dev; urb->pipe = pipe; urb->transfer_buffer = transfer_buffer; urb->transfer_buffer_length = (u32 )buffer_length; urb->complete = complete_fn; urb->context = context; if ((unsigned int )dev->speed == 3U || (unsigned int )dev->speed == 5U) { urb->interval = 1 << (interval + -1); } else { urb->interval = interval; } urb->start_frame = -1; return; } } struct urb *usb_alloc_urb(int iso_packets , gfp_t mem_flags ) ; void usb_free_urb(struct urb *urb ) ; int usb_submit_urb(struct urb *urb , gfp_t mem_flags ) ; void usb_kill_urb(struct urb *urb ) ; int usb_control_msg(struct usb_device *dev , unsigned int pipe , __u8 request , __u8 requesttype , __u16 value , __u16 index , void *data , __u16 size , int timeout ) ; int usb_get_descriptor(struct usb_device *dev , unsigned char type , unsigned char index , void *buf , int size ) ; int usb_get_status(struct usb_device *dev , int type , int target , void *data ) ; int usb_string(struct usb_device *dev , int index , char *buf , size_t size ) ; int usb_set_interface(struct usb_device *dev , int interface , int alternate ) ; __inline static unsigned int __create_pipe(struct usb_device *dev , unsigned int endpoint ) { { return ((unsigned int )(dev->devnum << 8) | (endpoint << 15)); } } __inline static __u16 usb_maxpacket(struct usb_device *udev , int pipe , int is_out ) { struct usb_host_endpoint *ep ; unsigned int epnum ; int __ret_warn_on ; long tmp ; int __ret_warn_on___0 ; long tmp___0 ; int tmp___1 ; { epnum = (unsigned int )(pipe >> 15) & 15U; if (is_out != 0) { __ret_warn_on = (pipe & 128) != 0; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("include/linux/usb.h", 1744); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); ep = udev->ep_out[epnum]; } else { __ret_warn_on___0 = (pipe & 128) == 0; tmp___0 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("include/linux/usb.h", 1747); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); ep = udev->ep_in[epnum]; } if ((unsigned long )ep == (unsigned long )((struct usb_host_endpoint *)0)) { return (0U); } else { } tmp___1 = usb_endpoint_maxp((struct usb_endpoint_descriptor const *)(& ep->desc)); return ((__u16 )tmp___1); } } void usb_hcd_synchronize_unlinks(struct usb_device *udev ) ; int usb_hcd_alloc_bandwidth(struct usb_device *udev , struct usb_host_config *new_config , struct usb_host_interface *cur_alt , struct usb_host_interface *new_alt ) ; void usb_wakeup_notification(struct usb_device *hdev , unsigned int portnum ) ; int usb_new_device(struct usb_device *udev ) ; void usb_disconnect(struct usb_device **pdev ) ; int usb_get_configuration(struct usb_device *dev ) ; int usb_hub_clear_tt_buffer(struct urb *urb ) ; void usb_ep0_reinit(struct usb_device *udev ) ; void usb_set_device_state(struct usb_device *udev , enum usb_device_state new_state ) ; void usb_root_hub_lost_power(struct usb_device *rhdev ) ; struct rw_semaphore ehci_cf_port_reset_rwsem ; __inline static int usb_phy_notify_connect(struct usb_phy *x , int port ) { int tmp ; { if ((unsigned long )x->notify_connect != (unsigned long )((int (*)(struct usb_phy * , int ))0)) { tmp = (*(x->notify_connect))(x, port); return (tmp); } else { return (0); } } } __inline static int usb_phy_notify_disconnect(struct usb_phy *x , int port ) { int tmp ; { if ((unsigned long )x->notify_disconnect != (unsigned long )((int (*)(struct usb_phy * , int ))0)) { tmp = (*(x->notify_disconnect))(x, port); return (tmp); } else { return (0); } } } extern struct task_struct *kthread_create_on_node(int (*)(void * ) , void * , int , char const * , ...) ; extern int kthread_stop(struct task_struct * ) ; extern bool kthread_should_stop(void) ; extern atomic_t system_freezing_cnt ; extern bool freezing_slow_path(struct task_struct * ) ; __inline static bool freezing(struct task_struct *p ) { int tmp ; long tmp___0 ; bool tmp___1 ; { tmp = atomic_read((atomic_t const *)(& system_freezing_cnt)); tmp___0 = ldv__builtin_expect(tmp == 0, 1L); if (tmp___0 != 0L) { return (0); } else { } tmp___1 = freezing_slow_path(p); return (tmp___1); } } extern bool __refrigerator(bool ) ; __inline static bool try_to_freeze(void) { struct task_struct *tmp ; bool tmp___0 ; int tmp___1 ; long tmp___2 ; bool tmp___3 ; { __might_sleep("include/linux/freezer.h", 46, 0); tmp = get_current(); tmp___0 = freezing(tmp); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } tmp___2 = ldv__builtin_expect((long )tmp___1, 1L); if (tmp___2 != 0L) { return (0); } else { } tmp___3 = __refrigerator(0); return (tmp___3); } } extern bool set_freezable(void) ; extern void add_device_randomness(void const * , unsigned int ) ; int usb_create_ep_devs(struct device *parent , struct usb_host_endpoint *endpoint , struct usb_device *udev ) ; void usb_remove_ep_devs(struct usb_host_endpoint *endpoint ) ; void usb_enable_interface(struct usb_device *dev , struct usb_interface *intf , bool reset_eps ) ; void usb_disable_endpoint(struct usb_device *dev , unsigned int epaddr , bool reset_hardware ) ; void usb_disable_interface(struct usb_device *dev , struct usb_interface *intf , bool reset_hardware ) ; void usb_disable_device(struct usb_device *dev , int skip_ep0 ) ; int usb_deauthorize_device(struct usb_device *usb_dev ) ; int usb_authorize_device(struct usb_device *usb_dev ) ; void usb_detect_quirks(struct usb_device *udev ) ; void usb_detect_interface_quirks(struct usb_device *udev ) ; int usb_remove_device(struct usb_device *udev ) ; int usb_get_device_descriptor(struct usb_device *dev , unsigned int size ) ; int usb_get_bos_descriptor(struct usb_device *dev ) ; char *usb_cache_string(struct usb_device *udev , int index ) ; int usb_set_configuration(struct usb_device *dev , int configuration ) ; int usb_choose_configuration(struct usb_device *udev ) ; void usb_kick_khubd(struct usb_device *hdev ) ; void usb_forced_unbind_intf(struct usb_interface *intf ) ; void usb_rebind_intf(struct usb_interface *intf ) ; int usb_hub_claim_port(struct usb_device *hdev , unsigned int port1 , struct dev_state *owner ) ; int usb_hub_release_port(struct usb_device *hdev , unsigned int port1 , struct dev_state *owner ) ; void usb_hub_release_all_ports(struct usb_device *hdev , struct dev_state *owner ) ; bool usb_device_is_owned(struct usb_device *udev ) ; int usb_port_suspend(struct usb_device *udev , pm_message_t msg ) ; int usb_port_resume(struct usb_device *udev , pm_message_t msg ) ; void usb_autosuspend_device(struct usb_device *udev ) ; int usb_autoresume_device(struct usb_device *udev ) ; int usb_remote_wakeup(struct usb_device *udev ) ; int usb_set_usb2_hardware_lpm(struct usb_device *udev , int enable ) ; struct device_type usb_port_device_type ; enum usb_port_connect_type usb_get_hub_port_connect_type(struct usb_device *hdev , int port1 ) ; void usb_set_hub_port_connect_type(struct usb_device *hdev , int port1 , enum usb_port_connect_type type ) ; acpi_handle usb_get_hub_port_acpi_handle(struct usb_device *hdev , int port1 ) ; __inline static int hub_is_superspeed(struct usb_device *hdev ) { { return ((unsigned int )hdev->descriptor.bDeviceProtocol == 3U); } } static spinlock_t device_state_lock = {{{{{0U}}, 3735899821U, 4294967295U, 0xffffffffffffffffUL, {0, {0, 0}, "device_state_lock", 0, 0UL}}}}; static spinlock_t hub_event_lock = {{{{{0U}}, 3735899821U, 4294967295U, 0xffffffffffffffffUL, {0, {0, 0}, "hub_event_lock", 0, 0UL}}}}; static struct list_head hub_event_list = {& hub_event_list, & hub_event_list}; static wait_queue_head_t khubd_wait = {{{{{{0U}}, 3735899821U, 4294967295U, 0xffffffffffffffffUL, {0, {0, 0}, "khubd_wait.lock", 0, 0UL}}}}, {& khubd_wait.task_list, & khubd_wait.task_list}}; static struct task_struct *khubd_task ; static bool blinkenlights = 0; static int initial_descriptor_timeout = 5000; static bool old_scheme_first = 0; static bool use_both_schemes = 1; struct rw_semaphore ehci_cf_port_reset_rwsem = {0L, {{{0U}}, 3735899821U, 4294967295U, 0xffffffffffffffffUL, {0, {0, 0}, "ehci_cf_port_reset_rwsem.wait_lock", 0, 0UL}}, {& ehci_cf_port_reset_rwsem.wait_list, & ehci_cf_port_reset_rwsem.wait_list}, {0, {0, 0}, "ehci_cf_port_reset_rwsem", 0, 0UL}}; static int usb_reset_and_verify_device(struct usb_device *udev ) ; __inline static char *portspeed(struct usb_hub *hub , int portstatus ) { int tmp ; { tmp = hub_is_superspeed(hub->hdev); if (tmp != 0) { return ((char *)"5.0 Gb/s"); } else { } if ((portstatus & 1024) != 0) { return ((char *)"480 Mb/s"); } else if ((portstatus & 512) != 0) { return ((char *)"1.5 Mb/s"); } else { return ((char *)"12 Mb/s"); } } } static struct usb_hub *hdev_to_hub(struct usb_device *hdev ) { void *tmp ; { if (((unsigned long )hdev == (unsigned long )((struct usb_device *)0) || (unsigned long )hdev->actconfig == (unsigned long )((struct usb_host_config *)0)) || hdev->maxchild == 0) { return (0); } else { } tmp = usb_get_intfdata((hdev->actconfig)->interface[0]); return ((struct usb_hub *)tmp); } } static int usb_device_supports_lpm(struct usb_device *udev ) { { if ((unsigned int )udev->speed == 3U) { if ((unsigned long )(udev->bos)->ext_cap != (unsigned long )((struct usb_ext_cap_descriptor *)0) && (((udev->bos)->ext_cap)->bmAttributes & 2U) != 0U) { return (1); } else { } return (0); } else { } if ((unsigned long )(udev->bos)->ss_cap == (unsigned long )((struct usb_ss_cap_descriptor *)0)) { dev_warn((struct device const *)(& udev->dev), "No LPM exit latency info found. Power management will be impacted.\n"); return (0); } else { } if ((unsigned int )*((unsigned char *)udev->parent + 1596UL) != 0U) { return (1); } else { } dev_warn((struct device const *)(& udev->dev), "Parent hub missing LPM exit latency info. Power management will be impacted.\n"); return (0); } } static void usb_set_lpm_mel(struct usb_device *udev , struct usb3_lpm_parameters *udev_lpm_params , unsigned int udev_exit_latency , struct usb_hub *hub , struct usb3_lpm_parameters *hub_lpm_params , unsigned int hub_exit_latency ) { unsigned int total_mel ; unsigned int device_mel ; unsigned int hub_mel ; { total_mel = hub_lpm_params->mel + (unsigned int )((int )(hub->descriptor)->u.ss.bHubHdrDecLat * 100); device_mel = udev_exit_latency * 1000U; hub_mel = hub_exit_latency * 1000U; if (device_mel > hub_mel) { total_mel = total_mel + device_mel; } else { total_mel = total_mel + hub_mel; } udev_lpm_params->mel = total_mel; return; } } static void usb_set_lpm_pel(struct usb_device *udev , struct usb3_lpm_parameters *udev_lpm_params , unsigned int udev_exit_latency , struct usb_hub *hub , struct usb3_lpm_parameters *hub_lpm_params , unsigned int hub_exit_latency , unsigned int port_to_port_exit_latency ) { unsigned int first_link_pel ; unsigned int hub_pel ; { if (udev_exit_latency > hub_exit_latency) { first_link_pel = udev_exit_latency * 1000U; } else { first_link_pel = hub_exit_latency * 1000U; } hub_pel = port_to_port_exit_latency * 1000U + hub_lpm_params->pel; if (first_link_pel > hub_pel) { udev_lpm_params->pel = first_link_pel; } else { udev_lpm_params->pel = hub_pel; } return; } } static void usb_set_lpm_sel(struct usb_device *udev , struct usb3_lpm_parameters *udev_lpm_params ) { struct usb_device *parent ; unsigned int num_hubs ; unsigned int total_sel ; { total_sel = udev_lpm_params->pel; parent = udev->parent; num_hubs = 0U; goto ldv_30295; ldv_30294: num_hubs = num_hubs + 1U; parent = parent->parent; ldv_30295: ; if ((unsigned long )parent->parent != (unsigned long )((struct usb_device *)0)) { goto ldv_30294; } else { } if (num_hubs != 0U) { total_sel = (num_hubs * 250U + total_sel) + 1850U; } else { } total_sel = num_hubs * 250U + total_sel; udev_lpm_params->sel = total_sel; return; } } static void usb_set_lpm_parameters(struct usb_device *udev ) { struct usb_hub *hub ; unsigned int port_to_port_delay ; unsigned int udev_u1_del ; unsigned int udev_u2_del ; unsigned int hub_u1_del ; unsigned int hub_u2_del ; { if ((unsigned int )*((unsigned char *)udev + 1596UL) == 0U || (unsigned int )udev->speed != 5U) { return; } else { } hub = hdev_to_hub(udev->parent); if ((unsigned long )hub == (unsigned long )((struct usb_hub *)0)) { return; } else { } udev_u1_del = (unsigned int )((udev->bos)->ss_cap)->bU1devExitLat; udev_u2_del = (unsigned int )((udev->bos)->ss_cap)->bU2DevExitLat; hub_u1_del = (unsigned int )(((udev->parent)->bos)->ss_cap)->bU1devExitLat; hub_u2_del = (unsigned int )(((udev->parent)->bos)->ss_cap)->bU2DevExitLat; usb_set_lpm_mel(udev, & udev->u1_params, udev_u1_del, hub, & (udev->parent)->u1_params, hub_u1_del); usb_set_lpm_mel(udev, & udev->u2_params, udev_u2_del, hub, & (udev->parent)->u2_params, hub_u2_del); port_to_port_delay = 1U; usb_set_lpm_pel(udev, & udev->u1_params, udev_u1_del, hub, & (udev->parent)->u1_params, hub_u1_del, port_to_port_delay); if (hub_u2_del > hub_u1_del) { port_to_port_delay = (hub_u2_del - hub_u1_del) + 1U; } else { port_to_port_delay = hub_u1_del + 1U; } usb_set_lpm_pel(udev, & udev->u2_params, udev_u2_del, hub, & (udev->parent)->u2_params, hub_u2_del, port_to_port_delay); usb_set_lpm_sel(udev, & udev->u1_params); usb_set_lpm_sel(udev, & udev->u2_params); return; } } static int get_hub_descriptor(struct usb_device *hdev , void *data ) { int i ; int ret ; int size ; unsigned int dtype ; int tmp ; unsigned int tmp___0 ; { tmp = hub_is_superspeed(hdev); if (tmp != 0) { dtype = 42U; size = 12; } else { dtype = 41U; size = 15; } i = 0; goto ldv_30315; ldv_30314: tmp___0 = __create_pipe(hdev, 0U); ret = usb_control_msg(hdev, tmp___0 | 2147483776U, 6, 160, (int )((__u16 )dtype) << 8U, 0, data, (int )((__u16 )size), 5000); if (ret > 8) { return (ret); } else { } i = i + 1; ldv_30315: ; if (i <= 2) { goto ldv_30314; } else { } return (-22); } } static int clear_hub_feature(struct usb_device *hdev , int feature ) { unsigned int tmp ; int tmp___0 ; { tmp = __create_pipe(hdev, 0U); tmp___0 = usb_control_msg(hdev, tmp | 2147483648U, 1, 32, (int )((__u16 )feature), 0, 0, 0, 1000); return (tmp___0); } } static int clear_port_feature(struct usb_device *hdev , int port1 , int feature ) { unsigned int tmp ; int tmp___0 ; { tmp = __create_pipe(hdev, 0U); tmp___0 = usb_control_msg(hdev, tmp | 2147483648U, 1, 35, (int )((__u16 )feature), (int )((__u16 )port1), 0, 0, 1000); return (tmp___0); } } static int set_port_feature(struct usb_device *hdev , int port1 , int feature ) { unsigned int tmp ; int tmp___0 ; { tmp = __create_pipe(hdev, 0U); tmp___0 = usb_control_msg(hdev, tmp | 2147483648U, 3, 35, (int )((__u16 )feature), (int )((__u16 )port1), 0, 0, 1000); return (tmp___0); } } static void set_port_led(struct usb_hub *hub , int port1 , int selector ) { int status ; int tmp ; struct _ddebug descriptor ; char *s ; long tmp___0 ; { tmp = set_port_feature(hub->hdev, (selector << 8) | port1, 22); status = tmp; if (status < 0) { descriptor.modname = "usbcore"; descriptor.function = "set_port_led"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor.format = "port %d indicator %s status %d\n"; descriptor.lineno = 586U; descriptor.flags = 1U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { switch (selector) { case 1: s = (char *)"amber"; goto ldv_30341; case 2: s = (char *)"green"; goto ldv_30341; case 3: s = (char *)"off"; goto ldv_30341; case 0: s = (char *)"auto"; goto ldv_30341; default: s = (char *)"??"; goto ldv_30341; } ldv_30341: __dynamic_dev_dbg(& descriptor, (struct device const *)hub->intfdev, "port %d indicator %s status %d\n", port1, s, status); } else { } } else { } return; } } static void led_work(struct work_struct *work ) { struct usb_hub *hub ; struct work_struct const *__mptr ; struct usb_device *hdev ; unsigned int i ; unsigned int changed ; int cursor ; unsigned int selector ; unsigned int mode ; { __mptr = (struct work_struct const *)work; hub = (struct usb_hub *)__mptr + 0xfffffffffffffe00UL; hdev = hub->hdev; changed = 0U; cursor = -1; if ((unsigned int )hdev->state != 7U || (unsigned int )*((unsigned char *)hub + 476UL) != 0U) { return; } else { } i = 0U; goto ldv_30370; ldv_30369: ; switch ((int )hub->indicator[i]) { case 1: cursor = (int )i; selector = 0U; mode = 0U; goto ldv_30360; case 2: selector = 2U; mode = 3U; goto ldv_30360; case 3: selector = 3U; mode = 2U; goto ldv_30360; case 4: selector = 1U; mode = 5U; goto ldv_30360; case 5: selector = 3U; mode = 4U; goto ldv_30360; case 6: selector = 2U; mode = 7U; goto ldv_30360; case 7: selector = 1U; mode = 6U; goto ldv_30360; default: ; goto ldv_30368; } ldv_30360: ; if (selector != 0U) { changed = 1U; } else { } set_port_led(hub, (int )(i + 1U), (int )selector); hub->indicator[i] = (u8 )mode; ldv_30368: i = i + 1U; ldv_30370: ; if ((unsigned int )(hub->descriptor)->bNbrPorts > i) { goto ldv_30369; } else { } if (changed == 0U && (int )blinkenlights) { cursor = cursor + 1; cursor = cursor % (int )(hub->descriptor)->bNbrPorts; set_port_led(hub, cursor + 1, 2); hub->indicator[cursor] = 1U; changed = changed + 1U; } else { } if (changed != 0U) { schedule_delayed_work(& hub->leds, 166UL); } else { } return; } } static int get_hub_status(struct usb_device *hdev , struct usb_hub_status *data ) { int i ; int status ; unsigned int tmp ; { status = -110; i = 0; goto ldv_30379; ldv_30378: tmp = __create_pipe(hdev, 0U); status = usb_control_msg(hdev, tmp | 2147483776U, 0, 160, 0, 0, (void *)data, 4, 1000); i = i + 1; ldv_30379: ; if (i <= 4 && (status == -110 || status == -32)) { goto ldv_30378; } else { } return (status); } } static int get_port_status(struct usb_device *hdev , int port1 , struct usb_port_status *data ) { int i ; int status ; unsigned int tmp ; { status = -110; i = 0; goto ldv_30389; ldv_30388: tmp = __create_pipe(hdev, 0U); status = usb_control_msg(hdev, tmp | 2147483776U, 0, 163, 0, (int )((__u16 )port1), (void *)data, 4, 1000); i = i + 1; ldv_30389: ; if (i <= 4 && (status == -110 || status == -32)) { goto ldv_30388; } else { } return (status); } } static int hub_port_status(struct usb_hub *hub , int port1 , u16 *status , u16 *change ) { int ret ; { ldv_mutex_lock_34(& hub->status_mutex); ret = get_port_status(hub->hdev, port1, & (hub->status)->port); if (ret <= 3) { dev_err((struct device const *)hub->intfdev, "%s failed (err = %d)\n", "hub_port_status", ret); if (ret >= 0) { ret = -5; } else { } } else { *status = (hub->status)->port.wPortStatus; *change = (hub->status)->port.wPortChange; ret = 0; } ldv_mutex_unlock_35(& hub->status_mutex); return (ret); } } static void kick_khubd(struct usb_hub *hub ) { unsigned long flags ; raw_spinlock_t *tmp ; struct device const *__mptr ; int tmp___0 ; { tmp = spinlock_check(& hub_event_lock); flags = _raw_spin_lock_irqsave(tmp); if ((unsigned int )*((unsigned char *)hub + 476UL) == 0U) { tmp___0 = list_empty((struct list_head const *)(& hub->event_list)); if (tmp___0 != 0) { list_add_tail(& hub->event_list, & hub_event_list); __mptr = (struct device const *)hub->intfdev; usb_autopm_get_interface_no_resume((struct usb_interface *)__mptr + 0xffffffffffffffd0UL); __wake_up(& khubd_wait, 3U, 1, 0); } else { } } else { } spin_unlock_irqrestore(& hub_event_lock, flags); return; } } void usb_kick_khubd(struct usb_device *hdev ) { struct usb_hub *hub ; struct usb_hub *tmp ; { tmp = hdev_to_hub(hdev); hub = tmp; if ((unsigned long )hub != (unsigned long )((struct usb_hub *)0)) { kick_khubd(hub); } else { } return; } } void usb_wakeup_notification(struct usb_device *hdev , unsigned int portnum ) { struct usb_hub *hub ; { if ((unsigned long )hdev == (unsigned long )((struct usb_device *)0)) { return; } else { } hub = hdev_to_hub(hdev); if ((unsigned long )hub != (unsigned long )((struct usb_hub *)0)) { set_bit(portnum, (unsigned long volatile *)(& hub->wakeup_bits)); kick_khubd(hub); } else { } return; } } static void hub_irq(struct urb *urb ) { struct usb_hub *hub ; int status ; unsigned int i ; unsigned long bits ; struct _ddebug descriptor ; long tmp ; { hub = (struct usb_hub *)urb->context; status = urb->status; switch (status) { case -2: ; case -104: ; case -108: ; return; default: descriptor.modname = "usbcore"; descriptor.function = "hub_irq"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor.format = "transfer --> %d\n"; descriptor.lineno = 785U; descriptor.flags = 1U; tmp = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)hub->intfdev, "transfer --> %d\n", status); } else { } hub->nerrors = hub->nerrors + 1; if (hub->nerrors <= 9 || hub->error != 0) { goto resubmit; } else { } hub->error = status; case 0: bits = 0UL; i = 0U; goto ldv_30440; ldv_30439: bits = ((unsigned long )(*(hub->buffer))[i] << (int )(i * 8U)) | bits; i = i + 1U; ldv_30440: ; if (urb->actual_length > i) { goto ldv_30439; } else { } hub->event_bits[0] = bits; goto ldv_30442; } ldv_30442: hub->nerrors = 0; kick_khubd(hub); resubmit: ; if ((unsigned int )*((unsigned char *)hub + 476UL) != 0U) { return; } else { } status = usb_submit_urb(hub->urb, 32U); if ((status != 0 && status != -19) && status != -1) { dev_err((struct device const *)hub->intfdev, "resubmit --> %d\n", status); } else { } return; } } __inline static int hub_clear_tt_buffer(struct usb_device *hdev , u16 devinfo , u16 tt ) { unsigned int tmp ; int tmp___0 ; { tmp = __create_pipe(hdev, 0U); tmp___0 = usb_control_msg(hdev, tmp | 2147483648U, 8, 35, (int )devinfo, (int )tt, 0, 0, 1000); return (tmp___0); } } static void hub_tt_work(struct work_struct *work ) { struct usb_hub *hub ; struct work_struct const *__mptr ; unsigned long flags ; int limit ; raw_spinlock_t *tmp ; struct list_head *next ; struct usb_tt_clear *clear ; struct usb_device *hdev ; struct hc_driver const *drv ; int status ; struct list_head const *__mptr___0 ; raw_spinlock_t *tmp___0 ; int tmp___1 ; { __mptr = (struct work_struct const *)work; hub = (struct usb_hub *)__mptr + 0xfffffffffffffe78UL; limit = 100; tmp = spinlock_check(& hub->tt.lock); flags = _raw_spin_lock_irqsave(tmp); goto ldv_30471; ldv_30470: hdev = hub->hdev; if ((unsigned int )*((unsigned char *)hub + 476UL) == 0U) { limit = limit - 1; if (limit < 0) { goto ldv_30464; } else { } } else { } next = hub->tt.clear_list.next; __mptr___0 = (struct list_head const *)next; clear = (struct usb_tt_clear *)__mptr___0; list_del(& clear->clear_list); spin_unlock_irqrestore(& hub->tt.lock, flags); status = hub_clear_tt_buffer(hdev, (int )clear->devinfo, (int )((u16 )clear->tt)); if (status != 0) { dev_err((struct device const *)(& hdev->dev), "clear tt %d (%04x) error %d\n", clear->tt, (int )clear->devinfo, status); } else { } drv = (clear->hcd)->driver; if ((unsigned long )drv->clear_tt_buffer_complete != (unsigned long )((void (*/* const */)(struct usb_hcd * , struct usb_host_endpoint * ))0)) { (*(drv->clear_tt_buffer_complete))(clear->hcd, clear->ep); } else { } kfree((void const *)clear); tmp___0 = spinlock_check(& hub->tt.lock); flags = _raw_spin_lock_irqsave(tmp___0); ldv_30471: tmp___1 = list_empty((struct list_head const *)(& hub->tt.clear_list)); if (tmp___1 == 0) { goto ldv_30470; } else { } ldv_30464: spin_unlock_irqrestore(& hub->tt.lock, flags); return; } } int usb_hub_clear_tt_buffer(struct urb *urb ) { struct usb_device *udev ; int pipe ; struct usb_tt *tt ; unsigned long flags ; struct usb_tt_clear *clear ; void *tmp ; raw_spinlock_t *tmp___0 ; { udev = urb->dev; pipe = (int )urb->pipe; tt = udev->tt; tmp = kmalloc(40UL, 32U); clear = (struct usb_tt_clear *)tmp; if ((unsigned long )clear == (unsigned long )((struct usb_tt_clear *)0)) { dev_err((struct device const *)(& udev->dev), "can\'t save CLEAR_TT_BUFFER state\n"); return (-12); } else { } clear->tt = tt->multi != 0 ? (unsigned int )udev->ttport : 1U; clear->devinfo = (unsigned int )((u16 )(pipe >> 15)) & 15U; clear->devinfo = (u16 )((int )((short )clear->devinfo) | (int )((short )(udev->devnum << 4))); clear->devinfo = (u16 )((int )((short )clear->devinfo) | ((unsigned int )pipe >> 30 == 2U ? 0 : 4096)); if ((pipe & 128) != 0) { clear->devinfo = (u16 )((unsigned int )clear->devinfo | 32768U); } else { } clear->hcd = bus_to_hcd(udev->bus); clear->ep = urb->ep; tmp___0 = spinlock_check(& tt->lock); flags = _raw_spin_lock_irqsave(tmp___0); list_add_tail(& clear->clear_list, & tt->clear_list); schedule_work(& tt->clear_work); spin_unlock_irqrestore(& tt->lock, flags); return (0); } } static unsigned int hub_power_on(struct usb_hub *hub , bool do_delay ) { int port1 ; unsigned int pgood_delay ; unsigned int delay ; u16 wHubCharacteristics ; struct _ddebug descriptor ; long tmp ; struct _ddebug descriptor___0 ; long tmp___0 ; unsigned int _max1 ; unsigned int _max2 ; { pgood_delay = (unsigned int )((int )(hub->descriptor)->bPwrOn2PwrGood * 2); wHubCharacteristics = (hub->descriptor)->wHubCharacteristics; if (((int )wHubCharacteristics & 3) <= 1) { descriptor.modname = "usbcore"; descriptor.function = "hub_power_on"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor.format = "enabling power on all ports\n"; descriptor.lineno = 942U; descriptor.flags = 1U; tmp = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)hub->intfdev, "enabling power on all ports\n"); } else { } } else { descriptor___0.modname = "usbcore"; descriptor___0.function = "hub_power_on"; descriptor___0.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___0.format = "trying to enable port power on non-switchable hub\n"; descriptor___0.lineno = 945U; descriptor___0.flags = 1U; tmp___0 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___0 != 0L) { __dynamic_dev_dbg(& descriptor___0, (struct device const *)hub->intfdev, "trying to enable port power on non-switchable hub\n"); } else { } } port1 = 1; goto ldv_30501; ldv_30500: set_port_feature(hub->hdev, port1, 8); port1 = port1 + 1; ldv_30501: ; if ((int )(hub->descriptor)->bNbrPorts >= port1) { goto ldv_30500; } else { } _max1 = pgood_delay; _max2 = 100U; delay = _max1 > _max2 ? _max1 : _max2; if ((int )do_delay) { msleep(delay); } else { } return (delay); } } static int hub_hub_status(struct usb_hub *hub , u16 *status , u16 *change ) { int ret ; { ldv_mutex_lock_36(& hub->status_mutex); ret = get_hub_status(hub->hdev, & (hub->status)->hub); if (ret < 0) { dev_err((struct device const *)hub->intfdev, "%s failed (err = %d)\n", "hub_hub_status", ret); } else { *status = (hub->status)->hub.wHubStatus; *change = (hub->status)->hub.wHubChange; ret = 0; } ldv_mutex_unlock_37(& hub->status_mutex); return (ret); } } static int hub_set_port_link_state(struct usb_hub *hub , int port1 , unsigned int link_status ) { int tmp ; { tmp = set_port_feature(hub->hdev, (int )((link_status << 3) | (unsigned int )port1), 5); return (tmp); } } static int hub_usb3_port_disable(struct usb_hub *hub , int port1 ) { int ret ; int total_time ; u16 portchange ; u16 portstatus ; int tmp ; int tmp___0 ; { tmp = hub_is_superspeed(hub->hdev); if (tmp == 0) { return (-22); } else { } ret = hub_set_port_link_state(hub, port1, 128U); if (ret != 0) { dev_err((struct device const *)hub->intfdev, "cannot disable port %d (err = %d)\n", port1, ret); return (ret); } else { } total_time = 0; ldv_30527: ret = hub_port_status(hub, port1, & portstatus, & portchange); if (ret < 0) { return (ret); } else { } if (((int )portstatus & 480) == 128) { goto ldv_30526; } else { } if (total_time > 1499) { goto ldv_30526; } else { } msleep(25U); total_time = total_time + 25; goto ldv_30527; ldv_30526: ; if (total_time > 1499) { dev_warn((struct device const *)hub->intfdev, "Could not disable port %d after %d ms\n", port1, total_time); } else { } tmp___0 = hub_set_port_link_state(hub, port1, 160U); return (tmp___0); } } static int hub_port_disable(struct usb_hub *hub , int port1 , int set_state ) { struct usb_device *hdev ; int ret ; int tmp ; { hdev = hub->hdev; ret = 0; if ((unsigned long )(*(hub->ports + ((unsigned long )port1 + 0xffffffffffffffffUL)))->child != (unsigned long )((struct usb_device *)0) && set_state != 0) { usb_set_device_state((*(hub->ports + ((unsigned long )port1 + 0xffffffffffffffffUL)))->child, USB_STATE_NOTATTACHED); } else { } if (hub->error == 0) { tmp = hub_is_superspeed(hub->hdev); if (tmp != 0) { ret = hub_usb3_port_disable(hub, port1); } else { ret = clear_port_feature(hdev, port1, 1); } } else { } if (ret != 0) { dev_err((struct device const *)hub->intfdev, "cannot disable port %d (err = %d)\n", port1, ret); } else { } return (ret); } } static void hub_port_logical_disconnect(struct usb_hub *hub , int port1 ) { struct _ddebug descriptor ; long tmp ; { descriptor.modname = "usbcore"; descriptor.function = "hub_port_logical_disconnect"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor.format = "logical disconnect on port %d\n"; descriptor.lineno = 1057U; descriptor.flags = 1U; tmp = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)hub->intfdev, "logical disconnect on port %d\n", port1); } else { } hub_port_disable(hub, port1, 1); set_bit((unsigned int )port1, (unsigned long volatile *)(& hub->change_bits)); kick_khubd(hub); return; } } int usb_remove_device(struct usb_device *udev ) { struct usb_hub *hub ; struct usb_interface *intf ; struct device const *__mptr ; { if ((unsigned long )udev->parent == (unsigned long )((struct usb_device *)0)) { return (-22); } else { } hub = hdev_to_hub(udev->parent); __mptr = (struct device const *)hub->intfdev; intf = (struct usb_interface *)__mptr + 0xffffffffffffffd0UL; usb_autopm_get_interface(intf); set_bit((unsigned int )udev->portnum, (unsigned long volatile *)(& hub->removed_bits)); hub_port_logical_disconnect(hub, (int )udev->portnum); usb_autopm_put_interface(intf); return (0); } } static void hub_init_func2(struct work_struct *ws ) ; static void hub_init_func3(struct work_struct *ws ) ; static void hub_activate(struct usb_hub *hub , enum hub_activation_type type ) { struct usb_device *hdev ; struct usb_hcd *hcd ; int ret ; int port1 ; int status ; bool need_debounce_delay ; unsigned int delay ; unsigned int tmp ; int tmp___0 ; unsigned long tmp___1 ; struct device const *__mptr ; struct usb_device *udev ; u16 portstatus ; u16 portchange ; struct _ddebug descriptor ; long tmp___2 ; int tmp___3 ; int tmp___4 ; bool port_resumed ; int tmp___5 ; unsigned long tmp___6 ; struct device const *__mptr___0 ; { hdev = hub->hdev; need_debounce_delay = 0; if ((unsigned int )type == 1U) { goto init2; } else { } if ((unsigned int )type == 2U) { goto init3; } else { } if ((unsigned int )type != 4U) { if ((unsigned long )hdev->parent != (unsigned long )((struct usb_device *)0)) { tmp___0 = hub_is_superspeed(hdev); if (tmp___0 != 0) { tmp = __create_pipe(hdev, 0U); ret = usb_control_msg(hdev, tmp | 2147483648U, 12, 32, (int )((unsigned int )((__u16 )hdev->level) + 65535U), 0, 0, 0, 5000); if (ret < 0) { dev_err((struct device const *)hub->intfdev, "set hub depth failed\n"); } else { } } else { } } else { } if ((unsigned int )type == 0U) { delay = hub_power_on(hub, 0); hub->init_work.work.func = & hub_init_func2; tmp___1 = msecs_to_jiffies(delay); schedule_delayed_work(& hub->init_work, tmp___1); __mptr = (struct device const *)hub->intfdev; usb_autopm_get_interface_no_resume((struct usb_interface *)__mptr + 0xffffffffffffffd0UL); return; } else if ((unsigned int )type == 5U) { hcd = bus_to_hcd(hdev->bus); if ((unsigned long )(hcd->driver)->update_hub_device != (unsigned long )((int (*/* const */)(struct usb_hcd * , struct usb_device * , struct usb_tt * , gfp_t ))0)) { ret = (*((hcd->driver)->update_hub_device))(hcd, hdev, & hub->tt, 16U); if (ret < 0) { dev_err((struct device const *)hub->intfdev, "Host not accepting hub info update.\n"); dev_err((struct device const *)hub->intfdev, "LS/FS devices and hubs may not work under this hub\n."); } else { } } else { } hub_power_on(hub, 1); } else { hub_power_on(hub, 1); } } else { } init2: port1 = 1; goto ldv_30581; ldv_30580: udev = (*(hub->ports + ((unsigned long )port1 + 0xffffffffffffffffUL)))->child; portchange = 0U; portstatus = portchange; status = hub_port_status(hub, port1, & portstatus, & portchange); if ((unsigned long )udev != (unsigned long )((struct usb_device *)0) || (int )portstatus & 1) { descriptor.modname = "usbcore"; descriptor.function = "hub_activate"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor.format = "port %d: status %04x change %04x\n"; descriptor.lineno = 1204U; descriptor.flags = 1U; tmp___2 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___2 != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)hub->intfdev, "port %d: status %04x change %04x\n", port1, (int )portstatus, (int )portchange); } else { } } else { } if (((int )portstatus & 2) != 0 && ((((unsigned int )type != 4U || ((int )portstatus & 1) == 0) || (unsigned long )udev == (unsigned long )((struct usb_device *)0)) || (unsigned int )udev->state == 0U)) { tmp___3 = hub_is_superspeed(hdev); if (tmp___3 == 0) { clear_port_feature(hdev, port1, 1); portstatus = (unsigned int )portstatus & 65533U; } else { portstatus = (unsigned int )portstatus & 65533U; } } else { } if ((int )portchange & 1) { need_debounce_delay = 1; clear_port_feature(hub->hdev, port1, 16); } else { } if (((int )portchange & 2) != 0) { need_debounce_delay = 1; clear_port_feature(hub->hdev, port1, 17); } else { } if (((int )portchange & 32) != 0) { tmp___4 = hub_is_superspeed(hub->hdev); if (tmp___4 != 0) { need_debounce_delay = 1; clear_port_feature(hub->hdev, port1, 29); } else { } } else { } if (((int )portstatus & 1) == 0 || (int )portchange & 1) { clear_bit(port1, (unsigned long volatile *)(& hub->removed_bits)); } else { } if ((unsigned long )udev == (unsigned long )((struct usb_device *)0) || (unsigned int )udev->state == 0U) { if ((unsigned long )udev != (unsigned long )((struct usb_device *)0) || (int )portstatus & 1) { set_bit((unsigned int )port1, (unsigned long volatile *)(& hub->change_bits)); } else if (((int )portstatus & 2) != 0) { port_resumed = ((int )portstatus & 480) == 0; if ((unsigned int )portchange != 0U) { set_bit((unsigned int )port1, (unsigned long volatile *)(& hub->change_bits)); } else { tmp___5 = hub_is_superspeed(hub->hdev); if (tmp___5 != 0 && (int )port_resumed) { set_bit((unsigned int )port1, (unsigned long volatile *)(& hub->change_bits)); } else { } } } else if ((unsigned int )*((unsigned char *)udev + 1596UL) != 0U) { udev->reset_resume = 1U; set_bit((unsigned int )port1, (unsigned long volatile *)(& hub->change_bits)); } else { usb_set_device_state(udev, USB_STATE_NOTATTACHED); set_bit((unsigned int )port1, (unsigned long volatile *)(& hub->change_bits)); } } else { } port1 = port1 + 1; ldv_30581: ; if (hdev->maxchild >= port1) { goto ldv_30580; } else { } if ((int )need_debounce_delay) { delay = 100U; if ((unsigned int )type == 1U) { hub->init_work.work.func = & hub_init_func3; tmp___6 = msecs_to_jiffies(delay); schedule_delayed_work(& hub->init_work, tmp___6); return; } else { msleep(delay); } } else { } init3: hub->quiescing = 0U; status = usb_submit_urb(hub->urb, 16U); if (status < 0) { dev_err((struct device const *)hub->intfdev, "activate --> %d\n", status); } else { } if ((unsigned int )*((unsigned char *)hub + 476UL) != 0U && (int )blinkenlights) { schedule_delayed_work(& hub->leds, 166UL); } else { } kick_khubd(hub); if ((unsigned int )type <= 2U) { __mptr___0 = (struct device const *)hub->intfdev; usb_autopm_put_interface_async((struct usb_interface *)__mptr___0 + 0xffffffffffffffd0UL); } else { } return; } } static void hub_init_func2(struct work_struct *ws ) { struct usb_hub *hub ; struct work_struct const *__mptr ; { __mptr = (struct work_struct const *)ws; hub = (struct usb_hub *)__mptr + 0xfffffffffffffd28UL; hub_activate(hub, HUB_INIT2); return; } } static void hub_init_func3(struct work_struct *ws ) { struct usb_hub *hub ; struct work_struct const *__mptr ; { __mptr = (struct work_struct const *)ws; hub = (struct usb_hub *)__mptr + 0xfffffffffffffd28UL; hub_activate(hub, HUB_INIT3); return; } } static void hub_quiesce(struct usb_hub *hub , enum hub_quiescing_type type ) { struct usb_device *hdev ; int i ; { hdev = hub->hdev; cancel_delayed_work_sync(& hub->init_work); hub->quiescing = 1U; if ((unsigned int )type != 2U) { i = 0; goto ldv_30608; ldv_30607: ; if ((unsigned long )(*(hub->ports + (unsigned long )i))->child != (unsigned long )((struct usb_device *)0)) { usb_disconnect(& (*(hub->ports + (unsigned long )i))->child); } else { } i = i + 1; ldv_30608: ; if (hdev->maxchild > i) { goto ldv_30607; } else { } } else { } usb_kill_urb(hub->urb); if ((unsigned int )*((unsigned char *)hub + 476UL) != 0U) { cancel_delayed_work_sync(& hub->leds); } else { } if ((unsigned long )hub->tt.hub != (unsigned long )((struct usb_device *)0)) { flush_work(& hub->tt.clear_work); } else { } return; } } static int hub_pre_reset(struct usb_interface *intf ) { struct usb_hub *hub ; void *tmp ; { tmp = usb_get_intfdata(intf); hub = (struct usb_hub *)tmp; hub_quiesce(hub, HUB_PRE_RESET); return (0); } } static int hub_post_reset(struct usb_interface *intf ) { struct usb_hub *hub ; void *tmp ; { tmp = usb_get_intfdata(intf); hub = (struct usb_hub *)tmp; hub_activate(hub, HUB_POST_RESET); return (0); } } static void usb_port_device_release(struct device *dev ) { struct usb_port *port_dev ; struct device const *__mptr ; { __mptr = (struct device const *)dev; port_dev = (struct usb_port *)__mptr + 0xfffffffffffffff8UL; kfree((void const *)port_dev); return; } } static void usb_hub_remove_port_device(struct usb_hub *hub , int port1 ) { { device_unregister(& (*(hub->ports + ((unsigned long )port1 + 0xffffffffffffffffUL)))->dev); return; } } struct device_type usb_port_device_type = {"usb_port", 0, 0, 0, & usb_port_device_release, 0}; static int usb_hub_create_port_device(struct usb_hub *hub , int port1 ) { struct usb_port *port_dev ; int retval ; void *tmp ; { port_dev = 0; tmp = kzalloc(1168UL, 208U); port_dev = (struct usb_port *)tmp; if ((unsigned long )port_dev == (unsigned long )((struct usb_port *)0)) { retval = -12; goto exit; } else { } *(hub->ports + ((unsigned long )port1 + 0xffffffffffffffffUL)) = port_dev; port_dev->dev.parent = hub->intfdev; port_dev->dev.type = (struct device_type const *)(& usb_port_device_type); dev_set_name(& port_dev->dev, "port%d", port1); retval = device_register(& port_dev->dev); if (retval != 0) { goto error_register; } else { } return (0); error_register: put_device(& port_dev->dev); exit: ; return (retval); } } static int hub_configure(struct usb_hub *hub , struct usb_endpoint_descriptor *endpoint ) { struct usb_hcd *hcd ; struct usb_device *hdev ; struct device *hub_dev ; u16 hubstatus ; u16 hubchange ; u16 wHubCharacteristics ; unsigned int pipe ; int maxp ; int ret ; int i ; char *message ; void *tmp ; void *tmp___0 ; struct lock_class_key __key ; void *tmp___1 ; void *tmp___2 ; int i___0 ; char portstr[32U] ; struct _ddebug descriptor ; long tmp___3 ; struct _ddebug descriptor___0 ; long tmp___4 ; int tmp___5 ; struct _ddebug descriptor___1 ; long tmp___6 ; struct _ddebug descriptor___2 ; long tmp___7 ; struct _ddebug descriptor___3 ; long tmp___8 ; struct _ddebug descriptor___4 ; long tmp___9 ; struct _ddebug descriptor___5 ; long tmp___10 ; struct _ddebug descriptor___6 ; long tmp___11 ; struct lock_class_key __key___0 ; struct lock_class_key __key___1 ; atomic_long_t __constr_expr_0 ; struct _ddebug descriptor___7 ; long tmp___12 ; struct _ddebug descriptor___8 ; long tmp___13 ; struct _ddebug descriptor___9 ; long tmp___14 ; struct _ddebug descriptor___10 ; long tmp___15 ; struct _ddebug descriptor___11 ; long tmp___16 ; struct _ddebug descriptor___12 ; long tmp___17 ; struct _ddebug descriptor___13 ; long tmp___18 ; struct _ddebug descriptor___14 ; long tmp___19 ; struct _ddebug descriptor___15 ; long tmp___20 ; struct _ddebug descriptor___16 ; long tmp___21 ; int remaining ; struct _ddebug descriptor___17 ; long tmp___22 ; struct _ddebug descriptor___18 ; long tmp___23 ; struct _ddebug descriptor___19 ; long tmp___24 ; unsigned int tmp___25 ; __u16 tmp___26 ; int tmp___27 ; { hdev = hub->hdev; hub_dev = hub->intfdev; message = (char *)"out of memory"; tmp = kmalloc(8UL, 208U); hub->buffer = (char (*)[8])tmp; if ((unsigned long )hub->buffer == (unsigned long )((char (*)[8U])0)) { ret = -12; goto fail; } else { } tmp___0 = kmalloc(4UL, 208U); hub->status = (union __anonunion_218 *)tmp___0; if ((unsigned long )hub->status == (unsigned long )((union __anonunion_status_216 *)0)) { ret = -12; goto fail; } else { } __mutex_init(& hub->status_mutex, "&hub->status_mutex", & __key); tmp___1 = kmalloc(15UL, 208U); hub->descriptor = (struct usb_hub_descriptor *)tmp___1; if ((unsigned long )hub->descriptor == (unsigned long )((struct usb_hub_descriptor *)0)) { ret = -12; goto fail; } else { } ret = get_hub_descriptor(hdev, (void *)hub->descriptor); if (ret < 0) { message = (char *)"can\'t read hub descriptor"; goto fail; } else if ((unsigned int )(hub->descriptor)->bNbrPorts > 31U) { message = (char *)"hub has too many ports!"; ret = -19; goto fail; } else { } hdev->maxchild = (int )(hub->descriptor)->bNbrPorts; _dev_info((struct device const *)hub_dev, "%d port%s detected\n", hdev->maxchild, hdev->maxchild == 1 ? (char *)"" : (char *)"s"); tmp___2 = kzalloc((unsigned long )hdev->maxchild * 8UL, 208U); hub->ports = (struct usb_port **)tmp___2; if ((unsigned long )hub->ports == (unsigned long )((struct usb_port **)0)) { ret = -12; goto fail; } else { } wHubCharacteristics = (hub->descriptor)->wHubCharacteristics; if (((int )wHubCharacteristics & 4) != 0) { tmp___5 = hub_is_superspeed(hdev); if (tmp___5 == 0) { i___0 = 0; goto ldv_30657; ldv_30656: portstr[i___0] = ((int )(hub->descriptor)->u.hs.DeviceRemovable[(i___0 + 1) / 8] >> (i___0 + 1) % 8) & 1 ? 70 : 82; i___0 = i___0 + 1; ldv_30657: ; if (hdev->maxchild > i___0) { goto ldv_30656; } else { } portstr[hdev->maxchild] = 0; descriptor.modname = "usbcore"; descriptor.function = "hub_configure"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor.format = "compound device; port removable status: %s\n"; descriptor.lineno = 1507U; descriptor.flags = 1U; tmp___3 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___3 != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)hub_dev, "compound device; port removable status: %s\n", (char *)(& portstr)); } else { } } else { goto _L; } } else { _L: /* CIL Label */ descriptor___0.modname = "usbcore"; descriptor___0.function = "hub_configure"; descriptor___0.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___0.format = "standalone hub\n"; descriptor___0.lineno = 1509U; descriptor___0.flags = 1U; tmp___4 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___4 != 0L) { __dynamic_dev_dbg(& descriptor___0, (struct device const *)hub_dev, "standalone hub\n"); } else { } } switch ((int )wHubCharacteristics & 3) { case 0: descriptor___1.modname = "usbcore"; descriptor___1.function = "hub_configure"; descriptor___1.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___1.format = "ganged power switching\n"; descriptor___1.lineno = 1513U; descriptor___1.flags = 1U; tmp___6 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); if (tmp___6 != 0L) { __dynamic_dev_dbg(& descriptor___1, (struct device const *)hub_dev, "ganged power switching\n"); } else { } goto ldv_30664; case 1: descriptor___2.modname = "usbcore"; descriptor___2.function = "hub_configure"; descriptor___2.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___2.format = "individual port power switching\n"; descriptor___2.lineno = 1516U; descriptor___2.flags = 1U; tmp___7 = ldv__builtin_expect((long )descriptor___2.flags & 1L, 0L); if (tmp___7 != 0L) { __dynamic_dev_dbg(& descriptor___2, (struct device const *)hub_dev, "individual port power switching\n"); } else { } goto ldv_30664; case 2: ; case 3: descriptor___3.modname = "usbcore"; descriptor___3.function = "hub_configure"; descriptor___3.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___3.format = "no power switching (usb 1.0)\n"; descriptor___3.lineno = 1520U; descriptor___3.flags = 1U; tmp___8 = ldv__builtin_expect((long )descriptor___3.flags & 1L, 0L); if (tmp___8 != 0L) { __dynamic_dev_dbg(& descriptor___3, (struct device const *)hub_dev, "no power switching (usb 1.0)\n"); } else { } goto ldv_30664; } ldv_30664: ; switch ((int )wHubCharacteristics & 24) { case 0: descriptor___4.modname = "usbcore"; descriptor___4.function = "hub_configure"; descriptor___4.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___4.format = "global over-current protection\n"; descriptor___4.lineno = 1526U; descriptor___4.flags = 1U; tmp___9 = ldv__builtin_expect((long )descriptor___4.flags & 1L, 0L); if (tmp___9 != 0L) { __dynamic_dev_dbg(& descriptor___4, (struct device const *)hub_dev, "global over-current protection\n"); } else { } goto ldv_30672; case 8: descriptor___5.modname = "usbcore"; descriptor___5.function = "hub_configure"; descriptor___5.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___5.format = "individual port over-current protection\n"; descriptor___5.lineno = 1529U; descriptor___5.flags = 1U; tmp___10 = ldv__builtin_expect((long )descriptor___5.flags & 1L, 0L); if (tmp___10 != 0L) { __dynamic_dev_dbg(& descriptor___5, (struct device const *)hub_dev, "individual port over-current protection\n"); } else { } goto ldv_30672; case 16: ; case 24: descriptor___6.modname = "usbcore"; descriptor___6.function = "hub_configure"; descriptor___6.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___6.format = "no over-current protection\n"; descriptor___6.lineno = 1533U; descriptor___6.flags = 1U; tmp___11 = ldv__builtin_expect((long )descriptor___6.flags & 1L, 0L); if (tmp___11 != 0L) { __dynamic_dev_dbg(& descriptor___6, (struct device const *)hub_dev, "no over-current protection\n"); } else { } goto ldv_30672; } ldv_30672: spinlock_check(& hub->tt.lock); __raw_spin_lock_init(& hub->tt.lock.ldv_5957.rlock, "&(&hub->tt.lock)->rlock", & __key___0); INIT_LIST_HEAD(& hub->tt.clear_list); __init_work(& hub->tt.clear_work, 0); __constr_expr_0.counter = 4195328L; hub->tt.clear_work.data = __constr_expr_0; lockdep_init_map(& hub->tt.clear_work.lockdep_map, "(&hub->tt.clear_work)", & __key___1, 0); INIT_LIST_HEAD(& hub->tt.clear_work.entry); hub->tt.clear_work.func = & hub_tt_work; switch ((int )hdev->descriptor.bDeviceProtocol) { case 0: ; goto ldv_30682; case 1: descriptor___7.modname = "usbcore"; descriptor___7.function = "hub_configure"; descriptor___7.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___7.format = "Single TT\n"; descriptor___7.lineno = 1544U; descriptor___7.flags = 1U; tmp___12 = ldv__builtin_expect((long )descriptor___7.flags & 1L, 0L); if (tmp___12 != 0L) { __dynamic_dev_dbg(& descriptor___7, (struct device const *)hub_dev, "Single TT\n"); } else { } hub->tt.hub = hdev; goto ldv_30682; case 2: ret = usb_set_interface(hdev, 0, 1); if (ret == 0) { descriptor___8.modname = "usbcore"; descriptor___8.function = "hub_configure"; descriptor___8.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___8.format = "TT per port\n"; descriptor___8.lineno = 1550U; descriptor___8.flags = 1U; tmp___13 = ldv__builtin_expect((long )descriptor___8.flags & 1L, 0L); if (tmp___13 != 0L) { __dynamic_dev_dbg(& descriptor___8, (struct device const *)hub_dev, "TT per port\n"); } else { } hub->tt.multi = 1; } else { dev_err((struct device const *)hub_dev, "Using single TT (err %d)\n", ret); } hub->tt.hub = hdev; goto ldv_30682; case 3: ; goto ldv_30682; default: descriptor___9.modname = "usbcore"; descriptor___9.function = "hub_configure"; descriptor___9.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___9.format = "Unrecognized hub protocol %d\n"; descriptor___9.lineno = 1562U; descriptor___9.flags = 1U; tmp___14 = ldv__builtin_expect((long )descriptor___9.flags & 1L, 0L); if (tmp___14 != 0L) { __dynamic_dev_dbg(& descriptor___9, (struct device const *)hub_dev, "Unrecognized hub protocol %d\n", (int )hdev->descriptor.bDeviceProtocol); } else { } goto ldv_30682; } ldv_30682: ; switch ((int )wHubCharacteristics & 96) { case 0: ; if ((unsigned int )hdev->descriptor.bDeviceProtocol != 0U) { hub->tt.think_time = 666U; descriptor___10.modname = "usbcore"; descriptor___10.function = "hub_configure"; descriptor___10.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___10.format = "TT requires at most %d FS bit times (%d ns)\n"; descriptor___10.lineno = 1573U; descriptor___10.flags = 1U; tmp___15 = ldv__builtin_expect((long )descriptor___10.flags & 1L, 0L); if (tmp___15 != 0L) { __dynamic_dev_dbg(& descriptor___10, (struct device const *)hub_dev, "TT requires at most %d FS bit times (%d ns)\n", 8, hub->tt.think_time); } else { } } else { } goto ldv_30692; case 32: hub->tt.think_time = 1332U; descriptor___11.modname = "usbcore"; descriptor___11.function = "hub_configure"; descriptor___11.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___11.format = "TT requires at most %d FS bit times (%d ns)\n"; descriptor___11.lineno = 1580U; descriptor___11.flags = 1U; tmp___16 = ldv__builtin_expect((long )descriptor___11.flags & 1L, 0L); if (tmp___16 != 0L) { __dynamic_dev_dbg(& descriptor___11, (struct device const *)hub_dev, "TT requires at most %d FS bit times (%d ns)\n", 16, hub->tt.think_time); } else { } goto ldv_30692; case 64: hub->tt.think_time = 1998U; descriptor___12.modname = "usbcore"; descriptor___12.function = "hub_configure"; descriptor___12.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___12.format = "TT requires at most %d FS bit times (%d ns)\n"; descriptor___12.lineno = 1586U; descriptor___12.flags = 1U; tmp___17 = ldv__builtin_expect((long )descriptor___12.flags & 1L, 0L); if (tmp___17 != 0L) { __dynamic_dev_dbg(& descriptor___12, (struct device const *)hub_dev, "TT requires at most %d FS bit times (%d ns)\n", 24, hub->tt.think_time); } else { } goto ldv_30692; case 96: hub->tt.think_time = 2664U; descriptor___13.modname = "usbcore"; descriptor___13.function = "hub_configure"; descriptor___13.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___13.format = "TT requires at most %d FS bit times (%d ns)\n"; descriptor___13.lineno = 1592U; descriptor___13.flags = 1U; tmp___18 = ldv__builtin_expect((long )descriptor___13.flags & 1L, 0L); if (tmp___18 != 0L) { __dynamic_dev_dbg(& descriptor___13, (struct device const *)hub_dev, "TT requires at most %d FS bit times (%d ns)\n", 32, hub->tt.think_time); } else { } goto ldv_30692; } ldv_30692: ; if (((int )wHubCharacteristics & 128) != 0) { hub->has_indicators = 1U; descriptor___14.modname = "usbcore"; descriptor___14.function = "hub_configure"; descriptor___14.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___14.format = "Port indicators are supported\n"; descriptor___14.lineno = 1599U; descriptor___14.flags = 1U; tmp___19 = ldv__builtin_expect((long )descriptor___14.flags & 1L, 0L); if (tmp___19 != 0L) { __dynamic_dev_dbg(& descriptor___14, (struct device const *)hub_dev, "Port indicators are supported\n"); } else { } } else { } descriptor___15.modname = "usbcore"; descriptor___15.function = "hub_configure"; descriptor___15.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___15.format = "power on to power good time: %dms\n"; descriptor___15.lineno = 1603U; descriptor___15.flags = 1U; tmp___20 = ldv__builtin_expect((long )descriptor___15.flags & 1L, 0L); if (tmp___20 != 0L) { __dynamic_dev_dbg(& descriptor___15, (struct device const *)hub_dev, "power on to power good time: %dms\n", (int )(hub->descriptor)->bPwrOn2PwrGood * 2); } else { } ret = usb_get_status(hdev, 0, 0, (void *)(& hubstatus)); if (ret <= 1) { message = (char *)"can\'t get hub status"; goto fail; } else { } if ((unsigned long )(hdev->bus)->root_hub == (unsigned long )hdev) { if ((unsigned int )hdev->bus_mA == 0U || (unsigned int )hdev->bus_mA > 499U) { hub->mA_per_port = 500U; } else { hub->mA_per_port = (unsigned int )hdev->bus_mA; hub->limited_power = 1U; } } else if (((int )hubstatus & 1) == 0) { descriptor___16.modname = "usbcore"; descriptor___16.function = "hub_configure"; descriptor___16.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___16.format = "hub controller current requirement: %dmA\n"; descriptor___16.lineno = 1623U; descriptor___16.flags = 1U; tmp___21 = ldv__builtin_expect((long )descriptor___16.flags & 1L, 0L); if (tmp___21 != 0L) { __dynamic_dev_dbg(& descriptor___16, (struct device const *)hub_dev, "hub controller current requirement: %dmA\n", (int )(hub->descriptor)->bHubContrCurrent); } else { } hub->limited_power = 1U; if (hdev->maxchild > 0) { remaining = (int )hdev->bus_mA - (int )(hub->descriptor)->bHubContrCurrent; if (hdev->maxchild * 100 > remaining) { dev_warn((struct device const *)hub_dev, "insufficient power available to use all downstream ports\n"); } else { } hub->mA_per_port = 100U; } else { } } else { hub->mA_per_port = 500U; } if (hub->mA_per_port <= 499U) { descriptor___17.modname = "usbcore"; descriptor___17.function = "hub_configure"; descriptor___17.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___17.format = "%umA bus power budget for each child\n"; descriptor___17.lineno = 1642U; descriptor___17.flags = 1U; tmp___22 = ldv__builtin_expect((long )descriptor___17.flags & 1L, 0L); if (tmp___22 != 0L) { __dynamic_dev_dbg(& descriptor___17, (struct device const *)hub_dev, "%umA bus power budget for each child\n", hub->mA_per_port); } else { } } else { } hcd = bus_to_hcd(hdev->bus); if ((unsigned long )(hcd->driver)->update_hub_device != (unsigned long )((int (*/* const */)(struct usb_hcd * , struct usb_device * , struct usb_tt * , gfp_t ))0)) { ret = (*((hcd->driver)->update_hub_device))(hcd, hdev, & hub->tt, 208U); if (ret < 0) { message = (char *)"can\'t update HCD hub info"; goto fail; } else { } } else { } ret = hub_hub_status(hub, & hubstatus, & hubchange); if (ret < 0) { message = (char *)"can\'t get hub status"; goto fail; } else { } if (((int )(hdev->actconfig)->desc.bmAttributes & 64) != 0) { descriptor___18.modname = "usbcore"; descriptor___18.function = "hub_configure"; descriptor___18.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___18.format = "local power source is %s\n"; descriptor___18.lineno = 1667U; descriptor___18.flags = 1U; tmp___23 = ldv__builtin_expect((long )descriptor___18.flags & 1L, 0L); if (tmp___23 != 0L) { __dynamic_dev_dbg(& descriptor___18, (struct device const *)hub_dev, "local power source is %s\n", (int )hubstatus & 1 ? (char *)"lost (inactive)" : (char *)"good"); } else { } } else { } if (((int )wHubCharacteristics & 24) == 0) { descriptor___19.modname = "usbcore"; descriptor___19.function = "hub_configure"; descriptor___19.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___19.format = "%sover-current condition exists\n"; descriptor___19.lineno = 1671U; descriptor___19.flags = 1U; tmp___24 = ldv__builtin_expect((long )descriptor___19.flags & 1L, 0L); if (tmp___24 != 0L) { __dynamic_dev_dbg(& descriptor___19, (struct device const *)hub_dev, "%sover-current condition exists\n", ((int )hubstatus & 2) != 0 ? (char *)"" : (char *)"no "); } else { } } else { } tmp___25 = __create_pipe(hdev, (unsigned int )endpoint->bEndpointAddress); pipe = tmp___25 | 1073741952U; tmp___26 = usb_maxpacket(hdev, (int )pipe, (pipe & 128U) == 0U); maxp = (int )tmp___26; if ((unsigned int )maxp > 8U) { maxp = 8; } else { } hub->urb = usb_alloc_urb(0, 208U); if ((unsigned long )hub->urb == (unsigned long )((struct urb *)0)) { ret = -12; goto fail; } else { } usb_fill_int_urb(hub->urb, hdev, pipe, (void *)hub->buffer, maxp, & hub_irq, (void *)hub, (int )endpoint->bInterval); if ((unsigned int )*((unsigned char *)hub + 476UL) != 0U && (int )blinkenlights) { hub->indicator[0] = 1U; } else { } i = 0; goto ldv_30707; ldv_30706: tmp___27 = usb_hub_create_port_device(hub, i + 1); if (tmp___27 < 0) { dev_err((struct device const *)hub->intfdev, "couldn\'t create port%d device.\n", i + 1); } else { } i = i + 1; ldv_30707: ; if (hdev->maxchild > i) { goto ldv_30706; } else { } hub_activate(hub, HUB_INIT); return (0); fail: dev_err((struct device const *)hub_dev, "config failed, %s (err %d)\n", message, ret); return (ret); } } static void hub_release(struct kref *kref ) { struct usb_hub *hub ; struct kref const *__mptr ; struct device const *__mptr___0 ; { __mptr = (struct kref const *)kref; hub = (struct usb_hub *)__mptr + 0xfffffffffffffff0UL; __mptr___0 = (struct device const *)hub->intfdev; usb_put_intf((struct usb_interface *)__mptr___0 + 0xffffffffffffffd0UL); kfree((void const *)hub); return; } } static unsigned int highspeed_hubs ; static void hub_disconnect(struct usb_interface *intf ) { struct usb_hub *hub ; void *tmp ; struct usb_device *hdev ; struct usb_device *tmp___0 ; int i ; int tmp___1 ; { tmp = usb_get_intfdata(intf); hub = (struct usb_hub *)tmp; tmp___0 = interface_to_usbdev(intf); hdev = tmp___0; spin_lock_irq(& hub_event_lock); tmp___1 = list_empty((struct list_head const *)(& hub->event_list)); if (tmp___1 == 0) { list_del_init(& hub->event_list); usb_autopm_put_interface_no_suspend(intf); } else { } hub->disconnected = 1U; spin_unlock_irq(& hub_event_lock); hub->error = 0; hub_quiesce(hub, HUB_DISCONNECT); usb_set_intfdata(intf, 0); i = 0; goto ldv_30725; ldv_30724: usb_hub_remove_port_device(hub, i + 1); i = i + 1; ldv_30725: ; if (hdev->maxchild > i) { goto ldv_30724; } else { } (hub->hdev)->maxchild = 0; if ((unsigned int )(hub->hdev)->speed == 3U) { highspeed_hubs = highspeed_hubs - 1U; } else { } usb_free_urb(hub->urb); kfree((void const *)hub->ports); kfree((void const *)hub->descriptor); kfree((void const *)hub->status); kfree((void const *)hub->buffer); kref_put(& hub->kref, & hub_release); return; } } static int hub_probe(struct usb_interface *intf , struct usb_device_id const *id ) { struct usb_host_interface *desc ; struct usb_endpoint_descriptor *endpoint ; struct usb_device *hdev ; struct usb_hub *hub ; int tmp ; void *tmp___0 ; struct _ddebug descriptor ; long tmp___1 ; struct lock_class_key __key ; atomic_long_t __constr_expr_0 ; struct lock_class_key __key___0 ; struct lock_class_key __key___1 ; atomic_long_t __constr_expr_1 ; struct lock_class_key __key___2 ; int tmp___2 ; { desc = intf->cur_altsetting; hdev = interface_to_usbdev(intf); usb_enable_autosuspend(hdev); if ((unsigned int )hdev->level == 6U) { dev_err((struct device const *)(& intf->dev), "Unsupported bus topology: hub nested too deep\n"); return (-7); } else { } if ((unsigned long )hdev->parent != (unsigned long )((struct usb_device *)0)) { dev_warn((struct device const *)(& intf->dev), "ignoring external hub\n"); return (-19); } else { } if ((unsigned int )desc->desc.bInterfaceSubClass != 0U && (unsigned int )desc->desc.bInterfaceSubClass != 1U) { descriptor_error: dev_err((struct device const *)(& intf->dev), "bad descriptor, ignoring hub\n"); return (-5); } else { } if ((unsigned int )desc->desc.bNumEndpoints != 1U) { goto descriptor_error; } else { } endpoint = & (desc->endpoint)->desc; tmp = usb_endpoint_is_int_in((struct usb_endpoint_descriptor const *)endpoint); if (tmp == 0) { goto descriptor_error; } else { } _dev_info((struct device const *)(& intf->dev), "USB hub found\n"); tmp___0 = kzalloc(952UL, 208U); hub = (struct usb_hub *)tmp___0; if ((unsigned long )hub == (unsigned long )((struct usb_hub *)0)) { descriptor.modname = "usbcore"; descriptor.function = "hub_probe"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor.format = "couldn\'t kmalloc hub struct\n"; descriptor.lineno = 1810U; descriptor.flags = 1U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)(& intf->dev), "couldn\'t kmalloc hub struct\n"); } else { } return (-12); } else { } kref_init(& hub->kref); INIT_LIST_HEAD(& hub->event_list); hub->intfdev = & intf->dev; hub->hdev = hdev; __init_work(& hub->leds.work, 0); __constr_expr_0.counter = 4195328L; hub->leds.work.data = __constr_expr_0; lockdep_init_map(& hub->leds.work.lockdep_map, "(&(&hub->leds)->work)", & __key, 0); INIT_LIST_HEAD(& hub->leds.work.entry); hub->leds.work.func = & led_work; init_timer_key(& hub->leds.timer, 2U, "(&(&hub->leds)->timer)", & __key___0); hub->leds.timer.function = & delayed_work_timer_fn; hub->leds.timer.data = (unsigned long )(& hub->leds); __init_work(& hub->init_work.work, 0); __constr_expr_1.counter = 4195328L; hub->init_work.work.data = __constr_expr_1; lockdep_init_map(& hub->init_work.work.lockdep_map, "(&(&hub->init_work)->work)", & __key___1, 0); INIT_LIST_HEAD(& hub->init_work.work.entry); hub->init_work.work.func = 0; init_timer_key(& hub->init_work.timer, 2U, "(&(&hub->init_work)->timer)", & __key___2); hub->init_work.timer.function = & delayed_work_timer_fn; hub->init_work.timer.data = (unsigned long )(& hub->init_work); usb_get_intf(intf); usb_set_intfdata(intf, (void *)hub); intf->needs_remote_wakeup = 1U; if ((unsigned int )hdev->speed == 3U) { highspeed_hubs = highspeed_hubs + 1U; } else { } tmp___2 = hub_configure(hub, endpoint); if (tmp___2 >= 0) { return (0); } else { } hub_disconnect(intf); return (-19); } } static int hub_ioctl(struct usb_interface *intf , unsigned int code , void *user_data ) { struct usb_device *hdev ; struct usb_device *tmp ; struct usb_hub *hub ; struct usb_hub *tmp___0 ; struct usbdevfs_hub_portinfo *info ; int i ; { tmp = interface_to_usbdev(intf); hdev = tmp; tmp___0 = hdev_to_hub(hdev); hub = tmp___0; switch (code) { case 2155894035U: info = (struct usbdevfs_hub_portinfo *)user_data; spin_lock_irq(& device_state_lock); if (hdev->devnum <= 0) { info->nports = 0; } else { info->nports = (char )hdev->maxchild; i = 0; goto ldv_30755; ldv_30754: ; if ((unsigned long )(*(hub->ports + (unsigned long )i))->child == (unsigned long )((struct usb_device *)0)) { info->port[i] = 0; } else { info->port[i] = (char )((*(hub->ports + (unsigned long )i))->child)->devnum; } i = i + 1; ldv_30755: ; if ((int )info->nports > i) { goto ldv_30754; } else { } } spin_unlock_irq(& device_state_lock); return ((int )info->nports + 1); default: ; return (-38); } } } static int find_port_owner(struct usb_device *hdev , unsigned int port1 , struct dev_state ***ppowner ) { struct usb_hub *tmp ; { if ((unsigned int )hdev->state == 0U) { return (-19); } else { } if (port1 == 0U || (unsigned int )hdev->maxchild < port1) { return (-22); } else { } tmp = hdev_to_hub(hdev); *ppowner = & (*(tmp->ports + (unsigned long )(port1 - 1U)))->port_owner; return (0); } } int usb_hub_claim_port(struct usb_device *hdev , unsigned int port1 , struct dev_state *owner ) { int rc ; struct dev_state **powner ; { rc = find_port_owner(hdev, port1, & powner); if (rc != 0) { return (rc); } else { } if ((unsigned long )*powner != (unsigned long )((struct dev_state *)0)) { return (-16); } else { } *powner = owner; return (rc); } } int usb_hub_release_port(struct usb_device *hdev , unsigned int port1 , struct dev_state *owner ) { int rc ; struct dev_state **powner ; { rc = find_port_owner(hdev, port1, & powner); if (rc != 0) { return (rc); } else { } if ((unsigned long )*powner != (unsigned long )owner) { return (-2); } else { } *powner = 0; return (rc); } } void usb_hub_release_all_ports(struct usb_device *hdev , struct dev_state *owner ) { struct usb_hub *hub ; struct usb_hub *tmp ; int n ; { tmp = hdev_to_hub(hdev); hub = tmp; n = 0; goto ldv_30784; ldv_30783: ; if ((unsigned long )(*(hub->ports + (unsigned long )n))->port_owner == (unsigned long )owner) { (*(hub->ports + (unsigned long )n))->port_owner = 0; } else { } n = n + 1; ldv_30784: ; if (hdev->maxchild > n) { goto ldv_30783; } else { } return; } } bool usb_device_is_owned(struct usb_device *udev ) { struct usb_hub *hub ; { if ((unsigned int )udev->state == 0U || (unsigned long )udev->parent == (unsigned long )((struct usb_device *)0)) { return (0); } else { } hub = hdev_to_hub(udev->parent); return ((unsigned long )(*(hub->ports + ((unsigned long )udev->portnum + 0xffffffffffffffffUL)))->port_owner != (unsigned long )((struct dev_state *)0)); } } static void recursively_mark_NOTATTACHED(struct usb_device *udev ) { struct usb_hub *hub ; struct usb_hub *tmp ; int i ; { tmp = hdev_to_hub(udev); hub = tmp; i = 0; goto ldv_30796; ldv_30795: ; if ((unsigned long )(*(hub->ports + (unsigned long )i))->child != (unsigned long )((struct usb_device *)0)) { recursively_mark_NOTATTACHED((*(hub->ports + (unsigned long )i))->child); } else { } i = i + 1; ldv_30796: ; if (udev->maxchild > i) { goto ldv_30795; } else { } if ((unsigned int )udev->state == 8U) { udev->active_duration = udev->active_duration - (unsigned long )jiffies; } else { } udev->state = USB_STATE_NOTATTACHED; return; } } void usb_set_device_state(struct usb_device *udev , enum usb_device_state new_state ) { unsigned long flags ; int wakeup ; raw_spinlock_t *tmp ; { wakeup = -1; tmp = spinlock_check(& device_state_lock); flags = _raw_spin_lock_irqsave(tmp); if ((unsigned int )udev->state == 0U) { } else if ((unsigned int )new_state != 0U) { if ((unsigned long )udev->parent != (unsigned long )((struct usb_device *)0)) { if ((unsigned int )udev->state == 8U || (unsigned int )new_state == 8U) { } else if ((unsigned int )new_state == 7U) { wakeup = (int )(udev->actconfig)->desc.bmAttributes & 32; } else { wakeup = 0; } } else { } if ((unsigned int )udev->state == 8U && (unsigned int )new_state != 8U) { udev->active_duration = udev->active_duration - (unsigned long )jiffies; } else if ((unsigned int )new_state == 8U && (unsigned int )udev->state != 8U) { udev->active_duration = udev->active_duration + (unsigned long )jiffies; } else { } udev->state = new_state; } else { recursively_mark_NOTATTACHED(udev); } spin_unlock_irqrestore(& device_state_lock, flags); if (wakeup >= 0) { device_set_wakeup_capable(& udev->dev, wakeup != 0); } else { } return; } } static void choose_devnum(struct usb_device *udev ) { int devnum ; struct usb_bus *bus ; int tmp ; long tmp___0 ; unsigned long tmp___1 ; unsigned long tmp___2 ; { bus = udev->bus; if ((unsigned int )*((unsigned char *)udev + 1596UL) != 0U) { devnum = (int )udev->portnum + 1; tmp = variable_test_bit(devnum, (unsigned long const volatile *)(& bus->devmap.devicemap)); 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 *)"/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"), "i" (2054), "i" (12UL)); ldv_30819: ; goto ldv_30819; } else { } } else { tmp___1 = find_next_zero_bit((unsigned long const *)(& bus->devmap.devicemap), 128UL, (unsigned long )bus->devnum_next); devnum = (int )tmp___1; if (devnum > 127) { tmp___2 = find_next_zero_bit((unsigned long const *)(& bus->devmap.devicemap), 128UL, 1UL); devnum = (int )tmp___2; } else { } bus->devnum_next = devnum <= 126 ? devnum + 1 : 1; } if (devnum <= 127) { set_bit((unsigned int )devnum, (unsigned long volatile *)(& bus->devmap.devicemap)); udev->devnum = devnum; } else { } return; } } static void release_devnum(struct usb_device *udev ) { { if (udev->devnum > 0) { clear_bit(udev->devnum, (unsigned long volatile *)(& (udev->bus)->devmap.devicemap)); udev->devnum = -1; } else { } return; } } static void update_devnum(struct usb_device *udev , int devnum ) { { if ((unsigned int )*((unsigned char *)udev + 1596UL) == 0U) { udev->devnum = devnum; } else { } return; } } static void hub_free_dev(struct usb_device *udev ) { struct usb_hcd *hcd ; struct usb_hcd *tmp ; { tmp = bus_to_hcd(udev->bus); hcd = tmp; if ((unsigned long )(hcd->driver)->free_dev != (unsigned long )((void (*/* const */)(struct usb_hcd * , struct usb_device * ))0) && (unsigned long )udev->parent != (unsigned long )((struct usb_device *)0)) { (*((hcd->driver)->free_dev))(hcd, udev); } else { } return; } } void usb_disconnect(struct usb_device **pdev ) { struct usb_device *udev ; struct usb_hub *hub ; struct usb_hub *tmp ; int i ; struct _ddebug descriptor ; long tmp___0 ; { udev = *pdev; tmp = hdev_to_hub(udev); hub = tmp; usb_set_device_state(udev, USB_STATE_NOTATTACHED); _dev_info((struct device const *)(& udev->dev), "USB disconnect, device number %d\n", udev->devnum); device_lock(& udev->dev); i = 0; goto ldv_30838; ldv_30837: ; if ((unsigned long )(*(hub->ports + (unsigned long )i))->child != (unsigned long )((struct usb_device *)0)) { usb_disconnect(& (*(hub->ports + (unsigned long )i))->child); } else { } i = i + 1; ldv_30838: ; if (udev->maxchild > i) { goto ldv_30837; } else { } descriptor.modname = "usbcore"; descriptor.function = "usb_disconnect"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor.format = "unregistering device\n"; descriptor.lineno = 2137U; descriptor.flags = 1U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)(& udev->dev), "unregistering device\n"); } else { } usb_disable_device(udev, 0); usb_hcd_synchronize_unlinks(udev); usb_remove_ep_devs(& udev->ep0); device_unlock(& udev->dev); device_del(& udev->dev); release_devnum(udev); spin_lock_irq(& device_state_lock); *pdev = 0; spin_unlock_irq(& device_state_lock); hub_free_dev(udev); put_device(& udev->dev); return; } } static void show_string(struct usb_device *udev , char *id , char *string ) { { if ((unsigned long )string == (unsigned long )((char *)0)) { return; } else { } dev_printk("\016", (struct device const *)(& udev->dev), "%s: %s\n", id, string); return; } } static void announce_device(struct usb_device *udev ) { { _dev_info((struct device const *)(& udev->dev), "New USB device found, idVendor=%04x, idProduct=%04x\n", (int )udev->descriptor.idVendor, (int )udev->descriptor.idProduct); _dev_info((struct device const *)(& udev->dev), "New USB device strings: Mfr=%d, Product=%d, SerialNumber=%d\n", (int )udev->descriptor.iManufacturer, (int )udev->descriptor.iProduct, (int )udev->descriptor.iSerialNumber); show_string(udev, (char *)"Product", udev->product); show_string(udev, (char *)"Manufacturer", udev->manufacturer); show_string(udev, (char *)"SerialNumber", udev->serial); return; } } static struct usb_device_id whitelist_table[4U] = { {112U, (unsigned short)0, (unsigned short)0, (unsigned short)0, (unsigned short)0, 9U, 0U, 0U, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 0UL}, {112U, (unsigned short)0, (unsigned short)0, (unsigned short)0, (unsigned short)0, 9U, 0U, 1U, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 0UL}, {3U, 1317U, 42144U, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 0UL}}; static int is_targeted(struct usb_device *dev ) { struct usb_device_id *id ; { id = (struct usb_device_id *)(& whitelist_table); if ((unsigned int )(dev->bus)->otg_port == 0U) { return (1); } else { } if ((unsigned int )dev->descriptor.idVendor == 6666U && (unsigned int )dev->descriptor.idProduct == 47837U) { return (0); } else { } id = (struct usb_device_id *)(& whitelist_table); goto ldv_30857; ldv_30856: ; if ((int )id->match_flags & 1 && (int )id->idVendor != (int )dev->descriptor.idVendor) { goto ldv_30855; } else { } if (((int )id->match_flags & 2) != 0 && (int )id->idProduct != (int )dev->descriptor.idProduct) { goto ldv_30855; } else { } if (((int )id->match_flags & 4) != 0 && (int )id->bcdDevice_lo > (int )dev->descriptor.bcdDevice) { goto ldv_30855; } else { } if (((int )id->match_flags & 8) != 0 && (int )id->bcdDevice_hi < (int )dev->descriptor.bcdDevice) { goto ldv_30855; } else { } if (((int )id->match_flags & 16) != 0 && (int )id->bDeviceClass != (int )dev->descriptor.bDeviceClass) { goto ldv_30855; } else { } if (((int )id->match_flags & 32) != 0 && (int )id->bDeviceSubClass != (int )dev->descriptor.bDeviceSubClass) { goto ldv_30855; } else { } if (((int )id->match_flags & 64) != 0 && (int )id->bDeviceProtocol != (int )dev->descriptor.bDeviceProtocol) { goto ldv_30855; } else { } return (1); ldv_30855: id = id + 1; ldv_30857: ; if ((unsigned int )id->match_flags != 0U) { goto ldv_30856; } else { } dev_err((struct device const *)(& dev->dev), "device v%04x p%04x is not supported\n", (int )dev->descriptor.idVendor, (int )dev->descriptor.idProduct); return (0); } } static int usb_enumerate_device_otg(struct usb_device *udev ) { int err ; struct usb_otg_descriptor *desc ; struct usb_bus *bus ; unsigned int port1 ; unsigned int tmp ; int tmp___0 ; struct pm_message __constr_expr_0 ; struct _ddebug descriptor ; long tmp___1 ; int tmp___2 ; { err = 0; if (((unsigned int )*((unsigned char *)udev->bus + 27UL) == 0U && (unsigned long )udev->config != (unsigned long )((struct usb_host_config *)0)) && (unsigned long )udev->parent == (unsigned long )(udev->bus)->root_hub) { desc = 0; bus = udev->bus; tmp___0 = __usb_get_extra_descriptor(*(udev->rawdescriptors), (unsigned int )(udev->config)->desc.wTotalLength, 9, (void **)(& desc)); if (tmp___0 == 0) { if (((int )desc->bmAttributes & 2) != 0) { port1 = (unsigned int )udev->portnum; _dev_info((struct device const *)(& udev->dev), "Dual-Role OTG device on %sHNP port\n", (unsigned int )bus->otg_port == port1 ? (char *)"" : (char *)"non-"); if ((unsigned int )bus->otg_port == port1) { bus->b_hnp_enable = 1U; } else { } tmp = __create_pipe(udev, 0U); err = usb_control_msg(udev, tmp | 2147483648U, 3, 0, (unsigned int )*((unsigned char *)bus + 27UL) != 0U ? 3 : 5, 0, 0, 0, 5000); if (err < 0) { _dev_info((struct device const *)(& udev->dev), "can\'t set HNP mode: %d\n", err); bus->b_hnp_enable = 0U; } else { } } else { } } else { } } else { } tmp___2 = is_targeted(udev); if (tmp___2 == 0) { if ((unsigned int )*((unsigned char *)udev->bus + 27UL) != 0U || (unsigned int )*((unsigned char *)udev->bus + 27UL) != 0U) { __constr_expr_0.event = 2; err = usb_port_suspend(udev, __constr_expr_0); if (err < 0) { descriptor.modname = "usbcore"; descriptor.function = "usb_enumerate_device_otg"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor.format = "HNP fail, %d\n"; descriptor.lineno = 2260U; descriptor.flags = 1U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)(& udev->dev), "HNP fail, %d\n", err); } else { } } else { } } else { } err = -524; goto fail; } else { } fail: ; return (err); } } static int usb_enumerate_device(struct usb_device *udev ) { int err ; { if ((unsigned long )udev->config == (unsigned long )((struct usb_host_config *)0)) { err = usb_get_configuration(udev); if (err < 0) { dev_err((struct device const *)(& udev->dev), "can\'t read configurations, error %d\n", err); return (err); } else { } } else { } if ((unsigned int )*((unsigned char *)udev + 1596UL) != 0U && (unsigned int )*((unsigned char *)udev + 1596UL) == 0U) { udev->product = kstrdup("n/a (unauthorized)", 208U); udev->manufacturer = kstrdup("n/a (unauthorized)", 208U); udev->serial = kstrdup("n/a (unauthorized)", 208U); } else { udev->product = usb_cache_string(udev, (int )udev->descriptor.iProduct); udev->manufacturer = usb_cache_string(udev, (int )udev->descriptor.iManufacturer); udev->serial = usb_cache_string(udev, (int )udev->descriptor.iSerialNumber); } err = usb_enumerate_device_otg(udev); if (err < 0) { return (err); } else { } usb_detect_interface_quirks(udev); return (0); } } static void set_usb_port_removable(struct usb_device *udev ) { struct usb_device *hdev ; struct usb_hub *hub ; u8 port ; u16 wHubCharacteristics ; bool removable ; int tmp ; { hdev = udev->parent; port = udev->portnum; removable = 1; if ((unsigned long )hdev == (unsigned long )((struct usb_device *)0)) { return; } else { } hub = hdev_to_hub(udev->parent); wHubCharacteristics = (hub->descriptor)->wHubCharacteristics; if (((int )wHubCharacteristics & 4) == 0) { return; } else { } tmp = hub_is_superspeed(hdev); if (tmp != 0) { if (((int )(hub->descriptor)->u.ss.DeviceRemovable >> (int )port) & 1) { removable = 0; } else if (((int )(hub->descriptor)->u.hs.DeviceRemovable[(int )((unsigned int )port / 8U)] >> ((int )port & 7)) & 1) { removable = 0; } else { } } else { } if ((int )removable) { udev->removable = USB_DEVICE_REMOVABLE; } else { udev->removable = USB_DEVICE_FIXED; } return; } } int usb_new_device(struct usb_device *udev ) { int err ; struct _ddebug descriptor ; long tmp ; size_t tmp___0 ; size_t tmp___1 ; size_t tmp___2 ; { if ((unsigned long )udev->parent != (unsigned long )((struct usb_device *)0)) { device_init_wakeup(& udev->dev, 0); } else { } pm_runtime_set_active(& udev->dev); pm_runtime_get_noresume(& udev->dev); pm_runtime_use_autosuspend(& udev->dev); pm_runtime_enable(& udev->dev); usb_disable_autosuspend(udev); err = usb_enumerate_device(udev); if (err < 0) { goto fail; } else { } descriptor.modname = "usbcore"; descriptor.function = "usb_new_device"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor.format = "udev %d, busnum %d, minor = %d\n"; descriptor.lineno = 2397U; descriptor.flags = 1U; tmp = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)(& udev->dev), "udev %d, busnum %d, minor = %d\n", udev->devnum, (udev->bus)->busnum, ((udev->bus)->busnum + -1) * 128 + (udev->devnum + -1)); } else { } udev->dev.devt = (dev_t )((((udev->bus)->busnum + -1) * 128 + (udev->devnum + -1)) | 198180864); announce_device(udev); if ((unsigned long )udev->serial != (unsigned long )((char *)0)) { tmp___0 = strlen((char const *)udev->serial); add_device_randomness((void const *)udev->serial, (unsigned int )tmp___0); } else { } if ((unsigned long )udev->product != (unsigned long )((char *)0)) { tmp___1 = strlen((char const *)udev->product); add_device_randomness((void const *)udev->product, (unsigned int )tmp___1); } else { } if ((unsigned long )udev->manufacturer != (unsigned long )((char *)0)) { tmp___2 = strlen((char const *)udev->manufacturer); add_device_randomness((void const *)udev->manufacturer, (unsigned int )tmp___2); } else { } device_enable_async_suspend(& udev->dev); if ((unsigned long )udev->parent != (unsigned long )((struct usb_device *)0)) { set_usb_port_removable(udev); } else { } err = device_add(& udev->dev); if (err != 0) { dev_err((struct device const *)(& udev->dev), "can\'t device_add, error %d\n", err); goto fail; } else { } usb_create_ep_devs(& udev->dev, & udev->ep0, udev); usb_mark_last_busy(udev); pm_runtime_put_sync_autosuspend(& udev->dev); return (err); fail: usb_set_device_state(udev, USB_STATE_NOTATTACHED); pm_runtime_disable(& udev->dev); pm_runtime_set_suspended(& udev->dev); return (err); } } int usb_deauthorize_device(struct usb_device *usb_dev ) { { device_lock(& usb_dev->dev); if ((unsigned int )*((unsigned char *)usb_dev + 1596UL) == 0U) { goto out_unauthorized; } else { } usb_dev->authorized = 0U; usb_set_configuration(usb_dev, -1); kfree((void const *)usb_dev->product); usb_dev->product = kstrdup("n/a (unauthorized)", 208U); kfree((void const *)usb_dev->manufacturer); usb_dev->manufacturer = kstrdup("n/a (unauthorized)", 208U); kfree((void const *)usb_dev->serial); usb_dev->serial = kstrdup("n/a (unauthorized)", 208U); usb_destroy_configuration(usb_dev); usb_dev->descriptor.bNumConfigurations = 0U; out_unauthorized: device_unlock(& usb_dev->dev); return (0); } } int usb_authorize_device(struct usb_device *usb_dev ) { int result ; int c ; { result = 0; device_lock(& usb_dev->dev); if ((unsigned int )*((unsigned char *)usb_dev + 1596UL) != 0U) { goto out_authorized; } else { } result = usb_autoresume_device(usb_dev); if (result < 0) { dev_err((struct device const *)(& usb_dev->dev), "can\'t autoresume for authorization: %d\n", result); goto error_autoresume; } else { } result = usb_get_device_descriptor(usb_dev, 18U); if (result < 0) { dev_err((struct device const *)(& usb_dev->dev), "can\'t re-read device descriptor for authorization: %d\n", result); goto error_device_descriptor; } else { } kfree((void const *)usb_dev->product); usb_dev->product = 0; kfree((void const *)usb_dev->manufacturer); usb_dev->manufacturer = 0; kfree((void const *)usb_dev->serial); usb_dev->serial = 0; usb_dev->authorized = 1U; result = usb_enumerate_device(usb_dev); if (result < 0) { goto error_enumerate; } else { } c = usb_choose_configuration(usb_dev); if (c >= 0) { result = usb_set_configuration(usb_dev, c); if (result != 0) { dev_err((struct device const *)(& usb_dev->dev), "can\'t set config #%d, error %d\n", c, result); } else { } } else { } _dev_info((struct device const *)(& usb_dev->dev), "authorized to connect\n"); error_enumerate: ; error_device_descriptor: usb_autosuspend_device(usb_dev); error_autoresume: ; out_authorized: device_unlock(& usb_dev->dev); return (result); } } static unsigned int hub_is_wusb(struct usb_hub *hub ) { struct usb_hcd *hcd ; struct usb_bus const *__mptr ; { if ((unsigned long )(hub->hdev)->parent != (unsigned long )((struct usb_device *)0)) { return (0U); } else { } __mptr = (struct usb_bus const *)(hub->hdev)->bus; hcd = (struct usb_hcd *)__mptr; return ((unsigned int )hcd->wireless); } } static int hub_port_reset(struct usb_hub *hub , int port1 , struct usb_device *udev , unsigned int delay , bool warm ) ; static bool hub_port_warm_reset_required(struct usb_hub *hub , u16 portstatus ) { int tmp ; { tmp = hub_is_superspeed(hub->hdev); return ((bool )(tmp != 0 && (((int )portstatus & 480) == 192 || ((int )portstatus & 480) == 320))); } } static int hub_port_wait_reset(struct usb_hub *hub , int port1 , struct usb_device *udev , unsigned int delay , bool warm ) { int delay_time ; int ret ; u16 portstatus ; u16 portchange ; int ret___0 ; struct _ddebug descriptor ; long tmp ; bool tmp___0 ; int tmp___1 ; unsigned int tmp___2 ; bool tmp___3 ; struct _ddebug descriptor___0 ; long tmp___4 ; { delay_time = 0; goto ldv_30935; ldv_30934: msleep(delay); ret = hub_port_status(hub, port1, & portstatus, & portchange); if (ret < 0) { return (ret); } else { } if (((int )portstatus & 16) != 0) { goto delay; } else { } if (! warm) { tmp___0 = hub_port_warm_reset_required(hub, (int )portstatus); if ((int )tmp___0) { if ((int )portchange & 1) { clear_port_feature(hub->hdev, port1, 16); } else { } if (((int )portchange & 64) != 0) { clear_port_feature(hub->hdev, port1, 25); } else { } if (((int )portchange & 16) != 0) { clear_port_feature(hub->hdev, port1, 20); } else { } descriptor.modname = "usbcore"; descriptor.function = "hub_port_wait_reset"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor.format = "hot reset failed, warm reset port %d\n"; descriptor.lineno = 2626U; descriptor.flags = 1U; tmp = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)hub->intfdev, "hot reset failed, warm reset port %d\n", port1); } else { } ret___0 = hub_port_reset(hub, port1, udev, 50U, 1); if ((int )portchange & 1) { clear_port_feature(hub->hdev, port1, 16); } else { } return (ret___0); } else { } if (((int )portstatus & 1) == 0) { return (-107); } else { } if ((int )portchange & 1) { return (-107); } else { } if (((int )portstatus & 2) != 0) { tmp___2 = hub_is_wusb(hub); if (tmp___2 != 0U) { udev->speed = USB_SPEED_WIRELESS; } else { tmp___1 = hub_is_superspeed(hub->hdev); if (tmp___1 != 0) { udev->speed = USB_SPEED_SUPER; } else if (((int )portstatus & 1024) != 0) { udev->speed = USB_SPEED_HIGH; } else if (((int )portstatus & 512) != 0) { udev->speed = USB_SPEED_LOW; } else { udev->speed = USB_SPEED_FULL; } } return (0); } else { } } else { if (((int )portstatus & 1) == 0) { return (-107); } else { tmp___3 = hub_port_warm_reset_required(hub, (int )portstatus); if ((int )tmp___3) { return (-107); } else { } } return (0); } delay: ; if (delay_time > 19) { delay = 200U; } else { } descriptor___0.modname = "usbcore"; descriptor___0.function = "hub_port_wait_reset"; descriptor___0.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___0.format = "port %d not %sreset yet, waiting %dms\n"; descriptor___0.lineno = 2672U; descriptor___0.flags = 1U; tmp___4 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___4 != 0L) { __dynamic_dev_dbg(& descriptor___0, (struct device const *)hub->intfdev, "port %d not %sreset yet, waiting %dms\n", port1, (int )warm ? (char *)"warm " : (char *)"", delay); } else { } delay_time = (int )((unsigned int )delay_time + delay); ldv_30935: ; if (delay_time <= 799) { goto ldv_30934; } else { } return (-16); } } static void hub_port_finish_reset(struct usb_hub *hub , int port1 , struct usb_device *udev , int *status , bool warm ) { struct usb_hcd *hcd ; int tmp ; { switch (*status) { case 0: ; if (! warm) { msleep(50U); update_devnum(udev, 0); hcd = bus_to_hcd(udev->bus); if ((unsigned long )(hcd->driver)->reset_device != (unsigned long )((int (*/* const */)(struct usb_hcd * , struct usb_device * ))0)) { (*((hcd->driver)->reset_device))(hcd, udev); } else { } } else { } case -107: ; case -19: clear_port_feature(hub->hdev, port1, 20); tmp = hub_is_superspeed(hub->hdev); if (tmp != 0) { clear_port_feature(hub->hdev, port1, 29); clear_port_feature(hub->hdev, port1, 25); } else { } if (! warm) { usb_set_device_state(udev, *status != 0 ? USB_STATE_NOTATTACHED : USB_STATE_DEFAULT); } else { } goto ldv_30948; } ldv_30948: ; return; } } static int hub_port_reset(struct usb_hub *hub , int port1 , struct usb_device *udev , unsigned int delay , bool warm ) { int i ; int status ; int tmp ; struct _ddebug descriptor ; long tmp___0 ; struct _ddebug descriptor___0 ; long tmp___1 ; { if (! warm) { down_read(& ehci_cf_port_reset_rwsem); } else { tmp = hub_is_superspeed(hub->hdev); if (tmp == 0) { dev_err((struct device const *)hub->intfdev, "only USB3 hub support warm reset\n"); return (-22); } else { } } i = 0; goto ldv_30963; ldv_30962: status = set_port_feature(hub->hdev, port1, (int )warm ? 28 : 4); if (status != 0) { dev_err((struct device const *)hub->intfdev, "cannot %sreset port %d (err = %d)\n", (int )warm ? (char *)"warm " : (char *)"", port1, status); } else { status = hub_port_wait_reset(hub, port1, udev, delay, (int )warm); if (status != 0 && status != -107) { descriptor.modname = "usbcore"; descriptor.function = "hub_port_reset"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor.format = "port_wait_reset: err = %d\n"; descriptor.lineno = 2749U; descriptor.flags = 1U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)hub->intfdev, "port_wait_reset: err = %d\n", status); } else { } } else { } } if ((status == 0 || status == -107) || status == -19) { hub_port_finish_reset(hub, port1, udev, & status, (int )warm); goto done; } else { } descriptor___0.modname = "usbcore"; descriptor___0.function = "hub_port_reset"; descriptor___0.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___0.format = "port %d not enabled, trying %sreset again...\n"; descriptor___0.lineno = 2760U; descriptor___0.flags = 1U; tmp___1 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___1 != 0L) { __dynamic_dev_dbg(& descriptor___0, (struct device const *)hub->intfdev, "port %d not enabled, trying %sreset again...\n", port1, (int )warm ? (char *)"warm " : (char *)""); } else { } delay = 200U; i = i + 1; ldv_30963: ; if (i <= 4) { goto ldv_30962; } else { } dev_err((struct device const *)hub->intfdev, "Cannot enable port %i. Maybe the USB cable is bad?\n", port1); done: ; if (! warm) { up_read(& ehci_cf_port_reset_rwsem); } else { } return (status); } } static int port_is_power_on(struct usb_hub *hub , unsigned int portstatus ) { int ret ; int tmp ; { ret = 0; tmp = hub_is_superspeed(hub->hdev); if (tmp != 0) { if ((portstatus & 512U) != 0U) { ret = 1; } else if ((portstatus & 256U) != 0U) { ret = 1; } else { } } else { } return (ret); } } static int port_is_suspended(struct usb_hub *hub , unsigned int portstatus ) { int ret ; int tmp ; { ret = 0; tmp = hub_is_superspeed(hub->hdev); if (tmp != 0) { if ((portstatus & 480U) == 96U) { ret = 1; } else if ((portstatus & 4U) != 0U) { ret = 1; } else { } } else { } return (ret); } } static int check_port_resume_type(struct usb_device *udev , struct usb_hub *hub , int port1 , int status , unsigned int portchange , unsigned int portstatus ) { int tmp ; int tmp___0 ; struct _ddebug descriptor ; long tmp___1 ; { if (status != 0) { goto _L; } else { tmp = port_is_suspended(hub, portstatus); if (tmp != 0) { goto _L; } else { tmp___0 = port_is_power_on(hub, portstatus); if (tmp___0 == 0) { goto _L; } else if ((portstatus & 1U) == 0U) { _L: /* CIL Label */ if (status >= 0) { status = -19; } else if ((portstatus & 2U) == 0U && (unsigned int )*((unsigned char *)udev + 1680UL) == 0U) { if ((unsigned int )*((unsigned char *)udev + 1596UL) != 0U) { udev->reset_resume = 1U; } else { status = -19; } } else { } } else { } } } if (status != 0) { descriptor.modname = "usbcore"; descriptor.function = "check_port_resume_type"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor.format = "port %d status %04x.%04x after resume, %d\n"; descriptor.lineno = 2838U; descriptor.flags = 1U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)hub->intfdev, "port %d status %04x.%04x after resume, %d\n", port1, portchange, portstatus, status); } else { } } else if ((unsigned int )*((unsigned char *)udev + 1680UL) != 0U) { if ((int )portchange & 1) { clear_port_feature(hub->hdev, port1, 16); } else { } if ((portchange & 2U) != 0U) { clear_port_feature(hub->hdev, port1, 17); } else { } } else { } return (status); } } int usb_disable_ltm(struct usb_device *udev ) { struct usb_hcd *hcd ; struct usb_hcd *tmp ; bool tmp___0 ; int tmp___1 ; bool tmp___2 ; int tmp___3 ; unsigned int tmp___4 ; int tmp___5 ; { tmp = bus_to_hcd(udev->bus); hcd = tmp; tmp___0 = usb_device_supports_ltm(hcd->self.root_hub); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { return (0); } else { tmp___2 = usb_device_supports_ltm(udev); if (tmp___2) { tmp___3 = 0; } else { tmp___3 = 1; } if (tmp___3) { return (0); } else { } } if ((unsigned long )udev->actconfig == (unsigned long )((struct usb_host_config *)0)) { return (0); } else { } tmp___4 = __create_pipe(udev, 0U); tmp___5 = usb_control_msg(udev, tmp___4 | 2147483648U, 1, 0, 50, 0, 0, 0, 5000); return (tmp___5); } } void usb_enable_ltm(struct usb_device *udev ) { struct usb_hcd *hcd ; struct usb_hcd *tmp ; bool tmp___0 ; int tmp___1 ; bool tmp___2 ; int tmp___3 ; unsigned int tmp___4 ; { tmp = bus_to_hcd(udev->bus); hcd = tmp; tmp___0 = usb_device_supports_ltm(hcd->self.root_hub); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { return; } else { tmp___2 = usb_device_supports_ltm(udev); if (tmp___2) { tmp___3 = 0; } else { tmp___3 = 1; } if (tmp___3) { return; } else { } } if ((unsigned long )udev->actconfig == (unsigned long )((struct usb_host_config *)0)) { return; } else { } tmp___4 = __create_pipe(udev, 0U); usb_control_msg(udev, tmp___4 | 2147483648U, 3, 0, 50, 0, 0, 0, 5000); return; } } int usb_port_suspend(struct usb_device *udev , pm_message_t msg ) { struct usb_hub *hub ; struct usb_hub *tmp ; int port1 ; int status ; unsigned int tmp___0 ; unsigned int tmp___1 ; int tmp___2 ; struct _ddebug descriptor ; long tmp___3 ; int tmp___4 ; int tmp___5 ; int tmp___6 ; struct _ddebug descriptor___0 ; long tmp___7 ; unsigned int tmp___8 ; struct _ddebug descriptor___1 ; long tmp___9 ; { tmp = hdev_to_hub(udev->parent); hub = tmp; port1 = (int )udev->portnum; if ((unsigned int )*((unsigned char *)udev + 1680UL) != 0U) { tmp___2 = hub_is_superspeed(hub->hdev); if (tmp___2 == 0) { tmp___0 = __create_pipe(udev, 0U); status = usb_control_msg(udev, tmp___0 | 2147483648U, 3, 0, 1, 0, 0, 0, 5000); } else { tmp___1 = __create_pipe(udev, 0U); status = usb_control_msg(udev, tmp___1 | 2147483648U, 3, 1, 0, 768, 0, 0, 5000); } if (status != 0) { descriptor.modname = "usbcore"; descriptor.function = "usb_port_suspend"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor.format = "won\'t remote wakeup, status %d\n"; descriptor.lineno = 2981U; descriptor.flags = 1U; tmp___3 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___3 != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)(& udev->dev), "won\'t remote wakeup, status %d\n", status); } else { } if ((msg.event & 1024) != 0) { return (status); } else { } } else { } } else { } if ((unsigned int )*((unsigned char *)udev + 1597UL) != 0U) { usb_set_usb2_hardware_lpm(udev, 0); } else { } tmp___4 = usb_disable_ltm(udev); if (tmp___4 != 0) { dev_err((struct device const *)(& udev->dev), "%s Failed to disable LTM before suspend\n.", "usb_port_suspend"); return (-12); } else { } tmp___5 = usb_unlocked_disable_lpm(udev); if (tmp___5 != 0) { dev_err((struct device const *)(& udev->dev), "%s Failed to disable LPM before suspend\n.", "usb_port_suspend"); return (-12); } else { } tmp___6 = hub_is_superspeed(hub->hdev); if (tmp___6 != 0) { status = set_port_feature(hub->hdev, port1 | 768, 5); } else { status = set_port_feature(hub->hdev, port1, 2); } if (status != 0) { descriptor___0.modname = "usbcore"; descriptor___0.function = "usb_port_suspend"; descriptor___0.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___0.format = "can\'t suspend port %d, status %d\n"; descriptor___0.lineno = 3013U; descriptor___0.flags = 1U; tmp___7 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___7 != 0L) { __dynamic_dev_dbg(& descriptor___0, (struct device const *)hub->intfdev, "can\'t suspend port %d, status %d\n", port1, status); } else { } if ((unsigned int )*((unsigned char *)udev + 1680UL) != 0U) { tmp___8 = __create_pipe(udev, 0U); usb_control_msg(udev, tmp___8 | 2147483648U, 1, 0, 1, 0, 0, 0, 5000); } else { } if ((unsigned int )*((unsigned char *)udev + 1596UL) != 0U) { usb_set_usb2_hardware_lpm(udev, 1); } else { } usb_enable_ltm(udev); usb_unlocked_enable_lpm(udev); if ((msg.event & 1024) == 0) { status = 0; } else { } } else { descriptor___1.modname = "usbcore"; descriptor___1.function = "usb_port_suspend"; descriptor___1.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___1.format = "usb %ssuspend, wakeup %d\n"; descriptor___1.lineno = 3037U; descriptor___1.flags = 1U; tmp___9 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); if (tmp___9 != 0L) { __dynamic_dev_dbg(& descriptor___1, (struct device const *)(& udev->dev), "usb %ssuspend, wakeup %d\n", (msg.event & 1024) != 0 ? (char *)"auto-" : (char *)"", (int )udev->do_remote_wakeup); } else { } usb_set_device_state(udev, USB_STATE_SUSPENDED); msleep(10U); } usb_mark_last_busy(hub->hdev); return (status); } } static int finish_port_resume(struct usb_device *udev ) { int status ; u16 devstatus ; struct _ddebug descriptor ; long tmp ; struct _ddebug descriptor___0 ; long tmp___0 ; struct _ddebug descriptor___1 ; long tmp___1 ; unsigned int tmp___2 ; struct _ddebug descriptor___2 ; long tmp___3 ; { status = 0; devstatus = 0U; descriptor.modname = "usbcore"; descriptor.function = "finish_port_resume"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor.format = "%s\n"; descriptor.lineno = 3063U; descriptor.flags = 1U; tmp = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)(& udev->dev), "%s\n", (unsigned int )*((unsigned char *)udev + 1680UL) != 0U ? (char *)"finish reset-resume" : (char *)"finish resume"); } else { } usb_set_device_state(udev, (unsigned long )udev->actconfig != (unsigned long )((struct usb_host_config *)0) ? USB_STATE_CONFIGURED : USB_STATE_ADDRESS); if ((unsigned int )*((unsigned char *)udev + 1680UL) != 0U) { retry_reset_resume: status = usb_reset_and_verify_device(udev); } else { } if (status == 0) { devstatus = 0U; status = usb_get_status(udev, 0, 0, (void *)(& devstatus)); if (status >= 0) { status = status > 0 ? 0 : -19; } else { } if ((status != 0 && (unsigned int )*((unsigned char *)udev + 1680UL) == 0U) && (unsigned int )*((unsigned char *)udev + 1596UL) != 0U) { descriptor___0.modname = "usbcore"; descriptor___0.function = "finish_port_resume"; descriptor___0.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___0.format = "retry with reset-resume\n"; descriptor___0.lineno = 3095U; descriptor___0.flags = 1U; tmp___0 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___0 != 0L) { __dynamic_dev_dbg(& descriptor___0, (struct device const *)(& udev->dev), "retry with reset-resume\n"); } else { } udev->reset_resume = 1U; goto retry_reset_resume; } else { } } else { } if (status != 0) { descriptor___1.modname = "usbcore"; descriptor___1.function = "finish_port_resume"; descriptor___1.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___1.format = "gone after usb resume? status %d\n"; descriptor___1.lineno = 3103U; descriptor___1.flags = 1U; tmp___1 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); if (tmp___1 != 0L) { __dynamic_dev_dbg(& descriptor___1, (struct device const *)(& udev->dev), "gone after usb resume? status %d\n", status); } else { } } else if ((unsigned long )udev->actconfig != (unsigned long )((struct usb_host_config *)0) && (unsigned int )*((unsigned char *)udev + 1680UL) == 0U) { if (((int )devstatus & 2) != 0) { tmp___2 = __create_pipe(udev, 0U); status = usb_control_msg(udev, tmp___2 | 2147483648U, 1, 0, 1, 0, 0, 0, 5000); if (status != 0) { descriptor___2.modname = "usbcore"; descriptor___2.function = "finish_port_resume"; descriptor___2.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___2.format = "disable remote wakeup, status %d\n"; descriptor___2.lineno = 3123U; descriptor___2.flags = 1U; tmp___3 = ldv__builtin_expect((long )descriptor___2.flags & 1L, 0L); if (tmp___3 != 0L) { __dynamic_dev_dbg(& descriptor___2, (struct device const *)(& udev->dev), "disable remote wakeup, status %d\n", status); } else { } } else { } } else { } status = 0; } else { } return (status); } } int usb_port_resume(struct usb_device *udev , pm_message_t msg ) { struct usb_hub *hub ; struct usb_hub *tmp ; int port1 ; int status ; u16 portchange ; u16 portstatus ; int tmp___0 ; int tmp___1 ; struct _ddebug descriptor ; long tmp___2 ; struct _ddebug descriptor___0 ; long tmp___3 ; int tmp___4 ; struct _ddebug descriptor___1 ; long tmp___5 ; { tmp = hdev_to_hub(udev->parent); hub = tmp; port1 = (int )udev->portnum; status = hub_port_status(hub, port1, & portstatus, & portchange); if (status == 0) { tmp___0 = port_is_suspended(hub, (unsigned int )portstatus); if (tmp___0 == 0) { goto SuspendCleared; } else { } } else { } set_bit((unsigned int )port1, (unsigned long volatile *)(& hub->busy_bits)); tmp___1 = hub_is_superspeed(hub->hdev); if (tmp___1 != 0) { status = set_port_feature(hub->hdev, port1, 5); } else { status = clear_port_feature(hub->hdev, port1, 2); } if (status != 0) { descriptor.modname = "usbcore"; descriptor.function = "usb_port_resume"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor.format = "can\'t resume port %d, status %d\n"; descriptor.lineno = 3190U; descriptor.flags = 1U; tmp___2 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___2 != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)hub->intfdev, "can\'t resume port %d, status %d\n", port1, status); } else { } } else { descriptor___0.modname = "usbcore"; descriptor___0.function = "usb_port_resume"; descriptor___0.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___0.format = "usb %sresume\n"; descriptor___0.lineno = 3194U; descriptor___0.flags = 1U; tmp___3 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___3 != 0L) { __dynamic_dev_dbg(& descriptor___0, (struct device const *)(& udev->dev), "usb %sresume\n", (msg.event & 1024) != 0 ? (char *)"auto-" : (char *)""); } else { } msleep(25U); status = hub_port_status(hub, port1, & portstatus, & portchange); msleep(10U); } SuspendCleared: ; if (status == 0) { tmp___4 = hub_is_superspeed(hub->hdev); if (tmp___4 != 0) { if (((int )portchange & 64) != 0) { clear_port_feature(hub->hdev, port1, 25); } else if (((int )portchange & 4) != 0) { clear_port_feature(hub->hdev, port1, 18); } else { } } else { } } else { } clear_bit(port1, (unsigned long volatile *)(& hub->busy_bits)); status = check_port_resume_type(udev, hub, port1, status, (unsigned int )portchange, (unsigned int )portstatus); if (status == 0) { status = finish_port_resume(udev); } else { } if (status < 0) { descriptor___1.modname = "usbcore"; descriptor___1.function = "usb_port_resume"; descriptor___1.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___1.format = "can\'t resume, status %d\n"; descriptor___1.lineno = 3227U; descriptor___1.flags = 1U; tmp___5 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); if (tmp___5 != 0L) { __dynamic_dev_dbg(& descriptor___1, (struct device const *)(& udev->dev), "can\'t resume, status %d\n", status); } else { } hub_port_logical_disconnect(hub, port1); } else { if ((unsigned int )*((unsigned char *)udev + 1596UL) != 0U) { usb_set_usb2_hardware_lpm(udev, 1); } else { } usb_enable_ltm(udev); usb_unlocked_enable_lpm(udev); } return (status); } } int usb_remote_wakeup(struct usb_device *udev ) { int status ; struct _ddebug descriptor ; long tmp ; { status = 0; if ((unsigned int )udev->state == 8U) { descriptor.modname = "usbcore"; descriptor.function = "usb_remote_wakeup"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor.format = "usb %sresume\n"; descriptor.lineno = 3248U; descriptor.flags = 1U; tmp = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)(& udev->dev), "usb %sresume\n", (char *)"wakeup-"); } else { } status = usb_autoresume_device(udev); if (status == 0) { usb_autosuspend_device(udev); } else { } } else { } return (status); } } static int hub_suspend(struct usb_interface *intf , pm_message_t msg ) { struct usb_hub *hub ; void *tmp ; struct usb_device *hdev ; unsigned int port1 ; int status ; struct usb_device *udev ; int tmp___0 ; struct _ddebug descriptor ; long tmp___1 ; { tmp = usb_get_intfdata(intf); hub = (struct usb_hub *)tmp; hdev = hub->hdev; port1 = 1U; goto ldv_31057; ldv_31056: udev = (*(hub->ports + (unsigned long )(port1 - 1U)))->child; if ((unsigned long )udev != (unsigned long )((struct usb_device *)0) && (unsigned int )*((unsigned char *)udev + 1596UL) != 0U) { dev_warn((struct device const *)(& intf->dev), "port %d nyet suspended\n", port1); if ((msg.event & 1024) != 0) { return (-16); } else { } } else { } port1 = port1 + 1U; ldv_31057: ; if ((unsigned int )hdev->maxchild >= port1) { goto ldv_31056; } else { } tmp___0 = hub_is_superspeed(hdev); if (tmp___0 != 0 && (unsigned int )*((unsigned char *)hdev + 1680UL) != 0U) { port1 = 1U; goto ldv_31060; ldv_31059: status = set_port_feature(hdev, (int )(port1 | 1792U), 27); port1 = port1 + 1U; ldv_31060: ; if ((unsigned int )hdev->maxchild >= port1) { goto ldv_31059; } else { } } else { } descriptor.modname = "usbcore"; descriptor.function = "hub_suspend"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor.format = "%s\n"; descriptor.lineno = 3322U; descriptor.flags = 1U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)(& intf->dev), "%s\n", "hub_suspend"); } else { } hub_quiesce(hub, HUB_SUSPEND); return (0); } } static int hub_resume(struct usb_interface *intf ) { struct usb_hub *hub ; void *tmp ; struct _ddebug descriptor ; long tmp___0 ; { tmp = usb_get_intfdata(intf); hub = (struct usb_hub *)tmp; descriptor.modname = "usbcore"; descriptor.function = "hub_resume"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor.format = "%s\n"; descriptor.lineno = 3333U; descriptor.flags = 1U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)(& intf->dev), "%s\n", "hub_resume"); } else { } hub_activate(hub, HUB_RESUME); return (0); } } static int hub_reset_resume(struct usb_interface *intf ) { struct usb_hub *hub ; void *tmp ; struct _ddebug descriptor ; long tmp___0 ; { tmp = usb_get_intfdata(intf); hub = (struct usb_hub *)tmp; descriptor.modname = "usbcore"; descriptor.function = "hub_reset_resume"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor.format = "%s\n"; descriptor.lineno = 3342U; descriptor.flags = 1U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)(& intf->dev), "%s\n", "hub_reset_resume"); } else { } hub_activate(hub, HUB_RESET_RESUME); return (0); } } void usb_root_hub_lost_power(struct usb_device *rhdev ) { { dev_warn((struct device const *)(& rhdev->dev), "root hub lost power or was reset\n"); rhdev->reset_resume = 1U; return; } } static char const * const usb3_lpm_names[4U] = { "U0", "U1", "U2", "U3"}; static int usb_req_set_sel(struct usb_device *udev , enum usb3_link_state state ) { struct usb_set_sel_req *sel_values ; unsigned long long u1_sel ; unsigned long long u1_pel ; unsigned long long u2_sel ; unsigned long long u2_pel ; int ret ; struct _ddebug descriptor ; long tmp ; void *tmp___0 ; unsigned int tmp___1 ; { u1_sel = (unsigned long long )((udev->u1_params.sel + 999U) / 1000U); u1_pel = (unsigned long long )((udev->u1_params.pel + 999U) / 1000U); u2_sel = (unsigned long long )((udev->u2_params.sel + 999U) / 1000U); u2_pel = (unsigned long long )((udev->u2_params.pel + 999U) / 1000U); if (((unsigned int )state == 1U && (u1_sel > 255ULL || u1_pel > 255ULL)) || ((unsigned int )state == 2U && (u2_sel > 65535ULL || u2_pel > 65535ULL))) { descriptor.modname = "usbcore"; descriptor.function = "usb_req_set_sel"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor.format = "Device-initiated %s disabled due to long SEL %llu us or PEL %llu us\n"; descriptor.lineno = 3411U; descriptor.flags = 1U; tmp = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)(& udev->dev), "Device-initiated %s disabled due to long SEL %llu us or PEL %llu us\n", usb3_lpm_names[(unsigned int )state], u1_sel, u1_pel); } else { } return (-22); } else { } if (u1_sel > 255ULL) { u1_sel = 255ULL; } else { } if (u1_pel > 255ULL) { u1_pel = 255ULL; } else { } if (u2_sel > 65535ULL) { u2_sel = 65535ULL; } else { } if (u2_pel > 65535ULL) { u2_pel = 65535ULL; } else { } tmp___0 = kmalloc(6UL, 16U); sel_values = (struct usb_set_sel_req *)tmp___0; if ((unsigned long )sel_values == (unsigned long )((struct usb_set_sel_req *)0)) { return (-12); } else { } sel_values->u1_sel = (__u8 )u1_sel; sel_values->u1_pel = (__u8 )u1_pel; sel_values->u2_sel = (unsigned short )u2_sel; sel_values->u2_pel = (unsigned short )u2_pel; tmp___1 = __create_pipe(udev, 0U); ret = usb_control_msg(udev, tmp___1 | 2147483648U, 48, 0, 0, 0, (void *)sel_values, 6, 5000); kfree((void const *)sel_values); return (ret); } } static int usb_set_device_initiated_lpm(struct usb_device *udev , enum usb3_link_state state , bool enable ) { int ret ; int feature ; struct _ddebug descriptor ; long tmp ; unsigned int tmp___0 ; unsigned int tmp___1 ; { switch ((unsigned int )state) { case 1U: feature = 48; goto ldv_31106; case 2U: feature = 49; goto ldv_31106; default: dev_warn((struct device const *)(& udev->dev), "%s: Can\'t %s non-U1 or U2 state.\n", "usb_set_device_initiated_lpm", (int )enable ? (char *)"enable" : (char *)"disable"); return (-22); } ldv_31106: ; if ((unsigned int )udev->state != 7U) { descriptor.modname = "usbcore"; descriptor.function = "usb_set_device_initiated_lpm"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor.format = "%s: Can\'t %s %s state for unconfigured device.\n"; descriptor.lineno = 3482U; descriptor.flags = 1U; tmp = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)(& udev->dev), "%s: Can\'t %s %s state for unconfigured device.\n", "usb_set_device_initiated_lpm", (int )enable ? (char *)"enable" : (char *)"disable", usb3_lpm_names[(unsigned int )state]); } else { } return (0); } else { } if ((int )enable) { tmp___0 = __create_pipe(udev, 0U); ret = usb_control_msg(udev, tmp___0 | 2147483648U, 3, 0, (int )((__u16 )feature), 0, 0, 0, 5000); } else { tmp___1 = __create_pipe(udev, 0U); ret = usb_control_msg(udev, tmp___1 | 2147483648U, 1, 0, (int )((__u16 )feature), 0, 0, 0, 5000); } if (ret < 0) { dev_warn((struct device const *)(& udev->dev), "%s of device-initiated %s failed.\n", (int )enable ? (char *)"Enable" : (char *)"Disable", usb3_lpm_names[(unsigned int )state]); return (-16); } else { } return (0); } } static int usb_set_lpm_timeout(struct usb_device *udev , enum usb3_link_state state , int timeout ) { int ret ; int feature ; { switch ((unsigned int )state) { case 1U: feature = 23; goto ldv_31119; case 2U: feature = 24; goto ldv_31119; default: dev_warn((struct device const *)(& udev->dev), "%s: Can\'t set timeout for non-U1 or U2 state.\n", "usb_set_lpm_timeout"); return (-22); } ldv_31119: ; if (((unsigned int )state == 1U && timeout > 127) && timeout != 255) { dev_warn((struct device const *)(& udev->dev), "Failed to set %s timeout to 0x%x, which is a reserved value.\n", usb3_lpm_names[(unsigned int )state], timeout); return (-22); } else { } ret = set_port_feature(udev->parent, ((timeout << 8) & 65535) | (int )udev->portnum, feature); if (ret < 0) { dev_warn((struct device const *)(& udev->dev), "Failed to set %s timeout to 0x%x,error code %i\n", usb3_lpm_names[(unsigned int )state], timeout, ret); return (-16); } else { } if ((unsigned int )state == 1U) { udev->u1_params.timeout = timeout; } else { udev->u2_params.timeout = timeout; } return (0); } } static void usb_enable_link_state(struct usb_hcd *hcd , struct usb_device *udev , enum usb3_link_state state ) { int timeout ; int ret ; __u8 u1_mel ; __le16 u2_mel ; int tmp ; { u1_mel = ((udev->bos)->ss_cap)->bU1devExitLat; u2_mel = ((udev->bos)->ss_cap)->bU2DevExitLat; if (((unsigned int )state == 1U && (unsigned int )u1_mel == 0U) || ((unsigned int )state == 2U && (unsigned int )u2_mel == 0U)) { return; } else { } ret = usb_req_set_sel(udev, state); if (ret < 0) { dev_warn((struct device const *)(& udev->dev), "Set SEL for device-initiated %s failed.\n", usb3_lpm_names[(unsigned int )state]); return; } else { } timeout = (*((hcd->driver)->enable_usb3_lpm_timeout))(hcd, udev, state); if (timeout == 0) { return; } else { } if (timeout < 0) { dev_warn((struct device const *)(& udev->dev), "Could not enable %s link state, xHCI error %i.\n", usb3_lpm_names[(unsigned int )state], timeout); return; } else { } tmp = usb_set_lpm_timeout(udev, state, timeout); if (tmp != 0) { (*((hcd->driver)->disable_usb3_lpm_timeout))(hcd, udev, state); } else if ((unsigned long )udev->actconfig != (unsigned long )((struct usb_host_config *)0)) { usb_set_device_initiated_lpm(udev, state, 1); } else { } return; } } static int usb_disable_link_state(struct usb_hcd *hcd , struct usb_device *udev , enum usb3_link_state state ) { int feature ; int tmp ; int tmp___0 ; { switch ((unsigned int )state) { case 1U: feature = 23; goto ldv_31139; case 2U: feature = 24; goto ldv_31139; default: dev_warn((struct device const *)(& udev->dev), "%s: Can\'t disable non-U1 or U2 state.\n", "usb_disable_link_state"); return (-22); } ldv_31139: tmp = usb_set_lpm_timeout(udev, state, 0); if (tmp != 0) { return (-16); } else { } usb_set_device_initiated_lpm(udev, state, 0); tmp___0 = (*((hcd->driver)->disable_usb3_lpm_timeout))(hcd, udev, state); if (tmp___0 != 0) { dev_warn((struct device const *)(& udev->dev), "Could not disable xHCI %s timeout, bus schedule bandwidth may be impacted.\n", usb3_lpm_names[(unsigned int )state]); } else { } return (0); } } int usb_disable_lpm(struct usb_device *udev ) { struct usb_hcd *hcd ; int tmp ; int tmp___0 ; { if ((((unsigned long )udev == (unsigned long )((struct usb_device *)0) || (unsigned long )udev->parent == (unsigned long )((struct usb_device *)0)) || (unsigned int )udev->speed != 5U) || (unsigned int )*((unsigned char *)udev + 1596UL) == 0U) { return (0); } else { } hcd = bus_to_hcd(udev->bus); if ((unsigned long )hcd == (unsigned long )((struct usb_hcd *)0) || (unsigned long )(hcd->driver)->disable_usb3_lpm_timeout == (unsigned long )((int (*/* const */)(struct usb_hcd * , struct usb_device * , enum usb3_link_state ))0)) { return (0); } else { } udev->lpm_disable_count = udev->lpm_disable_count + 1U; if (udev->u1_params.timeout == 0 && udev->u2_params.timeout == 0) { return (0); } else { } tmp = usb_disable_link_state(hcd, udev, USB3_LPM_U1); if (tmp != 0) { goto enable_lpm; } else { } tmp___0 = usb_disable_link_state(hcd, udev, USB3_LPM_U2); if (tmp___0 != 0) { goto enable_lpm; } else { } return (0); enable_lpm: usb_enable_lpm(udev); return (-16); } } int usb_unlocked_disable_lpm(struct usb_device *udev ) { struct usb_hcd *hcd ; struct usb_hcd *tmp ; int ret ; { tmp = bus_to_hcd(udev->bus); hcd = tmp; if ((unsigned long )hcd == (unsigned long )((struct usb_hcd *)0)) { return (-22); } else { } ldv_mutex_lock_38(hcd->bandwidth_mutex); ret = usb_disable_lpm(udev); ldv_mutex_unlock_39(hcd->bandwidth_mutex); return (ret); } } void usb_enable_lpm(struct usb_device *udev ) { struct usb_hcd *hcd ; { if ((((unsigned long )udev == (unsigned long )((struct usb_device *)0) || (unsigned long )udev->parent == (unsigned long )((struct usb_device *)0)) || (unsigned int )udev->speed != 5U) || (unsigned int )*((unsigned char *)udev + 1596UL) == 0U) { return; } else { } udev->lpm_disable_count = udev->lpm_disable_count - 1U; hcd = bus_to_hcd(udev->bus); if (((unsigned long )hcd == (unsigned long )((struct usb_hcd *)0) || (unsigned long )(hcd->driver)->enable_usb3_lpm_timeout == (unsigned long )((int (*/* const */)(struct usb_hcd * , struct usb_device * , enum usb3_link_state ))0)) || (unsigned long )(hcd->driver)->disable_usb3_lpm_timeout == (unsigned long )((int (*/* const */)(struct usb_hcd * , struct usb_device * , enum usb3_link_state ))0)) { return; } else { } if (udev->lpm_disable_count != 0U) { return; } else { } usb_enable_link_state(hcd, udev, USB3_LPM_U1); usb_enable_link_state(hcd, udev, USB3_LPM_U2); return; } } void usb_unlocked_enable_lpm(struct usb_device *udev ) { struct usb_hcd *hcd ; struct usb_hcd *tmp ; { tmp = bus_to_hcd(udev->bus); hcd = tmp; if ((unsigned long )hcd == (unsigned long )((struct usb_hcd *)0)) { return; } else { } ldv_mutex_lock_40(hcd->bandwidth_mutex); usb_enable_lpm(udev); ldv_mutex_unlock_41(hcd->bandwidth_mutex); return; } } static int hub_port_debounce(struct usb_hub *hub , int port1 ) { int ret ; int total_time ; int stable_time ; u16 portchange ; u16 portstatus ; unsigned int connection ; struct _ddebug descriptor ; long tmp ; { stable_time = 0; connection = 65535U; total_time = 0; ldv_31196: ret = hub_port_status(hub, port1, & portstatus, & portchange); if (ret < 0) { return (ret); } else { } if (((int )portchange & 1) == 0 && ((unsigned int )portstatus & 1U) == connection) { stable_time = stable_time + 25; if (stable_time > 99) { goto ldv_31195; } else { } } else { stable_time = 0; connection = (unsigned int )portstatus & 1U; } if ((int )portchange & 1) { clear_port_feature(hub->hdev, port1, 16); } else { } if (total_time > 1499) { goto ldv_31195; } else { } msleep(25U); total_time = total_time + 25; goto ldv_31196; ldv_31195: descriptor.modname = "usbcore"; descriptor.function = "hub_port_debounce"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor.format = "debounce: port %d: total %dms stable %dms status 0x%x\n"; descriptor.lineno = 3859U; descriptor.flags = 1U; tmp = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)hub->intfdev, "debounce: port %d: total %dms stable %dms status 0x%x\n", port1, total_time, stable_time, (int )portstatus); } else { } if (stable_time <= 99) { return (-110); } else { } return ((int )portstatus); } } void usb_ep0_reinit(struct usb_device *udev ) { { usb_disable_endpoint(udev, 128U, 1); usb_disable_endpoint(udev, 0U, 1); usb_enable_endpoint(udev, & udev->ep0, 1); return; } } static int hub_set_address(struct usb_device *udev , int devnum ) { int retval ; struct usb_hcd *hcd ; struct usb_hcd *tmp ; { tmp = bus_to_hcd(udev->bus); hcd = tmp; if ((unsigned long )(hcd->driver)->address_device == (unsigned long )((int (*/* const */)(struct usb_hcd * , struct usb_device * ))0) && devnum <= 1) { return (-22); } else { } if ((unsigned int )udev->state == 6U) { return (0); } else { } if ((unsigned int )udev->state != 5U) { return (-22); } else { } if ((unsigned long )(hcd->driver)->address_device != (unsigned long )((int (*/* const */)(struct usb_hcd * , struct usb_device * ))0)) { retval = (*((hcd->driver)->address_device))(hcd, udev); } else { retval = usb_control_msg(udev, 2147483648U, 5, 0, (int )((__u16 )devnum), 0, 0, 0, 5000); } if (retval == 0) { update_devnum(udev, devnum); usb_set_device_state(udev, USB_STATE_ADDRESS); usb_ep0_reinit(udev); } else { } return (retval); } } static int hub_port_init(struct usb_hub *hub , struct usb_device *udev , int port1 , int retry_counter ) { struct mutex usb_address0_mutex ; struct usb_device *hdev ; struct usb_hcd *hcd ; struct usb_hcd *tmp ; int i ; int j ; int retval ; unsigned int delay ; enum usb_device_speed oldspeed ; char const *speed ; int devnum ; struct _ddebug descriptor ; long tmp___0 ; struct usb_device_descriptor *buf ; int r ; void *tmp___1 ; struct _ddebug descriptor___0 ; long tmp___2 ; struct _ddebug descriptor___1 ; long tmp___3 ; int tmp___4 ; int tmp___5 ; { usb_address0_mutex.count.counter = 1; usb_address0_mutex.wait_lock.ldv_5957.rlock.raw_lock.ldv_2023.head_tail = 0U; usb_address0_mutex.wait_lock.ldv_5957.rlock.magic = 3735899821U; usb_address0_mutex.wait_lock.ldv_5957.rlock.owner_cpu = 4294967295U; usb_address0_mutex.wait_lock.ldv_5957.rlock.owner = 0xffffffffffffffffUL; usb_address0_mutex.wait_lock.ldv_5957.rlock.dep_map.key = 0; usb_address0_mutex.wait_lock.ldv_5957.rlock.dep_map.class_cache[0] = 0; usb_address0_mutex.wait_lock.ldv_5957.rlock.dep_map.class_cache[1] = 0; usb_address0_mutex.wait_lock.ldv_5957.rlock.dep_map.name = "usb_address0_mutex.wait_lock"; usb_address0_mutex.wait_lock.ldv_5957.rlock.dep_map.cpu = 0; usb_address0_mutex.wait_lock.ldv_5957.rlock.dep_map.ip = 0UL; usb_address0_mutex.wait_list.next = & usb_address0_mutex.wait_list; usb_address0_mutex.wait_list.prev = & usb_address0_mutex.wait_list; usb_address0_mutex.owner = 0; usb_address0_mutex.name = 0; usb_address0_mutex.magic = (void *)(& usb_address0_mutex); usb_address0_mutex.dep_map.key = 0; usb_address0_mutex.dep_map.class_cache[0] = 0; usb_address0_mutex.dep_map.class_cache[1] = 0; usb_address0_mutex.dep_map.name = "usb_address0_mutex"; usb_address0_mutex.dep_map.cpu = 0; usb_address0_mutex.dep_map.ip = 0UL; hdev = hub->hdev; tmp = bus_to_hcd(hdev->bus); hcd = tmp; delay = 10U; oldspeed = udev->speed; devnum = udev->devnum; if ((unsigned long )hdev->parent == (unsigned long )((struct usb_device *)0)) { delay = 50U; if ((int )(hdev->bus)->otg_port == port1) { (hdev->bus)->b_hnp_enable = 0U; } else { } } else { } if ((unsigned int )oldspeed == 1U) { delay = 200U; } else { } ldv_mutex_lock_42(& usb_address0_mutex); retval = hub_port_reset(hub, port1, udev, delay, 0); if (retval < 0) { goto fail; } else { } retval = -19; if ((unsigned int )oldspeed != 0U && (unsigned int )udev->speed != (unsigned int )oldspeed) { descriptor.modname = "usbcore"; descriptor.function = "hub_port_init"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor.format = "device reset changed speed!\n"; descriptor.lineno = 3956U; descriptor.flags = 1U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)(& udev->dev), "device reset changed speed!\n"); } else { } goto fail; } else { } oldspeed = udev->speed; switch ((unsigned int )udev->speed) { case 5U: ; case 4U: udev->ep0.desc.wMaxPacketSize = 512U; goto ldv_31236; case 3U: udev->ep0.desc.wMaxPacketSize = 64U; goto ldv_31236; case 2U: udev->ep0.desc.wMaxPacketSize = 64U; goto ldv_31236; case 1U: udev->ep0.desc.wMaxPacketSize = 8U; goto ldv_31236; default: ; goto fail; } ldv_31236: ; if ((unsigned int )udev->speed == 4U) { speed = "variable speed Wireless"; } else { speed = usb_speed_string(udev->speed); } if ((unsigned int )udev->speed != 5U) { _dev_info((struct device const *)(& udev->dev), "%s %s USB device number %d using %s\n", (unsigned long )udev->config != (unsigned long )((struct usb_host_config *)0) ? (char *)"reset" : (char *)"new", speed, devnum, (((udev->bus)->controller)->driver)->name); } else { } if ((unsigned long )hdev->tt != (unsigned long )((struct usb_tt *)0)) { udev->tt = hdev->tt; udev->ttport = hdev->ttport; } else if ((unsigned int )udev->speed != 3U && (unsigned int )hdev->speed == 3U) { if ((unsigned long )hub->tt.hub == (unsigned long )((struct usb_device *)0)) { dev_err((struct device const *)(& udev->dev), "parent hub has no TT\n"); retval = -22; goto fail; } else { } udev->tt = & hub->tt; udev->ttport = port1; } else { } i = 0; goto ldv_31260; ldv_31259: ; if (retry_counter / 2 == (int )old_scheme_first && ((int )(hcd->driver)->flags & 64) == 0) { r = 0; tmp___1 = kmalloc(64UL, 16U); buf = (struct usb_device_descriptor *)tmp___1; if ((unsigned long )buf == (unsigned long )((struct usb_device_descriptor *)0)) { retval = -12; goto ldv_31243; } else { } j = 0; goto ldv_31253; ldv_31252: buf->bMaxPacketSize0 = 0U; r = usb_control_msg(udev, 2147483776U, 6, 128, 256, 0, (void *)buf, 64, initial_descriptor_timeout); switch ((int )buf->bMaxPacketSize0) { case 8: ; case 16: ; case 32: ; case 64: ; case 255: ; if ((unsigned int )buf->bDescriptorType == 1U) { r = 0; goto ldv_31249; } else { } default: ; if (r == 0) { r = -71; } else { } goto ldv_31249; } ldv_31249: ; if (r == 0) { goto ldv_31251; } else { } j = j + 1; ldv_31253: ; if (j <= 2) { goto ldv_31252; } else { } ldv_31251: udev->descriptor.bMaxPacketSize0 = buf->bMaxPacketSize0; kfree((void const *)buf); retval = hub_port_reset(hub, port1, udev, delay, 0); if (retval < 0) { goto fail; } else { } if ((unsigned int )udev->speed != (unsigned int )oldspeed) { descriptor___0.modname = "usbcore"; descriptor___0.function = "hub_port_init"; descriptor___0.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___0.format = "device reset changed speed!\n"; descriptor___0.lineno = 4074U; descriptor___0.flags = 1U; tmp___2 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___2 != 0L) { __dynamic_dev_dbg(& descriptor___0, (struct device const *)(& udev->dev), "device reset changed speed!\n"); } else { } retval = -19; goto fail; } else { } if (r != 0) { dev_err((struct device const *)(& udev->dev), "device descriptor read/64, error %d\n", r); retval = -90; goto ldv_31243; } else { } } else { } if ((unsigned int )*((unsigned char *)udev + 1596UL) == 0U) { j = 0; goto ldv_31257; ldv_31256: retval = hub_set_address(udev, devnum); if (retval >= 0) { goto ldv_31255; } else { } msleep(200U); j = j + 1; ldv_31257: ; if (j <= 1) { goto ldv_31256; } else { } ldv_31255: ; if (retval < 0) { dev_err((struct device const *)(& udev->dev), "device not accepting address %d, error %d\n", devnum, retval); goto fail; } else { } if ((unsigned int )udev->speed == 5U) { devnum = udev->devnum; _dev_info((struct device const *)(& udev->dev), "%s SuperSpeed USB device number %d using %s\n", (unsigned long )udev->config != (unsigned long )((struct usb_host_config *)0) ? (char *)"reset" : (char *)"new", devnum, (((udev->bus)->controller)->driver)->name); } else { } msleep(10U); if (retry_counter / 2 == (int )old_scheme_first && ((int )(hcd->driver)->flags & 64) == 0) { goto ldv_31258; } else { } } else { } retval = usb_get_device_descriptor(udev, 8U); if (retval <= 7) { dev_err((struct device const *)(& udev->dev), "device descriptor read/8, error %d\n", retval); if (retval >= 0) { retval = -90; } else { } } else { retval = 0; goto ldv_31258; } ldv_31243: i = i + 1; msleep(100U); ldv_31260: ; if (i <= 1) { goto ldv_31259; } else { } ldv_31258: ; if (retval != 0) { goto fail; } else { } if ((unsigned int )udev->speed == 5U && (unsigned int )udev->descriptor.bcdUSB <= 767U) { dev_err((struct device const *)(& udev->dev), "got a wrong device descriptor, warm reset device\n"); hub_port_reset(hub, port1, udev, 50U, 1); retval = -22; goto fail; } else { } if ((unsigned int )udev->descriptor.bMaxPacketSize0 == 255U || (unsigned int )udev->speed == 5U) { i = 512; } else { i = (int )udev->descriptor.bMaxPacketSize0; } tmp___4 = usb_endpoint_maxp((struct usb_endpoint_descriptor const *)(& udev->ep0.desc)); if (tmp___4 != i) { if ((unsigned int )udev->speed == 1U || (((i != 8 && i != 16) && i != 32) && i != 64)) { dev_err((struct device const *)(& udev->dev), "Invalid ep0 maxpacket: %d\n", i); retval = -90; goto fail; } else { } if ((unsigned int )udev->speed == 2U) { descriptor___1.modname = "usbcore"; descriptor___1.function = "hub_port_init"; descriptor___1.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___1.format = "ep0 maxpacket = %d\n"; descriptor___1.lineno = 4167U; descriptor___1.flags = 1U; tmp___3 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); if (tmp___3 != 0L) { __dynamic_dev_dbg(& descriptor___1, (struct device const *)(& udev->dev), "ep0 maxpacket = %d\n", i); } else { } } else { dev_warn((struct device const *)(& udev->dev), "Using ep0 maxpacket: %d\n", i); } udev->ep0.desc.wMaxPacketSize = (unsigned short )i; usb_ep0_reinit(udev); } else { } retval = usb_get_device_descriptor(udev, 18U); if (retval <= 17) { dev_err((struct device const *)(& udev->dev), "device descriptor read/all, error %d\n", retval); if (retval >= 0) { retval = -42; } else { } goto fail; } else { } if ((unsigned int )*((unsigned char *)udev + 1596UL) == 0U && (unsigned int )udev->descriptor.bcdUSB > 512U) { retval = usb_get_bos_descriptor(udev); if (retval == 0) { tmp___5 = usb_device_supports_lpm(udev); udev->lpm_capable = (unsigned char )tmp___5; usb_set_lpm_parameters(udev); } else { } } else { } retval = 0; if ((unsigned long )(hcd->driver)->update_device != (unsigned long )((int (*/* const */)(struct usb_hcd * , struct usb_device * ))0)) { (*((hcd->driver)->update_device))(hcd, udev); } else { } fail: ; if (retval != 0) { hub_port_disable(hub, port1, 0); update_devnum(udev, devnum); } else { } ldv_mutex_unlock_43(& usb_address0_mutex); return (retval); } } static void check_highspeed(struct usb_hub *hub , struct usb_device *udev , int port1 ) { struct usb_qualifier_descriptor *qual ; int status ; void *tmp ; { tmp = kmalloc(10UL, 208U); qual = (struct usb_qualifier_descriptor *)tmp; if ((unsigned long )qual == (unsigned long )((struct usb_qualifier_descriptor *)0)) { return; } else { } status = usb_get_descriptor(udev, 6, 0, (void *)qual, 10); if (status == 10) { _dev_info((struct device const *)(& udev->dev), "not running at top speed; connect to a high speed hub\n"); if ((unsigned int )*((unsigned char *)hub + 476UL) != 0U) { hub->indicator[port1 + -1] = 2U; schedule_delayed_work(& hub->leds, 0UL); } else { } } else { } kfree((void const *)qual); return; } } static unsigned int hub_power_remaining(struct usb_hub *hub ) { struct usb_device *hdev ; int remaining ; int port1 ; struct usb_device *udev ; int delta ; { hdev = hub->hdev; if ((unsigned int )*((unsigned char *)hub + 476UL) == 0U) { return (0U); } else { } remaining = (int )hdev->bus_mA - (int )(hub->descriptor)->bHubContrCurrent; port1 = 1; goto ldv_31279; ldv_31278: udev = (*(hub->ports + ((unsigned long )port1 + 0xffffffffffffffffUL)))->child; if ((unsigned long )udev == (unsigned long )((struct usb_device *)0)) { goto ldv_31277; } else { } if ((unsigned long )udev->actconfig != (unsigned long )((struct usb_host_config *)0)) { delta = (int )(udev->actconfig)->desc.bMaxPower * 2; } else if ((int )(udev->bus)->otg_port != port1 || (unsigned long )hdev->parent != (unsigned long )((struct usb_device *)0)) { delta = 100; } else { delta = 8; } if ((unsigned int )delta > hub->mA_per_port) { dev_warn((struct device const *)(& udev->dev), "%dmA is over %umA budget for port %d!\n", delta, hub->mA_per_port, port1); } else { } remaining = remaining - delta; ldv_31277: port1 = port1 + 1; ldv_31279: ; if (hdev->maxchild >= port1) { goto ldv_31278; } else { } if (remaining < 0) { dev_warn((struct device const *)hub->intfdev, "%dmA over power budget!\n", - remaining); remaining = 0; } else { } return ((unsigned int )remaining); } } static void hub_port_connect_change(struct usb_hub *hub , int port1 , u16 portstatus , u16 portchange ) { struct usb_device *hdev ; struct device *hub_dev ; struct usb_hcd *hcd ; struct usb_hcd *tmp ; unsigned int wHubCharacteristics ; struct usb_device *udev ; int status ; int i ; struct _ddebug descriptor ; char *tmp___0 ; long tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; unsigned int tmp___5 ; int tmp___6 ; u16 devstat ; struct _ddebug descriptor___0 ; long tmp___7 ; unsigned int tmp___8 ; struct _ddebug descriptor___1 ; long tmp___9 ; int tmp___10 ; { hdev = hub->hdev; hub_dev = hub->intfdev; tmp = bus_to_hcd(hdev->bus); hcd = tmp; wHubCharacteristics = (unsigned int )(hub->descriptor)->wHubCharacteristics; descriptor.modname = "usbcore"; descriptor.function = "hub_port_connect_change"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor.format = "port %d, status %04x, change %04x, %s\n"; descriptor.lineno = 4289U; descriptor.flags = 1U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp___0 = portspeed(hub, (int )portstatus); __dynamic_dev_dbg(& descriptor, (struct device const *)hub_dev, "port %d, status %04x, change %04x, %s\n", port1, (int )portstatus, (int )portchange, tmp___0); } else { } if ((unsigned int )*((unsigned char *)hub + 476UL) != 0U) { set_port_led(hub, port1, 0); hub->indicator[port1 + -1] = 0U; } else { } if ((unsigned int )*((unsigned char *)hdev->bus + 27UL) != 0U) { portchange = (unsigned int )portchange & 65532U; } else { } udev = (*(hub->ports + ((unsigned long )port1 + 0xffffffffffffffffUL)))->child; if (((int )portstatus & 1 && (unsigned long )udev != (unsigned long )((struct usb_device *)0)) && (unsigned int )udev->state != 0U) { device_lock(& udev->dev); if (((int )portstatus & 2) != 0) { status = 0; } else if ((unsigned int )udev->state == 8U && (unsigned int )*((unsigned char *)udev + 1596UL) != 0U) { status = usb_remote_wakeup(udev); } else { status = -19; } device_unlock(& udev->dev); if (status == 0) { clear_bit(port1, (unsigned long volatile *)(& hub->change_bits)); return; } else { } } else { } if ((unsigned long )udev != (unsigned long )((struct usb_device *)0)) { usb_disconnect(& (*(hub->ports + ((unsigned long )port1 + 0xffffffffffffffffUL)))->child); } else { } clear_bit(port1, (unsigned long volatile *)(& hub->change_bits)); if (((int )portstatus & 1) == 0 || (int )portchange & 1) { clear_bit(port1, (unsigned long volatile *)(& hub->removed_bits)); } else { } if (((int )portchange & 3) != 0) { status = hub_port_debounce(hub, port1); if (status < 0) { tmp___2 = __printk_ratelimit("hub_port_connect_change"); if (tmp___2 != 0) { dev_err((struct device const *)hub_dev, "connect-debounce failed, port %d disabled\n", port1); } else { } portstatus = (unsigned int )portstatus & 65534U; } else { portstatus = (u16 )status; } } else { } if ((unsigned long )hcd->phy != (unsigned long )((struct usb_phy *)0) && (unsigned long )hdev->parent == (unsigned long )((struct usb_device *)0)) { if ((int )portstatus & 1) { usb_phy_notify_connect(hcd->phy, port1); } else { usb_phy_notify_disconnect(hcd->phy, port1); } } else { } if (((int )portstatus & 1) == 0) { goto _L; } else { tmp___4 = variable_test_bit(port1, (unsigned long const volatile *)(& hub->removed_bits)); if (tmp___4 != 0) { _L: /* CIL Label */ if ((wHubCharacteristics & 3U) <= 1U) { tmp___3 = port_is_power_on(hub, (unsigned int )portstatus); if (tmp___3 == 0) { set_port_feature(hdev, port1, 8); } else { } } else { } if (((int )portstatus & 2) != 0) { goto done; } else { } return; } else { } } i = 0; goto ldv_31304; ldv_31303: udev = usb_alloc_dev(hdev, hdev->bus, (unsigned int )port1); if ((unsigned long )udev == (unsigned long )((struct usb_device *)0)) { dev_err((struct device const *)hub_dev, "couldn\'t allocate port %d usb_device\n", port1); goto done; } else { } usb_set_device_state(udev, USB_STATE_POWERED); udev->bus_mA = (unsigned short )hub->mA_per_port; udev->level = (unsigned int )hdev->level + 1U; tmp___5 = hub_is_wusb(hub); udev->wusb = (unsigned char )tmp___5; tmp___6 = hub_is_superspeed(hub->hdev); if (tmp___6 != 0) { udev->speed = USB_SPEED_SUPER; } else { udev->speed = USB_SPEED_UNKNOWN; } choose_devnum(udev); if (udev->devnum <= 0) { status = -107; goto loop; } else { } status = hub_port_init(hub, udev, port1, i); if (status < 0) { goto loop; } else { } usb_detect_quirks(udev); if ((udev->quirks & 64U) != 0U) { msleep(1000U); } else { } if ((unsigned int )udev->descriptor.bDeviceClass == 9U && (unsigned int )udev->bus_mA <= 100U) { status = usb_get_status(udev, 0, 0, (void *)(& devstat)); if (status <= 1) { descriptor___0.modname = "usbcore"; descriptor___0.function = "hub_port_connect_change"; descriptor___0.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___0.format = "get status %d ?\n"; descriptor___0.lineno = 4431U; descriptor___0.flags = 1U; tmp___7 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___7 != 0L) { __dynamic_dev_dbg(& descriptor___0, (struct device const *)(& udev->dev), "get status %d ?\n", status); } else { } goto loop_disable; } else { } if (((int )devstat & 1) == 0) { dev_err((struct device const *)(& udev->dev), "can\'t connect bus-powered hub to this port\n"); if ((unsigned int )*((unsigned char *)hub + 476UL) != 0U) { hub->indicator[port1 + -1] = 4U; schedule_delayed_work(& hub->leds, 0UL); } else { } status = -107; goto loop_disable; } else { } } else { } if (((unsigned int )udev->descriptor.bcdUSB > 511U && (unsigned int )udev->speed == 2U) && highspeed_hubs != 0U) { check_highspeed(hub, udev, port1); } else { } status = 0; spin_lock_irq(& device_state_lock); if ((unsigned int )hdev->state == 0U) { status = -107; } else { (*(hub->ports + ((unsigned long )port1 + 0xffffffffffffffffUL)))->child = udev; } spin_unlock_irq(& device_state_lock); if (status == 0) { status = usb_new_device(udev); if (status != 0) { spin_lock_irq(& device_state_lock); (*(hub->ports + ((unsigned long )port1 + 0xffffffffffffffffUL)))->child = 0; spin_unlock_irq(& device_state_lock); } else { } } else { } if (status != 0) { goto loop_disable; } else { } tmp___8 = hub_power_remaining(hub); status = (int )tmp___8; if (status != 0) { descriptor___1.modname = "usbcore"; descriptor___1.function = "hub_port_connect_change"; descriptor___1.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___1.format = "%dmA power budget left\n"; descriptor___1.lineno = 4487U; descriptor___1.flags = 1U; tmp___9 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); if (tmp___9 != 0L) { __dynamic_dev_dbg(& descriptor___1, (struct device const *)hub_dev, "%dmA power budget left\n", status); } else { } } else { } return; loop_disable: hub_port_disable(hub, port1, 1); loop: usb_ep0_reinit(udev); release_devnum(udev); hub_free_dev(udev); usb_put_dev(udev); if (status == -107 || status == -524) { goto ldv_31302; } else { } i = i + 1; ldv_31304: ; if (((int )use_both_schemes + 1) * 2 > i) { goto ldv_31303; } else { } ldv_31302: ; if ((unsigned long )(hub->hdev)->parent != (unsigned long )((struct usb_device *)0) || (unsigned long )(hcd->driver)->port_handed_over == (unsigned long )((int (*/* const */)(struct usb_hcd * , int ))0)) { dev_err((struct device const *)hub_dev, "unable to enumerate USB device on port %d\n", port1); } else { tmp___10 = (*((hcd->driver)->port_handed_over))(hcd, port1); if (tmp___10 == 0) { dev_err((struct device const *)hub_dev, "unable to enumerate USB device on port %d\n", port1); } else { } } done: hub_port_disable(hub, port1, 1); if ((unsigned long )(hcd->driver)->relinquish_port != (unsigned long )((void (*/* const */)(struct usb_hcd * , int ))0) && (unsigned long )(hub->hdev)->parent == (unsigned long )((struct usb_device *)0)) { (*((hcd->driver)->relinquish_port))(hcd, port1); } else { } return; } } static int hub_handle_remote_wakeup(struct usb_hub *hub , unsigned int port , u16 portstatus , u16 portchange ) { struct usb_device *hdev ; struct usb_device *udev ; int connect_change ; int ret ; int tmp ; struct _ddebug descriptor ; long tmp___0 ; { connect_change = 0; hdev = hub->hdev; udev = (*(hub->ports + (unsigned long )(port - 1U)))->child; tmp = hub_is_superspeed(hdev); if (tmp == 0) { if (((int )portchange & 4) == 0) { return (0); } else { } clear_port_feature(hdev, (int )port, 18); } else if (((unsigned long )udev == (unsigned long )((struct usb_device *)0) || (unsigned int )udev->state != 8U) || ((int )portstatus & 480) != 0) { return (0); } else { } if ((unsigned long )udev != (unsigned long )((struct usb_device *)0)) { msleep(10U); device_lock(& udev->dev); ret = usb_remote_wakeup(udev); device_unlock(& udev->dev); if (ret < 0) { connect_change = 1; } else { } } else { ret = -19; hub_port_disable(hub, (int )port, 1); } descriptor.modname = "usbcore"; descriptor.function = "hub_handle_remote_wakeup"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor.format = "resume on port %d, status %d\n"; descriptor.lineno = 4549U; descriptor.flags = 1U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)hub->intfdev, "resume on port %d, status %d\n", port, ret); } else { } return (connect_change); } } static void hub_events(void) { struct list_head *tmp ; struct usb_device *hdev ; struct usb_interface *intf ; struct usb_hub *hub ; struct device *hub_dev ; u16 hubstatus ; u16 hubchange ; u16 portstatus ; u16 portchange ; int i ; int ret ; int connect_change ; int wakeup_change ; int tmp___0 ; struct list_head const *__mptr ; struct device const *__mptr___0 ; struct _ddebug descriptor ; long tmp___1 ; long tmp___2 ; struct _ddebug descriptor___0 ; long tmp___3 ; struct _ddebug descriptor___1 ; long tmp___4 ; struct _ddebug descriptor___2 ; long tmp___5 ; int tmp___6 ; int tmp___7 ; struct _ddebug descriptor___3 ; long tmp___8 ; int tmp___9 ; u16 status ; u16 unused ; struct _ddebug descriptor___4 ; long tmp___10 ; struct _ddebug descriptor___5 ; long tmp___11 ; struct _ddebug descriptor___6 ; long tmp___12 ; int tmp___13 ; int status___0 ; struct _ddebug descriptor___7 ; long tmp___14 ; bool tmp___15 ; struct _ddebug descriptor___8 ; long tmp___16 ; u16 status___1 ; u16 unused___0 ; struct _ddebug descriptor___9 ; long tmp___17 ; int tmp___18 ; int tmp___19 ; { ldv_31362: spin_lock_irq(& hub_event_lock); tmp___0 = list_empty((struct list_head const *)(& hub_event_list)); if (tmp___0 != 0) { spin_unlock_irq(& hub_event_lock); goto ldv_31333; } else { } tmp = hub_event_list.next; list_del_init(tmp); __mptr = (struct list_head const *)tmp; hub = (struct usb_hub *)__mptr + 0xffffffffffffff20UL; kref_get(& hub->kref); spin_unlock_irq(& hub_event_lock); hdev = hub->hdev; hub_dev = hub->intfdev; __mptr___0 = (struct device const *)hub_dev; intf = (struct usb_interface *)__mptr___0 + 0xffffffffffffffd0UL; descriptor.modname = "usbcore"; descriptor.function = "hub_events"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor.format = "state %d ports %d chg %04x evt %04x\n"; descriptor.lineno = 4598U; descriptor.flags = 1U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)hub_dev, "state %d ports %d chg %04x evt %04x\n", (unsigned int )hdev->state, (unsigned long )hub->descriptor != (unsigned long )((struct usb_hub_descriptor *)0) ? (int )(hub->descriptor)->bNbrPorts : 0, (int )((unsigned short )hub->change_bits[0]), (int )((unsigned short )hub->event_bits[0])); } else { } device_lock(& hdev->dev); tmp___2 = ldv__builtin_expect((unsigned int )*((unsigned char *)hub + 476UL) != 0U, 0L); if (tmp___2 != 0L) { goto loop_disconnected; } else { } if ((unsigned int )hdev->state == 0U) { hub->error = -19; hub_quiesce(hub, HUB_DISCONNECT); goto loop; } else { } ret = usb_autopm_get_interface(intf); if (ret != 0) { descriptor___0.modname = "usbcore"; descriptor___0.function = "hub_events"; descriptor___0.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___0.format = "Can\'t autoresume: %d\n"; descriptor___0.lineno = 4616U; descriptor___0.flags = 1U; tmp___3 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___3 != 0L) { __dynamic_dev_dbg(& descriptor___0, (struct device const *)hub_dev, "Can\'t autoresume: %d\n", ret); } else { } goto loop; } else { } if ((unsigned int )*((unsigned char *)hub + 476UL) != 0U) { goto loop_autopm; } else { } if (hub->error != 0) { descriptor___1.modname = "usbcore"; descriptor___1.function = "hub_events"; descriptor___1.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___1.format = "resetting for error %d\n"; descriptor___1.lineno = 4626U; descriptor___1.flags = 1U; tmp___4 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); if (tmp___4 != 0L) { __dynamic_dev_dbg(& descriptor___1, (struct device const *)hub_dev, "resetting for error %d\n", hub->error); } else { } ret = usb_reset_device(hdev); if (ret != 0) { descriptor___2.modname = "usbcore"; descriptor___2.function = "hub_events"; descriptor___2.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___2.format = "error resetting hub: %d\n"; descriptor___2.lineno = 4631U; descriptor___2.flags = 1U; tmp___5 = ldv__builtin_expect((long )descriptor___2.flags & 1L, 0L); if (tmp___5 != 0L) { __dynamic_dev_dbg(& descriptor___2, (struct device const *)hub_dev, "error resetting hub: %d\n", ret); } else { } goto loop_autopm; } else { } hub->nerrors = 0; hub->error = 0; } else { } i = 1; goto ldv_31356; ldv_31355: tmp___6 = variable_test_bit(i, (unsigned long const volatile *)(& hub->busy_bits)); if (tmp___6 != 0) { goto ldv_31346; } else { } connect_change = variable_test_bit(i, (unsigned long const volatile *)(& hub->change_bits)); wakeup_change = test_and_clear_bit(i, (unsigned long volatile *)(& hub->wakeup_bits)); tmp___7 = test_and_clear_bit(i, (unsigned long volatile *)(& hub->event_bits)); if ((tmp___7 == 0 && connect_change == 0) && wakeup_change == 0) { goto ldv_31346; } else { } ret = hub_port_status(hub, i, & portstatus, & portchange); if (ret < 0) { goto ldv_31346; } else { } if ((int )portchange & 1) { clear_port_feature(hdev, i, 16); connect_change = 1; } else { } if (((int )portchange & 2) != 0) { if (connect_change == 0) { descriptor___3.modname = "usbcore"; descriptor___3.function = "hub_events"; descriptor___3.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___3.format = "port %d enable change, status %08x\n"; descriptor___3.lineno = 4665U; descriptor___3.flags = 1U; tmp___8 = ldv__builtin_expect((long )descriptor___3.flags & 1L, 0L); if (tmp___8 != 0L) { __dynamic_dev_dbg(& descriptor___3, (struct device const *)hub_dev, "port %d enable change, status %08x\n", i, (int )portstatus); } else { } } else { } clear_port_feature(hdev, i, 17); if ((((int )portstatus & 2) == 0 && connect_change == 0) && (unsigned long )(*(hub->ports + ((unsigned long )i + 0xffffffffffffffffUL)))->child != (unsigned long )((struct usb_device *)0)) { dev_err((struct device const *)hub_dev, "port %i disabled by hub (EMI?), re-enabling...\n", i); connect_change = 1; } else { } } else { } tmp___9 = hub_handle_remote_wakeup(hub, (unsigned int )i, (int )portstatus, (int )portchange); if (tmp___9 != 0) { connect_change = 1; } else { } if (((int )portchange & 8) != 0) { status = 0U; descriptor___4.modname = "usbcore"; descriptor___4.function = "hub_events"; descriptor___4.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___4.format = "over-current change on port %d\n"; descriptor___4.lineno = 4696U; descriptor___4.flags = 1U; tmp___10 = ldv__builtin_expect((long )descriptor___4.flags & 1L, 0L); if (tmp___10 != 0L) { __dynamic_dev_dbg(& descriptor___4, (struct device const *)hub_dev, "over-current change on port %d\n", i); } else { } clear_port_feature(hdev, i, 19); msleep(100U); hub_power_on(hub, 1); hub_port_status(hub, i, & status, & unused); if (((int )status & 8) != 0) { dev_err((struct device const *)hub_dev, "over-current condition on port %d\n", i); } else { } } else { } if (((int )portchange & 16) != 0) { descriptor___5.modname = "usbcore"; descriptor___5.function = "hub_events"; descriptor___5.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___5.format = "reset change on port %d\n"; descriptor___5.lineno = 4710U; descriptor___5.flags = 1U; tmp___11 = ldv__builtin_expect((long )descriptor___5.flags & 1L, 0L); if (tmp___11 != 0L) { __dynamic_dev_dbg(& descriptor___5, (struct device const *)hub_dev, "reset change on port %d\n", i); } else { } clear_port_feature(hdev, i, 20); } else { } if (((int )portchange & 32) != 0) { tmp___13 = hub_is_superspeed(hub->hdev); if (tmp___13 != 0) { descriptor___6.modname = "usbcore"; descriptor___6.function = "hub_events"; descriptor___6.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___6.format = "warm reset change on port %d\n"; descriptor___6.lineno = 4718U; descriptor___6.flags = 1U; tmp___12 = ldv__builtin_expect((long )descriptor___6.flags & 1L, 0L); if (tmp___12 != 0L) { __dynamic_dev_dbg(& descriptor___6, (struct device const *)hub_dev, "warm reset change on port %d\n", i); } else { } clear_port_feature(hdev, i, 29); } else { } } else { } if (((int )portchange & 64) != 0) { clear_port_feature(hub->hdev, i, 25); } else { } if (((int )portchange & 128) != 0) { dev_warn((struct device const *)hub_dev, "config error on port %d\n", i); clear_port_feature(hub->hdev, i, 26); } else { } tmp___15 = hub_port_warm_reset_required(hub, (int )portstatus); if ((int )tmp___15) { descriptor___7.modname = "usbcore"; descriptor___7.function = "hub_events"; descriptor___7.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___7.format = "warm reset port %d\n"; descriptor___7.lineno = 4740U; descriptor___7.flags = 1U; tmp___14 = ldv__builtin_expect((long )descriptor___7.flags & 1L, 0L); if (tmp___14 != 0L) { __dynamic_dev_dbg(& descriptor___7, (struct device const *)hub_dev, "warm reset port %d\n", i); } else { } status___0 = hub_port_reset(hub, i, 0, 50U, 1); if (status___0 < 0) { hub_port_disable(hub, i, 1); } else { } connect_change = 0; } else { } if (connect_change != 0) { hub_port_connect_change(hub, i, (int )portstatus, (int )portchange); } else { } ldv_31346: i = i + 1; ldv_31356: ; if ((int )(hub->descriptor)->bNbrPorts >= i) { goto ldv_31355; } else { } tmp___19 = test_and_clear_bit(0, (unsigned long volatile *)(& hub->event_bits)); if (tmp___19 == 0) { } else { tmp___18 = hub_hub_status(hub, & hubstatus, & hubchange); if (tmp___18 < 0) { dev_err((struct device const *)hub_dev, "get_hub_status failed\n"); } else { if ((int )hubchange & 1) { descriptor___8.modname = "usbcore"; descriptor___8.function = "hub_events"; descriptor___8.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___8.format = "power change\n"; descriptor___8.lineno = 4760U; descriptor___8.flags = 1U; tmp___16 = ldv__builtin_expect((long )descriptor___8.flags & 1L, 0L); if (tmp___16 != 0L) { __dynamic_dev_dbg(& descriptor___8, (struct device const *)hub_dev, "power change\n"); } else { } clear_hub_feature(hdev, 0); if ((int )hubstatus & 1) { hub->limited_power = 1U; } else { hub->limited_power = 0U; } } else { } if (((int )hubchange & 2) != 0) { status___1 = 0U; descriptor___9.modname = "usbcore"; descriptor___9.function = "hub_events"; descriptor___9.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___9.format = "over-current change\n"; descriptor___9.lineno = 4772U; descriptor___9.flags = 1U; tmp___17 = ldv__builtin_expect((long )descriptor___9.flags & 1L, 0L); if (tmp___17 != 0L) { __dynamic_dev_dbg(& descriptor___9, (struct device const *)hub_dev, "over-current change\n"); } else { } clear_hub_feature(hdev, 1); msleep(500U); hub_power_on(hub, 1); hub_hub_status(hub, & status___1, & unused___0); if (((int )status___1 & 2) != 0) { dev_err((struct device const *)hub_dev, "over-current condition\n"); } else { } } else { } } } loop_autopm: usb_autopm_put_interface_no_suspend(intf); loop: usb_autopm_put_interface(intf); loop_disconnected: device_unlock(& hdev->dev); kref_put(& hub->kref, & hub_release); goto ldv_31362; ldv_31333: ; return; } } static int hub_thread(void *__unused ) { int __retval ; int __ret ; wait_queue_t __wait ; struct task_struct *tmp ; int tmp___0 ; bool tmp___1 ; struct task_struct *tmp___2 ; bool tmp___3 ; struct task_struct *tmp___4 ; int tmp___5 ; int tmp___6 ; bool tmp___7 ; int tmp___8 ; struct task_struct *tmp___9 ; bool tmp___10 ; int tmp___11 ; int tmp___12 ; bool tmp___13 ; bool tmp___14 ; int tmp___15 ; int tmp___16 ; struct _ddebug descriptor ; long tmp___17 ; { set_freezable(); ldv_31376: hub_events(); ldv_31374: __ret = 0; tmp___6 = list_empty((struct list_head const *)(& hub_event_list)); if (tmp___6 != 0) { tmp___7 = kthread_should_stop(); if (tmp___7) { tmp___8 = 0; } else { tmp___8 = 1; } if (tmp___8) { tmp___9 = get_current(); tmp___10 = freezing(tmp___9); if (tmp___10) { tmp___11 = 0; } else { tmp___11 = 1; } if (tmp___11) { 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; ldv_31371: prepare_to_wait(& khubd_wait, & __wait, 1); tmp___0 = list_empty((struct list_head const *)(& hub_event_list)); if (tmp___0 == 0) { goto ldv_31369; } else { tmp___1 = kthread_should_stop(); if ((int )tmp___1) { goto ldv_31369; } else { tmp___2 = get_current(); tmp___3 = freezing(tmp___2); if ((int )tmp___3) { goto ldv_31369; } else { } } } tmp___4 = get_current(); tmp___5 = signal_pending(tmp___4); if (tmp___5 == 0) { schedule(); goto ldv_31370; } else { } __ret = -512; goto ldv_31369; ldv_31370: ; goto ldv_31371; ldv_31369: finish_wait(& khubd_wait, & __wait); } else { } } else { } } else { } __retval = __ret; if (__retval != 0) { goto ldv_31373; } else { tmp___12 = list_empty((struct list_head const *)(& hub_event_list)); if (tmp___12 == 0) { goto ldv_31373; } else { tmp___13 = kthread_should_stop(); if ((int )tmp___13) { goto ldv_31373; } else { } } } try_to_freeze(); goto ldv_31374; ldv_31373: tmp___14 = kthread_should_stop(); if (tmp___14) { tmp___15 = 0; } else { tmp___15 = 1; } if (tmp___15) { goto ldv_31376; } else { tmp___16 = list_empty((struct list_head const *)(& hub_event_list)); if (tmp___16 == 0) { goto ldv_31376; } else { goto ldv_31377; } } ldv_31377: descriptor.modname = "usbcore"; descriptor.function = "hub_thread"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor.format = "%s: khubd exiting\n"; descriptor.lineno = 4814U; descriptor.flags = 1U; tmp___17 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___17 != 0L) { __dynamic_pr_debug(& descriptor, "%s: khubd exiting\n", usbcore_name); } else { } return (0); } } static struct usb_device_id const hub_id_table[3U] = { {16U, (unsigned short)0, (unsigned short)0, (unsigned short)0, (unsigned short)0, 9U, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 0UL}, {128U, (unsigned short)0, (unsigned short)0, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 9U, (unsigned char)0, (unsigned char)0, (unsigned char)0, 0UL}}; struct usb_device_id const __mod_usb_device_table ; static struct usb_driver hub_driver = {"hub", & hub_probe, & hub_disconnect, & hub_ioctl, & hub_suspend, & hub_resume, & hub_reset_resume, & hub_pre_reset, & hub_post_reset, (struct usb_device_id const *)(& hub_id_table), {{{{{{0U}}, 0U, 0U, 0, {0, {0, 0}, 0, 0, 0UL}}}}, {0, 0}}, {{0, 0, 0, 0, (_Bool)0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 0}, (unsigned char)0, 1U, (unsigned char)0, (unsigned char)0}; int usb_hub_init(void) { int tmp ; struct task_struct *__k ; struct task_struct *tmp___0 ; long tmp___1 ; long tmp___2 ; { tmp = usb_register_driver(& hub_driver, & __this_module, "usbcore"); if (tmp < 0) { printk("\v%s: can\'t register hub driver\n", usbcore_name); return (-1); } else { } tmp___0 = kthread_create_on_node(& hub_thread, 0, -1, "khubd"); __k = tmp___0; tmp___1 = IS_ERR((void const *)__k); if (tmp___1 == 0L) { wake_up_process(__k); } else { } khubd_task = __k; tmp___2 = IS_ERR((void const *)khubd_task); if (tmp___2 == 0L) { return (0); } else { } usb_deregister(& hub_driver); printk("\v%s: can\'t start khubd\n", usbcore_name); return (-1); } } void usb_hub_cleanup(void) { { kthread_stop(khubd_task); usb_deregister(& hub_driver); return; } } static int descriptors_changed(struct usb_device *udev , struct usb_device_descriptor *old_device_descriptor ) { int changed ; unsigned int index ; unsigned int serial_len ; unsigned int len ; unsigned int old_length ; int length ; char *buf ; int tmp ; size_t tmp___0 ; unsigned int _max1 ; unsigned int _max2 ; void *tmp___1 ; struct _ddebug descriptor ; long tmp___2 ; struct _ddebug descriptor___0 ; long tmp___3 ; int tmp___4 ; struct _ddebug descriptor___1 ; long tmp___5 ; struct _ddebug descriptor___2 ; long tmp___6 ; int tmp___7 ; { changed = 0; serial_len = 0U; tmp = memcmp((void const *)(& udev->descriptor), (void const *)old_device_descriptor, 18UL); if (tmp != 0) { return (1); } else { } if ((unsigned long )udev->serial != (unsigned long )((char *)0)) { tmp___0 = strlen((char const *)udev->serial); serial_len = (unsigned int )tmp___0 + 1U; } else { } len = serial_len; index = 0U; goto ldv_31406; ldv_31405: old_length = (unsigned int )(udev->config + (unsigned long )index)->desc.wTotalLength; _max1 = len; _max2 = old_length; len = _max1 > _max2 ? _max1 : _max2; index = index + 1U; ldv_31406: ; if ((unsigned int )udev->descriptor.bNumConfigurations > index) { goto ldv_31405; } else { } tmp___1 = kmalloc((size_t )len, 16U); buf = (char *)tmp___1; if ((unsigned long )buf == (unsigned long )((char *)0)) { dev_err((struct device const *)(& udev->dev), "no mem to re-read configs after reset\n"); return (1); } else { } index = 0U; goto ldv_31413; ldv_31412: old_length = (unsigned int )(udev->config + (unsigned long )index)->desc.wTotalLength; length = usb_get_descriptor(udev, 2, (int )((unsigned char )index), (void *)buf, (int )old_length); if ((unsigned int )length != old_length) { descriptor.modname = "usbcore"; descriptor.function = "descriptors_changed"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor.format = "config index %d, error %d\n"; descriptor.lineno = 4917U; descriptor.flags = 1U; tmp___2 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___2 != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)(& udev->dev), "config index %d, error %d\n", index, length); } else { } changed = 1; goto ldv_31410; } else { } tmp___4 = memcmp((void const *)buf, (void const *)*(udev->rawdescriptors + (unsigned long )index), (size_t )old_length); if (tmp___4 != 0) { descriptor___0.modname = "usbcore"; descriptor___0.function = "descriptors_changed"; descriptor___0.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___0.format = "config index %d changed (#%d)\n"; descriptor___0.lineno = 4926U; descriptor___0.flags = 1U; tmp___3 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___3 != 0L) { __dynamic_dev_dbg(& descriptor___0, (struct device const *)(& udev->dev), "config index %d changed (#%d)\n", index, (int )((struct usb_config_descriptor *)buf)->bConfigurationValue); } else { } changed = 1; goto ldv_31410; } else { } index = index + 1U; ldv_31413: ; if ((unsigned int )udev->descriptor.bNumConfigurations > index) { goto ldv_31412; } else { } ldv_31410: ; if (changed == 0 && serial_len != 0U) { length = usb_string(udev, (int )udev->descriptor.iSerialNumber, buf, (size_t )serial_len); if ((unsigned int )(length + 1) != serial_len) { descriptor___1.modname = "usbcore"; descriptor___1.function = "descriptors_changed"; descriptor___1.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___1.format = "serial string error %d\n"; descriptor___1.lineno = 4937U; descriptor___1.flags = 1U; tmp___5 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); if (tmp___5 != 0L) { __dynamic_dev_dbg(& descriptor___1, (struct device const *)(& udev->dev), "serial string error %d\n", length); } else { } changed = 1; } else { tmp___7 = memcmp((void const *)buf, (void const *)udev->serial, (size_t )length); if (tmp___7 != 0) { descriptor___2.modname = "usbcore"; descriptor___2.function = "descriptors_changed"; descriptor___2.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___2.format = "serial string changed\n"; descriptor___2.lineno = 4940U; descriptor___2.flags = 1U; tmp___6 = ldv__builtin_expect((long )descriptor___2.flags & 1L, 0L); if (tmp___6 != 0L) { __dynamic_dev_dbg(& descriptor___2, (struct device const *)(& udev->dev), "serial string changed\n"); } else { } changed = 1; } else { } } } else { } kfree((void const *)buf); return (changed); } } static int usb_reset_and_verify_device(struct usb_device *udev ) { struct usb_device *parent_hdev ; struct usb_hub *parent_hub ; struct usb_hcd *hcd ; struct usb_hcd *tmp ; struct usb_device_descriptor descriptor ; int i ; int ret ; int port1 ; struct _ddebug descriptor___0 ; long tmp___0 ; struct _ddebug descriptor___1 ; long tmp___1 ; int tmp___2 ; unsigned int tmp___3 ; struct usb_host_config *config ; struct usb_interface *intf ; struct usb_interface_descriptor *desc ; { parent_hdev = udev->parent; tmp = bus_to_hcd(udev->bus); hcd = tmp; descriptor = udev->descriptor; ret = 0; port1 = (int )udev->portnum; if ((unsigned int )udev->state == 0U || (unsigned int )udev->state == 8U) { descriptor___0.modname = "usbcore"; descriptor___0.function = "usb_reset_and_verify_device"; descriptor___0.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___0.format = "device reset not allowed in state %d\n"; descriptor___0.lineno = 4991U; descriptor___0.flags = 1U; tmp___0 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___0 != 0L) { __dynamic_dev_dbg(& descriptor___0, (struct device const *)(& udev->dev), "device reset not allowed in state %d\n", (unsigned int )udev->state); } else { } return (-22); } else { } if ((unsigned long )parent_hdev == (unsigned long )((struct usb_device *)0)) { descriptor___1.modname = "usbcore"; descriptor___1.function = "usb_reset_and_verify_device"; descriptor___1.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor___1.format = "%s for root hub!\n"; descriptor___1.lineno = 4997U; descriptor___1.flags = 1U; tmp___1 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); if (tmp___1 != 0L) { __dynamic_dev_dbg(& descriptor___1, (struct device const *)(& udev->dev), "%s for root hub!\n", "usb_reset_and_verify_device"); } else { } return (-21); } else { } parent_hub = hdev_to_hub(parent_hdev); ret = usb_unlocked_disable_lpm(udev); if (ret != 0) { dev_err((struct device const *)(& udev->dev), "%s Failed to disable LPM\n.", "usb_reset_and_verify_device"); goto re_enumerate; } else { } ret = usb_disable_ltm(udev); if (ret != 0) { dev_err((struct device const *)(& udev->dev), "%s Failed to disable LTM\n.", "usb_reset_and_verify_device"); goto re_enumerate; } else { } set_bit((unsigned int )port1, (unsigned long volatile *)(& parent_hub->busy_bits)); i = 0; goto ldv_31432; ldv_31431: usb_ep0_reinit(udev); ret = hub_port_init(parent_hub, udev, port1, i); if ((ret >= 0 || ret == -107) || ret == -19) { goto ldv_31430; } else { } i = i + 1; ldv_31432: ; if (((int )use_both_schemes + 1) * 2 > i) { goto ldv_31431; } else { } ldv_31430: clear_bit(port1, (unsigned long volatile *)(& parent_hub->busy_bits)); if (ret < 0) { goto re_enumerate; } else { } tmp___2 = descriptors_changed(udev, & descriptor); if (tmp___2 != 0) { _dev_info((struct device const *)(& udev->dev), "device firmware changed\n"); udev->descriptor = descriptor; goto re_enumerate; } else { } if ((unsigned long )udev->actconfig == (unsigned long )((struct usb_host_config *)0)) { goto done; } else { } ldv_mutex_lock_44(hcd->bandwidth_mutex); ret = usb_hcd_alloc_bandwidth(udev, udev->actconfig, 0, 0); if (ret < 0) { dev_warn((struct device const *)(& udev->dev), "Busted HC? Not enough HCD resources for old configuration.\n"); ldv_mutex_unlock_45(hcd->bandwidth_mutex); goto re_enumerate; } else { } tmp___3 = __create_pipe(udev, 0U); ret = usb_control_msg(udev, tmp___3 | 2147483648U, 9, 0, (int )(udev->actconfig)->desc.bConfigurationValue, 0, 0, 0, 5000); if (ret < 0) { dev_err((struct device const *)(& udev->dev), "can\'t restore configuration #%d (error=%d)\n", (int )(udev->actconfig)->desc.bConfigurationValue, ret); ldv_mutex_unlock_46(hcd->bandwidth_mutex); goto re_enumerate; } else { } ldv_mutex_unlock_47(hcd->bandwidth_mutex); usb_set_device_state(udev, USB_STATE_CONFIGURED); i = 0; goto ldv_31438; ldv_31437: config = udev->actconfig; intf = config->interface[i]; desc = & (intf->cur_altsetting)->desc; if ((unsigned int )desc->bAlternateSetting == 0U) { usb_disable_interface(udev, intf, 1); usb_enable_interface(udev, intf, 1); ret = 0; } else { intf->resetting_device = 1U; ret = usb_set_interface(udev, (int )desc->bInterfaceNumber, (int )desc->bAlternateSetting); intf->resetting_device = 0U; } if (ret < 0) { dev_err((struct device const *)(& udev->dev), "failed to restore interface %d altsetting %d (error=%d)\n", (int )desc->bInterfaceNumber, (int )desc->bAlternateSetting, ret); goto re_enumerate; } else { } i = i + 1; ldv_31438: ; if ((int )(udev->actconfig)->desc.bNumInterfaces > i) { goto ldv_31437; } else { } done: usb_unlocked_enable_lpm(udev); usb_enable_ltm(udev); return (0); re_enumerate: hub_port_logical_disconnect(parent_hub, port1); return (-19); } } int usb_reset_device(struct usb_device *udev ) { int ret ; int i ; struct usb_host_config *config ; struct _ddebug descriptor ; long tmp ; struct usb_interface *cintf ; struct usb_driver *drv ; int unbind ; struct device_driver const *__mptr ; struct usb_interface *cintf___0 ; struct usb_driver *drv___0 ; int rebind ; struct device_driver const *__mptr___0 ; { config = udev->actconfig; if ((unsigned int )udev->state == 0U || (unsigned int )udev->state == 8U) { descriptor.modname = "usbcore"; descriptor.function = "usb_reset_device"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hub.c.prepared"; descriptor.format = "device reset not allowed in state %d\n"; descriptor.lineno = 5145U; descriptor.flags = 1U; tmp = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)(& udev->dev), "device reset not allowed in state %d\n", (unsigned int )udev->state); } else { } return (-22); } else { } usb_autoresume_device(udev); if ((unsigned long )config != (unsigned long )((struct usb_host_config *)0)) { i = 0; goto ldv_31454; ldv_31453: cintf = config->interface[i]; unbind = 0; if ((unsigned long )cintf->dev.driver != (unsigned long )((struct device_driver *)0)) { __mptr = (struct device_driver const *)cintf->dev.driver; drv = (struct usb_driver *)__mptr + 0xffffffffffffff58UL; if ((unsigned long )drv->pre_reset != (unsigned long )((int (*)(struct usb_interface * ))0) && (unsigned long )drv->post_reset != (unsigned long )((int (*)(struct usb_interface * ))0)) { unbind = (*(drv->pre_reset))(cintf); } else if ((unsigned int )cintf->condition == 2U) { unbind = 1; } else { } if (unbind != 0) { usb_forced_unbind_intf(cintf); } else { } } else { } i = i + 1; ldv_31454: ; if ((int )config->desc.bNumInterfaces > i) { goto ldv_31453; } else { } } else { } ret = usb_reset_and_verify_device(udev); if ((unsigned long )config != (unsigned long )((struct usb_host_config *)0)) { i = (int )config->desc.bNumInterfaces + -1; goto ldv_31462; ldv_31461: cintf___0 = config->interface[i]; rebind = (int )cintf___0->needs_binding; if (rebind == 0 && (unsigned long )cintf___0->dev.driver != (unsigned long )((struct device_driver *)0)) { __mptr___0 = (struct device_driver const *)cintf___0->dev.driver; drv___0 = (struct usb_driver *)__mptr___0 + 0xffffffffffffff58UL; if ((unsigned long )drv___0->post_reset != (unsigned long )((int (*)(struct usb_interface * ))0)) { rebind = (*(drv___0->post_reset))(cintf___0); } else if ((unsigned int )cintf___0->condition == 2U) { rebind = 1; } else { } } else { } if (ret == 0 && rebind != 0) { usb_rebind_intf(cintf___0); } else { } i = i - 1; ldv_31462: ; if (i >= 0) { goto ldv_31461; } else { } } else { } usb_autosuspend_device(udev); return (ret); } } void usb_queue_reset_device(struct usb_interface *iface ) { { schedule_work(& iface->reset_ws); return; } } struct usb_device *usb_hub_find_child(struct usb_device *hdev , int port1 ) { struct usb_hub *hub ; struct usb_hub *tmp ; { tmp = hdev_to_hub(hdev); hub = tmp; if (port1 <= 0 || hdev->maxchild < port1) { return (0); } else { } return ((*(hub->ports + ((unsigned long )port1 + 0xffffffffffffffffUL)))->child); } } void usb_set_hub_port_connect_type(struct usb_device *hdev , int port1 , enum usb_port_connect_type type ) { struct usb_hub *hub ; struct usb_hub *tmp ; { tmp = hdev_to_hub(hdev); hub = tmp; (*(hub->ports + ((unsigned long )port1 + 0xffffffffffffffffUL)))->connect_type = type; return; } } enum usb_port_connect_type usb_get_hub_port_connect_type(struct usb_device *hdev , int port1 ) { struct usb_hub *hub ; struct usb_hub *tmp ; { tmp = hdev_to_hub(hdev); hub = tmp; return ((*(hub->ports + ((unsigned long )port1 + 0xffffffffffffffffUL)))->connect_type); } } acpi_handle usb_get_hub_port_acpi_handle(struct usb_device *hdev , int port1 ) { struct usb_hub *hub ; struct usb_hub *tmp ; { tmp = hdev_to_hub(hdev); hub = tmp; return ((*(hub->ports + ((unsigned long )port1 + 0xffffffffffffffffUL)))->dev.archdata.acpi_handle); } } extern void ldv_check_return_value(int ) ; extern void ldv_check_return_value_probe(int ) ; int main(void) { struct device *var_group1 ; struct usb_interface *var_group2 ; struct usb_device_id const *var_hub_probe_43_p1 ; int res_hub_probe_43 ; pm_message_t var_hub_suspend_82_p1 ; unsigned int var_hub_ioctl_44_p1 ; void *var_hub_ioctl_44_p2 ; int ldv_s_usb_port_device_type_device_type ; int ldv_s_hub_driver_usb_driver ; int tmp ; int tmp___0 ; { ldv_s_usb_port_device_type_device_type = 0; ldv_s_hub_driver_usb_driver = 0; LDV_IN_INTERRUPT = 1; ldv_initialize(); goto ldv_31545; ldv_31544: tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_s_usb_port_device_type_device_type == 0) { ldv_handler_precall(); usb_port_device_release(var_group1); ldv_s_usb_port_device_type_device_type = 0; } else { } goto ldv_31533; case 1: ; if (ldv_s_hub_driver_usb_driver == 0) { res_hub_probe_43 = hub_probe(var_group2, var_hub_probe_43_p1); ldv_check_return_value(res_hub_probe_43); ldv_check_return_value_probe(res_hub_probe_43); if (res_hub_probe_43 != 0) { goto ldv_module_exit; } else { } ldv_s_hub_driver_usb_driver = ldv_s_hub_driver_usb_driver + 1; } else { } goto ldv_31533; case 2: ; if (ldv_s_hub_driver_usb_driver == 1) { ldv_handler_precall(); hub_suspend(var_group2, var_hub_suspend_82_p1); ldv_s_hub_driver_usb_driver = ldv_s_hub_driver_usb_driver + 1; } else { } goto ldv_31533; case 3: ; if (ldv_s_hub_driver_usb_driver == 2) { ldv_handler_precall(); hub_resume(var_group2); ldv_s_hub_driver_usb_driver = ldv_s_hub_driver_usb_driver + 1; } else { } goto ldv_31533; case 4: ; if (ldv_s_hub_driver_usb_driver == 3) { ldv_handler_precall(); hub_pre_reset(var_group2); ldv_s_hub_driver_usb_driver = ldv_s_hub_driver_usb_driver + 1; } else { } goto ldv_31533; case 5: ; if (ldv_s_hub_driver_usb_driver == 4) { ldv_handler_precall(); hub_reset_resume(var_group2); ldv_s_hub_driver_usb_driver = ldv_s_hub_driver_usb_driver + 1; } else { } goto ldv_31533; case 6: ; if (ldv_s_hub_driver_usb_driver == 5) { ldv_handler_precall(); hub_post_reset(var_group2); ldv_s_hub_driver_usb_driver = ldv_s_hub_driver_usb_driver + 1; } else { } goto ldv_31533; case 7: ; if (ldv_s_hub_driver_usb_driver == 6) { ldv_handler_precall(); hub_disconnect(var_group2); ldv_s_hub_driver_usb_driver = 0; } else { } goto ldv_31533; case 8: ldv_handler_precall(); hub_ioctl(var_group2, var_hub_ioctl_44_p1, var_hub_ioctl_44_p2); goto ldv_31533; default: ; goto ldv_31533; } ldv_31533: ; ldv_31545: tmp___0 = __VERIFIER_nondet_int(); if ((tmp___0 != 0 || ldv_s_usb_port_device_type_device_type != 0) || ldv_s_hub_driver_usb_driver != 0) { goto ldv_31544; } else { } ldv_module_exit: ; ldv_check_final_state(); return 0; } } void ldv_mutex_lock_23(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_24(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_25(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_26(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_27(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_28(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___4 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_29(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_30(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mtx(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_31(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mtx(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_32(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mtx(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_33(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mtx(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_34(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_status_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_35(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_status_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_36(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_status_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_37(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_status_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_38(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_bandwidth_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_39(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_bandwidth_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_40(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_bandwidth_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_41(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_bandwidth_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_42(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_usb_address0_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_43(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_usb_address0_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_44(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_bandwidth_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_45(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_bandwidth_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_46(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_bandwidth_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_47(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_bandwidth_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } __inline static __u64 __le64_to_cpup(__le64 const *p ) { { return ((__u64 )*p); } } extern int sscanf(char const * , char const * , ...) ; __inline static void list_add(struct list_head *new , struct list_head *head ) { { __list_add(new, head, head->next); return; } } extern unsigned long __phys_addr(unsigned long ) ; extern struct pv_irq_ops pv_irq_ops ; extern void *memset(void * , int , 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 *)"/work/vladimir/UFO/Work/test/inst/current/envs/linux-3.7.3/linux-3.7.3/arch/x86/include/asm/paravirt.h"), "i" (827), "i" (12UL)); ldv_4720: ; goto ldv_4720; } 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.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 *)"/work/vladimir/UFO/Work/test/inst/current/envs/linux-3.7.3/linux-3.7.3/arch/x86/include/asm/paravirt.h"), "i" (832), "i" (12UL)); ldv_4730: ; goto ldv_4730; } 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" (46UL), [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 *)"/work/vladimir/UFO/Work/test/inst/current/envs/linux-3.7.3/linux-3.7.3/arch/x86/include/asm/paravirt.h"), "i" (837), "i" (12UL)); ldv_4739: ; goto ldv_4739; } 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" (47UL), [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(); arch_local_irq_disable(); return (f); } } __inline static int arch_irqs_disabled_flags(unsigned long flags ) { { return ((flags & 512UL) == 0UL); } } extern void trace_hardirqs_on(void) ; extern void trace_hardirqs_off(void) ; __inline static void atomic_dec(atomic_t *v ) { { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; decl %0": "+m" (v->counter)); return; } } int ldv_mutex_trylock_78(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_74(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_76(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_79(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_81(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_83(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_85(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_86(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_88(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_90(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_91(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_92(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_94(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_96(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_73(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_75(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_77(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_80(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_82(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_84(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_87(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_89(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_93(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_95(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_usb_bus_list_lock(struct mutex *lock ) ; void ldv_mutex_unlock_usb_bus_list_lock(struct mutex *lock ) ; extern void _raw_spin_lock(raw_spinlock_t * ) ; extern void _raw_spin_unlock(raw_spinlock_t * ) ; __inline static void spin_lock(spinlock_t *lock ) { { _raw_spin_lock(& lock->ldv_5957.rlock); return; } } __inline static void spin_unlock(spinlock_t *lock ) { { _raw_spin_unlock(& lock->ldv_5957.rlock); return; } } extern int del_timer(struct timer_list * ) ; extern int mod_timer(struct timer_list * , unsigned long ) ; extern int del_timer_sync(struct timer_list * ) ; extern bool queue_work(struct workqueue_struct * , struct work_struct * ) ; extern bool cancel_work_sync(struct work_struct * ) ; extern int sysfs_create_group(struct kobject * , struct attribute_group const * ) ; extern void sysfs_remove_group(struct kobject * , struct attribute_group const * ) ; __inline static char const *kobject_name(struct kobject const *kobj ) { { return ((char const *)kobj->name); } } extern struct uts_namespace init_uts_ns ; __inline static struct new_utsname *init_utsname(void) { { return (& init_uts_ns.name); } } __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 bool device_can_wakeup(struct device *dev ) { { return ((int )dev->power.can_wakeup != 0); } } __inline static bool device_may_wakeup(struct device *dev ) { { return ((bool )((unsigned int )*((unsigned char *)dev + 292UL) != 0U && (unsigned long )dev->power.wakeup != (unsigned long )((struct wakeup_source *)0))); } } extern int device_wakeup_enable(struct device * ) ; extern int device_set_wakeup_enable(struct device * , bool ) ; __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 device_lock___0(struct device *dev ) { { ldv_mutex_lock_77(& dev->mutex); return; } } __inline static void device_unlock___0(struct device *dev ) { { ldv_mutex_unlock_79(& dev->mutex); return; } } __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" (98), "i" (12UL)); ldv_21391: ; goto ldv_21391; } 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" (99), "i" (12UL)); ldv_21392: ; goto ldv_21392; } 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 * ) ; __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_page(struct device * , struct page * , size_t , size_t , int , dma_addr_t , bool ) ; extern void debug_dma_unmap_page(struct device * , dma_addr_t , size_t , int , bool ) ; 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 dma_addr_t dma_map_single_attrs(struct device *dev , void *ptr , size_t size , enum dma_data_direction dir , struct dma_attrs *attrs ) { struct dma_map_ops *ops ; struct dma_map_ops *tmp ; dma_addr_t addr ; int tmp___0 ; long tmp___1 ; unsigned long tmp___2 ; unsigned long tmp___3 ; { tmp = get_dma_ops(dev); ops = tmp; kmemcheck_mark_initialized(ptr, (unsigned int )size); 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" (19), "i" (12UL)); ldv_21868: ; goto ldv_21868; } else { } tmp___2 = __phys_addr((unsigned long )ptr); addr = (*(ops->map_page))(dev, 0xffffea0000000000UL + (tmp___2 >> 12), (unsigned long )ptr & 4095UL, size, dir, attrs); tmp___3 = __phys_addr((unsigned long )ptr); debug_dma_map_page(dev, 0xffffea0000000000UL + (tmp___3 >> 12), (unsigned long )ptr & 4095UL, size, (int )dir, addr, 1); return (addr); } } __inline static void dma_unmap_single_attrs(struct device *dev , dma_addr_t addr , size_t size , 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" (36), "i" (12UL)); ldv_21877: ; goto ldv_21877; } else { } if ((unsigned long )ops->unmap_page != (unsigned long )((void (*)(struct device * , dma_addr_t , size_t , enum dma_data_direction , struct dma_attrs * ))0)) { (*(ops->unmap_page))(dev, addr, size, dir, attrs); } else { } debug_dma_unmap_page(dev, addr, size, (int )dir, 1); return; } } __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 ; { tmp = get_dma_ops(dev); ops = tmp; i = 0; s = sg; goto ldv_21890; ldv_21889: tmp___0 = sg_virt(s); kmemcheck_mark_initialized(tmp___0, s->length); i = i + 1; s = sg_next(s); ldv_21890: ; if (i < nents) { goto ldv_21889; } 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" (52), "i" (12UL)); ldv_21892: ; goto ldv_21892; } else { } ents = (*(ops->map_sg))(dev, sg, nents, dir, attrs); 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" (65), "i" (12UL)); ldv_21901: ; goto ldv_21901; } 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 dma_addr_t dma_map_page(struct device *dev , struct page *page , size_t offset , size_t size , enum dma_data_direction dir ) { struct dma_map_ops *ops ; struct dma_map_ops *tmp ; dma_addr_t addr ; void *tmp___0 ; int tmp___1 ; long tmp___2 ; { tmp = get_dma_ops(dev); ops = tmp; tmp___0 = lowmem_page_address((struct page const *)page); kmemcheck_mark_initialized(tmp___0 + offset, (unsigned int )size); 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" (79), "i" (12UL)); ldv_21911: ; goto ldv_21911; } else { } addr = (*(ops->map_page))(dev, page, offset, size, dir, 0); debug_dma_map_page(dev, page, offset, size, (int )dir, addr, 0); return (addr); } } __inline static void dma_unmap_page(struct device *dev , dma_addr_t addr , size_t size , enum dma_data_direction dir ) { 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" (91), "i" (12UL)); ldv_21919: ; goto ldv_21919; } else { } if ((unsigned long )ops->unmap_page != (unsigned long )((void (*)(struct device * , dma_addr_t , size_t , enum dma_data_direction , struct dma_attrs * ))0)) { (*(ops->unmap_page))(dev, addr, size, dir, 0); } else { } debug_dma_unmap_page(dev, addr, size, (int )dir, 0); return; } } __inline static int dma_mapping_error(struct device *dev , dma_addr_t dma_addr ) { struct dma_map_ops *ops ; struct dma_map_ops *tmp ; int tmp___0 ; { tmp = get_dma_ops(dev); ops = tmp; if ((unsigned long )ops->mapping_error != (unsigned long )((int (*)(struct device * , dma_addr_t ))0)) { tmp___0 = (*(ops->mapping_error))(dev, dma_addr); return (tmp___0); } else { } return (dma_addr == 0ULL); } } __inline static u64 get_unaligned_le64(void const *p ) { __u64 tmp ; { tmp = __le64_to_cpup((__le64 const *)p); return (tmp); } } __inline static void put_unaligned_le16(u16 val , void *p ) { { *((__le16 *)p) = val; return; } } __inline static void put_unaligned_le32(u32 val , void *p ) { { *((__le32 *)p) = val; return; } } __inline static void put_unaligned_le64(u64 val , void *p ) { { *((__le64 *)p) = val; return; } } extern void __bad_unaligned_access_size(void) ; __inline static void *platform_get_drvdata(struct platform_device const *pdev ) { void *tmp ; { tmp = dev_get_drvdata(& pdev->dev); return (tmp); } } __inline static int usb_endpoint_num(struct usb_endpoint_descriptor const *epd ) { { return ((int )epd->bEndpointAddress & 15); } } __inline static int usb_endpoint_type(struct usb_endpoint_descriptor const *epd ) { { return ((int )epd->bmAttributes & 3); } } __inline static int usb_endpoint_dir_out(struct usb_endpoint_descriptor const *epd ) { { return ((int )((signed char )epd->bEndpointAddress) >= 0); } } __inline static int usb_endpoint_xfer_bulk(struct usb_endpoint_descriptor const *epd ) { { return (((int )epd->bmAttributes & 3) == 2); } } __inline static int usb_endpoint_xfer_control(struct usb_endpoint_descriptor const *epd ) { { return (((int )epd->bmAttributes & 3) == 0); } } __inline static int usb_endpoint_xfer_isoc(struct usb_endpoint_descriptor const *epd ) { { return (((int )epd->bmAttributes & 3) == 1); } } extern int request_threaded_irq(unsigned int , irqreturn_t (*)(int , void * ) , irqreturn_t (*)(int , void * ) , unsigned long , char const * , void * ) ; __inline static int request_irq(unsigned int irq , irqreturn_t (*handler)(int , void * ) , unsigned long flags , char const *name , void *dev ) { int tmp ; { tmp = request_threaded_irq(irq, handler, 0, flags, name, dev); return (tmp); } } extern void free_irq(unsigned int , void * ) ; extern struct workqueue_struct *pm_wq ; int usb_alloc_streams(struct usb_interface *interface , struct usb_host_endpoint **eps , unsigned int num_eps , unsigned int num_streams , gfp_t mem_flags ) ; void usb_free_streams(struct usb_interface *interface , struct usb_host_endpoint **eps , unsigned int num_eps , gfp_t mem_flags ) ; struct urb *usb_get_urb(struct urb *urb ) ; void usb_unanchor_urb(struct urb *urb ) ; __inline static int usb_urb_dir_in(struct urb *urb ) { { return ((urb->transfer_flags & 512U) != 0U); } } int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd , struct urb *urb ) ; int usb_hcd_check_unlink_urb(struct usb_hcd *hcd , struct urb *urb , int status ) ; void usb_hcd_unlink_urb_from_ep(struct usb_hcd *hcd , struct urb *urb ) ; int usb_hcd_submit_urb(struct urb *urb , gfp_t mem_flags ) ; int usb_hcd_unlink_urb(struct urb *urb , int status ) ; void usb_hcd_giveback_urb(struct usb_hcd *hcd , struct urb *urb , int status ) ; int usb_hcd_map_urb_for_dma(struct usb_hcd *hcd , struct urb *urb , gfp_t mem_flags ) ; void usb_hcd_unmap_urb_setup_for_dma(struct usb_hcd *hcd , struct urb *urb ) ; void usb_hcd_unmap_urb_for_dma(struct usb_hcd *hcd , struct urb *urb ) ; void usb_hcd_flush_endpoint(struct usb_device *udev , struct usb_host_endpoint *ep ) ; void usb_hcd_disable_endpoint(struct usb_device *udev , struct usb_host_endpoint *ep ) ; void usb_hcd_reset_endpoint(struct usb_device *udev , struct usb_host_endpoint *ep ) ; struct usb_hcd *usb_create_hcd(struct hc_driver const *driver , struct device *dev , char const *bus_name ) ; struct usb_hcd *usb_create_shared_hcd(struct hc_driver const *driver , struct device *dev , char const *bus_name , struct usb_hcd *primary_hcd ) ; int usb_hcd_is_primary_hcd(struct usb_hcd *hcd ) ; int usb_add_hcd(struct usb_hcd *hcd , unsigned int irqnum , unsigned long irqflags ) ; void usb_remove_hcd(struct usb_hcd *hcd ) ; void usb_hcd_platform_shutdown(struct platform_device *dev ) ; int hcd_buffer_create(struct usb_hcd *hcd ) ; void hcd_buffer_destroy(struct usb_hcd *hcd ) ; irqreturn_t usb_hcd_irq(int irq , void *__hcd ) ; void usb_hc_died(struct usb_hcd *hcd ) ; void usb_hcd_poll_rh_status(struct usb_hcd *hcd ) ; long usb_calc_bus_time(int speed , int is_input , int isoc , int bytecount ) ; struct list_head usb_bus_list ; struct mutex usb_bus_list_lock ; wait_queue_head_t usb_kill_urb_queue ; int hcd_bus_suspend(struct usb_device *rhdev , pm_message_t msg ) ; int hcd_bus_resume(struct usb_device *rhdev , pm_message_t msg ) ; void usb_hcd_resume_root_hub(struct usb_hcd *hcd ) ; struct usb_mon_operations *mon_ops ; __inline static void usbmon_urb_submit(struct usb_bus *bus , struct urb *urb ) { { if (bus->monitored != 0) { (*(mon_ops->urb_submit))(bus, urb); } else { } return; } } __inline static void usbmon_urb_submit_error(struct usb_bus *bus , struct urb *urb , int error ) { { if (bus->monitored != 0) { (*(mon_ops->urb_submit_error))(bus, urb, error); } else { } return; } } __inline static void usbmon_urb_complete(struct usb_bus *bus , struct urb *urb , int status ) { { if (bus->monitored != 0) { (*(mon_ops->urb_complete))(bus, urb, status); } else { } return; } } int usb_mon_register(struct usb_mon_operations *ops ) ; void usb_mon_deregister(void) ; unsigned long usb_hcds_loaded ; void usb_notify_add_bus(struct usb_bus *ubus ) ; void usb_notify_remove_bus(struct usb_bus *ubus ) ; struct list_head usb_bus_list = {& usb_bus_list, & usb_bus_list}; static struct usb_busmap busmap ; struct mutex usb_bus_list_lock = {{1}, {{{{{0U}}, 3735899821U, 4294967295U, 0xffffffffffffffffUL, {0, {0, 0}, "usb_bus_list_lock.wait_lock", 0, 0UL}}}}, {& usb_bus_list_lock.wait_list, & usb_bus_list_lock.wait_list}, 0, 0, (void *)(& usb_bus_list_lock), {0, {0, 0}, "usb_bus_list_lock", 0, 0UL}}; static spinlock_t hcd_root_hub_lock = {{{{{0U}}, 3735899821U, 4294967295U, 0xffffffffffffffffUL, {0, {0, 0}, "hcd_root_hub_lock", 0, 0UL}}}}; static spinlock_t hcd_urb_list_lock = {{{{{0U}}, 3735899821U, 4294967295U, 0xffffffffffffffffUL, {0, {0, 0}, "hcd_urb_list_lock", 0, 0UL}}}}; static spinlock_t hcd_urb_unlink_lock = {{{{{0U}}, 3735899821U, 4294967295U, 0xffffffffffffffffUL, {0, {0, 0}, "hcd_urb_unlink_lock", 0, 0UL}}}}; wait_queue_head_t usb_kill_urb_queue = {{{{{{0U}}, 3735899821U, 4294967295U, 0xffffffffffffffffUL, {0, {0, 0}, "usb_kill_urb_queue.lock", 0, 0UL}}}}, {& usb_kill_urb_queue.task_list, & usb_kill_urb_queue.task_list}}; __inline static int is_root_hub(struct usb_device *udev ) { { return ((unsigned long )udev->parent == (unsigned long )((struct usb_device *)0)); } } static u8 const usb3_rh_dev_descriptor[18U] = { 18U, 1U, 0U, 3U, 9U, 0U, 3U, 9U, 107U, 29U, 3U, 0U, 7U, 3U, 3U, 2U, 1U, 1U}; static u8 const usb2_rh_dev_descriptor[18U] = { 18U, 1U, 0U, 2U, 9U, 0U, 0U, 64U, 107U, 29U, 2U, 0U, 7U, 3U, 3U, 2U, 1U, 1U}; static u8 const usb11_rh_dev_descriptor[18U] = { 18U, 1U, 16U, 1U, 9U, 0U, 0U, 64U, 107U, 29U, 1U, 0U, 7U, 3U, 3U, 2U, 1U, 1U}; static u8 const fs_rh_config_descriptor[25U] = { 9U, 2U, 25U, 0U, 1U, 1U, 0U, 192U, 0U, 9U, 4U, 0U, 0U, 1U, 9U, 0U, 0U, 0U, 7U, 5U, 129U, 3U, 2U, 0U, 255U}; static u8 const hs_rh_config_descriptor[25U] = { 9U, 2U, 25U, 0U, 1U, 1U, 0U, 192U, 0U, 9U, 4U, 0U, 0U, 1U, 9U, 0U, 0U, 0U, 7U, 5U, 129U, 3U, 4U, 0U, 12U}; static u8 const ss_rh_config_descriptor[31U] = { 9U, 2U, 31U, 0U, 1U, 1U, 0U, 192U, 0U, 9U, 4U, 0U, 0U, 1U, 9U, 0U, 0U, 0U, 7U, 5U, 129U, 3U, 4U, 0U, 12U, 6U, 48U, 0U, 0U, 2U, 0U}; static int authorized_default = -1; static unsigned int ascii2desc(char const *s , u8 *buf , unsigned int len ) { unsigned int n ; unsigned int t ; size_t tmp ; u8 *tmp___0 ; unsigned int tmp___1 ; u8 *tmp___2 ; char const *tmp___3 ; unsigned int tmp___4 ; { tmp = strlen(s); t = (unsigned int )(tmp + 1UL) * 2U; if (t > 254U) { t = 254U; } else { } if (len > t) { len = t; } else { } t = t + 768U; n = len; goto ldv_32172; ldv_32171: tmp___0 = buf; buf = buf + 1; *tmp___0 = (u8 )t; tmp___1 = n; n = n - 1U; if (tmp___1 == 0U) { goto ldv_32170; } else { } tmp___2 = buf; buf = buf + 1; *tmp___2 = (u8 )(t >> 8); tmp___3 = s; s = s + 1; t = (unsigned int )((unsigned char )*tmp___3); ldv_32172: tmp___4 = n; n = n - 1U; if (tmp___4 != 0U) { goto ldv_32171; } else { } ldv_32170: ; return (len); } } static unsigned int rh_string(int id , struct usb_hcd const *hcd , u8 *data , unsigned int len ) { char buf[100U] ; char const *s ; char langids[4U] ; size_t __len ; void *__ret ; struct new_utsname *tmp ; struct new_utsname *tmp___0 ; unsigned int tmp___1 ; { langids[0] = 4; langids[1] = 3; langids[2] = 9; langids[3] = 4; switch (id) { case 0: ; if (len > 4U) { len = 4U; } else { } __len = (size_t )len; __ret = __builtin_memcpy((void *)data, (void const *)(& langids), __len); return (len); case 1: s = hcd->self.bus_name; goto ldv_32187; case 2: s = hcd->product_desc; goto ldv_32187; case 3: tmp = init_utsname(); tmp___0 = init_utsname(); snprintf((char *)(& buf), 100UL, "%s %s %s", (char *)(& tmp___0->sysname), (char *)(& tmp->release), (hcd->driver)->description); s = (char const *)(& buf); goto ldv_32187; default: ; return (0U); } ldv_32187: tmp___1 = ascii2desc(s, data, len); return (tmp___1); } } static int rh_call_control(struct usb_hcd *hcd , struct urb *urb ) { struct usb_ctrlrequest *cmd ; u16 typeReq ; u16 wValue ; u16 wIndex ; u16 wLength ; u8 *ubuf ; u8 tbuf[15U] ; u8 const *bufp ; unsigned int len ; int status ; u8 patch_wakeup ; u8 patch_protocol ; bool tmp ; bool tmp___0 ; bool tmp___1 ; struct _ddebug descriptor ; long tmp___2 ; struct _ddebug descriptor___0 ; long tmp___3 ; struct _ddebug descriptor___1 ; long tmp___4 ; size_t __len ; void *__ret ; { ubuf = (u8 *)urb->transfer_buffer; bufp = (u8 const *)(& tbuf); len = 0U; patch_wakeup = 0U; patch_protocol = 0U; __might_sleep("/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hcd.c.prepared", 553, 0); spin_lock_irq(& hcd_root_hub_lock); status = usb_hcd_link_urb_to_ep(hcd, urb); spin_unlock_irq(& hcd_root_hub_lock); if (status != 0) { return (status); } else { } urb->hcpriv = (void *)hcd; cmd = (struct usb_ctrlrequest *)urb->setup_packet; typeReq = (u16 )((int )((short )((int )cmd->bRequestType << 8)) | (int )((short )cmd->bRequest)); wValue = cmd->wValue; wIndex = cmd->wIndex; wLength = cmd->wLength; if ((u32 )wLength > urb->transfer_buffer_length) { goto error; } else { } urb->actual_length = 0U; switch ((int )typeReq) { case 32768: tmp = device_may_wakeup(& (hcd->self.root_hub)->dev); tbuf[0] = (u8 )((int )((signed char )((int )tmp << 1)) | 1); tbuf[1] = 0U; len = 2U; goto ldv_32209; case 1: ; if ((unsigned int )wValue == 1U) { device_set_wakeup_enable(& (hcd->self.root_hub)->dev, 0); } else { goto error; } goto ldv_32209; case 3: tmp___0 = device_can_wakeup(& (hcd->self.root_hub)->dev); if ((int )tmp___0 && (unsigned int )wValue == 1U) { device_set_wakeup_enable(& (hcd->self.root_hub)->dev, 1); } else { goto error; } goto ldv_32209; case 32776: tbuf[0] = 1U; len = 1U; case 9: ; goto ldv_32209; case 32774: ; switch ((int )wValue & 65280) { case 256: ; switch (hcd->speed) { case 64: bufp = (u8 const *)(& usb3_rh_dev_descriptor); goto ldv_32217; case 32: bufp = (u8 const *)(& usb2_rh_dev_descriptor); goto ldv_32217; case 16: bufp = (u8 const *)(& usb11_rh_dev_descriptor); goto ldv_32217; default: ; goto error; } ldv_32217: len = 18U; if ((unsigned int )*((unsigned char *)hcd + 408UL) != 0U) { patch_protocol = 1U; } else { } goto ldv_32221; case 512: ; switch (hcd->speed) { case 64: bufp = (u8 const *)(& ss_rh_config_descriptor); len = 31U; goto ldv_32224; case 32: bufp = (u8 const *)(& hs_rh_config_descriptor); len = 25U; goto ldv_32224; case 16: bufp = (u8 const *)(& fs_rh_config_descriptor); len = 25U; goto ldv_32224; default: ; goto error; } ldv_32224: tmp___1 = device_can_wakeup(& (hcd->self.root_hub)->dev); if ((int )tmp___1) { patch_wakeup = 1U; } else { } goto ldv_32221; case 768: ; if (((int )wValue & 255) <= 3) { urb->actual_length = rh_string((int )wValue & 255, (struct usb_hcd const *)hcd, ubuf, (unsigned int )wLength); } else { goto error; } goto ldv_32221; case 3840: ; goto nongeneric; default: ; goto error; } ldv_32221: ; goto ldv_32209; case 32778: tbuf[0] = 0U; len = 1U; case 11: ; goto ldv_32209; case 5: descriptor.modname = "usbcore"; descriptor.function = "rh_call_control"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hcd.c.prepared"; descriptor.format = "root hub device address %d\n"; descriptor.lineno = 680U; descriptor.flags = 1U; tmp___2 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___2 != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)hcd->self.controller, "root hub device address %d\n", (int )wValue); } else { } goto ldv_32209; case 33024: tbuf[0] = 0U; tbuf[1] = 0U; len = 2U; case 257: ; case 259: descriptor___0.modname = "usbcore"; descriptor___0.function = "rh_call_control"; descriptor___0.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hcd.c.prepared"; descriptor___0.format = "no endpoint features yet\n"; descriptor___0.lineno = 695U; descriptor___0.flags = 1U; tmp___3 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___3 != 0L) { __dynamic_dev_dbg(& descriptor___0, (struct device const *)hcd->self.controller, "no endpoint features yet\n"); } else { } goto ldv_32209; default: ; nongeneric: ; switch ((int )typeReq) { case 40960: ; case 41728: len = 4U; goto ldv_32244; case 40966: len = 15U; goto ldv_32244; case 32774: ; goto ldv_32244; } ldv_32244: status = (*((hcd->driver)->hub_control))(hcd, (int )typeReq, (int )wValue, (int )wIndex, (char *)(& tbuf), (int )wLength); goto ldv_32209; error: status = -32; } ldv_32209: ; if (status < 0) { len = 0U; if (status != -32) { descriptor___1.modname = "usbcore"; descriptor___1.function = "rh_call_control"; descriptor___1.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hcd.c.prepared"; descriptor___1.format = "CTRL: TypeReq=0x%x val=0x%x idx=0x%x len=%d ==> %d\n"; descriptor___1.lineno = 731U; descriptor___1.flags = 1U; tmp___4 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); if (tmp___4 != 0L) { __dynamic_dev_dbg(& descriptor___1, (struct device const *)hcd->self.controller, "CTRL: TypeReq=0x%x val=0x%x idx=0x%x len=%d ==> %d\n", (int )typeReq, (int )wValue, (int )wIndex, (int )wLength, status); } else { } } else { } } else if (status > 0) { len = (unsigned int )status; status = 0; } else { } if (len != 0U) { if (urb->transfer_buffer_length < len) { len = urb->transfer_buffer_length; } else { } urb->actual_length = len; __len = (size_t )len; __ret = __builtin_memcpy((void *)ubuf, (void const *)bufp, __len); if ((unsigned int )patch_wakeup != 0U && len > 7U) { ((struct usb_config_descriptor *)ubuf)->bmAttributes = (__u8 )((unsigned int )((struct usb_config_descriptor *)ubuf)->bmAttributes | 32U); } else { } if ((unsigned int )patch_protocol != 0U && len > 6U) { ((struct usb_device_descriptor *)ubuf)->bDeviceProtocol = 1U; } else { } } else { } spin_lock_irq(& hcd_root_hub_lock); usb_hcd_unlink_urb_from_ep(hcd, urb); spin_unlock(& hcd_root_hub_lock); usb_hcd_giveback_urb(hcd, urb, status); spin_lock(& hcd_root_hub_lock); spin_unlock_irq(& hcd_root_hub_lock); return (0); } } void usb_hcd_poll_rh_status(struct usb_hcd *hcd ) { struct urb *urb ; int length ; unsigned long flags ; char buffer[6U] ; long tmp ; raw_spinlock_t *tmp___0 ; size_t __len ; void *__ret ; { tmp = ldv__builtin_expect((unsigned int )*((unsigned char *)hcd + 408UL) == 0U, 0L); if (tmp != 0L) { return; } else { } if ((unsigned int )*((unsigned char *)hcd + 408UL) == 0U && (unsigned long )hcd->status_urb == (unsigned long )((struct urb *)0)) { return; } else { } length = (*((hcd->driver)->hub_status_data))(hcd, (char *)(& buffer)); if (length > 0) { tmp___0 = spinlock_check(& hcd_root_hub_lock); flags = _raw_spin_lock_irqsave(tmp___0); urb = hcd->status_urb; if ((unsigned long )urb != (unsigned long )((struct urb *)0)) { clear_bit(3, (unsigned long volatile *)(& hcd->flags)); hcd->status_urb = 0; urb->actual_length = (u32 )length; __len = (size_t )length; __ret = __builtin_memcpy(urb->transfer_buffer, (void const *)(& buffer), __len); usb_hcd_unlink_urb_from_ep(hcd, urb); spin_unlock(& hcd_root_hub_lock); usb_hcd_giveback_urb(hcd, urb, 0); spin_lock(& hcd_root_hub_lock); } else { length = 0; set_bit(3U, (unsigned long volatile *)(& hcd->flags)); } spin_unlock_irqrestore(& hcd_root_hub_lock, flags); } else { } if ((unsigned int )*((unsigned char *)hcd + 408UL) != 0U ? (hcd->flags & 4UL) != 0UL : (length == 0 && (unsigned long )hcd->status_urb != (unsigned long )((struct urb *)0)) != 0) { mod_timer(& hcd->rh_timer, ((unsigned long )jiffies / 62UL + 1UL) * 62UL); } else { } return; } } static void rh_timer_func(unsigned long _hcd ) { { usb_hcd_poll_rh_status((struct usb_hcd *)_hcd); return; } } static int rh_queue_status(struct usb_hcd *hcd , struct urb *urb ) { int retval ; unsigned long flags ; unsigned int len ; raw_spinlock_t *tmp ; struct _ddebug descriptor ; long tmp___0 ; { len = (unsigned int )((urb->dev)->maxchild / 8 + 1); tmp = spinlock_check(& hcd_root_hub_lock); flags = _raw_spin_lock_irqsave(tmp); if ((unsigned long )hcd->status_urb != (unsigned long )((struct urb *)0) || urb->transfer_buffer_length < len) { descriptor.modname = "usbcore"; descriptor.function = "rh_queue_status"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hcd.c.prepared"; descriptor.format = "not queuing rh status urb\n"; descriptor.lineno = 847U; descriptor.flags = 1U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)hcd->self.controller, "not queuing rh status urb\n"); } else { } retval = -22; goto done; } else { } retval = usb_hcd_link_urb_to_ep(hcd, urb); if (retval != 0) { goto done; } else { } hcd->status_urb = urb; urb->hcpriv = (void *)hcd; if ((unsigned int )*((unsigned char *)hcd + 408UL) == 0U) { mod_timer(& hcd->rh_timer, ((unsigned long )jiffies / 62UL + 1UL) * 62UL); } else if ((hcd->flags & 8UL) != 0UL) { mod_timer(& hcd->rh_timer, jiffies); } else { } retval = 0; done: spin_unlock_irqrestore(& hcd_root_hub_lock, flags); return (retval); } } static int rh_urb_enqueue(struct usb_hcd *hcd , struct urb *urb ) { int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; { tmp___0 = usb_endpoint_xfer_int((struct usb_endpoint_descriptor const *)(& (urb->ep)->desc)); if (tmp___0 != 0) { tmp = rh_queue_status(hcd, urb); return (tmp); } else { } tmp___2 = usb_endpoint_xfer_control((struct usb_endpoint_descriptor const *)(& (urb->ep)->desc)); if (tmp___2 != 0) { tmp___1 = rh_call_control(hcd, urb); return (tmp___1); } else { } return (-22); } } static int usb_rh_urb_dequeue(struct usb_hcd *hcd , struct urb *urb , int status ) { unsigned long flags ; int rc ; raw_spinlock_t *tmp ; int tmp___0 ; { tmp = spinlock_check(& hcd_root_hub_lock); flags = _raw_spin_lock_irqsave(tmp); rc = usb_hcd_check_unlink_urb(hcd, urb, status); if (rc != 0) { goto done; } else { } tmp___0 = usb_endpoint_num((struct usb_endpoint_descriptor const *)(& (urb->ep)->desc)); if (tmp___0 == 0) { } else { if ((unsigned int )*((unsigned char *)hcd + 408UL) == 0U) { del_timer(& hcd->rh_timer); } else { } if ((unsigned long )hcd->status_urb == (unsigned long )urb) { hcd->status_urb = 0; usb_hcd_unlink_urb_from_ep(hcd, urb); spin_unlock(& hcd_root_hub_lock); usb_hcd_giveback_urb(hcd, urb, status); spin_lock(& hcd_root_hub_lock); } else { } } done: spin_unlock_irqrestore(& hcd_root_hub_lock, flags); return (rc); } } static ssize_t usb_host_authorized_default_show(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_device *rh_usb_dev ; struct device const *__mptr ; struct usb_bus *usb_bus ; struct usb_hcd *usb_hcd ; int tmp ; { __mptr = (struct device const *)dev; rh_usb_dev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; usb_bus = rh_usb_dev->bus; if ((unsigned long )usb_bus == (unsigned long )((struct usb_bus *)0)) { return (-19L); } else { } usb_hcd = bus_to_hcd(usb_bus); tmp = snprintf(buf, 4096UL, "%u\n", (int )usb_hcd->authorized_default); return ((ssize_t )tmp); } } static ssize_t usb_host_authorized_default_store(struct device *dev , struct device_attribute *attr , char const *buf , size_t size ) { ssize_t result ; unsigned int val ; struct usb_device *rh_usb_dev ; struct device const *__mptr ; struct usb_bus *usb_bus ; struct usb_hcd *usb_hcd ; int tmp ; { __mptr = (struct device const *)dev; rh_usb_dev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; usb_bus = rh_usb_dev->bus; if ((unsigned long )usb_bus == (unsigned long )((struct usb_bus *)0)) { return (-19L); } else { } usb_hcd = bus_to_hcd(usb_bus); tmp = sscanf(buf, "%u\n", & val); result = (ssize_t )tmp; if (result == 1L) { usb_hcd->authorized_default = val != 0U; result = (ssize_t )size; } else { result = -22L; } return (result); } } static struct device_attribute dev_attr_authorized_default = {{"authorized_default", 420U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & usb_host_authorized_default_show, & usb_host_authorized_default_store}; static struct attribute *usb_bus_attrs[2U] = { & dev_attr_authorized_default.attr, 0}; static struct attribute_group usb_bus_attr_group = {0, 0, (struct attribute **)(& usb_bus_attrs)}; static void usb_bus_init(struct usb_bus *bus ) { { memset((void *)(& bus->devmap), 0, 16UL); bus->devnum_next = 1; bus->root_hub = 0; bus->busnum = -1; bus->bandwidth_allocated = 0; bus->bandwidth_int_reqs = 0; bus->bandwidth_isoc_reqs = 0; INIT_LIST_HEAD(& bus->bus_list); return; } } static int usb_register_bus(struct usb_bus *bus ) { int result ; int busnum ; unsigned long tmp ; { result = -7; ldv_mutex_lock_84(& usb_bus_list_lock); tmp = find_next_zero_bit((unsigned long const *)(& busmap.busmap), 64UL, 1UL); busnum = (int )tmp; if (busnum > 63) { printk("\v%s: too many buses\n", usbcore_name); goto error_find_busnum; } else { } set_bit((unsigned int )busnum, (unsigned long volatile *)(& busmap.busmap)); bus->busnum = busnum; list_add(& bus->bus_list, & usb_bus_list); ldv_mutex_unlock_85(& usb_bus_list_lock); usb_notify_add_bus(bus); _dev_info((struct device const *)bus->controller, "new USB bus registered, assigned bus number %d\n", bus->busnum); return (0); error_find_busnum: ldv_mutex_unlock_86(& usb_bus_list_lock); return (result); } } static void usb_deregister_bus(struct usb_bus *bus ) { { _dev_info((struct device const *)bus->controller, "USB bus %d deregistered\n", bus->busnum); ldv_mutex_lock_87(& usb_bus_list_lock); list_del(& bus->bus_list); ldv_mutex_unlock_88(& usb_bus_list_lock); usb_notify_remove_bus(bus); clear_bit(bus->busnum, (unsigned long volatile *)(& busmap.busmap)); return; } } static int register_root_hub(struct usb_hcd *hcd ) { struct device *parent_dev ; struct usb_device *usb_dev ; int devnum ; int retval ; struct _ddebug descriptor ; char const *tmp ; long tmp___0 ; struct _ddebug descriptor___0 ; char const *tmp___1 ; long tmp___2 ; char const *tmp___3 ; { parent_dev = hcd->self.controller; usb_dev = hcd->self.root_hub; devnum = 1; usb_dev->devnum = devnum; (usb_dev->bus)->devnum_next = devnum + 1; memset((void *)(& (usb_dev->bus)->devmap.devicemap), 0, 16UL); set_bit((unsigned int )devnum, (unsigned long volatile *)(& (usb_dev->bus)->devmap.devicemap)); usb_set_device_state(usb_dev, USB_STATE_ADDRESS); ldv_mutex_lock_89(& usb_bus_list_lock); usb_dev->ep0.desc.wMaxPacketSize = 64U; retval = usb_get_device_descriptor(usb_dev, 18U); if (retval != 18) { ldv_mutex_unlock_90(& usb_bus_list_lock); descriptor.modname = "usbcore"; descriptor.function = "register_root_hub"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hcd.c.prepared"; descriptor.format = "can\'t read %s device descriptor %d\n"; descriptor.lineno = 1093U; descriptor.flags = 1U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = dev_name((struct device const *)(& usb_dev->dev)); __dynamic_dev_dbg(& descriptor, (struct device const *)parent_dev, "can\'t read %s device descriptor %d\n", tmp, retval); } else { } return (retval < 0 ? retval : -90); } else { } if ((unsigned int )usb_dev->speed == 5U) { retval = usb_get_bos_descriptor(usb_dev); if (retval < 0) { ldv_mutex_unlock_91(& usb_bus_list_lock); descriptor___0.modname = "usbcore"; descriptor___0.function = "register_root_hub"; descriptor___0.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hcd.c.prepared"; descriptor___0.format = "can\'t read %s bos descriptor %d\n"; descriptor___0.lineno = 1101U; descriptor___0.flags = 1U; tmp___2 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___2 != 0L) { tmp___1 = dev_name((struct device const *)(& usb_dev->dev)); __dynamic_dev_dbg(& descriptor___0, (struct device const *)parent_dev, "can\'t read %s bos descriptor %d\n", tmp___1, retval); } else { } return (retval); } else { } } else { } retval = usb_new_device(usb_dev); if (retval != 0) { tmp___3 = dev_name((struct device const *)(& usb_dev->dev)); dev_err((struct device const *)parent_dev, "can\'t register root hub for %s, %d\n", tmp___3, retval); } else { spin_lock_irq(& hcd_root_hub_lock); hcd->rh_registered = 1U; spin_unlock_irq(& hcd_root_hub_lock); if ((hcd->flags & 64UL) != 0UL) { usb_hc_died(hcd); } else { } } ldv_mutex_unlock_92(& usb_bus_list_lock); return (retval); } } long usb_calc_bus_time(int speed , int is_input , int isoc , int bytecount ) { unsigned long tmp ; struct _ddebug descriptor ; long tmp___0 ; { switch (speed) { case 1: ; if (is_input != 0) { tmp = (unsigned long )(((long )((bytecount * 56) / 6) * 676670L + 2097677L) / 1000L); return ((long )(tmp + 65726UL)); } else { tmp = (unsigned long )(((long )((bytecount * 56) / 6) * 667000L + 2067700L) / 1000L); return ((long )(tmp + 65773UL)); } case 2: ; if (isoc != 0) { tmp = (unsigned long )(((long )((bytecount * 56) / 6) * 83540L + 258974L) / 1000L); return ((long )((is_input != 0 ? 8268UL : 7265UL) + tmp)); } else { tmp = (unsigned long )(((long )((bytecount * 56) / 6) * 83540L + 258974L) / 1000L); return ((long )(tmp + 10107UL)); } case 3: ; if (isoc != 0) { tmp = ((unsigned long )((bytecount * 56) / 6 + 3) * 2083UL + 633232UL) / 1000UL + 5UL; } else { tmp = ((unsigned long )((bytecount * 56) / 6 + 3) * 2083UL + 916520UL) / 1000UL + 5UL; } return ((long )tmp); default: descriptor.modname = "usbcore"; descriptor.function = "usb_calc_bus_time"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hcd.c.prepared"; descriptor.format = "%s: bogus device speed!\n"; descriptor.lineno = 1167U; descriptor.flags = 1U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { __dynamic_pr_debug(& descriptor, "%s: bogus device speed!\n", usbcore_name); } else { } return (-1L); } } } int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd , struct urb *urb ) { int rc ; int tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; { rc = 0; spin_lock(& hcd_urb_list_lock); tmp = atomic_read((atomic_t const *)(& urb->reject)); tmp___0 = ldv__builtin_expect(tmp != 0, 0L); if (tmp___0 != 0L) { rc = -1; goto done; } else { } tmp___1 = ldv__builtin_expect((urb->ep)->enabled == 0, 0L); if (tmp___1 != 0L) { rc = -2; goto done; } else { } tmp___2 = ldv__builtin_expect((unsigned int )*((unsigned char *)urb->dev + 1596UL) == 0U, 0L); if (tmp___2 != 0L) { rc = -113; goto done; } else { } if ((hcd->flags & 32UL) != 0UL) { urb->unlinked = 0; list_add_tail(& urb->urb_list, & (urb->ep)->urb_list); } else { rc = -108; goto done; } done: spin_unlock(& hcd_urb_list_lock); return (rc); } } int usb_hcd_check_unlink_urb(struct usb_hcd *hcd , struct urb *urb , int status ) { struct list_head *tmp ; { tmp = (urb->ep)->urb_list.next; goto ldv_32392; ldv_32391: ; if ((unsigned long )(& urb->urb_list) == (unsigned long )tmp) { goto ldv_32390; } else { } tmp = tmp->next; ldv_32392: ; if ((unsigned long )(& (urb->ep)->urb_list) != (unsigned long )tmp) { goto ldv_32391; } else { } ldv_32390: ; if ((unsigned long )(& urb->urb_list) != (unsigned long )tmp) { return (-43); } else { } if (urb->unlinked != 0) { return (-16); } else { } urb->unlinked = status; return (0); } } void usb_hcd_unlink_urb_from_ep(struct usb_hcd *hcd , struct urb *urb ) { { spin_lock(& hcd_urb_list_lock); list_del_init(& urb->urb_list); spin_unlock(& hcd_urb_list_lock); return; } } static int hcd_alloc_coherent(struct usb_bus *bus , gfp_t mem_flags , dma_addr_t *dma_handle , void **vaddr_handle , size_t size , enum dma_data_direction dir ) { unsigned char *vaddr ; bool __warned ; int __ret_warn_once ; int __ret_warn_on ; long tmp ; long tmp___0 ; long tmp___1 ; void *tmp___2 ; void *__gu_p ; size_t __len ; void *__ret ; { if ((unsigned long )*vaddr_handle == (unsigned long )((void *)0)) { __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/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hcd.c.prepared", 1337); } 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 (-14); } else { } tmp___2 = hcd_buffer_alloc(bus, size + 8UL, mem_flags, dma_handle); vaddr = (unsigned char *)tmp___2; if ((unsigned long )vaddr == (unsigned long )((unsigned char *)0)) { return (-12); } else { } __gu_p = (void *)(vaddr + size); switch (8UL) { case 1UL: *((u8 *)__gu_p) = (unsigned char )((long )*vaddr_handle); goto ldv_32428; case 2UL: put_unaligned_le16((int )((unsigned short )((long )*vaddr_handle)), __gu_p); goto ldv_32428; case 4UL: put_unaligned_le32((unsigned int )((long )*vaddr_handle), __gu_p); goto ldv_32428; case 8UL: put_unaligned_le64((unsigned long long )*vaddr_handle, __gu_p); goto ldv_32428; default: __bad_unaligned_access_size(); goto ldv_32428; } ldv_32428: ; if ((unsigned int )dir == 1U) { __len = size; __ret = __builtin_memcpy((void *)vaddr, (void const *)*vaddr_handle, __len); } else { } *vaddr_handle = (void *)vaddr; return (0); } } static void hcd_free_coherent(struct usb_bus *bus , dma_addr_t *dma_handle , void **vaddr_handle , size_t size , enum dma_data_direction dir ) { unsigned char *vaddr ; u64 tmp ; size_t __len ; void *__ret ; { vaddr = (unsigned char *)*vaddr_handle; tmp = get_unaligned_le64((void const *)(vaddr + size)); vaddr = (unsigned char *)tmp; if ((unsigned int )dir == 2U) { __len = size; __ret = __builtin_memcpy((void *)vaddr, (void const *)*vaddr_handle, __len); } else { } hcd_buffer_free(bus, size + 8UL, *vaddr_handle, *dma_handle); *vaddr_handle = (void *)vaddr; *dma_handle = 0ULL; return; } } void usb_hcd_unmap_urb_setup_for_dma(struct usb_hcd *hcd , struct urb *urb ) { { if ((urb->transfer_flags & 1048576U) != 0U) { dma_unmap_single_attrs(hcd->self.controller, urb->setup_dma, 8UL, DMA_TO_DEVICE, 0); } else if ((urb->transfer_flags & 2097152U) != 0U) { hcd_free_coherent((urb->dev)->bus, & urb->setup_dma, (void **)(& urb->setup_packet), 8UL, DMA_TO_DEVICE); } else { } urb->transfer_flags = urb->transfer_flags & 4291821567U; return; } } static void unmap_urb_for_dma(struct usb_hcd *hcd , struct urb *urb ) { { if ((unsigned long )(hcd->driver)->unmap_urb_for_dma != (unsigned long )((void (*/* const */)(struct usb_hcd * , struct urb * ))0)) { (*((hcd->driver)->unmap_urb_for_dma))(hcd, urb); } else { usb_hcd_unmap_urb_for_dma(hcd, urb); } return; } } void usb_hcd_unmap_urb_for_dma(struct usb_hcd *hcd , struct urb *urb ) { enum dma_data_direction dir ; int tmp ; { usb_hcd_unmap_urb_setup_for_dma(hcd, urb); tmp = usb_urb_dir_in(urb); dir = tmp != 0 ? DMA_FROM_DEVICE : DMA_TO_DEVICE; if ((urb->transfer_flags & 262144U) != 0U) { dma_unmap_sg_attrs(hcd->self.controller, urb->sg, urb->num_sgs, dir, 0); } else if ((urb->transfer_flags & 131072U) != 0U) { dma_unmap_page(hcd->self.controller, urb->transfer_dma, (size_t )urb->transfer_buffer_length, dir); } else if ((urb->transfer_flags & 65536U) != 0U) { dma_unmap_single_attrs(hcd->self.controller, urb->transfer_dma, (size_t )urb->transfer_buffer_length, dir, 0); } else if ((urb->transfer_flags & 524288U) != 0U) { hcd_free_coherent((urb->dev)->bus, & urb->transfer_dma, & urb->transfer_buffer, (size_t )urb->transfer_buffer_length, dir); } else { } urb->transfer_flags = urb->transfer_flags & 4293984255U; return; } } static int map_urb_for_dma(struct usb_hcd *hcd , struct urb *urb , gfp_t mem_flags ) { int tmp ; int tmp___0 ; { if ((unsigned long )(hcd->driver)->map_urb_for_dma != (unsigned long )((int (*/* const */)(struct usb_hcd * , struct urb * , gfp_t ))0)) { tmp = (*((hcd->driver)->map_urb_for_dma))(hcd, urb, mem_flags); return (tmp); } else { tmp___0 = usb_hcd_map_urb_for_dma(hcd, urb, mem_flags); return (tmp___0); } } } int usb_hcd_map_urb_for_dma(struct usb_hcd *hcd , struct urb *urb , gfp_t mem_flags ) { enum dma_data_direction dir ; int ret ; int tmp ; int tmp___0 ; int tmp___1 ; int n ; int __ret_warn_on ; long tmp___2 ; int tmp___3 ; struct scatterlist *sg ; struct page *tmp___4 ; int tmp___5 ; int tmp___6 ; { ret = 0; tmp___0 = usb_endpoint_xfer_control((struct usb_endpoint_descriptor const *)(& (urb->ep)->desc)); if (tmp___0 != 0) { if ((unsigned int )hcd->self.uses_pio_for_control != 0U) { return (ret); } else { } if ((unsigned int )hcd->self.uses_dma != 0U) { urb->setup_dma = dma_map_single_attrs(hcd->self.controller, (void *)urb->setup_packet, 8UL, DMA_TO_DEVICE, 0); tmp = dma_mapping_error(hcd->self.controller, urb->setup_dma); if (tmp != 0) { return (-11); } else { } urb->transfer_flags = urb->transfer_flags | 1048576U; } else if (((int )(hcd->driver)->flags & 2) != 0) { ret = hcd_alloc_coherent((urb->dev)->bus, mem_flags, & urb->setup_dma, (void **)(& urb->setup_packet), 8UL, DMA_TO_DEVICE); if (ret != 0) { return (ret); } else { } urb->transfer_flags = urb->transfer_flags | 2097152U; } else { } } else { } tmp___1 = usb_urb_dir_in(urb); dir = tmp___1 != 0 ? DMA_FROM_DEVICE : DMA_TO_DEVICE; if (urb->transfer_buffer_length != 0U && (urb->transfer_flags & 4U) == 0U) { if ((unsigned int )hcd->self.uses_dma != 0U) { if (urb->num_sgs != 0) { tmp___3 = usb_endpoint_xfer_isoc((struct usb_endpoint_descriptor const *)(& (urb->ep)->desc)); if (tmp___3 != 0) { __ret_warn_on = 1; tmp___2 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___2 != 0L) { warn_slowpath_null("/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hcd.c.prepared", 1499); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); return (-22); } else { } n = dma_map_sg_attrs(hcd->self.controller, urb->sg, urb->num_sgs, dir, 0); if (n <= 0) { ret = -11; } else { urb->transfer_flags = urb->transfer_flags | 262144U; } urb->num_mapped_sgs = n; if (urb->num_sgs != n) { urb->transfer_flags = urb->transfer_flags | 4194304U; } else { } } else if ((unsigned long )urb->sg != (unsigned long )((struct scatterlist *)0)) { sg = urb->sg; tmp___4 = sg_page(sg); urb->transfer_dma = dma_map_page(hcd->self.controller, tmp___4, (size_t )sg->offset, (size_t )urb->transfer_buffer_length, dir); tmp___5 = dma_mapping_error(hcd->self.controller, urb->transfer_dma); if (tmp___5 != 0) { ret = -11; } else { urb->transfer_flags = urb->transfer_flags | 131072U; } } else { urb->transfer_dma = dma_map_single_attrs(hcd->self.controller, urb->transfer_buffer, (size_t )urb->transfer_buffer_length, dir, 0); tmp___6 = dma_mapping_error(hcd->self.controller, urb->transfer_dma); if (tmp___6 != 0) { ret = -11; } else { urb->transfer_flags = urb->transfer_flags | 65536U; } } } else if (((int )(hcd->driver)->flags & 2) != 0) { ret = hcd_alloc_coherent((urb->dev)->bus, mem_flags, & urb->transfer_dma, & urb->transfer_buffer, (size_t )urb->transfer_buffer_length, dir); if (ret == 0) { urb->transfer_flags = urb->transfer_flags | 524288U; } else { } } else { } if (ret != 0 && (urb->transfer_flags & 3145728U) != 0U) { usb_hcd_unmap_urb_for_dma(hcd, urb); } else { } } else { } return (ret); } } int usb_hcd_submit_urb(struct urb *urb , gfp_t mem_flags ) { int status ; struct usb_hcd *hcd ; struct usb_hcd *tmp ; long tmp___0 ; long tmp___1 ; int tmp___2 ; int tmp___3 ; long tmp___4 ; { tmp = bus_to_hcd((urb->dev)->bus); hcd = tmp; usb_get_urb(urb); atomic_inc(& urb->use_count); atomic_inc(& (urb->dev)->urbnum); usbmon_urb_submit(& hcd->self, urb); tmp___2 = is_root_hub(urb->dev); if (tmp___2 != 0) { status = rh_urb_enqueue(hcd, urb); } else { status = map_urb_for_dma(hcd, urb, mem_flags); tmp___1 = ldv__builtin_expect(status == 0, 1L); if (tmp___1 != 0L) { status = (*((hcd->driver)->urb_enqueue))(hcd, urb, mem_flags); tmp___0 = ldv__builtin_expect(status != 0, 0L); if (tmp___0 != 0L) { unmap_urb_for_dma(hcd, urb); } else { } } else { } } tmp___4 = ldv__builtin_expect(status != 0, 0L); if (tmp___4 != 0L) { usbmon_urb_submit_error(& hcd->self, urb, status); urb->hcpriv = 0; INIT_LIST_HEAD(& urb->urb_list); atomic_dec(& urb->use_count); atomic_dec(& (urb->dev)->urbnum); tmp___3 = atomic_read((atomic_t const *)(& urb->reject)); if (tmp___3 != 0) { __wake_up(& usb_kill_urb_queue, 3U, 1, 0); } else { } usb_free_urb(urb); } else { } return (status); } } static int unlink1(struct usb_hcd *hcd , struct urb *urb , int status ) { int value ; int tmp ; { tmp = is_root_hub(urb->dev); if (tmp != 0) { value = usb_rh_urb_dequeue(hcd, urb, status); } else { value = (*((hcd->driver)->urb_dequeue))(hcd, urb, status); } return (value); } } int usb_hcd_unlink_urb(struct urb *urb , int status ) { struct usb_hcd *hcd ; int retval ; unsigned long flags ; raw_spinlock_t *tmp ; int tmp___0 ; struct _ddebug descriptor ; long tmp___1 ; { retval = -43; tmp = spinlock_check(& hcd_urb_unlink_lock); flags = _raw_spin_lock_irqsave(tmp); tmp___0 = atomic_read((atomic_t const *)(& urb->use_count)); if (tmp___0 > 0) { retval = 0; usb_get_dev(urb->dev); } else { } spin_unlock_irqrestore(& hcd_urb_unlink_lock, flags); if (retval == 0) { hcd = bus_to_hcd((urb->dev)->bus); retval = unlink1(hcd, urb, status); usb_put_dev(urb->dev); } else { } if (retval == 0) { retval = -115; } else if (retval != -43 && retval != -16) { descriptor.modname = "usbcore"; descriptor.function = "usb_hcd_unlink_urb"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hcd.c.prepared"; descriptor.format = "hcd_unlink_urb %p fail %d\n"; descriptor.lineno = 1668U; descriptor.flags = 1U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)(& (urb->dev)->dev), "hcd_unlink_urb %p fail %d\n", urb, retval); } else { } } else { } return (retval); } } void usb_hcd_giveback_urb(struct usb_hcd *hcd , struct urb *urb , int status ) { long tmp ; long tmp___0 ; int tmp___1 ; long tmp___2 ; long tmp___3 ; int tmp___4 ; long tmp___5 ; { urb->hcpriv = 0; tmp___3 = ldv__builtin_expect(urb->unlinked != 0, 0L); if (tmp___3 != 0L) { status = urb->unlinked; } else { tmp = ldv__builtin_expect((long )((int )urb->transfer_flags) & 1L, 0L); if (tmp != 0L) { tmp___0 = ldv__builtin_expect(urb->actual_length < urb->transfer_buffer_length, 0L); if (tmp___0 != 0L) { tmp___1 = 1; } else { tmp___1 = 0; } } else { tmp___1 = 0; } if (tmp___1 != 0) { tmp___2 = ldv__builtin_expect(status == 0, 0L); if (tmp___2 != 0L) { status = -121; } else { } } else { } } unmap_urb_for_dma(hcd, urb); usbmon_urb_complete(& hcd->self, urb, status); usb_unanchor_urb(urb); urb->status = status; (*(urb->complete))(urb); atomic_dec(& urb->use_count); tmp___4 = atomic_read((atomic_t const *)(& urb->reject)); tmp___5 = ldv__builtin_expect(tmp___4 != 0, 0L); if (tmp___5 != 0L) { __wake_up(& usb_kill_urb_queue, 3U, 1, 0); } else { } usb_free_urb(urb); return; } } void usb_hcd_flush_endpoint(struct usb_device *udev , struct usb_host_endpoint *ep ) { struct usb_hcd *hcd ; struct urb *urb ; struct list_head const *__mptr ; int is_in ; struct _ddebug descriptor ; char *s ; int tmp ; int tmp___0 ; long tmp___1 ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; int tmp___2 ; int tmp___3 ; { if ((unsigned long )ep == (unsigned long )((struct usb_host_endpoint *)0)) { return; } else { } __might_sleep("/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hcd.c.prepared", 1729, 0); hcd = bus_to_hcd(udev->bus); spin_lock_irq(& hcd_urb_list_lock); rescan: __mptr = (struct list_head const *)ep->urb_list.next; urb = (struct urb *)__mptr + 0xffffffffffffffe0UL; goto ldv_32558; ldv_32557: ; if (urb->unlinked != 0) { goto ldv_32547; } else { } usb_get_urb(urb); is_in = usb_urb_dir_in(urb); spin_unlock(& hcd_urb_list_lock); unlink1(hcd, urb, -108); descriptor.modname = "usbcore"; descriptor.function = "usb_hcd_flush_endpoint"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hcd.c.prepared"; descriptor.format = "shutdown urb %p ep%d%s%s\n"; descriptor.lineno = 1763U; descriptor.flags = 1U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp = usb_endpoint_type((struct usb_endpoint_descriptor const *)(& ep->desc)); switch (tmp) { case 0: s = (char *)""; goto ldv_32552; case 2: s = (char *)"-bulk"; goto ldv_32552; case 3: s = (char *)"-intr"; goto ldv_32552; default: s = (char *)"-iso"; goto ldv_32552; } ldv_32552: tmp___0 = usb_endpoint_num((struct usb_endpoint_descriptor const *)(& ep->desc)); __dynamic_dev_dbg(& descriptor, (struct device const *)hcd->self.controller, "shutdown urb %p ep%d%s%s\n", urb, tmp___0, is_in != 0 ? (char *)"in" : (char *)"out", s); } else { } usb_free_urb(urb); spin_lock(& hcd_urb_list_lock); goto rescan; ldv_32547: __mptr___0 = (struct list_head const *)urb->urb_list.next; urb = (struct urb *)__mptr___0 + 0xffffffffffffffe0UL; ldv_32558: ; if ((unsigned long )(& urb->urb_list) != (unsigned long )(& ep->urb_list)) { goto ldv_32557; } else { } spin_unlock_irq(& hcd_urb_list_lock); goto ldv_32563; ldv_32562: spin_lock_irq(& hcd_urb_list_lock); urb = 0; tmp___2 = list_empty((struct list_head const *)(& ep->urb_list)); if (tmp___2 == 0) { __mptr___1 = (struct list_head const *)ep->urb_list.prev; urb = (struct urb *)__mptr___1 + 0xffffffffffffffe0UL; usb_get_urb(urb); } else { } spin_unlock_irq(& hcd_urb_list_lock); if ((unsigned long )urb != (unsigned long )((struct urb *)0)) { usb_kill_urb(urb); usb_free_urb(urb); } else { } ldv_32563: tmp___3 = list_empty((struct list_head const *)(& ep->urb_list)); if (tmp___3 == 0) { goto ldv_32562; } else { } return; } } int usb_hcd_alloc_bandwidth(struct usb_device *udev , struct usb_host_config *new_config , struct usb_host_interface *cur_alt , struct usb_host_interface *new_alt ) { int num_intfs ; int i ; int j ; struct usb_host_interface *alt ; int ret ; struct usb_hcd *hcd ; struct usb_host_endpoint *ep ; struct usb_host_interface *first_alt ; int iface_num ; struct usb_interface *iface ; struct usb_interface *tmp ; { alt = 0; ret = 0; hcd = bus_to_hcd(udev->bus); if ((unsigned long )(hcd->driver)->check_bandwidth == (unsigned long )((int (*/* const */)(struct usb_hcd * , struct usb_device * ))0)) { return (0); } else { } if ((unsigned long )new_config == (unsigned long )((struct usb_host_config *)0) && (unsigned long )cur_alt == (unsigned long )((struct usb_host_interface *)0)) { i = 1; goto ldv_32579; ldv_32578: ep = udev->ep_out[i]; if ((unsigned long )ep != (unsigned long )((struct usb_host_endpoint *)0)) { (*((hcd->driver)->drop_endpoint))(hcd, udev, ep); } else { } ep = udev->ep_in[i]; if ((unsigned long )ep != (unsigned long )((struct usb_host_endpoint *)0)) { (*((hcd->driver)->drop_endpoint))(hcd, udev, ep); } else { } i = i + 1; ldv_32579: ; if (i <= 15) { goto ldv_32578; } else { } (*((hcd->driver)->check_bandwidth))(hcd, udev); return (0); } else { } if ((unsigned long )new_config != (unsigned long )((struct usb_host_config *)0)) { num_intfs = (int )new_config->desc.bNumInterfaces; i = 1; goto ldv_32583; ldv_32582: ep = udev->ep_out[i]; if ((unsigned long )ep != (unsigned long )((struct usb_host_endpoint *)0)) { ret = (*((hcd->driver)->drop_endpoint))(hcd, udev, ep); if (ret < 0) { goto reset; } else { } } else { } ep = udev->ep_in[i]; if ((unsigned long )ep != (unsigned long )((struct usb_host_endpoint *)0)) { ret = (*((hcd->driver)->drop_endpoint))(hcd, udev, ep); if (ret < 0) { goto reset; } else { } } else { } i = i + 1; ldv_32583: ; if (i <= 15) { goto ldv_32582; } else { } i = 0; goto ldv_32591; ldv_32590: first_alt = (struct usb_host_interface *)(& (new_config->intf_cache[i])->altsetting); iface_num = (int )first_alt->desc.bInterfaceNumber; alt = usb_find_alt_setting(new_config, (unsigned int )iface_num, 0U); if ((unsigned long )alt == (unsigned long )((struct usb_host_interface *)0)) { alt = first_alt; } else { } j = 0; goto ldv_32588; ldv_32587: ret = (*((hcd->driver)->add_endpoint))(hcd, udev, alt->endpoint + (unsigned long )j); if (ret < 0) { goto reset; } else { } j = j + 1; ldv_32588: ; if ((int )alt->desc.bNumEndpoints > j) { goto ldv_32587; } else { } i = i + 1; ldv_32591: ; if (i < num_intfs) { goto ldv_32590; } else { } } else { } if ((unsigned long )cur_alt != (unsigned long )((struct usb_host_interface *)0) && (unsigned long )new_alt != (unsigned long )((struct usb_host_interface *)0)) { tmp = usb_ifnum_to_if((struct usb_device const *)udev, (unsigned int )cur_alt->desc.bInterfaceNumber); iface = tmp; if ((unsigned long )iface == (unsigned long )((struct usb_interface *)0)) { return (-22); } else { } if ((unsigned int )*((unsigned char *)iface + 40UL) != 0U) { cur_alt = usb_altnum_to_altsetting((struct usb_interface const *)iface, 0U); if ((unsigned long )cur_alt == (unsigned long )((struct usb_host_interface *)0)) { cur_alt = iface->altsetting; } else { } } else { } i = 0; goto ldv_32595; ldv_32594: ret = (*((hcd->driver)->drop_endpoint))(hcd, udev, cur_alt->endpoint + (unsigned long )i); if (ret < 0) { goto reset; } else { } i = i + 1; ldv_32595: ; if ((int )cur_alt->desc.bNumEndpoints > i) { goto ldv_32594; } else { } i = 0; goto ldv_32598; ldv_32597: ret = (*((hcd->driver)->add_endpoint))(hcd, udev, new_alt->endpoint + (unsigned long )i); if (ret < 0) { goto reset; } else { } i = i + 1; ldv_32598: ; if ((int )new_alt->desc.bNumEndpoints > i) { goto ldv_32597; } else { } } else { } ret = (*((hcd->driver)->check_bandwidth))(hcd, udev); reset: ; if (ret < 0) { (*((hcd->driver)->reset_bandwidth))(hcd, udev); } else { } return (ret); } } void usb_hcd_disable_endpoint(struct usb_device *udev , struct usb_host_endpoint *ep ) { struct usb_hcd *hcd ; { __might_sleep("/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hcd.c.prepared", 1940, 0); hcd = bus_to_hcd(udev->bus); if ((unsigned long )(hcd->driver)->endpoint_disable != (unsigned long )((void (*/* const */)(struct usb_hcd * , struct usb_host_endpoint * ))0)) { (*((hcd->driver)->endpoint_disable))(hcd, ep); } else { } return; } } void usb_hcd_reset_endpoint(struct usb_device *udev , struct usb_host_endpoint *ep ) { struct usb_hcd *hcd ; struct usb_hcd *tmp ; int epnum ; int tmp___0 ; int is_out ; int tmp___1 ; int is_control ; int tmp___2 ; { tmp = bus_to_hcd(udev->bus); hcd = tmp; if ((unsigned long )(hcd->driver)->endpoint_reset != (unsigned long )((void (*/* const */)(struct usb_hcd * , struct usb_host_endpoint * ))0)) { (*((hcd->driver)->endpoint_reset))(hcd, ep); } else { tmp___0 = usb_endpoint_num((struct usb_endpoint_descriptor const *)(& ep->desc)); epnum = tmp___0; tmp___1 = usb_endpoint_dir_out((struct usb_endpoint_descriptor const *)(& ep->desc)); is_out = tmp___1; tmp___2 = usb_endpoint_xfer_control((struct usb_endpoint_descriptor const *)(& ep->desc)); is_control = tmp___2; udev->toggle[is_out] = udev->toggle[is_out] & (unsigned int )(~ (1 << epnum)); if (is_control != 0) { udev->toggle[is_out == 0] = udev->toggle[is_out == 0] & (unsigned int )(~ (1 << epnum)); } else { } } return; } } int usb_alloc_streams(struct usb_interface *interface , struct usb_host_endpoint **eps , unsigned int num_eps , unsigned int num_streams , gfp_t mem_flags ) { struct usb_hcd *hcd ; struct usb_device *dev ; int i ; int tmp ; int tmp___0 ; { dev = interface_to_usbdev(interface); hcd = bus_to_hcd(dev->bus); if ((unsigned long )(hcd->driver)->alloc_streams == (unsigned long )((int (*/* const */)(struct usb_hcd * , struct usb_device * , struct usb_host_endpoint ** , unsigned int , unsigned int , gfp_t ))0) || (unsigned long )(hcd->driver)->free_streams == (unsigned long )((int (*/* const */)(struct usb_hcd * , struct usb_device * , struct usb_host_endpoint ** , unsigned int , gfp_t ))0)) { return (-22); } else { } if ((unsigned int )dev->speed != 5U) { return (-22); } else { } i = 0; goto ldv_32624; ldv_32623: tmp = usb_endpoint_xfer_bulk((struct usb_endpoint_descriptor const *)(& (*(eps + (unsigned long )i))->desc)); if (tmp == 0) { return (-22); } else { } i = i + 1; ldv_32624: ; if ((unsigned int )i < num_eps) { goto ldv_32623; } else { } tmp___0 = (*((hcd->driver)->alloc_streams))(hcd, dev, eps, num_eps, num_streams, mem_flags); return (tmp___0); } } void usb_free_streams(struct usb_interface *interface , struct usb_host_endpoint **eps , unsigned int num_eps , gfp_t mem_flags ) { struct usb_hcd *hcd ; struct usb_device *dev ; int i ; int tmp ; { dev = interface_to_usbdev(interface); hcd = bus_to_hcd(dev->bus); if ((unsigned int )dev->speed != 5U) { return; } else { } i = 0; goto ldv_32646; ldv_32645: ; if ((unsigned long )*(eps + (unsigned long )i) == (unsigned long )((struct usb_host_endpoint *)0)) { return; } else { tmp = usb_endpoint_xfer_bulk((struct usb_endpoint_descriptor const *)(& (*(eps + (unsigned long )i))->desc)); if (tmp == 0) { return; } else { } } i = i + 1; ldv_32646: ; if ((unsigned int )i < num_eps) { goto ldv_32645; } else { } (*((hcd->driver)->free_streams))(hcd, dev, eps, num_eps, mem_flags); return; } } void usb_hcd_synchronize_unlinks(struct usb_device *udev ) { { spin_lock_irq(& hcd_urb_unlink_lock); spin_unlock_irq(& hcd_urb_unlink_lock); return; } } int usb_hcd_get_frame_number(struct usb_device *udev ) { struct usb_hcd *hcd ; struct usb_hcd *tmp ; int tmp___0 ; { tmp = bus_to_hcd(udev->bus); hcd = tmp; if ((hcd->flags & 32UL) == 0UL) { return (-108); } else { } tmp___0 = (*((hcd->driver)->get_frame_number))(hcd); return (tmp___0); } } int hcd_bus_suspend(struct usb_device *rhdev , pm_message_t msg ) { struct usb_hcd *hcd ; struct usb_bus const *__mptr ; int status ; int old_state ; struct _ddebug descriptor ; long tmp ; struct _ddebug descriptor___0 ; long tmp___0 ; char buffer[6U] ; struct _ddebug descriptor___1 ; long tmp___1 ; struct pm_message __constr_expr_0 ; struct _ddebug descriptor___2 ; long tmp___2 ; { __mptr = (struct usb_bus const *)rhdev->bus; hcd = (struct usb_hcd *)__mptr; old_state = hcd->state; descriptor.modname = "usbcore"; descriptor.function = "hcd_bus_suspend"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hcd.c.prepared"; descriptor.format = "bus %ssuspend, wakeup %d\n"; descriptor.lineno = 2076U; descriptor.flags = 1U; tmp = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)(& rhdev->dev), "bus %ssuspend, wakeup %d\n", (msg.event & 1024) != 0 ? (char *)"auto-" : (char *)"", (int )rhdev->do_remote_wakeup); } else { } if ((hcd->flags & 64UL) != 0UL) { descriptor___0.modname = "usbcore"; descriptor___0.function = "hcd_bus_suspend"; descriptor___0.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hcd.c.prepared"; descriptor___0.format = "skipped %s of dead bus\n"; descriptor___0.lineno = 2078U; descriptor___0.flags = 1U; tmp___0 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___0 != 0L) { __dynamic_dev_dbg(& descriptor___0, (struct device const *)(& rhdev->dev), "skipped %s of dead bus\n", (char *)"suspend"); } else { } return (0); } else { } if ((unsigned long )(hcd->driver)->bus_suspend == (unsigned long )((int (*/* const */)(struct usb_hcd * ))0)) { status = -2; } else { clear_bit(5, (unsigned long volatile *)(& hcd->flags)); hcd->state = 133; status = (*((hcd->driver)->bus_suspend))(hcd); } if (status == 0) { usb_set_device_state(rhdev, USB_STATE_SUSPENDED); hcd->state = 4; if ((unsigned int )*((unsigned char *)rhdev + 1680UL) != 0U) { status = (*((hcd->driver)->hub_status_data))(hcd, (char *)(& buffer)); if (status != 0) { descriptor___1.modname = "usbcore"; descriptor___1.function = "hcd_bus_suspend"; descriptor___1.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hcd.c.prepared"; descriptor___1.format = "suspend raced with wakeup event\n"; descriptor___1.lineno = 2099U; descriptor___1.flags = 1U; tmp___1 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); if (tmp___1 != 0L) { __dynamic_dev_dbg(& descriptor___1, (struct device const *)(& rhdev->dev), "suspend raced with wakeup event\n"); } else { } __constr_expr_0.event = 1040; hcd_bus_resume(rhdev, __constr_expr_0); status = -16; } else { } } else { } } else { spin_lock_irq(& hcd_root_hub_lock); if ((hcd->flags & 64UL) == 0UL) { set_bit(5U, (unsigned long volatile *)(& hcd->flags)); hcd->state = old_state; } else { } spin_unlock_irq(& hcd_root_hub_lock); descriptor___2.modname = "usbcore"; descriptor___2.function = "hcd_bus_suspend"; descriptor___2.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hcd.c.prepared"; descriptor___2.format = "bus %s fail, err %d\n"; descriptor___2.lineno = 2112U; descriptor___2.flags = 1U; tmp___2 = ldv__builtin_expect((long )descriptor___2.flags & 1L, 0L); if (tmp___2 != 0L) { __dynamic_dev_dbg(& descriptor___2, (struct device const *)(& rhdev->dev), "bus %s fail, err %d\n", (char *)"suspend", status); } else { } } return (status); } } int hcd_bus_resume(struct usb_device *rhdev , pm_message_t msg ) { struct usb_hcd *hcd ; struct usb_bus const *__mptr ; int status ; int old_state ; struct _ddebug descriptor ; long tmp ; struct _ddebug descriptor___0 ; long tmp___0 ; struct _ddebug descriptor___1 ; long tmp___1 ; { __mptr = (struct usb_bus const *)rhdev->bus; hcd = (struct usb_hcd *)__mptr; old_state = hcd->state; descriptor.modname = "usbcore"; descriptor.function = "hcd_bus_resume"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hcd.c.prepared"; descriptor.format = "usb %sresume\n"; descriptor.lineno = 2124U; descriptor.flags = 1U; tmp = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)(& rhdev->dev), "usb %sresume\n", (msg.event & 1024) != 0 ? (char *)"auto-" : (char *)""); } else { } if ((hcd->flags & 64UL) != 0UL) { descriptor___0.modname = "usbcore"; descriptor___0.function = "hcd_bus_resume"; descriptor___0.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hcd.c.prepared"; descriptor___0.format = "skipped %s of dead bus\n"; descriptor___0.lineno = 2126U; descriptor___0.flags = 1U; tmp___0 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___0 != 0L) { __dynamic_dev_dbg(& descriptor___0, (struct device const *)(& rhdev->dev), "skipped %s of dead bus\n", (char *)"resume"); } else { } return (0); } else { } if ((unsigned long )(hcd->driver)->bus_resume == (unsigned long )((int (*/* const */)(struct usb_hcd * ))0)) { return (-2); } else { } if ((hcd->flags & 32UL) != 0UL) { return (0); } else { } hcd->state = 132; status = (*((hcd->driver)->bus_resume))(hcd); clear_bit(4, (unsigned long volatile *)(& hcd->flags)); if (status == 0) { msleep(10U); spin_lock_irq(& hcd_root_hub_lock); if ((hcd->flags & 64UL) == 0UL) { usb_set_device_state(rhdev, (unsigned long )rhdev->actconfig != (unsigned long )((struct usb_host_config *)0) ? USB_STATE_CONFIGURED : USB_STATE_ADDRESS); set_bit(5U, (unsigned long volatile *)(& hcd->flags)); hcd->state = 1; } else { } spin_unlock_irq(& hcd_root_hub_lock); } else { hcd->state = old_state; descriptor___1.modname = "usbcore"; descriptor___1.function = "hcd_bus_resume"; descriptor___1.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hcd.c.prepared"; descriptor___1.format = "bus %s fail, err %d\n"; descriptor___1.lineno = 2152U; descriptor___1.flags = 1U; tmp___1 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); if (tmp___1 != 0L) { __dynamic_dev_dbg(& descriptor___1, (struct device const *)(& rhdev->dev), "bus %s fail, err %d\n", (char *)"resume", status); } else { } if (status != -108) { usb_hc_died(hcd); } else { } } return (status); } } static void hcd_resume_work(struct work_struct *work ) { struct usb_hcd *hcd ; struct work_struct const *__mptr ; struct usb_device *udev ; { __mptr = (struct work_struct const *)work; hcd = (struct usb_hcd *)__mptr + 0xfffffffffffffed0UL; udev = hcd->self.root_hub; device_lock___0(& udev->dev); usb_remote_wakeup(udev); device_unlock___0(& udev->dev); return; } } void usb_hcd_resume_root_hub(struct usb_hcd *hcd ) { unsigned long flags ; raw_spinlock_t *tmp ; { tmp = spinlock_check(& hcd_root_hub_lock); flags = _raw_spin_lock_irqsave(tmp); if ((unsigned int )*((unsigned char *)hcd + 408UL) != 0U) { set_bit(4U, (unsigned long volatile *)(& hcd->flags)); queue_work(pm_wq, & hcd->wakeup_work); } else { } spin_unlock_irqrestore(& hcd_root_hub_lock, flags); return; } } int usb_bus_start_enum(struct usb_bus *bus , unsigned int port_num ) { struct usb_hcd *hcd ; int status ; struct usb_bus const *__mptr ; unsigned long tmp ; { status = -95; __mptr = (struct usb_bus const *)bus; hcd = (struct usb_hcd *)__mptr; if (port_num != 0U && (unsigned long )(hcd->driver)->start_port_reset != (unsigned long )((int (*/* const */)(struct usb_hcd * , unsigned int ))0)) { status = (*((hcd->driver)->start_port_reset))(hcd, port_num); } else { } if (status == 0) { tmp = msecs_to_jiffies(10U); mod_timer(& hcd->rh_timer, tmp + (unsigned long )jiffies); } else { } return (status); } } irqreturn_t usb_hcd_irq(int irq , void *__hcd ) { struct usb_hcd *hcd ; unsigned long flags ; irqreturn_t rc ; irqreturn_t tmp ; long tmp___0 ; long tmp___1 ; int tmp___2 ; { hcd = (struct usb_hcd *)__hcd; flags = arch_local_irq_save(); trace_hardirqs_off(); tmp___0 = ldv__builtin_expect((hcd->flags & 64UL) != 0UL, 0L); if (tmp___0 != 0L) { rc = IRQ_NONE; } else { tmp___1 = ldv__builtin_expect((hcd->flags & 1UL) == 0UL, 0L); if (tmp___1 != 0L) { rc = IRQ_NONE; } else { tmp = (*((hcd->driver)->irq))(hcd); if ((unsigned int )tmp == 0U) { rc = IRQ_NONE; } else { rc = IRQ_HANDLED; } } } tmp___2 = arch_irqs_disabled_flags(flags); if (tmp___2 != 0) { arch_local_irq_restore(flags); trace_hardirqs_off(); } else { trace_hardirqs_on(); arch_local_irq_restore(flags); } return (rc); } } void usb_hc_died(struct usb_hcd *hcd ) { unsigned long flags ; raw_spinlock_t *tmp ; int tmp___0 ; { dev_err((struct device const *)hcd->self.controller, "HC died; cleaning up\n"); tmp = spinlock_check(& hcd_root_hub_lock); flags = _raw_spin_lock_irqsave(tmp); clear_bit(5, (unsigned long volatile *)(& hcd->flags)); set_bit(6U, (unsigned long volatile *)(& hcd->flags)); if ((unsigned int )*((unsigned char *)hcd + 408UL) != 0U) { clear_bit(2, (unsigned long volatile *)(& hcd->flags)); usb_set_device_state(hcd->self.root_hub, USB_STATE_NOTATTACHED); usb_kick_khubd(hcd->self.root_hub); } else { } tmp___0 = usb_hcd_is_primary_hcd(hcd); if (tmp___0 != 0 && (unsigned long )hcd->shared_hcd != (unsigned long )((struct usb_hcd *)0)) { hcd = hcd->shared_hcd; if ((unsigned int )*((unsigned char *)hcd + 408UL) != 0U) { clear_bit(2, (unsigned long volatile *)(& hcd->flags)); usb_set_device_state(hcd->self.root_hub, USB_STATE_NOTATTACHED); usb_kick_khubd(hcd->self.root_hub); } else { } } else { } spin_unlock_irqrestore(& hcd_root_hub_lock, flags); return; } } struct usb_hcd *usb_create_shared_hcd(struct hc_driver const *driver , struct device *dev , char const *bus_name , struct usb_hcd *primary_hcd ) { struct usb_hcd *hcd ; void *tmp ; struct _ddebug descriptor ; long tmp___0 ; void *tmp___1 ; struct _ddebug descriptor___0 ; long tmp___2 ; struct lock_class_key __key ; struct lock_class_key __key___0 ; struct lock_class_key __key___1 ; atomic_long_t __constr_expr_0 ; { tmp = kzalloc((unsigned long )driver->hcd_priv_size + 512UL, 208U); hcd = (struct usb_hcd *)tmp; if ((unsigned long )hcd == (unsigned long )((struct usb_hcd *)0)) { descriptor.modname = "usbcore"; descriptor.function = "usb_create_shared_hcd"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hcd.c.prepared"; descriptor.format = "hcd alloc failed\n"; descriptor.lineno = 2341U; descriptor.flags = 1U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)dev, "hcd alloc failed\n"); } else { } return (0); } else { } if ((unsigned long )primary_hcd == (unsigned long )((struct usb_hcd *)0)) { tmp___1 = kmalloc(168UL, 208U); hcd->bandwidth_mutex = (struct mutex *)tmp___1; if ((unsigned long )hcd->bandwidth_mutex == (unsigned long )((struct mutex *)0)) { kfree((void const *)hcd); descriptor___0.modname = "usbcore"; descriptor___0.function = "usb_create_shared_hcd"; descriptor___0.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hcd.c.prepared"; descriptor___0.format = "hcd bandwidth mutex alloc failed\n"; descriptor___0.lineno = 2349U; descriptor___0.flags = 1U; tmp___2 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___2 != 0L) { __dynamic_dev_dbg(& descriptor___0, (struct device const *)dev, "hcd bandwidth mutex alloc failed\n"); } else { } return (0); } else { } __mutex_init(hcd->bandwidth_mutex, "hcd->bandwidth_mutex", & __key); dev_set_drvdata(dev, (void *)hcd); } else { hcd->bandwidth_mutex = primary_hcd->bandwidth_mutex; hcd->primary_hcd = primary_hcd; primary_hcd->primary_hcd = primary_hcd; hcd->shared_hcd = primary_hcd; primary_hcd->shared_hcd = hcd; } kref_init(& hcd->kref); usb_bus_init(& hcd->self); hcd->self.controller = dev; hcd->self.bus_name = bus_name; hcd->self.uses_dma = (unsigned long )dev->dma_mask != (unsigned long )((u64 *)0); init_timer_key(& hcd->rh_timer, 0U, "(&hcd->rh_timer)", & __key___0); hcd->rh_timer.function = & rh_timer_func; hcd->rh_timer.data = (unsigned long )hcd; __init_work(& hcd->wakeup_work, 0); __constr_expr_0.counter = 4195328L; hcd->wakeup_work.data = __constr_expr_0; lockdep_init_map(& hcd->wakeup_work.lockdep_map, "(&hcd->wakeup_work)", & __key___1, 0); INIT_LIST_HEAD(& hcd->wakeup_work.entry); hcd->wakeup_work.func = & hcd_resume_work; hcd->driver = driver; hcd->speed = (int )driver->flags & 112; hcd->product_desc = (unsigned long )driver->product_desc != (unsigned long )((char const */* const */)0) ? driver->product_desc : (char const */* const */)"USB Host Controller"; return (hcd); } } struct usb_hcd *usb_create_hcd(struct hc_driver const *driver , struct device *dev , char const *bus_name ) { struct usb_hcd *tmp ; { tmp = usb_create_shared_hcd(driver, dev, bus_name, 0); return (tmp); } } static void hcd_release(struct kref *kref ) { struct usb_hcd *hcd ; struct kref const *__mptr ; int tmp ; { __mptr = (struct kref const *)kref; hcd = (struct usb_hcd *)__mptr + 0xffffffffffffff88UL; tmp = usb_hcd_is_primary_hcd(hcd); if (tmp != 0) { kfree((void const *)hcd->bandwidth_mutex); } else { (hcd->shared_hcd)->shared_hcd = 0; } kfree((void const *)hcd); return; } } struct usb_hcd *usb_get_hcd(struct usb_hcd *hcd ) { { if ((unsigned long )hcd != (unsigned long )((struct usb_hcd *)0)) { kref_get(& hcd->kref); } else { } return (hcd); } } void usb_put_hcd(struct usb_hcd *hcd ) { { if ((unsigned long )hcd != (unsigned long )((struct usb_hcd *)0)) { kref_put(& hcd->kref, & hcd_release); } else { } return; } } int usb_hcd_is_primary_hcd(struct usb_hcd *hcd ) { { if ((unsigned long )hcd->primary_hcd == (unsigned long )((struct usb_hcd *)0)) { return (1); } else { } return ((unsigned long )hcd->primary_hcd == (unsigned long )hcd); } } static int usb_hcd_request_irqs(struct usb_hcd *hcd , unsigned int irqnum , unsigned long irqflags ) { int retval ; { if ((unsigned long )(hcd->driver)->irq != (unsigned long )((irqreturn_t (*/* const */)(struct usb_hcd * ))0)) { if ((irqflags & 128UL) != 0UL) { irqflags = irqflags & 0xffffffffffffffdfUL; } else { } snprintf((char *)(& hcd->irq_descr), 24UL, "%s:usb%d", (hcd->driver)->description, hcd->self.busnum); retval = request_irq(irqnum, & usb_hcd_irq, irqflags, (char const *)(& hcd->irq_descr), (void *)hcd); if (retval != 0) { dev_err((struct device const *)hcd->self.controller, "request interrupt %d failed\n", irqnum); return (retval); } else { } hcd->irq = irqnum; _dev_info((struct device const *)hcd->self.controller, "irq %d, %s 0x%08llx\n", irqnum, (int )(hcd->driver)->flags & 1 ? (char *)"io mem" : (char *)"io base", hcd->rsrc_start); } else { hcd->irq = 0U; if (hcd->rsrc_start != 0ULL) { _dev_info((struct device const *)hcd->self.controller, "%s 0x%08llx\n", (int )(hcd->driver)->flags & 1 ? (char *)"io mem" : (char *)"io base", hcd->rsrc_start); } else { } } return (0); } } int usb_add_hcd(struct usb_hcd *hcd , unsigned int irqnum , unsigned long irqflags ) { int retval ; struct usb_device *rhdev ; struct _ddebug descriptor ; long tmp ; struct _ddebug descriptor___0 ; long tmp___0 ; bool tmp___1 ; bool tmp___2 ; int tmp___3 ; unsigned int _min1 ; unsigned int _min2 ; int tmp___4 ; { _dev_info((struct device const *)hcd->self.controller, "%s\n", hcd->product_desc); if (authorized_default < 0 || authorized_default > 1) { hcd->authorized_default = (unsigned int )*((unsigned char *)hcd + 408UL) == 0U; } else { hcd->authorized_default = (unsigned char )authorized_default; } set_bit(0U, (unsigned long volatile *)(& hcd->flags)); retval = hcd_buffer_create(hcd); if (retval != 0) { descriptor.modname = "usbcore"; descriptor.function = "usb_add_hcd"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hcd.c.prepared"; descriptor.format = "pool alloc failed\n"; descriptor.lineno = 2518U; descriptor.flags = 1U; tmp = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)hcd->self.controller, "pool alloc failed\n"); } else { } return (retval); } else { } retval = usb_register_bus(& hcd->self); if (retval < 0) { goto err_register_bus; } else { } rhdev = usb_alloc_dev(0, & hcd->self, 0U); if ((unsigned long )rhdev == (unsigned long )((struct usb_device *)0)) { dev_err((struct device const *)hcd->self.controller, "unable to allocate root hub\n"); retval = -12; goto err_allocate_root_hub; } else { } hcd->self.root_hub = rhdev; switch (hcd->speed) { case 16: rhdev->speed = USB_SPEED_FULL; goto ldv_32855; case 32: rhdev->speed = USB_SPEED_HIGH; goto ldv_32855; case 64: rhdev->speed = USB_SPEED_SUPER; goto ldv_32855; default: retval = -22; goto err_set_rh_speed; } ldv_32855: device_set_wakeup_capable(& rhdev->dev, 1); set_bit(5U, (unsigned long volatile *)(& hcd->flags)); if ((unsigned long )(hcd->driver)->reset != (unsigned long )((int (*/* const */)(struct usb_hcd * ))0)) { retval = (*((hcd->driver)->reset))(hcd); if (retval < 0) { dev_err((struct device const *)hcd->self.controller, "can\'t setup\n"); goto err_hcd_driver_setup; } else { } } else { } hcd->rh_pollable = 1U; tmp___1 = device_can_wakeup(hcd->self.controller); if ((int )tmp___1) { tmp___2 = device_can_wakeup(& (hcd->self.root_hub)->dev); if ((int )tmp___2) { descriptor___0.modname = "usbcore"; descriptor___0.function = "usb_add_hcd"; descriptor___0.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hcd.c.prepared"; descriptor___0.format = "supports USB remote wakeup\n"; descriptor___0.lineno = 2571U; descriptor___0.flags = 1U; tmp___0 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___0 != 0L) { __dynamic_dev_dbg(& descriptor___0, (struct device const *)hcd->self.controller, "supports USB remote wakeup\n"); } else { } } else { } } else { } tmp___3 = usb_hcd_is_primary_hcd(hcd); if (tmp___3 != 0 && irqnum != 0U) { retval = usb_hcd_request_irqs(hcd, irqnum, irqflags); if (retval != 0) { goto err_request_irq; } else { } } else { } hcd->state = 1; retval = (*((hcd->driver)->start))(hcd); if (retval < 0) { dev_err((struct device const *)hcd->self.controller, "startup error %d\n", retval); goto err_hcd_driver_start; } else { } _min1 = 500U; _min2 = hcd->power_budget; rhdev->bus_mA = (unsigned short )(_min1 < _min2 ? _min1 : _min2); retval = register_root_hub(hcd); if (retval != 0) { goto err_register_root_hub; } else { } retval = sysfs_create_group(& rhdev->dev.kobj, (struct attribute_group const *)(& usb_bus_attr_group)); if (retval < 0) { printk("\vCannot register USB bus sysfs attributes: %d\n", retval); goto error_create_attr_group; } else { } if ((unsigned int )*((unsigned char *)hcd + 408UL) != 0U && (hcd->flags & 4UL) != 0UL) { usb_hcd_poll_rh_status(hcd); } else { } device_wakeup_enable(hcd->self.controller); return (retval); error_create_attr_group: clear_bit(5, (unsigned long volatile *)(& hcd->flags)); if (hcd->state & 1) { hcd->state = 133; } else { } spin_lock_irq(& hcd_root_hub_lock); hcd->rh_registered = 0U; spin_unlock_irq(& hcd_root_hub_lock); cancel_work_sync(& hcd->wakeup_work); ldv_mutex_lock_93(& usb_bus_list_lock); usb_disconnect(& rhdev); ldv_mutex_unlock_94(& usb_bus_list_lock); err_register_root_hub: hcd->rh_pollable = 0U; clear_bit(2, (unsigned long volatile *)(& hcd->flags)); del_timer_sync(& hcd->rh_timer); (*((hcd->driver)->stop))(hcd); hcd->state = 0; clear_bit(2, (unsigned long volatile *)(& hcd->flags)); del_timer_sync(& hcd->rh_timer); err_hcd_driver_start: tmp___4 = usb_hcd_is_primary_hcd(hcd); if (tmp___4 != 0 && hcd->irq != 0U) { free_irq(irqnum, (void *)hcd); } else { } err_request_irq: ; err_hcd_driver_setup: ; err_set_rh_speed: usb_put_dev(hcd->self.root_hub); err_allocate_root_hub: usb_deregister_bus(& hcd->self); err_register_bus: hcd_buffer_destroy(hcd); return (retval); } } void usb_remove_hcd(struct usb_hcd *hcd ) { struct usb_device *rhdev ; struct _ddebug descriptor ; long tmp ; int tmp___0 ; { rhdev = hcd->self.root_hub; _dev_info((struct device const *)hcd->self.controller, "remove, state %x\n", hcd->state); usb_get_dev(rhdev); sysfs_remove_group(& rhdev->dev.kobj, (struct attribute_group const *)(& usb_bus_attr_group)); clear_bit(5, (unsigned long volatile *)(& hcd->flags)); if (hcd->state & 1) { hcd->state = 133; } else { } descriptor.modname = "usbcore"; descriptor.function = "usb_remove_hcd"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hcd.c.prepared"; descriptor.format = "roothub graceful disconnect\n"; descriptor.lineno = 2669U; descriptor.flags = 1U; tmp = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)hcd->self.controller, "roothub graceful disconnect\n"); } else { } spin_lock_irq(& hcd_root_hub_lock); hcd->rh_registered = 0U; spin_unlock_irq(& hcd_root_hub_lock); cancel_work_sync(& hcd->wakeup_work); ldv_mutex_lock_95(& usb_bus_list_lock); usb_disconnect(& rhdev); ldv_mutex_unlock_96(& usb_bus_list_lock); hcd->rh_pollable = 0U; clear_bit(2, (unsigned long volatile *)(& hcd->flags)); del_timer_sync(& hcd->rh_timer); (*((hcd->driver)->stop))(hcd); hcd->state = 0; clear_bit(2, (unsigned long volatile *)(& hcd->flags)); del_timer_sync(& hcd->rh_timer); tmp___0 = usb_hcd_is_primary_hcd(hcd); if (tmp___0 != 0) { if (hcd->irq != 0U) { free_irq(hcd->irq, (void *)hcd); } else { } } else { } usb_put_dev(hcd->self.root_hub); usb_deregister_bus(& hcd->self); hcd_buffer_destroy(hcd); return; } } void usb_hcd_platform_shutdown(struct platform_device *dev ) { struct usb_hcd *hcd ; void *tmp ; { tmp = platform_get_drvdata((struct platform_device const *)dev); hcd = (struct usb_hcd *)tmp; if ((unsigned long )(hcd->driver)->shutdown != (unsigned long )((void (*/* const */)(struct usb_hcd * ))0)) { (*((hcd->driver)->shutdown))(hcd); } else { } return; } } int usb_mon_register(struct usb_mon_operations *ops ) { { if ((unsigned long )mon_ops != (unsigned long )((struct usb_mon_operations *)0)) { return (-16); } else { } mon_ops = ops; __asm__ volatile ("mfence": : : "memory"); return (0); } } void usb_mon_deregister(void) { { if ((unsigned long )mon_ops == (unsigned long )((struct usb_mon_operations *)0)) { printk("\vUSB: monitor was not registered\n"); return; } else { } mon_ops = 0; __asm__ volatile ("mfence": : : "memory"); return; } } void ldv_main2_sequence_infinite_withcheck_stateful(void) { int var_usb_hcd_irq_43_p0 ; void *var_usb_hcd_irq_43_p1 ; unsigned long var_rh_timer_func_5_p0 ; int tmp ; int tmp___0 ; { LDV_IN_INTERRUPT = 1; ldv_initialize(); goto ldv_32941; ldv_32940: tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: LDV_IN_INTERRUPT = 2; ldv_handler_precall(); usb_hcd_irq(var_usb_hcd_irq_43_p0, var_usb_hcd_irq_43_p1); LDV_IN_INTERRUPT = 1; goto ldv_32937; case 1: ldv_handler_precall(); rh_timer_func(var_rh_timer_func_5_p0); goto ldv_32937; default: ; goto ldv_32937; } ldv_32937: ; ldv_32941: tmp___0 = __VERIFIER_nondet_int(); if (tmp___0 != 0) { goto ldv_32940; } else { } ldv_check_final_state(); return; } } void ldv_mutex_lock_73(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_74(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_75(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_76(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_77(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_78(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___4 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_79(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_80(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mtx(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_81(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mtx(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_82(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mtx(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_83(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mtx(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_84(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_usb_bus_list_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_85(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_usb_bus_list_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_86(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_usb_bus_list_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_87(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_usb_bus_list_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_88(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_usb_bus_list_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_89(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_usb_bus_list_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_90(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_usb_bus_list_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_91(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_usb_bus_list_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_92(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_usb_bus_list_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_93(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_usb_bus_list_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_94(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_usb_bus_list_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_95(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_usb_bus_list_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_96(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_usb_bus_list_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } __inline static int fls(int x ) { int r ; { __asm__ ("bsrl %1,%0": "=r" (r): "rm" (x), "0" (-1)); return (r + 1); } } __inline static int __ilog2_u32(u32 n ) { int tmp ; { tmp = fls((int )n); return (tmp + -1); } } extern void warn_slowpath_fmt(char const * , int const , char const * , ...) ; int ldv_mutex_trylock_124(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_122(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_125(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_127(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_129(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_131(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_121(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_123(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_126(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_128(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_130(struct mutex *ldv_func_arg1 ) ; extern char const *dev_driver_string(struct device const * ) ; extern long schedule_timeout(long ) ; void usb_init_urb(struct urb *urb ) ; int usb_unlink_urb(struct urb *urb ) ; void usb_poison_urb(struct urb *urb ) ; void usb_unpoison_urb(struct urb *urb ) ; void usb_block_urb(struct urb *urb ) ; void usb_kill_anchored_urbs(struct usb_anchor *anchor ) ; void usb_poison_anchored_urbs(struct usb_anchor *anchor ) ; void usb_unpoison_anchored_urbs(struct usb_anchor *anchor ) ; void usb_unlink_anchored_urbs(struct usb_anchor *anchor ) ; void usb_anchor_urb(struct urb *urb , struct usb_anchor *anchor ) ; int usb_wait_anchor_empty_timeout(struct usb_anchor *anchor , unsigned int timeout ) ; struct urb *usb_get_from_anchor(struct usb_anchor *anchor ) ; void usb_scuttle_anchored_urbs(struct usb_anchor *anchor ) ; int usb_anchor_empty(struct usb_anchor *anchor ) ; __inline static struct usb_host_endpoint *usb_pipe_endpoint(struct usb_device *dev , unsigned int pipe ) { struct usb_host_endpoint **eps ; { eps = (pipe & 128U) != 0U ? (struct usb_host_endpoint **)(& dev->ep_in) : (struct usb_host_endpoint **)(& dev->ep_out); return (*(eps + ((unsigned long )(pipe >> 15) & 15UL))); } } static void urb_destroy(struct kref *kref ) { struct urb *urb ; struct kref const *__mptr ; { __mptr = (struct kref const *)kref; urb = (struct urb *)__mptr; if ((urb->transfer_flags & 256U) != 0U) { kfree((void const *)urb->transfer_buffer); } else { } kfree((void const *)urb); return; } } void usb_init_urb(struct urb *urb ) { { if ((unsigned long )urb != (unsigned long )((struct urb *)0)) { memset((void *)urb, 0, 192UL); kref_init(& urb->kref); INIT_LIST_HEAD(& urb->anchor_list); } else { } return; } } struct urb *usb_alloc_urb(int iso_packets , gfp_t mem_flags ) { struct urb *urb ; void *tmp ; { tmp = kmalloc(((unsigned long )iso_packets + 12UL) * 16UL, mem_flags); urb = (struct urb *)tmp; if ((unsigned long )urb == (unsigned long )((struct urb *)0)) { printk("\valloc_urb: kmalloc failed\n"); return (0); } else { } usb_init_urb(urb); return (urb); } } void usb_free_urb(struct urb *urb ) { { if ((unsigned long )urb != (unsigned long )((struct urb *)0)) { kref_put(& urb->kref, & urb_destroy); } else { } return; } } struct urb *usb_get_urb(struct urb *urb ) { { if ((unsigned long )urb != (unsigned long )((struct urb *)0)) { kref_get(& urb->kref); } else { } return (urb); } } void usb_anchor_urb(struct urb *urb , struct usb_anchor *anchor ) { unsigned long flags ; raw_spinlock_t *tmp ; long tmp___0 ; { tmp = spinlock_check(& anchor->lock); flags = _raw_spin_lock_irqsave(tmp); usb_get_urb(urb); list_add_tail(& urb->anchor_list, & anchor->urb_list); urb->anchor = anchor; tmp___0 = ldv__builtin_expect((long )*((unsigned char *)anchor + 176UL) & 1L, 0L); if (tmp___0 != 0L) { atomic_inc(& urb->reject); } else { } spin_unlock_irqrestore(& anchor->lock, flags); return; } } static void __usb_unanchor_urb(struct urb *urb , struct usb_anchor *anchor ) { int tmp ; { urb->anchor = 0; list_del(& urb->anchor_list); usb_free_urb(urb); tmp = list_empty((struct list_head const *)(& anchor->urb_list)); if (tmp != 0) { __wake_up(& anchor->wait, 3U, 1, 0); } else { } return; } } void usb_unanchor_urb(struct urb *urb ) { unsigned long flags ; struct usb_anchor *anchor ; raw_spinlock_t *tmp ; long tmp___0 ; { if ((unsigned long )urb == (unsigned long )((struct urb *)0)) { return; } else { } anchor = urb->anchor; if ((unsigned long )anchor == (unsigned long )((struct usb_anchor *)0)) { return; } else { } tmp = spinlock_check(& anchor->lock); flags = _raw_spin_lock_irqsave(tmp); tmp___0 = ldv__builtin_expect((unsigned long )urb->anchor == (unsigned long )anchor, 1L); if (tmp___0 != 0L) { __usb_unanchor_urb(urb, anchor); } else { } spin_unlock_irqrestore(& anchor->lock, flags); return; } } int usb_submit_urb(struct urb *urb , gfp_t mem_flags ) { int xfertype ; int max ; struct usb_device *dev ; struct usb_host_endpoint *ep ; int is_out ; struct usb_ctrlrequest *setup ; struct _ddebug descriptor ; int tmp ; long tmp___0 ; int n ; int len ; int burst ; int mult ; int mult___0 ; unsigned int allowed ; int pipetypes[4U] ; int __ret_warn_on ; char const *tmp___1 ; long tmp___2 ; int __ret_warn_on___0 ; char const *tmp___3 ; long tmp___4 ; int _min1 ; int _min2 ; int tmp___5 ; int tmp___6 ; { if (((unsigned long )urb == (unsigned long )((struct urb *)0) || (unsigned long )urb->hcpriv != (unsigned long )((void *)0)) || (unsigned long )urb->complete == (unsigned long )((void (*)(struct urb * ))0)) { return (-22); } else { } dev = urb->dev; if ((unsigned long )dev == (unsigned long )((struct usb_device *)0) || (unsigned int )dev->state <= 3U) { return (-19); } else { } ep = usb_pipe_endpoint(dev, urb->pipe); if ((unsigned long )ep == (unsigned long )((struct usb_host_endpoint *)0)) { return (-2); } else { } urb->ep = ep; urb->status = -115; urb->actual_length = 0U; xfertype = usb_endpoint_type((struct usb_endpoint_descriptor const *)(& ep->desc)); if (xfertype == 0) { setup = (struct usb_ctrlrequest *)urb->setup_packet; if ((unsigned long )setup == (unsigned long )((struct usb_ctrlrequest *)0)) { return (-8); } else { } is_out = (int )((signed char )setup->bRequestType) >= 0 || (unsigned int )setup->wLength == 0U; } else { is_out = usb_endpoint_dir_out((struct usb_endpoint_descriptor const *)(& ep->desc)); } urb->transfer_flags = urb->transfer_flags & 4286643711U; urb->transfer_flags = urb->transfer_flags | (is_out != 0 ? 0U : 512U); if (xfertype != 0 && (unsigned int )dev->state <= 6U) { return (-19); } else { } max = usb_endpoint_maxp((struct usb_endpoint_descriptor const *)(& ep->desc)); if (max <= 0) { descriptor.modname = "usbcore"; descriptor.function = "usb_submit_urb"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/urb.c.prepared"; descriptor.format = "bogus endpoint ep%d%s in %s (bad maxpacket %d)\n"; descriptor.lineno = 453U; descriptor.flags = 1U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = usb_endpoint_num((struct usb_endpoint_descriptor const *)(& ep->desc)); __dynamic_dev_dbg(& descriptor, (struct device const *)(& dev->dev), "bogus endpoint ep%d%s in %s (bad maxpacket %d)\n", tmp, is_out != 0 ? (char *)"out" : (char *)"in", "usb_submit_urb", max); } else { } return (-90); } else { } if (xfertype == 1) { if ((unsigned int )dev->speed == 5U) { burst = (int )ep->ss_ep_comp.bMaxBurst + 1; mult = ((int )ep->ss_ep_comp.bmAttributes & 3) + 1; max = max * burst; max = max * mult; } else { } if ((unsigned int )dev->speed == 3U) { mult___0 = ((max >> 11) & 3) + 1; max = max & 2047; max = max * mult___0; } else { } if (urb->number_of_packets <= 0) { return (-22); } else { } n = 0; goto ldv_25355; ldv_25354: len = (int )urb->iso_frame_desc[n].length; if (len < 0 || len > max) { return (-90); } else { } urb->iso_frame_desc[n].status = -18; urb->iso_frame_desc[n].actual_length = 0U; n = n + 1; ldv_25355: ; if (urb->number_of_packets > n) { goto ldv_25354; } else { } } else { } if ((int )urb->transfer_buffer_length < 0) { return (-90); } else { } pipetypes[0] = 2; pipetypes[1] = 0; pipetypes[2] = 3; pipetypes[3] = 1; if (urb->pipe >> 30 != (unsigned int )pipetypes[xfertype]) { __ret_warn_on = 1; tmp___2 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___2 != 0L) { tmp___1 = dev_driver_string((struct device const *)(& dev->dev)); warn_slowpath_fmt("/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/urb.c.prepared", 509, "Device: %s\nBOGUS urb xfer, pipe %x != type %x\n", tmp___1, urb->pipe >> 30, pipetypes[xfertype]); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); } else { } allowed = 900U; switch (xfertype) { case 2: ; if (is_out != 0) { allowed = allowed | 64U; } else { } case 0: allowed = allowed | 32U; default: ; if (is_out == 0) { allowed = allowed | 1U; } else { } goto ldv_25364; case 1: allowed = allowed | 2U; goto ldv_25364; } ldv_25364: allowed = urb->transfer_flags & allowed; if (urb->transfer_flags != allowed) { __ret_warn_on___0 = 1; tmp___4 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___4 != 0L) { tmp___3 = dev_driver_string((struct device const *)(& dev->dev)); warn_slowpath_fmt("/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/urb.c.prepared", 535, "Device: %s\nBOGUS urb flags, %x --> %x\n", tmp___3, urb->transfer_flags, allowed); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); } else { } switch (xfertype) { case 1: ; case 3: ; switch ((unsigned int )dev->speed) { case 4U: ; if (urb->interval <= 5) { return (-22); } else { } goto ldv_25371; default: ; if (urb->interval <= 0) { return (-22); } else { } goto ldv_25371; } ldv_25371: ; switch ((unsigned int )dev->speed) { case 5U: ; if (urb->interval > 32768) { return (-22); } else { } max = 32768; goto ldv_25374; case 4U: ; if (urb->interval > 16) { return (-22); } else { } goto ldv_25374; case 3U: ; if (urb->interval > 8192) { urb->interval = 8192; } else { } max = 8192; goto ldv_25374; case 2U: ; case 1U: ; if (xfertype == 3) { if (urb->interval > 255) { return (-22); } else { } max = 128; } else { if (urb->interval > 1024) { urb->interval = 1024; } else { } max = 1024; } goto ldv_25374; default: ; return (-22); } ldv_25374: ; if ((unsigned int )dev->speed != 4U) { _min1 = max; tmp___5 = __ilog2_u32((u32 )urb->interval); _min2 = 1 << tmp___5; urb->interval = _min1 < _min2 ? _min1 : _min2; } else { } } tmp___6 = usb_hcd_submit_urb(urb, mem_flags); return (tmp___6); } } int usb_unlink_urb(struct urb *urb ) { int tmp ; { if ((unsigned long )urb == (unsigned long )((struct urb *)0)) { return (-22); } else { } if ((unsigned long )urb->dev == (unsigned long )((struct usb_device *)0)) { return (-19); } else { } if ((unsigned long )urb->ep == (unsigned long )((struct usb_host_endpoint *)0)) { return (-43); } else { } tmp = usb_hcd_unlink_urb(urb, -104); return (tmp); } } void usb_kill_urb(struct urb *urb ) { int tmp ; wait_queue_t __wait ; struct task_struct *tmp___0 ; int tmp___1 ; { __might_sleep("/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/urb.c.prepared", 718, 0); if (((unsigned long )urb == (unsigned long )((struct urb *)0) || (unsigned long )urb->dev == (unsigned long )((struct usb_device *)0)) || (unsigned long )urb->ep == (unsigned long )((struct usb_host_endpoint *)0)) { return; } else { } atomic_inc(& urb->reject); usb_hcd_unlink_urb(urb, -2); tmp = atomic_read((atomic_t const *)(& urb->use_count)); if (tmp == 0) { goto ldv_25402; } else { } tmp___0 = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp___0; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; ldv_25405: prepare_to_wait(& usb_kill_urb_queue, & __wait, 2); tmp___1 = atomic_read((atomic_t const *)(& urb->use_count)); if (tmp___1 == 0) { goto ldv_25404; } else { } schedule(); goto ldv_25405; ldv_25404: finish_wait(& usb_kill_urb_queue, & __wait); ldv_25402: atomic_dec(& urb->reject); return; } } void usb_poison_urb(struct urb *urb ) { int tmp ; wait_queue_t __wait ; struct task_struct *tmp___0 ; int tmp___1 ; { __might_sleep("/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/urb.c.prepared", 759, 0); if (((unsigned long )urb == (unsigned long )((struct urb *)0) || (unsigned long )urb->dev == (unsigned long )((struct usb_device *)0)) || (unsigned long )urb->ep == (unsigned long )((struct usb_host_endpoint *)0)) { return; } else { } atomic_inc(& urb->reject); usb_hcd_unlink_urb(urb, -2); tmp = atomic_read((atomic_t const *)(& urb->use_count)); if (tmp == 0) { goto ldv_25415; } else { } tmp___0 = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp___0; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; ldv_25418: prepare_to_wait(& usb_kill_urb_queue, & __wait, 2); tmp___1 = atomic_read((atomic_t const *)(& urb->use_count)); if (tmp___1 == 0) { goto ldv_25417; } else { } schedule(); goto ldv_25418; ldv_25417: finish_wait(& usb_kill_urb_queue, & __wait); ldv_25415: ; return; } } void usb_unpoison_urb(struct urb *urb ) { { if ((unsigned long )urb == (unsigned long )((struct urb *)0)) { return; } else { } atomic_dec(& urb->reject); return; } } void usb_block_urb(struct urb *urb ) { { if ((unsigned long )urb == (unsigned long )((struct urb *)0)) { return; } else { } atomic_inc(& urb->reject); return; } } void usb_kill_anchored_urbs(struct usb_anchor *anchor ) { struct urb *victim ; struct list_head const *__mptr ; int tmp ; { spin_lock_irq(& anchor->lock); goto ldv_25450; ldv_25449: __mptr = (struct list_head const *)anchor->urb_list.prev; victim = (struct urb *)__mptr + 0xffffffffffffffd0UL; usb_get_urb(victim); spin_unlock_irq(& anchor->lock); usb_kill_urb(victim); usb_free_urb(victim); spin_lock_irq(& anchor->lock); ldv_25450: tmp = list_empty((struct list_head const *)(& anchor->urb_list)); if (tmp == 0) { goto ldv_25449; } else { } spin_unlock_irq(& anchor->lock); return; } } void usb_poison_anchored_urbs(struct usb_anchor *anchor ) { struct urb *victim ; struct list_head const *__mptr ; int tmp ; { spin_lock_irq(& anchor->lock); anchor->poisoned = 1U; goto ldv_25465; ldv_25464: __mptr = (struct list_head const *)anchor->urb_list.prev; victim = (struct urb *)__mptr + 0xffffffffffffffd0UL; usb_get_urb(victim); spin_unlock_irq(& anchor->lock); usb_poison_urb(victim); usb_free_urb(victim); spin_lock_irq(& anchor->lock); ldv_25465: tmp = list_empty((struct list_head const *)(& anchor->urb_list)); if (tmp == 0) { goto ldv_25464; } else { } spin_unlock_irq(& anchor->lock); return; } } void usb_unpoison_anchored_urbs(struct usb_anchor *anchor ) { unsigned long flags ; struct urb *lazarus ; raw_spinlock_t *tmp ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; { tmp = spinlock_check(& anchor->lock); flags = _raw_spin_lock_irqsave(tmp); __mptr = (struct list_head const *)anchor->urb_list.next; lazarus = (struct urb *)__mptr + 0xffffffffffffffd0UL; goto ldv_25486; ldv_25485: usb_unpoison_urb(lazarus); __mptr___0 = (struct list_head const *)lazarus->anchor_list.next; lazarus = (struct urb *)__mptr___0 + 0xffffffffffffffd0UL; ldv_25486: ; if ((unsigned long )(& lazarus->anchor_list) != (unsigned long )(& anchor->urb_list)) { goto ldv_25485; } else { } anchor->poisoned = 0U; spin_unlock_irqrestore(& anchor->lock, flags); return; } } void usb_unlink_anchored_urbs(struct usb_anchor *anchor ) { struct urb *victim ; { goto ldv_25499; ldv_25498: usb_unlink_urb(victim); usb_free_urb(victim); ldv_25499: victim = usb_get_from_anchor(anchor); if ((unsigned long )victim != (unsigned long )((struct urb *)0)) { goto ldv_25498; } else { } return; } } int usb_wait_anchor_empty_timeout(struct usb_anchor *anchor , unsigned int timeout ) { long __ret ; unsigned long tmp ; wait_queue_t __wait ; struct task_struct *tmp___0 ; int tmp___1 ; int tmp___2 ; { tmp = msecs_to_jiffies(timeout); __ret = (long )tmp; tmp___2 = list_empty((struct list_head const *)(& anchor->urb_list)); if (tmp___2 == 0) { tmp___0 = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp___0; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; ldv_25514: prepare_to_wait(& anchor->wait, & __wait, 2); tmp___1 = list_empty((struct list_head const *)(& anchor->urb_list)); if (tmp___1 != 0) { goto ldv_25513; } else { } __ret = schedule_timeout(__ret); if (__ret == 0L) { goto ldv_25513; } else { } goto ldv_25514; ldv_25513: finish_wait(& anchor->wait, & __wait); } else { } return ((int )__ret); } } struct urb *usb_get_from_anchor(struct usb_anchor *anchor ) { struct urb *victim ; unsigned long flags ; raw_spinlock_t *tmp ; struct list_head const *__mptr ; int tmp___0 ; { tmp = spinlock_check(& anchor->lock); flags = _raw_spin_lock_irqsave(tmp); tmp___0 = list_empty((struct list_head const *)(& anchor->urb_list)); if (tmp___0 == 0) { __mptr = (struct list_head const *)anchor->urb_list.next; victim = (struct urb *)__mptr + 0xffffffffffffffd0UL; usb_get_urb(victim); __usb_unanchor_urb(victim, anchor); } else { victim = 0; } spin_unlock_irqrestore(& anchor->lock, flags); return (victim); } } void usb_scuttle_anchored_urbs(struct usb_anchor *anchor ) { struct urb *victim ; unsigned long flags ; raw_spinlock_t *tmp ; struct list_head const *__mptr ; int tmp___0 ; { tmp = spinlock_check(& anchor->lock); flags = _raw_spin_lock_irqsave(tmp); goto ldv_25550; ldv_25549: __mptr = (struct list_head const *)anchor->urb_list.prev; victim = (struct urb *)__mptr + 0xffffffffffffffd0UL; __usb_unanchor_urb(victim, anchor); ldv_25550: tmp___0 = list_empty((struct list_head const *)(& anchor->urb_list)); if (tmp___0 == 0) { goto ldv_25549; } else { } spin_unlock_irqrestore(& anchor->lock, flags); return; } } int usb_anchor_empty(struct usb_anchor *anchor ) { int tmp ; { tmp = list_empty((struct list_head const *)(& anchor->urb_list)); return (tmp); } } void ldv_mutex_lock_121(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_122(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_123(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_124(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___2 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_125(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_126(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mtx(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_127(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mtx(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_128(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mtx(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_129(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mtx(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_130(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_131(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } __inline static void rep_nop(void) { { __asm__ volatile ("rep; nop": : : "memory"); return; } } __inline static void cpu_relax(void) { { rep_nop(); return; } } int ldv_mutex_trylock_146(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_144(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_147(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_149(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_151(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_153(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_155(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_157(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_158(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_159(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_160(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_162(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_163(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_164(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_166(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_167(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_168(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_143(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_145(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_148(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_150(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_152(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_154(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_156(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_161(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_165(struct mutex *ldv_func_arg1 ) ; extern void __init_waitqueue_head(wait_queue_head_t * , 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 void wait_for_completion(struct completion * ) ; extern unsigned long wait_for_completion_timeout(struct completion * , unsigned long ) ; extern void complete(struct completion * ) ; __inline static int device_is_registered(struct device *dev ) { { return ((int )dev->kobj.state_in_sysfs); } } __inline static void device_lock___1(struct device *dev ) { { ldv_mutex_lock_145(& dev->mutex); return; } } __inline static void device_unlock___1(struct device *dev ) { { ldv_mutex_unlock_147(& dev->mutex); return; } } __inline static int PageHighMem(struct page const *page ) { { return (0); } } __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" (98), "i" (12UL)); ldv_17766: ; goto ldv_17766; } 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" (99), "i" (12UL)); ldv_17767: ; goto ldv_17767; } else { } return ((struct page *)(sg->page_link & 0xfffffffffffffffcUL)); } } __inline static void *sg_virt___0(struct scatterlist *sg ) { struct page *tmp ; void *tmp___0 ; { tmp = sg_page___0(sg); tmp___0 = lowmem_page_address((struct page const *)tmp); return (tmp___0 + (unsigned long )sg->offset); } } extern void yield(void) ; extern void pm_runtime_no_callbacks(struct device * ) ; __inline static void usb_fill_control_urb(struct urb *urb , struct usb_device *dev , unsigned int pipe , unsigned char *setup_packet , void *transfer_buffer , int buffer_length , void (*complete_fn)(struct urb * ) , void *context ) { { urb->dev = dev; urb->pipe = pipe; urb->setup_packet = setup_packet; urb->transfer_buffer = transfer_buffer; urb->transfer_buffer_length = (u32 )buffer_length; urb->complete = complete_fn; urb->context = context; return; } } __inline static void usb_fill_bulk_urb(struct urb *urb , struct usb_device *dev , unsigned int pipe , void *transfer_buffer , int buffer_length , void (*complete_fn)(struct urb * ) , void *context ) { { urb->dev = dev; urb->pipe = pipe; urb->transfer_buffer = transfer_buffer; urb->transfer_buffer_length = (u32 )buffer_length; urb->complete = complete_fn; urb->context = context; return; } } int usb_interrupt_msg(struct usb_device *usb_dev , unsigned int pipe , void *data , int len , int *actual_length , int timeout ) ; int usb_bulk_msg(struct usb_device *usb_dev , unsigned int pipe , void *data , int len , int *actual_length , int timeout ) ; int usb_clear_halt(struct usb_device *dev , int pipe ) ; int usb_reset_configuration(struct usb_device *dev ) ; void usb_reset_endpoint(struct usb_device *dev , unsigned int epaddr ) ; int usb_driver_set_configuration(struct usb_device *udev , int config ) ; int usb_sg_init(struct usb_sg_request *io , struct usb_device *dev , unsigned int pipe , unsigned int period , struct scatterlist *sg , int nents , size_t length , gfp_t mem_flags ) ; void usb_sg_cancel(struct usb_sg_request *io ) ; void usb_sg_wait(struct usb_sg_request *io ) ; extern unsigned char const _ctype[] ; extern int utf16s_to_utf8s(wchar_t const * , int , enum utf16_endian , u8 * , int ) ; void usb_release_interface_cache(struct kref *ref ) ; struct attribute_group const *usb_interface_groups[3U] ; static void cancel_async_set_config(struct usb_device *udev ) ; static void usb_api_blocking_completion(struct urb *urb ) { struct api_context *ctx ; { ctx = (struct api_context *)urb->context; ctx->status = urb->status; complete(& ctx->done); return; } } static int usb_start_wait_urb(struct urb *urb , int timeout , int *actual_length ) { struct api_context ctx ; unsigned long expire ; int retval ; long tmp ; unsigned long tmp___0 ; struct _ddebug descriptor ; int tmp___1 ; int tmp___2 ; struct task_struct *tmp___3 ; long tmp___4 ; unsigned long tmp___5 ; { init_completion(& ctx.done); urb->context = (void *)(& ctx); urb->actual_length = 0U; retval = usb_submit_urb(urb, 16U); tmp = ldv__builtin_expect(retval != 0, 0L); if (tmp != 0L) { goto out; } else { } if (timeout != 0) { tmp___0 = msecs_to_jiffies((unsigned int const )timeout); expire = tmp___0; } else { expire = 9223372036854775807UL; } tmp___5 = wait_for_completion_timeout(& ctx.done, expire); if (tmp___5 == 0UL) { usb_kill_urb(urb); retval = ctx.status != -2 ? ctx.status : -110; descriptor.modname = "usbcore"; descriptor.function = "usb_start_wait_urb"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/message.c.prepared"; descriptor.format = "%s timed out on ep%d%s len=%u/%u\n"; descriptor.lineno = 164U; descriptor.flags = 1U; tmp___4 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___4 != 0L) { tmp___1 = usb_urb_dir_in(urb); tmp___2 = usb_endpoint_num((struct usb_endpoint_descriptor const *)(& (urb->ep)->desc)); tmp___3 = get_current(); __dynamic_dev_dbg(& descriptor, (struct device const *)(& (urb->dev)->dev), "%s timed out on ep%d%s len=%u/%u\n", (char *)(& tmp___3->comm), tmp___2, tmp___1 != 0 ? (char *)"in" : (char *)"out", urb->actual_length, urb->transfer_buffer_length); } else { } } else { retval = ctx.status; } out: ; if ((unsigned long )actual_length != (unsigned long )((int *)0)) { *actual_length = (int )urb->actual_length; } else { } usb_free_urb(urb); return (retval); } } static int usb_internal_control_msg(struct usb_device *usb_dev , unsigned int pipe , struct usb_ctrlrequest *cmd , void *data , int len , int timeout ) { struct urb *urb ; int retv ; int length ; { urb = usb_alloc_urb(0, 16U); if ((unsigned long )urb == (unsigned long )((struct urb *)0)) { return (-12); } else { } usb_fill_control_urb(urb, usb_dev, pipe, (unsigned char *)cmd, data, len, & usb_api_blocking_completion, 0); retv = usb_start_wait_urb(urb, timeout, & length); if (retv < 0) { return (retv); } else { return (length); } } } int usb_control_msg(struct usb_device *dev , unsigned int pipe , __u8 request , __u8 requesttype , __u16 value , __u16 index , void *data , __u16 size , int timeout ) { struct usb_ctrlrequest *dr ; int ret ; void *tmp ; { tmp = kmalloc(8UL, 16U); dr = (struct usb_ctrlrequest *)tmp; if ((unsigned long )dr == (unsigned long )((struct usb_ctrlrequest *)0)) { return (-12); } else { } dr->bRequestType = requesttype; dr->bRequest = request; dr->wValue = value; dr->wIndex = index; dr->wLength = size; ret = usb_internal_control_msg(dev, pipe, dr, data, (int )size, timeout); kfree((void const *)dr); return (ret); } } int usb_interrupt_msg(struct usb_device *usb_dev , unsigned int pipe , void *data , int len , int *actual_length , int timeout ) { int tmp ; { tmp = usb_bulk_msg(usb_dev, pipe, data, len, actual_length, timeout); return (tmp); } } int usb_bulk_msg(struct usb_device *usb_dev , unsigned int pipe , void *data , int len , int *actual_length , int timeout ) { struct urb *urb ; struct usb_host_endpoint *ep ; int tmp ; { ep = usb_pipe_endpoint(usb_dev, pipe); if ((unsigned long )ep == (unsigned long )((struct usb_host_endpoint *)0) || len < 0) { return (-22); } else { } urb = usb_alloc_urb(0, 208U); if ((unsigned long )urb == (unsigned long )((struct urb *)0)) { return (-12); } else { } if (((int )ep->desc.bmAttributes & 3) == 3) { pipe = (pipe & 1073741823U) | 1073741824U; usb_fill_int_urb(urb, usb_dev, pipe, data, len, & usb_api_blocking_completion, 0, (int )ep->desc.bInterval); } else { usb_fill_bulk_urb(urb, usb_dev, pipe, data, len, & usb_api_blocking_completion, 0); } tmp = usb_start_wait_urb(urb, timeout, actual_length); return (tmp); } } static void sg_clean(struct usb_sg_request *io ) { int tmp ; { if ((unsigned long )io->urbs != (unsigned long )((struct urb **)0)) { goto ldv_33463; ldv_33462: usb_free_urb(*(io->urbs + (unsigned long )io->entries)); ldv_33463: tmp = io->entries; io->entries = io->entries - 1; if (tmp != 0) { goto ldv_33462; } else { } kfree((void const *)io->urbs); io->urbs = 0; } else { } io->dev = 0; return; } } static void sg_complete(struct urb *urb ) { struct usb_sg_request *io ; int status ; int tmp ; int tmp___0 ; int i ; int found ; int retval ; { io = (struct usb_sg_request *)urb->context; status = urb->status; spin_lock(& io->lock); if ((io->status != 0 && (io->status != -104 || status != -104)) && urb->actual_length != 0U) { tmp = usb_urb_dir_in(urb); tmp___0 = usb_endpoint_num((struct usb_endpoint_descriptor const *)(& (urb->ep)->desc)); dev_err((struct device const *)((io->dev)->bus)->controller, "dev %s ep%d%s scatterlist error %d/%d\n", (char *)(& (io->dev)->devpath), tmp___0, tmp != 0 ? (char *)"in" : (char *)"out", status, io->status); } else { } if ((io->status == 0 && status != 0) && status != -104) { io->status = status; spin_unlock(& io->lock); i = 0; found = 0; goto ldv_33476; ldv_33475: ; if ((unsigned long )*(io->urbs + (unsigned long )i) == (unsigned long )((struct urb *)0) || (unsigned long )(*(io->urbs + (unsigned long )i))->dev == (unsigned long )((struct usb_device *)0)) { goto ldv_33473; } else { } if (found != 0) { retval = usb_unlink_urb(*(io->urbs + (unsigned long )i)); if (((retval != -115 && retval != -19) && retval != -16) && retval != -43) { dev_err((struct device const *)(& (io->dev)->dev), "%s, unlink --> %d\n", "sg_complete", retval); } else { } } else if ((unsigned long )*(io->urbs + (unsigned long )i) == (unsigned long )urb) { found = 1; } else { } ldv_33473: i = i + 1; ldv_33476: ; if (io->entries > i) { goto ldv_33475; } else { } spin_lock(& io->lock); } else { } io->bytes = io->bytes + (size_t )urb->actual_length; io->count = io->count - 1; if (io->count == 0) { complete(& io->complete); } else { } spin_unlock(& io->lock); return; } } int usb_sg_init(struct usb_sg_request *io , struct usb_device *dev , unsigned int pipe , unsigned int period , struct scatterlist *sg , int nents , size_t length , gfp_t mem_flags ) { int i ; int urb_flags ; int use_sg ; struct lock_class_key __key ; void *tmp ; struct urb *urb ; unsigned int len ; struct scatterlist *sg2 ; int j ; struct page *tmp___0 ; int tmp___1 ; size_t __min1 ; size_t __min2 ; { if ((((((unsigned long )io == (unsigned long )((struct usb_sg_request *)0) || (unsigned long )dev == (unsigned long )((struct usb_device *)0)) || (unsigned long )sg == (unsigned long )((struct scatterlist *)0)) || pipe >> 30 == 2U) || pipe >> 30 == 0U) || nents <= 0) { return (-22); } else { } spinlock_check(& io->lock); __raw_spin_lock_init(& io->lock.ldv_5957.rlock, "&(&io->lock)->rlock", & __key); io->dev = dev; io->pipe = (int )pipe; if ((dev->bus)->sg_tablesize != 0U) { use_sg = 1; io->entries = 1; } else { use_sg = 0; io->entries = nents; } tmp = kmalloc((unsigned long )io->entries * 8UL, mem_flags); io->urbs = (struct urb **)tmp; if ((unsigned long )io->urbs == (unsigned long )((struct urb **)0)) { goto nomem; } else { } urb_flags = 128; if ((pipe & 128U) != 0U) { urb_flags = urb_flags | 1; } else { } i = 0; sg = sg; goto ldv_33504; ldv_33503: urb = usb_alloc_urb(0, mem_flags); if ((unsigned long )urb == (unsigned long )((struct urb *)0)) { io->entries = i; goto nomem; } else { } *(io->urbs + (unsigned long )i) = urb; urb->dev = 0; urb->pipe = pipe; urb->interval = (int )period; urb->transfer_flags = (unsigned int )urb_flags; urb->complete = & sg_complete; urb->context = (void *)io; urb->sg = sg; if (use_sg != 0) { urb->transfer_buffer = 0; urb->num_sgs = nents; len = (unsigned int )length; if (len == 0U) { j = 0; sg2 = sg; goto ldv_33498; ldv_33497: len = sg2->length + len; j = j + 1; sg2 = sg_next(sg2); ldv_33498: ; if (j < nents) { goto ldv_33497; } else { } } else { } } else { tmp___0 = sg_page___0(sg); tmp___1 = PageHighMem((struct page const *)tmp___0); if (tmp___1 == 0) { urb->transfer_buffer = sg_virt___0(sg); } else { urb->transfer_buffer = 0; } len = sg->length; if (length != 0UL) { __min1 = (size_t )len; __min2 = length; len = (unsigned int )(__min1 < __min2 ? __min1 : __min2); length = length - (size_t )len; if (length == 0UL) { io->entries = i + 1; } else { } } else { } } urb->transfer_buffer_length = len; i = i + 1; sg = sg_next(sg); ldv_33504: ; if (io->entries > i) { goto ldv_33503; } else { } i = i - 1; (*(io->urbs + (unsigned long )i))->transfer_flags = (*(io->urbs + (unsigned long )i))->transfer_flags & 4294967167U; io->count = io->entries; io->status = 0; io->bytes = 0UL; init_completion(& io->complete); return (0); nomem: sg_clean(io); return (-12); } } void usb_sg_wait(struct usb_sg_request *io ) { int i ; int entries ; int retval ; struct _ddebug descriptor ; long tmp ; { entries = io->entries; spin_lock_irq(& io->lock); i = 0; goto ldv_33534; ldv_33533: (*(io->urbs + (unsigned long )i))->dev = io->dev; retval = usb_submit_urb(*(io->urbs + (unsigned long )i), 32U); spin_unlock_irq(& io->lock); switch (retval) { case -6: ; case -11: ; case -12: retval = 0; yield(); goto ldv_33528; case 0: i = i + 1; cpu_relax(); goto ldv_33528; default: (*(io->urbs + (unsigned long )i))->status = retval; descriptor.modname = "usbcore"; descriptor.function = "usb_sg_wait"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/message.c.prepared"; descriptor.format = "%s, submit --> %d\n"; descriptor.lineno = 640U; descriptor.flags = 1U; tmp = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)(& (io->dev)->dev), "%s, submit --> %d\n", "usb_sg_wait", retval); } else { } usb_sg_cancel(io); } ldv_33528: spin_lock_irq(& io->lock); if (retval != 0 && (io->status == 0 || io->status == -104)) { io->status = retval; } else { } ldv_33534: ; if (i < entries && io->status == 0) { goto ldv_33533; } else { } io->count = io->count + (i - entries); if (io->count == 0) { complete(& io->complete); } else { } spin_unlock_irq(& io->lock); wait_for_completion(& io->complete); sg_clean(io); return; } } void usb_sg_cancel(struct usb_sg_request *io ) { unsigned long flags ; raw_spinlock_t *tmp ; int i ; int retval ; { tmp = spinlock_check(& io->lock); flags = _raw_spin_lock_irqsave(tmp); if (io->status == 0) { io->status = -104; spin_unlock(& io->lock); i = 0; goto ldv_33554; ldv_33553: ; if ((unsigned long )(*(io->urbs + (unsigned long )i))->dev == (unsigned long )((struct usb_device *)0)) { goto ldv_33551; } else { } retval = usb_unlink_urb(*(io->urbs + (unsigned long )i)); if (((retval != -115 && retval != -19) && retval != -16) && retval != -43) { dev_warn((struct device const *)(& (io->dev)->dev), "%s, unlink --> %d\n", "usb_sg_cancel", retval); } else { } ldv_33551: i = i + 1; ldv_33554: ; if (io->entries > i) { goto ldv_33553; } else { } spin_lock(& io->lock); } else { } spin_unlock_irqrestore(& io->lock, flags); return; } } int usb_get_descriptor(struct usb_device *dev , unsigned char type , unsigned char index , void *buf , int size ) { int i ; int result ; unsigned int tmp ; { memset(buf, 0, (size_t )size); i = 0; goto ldv_33574; ldv_33573: tmp = __create_pipe(dev, 0U); result = usb_control_msg(dev, tmp | 2147483776U, 6, 128, ((int )((__u16 )type) << 8U) + (int )((__u16 )index), 0, buf, (int )((__u16 )size), 5000); if (result <= 0 && result != -110) { goto ldv_33571; } else { } if (result > 1 && (int )*((u8 *)buf + 1UL) != (int )type) { result = -61; goto ldv_33571; } else { } goto ldv_33572; ldv_33571: i = i + 1; ldv_33574: ; if (i <= 2) { goto ldv_33573; } else { } ldv_33572: ; return (result); } } static int usb_get_string(struct usb_device *dev , unsigned short langid , unsigned char index , void *buf , int size ) { int i ; int result ; unsigned int tmp ; { i = 0; goto ldv_33597; ldv_33596: tmp = __create_pipe(dev, 0U); result = usb_control_msg(dev, tmp | 2147483776U, 6, 128, (int )((unsigned int )((__u16 )index) + 768U), (int )langid, buf, (int )((__u16 )size), 5000); if (result == 0 || result == -32) { goto ldv_33594; } else { } if (result > 1 && (unsigned int )*((u8 *)buf + 1UL) != 3U) { result = -61; goto ldv_33594; } else { } goto ldv_33595; ldv_33594: i = i + 1; ldv_33597: ; if (i <= 2) { goto ldv_33596; } else { } ldv_33595: ; return (result); } } static void usb_try_string_workarounds(unsigned char *buf , int *length ) { int newlength ; int oldlength ; { oldlength = *length; newlength = 2; goto ldv_33606; ldv_33605: ; if (((int )_ctype[(int )*(buf + (unsigned long )newlength)] & 151) == 0 || (unsigned int )*(buf + ((unsigned long )newlength + 1UL)) != 0U) { goto ldv_33604; } else { } newlength = newlength + 2; ldv_33606: ; if (newlength + 1 < oldlength) { goto ldv_33605; } else { } ldv_33604: ; if (newlength > 2) { *buf = (unsigned char )newlength; *length = newlength; } else { } return; } } static int usb_string_sub(struct usb_device *dev , unsigned int langid , unsigned int index , unsigned char *buf ) { int rc ; { if ((int )dev->quirks & 1) { rc = -5; } else { rc = usb_get_string(dev, (int )((unsigned short )langid), (int )((unsigned char )index), (void *)buf, 255); } if (rc <= 1) { rc = usb_get_string(dev, (int )((unsigned short )langid), (int )((unsigned char )index), (void *)buf, 2); if (rc == 2) { rc = usb_get_string(dev, (int )((unsigned short )langid), (int )((unsigned char )index), (void *)buf, (int )*buf); } else { } } else { } if (rc > 1) { if ((unsigned int )*buf == 0U && (unsigned int )*(buf + 1UL) == 0U) { usb_try_string_workarounds(buf, & rc); } else { } if ((int )*buf < rc) { rc = (int )*buf; } else { } rc = rc & -2; } else { } if (rc <= 1) { rc = rc < 0 ? rc : -22; } else { } return (rc); } } static int usb_get_langid(struct usb_device *dev , unsigned char *tbuf ) { int err ; struct _ddebug descriptor ; long tmp ; { if ((unsigned int )*((unsigned char *)dev + 1596UL) != 0U) { return (0); } else { } if (dev->string_langid < 0) { return (-32); } else { } err = usb_string_sub(dev, 0U, 0U, tbuf); if (err == -61 || (err > 0 && err <= 3)) { dev->string_langid = 1033; dev->have_langid = 1U; dev_err((struct device const *)(& dev->dev), "string descriptor 0 malformed (err = %d), defaulting to 0x%04x\n", err, dev->string_langid); return (0); } else { } if (err < 0) { dev_err((struct device const *)(& dev->dev), "string descriptor 0 read error: %d\n", err); dev->string_langid = -1; return (-32); } else { } dev->string_langid = (int )*(tbuf + 2UL) | ((int )*(tbuf + 3UL) << 8); dev->have_langid = 1U; descriptor.modname = "usbcore"; descriptor.function = "usb_get_langid"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/message.c.prepared"; descriptor.format = "default language 0x%04x\n"; descriptor.lineno = 885U; descriptor.flags = 1U; tmp = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)(& dev->dev), "default language 0x%04x\n", dev->string_langid); } else { } return (0); } } int usb_string(struct usb_device *dev , int index , char *buf , size_t size ) { unsigned char *tbuf ; int err ; void *tmp ; struct _ddebug descriptor ; long tmp___0 ; { if ((unsigned int )dev->state == 8U) { return (-113); } else { } if ((size == 0UL || (unsigned long )buf == (unsigned long )((char *)0)) || index == 0) { return (-22); } else { } *buf = 0; tmp = kmalloc(256UL, 16U); tbuf = (unsigned char *)tmp; if ((unsigned long )tbuf == (unsigned long )((unsigned char *)0)) { return (-12); } else { } err = usb_get_langid(dev, tbuf); if (err < 0) { goto errout; } else { } err = usb_string_sub(dev, (unsigned int )dev->string_langid, (unsigned int )index, tbuf); if (err < 0) { goto errout; } else { } size = size - (size_t )1; err = utf16s_to_utf8s((wchar_t const *)tbuf + 2U, (err + -2) / 2, UTF16_LITTLE_ENDIAN, (u8 *)buf, (int )size); *(buf + (unsigned long )err) = 0; if ((unsigned int )*(tbuf + 1UL) != 3U) { descriptor.modname = "usbcore"; descriptor.function = "usb_string"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/message.c.prepared"; descriptor.format = "wrong descriptor type %02x for string %d (\"%s\")\n"; descriptor.lineno = 936U; descriptor.flags = 1U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)(& dev->dev), "wrong descriptor type %02x for string %d (\"%s\")\n", (int )*(tbuf + 1UL), index, buf); } else { } } else { } errout: kfree((void const *)tbuf); return (err); } } char *usb_cache_string(struct usb_device *udev , int index ) { char *buf ; char *smallbuf ; int len ; void *tmp ; void *tmp___0 ; size_t __len ; void *__ret ; { smallbuf = 0; if (index <= 0) { return (0); } else { } tmp = kmalloc(382UL, 16U); buf = (char *)tmp; if ((unsigned long )buf != (unsigned long )((char *)0)) { len = usb_string(udev, index, buf, 382UL); if (len > 0) { len = len + 1; tmp___0 = kmalloc((size_t )len, 16U); smallbuf = (char *)tmp___0; if ((unsigned long )smallbuf == (unsigned long )((char *)0)) { return (buf); } else { } __len = (size_t )len; __ret = __builtin_memcpy((void *)smallbuf, (void const *)buf, __len); } else { } kfree((void const *)buf); } else { } return (smallbuf); } } int usb_get_device_descriptor(struct usb_device *dev , unsigned int size ) { struct usb_device_descriptor *desc ; int ret ; void *tmp ; size_t __len ; void *__ret ; { if (size > 18U) { return (-22); } else { } tmp = kmalloc(18UL, 16U); desc = (struct usb_device_descriptor *)tmp; if ((unsigned long )desc == (unsigned long )((struct usb_device_descriptor *)0)) { return (-12); } else { } ret = usb_get_descriptor(dev, 1, 0, (void *)desc, (int )size); if (ret >= 0) { __len = (size_t )size; __ret = __builtin_memcpy((void *)(& dev->descriptor), (void const *)desc, __len); } else { } kfree((void const *)desc); return (ret); } } int usb_get_status(struct usb_device *dev , int type , int target , void *data ) { int ret ; u16 *status ; void *tmp ; unsigned int tmp___0 ; { tmp = kmalloc(2UL, 208U); status = (u16 *)tmp; if ((unsigned long )status == (unsigned long )((u16 *)0)) { return (-12); } else { } tmp___0 = __create_pipe(dev, 0U); ret = usb_control_msg(dev, tmp___0 | 2147483776U, 0, (int )((__u8 )((int )((signed char )type) | -128)), 0, (int )((__u16 )target), (void *)status, 2, 5000); *((u16 *)data) = *status; kfree((void const *)status); return (ret); } } int usb_clear_halt(struct usb_device *dev , int pipe ) { int result ; int endp ; unsigned int tmp ; { endp = (pipe >> 15) & 15; if ((pipe & 128) != 0) { endp = endp | 128; } else { } tmp = __create_pipe(dev, 0U); result = usb_control_msg(dev, tmp | 2147483648U, 1, 2, 0, (int )((__u16 )endp), 0, 0, 5000); if (result < 0) { return (result); } else { } usb_reset_endpoint(dev, (unsigned int )endp); return (0); } } static int create_intf_ep_devs(struct usb_interface *intf ) { struct usb_device *udev ; struct usb_device *tmp ; struct usb_host_interface *alt ; int i ; { tmp = interface_to_usbdev(intf); udev = tmp; alt = intf->cur_altsetting; if ((unsigned int )*((unsigned char *)intf + 40UL) != 0U || (unsigned int )*((unsigned char *)intf + 40UL) != 0U) { return (0); } else { } i = 0; goto ldv_33697; ldv_33696: usb_create_ep_devs(& intf->dev, alt->endpoint + (unsigned long )i, udev); i = i + 1; ldv_33697: ; if ((int )alt->desc.bNumEndpoints > i) { goto ldv_33696; } else { } intf->ep_devs_created = 1U; return (0); } } static void remove_intf_ep_devs(struct usb_interface *intf ) { struct usb_host_interface *alt ; int i ; { alt = intf->cur_altsetting; if ((unsigned int )*((unsigned char *)intf + 40UL) == 0U) { return; } else { } i = 0; goto ldv_33705; ldv_33704: usb_remove_ep_devs(alt->endpoint + (unsigned long )i); i = i + 1; ldv_33705: ; if ((int )alt->desc.bNumEndpoints > i) { goto ldv_33704; } else { } intf->ep_devs_created = 0U; return; } } void usb_disable_endpoint(struct usb_device *dev , unsigned int epaddr , bool reset_hardware ) { unsigned int epnum ; struct usb_host_endpoint *ep ; { epnum = epaddr & 15U; if ((unsigned long )dev == (unsigned long )((struct usb_device *)0)) { return; } else { } if ((epaddr & 128U) == 0U) { ep = dev->ep_out[epnum]; if ((int )reset_hardware) { dev->ep_out[epnum] = 0; } else { } } else { ep = dev->ep_in[epnum]; if ((int )reset_hardware) { dev->ep_in[epnum] = 0; } else { } } if ((unsigned long )ep != (unsigned long )((struct usb_host_endpoint *)0)) { ep->enabled = 0; usb_hcd_flush_endpoint(dev, ep); if ((int )reset_hardware) { usb_hcd_disable_endpoint(dev, ep); } else { } } else { } return; } } void usb_reset_endpoint(struct usb_device *dev , unsigned int epaddr ) { unsigned int epnum ; struct usb_host_endpoint *ep ; { epnum = epaddr & 15U; if ((epaddr & 128U) == 0U) { ep = dev->ep_out[epnum]; } else { ep = dev->ep_in[epnum]; } if ((unsigned long )ep != (unsigned long )((struct usb_host_endpoint *)0)) { usb_hcd_reset_endpoint(dev, ep); } else { } return; } } void usb_disable_interface(struct usb_device *dev , struct usb_interface *intf , bool reset_hardware ) { struct usb_host_interface *alt ; int i ; { alt = intf->cur_altsetting; i = 0; goto ldv_33735; ldv_33734: usb_disable_endpoint(dev, (unsigned int )(alt->endpoint + (unsigned long )i)->desc.bEndpointAddress, (int )reset_hardware); i = i + 1; ldv_33735: ; if ((int )alt->desc.bNumEndpoints > i) { goto ldv_33734; } else { } return; } } void usb_disable_device(struct usb_device *dev , int skip_ep0 ) { int i ; struct usb_hcd *hcd ; struct usb_hcd *tmp ; struct usb_interface *interface ; int tmp___0 ; struct _ddebug descriptor ; char const *tmp___1 ; long tmp___2 ; struct _ddebug descriptor___0 ; long tmp___3 ; { tmp = bus_to_hcd(dev->bus); hcd = tmp; if ((unsigned long )dev->actconfig != (unsigned long )((struct usb_host_config *)0)) { i = 0; goto ldv_33744; ldv_33743: ((dev->actconfig)->interface[i])->unregistering = 1U; i = i + 1; ldv_33744: ; if ((int )(dev->actconfig)->desc.bNumInterfaces > i) { goto ldv_33743; } else { } i = 0; goto ldv_33751; ldv_33750: interface = (dev->actconfig)->interface[i]; tmp___0 = device_is_registered(& interface->dev); if (tmp___0 == 0) { goto ldv_33747; } else { } descriptor.modname = "usbcore"; descriptor.function = "usb_disable_device"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/message.c.prepared"; descriptor.format = "unregistering interface %s\n"; descriptor.lineno = 1259U; descriptor.flags = 1U; tmp___2 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___2 != 0L) { tmp___1 = dev_name((struct device const *)(& interface->dev)); __dynamic_dev_dbg(& descriptor, (struct device const *)(& dev->dev), "unregistering interface %s\n", tmp___1); } else { } remove_intf_ep_devs(interface); device_del(& interface->dev); ldv_33747: i = i + 1; ldv_33751: ; if ((int )(dev->actconfig)->desc.bNumInterfaces > i) { goto ldv_33750; } else { } i = 0; goto ldv_33754; ldv_33753: put_device(& ((dev->actconfig)->interface[i])->dev); (dev->actconfig)->interface[i] = 0; i = i + 1; ldv_33754: ; if ((int )(dev->actconfig)->desc.bNumInterfaces > i) { goto ldv_33753; } else { } usb_unlocked_disable_lpm(dev); usb_disable_ltm(dev); dev->actconfig = 0; if ((unsigned int )dev->state == 7U) { usb_set_device_state(dev, USB_STATE_ADDRESS); } else { } } else { } descriptor___0.modname = "usbcore"; descriptor___0.function = "usb_disable_device"; descriptor___0.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/message.c.prepared"; descriptor___0.format = "%s nuking %s URBs\n"; descriptor___0.lineno = 1279U; descriptor___0.flags = 1U; tmp___3 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___3 != 0L) { __dynamic_dev_dbg(& descriptor___0, (struct device const *)(& dev->dev), "%s nuking %s URBs\n", "usb_disable_device", skip_ep0 != 0 ? (char *)"non-ep0" : (char *)"all"); } else { } if ((unsigned long )(hcd->driver)->check_bandwidth != (unsigned long )((int (*/* const */)(struct usb_hcd * , struct usb_device * ))0)) { i = skip_ep0; goto ldv_33758; ldv_33757: usb_disable_endpoint(dev, (unsigned int )i, 0); usb_disable_endpoint(dev, (unsigned int )(i + 128), 0); i = i + 1; ldv_33758: ; if (i <= 15) { goto ldv_33757; } else { } ldv_mutex_lock_154(hcd->bandwidth_mutex); usb_hcd_alloc_bandwidth(dev, 0, 0, 0); ldv_mutex_unlock_155(hcd->bandwidth_mutex); } else { } i = skip_ep0; goto ldv_33761; ldv_33760: usb_disable_endpoint(dev, (unsigned int )i, 1); usb_disable_endpoint(dev, (unsigned int )(i + 128), 1); i = i + 1; ldv_33761: ; if (i <= 15) { goto ldv_33760; } else { } return; } } void usb_enable_endpoint(struct usb_device *dev , struct usb_host_endpoint *ep , bool reset_ep ) { int epnum ; int tmp ; int is_out ; int tmp___0 ; int is_control ; int tmp___1 ; { tmp = usb_endpoint_num((struct usb_endpoint_descriptor const *)(& ep->desc)); epnum = tmp; tmp___0 = usb_endpoint_dir_out((struct usb_endpoint_descriptor const *)(& ep->desc)); is_out = tmp___0; tmp___1 = usb_endpoint_xfer_control((struct usb_endpoint_descriptor const *)(& ep->desc)); is_control = tmp___1; if ((int )reset_ep) { usb_hcd_reset_endpoint(dev, ep); } else { } if (is_out != 0 || is_control != 0) { dev->ep_out[epnum] = ep; } else { } if (is_out == 0 || is_control != 0) { dev->ep_in[epnum] = ep; } else { } ep->enabled = 1; return; } } void usb_enable_interface(struct usb_device *dev , struct usb_interface *intf , bool reset_eps ) { struct usb_host_interface *alt ; int i ; { alt = intf->cur_altsetting; i = 0; goto ldv_33779; ldv_33778: usb_enable_endpoint(dev, alt->endpoint + (unsigned long )i, (int )reset_eps); i = i + 1; ldv_33779: ; if ((int )alt->desc.bNumEndpoints > i) { goto ldv_33778; } else { } return; } } int usb_set_interface(struct usb_device *dev , int interface , int alternate ) { struct usb_interface *iface ; struct usb_host_interface *alt ; struct usb_hcd *hcd ; struct usb_hcd *tmp ; int ret ; int manual ; unsigned int epaddr ; unsigned int pipe ; struct _ddebug descriptor ; long tmp___0 ; int tmp___1 ; unsigned int tmp___2 ; struct _ddebug descriptor___0 ; long tmp___3 ; int i ; unsigned int tmp___4 ; int tmp___5 ; { tmp = bus_to_hcd(dev->bus); hcd = tmp; manual = 0; if ((unsigned int )dev->state == 8U) { return (-113); } else { } iface = usb_ifnum_to_if((struct usb_device const *)dev, (unsigned int )interface); if ((unsigned long )iface == (unsigned long )((struct usb_interface *)0)) { descriptor.modname = "usbcore"; descriptor.function = "usb_set_interface"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/message.c.prepared"; descriptor.format = "selecting invalid interface %d\n"; descriptor.lineno = 1390U; descriptor.flags = 1U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)(& dev->dev), "selecting invalid interface %d\n", interface); } else { } return (-22); } else { } if ((unsigned int )*((unsigned char *)iface + 40UL) != 0U) { return (-19); } else { } alt = usb_altnum_to_altsetting((struct usb_interface const *)iface, (unsigned int )alternate); if ((unsigned long )alt == (unsigned long )((struct usb_host_interface *)0)) { dev_warn((struct device const *)(& dev->dev), "selecting invalid altsetting %d\n", alternate); return (-22); } else { } ldv_mutex_lock_156(hcd->bandwidth_mutex); tmp___1 = usb_disable_lpm(dev); if (tmp___1 != 0) { dev_err((struct device const *)(& iface->dev), "%s Failed to disable LPM\n.", "usb_set_interface"); ldv_mutex_unlock_157(hcd->bandwidth_mutex); return (-12); } else { } ret = usb_hcd_alloc_bandwidth(dev, 0, iface->cur_altsetting, alt); if (ret < 0) { _dev_info((struct device const *)(& dev->dev), "Not enough bandwidth for altsetting %d\n", alternate); usb_enable_lpm(dev); ldv_mutex_unlock_158(hcd->bandwidth_mutex); return (ret); } else { } if ((dev->quirks & 4U) != 0U) { ret = -32; } else { tmp___2 = __create_pipe(dev, 0U); ret = usb_control_msg(dev, tmp___2 | 2147483648U, 11, 1, (int )((__u16 )alternate), (int )((__u16 )interface), 0, 0, 5000); } if (ret == -32 && iface->num_altsetting == 1U) { descriptor___0.modname = "usbcore"; descriptor___0.function = "usb_set_interface"; descriptor___0.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/message.c.prepared"; descriptor___0.format = "manual set_interface for iface %d, alt %d\n"; descriptor___0.lineno = 1437U; descriptor___0.flags = 1U; tmp___3 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___3 != 0L) { __dynamic_dev_dbg(& descriptor___0, (struct device const *)(& dev->dev), "manual set_interface for iface %d, alt %d\n", interface, alternate); } else { } manual = 1; } else if (ret < 0) { usb_hcd_alloc_bandwidth(dev, 0, alt, iface->cur_altsetting); usb_enable_lpm(dev); ldv_mutex_unlock_159(hcd->bandwidth_mutex); return (ret); } else { } ldv_mutex_unlock_160(hcd->bandwidth_mutex); if ((unsigned long )iface->cur_altsetting != (unsigned long )alt) { remove_intf_ep_devs(iface); usb_remove_sysfs_intf_files(iface); } else { } usb_disable_interface(dev, iface, 1); iface->cur_altsetting = alt; usb_unlocked_enable_lpm(dev); if (manual != 0) { i = 0; goto ldv_33798; ldv_33797: epaddr = (unsigned int )(alt->endpoint + (unsigned long )i)->desc.bEndpointAddress; tmp___4 = __create_pipe(dev, epaddr & 15U); pipe = tmp___4 | ((epaddr & 128U) == 0U ? 0U : 128U); usb_clear_halt(dev, (int )pipe); i = i + 1; ldv_33798: ; if ((int )alt->desc.bNumEndpoints > i) { goto ldv_33797; } else { } } else { } usb_enable_interface(dev, iface, 1); tmp___5 = device_is_registered(& iface->dev); if (tmp___5 != 0) { usb_create_sysfs_intf_files(iface); create_intf_ep_devs(iface); } else { } return (0); } } int usb_reset_configuration(struct usb_device *dev ) { int i ; int retval ; struct usb_host_config *config ; struct usb_hcd *hcd ; struct usb_hcd *tmp ; int tmp___0 ; struct usb_interface *intf ; struct usb_host_interface *alt ; struct usb_interface *intf___0 ; struct usb_host_interface *alt___0 ; unsigned int tmp___1 ; struct usb_interface *intf___1 ; struct usb_host_interface *alt___1 ; int tmp___2 ; { tmp = bus_to_hcd(dev->bus); hcd = tmp; if ((unsigned int )dev->state == 8U) { return (-113); } else { } i = 1; goto ldv_33816; ldv_33815: usb_disable_endpoint(dev, (unsigned int )i, 1); usb_disable_endpoint(dev, (unsigned int )(i + 128), 1); i = i + 1; ldv_33816: ; if (i <= 15) { goto ldv_33815; } else { } config = dev->actconfig; retval = 0; ldv_mutex_lock_161(hcd->bandwidth_mutex); tmp___0 = usb_disable_lpm(dev); if (tmp___0 != 0) { dev_err((struct device const *)(& dev->dev), "%s Failed to disable LPM\n.", "usb_reset_configuration"); ldv_mutex_unlock_162(hcd->bandwidth_mutex); return (-12); } else { } i = 0; goto ldv_33823; ldv_33822: intf = config->interface[i]; alt = usb_altnum_to_altsetting((struct usb_interface const *)intf, 0U); if ((unsigned long )alt == (unsigned long )((struct usb_host_interface *)0)) { alt = intf->altsetting; } else { } if ((unsigned long )intf->cur_altsetting != (unsigned long )alt) { retval = usb_hcd_alloc_bandwidth(dev, 0, intf->cur_altsetting, alt); } else { } if (retval < 0) { goto ldv_33821; } else { } i = i + 1; ldv_33823: ; if ((int )config->desc.bNumInterfaces > i) { goto ldv_33822; } else { } ldv_33821: ; if (retval < 0) { reset_old_alts: i = i - 1; goto ldv_33828; ldv_33827: intf___0 = config->interface[i]; alt___0 = usb_altnum_to_altsetting((struct usb_interface const *)intf___0, 0U); if ((unsigned long )alt___0 == (unsigned long )((struct usb_host_interface *)0)) { alt___0 = intf___0->altsetting; } else { } if ((unsigned long )intf___0->cur_altsetting != (unsigned long )alt___0) { usb_hcd_alloc_bandwidth(dev, 0, alt___0, intf___0->cur_altsetting); } else { } i = i - 1; ldv_33828: ; if (i >= 0) { goto ldv_33827; } else { } usb_enable_lpm(dev); ldv_mutex_unlock_163(hcd->bandwidth_mutex); return (retval); } else { } tmp___1 = __create_pipe(dev, 0U); retval = usb_control_msg(dev, tmp___1 | 2147483648U, 9, 0, (int )config->desc.bConfigurationValue, 0, 0, 0, 5000); if (retval < 0) { goto reset_old_alts; } else { } ldv_mutex_unlock_164(hcd->bandwidth_mutex); i = 0; goto ldv_33833; ldv_33832: intf___1 = config->interface[i]; alt___1 = usb_altnum_to_altsetting((struct usb_interface const *)intf___1, 0U); if ((unsigned long )alt___1 == (unsigned long )((struct usb_host_interface *)0)) { alt___1 = intf___1->altsetting; } else { } if ((unsigned long )intf___1->cur_altsetting != (unsigned long )alt___1) { remove_intf_ep_devs(intf___1); usb_remove_sysfs_intf_files(intf___1); } else { } intf___1->cur_altsetting = alt___1; usb_enable_interface(dev, intf___1, 1); tmp___2 = device_is_registered(& intf___1->dev); if (tmp___2 != 0) { usb_create_sysfs_intf_files(intf___1); create_intf_ep_devs(intf___1); } else { } i = i + 1; ldv_33833: ; if ((int )config->desc.bNumInterfaces > i) { goto ldv_33832; } else { } usb_unlocked_enable_lpm(dev); return (0); } } static void usb_release_interface(struct device *dev ) { struct usb_interface *intf ; struct device const *__mptr ; struct usb_interface_cache *intfc ; struct usb_host_interface const *__mptr___0 ; { __mptr = (struct device const *)dev; intf = (struct usb_interface *)__mptr + 0xffffffffffffffd0UL; __mptr___0 = (struct usb_host_interface const *)intf->altsetting; intfc = (struct usb_interface_cache *)__mptr___0 + 0xfffffffffffffff8UL; kref_put(& intfc->ref, & usb_release_interface_cache); kfree((void const *)intf); return; } } static int usb_if_uevent(struct device *dev , struct kobj_uevent_env *env ) { struct usb_device *usb_dev ; struct usb_interface *intf ; struct usb_host_interface *alt ; struct device const *__mptr ; int tmp ; int tmp___0 ; { __mptr = (struct device const *)dev; intf = (struct usb_interface *)__mptr + 0xffffffffffffffd0UL; usb_dev = interface_to_usbdev(intf); alt = intf->cur_altsetting; tmp = add_uevent_var(env, "INTERFACE=%d/%d/%d", (int )alt->desc.bInterfaceClass, (int )alt->desc.bInterfaceSubClass, (int )alt->desc.bInterfaceProtocol); if (tmp != 0) { return (-12); } else { } tmp___0 = add_uevent_var(env, "MODALIAS=usb:v%04Xp%04Xd%04Xdc%02Xdsc%02Xdp%02Xic%02Xisc%02Xip%02Xin%02X", (int )usb_dev->descriptor.idVendor, (int )usb_dev->descriptor.idProduct, (int )usb_dev->descriptor.bcdDevice, (int )usb_dev->descriptor.bDeviceClass, (int )usb_dev->descriptor.bDeviceSubClass, (int )usb_dev->descriptor.bDeviceProtocol, (int )alt->desc.bInterfaceClass, (int )alt->desc.bInterfaceSubClass, (int )alt->desc.bInterfaceProtocol, (int )alt->desc.bInterfaceNumber); if (tmp___0 != 0) { return (-12); } else { } return (0); } } struct device_type usb_if_device_type = {"usb_interface", 0, & usb_if_uevent, 0, & usb_release_interface, 0}; static struct usb_interface_assoc_descriptor *find_iad(struct usb_device *dev , struct usb_host_config *config , u8 inum ) { struct usb_interface_assoc_descriptor *retval ; struct usb_interface_assoc_descriptor *intf_assoc ; int first_intf ; int last_intf ; int i ; { retval = 0; i = 0; goto ldv_33872; ldv_33871: intf_assoc = config->intf_assoc[i]; if ((unsigned int )intf_assoc->bInterfaceCount == 0U) { goto ldv_33870; } else { } first_intf = (int )intf_assoc->bFirstInterface; last_intf = ((int )intf_assoc->bInterfaceCount + -1) + first_intf; if ((int )inum >= first_intf && (int )inum <= last_intf) { if ((unsigned long )retval == (unsigned long )((struct usb_interface_assoc_descriptor *)0)) { retval = intf_assoc; } else { dev_err((struct device const *)(& dev->dev), "Interface #%d referenced by multiple IADs\n", (int )inum); } } else { } ldv_33870: i = i + 1; ldv_33872: ; if (i <= 15 && (unsigned long )config->intf_assoc[i] != (unsigned long )((struct usb_interface_assoc_descriptor *)0)) { goto ldv_33871; } else { } return (retval); } } static void __usb_queue_reset_device(struct work_struct *ws ) { int rc ; struct usb_interface *iface ; struct work_struct const *__mptr ; struct usb_device *udev ; struct usb_device *tmp ; { __mptr = (struct work_struct const *)ws; iface = (struct usb_interface *)__mptr + 0xfffffffffffffb48UL; tmp = interface_to_usbdev(iface); udev = tmp; rc = usb_lock_device_for_reset(udev, (struct usb_interface const *)iface); if (rc >= 0) { iface->reset_running = 1U; usb_reset_device(udev); iface->reset_running = 0U; device_unlock___1(& udev->dev); } else { } return; } } int usb_set_configuration(struct usb_device *dev , int configuration ) { int i ; int ret ; struct usb_host_config *cp ; struct usb_interface **new_interfaces ; struct usb_hcd *hcd ; struct usb_hcd *tmp ; int n ; int nintf ; void *tmp___0 ; void *tmp___1 ; int tmp___2 ; struct usb_interface_cache *intfc ; struct usb_interface *intf ; struct usb_host_interface *alt ; struct lock_class_key __key ; atomic_long_t __constr_expr_0 ; unsigned int tmp___3 ; struct usb_interface *intf___0 ; struct _ddebug descriptor ; char const *tmp___4 ; long tmp___5 ; char const *tmp___6 ; { cp = 0; new_interfaces = 0; tmp = bus_to_hcd(dev->bus); hcd = tmp; if ((unsigned int )*((unsigned char *)dev + 1596UL) == 0U || configuration == -1) { configuration = 0; } else { i = 0; goto ldv_33895; ldv_33894: ; if ((int )(dev->config + (unsigned long )i)->desc.bConfigurationValue == configuration) { cp = dev->config + (unsigned long )i; goto ldv_33893; } else { } i = i + 1; ldv_33895: ; if ((int )dev->descriptor.bNumConfigurations > i) { goto ldv_33894; } else { } ldv_33893: ; } if ((unsigned long )cp == (unsigned long )((struct usb_host_config *)0) && configuration != 0) { return (-22); } else { } if ((unsigned long )cp != (unsigned long )((struct usb_host_config *)0) && configuration == 0) { dev_warn((struct device const *)(& dev->dev), "config 0 descriptor??\n"); } else { } nintf = 0; n = nintf; if ((unsigned long )cp != (unsigned long )((struct usb_host_config *)0)) { nintf = (int )cp->desc.bNumInterfaces; tmp___0 = kmalloc((unsigned long )nintf * 8UL, 16U); new_interfaces = (struct usb_interface **)tmp___0; if ((unsigned long )new_interfaces == (unsigned long )((struct usb_interface **)0)) { dev_err((struct device const *)(& dev->dev), "Out of memory\n"); return (-12); } else { } goto ldv_33901; ldv_33900: tmp___1 = kzalloc(1288UL, 16U); *(new_interfaces + (unsigned long )n) = (struct usb_interface *)tmp___1; if ((unsigned long )*(new_interfaces + (unsigned long )n) == (unsigned long )((struct usb_interface *)0)) { dev_err((struct device const *)(& dev->dev), "Out of memory\n"); ret = -12; free_interfaces: ; goto ldv_33898; ldv_33897: kfree((void const *)*(new_interfaces + (unsigned long )n)); ldv_33898: n = n - 1; if (n >= 0) { goto ldv_33897; } else { } kfree((void const *)new_interfaces); return (ret); } else { } n = n + 1; ldv_33901: ; if (n < nintf) { goto ldv_33900; } else { } i = (int )dev->bus_mA + (int )cp->desc.bMaxPower * -2; if (i < 0) { dev_warn((struct device const *)(& dev->dev), "new config #%d exceeds power limit by %dmA\n", configuration, - i); } else { } } else { } ret = usb_autoresume_device(dev); if (ret != 0) { goto free_interfaces; } else { } if ((unsigned int )dev->state != 6U) { usb_disable_device(dev, 1); } else { } cancel_async_set_config(dev); ldv_mutex_lock_165(hcd->bandwidth_mutex); if ((unsigned long )dev->actconfig != (unsigned long )((struct usb_host_config *)0)) { tmp___2 = usb_disable_lpm(dev); if (tmp___2 != 0) { dev_err((struct device const *)(& dev->dev), "%s Failed to disable LPM\n.", "usb_set_configuration"); ldv_mutex_unlock_166(hcd->bandwidth_mutex); return (-12); } else { } } else { } ret = usb_hcd_alloc_bandwidth(dev, cp, 0, 0); if (ret < 0) { if ((unsigned long )dev->actconfig != (unsigned long )((struct usb_host_config *)0)) { usb_enable_lpm(dev); } else { } ldv_mutex_unlock_167(hcd->bandwidth_mutex); usb_autosuspend_device(dev); goto free_interfaces; } else { } i = 0; goto ldv_33910; ldv_33909: intf = *(new_interfaces + (unsigned long )i); cp->interface[i] = intf; intfc = cp->intf_cache[i]; intf->altsetting = (struct usb_host_interface *)(& intfc->altsetting); intf->num_altsetting = intfc->num_altsetting; kref_get(& intfc->ref); alt = usb_altnum_to_altsetting((struct usb_interface const *)intf, 0U); if ((unsigned long )alt == (unsigned long )((struct usb_host_interface *)0)) { alt = intf->altsetting; } else { } intf->intf_assoc = find_iad(dev, cp, (int )alt->desc.bInterfaceNumber); intf->cur_altsetting = alt; usb_enable_interface(dev, intf, 1); intf->dev.parent = & dev->dev; intf->dev.driver = 0; intf->dev.bus = & usb_bus_type; intf->dev.type = (struct device_type const *)(& usb_if_device_type); intf->dev.groups = (struct attribute_group const **)(& usb_interface_groups); intf->dev.dma_mask = dev->dev.dma_mask; __init_work(& intf->reset_ws, 0); __constr_expr_0.counter = 4195328L; intf->reset_ws.data = __constr_expr_0; lockdep_init_map(& intf->reset_ws.lockdep_map, "(&intf->reset_ws)", & __key, 0); INIT_LIST_HEAD(& intf->reset_ws.entry); intf->reset_ws.func = & __usb_queue_reset_device; intf->minor = -1; device_initialize(& intf->dev); pm_runtime_no_callbacks(& intf->dev); dev_set_name(& intf->dev, "%d-%s:%d.%d", (dev->bus)->busnum, (char *)(& dev->devpath), configuration, (int )alt->desc.bInterfaceNumber); i = i + 1; ldv_33910: ; if (i < nintf) { goto ldv_33909; } else { } kfree((void const *)new_interfaces); tmp___3 = __create_pipe(dev, 0U); ret = usb_control_msg(dev, tmp___3 | 2147483648U, 9, 0, (int )((__u16 )configuration), 0, 0, 0, 5000); if (ret < 0 && (unsigned long )cp != (unsigned long )((struct usb_host_config *)0)) { usb_hcd_alloc_bandwidth(dev, 0, 0, 0); i = 0; goto ldv_33913; ldv_33912: usb_disable_interface(dev, cp->interface[i], 1); put_device(& (cp->interface[i])->dev); cp->interface[i] = 0; i = i + 1; ldv_33913: ; if (i < nintf) { goto ldv_33912; } else { } cp = 0; } else { } dev->actconfig = cp; ldv_mutex_unlock_168(hcd->bandwidth_mutex); if ((unsigned long )cp == (unsigned long )((struct usb_host_config *)0)) { usb_set_device_state(dev, USB_STATE_ADDRESS); usb_autosuspend_device(dev); return (ret); } else { } usb_set_device_state(dev, USB_STATE_CONFIGURED); if ((unsigned long )cp->string == (unsigned long )((char *)0) && (dev->quirks & 8U) == 0U) { cp->string = usb_cache_string(dev, (int )cp->desc.iConfiguration); } else { } usb_unlocked_enable_lpm(dev); usb_enable_ltm(dev); i = 0; goto ldv_33919; ldv_33918: intf___0 = cp->interface[i]; descriptor.modname = "usbcore"; descriptor.function = "usb_set_configuration"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/message.c.prepared"; descriptor.format = "adding %s (config #%d, interface %d)\n"; descriptor.lineno = 2000U; descriptor.flags = 1U; tmp___5 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___5 != 0L) { tmp___4 = dev_name((struct device const *)(& intf___0->dev)); __dynamic_dev_dbg(& descriptor, (struct device const *)(& dev->dev), "adding %s (config #%d, interface %d)\n", tmp___4, configuration, (int )(intf___0->cur_altsetting)->desc.bInterfaceNumber); } else { } device_enable_async_suspend(& intf___0->dev); ret = device_add(& intf___0->dev); if (ret != 0) { tmp___6 = dev_name((struct device const *)(& intf___0->dev)); dev_err((struct device const *)(& dev->dev), "device_add(%s) --> %d\n", tmp___6, ret); goto ldv_33917; } else { } create_intf_ep_devs(intf___0); ldv_33917: i = i + 1; ldv_33919: ; if (i < nintf) { goto ldv_33918; } else { } usb_autosuspend_device(dev); return (0); } } static struct list_head set_config_list = {& set_config_list, & set_config_list}; static spinlock_t set_config_lock = {{{{{0U}}, 3735899821U, 4294967295U, 0xffffffffffffffffUL, {0, {0, 0}, "set_config_lock", 0, 0UL}}}}; static void driver_set_config_work(struct work_struct *work ) { struct set_config_request *req ; struct work_struct const *__mptr ; struct usb_device *udev ; { __mptr = (struct work_struct const *)work; req = (struct set_config_request *)__mptr + 0xfffffffffffffff0UL; udev = req->udev; device_lock___1(& udev->dev); spin_lock(& set_config_lock); list_del(& req->node); spin_unlock(& set_config_lock); if (req->config >= -1) { usb_set_configuration(udev, req->config); } else { } device_unlock___1(& udev->dev); usb_put_dev(udev); kfree((void const *)req); return; } } static void cancel_async_set_config(struct usb_device *udev ) { struct set_config_request *req ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; { spin_lock(& set_config_lock); __mptr = (struct list_head const *)set_config_list.next; req = (struct set_config_request *)__mptr + 0xffffffffffffffa0UL; goto ldv_33945; ldv_33944: ; if ((unsigned long )req->udev == (unsigned long )udev) { req->config = -999; } else { } __mptr___0 = (struct list_head const *)req->node.next; req = (struct set_config_request *)__mptr___0 + 0xffffffffffffffa0UL; ldv_33945: ; if ((unsigned long )(& req->node) != (unsigned long )(& set_config_list)) { goto ldv_33944; } else { } spin_unlock(& set_config_lock); return; } } int usb_driver_set_configuration(struct usb_device *udev , int config ) { struct set_config_request *req ; void *tmp ; struct lock_class_key __key ; atomic_long_t __constr_expr_0 ; { tmp = kmalloc(112UL, 208U); req = (struct set_config_request *)tmp; if ((unsigned long )req == (unsigned long )((struct set_config_request *)0)) { return (-12); } else { } req->udev = udev; req->config = config; __init_work(& req->work, 0); __constr_expr_0.counter = 4195328L; req->work.data = __constr_expr_0; lockdep_init_map(& req->work.lockdep_map, "(&req->work)", & __key, 0); INIT_LIST_HEAD(& req->work.entry); req->work.func = & driver_set_config_work; spin_lock(& set_config_lock); list_add(& req->node, & set_config_list); spin_unlock(& set_config_lock); usb_get_dev(udev); schedule_work(& req->work); return (0); } } void ldv_main4_sequence_infinite_withcheck_stateful(void) { struct device *var_group1 ; int ldv_s_usb_if_device_type_device_type ; int tmp ; int tmp___0 ; { ldv_s_usb_if_device_type_device_type = 0; LDV_IN_INTERRUPT = 1; ldv_initialize(); goto ldv_33984; ldv_33983: tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_s_usb_if_device_type_device_type == 0) { ldv_handler_precall(); usb_release_interface(var_group1); ldv_s_usb_if_device_type_device_type = 0; } else { } goto ldv_33980; case 1: ; goto ldv_33980; default: ; goto ldv_33980; } ldv_33980: ; ldv_33984: tmp___0 = __VERIFIER_nondet_int(); if (tmp___0 != 0 || ldv_s_usb_if_device_type_device_type != 0) { goto ldv_33983; } else { } ldv_check_final_state(); return; } } void ldv_mutex_lock_143(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_144(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_145(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_146(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___2 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_147(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_148(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mtx(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_149(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mtx(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_150(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mtx(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_151(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mtx(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_152(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_153(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_154(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_bandwidth_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_155(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_bandwidth_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_156(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_bandwidth_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_157(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_bandwidth_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_158(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_bandwidth_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_159(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_bandwidth_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_160(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_bandwidth_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_161(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_bandwidth_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_162(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_bandwidth_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_163(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_bandwidth_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_164(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_bandwidth_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_165(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_bandwidth_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_166(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_bandwidth_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_167(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_bandwidth_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_168(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_bandwidth_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } extern int scnprintf(char * , size_t , char const * , ...) ; extern void __cmpxchg_wrong_size(void) ; __inline static int atomic_cmpxchg(atomic_t *v , int old , int new ) { int __ret ; int __old ; int __new ; u8 volatile *__ptr ; u16 volatile *__ptr___0 ; u32 volatile *__ptr___1 ; u64 volatile *__ptr___2 ; { __old = old; __new = new; switch (4UL) { case 1UL: __ptr = (u8 volatile *)(& v->counter); __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; cmpxchgb %2,%1": "=a" (__ret), "+m" (*__ptr): "q" (__new), "0" (__old): "memory"); goto ldv_5490; case 2UL: __ptr___0 = (u16 volatile *)(& v->counter); __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; cmpxchgw %2,%1": "=a" (__ret), "+m" (*__ptr___0): "r" (__new), "0" (__old): "memory"); goto ldv_5490; case 4UL: __ptr___1 = (u32 volatile *)(& v->counter); __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; cmpxchgl %2,%1": "=a" (__ret), "+m" (*__ptr___1): "r" (__new), "0" (__old): "memory"); goto ldv_5490; case 8UL: __ptr___2 = (u64 volatile *)(& v->counter); __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; cmpxchgq %2,%1": "=a" (__ret), "+m" (*__ptr___2): "r" (__new), "0" (__old): "memory"); goto ldv_5490; default: __cmpxchg_wrong_size(); } ldv_5490: ; return (__ret); } } __inline static int __atomic_add_unless(atomic_t *v , int a , int u ) { int c ; int old ; long tmp ; long tmp___0 ; { c = atomic_read((atomic_t const *)v); ldv_5519: tmp = ldv__builtin_expect(c == u, 0L); if (tmp != 0L) { goto ldv_5518; } else { } old = atomic_cmpxchg(v, c, c + a); tmp___0 = ldv__builtin_expect(old == c, 1L); if (tmp___0 != 0L) { goto ldv_5518; } else { } c = old; goto ldv_5519; ldv_5518: ; return (c); } } __inline static int atomic_add_unless(atomic_t *v , int a , int u ) { int tmp ; { tmp = __atomic_add_unless(v, a, u); return (tmp != u); } } int ldv_mutex_trylock_198(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_196(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_199(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_201(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_203(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_205(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_195(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_197(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_200(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_202(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_204(struct mutex *ldv_func_arg1 ) ; extern int device_pm_wait_for_dev(struct device * , struct device * ) ; extern int driver_register(struct device_driver * ) ; extern void driver_unregister(struct device_driver * ) ; extern int driver_create_file(struct device_driver * , struct driver_attribute const * ) ; extern void driver_remove_file(struct device_driver * , struct driver_attribute const * ) ; __inline static void pm_suspend_ignore_children(struct device *dev , bool enable ) { { dev->power.ignore_children = enable; return; } } __inline static void device_lock___2(struct device *dev ) { { ldv_mutex_lock_197(& dev->mutex); return; } } __inline static void device_unlock___2(struct device *dev ) { { ldv_mutex_unlock_199(& dev->mutex); return; } } extern int device_bind_driver(struct device * ) ; extern void device_release_driver(struct device * ) ; extern int device_attach(struct device * ) ; extern int driver_attach(struct device_driver * ) ; extern int __pm_runtime_idle(struct device * , int ) ; extern int __pm_runtime_resume(struct device * , int ) ; extern void pm_runtime_allow(struct device * ) ; extern void pm_runtime_forbid(struct device * ) ; __inline static void pm_runtime_put_noidle(struct device *dev ) { { atomic_add_unless(& dev->power.usage_count, -1, 0); return; } } __inline static int pm_runtime_autosuspend(struct device *dev ) { int tmp ; { tmp = __pm_runtime_suspend(dev, 8); return (tmp); } } __inline static int pm_runtime_resume(struct device *dev ) { int tmp ; { tmp = __pm_runtime_resume(dev, 0); return (tmp); } } __inline static int pm_runtime_get(struct device *dev ) { int tmp ; { tmp = __pm_runtime_resume(dev, 5); return (tmp); } } __inline static int pm_runtime_get_sync(struct device *dev ) { int tmp ; { tmp = __pm_runtime_resume(dev, 4); return (tmp); } } __inline static int pm_runtime_put(struct device *dev ) { int tmp ; { tmp = __pm_runtime_idle(dev, 5); return (tmp); } } __inline static int pm_runtime_put_sync(struct device *dev ) { int tmp ; { tmp = __pm_runtime_idle(dev, 4); return (tmp); } } int usb_autopm_get_interface_async(struct usb_interface *intf ) ; int usb_driver_claim_interface(struct usb_driver *driver , struct usb_interface *iface , void *priv ) ; void usb_driver_release_interface(struct usb_driver *driver , struct usb_interface *iface ) ; struct usb_device_id const *usb_match_id(struct usb_interface *interface , struct usb_device_id const *id ) ; int usb_match_one_id(struct usb_interface *interface , struct usb_device_id const *id ) ; ssize_t usb_store_new_id(struct usb_dynids *dynids , struct device_driver *driver , char const *buf , size_t count ) ; ssize_t usb_show_dynids(struct usb_dynids *dynids , char *buf ) ; int usb_match_one_id_intf(struct usb_device *dev , struct usb_host_interface *intf , struct usb_device_id const *id ) ; int usb_match_device(struct usb_device *dev , struct usb_device_id const *id ) ; __inline static int is_usb_device(struct device const *dev ) { { return ((unsigned long )((struct device_type const *)dev->type) == (unsigned long )((struct device_type const *)(& usb_device_type))); } } __inline static int is_usb_device_driver(struct device_driver *drv ) { struct device_driver const *__mptr ; { __mptr = (struct device_driver const *)drv; return (((struct usbdrv_wrap *)__mptr)->for_devices); } } ssize_t usb_store_new_id(struct usb_dynids *dynids , struct device_driver *driver , char const *buf , size_t count ) { struct usb_dynid *dynid ; u32 idVendor ; u32 idProduct ; unsigned int bInterfaceClass ; int fields ; int retval ; void *tmp ; { idVendor = 0U; idProduct = 0U; bInterfaceClass = 0U; fields = 0; retval = 0; fields = sscanf(buf, "%x %x %x", & idVendor, & idProduct, & bInterfaceClass); if (fields <= 1) { return (-22L); } else { } tmp = kzalloc(48UL, 208U); dynid = (struct usb_dynid *)tmp; if ((unsigned long )dynid == (unsigned long )((struct usb_dynid *)0)) { return (-12L); } else { } INIT_LIST_HEAD(& dynid->node); dynid->id.idVendor = (__u16 )idVendor; dynid->id.idProduct = (__u16 )idProduct; dynid->id.match_flags = 3U; if (fields == 3) { dynid->id.bInterfaceClass = (unsigned char )bInterfaceClass; dynid->id.match_flags = (__u16 )((unsigned int )dynid->id.match_flags | 128U); } else { } spin_lock(& dynids->lock); list_add_tail(& dynid->node, & dynids->list); spin_unlock(& dynids->lock); retval = driver_attach(driver); if (retval != 0) { return ((ssize_t )retval); } else { } return ((ssize_t )count); } } ssize_t usb_show_dynids(struct usb_dynids *dynids , char *buf ) { struct usb_dynid *dynid ; size_t count ; struct list_head const *__mptr ; int tmp ; int tmp___0 ; struct list_head const *__mptr___0 ; { count = 0UL; __mptr = (struct list_head const *)dynids->list.next; dynid = (struct usb_dynid *)__mptr; goto ldv_27690; ldv_27689: ; if ((unsigned int )dynid->id.bInterfaceClass != 0U) { tmp = scnprintf(buf + count, 4096UL - count, "%04x %04x %02x\n", (int )dynid->id.idVendor, (int )dynid->id.idProduct, (int )dynid->id.bInterfaceClass); count = (size_t )tmp + count; } else { tmp___0 = scnprintf(buf + count, 4096UL - count, "%04x %04x\n", (int )dynid->id.idVendor, (int )dynid->id.idProduct); count = (size_t )tmp___0 + count; } __mptr___0 = (struct list_head const *)dynid->node.next; dynid = (struct usb_dynid *)__mptr___0; ldv_27690: ; if ((unsigned long )(& dynid->node) != (unsigned long )(& dynids->list)) { goto ldv_27689; } else { } return ((ssize_t )count); } } static ssize_t show_dynids(struct device_driver *driver , char *buf ) { struct usb_driver *usb_drv ; struct device_driver const *__mptr ; ssize_t tmp ; { __mptr = (struct device_driver const *)driver; usb_drv = (struct usb_driver *)__mptr + 0xffffffffffffff58UL; tmp = usb_show_dynids(& usb_drv->dynids, buf); return (tmp); } } static ssize_t store_new_id(struct device_driver *driver , char const *buf , size_t count ) { struct usb_driver *usb_drv ; struct device_driver const *__mptr ; ssize_t tmp ; { __mptr = (struct device_driver const *)driver; usb_drv = (struct usb_driver *)__mptr + 0xffffffffffffff58UL; tmp = usb_store_new_id(& usb_drv->dynids, driver, buf, count); return (tmp); } } static struct driver_attribute driver_attr_new_id = {{"new_id", 420U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_dynids, & store_new_id}; static ssize_t store_remove_id(struct device_driver *driver , char const *buf , size_t count ) { struct usb_dynid *dynid ; struct usb_dynid *n ; struct usb_driver *usb_driver ; struct device_driver const *__mptr ; u32 idVendor ; u32 idProduct ; int fields ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; struct usb_device_id *id ; struct list_head const *__mptr___2 ; { __mptr = (struct device_driver const *)driver; usb_driver = (struct usb_driver *)__mptr + 0xffffffffffffff58UL; fields = sscanf(buf, "%x %x", & idVendor, & idProduct); if (fields <= 1) { return (-22L); } else { } spin_lock(& usb_driver->dynids.lock); __mptr___0 = (struct list_head const *)usb_driver->dynids.list.next; dynid = (struct usb_dynid *)__mptr___0; __mptr___1 = (struct list_head const *)dynid->node.next; n = (struct usb_dynid *)__mptr___1; goto ldv_27737; ldv_27736: id = & dynid->id; if ((u32 )id->idVendor == idVendor && (u32 )id->idProduct == idProduct) { list_del(& dynid->node); kfree((void const *)dynid); goto ldv_27735; } else { } dynid = n; __mptr___2 = (struct list_head const *)n->node.next; n = (struct usb_dynid *)__mptr___2; ldv_27737: ; if ((unsigned long )(& dynid->node) != (unsigned long )(& usb_driver->dynids.list)) { goto ldv_27736; } else { } ldv_27735: spin_unlock(& usb_driver->dynids.lock); return ((ssize_t )count); } } static struct driver_attribute driver_attr_remove_id = {{"remove_id", 420U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_dynids, & store_remove_id}; static int usb_create_newid_files(struct usb_driver *usb_drv ) { int error ; { error = 0; if ((unsigned int )*((unsigned char *)usb_drv + 288UL) != 0U) { goto exit; } else { } if ((unsigned long )usb_drv->probe != (unsigned long )((int (*)(struct usb_interface * , struct usb_device_id const * ))0)) { error = driver_create_file(& usb_drv->drvwrap.driver, (struct driver_attribute const *)(& driver_attr_new_id)); if (error == 0) { error = driver_create_file(& usb_drv->drvwrap.driver, (struct driver_attribute const *)(& driver_attr_remove_id)); if (error != 0) { driver_remove_file(& usb_drv->drvwrap.driver, (struct driver_attribute const *)(& driver_attr_new_id)); } else { } } else { } } else { } exit: ; return (error); } } static void usb_remove_newid_files(struct usb_driver *usb_drv ) { { if ((unsigned int )*((unsigned char *)usb_drv + 288UL) != 0U) { return; } else { } if ((unsigned long )usb_drv->probe != (unsigned long )((int (*)(struct usb_interface * , struct usb_device_id const * ))0)) { driver_remove_file(& usb_drv->drvwrap.driver, (struct driver_attribute const *)(& driver_attr_remove_id)); driver_remove_file(& usb_drv->drvwrap.driver, (struct driver_attribute const *)(& driver_attr_new_id)); } else { } return; } } static void usb_free_dynids(struct usb_driver *usb_drv ) { struct usb_dynid *dynid ; struct usb_dynid *n ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; { spin_lock(& usb_drv->dynids.lock); __mptr = (struct list_head const *)usb_drv->dynids.list.next; dynid = (struct usb_dynid *)__mptr; __mptr___0 = (struct list_head const *)dynid->node.next; n = (struct usb_dynid *)__mptr___0; goto ldv_27759; ldv_27758: list_del(& dynid->node); kfree((void const *)dynid); dynid = n; __mptr___1 = (struct list_head const *)n->node.next; n = (struct usb_dynid *)__mptr___1; ldv_27759: ; if ((unsigned long )(& dynid->node) != (unsigned long )(& usb_drv->dynids.list)) { goto ldv_27758; } else { } spin_unlock(& usb_drv->dynids.lock); return; } } static struct usb_device_id const *usb_match_dynamic_id(struct usb_interface *intf , struct usb_driver *drv ) { struct usb_dynid *dynid ; struct list_head const *__mptr ; int tmp ; struct list_head const *__mptr___0 ; { spin_lock(& drv->dynids.lock); __mptr = (struct list_head const *)drv->dynids.list.next; dynid = (struct usb_dynid *)__mptr; goto ldv_27771; ldv_27770: tmp = usb_match_one_id(intf, (struct usb_device_id const *)(& dynid->id)); if (tmp != 0) { spin_unlock(& drv->dynids.lock); return ((struct usb_device_id const *)(& dynid->id)); } else { } __mptr___0 = (struct list_head const *)dynid->node.next; dynid = (struct usb_dynid *)__mptr___0; ldv_27771: ; if ((unsigned long )(& dynid->node) != (unsigned long )(& drv->dynids.list)) { goto ldv_27770; } else { } spin_unlock(& drv->dynids.lock); return (0); } } static int usb_probe_device(struct device *dev ) { struct usb_device_driver *udriver ; struct device_driver const *__mptr ; struct usb_device *udev ; struct device const *__mptr___0 ; int error ; struct _ddebug descriptor ; long tmp ; { __mptr = (struct device_driver const *)dev->driver; udriver = (struct usb_device_driver *)__mptr + 0xffffffffffffffd8UL; __mptr___0 = (struct device const *)dev; udev = (struct usb_device *)__mptr___0 + 0xffffffffffffff78UL; error = 0; descriptor.modname = "usbcore"; descriptor.function = "usb_probe_device"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/driver.c.prepared"; descriptor.format = "%s\n"; descriptor.lineno = 332U; descriptor.flags = 1U; tmp = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)dev, "%s\n", "usb_probe_device"); } else { } if ((unsigned int )*((unsigned char *)udriver + 160UL) == 0U) { error = usb_autoresume_device(udev); } else { } if (error == 0) { error = (*(udriver->probe))(udev); } else { } return (error); } } static int usb_unbind_device(struct device *dev ) { struct usb_device *udev ; struct device const *__mptr ; struct usb_device_driver *udriver ; struct device_driver const *__mptr___0 ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; __mptr___0 = (struct device_driver const *)dev->driver; udriver = (struct usb_device_driver *)__mptr___0 + 0xffffffffffffffd8UL; (*(udriver->disconnect))(udev); if ((unsigned int )*((unsigned char *)udriver + 160UL) == 0U) { usb_autosuspend_device(udev); } else { } return (0); } } static void usb_cancel_queued_reset(struct usb_interface *iface ) { { if ((unsigned int )*((unsigned char *)iface + 40UL) == 0U) { cancel_work_sync(& iface->reset_ws); } else { } return; } } static int usb_probe_interface(struct device *dev ) { struct usb_driver *driver ; struct device_driver const *__mptr ; struct usb_interface *intf ; struct device const *__mptr___0 ; struct usb_device *udev ; struct usb_device *tmp ; struct usb_device_id const *id ; int error ; int lpm_disable_error ; struct _ddebug descriptor ; long tmp___0 ; bool tmp___1 ; struct _ddebug descriptor___0 ; long tmp___2 ; { __mptr = (struct device_driver const *)dev->driver; driver = (struct usb_driver *)__mptr + 0xffffffffffffff58UL; __mptr___0 = (struct device const *)dev; intf = (struct usb_interface *)__mptr___0 + 0xffffffffffffffd0UL; tmp = interface_to_usbdev(intf); udev = tmp; error = -19; descriptor.modname = "usbcore"; descriptor.function = "usb_probe_interface"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/driver.c.prepared"; descriptor.format = "%s\n"; descriptor.lineno = 384U; descriptor.flags = 1U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)dev, "%s\n", "usb_probe_interface"); } else { } intf->needs_binding = 0U; tmp___1 = usb_device_is_owned(udev); if ((int )tmp___1) { return (error); } else { } if ((unsigned int )*((unsigned char *)udev + 1596UL) == 0U) { dev_err((struct device const *)(& intf->dev), "Device is not authorized for usage\n"); return (error); } else { } id = usb_match_id(intf, driver->id_table); if ((unsigned long )id == (unsigned long )((struct usb_device_id const *)0)) { id = usb_match_dynamic_id(intf, driver); } else { } if ((unsigned long )id == (unsigned long )((struct usb_device_id const *)0)) { return (error); } else { } descriptor___0.modname = "usbcore"; descriptor___0.function = "usb_probe_interface"; descriptor___0.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/driver.c.prepared"; descriptor___0.format = "%s - got id\n"; descriptor___0.lineno = 402U; descriptor___0.flags = 1U; tmp___2 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___2 != 0L) { __dynamic_dev_dbg(& descriptor___0, (struct device const *)dev, "%s - got id\n", "usb_probe_interface"); } else { } error = usb_autoresume_device(udev); if (error != 0) { return (error); } else { } intf->condition = USB_INTERFACE_BINDING; pm_runtime_set_active(dev); pm_suspend_ignore_children(dev, 0); if ((unsigned int )*((unsigned char *)driver + 288UL) != 0U) { pm_runtime_enable(dev); } else { } lpm_disable_error = usb_unlocked_disable_lpm(udev); if (lpm_disable_error != 0 && (unsigned int )*((unsigned char *)driver + 288UL) != 0U) { dev_err((struct device const *)(& intf->dev), "%s Failed to disable LPM for driver %s\n.", "usb_probe_interface", driver->name); error = lpm_disable_error; goto err; } else { } if ((unsigned int )*((unsigned char *)intf + 40UL) != 0U) { error = usb_set_interface(udev, (int )(intf->altsetting)->desc.bInterfaceNumber, 0); if (error < 0) { goto err; } else { } intf->needs_altsetting0 = 0U; } else { } error = (*(driver->probe))(intf, id); if (error != 0) { goto err; } else { } intf->condition = USB_INTERFACE_BOUND; if (lpm_disable_error == 0) { usb_unlocked_enable_lpm(udev); } else { } usb_autosuspend_device(udev); return (error); err: usb_set_intfdata(intf, 0); intf->needs_remote_wakeup = 0U; intf->condition = USB_INTERFACE_UNBOUND; usb_cancel_queued_reset(intf); if (lpm_disable_error == 0) { usb_unlocked_enable_lpm(udev); } else { } if ((unsigned int )*((unsigned char *)driver + 288UL) != 0U) { pm_runtime_disable(dev); } else { } pm_runtime_set_suspended(dev); usb_autosuspend_device(udev); return (error); } } static int usb_unbind_interface(struct device *dev ) { struct usb_driver *driver ; struct device_driver const *__mptr ; struct usb_interface *intf ; struct device const *__mptr___0 ; struct usb_device *udev ; int error ; int r ; int lpm_disable_error ; { __mptr = (struct device_driver const *)dev->driver; driver = (struct usb_driver *)__mptr + 0xffffffffffffff58UL; __mptr___0 = (struct device const *)dev; intf = (struct usb_interface *)__mptr___0 + 0xffffffffffffffd0UL; intf->condition = USB_INTERFACE_UNBINDING; udev = interface_to_usbdev(intf); error = usb_autoresume_device(udev); lpm_disable_error = usb_unlocked_disable_lpm(udev); if ((unsigned int )*((unsigned char *)driver + 288UL) == 0U) { usb_disable_interface(udev, intf, 0); } else { } (*(driver->disconnect))(intf); usb_cancel_queued_reset(intf); if ((unsigned int )(intf->cur_altsetting)->desc.bAlternateSetting == 0U) { usb_enable_interface(udev, intf, 0); } else if (error == 0 && ! intf->dev.power.is_prepared) { r = usb_set_interface(udev, (int )(intf->altsetting)->desc.bInterfaceNumber, 0); if (r < 0) { intf->needs_altsetting0 = 1U; } else { } } else { intf->needs_altsetting0 = 1U; } usb_set_intfdata(intf, 0); intf->condition = USB_INTERFACE_UNBOUND; intf->needs_remote_wakeup = 0U; if (lpm_disable_error == 0) { usb_unlocked_enable_lpm(udev); } else { } if ((unsigned int )*((unsigned char *)driver + 288UL) != 0U) { pm_runtime_disable(dev); } else { } pm_runtime_set_suspended(dev); r = atomic_read((atomic_t const *)(& intf->pm_usage_cnt)); goto ldv_27828; ldv_27827: usb_autopm_put_interface_no_suspend(intf); r = r - 1; ldv_27828: ; if (r > 0) { goto ldv_27827; } else { } atomic_set(& intf->pm_usage_cnt, 0); if (error == 0) { usb_autosuspend_device(udev); } else { } return (0); } } int usb_driver_claim_interface(struct usb_driver *driver , struct usb_interface *iface , void *priv ) { struct device *dev ; struct usb_device *udev ; int retval ; int lpm_disable_error ; int tmp ; { dev = & iface->dev; retval = 0; if ((unsigned long )dev->driver != (unsigned long )((struct device_driver *)0)) { return (-16); } else { } udev = interface_to_usbdev(iface); dev->driver = & driver->drvwrap.driver; usb_set_intfdata(iface, priv); iface->needs_binding = 0U; iface->condition = USB_INTERFACE_BOUND; lpm_disable_error = usb_unlocked_disable_lpm(udev); if (lpm_disable_error != 0 && (unsigned int )*((unsigned char *)driver + 288UL) != 0U) { dev_err((struct device const *)(& iface->dev), "%s Failed to disable LPM for driver %s\n.", "usb_driver_claim_interface", driver->name); return (-12); } else { } pm_suspend_ignore_children(dev, 0); if ((unsigned int )*((unsigned char *)driver + 288UL) != 0U) { pm_runtime_enable(dev); } else { pm_runtime_set_active(dev); } tmp = device_is_registered(dev); if (tmp != 0) { retval = device_bind_driver(dev); } else { } if (lpm_disable_error == 0) { usb_unlocked_enable_lpm(udev); } else { } return (retval); } } void usb_driver_release_interface(struct usb_driver *driver , struct usb_interface *iface ) { struct device *dev ; int tmp ; { dev = & iface->dev; if ((unsigned long )dev->driver == (unsigned long )((struct device_driver *)0) || (unsigned long )dev->driver != (unsigned long )(& driver->drvwrap.driver)) { return; } else { } if ((unsigned int )iface->condition != 2U) { return; } else { } iface->condition = USB_INTERFACE_UNBINDING; tmp = device_is_registered(dev); if (tmp != 0) { device_release_driver(dev); } else { device_lock___2(dev); usb_unbind_interface(dev); dev->driver = 0; device_unlock___2(dev); } return; } } int usb_match_device(struct usb_device *dev , struct usb_device_id const *id ) { { if ((int )id->match_flags & 1 && (int )((unsigned short )id->idVendor) != (int )dev->descriptor.idVendor) { return (0); } else { } if (((int )id->match_flags & 2) != 0 && (int )((unsigned short )id->idProduct) != (int )dev->descriptor.idProduct) { return (0); } else { } if (((int )id->match_flags & 4) != 0 && (int )((unsigned short )id->bcdDevice_lo) > (int )dev->descriptor.bcdDevice) { return (0); } else { } if (((int )id->match_flags & 8) != 0 && (int )((unsigned short )id->bcdDevice_hi) < (int )dev->descriptor.bcdDevice) { return (0); } else { } if (((int )id->match_flags & 16) != 0 && (int )((unsigned char )id->bDeviceClass) != (int )dev->descriptor.bDeviceClass) { return (0); } else { } if (((int )id->match_flags & 32) != 0 && (int )((unsigned char )id->bDeviceSubClass) != (int )dev->descriptor.bDeviceSubClass) { return (0); } else { } if (((int )id->match_flags & 64) != 0 && (int )((unsigned char )id->bDeviceProtocol) != (int )dev->descriptor.bDeviceProtocol) { return (0); } else { } return (1); } } int usb_match_one_id_intf(struct usb_device *dev , struct usb_host_interface *intf , struct usb_device_id const *id ) { { if (((unsigned int )dev->descriptor.bDeviceClass == 255U && ((int )id->match_flags & 1) == 0) && ((int )id->match_flags & 1920) != 0) { return (0); } else { } if (((int )id->match_flags & 128) != 0 && (int )((unsigned char )id->bInterfaceClass) != (int )intf->desc.bInterfaceClass) { return (0); } else { } if (((int )id->match_flags & 256) != 0 && (int )((unsigned char )id->bInterfaceSubClass) != (int )intf->desc.bInterfaceSubClass) { return (0); } else { } if (((int )id->match_flags & 512) != 0 && (int )((unsigned char )id->bInterfaceProtocol) != (int )intf->desc.bInterfaceProtocol) { return (0); } else { } if (((int )id->match_flags & 1024) != 0 && (int )((unsigned char )id->bInterfaceNumber) != (int )intf->desc.bInterfaceNumber) { return (0); } else { } return (1); } } int usb_match_one_id(struct usb_interface *interface , struct usb_device_id const *id ) { struct usb_host_interface *intf ; struct usb_device *dev ; int tmp ; int tmp___0 ; { if ((unsigned long )id == (unsigned long )((struct usb_device_id const *)0)) { return (0); } else { } intf = interface->cur_altsetting; dev = interface_to_usbdev(interface); tmp = usb_match_device(dev, id); if (tmp == 0) { return (0); } else { } tmp___0 = usb_match_one_id_intf(dev, intf, id); return (tmp___0); } } struct usb_device_id const *usb_match_id(struct usb_interface *interface , struct usb_device_id const *id ) { int tmp ; { if ((unsigned long )id == (unsigned long )((struct usb_device_id const *)0)) { return (0); } else { } goto ldv_27887; ldv_27886: tmp = usb_match_one_id(interface, id); if (tmp != 0) { return (id); } else { } id = id + 1; ldv_27887: ; if (((((unsigned int )((unsigned short )id->idVendor) != 0U || (unsigned int )((unsigned short )id->idProduct) != 0U) || (unsigned int )((unsigned char )id->bDeviceClass) != 0U) || (unsigned int )((unsigned char )id->bInterfaceClass) != 0U) || (unsigned long )id->driver_info != 0UL) { goto ldv_27886; } else { } return (0); } } static int usb_device_match(struct device *dev , struct device_driver *drv ) { int tmp ; struct usb_interface *intf ; struct usb_driver *usb_drv ; struct usb_device_id const *id ; int tmp___0 ; struct device const *__mptr ; struct device_driver const *__mptr___0 ; int tmp___1 ; int tmp___2 ; { tmp___2 = is_usb_device((struct device const *)dev); if (tmp___2 != 0) { tmp = is_usb_device_driver(drv); if (tmp == 0) { return (0); } else { } return (1); } else { tmp___1 = is_usb_interface((struct device const *)dev); if (tmp___1 != 0) { tmp___0 = is_usb_device_driver(drv); if (tmp___0 != 0) { return (0); } else { } __mptr = (struct device const *)dev; intf = (struct usb_interface *)__mptr + 0xffffffffffffffd0UL; __mptr___0 = (struct device_driver const *)drv; usb_drv = (struct usb_driver *)__mptr___0 + 0xffffffffffffff58UL; id = usb_match_id(intf, usb_drv->id_table); if ((unsigned long )id != (unsigned long )((struct usb_device_id const *)0)) { return (1); } else { } id = usb_match_dynamic_id(intf, usb_drv); if ((unsigned long )id != (unsigned long )((struct usb_device_id const *)0)) { return (1); } else { } } else { } } return (0); } } static int usb_uevent(struct device *dev , struct kobj_uevent_env *env ) { struct usb_device *usb_dev ; struct device const *__mptr ; struct usb_interface *intf ; struct device const *__mptr___0 ; int tmp ; int tmp___0 ; struct _ddebug descriptor ; char const *tmp___1 ; long tmp___2 ; struct _ddebug descriptor___0 ; char const *tmp___3 ; long tmp___4 ; int tmp___5 ; int tmp___6 ; { tmp___0 = is_usb_device((struct device const *)dev); if (tmp___0 != 0) { __mptr = (struct device const *)dev; usb_dev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; } else { tmp = is_usb_interface((struct device const *)dev); if (tmp != 0) { __mptr___0 = (struct device const *)dev; intf = (struct usb_interface *)__mptr___0 + 0xffffffffffffffd0UL; usb_dev = interface_to_usbdev(intf); } else { return (0); } } if (usb_dev->devnum < 0) { descriptor.modname = "usbcore"; descriptor.function = "usb_uevent"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/driver.c.prepared"; descriptor.format = "usb %s: already deleted?\n"; descriptor.lineno = 906U; descriptor.flags = 1U; tmp___2 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___2 != 0L) { tmp___1 = dev_name((struct device const *)dev); __dynamic_pr_debug(& descriptor, "usb %s: already deleted?\n", tmp___1); } else { } return (-19); } else { } if ((unsigned long )usb_dev->bus == (unsigned long )((struct usb_bus *)0)) { descriptor___0.modname = "usbcore"; descriptor___0.function = "usb_uevent"; descriptor___0.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/driver.c.prepared"; descriptor___0.format = "usb %s: bus removed?\n"; descriptor___0.lineno = 910U; descriptor___0.flags = 1U; tmp___4 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___4 != 0L) { tmp___3 = dev_name((struct device const *)dev); __dynamic_pr_debug(& descriptor___0, "usb %s: bus removed?\n", tmp___3); } else { } return (-19); } else { } tmp___5 = add_uevent_var(env, "PRODUCT=%x/%x/%x", (int )usb_dev->descriptor.idVendor, (int )usb_dev->descriptor.idProduct, (int )usb_dev->descriptor.bcdDevice); if (tmp___5 != 0) { return (-12); } else { } tmp___6 = add_uevent_var(env, "TYPE=%d/%d/%d", (int )usb_dev->descriptor.bDeviceClass, (int )usb_dev->descriptor.bDeviceSubClass, (int )usb_dev->descriptor.bDeviceProtocol); if (tmp___6 != 0) { return (-12); } else { } return (0); } } int usb_register_device_driver(struct usb_device_driver *new_udriver , struct module *owner ) { int retval ; int tmp ; { retval = 0; tmp = usb_disabled(); if (tmp != 0) { return (-19); } else { } new_udriver->drvwrap.for_devices = 1; new_udriver->drvwrap.driver.name = new_udriver->name; new_udriver->drvwrap.driver.bus = & usb_bus_type; new_udriver->drvwrap.driver.probe = & usb_probe_device; new_udriver->drvwrap.driver.remove = & usb_unbind_device; new_udriver->drvwrap.driver.owner = owner; retval = driver_register(& new_udriver->drvwrap.driver); if (retval == 0) { printk("\016%s: registered new device driver %s\n", usbcore_name, new_udriver->name); } else { printk("\v%s: error %d registering device \tdriver %s\n", usbcore_name, retval, new_udriver->name); } return (retval); } } void usb_deregister_device_driver(struct usb_device_driver *udriver ) { { printk("\016%s: deregistering device driver %s\n", usbcore_name, udriver->name); driver_unregister(& udriver->drvwrap.driver); return; } } int usb_register_driver(struct usb_driver *new_driver , struct module *owner , char const *mod_name ) { int retval ; int tmp ; struct lock_class_key __key ; { retval = 0; tmp = usb_disabled(); if (tmp != 0) { return (-19); } else { } new_driver->drvwrap.for_devices = 0; new_driver->drvwrap.driver.name = new_driver->name; new_driver->drvwrap.driver.bus = & usb_bus_type; new_driver->drvwrap.driver.probe = & usb_probe_interface; new_driver->drvwrap.driver.remove = & usb_unbind_interface; new_driver->drvwrap.driver.owner = owner; new_driver->drvwrap.driver.mod_name = mod_name; spinlock_check(& new_driver->dynids.lock); __raw_spin_lock_init(& new_driver->dynids.lock.ldv_5957.rlock, "&(&new_driver->dynids.lock)->rlock", & __key); INIT_LIST_HEAD(& new_driver->dynids.list); retval = driver_register(& new_driver->drvwrap.driver); if (retval != 0) { goto out; } else { } retval = usb_create_newid_files(new_driver); if (retval != 0) { goto out_newid; } else { } printk("\016%s: registered new interface driver %s\n", usbcore_name, new_driver->name); out: ; return (retval); out_newid: driver_unregister(& new_driver->drvwrap.driver); printk("\v%s: error %d registering interface \tdriver %s\n", usbcore_name, retval, new_driver->name); goto out; } } void usb_deregister(struct usb_driver *driver ) { { printk("\016%s: deregistering interface driver %s\n", usbcore_name, driver->name); usb_remove_newid_files(driver); driver_unregister(& driver->drvwrap.driver); usb_free_dynids(driver); return; } } void usb_forced_unbind_intf(struct usb_interface *intf ) { struct usb_driver *driver ; struct device_driver const *__mptr ; struct _ddebug descriptor ; long tmp ; { __mptr = (struct device_driver const *)intf->dev.driver; driver = (struct usb_driver *)__mptr + 0xffffffffffffff58UL; descriptor.modname = "usbcore"; descriptor.function = "usb_forced_unbind_intf"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/driver.c.prepared"; descriptor.format = "forced unbind\n"; descriptor.lineno = 1084U; descriptor.flags = 1U; tmp = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)(& intf->dev), "forced unbind\n"); } else { } usb_driver_release_interface(driver, intf); intf->needs_binding = 1U; return; } } void usb_rebind_intf(struct usb_interface *intf ) { int rc ; { if ((unsigned long )intf->dev.driver != (unsigned long )((struct device_driver *)0)) { usb_forced_unbind_intf(intf); } else { } if (! intf->dev.power.is_prepared) { intf->needs_binding = 0U; rc = device_attach(& intf->dev); if (rc < 0) { dev_warn((struct device const *)(& intf->dev), "rebind failed: %d\n", rc); } else { } } else { } return; } } static void unbind_no_pm_drivers_interfaces(struct usb_device *udev ) { struct usb_host_config *config ; int i ; struct usb_interface *intf ; struct usb_driver *drv ; struct device_driver const *__mptr ; { config = udev->actconfig; if ((unsigned long )config != (unsigned long )((struct usb_host_config *)0)) { i = 0; goto ldv_27989; ldv_27988: intf = config->interface[i]; if ((unsigned long )intf->dev.driver != (unsigned long )((struct device_driver *)0)) { __mptr = (struct device_driver const *)intf->dev.driver; drv = (struct usb_driver *)__mptr + 0xffffffffffffff58UL; if ((unsigned long )drv->suspend == (unsigned long )((int (*)(struct usb_interface * , pm_message_t ))0) || (unsigned long )drv->resume == (unsigned long )((int (*)(struct usb_interface * ))0)) { usb_forced_unbind_intf(intf); } else { } } else { } i = i + 1; ldv_27989: ; if ((int )config->desc.bNumInterfaces > i) { goto ldv_27988; } else { } } else { } return; } } static void unbind_no_reset_resume_drivers_interfaces(struct usb_device *udev ) { struct usb_host_config *config ; int i ; struct usb_interface *intf ; { config = udev->actconfig; if ((unsigned long )config != (unsigned long )((struct usb_host_config *)0)) { i = 0; goto ldv_27998; ldv_27997: intf = config->interface[i]; if ((unsigned long )intf->dev.driver != (unsigned long )((struct device_driver *)0) && (unsigned int )*((unsigned char *)intf + 40UL) != 0U) { usb_forced_unbind_intf(intf); } else { } i = i + 1; ldv_27998: ; if ((int )config->desc.bNumInterfaces > i) { goto ldv_27997; } else { } } else { } return; } } static void do_rebind_interfaces(struct usb_device *udev ) { struct usb_host_config *config ; int i ; struct usb_interface *intf ; { config = udev->actconfig; if ((unsigned long )config != (unsigned long )((struct usb_host_config *)0)) { i = 0; goto ldv_28007; ldv_28006: intf = config->interface[i]; if ((unsigned int )*((unsigned char *)intf + 40UL) != 0U) { usb_rebind_intf(intf); } else { } i = i + 1; ldv_28007: ; if ((int )config->desc.bNumInterfaces > i) { goto ldv_28006; } else { } } else { } return; } } static int usb_suspend_device(struct usb_device *udev , pm_message_t msg ) { struct usb_device_driver *udriver ; int status ; struct device_driver const *__mptr ; { status = 0; if ((unsigned int )udev->state == 0U || (unsigned int )udev->state == 8U) { goto done; } else { } if ((unsigned long )udev->dev.driver != (unsigned long )((struct device_driver *)0)) { __mptr = (struct device_driver const *)udev->dev.driver; udriver = (struct usb_device_driver *)__mptr + 0xffffffffffffffd8UL; } else { udev->do_remote_wakeup = 0U; udriver = & usb_generic_driver; } status = (*(udriver->suspend))(udev, msg); done: ; return (status); } } static int usb_resume_device(struct usb_device *udev , pm_message_t msg ) { struct usb_device_driver *udriver ; int status ; struct device_driver const *__mptr ; { status = 0; if ((unsigned int )udev->state == 0U) { goto done; } else { } if ((unsigned long )udev->dev.driver == (unsigned long )((struct device_driver *)0)) { status = -107; goto done; } else { } if (((msg.event & 1024) == 0 && (unsigned long )udev->parent != (unsigned long )((struct usb_device *)0)) && (unsigned long )(udev->bus)->hs_companion != (unsigned long )((struct usb_bus *)0)) { device_pm_wait_for_dev(& udev->dev, & (((udev->bus)->hs_companion)->root_hub)->dev); } else { } if ((udev->quirks & 2U) != 0U) { udev->reset_resume = 1U; } else { } __mptr = (struct device_driver const *)udev->dev.driver; udriver = (struct usb_device_driver *)__mptr + 0xffffffffffffffd8UL; status = (*(udriver->resume))(udev, msg); done: ; return (status); } } static int usb_suspend_interface(struct usb_device *udev , struct usb_interface *intf , pm_message_t msg ) { struct usb_driver *driver ; int status ; struct device_driver const *__mptr ; { status = 0; if ((unsigned int )udev->state == 0U || (unsigned int )intf->condition == 0U) { goto done; } else { } __mptr = (struct device_driver const *)intf->dev.driver; driver = (struct usb_driver *)__mptr + 0xffffffffffffff58UL; status = (*(driver->suspend))(intf, msg); if (status != 0 && (msg.event & 1024) == 0) { dev_err((struct device const *)(& intf->dev), "suspend error %d\n", status); } else { } done: ; return (status); } } static int usb_resume_interface(struct usb_device *udev , struct usb_interface *intf , pm_message_t msg , int reset_resume ) { struct usb_driver *driver ; int status ; struct device_driver const *__mptr ; { status = 0; if ((unsigned int )udev->state == 0U) { goto done; } else { } if ((unsigned int )intf->condition == 3U) { goto done; } else { } if ((unsigned int )intf->condition == 0U) { if ((unsigned int )*((unsigned char *)intf + 40UL) != 0U && ! intf->dev.power.is_prepared) { usb_set_interface(udev, (int )(intf->altsetting)->desc.bInterfaceNumber, 0); intf->needs_altsetting0 = 0U; } else { } goto done; } else { } if ((unsigned int )*((unsigned char *)intf + 40UL) != 0U) { goto done; } else { } __mptr = (struct device_driver const *)intf->dev.driver; driver = (struct usb_driver *)__mptr + 0xffffffffffffff58UL; if (reset_resume != 0) { if ((unsigned long )driver->reset_resume != (unsigned long )((int (*)(struct usb_interface * ))0)) { status = (*(driver->reset_resume))(intf); if (status != 0) { dev_err((struct device const *)(& intf->dev), "%s error %d\n", (char *)"reset_resume", status); } else { } } else { intf->needs_binding = 1U; dev_warn((struct device const *)(& intf->dev), "no %s for driver %s?\n", (char *)"reset_resume", driver->name); } } else { status = (*(driver->resume))(intf); if (status != 0) { dev_err((struct device const *)(& intf->dev), "resume error %d\n", status); } else { } } done: ; return (status); } } static int usb_suspend_both(struct usb_device *udev , pm_message_t msg ) { int status ; int i ; int n ; struct usb_interface *intf ; { status = 0; i = 0; n = 0; if ((unsigned int )udev->state == 0U || (unsigned int )udev->state == 8U) { goto done; } else { } if ((unsigned long )udev->actconfig != (unsigned long )((struct usb_host_config *)0)) { n = (int )(udev->actconfig)->desc.bNumInterfaces; i = n + -1; goto ldv_28067; ldv_28066: intf = (udev->actconfig)->interface[i]; status = usb_suspend_interface(udev, intf, msg); if ((msg.event & 1024) == 0) { status = 0; } else { } if (status != 0) { goto ldv_28065; } else { } i = i - 1; ldv_28067: ; if (i >= 0) { goto ldv_28066; } else { } ldv_28065: ; } else { } if (status == 0) { status = usb_suspend_device(udev, msg); if ((unsigned long )udev->parent != (unsigned long )((struct usb_device *)0) && (msg.event & 1024) == 0) { status = 0; } else { } } else { } if (status != 0) { msg.event = msg.event ^ 18; goto ldv_28069; ldv_28068: intf = (udev->actconfig)->interface[i]; usb_resume_interface(udev, intf, msg, 0); ldv_28069: i = i + 1; if (i < n) { goto ldv_28068; } else { } } else { udev->can_submit = 0U; i = 0; goto ldv_28072; ldv_28071: usb_hcd_flush_endpoint(udev, udev->ep_out[i]); usb_hcd_flush_endpoint(udev, udev->ep_in[i]); i = i + 1; ldv_28072: ; if (i <= 15) { goto ldv_28071; } else { } } done: ; return (status); } } static int usb_resume_both(struct usb_device *udev , pm_message_t msg ) { int status ; int i ; struct usb_interface *intf ; { status = 0; if ((unsigned int )udev->state == 0U) { status = -19; goto done; } else { } udev->can_submit = 1U; if ((unsigned int )udev->state == 8U || (unsigned int )*((unsigned char *)udev + 1680UL) != 0U) { status = usb_resume_device(udev, msg); } else { } if (status == 0 && (unsigned long )udev->actconfig != (unsigned long )((struct usb_host_config *)0)) { i = 0; goto ldv_28085; ldv_28084: intf = (udev->actconfig)->interface[i]; usb_resume_interface(udev, intf, msg, (int )udev->reset_resume); i = i + 1; ldv_28085: ; if ((int )(udev->actconfig)->desc.bNumInterfaces > i) { goto ldv_28084; } else { } } else { } usb_mark_last_busy(udev); done: ; if (status == 0) { udev->reset_resume = 0U; } else { } return (status); } } static void choose_wakeup(struct usb_device *udev , pm_message_t msg ) { int w ; bool tmp ; { if (msg.event == 1 || msg.event == 8) { if ((unsigned int )udev->state != 8U) { udev->do_remote_wakeup = 0U; } else { } return; } else { } tmp = device_may_wakeup(& udev->dev); w = (int )tmp; if ((unsigned int )udev->state == 8U && (int )udev->do_remote_wakeup != w) { pm_runtime_resume(& udev->dev); } else { } udev->do_remote_wakeup = (unsigned char )w; return; } } int usb_suspend(struct device *dev , pm_message_t msg ) { struct usb_device *udev ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; unbind_no_pm_drivers_interfaces(udev); choose_wakeup(udev, msg); tmp = usb_suspend_both(udev, msg); return (tmp); } } int usb_resume_complete(struct device *dev ) { struct usb_device *udev ; struct device const *__mptr ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; if ((unsigned int )udev->state != 0U) { do_rebind_interfaces(udev); } else { } return (0); } } int usb_resume(struct device *dev , pm_message_t msg ) { struct usb_device *udev ; struct device const *__mptr ; int status ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; status = usb_resume_both(udev, msg); if (status == 0) { pm_runtime_disable(dev); pm_runtime_set_active(dev); pm_runtime_enable(dev); unbind_no_reset_resume_drivers_interfaces(udev); } else { } if (status == -19 || status == -108) { status = 0; } else { } return (status); } } void usb_enable_autosuspend(struct usb_device *udev ) { { pm_runtime_allow(& udev->dev); return; } } void usb_disable_autosuspend(struct usb_device *udev ) { { pm_runtime_forbid(& udev->dev); return; } } void usb_autosuspend_device(struct usb_device *udev ) { int status ; { usb_mark_last_busy(udev); status = pm_runtime_put_sync_autosuspend(& udev->dev); return; } } int usb_autoresume_device(struct usb_device *udev ) { int status ; { status = pm_runtime_get_sync(& udev->dev); if (status < 0) { pm_runtime_put_sync(& udev->dev); } else { } if (status > 0) { status = 0; } else { } return (status); } } void usb_autopm_put_interface(struct usb_interface *intf ) { struct usb_device *udev ; struct usb_device *tmp ; int status ; { tmp = interface_to_usbdev(intf); udev = tmp; usb_mark_last_busy(udev); atomic_dec(& intf->pm_usage_cnt); status = pm_runtime_put_sync(& intf->dev); return; } } void usb_autopm_put_interface_async(struct usb_interface *intf ) { struct usb_device *udev ; struct usb_device *tmp ; int status ; { tmp = interface_to_usbdev(intf); udev = tmp; usb_mark_last_busy(udev); atomic_dec(& intf->pm_usage_cnt); status = pm_runtime_put(& intf->dev); return; } } void usb_autopm_put_interface_no_suspend(struct usb_interface *intf ) { struct usb_device *udev ; struct usb_device *tmp ; { tmp = interface_to_usbdev(intf); udev = tmp; usb_mark_last_busy(udev); atomic_dec(& intf->pm_usage_cnt); pm_runtime_put_noidle(& intf->dev); return; } } int usb_autopm_get_interface(struct usb_interface *intf ) { int status ; { status = pm_runtime_get_sync(& intf->dev); if (status < 0) { pm_runtime_put_sync(& intf->dev); } else { atomic_inc(& intf->pm_usage_cnt); } if (status > 0) { status = 0; } else { } return (status); } } int usb_autopm_get_interface_async(struct usb_interface *intf ) { int status ; { status = pm_runtime_get(& intf->dev); if (status < 0 && status != -115) { pm_runtime_put_noidle(& intf->dev); } else { atomic_inc(& intf->pm_usage_cnt); } if (status > 0 || status == -115) { status = 0; } else { } return (status); } } void usb_autopm_get_interface_no_resume(struct usb_interface *intf ) { struct usb_device *udev ; struct usb_device *tmp ; { tmp = interface_to_usbdev(intf); udev = tmp; usb_mark_last_busy(udev); atomic_inc(& intf->pm_usage_cnt); pm_runtime_get_noresume(& intf->dev); return; } } static int autosuspend_check(struct usb_device *udev ) { int w ; int i ; struct usb_interface *intf ; int tmp ; struct usb_driver *driver ; struct device_driver const *__mptr ; struct _ddebug descriptor ; long tmp___0 ; bool tmp___1 ; int tmp___2 ; { w = 0; if ((unsigned long )udev->actconfig != (unsigned long )((struct usb_host_config *)0)) { i = 0; goto ldv_28226; ldv_28225: intf = (udev->actconfig)->interface[i]; if ((unsigned int )*((unsigned char *)intf + 856UL) != 0U) { goto ldv_28221; } else { } tmp = atomic_read((atomic_t const *)(& intf->dev.power.usage_count)); if (tmp > 0) { return (-16); } else { } w = (int )intf->needs_remote_wakeup | w; if ((udev->quirks & 2U) != 0U) { __mptr = (struct device_driver const *)intf->dev.driver; driver = (struct usb_driver *)__mptr + 0xffffffffffffff58UL; if ((unsigned long )driver->reset_resume == (unsigned long )((int (*)(struct usb_interface * ))0) || (unsigned int )*((unsigned char *)intf + 40UL) != 0U) { return (-95); } else { } } else { } ldv_28221: i = i + 1; ldv_28226: ; if ((int )(udev->actconfig)->desc.bNumInterfaces > i) { goto ldv_28225; } else { } } else { } if (w != 0) { tmp___1 = device_can_wakeup(& udev->dev); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { descriptor.modname = "usbcore"; descriptor.function = "autosuspend_check"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/driver.c.prepared"; descriptor.format = "remote wakeup needed for autosuspend\n"; descriptor.lineno = 1828U; descriptor.flags = 1U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)(& udev->dev), "remote wakeup needed for autosuspend\n"); } else { } return (-95); } else { } } else { } udev->do_remote_wakeup = (unsigned char )w; return (0); } } int usb_runtime_suspend(struct device *dev ) { struct usb_device *udev ; struct device const *__mptr ; int status ; int tmp ; struct pm_message __constr_expr_0 ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; tmp = autosuspend_check(udev); if (tmp != 0) { return (-11); } else { } __constr_expr_0.event = 1026; status = usb_suspend_both(udev, __constr_expr_0); if (status == -11 || status == -16) { usb_mark_last_busy(udev); } else { } if (status != 0) { return (-16); } else { } return (status); } } int usb_runtime_resume(struct device *dev ) { struct usb_device *udev ; struct device const *__mptr ; int status ; struct pm_message __constr_expr_0 ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; __constr_expr_0.event = 1040; status = usb_resume_both(udev, __constr_expr_0); return (status); } } int usb_runtime_idle(struct device *dev ) { struct usb_device *udev ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; tmp = autosuspend_check(udev); if (tmp == 0) { pm_runtime_autosuspend(dev); } else { } return (0); } } int usb_set_usb2_hardware_lpm(struct usb_device *udev , int enable ) { struct usb_hcd *hcd ; struct usb_hcd *tmp ; int ret ; { tmp = bus_to_hcd(udev->bus); hcd = tmp; ret = -1; if ((unsigned long )(hcd->driver)->set_usb2_hw_lpm != (unsigned long )((int (*/* const */)(struct usb_hcd * , struct usb_device * , int ))0)) { ret = (*((hcd->driver)->set_usb2_hw_lpm))(hcd, udev, enable); if (ret == 0) { udev->usb2_hw_lpm_enabled = (unsigned char )enable; } else { } } else { } return (ret); } } struct bus_type usb_bus_type = {"usb", 0, 0, 0, 0, 0, & usb_device_match, & usb_uevent, 0, 0, 0, 0, 0, 0, 0, 0}; void ldv_main5_sequence_infinite_withcheck_stateful(void) { struct device *var_group1 ; struct device_driver *var_group2 ; int tmp ; int tmp___0 ; { LDV_IN_INTERRUPT = 1; ldv_initialize(); goto ldv_28282; ldv_28281: tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ldv_handler_precall(); usb_device_match(var_group1, var_group2); goto ldv_28278; case 1: ; goto ldv_28278; default: ; goto ldv_28278; } ldv_28278: ; ldv_28282: tmp___0 = __VERIFIER_nondet_int(); if (tmp___0 != 0) { goto ldv_28281; } else { } ldv_check_final_state(); return; } } void ldv_mutex_lock_195(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_196(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_197(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_198(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___2 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_199(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_200(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mtx(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_201(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mtx(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_202(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mtx(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_203(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mtx(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_204(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_205(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } extern void *__memcpy(void * , void const * , size_t ) ; int ldv_mutex_trylock_220(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_218(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_221(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_223(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_225(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_227(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_217(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_219(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_222(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_224(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_226(struct mutex *ldv_func_arg1 ) ; __inline static char const *plural(int n ) { { return (n == 1 ? "" : "s"); } } static int find_next_descriptor(unsigned char *buffer , int size , int dt1 , int dt2 , int *num_skipped ) { struct usb_descriptor_header *h ; int n ; unsigned char *buffer0 ; { n = 0; buffer0 = buffer; goto ldv_28508; ldv_28507: h = (struct usb_descriptor_header *)buffer; if ((int )h->bDescriptorType == dt1 || (int )h->bDescriptorType == dt2) { goto ldv_28506; } else { } buffer = buffer + (unsigned long )h->bLength; size = size - (int )h->bLength; n = n + 1; ldv_28508: ; if (size > 0) { goto ldv_28507; } else { } ldv_28506: ; if ((unsigned long )num_skipped != (unsigned long )((int *)0)) { *num_skipped = n; } else { } return ((int )((unsigned int )((long )buffer) - (unsigned int )((long )buffer0))); } } static void usb_parse_ss_endpoint_companion(struct device *ddev , int cfgno , int inum , int asnum , struct usb_host_endpoint *ep , unsigned char *buffer , int size ) { struct usb_ss_ep_comp_descriptor *desc ; int max_tx ; int tmp ; int tmp___0 ; size_t __len ; void *__ret ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; int tmp___6 ; int tmp___7 ; int tmp___8 ; int tmp___9 ; int tmp___10 ; int tmp___11 ; { desc = (struct usb_ss_ep_comp_descriptor *)buffer; if ((unsigned int )desc->bDescriptorType != 48U || size <= 5) { dev_warn((struct device const *)ddev, "No SuperSpeed endpoint companion for config %d interface %d altsetting %d ep %d: using minimum values\n", cfgno, inum, asnum, (int )ep->desc.bEndpointAddress); ep->ss_ep_comp.bLength = 6U; ep->ss_ep_comp.bDescriptorType = 48U; tmp = usb_endpoint_xfer_isoc((struct usb_endpoint_descriptor const *)(& ep->desc)); if (tmp != 0) { ep->ss_ep_comp.wBytesPerInterval = ep->desc.wMaxPacketSize; } else { tmp___0 = usb_endpoint_xfer_int((struct usb_endpoint_descriptor const *)(& ep->desc)); if (tmp___0 != 0) { ep->ss_ep_comp.wBytesPerInterval = ep->desc.wMaxPacketSize; } else { } } return; } else { } __len = 6UL; if (__len > 63UL) { __ret = __memcpy((void *)(& ep->ss_ep_comp), (void const *)desc, __len); } else { __ret = __builtin_memcpy((void *)(& ep->ss_ep_comp), (void const *)desc, __len); } tmp___1 = usb_endpoint_xfer_control((struct usb_endpoint_descriptor const *)(& ep->desc)); if (tmp___1 != 0 && (unsigned int )desc->bMaxBurst != 0U) { dev_warn((struct device const *)ddev, "Control endpoint with bMaxBurst = %d in config %d interface %d altsetting %d ep %d: setting to zero\n", (int )desc->bMaxBurst, cfgno, inum, asnum, (int )ep->desc.bEndpointAddress); ep->ss_ep_comp.bMaxBurst = 0U; } else if ((unsigned int )desc->bMaxBurst > 15U) { dev_warn((struct device const *)ddev, "Endpoint with bMaxBurst = %d in config %d interface %d altsetting %d ep %d: setting to 15\n", (int )desc->bMaxBurst, cfgno, inum, asnum, (int )ep->desc.bEndpointAddress); ep->ss_ep_comp.bMaxBurst = 15U; } else { } tmp___5 = usb_endpoint_xfer_control((struct usb_endpoint_descriptor const *)(& ep->desc)); if (tmp___5 != 0) { goto _L___0; } else { tmp___6 = usb_endpoint_xfer_int((struct usb_endpoint_descriptor const *)(& ep->desc)); if (tmp___6 != 0) { _L___0: /* CIL Label */ if ((unsigned int )desc->bmAttributes != 0U) { tmp___2 = usb_endpoint_xfer_control((struct usb_endpoint_descriptor const *)(& ep->desc)); dev_warn((struct device const *)ddev, "%s endpoint with bmAttributes = %d in config %d interface %d altsetting %d ep %d: setting to zero\n", tmp___2 != 0 ? (char *)"Control" : (char *)"Bulk", (int )desc->bmAttributes, cfgno, inum, asnum, (int )ep->desc.bEndpointAddress); ep->ss_ep_comp.bmAttributes = 0U; } else { goto _L; } } else { _L: /* CIL Label */ tmp___4 = usb_endpoint_xfer_bulk((struct usb_endpoint_descriptor const *)(& ep->desc)); if (tmp___4 != 0 && (unsigned int )desc->bmAttributes > 16U) { dev_warn((struct device const *)ddev, "Bulk endpoint with more than 65536 streams in config %d interface %d altsetting %d ep %d: setting to max\n", cfgno, inum, asnum, (int )ep->desc.bEndpointAddress); ep->ss_ep_comp.bmAttributes = 16U; } else { tmp___3 = usb_endpoint_xfer_isoc((struct usb_endpoint_descriptor const *)(& ep->desc)); if (tmp___3 != 0 && (unsigned int )desc->bmAttributes > 2U) { dev_warn((struct device const *)ddev, "Isoc endpoint has Mult of %d in config %d interface %d altsetting %d ep %d: setting to 3\n", (int )desc->bmAttributes + 1, cfgno, inum, asnum, (int )ep->desc.bEndpointAddress); ep->ss_ep_comp.bmAttributes = 2U; } else { } } } } tmp___10 = usb_endpoint_xfer_isoc((struct usb_endpoint_descriptor const *)(& ep->desc)); if (tmp___10 != 0) { tmp___7 = usb_endpoint_maxp((struct usb_endpoint_descriptor const *)(& ep->desc)); max_tx = (((int )desc->bMaxBurst + 1) * ((int )desc->bmAttributes + 1)) * tmp___7; } else { tmp___9 = usb_endpoint_xfer_int((struct usb_endpoint_descriptor const *)(& ep->desc)); if (tmp___9 != 0) { tmp___8 = usb_endpoint_maxp((struct usb_endpoint_descriptor const *)(& ep->desc)); max_tx = tmp___8 * ((int )desc->bMaxBurst + 1); } else { max_tx = 999999; } } if ((int )desc->wBytesPerInterval > max_tx) { tmp___11 = usb_endpoint_xfer_isoc((struct usb_endpoint_descriptor const *)(& ep->desc)); dev_warn((struct device const *)ddev, "%s endpoint with wBytesPerInterval of %d in config %d interface %d altsetting %d ep %d: setting to %d\n", tmp___11 != 0 ? (char *)"Isoc" : (char *)"Int", (int )desc->wBytesPerInterval, cfgno, inum, asnum, (int )ep->desc.bEndpointAddress, max_tx); ep->ss_ep_comp.wBytesPerInterval = (unsigned short )max_tx; } else { } return; } } static int usb_parse_endpoint(struct device *ddev , int cfgno , int inum , int asnum , struct usb_host_interface *ifp , int num_ep , unsigned char *buffer , int size ) { unsigned char *buffer0 ; struct usb_endpoint_descriptor *d ; struct usb_host_endpoint *endpoint ; int n ; int i ; int j ; int retval ; size_t __len ; void *__ret ; struct device const *__mptr ; struct device const *__mptr___0 ; int tmp ; int tmp___0 ; int tmp___1 ; struct device const *__mptr___1 ; int tmp___2 ; unsigned int maxp ; int tmp___3 ; struct device const *__mptr___2 ; int tmp___4 ; struct device const *__mptr___3 ; struct _ddebug descriptor ; char const *tmp___5 ; long tmp___6 ; { buffer0 = buffer; d = (struct usb_endpoint_descriptor *)buffer; buffer = buffer + (unsigned long )d->bLength; size = size - (int )d->bLength; if ((unsigned int )d->bLength > 8U) { n = 9; } else if ((unsigned int )d->bLength > 6U) { n = 7; } else { dev_warn((struct device const *)ddev, "config %d interface %d altsetting %d has an invalid endpoint descriptor of length %d, skipping\n", cfgno, inum, asnum, (int )d->bLength); goto skip_to_next_endpoint_or_interface_descriptor; } i = (int )d->bEndpointAddress & -129; if (i > 15 || i == 0) { dev_warn((struct device const *)ddev, "config %d interface %d altsetting %d has an invalid endpoint with address 0x%X, skipping\n", cfgno, inum, asnum, (int )d->bEndpointAddress); goto skip_to_next_endpoint_or_interface_descriptor; } else { } if ((int )ifp->desc.bNumEndpoints >= num_ep) { goto skip_to_next_endpoint_or_interface_descriptor; } else { } endpoint = ifp->endpoint + (unsigned long )ifp->desc.bNumEndpoints; ifp->desc.bNumEndpoints = (__u8 )((int )ifp->desc.bNumEndpoints + 1); __len = (size_t )n; __ret = __builtin_memcpy((void *)(& endpoint->desc), (void const *)d, __len); INIT_LIST_HEAD(& endpoint->urb_list); i = 0; j = 255; tmp___0 = usb_endpoint_xfer_int((struct usb_endpoint_descriptor const *)d); if (tmp___0 != 0) { i = 1; __mptr = (struct device const *)ddev; switch ((unsigned int )((struct usb_device *)__mptr + 0xffffffffffffff78UL)->speed) { case 5U: ; case 3U: n = fls((int )d->bInterval * 8); if (n == 0) { n = 9; } else { } j = 16; goto ldv_28548; default: n = 32; goto ldv_28548; } ldv_28548: ; } else { tmp = usb_endpoint_xfer_isoc((struct usb_endpoint_descriptor const *)d); if (tmp != 0) { i = 1; j = 16; __mptr___0 = (struct device const *)ddev; switch ((unsigned int )((struct usb_device *)__mptr___0 + 0xffffffffffffff78UL)->speed) { case 3U: n = 9; goto ldv_28553; default: n = 6; goto ldv_28553; } ldv_28553: ; } else { } } if ((int )d->bInterval < i || (int )d->bInterval > j) { dev_warn((struct device const *)ddev, "config %d interface %d altsetting %d endpoint 0x%X has an invalid bInterval %d, changing to %d\n", cfgno, inum, asnum, (int )d->bEndpointAddress, (int )d->bInterval, n); endpoint->desc.bInterval = (__u8 )n; } else { } __mptr___1 = (struct device const *)ddev; if ((unsigned int )((struct usb_device *)__mptr___1 + 0xffffffffffffff78UL)->speed == 1U) { tmp___2 = usb_endpoint_xfer_bulk((struct usb_endpoint_descriptor const *)d); if (tmp___2 != 0) { dev_warn((struct device const *)ddev, "config %d interface %d altsetting %d endpoint 0x%X is Bulk; changing to Interrupt\n", cfgno, inum, asnum, (int )d->bEndpointAddress); endpoint->desc.bmAttributes = 3U; endpoint->desc.bInterval = 1U; tmp___1 = usb_endpoint_maxp((struct usb_endpoint_descriptor const *)(& endpoint->desc)); if (tmp___1 > 8) { endpoint->desc.wMaxPacketSize = 8U; } else { } } else { } } else { } __mptr___2 = (struct device const *)ddev; if ((unsigned int )((struct usb_device *)__mptr___2 + 0xffffffffffffff78UL)->speed == 3U) { tmp___4 = usb_endpoint_xfer_bulk((struct usb_endpoint_descriptor const *)d); if (tmp___4 != 0) { tmp___3 = usb_endpoint_maxp((struct usb_endpoint_descriptor const *)(& endpoint->desc)); maxp = (unsigned int )tmp___3 & 2047U; if (maxp != 512U) { dev_warn((struct device const *)ddev, "config %d interface %d altsetting %d bulk endpoint 0x%X has invalid maxpacket %d\n", cfgno, inum, asnum, (int )d->bEndpointAddress, maxp); } else { } } else { } } else { } __mptr___3 = (struct device const *)ddev; if ((unsigned int )((struct usb_device *)__mptr___3 + 0xffffffffffffff78UL)->speed == 5U) { usb_parse_ss_endpoint_companion(ddev, cfgno, inum, asnum, endpoint, buffer, size); } else { } endpoint->extra = buffer; i = find_next_descriptor(buffer, size, 5, 4, & n); endpoint->extralen = i; retval = (int )(((unsigned int )((long )buffer) - (unsigned int )((long )buffer0)) + (unsigned int )i); if (n > 0) { descriptor.modname = "usbcore"; descriptor.function = "usb_parse_endpoint"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/config.c.prepared"; descriptor.format = "skipped %d descriptor%s after %s\n"; descriptor.lineno = 374U; descriptor.flags = 1U; tmp___6 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___6 != 0L) { tmp___5 = plural(n); __dynamic_dev_dbg(& descriptor, (struct device const *)ddev, "skipped %d descriptor%s after %s\n", n, tmp___5, (char *)"endpoint"); } else { } } else { } return (retval); skip_to_next_endpoint_or_interface_descriptor: i = find_next_descriptor(buffer, size, 5, 4, 0); return ((int )(((unsigned int )((long )buffer) - (unsigned int )((long )buffer0)) + (unsigned int )i)); } } void usb_release_interface_cache(struct kref *ref ) { struct usb_interface_cache *intfc ; struct kref const *__mptr ; int j ; struct usb_host_interface *alt ; { __mptr = (struct kref const *)ref; intfc = (struct usb_interface_cache *)__mptr + 0xfffffffffffffffcUL; j = 0; goto ldv_28573; ldv_28572: alt = (struct usb_host_interface *)(& intfc->altsetting) + (unsigned long )j; kfree((void const *)alt->endpoint); kfree((void const *)alt->string); j = j + 1; ldv_28573: ; if ((unsigned int )j < intfc->num_altsetting) { goto ldv_28572; } else { } kfree((void const *)intfc); return; } } static int usb_parse_interface(struct device *ddev , int cfgno , struct usb_host_config *config , unsigned char *buffer , int size , u8 *inums , u8 *nalts ) { unsigned char *buffer0 ; struct usb_interface_descriptor *d ; int inum ; int asnum ; struct usb_interface_cache *intfc ; struct usb_host_interface *alt ; int i ; int n ; int len ; int retval ; int num_ep ; int num_ep_orig ; size_t __len ; void *__ret ; struct _ddebug descriptor ; char const *tmp ; long tmp___0 ; void *tmp___1 ; char const *tmp___2 ; { buffer0 = buffer; d = (struct usb_interface_descriptor *)buffer; buffer = buffer + (unsigned long )d->bLength; size = size - (int )d->bLength; if ((unsigned int )d->bLength <= 8U) { goto skip_to_next_interface_descriptor; } else { } intfc = 0; inum = (int )d->bInterfaceNumber; i = 0; goto ldv_28599; ldv_28598: ; if ((int )*(inums + (unsigned long )i) == inum) { intfc = config->intf_cache[i]; goto ldv_28597; } else { } i = i + 1; ldv_28599: ; if ((int )config->desc.bNumInterfaces > i) { goto ldv_28598; } else { } ldv_28597: ; if ((unsigned long )intfc == (unsigned long )((struct usb_interface_cache *)0) || intfc->num_altsetting >= (unsigned int )*(nalts + (unsigned long )i)) { goto skip_to_next_interface_descriptor; } else { } asnum = (int )d->bAlternateSetting; i = 0; alt = (struct usb_host_interface *)(& intfc->altsetting); goto ldv_28601; ldv_28600: ; if ((int )alt->desc.bAlternateSetting == asnum) { dev_warn((struct device const *)ddev, "Duplicate descriptor for config %d interface %d altsetting %d, skipping\n", cfgno, inum, asnum); goto skip_to_next_interface_descriptor; } else { } i = i + 1; alt = alt + 1; ldv_28601: ; if ((unsigned int )i < intfc->num_altsetting) { goto ldv_28600; } else { } intfc->num_altsetting = intfc->num_altsetting + 1U; __len = 9UL; if (__len > 63UL) { __ret = __memcpy((void *)(& alt->desc), (void const *)d, __len); } else { __ret = __builtin_memcpy((void *)(& alt->desc), (void const *)d, __len); } alt->extra = buffer; i = find_next_descriptor(buffer, size, 5, 4, & n); alt->extralen = i; if (n > 0) { descriptor.modname = "usbcore"; descriptor.function = "usb_parse_interface"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/config.c.prepared"; descriptor.format = "skipped %d descriptor%s after %s\n"; descriptor.lineno = 453U; descriptor.flags = 1U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = plural(n); __dynamic_dev_dbg(& descriptor, (struct device const *)ddev, "skipped %d descriptor%s after %s\n", n, tmp, (char *)"interface"); } else { } } else { } buffer = buffer + (unsigned long )i; size = size - i; num_ep_orig = (int )alt->desc.bNumEndpoints; num_ep = num_ep_orig; alt->desc.bNumEndpoints = 0U; if (num_ep > 30) { dev_warn((struct device const *)ddev, "too many endpoints for config %d interface %d altsetting %d: %d, using maximum allowed: %d\n", cfgno, inum, asnum, num_ep, 30); num_ep = 30; } else { } if (num_ep > 0) { len = (int )((unsigned int )num_ep * 64U); tmp___1 = kzalloc((size_t )len, 208U); alt->endpoint = (struct usb_host_endpoint *)tmp___1; if ((unsigned long )alt->endpoint == (unsigned long )((struct usb_host_endpoint *)0)) { return (-12); } else { } } else { } n = 0; goto ldv_28610; ldv_28609: ; if ((unsigned int )((struct usb_descriptor_header *)buffer)->bDescriptorType == 4U) { goto ldv_28608; } else { } retval = usb_parse_endpoint(ddev, cfgno, inum, asnum, alt, num_ep, buffer, size); if (retval < 0) { return (retval); } else { } n = n + 1; buffer = buffer + (unsigned long )retval; size = size - retval; ldv_28610: ; if (size > 0) { goto ldv_28609; } else { } ldv_28608: ; if (n != num_ep_orig) { tmp___2 = plural(n); dev_warn((struct device const *)ddev, "config %d interface %d altsetting %d has %d endpoint descriptor%s, different from the interface descriptor\'s value: %d\n", cfgno, inum, asnum, n, tmp___2, num_ep_orig); } else { } return ((int )((unsigned int )((long )buffer) - (unsigned int )((long )buffer0))); skip_to_next_interface_descriptor: i = find_next_descriptor(buffer, size, 4, 4, 0); return ((int )(((unsigned int )((long )buffer) - (unsigned int )((long )buffer0)) + (unsigned int )i)); } } static int usb_parse_configuration(struct usb_device *dev , int cfgidx , struct usb_host_config *config , unsigned char *buffer , int size ) { struct device *ddev ; unsigned char *buffer0 ; int cfgno ; int nintf ; int nintf_orig ; int i ; int j ; int n ; struct usb_interface_cache *intfc ; unsigned char *buffer2 ; int size2 ; struct usb_descriptor_header *header ; int len ; int retval ; u8 inums[32U] ; u8 nalts[32U] ; unsigned int iad_num ; size_t __len ; void *__ret ; char const *tmp ; struct usb_interface_descriptor *d ; int inum ; char const *tmp___0 ; void *tmp___1 ; struct _ddebug descriptor ; char const *tmp___2 ; long tmp___3 ; { ddev = & dev->dev; buffer0 = buffer; iad_num = 0U; __len = 9UL; if (__len > 63UL) { __ret = __memcpy((void *)(& config->desc), (void const *)buffer, __len); } else { __ret = __builtin_memcpy((void *)(& config->desc), (void const *)buffer, __len); } if ((unsigned int )config->desc.bDescriptorType != 2U || (unsigned int )config->desc.bLength <= 8U) { dev_err((struct device const *)ddev, "invalid descriptor for config index %d: type = 0x%X, length = %d\n", cfgidx, (int )config->desc.bDescriptorType, (int )config->desc.bLength); return (-22); } else { } cfgno = (int )config->desc.bConfigurationValue; buffer = buffer + (unsigned long )config->desc.bLength; size = size - (int )config->desc.bLength; nintf_orig = (int )config->desc.bNumInterfaces; nintf = nintf_orig; if (nintf > 32) { dev_warn((struct device const *)ddev, "config %d has too many interfaces: %d, using maximum allowed: %d\n", cfgno, nintf, 32); nintf = 32; } else { } n = 0; buffer2 = buffer; size2 = size; goto ldv_28646; ldv_28645: ; if ((unsigned int )size2 <= 1U) { tmp = plural(size2); dev_warn((struct device const *)ddev, "config %d descriptor has %d excess byte%s, ignoring\n", cfgno, size2, tmp); goto ldv_28638; } else { } header = (struct usb_descriptor_header *)buffer2; if ((int )header->bLength > size2 || (unsigned int )header->bLength <= 1U) { dev_warn((struct device const *)ddev, "config %d has an invalid descriptor of length %d, skipping remainder of the config\n", cfgno, (int )header->bLength); goto ldv_28638; } else { } if ((unsigned int )header->bDescriptorType == 4U) { d = (struct usb_interface_descriptor *)header; if ((unsigned int )d->bLength <= 8U) { dev_warn((struct device const *)ddev, "config %d has an invalid interface descriptor of length %d, skipping\n", cfgno, (int )d->bLength); goto ldv_28641; } else { } inum = (int )d->bInterfaceNumber; if ((dev->quirks & 32U) != 0U && n >= nintf_orig) { dev_warn((struct device const *)ddev, "config %d has more interface descriptors, than it declares in bNumInterfaces, ignoring interface number: %d\n", cfgno, inum); goto ldv_28641; } else { } if (inum >= nintf_orig) { dev_warn((struct device const *)ddev, "config %d has an invalid interface number: %d but max is %d\n", cfgno, inum, nintf_orig + -1); } else { } i = 0; goto ldv_28644; ldv_28643: ; if ((int )inums[i] == inum) { goto ldv_28642; } else { } i = i + 1; ldv_28644: ; if (i < n) { goto ldv_28643; } else { } ldv_28642: ; if (i < n) { if ((unsigned int )nalts[i] != 255U) { nalts[i] = (u8 )((int )nalts[i] + 1); } else if (n <= 31) { inums[n] = (u8 )inum; nalts[n] = 1U; n = n + 1; } else { } } else { } } else if ((unsigned int )header->bDescriptorType == 11U) { if (iad_num == 16U) { dev_warn((struct device const *)ddev, "found more Interface Association Descriptors than allocated for in configuration %d\n", cfgno); } else { config->intf_assoc[iad_num] = (struct usb_interface_assoc_descriptor *)header; iad_num = iad_num + 1U; } } else if ((unsigned int )header->bDescriptorType == 1U || (unsigned int )header->bDescriptorType == 2U) { dev_warn((struct device const *)ddev, "config %d contains an unexpected descriptor of type 0x%X, skipping\n", cfgno, (int )header->bDescriptorType); } else { } ldv_28641: buffer2 = buffer2 + (unsigned long )header->bLength; size2 = size2 - (int )header->bLength; ldv_28646: ; if (size2 > 0) { goto ldv_28645; } else { } ldv_28638: size = (int )((unsigned int )((long )buffer2) - (unsigned int )((long )buffer)); config->desc.wTotalLength = (int )((unsigned short )((long )buffer2)) - (int )((unsigned short )((long )buffer0)); if (n != nintf) { tmp___0 = plural(n); dev_warn((struct device const *)ddev, "config %d has %d interface%s, different from the descriptor\'s value: %d\n", cfgno, n, tmp___0, nintf_orig); } else if (n == 0) { dev_warn((struct device const *)ddev, "config %d has no interfaces?\n", cfgno); } else { } nintf = n; config->desc.bNumInterfaces = (__u8 )nintf; i = 0; goto ldv_28651; ldv_28650: j = 0; goto ldv_28649; ldv_28648: ; if ((int )inums[j] == i) { goto ldv_28647; } else { } j = j + 1; ldv_28649: ; if (j < nintf) { goto ldv_28648; } else { } ldv_28647: ; if (j >= nintf) { dev_warn((struct device const *)ddev, "config %d has no interface number %d\n", cfgno, i); } else { } i = i + 1; ldv_28651: ; if (i < nintf) { goto ldv_28650; } else { } i = 0; goto ldv_28654; ldv_28653: j = (int )nalts[i]; if (j > 128) { dev_warn((struct device const *)ddev, "too many alternate settings for config %d interface %d: %d, using maximum allowed: %d\n", cfgno, (int )inums[i], j, 128); j = 128; nalts[i] = 128U; } else { } len = (int )((unsigned int )((unsigned long )j) * 40U + 8U); tmp___1 = kzalloc((size_t )len, 208U); intfc = (struct usb_interface_cache *)tmp___1; config->intf_cache[i] = intfc; if ((unsigned long )intfc == (unsigned long )((struct usb_interface_cache *)0)) { return (-12); } else { } kref_init(& intfc->ref); i = i + 1; ldv_28654: ; if (i < nintf) { goto ldv_28653; } else { } config->extra = buffer; i = find_next_descriptor(buffer, size, 4, 4, & n); config->extralen = i; if (n > 0) { descriptor.modname = "usbcore"; descriptor.function = "usb_parse_configuration"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/config.c.prepared"; descriptor.format = "skipped %d descriptor%s after %s\n"; descriptor.lineno = 677U; descriptor.flags = 1U; tmp___3 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___3 != 0L) { tmp___2 = plural(n); __dynamic_dev_dbg(& descriptor, (struct device const *)ddev, "skipped %d descriptor%s after %s\n", n, tmp___2, (char *)"configuration"); } else { } } else { } buffer = buffer + (unsigned long )i; size = size - i; goto ldv_28659; ldv_28658: retval = usb_parse_interface(ddev, cfgno, config, buffer, size, (u8 *)(& inums), (u8 *)(& nalts)); if (retval < 0) { return (retval); } else { } buffer = buffer + (unsigned long )retval; size = size - retval; ldv_28659: ; if (size > 0) { goto ldv_28658; } else { } i = 0; goto ldv_28668; ldv_28667: intfc = config->intf_cache[i]; j = 0; goto ldv_28665; ldv_28664: n = 0; goto ldv_28663; ldv_28662: ; if ((int )intfc->altsetting[n].desc.bAlternateSetting == j) { goto ldv_28661; } else { } n = n + 1; ldv_28663: ; if ((unsigned int )n < intfc->num_altsetting) { goto ldv_28662; } else { } ldv_28661: ; if ((unsigned int )n >= intfc->num_altsetting) { dev_warn((struct device const *)ddev, "config %d interface %d has no altsetting %d\n", cfgno, (int )inums[i], j); } else { } j = j + 1; ldv_28665: ; if ((unsigned int )j < intfc->num_altsetting) { goto ldv_28664; } else { } i = i + 1; ldv_28668: ; if (i < nintf) { goto ldv_28667; } else { } return (0); } } void usb_destroy_configuration(struct usb_device *dev ) { int c ; int i ; struct usb_host_config *cf ; { if ((unsigned long )dev->config == (unsigned long )((struct usb_host_config *)0)) { return; } else { } if ((unsigned long )dev->rawdescriptors != (unsigned long )((char **)0)) { i = 0; goto ldv_28676; ldv_28675: kfree((void const *)*(dev->rawdescriptors + (unsigned long )i)); i = i + 1; ldv_28676: ; if ((int )dev->descriptor.bNumConfigurations > i) { goto ldv_28675; } else { } kfree((void const *)dev->rawdescriptors); dev->rawdescriptors = 0; } else { } c = 0; goto ldv_28683; ldv_28682: cf = dev->config + (unsigned long )c; kfree((void const *)cf->string); i = 0; goto ldv_28680; ldv_28679: ; if ((unsigned long )cf->intf_cache[i] != (unsigned long )((struct usb_interface_cache *)0)) { kref_put(& (cf->intf_cache[i])->ref, & usb_release_interface_cache); } else { } i = i + 1; ldv_28680: ; if ((int )cf->desc.bNumInterfaces > i) { goto ldv_28679; } else { } c = c + 1; ldv_28683: ; if ((int )dev->descriptor.bNumConfigurations > c) { goto ldv_28682; } else { } kfree((void const *)dev->config); dev->config = 0; return; } } int usb_get_configuration(struct usb_device *dev ) { struct device *ddev ; int ncfg ; int result ; unsigned int cfgno ; unsigned int length ; unsigned char *bigbuffer ; struct usb_config_descriptor *desc ; void *tmp ; void *tmp___0 ; void *tmp___1 ; int _max1 ; int _max2 ; void *tmp___2 ; { ddev = & dev->dev; ncfg = (int )dev->descriptor.bNumConfigurations; result = 0; cfgno = 0U; if ((unsigned int )*((unsigned char *)dev + 1596UL) == 0U) { goto out_not_authorized; } else { } result = -12; if (ncfg > 8) { dev_warn((struct device const *)ddev, "too many configurations: %d, using maximum allowed: %d\n", ncfg, 8); ncfg = 8; dev->descriptor.bNumConfigurations = 8U; } else { } if (ncfg <= 0) { dev_err((struct device const *)ddev, "no configurations\n"); return (-22); } else { } length = (unsigned int )((unsigned long )ncfg) * 680U; tmp = kzalloc((size_t )length, 208U); dev->config = (struct usb_host_config *)tmp; if ((unsigned long )dev->config == (unsigned long )((struct usb_host_config *)0)) { goto err2; } else { } length = (unsigned int )((unsigned long )ncfg) * 8U; tmp___0 = kzalloc((size_t )length, 208U); dev->rawdescriptors = (char **)tmp___0; if ((unsigned long )dev->rawdescriptors == (unsigned long )((char **)0)) { goto err2; } else { } tmp___1 = kmalloc(9UL, 208U); desc = (struct usb_config_descriptor *)tmp___1; if ((unsigned long )desc == (unsigned long )((struct usb_config_descriptor *)0)) { goto err2; } else { } result = 0; goto ldv_28703; ldv_28702: result = usb_get_descriptor(dev, 2, (int )((unsigned char )cfgno), (void *)desc, 9); if (result < 0) { dev_err((struct device const *)ddev, "unable to read config index %d descriptor/%s: %d\n", cfgno, (char *)"start", result); if (result != -32) { goto err; } else { } dev_err((struct device const *)ddev, "chopping to %d config(s)\n", cfgno); dev->descriptor.bNumConfigurations = (__u8 )cfgno; goto ldv_28698; } else if (result <= 3) { dev_err((struct device const *)ddev, "config index %d descriptor too short (expected %i, got %i)\n", cfgno, 9, result); result = -22; goto err; } else { } _max1 = (int )desc->wTotalLength; _max2 = 9; length = (unsigned int )(_max1 > _max2 ? _max1 : _max2); tmp___2 = kmalloc((size_t )length, 208U); bigbuffer = (unsigned char *)tmp___2; if ((unsigned long )bigbuffer == (unsigned long )((unsigned char *)0)) { result = -12; goto err; } else { } result = usb_get_descriptor(dev, 2, (int )((unsigned char )cfgno), (void *)bigbuffer, (int )length); if (result < 0) { dev_err((struct device const *)ddev, "unable to read config index %d descriptor/%s\n", cfgno, (char *)"all"); kfree((void const *)bigbuffer); goto err; } else { } if ((unsigned int )result < length) { dev_warn((struct device const *)ddev, "config index %d descriptor too short (expected %i, got %i)\n", cfgno, length, result); length = (unsigned int )result; } else { } *(dev->rawdescriptors + (unsigned long )cfgno) = (char *)bigbuffer; result = usb_parse_configuration(dev, (int )cfgno, dev->config + (unsigned long )cfgno, bigbuffer, (int )length); if (result < 0) { cfgno = cfgno + 1U; goto err; } else { } cfgno = cfgno + 1U; ldv_28703: ; if ((unsigned int )ncfg > cfgno) { goto ldv_28702; } else { } ldv_28698: result = 0; err: kfree((void const *)desc); out_not_authorized: dev->descriptor.bNumConfigurations = (__u8 )cfgno; err2: ; if (result == -12) { dev_err((struct device const *)ddev, "out of memory\n"); } else { } return (result); } } void usb_release_bos_descriptor(struct usb_device *dev ) { { if ((unsigned long )dev->bos != (unsigned long )((struct usb_host_bos *)0)) { kfree((void const *)(dev->bos)->desc); kfree((void const *)dev->bos); dev->bos = 0; } else { } return; } } int usb_get_bos_descriptor(struct usb_device *dev ) { struct device *ddev ; struct usb_bos_descriptor *bos ; struct usb_dev_cap_header *cap ; unsigned char *buffer ; int length ; int total_len ; int num ; int i ; int ret ; void *tmp ; void *tmp___0 ; void *tmp___1 ; { ddev = & dev->dev; tmp = kzalloc(5UL, 208U); bos = (struct usb_bos_descriptor *)tmp; if ((unsigned long )bos == (unsigned long )((struct usb_bos_descriptor *)0)) { return (-12); } else { } ret = usb_get_descriptor(dev, 15, 0, (void *)bos, 5); if (ret <= 4) { dev_err((struct device const *)ddev, "unable to get BOS descriptor\n"); if (ret >= 0) { ret = -42; } else { } kfree((void const *)bos); return (ret); } else { } length = (int )bos->bLength; total_len = (int )bos->wTotalLength; num = (int )bos->bNumDeviceCaps; kfree((void const *)bos); if (total_len < length) { return (-22); } else { } tmp___0 = kzalloc(32UL, 208U); dev->bos = (struct usb_host_bos *)tmp___0; if ((unsigned long )dev->bos == (unsigned long )((struct usb_host_bos *)0)) { return (-12); } else { } tmp___1 = kzalloc((size_t )total_len, 208U); buffer = (unsigned char *)tmp___1; if ((unsigned long )buffer == (unsigned long )((unsigned char *)0)) { ret = -12; goto err; } else { } (dev->bos)->desc = (struct usb_bos_descriptor *)buffer; ret = usb_get_descriptor(dev, 15, 0, (void *)buffer, total_len); if (ret < total_len) { dev_err((struct device const *)ddev, "unable to get BOS descriptor set\n"); if (ret >= 0) { ret = -42; } else { } goto err; } else { } total_len = total_len - length; i = 0; goto ldv_28729; ldv_28728: buffer = buffer + (unsigned long )length; cap = (struct usb_dev_cap_header *)buffer; length = (int )cap->bLength; if (total_len < length) { goto ldv_28720; } else { } total_len = total_len - length; if ((unsigned int )cap->bDescriptorType != 16U) { dev_warn((struct device const *)ddev, "descriptor type invalid, skip\n"); goto ldv_28721; } else { } switch ((int )cap->bDevCapabilityType) { case 1: ; goto ldv_28723; case 2: (dev->bos)->ext_cap = (struct usb_ext_cap_descriptor *)buffer; goto ldv_28723; case 3: (dev->bos)->ss_cap = (struct usb_ss_cap_descriptor *)buffer; goto ldv_28723; case 4: (dev->bos)->ss_id = (struct usb_ss_container_id_descriptor *)buffer; goto ldv_28723; default: ; goto ldv_28723; } ldv_28723: ; ldv_28721: i = i + 1; ldv_28729: ; if (i < num) { goto ldv_28728; } else { } ldv_28720: ; return (0); err: usb_release_bos_descriptor(dev); return (ret); } } void ldv_mutex_lock_217(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_218(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_219(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_220(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___2 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_221(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_222(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mtx(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_223(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mtx(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_224(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mtx(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_225(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mtx(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_226(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_227(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } extern char *strrchr(char const * , int ) ; __inline static long PTR_ERR(void const *ptr ) { { return ((long )ptr); } } int ldv_mutex_trylock_242(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_240(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_243(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_245(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_247(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_249(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_239(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_241(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_244(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_246(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_248(struct mutex *ldv_func_arg1 ) ; extern void down_write(struct rw_semaphore * ) ; extern void up_write(struct rw_semaphore * ) ; extern bool try_module_get(struct module * ) ; extern void module_put(struct module * ) ; extern struct class *__class_create(struct module * , char const * , struct lock_class_key * ) ; extern void class_destroy(struct class * ) ; extern struct device *device_create(struct class * , struct device * , dev_t , void * , char const * , ...) ; extern void device_destroy(struct class * , dev_t ) ; __inline static unsigned int iminor(struct inode const *inode ) { { return ((unsigned int )inode->i_rdev & 1048575U); } } extern int __register_chrdev(unsigned int , unsigned int , unsigned int , char const * , struct file_operations const * ) ; extern void __unregister_chrdev(unsigned int , unsigned int , unsigned int , char const * ) ; __inline static int register_chrdev(unsigned int major , char const *name , struct file_operations const *fops ) { int tmp ; { tmp = __register_chrdev(major, 0U, 256U, name, fops); return (tmp); } } __inline static void unregister_chrdev(unsigned int major , char const *name ) { { __unregister_chrdev(major, 0U, 256U, name); return; } } extern loff_t noop_llseek(struct file * , loff_t , int ) ; int usb_register_dev(struct usb_interface *intf , struct usb_class_driver *class_driver ) ; void usb_deregister_dev(struct usb_interface *intf , struct usb_class_driver *class_driver ) ; static struct file_operations const *usb_minors[256U] ; static struct rw_semaphore minor_rwsem = {0L, {{{0U}}, 3735899821U, 4294967295U, 0xffffffffffffffffUL, {0, {0, 0}, "minor_rwsem.wait_lock", 0, 0UL}}, {& minor_rwsem.wait_list, & minor_rwsem.wait_list}, {0, {0, 0}, "minor_rwsem", 0, 0UL}}; static int usb_open(struct inode *inode , struct file *file ) { int minor ; unsigned int tmp ; struct file_operations const *c ; int err ; struct file_operations const *old_fops ; struct file_operations const *new_fops ; bool tmp___1 ; bool tmp___3 ; { tmp = iminor((struct inode const *)inode); minor = (int )tmp; err = -19; new_fops = 0; down_read(& minor_rwsem); c = usb_minors[minor]; if ((unsigned long )c == (unsigned long )((struct file_operations const *)0)) { goto done; } else { if ((unsigned long )c != (unsigned long )((struct file_operations const *)0)) { tmp___1 = try_module_get(c->owner); if ((int )tmp___1) { new_fops = c; } else { new_fops = 0; } } else { new_fops = 0; } if ((unsigned long )new_fops == (unsigned long )((struct file_operations const *)0)) { goto done; } else { } } old_fops = file->f_op; file->f_op = new_fops; if ((unsigned long )(file->f_op)->open != (unsigned long )((int (*/* const */)(struct inode * , struct file * ))0)) { err = (*((file->f_op)->open))(inode, file); } else { } if (err != 0) { if ((unsigned long )file->f_op != (unsigned long )((struct file_operations const *)0)) { module_put((file->f_op)->owner); } else { } if ((unsigned long )old_fops != (unsigned long )((struct file_operations const *)0)) { tmp___3 = try_module_get(old_fops->owner); if ((int )tmp___3) { file->f_op = old_fops; } else { file->f_op = 0; } } else { file->f_op = 0; } } else { } if ((unsigned long )old_fops != (unsigned long )((struct file_operations const *)0)) { module_put(old_fops->owner); } else { } done: up_read(& minor_rwsem); return (err); } } static struct file_operations const usb_fops = {& __this_module, & noop_llseek, 0, 0, 0, 0, 0, 0, 0, 0, 0, & usb_open, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; static struct usb_class *usb_class ; static char *usb_devnode___0(struct device *dev , umode_t *mode ) { struct usb_class_driver *drv ; void *tmp ; char *tmp___0 ; { tmp = dev_get_drvdata((struct device const *)dev); drv = (struct usb_class_driver *)tmp; if ((unsigned long )drv == (unsigned long )((struct usb_class_driver *)0) || (unsigned long )drv->devnode == (unsigned long )((char *(*)(struct device * , umode_t * ))0)) { return (0); } else { } tmp___0 = (*(drv->devnode))(dev, mode); return (tmp___0); } } static int init_usb_class(void) { int result ; void *tmp ; struct lock_class_key __key ; struct class *tmp___0 ; long tmp___1 ; long tmp___2 ; { result = 0; if ((unsigned long )usb_class != (unsigned long )((struct usb_class *)0)) { kref_get(& usb_class->kref); goto exit; } else { } tmp = kmalloc(16UL, 208U); usb_class = (struct usb_class *)tmp; if ((unsigned long )usb_class == (unsigned long )((struct usb_class *)0)) { result = -12; goto exit; } else { } kref_init(& usb_class->kref); tmp___0 = __class_create(& __this_module, "usbmisc", & __key); usb_class->class = tmp___0; tmp___2 = IS_ERR((void const *)usb_class->class); if (tmp___2 != 0L) { tmp___1 = IS_ERR((void const *)usb_class->class); result = (int )tmp___1; printk("\vclass_create failed for usb devices\n"); kfree((void const *)usb_class); usb_class = 0; goto exit; } else { } (usb_class->class)->devnode = & usb_devnode___0; exit: ; return (result); } } static void release_usb_class(struct kref *kref ) { { class_destroy(usb_class->class); kfree((void const *)usb_class); usb_class = 0; return; } } static void destroy_usb_class(void) { { if ((unsigned long )usb_class != (unsigned long )((struct usb_class *)0)) { kref_put(& usb_class->kref, & release_usb_class); } else { } return; } } int usb_major_init(void) { int error ; { error = register_chrdev(180U, "usb", & usb_fops); if (error != 0) { printk("\vUnable to get major %d for usb devices\n", 180); } else { } return (error); } } void usb_major_cleanup(void) { { unregister_chrdev(180U, "usb"); return; } } int usb_register_dev(struct usb_interface *intf , struct usb_class_driver *class_driver ) { int retval ; int minor_base ; int minor ; char name[20U] ; char *temp ; struct _ddebug descriptor ; long tmp ; long tmp___0 ; long tmp___1 ; { minor_base = class_driver->minor_base; minor_base = 0; if ((unsigned long )class_driver->fops == (unsigned long )((struct file_operations const *)0)) { return (-22); } else { } if (intf->minor >= 0) { return (-98); } else { } retval = init_usb_class(); if (retval != 0) { return (retval); } else { } descriptor.modname = "usbcore"; descriptor.function = "usb_register_dev"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/file.c.prepared"; descriptor.format = "looking for a minor, starting at %d\n"; descriptor.lineno = 282U; descriptor.flags = 1U; tmp = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)(& intf->dev), "looking for a minor, starting at %d\n", minor_base); } else { } down_write(& minor_rwsem); minor = minor_base; goto ldv_28156; ldv_28155: ; if ((unsigned long )usb_minors[minor] != (unsigned long )((struct file_operations const *)0)) { goto ldv_28153; } else { } usb_minors[minor] = class_driver->fops; intf->minor = minor; goto ldv_28154; ldv_28153: minor = minor + 1; ldv_28156: ; if (minor <= 255) { goto ldv_28155; } else { } ldv_28154: up_write(& minor_rwsem); if (intf->minor < 0) { return (-54); } else { } snprintf((char *)(& name), 20UL, (char const *)class_driver->name, minor - minor_base); temp = strrchr((char const *)(& name), 47); if ((unsigned long )temp != (unsigned long )((char *)0) && (int )((signed char )*(temp + 1UL)) != 0) { temp = temp + 1; } else { temp = (char *)(& name); } intf->usb_dev = device_create(usb_class->class, & intf->dev, (dev_t )(minor | 188743680), (void *)class_driver, "%s", temp); tmp___1 = IS_ERR((void const *)intf->usb_dev); if (tmp___1 != 0L) { down_write(& minor_rwsem); usb_minors[minor] = 0; intf->minor = -1; up_write(& minor_rwsem); tmp___0 = PTR_ERR((void const *)intf->usb_dev); retval = (int )tmp___0; } else { } return (retval); } } void usb_deregister_dev(struct usb_interface *intf , struct usb_class_driver *class_driver ) { struct _ddebug descriptor ; long tmp ; { if (intf->minor == -1) { return; } else { } descriptor.modname = "usbcore"; descriptor.function = "usb_deregister_dev"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/file.c.prepared"; descriptor.format = "removing %d minor\n"; descriptor.lineno = 338U; descriptor.flags = 1U; tmp = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)(& intf->dev), "removing %d minor\n", intf->minor); } else { } down_write(& minor_rwsem); usb_minors[intf->minor] = 0; up_write(& minor_rwsem); device_destroy(usb_class->class, (dev_t )(intf->minor | 188743680)); intf->usb_dev = 0; intf->minor = -1; destroy_usb_class(); return; } } void ldv_main7_sequence_infinite_withcheck_stateful(void) { struct inode *var_group1 ; struct file *var_group2 ; int res_usb_open_0 ; int ldv_s_usb_fops_file_operations ; int tmp ; int tmp___0 ; { ldv_s_usb_fops_file_operations = 0; LDV_IN_INTERRUPT = 1; ldv_initialize(); goto ldv_28202; ldv_28201: tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_s_usb_fops_file_operations == 0) { ldv_handler_precall(); res_usb_open_0 = usb_open(var_group1, var_group2); ldv_check_return_value(res_usb_open_0); if (res_usb_open_0 != 0) { goto ldv_module_exit; } else { } ldv_s_usb_fops_file_operations = 0; } else { } goto ldv_28199; default: ; goto ldv_28199; } ldv_28199: ; ldv_28202: tmp___0 = __VERIFIER_nondet_int(); if (tmp___0 != 0 || ldv_s_usb_fops_file_operations != 0) { goto ldv_28201; } else { } ldv_module_exit: ; ldv_check_final_state(); return; } } void ldv_mutex_lock_239(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_240(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_241(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_242(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___2 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_243(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_244(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mtx(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_245(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mtx(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_246(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mtx(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_247(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mtx(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_248(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_249(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } int ldv_mutex_trylock_264(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_262(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_265(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_267(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_269(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_271(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_261(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_263(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_266(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_268(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_270(struct mutex *ldv_func_arg1 ) ; __inline static int is_device_dma_capable(struct device *dev ) { { return ((unsigned long )dev->dma_mask != (unsigned long )((u64 *)0) && *(dev->dma_mask) != 0ULL); } } extern void debug_dma_alloc_coherent(struct device * , size_t , dma_addr_t , void * ) ; extern void debug_dma_free_coherent(struct device * , size_t , void * , dma_addr_t ) ; extern struct device x86_dma_fallback_dev ; __inline static unsigned long dma_alloc_coherent_mask(struct device *dev , gfp_t gfp ) { unsigned long dma_mask ; { dma_mask = 0UL; dma_mask = (unsigned long )dev->coherent_dma_mask; if (dma_mask == 0UL) { dma_mask = (int )gfp & 1 ? 16777215UL : 4294967295UL; } else { } return (dma_mask); } } __inline static gfp_t dma_alloc_coherent_gfp_flags(struct device *dev , gfp_t gfp ) { unsigned long dma_mask ; unsigned long tmp ; { tmp = dma_alloc_coherent_mask(dev, gfp); dma_mask = tmp; if ((unsigned long long )dma_mask <= 16777215ULL) { gfp = gfp | 1U; } else { } if ((unsigned long long )dma_mask <= 4294967295ULL && (gfp & 1U) == 0U) { gfp = gfp | 4U; } else { } return (gfp); } } __inline static void *dma_alloc_attrs(struct device *dev , size_t size , dma_addr_t *dma_handle , gfp_t gfp , struct dma_attrs *attrs ) { struct dma_map_ops *ops ; struct dma_map_ops *tmp ; void *memory ; int tmp___0 ; gfp_t tmp___1 ; { tmp = get_dma_ops(dev); ops = tmp; gfp = gfp & 4294967288U; if ((unsigned long )dev == (unsigned long )((struct device *)0)) { dev = & x86_dma_fallback_dev; } else { } tmp___0 = is_device_dma_capable(dev); if (tmp___0 == 0) { return (0); } else { } if ((unsigned long )ops->alloc == (unsigned long )((void *(*)(struct device * , size_t , dma_addr_t * , gfp_t , struct dma_attrs * ))0)) { return (0); } else { } tmp___1 = dma_alloc_coherent_gfp_flags(dev, gfp); memory = (*(ops->alloc))(dev, size, dma_handle, tmp___1, attrs); debug_dma_alloc_coherent(dev, size, *dma_handle, memory); return (memory); } } __inline static void dma_free_attrs(struct device *dev , size_t size , void *vaddr , dma_addr_t bus , struct dma_attrs *attrs ) { struct dma_map_ops *ops ; struct dma_map_ops *tmp ; int __ret_warn_on ; unsigned long _flags ; int tmp___0 ; long tmp___1 ; { tmp = get_dma_ops(dev); ops = tmp; _flags = arch_local_save_flags(); tmp___0 = arch_irqs_disabled_flags(_flags); __ret_warn_on = tmp___0 != 0; tmp___1 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_null("/work/vladimir/UFO/Work/test/inst/current/envs/linux-3.7.3/linux-3.7.3/arch/x86/include/asm/dma-mapping.h", 165); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); debug_dma_free_coherent(dev, size, vaddr, bus); if ((unsigned long )ops->free != (unsigned long )((void (*)(struct device * , size_t , void * , dma_addr_t , struct dma_attrs * ))0)) { (*(ops->free))(dev, size, vaddr, bus, attrs); } else { } return; } } extern struct dma_pool *dma_pool_create(char const * , struct device * , size_t , size_t , size_t ) ; extern void dma_pool_destroy(struct dma_pool * ) ; extern void *dma_pool_alloc(struct dma_pool * , gfp_t , dma_addr_t * ) ; extern void dma_pool_free(struct dma_pool * , void * , dma_addr_t ) ; static size_t const pool_max[4U] = { 32UL, 128UL, 512UL, 2048UL}; int hcd_buffer_create(struct usb_hcd *hcd ) { char name[16U] ; int i ; int size ; { if ((unsigned long )(hcd->self.controller)->dma_mask == (unsigned long )((u64 *)0) && ((int )(hcd->driver)->flags & 2) == 0) { return (0); } else { } i = 0; goto ldv_28602; ldv_28601: size = (int )pool_max[i]; if (size == 0) { goto ldv_28600; } else { } snprintf((char *)(& name), 16UL, "buffer-%d", size); hcd->pool[i] = dma_pool_create((char const *)(& name), hcd->self.controller, (size_t )size, (size_t )size, 0UL); if ((unsigned long )hcd->pool[i] == (unsigned long )((struct dma_pool *)0)) { hcd_buffer_destroy(hcd); return (-12); } else { } ldv_28600: i = i + 1; ldv_28602: ; if (i <= 3) { goto ldv_28601; } else { } return (0); } } void hcd_buffer_destroy(struct usb_hcd *hcd ) { int i ; struct dma_pool *pool ; { i = 0; goto ldv_28610; ldv_28609: pool = hcd->pool[i]; if ((unsigned long )pool != (unsigned long )((struct dma_pool *)0)) { dma_pool_destroy(pool); hcd->pool[i] = 0; } else { } i = i + 1; ldv_28610: ; if (i <= 3) { goto ldv_28609; } else { } return; } } void *hcd_buffer_alloc(struct usb_bus *bus , size_t size , gfp_t mem_flags , dma_addr_t *dma ) { struct usb_hcd *hcd ; struct usb_hcd *tmp ; int i ; void *tmp___0 ; void *tmp___1 ; void *tmp___2 ; { tmp = bus_to_hcd(bus); hcd = tmp; if ((unsigned long )(bus->controller)->dma_mask == (unsigned long )((u64 *)0) && ((int )(hcd->driver)->flags & 2) == 0) { *dma = 0xffffffffffffffffULL; tmp___0 = kmalloc(size, mem_flags); return (tmp___0); } else { } i = 0; goto ldv_28621; ldv_28620: ; if ((unsigned long )pool_max[i] >= size) { tmp___1 = dma_pool_alloc(hcd->pool[i], mem_flags, dma); return (tmp___1); } else { } i = i + 1; ldv_28621: ; if (i <= 3) { goto ldv_28620; } else { } tmp___2 = dma_alloc_attrs(hcd->self.controller, size, dma, mem_flags, 0); return (tmp___2); } } void hcd_buffer_free(struct usb_bus *bus , size_t size , void *addr , dma_addr_t dma ) { struct usb_hcd *hcd ; struct usb_hcd *tmp ; int i ; { tmp = bus_to_hcd(bus); hcd = tmp; if ((unsigned long )addr == (unsigned long )((void *)0)) { return; } else { } if ((unsigned long )(bus->controller)->dma_mask == (unsigned long )((u64 *)0) && ((int )(hcd->driver)->flags & 2) == 0) { kfree((void const *)addr); return; } else { } i = 0; goto ldv_28632; ldv_28631: ; if ((unsigned long )pool_max[i] >= size) { dma_pool_free(hcd->pool[i], addr, dma); return; } else { } i = i + 1; ldv_28632: ; if (i <= 3) { goto ldv_28631; } else { } dma_free_attrs(hcd->self.controller, size, addr, dma, 0); return; } } void ldv_mutex_lock_261(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_262(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_263(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_264(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___2 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_265(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_266(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mtx(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_267(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mtx(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_268(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mtx(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_269(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mtx(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_270(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_271(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } extern int sprintf(char * , char const * , ...) ; extern int strncmp(char const * , char const * , __kernel_size_t ) ; extern void *memchr(void const * , int , __kernel_size_t ) ; extern int strtobool(char const * , bool * ) ; int ldv_mutex_trylock_286(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_284(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_287(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_289(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_291(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_293(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_283(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_285(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_288(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_290(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_292(struct mutex *ldv_func_arg1 ) ; extern unsigned int jiffies_to_msecs(unsigned long const ) ; extern char const power_group_name[] ; extern int sysfs_add_file_to_group(struct kobject * , struct attribute const * , char const * ) ; extern void sysfs_remove_file_from_group(struct kobject * , struct attribute const * , char const * ) ; extern int sysfs_merge_group(struct kobject * , struct attribute_group const * ) ; extern void sysfs_unmerge_group(struct kobject * , struct attribute_group const * ) ; extern int device_create_file(struct device * , struct device_attribute const * ) ; extern void device_remove_file(struct device * , struct device_attribute const * ) ; extern int device_create_bin_file(struct device * , struct bin_attribute const * ) ; extern void device_remove_bin_file(struct device * , struct bin_attribute const * ) ; __inline static void device_lock___3(struct device *dev ) { { ldv_mutex_lock_285(& dev->mutex); return; } } __inline static void device_unlock___3(struct device *dev ) { { ldv_mutex_unlock_287(& dev->mutex); return; } } static ssize_t show_bNumInterfaces(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_device *udev ; struct usb_host_config *actconfig ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; actconfig = udev->actconfig; if ((unsigned long )actconfig != (unsigned long )((struct usb_host_config *)0)) { tmp = sprintf(buf, "%2d\n", (int )actconfig->desc.bNumInterfaces); return ((ssize_t )tmp); } else { return (0L); } } } static struct device_attribute dev_attr_bNumInterfaces = {{"bNumInterfaces", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_bNumInterfaces, 0}; static ssize_t show_bmAttributes(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_device *udev ; struct usb_host_config *actconfig ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; actconfig = udev->actconfig; if ((unsigned long )actconfig != (unsigned long )((struct usb_host_config *)0)) { tmp = sprintf(buf, "%2x\n", (int )actconfig->desc.bmAttributes); return ((ssize_t )tmp); } else { return (0L); } } } static struct device_attribute dev_attr_bmAttributes = {{"bmAttributes", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_bmAttributes, 0}; static ssize_t show_bMaxPower(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_device *udev ; struct usb_host_config *actconfig ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; actconfig = udev->actconfig; if ((unsigned long )actconfig != (unsigned long )((struct usb_host_config *)0)) { tmp = sprintf(buf, "%3dmA\n", (int )actconfig->desc.bMaxPower * 2); return ((ssize_t )tmp); } else { return (0L); } } } static struct device_attribute dev_attr_bMaxPower = {{"bMaxPower", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_bMaxPower, 0}; static ssize_t show_configuration_string(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_device *udev ; struct usb_host_config *actconfig ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; actconfig = udev->actconfig; if ((unsigned long )actconfig == (unsigned long )((struct usb_host_config *)0) || (unsigned long )actconfig->string == (unsigned long )((char *)0)) { return (0L); } else { } tmp = sprintf(buf, "%s\n", actconfig->string); return ((ssize_t )tmp); } } static struct device_attribute dev_attr_configuration = {{"configuration", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_configuration_string, 0}; static ssize_t show_bConfigurationValue(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_device *udev ; struct usb_host_config *actconfig ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; actconfig = udev->actconfig; if ((unsigned long )actconfig != (unsigned long )((struct usb_host_config *)0)) { tmp = sprintf(buf, "%u\n", (int )actconfig->desc.bConfigurationValue); return ((ssize_t )tmp); } else { return (0L); } } } static ssize_t set_bConfigurationValue(struct device *dev , struct device_attribute *attr , char const *buf , size_t count ) { struct usb_device *udev ; struct device const *__mptr ; int config ; int value ; int tmp ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; tmp = sscanf(buf, "%d", & config); if ((tmp != 1 || config < -1) || config > 255) { return (-22L); } else { } device_lock___3(& udev->dev); value = usb_set_configuration(udev, config); device_unlock___3(& udev->dev); return ((ssize_t )(value < 0 ? (size_t )value : count)); } } static struct device_attribute dev_attr_bConfigurationValue = {{"bConfigurationValue", 420U, 1, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_bConfigurationValue, & set_bConfigurationValue}; static ssize_t show_product(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_device *udev ; int retval ; struct device const *__mptr ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; device_lock___3(& udev->dev); retval = sprintf(buf, "%s\n", udev->product); device_unlock___3(& udev->dev); return ((ssize_t )retval); } } static struct device_attribute dev_attr_product = {{"product", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_product, 0}; static ssize_t show_manufacturer(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_device *udev ; int retval ; struct device const *__mptr ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; device_lock___3(& udev->dev); retval = sprintf(buf, "%s\n", udev->manufacturer); device_unlock___3(& udev->dev); return ((ssize_t )retval); } } static struct device_attribute dev_attr_manufacturer = {{"manufacturer", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_manufacturer, 0}; static ssize_t show_serial(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_device *udev ; int retval ; struct device const *__mptr ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; device_lock___3(& udev->dev); retval = sprintf(buf, "%s\n", udev->serial); device_unlock___3(& udev->dev); return ((ssize_t )retval); } } static struct device_attribute dev_attr_serial = {{"serial", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_serial, 0}; static ssize_t show_speed(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_device *udev ; char *speed ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; switch ((unsigned int )udev->speed) { case 1U: speed = (char *)"1.5"; goto ldv_27361; case 0U: ; case 2U: speed = (char *)"12"; goto ldv_27361; case 3U: speed = (char *)"480"; goto ldv_27361; case 4U: speed = (char *)"480"; goto ldv_27361; case 5U: speed = (char *)"5000"; goto ldv_27361; default: speed = (char *)"unknown"; } ldv_27361: tmp = sprintf(buf, "%s\n", speed); return ((ssize_t )tmp); } } static struct device_attribute dev_attr_speed = {{"speed", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_speed, 0}; static ssize_t show_busnum(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_device *udev ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; tmp = sprintf(buf, "%d\n", (udev->bus)->busnum); return ((ssize_t )tmp); } } static struct device_attribute dev_attr_busnum = {{"busnum", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_busnum, 0}; static ssize_t show_devnum(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_device *udev ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; tmp = sprintf(buf, "%d\n", udev->devnum); return ((ssize_t )tmp); } } static struct device_attribute dev_attr_devnum = {{"devnum", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_devnum, 0}; static ssize_t show_devpath(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_device *udev ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; tmp = sprintf(buf, "%s\n", (char *)(& udev->devpath)); return ((ssize_t )tmp); } } static struct device_attribute dev_attr_devpath = {{"devpath", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_devpath, 0}; static ssize_t show_version(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_device *udev ; u16 bcdUSB ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; bcdUSB = udev->descriptor.bcdUSB; tmp = sprintf(buf, "%2x.%02x\n", (int )bcdUSB >> 8, (int )bcdUSB & 255); return ((ssize_t )tmp); } } static struct device_attribute dev_attr_version = {{"version", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_version, 0}; static ssize_t show_maxchild(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_device *udev ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; tmp = sprintf(buf, "%d\n", udev->maxchild); return ((ssize_t )tmp); } } static struct device_attribute dev_attr_maxchild = {{"maxchild", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_maxchild, 0}; static ssize_t show_quirks(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_device *udev ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; tmp = sprintf(buf, "0x%x\n", udev->quirks); return ((ssize_t )tmp); } } static struct device_attribute dev_attr_quirks = {{"quirks", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_quirks, 0}; static ssize_t show_avoid_reset_quirk(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_device *udev ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; tmp = sprintf(buf, "%d\n", (udev->quirks & 16U) != 0U); return ((ssize_t )tmp); } } static ssize_t set_avoid_reset_quirk(struct device *dev , struct device_attribute *attr , char const *buf , size_t count ) { struct usb_device *udev ; struct device const *__mptr ; int val ; int tmp ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; tmp = sscanf(buf, "%d", & val); if ((tmp != 1 || val < 0) || val > 1) { return (-22L); } else { } device_lock___3(& udev->dev); if (val != 0) { udev->quirks = udev->quirks | 16U; } else { udev->quirks = udev->quirks & 4294967279U; } device_unlock___3(& udev->dev); return ((ssize_t )count); } } static struct device_attribute dev_attr_avoid_reset_quirk = {{"avoid_reset_quirk", 420U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_avoid_reset_quirk, & set_avoid_reset_quirk}; static ssize_t show_urbnum(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_device *udev ; struct device const *__mptr ; int tmp ; int tmp___0 ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; tmp = atomic_read((atomic_t const *)(& udev->urbnum)); tmp___0 = sprintf(buf, "%d\n", tmp); return ((ssize_t )tmp___0); } } static struct device_attribute dev_attr_urbnum = {{"urbnum", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_urbnum, 0}; static ssize_t show_removable(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_device *udev ; char *state ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; switch ((unsigned int )udev->removable) { case 1U: state = (char *)"removable"; goto ldv_27462; case 2U: state = (char *)"fixed"; goto ldv_27462; default: state = (char *)"unknown"; } ldv_27462: tmp = sprintf(buf, "%s\n", state); return ((ssize_t )tmp); } } static struct device_attribute dev_attr_removable = {{"removable", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_removable, 0}; static ssize_t show_ltm_capable(struct device *dev , struct device_attribute *attr , char *buf ) { int tmp ; struct device const *__mptr ; bool tmp___0 ; int tmp___1 ; { __mptr = (struct device const *)dev; tmp___0 = usb_device_supports_ltm((struct usb_device *)__mptr + 0xffffffffffffff78UL); if ((int )tmp___0) { tmp = sprintf(buf, "%s\n", (char *)"yes"); return ((ssize_t )tmp); } else { } tmp___1 = sprintf(buf, "%s\n", (char *)"no"); return ((ssize_t )tmp___1); } } static struct device_attribute dev_attr_ltm_capable = {{"ltm_capable", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_ltm_capable, 0}; static ssize_t show_persist(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_device *udev ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; tmp = sprintf(buf, "%d\n", (int )udev->persist_enabled); return ((ssize_t )tmp); } } static ssize_t set_persist(struct device *dev , struct device_attribute *attr , char const *buf , size_t count ) { struct usb_device *udev ; struct device const *__mptr ; int value ; int tmp ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; if ((unsigned int )udev->descriptor.bDeviceClass == 9U) { return (-1L); } else { } tmp = sscanf(buf, "%d", & value); if (tmp != 1) { return (-22L); } else { } device_lock___3(& udev->dev); udev->persist_enabled = value != 0; device_unlock___3(& udev->dev); return ((ssize_t )count); } } static struct device_attribute dev_attr_persist = {{"persist", 420U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_persist, & set_persist}; static int add_persist_attributes(struct device *dev ) { int rc ; struct usb_device *udev ; struct device const *__mptr ; int tmp ; { rc = 0; tmp = is_usb_device((struct device const *)dev); if (tmp != 0) { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; if ((unsigned int )udev->descriptor.bDeviceClass != 9U) { rc = sysfs_add_file_to_group(& dev->kobj, (struct attribute const *)(& dev_attr_persist.attr), (char const *)(& power_group_name)); } else { } } else { } return (rc); } } static void remove_persist_attributes(struct device *dev ) { { sysfs_remove_file_from_group(& dev->kobj, (struct attribute const *)(& dev_attr_persist.attr), (char const *)(& power_group_name)); return; } } static ssize_t show_connected_duration(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_device *udev ; struct device const *__mptr ; unsigned int tmp ; int tmp___0 ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; tmp = jiffies_to_msecs((unsigned long )jiffies - udev->connect_time); tmp___0 = sprintf(buf, "%u\n", tmp); return ((ssize_t )tmp___0); } } static struct device_attribute dev_attr_connected_duration = {{"connected_duration", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_connected_duration, 0}; static ssize_t show_active_duration(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_device *udev ; struct device const *__mptr ; int duration ; unsigned int tmp ; unsigned int tmp___0 ; int tmp___1 ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; if ((unsigned int )udev->state != 8U) { tmp = jiffies_to_msecs(udev->active_duration + (unsigned long )jiffies); duration = (int )tmp; } else { tmp___0 = jiffies_to_msecs(udev->active_duration); duration = (int )tmp___0; } tmp___1 = sprintf(buf, "%u\n", duration); return ((ssize_t )tmp___1); } } static struct device_attribute dev_attr_active_duration = {{"active_duration", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_active_duration, 0}; static ssize_t show_autosuspend(struct device *dev , struct device_attribute *attr , char *buf ) { int tmp ; { tmp = sprintf(buf, "%d\n", dev->power.autosuspend_delay / 1000); return ((ssize_t )tmp); } } static ssize_t set_autosuspend(struct device *dev , struct device_attribute *attr , char const *buf , size_t count ) { int value ; int tmp ; { tmp = sscanf(buf, "%d", & value); if ((tmp != 1 || value > 2147482) || value < -2147482) { return (-22L); } else { } pm_runtime_set_autosuspend_delay(dev, value * 1000); return ((ssize_t )count); } } static struct device_attribute dev_attr_autosuspend = {{"autosuspend", 420U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_autosuspend, & set_autosuspend}; static char const on_string[3U] = { 'o', 'n', '\000'}; static char const auto_string[5U] = { 'a', 'u', 't', 'o', '\000'}; static void warn_level(void) { int level_warned ; { if (level_warned == 0) { level_warned = 1; printk("\fWARNING! power/level is deprecated; use power/control instead\n"); } else { } return; } } static ssize_t show_level(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_device *udev ; struct device const *__mptr ; char const *p ; int tmp ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; p = (char const *)(& auto_string); warn_level(); if ((unsigned int )udev->state != 8U && (unsigned int )*((unsigned char *)udev + 944UL) == 0U) { p = (char const *)(& on_string); } else { } tmp = sprintf(buf, "%s\n", p); return ((ssize_t )tmp); } } static ssize_t set_level(struct device *dev , struct device_attribute *attr , char const *buf , size_t count ) { struct usb_device *udev ; struct device const *__mptr ; int len ; char *cp ; int rc ; void *tmp ; int tmp___0 ; int tmp___1 ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; len = (int )count; rc = (int )count; warn_level(); tmp = memchr((void const *)buf, 10, count); cp = (char *)tmp; if ((unsigned long )cp != (unsigned long )((char *)0)) { len = (int )((unsigned int )((long )cp) - (unsigned int )((long )buf)); } else { } device_lock___3(& udev->dev); if (len == 2) { tmp___1 = strncmp(buf, (char const *)(& on_string), (__kernel_size_t )len); if (tmp___1 == 0) { usb_disable_autosuspend(udev); } else { goto _L; } } else _L: /* CIL Label */ if (len == 4) { tmp___0 = strncmp(buf, (char const *)(& auto_string), (__kernel_size_t )len); if (tmp___0 == 0) { usb_enable_autosuspend(udev); } else { rc = -22; } } else { rc = -22; } device_unlock___3(& udev->dev); return ((ssize_t )rc); } } static struct device_attribute dev_attr_level = {{"level", 420U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_level, & set_level}; static ssize_t show_usb2_hardware_lpm(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_device *udev ; struct device const *__mptr ; char const *p ; int tmp ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; if ((unsigned int )*((unsigned char *)udev + 1597UL) != 0U) { p = "enabled"; } else { p = "disabled"; } tmp = sprintf(buf, "%s\n", p); return ((ssize_t )tmp); } } static ssize_t set_usb2_hardware_lpm(struct device *dev , struct device_attribute *attr , char const *buf , size_t count ) { struct usb_device *udev ; struct device const *__mptr ; bool value ; int ret ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; device_lock___3(& udev->dev); ret = strtobool(buf, & value); if (ret == 0) { ret = usb_set_usb2_hardware_lpm(udev, (int )value); } else { } device_unlock___3(& udev->dev); if (ret == 0) { return ((ssize_t )count); } else { } return ((ssize_t )ret); } } static struct device_attribute dev_attr_usb2_hardware_lpm = {{"usb2_hardware_lpm", 420U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_usb2_hardware_lpm, & set_usb2_hardware_lpm}; static struct attribute *usb2_hardware_lpm_attr[2U] = { & dev_attr_usb2_hardware_lpm.attr, 0}; static struct attribute_group usb2_hardware_lpm_attr_group = {(char const *)(& power_group_name), 0, (struct attribute **)(& usb2_hardware_lpm_attr)}; static struct attribute *power_attrs[5U] = { & dev_attr_autosuspend.attr, & dev_attr_level.attr, & dev_attr_connected_duration.attr, & dev_attr_active_duration.attr, 0}; static struct attribute_group power_attr_group = {(char const *)(& power_group_name), 0, (struct attribute **)(& power_attrs)}; static int add_power_attributes(struct device *dev ) { int rc ; struct usb_device *udev ; struct device const *__mptr ; int tmp ; { rc = 0; tmp = is_usb_device((struct device const *)dev); if (tmp != 0) { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; rc = sysfs_merge_group(& dev->kobj, (struct attribute_group const *)(& power_attr_group)); if ((unsigned int )*((unsigned char *)udev + 1596UL) != 0U) { rc = sysfs_merge_group(& dev->kobj, (struct attribute_group const *)(& usb2_hardware_lpm_attr_group)); } else { } } else { } return (rc); } } static void remove_power_attributes(struct device *dev ) { { sysfs_unmerge_group(& dev->kobj, (struct attribute_group const *)(& usb2_hardware_lpm_attr_group)); sysfs_unmerge_group(& dev->kobj, (struct attribute_group const *)(& power_attr_group)); return; } } static ssize_t show_idVendor(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_device *udev ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; tmp = sprintf(buf, "%04x\n", (int )udev->descriptor.idVendor); return ((ssize_t )tmp); } } static struct device_attribute dev_attr_idVendor = {{"idVendor", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_idVendor, 0}; static ssize_t show_idProduct(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_device *udev ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; tmp = sprintf(buf, "%04x\n", (int )udev->descriptor.idProduct); return ((ssize_t )tmp); } } static struct device_attribute dev_attr_idProduct = {{"idProduct", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_idProduct, 0}; static ssize_t show_bcdDevice(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_device *udev ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; tmp = sprintf(buf, "%04x\n", (int )udev->descriptor.bcdDevice); return ((ssize_t )tmp); } } static struct device_attribute dev_attr_bcdDevice = {{"bcdDevice", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_bcdDevice, 0}; static ssize_t show_bDeviceClass(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_device *udev ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; tmp = sprintf(buf, "%02x\n", (int )udev->descriptor.bDeviceClass); return ((ssize_t )tmp); } } static struct device_attribute dev_attr_bDeviceClass = {{"bDeviceClass", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_bDeviceClass, 0}; static ssize_t show_bDeviceSubClass(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_device *udev ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; tmp = sprintf(buf, "%02x\n", (int )udev->descriptor.bDeviceSubClass); return ((ssize_t )tmp); } } static struct device_attribute dev_attr_bDeviceSubClass = {{"bDeviceSubClass", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_bDeviceSubClass, 0}; static ssize_t show_bDeviceProtocol(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_device *udev ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; tmp = sprintf(buf, "%02x\n", (int )udev->descriptor.bDeviceProtocol); return ((ssize_t )tmp); } } static struct device_attribute dev_attr_bDeviceProtocol = {{"bDeviceProtocol", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_bDeviceProtocol, 0}; static ssize_t show_bNumConfigurations(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_device *udev ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; tmp = sprintf(buf, "%d\n", (int )udev->descriptor.bNumConfigurations); return ((ssize_t )tmp); } } static struct device_attribute dev_attr_bNumConfigurations = {{"bNumConfigurations", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_bNumConfigurations, 0}; static ssize_t show_bMaxPacketSize0(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_device *udev ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; tmp = sprintf(buf, "%d\n", (int )udev->descriptor.bMaxPacketSize0); return ((ssize_t )tmp); } } static struct device_attribute dev_attr_bMaxPacketSize0 = {{"bMaxPacketSize0", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_bMaxPacketSize0, 0}; static ssize_t usb_dev_authorized_show(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_device *usb_dev ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev; usb_dev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; tmp = snprintf(buf, 4096UL, "%u\n", (int )usb_dev->authorized); return ((ssize_t )tmp); } } static ssize_t usb_dev_authorized_store(struct device *dev , struct device_attribute *attr , char const *buf , size_t size ) { ssize_t result ; struct usb_device *usb_dev ; struct device const *__mptr ; unsigned int val ; int tmp ; int tmp___0 ; int tmp___1 ; { __mptr = (struct device const *)dev; usb_dev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; tmp = sscanf(buf, "%u\n", & val); result = (ssize_t )tmp; if (result != 1L) { result = -22L; } else if (val == 0U) { tmp___0 = usb_deauthorize_device(usb_dev); result = (ssize_t )tmp___0; } else { tmp___1 = usb_authorize_device(usb_dev); result = (ssize_t )tmp___1; } return (result >= 0L ? (ssize_t )size : result); } } static struct device_attribute dev_attr_authorized = {{"authorized", 420U, 1, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & usb_dev_authorized_show, & usb_dev_authorized_store}; static ssize_t usb_remove_store(struct device *dev , struct device_attribute *attr , char const *buf , size_t count ) { struct usb_device *udev ; struct device const *__mptr ; int rc ; { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; rc = 0; device_lock___3(& udev->dev); if ((unsigned int )udev->state != 0U) { usb_set_configuration(udev, -1); rc = usb_remove_device(udev); } else { } if (rc == 0) { rc = (int )count; } else { } device_unlock___3(& udev->dev); return ((ssize_t )rc); } } static struct device_attribute dev_attr_remove = {{"remove", 128U, 1, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, 0, & usb_remove_store}; static struct attribute *dev_attrs[27U] = { & dev_attr_configuration.attr, & dev_attr_bNumInterfaces.attr, & dev_attr_bConfigurationValue.attr, & dev_attr_bmAttributes.attr, & dev_attr_bMaxPower.attr, & dev_attr_urbnum.attr, & dev_attr_idVendor.attr, & dev_attr_idProduct.attr, & dev_attr_bcdDevice.attr, & dev_attr_bDeviceClass.attr, & dev_attr_bDeviceSubClass.attr, & dev_attr_bDeviceProtocol.attr, & dev_attr_bNumConfigurations.attr, & dev_attr_bMaxPacketSize0.attr, & dev_attr_speed.attr, & dev_attr_busnum.attr, & dev_attr_devnum.attr, & dev_attr_devpath.attr, & dev_attr_version.attr, & dev_attr_maxchild.attr, & dev_attr_quirks.attr, & dev_attr_avoid_reset_quirk.attr, & dev_attr_authorized.attr, & dev_attr_remove.attr, & dev_attr_removable.attr, & dev_attr_ltm_capable.attr, 0}; static struct attribute_group dev_attr_grp = {0, 0, (struct attribute **)(& dev_attrs)}; static struct attribute *dev_string_attrs[4U] = { & dev_attr_manufacturer.attr, & dev_attr_product.attr, & dev_attr_serial.attr, 0}; static umode_t dev_string_attrs_are_visible(struct kobject *kobj , struct attribute *a , int n ) { struct device *dev ; struct kobject const *__mptr ; struct usb_device *udev ; struct device const *__mptr___0 ; { __mptr = (struct kobject const *)kobj; dev = (struct device *)__mptr + 0xfffffffffffffff0UL; __mptr___0 = (struct device const *)dev; udev = (struct usb_device *)__mptr___0 + 0xffffffffffffff78UL; if ((unsigned long )a == (unsigned long )(& dev_attr_manufacturer.attr)) { if ((unsigned long )udev->manufacturer == (unsigned long )((char *)0)) { return (0U); } else if ((unsigned long )a == (unsigned long )(& dev_attr_product.attr)) { if ((unsigned long )udev->product == (unsigned long )((char *)0)) { return (0U); } else if ((unsigned long )a == (unsigned long )(& dev_attr_serial.attr)) { if ((unsigned long )udev->serial == (unsigned long )((char *)0)) { return (0U); } else { } } else { } } else { } } else { } return (a->mode); } } static struct attribute_group dev_string_attr_grp = {0, & dev_string_attrs_are_visible, (struct attribute **)(& dev_string_attrs)}; struct attribute_group const *usb_device_groups[3U] = { (struct attribute_group const *)(& dev_attr_grp), (struct attribute_group const *)(& dev_string_attr_grp), 0}; static ssize_t read_descriptors(struct file *filp , struct kobject *kobj , struct bin_attribute *attr , char *buf , loff_t off , size_t count ) { struct device *dev ; struct kobject const *__mptr ; struct usb_device *udev ; struct device const *__mptr___0 ; size_t nleft ; size_t srclen ; size_t n ; int cfgno ; void *src ; size_t _min1 ; unsigned long _min2 ; size_t __len ; void *__ret ; { __mptr = (struct kobject const *)kobj; dev = (struct device *)__mptr + 0xfffffffffffffff0UL; __mptr___0 = (struct device const *)dev; udev = (struct usb_device *)__mptr___0 + 0xffffffffffffff78UL; nleft = count; cfgno = -1; goto ldv_27743; ldv_27742: ; if (cfgno < 0) { src = (void *)(& udev->descriptor); srclen = 18UL; } else { src = (void *)*(udev->rawdescriptors + (unsigned long )cfgno); srclen = (size_t )(udev->config + (unsigned long )cfgno)->desc.wTotalLength; } if ((unsigned long long )off < (unsigned long long )srclen) { _min1 = nleft; _min2 = srclen - (unsigned long )off; n = _min1 < _min2 ? _min1 : _min2; __len = n; __ret = __builtin_memcpy((void *)buf, (void const *)src + (unsigned long )off, __len); nleft = nleft - n; buf = buf + n; off = 0LL; } else { off = (loff_t )((unsigned long long )off - (unsigned long long )srclen); } cfgno = cfgno + 1; ldv_27743: ; if ((int )udev->descriptor.bNumConfigurations > cfgno && nleft != 0UL) { goto ldv_27742; } else { } return ((ssize_t )(count - nleft)); } } static struct bin_attribute dev_bin_attr_descriptors = {{"descriptors", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, 65553UL, 0, & read_descriptors, 0, 0}; int usb_create_sysfs_dev_files(struct usb_device *udev ) { struct device *dev ; int retval ; { dev = & udev->dev; retval = device_create_bin_file(dev, (struct bin_attribute const *)(& dev_bin_attr_descriptors)); if (retval != 0) { goto error; } else { } retval = add_persist_attributes(dev); if (retval != 0) { goto error; } else { } retval = add_power_attributes(dev); if (retval != 0) { goto error; } else { } return (retval); error: usb_remove_sysfs_dev_files(udev); return (retval); } } void usb_remove_sysfs_dev_files(struct usb_device *udev ) { struct device *dev ; { dev = & udev->dev; remove_power_attributes(dev); remove_persist_attributes(dev); device_remove_bin_file(dev, (struct bin_attribute const *)(& dev_bin_attr_descriptors)); return; } } static ssize_t show_iad_bFirstInterface(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_interface *intf ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev; intf = (struct usb_interface *)__mptr + 0xffffffffffffffd0UL; tmp = sprintf(buf, "%02x\n", (int )(intf->intf_assoc)->bFirstInterface); return ((ssize_t )tmp); } } static struct device_attribute dev_attr_iad_bFirstInterface = {{"iad_bFirstInterface", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_iad_bFirstInterface, 0}; static ssize_t show_iad_bInterfaceCount(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_interface *intf ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev; intf = (struct usb_interface *)__mptr + 0xffffffffffffffd0UL; tmp = sprintf(buf, "%02d\n", (int )(intf->intf_assoc)->bInterfaceCount); return ((ssize_t )tmp); } } static struct device_attribute dev_attr_iad_bInterfaceCount = {{"iad_bInterfaceCount", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_iad_bInterfaceCount, 0}; static ssize_t show_iad_bFunctionClass(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_interface *intf ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev; intf = (struct usb_interface *)__mptr + 0xffffffffffffffd0UL; tmp = sprintf(buf, "%02x\n", (int )(intf->intf_assoc)->bFunctionClass); return ((ssize_t )tmp); } } static struct device_attribute dev_attr_iad_bFunctionClass = {{"iad_bFunctionClass", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_iad_bFunctionClass, 0}; static ssize_t show_iad_bFunctionSubClass(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_interface *intf ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev; intf = (struct usb_interface *)__mptr + 0xffffffffffffffd0UL; tmp = sprintf(buf, "%02x\n", (int )(intf->intf_assoc)->bFunctionSubClass); return ((ssize_t )tmp); } } static struct device_attribute dev_attr_iad_bFunctionSubClass = {{"iad_bFunctionSubClass", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_iad_bFunctionSubClass, 0}; static ssize_t show_iad_bFunctionProtocol(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_interface *intf ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev; intf = (struct usb_interface *)__mptr + 0xffffffffffffffd0UL; tmp = sprintf(buf, "%02x\n", (int )(intf->intf_assoc)->bFunctionProtocol); return ((ssize_t )tmp); } } static struct device_attribute dev_attr_iad_bFunctionProtocol = {{"iad_bFunctionProtocol", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_iad_bFunctionProtocol, 0}; static ssize_t show_bInterfaceNumber(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_interface *intf ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev; intf = (struct usb_interface *)__mptr + 0xffffffffffffffd0UL; tmp = sprintf(buf, "%02x\n", (int )(intf->cur_altsetting)->desc.bInterfaceNumber); return ((ssize_t )tmp); } } static struct device_attribute dev_attr_bInterfaceNumber = {{"bInterfaceNumber", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_bInterfaceNumber, 0}; static ssize_t show_bAlternateSetting(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_interface *intf ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev; intf = (struct usb_interface *)__mptr + 0xffffffffffffffd0UL; tmp = sprintf(buf, "%2d\n", (int )(intf->cur_altsetting)->desc.bAlternateSetting); return ((ssize_t )tmp); } } static struct device_attribute dev_attr_bAlternateSetting = {{"bAlternateSetting", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_bAlternateSetting, 0}; static ssize_t show_bNumEndpoints(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_interface *intf ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev; intf = (struct usb_interface *)__mptr + 0xffffffffffffffd0UL; tmp = sprintf(buf, "%02x\n", (int )(intf->cur_altsetting)->desc.bNumEndpoints); return ((ssize_t )tmp); } } static struct device_attribute dev_attr_bNumEndpoints = {{"bNumEndpoints", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_bNumEndpoints, 0}; static ssize_t show_bInterfaceClass(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_interface *intf ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev; intf = (struct usb_interface *)__mptr + 0xffffffffffffffd0UL; tmp = sprintf(buf, "%02x\n", (int )(intf->cur_altsetting)->desc.bInterfaceClass); return ((ssize_t )tmp); } } static struct device_attribute dev_attr_bInterfaceClass = {{"bInterfaceClass", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_bInterfaceClass, 0}; static ssize_t show_bInterfaceSubClass(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_interface *intf ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev; intf = (struct usb_interface *)__mptr + 0xffffffffffffffd0UL; tmp = sprintf(buf, "%02x\n", (int )(intf->cur_altsetting)->desc.bInterfaceSubClass); return ((ssize_t )tmp); } } static struct device_attribute dev_attr_bInterfaceSubClass = {{"bInterfaceSubClass", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_bInterfaceSubClass, 0}; static ssize_t show_bInterfaceProtocol(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_interface *intf ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev; intf = (struct usb_interface *)__mptr + 0xffffffffffffffd0UL; tmp = sprintf(buf, "%02x\n", (int )(intf->cur_altsetting)->desc.bInterfaceProtocol); return ((ssize_t )tmp); } } static struct device_attribute dev_attr_bInterfaceProtocol = {{"bInterfaceProtocol", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_bInterfaceProtocol, 0}; static ssize_t show_interface_string(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_interface *intf ; char *string ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev; intf = (struct usb_interface *)__mptr + 0xffffffffffffffd0UL; string = (intf->cur_altsetting)->string; __asm__ volatile ("": : : "memory"); if ((unsigned long )string == (unsigned long )((char *)0)) { return (0L); } else { } tmp = sprintf(buf, "%s\n", string); return ((ssize_t )tmp); } } static struct device_attribute dev_attr_interface = {{"interface", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_interface_string, 0}; static ssize_t show_modalias(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_interface *intf ; struct usb_device *udev ; struct usb_host_interface *alt ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev; intf = (struct usb_interface *)__mptr + 0xffffffffffffffd0UL; udev = interface_to_usbdev(intf); alt = intf->cur_altsetting; tmp = sprintf(buf, "usb:v%04Xp%04Xd%04Xdc%02Xdsc%02Xdp%02Xic%02Xisc%02Xip%02Xin%02X\n", (int )udev->descriptor.idVendor, (int )udev->descriptor.idProduct, (int )udev->descriptor.bcdDevice, (int )udev->descriptor.bDeviceClass, (int )udev->descriptor.bDeviceSubClass, (int )udev->descriptor.bDeviceProtocol, (int )alt->desc.bInterfaceClass, (int )alt->desc.bInterfaceSubClass, (int )alt->desc.bInterfaceProtocol, (int )alt->desc.bInterfaceNumber); return ((ssize_t )tmp); } } static struct device_attribute dev_attr_modalias = {{"modalias", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_modalias, 0}; static ssize_t show_supports_autosuspend(struct device *dev , struct device_attribute *attr , char *buf ) { struct usb_interface *intf ; struct usb_device *udev ; int ret ; struct device const *__mptr ; struct device_driver const *__mptr___0 ; { __mptr = (struct device const *)dev; intf = (struct usb_interface *)__mptr + 0xffffffffffffffd0UL; udev = interface_to_usbdev(intf); device_lock___3(& udev->dev); if ((unsigned long )intf->dev.driver == (unsigned long )((struct device_driver *)0)) { ret = sprintf(buf, "%u\n", 1); } else { __mptr___0 = (struct device_driver const *)intf->dev.driver; if ((unsigned int )*((unsigned char *)((struct usb_driver *)__mptr___0 + 0xffffffffffffff58UL) + 288UL) != 0U) { ret = sprintf(buf, "%u\n", 1); } else { ret = sprintf(buf, "%u\n", 0); } } device_unlock___3(& udev->dev); return ((ssize_t )ret); } } static struct device_attribute dev_attr_supports_autosuspend = {{"supports_autosuspend", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_supports_autosuspend, 0}; static struct attribute *intf_attrs[9U] = { & dev_attr_bInterfaceNumber.attr, & dev_attr_bAlternateSetting.attr, & dev_attr_bNumEndpoints.attr, & dev_attr_bInterfaceClass.attr, & dev_attr_bInterfaceSubClass.attr, & dev_attr_bInterfaceProtocol.attr, & dev_attr_modalias.attr, & dev_attr_supports_autosuspend.attr, 0}; static struct attribute_group intf_attr_grp = {0, 0, (struct attribute **)(& intf_attrs)}; static struct attribute *intf_assoc_attrs[6U] = { & dev_attr_iad_bFirstInterface.attr, & dev_attr_iad_bInterfaceCount.attr, & dev_attr_iad_bFunctionClass.attr, & dev_attr_iad_bFunctionSubClass.attr, & dev_attr_iad_bFunctionProtocol.attr, 0}; static umode_t intf_assoc_attrs_are_visible(struct kobject *kobj , struct attribute *a , int n ) { struct device *dev ; struct kobject const *__mptr ; struct usb_interface *intf ; struct device const *__mptr___0 ; { __mptr = (struct kobject const *)kobj; dev = (struct device *)__mptr + 0xfffffffffffffff0UL; __mptr___0 = (struct device const *)dev; intf = (struct usb_interface *)__mptr___0 + 0xffffffffffffffd0UL; if ((unsigned long )intf->intf_assoc == (unsigned long )((struct usb_interface_assoc_descriptor *)0)) { return (0U); } else { } return (a->mode); } } static struct attribute_group intf_assoc_attr_grp = {0, & intf_assoc_attrs_are_visible, (struct attribute **)(& intf_assoc_attrs)}; struct attribute_group const *usb_interface_groups[3U] = { (struct attribute_group const *)(& intf_attr_grp), (struct attribute_group const *)(& intf_assoc_attr_grp), 0}; void usb_create_sysfs_intf_files(struct usb_interface *intf ) { struct usb_device *udev ; struct usb_device *tmp ; struct usb_host_interface *alt ; int tmp___0 ; int tmp___1 ; { tmp = interface_to_usbdev(intf); udev = tmp; alt = intf->cur_altsetting; if ((unsigned int )*((unsigned char *)intf + 40UL) != 0U || (unsigned int )*((unsigned char *)intf + 40UL) != 0U) { return; } else { } if ((unsigned long )alt->string == (unsigned long )((char *)0) && (udev->quirks & 8U) == 0U) { alt->string = usb_cache_string(udev, (int )alt->desc.iInterface); } else { } if ((unsigned long )alt->string != (unsigned long )((char *)0)) { tmp___0 = device_create_file(& intf->dev, (struct device_attribute const *)(& dev_attr_interface)); if (tmp___0 != 0) { tmp___1 = 1; } else { tmp___1 = 0; } } else { tmp___1 = 0; } intf->sysfs_files_created = 1U; return; } } void usb_remove_sysfs_intf_files(struct usb_interface *intf ) { { if ((unsigned int )*((unsigned char *)intf + 40UL) == 0U) { return; } else { } device_remove_file(& intf->dev, (struct device_attribute const *)(& dev_attr_interface)); intf->sysfs_files_created = 0U; return; } } void ldv_main9_sequence_infinite_withcheck_stateful(void) { struct kobject *var_group1 ; struct attribute *var_group2 ; int var_dev_string_attrs_are_visible_32_p2 ; struct file *var_group3 ; struct bin_attribute *var_read_descriptors_33_p2 ; char *var_read_descriptors_33_p3 ; loff_t var_read_descriptors_33_p4 ; size_t var_read_descriptors_33_p5 ; int var_intf_assoc_attrs_are_visible_39_p2 ; int tmp ; int tmp___0 ; { LDV_IN_INTERRUPT = 1; ldv_initialize(); goto ldv_27944; ldv_27943: tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ldv_handler_precall(); dev_string_attrs_are_visible(var_group1, var_group2, var_dev_string_attrs_are_visible_32_p2); goto ldv_27939; case 1: ldv_handler_precall(); read_descriptors(var_group3, var_group1, var_read_descriptors_33_p2, var_read_descriptors_33_p3, var_read_descriptors_33_p4, var_read_descriptors_33_p5); goto ldv_27939; case 2: ldv_handler_precall(); intf_assoc_attrs_are_visible(var_group1, var_group2, var_intf_assoc_attrs_are_visible_39_p2); goto ldv_27939; default: ; goto ldv_27939; } ldv_27939: ; ldv_27944: tmp___0 = __VERIFIER_nondet_int(); if (tmp___0 != 0) { goto ldv_27943; } else { } ldv_check_final_state(); return; } } void ldv_mutex_lock_283(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_284(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_285(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_286(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___2 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_287(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_288(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mtx(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_289(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mtx(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_290(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mtx(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_291(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mtx(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_292(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_293(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } int ldv_mutex_trylock_308(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_306(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_309(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_311(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_313(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_315(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_305(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_307(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_310(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_312(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_314(struct mutex *ldv_func_arg1 ) ; struct device_type usb_ep_device_type ; static ssize_t show_ep_bLength(struct device *dev , struct device_attribute *attr , char *buf ) { struct ep_device *ep ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev; ep = (struct ep_device *)__mptr + 0xfffffffffffffff0UL; tmp = sprintf(buf, "%02x\n", (int )(ep->desc)->bLength); return ((ssize_t )tmp); } } static struct device_attribute dev_attr_bLength = {{"bLength", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_ep_bLength, 0}; static ssize_t show_ep_bEndpointAddress(struct device *dev , struct device_attribute *attr , char *buf ) { struct ep_device *ep ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev; ep = (struct ep_device *)__mptr + 0xfffffffffffffff0UL; tmp = sprintf(buf, "%02x\n", (int )(ep->desc)->bEndpointAddress); return ((ssize_t )tmp); } } static struct device_attribute dev_attr_bEndpointAddress = {{"bEndpointAddress", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_ep_bEndpointAddress, 0}; static ssize_t show_ep_bmAttributes(struct device *dev , struct device_attribute *attr , char *buf ) { struct ep_device *ep ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev; ep = (struct ep_device *)__mptr + 0xfffffffffffffff0UL; tmp = sprintf(buf, "%02x\n", (int )(ep->desc)->bmAttributes); return ((ssize_t )tmp); } } static struct device_attribute dev_attr_bmAttributes___0 = {{"bmAttributes", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_ep_bmAttributes, 0}; static ssize_t show_ep_bInterval(struct device *dev , struct device_attribute *attr , char *buf ) { struct ep_device *ep ; struct device const *__mptr ; int tmp ; { __mptr = (struct device const *)dev; ep = (struct ep_device *)__mptr + 0xfffffffffffffff0UL; tmp = sprintf(buf, "%02x\n", (int )(ep->desc)->bInterval); return ((ssize_t )tmp); } } static struct device_attribute dev_attr_bInterval = {{"bInterval", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_ep_bInterval, 0}; static ssize_t show_ep_wMaxPacketSize(struct device *dev , struct device_attribute *attr , char *buf ) { struct ep_device *ep ; struct device const *__mptr ; int tmp ; int tmp___0 ; { __mptr = (struct device const *)dev; ep = (struct ep_device *)__mptr + 0xfffffffffffffff0UL; tmp = usb_endpoint_maxp((struct usb_endpoint_descriptor const *)ep->desc); tmp___0 = sprintf(buf, "%04x\n", tmp & 2047); return ((ssize_t )tmp___0); } } static struct device_attribute dev_attr_wMaxPacketSize = {{"wMaxPacketSize", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_ep_wMaxPacketSize, 0}; static ssize_t show_ep_type(struct device *dev , struct device_attribute *attr , char *buf ) { struct ep_device *ep ; struct device const *__mptr ; char *type ; int tmp ; int tmp___0 ; { __mptr = (struct device const *)dev; ep = (struct ep_device *)__mptr + 0xfffffffffffffff0UL; type = (char *)"unknown"; tmp = usb_endpoint_type((struct usb_endpoint_descriptor const *)ep->desc); switch (tmp) { case 0: type = (char *)"Control"; goto ldv_27407; case 1: type = (char *)"Isoc"; goto ldv_27407; case 2: type = (char *)"Bulk"; goto ldv_27407; case 3: type = (char *)"Interrupt"; goto ldv_27407; } ldv_27407: tmp___0 = sprintf(buf, "%s\n", type); return ((ssize_t )tmp___0); } } static struct device_attribute dev_attr_type = {{"type", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_ep_type, 0}; static ssize_t show_ep_interval(struct device *dev , struct device_attribute *attr , char *buf ) { struct ep_device *ep ; struct device const *__mptr ; char unit ; unsigned int interval ; unsigned int in ; int tmp ; int tmp___0 ; { __mptr = (struct device const *)dev; ep = (struct ep_device *)__mptr + 0xfffffffffffffff0UL; interval = 0U; in = (unsigned int )(ep->desc)->bEndpointAddress & 128U; tmp = usb_endpoint_type((struct usb_endpoint_descriptor const *)ep->desc); switch (tmp) { case 0: ; if ((unsigned int )(ep->udev)->speed == 3U) { interval = (unsigned int )(ep->desc)->bInterval; } else { } goto ldv_27424; case 1: interval = (unsigned int )(1 << ((int )(ep->desc)->bInterval + -1)); goto ldv_27424; case 2: ; if ((unsigned int )(ep->udev)->speed == 3U && in == 0U) { interval = (unsigned int )(ep->desc)->bInterval; } else { } goto ldv_27424; case 3: ; if ((unsigned int )(ep->udev)->speed == 3U) { interval = (unsigned int )(1 << ((int )(ep->desc)->bInterval + -1)); } else { interval = (unsigned int )(ep->desc)->bInterval; } goto ldv_27424; } ldv_27424: interval = ((unsigned int )(ep->udev)->speed == 3U ? 125U : 1000U) * interval; if (interval % 1000U != 0U) { unit = 117; } else { unit = 109; interval = interval / 1000U; } tmp___0 = sprintf(buf, "%d%cs\n", interval, (int )unit); return ((ssize_t )tmp___0); } } static struct device_attribute dev_attr_interval = {{"interval", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_ep_interval, 0}; static ssize_t show_ep_direction(struct device *dev , struct device_attribute *attr , char *buf ) { struct ep_device *ep ; struct device const *__mptr ; char *direction ; int tmp ; int tmp___0 ; int tmp___1 ; { __mptr = (struct device const *)dev; ep = (struct ep_device *)__mptr + 0xfffffffffffffff0UL; tmp___0 = usb_endpoint_xfer_control((struct usb_endpoint_descriptor const *)ep->desc); if (tmp___0 != 0) { direction = (char *)"both"; } else { tmp = usb_endpoint_dir_in((struct usb_endpoint_descriptor const *)ep->desc); if (tmp != 0) { direction = (char *)"in"; } else { direction = (char *)"out"; } } tmp___1 = sprintf(buf, "%s\n", direction); return ((ssize_t )tmp___1); } } static struct device_attribute dev_attr_direction = {{"direction", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & show_ep_direction, 0}; static struct attribute *ep_dev_attrs[9U] = { & dev_attr_bLength.attr, & dev_attr_bEndpointAddress.attr, & dev_attr_bmAttributes___0.attr, & dev_attr_bInterval.attr, & dev_attr_wMaxPacketSize.attr, & dev_attr_interval.attr, & dev_attr_type.attr, & dev_attr_direction.attr, 0}; static struct attribute_group ep_dev_attr_grp = {0, 0, (struct attribute **)(& ep_dev_attrs)}; static struct attribute_group const *ep_dev_groups[2U] = { (struct attribute_group const *)(& ep_dev_attr_grp), 0}; static void ep_device_release(struct device *dev ) { struct ep_device *ep_dev ; struct device const *__mptr ; { __mptr = (struct device const *)dev; ep_dev = (struct ep_device *)__mptr + 0xfffffffffffffff0UL; kfree((void const *)ep_dev); return; } } struct device_type usb_ep_device_type = {"usb_endpoint", 0, 0, 0, & ep_device_release, 0}; int usb_create_ep_devs(struct device *parent , struct usb_host_endpoint *endpoint , struct usb_device *udev ) { struct ep_device *ep_dev ; int retval ; void *tmp ; { tmp = kzalloc(1160UL, 208U); ep_dev = (struct ep_device *)tmp; if ((unsigned long )ep_dev == (unsigned long )((struct ep_device *)0)) { retval = -12; goto exit; } else { } ep_dev->desc = & endpoint->desc; ep_dev->udev = udev; ep_dev->dev.groups = (struct attribute_group const **)(& ep_dev_groups); ep_dev->dev.type = (struct device_type const *)(& usb_ep_device_type); ep_dev->dev.parent = parent; dev_set_name(& ep_dev->dev, "ep_%02x", (int )endpoint->desc.bEndpointAddress); retval = device_register(& ep_dev->dev); if (retval != 0) { goto error_register; } else { } device_enable_async_suspend(& ep_dev->dev); endpoint->ep_dev = ep_dev; return (retval); error_register: put_device(& ep_dev->dev); exit: ; return (retval); } } void usb_remove_ep_devs(struct usb_host_endpoint *endpoint ) { struct ep_device *ep_dev ; { ep_dev = endpoint->ep_dev; if ((unsigned long )ep_dev != (unsigned long )((struct ep_device *)0)) { device_unregister(& ep_dev->dev); endpoint->ep_dev = 0; } else { } return; } } void ldv_main10_sequence_infinite_withcheck_stateful(void) { struct device *var_group1 ; int ldv_s_usb_ep_device_type_device_type ; int tmp ; int tmp___0 ; { ldv_s_usb_ep_device_type_device_type = 0; LDV_IN_INTERRUPT = 1; ldv_initialize(); goto ldv_27484; ldv_27483: tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_s_usb_ep_device_type_device_type == 0) { ldv_handler_precall(); ep_device_release(var_group1); ldv_s_usb_ep_device_type_device_type = 0; } else { } goto ldv_27481; default: ; goto ldv_27481; } ldv_27481: ; ldv_27484: tmp___0 = __VERIFIER_nondet_int(); if (tmp___0 != 0 || ldv_s_usb_ep_device_type_device_type != 0) { goto ldv_27483; } else { } ldv_check_final_state(); return; } } void ldv_mutex_lock_305(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_306(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_307(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_308(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___2 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_309(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_310(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mtx(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_311(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mtx(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_312(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mtx(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_313(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mtx(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_314(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_315(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } __inline static __u16 __le16_to_cpup(__le16 const *p ) { { return ((__u16 )*p); } } extern void print_hex_dump(char const * , char const * , int , int , int , void const * , size_t , bool ) ; extern void might_fault(void) ; __inline static void list_move_tail(struct list_head *list , struct list_head *head ) { { __list_del_entry(list); list_add_tail(list, head); return; } } extern char *strncpy(char * , char const * , __kernel_size_t ) ; extern void __xchg_wrong_size(void) ; __inline static void atomic_add(int i , atomic_t *v ) { { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; addl %1,%0": "+m" (v->counter): "ir" (i)); return; } } __inline static void atomic_sub(int i , atomic_t *v ) { { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; subl %1,%0": "+m" (v->counter): "ir" (i)); return; } } __inline static int atomic_dec_and_test(atomic_t *v ) { unsigned char c ; { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; decl %0; sete %1": "+m" (v->counter), "=qm" (c): : "memory"); return ((unsigned int )c != 0U); } } int ldv_mutex_trylock_334(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_328(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_330(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_332(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_335(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_337(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_339(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_341(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_327(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_329(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_331(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_333(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_336(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_338(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_340(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_i_mutex(struct mutex *lock ) ; void ldv_mutex_unlock_i_mutex(struct mutex *lock ) ; void ldv_mutex_lock_usbfs_mutex(struct mutex *lock ) ; void ldv_mutex_unlock_usbfs_mutex(struct mutex *lock ) ; extern unsigned long kernel_stack ; __inline static struct thread_info *current_thread_info(void) { struct thread_info *ti ; unsigned long pfo_ret__ ; { switch (8UL) { case 1UL: __asm__ ("movb %%gs:%P1,%0": "=q" (pfo_ret__): "p" (& kernel_stack)); goto ldv_6321; case 2UL: __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_6321; case 4UL: __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_6321; case 8UL: __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_6321; default: __bad_percpu_size(); } ldv_6321: ti = (struct thread_info *)(pfo_ret__ - 8152UL); return (ti); } } extern int default_wake_function(wait_queue_t * , unsigned int , int , void * ) ; extern void add_wait_queue(wait_queue_head_t * , wait_queue_t * ) ; extern void remove_wait_queue(wait_queue_head_t * , wait_queue_t * ) ; extern int debug_lockdep_rcu_enabled(void) ; extern struct timespec current_kernel_time(void) ; __inline static struct pid *get_pid(struct pid *pid ) { { if ((unsigned long )pid != (unsigned long )((struct pid *)0)) { atomic_inc(& pid->count); } else { } return (pid); } } extern void put_pid(struct pid * ) ; __inline static unsigned int imajor(struct inode const *inode ) { { return ((unsigned int )(inode->i_rdev >> 20)); } } extern int register_chrdev_region(dev_t , unsigned int , char const * ) ; extern void unregister_chrdev_region(dev_t , unsigned int ) ; extern unsigned long __get_free_pages(gfp_t , unsigned int ) ; extern void free_pages(unsigned long , unsigned int ) ; extern int __get_user_bad(void) ; extern unsigned long _copy_to_user(void * , void const * , unsigned int ) ; extern unsigned long _copy_from_user(void * , void const * , unsigned int ) ; extern unsigned long copy_in_user(void * , void const * , unsigned int ) ; __inline static unsigned long copy_from_user(void *to , void const *from , unsigned long n ) { int sz ; unsigned long tmp ; int __ret_warn_on ; long tmp___0 ; long tmp___1 ; long tmp___2 ; { tmp = __builtin_object_size((void const *)to, 0); sz = (int )tmp; might_fault(); tmp___1 = ldv__builtin_expect(sz == -1, 1L); if (tmp___1 != 0L) { n = _copy_from_user(to, from, (unsigned int )n); } else { tmp___2 = ldv__builtin_expect((unsigned long )sz >= n, 1L); if (tmp___2 != 0L) { n = _copy_from_user(to, from, (unsigned int )n); } else { __ret_warn_on = 1; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_fmt("/work/vladimir/UFO/Work/test/inst/current/envs/linux-3.7.3/linux-3.7.3/arch/x86/include/asm/uaccess_64.h", 66, "Buffer overflow detected!\n"); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); } } return (n); } } __inline static int copy_to_user(void *dst , void const *src , unsigned int size ) { unsigned long tmp ; { might_fault(); tmp = _copy_to_user(dst, src, size); return ((int )tmp); } } __inline static void poll_wait(struct file *filp , wait_queue_head_t *wait_address , poll_table *p ) { { if (((unsigned long )p != (unsigned long )((poll_table *)0) && (unsigned long )p->_qproc != (unsigned long )((void (*)(struct file * , wait_queue_head_t * , struct poll_table_struct * ))0)) && (unsigned long )wait_address != (unsigned long )((wait_queue_head_t *)0)) { (*(p->_qproc))(filp, wait_address, p); } else { } return; } } __inline static void device_lock___4(struct device *dev ) { { ldv_mutex_lock_333(& dev->mutex); return; } } __inline static void device_unlock___4(struct device *dev ) { { ldv_mutex_unlock_335(& dev->mutex); return; } } extern void __put_cred(struct cred * ) ; extern void __invalid_creds(struct cred const * , char const * , unsigned int ) ; extern bool creds_are_invalid(struct cred const * ) ; __inline static void __validate_creds(struct cred const *cred , char const *file , unsigned int line ) { bool tmp ; long tmp___0 ; { tmp = creds_are_invalid(cred); tmp___0 = ldv__builtin_expect((long )tmp, 0L); if (tmp___0 != 0L) { __invalid_creds(cred, file, line); } else { } return; } } __inline static struct cred *get_new_cred(struct cred *cred ) { { atomic_inc(& cred->usage); return (cred); } } __inline static struct cred const *get_cred(struct cred const *cred ) { struct cred *nonconst_cred ; struct cred *tmp ; { nonconst_cred = (struct cred *)cred; __validate_creds(cred, "include/linux/cred.h", 242U); tmp = get_new_cred(nonconst_cred); return ((struct cred const *)tmp); } } __inline static void put_cred(struct cred const *_cred ) { struct cred *cred ; int tmp ; { cred = (struct cred *)_cred; __validate_creds((struct cred const *)cred, "include/linux/cred.h", 261U); tmp = atomic_dec_and_test(& cred->usage); if (tmp != 0) { __put_cred(cred); } else { } return; } } __inline static struct pid *task_pid(struct task_struct *task ) { { return (task->pids[0].pid); } } __inline static pid_t task_pid_nr(struct task_struct *tsk ) { { return (tsk->pid); } } extern int kill_pid_info_as_cred(int , struct siginfo * , struct pid * , struct cred const * , u32 ) ; __inline static int usb_interface_claimed(struct usb_interface *iface ) { { return ((unsigned long )iface->dev.driver != (unsigned long )((struct device_driver *)0)); } } void usb_register_notify(struct notifier_block *nb ) ; void usb_unregister_notify(struct notifier_block *nb ) ; __inline static void *compat_ptr(compat_uptr_t uptr ) { { return ((void *)((unsigned long )uptr)); } } __inline static compat_uptr_t ptr_to_compat(void *uptr ) { { return ((compat_uptr_t )((long )uptr)); } } extern void *compat_alloc_user_space(unsigned long ) ; extern void cdev_init(struct cdev * , struct file_operations const * ) ; extern int cdev_add(struct cdev * , dev_t , unsigned int ) ; extern void cdev_del(struct cdev * ) ; extern void security_task_getsecid(struct task_struct * , u32 * ) ; __inline static void sg_assign_page(struct scatterlist *sg , struct page *page ) { unsigned long page_link ; long tmp ; long tmp___0 ; long tmp___1 ; { page_link = sg->page_link & 3UL; tmp = ldv__builtin_expect(((unsigned long )page & 3UL) != 0UL, 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" (65), "i" (12UL)); ldv_30549: ; goto ldv_30549; } else { } tmp___0 = ldv__builtin_expect(sg->sg_magic != 2271560481UL, 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" (67), "i" (12UL)); ldv_30550: ; goto ldv_30550; } else { } tmp___1 = ldv__builtin_expect((long )((int )sg->page_link) & 1L, 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/linux/scatterlist.h"), "i" (68), "i" (12UL)); ldv_30551: ; goto ldv_30551; } else { } sg->page_link = page_link | (unsigned long )page; return; } } __inline static void sg_set_page(struct scatterlist *sg , struct page *page , unsigned int len , unsigned int offset ) { { sg_assign_page(sg, page); sg->offset = offset; sg->length = len; return; } } __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" (98), "i" (12UL)); ldv_30561: ; goto ldv_30561; } 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" (99), "i" (12UL)); ldv_30562: ; goto ldv_30562; } else { } return ((struct page *)(sg->page_link & 0xfffffffffffffffcUL)); } } __inline static void sg_set_buf(struct scatterlist *sg , void const *buf , unsigned int buflen ) { unsigned long tmp ; { tmp = __phys_addr((unsigned long )buf); sg_set_page(sg, 0xffffea0000000000UL + (tmp >> 12), buflen, (unsigned int )((long )buf) & 4095U); return; } } __inline static void *sg_virt___1(struct scatterlist *sg ) { struct page *tmp ; void *tmp___0 ; { tmp = sg_page___1(sg); tmp___0 = lowmem_page_address((struct page const *)tmp); return (tmp___0 + (unsigned long )sg->offset); } } extern void sg_init_table(struct scatterlist * , unsigned int ) ; struct mutex usbfs_mutex ; struct file_operations const usbdev_file_operations ; struct mutex usbfs_mutex = {{1}, {{{{{0U}}, 3735899821U, 4294967295U, 0xffffffffffffffffUL, {0, {0, 0}, "usbfs_mutex.wait_lock", 0, 0UL}}}}, {& usbfs_mutex.wait_list, & usbfs_mutex.wait_list}, 0, 0, (void *)(& usbfs_mutex), {0, {0, 0}, "usbfs_mutex", 0, 0UL}}; static bool usbfs_snoop ; static unsigned int usbfs_memory_mb = 16U; static atomic_t usbfs_memory_usage ; static int usbfs_increase_memory_usage(unsigned int amount ) { unsigned int lim ; int tmp ; { lim = *((unsigned int volatile *)(& usbfs_memory_mb)); if (lim == 0U || lim > 2047U) { lim = 2146483647U; } else { lim = lim << 20; } atomic_add((int )amount, & usbfs_memory_usage); tmp = atomic_read((atomic_t const *)(& usbfs_memory_usage)); if ((unsigned int )tmp <= lim) { return (0); } else { } atomic_sub((int )amount, & usbfs_memory_usage); return (-12); } } static void usbfs_decrease_memory_usage(unsigned int amount ) { { atomic_sub((int )amount, & usbfs_memory_usage); return; } } static int connected(struct dev_state *ps ) { int tmp ; { tmp = list_empty((struct list_head const *)(& ps->list)); return (tmp == 0 && (unsigned int )(ps->dev)->state != 0U); } } static loff_t usbdev_lseek(struct file *file , loff_t offset , int orig ) { loff_t ret ; { ldv_mutex_lock_338(& ((file->f_path.dentry)->d_inode)->i_mutex); switch (orig) { case 0: file->f_pos = offset; ret = file->f_pos; goto ldv_33966; case 1: file->f_pos = file->f_pos + offset; ret = file->f_pos; goto ldv_33966; case 2: ; default: ret = -22LL; } ldv_33966: ldv_mutex_unlock_339(& ((file->f_path.dentry)->d_inode)->i_mutex); return (ret); } } static ssize_t usbdev_read(struct file *file , char *buf , size_t nbytes , loff_t *ppos ) { struct dev_state *ps ; struct usb_device *dev ; ssize_t ret ; unsigned int len ; loff_t pos ; int i ; int tmp ; struct usb_device_descriptor temp_desc ; size_t __len ; void *__ret ; int tmp___0 ; struct usb_config_descriptor *config ; unsigned int length ; unsigned int alloclen ; unsigned int _min1 ; unsigned int _min2 ; int tmp___1 ; { ps = (struct dev_state *)file->private_data; dev = ps->dev; ret = 0L; pos = *ppos; device_lock___4(& dev->dev); tmp = connected(ps); if (tmp == 0) { ret = -19L; goto err; } else if (pos < 0LL) { ret = -22L; goto err; } else { } if ((unsigned long long )pos <= 17ULL) { __len = 18UL; if (__len > 63UL) { __ret = __memcpy((void *)(& temp_desc), (void const *)(& dev->descriptor), __len); } else { __ret = __builtin_memcpy((void *)(& temp_desc), (void const *)(& dev->descriptor), __len); } len = 18U - (unsigned int )pos; if ((size_t )len > nbytes) { len = (unsigned int )nbytes; } else { } tmp___0 = copy_to_user((void *)buf, (void const *)(& temp_desc) + (unsigned long )pos, len); if (tmp___0 != 0) { ret = -14L; goto err; } else { } *ppos = *ppos + (loff_t )len; buf = buf + (unsigned long )len; nbytes = nbytes - (size_t )len; ret = (ssize_t )len + ret; } else { } pos = 18LL; i = 0; goto ldv_33994; ldv_33993: config = (struct usb_config_descriptor *)*(dev->rawdescriptors + (unsigned long )i); length = (unsigned int )config->wTotalLength; if (*ppos < (loff_t )length + pos) { alloclen = (unsigned int )(dev->config + (unsigned long )i)->desc.wTotalLength; len = ((unsigned int )pos - (unsigned int )*ppos) + length; if ((size_t )len > nbytes) { len = (unsigned int )nbytes; } else { } if ((loff_t )alloclen > *ppos - pos) { alloclen = ((unsigned int )pos - (unsigned int )*ppos) + alloclen; _min1 = len; _min2 = alloclen; tmp___1 = copy_to_user((void *)buf, (void const *)*(dev->rawdescriptors + (unsigned long )i) + (unsigned long )(*ppos - pos), _min1 < _min2 ? _min1 : _min2); if (tmp___1 != 0) { ret = -14L; goto err; } else { } } else { } *ppos = *ppos + (loff_t )len; buf = buf + (unsigned long )len; nbytes = nbytes - (size_t )len; ret = (ssize_t )len + ret; } else { } pos = (loff_t )length + pos; i = i + 1; ldv_33994: ; if (nbytes != 0UL && (int )dev->descriptor.bNumConfigurations > i) { goto ldv_33993; } else { } err: device_unlock___4(& dev->dev); return (ret); } } static struct async *alloc_async(unsigned int numisoframes ) { struct async *as ; void *tmp ; { tmp = kzalloc(88UL, 208U); as = (struct async *)tmp; if ((unsigned long )as == (unsigned long )((struct async *)0)) { return (0); } else { } as->urb = usb_alloc_urb((int )numisoframes, 208U); if ((unsigned long )as->urb == (unsigned long )((struct urb *)0)) { kfree((void const *)as); return (0); } else { } return (as); } } static void free_async(struct async *as ) { int i ; void *tmp ; struct page *tmp___0 ; { put_pid(as->pid); if ((unsigned long )as->cred != (unsigned long )((struct cred const *)0)) { put_cred(as->cred); } else { } i = 0; goto ldv_34005; ldv_34004: tmp___0 = sg_page___1((as->urb)->sg + (unsigned long )i); if ((unsigned long )tmp___0 != (unsigned long )((struct page *)0)) { tmp = sg_virt___1((as->urb)->sg + (unsigned long )i); kfree((void const *)tmp); } else { } i = i + 1; ldv_34005: ; if ((as->urb)->num_sgs > i) { goto ldv_34004; } else { } kfree((void const *)(as->urb)->sg); kfree((void const *)(as->urb)->transfer_buffer); kfree((void const *)(as->urb)->setup_packet); usb_free_urb(as->urb); usbfs_decrease_memory_usage(as->mem_usage); kfree((void const *)as); return; } } static void async_newpending(struct async *as ) { struct dev_state *ps ; unsigned long flags ; raw_spinlock_t *tmp ; { ps = as->ps; tmp = spinlock_check(& ps->lock); flags = _raw_spin_lock_irqsave(tmp); list_add_tail(& as->asynclist, & ps->async_pending); spin_unlock_irqrestore(& ps->lock, flags); return; } } static void async_removepending(struct async *as ) { struct dev_state *ps ; unsigned long flags ; raw_spinlock_t *tmp ; { ps = as->ps; tmp = spinlock_check(& ps->lock); flags = _raw_spin_lock_irqsave(tmp); list_del_init(& as->asynclist); spin_unlock_irqrestore(& ps->lock, flags); return; } } static struct async *async_getcompleted(struct dev_state *ps ) { unsigned long flags ; struct async *as ; raw_spinlock_t *tmp ; struct list_head const *__mptr ; int tmp___0 ; { as = 0; tmp = spinlock_check(& ps->lock); flags = _raw_spin_lock_irqsave(tmp); tmp___0 = list_empty((struct list_head const *)(& ps->async_completed)); if (tmp___0 == 0) { __mptr = (struct list_head const *)ps->async_completed.next; as = (struct async *)__mptr; list_del_init(& as->asynclist); } else { } spin_unlock_irqrestore(& ps->lock, flags); return (as); } } static struct async *async_getpending(struct dev_state *ps , void *userurb ) { struct async *as ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; { __mptr = (struct list_head const *)ps->async_pending.next; as = (struct async *)__mptr; goto ldv_34043; ldv_34042: ; if ((unsigned long )as->userurb == (unsigned long )userurb) { list_del_init(& as->asynclist); return (as); } else { } __mptr___0 = (struct list_head const *)as->asynclist.next; as = (struct async *)__mptr___0; ldv_34043: ; if ((unsigned long )(& as->asynclist) != (unsigned long )(& ps->async_pending)) { goto ldv_34042; } else { } return (0); } } static void snoop_urb(struct usb_device *udev , void *userurb , int pipe , unsigned int length , int timeout_or_status , enum snoop_when when , unsigned char *data , unsigned int data_len ) { char const *types[4U] ; char const *dirs[2U] ; int ep ; char const *t ; char const *d ; { types[0] = "isoc"; types[1] = "int"; types[2] = "ctrl"; types[3] = "bulk"; dirs[0] = "out"; dirs[1] = "in"; if (! usbfs_snoop) { return; } else { } ep = (pipe >> 15) & 15; t = types[(int )((unsigned int )pipe >> 30)]; d = dirs[(pipe & 128) != 0]; if ((unsigned long )userurb != (unsigned long )((void *)0)) { if ((unsigned int )when == 0U) { _dev_info((struct device const *)(& udev->dev), "userurb %p, ep%d %s-%s, length %u\n", userurb, ep, t, d, length); } else { _dev_info((struct device const *)(& udev->dev), "userurb %p, ep%d %s-%s, actual_length %u status %d\n", userurb, ep, t, d, length, timeout_or_status); } } else if ((unsigned int )when == 0U) { _dev_info((struct device const *)(& udev->dev), "ep%d %s-%s, length %u, timeout %d\n", ep, t, d, length, timeout_or_status); } else { _dev_info((struct device const *)(& udev->dev), "ep%d %s-%s, actual_length %u, status %d\n", ep, t, d, length, timeout_or_status); } if ((unsigned long )data != (unsigned long )((unsigned char *)0) && data_len != 0U) { print_hex_dump("\017", "data: ", 0, 32, 1, (void const *)data, (size_t )data_len, 1); } else { } return; } } static void snoop_urb_data(struct urb *urb , unsigned int len ) { int i ; int size ; void *tmp ; { if (! usbfs_snoop) { return; } else { } if (urb->num_sgs == 0) { print_hex_dump("\017", "data: ", 0, 32, 1, (void const *)urb->transfer_buffer, (size_t )len, 1); return; } else { } i = 0; goto ldv_34067; ldv_34066: size = (int )(16384U < len ? 16384U : len); tmp = sg_virt___1(urb->sg + (unsigned long )i); print_hex_dump("\017", "data: ", 0, 32, 1, (void const *)tmp, (size_t )size, 1); len = len - (unsigned int )size; i = i + 1; ldv_34067: ; if (urb->num_sgs > i && len != 0U) { goto ldv_34066; } else { } return; } } static int copy_urb_data_to_user(u8 *userbuffer , struct urb *urb ) { unsigned int i ; unsigned int len ; unsigned int size ; int tmp ; void *tmp___0 ; int tmp___1 ; { if (urb->number_of_packets > 0) { len = urb->transfer_buffer_length; } else { len = urb->actual_length; } if (urb->num_sgs == 0) { tmp = copy_to_user((void *)userbuffer, (void const *)urb->transfer_buffer, len); if (tmp != 0) { return (-14); } else { } return (0); } else { } i = 0U; goto ldv_34077; ldv_34076: size = 16384U < len ? 16384U : len; tmp___0 = sg_virt___1(urb->sg + (unsigned long )i); tmp___1 = copy_to_user((void *)userbuffer, (void const *)tmp___0, size); if (tmp___1 != 0) { return (-14); } else { } userbuffer = userbuffer + (unsigned long )size; len = len - size; i = i + 1U; ldv_34077: ; if ((unsigned int )urb->num_sgs > i && len != 0U) { goto ldv_34076; } else { } return (0); } } static void cancel_bulk_urbs(struct dev_state *ps , unsigned int bulk_addr ) { struct urb *urb ; struct async *as ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; struct list_head const *__mptr___2 ; { __mptr = (struct list_head const *)ps->async_pending.next; as = (struct async *)__mptr; goto ldv_34091; ldv_34090: ; if ((unsigned int )as->bulk_addr == bulk_addr) { if ((unsigned int )as->bulk_status != 1U) { goto rescan; } else { } as->bulk_status = 2U; as->bulk_addr = 0U; } else { } __mptr___0 = (struct list_head const *)as->asynclist.next; as = (struct async *)__mptr___0; ldv_34091: ; if ((unsigned long )(& as->asynclist) != (unsigned long )(& ps->async_pending)) { goto ldv_34090; } else { } ps->disabled_bulk_eps = ps->disabled_bulk_eps | (u32 )(1 << (int )bulk_addr); rescan: __mptr___1 = (struct list_head const *)ps->async_pending.next; as = (struct async *)__mptr___1; goto ldv_34098; ldv_34097: ; if ((unsigned int )as->bulk_status == 2U) { as->bulk_status = 0U; urb = as->urb; usb_get_urb(urb); spin_unlock(& ps->lock); usb_unlink_urb(urb); usb_free_urb(urb); spin_lock(& ps->lock); goto rescan; } else { } __mptr___2 = (struct list_head const *)as->asynclist.next; as = (struct async *)__mptr___2; ldv_34098: ; if ((unsigned long )(& as->asynclist) != (unsigned long )(& ps->async_pending)) { goto ldv_34097; } else { } return; } } static void async_completed(struct urb *urb ) { struct async *as ; struct dev_state *ps ; struct siginfo sinfo ; struct pid *pid ; u32 secid ; struct cred const *cred ; int signr ; { as = (struct async *)urb->context; ps = as->ps; pid = 0; secid = 0U; cred = 0; spin_lock(& ps->lock); list_move_tail(& as->asynclist, & ps->async_completed); as->status = urb->status; signr = (int )as->signr; if (signr != 0) { sinfo.si_signo = (int )as->signr; sinfo.si_errno = as->status; sinfo.si_code = -4; sinfo._sifields._sigfault._addr = as->userurb; pid = get_pid(as->pid); cred = get_cred(as->cred); secid = as->secid; } else { } if ((int )usbfs_snoop) { _dev_info((struct device const *)(& (urb->dev)->dev), "urb complete\n"); } else { } snoop_urb(urb->dev, as->userurb, (int )urb->pipe, urb->actual_length, as->status, COMPLETE, 0, 0U); if (((as->status < 0 && (unsigned int )as->bulk_addr != 0U) && as->status != -104) && as->status != -2) { cancel_bulk_urbs(ps, (unsigned int )as->bulk_addr); } else { } spin_unlock(& ps->lock); if (signr != 0) { kill_pid_info_as_cred(sinfo.si_signo, & sinfo, pid, cred, secid); put_pid(pid); put_cred(cred); } else { } __wake_up(& ps->wait, 3U, 1, 0); return; } } static void destroy_async(struct dev_state *ps , struct list_head *list ) { struct urb *urb ; struct async *as ; unsigned long flags ; raw_spinlock_t *tmp ; struct list_head const *__mptr ; raw_spinlock_t *tmp___0 ; int tmp___1 ; { tmp = spinlock_check(& ps->lock); flags = _raw_spin_lock_irqsave(tmp); goto ldv_34126; ldv_34125: __mptr = (struct list_head const *)list->next; as = (struct async *)__mptr; list_del_init(& as->asynclist); urb = as->urb; usb_get_urb(urb); spin_unlock_irqrestore(& ps->lock, flags); usb_kill_urb(urb); usb_free_urb(urb); tmp___0 = spinlock_check(& ps->lock); flags = _raw_spin_lock_irqsave(tmp___0); ldv_34126: tmp___1 = list_empty((struct list_head const *)list); if (tmp___1 == 0) { goto ldv_34125; } else { } spin_unlock_irqrestore(& ps->lock, flags); return; } } static void destroy_async_on_interface(struct dev_state *ps , unsigned int ifnum ) { struct list_head *p ; struct list_head *q ; struct list_head hitlist ; unsigned long flags ; raw_spinlock_t *tmp ; struct list_head const *__mptr ; { INIT_LIST_HEAD(& hitlist); tmp = spinlock_check(& ps->lock); flags = _raw_spin_lock_irqsave(tmp); p = ps->async_pending.next; q = p->next; goto ldv_34142; ldv_34141: __mptr = (struct list_head const *)p; if (((struct async *)__mptr)->ifnum == ifnum) { list_move_tail(p, & hitlist); } else { } p = q; q = p->next; ldv_34142: ; if ((unsigned long )(& ps->async_pending) != (unsigned long )p) { goto ldv_34141; } else { } spin_unlock_irqrestore(& ps->lock, flags); destroy_async(ps, & hitlist); return; } } static void destroy_all_async(struct dev_state *ps ) { { destroy_async(ps, & ps->async_pending); return; } } static int driver_probe(struct usb_interface *intf , struct usb_device_id const *id ) { { return (-19); } } static void driver_disconnect(struct usb_interface *intf ) { struct dev_state *ps ; void *tmp ; unsigned int ifnum ; long tmp___0 ; { tmp = usb_get_intfdata(intf); ps = (struct dev_state *)tmp; ifnum = (unsigned int )(intf->altsetting)->desc.bInterfaceNumber; if ((unsigned long )ps == (unsigned long )((struct dev_state *)0)) { return; } else { } tmp___0 = ldv__builtin_expect(ifnum <= 63U, 1L); if (tmp___0 != 0L) { clear_bit((int )ifnum, (unsigned long volatile *)(& ps->ifclaimed)); } else { dev_warn((struct device const *)(& intf->dev), "interface number %u out of range\n", ifnum); } usb_set_intfdata(intf, 0); destroy_async_on_interface(ps, ifnum); return; } } static int driver_suspend(struct usb_interface *intf , pm_message_t msg ) { { return (0); } } static int driver_resume(struct usb_interface *intf ) { { return (0); } } struct usb_driver usbfs_driver = {"usbfs", & driver_probe, & driver_disconnect, 0, & driver_suspend, & driver_resume, 0, 0, 0, 0, {{{{{{0U}}, 0U, 0U, 0, {0, {0, 0}, 0, 0, 0UL}}}}, {0, 0}}, {{0, 0, 0, 0, (_Bool)0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 0}, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0}; static int claimintf(struct dev_state *ps , unsigned int ifnum ) { struct usb_device *dev ; struct usb_interface *intf ; int err ; int tmp ; { dev = ps->dev; if (ifnum > 63U) { return (-22); } else { } tmp = variable_test_bit((int )ifnum, (unsigned long const volatile *)(& ps->ifclaimed)); if (tmp != 0) { return (0); } else { } intf = usb_ifnum_to_if((struct usb_device const *)dev, ifnum); if ((unsigned long )intf == (unsigned long )((struct usb_interface *)0)) { err = -2; } else { err = usb_driver_claim_interface(& usbfs_driver, intf, (void *)ps); } if (err == 0) { set_bit(ifnum, (unsigned long volatile *)(& ps->ifclaimed)); } else { } return (err); } } static int releaseintf(struct dev_state *ps , unsigned int ifnum ) { struct usb_device *dev ; struct usb_interface *intf ; int err ; int tmp ; { err = -22; if (ifnum > 63U) { return (err); } else { } dev = ps->dev; intf = usb_ifnum_to_if((struct usb_device const *)dev, ifnum); if ((unsigned long )intf == (unsigned long )((struct usb_interface *)0)) { err = -2; } else { tmp = test_and_clear_bit((int )ifnum, (unsigned long volatile *)(& ps->ifclaimed)); if (tmp != 0) { usb_driver_release_interface(& usbfs_driver, intf); err = 0; } else { } } return (err); } } static int checkintf(struct dev_state *ps , unsigned int ifnum ) { int tmp ; struct task_struct *tmp___0 ; struct task_struct *tmp___1 ; pid_t tmp___2 ; int tmp___3 ; { if ((unsigned int )(ps->dev)->state != 7U) { return (-113); } else { } if (ifnum > 63U) { return (-22); } else { } tmp = variable_test_bit((int )ifnum, (unsigned long const volatile *)(& ps->ifclaimed)); if (tmp != 0) { return (0); } else { } tmp___0 = get_current(); tmp___1 = get_current(); tmp___2 = task_pid_nr(tmp___1); dev_warn((struct device const *)(& (ps->dev)->dev), "usbfs: process %d (%s) did not claim interface %u before use\n", tmp___2, (char *)(& tmp___0->comm), ifnum); tmp___3 = claimintf(ps, ifnum); return (tmp___3); } } static int findintfep(struct usb_device *dev , unsigned int ep ) { unsigned int i ; unsigned int j ; unsigned int e ; struct usb_interface *intf ; struct usb_host_interface *alts ; struct usb_endpoint_descriptor *endpt ; { if ((ep & 4294967152U) != 0U) { return (-22); } else { } if ((unsigned long )dev->actconfig == (unsigned long )((struct usb_host_config *)0)) { return (-3); } else { } i = 0U; goto ldv_34199; ldv_34198: intf = (dev->actconfig)->interface[i]; j = 0U; goto ldv_34196; ldv_34195: alts = intf->altsetting + (unsigned long )j; e = 0U; goto ldv_34193; ldv_34192: endpt = & (alts->endpoint + (unsigned long )e)->desc; if ((unsigned int )endpt->bEndpointAddress == ep) { return ((int )alts->desc.bInterfaceNumber); } else { } e = e + 1U; ldv_34193: ; if ((unsigned int )alts->desc.bNumEndpoints > e) { goto ldv_34192; } else { } j = j + 1U; ldv_34196: ; if (intf->num_altsetting > j) { goto ldv_34195; } else { } i = i + 1U; ldv_34199: ; if ((unsigned int )(dev->actconfig)->desc.bNumInterfaces > i) { goto ldv_34198; } else { } return (-2); } } static int check_ctrlrecip(struct dev_state *ps , unsigned int requesttype , unsigned int request , unsigned int index ) { int ret ; struct usb_host_interface *alt_setting ; { ret = 0; if (((unsigned int )(ps->dev)->state != 4U && (unsigned int )(ps->dev)->state != 6U) && (unsigned int )(ps->dev)->state != 7U) { return (-113); } else { } if ((requesttype & 96U) == 64U) { return (0); } else { } if (requesttype == 161U && request == 0U) { alt_setting = usb_find_alt_setting((ps->dev)->actconfig, index >> 8, index & 255U); if ((unsigned long )alt_setting != (unsigned long )((struct usb_host_interface *)0) && (unsigned int )alt_setting->desc.bInterfaceClass == 7U) { index = index >> 8; } else { } } else { } index = index & 255U; switch (requesttype & 31U) { case 2U: ret = findintfep(ps->dev, index); if (ret >= 0) { ret = checkintf(ps, (unsigned int )ret); } else { } goto ldv_34210; case 1U: ret = checkintf(ps, index); goto ldv_34210; } ldv_34210: ; return (ret); } } static int match_devt(struct device *dev , void *data ) { { return (dev->devt == (dev_t )((long )data)); } } static struct usb_device *usbdev_lookup_by_devt(dev_t devt ) { struct device *dev ; struct device const *__mptr ; { dev = bus_find_device(& usb_bus_type, 0, (void *)((unsigned long )devt), & match_devt); if ((unsigned long )dev == (unsigned long )((struct device *)0)) { return (0); } else { } __mptr = (struct device const *)dev; return ((struct usb_device *)__mptr + 0xffffffffffffff78UL); } } static int usbdev_open(struct inode *inode , struct file *file ) { struct usb_device *dev ; struct dev_state *ps ; int ret ; void *tmp ; unsigned int tmp___0 ; struct lock_class_key __key ; struct lock_class_key __key___0 ; struct task_struct *tmp___1 ; struct pid *tmp___2 ; int tmp___3 ; struct task_struct *tmp___4 ; struct task_struct *tmp___5 ; struct task_struct *tmp___6 ; struct task_struct *tmp___7 ; pid_t tmp___8 ; { dev = 0; ret = -12; tmp = kmalloc(272UL, 208U); ps = (struct dev_state *)tmp; if ((unsigned long )ps == (unsigned long )((struct dev_state *)0)) { goto out_free_ps; } else { } ret = -19; ldv_mutex_lock_340(& usbfs_mutex); tmp___0 = imajor((struct inode const *)inode); if (tmp___0 == 189U) { dev = usbdev_lookup_by_devt(inode->i_rdev); } else { } ldv_mutex_unlock_341(& usbfs_mutex); if ((unsigned long )dev == (unsigned long )((struct usb_device *)0)) { goto out_free_ps; } else { } device_lock___4(& dev->dev); if ((unsigned int )dev->state == 0U) { goto out_unlock_device; } else { } ret = usb_autoresume_device(dev); if (ret != 0) { goto out_unlock_device; } else { } ps->dev = dev; ps->file = file; spinlock_check(& ps->lock); __raw_spin_lock_init(& ps->lock.ldv_5957.rlock, "&(&ps->lock)->rlock", & __key); INIT_LIST_HEAD(& ps->list); INIT_LIST_HEAD(& ps->async_pending); INIT_LIST_HEAD(& ps->async_completed); __init_waitqueue_head(& ps->wait, "&ps->wait", & __key___0); ps->discsignr = 0U; tmp___1 = get_current(); tmp___2 = task_pid(tmp___1); ps->disc_pid = get_pid(tmp___2); tmp___3 = debug_lockdep_rcu_enabled(); tmp___4 = get_current(); ps->cred = get_cred(tmp___4->cred); ps->disccontext = 0; ps->ifclaimed = 0UL; tmp___5 = get_current(); security_task_getsecid(tmp___5, & ps->secid); __asm__ volatile ("": : : "memory"); list_add_tail(& ps->list, & dev->filelist); file->private_data = (void *)ps; device_unlock___4(& dev->dev); if ((int )usbfs_snoop) { tmp___6 = get_current(); tmp___7 = get_current(); tmp___8 = task_pid_nr(tmp___7); _dev_info((struct device const *)(& dev->dev), "opened by process %d: %s\n", tmp___8, (char *)(& tmp___6->comm)); } else { } return (ret); out_unlock_device: device_unlock___4(& dev->dev); usb_put_dev(dev); out_free_ps: kfree((void const *)ps); return (ret); } } static int usbdev_release(struct inode *inode , struct file *file ) { struct dev_state *ps ; struct usb_device *dev ; unsigned int ifnum ; struct async *as ; int tmp ; { ps = (struct dev_state *)file->private_data; dev = ps->dev; device_lock___4(& dev->dev); usb_hub_release_all_ports(dev, ps); list_del_init(& ps->list); ifnum = 0U; goto ldv_34244; ldv_34243: tmp = variable_test_bit((int )ifnum, (unsigned long const volatile *)(& ps->ifclaimed)); if (tmp != 0) { releaseintf(ps, ifnum); } else { } ifnum = ifnum + 1U; ldv_34244: ; if (ps->ifclaimed != 0UL && ifnum <= 63U) { goto ldv_34243; } else { } destroy_all_async(ps); usb_autosuspend_device(dev); device_unlock___4(& dev->dev); usb_put_dev(dev); put_pid(ps->disc_pid); put_cred(ps->cred); as = async_getcompleted(ps); goto ldv_34247; ldv_34246: free_async(as); as = async_getcompleted(ps); ldv_34247: ; if ((unsigned long )as != (unsigned long )((struct async *)0)) { goto ldv_34246; } else { } kfree((void const *)ps); return (0); } } static int proc_control(struct dev_state *ps , void *arg ) { struct usb_device *dev ; struct usbdevfs_ctrltransfer ctrl ; unsigned int tmo ; unsigned char *tbuf ; unsigned int wLength ; int i ; int pipe ; int ret ; unsigned long tmp ; unsigned long tmp___0 ; __u16 tmp___1 ; __u16 tmp___2 ; __u16 tmp___3 ; unsigned long flag ; unsigned long roksum ; struct thread_info *tmp___4 ; long tmp___5 ; unsigned int tmp___6 ; int _max1 ; int _max2 ; int _min1 ; int _min2 ; int _max1___0 ; int _max2___0 ; int tmp___7 ; unsigned long tmp___8 ; unsigned int tmp___9 ; unsigned int tmp___10 ; int _min1___0 ; int _min2___0 ; int _max1___1 ; int _max2___1 ; struct task_struct *tmp___11 ; { dev = ps->dev; tmp = copy_from_user((void *)(& ctrl), (void const *)arg, 24UL); if (tmp != 0UL) { return (-14); } else { } ret = check_ctrlrecip(ps, (unsigned int )ctrl.bRequestType, (unsigned int )ctrl.bRequest, (unsigned int )ctrl.wIndex); if (ret != 0) { return (ret); } else { } wLength = (unsigned int )ctrl.wLength; if (wLength > 4096U) { return (-22); } else { } ret = usbfs_increase_memory_usage(4296U); if (ret != 0) { return (ret); } else { } tmp___0 = __get_free_pages(208U, 0U); tbuf = (unsigned char *)tmp___0; if ((unsigned long )tbuf == (unsigned long )((unsigned char *)0)) { ret = -12; goto done; } else { } tmo = ctrl.timeout; if ((int )usbfs_snoop) { tmp___1 = __le16_to_cpup((__le16 const *)(& ctrl.wLength)); tmp___2 = __le16_to_cpup((__le16 const *)(& ctrl.wIndex)); tmp___3 = __le16_to_cpup((__le16 const *)(& ctrl.wValue)); _dev_info((struct device const *)(& dev->dev), "control urb: bRequestType=%02x bRequest=%02x wValue=%04x wIndex=%04x wLength=%04x\n", (int )ctrl.bRequestType, (int )ctrl.bRequest, (int )tmp___3, (int )tmp___2, (int )tmp___1); } else { } if ((int )((signed char )ctrl.bRequestType) < 0) { if ((unsigned int )ctrl.wLength != 0U) { tmp___4 = current_thread_info(); __asm__ ("add %3,%1 ; sbb %0,%0 ; cmp %1,%4 ; sbb $0,%0": "=&r" (flag), "=r" (roksum): "1" (ctrl.data), "g" ((long )ctrl.wLength), "rm" (tmp___4->addr_limit.seg)); tmp___5 = ldv__builtin_expect(flag == 0UL, 1L); if (tmp___5 == 0L) { ret = -22; goto done; } else { } } else { } tmp___6 = __create_pipe(dev, 0U); pipe = (int )(tmp___6 | 2147483776U); snoop_urb(dev, 0, pipe, (unsigned int )ctrl.wLength, (int )tmo, SUBMIT, 0, 0U); device_unlock___4(& dev->dev); i = usb_control_msg(dev, (unsigned int )pipe, (int )ctrl.bRequest, (int )ctrl.bRequestType, (int )ctrl.wValue, (int )ctrl.wIndex, (void *)tbuf, (int )ctrl.wLength, (int )tmo); device_lock___4(& dev->dev); _max1 = i; _max2 = 0; _min1 = i; _min2 = 0; _max1___0 = i; _max2___0 = 0; snoop_urb(dev, 0, pipe, (unsigned int )(_max1___0 > _max2___0 ? _max1___0 : _max2___0), _min1 < _min2 ? _min1 : _min2, COMPLETE, tbuf, (unsigned int )(_max1 > _max2 ? _max1 : _max2)); if (i > 0 && (unsigned int )ctrl.wLength != 0U) { tmp___7 = copy_to_user(ctrl.data, (void const *)tbuf, (unsigned int )i); if (tmp___7 != 0) { ret = -14; goto done; } else { } } else { } } else { if ((unsigned int )ctrl.wLength != 0U) { tmp___8 = copy_from_user((void *)tbuf, (void const *)ctrl.data, (unsigned long )ctrl.wLength); if (tmp___8 != 0UL) { ret = -14; goto done; } else { } } else { } tmp___9 = __create_pipe(dev, 0U); pipe = (int )(tmp___9 | 2147483648U); snoop_urb(dev, 0, pipe, (unsigned int )ctrl.wLength, (int )tmo, SUBMIT, tbuf, (unsigned int )ctrl.wLength); device_unlock___4(& dev->dev); tmp___10 = __create_pipe(dev, 0U); i = usb_control_msg(dev, tmp___10 | 2147483648U, (int )ctrl.bRequest, (int )ctrl.bRequestType, (int )ctrl.wValue, (int )ctrl.wIndex, (void *)tbuf, (int )ctrl.wLength, (int )tmo); device_lock___4(& dev->dev); _min1___0 = i; _min2___0 = 0; _max1___1 = i; _max2___1 = 0; snoop_urb(dev, 0, pipe, (unsigned int )(_max1___1 > _max2___1 ? _max1___1 : _max2___1), _min1___0 < _min2___0 ? _min1___0 : _min2___0, COMPLETE, 0, 0U); } if (i < 0 && i != -32) { tmp___11 = get_current(); dev_printk("\017", (struct device const *)(& dev->dev), "usbfs: USBDEVFS_CONTROL failed cmd %s rqt %u rq %u len %u ret %d\n", (char *)(& tmp___11->comm), (int )ctrl.bRequestType, (int )ctrl.bRequest, (int )ctrl.wLength, i); } else { } ret = i; done: free_pages((unsigned long )tbuf, 0U); usbfs_decrease_memory_usage(4296U); return (ret); } } static int proc_bulk(struct dev_state *ps , void *arg ) { struct usb_device *dev ; struct usbdevfs_bulktransfer bulk ; unsigned int tmo ; unsigned int len1 ; unsigned int pipe ; int len2 ; unsigned char *tbuf ; int i ; int ret ; unsigned long tmp ; unsigned int tmp___0 ; unsigned int tmp___1 ; __u16 tmp___2 ; void *tmp___3 ; unsigned long flag ; unsigned long roksum ; struct thread_info *tmp___4 ; long tmp___5 ; int tmp___6 ; unsigned long tmp___7 ; { dev = ps->dev; tmp = copy_from_user((void *)(& bulk), (void const *)arg, 24UL); if (tmp != 0UL) { return (-14); } else { } ret = findintfep(ps->dev, bulk.ep); if (ret < 0) { return (ret); } else { } ret = checkintf(ps, (unsigned int )ret); if (ret != 0) { return (ret); } else { } if ((bulk.ep & 128U) != 0U) { tmp___0 = __create_pipe(dev, bulk.ep & 127U); pipe = tmp___0 | 3221225600U; } else { tmp___1 = __create_pipe(dev, bulk.ep & 127U); pipe = tmp___1 | 3221225472U; } tmp___2 = usb_maxpacket(dev, (int )pipe, (bulk.ep & 128U) == 0U); if ((unsigned int )tmp___2 == 0U) { return (-22); } else { } len1 = bulk.len; if (len1 > 2146483646U) { return (-22); } else { } ret = usbfs_increase_memory_usage(len1 + 192U); if (ret != 0) { return (ret); } else { } tmp___3 = kmalloc((size_t )len1, 208U); tbuf = (unsigned char *)tmp___3; if ((unsigned long )tbuf == (unsigned long )((unsigned char *)0)) { ret = -12; goto done; } else { } tmo = bulk.timeout; if ((bulk.ep & 128U) != 0U) { if (len1 != 0U) { tmp___4 = current_thread_info(); __asm__ ("add %3,%1 ; sbb %0,%0 ; cmp %1,%4 ; sbb $0,%0": "=&r" (flag), "=r" (roksum): "1" (bulk.data), "g" ((long )len1), "rm" (tmp___4->addr_limit.seg)); tmp___5 = ldv__builtin_expect(flag == 0UL, 1L); if (tmp___5 == 0L) { ret = -22; goto done; } else { } } else { } snoop_urb(dev, 0, (int )pipe, len1, (int )tmo, SUBMIT, 0, 0U); device_unlock___4(& dev->dev); i = usb_bulk_msg(dev, pipe, (void *)tbuf, (int )len1, & len2, (int )tmo); device_lock___4(& dev->dev); snoop_urb(dev, 0, (int )pipe, (unsigned int )len2, i, COMPLETE, tbuf, (unsigned int )len2); if (i == 0 && len2 != 0) { tmp___6 = copy_to_user(bulk.data, (void const *)tbuf, (unsigned int )len2); if (tmp___6 != 0) { ret = -14; goto done; } else { } } else { } } else { if (len1 != 0U) { tmp___7 = copy_from_user((void *)tbuf, (void const *)bulk.data, (unsigned long )len1); if (tmp___7 != 0UL) { ret = -14; goto done; } else { } } else { } snoop_urb(dev, 0, (int )pipe, len1, (int )tmo, SUBMIT, tbuf, len1); device_unlock___4(& dev->dev); i = usb_bulk_msg(dev, pipe, (void *)tbuf, (int )len1, & len2, (int )tmo); device_lock___4(& dev->dev); snoop_urb(dev, 0, (int )pipe, (unsigned int )len2, i, COMPLETE, 0, 0U); } ret = i < 0 ? i : len2; done: kfree((void const *)tbuf); usbfs_decrease_memory_usage(len1 + 192U); return (ret); } } static int proc_resetep(struct dev_state *ps , void *arg ) { unsigned int ep ; int ret ; int __ret_gu ; unsigned long __val_gu ; { might_fault(); switch (4UL) { case 1UL: __asm__ volatile ("call __get_user_1": "=a" (__ret_gu), "=d" (__val_gu): "0" ((unsigned int *)arg)); goto ldv_34306; case 2UL: __asm__ volatile ("call __get_user_2": "=a" (__ret_gu), "=d" (__val_gu): "0" ((unsigned int *)arg)); goto ldv_34306; case 4UL: __asm__ volatile ("call __get_user_4": "=a" (__ret_gu), "=d" (__val_gu): "0" ((unsigned int *)arg)); goto ldv_34306; case 8UL: __asm__ volatile ("call __get_user_8": "=a" (__ret_gu), "=d" (__val_gu): "0" ((unsigned int *)arg)); goto ldv_34306; default: __asm__ volatile ("call __get_user_X": "=a" (__ret_gu), "=d" (__val_gu): "0" ((unsigned int *)arg)); goto ldv_34306; } ldv_34306: ep = (unsigned int )__val_gu; if (__ret_gu != 0) { return (-14); } else { } ret = findintfep(ps->dev, ep); if (ret < 0) { return (ret); } else { } ret = checkintf(ps, (unsigned int )ret); if (ret != 0) { return (ret); } else { } usb_reset_endpoint(ps->dev, ep); return (0); } } static int proc_clearhalt(struct dev_state *ps , void *arg ) { unsigned int ep ; int pipe ; int ret ; int __ret_gu ; unsigned long __val_gu ; unsigned int tmp ; unsigned int tmp___0 ; int tmp___1 ; { might_fault(); switch (4UL) { case 1UL: __asm__ volatile ("call __get_user_1": "=a" (__ret_gu), "=d" (__val_gu): "0" ((unsigned int *)arg)); goto ldv_34322; case 2UL: __asm__ volatile ("call __get_user_2": "=a" (__ret_gu), "=d" (__val_gu): "0" ((unsigned int *)arg)); goto ldv_34322; case 4UL: __asm__ volatile ("call __get_user_4": "=a" (__ret_gu), "=d" (__val_gu): "0" ((unsigned int *)arg)); goto ldv_34322; case 8UL: __asm__ volatile ("call __get_user_8": "=a" (__ret_gu), "=d" (__val_gu): "0" ((unsigned int *)arg)); goto ldv_34322; default: __asm__ volatile ("call __get_user_X": "=a" (__ret_gu), "=d" (__val_gu): "0" ((unsigned int *)arg)); goto ldv_34322; } ldv_34322: ep = (unsigned int )__val_gu; if (__ret_gu != 0) { return (-14); } else { } ret = findintfep(ps->dev, ep); if (ret < 0) { return (ret); } else { } ret = checkintf(ps, (unsigned int )ret); if (ret != 0) { return (ret); } else { } if ((ep & 128U) != 0U) { tmp = __create_pipe(ps->dev, ep & 127U); pipe = (int )(tmp | 3221225600U); } else { tmp___0 = __create_pipe(ps->dev, ep & 127U); pipe = (int )(tmp___0 | 3221225472U); } tmp___1 = usb_clear_halt(ps->dev, pipe); return (tmp___1); } } static int proc_getdriver(struct dev_state *ps , void *arg ) { struct usbdevfs_getdriver gd ; struct usb_interface *intf ; int ret ; unsigned long tmp ; int tmp___0 ; { tmp = copy_from_user((void *)(& gd), (void const *)arg, 260UL); if (tmp != 0UL) { return (-14); } else { } intf = usb_ifnum_to_if((struct usb_device const *)ps->dev, gd.interface); if ((unsigned long )intf == (unsigned long )((struct usb_interface *)0) || (unsigned long )intf->dev.driver == (unsigned long )((struct device_driver *)0)) { ret = -61; } else { strncpy((char *)(& gd.driver), (intf->dev.driver)->name, 256UL); tmp___0 = copy_to_user(arg, (void const *)(& gd), 260U); ret = tmp___0 != 0 ? -14 : 0; } return (ret); } } static int proc_connectinfo(struct dev_state *ps , void *arg ) { struct usbdevfs_connectinfo ci ; int tmp ; { ci.devnum = (unsigned int )(ps->dev)->devnum; ci.slow = (unsigned int )(ps->dev)->speed == 1U; tmp = copy_to_user(arg, (void const *)(& ci), 8U); if (tmp != 0) { return (-14); } else { } return (0); } } static int proc_resetdevice(struct dev_state *ps ) { int tmp ; { tmp = usb_reset_device(ps->dev); return (tmp); } } static int proc_setintf(struct dev_state *ps , void *arg ) { struct usbdevfs_setinterface setintf ; int ret ; unsigned long tmp ; int tmp___0 ; { tmp = copy_from_user((void *)(& setintf), (void const *)arg, 8UL); if (tmp != 0UL) { return (-14); } else { } ret = checkintf(ps, setintf.interface); if (ret != 0) { return (ret); } else { } tmp___0 = usb_set_interface(ps->dev, (int )setintf.interface, (int )setintf.altsetting); return (tmp___0); } } static int proc_setconfig(struct dev_state *ps , void *arg ) { int u ; int status ; struct usb_host_config *actconfig ; int __ret_gu ; unsigned long __val_gu ; int i ; struct task_struct *tmp ; int tmp___0 ; { status = 0; might_fault(); switch (4UL) { case 1UL: __asm__ volatile ("call __get_user_1": "=a" (__ret_gu), "=d" (__val_gu): "0" ((int *)arg)); goto ldv_34359; case 2UL: __asm__ volatile ("call __get_user_2": "=a" (__ret_gu), "=d" (__val_gu): "0" ((int *)arg)); goto ldv_34359; case 4UL: __asm__ volatile ("call __get_user_4": "=a" (__ret_gu), "=d" (__val_gu): "0" ((int *)arg)); goto ldv_34359; case 8UL: __asm__ volatile ("call __get_user_8": "=a" (__ret_gu), "=d" (__val_gu): "0" ((int *)arg)); goto ldv_34359; default: __asm__ volatile ("call __get_user_X": "=a" (__ret_gu), "=d" (__val_gu): "0" ((int *)arg)); goto ldv_34359; } ldv_34359: u = (int )__val_gu; if (__ret_gu != 0) { return (-14); } else { } actconfig = (ps->dev)->actconfig; if ((unsigned long )actconfig != (unsigned long )((struct usb_host_config *)0)) { i = 0; goto ldv_34368; ldv_34367: tmp___0 = usb_interface_claimed(actconfig->interface[i]); if (tmp___0 != 0) { tmp = get_current(); dev_warn((struct device const *)(& (ps->dev)->dev), "usbfs: interface %d claimed by %s while \'%s\' sets config #%d\n", (int )((actconfig->interface[i])->cur_altsetting)->desc.bInterfaceNumber, ((actconfig->interface[i])->dev.driver)->name, (char *)(& tmp->comm), u); status = -16; goto ldv_34366; } else { } i = i + 1; ldv_34368: ; if ((int )actconfig->desc.bNumInterfaces > i) { goto ldv_34367; } else { } ldv_34366: ; } else { } if (status == 0) { if ((unsigned long )actconfig != (unsigned long )((struct usb_host_config *)0) && (int )actconfig->desc.bConfigurationValue == u) { status = usb_reset_configuration(ps->dev); } else { status = usb_set_configuration(ps->dev, u); } } else { } return (status); } } static int proc_do_submiturb(struct dev_state *ps , struct usbdevfs_urb *uurb , struct usbdevfs_iso_packet_desc *iso_frame_desc , void *arg ) { struct usbdevfs_iso_packet_desc *isopkt ; struct usb_host_endpoint *ep ; struct async *as ; struct usb_ctrlrequest *dr ; unsigned int u ; unsigned int totlen ; unsigned int isofrmlen ; int i ; int ret ; int is_in ; int num_sgs ; int ifnum ; void *buf ; int tmp ; void *tmp___0 ; unsigned long tmp___1 ; __u16 tmp___2 ; __u16 tmp___3 ; __u16 tmp___4 ; __u16 tmp___5 ; __u16 tmp___6 ; __u16 tmp___7 ; int tmp___8 ; int tmp___9 ; int tmp___10 ; void *tmp___11 ; unsigned long tmp___12 ; unsigned long flag ; unsigned long roksum ; struct thread_info *tmp___13 ; long tmp___14 ; void *tmp___15 ; unsigned long tmp___16 ; unsigned long tmp___17 ; unsigned int tmp___18 ; int _min1 ; int _min2 ; struct task_struct *tmp___19 ; struct pid *tmp___20 ; int tmp___21 ; struct task_struct *tmp___22 ; struct task_struct *tmp___23 ; int tmp___24 ; int tmp___25 ; { isopkt = 0; as = 0; dr = 0; num_sgs = 0; ifnum = -1; if ((uurb->flags & 4294967064U) != 0U) { return (-22); } else { } if (uurb->buffer_length > 0 && (unsigned long )uurb->buffer == (unsigned long )((void *)0)) { return (-22); } else { } if ((unsigned int )uurb->type != 2U || ((int )uurb->endpoint & -129) != 0) { ifnum = findintfep(ps->dev, (unsigned int )uurb->endpoint); if (ifnum < 0) { return (ifnum); } else { } ret = checkintf(ps, (unsigned int )ifnum); if (ret != 0) { return (ret); } else { } } else { } if ((int )((signed char )uurb->endpoint) < 0) { is_in = 1; ep = (ps->dev)->ep_in[(int )uurb->endpoint & 15]; } else { is_in = 0; ep = (ps->dev)->ep_out[(int )uurb->endpoint & 15]; } if ((unsigned long )ep == (unsigned long )((struct usb_host_endpoint *)0)) { return (-2); } else { } u = 0U; switch ((int )uurb->type) { case 2: tmp = usb_endpoint_xfer_control((struct usb_endpoint_descriptor const *)(& ep->desc)); if (tmp == 0) { return (-22); } else { } if (uurb->buffer_length <= 7) { return (-22); } else { } tmp___0 = kmalloc(8UL, 208U); dr = (struct usb_ctrlrequest *)tmp___0; if ((unsigned long )dr == (unsigned long )((struct usb_ctrlrequest *)0)) { return (-12); } else { } tmp___1 = copy_from_user((void *)dr, (void const *)uurb->buffer, 8UL); if (tmp___1 != 0UL) { ret = -14; goto error; } else { } tmp___2 = __le16_to_cpup((__le16 const *)(& dr->wLength)); if (uurb->buffer_length < (int )tmp___2 + 8) { ret = -22; goto error; } else { } tmp___3 = __le16_to_cpup((__le16 const *)(& dr->wIndex)); ret = check_ctrlrecip(ps, (unsigned int )dr->bRequestType, (unsigned int )dr->bRequest, (unsigned int )tmp___3); if (ret != 0) { goto error; } else { } uurb->number_of_packets = 0; tmp___4 = __le16_to_cpup((__le16 const *)(& dr->wLength)); uurb->buffer_length = (int )tmp___4; uurb->buffer = uurb->buffer + 8UL; if ((int )((signed char )dr->bRequestType) < 0 && uurb->buffer_length != 0) { is_in = 1; uurb->endpoint = (unsigned int )uurb->endpoint | 128U; } else { is_in = 0; uurb->endpoint = (unsigned int )uurb->endpoint & 127U; } if ((int )usbfs_snoop) { tmp___5 = __le16_to_cpup((__le16 const *)(& dr->wLength)); tmp___6 = __le16_to_cpup((__le16 const *)(& dr->wIndex)); tmp___7 = __le16_to_cpup((__le16 const *)(& dr->wValue)); _dev_info((struct device const *)(& (ps->dev)->dev), "control urb: bRequestType=%02x bRequest=%02x wValue=%04x wIndex=%04x wLength=%04x\n", (int )dr->bRequestType, (int )dr->bRequest, (int )tmp___7, (int )tmp___6, (int )tmp___5); } else { } u = 8U; goto ldv_34390; case 3: tmp___8 = usb_endpoint_type((struct usb_endpoint_descriptor const *)(& ep->desc)); switch (tmp___8) { case 0: ; case 1: ; return (-22); case 3: uurb->type = 1U; goto interrupt_urb; } uurb->number_of_packets = 0; num_sgs = (uurb->buffer_length + 16383) / 16384; if (num_sgs == 1 || (unsigned int )num_sgs > ((ps->dev)->bus)->sg_tablesize) { num_sgs = 0; } else { } goto ldv_34390; case 1: tmp___9 = usb_endpoint_xfer_int((struct usb_endpoint_descriptor const *)(& ep->desc)); if (tmp___9 == 0) { return (-22); } else { } interrupt_urb: uurb->number_of_packets = 0; goto ldv_34390; case 0: ; if (uurb->number_of_packets <= 0 || uurb->number_of_packets > 128) { return (-22); } else { } tmp___10 = usb_endpoint_xfer_isoc((struct usb_endpoint_descriptor const *)(& ep->desc)); if (tmp___10 == 0) { return (-22); } else { } isofrmlen = (unsigned int )((unsigned long )uurb->number_of_packets) * 12U; tmp___11 = kmalloc((size_t )isofrmlen, 208U); isopkt = (struct usbdevfs_iso_packet_desc *)tmp___11; if ((unsigned long )isopkt == (unsigned long )((struct usbdevfs_iso_packet_desc *)0)) { return (-12); } else { } tmp___12 = copy_from_user((void *)isopkt, (void const *)iso_frame_desc, (unsigned long )isofrmlen); if (tmp___12 != 0UL) { ret = -14; goto error; } else { } u = 0U; totlen = u; goto ldv_34399; ldv_34398: ; if ((isopkt + (unsigned long )u)->length > 8192U) { ret = -22; goto error; } else { } totlen = (isopkt + (unsigned long )u)->length + totlen; u = u + 1U; ldv_34399: ; if ((unsigned int )uurb->number_of_packets > u) { goto ldv_34398; } else { } u = u * 16U; uurb->buffer_length = (int )totlen; goto ldv_34390; default: ; return (-22); } ldv_34390: ; if ((unsigned int )uurb->buffer_length > 2146483646U) { ret = -22; goto error; } else { } if (uurb->buffer_length > 0) { tmp___13 = current_thread_info(); __asm__ ("add %3,%1 ; sbb %0,%0 ; cmp %1,%4 ; sbb $0,%0": "=&r" (flag), "=r" (roksum): "1" (uurb->buffer), "g" ((long )uurb->buffer_length), "rm" (tmp___13->addr_limit.seg)); tmp___14 = ldv__builtin_expect(flag == 0UL, 1L); if (tmp___14 == 0L) { ret = -14; goto error; } else { } } else { } as = alloc_async((unsigned int )uurb->number_of_packets); if ((unsigned long )as == (unsigned long )((struct async *)0)) { ret = -12; goto error; } else { } u = (((unsigned int )uurb->buffer_length + (unsigned int )((unsigned long )num_sgs) * 40U) + u) + 280U; ret = usbfs_increase_memory_usage(u); if (ret != 0) { goto error; } else { } as->mem_usage = u; if (num_sgs != 0) { tmp___15 = kmalloc((unsigned long )num_sgs * 40UL, 208U); (as->urb)->sg = (struct scatterlist *)tmp___15; if ((unsigned long )(as->urb)->sg == (unsigned long )((struct scatterlist *)0)) { ret = -12; goto error; } else { } (as->urb)->num_sgs = num_sgs; sg_init_table((as->urb)->sg, (unsigned int )(as->urb)->num_sgs); totlen = (unsigned int )uurb->buffer_length; i = 0; goto ldv_34406; ldv_34405: u = 16384U < totlen ? 16384U : totlen; buf = kmalloc((size_t )u, 208U); if ((unsigned long )buf == (unsigned long )((void *)0)) { ret = -12; goto error; } else { } sg_set_buf((as->urb)->sg + (unsigned long )i, (void const *)buf, u); if (is_in == 0) { tmp___16 = copy_from_user(buf, (void const *)uurb->buffer, (unsigned long )u); if (tmp___16 != 0UL) { ret = -14; goto error; } else { } uurb->buffer = uurb->buffer + (unsigned long )u; } else { } totlen = totlen - u; i = i + 1; ldv_34406: ; if ((as->urb)->num_sgs > i) { goto ldv_34405; } else { } } else if (uurb->buffer_length > 0) { (as->urb)->transfer_buffer = kmalloc((size_t )uurb->buffer_length, 208U); if ((unsigned long )(as->urb)->transfer_buffer == (unsigned long )((void *)0)) { ret = -12; goto error; } else { } if (is_in == 0) { tmp___17 = copy_from_user((as->urb)->transfer_buffer, (void const *)uurb->buffer, (unsigned long )uurb->buffer_length); if (tmp___17 != 0UL) { ret = -14; goto error; } else if ((unsigned int )uurb->type == 0U) { memset((as->urb)->transfer_buffer, 0, (size_t )uurb->buffer_length); } else { } } else { } } else { } (as->urb)->dev = ps->dev; tmp___18 = __create_pipe(ps->dev, (unsigned int )uurb->endpoint & 15U); (as->urb)->pipe = ((unsigned int )((int )uurb->type << 30) | tmp___18) | ((unsigned int )uurb->endpoint & 128U); u = is_in != 0 ? 512U : 0U; if ((uurb->flags & 2U) != 0U) { u = u | 2U; } else { } if ((int )uurb->flags & 1) { u = u | 1U; } else { } if ((uurb->flags & 32U) != 0U) { u = u | 32U; } else { } if ((uurb->flags & 64U) != 0U) { u = u | 64U; } else { } if ((uurb->flags & 128U) != 0U) { u = u | 128U; } else { } (as->urb)->transfer_flags = u; (as->urb)->transfer_buffer_length = (u32 )uurb->buffer_length; (as->urb)->setup_packet = (unsigned char *)dr; dr = 0; (as->urb)->start_frame = uurb->start_frame; (as->urb)->number_of_packets = uurb->number_of_packets; if ((unsigned int )uurb->type == 0U || (unsigned int )(ps->dev)->speed == 3U) { _min1 = 15; _min2 = (int )ep->desc.bInterval + -1; (as->urb)->interval = 1 << (_min1 < _min2 ? _min1 : _min2); } else { (as->urb)->interval = (int )ep->desc.bInterval; } (as->urb)->context = (void *)as; (as->urb)->complete = & async_completed; u = 0U; totlen = u; goto ldv_34412; ldv_34411: (as->urb)->iso_frame_desc[u].offset = totlen; (as->urb)->iso_frame_desc[u].length = (isopkt + (unsigned long )u)->length; totlen = (isopkt + (unsigned long )u)->length + totlen; u = u + 1U; ldv_34412: ; if ((unsigned int )uurb->number_of_packets > u) { goto ldv_34411; } else { } kfree((void const *)isopkt); isopkt = 0; as->ps = ps; as->userurb = arg; if (is_in != 0 && uurb->buffer_length > 0) { as->userbuffer = uurb->buffer; } else { as->userbuffer = 0; } as->signr = uurb->signr; as->ifnum = (unsigned int )ifnum; tmp___19 = get_current(); tmp___20 = task_pid(tmp___19); as->pid = get_pid(tmp___20); tmp___21 = debug_lockdep_rcu_enabled(); tmp___22 = get_current(); as->cred = get_cred(tmp___22->cred); tmp___23 = get_current(); security_task_getsecid(tmp___23, & as->secid); snoop_urb(ps->dev, as->userurb, (int )(as->urb)->pipe, (as->urb)->transfer_buffer_length, 0, SUBMIT, 0, 0U); if (is_in == 0) { snoop_urb_data(as->urb, (as->urb)->transfer_buffer_length); } else { } async_newpending(as); tmp___25 = usb_endpoint_xfer_bulk((struct usb_endpoint_descriptor const *)(& ep->desc)); if (tmp___25 != 0) { spin_lock_irq(& ps->lock); tmp___24 = usb_endpoint_num((struct usb_endpoint_descriptor const *)(& ep->desc)); as->bulk_addr = (u8 )((int )((signed char )tmp___24) | (int )((signed char )(((int )ep->desc.bEndpointAddress & 128) >> 3))); if ((uurb->flags & 4U) != 0U) { as->bulk_status = 1U; } else { ps->disabled_bulk_eps = ps->disabled_bulk_eps & (u32 )(~ (1 << (int )as->bulk_addr)); } if ((ps->disabled_bulk_eps & (u32 )(1 << (int )as->bulk_addr)) != 0U) { ret = -121; } else { ret = usb_submit_urb(as->urb, 32U); } spin_unlock_irq(& ps->lock); } else { ret = usb_submit_urb(as->urb, 208U); } if (ret != 0) { dev_printk("\017", (struct device const *)(& (ps->dev)->dev), "usbfs: usb_submit_urb returned %d\n", ret); snoop_urb(ps->dev, as->userurb, (int )(as->urb)->pipe, 0U, ret, COMPLETE, 0, 0U); async_removepending(as); goto error; } else { } return (0); error: kfree((void const *)isopkt); kfree((void const *)dr); if ((unsigned long )as != (unsigned long )((struct async *)0)) { free_async(as); } else { } return (ret); } } static int proc_submiturb(struct dev_state *ps , void *arg ) { struct usbdevfs_urb uurb ; unsigned long tmp ; int tmp___0 ; { tmp = copy_from_user((void *)(& uurb), (void const *)arg, 56UL); if (tmp != 0UL) { return (-14); } else { } tmp___0 = proc_do_submiturb(ps, & uurb, (struct usbdevfs_iso_packet_desc *)(& ((struct usbdevfs_urb *)arg)->iso_frame_desc), arg); return (tmp___0); } } static int proc_unlinkurb(struct dev_state *ps , void *arg ) { struct urb *urb ; struct async *as ; unsigned long flags ; raw_spinlock_t *tmp ; { tmp = spinlock_check(& ps->lock); flags = _raw_spin_lock_irqsave(tmp); as = async_getpending(ps, arg); if ((unsigned long )as == (unsigned long )((struct async *)0)) { spin_unlock_irqrestore(& ps->lock, flags); return (-22); } else { } urb = as->urb; usb_get_urb(urb); spin_unlock_irqrestore(& ps->lock, flags); usb_kill_urb(urb); usb_free_urb(urb); return (0); } } static int processcompl(struct async *as , void **arg ) { struct urb *urb ; struct usbdevfs_urb *userurb ; void *addr ; unsigned int i ; int tmp ; int __ret_pu ; int __pu_val ; int __ret_pu___0 ; int __pu_val___0 ; int __ret_pu___1 ; int __pu_val___1 ; int __ret_pu___2 ; unsigned int __pu_val___2 ; int __ret_pu___3 ; unsigned int __pu_val___3 ; int tmp___0 ; int __ret_pu___4 ; void *__pu_val___4 ; { urb = as->urb; userurb = (struct usbdevfs_urb *)as->userurb; addr = as->userurb; if ((unsigned long )as->userbuffer != (unsigned long )((void *)0) && urb->actual_length != 0U) { tmp = copy_urb_data_to_user((u8 *)as->userbuffer, urb); if (tmp != 0) { goto err_out; } else { } } else { } might_fault(); __pu_val = as->status; switch (4UL) { case 1UL: __asm__ volatile ("call __put_user_1": "=a" (__ret_pu): "0" (__pu_val), "c" (& userurb->status): "ebx"); goto ldv_34443; case 2UL: __asm__ volatile ("call __put_user_2": "=a" (__ret_pu): "0" (__pu_val), "c" (& userurb->status): "ebx"); goto ldv_34443; case 4UL: __asm__ volatile ("call __put_user_4": "=a" (__ret_pu): "0" (__pu_val), "c" (& userurb->status): "ebx"); goto ldv_34443; case 8UL: __asm__ volatile ("call __put_user_8": "=a" (__ret_pu): "0" (__pu_val), "c" (& userurb->status): "ebx"); goto ldv_34443; default: __asm__ volatile ("call __put_user_X": "=a" (__ret_pu): "0" (__pu_val), "c" (& userurb->status): "ebx"); goto ldv_34443; } ldv_34443: ; if (__ret_pu != 0) { goto err_out; } else { } might_fault(); __pu_val___0 = (int )urb->actual_length; switch (4UL) { case 1UL: __asm__ volatile ("call __put_user_1": "=a" (__ret_pu___0): "0" (__pu_val___0), "c" (& userurb->actual_length): "ebx"); goto ldv_34452; case 2UL: __asm__ volatile ("call __put_user_2": "=a" (__ret_pu___0): "0" (__pu_val___0), "c" (& userurb->actual_length): "ebx"); goto ldv_34452; case 4UL: __asm__ volatile ("call __put_user_4": "=a" (__ret_pu___0): "0" (__pu_val___0), "c" (& userurb->actual_length): "ebx"); goto ldv_34452; case 8UL: __asm__ volatile ("call __put_user_8": "=a" (__ret_pu___0): "0" (__pu_val___0), "c" (& userurb->actual_length): "ebx"); goto ldv_34452; default: __asm__ volatile ("call __put_user_X": "=a" (__ret_pu___0): "0" (__pu_val___0), "c" (& userurb->actual_length): "ebx"); goto ldv_34452; } ldv_34452: ; if (__ret_pu___0 != 0) { goto err_out; } else { } might_fault(); __pu_val___1 = urb->error_count; switch (4UL) { case 1UL: __asm__ volatile ("call __put_user_1": "=a" (__ret_pu___1): "0" (__pu_val___1), "c" (& userurb->error_count): "ebx"); goto ldv_34461; case 2UL: __asm__ volatile ("call __put_user_2": "=a" (__ret_pu___1): "0" (__pu_val___1), "c" (& userurb->error_count): "ebx"); goto ldv_34461; case 4UL: __asm__ volatile ("call __put_user_4": "=a" (__ret_pu___1): "0" (__pu_val___1), "c" (& userurb->error_count): "ebx"); goto ldv_34461; case 8UL: __asm__ volatile ("call __put_user_8": "=a" (__ret_pu___1): "0" (__pu_val___1), "c" (& userurb->error_count): "ebx"); goto ldv_34461; default: __asm__ volatile ("call __put_user_X": "=a" (__ret_pu___1): "0" (__pu_val___1), "c" (& userurb->error_count): "ebx"); goto ldv_34461; } ldv_34461: ; if (__ret_pu___1 != 0) { goto err_out; } else { } tmp___0 = usb_endpoint_xfer_isoc((struct usb_endpoint_descriptor const *)(& (urb->ep)->desc)); if (tmp___0 != 0) { i = 0U; goto ldv_34486; ldv_34485: might_fault(); __pu_val___2 = urb->iso_frame_desc[i].actual_length; switch (4UL) { case 1UL: __asm__ volatile ("call __put_user_1": "=a" (__ret_pu___2): "0" (__pu_val___2), "c" (& userurb->iso_frame_desc[i].actual_length): "ebx"); goto ldv_34470; case 2UL: __asm__ volatile ("call __put_user_2": "=a" (__ret_pu___2): "0" (__pu_val___2), "c" (& userurb->iso_frame_desc[i].actual_length): "ebx"); goto ldv_34470; case 4UL: __asm__ volatile ("call __put_user_4": "=a" (__ret_pu___2): "0" (__pu_val___2), "c" (& userurb->iso_frame_desc[i].actual_length): "ebx"); goto ldv_34470; case 8UL: __asm__ volatile ("call __put_user_8": "=a" (__ret_pu___2): "0" (__pu_val___2), "c" (& userurb->iso_frame_desc[i].actual_length): "ebx"); goto ldv_34470; default: __asm__ volatile ("call __put_user_X": "=a" (__ret_pu___2): "0" (__pu_val___2), "c" (& userurb->iso_frame_desc[i].actual_length): "ebx"); goto ldv_34470; } ldv_34470: ; if (__ret_pu___2 != 0) { goto err_out; } else { } might_fault(); __pu_val___3 = (unsigned int )urb->iso_frame_desc[i].status; switch (4UL) { case 1UL: __asm__ volatile ("call __put_user_1": "=a" (__ret_pu___3): "0" (__pu_val___3), "c" (& userurb->iso_frame_desc[i].status): "ebx"); goto ldv_34479; case 2UL: __asm__ volatile ("call __put_user_2": "=a" (__ret_pu___3): "0" (__pu_val___3), "c" (& userurb->iso_frame_desc[i].status): "ebx"); goto ldv_34479; case 4UL: __asm__ volatile ("call __put_user_4": "=a" (__ret_pu___3): "0" (__pu_val___3), "c" (& userurb->iso_frame_desc[i].status): "ebx"); goto ldv_34479; case 8UL: __asm__ volatile ("call __put_user_8": "=a" (__ret_pu___3): "0" (__pu_val___3), "c" (& userurb->iso_frame_desc[i].status): "ebx"); goto ldv_34479; default: __asm__ volatile ("call __put_user_X": "=a" (__ret_pu___3): "0" (__pu_val___3), "c" (& userurb->iso_frame_desc[i].status): "ebx"); goto ldv_34479; } ldv_34479: ; if (__ret_pu___3 != 0) { goto err_out; } else { } i = i + 1U; ldv_34486: ; if ((unsigned int )urb->number_of_packets > i) { goto ldv_34485; } else { } } else { } might_fault(); __pu_val___4 = addr; switch (8UL) { case 1UL: __asm__ volatile ("call __put_user_1": "=a" (__ret_pu___4): "0" (__pu_val___4), "c" (arg): "ebx"); goto ldv_34491; case 2UL: __asm__ volatile ("call __put_user_2": "=a" (__ret_pu___4): "0" (__pu_val___4), "c" (arg): "ebx"); goto ldv_34491; case 4UL: __asm__ volatile ("call __put_user_4": "=a" (__ret_pu___4): "0" (__pu_val___4), "c" (arg): "ebx"); goto ldv_34491; case 8UL: __asm__ volatile ("call __put_user_8": "=a" (__ret_pu___4): "0" (__pu_val___4), "c" (arg): "ebx"); goto ldv_34491; default: __asm__ volatile ("call __put_user_X": "=a" (__ret_pu___4): "0" (__pu_val___4), "c" (arg): "ebx"); goto ldv_34491; } ldv_34491: ; if (__ret_pu___4 != 0) { return (-14); } else { } return (0); err_out: ; return (-14); } } static struct async *reap_as(struct dev_state *ps ) { wait_queue_t wait ; struct task_struct *tmp ; struct async *as ; struct usb_device *dev ; struct task_struct *tmp___0 ; struct task_struct *tmp___1 ; int tmp___2 ; long volatile __ret ; struct task_struct *tmp___3 ; struct task_struct *tmp___4 ; struct task_struct *tmp___5 ; struct task_struct *tmp___6 ; { tmp = get_current(); wait.flags = 0U; wait.private = (void *)tmp; wait.func = & default_wake_function; wait.task_list.next = 0; wait.task_list.prev = 0; as = 0; dev = ps->dev; add_wait_queue(& ps->wait, & wait); ldv_34504: tmp___0 = get_current(); tmp___0->state = 1L; as = async_getcompleted(ps); if ((unsigned long )as != (unsigned long )((struct async *)0)) { goto ldv_34503; } else { } tmp___1 = get_current(); tmp___2 = signal_pending(tmp___1); if (tmp___2 != 0) { goto ldv_34503; } else { } device_unlock___4(& dev->dev); schedule(); device_lock___4(& dev->dev); goto ldv_34504; ldv_34503: remove_wait_queue(& ps->wait, & wait); __ret = 0L; switch (8UL) { case 1UL: tmp___3 = get_current(); __asm__ volatile ("xchgb %b0, %1\n": "+q" (__ret), "+m" (tmp___3->state): : "memory", "cc"); goto ldv_34507; case 2UL: tmp___4 = get_current(); __asm__ volatile ("xchgw %w0, %1\n": "+r" (__ret), "+m" (tmp___4->state): : "memory", "cc"); goto ldv_34507; case 4UL: tmp___5 = get_current(); __asm__ volatile ("xchgl %0, %1\n": "+r" (__ret), "+m" (tmp___5->state): : "memory", "cc"); goto ldv_34507; case 8UL: tmp___6 = get_current(); __asm__ volatile ("xchgq %q0, %1\n": "+r" (__ret), "+m" (tmp___6->state): : "memory", "cc"); goto ldv_34507; default: __xchg_wrong_size(); } ldv_34507: ; return (as); } } static int proc_reapurb(struct dev_state *ps , void *arg ) { struct async *as ; struct async *tmp ; int retval ; int tmp___0 ; struct task_struct *tmp___1 ; int tmp___2 ; { tmp = reap_as(ps); as = tmp; if ((unsigned long )as != (unsigned long )((struct async *)0)) { tmp___0 = processcompl(as, (void **)arg); retval = tmp___0; free_async(as); return (retval); } else { } tmp___1 = get_current(); tmp___2 = signal_pending(tmp___1); if (tmp___2 != 0) { return (-4); } else { } return (-5); } } static int proc_reapurbnonblock(struct dev_state *ps , void *arg ) { int retval ; struct async *as ; { as = async_getcompleted(ps); retval = -11; if ((unsigned long )as != (unsigned long )((struct async *)0)) { retval = processcompl(as, (void **)arg); free_async(as); } else { } return (retval); } } static int proc_control_compat(struct dev_state *ps , struct usbdevfs_ctrltransfer32 *p32 ) { struct usbdevfs_ctrltransfer *p ; __u32 udata ; void *tmp ; unsigned long tmp___0 ; int __ret_gu ; unsigned long __val_gu ; int __ret_pu ; void *__pu_val ; int tmp___1 ; { tmp = compat_alloc_user_space(24UL); p = (struct usbdevfs_ctrltransfer *)tmp; tmp___0 = copy_in_user((void *)p, (void const *)p32, 12U); if (tmp___0 != 0UL) { return (-14); } else { might_fault(); switch (4UL) { case 1UL: __asm__ volatile ("call __get_user_1": "=a" (__ret_gu), "=d" (__val_gu): "0" (& p32->data)); goto ldv_34534; case 2UL: __asm__ volatile ("call __get_user_2": "=a" (__ret_gu), "=d" (__val_gu): "0" (& p32->data)); goto ldv_34534; case 4UL: __asm__ volatile ("call __get_user_4": "=a" (__ret_gu), "=d" (__val_gu): "0" (& p32->data)); goto ldv_34534; case 8UL: __asm__ volatile ("call __get_user_8": "=a" (__ret_gu), "=d" (__val_gu): "0" (& p32->data)); goto ldv_34534; default: __asm__ volatile ("call __get_user_X": "=a" (__ret_gu), "=d" (__val_gu): "0" (& p32->data)); goto ldv_34534; } ldv_34534: udata = (unsigned int )__val_gu; if (__ret_gu != 0) { return (-14); } else { might_fault(); __pu_val = compat_ptr(udata); switch (8UL) { case 1UL: __asm__ volatile ("call __put_user_1": "=a" (__ret_pu): "0" (__pu_val), "c" (& p->data): "ebx"); goto ldv_34543; case 2UL: __asm__ volatile ("call __put_user_2": "=a" (__ret_pu): "0" (__pu_val), "c" (& p->data): "ebx"); goto ldv_34543; case 4UL: __asm__ volatile ("call __put_user_4": "=a" (__ret_pu): "0" (__pu_val), "c" (& p->data): "ebx"); goto ldv_34543; case 8UL: __asm__ volatile ("call __put_user_8": "=a" (__ret_pu): "0" (__pu_val), "c" (& p->data): "ebx"); goto ldv_34543; default: __asm__ volatile ("call __put_user_X": "=a" (__ret_pu): "0" (__pu_val), "c" (& p->data): "ebx"); goto ldv_34543; } ldv_34543: ; if (__ret_pu != 0) { return (-14); } else { } } } tmp___1 = proc_control(ps, (void *)p); return (tmp___1); } } static int proc_bulk_compat(struct dev_state *ps , struct usbdevfs_bulktransfer32 *p32 ) { struct usbdevfs_bulktransfer *p ; compat_uint_t n ; compat_caddr_t addr ; void *tmp ; int __ret_gu ; unsigned long __val_gu ; int __ret_pu ; unsigned int __pu_val ; int __ret_gu___0 ; unsigned long __val_gu___0 ; int __ret_pu___0 ; unsigned int __pu_val___0 ; int __ret_gu___1 ; unsigned long __val_gu___1 ; int __ret_pu___1 ; unsigned int __pu_val___1 ; int __ret_gu___2 ; unsigned long __val_gu___2 ; int __ret_pu___2 ; void *__pu_val___2 ; int tmp___0 ; { tmp = compat_alloc_user_space(24UL); p = (struct usbdevfs_bulktransfer *)tmp; might_fault(); switch (4UL) { case 1UL: __asm__ volatile ("call __get_user_1": "=a" (__ret_gu), "=d" (__val_gu): "0" (& p32->ep)); goto ldv_34559; case 2UL: __asm__ volatile ("call __get_user_2": "=a" (__ret_gu), "=d" (__val_gu): "0" (& p32->ep)); goto ldv_34559; case 4UL: __asm__ volatile ("call __get_user_4": "=a" (__ret_gu), "=d" (__val_gu): "0" (& p32->ep)); goto ldv_34559; case 8UL: __asm__ volatile ("call __get_user_8": "=a" (__ret_gu), "=d" (__val_gu): "0" (& p32->ep)); goto ldv_34559; default: __asm__ volatile ("call __get_user_X": "=a" (__ret_gu), "=d" (__val_gu): "0" (& p32->ep)); goto ldv_34559; } ldv_34559: n = (unsigned int )__val_gu; if (__ret_gu != 0) { return (-14); } else { might_fault(); __pu_val = n; switch (4UL) { case 1UL: __asm__ volatile ("call __put_user_1": "=a" (__ret_pu): "0" (__pu_val), "c" (& p->ep): "ebx"); goto ldv_34568; case 2UL: __asm__ volatile ("call __put_user_2": "=a" (__ret_pu): "0" (__pu_val), "c" (& p->ep): "ebx"); goto ldv_34568; case 4UL: __asm__ volatile ("call __put_user_4": "=a" (__ret_pu): "0" (__pu_val), "c" (& p->ep): "ebx"); goto ldv_34568; case 8UL: __asm__ volatile ("call __put_user_8": "=a" (__ret_pu): "0" (__pu_val), "c" (& p->ep): "ebx"); goto ldv_34568; default: __asm__ volatile ("call __put_user_X": "=a" (__ret_pu): "0" (__pu_val), "c" (& p->ep): "ebx"); goto ldv_34568; } ldv_34568: ; if (__ret_pu != 0) { return (-14); } else { might_fault(); switch (4UL) { case 1UL: __asm__ volatile ("call __get_user_1": "=a" (__ret_gu___0), "=d" (__val_gu___0): "0" (& p32->len)); goto ldv_34577; case 2UL: __asm__ volatile ("call __get_user_2": "=a" (__ret_gu___0), "=d" (__val_gu___0): "0" (& p32->len)); goto ldv_34577; case 4UL: __asm__ volatile ("call __get_user_4": "=a" (__ret_gu___0), "=d" (__val_gu___0): "0" (& p32->len)); goto ldv_34577; case 8UL: __asm__ volatile ("call __get_user_8": "=a" (__ret_gu___0), "=d" (__val_gu___0): "0" (& p32->len)); goto ldv_34577; default: __asm__ volatile ("call __get_user_X": "=a" (__ret_gu___0), "=d" (__val_gu___0): "0" (& p32->len)); goto ldv_34577; } ldv_34577: n = (unsigned int )__val_gu___0; if (__ret_gu___0 != 0) { return (-14); } else { might_fault(); __pu_val___0 = n; switch (4UL) { case 1UL: __asm__ volatile ("call __put_user_1": "=a" (__ret_pu___0): "0" (__pu_val___0), "c" (& p->len): "ebx"); goto ldv_34586; case 2UL: __asm__ volatile ("call __put_user_2": "=a" (__ret_pu___0): "0" (__pu_val___0), "c" (& p->len): "ebx"); goto ldv_34586; case 4UL: __asm__ volatile ("call __put_user_4": "=a" (__ret_pu___0): "0" (__pu_val___0), "c" (& p->len): "ebx"); goto ldv_34586; case 8UL: __asm__ volatile ("call __put_user_8": "=a" (__ret_pu___0): "0" (__pu_val___0), "c" (& p->len): "ebx"); goto ldv_34586; default: __asm__ volatile ("call __put_user_X": "=a" (__ret_pu___0): "0" (__pu_val___0), "c" (& p->len): "ebx"); goto ldv_34586; } ldv_34586: ; if (__ret_pu___0 != 0) { return (-14); } else { might_fault(); switch (4UL) { case 1UL: __asm__ volatile ("call __get_user_1": "=a" (__ret_gu___1), "=d" (__val_gu___1): "0" (& p32->timeout)); goto ldv_34595; case 2UL: __asm__ volatile ("call __get_user_2": "=a" (__ret_gu___1), "=d" (__val_gu___1): "0" (& p32->timeout)); goto ldv_34595; case 4UL: __asm__ volatile ("call __get_user_4": "=a" (__ret_gu___1), "=d" (__val_gu___1): "0" (& p32->timeout)); goto ldv_34595; case 8UL: __asm__ volatile ("call __get_user_8": "=a" (__ret_gu___1), "=d" (__val_gu___1): "0" (& p32->timeout)); goto ldv_34595; default: __asm__ volatile ("call __get_user_X": "=a" (__ret_gu___1), "=d" (__val_gu___1): "0" (& p32->timeout)); goto ldv_34595; } ldv_34595: n = (unsigned int )__val_gu___1; if (__ret_gu___1 != 0) { return (-14); } else { might_fault(); __pu_val___1 = n; switch (4UL) { case 1UL: __asm__ volatile ("call __put_user_1": "=a" (__ret_pu___1): "0" (__pu_val___1), "c" (& p->timeout): "ebx"); goto ldv_34604; case 2UL: __asm__ volatile ("call __put_user_2": "=a" (__ret_pu___1): "0" (__pu_val___1), "c" (& p->timeout): "ebx"); goto ldv_34604; case 4UL: __asm__ volatile ("call __put_user_4": "=a" (__ret_pu___1): "0" (__pu_val___1), "c" (& p->timeout): "ebx"); goto ldv_34604; case 8UL: __asm__ volatile ("call __put_user_8": "=a" (__ret_pu___1): "0" (__pu_val___1), "c" (& p->timeout): "ebx"); goto ldv_34604; default: __asm__ volatile ("call __put_user_X": "=a" (__ret_pu___1): "0" (__pu_val___1), "c" (& p->timeout): "ebx"); goto ldv_34604; } ldv_34604: ; if (__ret_pu___1 != 0) { return (-14); } else { might_fault(); switch (4UL) { case 1UL: __asm__ volatile ("call __get_user_1": "=a" (__ret_gu___2), "=d" (__val_gu___2): "0" (& p32->data)); goto ldv_34613; case 2UL: __asm__ volatile ("call __get_user_2": "=a" (__ret_gu___2), "=d" (__val_gu___2): "0" (& p32->data)); goto ldv_34613; case 4UL: __asm__ volatile ("call __get_user_4": "=a" (__ret_gu___2), "=d" (__val_gu___2): "0" (& p32->data)); goto ldv_34613; case 8UL: __asm__ volatile ("call __get_user_8": "=a" (__ret_gu___2), "=d" (__val_gu___2): "0" (& p32->data)); goto ldv_34613; default: __asm__ volatile ("call __get_user_X": "=a" (__ret_gu___2), "=d" (__val_gu___2): "0" (& p32->data)); goto ldv_34613; } ldv_34613: addr = (unsigned int )__val_gu___2; if (__ret_gu___2 != 0) { return (-14); } else { might_fault(); __pu_val___2 = compat_ptr(addr); switch (8UL) { case 1UL: __asm__ volatile ("call __put_user_1": "=a" (__ret_pu___2): "0" (__pu_val___2), "c" (& p->data): "ebx"); goto ldv_34622; case 2UL: __asm__ volatile ("call __put_user_2": "=a" (__ret_pu___2): "0" (__pu_val___2), "c" (& p->data): "ebx"); goto ldv_34622; case 4UL: __asm__ volatile ("call __put_user_4": "=a" (__ret_pu___2): "0" (__pu_val___2), "c" (& p->data): "ebx"); goto ldv_34622; case 8UL: __asm__ volatile ("call __put_user_8": "=a" (__ret_pu___2): "0" (__pu_val___2), "c" (& p->data): "ebx"); goto ldv_34622; default: __asm__ volatile ("call __put_user_X": "=a" (__ret_pu___2): "0" (__pu_val___2), "c" (& p->data): "ebx"); goto ldv_34622; } ldv_34622: ; if (__ret_pu___2 != 0) { return (-14); } else { } } } } } } } } tmp___0 = proc_bulk(ps, (void *)p); return (tmp___0); } } static int proc_disconnectsignal_compat(struct dev_state *ps , void *arg ) { struct usbdevfs_disconnectsignal32 ds ; unsigned long tmp ; { tmp = copy_from_user((void *)(& ds), (void const *)arg, 8UL); if (tmp != 0UL) { return (-14); } else { } ps->discsignr = (unsigned int )ds.signr; ps->disccontext = compat_ptr(ds.context); return (0); } } static int get_urb32(struct usbdevfs_urb *kurb , struct usbdevfs_urb32 *uurb ) { __u32 uptr ; unsigned long flag ; unsigned long roksum ; struct thread_info *tmp ; long tmp___0 ; int __gu_err ; unsigned long __gu_val ; int tmp___1 ; int __gu_err___0 ; unsigned long __gu_val___0 ; int tmp___2 ; int __gu_err___1 ; unsigned long __gu_val___1 ; int tmp___3 ; int __gu_err___2 ; unsigned long __gu_val___2 ; int tmp___4 ; int __gu_err___3 ; unsigned long __gu_val___3 ; int tmp___5 ; int __gu_err___4 ; unsigned long __gu_val___4 ; int tmp___6 ; int __gu_err___5 ; unsigned long __gu_val___5 ; int tmp___7 ; int __gu_err___6 ; unsigned long __gu_val___6 ; int tmp___8 ; int __gu_err___7 ; unsigned long __gu_val___7 ; int tmp___9 ; int __gu_err___8 ; unsigned long __gu_val___8 ; int tmp___10 ; int __gu_err___9 ; unsigned long __gu_val___9 ; int tmp___11 ; int __gu_err___10 ; unsigned long __gu_val___10 ; int tmp___12 ; { tmp = current_thread_info(); __asm__ ("add %3,%1 ; sbb %0,%0 ; cmp %1,%4 ; sbb $0,%0": "=&r" (flag), "=r" (roksum): "1" (uurb), "g" (44L), "rm" (tmp->addr_limit.seg)); tmp___0 = ldv__builtin_expect(flag == 0UL, 1L); if (tmp___0 == 0L) { return (-14); } else { __gu_err = 0; switch (1UL) { case 1UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovb %2,%b1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorb %b1,%b1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err), "=q" (__gu_val): "m" (*((struct __large_struct *)(& uurb->type))), "i" (-14), "0" (__gu_err)); goto ldv_34644; case 2UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovw %2,%w1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorw %w1,%w1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err), "=r" (__gu_val): "m" (*((struct __large_struct *)(& uurb->type))), "i" (-14), "0" (__gu_err)); goto ldv_34644; case 4UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovl %2,%k1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorl %k1,%k1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err), "=r" (__gu_val): "m" (*((struct __large_struct *)(& uurb->type))), "i" (-14), "0" (__gu_err)); goto ldv_34644; case 8UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovq %2,%1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorq %1,%1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err), "=r" (__gu_val): "m" (*((struct __large_struct *)(& uurb->type))), "i" (-14), "0" (__gu_err)); goto ldv_34644; default: tmp___1 = __get_user_bad(); __gu_val = (unsigned long )tmp___1; } ldv_34644: kurb->type = (unsigned char )__gu_val; if (__gu_err != 0) { return (-14); } else { __gu_err___0 = 0; switch (1UL) { case 1UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovb %2,%b1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorb %b1,%b1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___0), "=q" (__gu_val___0): "m" (*((struct __large_struct *)(& uurb->endpoint))), "i" (-14), "0" (__gu_err___0)); goto ldv_34653; case 2UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovw %2,%w1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorw %w1,%w1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___0), "=r" (__gu_val___0): "m" (*((struct __large_struct *)(& uurb->endpoint))), "i" (-14), "0" (__gu_err___0)); goto ldv_34653; case 4UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovl %2,%k1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorl %k1,%k1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___0), "=r" (__gu_val___0): "m" (*((struct __large_struct *)(& uurb->endpoint))), "i" (-14), "0" (__gu_err___0)); goto ldv_34653; case 8UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovq %2,%1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorq %1,%1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___0), "=r" (__gu_val___0): "m" (*((struct __large_struct *)(& uurb->endpoint))), "i" (-14), "0" (__gu_err___0)); goto ldv_34653; default: tmp___2 = __get_user_bad(); __gu_val___0 = (unsigned long )tmp___2; } ldv_34653: kurb->endpoint = (unsigned char )__gu_val___0; if (__gu_err___0 != 0) { return (-14); } else { __gu_err___1 = 0; switch (4UL) { case 1UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovb %2,%b1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorb %b1,%b1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___1), "=q" (__gu_val___1): "m" (*((struct __large_struct *)(& uurb->status))), "i" (-14), "0" (__gu_err___1)); goto ldv_34662; case 2UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovw %2,%w1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorw %w1,%w1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___1), "=r" (__gu_val___1): "m" (*((struct __large_struct *)(& uurb->status))), "i" (-14), "0" (__gu_err___1)); goto ldv_34662; case 4UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovl %2,%k1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorl %k1,%k1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___1), "=r" (__gu_val___1): "m" (*((struct __large_struct *)(& uurb->status))), "i" (-14), "0" (__gu_err___1)); goto ldv_34662; case 8UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovq %2,%1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorq %1,%1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___1), "=r" (__gu_val___1): "m" (*((struct __large_struct *)(& uurb->status))), "i" (-14), "0" (__gu_err___1)); goto ldv_34662; default: tmp___3 = __get_user_bad(); __gu_val___1 = (unsigned long )tmp___3; } ldv_34662: kurb->status = (int )__gu_val___1; if (__gu_err___1 != 0) { return (-14); } else { __gu_err___2 = 0; switch (4UL) { case 1UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovb %2,%b1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorb %b1,%b1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___2), "=q" (__gu_val___2): "m" (*((struct __large_struct *)(& uurb->flags))), "i" (-14), "0" (__gu_err___2)); goto ldv_34671; case 2UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovw %2,%w1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorw %w1,%w1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___2), "=r" (__gu_val___2): "m" (*((struct __large_struct *)(& uurb->flags))), "i" (-14), "0" (__gu_err___2)); goto ldv_34671; case 4UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovl %2,%k1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorl %k1,%k1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___2), "=r" (__gu_val___2): "m" (*((struct __large_struct *)(& uurb->flags))), "i" (-14), "0" (__gu_err___2)); goto ldv_34671; case 8UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovq %2,%1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorq %1,%1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___2), "=r" (__gu_val___2): "m" (*((struct __large_struct *)(& uurb->flags))), "i" (-14), "0" (__gu_err___2)); goto ldv_34671; default: tmp___4 = __get_user_bad(); __gu_val___2 = (unsigned long )tmp___4; } ldv_34671: kurb->flags = (unsigned int )__gu_val___2; if (__gu_err___2 != 0) { return (-14); } else { __gu_err___3 = 0; switch (4UL) { case 1UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovb %2,%b1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorb %b1,%b1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___3), "=q" (__gu_val___3): "m" (*((struct __large_struct *)(& uurb->buffer_length))), "i" (-14), "0" (__gu_err___3)); goto ldv_34680; case 2UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovw %2,%w1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorw %w1,%w1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___3), "=r" (__gu_val___3): "m" (*((struct __large_struct *)(& uurb->buffer_length))), "i" (-14), "0" (__gu_err___3)); goto ldv_34680; case 4UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovl %2,%k1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorl %k1,%k1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___3), "=r" (__gu_val___3): "m" (*((struct __large_struct *)(& uurb->buffer_length))), "i" (-14), "0" (__gu_err___3)); goto ldv_34680; case 8UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovq %2,%1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorq %1,%1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___3), "=r" (__gu_val___3): "m" (*((struct __large_struct *)(& uurb->buffer_length))), "i" (-14), "0" (__gu_err___3)); goto ldv_34680; default: tmp___5 = __get_user_bad(); __gu_val___3 = (unsigned long )tmp___5; } ldv_34680: kurb->buffer_length = (int )__gu_val___3; if (__gu_err___3 != 0) { return (-14); } else { __gu_err___4 = 0; switch (4UL) { case 1UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovb %2,%b1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorb %b1,%b1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___4), "=q" (__gu_val___4): "m" (*((struct __large_struct *)(& uurb->actual_length))), "i" (-14), "0" (__gu_err___4)); goto ldv_34689; case 2UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovw %2,%w1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorw %w1,%w1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___4), "=r" (__gu_val___4): "m" (*((struct __large_struct *)(& uurb->actual_length))), "i" (-14), "0" (__gu_err___4)); goto ldv_34689; case 4UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovl %2,%k1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorl %k1,%k1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___4), "=r" (__gu_val___4): "m" (*((struct __large_struct *)(& uurb->actual_length))), "i" (-14), "0" (__gu_err___4)); goto ldv_34689; case 8UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovq %2,%1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorq %1,%1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___4), "=r" (__gu_val___4): "m" (*((struct __large_struct *)(& uurb->actual_length))), "i" (-14), "0" (__gu_err___4)); goto ldv_34689; default: tmp___6 = __get_user_bad(); __gu_val___4 = (unsigned long )tmp___6; } ldv_34689: kurb->actual_length = (int )__gu_val___4; if (__gu_err___4 != 0) { return (-14); } else { __gu_err___5 = 0; switch (4UL) { case 1UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovb %2,%b1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorb %b1,%b1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___5), "=q" (__gu_val___5): "m" (*((struct __large_struct *)(& uurb->start_frame))), "i" (-14), "0" (__gu_err___5)); goto ldv_34698; case 2UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovw %2,%w1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorw %w1,%w1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___5), "=r" (__gu_val___5): "m" (*((struct __large_struct *)(& uurb->start_frame))), "i" (-14), "0" (__gu_err___5)); goto ldv_34698; case 4UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovl %2,%k1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorl %k1,%k1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___5), "=r" (__gu_val___5): "m" (*((struct __large_struct *)(& uurb->start_frame))), "i" (-14), "0" (__gu_err___5)); goto ldv_34698; case 8UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovq %2,%1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorq %1,%1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___5), "=r" (__gu_val___5): "m" (*((struct __large_struct *)(& uurb->start_frame))), "i" (-14), "0" (__gu_err___5)); goto ldv_34698; default: tmp___7 = __get_user_bad(); __gu_val___5 = (unsigned long )tmp___7; } ldv_34698: kurb->start_frame = (int )__gu_val___5; if (__gu_err___5 != 0) { return (-14); } else { __gu_err___6 = 0; switch (4UL) { case 1UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovb %2,%b1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorb %b1,%b1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___6), "=q" (__gu_val___6): "m" (*((struct __large_struct *)(& uurb->number_of_packets))), "i" (-14), "0" (__gu_err___6)); goto ldv_34707; case 2UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovw %2,%w1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorw %w1,%w1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___6), "=r" (__gu_val___6): "m" (*((struct __large_struct *)(& uurb->number_of_packets))), "i" (-14), "0" (__gu_err___6)); goto ldv_34707; case 4UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovl %2,%k1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorl %k1,%k1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___6), "=r" (__gu_val___6): "m" (*((struct __large_struct *)(& uurb->number_of_packets))), "i" (-14), "0" (__gu_err___6)); goto ldv_34707; case 8UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovq %2,%1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorq %1,%1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___6), "=r" (__gu_val___6): "m" (*((struct __large_struct *)(& uurb->number_of_packets))), "i" (-14), "0" (__gu_err___6)); goto ldv_34707; default: tmp___8 = __get_user_bad(); __gu_val___6 = (unsigned long )tmp___8; } ldv_34707: kurb->number_of_packets = (int )__gu_val___6; if (__gu_err___6 != 0) { return (-14); } else { __gu_err___7 = 0; switch (4UL) { case 1UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovb %2,%b1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorb %b1,%b1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___7), "=q" (__gu_val___7): "m" (*((struct __large_struct *)(& uurb->error_count))), "i" (-14), "0" (__gu_err___7)); goto ldv_34716; case 2UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovw %2,%w1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorw %w1,%w1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___7), "=r" (__gu_val___7): "m" (*((struct __large_struct *)(& uurb->error_count))), "i" (-14), "0" (__gu_err___7)); goto ldv_34716; case 4UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovl %2,%k1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorl %k1,%k1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___7), "=r" (__gu_val___7): "m" (*((struct __large_struct *)(& uurb->error_count))), "i" (-14), "0" (__gu_err___7)); goto ldv_34716; case 8UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovq %2,%1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorq %1,%1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___7), "=r" (__gu_val___7): "m" (*((struct __large_struct *)(& uurb->error_count))), "i" (-14), "0" (__gu_err___7)); goto ldv_34716; default: tmp___9 = __get_user_bad(); __gu_val___7 = (unsigned long )tmp___9; } ldv_34716: kurb->error_count = (int )__gu_val___7; if (__gu_err___7 != 0) { return (-14); } else { __gu_err___8 = 0; switch (4UL) { case 1UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovb %2,%b1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorb %b1,%b1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___8), "=q" (__gu_val___8): "m" (*((struct __large_struct *)(& uurb->signr))), "i" (-14), "0" (__gu_err___8)); goto ldv_34725; case 2UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovw %2,%w1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorw %w1,%w1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___8), "=r" (__gu_val___8): "m" (*((struct __large_struct *)(& uurb->signr))), "i" (-14), "0" (__gu_err___8)); goto ldv_34725; case 4UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovl %2,%k1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorl %k1,%k1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___8), "=r" (__gu_val___8): "m" (*((struct __large_struct *)(& uurb->signr))), "i" (-14), "0" (__gu_err___8)); goto ldv_34725; case 8UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovq %2,%1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorq %1,%1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___8), "=r" (__gu_val___8): "m" (*((struct __large_struct *)(& uurb->signr))), "i" (-14), "0" (__gu_err___8)); goto ldv_34725; default: tmp___10 = __get_user_bad(); __gu_val___8 = (unsigned long )tmp___10; } ldv_34725: kurb->signr = (unsigned int )__gu_val___8; if (__gu_err___8 != 0) { return (-14); } else { } } } } } } } } } } } __gu_err___9 = 0; switch (4UL) { case 1UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovb %2,%b1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorb %b1,%b1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___9), "=q" (__gu_val___9): "m" (*((struct __large_struct *)(& uurb->buffer))), "i" (-14), "0" (__gu_err___9)); goto ldv_34734; case 2UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovw %2,%w1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorw %w1,%w1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___9), "=r" (__gu_val___9): "m" (*((struct __large_struct *)(& uurb->buffer))), "i" (-14), "0" (__gu_err___9)); goto ldv_34734; case 4UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovl %2,%k1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorl %k1,%k1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___9), "=r" (__gu_val___9): "m" (*((struct __large_struct *)(& uurb->buffer))), "i" (-14), "0" (__gu_err___9)); goto ldv_34734; case 8UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovq %2,%1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorq %1,%1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___9), "=r" (__gu_val___9): "m" (*((struct __large_struct *)(& uurb->buffer))), "i" (-14), "0" (__gu_err___9)); goto ldv_34734; default: tmp___11 = __get_user_bad(); __gu_val___9 = (unsigned long )tmp___11; } ldv_34734: uptr = (unsigned int )__gu_val___9; if (__gu_err___9 != 0) { return (-14); } else { } kurb->buffer = compat_ptr(uptr); __gu_err___10 = 0; switch (4UL) { case 1UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovb %2,%b1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorb %b1,%b1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___10), "=q" (__gu_val___10): "m" (*((struct __large_struct *)(& uurb->usercontext))), "i" (-14), "0" (__gu_err___10)); goto ldv_34743; case 2UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovw %2,%w1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorw %w1,%w1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___10), "=r" (__gu_val___10): "m" (*((struct __large_struct *)(& uurb->usercontext))), "i" (-14), "0" (__gu_err___10)); goto ldv_34743; case 4UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovl %2,%k1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorl %k1,%k1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___10), "=r" (__gu_val___10): "m" (*((struct __large_struct *)(& uurb->usercontext))), "i" (-14), "0" (__gu_err___10)); goto ldv_34743; case 8UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovq %2,%1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorq %1,%1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___10), "=r" (__gu_val___10): "m" (*((struct __large_struct *)(& uurb->usercontext))), "i" (-14), "0" (__gu_err___10)); goto ldv_34743; default: tmp___12 = __get_user_bad(); __gu_val___10 = (unsigned long )tmp___12; } ldv_34743: uptr = (unsigned int )__gu_val___10; if (__gu_err___10 != 0) { return (-14); } else { } kurb->usercontext = compat_ptr(uptr); return (0); } } static int proc_submiturb_compat(struct dev_state *ps , void *arg ) { struct usbdevfs_urb uurb ; int tmp ; int tmp___0 ; { tmp = get_urb32(& uurb, (struct usbdevfs_urb32 *)arg); if (tmp != 0) { return (-14); } else { } tmp___0 = proc_do_submiturb(ps, & uurb, (struct usbdevfs_iso_packet_desc *)(& ((struct usbdevfs_urb32 *)arg)->iso_frame_desc), arg); return (tmp___0); } } static int processcompl_compat(struct async *as , void **arg ) { struct urb *urb ; struct usbdevfs_urb32 *userurb ; void *addr ; unsigned int i ; int tmp ; int __ret_pu ; compat_int_t __pu_val ; int __ret_pu___0 ; compat_int_t __pu_val___0 ; int __ret_pu___1 ; compat_int_t __pu_val___1 ; int __ret_pu___2 ; unsigned int __pu_val___2 ; int __ret_pu___3 ; unsigned int __pu_val___3 ; int tmp___0 ; int __ret_pu___4 ; u32 __pu_val___4 ; { urb = as->urb; userurb = (struct usbdevfs_urb32 *)as->userurb; addr = as->userurb; if ((unsigned long )as->userbuffer != (unsigned long )((void *)0) && urb->actual_length != 0U) { tmp = copy_urb_data_to_user((u8 *)as->userbuffer, urb); if (tmp != 0) { return (-14); } else { } } else { } might_fault(); __pu_val = as->status; switch (4UL) { case 1UL: __asm__ volatile ("call __put_user_1": "=a" (__ret_pu): "0" (__pu_val), "c" (& userurb->status): "ebx"); goto ldv_34765; case 2UL: __asm__ volatile ("call __put_user_2": "=a" (__ret_pu): "0" (__pu_val), "c" (& userurb->status): "ebx"); goto ldv_34765; case 4UL: __asm__ volatile ("call __put_user_4": "=a" (__ret_pu): "0" (__pu_val), "c" (& userurb->status): "ebx"); goto ldv_34765; case 8UL: __asm__ volatile ("call __put_user_8": "=a" (__ret_pu): "0" (__pu_val), "c" (& userurb->status): "ebx"); goto ldv_34765; default: __asm__ volatile ("call __put_user_X": "=a" (__ret_pu): "0" (__pu_val), "c" (& userurb->status): "ebx"); goto ldv_34765; } ldv_34765: ; if (__ret_pu != 0) { return (-14); } else { } might_fault(); __pu_val___0 = (compat_int_t )urb->actual_length; switch (4UL) { case 1UL: __asm__ volatile ("call __put_user_1": "=a" (__ret_pu___0): "0" (__pu_val___0), "c" (& userurb->actual_length): "ebx"); goto ldv_34774; case 2UL: __asm__ volatile ("call __put_user_2": "=a" (__ret_pu___0): "0" (__pu_val___0), "c" (& userurb->actual_length): "ebx"); goto ldv_34774; case 4UL: __asm__ volatile ("call __put_user_4": "=a" (__ret_pu___0): "0" (__pu_val___0), "c" (& userurb->actual_length): "ebx"); goto ldv_34774; case 8UL: __asm__ volatile ("call __put_user_8": "=a" (__ret_pu___0): "0" (__pu_val___0), "c" (& userurb->actual_length): "ebx"); goto ldv_34774; default: __asm__ volatile ("call __put_user_X": "=a" (__ret_pu___0): "0" (__pu_val___0), "c" (& userurb->actual_length): "ebx"); goto ldv_34774; } ldv_34774: ; if (__ret_pu___0 != 0) { return (-14); } else { } might_fault(); __pu_val___1 = urb->error_count; switch (4UL) { case 1UL: __asm__ volatile ("call __put_user_1": "=a" (__ret_pu___1): "0" (__pu_val___1), "c" (& userurb->error_count): "ebx"); goto ldv_34783; case 2UL: __asm__ volatile ("call __put_user_2": "=a" (__ret_pu___1): "0" (__pu_val___1), "c" (& userurb->error_count): "ebx"); goto ldv_34783; case 4UL: __asm__ volatile ("call __put_user_4": "=a" (__ret_pu___1): "0" (__pu_val___1), "c" (& userurb->error_count): "ebx"); goto ldv_34783; case 8UL: __asm__ volatile ("call __put_user_8": "=a" (__ret_pu___1): "0" (__pu_val___1), "c" (& userurb->error_count): "ebx"); goto ldv_34783; default: __asm__ volatile ("call __put_user_X": "=a" (__ret_pu___1): "0" (__pu_val___1), "c" (& userurb->error_count): "ebx"); goto ldv_34783; } ldv_34783: ; if (__ret_pu___1 != 0) { return (-14); } else { } tmp___0 = usb_endpoint_xfer_isoc((struct usb_endpoint_descriptor const *)(& (urb->ep)->desc)); if (tmp___0 != 0) { i = 0U; goto ldv_34808; ldv_34807: might_fault(); __pu_val___2 = urb->iso_frame_desc[i].actual_length; switch (4UL) { case 1UL: __asm__ volatile ("call __put_user_1": "=a" (__ret_pu___2): "0" (__pu_val___2), "c" (& userurb->iso_frame_desc[i].actual_length): "ebx"); goto ldv_34792; case 2UL: __asm__ volatile ("call __put_user_2": "=a" (__ret_pu___2): "0" (__pu_val___2), "c" (& userurb->iso_frame_desc[i].actual_length): "ebx"); goto ldv_34792; case 4UL: __asm__ volatile ("call __put_user_4": "=a" (__ret_pu___2): "0" (__pu_val___2), "c" (& userurb->iso_frame_desc[i].actual_length): "ebx"); goto ldv_34792; case 8UL: __asm__ volatile ("call __put_user_8": "=a" (__ret_pu___2): "0" (__pu_val___2), "c" (& userurb->iso_frame_desc[i].actual_length): "ebx"); goto ldv_34792; default: __asm__ volatile ("call __put_user_X": "=a" (__ret_pu___2): "0" (__pu_val___2), "c" (& userurb->iso_frame_desc[i].actual_length): "ebx"); goto ldv_34792; } ldv_34792: ; if (__ret_pu___2 != 0) { return (-14); } else { } might_fault(); __pu_val___3 = (unsigned int )urb->iso_frame_desc[i].status; switch (4UL) { case 1UL: __asm__ volatile ("call __put_user_1": "=a" (__ret_pu___3): "0" (__pu_val___3), "c" (& userurb->iso_frame_desc[i].status): "ebx"); goto ldv_34801; case 2UL: __asm__ volatile ("call __put_user_2": "=a" (__ret_pu___3): "0" (__pu_val___3), "c" (& userurb->iso_frame_desc[i].status): "ebx"); goto ldv_34801; case 4UL: __asm__ volatile ("call __put_user_4": "=a" (__ret_pu___3): "0" (__pu_val___3), "c" (& userurb->iso_frame_desc[i].status): "ebx"); goto ldv_34801; case 8UL: __asm__ volatile ("call __put_user_8": "=a" (__ret_pu___3): "0" (__pu_val___3), "c" (& userurb->iso_frame_desc[i].status): "ebx"); goto ldv_34801; default: __asm__ volatile ("call __put_user_X": "=a" (__ret_pu___3): "0" (__pu_val___3), "c" (& userurb->iso_frame_desc[i].status): "ebx"); goto ldv_34801; } ldv_34801: ; if (__ret_pu___3 != 0) { return (-14); } else { } i = i + 1U; ldv_34808: ; if ((unsigned int )urb->number_of_packets > i) { goto ldv_34807; } else { } } else { } might_fault(); __pu_val___4 = ptr_to_compat(addr); switch (4UL) { case 1UL: __asm__ volatile ("call __put_user_1": "=a" (__ret_pu___4): "0" (__pu_val___4), "c" ((u32 *)arg): "ebx"); goto ldv_34813; case 2UL: __asm__ volatile ("call __put_user_2": "=a" (__ret_pu___4): "0" (__pu_val___4), "c" ((u32 *)arg): "ebx"); goto ldv_34813; case 4UL: __asm__ volatile ("call __put_user_4": "=a" (__ret_pu___4): "0" (__pu_val___4), "c" ((u32 *)arg): "ebx"); goto ldv_34813; case 8UL: __asm__ volatile ("call __put_user_8": "=a" (__ret_pu___4): "0" (__pu_val___4), "c" ((u32 *)arg): "ebx"); goto ldv_34813; default: __asm__ volatile ("call __put_user_X": "=a" (__ret_pu___4): "0" (__pu_val___4), "c" ((u32 *)arg): "ebx"); goto ldv_34813; } ldv_34813: ; if (__ret_pu___4 != 0) { return (-14); } else { } return (0); } } static int proc_reapurb_compat(struct dev_state *ps , void *arg ) { struct async *as ; struct async *tmp ; int retval ; int tmp___0 ; struct task_struct *tmp___1 ; int tmp___2 ; { tmp = reap_as(ps); as = tmp; if ((unsigned long )as != (unsigned long )((struct async *)0)) { tmp___0 = processcompl_compat(as, (void **)arg); retval = tmp___0; free_async(as); return (retval); } else { } tmp___1 = get_current(); tmp___2 = signal_pending(tmp___1); if (tmp___2 != 0) { return (-4); } else { } return (-5); } } static int proc_reapurbnonblock_compat(struct dev_state *ps , void *arg ) { int retval ; struct async *as ; { retval = -11; as = async_getcompleted(ps); if ((unsigned long )as != (unsigned long )((struct async *)0)) { retval = processcompl_compat(as, (void **)arg); free_async(as); } else { } return (retval); } } static int proc_disconnectsignal(struct dev_state *ps , void *arg ) { struct usbdevfs_disconnectsignal ds ; unsigned long tmp ; { tmp = copy_from_user((void *)(& ds), (void const *)arg, 16UL); if (tmp != 0UL) { return (-14); } else { } ps->discsignr = ds.signr; ps->disccontext = ds.context; return (0); } } static int proc_claiminterface(struct dev_state *ps , void *arg ) { unsigned int ifnum ; int __ret_gu ; unsigned long __val_gu ; int tmp ; { might_fault(); switch (4UL) { case 1UL: __asm__ volatile ("call __get_user_1": "=a" (__ret_gu), "=d" (__val_gu): "0" ((unsigned int *)arg)); goto ldv_34844; case 2UL: __asm__ volatile ("call __get_user_2": "=a" (__ret_gu), "=d" (__val_gu): "0" ((unsigned int *)arg)); goto ldv_34844; case 4UL: __asm__ volatile ("call __get_user_4": "=a" (__ret_gu), "=d" (__val_gu): "0" ((unsigned int *)arg)); goto ldv_34844; case 8UL: __asm__ volatile ("call __get_user_8": "=a" (__ret_gu), "=d" (__val_gu): "0" ((unsigned int *)arg)); goto ldv_34844; default: __asm__ volatile ("call __get_user_X": "=a" (__ret_gu), "=d" (__val_gu): "0" ((unsigned int *)arg)); goto ldv_34844; } ldv_34844: ifnum = (unsigned int )__val_gu; if (__ret_gu != 0) { return (-14); } else { } tmp = claimintf(ps, ifnum); return (tmp); } } static int proc_releaseinterface(struct dev_state *ps , void *arg ) { unsigned int ifnum ; int ret ; int __ret_gu ; unsigned long __val_gu ; { might_fault(); switch (4UL) { case 1UL: __asm__ volatile ("call __get_user_1": "=a" (__ret_gu), "=d" (__val_gu): "0" ((unsigned int *)arg)); goto ldv_34859; case 2UL: __asm__ volatile ("call __get_user_2": "=a" (__ret_gu), "=d" (__val_gu): "0" ((unsigned int *)arg)); goto ldv_34859; case 4UL: __asm__ volatile ("call __get_user_4": "=a" (__ret_gu), "=d" (__val_gu): "0" ((unsigned int *)arg)); goto ldv_34859; case 8UL: __asm__ volatile ("call __get_user_8": "=a" (__ret_gu), "=d" (__val_gu): "0" ((unsigned int *)arg)); goto ldv_34859; default: __asm__ volatile ("call __get_user_X": "=a" (__ret_gu), "=d" (__val_gu): "0" ((unsigned int *)arg)); goto ldv_34859; } ldv_34859: ifnum = (unsigned int )__val_gu; if (__ret_gu != 0) { return (-14); } else { } ret = releaseintf(ps, ifnum); if (ret < 0) { return (ret); } else { } destroy_async_on_interface(ps, ifnum); return (0); } } static int proc_ioctl(struct dev_state *ps , struct usbdevfs_ioctl *ctl ) { int size ; void *buf ; int retval ; struct usb_interface *intf ; struct usb_driver *driver ; unsigned long tmp ; int tmp___0 ; struct device_driver const *__mptr ; struct _ddebug descriptor ; long tmp___1 ; struct device_driver const *__mptr___0 ; int tmp___2 ; { buf = 0; retval = 0; intf = 0; driver = 0; size = (ctl->ioctl_code >> 16) & 16383; if (size > 0) { buf = kmalloc((size_t )size, 208U); if ((unsigned long )buf == (unsigned long )((void *)0)) { return (-12); } else { } if (((unsigned int )ctl->ioctl_code & 1073741824U) != 0U) { tmp = copy_from_user(buf, (void const *)ctl->data, (unsigned long )size); if (tmp != 0UL) { kfree((void const *)buf); return (-14); } else { memset(buf, 0, (size_t )size); } } else { } } else { } tmp___0 = connected(ps); if (tmp___0 == 0) { kfree((void const *)buf); return (-19); } else { } if ((unsigned int )(ps->dev)->state != 7U) { retval = -113; } else { intf = usb_ifnum_to_if((struct usb_device const *)ps->dev, (unsigned int )ctl->ifno); if ((unsigned long )intf == (unsigned long )((struct usb_interface *)0)) { retval = -22; } else { switch (ctl->ioctl_code) { case 21782: ; if ((unsigned long )intf->dev.driver != (unsigned long )((struct device_driver *)0)) { __mptr = (struct device_driver const *)intf->dev.driver; driver = (struct usb_driver *)__mptr + 0xffffffffffffff58UL; descriptor.modname = "usbcore"; descriptor.function = "proc_ioctl"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/devio.c.prepared"; descriptor.format = "disconnect by usbfs\n"; descriptor.lineno = 1923U; descriptor.flags = 1U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)(& intf->dev), "disconnect by usbfs\n"); } else { } usb_driver_release_interface(driver, intf); } else { retval = -61; } goto ldv_34879; case 21783: ; if ((unsigned long )intf->dev.driver == (unsigned long )((struct device_driver *)0)) { retval = device_attach(& intf->dev); } else { retval = -16; } goto ldv_34879; default: ; if ((unsigned long )intf->dev.driver != (unsigned long )((struct device_driver *)0)) { __mptr___0 = (struct device_driver const *)intf->dev.driver; driver = (struct usb_driver *)__mptr___0 + 0xffffffffffffff58UL; } else { } if ((unsigned long )driver == (unsigned long )((struct usb_driver *)0) || (unsigned long )driver->unlocked_ioctl == (unsigned long )((int (*)(struct usb_interface * , unsigned int , void * ))0)) { retval = -25; } else { retval = (*(driver->unlocked_ioctl))(intf, (unsigned int )ctl->ioctl_code, buf); if (retval == -515) { retval = -25; } else { } } } ldv_34879: ; } } if ((retval >= 0 && ctl->ioctl_code < 0) && size > 0) { tmp___2 = copy_to_user(ctl->data, (void const *)buf, (unsigned int )size); if (tmp___2 != 0) { retval = -14; } else { } } else { } kfree((void const *)buf); return (retval); } } static int proc_ioctl_default(struct dev_state *ps , void *arg ) { struct usbdevfs_ioctl ctrl ; unsigned long tmp ; int tmp___0 ; { tmp = copy_from_user((void *)(& ctrl), (void const *)arg, 16UL); if (tmp != 0UL) { return (-14); } else { } tmp___0 = proc_ioctl(ps, & ctrl); return (tmp___0); } } static int proc_ioctl_compat(struct dev_state *ps , compat_uptr_t arg ) { struct usbdevfs_ioctl32 *uioc ; struct usbdevfs_ioctl ctrl ; u32 udata ; void *tmp ; unsigned long flag ; unsigned long roksum ; struct thread_info *tmp___0 ; long tmp___1 ; int __gu_err ; unsigned long __gu_val ; int tmp___2 ; int __gu_err___0 ; unsigned long __gu_val___0 ; int tmp___3 ; int __gu_err___1 ; unsigned long __gu_val___1 ; int tmp___4 ; int tmp___5 ; { tmp = compat_ptr(arg); uioc = (struct usbdevfs_ioctl32 *)tmp; tmp___0 = current_thread_info(); __asm__ ("add %3,%1 ; sbb %0,%0 ; cmp %1,%4 ; sbb $0,%0": "=&r" (flag), "=r" (roksum): "1" (uioc), "g" (12L), "rm" (tmp___0->addr_limit.seg)); tmp___1 = ldv__builtin_expect(flag == 0UL, 1L); if (tmp___1 == 0L) { return (-14); } else { __gu_err = 0; switch (4UL) { case 1UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovb %2,%b1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorb %b1,%b1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err), "=q" (__gu_val): "m" (*((struct __large_struct *)(& uioc->ifno))), "i" (-14), "0" (__gu_err)); goto ldv_34902; case 2UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovw %2,%w1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorw %w1,%w1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err), "=r" (__gu_val): "m" (*((struct __large_struct *)(& uioc->ifno))), "i" (-14), "0" (__gu_err)); goto ldv_34902; case 4UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovl %2,%k1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorl %k1,%k1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err), "=r" (__gu_val): "m" (*((struct __large_struct *)(& uioc->ifno))), "i" (-14), "0" (__gu_err)); goto ldv_34902; case 8UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovq %2,%1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorq %1,%1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err), "=r" (__gu_val): "m" (*((struct __large_struct *)(& uioc->ifno))), "i" (-14), "0" (__gu_err)); goto ldv_34902; default: tmp___2 = __get_user_bad(); __gu_val = (unsigned long )tmp___2; } ldv_34902: ctrl.ifno = (int )__gu_val; if (__gu_err != 0) { return (-14); } else { __gu_err___0 = 0; switch (4UL) { case 1UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovb %2,%b1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorb %b1,%b1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___0), "=q" (__gu_val___0): "m" (*((struct __large_struct *)(& uioc->ioctl_code))), "i" (-14), "0" (__gu_err___0)); goto ldv_34911; case 2UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovw %2,%w1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorw %w1,%w1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___0), "=r" (__gu_val___0): "m" (*((struct __large_struct *)(& uioc->ioctl_code))), "i" (-14), "0" (__gu_err___0)); goto ldv_34911; case 4UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovl %2,%k1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorl %k1,%k1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___0), "=r" (__gu_val___0): "m" (*((struct __large_struct *)(& uioc->ioctl_code))), "i" (-14), "0" (__gu_err___0)); goto ldv_34911; case 8UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovq %2,%1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorq %1,%1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___0), "=r" (__gu_val___0): "m" (*((struct __large_struct *)(& uioc->ioctl_code))), "i" (-14), "0" (__gu_err___0)); goto ldv_34911; default: tmp___3 = __get_user_bad(); __gu_val___0 = (unsigned long )tmp___3; } ldv_34911: ctrl.ioctl_code = (int )__gu_val___0; if (__gu_err___0 != 0) { return (-14); } else { __gu_err___1 = 0; switch (4UL) { case 1UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovb %2,%b1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorb %b1,%b1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___1), "=q" (__gu_val___1): "m" (*((struct __large_struct *)(& uioc->data))), "i" (-14), "0" (__gu_err___1)); goto ldv_34920; case 2UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovw %2,%w1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorw %w1,%w1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___1), "=r" (__gu_val___1): "m" (*((struct __large_struct *)(& uioc->data))), "i" (-14), "0" (__gu_err___1)); goto ldv_34920; case 4UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovl %2,%k1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorl %k1,%k1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___1), "=r" (__gu_val___1): "m" (*((struct __large_struct *)(& uioc->data))), "i" (-14), "0" (__gu_err___1)); goto ldv_34920; case 8UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovq %2,%1\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\txorq %1,%1\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__gu_err___1), "=r" (__gu_val___1): "m" (*((struct __large_struct *)(& uioc->data))), "i" (-14), "0" (__gu_err___1)); goto ldv_34920; default: tmp___4 = __get_user_bad(); __gu_val___1 = (unsigned long )tmp___4; } ldv_34920: udata = (unsigned int )__gu_val___1; if (__gu_err___1 != 0) { return (-14); } else { } } } } ctrl.data = compat_ptr(udata); tmp___5 = proc_ioctl(ps, & ctrl); return (tmp___5); } } static int proc_claim_port(struct dev_state *ps , void *arg ) { unsigned int portnum ; int rc ; int __ret_gu ; unsigned long __val_gu ; struct task_struct *tmp ; struct task_struct *tmp___0 ; pid_t tmp___1 ; { might_fault(); switch (4UL) { case 1UL: __asm__ volatile ("call __get_user_1": "=a" (__ret_gu), "=d" (__val_gu): "0" ((unsigned int *)arg)); goto ldv_34935; case 2UL: __asm__ volatile ("call __get_user_2": "=a" (__ret_gu), "=d" (__val_gu): "0" ((unsigned int *)arg)); goto ldv_34935; case 4UL: __asm__ volatile ("call __get_user_4": "=a" (__ret_gu), "=d" (__val_gu): "0" ((unsigned int *)arg)); goto ldv_34935; case 8UL: __asm__ volatile ("call __get_user_8": "=a" (__ret_gu), "=d" (__val_gu): "0" ((unsigned int *)arg)); goto ldv_34935; default: __asm__ volatile ("call __get_user_X": "=a" (__ret_gu), "=d" (__val_gu): "0" ((unsigned int *)arg)); goto ldv_34935; } ldv_34935: portnum = (unsigned int )__val_gu; if (__ret_gu != 0) { return (-14); } else { } rc = usb_hub_claim_port(ps->dev, portnum, ps); if (rc == 0) { if ((int )usbfs_snoop) { tmp = get_current(); tmp___0 = get_current(); tmp___1 = task_pid_nr(tmp___0); _dev_info((struct device const *)(& (ps->dev)->dev), "port %d claimed by process %d: %s\n", portnum, tmp___1, (char *)(& tmp->comm)); } else { } } else { } return (rc); } } static int proc_release_port(struct dev_state *ps , void *arg ) { unsigned int portnum ; int __ret_gu ; unsigned long __val_gu ; int tmp ; { might_fault(); switch (4UL) { case 1UL: __asm__ volatile ("call __get_user_1": "=a" (__ret_gu), "=d" (__val_gu): "0" ((unsigned int *)arg)); goto ldv_34949; case 2UL: __asm__ volatile ("call __get_user_2": "=a" (__ret_gu), "=d" (__val_gu): "0" ((unsigned int *)arg)); goto ldv_34949; case 4UL: __asm__ volatile ("call __get_user_4": "=a" (__ret_gu), "=d" (__val_gu): "0" ((unsigned int *)arg)); goto ldv_34949; case 8UL: __asm__ volatile ("call __get_user_8": "=a" (__ret_gu), "=d" (__val_gu): "0" ((unsigned int *)arg)); goto ldv_34949; default: __asm__ volatile ("call __get_user_X": "=a" (__ret_gu), "=d" (__val_gu): "0" ((unsigned int *)arg)); goto ldv_34949; } ldv_34949: portnum = (unsigned int )__val_gu; if (__ret_gu != 0) { return (-14); } else { } tmp = usb_hub_release_port(ps->dev, portnum, ps); return (tmp); } } static int proc_get_capabilities(struct dev_state *ps , void *arg ) { __u32 caps ; int __ret_pu ; __u32 __pu_val ; { caps = 5U; if ((unsigned int )*((unsigned char *)(ps->dev)->bus + 27UL) == 0U) { caps = caps | 2U; } else { } if (((ps->dev)->bus)->sg_tablesize != 0U) { caps = caps | 8U; } else { } might_fault(); __pu_val = caps; switch (4UL) { case 1UL: __asm__ volatile ("call __put_user_1": "=a" (__ret_pu): "0" (__pu_val), "c" ((__u32 *)arg): "ebx"); goto ldv_34963; case 2UL: __asm__ volatile ("call __put_user_2": "=a" (__ret_pu): "0" (__pu_val), "c" ((__u32 *)arg): "ebx"); goto ldv_34963; case 4UL: __asm__ volatile ("call __put_user_4": "=a" (__ret_pu): "0" (__pu_val), "c" ((__u32 *)arg): "ebx"); goto ldv_34963; case 8UL: __asm__ volatile ("call __put_user_8": "=a" (__ret_pu): "0" (__pu_val), "c" ((__u32 *)arg): "ebx"); goto ldv_34963; default: __asm__ volatile ("call __put_user_X": "=a" (__ret_pu): "0" (__pu_val), "c" ((__u32 *)arg): "ebx"); goto ldv_34963; } ldv_34963: ; if (__ret_pu != 0) { return (-14); } else { } return (0); } } static int proc_disconnect_claim(struct dev_state *ps , void *arg ) { struct usbdevfs_disconnect_claim dc ; struct usb_interface *intf ; unsigned long tmp ; struct usb_driver *driver ; struct device_driver const *__mptr ; int tmp___0 ; int tmp___1 ; struct _ddebug descriptor ; long tmp___2 ; int tmp___3 ; { tmp = copy_from_user((void *)(& dc), (void const *)arg, 264UL); if (tmp != 0UL) { return (-14); } else { } intf = usb_ifnum_to_if((struct usb_device const *)ps->dev, dc.interface); if ((unsigned long )intf == (unsigned long )((struct usb_interface *)0)) { return (-22); } else { } if ((unsigned long )intf->dev.driver != (unsigned long )((struct device_driver *)0)) { __mptr = (struct device_driver const *)intf->dev.driver; driver = (struct usb_driver *)__mptr + 0xffffffffffffff58UL; if ((int )dc.flags & 1) { tmp___0 = strncmp((char const *)(& dc.driver), (intf->dev.driver)->name, 256UL); if (tmp___0 != 0) { return (-16); } else { } } else { } if ((dc.flags & 2U) != 0U) { tmp___1 = strncmp((char const *)(& dc.driver), (intf->dev.driver)->name, 256UL); if (tmp___1 == 0) { return (-16); } else { } } else { } descriptor.modname = "usbcore"; descriptor.function = "proc_disconnect_claim"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/devio.c.prepared"; descriptor.format = "disconnect by usbfs\n"; descriptor.lineno = 2053U; descriptor.flags = 1U; tmp___2 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___2 != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)(& intf->dev), "disconnect by usbfs\n"); } else { } usb_driver_release_interface(driver, intf); } else { } tmp___3 = claimintf(ps, dc.interface); return (tmp___3); } } static long usbdev_do_ioctl(struct file *file , unsigned int cmd , void *p ) { struct dev_state *ps ; struct inode *inode ; struct usb_device *dev ; int ret ; int tmp ; compat_uptr_t tmp___0 ; { ps = (struct dev_state *)file->private_data; inode = (file->f_path.dentry)->d_inode; dev = ps->dev; ret = -25; if ((file->f_mode & 2U) == 0U) { return (-1L); } else { } device_lock___4(& dev->dev); tmp = connected(ps); if (tmp == 0) { device_unlock___4(& dev->dev); return (-19L); } else { } switch (cmd) { case 3222820096U: ; if ((int )usbfs_snoop) { _dev_info((struct device const *)(& dev->dev), "%s: CONTROL\n", "usbdev_do_ioctl"); } else { } ret = proc_control(ps, p); if (ret >= 0) { inode->i_mtime = current_kernel_time(); } else { } goto ldv_34991; case 3222820098U: ; if ((int )usbfs_snoop) { _dev_info((struct device const *)(& dev->dev), "%s: BULK\n", "usbdev_do_ioctl"); } else { } ret = proc_bulk(ps, p); if (ret >= 0) { inode->i_mtime = current_kernel_time(); } else { } goto ldv_34991; case 2147767555U: ; if ((int )usbfs_snoop) { _dev_info((struct device const *)(& dev->dev), "%s: RESETEP\n", "usbdev_do_ioctl"); } else { } ret = proc_resetep(ps, p); if (ret >= 0) { inode->i_mtime = current_kernel_time(); } else { } goto ldv_34991; case 21780U: ; if ((int )usbfs_snoop) { _dev_info((struct device const *)(& dev->dev), "%s: RESET\n", "usbdev_do_ioctl"); } else { } ret = proc_resetdevice(ps); goto ldv_34991; case 2147767573U: ; if ((int )usbfs_snoop) { _dev_info((struct device const *)(& dev->dev), "%s: CLEAR_HALT\n", "usbdev_do_ioctl"); } else { } ret = proc_clearhalt(ps, p); if (ret >= 0) { inode->i_mtime = current_kernel_time(); } else { } goto ldv_34991; case 1090802952U: ; if ((int )usbfs_snoop) { _dev_info((struct device const *)(& dev->dev), "%s: GETDRIVER\n", "usbdev_do_ioctl"); } else { } ret = proc_getdriver(ps, p); goto ldv_34991; case 1074287889U: ; if ((int )usbfs_snoop) { _dev_info((struct device const *)(& dev->dev), "%s: CONNECTINFO\n", "usbdev_do_ioctl"); } else { } ret = proc_connectinfo(ps, p); goto ldv_34991; case 2148029700U: ; if ((int )usbfs_snoop) { _dev_info((struct device const *)(& dev->dev), "%s: SETINTERFACE\n", "usbdev_do_ioctl"); } else { } ret = proc_setintf(ps, p); goto ldv_34991; case 2147767557U: ; if ((int )usbfs_snoop) { _dev_info((struct device const *)(& dev->dev), "%s: SETCONFIGURATION\n", "usbdev_do_ioctl"); } else { } ret = proc_setconfig(ps, p); goto ldv_34991; case 2151175434U: ; if ((int )usbfs_snoop) { _dev_info((struct device const *)(& dev->dev), "%s: SUBMITURB\n", "usbdev_do_ioctl"); } else { } ret = proc_submiturb(ps, p); if (ret >= 0) { inode->i_mtime = current_kernel_time(); } else { } goto ldv_34991; case 3222295808U: ; if ((int )usbfs_snoop) { _dev_info((struct device const *)(& dev->dev), "%s: CONTROL32\n", "usbdev_do_ioctl"); } else { } ret = proc_control_compat(ps, (struct usbdevfs_ctrltransfer32 *)p); if (ret >= 0) { inode->i_mtime = current_kernel_time(); } else { } goto ldv_34991; case 3222295810U: ; if ((int )usbfs_snoop) { _dev_info((struct device const *)(& dev->dev), "%s: BULK32\n", "usbdev_do_ioctl"); } else { } ret = proc_bulk_compat(ps, (struct usbdevfs_bulktransfer32 *)p); if (ret >= 0) { inode->i_mtime = current_kernel_time(); } else { } goto ldv_34991; case 2148029710U: ; if ((int )usbfs_snoop) { _dev_info((struct device const *)(& dev->dev), "%s: DISCSIGNAL32\n", "usbdev_do_ioctl"); } else { } ret = proc_disconnectsignal_compat(ps, p); goto ldv_34991; case 2150389002U: ; if ((int )usbfs_snoop) { _dev_info((struct device const *)(& dev->dev), "%s: SUBMITURB32\n", "usbdev_do_ioctl"); } else { } ret = proc_submiturb_compat(ps, p); if (ret >= 0) { inode->i_mtime = current_kernel_time(); } else { } goto ldv_34991; case 1074025740U: ; if ((int )usbfs_snoop) { _dev_info((struct device const *)(& dev->dev), "%s: REAPURB32\n", "usbdev_do_ioctl"); } else { } ret = proc_reapurb_compat(ps, p); goto ldv_34991; case 1074025741U: ; if ((int )usbfs_snoop) { _dev_info((struct device const *)(& dev->dev), "%s: REAPURBNDELAY32\n", "usbdev_do_ioctl"); } else { } ret = proc_reapurbnonblock_compat(ps, p); goto ldv_34991; case 3222033682U: ; if ((int )usbfs_snoop) { _dev_info((struct device const *)(& dev->dev), "%s: IOCTL32\n", "usbdev_do_ioctl"); } else { } tmp___0 = ptr_to_compat(p); ret = proc_ioctl_compat(ps, tmp___0); goto ldv_34991; case 21771U: ; if ((int )usbfs_snoop) { _dev_info((struct device const *)(& dev->dev), "%s: DISCARDURB\n", "usbdev_do_ioctl"); } else { } ret = proc_unlinkurb(ps, p); goto ldv_34991; case 1074287884U: ; if ((int )usbfs_snoop) { _dev_info((struct device const *)(& dev->dev), "%s: REAPURB\n", "usbdev_do_ioctl"); } else { } ret = proc_reapurb(ps, p); goto ldv_34991; case 1074287885U: ; if ((int )usbfs_snoop) { _dev_info((struct device const *)(& dev->dev), "%s: REAPURBNDELAY\n", "usbdev_do_ioctl"); } else { } ret = proc_reapurbnonblock(ps, p); goto ldv_34991; case 2148553998U: ; if ((int )usbfs_snoop) { _dev_info((struct device const *)(& dev->dev), "%s: DISCSIGNAL\n", "usbdev_do_ioctl"); } else { } ret = proc_disconnectsignal(ps, p); goto ldv_34991; case 2147767567U: ; if ((int )usbfs_snoop) { _dev_info((struct device const *)(& dev->dev), "%s: CLAIMINTERFACE\n", "usbdev_do_ioctl"); } else { } ret = proc_claiminterface(ps, p); goto ldv_34991; case 2147767568U: ; if ((int )usbfs_snoop) { _dev_info((struct device const *)(& dev->dev), "%s: RELEASEINTERFACE\n", "usbdev_do_ioctl"); } else { } ret = proc_releaseinterface(ps, p); goto ldv_34991; case 3222295826U: ; if ((int )usbfs_snoop) { _dev_info((struct device const *)(& dev->dev), "%s: IOCTL\n", "usbdev_do_ioctl"); } else { } ret = proc_ioctl_default(ps, p); goto ldv_34991; case 2147767576U: ; if ((int )usbfs_snoop) { _dev_info((struct device const *)(& dev->dev), "%s: CLAIM_PORT\n", "usbdev_do_ioctl"); } else { } ret = proc_claim_port(ps, p); goto ldv_34991; case 2147767577U: ; if ((int )usbfs_snoop) { _dev_info((struct device const *)(& dev->dev), "%s: RELEASE_PORT\n", "usbdev_do_ioctl"); } else { } ret = proc_release_port(ps, p); goto ldv_34991; case 2147767578U: ret = proc_get_capabilities(ps, p); goto ldv_34991; case 2164806939U: ret = proc_disconnect_claim(ps, p); goto ldv_34991; } ldv_34991: device_unlock___4(& dev->dev); if (ret >= 0) { inode->i_atime = current_kernel_time(); } else { } return ((long )ret); } } static long usbdev_ioctl(struct file *file , unsigned int cmd , unsigned long arg ) { int ret ; long tmp ; { tmp = usbdev_do_ioctl(file, cmd, (void *)arg); ret = (int )tmp; return ((long )ret); } } static long usbdev_compat_ioctl(struct file *file , unsigned int cmd , unsigned long arg ) { int ret ; void *tmp ; long tmp___0 ; { tmp = compat_ptr((compat_uptr_t )arg); tmp___0 = usbdev_do_ioctl(file, cmd, tmp); ret = (int )tmp___0; return ((long )ret); } } static unsigned int usbdev_poll(struct file *file , struct poll_table_struct *wait ) { struct dev_state *ps ; unsigned int mask ; int tmp ; int tmp___0 ; { ps = (struct dev_state *)file->private_data; mask = 0U; poll_wait(file, & ps->wait, wait); if ((file->f_mode & 2U) != 0U) { tmp = list_empty((struct list_head const *)(& ps->async_completed)); if (tmp == 0) { mask = mask | 260U; } else { } } else { } tmp___0 = connected(ps); if (tmp___0 == 0) { mask = mask | 24U; } else { } return (mask); } } struct file_operations const usbdev_file_operations = {& __this_module, & usbdev_lseek, & usbdev_read, 0, 0, 0, 0, & usbdev_poll, & usbdev_ioctl, & usbdev_compat_ioctl, 0, & usbdev_open, 0, & usbdev_release, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; static void usbdev_remove(struct usb_device *udev ) { struct dev_state *ps ; struct siginfo sinfo ; struct list_head const *__mptr ; int tmp ; { goto ldv_35046; ldv_35045: __mptr = (struct list_head const *)udev->filelist.next; ps = (struct dev_state *)__mptr; destroy_all_async(ps); __wake_up(& ps->wait, 3U, 0, 0); list_del_init(& ps->list); if (ps->discsignr != 0U) { sinfo.si_signo = (int )ps->discsignr; sinfo.si_errno = 32; sinfo.si_code = -4; sinfo._sifields._sigfault._addr = ps->disccontext; kill_pid_info_as_cred((int )ps->discsignr, & sinfo, ps->disc_pid, ps->cred, ps->secid); } else { } ldv_35046: tmp = list_empty((struct list_head const *)(& udev->filelist)); if (tmp == 0) { goto ldv_35045; } else { } return; } } static int usbdev_notify(struct notifier_block *self , unsigned long action , void *dev ) { { switch (action) { case 1UL: ; goto ldv_35054; case 2UL: usbdev_remove((struct usb_device *)dev); goto ldv_35054; } ldv_35054: ; return (1); } } static struct notifier_block usbdev_nb = {& usbdev_notify, 0, 0}; static struct cdev usb_device_cdev ; int usb_devio_init(void) { int retval ; { retval = register_chrdev_region(198180864U, 8192U, "usb_device"); if (retval != 0) { printk("\vUnable to register minors for usb_device\n"); goto out; } else { } cdev_init(& usb_device_cdev, & usbdev_file_operations); retval = cdev_add(& usb_device_cdev, 198180864U, 8192U); if (retval != 0) { printk("\vUnable to get usb_device major %d\n", 189); goto error_cdev; } else { } usb_register_notify(& usbdev_nb); out: ; return (retval); error_cdev: unregister_chrdev_region(198180864U, 8192U); goto out; } } void usb_devio_cleanup(void) { { usb_unregister_notify(& usbdev_nb); cdev_del(& usb_device_cdev); unregister_chrdev_region(198180864U, 8192U); return; } } void ldv_main11_sequence_infinite_withcheck_stateful(void) { struct usb_interface *var_group1 ; struct usb_device_id const *var_driver_probe_18_p1 ; int res_driver_probe_18 ; pm_message_t var_driver_suspend_20_p1 ; struct file *var_group2 ; loff_t var_usbdev_lseek_3_p1 ; int var_usbdev_lseek_3_p2 ; char *var_usbdev_read_4_p1 ; size_t var_usbdev_read_4_p2 ; loff_t *var_usbdev_read_4_p3 ; ssize_t res_usbdev_read_4 ; struct poll_table_struct *var_group3 ; unsigned int var_usbdev_ioctl_66_p1 ; unsigned long var_usbdev_ioctl_66_p2 ; unsigned int var_usbdev_compat_ioctl_67_p1 ; unsigned long var_usbdev_compat_ioctl_67_p2 ; struct inode *var_group4 ; int res_usbdev_open_29 ; struct notifier_block *var_group5 ; unsigned long var_usbdev_notify_70_p1 ; void *var_usbdev_notify_70_p2 ; int ldv_s_usbfs_driver_usb_driver ; int ldv_s_usbdev_file_operations_file_operations ; int tmp ; int tmp___0 ; { ldv_s_usbfs_driver_usb_driver = 0; ldv_s_usbdev_file_operations_file_operations = 0; LDV_IN_INTERRUPT = 1; ldv_initialize(); goto ldv_35122; ldv_35121: tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_s_usbfs_driver_usb_driver == 0) { res_driver_probe_18 = driver_probe(var_group1, var_driver_probe_18_p1); ldv_check_return_value(res_driver_probe_18); ldv_check_return_value_probe(res_driver_probe_18); if (res_driver_probe_18 != 0) { goto ldv_module_exit; } else { } ldv_s_usbfs_driver_usb_driver = ldv_s_usbfs_driver_usb_driver + 1; } else { } goto ldv_35108; case 1: ; if (ldv_s_usbfs_driver_usb_driver == 1) { ldv_handler_precall(); driver_suspend(var_group1, var_driver_suspend_20_p1); ldv_s_usbfs_driver_usb_driver = ldv_s_usbfs_driver_usb_driver + 1; } else { } goto ldv_35108; case 2: ; if (ldv_s_usbfs_driver_usb_driver == 2) { ldv_handler_precall(); driver_resume(var_group1); ldv_s_usbfs_driver_usb_driver = ldv_s_usbfs_driver_usb_driver + 1; } else { } goto ldv_35108; case 3: ; if (ldv_s_usbfs_driver_usb_driver == 3) { ldv_handler_precall(); driver_disconnect(var_group1); ldv_s_usbfs_driver_usb_driver = 0; } else { } goto ldv_35108; case 4: ; if (ldv_s_usbdev_file_operations_file_operations == 0) { ldv_handler_precall(); res_usbdev_open_29 = usbdev_open(var_group4, var_group2); ldv_check_return_value(res_usbdev_open_29); if (res_usbdev_open_29 != 0) { goto ldv_module_exit; } else { } ldv_s_usbdev_file_operations_file_operations = ldv_s_usbdev_file_operations_file_operations + 1; } else { } goto ldv_35108; case 5: ; if (ldv_s_usbdev_file_operations_file_operations == 1) { ldv_handler_precall(); res_usbdev_read_4 = usbdev_read(var_group2, var_usbdev_read_4_p1, var_usbdev_read_4_p2, var_usbdev_read_4_p3); ldv_check_return_value((int )res_usbdev_read_4); if (res_usbdev_read_4 < 0L) { goto ldv_module_exit; } else { } ldv_s_usbdev_file_operations_file_operations = ldv_s_usbdev_file_operations_file_operations + 1; } else { } goto ldv_35108; case 6: ; if (ldv_s_usbdev_file_operations_file_operations == 2) { ldv_handler_precall(); usbdev_lseek(var_group2, var_usbdev_lseek_3_p1, var_usbdev_lseek_3_p2); ldv_s_usbdev_file_operations_file_operations = ldv_s_usbdev_file_operations_file_operations + 1; } else { } goto ldv_35108; case 7: ; if (ldv_s_usbdev_file_operations_file_operations == 3) { ldv_handler_precall(); usbdev_release(var_group4, var_group2); ldv_s_usbdev_file_operations_file_operations = 0; } else { } goto ldv_35108; case 8: ldv_handler_precall(); usbdev_poll(var_group2, var_group3); goto ldv_35108; case 9: ldv_handler_precall(); usbdev_ioctl(var_group2, var_usbdev_ioctl_66_p1, var_usbdev_ioctl_66_p2); goto ldv_35108; case 10: ldv_handler_precall(); usbdev_compat_ioctl(var_group2, var_usbdev_compat_ioctl_67_p1, var_usbdev_compat_ioctl_67_p2); goto ldv_35108; case 11: ldv_handler_precall(); usbdev_notify(var_group5, var_usbdev_notify_70_p1, var_usbdev_notify_70_p2); goto ldv_35108; default: ; goto ldv_35108; } ldv_35108: ; ldv_35122: tmp___0 = __VERIFIER_nondet_int(); if ((tmp___0 != 0 || ldv_s_usbfs_driver_usb_driver != 0) || ldv_s_usbdev_file_operations_file_operations != 0) { goto ldv_35121; } else { } ldv_module_exit: ; ldv_check_final_state(); return; } } void ldv_mutex_lock_327(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mtx(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_328(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mtx(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_329(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mtx(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_330(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mtx(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_331(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_332(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_333(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_334(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___6 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_335(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_336(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_337(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_338(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_i_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_339(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_i_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_340(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_usbfs_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_341(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_usbfs_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } int ldv_mutex_trylock_360(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_358(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_361(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_363(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_365(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_367(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_369(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_357(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_359(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_362(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_364(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_366(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_368(struct mutex *ldv_func_arg1 ) ; extern int blocking_notifier_chain_register(struct blocking_notifier_head * , struct notifier_block * ) ; extern int blocking_notifier_chain_unregister(struct blocking_notifier_head * , struct notifier_block * ) ; extern int blocking_notifier_call_chain(struct blocking_notifier_head * , unsigned long , void * ) ; void usb_notify_add_device(struct usb_device *udev ) ; void usb_notify_remove_device(struct usb_device *udev ) ; static struct blocking_notifier_head usb_notifier_list = {{0L, {{{0U}}, 3735899821U, 4294967295U, 0xffffffffffffffffUL, {0, {0, 0}, "(usb_notifier_list).rwsem.wait_lock", 0, 0UL}}, {& usb_notifier_list.rwsem.wait_list, & usb_notifier_list.rwsem.wait_list}, {0, {0, 0}, "(usb_notifier_list).rwsem", 0, 0UL}}, 0}; void usb_register_notify(struct notifier_block *nb ) { { blocking_notifier_chain_register(& usb_notifier_list, nb); return; } } void usb_unregister_notify(struct notifier_block *nb ) { { blocking_notifier_chain_unregister(& usb_notifier_list, nb); return; } } void usb_notify_add_device(struct usb_device *udev ) { { blocking_notifier_call_chain(& usb_notifier_list, 1UL, (void *)udev); return; } } void usb_notify_remove_device(struct usb_device *udev ) { { ldv_mutex_lock_368(& usbfs_mutex); blocking_notifier_call_chain(& usb_notifier_list, 2UL, (void *)udev); ldv_mutex_unlock_369(& usbfs_mutex); return; } } void usb_notify_add_bus(struct usb_bus *ubus ) { { blocking_notifier_call_chain(& usb_notifier_list, 3UL, (void *)ubus); return; } } void usb_notify_remove_bus(struct usb_bus *ubus ) { { blocking_notifier_call_chain(& usb_notifier_list, 4UL, (void *)ubus); return; } } void ldv_mutex_lock_357(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_358(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_359(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_360(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___2 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_361(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_362(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mtx(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_363(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mtx(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_364(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mtx(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_365(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mtx(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_366(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_367(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_368(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_usbfs_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_369(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_usbfs_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } int ldv_mutex_trylock_386(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_384(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_387(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_389(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_391(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_393(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_383(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_385(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_388(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_390(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_392(struct mutex *ldv_func_arg1 ) ; static int is_rndis(struct usb_interface_descriptor *desc ) { { return (((unsigned int )desc->bInterfaceClass == 2U && (unsigned int )desc->bInterfaceSubClass == 2U) && (unsigned int )desc->bInterfaceProtocol == 255U); } } static int is_activesync(struct usb_interface_descriptor *desc ) { { return (((unsigned int )desc->bInterfaceClass == 239U && (unsigned int )desc->bInterfaceSubClass == 1U) && (unsigned int )desc->bInterfaceProtocol == 1U); } } int usb_choose_configuration(struct usb_device *udev ) { int i ; int num_configs ; int insufficient_power ; struct usb_host_config *c ; struct usb_host_config *best ; struct usb_interface_descriptor *desc ; int tmp ; int tmp___0 ; char const *tmp___1 ; struct _ddebug descriptor ; char const *tmp___2 ; long tmp___3 ; char const *tmp___4 ; { insufficient_power = 0; best = 0; c = udev->config; num_configs = (int )udev->descriptor.bNumConfigurations; i = 0; goto ldv_27675; ldv_27674: desc = 0; if ((unsigned int )c->desc.bNumInterfaces != 0U) { desc = & ((struct usb_host_interface *)(& (c->intf_cache[0])->altsetting))->desc; } else { } if ((int )c->desc.bMaxPower * 2 > (int )udev->bus_mA) { insufficient_power = insufficient_power + 1; goto ldv_27672; } else { } if ((i == 0 && num_configs > 1) && (unsigned long )desc != (unsigned long )((struct usb_interface_descriptor *)0)) { tmp = is_rndis(desc); if (tmp != 0) { best = c; } else { tmp___0 = is_activesync(desc); if (tmp___0 != 0) { best = c; } else { goto _L; } } } else _L: /* CIL Label */ if ((unsigned int )udev->descriptor.bDeviceClass != 255U && ((unsigned long )desc != (unsigned long )((struct usb_interface_descriptor *)0) && (unsigned int )desc->bInterfaceClass != 255U)) { best = c; goto ldv_27673; } else if ((unsigned long )best == (unsigned long )((struct usb_host_config *)0)) { best = c; } else { } ldv_27672: i = i + 1; c = c + 1; ldv_27675: ; if (i < num_configs) { goto ldv_27674; } else { } ldv_27673: ; if (insufficient_power > 0) { tmp___1 = plural(insufficient_power); _dev_info((struct device const *)(& udev->dev), "rejected %d configuration%s due to insufficient available bus power\n", insufficient_power, tmp___1); } else { } if ((unsigned long )best != (unsigned long )((struct usb_host_config *)0)) { i = (int )best->desc.bConfigurationValue; descriptor.modname = "usbcore"; descriptor.function = "usb_choose_configuration"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/generic.c.prepared"; descriptor.format = "configuration #%d chosen from %d choice%s\n"; descriptor.lineno = 242U; descriptor.flags = 1U; tmp___3 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___3 != 0L) { tmp___2 = plural(num_configs); __dynamic_dev_dbg(& descriptor, (struct device const *)(& udev->dev), "configuration #%d chosen from %d choice%s\n", i, num_configs, tmp___2); } else { } } else { i = -1; tmp___4 = plural(num_configs); dev_warn((struct device const *)(& udev->dev), "no configuration chosen from %d choice%s\n", num_configs, tmp___4); } return (i); } } static int generic_probe(struct usb_device *udev ) { int err ; int c ; bool tmp ; { tmp = usb_device_is_owned(udev); if ((int )tmp) { } else if ((unsigned int )*((unsigned char *)udev + 1596UL) == 0U) { dev_err((struct device const *)(& udev->dev), "Device is not authorized for usage\n"); } else { c = usb_choose_configuration(udev); if (c >= 0) { err = usb_set_configuration(udev, c); if (err != 0) { dev_err((struct device const *)(& udev->dev), "can\'t set config #%d, error %d\n", c, err); } else { } } else { } } usb_notify_add_device(udev); return (0); } } static void generic_disconnect(struct usb_device *udev ) { { usb_notify_remove_device(udev); if ((unsigned long )udev->actconfig != (unsigned long )((struct usb_host_config *)0)) { usb_set_configuration(udev, -1); } else { } return; } } static int generic_suspend(struct usb_device *udev , pm_message_t msg ) { int rc ; { if ((unsigned long )udev->parent == (unsigned long )((struct usb_device *)0)) { rc = hcd_bus_suspend(udev, msg); } else if (msg.event == 1 || msg.event == 8) { rc = 0; } else { rc = usb_port_suspend(udev, msg); } return (rc); } } static int generic_resume(struct usb_device *udev , pm_message_t msg ) { int rc ; { if ((unsigned long )udev->parent == (unsigned long )((struct usb_device *)0)) { rc = hcd_bus_resume(udev, msg); } else { rc = usb_port_resume(udev, msg); } return (rc); } } struct usb_device_driver usb_generic_driver = {"usb", & generic_probe, & generic_disconnect, & generic_suspend, & generic_resume, {{0, 0, 0, 0, (_Bool)0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 0}, 1U}; void ldv_main13_sequence_infinite_withcheck_stateful(void) { struct usb_device *var_group1 ; int res_generic_probe_4 ; pm_message_t var_generic_suspend_6_p1 ; pm_message_t var_generic_resume_7_p1 ; int ldv_s_usb_generic_driver_usb_device_driver ; int tmp ; int tmp___0 ; { ldv_s_usb_generic_driver_usb_device_driver = 0; LDV_IN_INTERRUPT = 1; ldv_initialize(); goto ldv_27726; ldv_27725: tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_s_usb_generic_driver_usb_device_driver == 0) { res_generic_probe_4 = generic_probe(var_group1); ldv_check_return_value(res_generic_probe_4); ldv_check_return_value_probe(res_generic_probe_4); if (res_generic_probe_4 != 0) { goto ldv_module_exit; } else { } ldv_s_usb_generic_driver_usb_device_driver = ldv_s_usb_generic_driver_usb_device_driver + 1; } else { } goto ldv_27720; case 1: ; if (ldv_s_usb_generic_driver_usb_device_driver == 1) { ldv_handler_precall(); generic_disconnect(var_group1); ldv_s_usb_generic_driver_usb_device_driver = 0; } else { } goto ldv_27720; case 2: ldv_handler_precall(); generic_suspend(var_group1, var_generic_suspend_6_p1); goto ldv_27720; case 3: ldv_handler_precall(); generic_resume(var_group1, var_generic_resume_7_p1); goto ldv_27720; default: ; goto ldv_27720; } ldv_27720: ; ldv_27726: tmp___0 = __VERIFIER_nondet_int(); if (tmp___0 != 0 || ldv_s_usb_generic_driver_usb_device_driver != 0) { goto ldv_27725; } else { } ldv_module_exit: ; ldv_check_final_state(); return; } } void ldv_mutex_lock_383(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_384(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_385(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_386(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___2 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_387(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_388(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mtx(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_389(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mtx(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_390(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mtx(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_391(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mtx(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_392(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_393(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } int ldv_mutex_trylock_408(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_406(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_409(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_411(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_413(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_415(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_405(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_407(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_410(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_412(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_414(struct mutex *ldv_func_arg1 ) ; static struct usb_device_id const usb_quirk_list[32U] = { {3U, 516U, 24613U, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 2UL}, {3U, 1008U, 1793U, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 1UL}, {3U, 1054U, 12320U, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 2UL}, {3U, 1118U, 1904U, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 2UL}, {3U, 1133U, 2241U, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 2UL}, {3U, 1133U, 2242U, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 2UL}, {3U, 1133U, 2243U, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 2UL}, {3U, 1133U, 2245U, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 2UL}, {3U, 1133U, 2246U, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 2UL}, {3U, 1133U, 2247U, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 2UL}, {3U, 1133U, 49442U, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 64UL}, {3U, 1137U, 341U, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 2UL}, {3U, 1204U, 1318U, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 8UL}, {3U, 1240U, 12U, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 8UL}, {3U, 1256U, 26113U, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 8UL}, {3U, 1410U, 7U, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 2UL}, {3U, 1410U, 39U, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 2UL}, {3U, 1452U, 538U, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 2UL}, {3U, 1592U, 2579U, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 1UL}, {3U, 1699U, 6U, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 8UL}, {3U, 1784U, 2052U, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 2UL}, {3U, 1784U, 12293U, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 2UL}, {3U, 1891U, 402U, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 2UL}, {3U, 2284U, 4096U, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 2UL}, {3U, 2342U, 13107U, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 8UL}, {3U, 2417U, 8192U, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 4UL}, {3U, 2652U, 8225U, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 2UL}, {3U, 4310U, 8704U, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 1UL}, {3U, 5398U, 34344U, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 2UL}, {3U, 6408U, 4885U, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 32UL}, {3U, 32902U, 61861U, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 2UL}}; static struct usb_device_id const usb_interface_quirk_list[2U] = { {897U, 1133U, (unsigned short)0, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 14U, 1U, 0U, (unsigned char)0, 2UL}}; static bool usb_match_any_interface(struct usb_device *udev , struct usb_device_id const *id ) { unsigned int i ; struct usb_host_config *cfg ; unsigned int j ; struct usb_interface_cache *cache ; struct usb_host_interface *intf ; int tmp ; { i = 0U; goto ldv_27276; ldv_27275: cfg = udev->config + (unsigned long )i; j = 0U; goto ldv_27273; ldv_27272: cache = cfg->intf_cache[j]; if (cache->num_altsetting == 0U) { goto ldv_27271; } else { } intf = (struct usb_host_interface *)(& cache->altsetting); tmp = usb_match_one_id_intf(udev, intf, id); if (tmp != 0) { return (1); } else { } ldv_27271: j = j + 1U; ldv_27273: ; if ((unsigned int )cfg->desc.bNumInterfaces > j) { goto ldv_27272; } else { } i = i + 1U; ldv_27276: ; if ((unsigned int )udev->descriptor.bNumConfigurations > i) { goto ldv_27275; } else { } return (0); } } static u32 __usb_detect_quirks(struct usb_device *udev , struct usb_device_id const *id ) { u32 quirks ; int tmp ; bool tmp___0 ; int tmp___1 ; { quirks = 0U; goto ldv_27285; ldv_27284: tmp = usb_match_device(udev, id); if (tmp == 0) { goto ldv_27283; } else { } if (((int )id->match_flags & 896) != 0) { tmp___0 = usb_match_any_interface(udev, id); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { goto ldv_27283; } else { } } else { } quirks = (u32 )id->driver_info | quirks; ldv_27283: id = id + 1; ldv_27285: ; if ((unsigned int )((unsigned short )id->match_flags) != 0U) { goto ldv_27284; } else { } return (quirks); } } void usb_detect_quirks(struct usb_device *udev ) { struct _ddebug descriptor ; long tmp ; { udev->quirks = __usb_detect_quirks(udev, (struct usb_device_id const *)(& usb_quirk_list)); if (udev->quirks != 0U) { descriptor.modname = "usbcore"; descriptor.function = "usb_detect_quirks"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/quirks.c.prepared"; descriptor.format = "USB quirks for this device: %x\n"; descriptor.lineno = 297U; descriptor.flags = 1U; tmp = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)(& udev->dev), "USB quirks for this device: %x\n", udev->quirks); } else { } } else { } if ((udev->quirks & 16U) == 0U) { udev->persist_enabled = 1U; } else { } return; } } void usb_detect_interface_quirks(struct usb_device *udev ) { u32 quirks ; struct _ddebug descriptor ; long tmp ; { quirks = __usb_detect_quirks(udev, (struct usb_device_id const *)(& usb_interface_quirk_list)); if (quirks == 0U) { return; } else { } descriptor.modname = "usbcore"; descriptor.function = "usb_detect_interface_quirks"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/quirks.c.prepared"; descriptor.format = "USB interface quirks for this device: %x\n"; descriptor.lineno = 324U; descriptor.flags = 1U; tmp = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)(& udev->dev), "USB interface quirks for this device: %x\n", quirks); } else { } udev->quirks = udev->quirks | quirks; return; } } void ldv_mutex_lock_405(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_406(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_407(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_408(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___2 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_409(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_410(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mtx(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_411(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mtx(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_412(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mtx(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_413(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mtx(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_414(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_415(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } int ldv_mutex_trylock_434(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_428(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_430(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_432(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_435(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_437(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_439(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_440(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_442(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_427(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_429(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_431(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_433(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_436(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_438(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_441(struct mutex *ldv_func_arg1 ) ; __inline static struct thread_info *current_thread_info___0(void) { struct thread_info *ti ; unsigned long pfo_ret__ ; { switch (8UL) { case 1UL: __asm__ ("movb %%gs:%P1,%0": "=q" (pfo_ret__): "p" (& kernel_stack)); goto ldv_6325; case 2UL: __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_6325; case 4UL: __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_6325; case 8UL: __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_6325; default: __bad_percpu_size(); } ldv_6325: ti = (struct thread_info *)(pfo_ret__ - 8152UL); return (ti); } } __inline static void device_lock___5(struct device *dev ) { { ldv_mutex_lock_433(& dev->mutex); return; } } __inline static void device_unlock___5(struct device *dev ) { { ldv_mutex_unlock_435(& dev->mutex); return; } } void usbfs_conn_disc_event(void) ; static char const format_topo[85U] = { '\n', 'T', ':', ' ', ' ', 'B', 'u', 's', '=', '%', '2', '.', '2', 'd', ' ', 'L', 'e', 'v', '=', '%', '2', '.', '2', 'd', ' ', 'P', 'r', 'n', 't', '=', '%', '2', '.', '2', 'd', ' ', 'P', 'o', 'r', 't', '=', '%', '2', '.', '2', 'd', ' ', 'C', 'n', 't', '=', '%', '2', '.', '2', 'd', ' ', 'D', 'e', 'v', '#', '=', '%', '3', 'd', ' ', 'S', 'p', 'd', '=', '%', '-', '4', 's', ' ', 'M', 'x', 'C', 'h', '=', '%', '2', 'd', '\n', '\000'}; static char const format_string_manufacturer[25U] = { 'S', ':', ' ', ' ', 'M', 'a', 'n', 'u', 'f', 'a', 'c', 't', 'u', 'r', 'e', 'r', '=', '%', '.', '1', '0', '0', 's', '\n', '\000'}; static char const format_string_product[20U] = { 'S', ':', ' ', ' ', 'P', 'r', 'o', 'd', 'u', 'c', 't', '=', '%', '.', '1', '0', '0', 's', '\n', '\000'}; static char const format_string_serialnumber[25U] = { 'S', ':', ' ', ' ', 'S', 'e', 'r', 'i', 'a', 'l', 'N', 'u', 'm', 'b', 'e', 'r', '=', '%', '.', '1', '0', '0', 's', '\n', '\000'}; static char const format_bandwidth[50U] = { 'B', ':', ' ', ' ', 'A', 'l', 'l', 'o', 'c', '=', '%', '3', 'd', '/', '%', '3', 'd', ' ', 'u', 's', ' ', '(', '%', '2', 'd', '%', '%', ')', ',', ' ', '#', 'I', 'n', 't', '=', '%', '3', 'd', ',', ' ', '#', 'I', 's', 'o', '=', '%', '3', 'd', '\n', '\000'}; static char const format_device1[71U] = { 'D', ':', ' ', ' ', 'V', 'e', 'r', '=', '%', '2', 'x', '.', '%', '0', '2', 'x', ' ', 'C', 'l', 's', '=', '%', '0', '2', 'x', '(', '%', '-', '5', 's', ')', ' ', 'S', 'u', 'b', '=', '%', '0', '2', 'x', ' ', 'P', 'r', 'o', 't', '=', '%', '0', '2', 'x', ' ', 'M', 'x', 'P', 'S', '=', '%', '2', 'd', ' ', '#', 'C', 'f', 'g', 's', '=', '%', '3', 'd', '\n', '\000'}; static char const format_device2[42U] = { 'P', ':', ' ', ' ', 'V', 'e', 'n', 'd', 'o', 'r', '=', '%', '0', '4', 'x', ' ', 'P', 'r', 'o', 'd', 'I', 'D', '=', '%', '0', '4', 'x', ' ', 'R', 'e', 'v', '=', '%', '2', 'x', '.', '%', '0', '2', 'x', '\n', '\000'}; static char const format_config[45U] = { 'C', ':', '%', 'c', ' ', '#', 'I', 'f', 's', '=', '%', '2', 'd', ' ', 'C', 'f', 'g', '#', '=', '%', '2', 'd', ' ', 'A', 't', 'r', '=', '%', '0', '2', 'x', ' ', 'M', 'x', 'P', 'w', 'r', '=', '%', '3', 'd', 'm', 'A', '\n', '\000'}; static char const format_iad[64U] = { 'A', ':', ' ', ' ', 'F', 'i', 'r', 's', 't', 'I', 'f', '#', '=', '%', '2', 'd', ' ', 'I', 'f', 'C', 'o', 'u', 'n', 't', '=', '%', '2', 'd', ' ', 'C', 'l', 's', '=', '%', '0', '2', 'x', '(', '%', '-', '5', 's', ')', ' ', 'S', 'u', 'b', '=', '%', '0', '2', 'x', ' ', 'P', 'r', 'o', 't', '=', '%', '0', '2', 'x', '\n', '\000'}; static char const format_iface[75U] = { 'I', ':', '%', 'c', ' ', 'I', 'f', '#', '=', '%', '2', 'd', ' ', 'A', 'l', 't', '=', '%', '2', 'd', ' ', '#', 'E', 'P', 's', '=', '%', '2', 'd', ' ', 'C', 'l', 's', '=', '%', '0', '2', 'x', '(', '%', '-', '5', 's', ')', ' ', 'S', 'u', 'b', '=', '%', '0', '2', 'x', ' ', 'P', 'r', 'o', 't', '=', '%', '0', '2', 'x', ' ', 'D', 'r', 'i', 'v', 'e', 'r', '=', '%', 's', '\n', '\000'}; static char const format_endpt[51U] = { 'E', ':', ' ', ' ', 'A', 'd', '=', '%', '0', '2', 'x', '(', '%', 'c', ')', ' ', 'A', 't', 'r', '=', '%', '0', '2', 'x', '(', '%', '-', '4', 's', ')', ' ', 'M', 'x', 'P', 'S', '=', '%', '4', 'd', ' ', 'I', 'v', 'l', '=', '%', 'd', '%', 'c', 's', '\n', '\000'}; static struct device_connect_event device_event = {{1}, {{{{{{0U}}, 3735899821U, 4294967295U, 0xffffffffffffffffUL, {0, {0, 0}, "device_event.wait.lock", 0, 0UL}}}}, {& device_event.wait.task_list, & device_event.wait.task_list}}}; static struct class_info const clas_info[18U] = { {0, (char *)">ifc"}, {1, (char *)"audio"}, {2, (char *)"comm."}, {3, (char *)"HID"}, {5, (char *)"PID"}, {6, (char *)"still"}, {7, (char *)"print"}, {8, (char *)"stor."}, {9, (char *)"hub"}, {10, (char *)"data"}, {11, (char *)"scard"}, {13, (char *)"c-sec"}, {14, (char *)"video"}, {224, (char *)"wlcon"}, {239, (char *)"misc"}, {254, (char *)"app."}, {255, (char *)"vend."}, {-1, (char *)"unk."}}; void usbfs_conn_disc_event(void) { { atomic_add(2, & device_event.count); __wake_up(& device_event.wait, 3U, 1, 0); return; } } static char const *class_decode(int const class ) { int ix ; { ix = 0; goto ldv_31536; ldv_31535: ; if ((int )clas_info[ix].class == (int )class) { goto ldv_31534; } else { } ix = ix + 1; ldv_31536: ; if ((int )clas_info[ix].class != -1) { goto ldv_31535; } else { } ldv_31534: ; return ((char const *)clas_info[ix].class_name); } } static char *usb_dump_endpoint_descriptor(int speed , char *start , char *end , struct usb_endpoint_descriptor const *desc ) { char dir ; char unit ; char *type ; unsigned int interval ; unsigned int bandwidth ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; { bandwidth = 1U; if ((unsigned long )start > (unsigned long )end) { return (start); } else { } tmp = usb_endpoint_dir_in(desc); dir = tmp != 0 ? 73 : 79; if (speed == 3) { tmp___0 = usb_endpoint_maxp(desc); switch (tmp___0 & 6144) { case 2048: bandwidth = 2U; goto ldv_31549; case 4096: bandwidth = 3U; goto ldv_31549; } ldv_31549: ; } else { } tmp___1 = usb_endpoint_type(desc); switch (tmp___1) { case 0: type = (char *)"Ctrl"; if (speed == 3) { interval = (unsigned int )desc->bInterval; } else { interval = 0U; } dir = 66; goto ldv_31552; case 1: type = (char *)"Isoc"; interval = (unsigned int )(1 << ((int )desc->bInterval + -1)); goto ldv_31552; case 2: type = (char *)"Bulk"; if (speed == 3 && (int )((signed char )dir) == 79) { interval = (unsigned int )desc->bInterval; } else { interval = 0U; } goto ldv_31552; case 3: type = (char *)"Int."; if (speed == 3 || speed == 5) { interval = (unsigned int )(1 << ((int )desc->bInterval + -1)); } else { interval = (unsigned int )desc->bInterval; } goto ldv_31552; default: ; return (start); } ldv_31552: interval = (speed == 3 || speed == 5 ? 125U : 1000U) * interval; if (interval % 1000U != 0U) { unit = 117; } else { unit = 109; interval = interval / 1000U; } tmp___2 = usb_endpoint_maxp(desc); tmp___3 = sprintf(start, (char const *)(& format_endpt), (int )desc->bEndpointAddress, (int )dir, (int )desc->bmAttributes, type, ((unsigned int )tmp___2 & 2047U) * bandwidth, interval, (int )unit); start = start + (unsigned long )tmp___3; return (start); } } static char *usb_dump_interface_descriptor(char *start , char *end , struct usb_interface_cache const *intfc , struct usb_interface const *iface , int setno ) { struct usb_interface_descriptor const *desc ; char const *driver_name ; int active ; char const *tmp ; int tmp___0 ; { driver_name = ""; active = 0; if ((unsigned long )start > (unsigned long )end) { return (start); } else { } desc = & intfc->altsetting[setno].desc; if ((unsigned long )iface != (unsigned long )((struct usb_interface const *)0)) { driver_name = (unsigned long )iface->dev.driver != (unsigned long )((struct device_driver */* const */)0) ? (iface->dev.driver)->name : "(none)"; active = (unsigned long )((struct usb_interface_descriptor const *)(& (iface->cur_altsetting)->desc)) == (unsigned long )desc; } else { } tmp = class_decode((int const )desc->bInterfaceClass); tmp___0 = sprintf(start, (char const *)(& format_iface), active != 0 ? 42 : 32, (int )desc->bInterfaceNumber, (int )desc->bAlternateSetting, (int )desc->bNumEndpoints, (int )desc->bInterfaceClass, tmp, (int )desc->bInterfaceSubClass, (int )desc->bInterfaceProtocol, driver_name); start = start + (unsigned long )tmp___0; return (start); } } static char *usb_dump_interface(int speed , char *start , char *end , struct usb_interface_cache const *intfc , struct usb_interface const *iface , int setno ) { struct usb_host_interface const *desc ; int i ; { desc = (struct usb_host_interface const *)(& intfc->altsetting) + (unsigned long )setno; start = usb_dump_interface_descriptor(start, end, intfc, iface, setno); i = 0; goto ldv_31578; ldv_31577: ; if ((unsigned long )start > (unsigned long )end) { return (start); } else { } start = usb_dump_endpoint_descriptor(speed, start, end, (struct usb_endpoint_descriptor const *)(& (desc->endpoint + (unsigned long )i)->desc)); i = i + 1; ldv_31578: ; if ((int )desc->desc.bNumEndpoints > i) { goto ldv_31577; } else { } return (start); } } static char *usb_dump_iad_descriptor(char *start , char *end , struct usb_interface_assoc_descriptor const *iad ) { char const *tmp ; int tmp___0 ; { if ((unsigned long )start > (unsigned long )end) { return (start); } else { } tmp = class_decode((int const )iad->bFunctionClass); tmp___0 = sprintf(start, (char const *)(& format_iad), (int )iad->bFirstInterface, (int )iad->bInterfaceCount, (int )iad->bFunctionClass, tmp, (int )iad->bFunctionSubClass, (int )iad->bFunctionProtocol); start = start + (unsigned long )tmp___0; return (start); } } static char *usb_dump_config_descriptor(char *start , char *end , struct usb_config_descriptor const *desc , int active ) { int tmp ; { if ((unsigned long )start > (unsigned long )end) { return (start); } else { } tmp = sprintf(start, (char const *)(& format_config), active != 0 ? 42 : 32, (int )desc->bNumInterfaces, (int )desc->bConfigurationValue, (int )desc->bmAttributes, (int )desc->bMaxPower * 2); start = start + (unsigned long )tmp; return (start); } } static char *usb_dump_config(int speed , char *start , char *end , struct usb_host_config const *config , int active ) { int i ; int j ; struct usb_interface_cache *intfc ; struct usb_interface *interface ; int tmp ; { if ((unsigned long )start > (unsigned long )end) { return (start); } else { } if ((unsigned long )config == (unsigned long )((struct usb_host_config const *)0)) { tmp = sprintf(start, "(null Cfg. desc.)\n"); return (start + (unsigned long )tmp); } else { } start = usb_dump_config_descriptor(start, end, & config->desc, active); i = 0; goto ldv_31604; ldv_31603: ; if ((unsigned long )config->intf_assoc[i] == (unsigned long )((struct usb_interface_assoc_descriptor *)0)) { goto ldv_31602; } else { } start = usb_dump_iad_descriptor(start, end, (struct usb_interface_assoc_descriptor const *)config->intf_assoc[i]); i = i + 1; ldv_31604: ; if (i <= 15) { goto ldv_31603; } else { } ldv_31602: i = 0; goto ldv_31609; ldv_31608: intfc = config->intf_cache[i]; interface = config->interface[i]; j = 0; goto ldv_31606; ldv_31605: ; if ((unsigned long )start > (unsigned long )end) { return (start); } else { } start = usb_dump_interface(speed, start, end, (struct usb_interface_cache const *)intfc, (struct usb_interface const *)interface, j); j = j + 1; ldv_31606: ; if ((unsigned int )j < intfc->num_altsetting) { goto ldv_31605; } else { } i = i + 1; ldv_31609: ; if ((int )config->desc.bNumInterfaces > i) { goto ldv_31608; } else { } return (start); } } static char *usb_dump_device_descriptor(char *start , char *end , struct usb_device_descriptor const *desc ) { u16 bcdUSB ; u16 bcdDevice ; char const *tmp ; int tmp___0 ; int tmp___1 ; { bcdUSB = desc->bcdUSB; bcdDevice = desc->bcdDevice; if ((unsigned long )start > (unsigned long )end) { return (start); } else { } tmp = class_decode((int const )desc->bDeviceClass); tmp___0 = sprintf(start, (char const *)(& format_device1), (int )bcdUSB >> 8, (int )bcdUSB & 255, (int )desc->bDeviceClass, tmp, (int )desc->bDeviceSubClass, (int )desc->bDeviceProtocol, (int )desc->bMaxPacketSize0, (int )desc->bNumConfigurations); start = start + (unsigned long )tmp___0; if ((unsigned long )start > (unsigned long )end) { return (start); } else { } tmp___1 = sprintf(start, (char const *)(& format_device2), (int )desc->idVendor, (int )desc->idProduct, (int )bcdDevice >> 8, (int )bcdDevice & 255); start = start + (unsigned long )tmp___1; return (start); } } static char *usb_dump_device_strings(char *start , char *end , struct usb_device *dev ) { int tmp ; int tmp___0 ; int tmp___1 ; { if ((unsigned long )start > (unsigned long )end) { return (start); } else { } if ((unsigned long )dev->manufacturer != (unsigned long )((char *)0)) { tmp = sprintf(start, (char const *)(& format_string_manufacturer), dev->manufacturer); start = start + (unsigned long )tmp; } else { } if ((unsigned long )start > (unsigned long )end) { goto out; } else { } if ((unsigned long )dev->product != (unsigned long )((char *)0)) { tmp___0 = sprintf(start, (char const *)(& format_string_product), dev->product); start = start + (unsigned long )tmp___0; } else { } if ((unsigned long )start > (unsigned long )end) { goto out; } else { } if ((unsigned long )dev->serial != (unsigned long )((char *)0)) { tmp___1 = sprintf(start, (char const *)(& format_string_serialnumber), dev->serial); start = start + (unsigned long )tmp___1; } else { } out: ; return (start); } } static char *usb_dump_desc(char *start , char *end , struct usb_device *dev ) { int i ; { if ((unsigned long )start > (unsigned long )end) { return (start); } else { } start = usb_dump_device_descriptor(start, end, (struct usb_device_descriptor const *)(& dev->descriptor)); if ((unsigned long )start > (unsigned long )end) { return (start); } else { } start = usb_dump_device_strings(start, end, dev); i = 0; goto ldv_31631; ldv_31630: ; if ((unsigned long )start > (unsigned long )end) { return (start); } else { } start = usb_dump_config((int )dev->speed, start, end, (struct usb_host_config const *)dev->config + (unsigned long )i, (unsigned long )(dev->config + (unsigned long )i) == (unsigned long )dev->actconfig); i = i + 1; ldv_31631: ; if ((int )dev->descriptor.bNumConfigurations > i) { goto ldv_31630; } else { } return (start); } } static ssize_t usb_device_dump(char **buffer , size_t *nbytes , loff_t *skip_bytes , loff_t *file_offset , struct usb_device *usbdev , struct usb_bus *bus , int level , int index , int count ) { int chix ; int ret ; int cnt ; int parent_devnum ; char *pages_start ; char *data_end ; char *speed ; unsigned int length ; ssize_t total_written ; struct usb_device *childdev ; unsigned long tmp ; int tmp___0 ; int max ; int tmp___1 ; int tmp___2 ; int tmp___3 ; ssize_t tmp___4 ; { cnt = 0; parent_devnum = 0; total_written = 0L; childdev = 0; if (*nbytes == 0UL) { return (0L); } else { } if (level > 6) { return (0L); } else { } tmp = __get_free_pages(16U, 1U); pages_start = (char *)tmp; if ((unsigned long )pages_start == (unsigned long )((char *)0)) { return (-12L); } else { } if ((unsigned long )usbdev->parent != (unsigned long )((struct usb_device *)0) && (usbdev->parent)->devnum != -1) { parent_devnum = (usbdev->parent)->devnum; } else { } switch ((unsigned int )usbdev->speed) { case 1U: speed = (char *)"1.5"; goto ldv_31655; case 0U: ; case 2U: speed = (char *)"12"; goto ldv_31655; case 4U: ; case 3U: speed = (char *)"480"; goto ldv_31655; case 5U: speed = (char *)"5000"; goto ldv_31655; default: speed = (char *)"??"; } ldv_31655: tmp___0 = sprintf(pages_start, (char const *)(& format_topo), bus->busnum, level, parent_devnum, index, count, usbdev->devnum, speed, usbdev->maxchild); data_end = pages_start + (unsigned long )tmp___0; if (level == 0) { if ((unsigned int )usbdev->speed == 3U || (unsigned int )usbdev->speed == 5U) { max = 800; } else { max = 900; } tmp___1 = sprintf(data_end, (char const *)(& format_bandwidth), bus->bandwidth_allocated, max, (bus->bandwidth_allocated * 100 + max / 2) / max, bus->bandwidth_int_reqs, bus->bandwidth_isoc_reqs); data_end = data_end + (unsigned long )tmp___1; } else { } data_end = usb_dump_desc(data_end, pages_start + 7936U, usbdev); if ((unsigned long )(pages_start + 7936U) < (unsigned long )data_end) { tmp___2 = sprintf(data_end, "(truncated)\n"); data_end = data_end + (unsigned long )tmp___2; } else { } length = (unsigned int )((long )data_end) - (unsigned int )((long )pages_start); if ((loff_t )length > *skip_bytes) { length = length - (unsigned int )*skip_bytes; if ((size_t )length > *nbytes) { length = (unsigned int )*nbytes; } else { } tmp___3 = copy_to_user((void *)*buffer, (void const *)pages_start + (unsigned long )*skip_bytes, length); if (tmp___3 != 0) { free_pages((unsigned long )pages_start, 1U); return (-14L); } else { } *nbytes = *nbytes - (size_t )length; *file_offset = *file_offset + (loff_t )length; total_written = (ssize_t )length + total_written; *buffer = *buffer + (unsigned long )length; *skip_bytes = 0LL; } else { *skip_bytes = *skip_bytes - (loff_t )length; } free_pages((unsigned long )pages_start, 1U); chix = 1; childdev = usb_hub_find_child(usbdev, chix); goto ldv_31664; ldv_31663: ; if ((unsigned long )childdev != (unsigned long )((struct usb_device *)0)) { device_lock___5(& childdev->dev); cnt = cnt + 1; tmp___4 = usb_device_dump(buffer, nbytes, skip_bytes, file_offset, childdev, bus, level + 1, chix + -1, cnt); ret = (int )tmp___4; device_unlock___5(& childdev->dev); if (ret == -14) { return (total_written); } else { } total_written = (ssize_t )ret + total_written; } else { } chix = chix + 1; childdev = usb_hub_find_child(usbdev, chix); ldv_31664: ; if (usbdev->maxchild >= chix) { goto ldv_31663; } else { } return (total_written); } } static ssize_t usb_device_read(struct file *file , char *buf , size_t nbytes , loff_t *ppos ) { struct usb_bus *bus ; ssize_t ret ; ssize_t total_written ; loff_t skip_bytes ; unsigned long flag ; unsigned long roksum ; struct thread_info *tmp ; long tmp___0 ; struct list_head const *__mptr ; struct usb_hcd *tmp___1 ; struct list_head const *__mptr___0 ; { total_written = 0L; skip_bytes = *ppos; if (*ppos < 0LL) { return (-22L); } else { } if (nbytes == 0UL) { return (0L); } else { } tmp = current_thread_info___0(); __asm__ ("add %3,%1 ; sbb %0,%0 ; cmp %1,%4 ; sbb $0,%0": "=&r" (flag), "=r" (roksum): "1" (buf), "g" ((long )nbytes), "rm" (tmp->addr_limit.seg)); tmp___0 = ldv__builtin_expect(flag == 0UL, 1L); if (tmp___0 == 0L) { return (-14L); } else { } ldv_mutex_lock_438(& usb_bus_list_lock); __mptr = (struct list_head const *)usb_bus_list.next; bus = (struct usb_bus *)__mptr + 0xffffffffffffffb8UL; goto ldv_31685; ldv_31684: tmp___1 = bus_to_hcd(bus); if ((unsigned int )*((unsigned char *)tmp___1 + 408UL) == 0U) { goto ldv_31683; } else { } device_lock___5(& (bus->root_hub)->dev); ret = usb_device_dump(& buf, & nbytes, & skip_bytes, ppos, bus->root_hub, bus, 0, 0, 0); device_unlock___5(& (bus->root_hub)->dev); if (ret < 0L) { ldv_mutex_unlock_439(& usb_bus_list_lock); return (ret); } else { } total_written = total_written + ret; ldv_31683: __mptr___0 = (struct list_head const *)bus->bus_list.next; bus = (struct usb_bus *)__mptr___0 + 0xffffffffffffffb8UL; ldv_31685: ; if ((unsigned long )(& bus->bus_list) != (unsigned long )(& usb_bus_list)) { goto ldv_31684; } else { } ldv_mutex_unlock_440(& usb_bus_list_lock); return (total_written); } } static unsigned int usb_device_poll(struct file *file , struct poll_table_struct *wait ) { unsigned int event_count ; int tmp ; { poll_wait(file, & device_event.wait, wait); tmp = atomic_read((atomic_t const *)(& device_event.count)); event_count = (unsigned int )tmp; if (file->f_version != (u64 )event_count) { file->f_version = (u64 )event_count; return (65U); } else { } return (0U); } } static loff_t usb_device_lseek(struct file *file , loff_t offset , int orig ) { loff_t ret ; { ldv_mutex_lock_441(& ((file->f_path.dentry)->d_inode)->i_mutex); switch (orig) { case 0: file->f_pos = offset; ret = file->f_pos; goto ldv_31699; case 1: file->f_pos = file->f_pos + offset; ret = file->f_pos; goto ldv_31699; case 2: ; default: ret = -22LL; } ldv_31699: ldv_mutex_unlock_442(& ((file->f_path.dentry)->d_inode)->i_mutex); return (ret); } } struct file_operations const usbfs_devices_fops = {0, & usb_device_lseek, & usb_device_read, 0, 0, 0, 0, & usb_device_poll, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; void ldv_main15_sequence_infinite_withcheck_stateful(void) { struct file *var_group1 ; loff_t var_usb_device_lseek_16_p1 ; int var_usb_device_lseek_16_p2 ; char *var_usb_device_read_14_p1 ; size_t var_usb_device_read_14_p2 ; loff_t *var_usb_device_read_14_p3 ; ssize_t res_usb_device_read_14 ; struct poll_table_struct *var_group2 ; int ldv_s_usbfs_devices_fops_file_operations ; int tmp ; int tmp___0 ; { ldv_s_usbfs_devices_fops_file_operations = 0; LDV_IN_INTERRUPT = 1; ldv_initialize(); goto ldv_31736; ldv_31735: tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_s_usbfs_devices_fops_file_operations == 0) { ldv_handler_precall(); res_usb_device_read_14 = usb_device_read(var_group1, var_usb_device_read_14_p1, var_usb_device_read_14_p2, var_usb_device_read_14_p3); ldv_check_return_value((int )res_usb_device_read_14); if (res_usb_device_read_14 < 0L) { goto ldv_module_exit; } else { } ldv_s_usbfs_devices_fops_file_operations = ldv_s_usbfs_devices_fops_file_operations + 1; } else { } goto ldv_31731; case 1: ; if (ldv_s_usbfs_devices_fops_file_operations == 1) { ldv_handler_precall(); usb_device_lseek(var_group1, var_usb_device_lseek_16_p1, var_usb_device_lseek_16_p2); ldv_s_usbfs_devices_fops_file_operations = 0; } else { } goto ldv_31731; case 2: ldv_handler_precall(); usb_device_poll(var_group1, var_group2); goto ldv_31731; default: ; goto ldv_31731; } ldv_31731: ; ldv_31736: tmp___0 = __VERIFIER_nondet_int(); if (tmp___0 != 0 || ldv_s_usbfs_devices_fops_file_operations != 0) { goto ldv_31735; } else { } ldv_module_exit: ; ldv_check_final_state(); return; } } void ldv_mutex_lock_427(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mtx(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_428(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mtx(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_429(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mtx(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_430(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mtx(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_431(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_432(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_433(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_434(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___6 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_435(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_436(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_437(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_438(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_usb_bus_list_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_439(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_usb_bus_list_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_440(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_usb_bus_list_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_441(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_i_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_442(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_i_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } __inline static int constant_test_bit(unsigned int nr , unsigned long const volatile *addr ) { { return ((int )((unsigned long )*(addr + (unsigned long )(nr / 64U)) >> ((int )nr & 63)) & 1); } } __inline static void arch_local_irq_enable(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_enable.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 *)"/work/vladimir/UFO/Work/test/inst/current/envs/linux-3.7.3/linux-3.7.3/arch/x86/include/asm/paravirt.h"), "i" (842), "i" (12UL)); ldv_4748: ; goto ldv_4748; } 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" (48UL), [paravirt_opptr] "i" (& pv_irq_ops.irq_enable.func), [paravirt_clobber] "i" (1): "memory", "cc"); return; } } int ldv_mutex_trylock_462(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_460(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_463(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_465(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_467(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_469(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_471(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_473(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_459(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_461(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_464(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_466(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_468(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_470(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_472(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_companions_mutex(struct mutex *lock ) ; void ldv_mutex_unlock_companions_mutex(struct mutex *lock ) ; extern struct resource ioport_resource ; extern struct resource iomem_resource ; extern struct resource *__request_region(struct resource * , resource_size_t , resource_size_t , char const * , int ) ; extern void __release_region(struct resource * , resource_size_t , resource_size_t ) ; extern void __suspend_report_result(char const * , void * , int ) ; extern void *ioremap_nocache(resource_size_t , unsigned long ) ; extern void iounmap(void volatile * ) ; extern char const *pci_power_names[] ; __inline static char const *pci_power_name(pci_power_t state ) { { return (pci_power_names[state + 1]); } } extern struct pci_dev *pci_get_device(unsigned int , unsigned int , struct pci_dev * ) ; extern int pci_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 int pci_prepare_to_sleep(struct pci_dev * ) ; extern int pci_back_from_sleep(struct pci_dev * ) ; extern bool pci_dev_run_wake(struct pci_dev * ) ; __inline static void *pci_get_drvdata(struct pci_dev *pdev ) { void *tmp ; { tmp = dev_get_drvdata((struct device const *)(& pdev->dev)); return (tmp); } } __inline static char const *pci_name(struct pci_dev const *pdev ) { char const *tmp ; { tmp = dev_name(& pdev->dev); return (tmp); } } extern void synchronize_irq(unsigned int ) ; int usb_hcd_pci_probe(struct pci_dev *dev , struct pci_device_id const *id ) ; void usb_hcd_pci_remove(struct pci_dev *dev ) ; void usb_hcd_pci_shutdown(struct pci_dev *dev ) ; struct dev_pm_ops const usb_hcd_pci_pm_ops ; static struct mutex companions_mutex = {{1}, {{{{{0U}}, 3735899821U, 4294967295U, 0xffffffffffffffffUL, {0, {0, 0}, "companions_mutex.wait_lock", 0, 0UL}}}}, {& companions_mutex.wait_list, & companions_mutex.wait_list}, 0, 0, (void *)(& companions_mutex), {0, {0, 0}, "companions_mutex", 0, 0UL}}; static void companion_common(struct pci_dev *pdev , struct usb_hcd *hcd , enum companion_action action ) { struct pci_dev *companion ; struct usb_hcd *companion_hcd ; unsigned int slot ; void *tmp ; struct _ddebug descriptor ; char const *tmp___0 ; long tmp___1 ; struct _ddebug descriptor___0 ; char const *tmp___2 ; long tmp___3 ; { slot = (pdev->devfn >> 3) & 31U; companion = 0; goto ldv_33256; ldv_33264: ; if ((unsigned long )companion->bus != (unsigned long )pdev->bus || ((companion->devfn >> 3) & 31U) != slot) { goto ldv_33256; } else { } tmp = pci_get_drvdata(companion); companion_hcd = (struct usb_hcd *)tmp; if ((unsigned long )companion_hcd == (unsigned long )((struct usb_hcd *)0)) { goto ldv_33256; } else { } if ((pdev->class == 787216U || pdev->class == 787200U) && companion->class == 787232U) { descriptor.modname = "usbcore"; descriptor.function = "companion_common"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hcd-pci.c.prepared"; descriptor.format = "HS companion for %s\n"; descriptor.lineno = 185U; descriptor.flags = 1U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp___0 = dev_name((struct device const *)(& pdev->dev)); __dynamic_dev_dbg(& descriptor, (struct device const *)(& companion->dev), "HS companion for %s\n", tmp___0); } else { } hcd->self.hs_companion = & companion_hcd->self; } else if (pdev->class == 787232U && (companion->class == 787216U || companion->class == 787200U)) { switch ((unsigned int )action) { case 0U: descriptor___0.modname = "usbcore"; descriptor___0.function = "companion_common"; descriptor___0.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hcd-pci.c.prepared"; descriptor___0.format = "HS companion for %s\n"; descriptor___0.lineno = 194U; descriptor___0.flags = 1U; tmp___3 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___3 != 0L) { tmp___2 = dev_name((struct device const *)(& companion->dev)); __dynamic_dev_dbg(& descriptor___0, (struct device const *)(& pdev->dev), "HS companion for %s\n", tmp___2); } else { } companion_hcd->self.hs_companion = & hcd->self; goto ldv_33261; case 1U: companion_hcd->self.hs_companion = 0; goto ldv_33261; case 2U: device_pm_wait_for_dev(& pdev->dev, & companion->dev); goto ldv_33261; } ldv_33261: ; } else { } ldv_33256: companion = pci_get_device(4294967295U, 4294967295U, companion); if ((unsigned long )companion != (unsigned long )((struct pci_dev *)0)) { goto ldv_33264; } else { } return; } } static void set_hs_companion(struct pci_dev *pdev , struct usb_hcd *hcd ) { { ldv_mutex_lock_470(& companions_mutex); dev_set_drvdata(& pdev->dev, (void *)hcd); companion_common(pdev, hcd, SET_HS_COMPANION); ldv_mutex_unlock_471(& companions_mutex); return; } } static void clear_hs_companion(struct pci_dev *pdev , struct usb_hcd *hcd ) { { ldv_mutex_lock_472(& companions_mutex); dev_set_drvdata(& pdev->dev, 0); if (pdev->class == 787216U || pdev->class == 787200U) { hcd->self.hs_companion = 0; } else { companion_common(pdev, hcd, CLEAR_HS_COMPANION); } ldv_mutex_unlock_473(& companions_mutex); return; } } static void wait_for_companions(struct pci_dev *pdev , struct usb_hcd *hcd ) { { if (pdev->class == 787232U) { companion_common(pdev, hcd, WAIT_FOR_COMPANIONS); } else { } return; } } int usb_hcd_pci_probe(struct pci_dev *dev , struct pci_device_id const *id ) { struct hc_driver *driver ; struct usb_hcd *hcd ; int retval ; int tmp ; int tmp___0 ; char const *tmp___1 ; char const *tmp___2 ; struct _ddebug descriptor ; long tmp___3 ; struct resource *tmp___4 ; struct _ddebug descriptor___0 ; long tmp___5 ; int region ; struct resource *tmp___6 ; struct _ddebug descriptor___1 ; long tmp___7 ; bool tmp___8 ; char const *tmp___9 ; { tmp = usb_disabled(); if (tmp != 0) { return (-19); } else { } if ((unsigned long )id == (unsigned long )((struct pci_device_id const *)0)) { return (-22); } else { } driver = (struct hc_driver *)id->driver_data; if ((unsigned long )driver == (unsigned long )((struct hc_driver *)0)) { return (-22); } else { } tmp___0 = pci_enable_device(dev); if (tmp___0 < 0) { return (-19); } else { } dev->current_state = 0; if (dev->irq == 0U && (driver->flags & 112) != 64) { tmp___1 = pci_name((struct pci_dev const *)dev); dev_err((struct device const *)(& dev->dev), "Found HC with no IRQ. Check BIOS/PCI %s setup!\n", tmp___1); retval = -19; goto disable_pci; } else { } tmp___2 = pci_name((struct pci_dev const *)dev); hcd = usb_create_hcd((struct hc_driver const *)driver, & dev->dev, tmp___2); if ((unsigned long )hcd == (unsigned long )((struct usb_hcd *)0)) { retval = -12; goto disable_pci; } else { } if (driver->flags & 1) { hcd->rsrc_start = dev->resource[0].start; hcd->rsrc_len = dev->resource[0].start != 0ULL || dev->resource[0].end != dev->resource[0].start ? (dev->resource[0].end - dev->resource[0].start) + 1ULL : 0ULL; tmp___4 = __request_region(& iomem_resource, hcd->rsrc_start, hcd->rsrc_len, driver->description, 0); if ((unsigned long )tmp___4 == (unsigned long )((struct resource *)0)) { descriptor.modname = "usbcore"; descriptor.function = "usb_hcd_pci_probe"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hcd-pci.c.prepared"; descriptor.format = "controller already in use\n"; descriptor.lineno = 309U; descriptor.flags = 1U; tmp___3 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___3 != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)(& dev->dev), "controller already in use\n"); } else { } retval = -16; goto clear_companion; } else { } hcd->regs = ioremap_nocache(hcd->rsrc_start, (unsigned long )hcd->rsrc_len); if ((unsigned long )hcd->regs == (unsigned long )((void *)0)) { descriptor___0.modname = "usbcore"; descriptor___0.function = "usb_hcd_pci_probe"; descriptor___0.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hcd-pci.c.prepared"; descriptor___0.format = "error mapping memory\n"; descriptor___0.lineno = 315U; descriptor___0.flags = 1U; tmp___5 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___5 != 0L) { __dynamic_dev_dbg(& descriptor___0, (struct device const *)(& dev->dev), "error mapping memory\n"); } else { } retval = -14; goto release_mem_region; } else { } } else { region = 0; goto ldv_33295; ldv_33294: ; if ((dev->resource[region].flags & 256UL) == 0UL) { goto ldv_33292; } else { } hcd->rsrc_start = dev->resource[region].start; hcd->rsrc_len = dev->resource[region].start != 0ULL || dev->resource[region].end != dev->resource[region].start ? (dev->resource[region].end - dev->resource[region].start) + 1ULL : 0ULL; tmp___6 = __request_region(& ioport_resource, hcd->rsrc_start, hcd->rsrc_len, driver->description, 0); if ((unsigned long )tmp___6 != (unsigned long )((struct resource *)0)) { goto ldv_33293; } else { } ldv_33292: region = region + 1; ldv_33295: ; if (region <= 5) { goto ldv_33294; } else { } ldv_33293: ; if (region == 6) { descriptor___1.modname = "usbcore"; descriptor___1.function = "usb_hcd_pci_probe"; descriptor___1.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hcd-pci.c.prepared"; descriptor___1.format = "no i/o regions available\n"; descriptor___1.lineno = 336U; descriptor___1.flags = 1U; tmp___7 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); if (tmp___7 != 0L) { __dynamic_dev_dbg(& descriptor___1, (struct device const *)(& dev->dev), "no i/o regions available\n"); } else { } retval = -16; goto clear_companion; } else { } } pci_set_master(dev); retval = usb_add_hcd(hcd, dev->irq, 128UL); if (retval != 0) { goto unmap_registers; } else { } set_hs_companion(dev, hcd); tmp___8 = pci_dev_run_wake(dev); if ((int )tmp___8) { pm_runtime_put_noidle(& dev->dev); } else { } return (retval); unmap_registers: ; if (driver->flags & 1) { iounmap((void volatile *)hcd->regs); release_mem_region: __release_region(& iomem_resource, hcd->rsrc_start, hcd->rsrc_len); } else { __release_region(& ioport_resource, hcd->rsrc_start, hcd->rsrc_len); } clear_companion: clear_hs_companion(dev, hcd); usb_put_hcd(hcd); disable_pci: pci_disable_device(dev); tmp___9 = pci_name((struct pci_dev const *)dev); dev_err((struct device const *)(& dev->dev), "init %s fail, %d\n", tmp___9, retval); return (retval); } } void usb_hcd_pci_remove(struct pci_dev *dev ) { struct usb_hcd *hcd ; void *tmp ; bool tmp___0 ; { tmp = pci_get_drvdata(dev); hcd = (struct usb_hcd *)tmp; if ((unsigned long )hcd == (unsigned long )((struct usb_hcd *)0)) { return; } else { } tmp___0 = pci_dev_run_wake(dev); if ((int )tmp___0) { pm_runtime_get_noresume(& dev->dev); } else { } arch_local_irq_disable(); trace_hardirqs_off(); usb_hcd_irq(0, (void *)hcd); trace_hardirqs_on(); arch_local_irq_enable(); usb_remove_hcd(hcd); if ((int )(hcd->driver)->flags & 1) { iounmap((void volatile *)hcd->regs); __release_region(& iomem_resource, hcd->rsrc_start, hcd->rsrc_len); } else { __release_region(& ioport_resource, hcd->rsrc_start, hcd->rsrc_len); } clear_hs_companion(dev, hcd); usb_put_hcd(hcd); pci_disable_device(dev); return; } } void usb_hcd_pci_shutdown(struct pci_dev *dev ) { struct usb_hcd *hcd ; void *tmp ; int tmp___0 ; { tmp = pci_get_drvdata(dev); hcd = (struct usb_hcd *)tmp; if ((unsigned long )hcd == (unsigned long )((struct usb_hcd *)0)) { return; } else { } tmp___0 = constant_test_bit(0U, (unsigned long const volatile *)(& hcd->flags)); if (tmp___0 != 0 && (unsigned long )(hcd->driver)->shutdown != (unsigned long )((void (*/* const */)(struct usb_hcd * ))0)) { (*((hcd->driver)->shutdown))(hcd); pci_disable_device(dev); } else { } return; } } __inline static void powermac_set_asic(struct pci_dev *pci_dev , int enable ) { { return; } } static int check_root_hub_suspended(struct device *dev ) { struct pci_dev *pci_dev ; struct device const *__mptr ; struct usb_hcd *hcd ; void *tmp ; { __mptr = (struct device const *)dev; pci_dev = (struct pci_dev *)__mptr + 0xffffffffffffff68UL; tmp = pci_get_drvdata(pci_dev); hcd = (struct usb_hcd *)tmp; if ((hcd->flags & 32UL) != 0UL) { dev_warn((struct device const *)dev, "Root hub is not suspended\n"); return (-16); } else { } if ((unsigned long )hcd->shared_hcd != (unsigned long )((struct usb_hcd *)0)) { hcd = hcd->shared_hcd; if ((hcd->flags & 32UL) != 0UL) { dev_warn((struct device const *)dev, "Secondary root hub is not suspended\n"); return (-16); } else { } } else { } return (0); } } static int suspend_common(struct device *dev , bool do_wakeup ) { struct pci_dev *pci_dev ; struct device const *__mptr ; struct usb_hcd *hcd ; void *tmp ; int retval ; { __mptr = (struct device const *)dev; pci_dev = (struct pci_dev *)__mptr + 0xffffffffffffff68UL; tmp = pci_get_drvdata(pci_dev); hcd = (struct usb_hcd *)tmp; retval = check_root_hub_suspended(dev); if (retval != 0) { return (retval); } else { } if ((unsigned long )(hcd->driver)->pci_suspend != (unsigned long )((int (*/* const */)(struct usb_hcd * , bool ))0) && (hcd->flags & 64UL) == 0UL) { if ((int )do_wakeup && (hcd->flags & 16UL) != 0UL) { return (-16); } else { } if (((int )do_wakeup && (unsigned long )hcd->shared_hcd != (unsigned long )((struct usb_hcd *)0)) && ((hcd->shared_hcd)->flags & 16UL) != 0UL) { return (-16); } else { } retval = (*((hcd->driver)->pci_suspend))(hcd, (int )do_wakeup); __suspend_report_result("suspend_common", (void *)(hcd->driver)->pci_suspend, retval); if (((retval == 0 && (int )do_wakeup) && (hcd->flags & 16UL) != 0UL) || (((retval == 0 && (int )do_wakeup) && (unsigned long )hcd->shared_hcd != (unsigned long )((struct usb_hcd *)0)) && ((hcd->shared_hcd)->flags & 16UL) != 0UL)) { if ((unsigned long )(hcd->driver)->pci_resume != (unsigned long )((int (*/* const */)(struct usb_hcd * , bool ))0)) { (*((hcd->driver)->pci_resume))(hcd, 0); } else { } retval = -16; } else { } if (retval != 0) { return (retval); } else { } } else { } if ((unsigned int )*((unsigned char *)hcd + 408UL) == 0U) { synchronize_irq(pci_dev->irq); } else { } pci_disable_device(pci_dev); return (retval); } } static int resume_common(struct device *dev , int event ) { struct pci_dev *pci_dev ; struct device const *__mptr ; struct usb_hcd *hcd ; void *tmp ; int retval ; struct _ddebug descriptor ; long tmp___0 ; { __mptr = (struct device const *)dev; pci_dev = (struct pci_dev *)__mptr + 0xffffffffffffff68UL; tmp = pci_get_drvdata(pci_dev); hcd = (struct usb_hcd *)tmp; if ((hcd->flags & 32UL) != 0UL || ((unsigned long )hcd->shared_hcd != (unsigned long )((struct usb_hcd *)0) && ((hcd->shared_hcd)->flags & 32UL) != 0UL)) { descriptor.modname = "usbcore"; descriptor.function = "resume_common"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hcd-pci.c.prepared"; descriptor.format = "can\'t resume, not suspended!\n"; descriptor.lineno = 544U; descriptor.flags = 1U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)dev, "can\'t resume, not suspended!\n"); } else { } return (0); } else { } retval = pci_enable_device(pci_dev); if (retval < 0) { dev_err((struct device const *)dev, "can\'t re-enable after resume, %d!\n", retval); return (retval); } else { } pci_set_master(pci_dev); if ((unsigned long )(hcd->driver)->pci_resume != (unsigned long )((int (*/* const */)(struct usb_hcd * , bool ))0) && (hcd->flags & 64UL) == 0UL) { if (event != 1040) { wait_for_companions(pci_dev, hcd); } else { } retval = (*((hcd->driver)->pci_resume))(hcd, event == 64); if (retval != 0) { dev_err((struct device const *)dev, "PCI post-resume error %d!\n", retval); if ((unsigned long )hcd->shared_hcd != (unsigned long )((struct usb_hcd *)0)) { usb_hc_died(hcd->shared_hcd); } else { } usb_hc_died(hcd); } else { } } else { } return (retval); } } static int hcd_pci_suspend(struct device *dev ) { bool tmp ; int tmp___0 ; { tmp = device_may_wakeup(dev); tmp___0 = suspend_common(dev, (int )tmp); return (tmp___0); } } static int hcd_pci_suspend_noirq(struct device *dev ) { struct pci_dev *pci_dev ; struct device const *__mptr ; struct usb_hcd *hcd ; void *tmp ; int retval ; struct _ddebug descriptor ; bool tmp___0 ; long tmp___1 ; struct _ddebug descriptor___0 ; long tmp___2 ; struct _ddebug descriptor___1 ; char const *tmp___3 ; long tmp___4 ; { __mptr = (struct device const *)dev; pci_dev = (struct pci_dev *)__mptr + 0xffffffffffffff68UL; tmp = pci_get_drvdata(pci_dev); hcd = (struct usb_hcd *)tmp; retval = check_root_hub_suspended(dev); if (retval != 0) { return (retval); } else { } pci_save_state(pci_dev); if ((hcd->flags & 64UL) != 0UL) { device_set_wakeup_enable(dev, 0); } else { } descriptor.modname = "usbcore"; descriptor.function = "hcd_pci_suspend_noirq"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hcd-pci.c.prepared"; descriptor.format = "wakeup: %d\n"; descriptor.lineno = 598U; descriptor.flags = 1U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp___0 = device_may_wakeup(dev); __dynamic_dev_dbg(& descriptor, (struct device const *)dev, "wakeup: %d\n", (int )tmp___0); } else { } retval = pci_prepare_to_sleep(pci_dev); if (retval == -5) { descriptor___0.modname = "usbcore"; descriptor___0.function = "hcd_pci_suspend_noirq"; descriptor___0.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hcd-pci.c.prepared"; descriptor___0.format = "--> PCI D0 legacy\n"; descriptor___0.lineno = 605U; descriptor___0.flags = 1U; tmp___2 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___2 != 0L) { __dynamic_dev_dbg(& descriptor___0, (struct device const *)dev, "--> PCI D0 legacy\n"); } else { } retval = 0; } else if (retval == 0) { descriptor___1.modname = "usbcore"; descriptor___1.function = "hcd_pci_suspend_noirq"; descriptor___1.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hcd-pci.c.prepared"; descriptor___1.format = "--> PCI %s\n"; descriptor___1.lineno = 609U; descriptor___1.flags = 1U; tmp___4 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); if (tmp___4 != 0L) { tmp___3 = pci_power_name(pci_dev->current_state); __dynamic_dev_dbg(& descriptor___1, (struct device const *)dev, "--> PCI %s\n", tmp___3); } else { } } else { __suspend_report_result("hcd_pci_suspend_noirq", (void *)(& pci_prepare_to_sleep), retval); return (retval); } powermac_set_asic(pci_dev, 0); return (retval); } } static int hcd_pci_resume_noirq(struct device *dev ) { struct pci_dev *pci_dev ; struct device const *__mptr ; { __mptr = (struct device const *)dev; pci_dev = (struct pci_dev *)__mptr + 0xffffffffffffff68UL; powermac_set_asic(pci_dev, 1); pci_back_from_sleep(pci_dev); return (0); } } static int hcd_pci_resume(struct device *dev ) { int tmp ; { tmp = resume_common(dev, 16); return (tmp); } } static int hcd_pci_restore(struct device *dev ) { int tmp ; { tmp = resume_common(dev, 64); return (tmp); } } static int hcd_pci_runtime_suspend(struct device *dev ) { int retval ; struct device const *__mptr ; struct _ddebug descriptor ; long tmp ; { retval = suspend_common(dev, 1); if (retval == 0) { __mptr = (struct device const *)dev; powermac_set_asic((struct pci_dev *)__mptr + 0xffffffffffffff68UL, 0); } else { } descriptor.modname = "usbcore"; descriptor.function = "hcd_pci_runtime_suspend"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hcd-pci.c.prepared"; descriptor.format = "hcd_pci_runtime_suspend: %d\n"; descriptor.lineno = 659U; descriptor.flags = 1U; tmp = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)dev, "hcd_pci_runtime_suspend: %d\n", retval); } else { } return (retval); } } static int hcd_pci_runtime_resume(struct device *dev ) { int retval ; struct device const *__mptr ; struct _ddebug descriptor ; long tmp ; { __mptr = (struct device const *)dev; powermac_set_asic((struct pci_dev *)__mptr + 0xffffffffffffff68UL, 1); retval = resume_common(dev, 1040); descriptor.modname = "usbcore"; descriptor.function = "hcd_pci_runtime_resume"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/hcd-pci.c.prepared"; descriptor.format = "hcd_pci_runtime_resume: %d\n"; descriptor.lineno = 669U; descriptor.flags = 1U; tmp = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)dev, "hcd_pci_runtime_resume: %d\n", retval); } else { } return (retval); } } struct dev_pm_ops const usb_hcd_pci_pm_ops = {0, 0, & hcd_pci_suspend, & hcd_pci_resume, & check_root_hub_suspended, 0, & hcd_pci_suspend, & hcd_pci_restore, 0, 0, 0, 0, 0, 0, & hcd_pci_suspend_noirq, & hcd_pci_resume_noirq, & check_root_hub_suspended, 0, & hcd_pci_suspend_noirq, & hcd_pci_resume_noirq, & hcd_pci_runtime_suspend, & hcd_pci_runtime_resume, 0}; void ldv_main16_sequence_infinite_withcheck_stateful(void) { struct device *var_group1 ; int tmp ; int tmp___0 ; { LDV_IN_INTERRUPT = 1; ldv_initialize(); goto ldv_33434; ldv_33433: tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ldv_handler_precall(); hcd_pci_suspend(var_group1); goto ldv_33424; case 1: ldv_handler_precall(); hcd_pci_suspend_noirq(var_group1); goto ldv_33424; case 2: ldv_handler_precall(); hcd_pci_resume_noirq(var_group1); goto ldv_33424; case 3: ldv_handler_precall(); hcd_pci_resume(var_group1); goto ldv_33424; case 4: ldv_handler_precall(); check_root_hub_suspended(var_group1); goto ldv_33424; case 5: ldv_handler_precall(); hcd_pci_restore(var_group1); goto ldv_33424; case 6: ldv_handler_precall(); hcd_pci_runtime_suspend(var_group1); goto ldv_33424; case 7: ldv_handler_precall(); hcd_pci_runtime_resume(var_group1); goto ldv_33424; default: ; goto ldv_33424; } ldv_33424: ; ldv_33434: tmp___0 = __VERIFIER_nondet_int(); if (tmp___0 != 0) { goto ldv_33433; } else { } ldv_check_final_state(); return; } } void ldv_mutex_lock_459(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_460(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_461(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_462(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___2 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_463(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_464(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mtx(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_465(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mtx(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_466(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mtx(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_467(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mtx(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_468(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_469(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_470(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_companions_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_471(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_companions_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_472(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_companions_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_473(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_companions_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } int ldv_mutex_trylock_492(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_490(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_493(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_495(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_497(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_499(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_489(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_491(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_494(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_496(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_498(struct mutex *ldv_func_arg1 ) ; int usb_acpi_set_power_state(struct usb_device *hdev , int index , bool enable ) ; bool usb_acpi_power_manageable(struct usb_device *hdev , int index ) ; extern acpi_status acpi_evaluate_object(acpi_handle , acpi_string , struct acpi_object_list * , struct acpi_buffer * ) ; extern acpi_status acpi_get_physical_device_location(acpi_handle , struct acpi_pld_info ** ) ; extern int acpi_bus_set_power(acpi_handle , int ) ; extern bool acpi_bus_power_manageable(acpi_handle ) ; extern int register_acpi_bus_type(struct acpi_bus_type * ) ; extern int unregister_acpi_bus_type(struct acpi_bus_type * ) ; extern acpi_handle acpi_get_child(acpi_handle , u64 ) ; __inline static int is_usb_port(struct device const *dev ) { { return ((unsigned long )((struct device_type const *)dev->type) == (unsigned long )((struct device_type const *)(& usb_port_device_type))); } } bool usb_acpi_power_manageable(struct usb_device *hdev , int index ) { acpi_handle port_handle ; int port1 ; bool tmp ; { port1 = index + 1; port_handle = usb_get_hub_port_acpi_handle(hdev, port1); if ((unsigned long )port_handle != (unsigned long )((acpi_handle )0)) { tmp = acpi_bus_power_manageable(port_handle); return (tmp); } else { return (0); } } } int usb_acpi_set_power_state(struct usb_device *hdev , int index , bool enable ) { acpi_handle port_handle ; unsigned char state ; int port1 ; int error ; struct _ddebug descriptor ; long tmp ; struct _ddebug descriptor___0 ; long tmp___0 ; { port1 = index + 1; error = -22; port_handle = usb_get_hub_port_acpi_handle(hdev, port1); if ((unsigned long )port_handle == (unsigned long )((acpi_handle )0)) { return (error); } else { } if ((int )enable) { state = 0U; } else { state = 4U; } error = acpi_bus_set_power(port_handle, (int )state); if (error == 0) { descriptor.modname = "usbcore"; descriptor.function = "usb_acpi_set_power_state"; descriptor.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/usb-acpi.c.prepared"; descriptor.format = "The power of hub port %d was set to %d\n"; descriptor.lineno = 172U; descriptor.flags = 1U; tmp = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)(& hdev->dev), "The power of hub port %d was set to %d\n", port1, (int )enable); } else { } } else { descriptor___0.modname = "usbcore"; descriptor___0.function = "usb_acpi_set_power_state"; descriptor___0.filename = "/work/vladimir/UFO/Work/test/work/current--X--drivers/usb/core/usbcore.ko--X--defaultlinux-3.7.3--X--32_7a--X--ufo/linux-3.7.3/csd_deg_dscv/29/dscv_tempdir/dscv/ri/32_7a/drivers/usb/core/usb-acpi.c.prepared"; descriptor___0.format = "The power of hub port failed to be set\n"; descriptor___0.lineno = 174U; descriptor___0.flags = 1U; tmp___0 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___0 != 0L) { __dynamic_dev_dbg(& descriptor___0, (struct device const *)(& hdev->dev), "The power of hub port failed to be set\n"); } else { } } return (error); } } static int usb_acpi_check_port_connect_type(struct usb_device *hdev , acpi_handle handle , int port1 ) { acpi_status status ; struct acpi_buffer buffer ; union acpi_object *upc ; struct acpi_pld_info *pld ; int ret ; { buffer.length = 0xffffffffffffffffULL; buffer.pointer = 0; ret = 0; status = acpi_get_physical_device_location(handle, & pld); if (status != 0U) { return (-19); } else { } status = acpi_evaluate_object(handle, (char *)"_UPC", 0, & buffer); upc = (union acpi_object *)buffer.pointer; if (((unsigned long )upc == (unsigned long )((union acpi_object *)0) || upc->type != 4U) || upc->package.count != 4U) { ret = -22; goto out; } else { } if ((upc->package.elements)->integer.value != 0ULL) { if ((unsigned int )pld->user_visible != 0U) { usb_set_hub_port_connect_type(hdev, port1, USB_PORT_CONNECT_TYPE_HOT_PLUG); } else { usb_set_hub_port_connect_type(hdev, port1, USB_PORT_CONNECT_TYPE_HARD_WIRED); } } else if ((unsigned int )pld->user_visible == 0U) { usb_set_hub_port_connect_type(hdev, port1, USB_PORT_NOT_USED); } else { } out: kfree((void const *)pld); kfree((void const *)upc); return (ret); } } static int usb_acpi_find_device(struct device *dev , acpi_handle **handle ) { struct usb_device *udev ; acpi_handle **parent_handle ; int port_num ; struct device const *__mptr ; enum usb_port_connect_type type ; acpi_handle tmp ; char const *tmp___0 ; struct device const *__mptr___0 ; acpi_handle tmp___1 ; acpi_handle tmp___2 ; acpi_handle tmp___3 ; int tmp___4 ; int tmp___5 ; { tmp___5 = is_usb_device((struct device const *)dev); if (tmp___5 != 0) { __mptr = (struct device const *)dev; udev = (struct usb_device *)__mptr + 0xffffffffffffff78UL; if ((unsigned long )udev->parent != (unsigned long )((struct usb_device *)0)) { type = usb_get_hub_port_connect_type(udev->parent, (int )udev->portnum); switch ((unsigned int )type) { case 1U: udev->removable = USB_DEVICE_REMOVABLE; goto ldv_32888; case 2U: udev->removable = USB_DEVICE_FIXED; goto ldv_32888; default: udev->removable = USB_DEVICE_REMOVABLE_UNKNOWN; goto ldv_32888; } ldv_32888: ; return (-19); } else { } parent_handle = (acpi_handle **)(dev->parent)->archdata.acpi_handle; tmp = acpi_get_child((acpi_handle )parent_handle, (u64 )udev->portnum); *handle = tmp; if ((unsigned long )*handle == (unsigned long )((acpi_handle *)0)) { return (-19); } else { } return (0); } else { tmp___4 = is_usb_port((struct device const *)dev); if (tmp___4 != 0) { tmp___0 = dev_name((struct device const *)dev); sscanf(tmp___0, "port%d", & port_num); __mptr___0 = (struct device const *)(dev->parent)->parent; udev = (struct usb_device *)__mptr___0 + 0xffffffffffffff78UL; if ((unsigned long )udev->parent == (unsigned long )((struct usb_device *)0)) { tmp___1 = acpi_get_child(udev->dev.archdata.acpi_handle, (u64 )port_num); *handle = tmp___1; if ((unsigned long )*handle == (unsigned long )((acpi_handle *)0)) { return (-19); } else { } } else { tmp___2 = usb_get_hub_port_acpi_handle(udev->parent, (int )udev->portnum); parent_handle = (acpi_handle **)tmp___2; if ((unsigned long )parent_handle == (unsigned long )((acpi_handle **)0)) { return (-19); } else { } tmp___3 = acpi_get_child((acpi_handle )parent_handle, (u64 )port_num); *handle = tmp___3; if ((unsigned long )*handle == (unsigned long )((acpi_handle *)0)) { return (-19); } else { } } usb_acpi_check_port_connect_type(udev, *handle, port_num); } else { return (-19); } } return (0); } } static struct acpi_bus_type usb_acpi_bus = {{0, 0}, & usb_bus_type, & usb_acpi_find_device, & usb_acpi_find_device}; int usb_acpi_register(void) { int tmp ; { tmp = register_acpi_bus_type(& usb_acpi_bus); return (tmp); } } void usb_acpi_unregister(void) { { unregister_acpi_bus_type(& usb_acpi_bus); return; } } void ldv_main17_sequence_infinite_withcheck_stateful(void) { struct device *var_group1 ; acpi_handle **var_usb_acpi_find_device_3_p1 ; int tmp ; int tmp___0 ; { LDV_IN_INTERRUPT = 1; ldv_initialize(); goto ldv_32922; ldv_32921: tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ldv_handler_precall(); usb_acpi_find_device(var_group1, var_usb_acpi_find_device_3_p1); goto ldv_32919; default: ; goto ldv_32919; } ldv_32919: ; ldv_32922: tmp___0 = __VERIFIER_nondet_int(); if (tmp___0 != 0) { goto ldv_32921; } else { } ldv_check_final_state(); return; } } void ldv_mutex_lock_489(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_490(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_491(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_492(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___2 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_493(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_494(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mtx(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_495(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mtx(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_496(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mtx(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_497(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mtx(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_498(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_499(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } __inline static void ldv_error(void) __attribute__((__no_instrument_function__)) ; __inline static void ldv_error(void) { { ERROR: __VERIFIER_error(); } } extern int __VERIFIER_nondet_int(void) ; long ldv__builtin_expect(long exp , long c ) { { return (exp); } } static int ldv_mutex_bandwidth_mutex ; int ldv_mutex_lock_interruptible_bandwidth_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_bandwidth_mutex == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_bandwidth_mutex = 2; return (0); } else { return (-4); } } } int ldv_mutex_lock_killable_bandwidth_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_bandwidth_mutex == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_bandwidth_mutex = 2; return (0); } else { return (-4); } } } void ldv_mutex_lock_bandwidth_mutex(struct mutex *lock ) { { if (ldv_mutex_bandwidth_mutex == 1) { } else { ldv_error(); } ldv_mutex_bandwidth_mutex = 2; return; } } int ldv_mutex_trylock_bandwidth_mutex(struct mutex *lock ) { int is_mutex_held_by_another_thread ; { if (ldv_mutex_bandwidth_mutex == 1) { } else { ldv_error(); } is_mutex_held_by_another_thread = __VERIFIER_nondet_int(); if (is_mutex_held_by_another_thread) { return (0); } else { ldv_mutex_bandwidth_mutex = 2; return (1); } } } int ldv_atomic_dec_and_mutex_lock_bandwidth_mutex(atomic_t *cnt , struct mutex *lock ) { int atomic_value_after_dec ; { if (ldv_mutex_bandwidth_mutex == 1) { } else { ldv_error(); } atomic_value_after_dec = __VERIFIER_nondet_int(); if (atomic_value_after_dec == 0) { ldv_mutex_bandwidth_mutex = 2; return (1); } else { } return (0); } } int ldv_mutex_is_locked_bandwidth_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_bandwidth_mutex == 1) { nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { return (0); } else { return (1); } } else { return (1); } } } void ldv_mutex_unlock_bandwidth_mutex(struct mutex *lock ) { { if (ldv_mutex_bandwidth_mutex == 2) { } else { ldv_error(); } ldv_mutex_bandwidth_mutex = 1; return; } } static int ldv_mutex_companions_mutex ; int ldv_mutex_lock_interruptible_companions_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_companions_mutex == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_companions_mutex = 2; return (0); } else { return (-4); } } } int ldv_mutex_lock_killable_companions_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_companions_mutex == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_companions_mutex = 2; return (0); } else { return (-4); } } } void ldv_mutex_lock_companions_mutex(struct mutex *lock ) { { if (ldv_mutex_companions_mutex == 1) { } else { ldv_error(); } ldv_mutex_companions_mutex = 2; return; } } int ldv_mutex_trylock_companions_mutex(struct mutex *lock ) { int is_mutex_held_by_another_thread ; { if (ldv_mutex_companions_mutex == 1) { } else { ldv_error(); } is_mutex_held_by_another_thread = __VERIFIER_nondet_int(); if (is_mutex_held_by_another_thread) { return (0); } else { ldv_mutex_companions_mutex = 2; return (1); } } } int ldv_atomic_dec_and_mutex_lock_companions_mutex(atomic_t *cnt , struct mutex *lock ) { int atomic_value_after_dec ; { if (ldv_mutex_companions_mutex == 1) { } else { ldv_error(); } atomic_value_after_dec = __VERIFIER_nondet_int(); if (atomic_value_after_dec == 0) { ldv_mutex_companions_mutex = 2; return (1); } else { } return (0); } } int ldv_mutex_is_locked_companions_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_companions_mutex == 1) { nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { return (0); } else { return (1); } } else { return (1); } } } void ldv_mutex_unlock_companions_mutex(struct mutex *lock ) { { if (ldv_mutex_companions_mutex == 2) { } else { ldv_error(); } ldv_mutex_companions_mutex = 1; return; } } static int ldv_mutex_cred_guard_mutex ; int ldv_mutex_lock_interruptible_cred_guard_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_cred_guard_mutex == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_cred_guard_mutex = 2; return (0); } else { return (-4); } } } int ldv_mutex_lock_killable_cred_guard_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_cred_guard_mutex == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_cred_guard_mutex = 2; return (0); } else { return (-4); } } } void ldv_mutex_lock_cred_guard_mutex(struct mutex *lock ) { { if (ldv_mutex_cred_guard_mutex == 1) { } else { ldv_error(); } ldv_mutex_cred_guard_mutex = 2; return; } } int ldv_mutex_trylock_cred_guard_mutex(struct mutex *lock ) { int is_mutex_held_by_another_thread ; { if (ldv_mutex_cred_guard_mutex == 1) { } else { ldv_error(); } is_mutex_held_by_another_thread = __VERIFIER_nondet_int(); if (is_mutex_held_by_another_thread) { return (0); } else { ldv_mutex_cred_guard_mutex = 2; return (1); } } } int ldv_atomic_dec_and_mutex_lock_cred_guard_mutex(atomic_t *cnt , struct mutex *lock ) { int atomic_value_after_dec ; { if (ldv_mutex_cred_guard_mutex == 1) { } else { ldv_error(); } atomic_value_after_dec = __VERIFIER_nondet_int(); if (atomic_value_after_dec == 0) { ldv_mutex_cred_guard_mutex = 2; return (1); } else { } return (0); } } int ldv_mutex_is_locked_cred_guard_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_cred_guard_mutex == 1) { nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { return (0); } else { return (1); } } else { return (1); } } } void ldv_mutex_unlock_cred_guard_mutex(struct mutex *lock ) { { if (ldv_mutex_cred_guard_mutex == 2) { } else { ldv_error(); } ldv_mutex_cred_guard_mutex = 1; return; } } static int ldv_mutex_i_mutex ; int ldv_mutex_lock_interruptible_i_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_i_mutex == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_i_mutex = 2; return (0); } else { return (-4); } } } int ldv_mutex_lock_killable_i_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_i_mutex == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_i_mutex = 2; return (0); } else { return (-4); } } } void ldv_mutex_lock_i_mutex(struct mutex *lock ) { { if (ldv_mutex_i_mutex == 1) { } else { ldv_error(); } ldv_mutex_i_mutex = 2; return; } } int ldv_mutex_trylock_i_mutex(struct mutex *lock ) { int is_mutex_held_by_another_thread ; { if (ldv_mutex_i_mutex == 1) { } else { ldv_error(); } is_mutex_held_by_another_thread = __VERIFIER_nondet_int(); if (is_mutex_held_by_another_thread) { return (0); } else { ldv_mutex_i_mutex = 2; return (1); } } } int ldv_atomic_dec_and_mutex_lock_i_mutex(atomic_t *cnt , struct mutex *lock ) { int atomic_value_after_dec ; { if (ldv_mutex_i_mutex == 1) { } else { ldv_error(); } atomic_value_after_dec = __VERIFIER_nondet_int(); if (atomic_value_after_dec == 0) { ldv_mutex_i_mutex = 2; return (1); } else { } return (0); } } int ldv_mutex_is_locked_i_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_i_mutex == 1) { nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { return (0); } else { return (1); } } else { return (1); } } } void ldv_mutex_unlock_i_mutex(struct mutex *lock ) { { if (ldv_mutex_i_mutex == 2) { } else { ldv_error(); } ldv_mutex_i_mutex = 1; return; } } static int ldv_mutex_lock ; int ldv_mutex_lock_interruptible_lock(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_lock == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_lock = 2; return (0); } else { return (-4); } } } int ldv_mutex_lock_killable_lock(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_lock == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_lock = 2; return (0); } else { return (-4); } } } void ldv_mutex_lock_lock(struct mutex *lock ) { { if (ldv_mutex_lock == 1) { } else { ldv_error(); } ldv_mutex_lock = 2; return; } } int ldv_mutex_trylock_lock(struct mutex *lock ) { int is_mutex_held_by_another_thread ; { if (ldv_mutex_lock == 1) { } else { ldv_error(); } is_mutex_held_by_another_thread = __VERIFIER_nondet_int(); if (is_mutex_held_by_another_thread) { return (0); } else { ldv_mutex_lock = 2; return (1); } } } int ldv_atomic_dec_and_mutex_lock_lock(atomic_t *cnt , struct mutex *lock ) { int atomic_value_after_dec ; { if (ldv_mutex_lock == 1) { } else { ldv_error(); } atomic_value_after_dec = __VERIFIER_nondet_int(); if (atomic_value_after_dec == 0) { ldv_mutex_lock = 2; return (1); } else { } return (0); } } int ldv_mutex_is_locked_lock(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_lock == 1) { nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { return (0); } else { return (1); } } else { return (1); } } } void ldv_mutex_unlock_lock(struct mutex *lock ) { { if (ldv_mutex_lock == 2) { } else { ldv_error(); } ldv_mutex_lock = 1; return; } } static int ldv_mutex_mtx ; int ldv_mutex_lock_interruptible_mtx(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_mtx == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_mtx = 2; return (0); } else { return (-4); } } } int ldv_mutex_lock_killable_mtx(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_mtx == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_mtx = 2; return (0); } else { return (-4); } } } void ldv_mutex_lock_mtx(struct mutex *lock ) { { if (ldv_mutex_mtx == 1) { } else { ldv_error(); } ldv_mutex_mtx = 2; return; } } int ldv_mutex_trylock_mtx(struct mutex *lock ) { int is_mutex_held_by_another_thread ; { if (ldv_mutex_mtx == 1) { } else { ldv_error(); } is_mutex_held_by_another_thread = __VERIFIER_nondet_int(); if (is_mutex_held_by_another_thread) { return (0); } else { ldv_mutex_mtx = 2; return (1); } } } int ldv_atomic_dec_and_mutex_lock_mtx(atomic_t *cnt , struct mutex *lock ) { int atomic_value_after_dec ; { if (ldv_mutex_mtx == 1) { } else { ldv_error(); } atomic_value_after_dec = __VERIFIER_nondet_int(); if (atomic_value_after_dec == 0) { ldv_mutex_mtx = 2; return (1); } else { } return (0); } } int ldv_mutex_is_locked_mtx(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_mtx == 1) { nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { return (0); } else { return (1); } } else { return (1); } } } void ldv_mutex_unlock_mtx(struct mutex *lock ) { { if (ldv_mutex_mtx == 2) { } else { ldv_error(); } ldv_mutex_mtx = 1; return; } } static int ldv_mutex_mutex ; int ldv_mutex_lock_interruptible_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_mutex == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_mutex = 2; return (0); } else { return (-4); } } } int ldv_mutex_lock_killable_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_mutex == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_mutex = 2; return (0); } else { return (-4); } } } void ldv_mutex_lock_mutex(struct mutex *lock ) { { if (ldv_mutex_mutex == 1) { } else { ldv_error(); } ldv_mutex_mutex = 2; return; } } int ldv_mutex_trylock_mutex(struct mutex *lock ) { int is_mutex_held_by_another_thread ; { if (ldv_mutex_mutex == 1) { } else { ldv_error(); } is_mutex_held_by_another_thread = __VERIFIER_nondet_int(); if (is_mutex_held_by_another_thread) { return (0); } else { ldv_mutex_mutex = 2; return (1); } } } int ldv_atomic_dec_and_mutex_lock_mutex(atomic_t *cnt , struct mutex *lock ) { int atomic_value_after_dec ; { if (ldv_mutex_mutex == 1) { } else { ldv_error(); } atomic_value_after_dec = __VERIFIER_nondet_int(); if (atomic_value_after_dec == 0) { ldv_mutex_mutex = 2; return (1); } else { } return (0); } } int ldv_mutex_is_locked_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_mutex == 1) { nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { return (0); } else { return (1); } } else { return (1); } } } void ldv_mutex_unlock_mutex(struct mutex *lock ) { { if (ldv_mutex_mutex == 2) { } else { ldv_error(); } ldv_mutex_mutex = 1; return; } } static int ldv_mutex_status_mutex ; int ldv_mutex_lock_interruptible_status_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_status_mutex == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_status_mutex = 2; return (0); } else { return (-4); } } } int ldv_mutex_lock_killable_status_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_status_mutex == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_status_mutex = 2; return (0); } else { return (-4); } } } void ldv_mutex_lock_status_mutex(struct mutex *lock ) { { if (ldv_mutex_status_mutex == 1) { } else { ldv_error(); } ldv_mutex_status_mutex = 2; return; } } int ldv_mutex_trylock_status_mutex(struct mutex *lock ) { int is_mutex_held_by_another_thread ; { if (ldv_mutex_status_mutex == 1) { } else { ldv_error(); } is_mutex_held_by_another_thread = __VERIFIER_nondet_int(); if (is_mutex_held_by_another_thread) { return (0); } else { ldv_mutex_status_mutex = 2; return (1); } } } int ldv_atomic_dec_and_mutex_lock_status_mutex(atomic_t *cnt , struct mutex *lock ) { int atomic_value_after_dec ; { if (ldv_mutex_status_mutex == 1) { } else { ldv_error(); } atomic_value_after_dec = __VERIFIER_nondet_int(); if (atomic_value_after_dec == 0) { ldv_mutex_status_mutex = 2; return (1); } else { } return (0); } } int ldv_mutex_is_locked_status_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_status_mutex == 1) { nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { return (0); } else { return (1); } } else { return (1); } } } void ldv_mutex_unlock_status_mutex(struct mutex *lock ) { { if (ldv_mutex_status_mutex == 2) { } else { ldv_error(); } ldv_mutex_status_mutex = 1; return; } } static int ldv_mutex_usb_address0_mutex ; int ldv_mutex_lock_interruptible_usb_address0_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_usb_address0_mutex == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_usb_address0_mutex = 2; return (0); } else { return (-4); } } } int ldv_mutex_lock_killable_usb_address0_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_usb_address0_mutex == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_usb_address0_mutex = 2; return (0); } else { return (-4); } } } void ldv_mutex_lock_usb_address0_mutex(struct mutex *lock ) { { if (ldv_mutex_usb_address0_mutex == 1) { } else { ldv_error(); } ldv_mutex_usb_address0_mutex = 2; return; } } int ldv_mutex_trylock_usb_address0_mutex(struct mutex *lock ) { int is_mutex_held_by_another_thread ; { if (ldv_mutex_usb_address0_mutex == 1) { } else { ldv_error(); } is_mutex_held_by_another_thread = __VERIFIER_nondet_int(); if (is_mutex_held_by_another_thread) { return (0); } else { ldv_mutex_usb_address0_mutex = 2; return (1); } } } int ldv_atomic_dec_and_mutex_lock_usb_address0_mutex(atomic_t *cnt , struct mutex *lock ) { int atomic_value_after_dec ; { if (ldv_mutex_usb_address0_mutex == 1) { } else { ldv_error(); } atomic_value_after_dec = __VERIFIER_nondet_int(); if (atomic_value_after_dec == 0) { ldv_mutex_usb_address0_mutex = 2; return (1); } else { } return (0); } } int ldv_mutex_is_locked_usb_address0_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_usb_address0_mutex == 1) { nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { return (0); } else { return (1); } } else { return (1); } } } void ldv_mutex_unlock_usb_address0_mutex(struct mutex *lock ) { { if (ldv_mutex_usb_address0_mutex == 2) { } else { ldv_error(); } ldv_mutex_usb_address0_mutex = 1; return; } } static int ldv_mutex_usb_bus_list_lock ; int ldv_mutex_lock_interruptible_usb_bus_list_lock(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_usb_bus_list_lock == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_usb_bus_list_lock = 2; return (0); } else { return (-4); } } } int ldv_mutex_lock_killable_usb_bus_list_lock(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_usb_bus_list_lock == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_usb_bus_list_lock = 2; return (0); } else { return (-4); } } } void ldv_mutex_lock_usb_bus_list_lock(struct mutex *lock ) { { if (ldv_mutex_usb_bus_list_lock == 1) { } else { ldv_error(); } ldv_mutex_usb_bus_list_lock = 2; return; } } int ldv_mutex_trylock_usb_bus_list_lock(struct mutex *lock ) { int is_mutex_held_by_another_thread ; { if (ldv_mutex_usb_bus_list_lock == 1) { } else { ldv_error(); } is_mutex_held_by_another_thread = __VERIFIER_nondet_int(); if (is_mutex_held_by_another_thread) { return (0); } else { ldv_mutex_usb_bus_list_lock = 2; return (1); } } } int ldv_atomic_dec_and_mutex_lock_usb_bus_list_lock(atomic_t *cnt , struct mutex *lock ) { int atomic_value_after_dec ; { if (ldv_mutex_usb_bus_list_lock == 1) { } else { ldv_error(); } atomic_value_after_dec = __VERIFIER_nondet_int(); if (atomic_value_after_dec == 0) { ldv_mutex_usb_bus_list_lock = 2; return (1); } else { } return (0); } } int ldv_mutex_is_locked_usb_bus_list_lock(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_usb_bus_list_lock == 1) { nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { return (0); } else { return (1); } } else { return (1); } } } void ldv_mutex_unlock_usb_bus_list_lock(struct mutex *lock ) { { if (ldv_mutex_usb_bus_list_lock == 2) { } else { ldv_error(); } ldv_mutex_usb_bus_list_lock = 1; return; } } static int ldv_mutex_usbfs_mutex ; int ldv_mutex_lock_interruptible_usbfs_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_usbfs_mutex == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_usbfs_mutex = 2; return (0); } else { return (-4); } } } int ldv_mutex_lock_killable_usbfs_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_usbfs_mutex == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_usbfs_mutex = 2; return (0); } else { return (-4); } } } void ldv_mutex_lock_usbfs_mutex(struct mutex *lock ) { { if (ldv_mutex_usbfs_mutex == 1) { } else { ldv_error(); } ldv_mutex_usbfs_mutex = 2; return; } } int ldv_mutex_trylock_usbfs_mutex(struct mutex *lock ) { int is_mutex_held_by_another_thread ; { if (ldv_mutex_usbfs_mutex == 1) { } else { ldv_error(); } is_mutex_held_by_another_thread = __VERIFIER_nondet_int(); if (is_mutex_held_by_another_thread) { return (0); } else { ldv_mutex_usbfs_mutex = 2; return (1); } } } int ldv_atomic_dec_and_mutex_lock_usbfs_mutex(atomic_t *cnt , struct mutex *lock ) { int atomic_value_after_dec ; { if (ldv_mutex_usbfs_mutex == 1) { } else { ldv_error(); } atomic_value_after_dec = __VERIFIER_nondet_int(); if (atomic_value_after_dec == 0) { ldv_mutex_usbfs_mutex = 2; return (1); } else { } return (0); } } int ldv_mutex_is_locked_usbfs_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_usbfs_mutex == 1) { nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { return (0); } else { return (1); } } else { return (1); } } } void ldv_mutex_unlock_usbfs_mutex(struct mutex *lock ) { { if (ldv_mutex_usbfs_mutex == 2) { } else { ldv_error(); } ldv_mutex_usbfs_mutex = 1; return; } } void ldv_initialize(void) { { ldv_mutex_bandwidth_mutex = 1; ldv_mutex_companions_mutex = 1; ldv_mutex_cred_guard_mutex = 1; ldv_mutex_i_mutex = 1; ldv_mutex_lock = 1; ldv_mutex_mtx = 1; ldv_mutex_mutex = 1; ldv_mutex_status_mutex = 1; ldv_mutex_usb_address0_mutex = 1; ldv_mutex_usb_bus_list_lock = 1; ldv_mutex_usbfs_mutex = 1; return; } } void ldv_check_final_state(void) { { if (ldv_mutex_bandwidth_mutex == 1) { } else { ldv_error(); } if (ldv_mutex_companions_mutex == 1) { } else { ldv_error(); } if (ldv_mutex_cred_guard_mutex == 1) { } else { ldv_error(); } if (ldv_mutex_i_mutex == 1) { } else { ldv_error(); } if (ldv_mutex_lock == 1) { } else { ldv_error(); } if (ldv_mutex_mtx == 1) { } else { ldv_error(); } if (ldv_mutex_mutex == 1) { } else { ldv_error(); } if (ldv_mutex_status_mutex == 1) { } else { ldv_error(); } if (ldv_mutex_usb_address0_mutex == 1) { } else { ldv_error(); } if (ldv_mutex_usb_bus_list_lock == 1) { } else { ldv_error(); } if (ldv_mutex_usbfs_mutex == 1) { } else { ldv_error(); } return; } }