extern void __VERIFIER_error() __attribute__ ((__noreturn__)); /* Generated by CIL v. 1.5.1 */ /* print_CIL_Input is false */ struct va_list; 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 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 short umode_t; typedef u64 dma_addr_t; typedef unsigned int __kernel_mode_t; typedef unsigned long __kernel_nlink_t; typedef long __kernel_off_t; typedef int __kernel_pid_t; typedef unsigned int __kernel_uid_t; typedef unsigned int __kernel_gid_t; typedef unsigned long __kernel_size_t; typedef long __kernel_ssize_t; typedef long __kernel_time_t; typedef long __kernel_clock_t; typedef int __kernel_timer_t; typedef int __kernel_clockid_t; typedef long long __kernel_loff_t; typedef __kernel_uid_t __kernel_uid32_t; typedef __kernel_gid_t __kernel_gid32_t; typedef __u32 __kernel_dev_t; typedef __kernel_dev_t dev_t; typedef __kernel_mode_t mode_t; typedef __kernel_nlink_t nlink_t; typedef __kernel_off_t off_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 unsigned char u_char; typedef __s32 int32_t; typedef __u8 uint8_t; typedef __u32 uint32_t; typedef unsigned long sector_t; typedef unsigned long blkcnt_t; typedef __u16 __le16; typedef __u16 __be16; typedef __u32 __le32; typedef __u32 __be32; typedef __u64 __le64; typedef __u32 __wsum; 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 task_struct; 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 ; }; typedef void (*ctor_fn_t)(void); struct kernel_vm86_regs { struct pt_regs pt ; unsigned short es ; unsigned short __esh ; unsigned short ds ; unsigned short __dsh ; unsigned short fs ; unsigned short __fsh ; unsigned short gs ; unsigned short __gsh ; }; union __anonunion____missing_field_name_8 { struct pt_regs *regs ; struct kernel_vm86_regs *vm86 ; }; struct math_emu_info { long ___orig_eip ; union __anonunion____missing_field_name_8 __annonCompField4 ; }; typedef __builtin_va_list __gnuc_va_list; typedef __gnuc_va_list va_list; struct module; struct bug_entry { int bug_addr_disp ; int file_disp ; unsigned short line ; unsigned short flags ; }; struct completion; struct pid; typedef unsigned long pgdval_t; typedef unsigned long pgprotval_t; struct pgprot { pgprotval_t pgprot ; }; typedef struct pgprot pgprot_t; struct __anonstruct_pgd_t_11 { pgdval_t pgd ; }; typedef struct __anonstruct_pgd_t_11 pgd_t; struct page; struct file; struct seq_file; struct __anonstruct____missing_field_name_15 { unsigned int a ; unsigned int b ; }; struct __anonstruct____missing_field_name_16 { u16 limit0 ; u16 base0 ; unsigned char base1 ; unsigned char type : 4 ; unsigned char s : 1 ; unsigned char dpl : 2 ; unsigned char p : 1 ; unsigned char limit : 4 ; unsigned char avl : 1 ; unsigned char l : 1 ; unsigned char d : 1 ; unsigned char g : 1 ; unsigned char base2 ; }; union __anonunion____missing_field_name_14 { struct __anonstruct____missing_field_name_15 __annonCompField6 ; struct __anonstruct____missing_field_name_16 __annonCompField7 ; }; struct desc_struct { union __anonunion____missing_field_name_14 __annonCompField8 ; }; struct thread_struct; struct cpumask; struct arch_spinlock; struct cpumask { unsigned long bits[64U] ; }; typedef struct cpumask cpumask_t; 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 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____missing_field_name_20 { u64 rip ; u64 rdp ; }; struct __anonstruct____missing_field_name_21 { u32 fip ; u32 fcs ; u32 foo ; u32 fos ; }; union __anonunion____missing_field_name_19 { struct __anonstruct____missing_field_name_20 __annonCompField11 ; struct __anonstruct____missing_field_name_21 __annonCompField12 ; }; union __anonunion____missing_field_name_22 { u32 padding1[12U] ; u32 sw_reserved[12U] ; }; struct i387_fxsave_struct { u16 cwd ; u16 swd ; u16 twd ; u16 fop ; union __anonunion____missing_field_name_19 __annonCompField13 ; u32 mxcsr ; u32 mxcsr_mask ; u32 st_space[32U] ; u32 xmm_space[64U] ; u32 padding[12U] ; union __anonunion____missing_field_name_22 __annonCompField14 ; }; 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 { 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_no ; unsigned long error_code ; struct fpu fpu ; unsigned long *io_bitmap_ptr ; unsigned long iopl ; unsigned int io_bitmap_max ; }; struct __anonstruct_mm_segment_t_24 { unsigned long seg ; }; typedef struct __anonstruct_mm_segment_t_24 mm_segment_t; struct timespec; struct compat_timespec; struct __anonstruct____missing_field_name_26 { unsigned long arg0 ; unsigned long arg1 ; unsigned long arg2 ; unsigned long arg3 ; }; struct __anonstruct_futex_27 { u32 *uaddr ; u32 val ; u32 flags ; u32 bitset ; u64 time ; u32 *uaddr2 ; }; struct __anonstruct_nanosleep_28 { clockid_t index ; struct timespec *rmtp ; struct compat_timespec *compat_rmtp ; u64 expires ; }; struct pollfd; struct __anonstruct_poll_29 { struct pollfd *ufds ; int nfds ; int has_timeout ; unsigned long tv_sec ; unsigned long tv_nsec ; }; union __anonunion____missing_field_name_25 { struct __anonstruct____missing_field_name_26 __annonCompField16 ; struct __anonstruct_futex_27 futex ; struct __anonstruct_nanosleep_28 nanosleep ; struct __anonstruct_poll_29 poll ; }; struct restart_block { long (*fn)(struct restart_block * ) ; union __anonunion____missing_field_name_25 __annonCompField17 ; }; typedef atomic64_t atomic_long_t; 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 ; int uaccess_err ; }; struct arch_spinlock { unsigned int slock ; }; typedef struct arch_spinlock arch_spinlock_t; struct __anonstruct_arch_rwlock_t_30 { unsigned int lock ; }; typedef struct __anonstruct_arch_rwlock_t_30 arch_rwlock_t; struct lockdep_map; struct stack_trace { unsigned int nr_entries ; unsigned int max_entries ; unsigned long *entries ; int skip ; }; struct lockdep_subclass_key { char __one_byte ; }; struct lock_class_key { struct lockdep_subclass_key subkeys[8U] ; }; struct lock_class { struct list_head hash_entry ; struct list_head lock_entry ; struct lockdep_subclass_key *key ; unsigned int subclass ; unsigned int dep_gen_id ; unsigned long usage_mask ; struct stack_trace usage_traces[13U] ; struct list_head locks_after ; struct list_head locks_before ; unsigned int version ; unsigned long ops ; char const *name ; int name_version ; unsigned long contention_point[4U] ; unsigned long contending_point[4U] ; }; struct lockdep_map { struct lock_class_key *key ; struct lock_class *class_cache ; 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____missing_field_name_32 { u8 __padding[1U] ; struct lockdep_map dep_map ; }; union __anonunion____missing_field_name_31 { struct raw_spinlock rlock ; struct __anonstruct____missing_field_name_32 __annonCompField18 ; }; struct spinlock { union __anonunion____missing_field_name_31 __annonCompField19 ; }; typedef struct spinlock spinlock_t; struct __anonstruct_rwlock_t_33 { arch_rwlock_t raw_lock ; unsigned int magic ; unsigned int owner_cpu ; void *owner ; struct lockdep_map dep_map ; }; typedef struct __anonstruct_rwlock_t_33 rwlock_t; struct __anonstruct_seqlock_t_34 { unsigned int sequence ; spinlock_t lock ; }; typedef struct __anonstruct_seqlock_t_34 seqlock_t; struct timespec { __kernel_time_t tv_sec ; long tv_nsec ; }; struct kstat { u64 ino ; dev_t dev ; umode_t mode ; unsigned int nlink ; uid_t uid ; gid_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_35 { unsigned long bits[16U] ; }; typedef struct __anonstruct_nodemask_t_35 nodemask_t; struct mutex { atomic_t count ; spinlock_t wait_lock ; struct list_head wait_list ; struct thread_info *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 rw_semaphore; typedef long rwsem_count_t; struct rw_semaphore { rwsem_count_t count ; spinlock_t wait_lock ; struct list_head wait_list ; struct lockdep_map dep_map ; }; struct ctl_table; struct resource { resource_size_t start ; resource_size_t end ; char const *name ; unsigned long flags ; struct resource *parent ; struct resource *sibling ; struct resource *child ; }; struct pci_dev; struct device; 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 ; void *start_site ; char start_comm[16U] ; int start_pid ; 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 ; }; struct completion { unsigned int done ; wait_queue_head_t wait ; }; 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_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 dpm_state { DPM_INVALID = 0, DPM_ON = 1, DPM_PREPARING = 2, DPM_RESUMING = 3, DPM_SUSPENDING = 4, DPM_OFF = 5, DPM_OFF_IRQ = 6 } ; 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_RESUME = 3 } ; struct dev_pm_info { pm_message_t power_state ; unsigned char can_wakeup : 1 ; unsigned char should_wakeup : 1 ; unsigned char async_suspend : 1 ; enum dpm_state status ; struct list_head entry ; struct completion completion ; unsigned long wakeup_count ; struct timer_list suspend_timer ; unsigned long timer_expires ; struct work_struct work ; wait_queue_head_t wait_queue ; spinlock_t lock ; atomic_t usage_count ; atomic_t child_count ; unsigned char disable_depth : 3 ; unsigned char ignore_children : 1 ; 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 ; enum rpm_request request ; enum rpm_status runtime_status ; int runtime_error ; unsigned long active_jiffies ; unsigned long suspended_jiffies ; unsigned long accounting_timestamp ; }; struct __anonstruct_mm_context_t_100 { void *ldt ; int size ; struct mutex lock ; void *vdso ; }; typedef struct __anonstruct_mm_context_t_100 mm_context_t; struct pci_bus; struct vm_area_struct; struct key; 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 const *(*current_ns)(void) ; void const *(*netlink_ns)(struct sock * ) ; void const *(*initial_ns)(void) ; }; struct attribute { char const *name ; mode_t mode ; struct lock_class_key *key ; struct lock_class_key skey ; }; struct attribute_group { char const *name ; mode_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 ) ; }; 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____missing_field_name_110 { 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 ; u16 flags ; union __anonunion____missing_field_name_110 __annonCompField20 ; }; struct kparam_string { unsigned int maxlen ; char *string ; }; struct kparam_array { unsigned int max ; unsigned int *num ; struct kernel_param_ops const *ops ; unsigned int elemsize ; void *elem ; }; struct rcu_head { struct rcu_head *next ; void (*func)(struct rcu_head * ) ; }; struct tracepoint; struct tracepoint_func { void *func ; void *data ; }; struct tracepoint { char const *name ; int state ; void (*regfunc)(void) ; void (*unregfunc)(void) ; struct tracepoint_func *funcs ; }; struct mod_arch_specific { }; struct kernel_symbol { unsigned long value ; char const *name ; }; struct module_attribute { struct attribute attr ; ssize_t (*show)(struct module_attribute * , struct module * , char * ) ; ssize_t (*store)(struct module_attribute * , struct module * , char const * , size_t ) ; void (*setup)(struct module * , char const * ) ; int (*test)(struct module * ) ; void (*free)(struct module * ) ; }; struct module_param_attrs; struct module_kobject { struct kobject kobj ; struct module *mod ; struct kobject *drivers_dir ; struct module_param_attrs *mp ; }; struct exception_table_entry; enum module_state { MODULE_STATE_LIVE = 0, MODULE_STATE_COMING = 1, MODULE_STATE_GOING = 2 } ; struct module_ref { unsigned int incs ; unsigned int 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 ; 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 ; void *percpu ; unsigned int percpu_size ; char *args ; struct tracepoint *tracepoints ; unsigned int num_tracepoints ; char const **trace_bprintk_fmt_start ; unsigned int num_trace_bprintk_fmt ; 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 sdio_func; struct kmem_cache_cpu { void **freelist ; struct page *page ; int node ; unsigned int stat[18U] ; }; 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 ; int size ; int objsize ; int offset ; 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 ; unsigned long min_partial ; 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 ieee80211_hw; struct b43_wldev; struct ssb_device; struct b43_dmaring; struct device_attribute; struct pcmcia_device; struct iovec { void *iov_base ; __kernel_size_t iov_len ; }; struct cred; typedef unsigned short sa_family_t; struct sockaddr { sa_family_t sa_family ; char sa_data[14U] ; }; struct __anonstruct_sync_serial_settings_111 { unsigned int clock_rate ; unsigned int clock_type ; unsigned short loopback ; }; typedef struct __anonstruct_sync_serial_settings_111 sync_serial_settings; struct __anonstruct_te1_settings_112 { unsigned int clock_rate ; unsigned int clock_type ; unsigned short loopback ; unsigned int slot_map ; }; typedef struct __anonstruct_te1_settings_112 te1_settings; struct __anonstruct_raw_hdlc_proto_113 { unsigned short encoding ; unsigned short parity ; }; typedef struct __anonstruct_raw_hdlc_proto_113 raw_hdlc_proto; struct __anonstruct_fr_proto_114 { unsigned int t391 ; unsigned int t392 ; unsigned int n391 ; unsigned int n392 ; unsigned int n393 ; unsigned short lmi ; unsigned short dce ; }; typedef struct __anonstruct_fr_proto_114 fr_proto; struct __anonstruct_fr_proto_pvc_115 { unsigned int dlci ; }; typedef struct __anonstruct_fr_proto_pvc_115 fr_proto_pvc; struct __anonstruct_fr_proto_pvc_info_116 { unsigned int dlci ; char master[16U] ; }; typedef struct __anonstruct_fr_proto_pvc_info_116 fr_proto_pvc_info; struct __anonstruct_cisco_proto_117 { unsigned int interval ; unsigned int timeout ; }; typedef struct __anonstruct_cisco_proto_117 cisco_proto; struct ifmap { unsigned long mem_start ; unsigned long mem_end ; unsigned short base_addr ; unsigned char irq ; unsigned char dma ; unsigned char port ; }; union __anonunion_ifs_ifsu_118 { raw_hdlc_proto *raw_hdlc ; cisco_proto *cisco ; fr_proto *fr ; fr_proto_pvc *fr_pvc ; fr_proto_pvc_info *fr_pvc_info ; sync_serial_settings *sync ; te1_settings *te1 ; }; struct if_settings { unsigned int type ; unsigned int size ; union __anonunion_ifs_ifsu_118 ifs_ifsu ; }; union __anonunion_ifr_ifrn_119 { char ifrn_name[16U] ; }; union __anonunion_ifr_ifru_120 { struct sockaddr ifru_addr ; struct sockaddr ifru_dstaddr ; struct sockaddr ifru_broadaddr ; struct sockaddr ifru_netmask ; struct sockaddr ifru_hwaddr ; short ifru_flags ; int ifru_ivalue ; int ifru_mtu ; struct ifmap ifru_map ; char ifru_slave[16U] ; char ifru_newname[16U] ; void *ifru_data ; struct if_settings ifru_settings ; }; struct ifreq { union __anonunion_ifr_ifrn_119 ifr_ifrn ; union __anonunion_ifr_ifru_120 ifr_ifru ; }; struct prio_tree_node; struct raw_prio_tree_node { struct prio_tree_node *left ; struct prio_tree_node *right ; struct prio_tree_node *parent ; }; struct prio_tree_node { struct prio_tree_node *left ; struct prio_tree_node *right ; struct prio_tree_node *parent ; unsigned long start ; unsigned long last ; }; struct prio_tree_root { struct prio_tree_node *prio_tree_node ; unsigned short index_bits ; unsigned short raw ; }; 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 address_space; struct __anonstruct____missing_field_name_123 { u16 inuse ; u16 objects ; }; union __anonunion____missing_field_name_122 { atomic_t _mapcount ; struct __anonstruct____missing_field_name_123 __annonCompField21 ; }; struct __anonstruct____missing_field_name_125 { unsigned long private ; struct address_space *mapping ; }; union __anonunion____missing_field_name_124 { struct __anonstruct____missing_field_name_125 __annonCompField23 ; struct kmem_cache *slab ; struct page *first_page ; }; union __anonunion____missing_field_name_126 { unsigned long index ; void *freelist ; }; struct page { unsigned long flags ; atomic_t _count ; union __anonunion____missing_field_name_122 __annonCompField22 ; union __anonunion____missing_field_name_124 __annonCompField24 ; union __anonunion____missing_field_name_126 __annonCompField25 ; struct list_head lru ; }; struct __anonstruct_vm_set_128 { struct list_head list ; void *parent ; struct vm_area_struct *head ; }; union __anonunion_shared_127 { struct __anonstruct_vm_set_128 vm_set ; struct raw_prio_tree_node prio_tree_node ; }; 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_127 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 ; unsigned long vm_truncate_count ; 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 { unsigned long 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 ; struct rw_semaphore mmap_sem ; spinlock_t page_table_lock ; struct list_head mmlist ; unsigned long hiwater_rss ; unsigned long hiwater_vm ; unsigned long total_vm ; unsigned long locked_vm ; unsigned long shared_vm ; unsigned long exec_vm ; unsigned long stack_vm ; unsigned long reserved_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_t cpu_vm_mask ; mm_context_t context ; unsigned int faultstamp ; unsigned int token_priority ; unsigned int last_interval ; 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 ; unsigned long num_exe_file_vmas ; struct mmu_notifier_mm *mmu_notifier_mm ; }; struct poll_table_struct; struct pipe_inode_info; struct inode; struct net; struct fasync_struct; struct kiocb; struct nsproxy; struct ctl_table_root; struct ctl_table_set { struct list_head list ; struct ctl_table_set *parent ; int (*is_seen)(struct ctl_table_set * ) ; }; struct ctl_table_header; typedef int proc_handler(struct ctl_table * , int , void * , size_t * , loff_t * ); struct ctl_table { char const *procname ; void *data ; int maxlen ; mode_t mode ; struct ctl_table *child ; struct ctl_table *parent ; proc_handler *proc_handler ; void *extra1 ; void *extra2 ; }; struct ctl_table_root { struct list_head root_list ; struct ctl_table_set default_set ; struct ctl_table_set *(*lookup)(struct ctl_table_root * , struct nsproxy * ) ; int (*permissions)(struct ctl_table_root * , struct nsproxy * , struct ctl_table * ) ; }; struct ctl_table_header { struct ctl_table *ctl_table ; struct list_head ctl_entry ; int used ; int count ; struct completion *unregistering ; struct ctl_table *ctl_table_arg ; struct ctl_table_root *root ; struct ctl_table_set *set ; struct ctl_table *attached_by ; struct ctl_table *attached_to ; struct ctl_table_header *parent ; }; struct exception_table_entry { unsigned long insn ; unsigned long fixup ; }; struct sk_buff; 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 class_private; struct bus_type; struct bus_type_private; struct bus_attribute { struct attribute attr ; ssize_t (*show)(struct bus_type * , char * ) ; ssize_t (*store)(struct bus_type * , char const * , size_t ) ; }; struct driver_attribute; struct bus_type { char const *name ; 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 bus_type_private *p ; }; struct device_driver { char const *name ; struct bus_type *bus ; struct module *owner ; char const *mod_name ; bool suppress_bind_attrs ; 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 kobject *dev_kobj ; int (*dev_uevent)(struct device * , struct kobj_uevent_env * ) ; char *(*devnode)(struct device * , mode_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 class_private *p ; }; struct device_type; struct class_attribute { struct attribute attr ; ssize_t (*show)(struct class * , struct class_attribute * , char * ) ; ssize_t (*store)(struct class * , struct class_attribute * , char const * , size_t ) ; }; struct device_type { char const *name ; struct attribute_group const **groups ; int (*uevent)(struct device * , struct kobj_uevent_env * ) ; char *(*devnode)(struct device * , mode_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 *type ; struct mutex mutex ; struct bus_type *bus ; struct device_driver *driver ; void *platform_data ; struct dev_pm_info power ; 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 ; dev_t devt ; 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 dma_attrs { unsigned long flags[1U] ; }; 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 file_ra_state; struct user_struct; struct writeback_control; 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 ) ; }; enum dma_data_direction { DMA_BIDIRECTIONAL = 0, DMA_TO_DEVICE = 1, DMA_FROM_DEVICE = 2, DMA_NONE = 3 } ; struct dma_map_ops { void *(*alloc_coherent)(struct device * , size_t , dma_addr_t * , gfp_t ) ; void (*free_coherent)(struct device * , size_t , void * , dma_addr_t ) ; 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 ; }; typedef s32 dma_cookie_t; struct hrtimer_clock_base; struct hrtimer_cpu_base; enum hrtimer_restart { HRTIMER_NORESTART = 0, HRTIMER_RESTART = 1 } ; struct hrtimer { struct rb_node node ; ktime_t _expires ; 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 ; clockid_t index ; struct rb_root active ; struct rb_node *first ; ktime_t resolution ; ktime_t (*get_time)(void) ; ktime_t softirq_time ; ktime_t offset ; }; struct hrtimer_cpu_base { raw_spinlock_t lock ; struct hrtimer_clock_base clock_base[2U] ; 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 net_device; struct nf_conntrack { atomic_t use ; }; struct nf_bridge_info { atomic_t use ; struct net_device *physindev ; struct net_device *physoutdev ; unsigned int mask ; unsigned long data[4U] ; }; struct sk_buff_head { struct sk_buff *next ; struct sk_buff *prev ; __u32 qlen ; spinlock_t lock ; }; struct skb_frag_struct; typedef struct skb_frag_struct skb_frag_t; struct skb_frag_struct { struct page *page ; __u32 page_offset ; __u32 size ; }; struct skb_shared_hwtstamps { ktime_t hwtstamp ; ktime_t syststamp ; }; struct __anonstruct____missing_field_name_130 { unsigned char hardware : 1 ; unsigned char software : 1 ; unsigned char in_progress : 1 ; unsigned char prevent_sk_orphan : 1 ; }; union skb_shared_tx { struct __anonstruct____missing_field_name_130 __annonCompField26 ; __u8 flags ; }; struct skb_shared_info { unsigned short nr_frags ; unsigned short gso_size ; unsigned short gso_segs ; unsigned short gso_type ; __be32 ip6_frag_id ; union skb_shared_tx tx_flags ; struct sk_buff *frag_list ; struct skb_shared_hwtstamps hwtstamps ; atomic_t dataref ; void *destructor_arg ; skb_frag_t frags[18U] ; }; typedef unsigned int sk_buff_data_t; struct sec_path; struct __anonstruct____missing_field_name_132 { __u16 csum_start ; __u16 csum_offset ; }; union __anonunion____missing_field_name_131 { __wsum csum ; struct __anonstruct____missing_field_name_132 __annonCompField27 ; }; union __anonunion____missing_field_name_133 { __u32 mark ; __u32 dropcount ; }; struct sk_buff { struct sk_buff *next ; struct sk_buff *prev ; ktime_t tstamp ; struct sock *sk ; struct net_device *dev ; char cb[48U] ; unsigned long _skb_refdst ; struct sec_path *sp ; unsigned int len ; unsigned int data_len ; __u16 mac_len ; __u16 hdr_len ; union __anonunion____missing_field_name_131 __annonCompField28 ; __u32 priority ; unsigned char local_df : 1 ; unsigned char cloned : 1 ; unsigned char ip_summed : 2 ; unsigned char nohdr : 1 ; unsigned char nfctinfo : 3 ; unsigned char pkt_type : 3 ; unsigned char fclone : 2 ; unsigned char ipvs_property : 1 ; unsigned char peeked : 1 ; unsigned char nf_trace : 1 ; __be16 protocol ; void (*destructor)(struct sk_buff * ) ; struct nf_conntrack *nfct ; struct sk_buff *nfct_reasm ; struct nf_bridge_info *nf_bridge ; int skb_iif ; __u16 tc_index ; __u16 tc_verd ; __u32 rxhash ; __u16 queue_mapping ; unsigned char ndisc_nodetype : 2 ; unsigned char deliver_no_wcard : 1 ; dma_cookie_t dma_cookie ; __u32 secmark ; union __anonunion____missing_field_name_133 __annonCompField29 ; __u16 vlan_tci ; sk_buff_data_t transport_header ; sk_buff_data_t network_header ; sk_buff_data_t mac_header ; sk_buff_data_t tail ; sk_buff_data_t end ; unsigned char *head ; unsigned char *data ; unsigned int truesize ; atomic_t users ; }; struct dst_entry; struct nlattr { __u16 nla_len ; __u16 nla_type ; }; struct kernel_cap_struct { __u32 cap[2U] ; }; typedef struct kernel_cap_struct kernel_cap_t; struct dentry; struct rtnl_link_stats64 { __u64 rx_packets ; __u64 tx_packets ; __u64 rx_bytes ; __u64 tx_bytes ; __u64 rx_errors ; __u64 tx_errors ; __u64 rx_dropped ; __u64 tx_dropped ; __u64 multicast ; __u64 collisions ; __u64 rx_length_errors ; __u64 rx_over_errors ; __u64 rx_crc_errors ; __u64 rx_frame_errors ; __u64 rx_fifo_errors ; __u64 rx_missed_errors ; __u64 tx_aborted_errors ; __u64 tx_carrier_errors ; __u64 tx_fifo_errors ; __u64 tx_heartbeat_errors ; __u64 tx_window_errors ; __u64 rx_compressed ; __u64 tx_compressed ; }; struct ifla_vf_info { __u32 vf ; __u8 mac[32U] ; __u32 vlan ; __u32 qos ; __u32 tx_rate ; }; struct plist_head { struct list_head prio_list ; struct list_head node_list ; raw_spinlock_t *rawlock ; spinlock_t *spinlock ; }; struct plist_node { int prio ; struct plist_head plist ; }; struct file_operations; struct pm_qos_request_list { struct plist_node list ; int pm_qos_class ; }; struct ethtool_cmd { __u32 cmd ; __u32 supported ; __u32 advertising ; __u16 speed ; __u8 duplex ; __u8 port ; __u8 phy_address ; __u8 transceiver ; __u8 autoneg ; __u8 mdio_support ; __u32 maxtxpkt ; __u32 maxrxpkt ; __u16 speed_hi ; __u8 eth_tp_mdix ; __u8 reserved2 ; __u32 lp_advertising ; __u32 reserved[2U] ; }; struct ethtool_drvinfo { __u32 cmd ; char driver[32U] ; char version[32U] ; char fw_version[32U] ; char bus_info[32U] ; char reserved1[32U] ; char reserved2[12U] ; __u32 n_priv_flags ; __u32 n_stats ; __u32 testinfo_len ; __u32 eedump_len ; __u32 regdump_len ; }; struct ethtool_wolinfo { __u32 cmd ; __u32 supported ; __u32 wolopts ; __u8 sopass[6U] ; }; struct ethtool_regs { __u32 cmd ; __u32 version ; __u32 len ; __u8 data[0U] ; }; struct ethtool_eeprom { __u32 cmd ; __u32 magic ; __u32 offset ; __u32 len ; __u8 data[0U] ; }; struct ethtool_coalesce { __u32 cmd ; __u32 rx_coalesce_usecs ; __u32 rx_max_coalesced_frames ; __u32 rx_coalesce_usecs_irq ; __u32 rx_max_coalesced_frames_irq ; __u32 tx_coalesce_usecs ; __u32 tx_max_coalesced_frames ; __u32 tx_coalesce_usecs_irq ; __u32 tx_max_coalesced_frames_irq ; __u32 stats_block_coalesce_usecs ; __u32 use_adaptive_rx_coalesce ; __u32 use_adaptive_tx_coalesce ; __u32 pkt_rate_low ; __u32 rx_coalesce_usecs_low ; __u32 rx_max_coalesced_frames_low ; __u32 tx_coalesce_usecs_low ; __u32 tx_max_coalesced_frames_low ; __u32 pkt_rate_high ; __u32 rx_coalesce_usecs_high ; __u32 rx_max_coalesced_frames_high ; __u32 tx_coalesce_usecs_high ; __u32 tx_max_coalesced_frames_high ; __u32 rate_sample_interval ; }; struct ethtool_ringparam { __u32 cmd ; __u32 rx_max_pending ; __u32 rx_mini_max_pending ; __u32 rx_jumbo_max_pending ; __u32 tx_max_pending ; __u32 rx_pending ; __u32 rx_mini_pending ; __u32 rx_jumbo_pending ; __u32 tx_pending ; }; struct ethtool_pauseparam { __u32 cmd ; __u32 autoneg ; __u32 rx_pause ; __u32 tx_pause ; }; struct ethtool_test { __u32 cmd ; __u32 flags ; __u32 reserved ; __u32 len ; __u64 data[0U] ; }; struct ethtool_stats { __u32 cmd ; __u32 n_stats ; __u64 data[0U] ; }; struct ethtool_tcpip4_spec { __be32 ip4src ; __be32 ip4dst ; __be16 psrc ; __be16 pdst ; __u8 tos ; }; struct ethtool_ah_espip4_spec { __be32 ip4src ; __be32 ip4dst ; __be32 spi ; __u8 tos ; }; struct ethtool_rawip4_spec { __be32 ip4src ; __be32 ip4dst ; __u8 hdata[64U] ; }; struct ethtool_ether_spec { __be16 ether_type ; __u8 frame_size ; __u8 eframe[16U] ; }; struct ethtool_usrip4_spec { __be32 ip4src ; __be32 ip4dst ; __be32 l4_4_bytes ; __u8 tos ; __u8 ip_ver ; __u8 proto ; }; union __anonunion_h_u_135 { struct ethtool_tcpip4_spec tcp_ip4_spec ; struct ethtool_tcpip4_spec udp_ip4_spec ; struct ethtool_tcpip4_spec sctp_ip4_spec ; struct ethtool_ah_espip4_spec ah_ip4_spec ; struct ethtool_ah_espip4_spec esp_ip4_spec ; struct ethtool_rawip4_spec raw_ip4_spec ; struct ethtool_ether_spec ether_spec ; struct ethtool_usrip4_spec usr_ip4_spec ; __u8 hdata[64U] ; }; union __anonunion_m_u_136 { struct ethtool_tcpip4_spec tcp_ip4_spec ; struct ethtool_tcpip4_spec udp_ip4_spec ; struct ethtool_tcpip4_spec sctp_ip4_spec ; struct ethtool_ah_espip4_spec ah_ip4_spec ; struct ethtool_ah_espip4_spec esp_ip4_spec ; struct ethtool_rawip4_spec raw_ip4_spec ; struct ethtool_ether_spec ether_spec ; struct ethtool_usrip4_spec usr_ip4_spec ; __u8 hdata[64U] ; }; struct ethtool_rx_flow_spec { __u32 flow_type ; union __anonunion_h_u_135 h_u ; union __anonunion_m_u_136 m_u ; __u64 ring_cookie ; __u32 location ; }; struct ethtool_rxnfc { __u32 cmd ; __u32 flow_type ; __u64 data ; struct ethtool_rx_flow_spec fs ; __u32 rule_cnt ; __u32 rule_locs[0U] ; }; struct ethtool_rxfh_indir { __u32 cmd ; __u32 size ; __u32 ring_index[0U] ; }; union __anonunion_h_u_137 { struct ethtool_tcpip4_spec tcp_ip4_spec ; struct ethtool_tcpip4_spec udp_ip4_spec ; struct ethtool_tcpip4_spec sctp_ip4_spec ; struct ethtool_ah_espip4_spec ah_ip4_spec ; struct ethtool_ah_espip4_spec esp_ip4_spec ; struct ethtool_rawip4_spec raw_ip4_spec ; struct ethtool_ether_spec ether_spec ; struct ethtool_usrip4_spec usr_ip4_spec ; __u8 hdata[64U] ; }; union __anonunion_m_u_138 { struct ethtool_tcpip4_spec tcp_ip4_spec ; struct ethtool_tcpip4_spec udp_ip4_spec ; struct ethtool_tcpip4_spec sctp_ip4_spec ; struct ethtool_ah_espip4_spec ah_ip4_spec ; struct ethtool_ah_espip4_spec esp_ip4_spec ; struct ethtool_rawip4_spec raw_ip4_spec ; struct ethtool_ether_spec ether_spec ; struct ethtool_usrip4_spec usr_ip4_spec ; __u8 hdata[64U] ; }; struct ethtool_rx_ntuple_flow_spec { __u32 flow_type ; union __anonunion_h_u_137 h_u ; union __anonunion_m_u_138 m_u ; __u16 vlan_tag ; __u16 vlan_tag_mask ; __u64 data ; __u64 data_mask ; __s32 action ; }; struct ethtool_rx_ntuple { __u32 cmd ; struct ethtool_rx_ntuple_flow_spec fs ; }; struct ethtool_flash { __u32 cmd ; __u32 region ; char data[128U] ; }; struct ethtool_rx_ntuple_list { struct list_head list ; unsigned int count ; }; struct ethtool_ops { int (*get_settings)(struct net_device * , struct ethtool_cmd * ) ; int (*set_settings)(struct net_device * , struct ethtool_cmd * ) ; void (*get_drvinfo)(struct net_device * , struct ethtool_drvinfo * ) ; int (*get_regs_len)(struct net_device * ) ; void (*get_regs)(struct net_device * , struct ethtool_regs * , void * ) ; void (*get_wol)(struct net_device * , struct ethtool_wolinfo * ) ; int (*set_wol)(struct net_device * , struct ethtool_wolinfo * ) ; u32 (*get_msglevel)(struct net_device * ) ; void (*set_msglevel)(struct net_device * , u32 ) ; int (*nway_reset)(struct net_device * ) ; u32 (*get_link)(struct net_device * ) ; int (*get_eeprom_len)(struct net_device * ) ; int (*get_eeprom)(struct net_device * , struct ethtool_eeprom * , u8 * ) ; int (*set_eeprom)(struct net_device * , struct ethtool_eeprom * , u8 * ) ; int (*get_coalesce)(struct net_device * , struct ethtool_coalesce * ) ; int (*set_coalesce)(struct net_device * , struct ethtool_coalesce * ) ; void (*get_ringparam)(struct net_device * , struct ethtool_ringparam * ) ; int (*set_ringparam)(struct net_device * , struct ethtool_ringparam * ) ; void (*get_pauseparam)(struct net_device * , struct ethtool_pauseparam * ) ; int (*set_pauseparam)(struct net_device * , struct ethtool_pauseparam * ) ; u32 (*get_rx_csum)(struct net_device * ) ; int (*set_rx_csum)(struct net_device * , u32 ) ; u32 (*get_tx_csum)(struct net_device * ) ; int (*set_tx_csum)(struct net_device * , u32 ) ; u32 (*get_sg)(struct net_device * ) ; int (*set_sg)(struct net_device * , u32 ) ; u32 (*get_tso)(struct net_device * ) ; int (*set_tso)(struct net_device * , u32 ) ; void (*self_test)(struct net_device * , struct ethtool_test * , u64 * ) ; void (*get_strings)(struct net_device * , u32 , u8 * ) ; int (*phys_id)(struct net_device * , u32 ) ; void (*get_ethtool_stats)(struct net_device * , struct ethtool_stats * , u64 * ) ; int (*begin)(struct net_device * ) ; void (*complete)(struct net_device * ) ; u32 (*get_ufo)(struct net_device * ) ; int (*set_ufo)(struct net_device * , u32 ) ; u32 (*get_flags)(struct net_device * ) ; int (*set_flags)(struct net_device * , u32 ) ; u32 (*get_priv_flags)(struct net_device * ) ; int (*set_priv_flags)(struct net_device * , u32 ) ; int (*get_sset_count)(struct net_device * , int ) ; int (*get_rxnfc)(struct net_device * , struct ethtool_rxnfc * , void * ) ; int (*set_rxnfc)(struct net_device * , struct ethtool_rxnfc * ) ; int (*flash_device)(struct net_device * , struct ethtool_flash * ) ; int (*reset)(struct net_device * , u32 * ) ; int (*set_rx_ntuple)(struct net_device * , struct ethtool_rx_ntuple * ) ; int (*get_rx_ntuple)(struct net_device * , u32 , void * ) ; int (*get_rxfh_indir)(struct net_device * , struct ethtool_rxfh_indir * ) ; int (*set_rxfh_indir)(struct net_device * , struct ethtool_rxfh_indir const * ) ; }; struct prot_inuse; struct netns_core { struct ctl_table_header *sysctl_hdr ; int sysctl_somaxconn ; struct prot_inuse *inuse ; }; struct u64_stats_sync { }; struct ipstats_mib { u64 mibs[31U] ; struct u64_stats_sync syncp ; }; struct icmp_mib { unsigned long mibs[28U] ; }; struct icmpmsg_mib { unsigned long mibs[512U] ; }; struct icmpv6_mib { unsigned long mibs[5U] ; }; struct icmpv6msg_mib { unsigned long mibs[512U] ; }; struct tcp_mib { unsigned long mibs[15U] ; }; struct udp_mib { unsigned long mibs[7U] ; }; struct linux_mib { unsigned long mibs[79U] ; }; struct linux_xfrm_mib { unsigned long mibs[27U] ; }; struct proc_dir_entry; struct netns_mib { struct tcp_mib *tcp_statistics[2U] ; struct ipstats_mib *ip_statistics[2U] ; struct linux_mib *net_statistics[2U] ; struct udp_mib *udp_statistics[2U] ; struct udp_mib *udplite_statistics[2U] ; struct icmp_mib *icmp_statistics[2U] ; struct icmpmsg_mib *icmpmsg_statistics[2U] ; struct proc_dir_entry *proc_net_devsnmp6 ; struct udp_mib *udp_stats_in6[2U] ; struct udp_mib *udplite_stats_in6[2U] ; struct ipstats_mib *ipv6_statistics[2U] ; struct icmpv6_mib *icmpv6_statistics[2U] ; struct icmpv6msg_mib *icmpv6msg_statistics[2U] ; struct linux_xfrm_mib *xfrm_statistics[2U] ; }; struct netns_unix { int sysctl_max_dgram_qlen ; struct ctl_table_header *ctl ; }; struct netns_packet { spinlock_t sklist_lock ; struct hlist_head sklist ; }; struct netns_frags { int nqueues ; atomic_t mem ; struct list_head lru_list ; int timeout ; int high_thresh ; int low_thresh ; }; struct ipv4_devconf; struct fib_rules_ops; struct xt_table; struct netns_ipv4 { struct ctl_table_header *forw_hdr ; struct ctl_table_header *frags_hdr ; struct ctl_table_header *ipv4_hdr ; struct ctl_table_header *route_hdr ; struct ipv4_devconf *devconf_all ; struct ipv4_devconf *devconf_dflt ; struct fib_rules_ops *rules_ops ; struct hlist_head *fib_table_hash ; struct sock *fibnl ; struct sock **icmp_sk ; struct sock *tcp_sock ; struct netns_frags frags ; struct xt_table *iptable_filter ; struct xt_table *iptable_mangle ; struct xt_table *iptable_raw ; struct xt_table *arptable_filter ; struct xt_table *iptable_security ; struct xt_table *nat_table ; struct hlist_head *nat_bysource ; unsigned int nat_htable_size ; int nat_vmalloced ; int sysctl_icmp_echo_ignore_all ; int sysctl_icmp_echo_ignore_broadcasts ; int sysctl_icmp_ignore_bogus_error_responses ; int sysctl_icmp_ratelimit ; int sysctl_icmp_ratemask ; int sysctl_icmp_errors_use_inbound_ifaddr ; int sysctl_rt_cache_rebuild_count ; int current_rt_cache_rebuild_count ; atomic_t rt_genid ; struct list_head mr_tables ; struct fib_rules_ops *mr_rules_ops ; }; struct dst_ops { unsigned short family ; __be16 protocol ; unsigned int gc_thresh ; int (*gc)(struct dst_ops * ) ; struct dst_entry *(*check)(struct dst_entry * , __u32 ) ; void (*destroy)(struct dst_entry * ) ; void (*ifdown)(struct dst_entry * , struct net_device * , int ) ; struct dst_entry *(*negative_advice)(struct dst_entry * ) ; void (*link_failure)(struct sk_buff * ) ; void (*update_pmtu)(struct dst_entry * , u32 ) ; int (*local_out)(struct sk_buff * ) ; atomic_t entries ; struct kmem_cache *kmem_cachep ; }; struct netns_sysctl_ipv6 { struct ctl_table_header *table ; struct ctl_table_header *frags_hdr ; int bindv6only ; int flush_delay ; int ip6_rt_max_size ; int ip6_rt_gc_min_interval ; int ip6_rt_gc_timeout ; int ip6_rt_gc_interval ; int ip6_rt_gc_elasticity ; int ip6_rt_mtu_expires ; int ip6_rt_min_advmss ; int icmpv6_time ; }; struct ipv6_devconf; struct rt6_info; struct rt6_statistics; struct fib6_table; struct netns_ipv6 { struct netns_sysctl_ipv6 sysctl ; struct ipv6_devconf *devconf_all ; struct ipv6_devconf *devconf_dflt ; struct netns_frags frags ; struct xt_table *ip6table_filter ; struct xt_table *ip6table_mangle ; struct xt_table *ip6table_raw ; struct xt_table *ip6table_security ; struct rt6_info *ip6_null_entry ; struct rt6_statistics *rt6_stats ; struct timer_list ip6_fib_timer ; struct hlist_head *fib_table_hash ; struct fib6_table *fib6_main_tbl ; struct dst_ops ip6_dst_ops ; unsigned int ip6_rt_gc_expire ; unsigned long ip6_rt_last_gc ; struct rt6_info *ip6_prohibit_entry ; struct rt6_info *ip6_blk_hole_entry ; struct fib6_table *fib6_local_tbl ; struct fib_rules_ops *fib6_rules_ops ; struct sock **icmp_sk ; struct sock *ndisc_sk ; struct sock *tcp_sk ; struct sock *igmp_sk ; struct list_head mr6_tables ; struct fib_rules_ops *mr6_rules_ops ; }; struct netns_dccp { struct sock *v4_ctl_sk ; struct sock *v6_ctl_sk ; }; struct block_device; struct nameidata; struct path; struct vfsmount; struct qstr { unsigned int hash ; unsigned int len ; unsigned char const *name ; }; union __anonunion_d_u_149 { struct list_head d_child ; struct rcu_head d_rcu ; }; struct dentry_operations; struct super_block; struct dentry { atomic_t d_count ; unsigned int d_flags ; spinlock_t d_lock ; int d_mounted ; struct inode *d_inode ; struct hlist_node d_hash ; struct dentry *d_parent ; struct qstr d_name ; struct list_head d_lru ; union __anonunion_d_u_149 d_u ; struct list_head d_subdirs ; struct list_head d_alias ; unsigned long d_time ; struct dentry_operations const *d_op ; struct super_block *d_sb ; void *d_fsdata ; unsigned char d_iname[32U] ; }; struct dentry_operations { int (*d_revalidate)(struct dentry * , struct nameidata * ) ; int (*d_hash)(struct dentry * , struct qstr * ) ; int (*d_compare)(struct dentry * , struct qstr * , struct qstr * ) ; int (*d_delete)(struct dentry * ) ; void (*d_release)(struct dentry * ) ; void (*d_iput)(struct dentry * , struct inode * ) ; char *(*d_dname)(struct dentry * , char * , int ) ; }; 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 rcu_head rcu ; struct upid numbers[1U] ; }; struct pid_link { struct hlist_node node ; struct pid *pid ; }; struct fiemap_extent { __u64 fe_logical ; __u64 fe_physical ; __u64 fe_length ; __u64 fe_reserved64[2U] ; __u32 fe_flags ; __u32 fe_reserved[3U] ; }; struct export_operations; struct kstatfs; struct iattr { unsigned int ia_valid ; umode_t ia_mode ; uid_t ia_uid ; gid_t ia_gid ; loff_t ia_size ; struct timespec ia_atime ; struct timespec ia_mtime ; struct timespec ia_ctime ; struct file *ia_file ; }; struct if_dqinfo { __u64 dqi_bgrace ; __u64 dqi_igrace ; __u32 dqi_flags ; __u32 dqi_valid ; }; 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 qid_t; typedef long long qsize_t; 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 ; unsigned int dq_id ; loff_t dq_off ; unsigned long dq_flags ; short dq_type ; 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 , char * ) ; int (*quota_off)(struct super_block * , int ) ; int (*quota_sync)(struct super_block * , int , 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 * , int , qid_t , struct fs_disk_quota * ) ; int (*set_dqblk)(struct super_block * , int , qid_t , 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] ; }; union __anonunion_arg_151 { char *buf ; void *data ; }; struct __anonstruct_read_descriptor_t_150 { size_t written ; size_t count ; union __anonunion_arg_151 arg ; int error ; }; typedef struct __anonstruct_read_descriptor_t_150 read_descriptor_t; struct address_space_operations { int (*writepage)(struct page * , struct writeback_control * ) ; int (*readpage)(struct file * , struct page * ) ; void (*sync_page)(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 ) ; 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 * ) ; 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 * ) ; }; 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 prio_tree_root i_mmap ; struct list_head i_mmap_nonlinear ; spinlock_t i_mmap_lock ; unsigned int truncate_count ; 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 hd_struct; struct gendisk; struct block_device { dev_t bd_dev ; struct inode *bd_inode ; struct super_block *bd_super ; int bd_openers ; struct mutex bd_mutex ; struct list_head bd_inodes ; void *bd_claiming ; void *bd_holder ; int bd_holders ; struct list_head bd_holder_list ; 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 list_head bd_list ; unsigned long bd_private ; int bd_fsfreeze_count ; struct mutex bd_fsfreeze_mutex ; }; struct posix_acl; struct inode_operations; struct file_lock; struct cdev; union __anonunion____missing_field_name_152 { struct pipe_inode_info *i_pipe ; struct block_device *i_bdev ; struct cdev *i_cdev ; }; struct inode { struct hlist_node i_hash ; struct list_head i_list ; struct list_head i_sb_list ; struct list_head i_dentry ; unsigned long i_ino ; atomic_t i_count ; unsigned int i_nlink ; uid_t i_uid ; gid_t i_gid ; dev_t i_rdev ; unsigned int i_blkbits ; u64 i_version ; loff_t i_size ; struct timespec i_atime ; struct timespec i_mtime ; struct timespec i_ctime ; blkcnt_t i_blocks ; unsigned short i_bytes ; umode_t i_mode ; spinlock_t i_lock ; struct mutex i_mutex ; struct rw_semaphore i_alloc_sem ; struct inode_operations const *i_op ; struct file_operations const *i_fop ; struct super_block *i_sb ; struct file_lock *i_flock ; struct address_space *i_mapping ; struct address_space i_data ; struct dquot *i_dquot[2U] ; struct list_head i_devices ; union __anonunion____missing_field_name_152 __annonCompField30 ; __u32 i_generation ; __u32 i_fsnotify_mask ; struct hlist_head i_fsnotify_marks ; unsigned long i_state ; unsigned long dirtied_when ; unsigned int i_flags ; atomic_t i_writecount ; void *i_security ; struct posix_acl *i_acl ; struct posix_acl *i_default_acl ; void *i_private ; }; struct fown_struct { rwlock_t lock ; struct pid *pid ; enum pid_type pid_type ; uid_t uid ; uid_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_153 { struct list_head fu_list ; struct rcu_head fu_rcuhead ; }; struct file { union __anonunion_f_u_153 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 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 (*fl_compare_owner)(struct file_lock * , struct file_lock * ) ; void (*fl_notify)(struct file_lock * ) ; int (*fl_grant)(struct file_lock * , struct file_lock * , int ) ; void (*fl_copy_lock)(struct file_lock * , struct file_lock * ) ; void (*fl_release_private)(struct file_lock * ) ; void (*fl_break)(struct file_lock * ) ; int (*fl_mylease)(struct file_lock * , struct file_lock * ) ; int (*fl_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 __anonstruct_afs_155 { struct list_head link ; int state ; }; union __anonunion_fl_u_154 { struct nfs_lock_info nfs_fl ; struct nfs4_lock_info nfs4_fl ; struct __anonstruct_afs_155 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 char 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 ; struct file_lock_operations const *fl_ops ; struct lock_manager_operations const *fl_lmops ; union __anonunion_fl_u_154 fl_u ; }; struct fasync_struct { spinlock_t fa_lock ; int magic ; int fa_fd ; struct fasync_struct *fa_next ; struct file *fa_file ; struct rcu_head fa_rcu ; }; 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_dirt ; 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 ; struct mutex s_lock ; int s_count ; atomic_t s_active ; void *s_security ; struct xattr_handler const **s_xattr ; struct list_head s_inodes ; struct hlist_head s_anon ; struct list_head *s_files ; struct list_head s_dentry_lru ; int s_nr_dentry_unused ; struct block_device *s_bdev ; struct backing_dev_info *s_bdi ; struct mtd_info *s_mtd ; struct list_head s_instances ; struct quota_info s_dquot ; int s_frozen ; wait_queue_head_t s_wait_unfrozen ; char s_id[32U] ; void *s_fs_info ; fmode_t s_mode ; u32 s_time_gran ; struct mutex s_vfs_rename_mutex ; char *s_subtype ; char *s_options ; }; 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 * , 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 ** ) ; }; struct inode_operations { int (*create)(struct inode * , struct dentry * , int , struct nameidata * ) ; struct dentry *(*lookup)(struct inode * , struct dentry * , struct nameidata * ) ; 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 * , int ) ; int (*rmdir)(struct inode * , struct dentry * ) ; int (*mknod)(struct inode * , struct dentry * , int , dev_t ) ; int (*rename)(struct inode * , struct dentry * , struct inode * , struct dentry * ) ; int (*readlink)(struct dentry * , char * , int ) ; void *(*follow_link)(struct dentry * , struct nameidata * ) ; void (*put_link)(struct dentry * , struct nameidata * , void * ) ; void (*truncate)(struct inode * ) ; int (*permission)(struct inode * , int ) ; int (*check_acl)(struct inode * , int ) ; int (*setattr)(struct dentry * , struct iattr * ) ; int (*getattr)(struct vfsmount * , struct dentry * , struct kstat * ) ; int (*setxattr)(struct dentry * , char const * , void const * , size_t , int ) ; ssize_t (*getxattr)(struct dentry * , char const * , void * , size_t ) ; ssize_t (*listxattr)(struct dentry * , char * , size_t ) ; int (*removexattr)(struct dentry * , char const * ) ; void (*truncate_range)(struct inode * , loff_t , loff_t ) ; long (*fallocate)(struct inode * , int , loff_t , loff_t ) ; int (*fiemap)(struct inode * , struct fiemap_extent_info * , u64 , u64 ) ; }; struct super_operations { struct inode *(*alloc_inode)(struct super_block * ) ; void (*destroy_inode)(struct inode * ) ; void (*dirty_inode)(struct inode * ) ; int (*write_inode)(struct inode * , struct writeback_control * ) ; int (*drop_inode)(struct inode * ) ; void (*evict_inode)(struct inode * ) ; void (*put_super)(struct super_block * ) ; void (*write_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 vfsmount * ) ; int (*show_stats)(struct seq_file * , struct vfsmount * ) ; 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 ) ; }; struct file_system_type { char const *name ; int fs_flags ; int (*get_sb)(struct file_system_type * , int , char const * , void * , struct vfsmount * ) ; void (*kill_sb)(struct super_block * ) ; struct module *owner ; struct file_system_type *next ; struct list_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 i_lock_key ; struct lock_class_key i_mutex_key ; struct lock_class_key i_mutex_dir_key ; struct lock_class_key i_alloc_sem_key ; }; 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 ; unsigned short namelen ; char const *name ; mode_t mode ; nlink_t nlink ; uid_t uid ; gid_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 ; spinlock_t pde_unload_lock ; struct completion *pde_unload_completion ; struct list_head pde_openers ; }; struct ebt_table; struct netns_xt { struct list_head tables[13U] ; struct ebt_table *broute_table ; struct ebt_table *frame_filter ; struct ebt_table *frame_nat ; }; struct hlist_nulls_node; struct hlist_nulls_head { struct hlist_nulls_node *first ; }; struct hlist_nulls_node { struct hlist_nulls_node *next ; struct hlist_nulls_node **pprev ; }; struct ip_conntrack_stat; struct netns_ct { atomic_t count ; unsigned int expect_count ; unsigned int htable_size ; struct kmem_cache *nf_conntrack_cachep ; struct hlist_nulls_head *hash ; struct hlist_head *expect_hash ; struct hlist_nulls_head unconfirmed ; struct hlist_nulls_head dying ; struct ip_conntrack_stat *stat ; int sysctl_events ; unsigned int sysctl_events_retry_timeout ; int sysctl_acct ; int sysctl_checksum ; unsigned int sysctl_log_invalid ; struct ctl_table_header *sysctl_header ; struct ctl_table_header *acct_sysctl_header ; struct ctl_table_header *event_sysctl_header ; int hash_vmalloc ; int expect_vmalloc ; char *slabname ; }; struct xfrm_policy_hash { struct hlist_head *table ; unsigned int hmask ; }; struct netns_xfrm { struct list_head state_all ; struct hlist_head *state_bydst ; struct hlist_head *state_bysrc ; struct hlist_head *state_byspi ; unsigned int state_hmask ; unsigned int state_num ; struct work_struct state_hash_work ; struct hlist_head state_gc_list ; struct work_struct state_gc_work ; wait_queue_head_t km_waitq ; struct list_head policy_all ; struct hlist_head *policy_byidx ; unsigned int policy_idx_hmask ; struct hlist_head policy_inexact[6U] ; struct xfrm_policy_hash policy_bydst[6U] ; unsigned int policy_count[6U] ; struct work_struct policy_hash_work ; struct dst_ops xfrm4_dst_ops ; struct dst_ops xfrm6_dst_ops ; struct sock *nlsk ; struct sock *nlsk_stash ; u32 sysctl_aevent_etime ; u32 sysctl_aevent_rseqth ; int sysctl_larval_drop ; u32 sysctl_acq_expires ; struct ctl_table_header *sysctl_hdr ; }; struct net_generic; struct net { atomic_t count ; struct list_head list ; struct list_head cleanup_list ; struct list_head exit_list ; struct proc_dir_entry *proc_net ; struct proc_dir_entry *proc_net_stat ; struct ctl_table_set sysctls ; struct net_device *loopback_dev ; struct list_head dev_base_head ; struct hlist_head *dev_name_head ; struct hlist_head *dev_index_head ; struct list_head rules_ops ; spinlock_t rules_mod_lock ; struct sock *rtnl ; struct sock *genl_sock ; struct netns_core core ; struct netns_mib mib ; struct netns_packet packet ; struct netns_unix unx ; struct netns_ipv4 ipv4 ; struct netns_ipv6 ipv6 ; struct netns_dccp dccp ; struct netns_xt xt ; struct netns_ct ct ; struct sock *nfnl ; struct sock *nfnl_stash ; struct netns_xfrm xfrm ; struct sk_buff_head wext_nlevents ; struct net_generic *gen ; }; 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 ; 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 dcbnl_rtnl_ops { u8 (*getstate)(struct net_device * ) ; u8 (*setstate)(struct net_device * , u8 ) ; void (*getpermhwaddr)(struct net_device * , u8 * ) ; void (*setpgtccfgtx)(struct net_device * , int , u8 , u8 , u8 , u8 ) ; void (*setpgbwgcfgtx)(struct net_device * , int , u8 ) ; void (*setpgtccfgrx)(struct net_device * , int , u8 , u8 , u8 , u8 ) ; void (*setpgbwgcfgrx)(struct net_device * , int , u8 ) ; void (*getpgtccfgtx)(struct net_device * , int , u8 * , u8 * , u8 * , u8 * ) ; void (*getpgbwgcfgtx)(struct net_device * , int , u8 * ) ; void (*getpgtccfgrx)(struct net_device * , int , u8 * , u8 * , u8 * , u8 * ) ; void (*getpgbwgcfgrx)(struct net_device * , int , u8 * ) ; void (*setpfccfg)(struct net_device * , int , u8 ) ; void (*getpfccfg)(struct net_device * , int , u8 * ) ; u8 (*setall)(struct net_device * ) ; u8 (*getcap)(struct net_device * , int , u8 * ) ; u8 (*getnumtcs)(struct net_device * , int , u8 * ) ; u8 (*setnumtcs)(struct net_device * , int , u8 ) ; u8 (*getpfcstate)(struct net_device * ) ; void (*setpfcstate)(struct net_device * , u8 ) ; void (*getbcncfg)(struct net_device * , int , u32 * ) ; void (*setbcncfg)(struct net_device * , int , u32 ) ; void (*getbcnrp)(struct net_device * , int , u8 * ) ; void (*setbcnrp)(struct net_device * , int , u8 ) ; u8 (*setapp)(struct net_device * , u8 , u16 , u8 ) ; u8 (*getapp)(struct net_device * , u8 , u16 ) ; }; struct vlan_group; struct netpoll_info; struct phy_device; struct wireless_dev; enum netdev_tx { __NETDEV_TX_MIN = (-0x7FFFFFFF-1), NETDEV_TX_OK = 0, NETDEV_TX_BUSY = 16, NETDEV_TX_LOCKED = 32 } ; typedef enum netdev_tx netdev_tx_t; struct net_device_stats { unsigned long rx_packets ; unsigned long tx_packets ; unsigned long rx_bytes ; unsigned long tx_bytes ; unsigned long rx_errors ; unsigned long tx_errors ; unsigned long rx_dropped ; unsigned long tx_dropped ; unsigned long multicast ; unsigned long collisions ; unsigned long rx_length_errors ; unsigned long rx_over_errors ; unsigned long rx_crc_errors ; unsigned long rx_frame_errors ; unsigned long rx_fifo_errors ; unsigned long rx_missed_errors ; unsigned long tx_aborted_errors ; unsigned long tx_carrier_errors ; unsigned long tx_fifo_errors ; unsigned long tx_heartbeat_errors ; unsigned long tx_window_errors ; unsigned long rx_compressed ; unsigned long tx_compressed ; }; struct neighbour; struct neigh_parms; struct netdev_hw_addr_list { struct list_head list ; int count ; }; struct hh_cache { struct hh_cache *hh_next ; atomic_t hh_refcnt ; __be16 hh_type ; u16 hh_len ; int (*hh_output)(struct sk_buff * ) ; seqlock_t hh_lock ; unsigned long hh_data[16U] ; }; struct header_ops { int (*create)(struct sk_buff * , struct net_device * , unsigned short , void const * , void const * , unsigned int ) ; int (*parse)(struct sk_buff const * , unsigned char * ) ; int (*rebuild)(struct sk_buff * ) ; int (*cache)(struct neighbour const * , struct hh_cache * ) ; void (*cache_update)(struct hh_cache * , struct net_device const * , unsigned char const * ) ; }; typedef struct sk_buff *rx_handler_func_t(struct sk_buff * ); struct Qdisc; struct netdev_queue { struct net_device *dev ; struct Qdisc *qdisc ; unsigned long state ; struct Qdisc *qdisc_sleeping ; spinlock_t _xmit_lock ; int xmit_lock_owner ; unsigned long trans_start ; u64 tx_bytes ; u64 tx_packets ; u64 tx_dropped ; }; struct rps_map { unsigned int len ; struct rcu_head rcu ; u16 cpus[0U] ; }; struct rps_dev_flow { u16 cpu ; u16 fill ; unsigned int last_qtail ; }; struct rps_dev_flow_table { unsigned int mask ; struct rcu_head rcu ; struct work_struct free_work ; struct rps_dev_flow flows[0U] ; }; struct netdev_rx_queue { struct rps_map *rps_map ; struct rps_dev_flow_table *rps_flow_table ; struct kobject kobj ; struct netdev_rx_queue *first ; atomic_t count ; }; struct net_device_ops { int (*ndo_init)(struct net_device * ) ; void (*ndo_uninit)(struct net_device * ) ; int (*ndo_open)(struct net_device * ) ; int (*ndo_stop)(struct net_device * ) ; netdev_tx_t (*ndo_start_xmit)(struct sk_buff * , struct net_device * ) ; u16 (*ndo_select_queue)(struct net_device * , struct sk_buff * ) ; void (*ndo_change_rx_flags)(struct net_device * , int ) ; void (*ndo_set_rx_mode)(struct net_device * ) ; void (*ndo_set_multicast_list)(struct net_device * ) ; int (*ndo_set_mac_address)(struct net_device * , void * ) ; int (*ndo_validate_addr)(struct net_device * ) ; int (*ndo_do_ioctl)(struct net_device * , struct ifreq * , int ) ; int (*ndo_set_config)(struct net_device * , struct ifmap * ) ; int (*ndo_change_mtu)(struct net_device * , int ) ; int (*ndo_neigh_setup)(struct net_device * , struct neigh_parms * ) ; void (*ndo_tx_timeout)(struct net_device * ) ; struct rtnl_link_stats64 *(*ndo_get_stats64)(struct net_device * , struct rtnl_link_stats64 * ) ; struct net_device_stats *(*ndo_get_stats)(struct net_device * ) ; void (*ndo_vlan_rx_register)(struct net_device * , struct vlan_group * ) ; void (*ndo_vlan_rx_add_vid)(struct net_device * , unsigned short ) ; void (*ndo_vlan_rx_kill_vid)(struct net_device * , unsigned short ) ; void (*ndo_poll_controller)(struct net_device * ) ; int (*ndo_netpoll_setup)(struct net_device * , struct netpoll_info * ) ; void (*ndo_netpoll_cleanup)(struct net_device * ) ; int (*ndo_set_vf_mac)(struct net_device * , int , u8 * ) ; int (*ndo_set_vf_vlan)(struct net_device * , int , u16 , u8 ) ; int (*ndo_set_vf_tx_rate)(struct net_device * , int , int ) ; int (*ndo_get_vf_config)(struct net_device * , int , struct ifla_vf_info * ) ; int (*ndo_set_vf_port)(struct net_device * , int , struct nlattr ** ) ; int (*ndo_get_vf_port)(struct net_device * , int , struct sk_buff * ) ; int (*ndo_fcoe_enable)(struct net_device * ) ; int (*ndo_fcoe_disable)(struct net_device * ) ; int (*ndo_fcoe_ddp_setup)(struct net_device * , u16 , struct scatterlist * , unsigned int ) ; int (*ndo_fcoe_ddp_done)(struct net_device * , u16 ) ; int (*ndo_fcoe_get_wwn)(struct net_device * , u64 * , int ) ; }; struct iw_handler_def; struct iw_public_data; struct garp_port; struct rtnl_link_ops; struct net_device { char name[16U] ; struct pm_qos_request_list pm_qos_req ; struct hlist_node name_hlist ; char *ifalias ; unsigned long mem_end ; unsigned long mem_start ; unsigned long base_addr ; unsigned int irq ; unsigned char if_port ; unsigned char dma ; unsigned long state ; struct list_head dev_list ; struct list_head napi_list ; struct list_head unreg_list ; unsigned long features ; int ifindex ; int iflink ; struct net_device_stats stats ; struct iw_handler_def const *wireless_handlers ; struct iw_public_data *wireless_data ; struct net_device_ops const *netdev_ops ; struct ethtool_ops const *ethtool_ops ; struct header_ops const *header_ops ; unsigned int flags ; unsigned short gflags ; unsigned short priv_flags ; unsigned short padded ; unsigned char operstate ; unsigned char link_mode ; unsigned int mtu ; unsigned short type ; unsigned short hard_header_len ; unsigned short needed_headroom ; unsigned short needed_tailroom ; struct net_device *master ; unsigned char perm_addr[32U] ; unsigned char addr_assign_type ; unsigned char addr_len ; unsigned short dev_id ; spinlock_t addr_list_lock ; struct netdev_hw_addr_list uc ; struct netdev_hw_addr_list mc ; int uc_promisc ; unsigned int promiscuity ; unsigned int allmulti ; void *dsa_ptr ; void *atalk_ptr ; void *ip_ptr ; void *dn_ptr ; void *ip6_ptr ; void *ec_ptr ; void *ax25_ptr ; struct wireless_dev *ieee80211_ptr ; unsigned long last_rx ; unsigned char *dev_addr ; struct netdev_hw_addr_list dev_addrs ; unsigned char broadcast[32U] ; struct kset *queues_kset ; struct netdev_rx_queue *_rx ; unsigned int num_rx_queues ; struct netdev_queue rx_queue ; rx_handler_func_t *rx_handler ; void *rx_handler_data ; struct netdev_queue *_tx ; unsigned int num_tx_queues ; unsigned int real_num_tx_queues ; struct Qdisc *qdisc ; unsigned long tx_queue_len ; spinlock_t tx_global_lock ; unsigned long trans_start ; int watchdog_timeo ; struct timer_list watchdog_timer ; atomic_t refcnt ; struct list_head todo_list ; struct hlist_node index_hlist ; struct list_head link_watch_list ; unsigned short reg_state ; unsigned short rtnl_link_state ; void (*destructor)(struct net_device * ) ; struct netpoll_info *npinfo ; struct net *nd_net ; void *ml_priv ; struct garp_port *garp_port ; struct device dev ; struct attribute_group const *sysfs_groups[4U] ; struct rtnl_link_ops const *rtnl_link_ops ; unsigned long vlan_features ; unsigned int gso_max_size ; struct dcbnl_rtnl_ops const *dcbnl_ops ; unsigned int fcoe_ddp_xid ; struct ethtool_rx_ntuple_list ethtool_ntuple_list ; struct phy_device *phydev ; }; struct irqaction; struct irqaction { irqreturn_t (*handler)(int , void * ) ; unsigned long flags ; char const *name ; void *dev_id ; struct irqaction *next ; int irq ; struct proc_dir_entry *dir ; irqreturn_t (*thread_fn)(int , void * ) ; struct task_struct *thread ; unsigned long thread_flags ; }; struct firmware { size_t size ; u8 const *data ; struct page **pages ; }; struct iw_param { __s32 value ; __u8 fixed ; __u8 disabled ; __u16 flags ; }; struct iw_point { void *pointer ; __u16 length ; __u16 flags ; }; struct sem_undo_list; struct sem_undo_list { atomic_t refcnt ; spinlock_t lock ; struct list_head list_proc ; }; struct sysv_sem { struct sem_undo_list *undo_list ; }; typedef unsigned long cputime_t; struct siginfo; struct __anonstruct_sigset_t_158 { unsigned long sig[1U] ; }; typedef struct __anonstruct_sigset_t_158 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_160 { __kernel_pid_t _pid ; __kernel_uid32_t _uid ; }; struct __anonstruct__timer_161 { __kernel_timer_t _tid ; int _overrun ; char _pad[0U] ; sigval_t _sigval ; int _sys_private ; }; struct __anonstruct__rt_162 { __kernel_pid_t _pid ; __kernel_uid32_t _uid ; sigval_t _sigval ; }; struct __anonstruct__sigchld_163 { __kernel_pid_t _pid ; __kernel_uid32_t _uid ; int _status ; __kernel_clock_t _utime ; __kernel_clock_t _stime ; }; struct __anonstruct__sigfault_164 { void *_addr ; short _addr_lsb ; }; struct __anonstruct__sigpoll_165 { long _band ; int _fd ; }; union __anonunion__sifields_159 { int _pad[28U] ; struct __anonstruct__kill_160 _kill ; struct __anonstruct__timer_161 _timer ; struct __anonstruct__rt_162 _rt ; struct __anonstruct__sigchld_163 _sigchld ; struct __anonstruct__sigfault_164 _sigfault ; struct __anonstruct__sigpoll_165 _sigpoll ; }; struct siginfo { int si_signo ; int si_errno ; int si_code ; union __anonunion__sifields_159 _sifields ; }; typedef struct siginfo siginfo_t; struct sigpending { struct list_head list ; sigset_t signal ; }; struct prop_local_single { unsigned long events ; unsigned long period ; int shift ; spinlock_t lock ; }; struct __anonstruct_seccomp_t_168 { int mode ; }; typedef struct __anonstruct_seccomp_t_168 seccomp_t; 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 signal_struct; struct key_type; struct keyring_list; struct key_user; union __anonunion____missing_field_name_169 { time_t expiry ; time_t revoked_at ; }; union __anonunion_type_data_170 { struct list_head link ; unsigned long x[2U] ; void *p[2U] ; }; union __anonunion_payload_171 { unsigned long value ; void *data ; struct keyring_list *subscriptions ; }; struct key { atomic_t usage ; key_serial_t serial ; struct rb_node serial_node ; struct key_type *type ; struct rw_semaphore sem ; struct key_user *user ; void *security ; union __anonunion____missing_field_name_169 __annonCompField31 ; uid_t uid ; gid_t gid ; key_perm_t perm ; unsigned short quotalen ; unsigned short datalen ; unsigned long flags ; char *description ; union __anonunion_type_data_170 type_data ; union __anonunion_payload_171 payload ; }; struct audit_context; struct group_info { atomic_t usage ; int ngroups ; int nblocks ; gid_t small_block[32U] ; gid_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 rcu_head rcu ; }; struct cred { atomic_t usage ; atomic_t subscribers ; void *put_addr ; unsigned int magic ; uid_t uid ; gid_t gid ; uid_t suid ; gid_t sgid ; uid_t euid ; gid_t egid ; uid_t fsuid ; gid_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 group_info *group_info ; struct rcu_head rcu ; }; struct futex_pi_state; struct robust_list_head; struct bio_list; struct fs_struct; struct perf_event_context; struct cfs_rq; struct user_namespace; struct io_event { __u64 data ; __u64 obj ; __s64 res ; __s64 res2 ; }; struct kioctx; union __anonunion_ki_obj_172 { 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_172 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 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 rcu_head rcu_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 ; spinlock_t lock ; }; 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 ; 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 ; 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 ; int oom_adj ; int oom_score_adj ; }; 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 epoll_watches ; unsigned long mq_bytes ; unsigned long locked_shm ; struct key *uid_keyring ; struct key *session_keyring ; struct hlist_node uidhash_node ; uid_t uid ; struct user_namespace *user_ns ; 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 ; unsigned int bkl_count ; }; 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 io_context; 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 * ) ; 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 rq * , struct task_struct * , int , int ) ; void (*pre_schedule)(struct rq * , struct task_struct * ) ; void (*post_schedule)(struct rq * ) ; void (*task_waking)(struct rq * , 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 * , int ) ; void (*switched_to)(struct rq * , struct task_struct * , int ) ; void (*prio_changed)(struct rq * , struct task_struct * , int , int ) ; unsigned int (*get_rr_interval)(struct rq * , struct task_struct * ) ; void (*moved_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 ; int nr_cpus_allowed ; 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 bytes ; unsigned long memsw_bytes ; }; 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 ; int lock_depth ; 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 hlist_head preempt_notifiers ; unsigned char fpu_counter ; unsigned int policy ; 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 ; int exit_state ; int exit_code ; int exit_signal ; int pdeath_signal ; unsigned int personality ; unsigned char did_exec : 1 ; unsigned char in_execve : 1 ; unsigned char in_iowait : 1 ; unsigned char sched_reset_on_fork : 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 ; struct mutex cred_guard_mutex ; struct cred *replacement_session_keyring ; 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 audit_context *audit_context ; uid_t loginuid ; unsigned int sessionid ; seccomp_t seccomp ; u32 parent_exec_id ; u32 self_exec_id ; spinlock_t alloc_lock ; struct irqaction *irqaction ; 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 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 ; int mems_allowed_change_disable ; 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 ; struct mutex perf_event_mutex ; struct list_head perf_event_list ; struct mempolicy *mempolicy ; short il_next ; atomic_t fs_excl ; struct rcu_head rcu ; struct pipe_inode_info *splice_pipe ; struct task_delay_info *delays ; int make_it_fail ; struct prop_local_single dirties ; int latency_record_count ; struct latency_record latency_record[32U] ; unsigned long timer_slack_ns ; unsigned long default_timer_slack_ns ; struct list_head *scm_work_list ; unsigned long trace ; unsigned long trace_recursion ; struct memcg_batch_info memcg_batch ; }; typedef s32 compat_time_t; typedef s32 compat_long_t; struct compat_timespec { compat_time_t tv_sec ; s32 tv_nsec ; }; typedef u32 compat_uptr_t; 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 iw_freq { __s32 m ; __s16 e ; __u8 i ; __u8 flags ; }; struct iw_quality { __u8 qual ; __u8 level ; __u8 noise ; __u8 updated ; }; struct iw_discarded { __u32 nwid ; __u32 code ; __u32 fragment ; __u32 retries ; __u32 misc ; }; struct iw_missed { __u32 beacon ; }; struct iw_statistics { __u16 status ; struct iw_quality qual ; struct iw_discarded discard ; struct iw_missed miss ; }; union iwreq_data { char name[16U] ; struct iw_point essid ; struct iw_param nwid ; struct iw_freq freq ; struct iw_param sens ; struct iw_param bitrate ; struct iw_param txpower ; struct iw_param rts ; struct iw_param frag ; __u32 mode ; struct iw_param retry ; struct iw_point encoding ; struct iw_param power ; struct iw_quality qual ; struct sockaddr ap_addr ; struct sockaddr addr ; struct iw_param param ; struct iw_point data ; }; struct iw_priv_args { __u32 cmd ; __u16 set_args ; __u16 get_args ; char name[16U] ; }; struct hwrng { char const *name ; int (*init)(struct hwrng * ) ; void (*cleanup)(struct hwrng * ) ; int (*data_present)(struct hwrng * , int ) ; int (*data_read)(struct hwrng * , u32 * ) ; int (*read)(struct hwrng * , void * , size_t , bool ) ; unsigned long priv ; struct list_head list ; }; typedef unsigned long kernel_ulong_t; struct pci_device_id { __u32 vendor ; __u32 device ; __u32 subvendor ; __u32 subdevice ; __u32 class ; __u32 class_mask ; kernel_ulong_t driver_data ; }; struct ssb_device_id { __u16 vendor ; __u16 coreid ; __u8 revision ; }; 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 pci_driver; union __anonunion____missing_field_name_180 { struct pci_sriov *sriov ; struct pci_dev *physfn ; }; struct pci_dev { struct list_head bus_list ; struct pci_bus *bus ; struct pci_bus *subordinate ; void *sysdata ; struct proc_dir_entry *procent ; struct pci_slot *slot ; unsigned int devfn ; unsigned short vendor ; unsigned short device ; unsigned short subsystem_vendor ; unsigned short subsystem_device ; unsigned int class ; u8 revision ; u8 hdr_type ; u8 pcie_cap ; u8 pcie_type ; u8 rom_base_reg ; u8 pin ; 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 d1_support : 1 ; unsigned char d2_support : 1 ; unsigned char no_d1d2 : 1 ; unsigned char mmio_always_on : 1 ; unsigned char wakeup_prepared : 1 ; unsigned int d3_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[18U] ; resource_size_t fw_addr[18U] ; 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_ucfg_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 ; 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[18U] ; struct bin_attribute *res_attr_wc[18U] ; struct list_head msi_list ; struct pci_vpd *vpd ; union __anonunion____missing_field_name_180 __annonCompField32 ; 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 pci_ops *ops ; void *sysdata ; struct proc_dir_entry *procdir ; unsigned char number ; unsigned char primary ; unsigned char secondary ; unsigned char subordinate ; 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 *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 *err_handler ; struct device_driver driver ; struct pci_dynids dynids ; }; struct ssb_bus; struct ssb_driver; struct __anonstruct_ghz24_182 { s8 a0 ; s8 a1 ; s8 a2 ; s8 a3 ; }; struct __anonstruct_ghz5_183 { s8 a0 ; s8 a1 ; s8 a2 ; s8 a3 ; }; struct __anonstruct_antenna_gain_181 { struct __anonstruct_ghz24_182 ghz24 ; struct __anonstruct_ghz5_183 ghz5 ; }; struct ssb_sprom { u8 revision ; u8 il0mac[6U] ; u8 et0mac[6U] ; u8 et1mac[6U] ; u8 et0phyaddr ; u8 et1phyaddr ; u8 et0mdcport ; u8 et1mdcport ; u8 board_rev ; u8 country_code ; u8 ant_available_a ; u8 ant_available_bg ; u16 pa0b0 ; u16 pa0b1 ; u16 pa0b2 ; u16 pa1b0 ; u16 pa1b1 ; u16 pa1b2 ; u16 pa1lob0 ; u16 pa1lob1 ; u16 pa1lob2 ; u16 pa1hib0 ; u16 pa1hib1 ; u16 pa1hib2 ; u8 gpio0 ; u8 gpio1 ; u8 gpio2 ; u8 gpio3 ; u16 maxpwr_bg ; u16 maxpwr_al ; u16 maxpwr_a ; u16 maxpwr_ah ; u8 itssi_a ; u8 itssi_bg ; u8 tri2g ; u8 tri5gl ; u8 tri5g ; u8 tri5gh ; u8 rxpo2g ; u8 rxpo5g ; u8 rssisav2g ; u8 rssismc2g ; u8 rssismf2g ; u8 bxa2g ; u8 rssisav5g ; u8 rssismc5g ; u8 rssismf5g ; u8 bxa5g ; u16 cck2gpo ; u32 ofdm2gpo ; u32 ofdm5glpo ; u32 ofdm5gpo ; u32 ofdm5ghpo ; u16 boardflags_lo ; u16 boardflags_hi ; u16 boardflags2_lo ; u16 boardflags2_hi ; struct __anonstruct_antenna_gain_181 antenna_gain ; }; struct ssb_boardinfo { u16 vendor ; u16 type ; u16 rev ; }; struct ssb_bus_ops { u8 (*read8)(struct ssb_device * , u16 ) ; u16 (*read16)(struct ssb_device * , u16 ) ; u32 (*read32)(struct ssb_device * , u16 ) ; void (*write8)(struct ssb_device * , u16 , u8 ) ; void (*write16)(struct ssb_device * , u16 , u16 ) ; void (*write32)(struct ssb_device * , u16 , u32 ) ; void (*block_read)(struct ssb_device * , void * , size_t , u16 , u8 ) ; void (*block_write)(struct ssb_device * , void const * , size_t , u16 , u8 ) ; }; struct ssb_device { struct ssb_bus_ops const *ops ; struct device *dev ; struct device *dma_dev ; struct ssb_bus *bus ; struct ssb_device_id id ; u8 core_index ; unsigned int irq ; void *drvdata ; void *devtypedata ; }; struct ssb_driver { char const *name ; struct ssb_device_id const *id_table ; int (*probe)(struct ssb_device * , struct ssb_device_id const * ) ; void (*remove)(struct ssb_device * ) ; int (*suspend)(struct ssb_device * , pm_message_t ) ; int (*resume)(struct ssb_device * ) ; void (*shutdown)(struct ssb_device * ) ; struct device_driver drv ; }; enum ssb_bustype { SSB_BUSTYPE_SSB = 0, SSB_BUSTYPE_PCI = 1, SSB_BUSTYPE_PCMCIA = 2, SSB_BUSTYPE_SDIO = 3 } ; struct ssb_chipcommon_pmu { u8 rev ; u32 crystalfreq ; }; struct ssb_chipcommon { struct ssb_device *dev ; u32 capabilities ; u32 status ; u16 fast_pwrup_delay ; struct ssb_chipcommon_pmu pmu ; }; struct ssb_mipscore { }; struct ssb_extif { }; struct ssb_pcicore { struct ssb_device *dev ; unsigned char setup_done : 1 ; unsigned char hostmode : 1 ; unsigned char cardbusmode : 1 ; }; union __anonunion____missing_field_name_184 { u8 mapped_pcmcia_seg ; u32 sdio_sbaddr ; }; union __anonunion____missing_field_name_185 { struct pci_dev *host_pci ; struct pcmcia_device *host_pcmcia ; struct sdio_func *host_sdio ; }; struct ssb_bus { void *mmio ; struct ssb_bus_ops const *ops ; struct ssb_device *mapped_device ; union __anonunion____missing_field_name_184 __annonCompField33 ; spinlock_t bar_lock ; enum ssb_bustype bustype ; union __anonunion____missing_field_name_185 __annonCompField34 ; unsigned int quirks ; struct mutex sprom_mutex ; u16 chip_id ; u16 chip_rev ; u16 sprom_offset ; u16 sprom_size ; u8 chip_package ; struct ssb_device devices[16U] ; u8 nr_devices ; unsigned int busnumber ; struct ssb_chipcommon chipco ; struct ssb_pcicore pcicore ; struct ssb_mipscore mipscore ; struct ssb_extif extif ; struct ssb_boardinfo boardinfo ; struct ssb_sprom sprom ; bool has_cardbus_slot ; struct list_head list ; }; struct ieee80211_msrment_ie { u8 token ; u8 mode ; u8 type ; u8 request[0U] ; }; struct ieee80211_channel_sw_ie { u8 mode ; u8 new_ch_num ; u8 count ; }; struct __anonstruct_auth_187 { __le16 auth_alg ; __le16 auth_transaction ; __le16 status_code ; u8 variable[0U] ; }; struct __anonstruct_deauth_188 { __le16 reason_code ; }; struct __anonstruct_assoc_req_189 { __le16 capab_info ; __le16 listen_interval ; u8 variable[0U] ; }; struct __anonstruct_assoc_resp_190 { __le16 capab_info ; __le16 status_code ; __le16 aid ; u8 variable[0U] ; }; struct __anonstruct_reassoc_resp_191 { __le16 capab_info ; __le16 status_code ; __le16 aid ; u8 variable[0U] ; }; struct __anonstruct_reassoc_req_192 { __le16 capab_info ; __le16 listen_interval ; u8 current_ap[6U] ; u8 variable[0U] ; }; struct __anonstruct_disassoc_193 { __le16 reason_code ; }; struct __anonstruct_beacon_194 { __le64 timestamp ; __le16 beacon_int ; __le16 capab_info ; u8 variable[0U] ; }; struct __anonstruct_probe_req_195 { u8 variable[0U] ; }; struct __anonstruct_probe_resp_196 { __le64 timestamp ; __le16 beacon_int ; __le16 capab_info ; u8 variable[0U] ; }; struct __anonstruct_wme_action_199 { u8 action_code ; u8 dialog_token ; u8 status_code ; u8 variable[0U] ; }; struct __anonstruct_chan_switch_200 { u8 action_code ; u8 element_id ; u8 length ; struct ieee80211_channel_sw_ie sw_elem ; }; struct __anonstruct_measurement_201 { u8 action_code ; u8 dialog_token ; u8 element_id ; u8 length ; struct ieee80211_msrment_ie msr_elem ; }; struct __anonstruct_addba_req_202 { u8 action_code ; u8 dialog_token ; __le16 capab ; __le16 timeout ; __le16 start_seq_num ; }; struct __anonstruct_addba_resp_203 { u8 action_code ; u8 dialog_token ; __le16 status ; __le16 capab ; __le16 timeout ; }; struct __anonstruct_delba_204 { u8 action_code ; __le16 params ; __le16 reason_code ; }; struct __anonstruct_plink_action_205 { u8 action_code ; __le16 aux ; u8 variable[0U] ; }; struct __anonstruct_mesh_action_206 { u8 action_code ; u8 variable[0U] ; }; struct __anonstruct_sa_query_207 { u8 action ; u8 trans_id[2U] ; }; struct __anonstruct_ht_smps_208 { u8 action ; u8 smps_control ; }; union __anonunion_u_198 { struct __anonstruct_wme_action_199 wme_action ; struct __anonstruct_chan_switch_200 chan_switch ; struct __anonstruct_measurement_201 measurement ; struct __anonstruct_addba_req_202 addba_req ; struct __anonstruct_addba_resp_203 addba_resp ; struct __anonstruct_delba_204 delba ; struct __anonstruct_plink_action_205 plink_action ; struct __anonstruct_mesh_action_206 mesh_action ; struct __anonstruct_sa_query_207 sa_query ; struct __anonstruct_ht_smps_208 ht_smps ; }; struct __anonstruct_action_197 { u8 category ; union __anonunion_u_198 u ; }; union __anonunion_u_186 { struct __anonstruct_auth_187 auth ; struct __anonstruct_deauth_188 deauth ; struct __anonstruct_assoc_req_189 assoc_req ; struct __anonstruct_assoc_resp_190 assoc_resp ; struct __anonstruct_reassoc_resp_191 reassoc_resp ; struct __anonstruct_reassoc_req_192 reassoc_req ; struct __anonstruct_disassoc_193 disassoc ; struct __anonstruct_beacon_194 beacon ; struct __anonstruct_probe_req_195 probe_req ; struct __anonstruct_probe_resp_196 probe_resp ; struct __anonstruct_action_197 action ; }; struct ieee80211_mgmt { __le16 frame_control ; __le16 duration ; u8 da[6U] ; u8 sa[6U] ; u8 bssid[6U] ; __le16 seq_ctrl ; union __anonunion_u_186 u ; }; struct ieee80211_mcs_info { u8 rx_mask[10U] ; __le16 rx_highest ; u8 tx_params ; u8 reserved[3U] ; }; enum nl80211_iftype { NL80211_IFTYPE_UNSPECIFIED = 0, NL80211_IFTYPE_ADHOC = 1, NL80211_IFTYPE_STATION = 2, NL80211_IFTYPE_AP = 3, NL80211_IFTYPE_AP_VLAN = 4, NL80211_IFTYPE_WDS = 5, NL80211_IFTYPE_MONITOR = 6, NL80211_IFTYPE_MESH_POINT = 7, __NL80211_IFTYPE_AFTER_LAST = 8, NL80211_IFTYPE_MAX = 7 } ; enum nl80211_reg_initiator { NL80211_REGDOM_SET_BY_CORE = 0, NL80211_REGDOM_SET_BY_USER = 1, NL80211_REGDOM_SET_BY_DRIVER = 2, NL80211_REGDOM_SET_BY_COUNTRY_IE = 3 } ; enum nl80211_channel_type { NL80211_CHAN_NO_HT = 0, NL80211_CHAN_HT20 = 1, NL80211_CHAN_HT40MINUS = 2, NL80211_CHAN_HT40PLUS = 3 } ; enum nl80211_auth_type { NL80211_AUTHTYPE_OPEN_SYSTEM = 0, NL80211_AUTHTYPE_SHARED_KEY = 1, NL80211_AUTHTYPE_FT = 2, NL80211_AUTHTYPE_NETWORK_EAP = 3, __NL80211_AUTHTYPE_NUM = 4, NL80211_AUTHTYPE_MAX = 3, NL80211_AUTHTYPE_AUTOMATIC = 4 } ; enum environment_cap { ENVIRON_ANY = 0, ENVIRON_INDOOR = 1, ENVIRON_OUTDOOR = 2 } ; struct regulatory_request { int wiphy_idx ; enum nl80211_reg_initiator initiator ; char alpha2[2U] ; bool intersect ; enum environment_cap country_ie_env ; struct list_head list ; }; struct ieee80211_freq_range { u32 start_freq_khz ; u32 end_freq_khz ; u32 max_bandwidth_khz ; }; struct ieee80211_power_rule { u32 max_antenna_gain ; u32 max_eirp ; }; struct ieee80211_reg_rule { struct ieee80211_freq_range freq_range ; struct ieee80211_power_rule power_rule ; u32 flags ; }; struct ieee80211_regdomain { u32 n_reg_rules ; char alpha2[2U] ; struct ieee80211_reg_rule reg_rules[] ; }; struct iw_request_info { __u16 cmd ; __u16 flags ; }; typedef int (*iw_handler)(struct net_device * , struct iw_request_info * , union iwreq_data * , char * ); struct iw_handler_def { iw_handler (* const *standard)(struct net_device * , struct iw_request_info * , union iwreq_data * , char * ) ; __u16 num_standard ; __u16 num_private ; __u16 num_private_args ; iw_handler (* const *private)(struct net_device * , struct iw_request_info * , union iwreq_data * , char * ) ; struct iw_priv_args const *private_args ; struct iw_statistics *(*get_wireless_stats)(struct net_device * ) ; }; struct iw_spy_data { int spy_number ; u_char spy_address[8U][6U] ; struct iw_quality spy_stat[8U] ; struct iw_quality spy_thr_low ; struct iw_quality spy_thr_high ; u_char spy_thr_under[8U] ; }; struct libipw_device; struct iw_public_data { struct iw_spy_data *spy_data ; struct libipw_device *libipw ; }; enum ieee80211_band { IEEE80211_BAND_2GHZ = 0, IEEE80211_BAND_5GHZ = 1, IEEE80211_NUM_BANDS = 2 } ; struct ieee80211_channel { enum ieee80211_band band ; u16 center_freq ; u16 hw_value ; u32 flags ; int max_antenna_gain ; int max_power ; bool beacon_found ; u32 orig_flags ; int orig_mag ; int orig_mpwr ; }; struct ieee80211_rate { u32 flags ; u16 bitrate ; u16 hw_value ; u16 hw_value_short ; }; struct ieee80211_sta_ht_cap { u16 cap ; bool ht_supported ; u8 ampdu_factor ; u8 ampdu_density ; struct ieee80211_mcs_info mcs ; }; struct ieee80211_supported_band { struct ieee80211_channel *channels ; struct ieee80211_rate *bitrates ; enum ieee80211_band band ; int n_channels ; int n_bitrates ; struct ieee80211_sta_ht_cap ht_cap ; }; struct survey_info { struct ieee80211_channel *channel ; u32 filled ; s8 noise ; }; struct wiphy; struct cfg80211_ssid { u8 ssid[32U] ; u8 ssid_len ; }; struct cfg80211_scan_request { struct cfg80211_ssid *ssids ; int n_ssids ; u32 n_channels ; u8 const *ie ; size_t ie_len ; struct wiphy *wiphy ; struct net_device *dev ; bool aborted ; struct ieee80211_channel *channels[0U] ; }; enum cfg80211_signal_type { CFG80211_SIGNAL_TYPE_NONE = 0, CFG80211_SIGNAL_TYPE_MBM = 1, CFG80211_SIGNAL_TYPE_UNSPEC = 2 } ; struct cfg80211_crypto_settings { u32 wpa_versions ; u32 cipher_group ; int n_ciphers_pairwise ; u32 ciphers_pairwise[5U] ; int n_akm_suites ; u32 akm_suites[2U] ; bool control_port ; }; struct cfg80211_ibss_params { u8 *ssid ; u8 *bssid ; struct ieee80211_channel *channel ; u8 *ie ; u8 ssid_len ; u8 ie_len ; u16 beacon_interval ; u32 basic_rates ; bool channel_fixed ; bool privacy ; }; struct cfg80211_connect_params { struct ieee80211_channel *channel ; u8 *bssid ; u8 *ssid ; size_t ssid_len ; enum nl80211_auth_type auth_type ; u8 *ie ; size_t ie_len ; bool privacy ; struct cfg80211_crypto_settings crypto ; u8 const *key ; u8 key_len ; u8 key_idx ; }; struct mac_address { u8 addr[6U] ; }; struct wiphy { u8 perm_addr[6U] ; u8 addr_mask[6U] ; u16 n_addresses ; struct mac_address *addresses ; u16 interface_modes ; u32 flags ; enum cfg80211_signal_type signal_type ; int bss_priv_size ; u8 max_scan_ssids ; u16 max_scan_ie_len ; int n_cipher_suites ; u32 const *cipher_suites ; u8 retry_short ; u8 retry_long ; u32 frag_threshold ; u32 rts_threshold ; u8 coverage_class ; char fw_version[32U] ; u32 hw_version ; u8 max_num_pmkids ; void const *privid ; struct ieee80211_supported_band *bands[2U] ; int (*reg_notifier)(struct wiphy * , struct regulatory_request * ) ; struct ieee80211_regdomain const *regd ; struct device dev ; struct dentry *debugfsdir ; struct net *_net ; struct iw_handler_def const *wext ; char priv[0U] ; }; struct cfg80211_conn; struct cfg80211_internal_bss; struct cfg80211_cached_keys; enum ldv_24312 { CFG80211_SME_IDLE = 0, CFG80211_SME_CONNECTING = 1, CFG80211_SME_CONNECTED = 2 } ; struct __anonstruct_wext_213 { struct cfg80211_ibss_params ibss ; struct cfg80211_connect_params connect ; struct cfg80211_cached_keys *keys ; u8 *ie ; size_t ie_len ; u8 bssid[6U] ; u8 prev_bssid[6U] ; u8 ssid[32U] ; s8 default_key ; s8 default_mgmt_key ; bool prev_bssid_valid ; }; struct wireless_dev { struct wiphy *wiphy ; enum nl80211_iftype iftype ; struct list_head list ; struct net_device *netdev ; struct list_head action_registrations ; spinlock_t action_registrations_lock ; struct mutex mtx ; struct work_struct cleanup_work ; bool use_4addr ; u8 ssid[32U] ; u8 ssid_len ; enum ldv_24312 sme_state ; struct cfg80211_conn *conn ; struct cfg80211_cached_keys *connect_keys ; struct list_head event_list ; spinlock_t event_lock ; struct cfg80211_internal_bss *authtry_bsses[4U] ; struct cfg80211_internal_bss *auth_bsses[4U] ; struct cfg80211_internal_bss *current_bss ; struct ieee80211_channel *channel ; bool ps ; int ps_timeout ; struct __anonstruct_wext_213 wext ; }; struct ieee80211_tx_queue_params { u16 txop ; u16 cw_min ; u16 cw_max ; u8 aifs ; bool uapsd ; }; struct ieee80211_low_level_stats { unsigned int dot11ACKFailureCount ; unsigned int dot11RTSFailureCount ; unsigned int dot11FCSErrorCount ; unsigned int dot11RTSSuccessCount ; }; struct ieee80211_bss_conf { u8 const *bssid ; bool assoc ; bool ibss_joined ; u16 aid ; bool use_cts_prot ; bool use_short_preamble ; bool use_short_slot ; bool enable_beacon ; u8 dtim_period ; u16 beacon_int ; u16 assoc_capability ; u64 timestamp ; u32 basic_rates ; u16 ht_operation_mode ; s32 cqm_rssi_thold ; u32 cqm_rssi_hyst ; enum nl80211_channel_type channel_type ; __be32 arp_addr_list[4U] ; u8 arp_addr_cnt ; bool arp_filter_enabled ; bool qos ; }; struct ieee80211_tx_rate { s8 idx ; u8 count ; u8 flags ; }; struct __anonstruct____missing_field_name_217 { struct ieee80211_tx_rate rates[5U] ; s8 rts_cts_rate_idx ; }; union __anonunion____missing_field_name_216 { struct __anonstruct____missing_field_name_217 __annonCompField36 ; unsigned long jiffies ; }; struct ieee80211_vif; struct ieee80211_key_conf; struct ieee80211_sta; struct __anonstruct_control_215 { union __anonunion____missing_field_name_216 __annonCompField37 ; struct ieee80211_vif *vif ; struct ieee80211_key_conf *hw_key ; struct ieee80211_sta *sta ; }; struct __anonstruct_status_218 { struct ieee80211_tx_rate rates[5U] ; u8 ampdu_ack_len ; int ack_signal ; u8 ampdu_len ; }; struct __anonstruct____missing_field_name_219 { struct ieee80211_tx_rate driver_rates[5U] ; void *rate_driver_data[3U] ; }; union __anonunion____missing_field_name_214 { struct __anonstruct_control_215 control ; struct __anonstruct_status_218 status ; struct __anonstruct____missing_field_name_219 __annonCompField38 ; void *driver_data[5U] ; }; struct ieee80211_tx_info { u32 flags ; u8 band ; u8 antenna_sel_tx ; u8 pad[2U] ; union __anonunion____missing_field_name_214 __annonCompField39 ; }; enum ieee80211_smps_mode { IEEE80211_SMPS_AUTOMATIC = 0, IEEE80211_SMPS_OFF = 1, IEEE80211_SMPS_STATIC = 2, IEEE80211_SMPS_DYNAMIC = 3, IEEE80211_SMPS_NUM_MODES = 4 } ; struct ieee80211_conf { u32 flags ; int power_level ; int dynamic_ps_timeout ; int max_sleep_period ; u16 listen_interval ; u8 ps_dtim_period ; u8 long_frame_max_tx_count ; u8 short_frame_max_tx_count ; struct ieee80211_channel *channel ; enum nl80211_channel_type channel_type ; enum ieee80211_smps_mode smps_mode ; }; struct ieee80211_channel_switch { u64 timestamp ; bool block_tx ; struct ieee80211_channel *channel ; u8 count ; }; struct ieee80211_vif { enum nl80211_iftype type ; struct ieee80211_bss_conf bss_conf ; u8 addr[6U] ; u8 drv_priv[0U] ; }; enum ieee80211_key_alg { ALG_WEP = 0, ALG_TKIP = 1, ALG_CCMP = 2, ALG_AES_CMAC = 3 } ; struct ieee80211_key_conf { enum ieee80211_key_alg alg ; u8 icv_len ; u8 iv_len ; u8 hw_key_idx ; u8 flags ; s8 keyidx ; u8 keylen ; u8 key[0U] ; }; enum set_key_cmd { SET_KEY = 0, DISABLE_KEY = 1 } ; struct ieee80211_sta { u32 supp_rates[2U] ; u8 addr[6U] ; u16 aid ; struct ieee80211_sta_ht_cap ht_cap ; u8 drv_priv[0U] ; }; enum sta_notify_cmd { STA_NOTIFY_SLEEP = 0, STA_NOTIFY_AWAKE = 1 } ; struct ieee80211_hw { struct ieee80211_conf conf ; struct wiphy *wiphy ; char const *rate_control_algorithm ; void *priv ; u32 flags ; unsigned int extra_tx_headroom ; int channel_change_time ; int vif_data_size ; int sta_data_size ; u16 queues ; u16 max_listen_interval ; s8 max_signal ; u8 max_rates ; u8 max_rate_tries ; }; enum ieee80211_ampdu_mlme_action { IEEE80211_AMPDU_RX_START = 0, IEEE80211_AMPDU_RX_STOP = 1, IEEE80211_AMPDU_TX_START = 2, IEEE80211_AMPDU_TX_STOP = 3, IEEE80211_AMPDU_TX_OPERATIONAL = 4 } ; struct ieee80211_ops { int (*tx)(struct ieee80211_hw * , struct sk_buff * ) ; int (*start)(struct ieee80211_hw * ) ; void (*stop)(struct ieee80211_hw * ) ; int (*add_interface)(struct ieee80211_hw * , struct ieee80211_vif * ) ; void (*remove_interface)(struct ieee80211_hw * , struct ieee80211_vif * ) ; int (*config)(struct ieee80211_hw * , u32 ) ; void (*bss_info_changed)(struct ieee80211_hw * , struct ieee80211_vif * , struct ieee80211_bss_conf * , u32 ) ; u64 (*prepare_multicast)(struct ieee80211_hw * , struct netdev_hw_addr_list * ) ; void (*configure_filter)(struct ieee80211_hw * , unsigned int , unsigned int * , u64 ) ; int (*set_tim)(struct ieee80211_hw * , struct ieee80211_sta * , bool ) ; int (*set_key)(struct ieee80211_hw * , enum set_key_cmd , struct ieee80211_vif * , struct ieee80211_sta * , struct ieee80211_key_conf * ) ; void (*update_tkip_key)(struct ieee80211_hw * , struct ieee80211_vif * , struct ieee80211_key_conf * , struct ieee80211_sta * , u32 , u16 * ) ; int (*hw_scan)(struct ieee80211_hw * , struct ieee80211_vif * , struct cfg80211_scan_request * ) ; void (*sw_scan_start)(struct ieee80211_hw * ) ; void (*sw_scan_complete)(struct ieee80211_hw * ) ; int (*get_stats)(struct ieee80211_hw * , struct ieee80211_low_level_stats * ) ; void (*get_tkip_seq)(struct ieee80211_hw * , u8 , u32 * , u16 * ) ; int (*set_rts_threshold)(struct ieee80211_hw * , u32 ) ; int (*sta_add)(struct ieee80211_hw * , struct ieee80211_vif * , struct ieee80211_sta * ) ; int (*sta_remove)(struct ieee80211_hw * , struct ieee80211_vif * , struct ieee80211_sta * ) ; void (*sta_notify)(struct ieee80211_hw * , struct ieee80211_vif * , enum sta_notify_cmd , struct ieee80211_sta * ) ; int (*conf_tx)(struct ieee80211_hw * , u16 , struct ieee80211_tx_queue_params const * ) ; u64 (*get_tsf)(struct ieee80211_hw * ) ; void (*set_tsf)(struct ieee80211_hw * , u64 ) ; void (*reset_tsf)(struct ieee80211_hw * ) ; int (*tx_last_beacon)(struct ieee80211_hw * ) ; int (*ampdu_action)(struct ieee80211_hw * , struct ieee80211_vif * , enum ieee80211_ampdu_mlme_action , struct ieee80211_sta * , u16 , u16 * ) ; int (*get_survey)(struct ieee80211_hw * , int , struct survey_info * ) ; void (*rfkill_poll)(struct ieee80211_hw * ) ; void (*set_coverage_class)(struct ieee80211_hw * , u8 ) ; int (*testmode_cmd)(struct ieee80211_hw * , void * , int ) ; void (*flush)(struct ieee80211_hw * , bool ) ; void (*channel_switch)(struct ieee80211_hw * , struct ieee80211_channel_switch * ) ; }; struct b43_txstatus; enum b43_dyndbg { B43_DBG_XMITPOWER = 0, B43_DBG_DMAOVERFLOW = 1, B43_DBG_DMAVERBOSE = 2, B43_DBG_PWORK_FAST = 3, B43_DBG_PWORK_STOP = 4, B43_DBG_LO = 5, B43_DBG_FIRMWARE = 6, B43_DBG_KEYS = 7, B43_DBG_VERBOSESTATS = 8, __B43_NR_DYNDBG = 9 } ; struct b43_txstatus_log { struct b43_txstatus *log ; int end ; }; struct b43_dfs_file { struct dentry *dentry ; char *buffer ; size_t data_len ; }; struct b43_dfsentry { struct b43_wldev *dev ; struct dentry *subdir ; struct b43_dfs_file file_shm16read ; struct b43_dfs_file file_shm16write ; struct b43_dfs_file file_shm32read ; struct b43_dfs_file file_shm32write ; struct b43_dfs_file file_mmio16read ; struct b43_dfs_file file_mmio16write ; struct b43_dfs_file file_mmio32read ; struct b43_dfs_file file_mmio32write ; struct b43_dfs_file file_txstat ; struct b43_dfs_file file_txpower_g ; struct b43_dfs_file file_restart ; struct b43_dfs_file file_loctls ; struct b43_txstatus_log txstatlog ; u16 mmio16read_next ; u16 mmio32read_next ; u32 shm16read_routing_next ; u32 shm16read_addr_next ; u32 shm32read_routing_next ; u32 shm32read_addr_next ; u32 dyn_debug[9U] ; struct dentry *dyn_debug_dentries[9U] ; }; struct b43_wl; enum led_brightness { LED_OFF = 0, LED_HALF = 127, LED_FULL = 255 } ; struct led_trigger; struct led_classdev { char const *name ; int brightness ; int max_brightness ; int flags ; void (*brightness_set)(struct led_classdev * , enum led_brightness ) ; enum led_brightness (*brightness_get)(struct led_classdev * ) ; int (*blink_set)(struct led_classdev * , unsigned long * , unsigned long * ) ; struct device *dev ; struct list_head node ; char const *default_trigger ; struct rw_semaphore trigger_lock ; struct led_trigger *trigger ; struct list_head trig_list ; void *trigger_data ; }; struct led_trigger { char const *name ; void (*activate)(struct led_classdev * ) ; void (*deactivate)(struct led_classdev * ) ; rwlock_t leddev_list_lock ; struct list_head led_cdevs ; struct list_head next_trig ; }; struct b43_led { struct b43_wl *wl ; struct led_classdev led_dev ; u8 index ; bool activelow ; char name[32U] ; atomic_t state ; bool hw_state ; }; struct b43_leds { struct b43_led led_tx ; struct b43_led led_rx ; struct b43_led led_radio ; struct b43_led led_assoc ; bool stop ; struct work_struct work ; }; enum b43_interference_mitigation { B43_INTERFMODE_NONE = 0, B43_INTERFMODE_NONWLAN = 1, B43_INTERFMODE_MANUALWLAN = 2, B43_INTERFMODE_AUTOWLAN = 3 } ; enum b43_txpwr_result { B43_TXPWR_RES_NEED_ADJUST = 0, B43_TXPWR_RES_DONE = 1 } ; struct b43_phy_operations { int (*allocate)(struct b43_wldev * ) ; void (*free)(struct b43_wldev * ) ; void (*prepare_structs)(struct b43_wldev * ) ; int (*prepare_hardware)(struct b43_wldev * ) ; int (*init)(struct b43_wldev * ) ; void (*exit)(struct b43_wldev * ) ; u16 (*phy_read)(struct b43_wldev * , u16 ) ; void (*phy_write)(struct b43_wldev * , u16 , u16 ) ; void (*phy_maskset)(struct b43_wldev * , u16 , u16 , u16 ) ; u16 (*radio_read)(struct b43_wldev * , u16 ) ; void (*radio_write)(struct b43_wldev * , u16 , u16 ) ; bool (*supports_hwpctl)(struct b43_wldev * ) ; void (*software_rfkill)(struct b43_wldev * , bool ) ; void (*switch_analog)(struct b43_wldev * , bool ) ; int (*switch_channel)(struct b43_wldev * , unsigned int ) ; unsigned int (*get_default_chan)(struct b43_wldev * ) ; void (*set_rx_antenna)(struct b43_wldev * , int ) ; int (*interf_mitigation)(struct b43_wldev * , enum b43_interference_mitigation ) ; enum b43_txpwr_result (*recalc_txpower)(struct b43_wldev * , bool ) ; void (*adjust_txpower)(struct b43_wldev * ) ; void (*pwork_15sec)(struct b43_wldev * ) ; void (*pwork_60sec)(struct b43_wldev * ) ; }; struct b43_phy_a; struct b43_phy_g; struct b43_phy_n; struct b43_phy_lp; struct __anonstruct____missing_field_name_220 { struct b43_phy_a *a ; struct b43_phy_g *g ; struct b43_phy_n *n ; struct b43_phy_lp *lp ; }; struct b43_phy { struct b43_phy_operations const *ops ; struct __anonstruct____missing_field_name_220 __annonCompField40 ; bool supports_2ghz ; bool supports_5ghz ; bool is_40mhz ; bool gmode ; u8 analog ; u8 type ; u8 rev ; u16 radio_manuf ; u16 radio_ver ; u8 radio_rev ; bool radio_on ; int desired_txpower ; bool hardware_power_control ; unsigned long next_txpwr_check_time ; unsigned int channel ; atomic_t txerr_cnt ; bool phy_locked ; bool radio_locked ; }; struct b43_phy_a { s8 const *tssi2dbm ; int tgt_idle_tssi ; int cur_idle_tssi ; u16 txpwr_offset ; }; struct b43_rfatt { u8 att ; bool with_padmix ; }; struct b43_rfatt_list { struct b43_rfatt const *list ; u8 len ; u8 min_val ; u8 max_val ; }; struct b43_bbatt { u8 att ; }; struct b43_bbatt_list { struct b43_bbatt const *list ; u8 len ; u8 min_val ; u8 max_val ; }; struct b43_txpower_lo_control; enum ldv_25049 { B43_OFDMTAB_DIRECTION_UNKNOWN = 0, B43_OFDMTAB_DIRECTION_READ = 1, B43_OFDMTAB_DIRECTION_WRITE = 2 } ; struct __anonstruct_radio_off_context_221 { bool valid ; u16 rfover ; u16 rfoverval ; }; struct b43_phy_g { bool aci_enable ; bool aci_wlan_automatic ; bool aci_hw_rssi ; bool radio_on ; struct __anonstruct_radio_off_context_221 radio_off_context ; u16 minlowsig[2U] ; u16 minlowsigpos[2U] ; s8 const *tssi2dbm ; bool dyn_tssi_tbl ; int tgt_idle_tssi ; int cur_idle_tssi ; u8 average_tssi ; struct b43_bbatt bbatt ; struct b43_rfatt rfatt ; u8 tx_control ; int bbatt_delta ; int rfatt_delta ; struct b43_txpower_lo_control *lo_control ; s16 max_lb_gain ; s16 trsw_rx_gain ; s16 lna_lod_gain ; s16 lna_gain ; s16 pga_gain ; int interfmode ; u32 interfstack[26U] ; s16 nrssi[2U] ; s32 nrssislope ; s8 nrssi_lt[64U] ; u16 lofcal ; u16 initval ; u16 ofdmtab_addr ; enum ldv_25049 ofdmtab_addr_direction ; }; struct b43_txpower_lo_control { struct b43_rfatt_list rfatt_list ; struct b43_bbatt_list bbatt_list ; u16 dc_lt[32U] ; struct list_head calib_list ; unsigned long pwr_vec_read_time ; unsigned long txctl_measured_time ; u8 tx_bias ; u8 tx_magn ; u64 power_vector ; }; struct b43_fw_header { u8 type ; u8 ver ; u8 __padding[2U] ; __be32 size ; }; union __anonunion_data_222 { __be16 d16 ; __be32 d32 ; }; struct b43_iv { __be16 offset_size ; union __anonunion_data_222 data ; }; struct b43_dma { struct b43_dmaring *tx_ring_AC_BK ; struct b43_dmaring *tx_ring_AC_BE ; struct b43_dmaring *tx_ring_AC_VI ; struct b43_dmaring *tx_ring_AC_VO ; struct b43_dmaring *tx_ring_mcast ; struct b43_dmaring *rx_ring ; }; struct b43_pio_txqueue; struct b43_pio_rxqueue; struct b43_pio { struct b43_pio_txqueue *tx_queue_AC_BK ; struct b43_pio_txqueue *tx_queue_AC_BE ; struct b43_pio_txqueue *tx_queue_AC_VI ; struct b43_pio_txqueue *tx_queue_AC_VO ; struct b43_pio_txqueue *tx_queue_mcast ; struct b43_pio_rxqueue *rx_queue ; }; struct b43_noise_calculation { bool calculation_running ; u8 nr_samples ; s8 samples[8U][4U] ; }; struct b43_stats { u8 link_noise ; }; struct b43_key { struct ieee80211_key_conf *keyconf ; u8 algorithm ; }; struct b43_qos_params { struct ieee80211_tx_queue_params p ; }; enum b43_firmware_file_type { B43_FWTYPE_PROPRIETARY = 0, B43_FWTYPE_OPENSOURCE = 1, B43_NR_FWTYPES = 2 } ; struct b43_request_fw_context { struct b43_wldev *dev ; enum b43_firmware_file_type req_type ; char errors[2U][128U] ; char fwname[64U] ; int fatal_failure ; }; struct b43_firmware_file { char const *filename ; struct firmware const *data ; enum b43_firmware_file_type type ; }; struct b43_firmware { struct b43_firmware_file ucode ; struct b43_firmware_file pcm ; struct b43_firmware_file initvals ; struct b43_firmware_file initvals_band ; u16 rev ; u16 patch ; bool opensource ; bool pcm_request_failed ; }; union __anonunion____missing_field_name_223 { struct b43_dma dma ; struct b43_pio pio ; }; struct b43_wldev { struct ssb_device *dev ; struct b43_wl *wl ; atomic_t __init_status ; bool bad_frames_preempt ; bool dfq_valid ; bool radio_hw_enable ; bool qos_enabled ; bool hwcrypto_enabled ; bool use_pio ; struct b43_phy phy ; union __anonunion____missing_field_name_223 __annonCompField41 ; bool __using_pio_transfers ; struct b43_stats stats ; u32 irq_reason ; u32 dma_reason[6U] ; u32 irq_mask ; struct b43_noise_calculation noisecalc ; int mac_suspended ; struct delayed_work periodic_work ; unsigned int periodic_state ; struct work_struct restart_work ; u16 ktp ; struct b43_key key[58U] ; struct b43_firmware fw ; struct list_head list ; struct b43_dfsentry *dfsentry ; unsigned int irq_count ; unsigned int irq_bit_count[32U] ; unsigned int tx_count ; unsigned int rx_count ; }; struct b43_wl { struct b43_wldev *current_dev ; struct ieee80211_hw *hw ; struct mutex mutex ; spinlock_t hardirq_lock ; u16 mac80211_initially_registered_queues ; struct ieee80211_vif *vif ; u8 mac_addr[6U] ; u8 bssid[6U] ; int if_type ; bool operating ; unsigned int filter_flags ; struct ieee80211_low_level_stats ieee_stats ; struct hwrng rng ; bool rng_initialized ; char rng_name[31U] ; struct list_head devlist ; u8 nr_devs ; bool radiotap_enabled ; bool radio_enabled ; struct sk_buff *current_beacon ; bool beacon0_uploaded ; bool beacon1_uploaded ; bool beacon_templates_virgin ; struct work_struct beacon_update_trigger ; struct b43_qos_params qos_params[4U] ; struct work_struct txpower_adjust_work ; struct work_struct tx_work ; struct sk_buff_head tx_queue ; struct b43_leds leds ; u8 pio_scratchspace[110U] ; u8 pio_tailspace[4U] ; }; struct b43_chanspec { u8 channel ; u8 sideband ; u8 b_width ; u8 b_freq ; }; struct b43_phy_n_iq_comp { s16 a0 ; s16 b0 ; s16 a1 ; s16 b1 ; }; struct b43_phy_n_rssical_cache { u16 rssical_radio_regs_2G[2U] ; u16 rssical_phy_regs_2G[12U] ; u16 rssical_radio_regs_5G[2U] ; u16 rssical_phy_regs_5G[12U] ; }; struct b43_phy_n_cal_cache { u16 txcal_radio_regs_2G[8U] ; u16 txcal_coeffs_2G[8U] ; struct b43_phy_n_iq_comp rxcal_coeffs_2G ; u16 txcal_radio_regs_5G[8U] ; u16 txcal_coeffs_5G[8U] ; struct b43_phy_n_iq_comp rxcal_coeffs_5G ; }; struct b43_phy_n_txpwrindex { s8 index ; s8 index_internal ; s8 index_internal_save ; u16 AfectrlOverride ; u16 AfeCtrlDacGain ; u16 rad_gain ; u8 bbmult ; u16 iqcomp_a ; u16 iqcomp_b ; u16 locomp ; }; struct b43_phy_n { u8 antsel_type ; u8 cal_orig_pwr_idx[2U] ; u8 measure_hold ; u8 phyrxchain ; u8 perical ; u32 deaf_count ; u32 rxcalparams ; bool hang_avoid ; bool mute ; u16 papd_epsilon_offset[2U] ; s32 preamble_override ; u32 bb_mult_save ; u8 b_width ; struct b43_chanspec radio_chanspec ; bool gain_boost ; bool elna_gain_config ; bool band5g_pwrgain ; u8 mphase_cal_phase_id ; u16 mphase_txcal_cmdidx ; u16 mphase_txcal_numcmds ; u16 mphase_txcal_bestcoeffs[11U] ; u8 txpwrctrl ; u16 txcal_bbmult ; u16 txiqlocal_bestc[11U] ; bool txiqlocal_coeffsvalid ; struct b43_phy_n_txpwrindex txpwrindex[2U] ; struct b43_chanspec txiqlocal_chanspec ; u8 txrx_chain ; u16 tx_rx_cal_phy_saveregs[11U] ; u16 tx_rx_cal_radio_saveregs[22U] ; u16 rfctrl_intc1_save ; u16 rfctrl_intc2_save ; u16 classifier_state ; u16 clip_state[2U] ; bool aband_spurwar_en ; bool gband_spurwar_en ; bool ipa2g_on ; struct b43_chanspec iqcal_chanspec_2G ; struct b43_chanspec rssical_chanspec_2G ; bool ipa5g_on ; struct b43_chanspec iqcal_chanspec_5G ; struct b43_chanspec rssical_chanspec_5G ; struct b43_phy_n_rssical_cache rssical_cache ; struct b43_phy_n_cal_cache cal_cache ; bool crsminpwr_adjusted ; bool noisevars_adjusted ; }; struct b43_dmadesc32 { __le32 control ; __le32 address ; }; struct b43_dmadesc64 { __le32 control0 ; __le32 control1 ; __le32 address_low ; __le32 address_high ; }; union __anonunion____missing_field_name_224 { struct b43_dmadesc32 dma32 ; struct b43_dmadesc64 dma64 ; }; struct b43_dmadesc_generic { union __anonunion____missing_field_name_224 __annonCompField42 ; }; struct b43_dmadesc_meta { struct sk_buff *skb ; dma_addr_t dmaaddr ; bool is_last_fragment ; }; struct b43_dma_ops { struct b43_dmadesc_generic *(*idx2desc)(struct b43_dmaring * , int , struct b43_dmadesc_meta ** ) ; void (*fill_descriptor)(struct b43_dmaring * , struct b43_dmadesc_generic * , dma_addr_t , u16 , int , int , int ) ; void (*poke_tx)(struct b43_dmaring * , int ) ; void (*tx_suspend)(struct b43_dmaring * ) ; void (*tx_resume)(struct b43_dmaring * ) ; int (*get_current_rxslot)(struct b43_dmaring * ) ; void (*set_current_rxslot)(struct b43_dmaring * , int ) ; }; enum b43_dmatype { B43_DMA_30BIT = 30, B43_DMA_32BIT = 32, B43_DMA_64BIT = 64 } ; struct b43_dmaring { struct b43_dma_ops const *ops ; void *descbase ; struct b43_dmadesc_meta *meta ; u8 *txhdr_cache ; dma_addr_t dmabase ; int nr_slots ; int used_slots ; int current_slot ; u32 frameoffset ; u16 rx_buffersize ; u16 mmio_base ; int index ; bool tx ; enum b43_dmatype type ; bool stopped ; u8 queue_prio ; struct b43_wldev *dev ; int max_used_slots ; unsigned long last_injected_overflow ; u64 nr_succeed_tx_packets ; u64 nr_failed_tx_packets ; u64 nr_total_packet_tries ; }; struct b43_pio_txpacket { struct b43_pio_txqueue *queue ; struct sk_buff *skb ; u8 index ; struct list_head list ; }; struct b43_pio_txqueue { struct b43_wldev *dev ; u16 mmio_base ; u16 buffer_size ; u16 buffer_used ; u16 free_packet_slots ; bool stopped ; u8 index ; u8 queue_prio ; struct b43_pio_txpacket packets[32U] ; struct list_head packets_list ; u8 rev ; }; struct b43_pio_rxqueue { struct b43_wldev *dev ; u16 mmio_base ; u8 rev ; }; union __anonunion____missing_field_name_225 { __le32 data ; __u8 raw[4U] ; }; struct b43_plcp_hdr4 { union __anonunion____missing_field_name_225 __annonCompField43 ; }; struct b43_txstatus { u16 cookie ; u16 seq ; u8 phy_stat ; u8 frame_count ; u8 rts_count ; u8 supp_reason ; u8 pm_indicated ; u8 intermediate ; u8 for_ampdu ; u8 acked ; }; struct mmc_card; typedef void sdio_irq_handler_t(struct sdio_func * ); struct sdio_func_tuple { struct sdio_func_tuple *next ; unsigned char code ; unsigned char size ; unsigned char data[0U] ; }; struct sdio_func { struct mmc_card *card ; struct device dev ; sdio_irq_handler_t *irq_handler ; unsigned int num ; unsigned char class ; unsigned short vendor ; unsigned short device ; unsigned int max_blksize ; unsigned int cur_blksize ; unsigned int enable_timeout ; unsigned int state ; u8 tmpbuf[4U] ; unsigned int num_info ; char const **info ; struct sdio_func_tuple *tuples ; }; typedef int ldv_func_ret_type; typedef int ldv_func_ret_type___0; typedef int ldv_func_ret_type___1; typedef int ldv_func_ret_type___2; typedef struct ieee80211_hw *ldv_func_ret_type___3; enum hrtimer_restart; enum hrtimer_restart; struct b43_c32 { s32 i ; s32 q ; }; enum b43_lpphy_txpctl_mode { B43_LPPHY_TXPCTL_UNKNOWN = 0, B43_LPPHY_TXPCTL_OFF = 1, B43_LPPHY_TXPCTL_SW = 2, B43_LPPHY_TXPCTL_HW = 3 } ; struct b43_phy_lp { enum b43_lpphy_txpctl_mode txpctl_mode ; u8 tx_isolation_med_band ; u8 tx_isolation_low_band ; u8 tx_isolation_hi_band ; u16 max_tx_pwr_med_band ; u16 max_tx_pwr_low_band ; u16 max_tx_pwr_hi_band ; u16 tx_max_rate[15U] ; u16 tx_max_ratel[15U] ; u16 tx_max_rateh[15U] ; s16 txpa[3U] ; s16 txpal[3U] ; s16 txpah[3U] ; u8 rx_pwr_offset ; u16 tssi_tx_count ; u16 tssi_idx ; u16 tssi_npt ; u16 tgt_tx_freq ; s8 tx_pwr_idx_over ; u8 rssi_vf ; u8 rssi_vc ; u8 rssi_gs ; u8 rc_cap ; u8 bx_arch ; u8 full_calib_chan ; bool tx_iqloc_best_coeffs_valid ; u8 tx_iqloc_best_coeffs[11U] ; u16 dig_flt_state[9U] ; bool crs_usr_disable ; bool crs_sys_disable ; unsigned int pdiv ; u8 channel ; int antenna ; int tx_tone_freq ; }; enum hrtimer_restart; struct init2050_saved_values { u16 reg_3EC ; u16 reg_3E6 ; u16 reg_3F4 ; u16 radio_43 ; u16 radio_51 ; u16 radio_52 ; u16 phy_pgactl ; u16 phy_cck_5A ; u16 phy_cck_59 ; u16 phy_cck_58 ; u16 phy_cck_30 ; u16 phy_rfover ; u16 phy_rfoverval ; u16 phy_analogover ; u16 phy_analogoverval ; u16 phy_crs0 ; u16 phy_classctl ; u16 phy_lo_mask ; u16 phy_lo_ctl ; u16 phy_syncctl ; }; enum hrtimer_restart; enum hrtimer_restart; enum ssb_pmu_ldo_volt_id { LDO_PAREF = 0, LDO_VOLT1 = 1, LDO_VOLT2 = 2, LDO_VOLT3 = 3 } ; struct b2062_freqdata { u16 freq ; u8 data[6U] ; }; struct lpphy_stx_table_entry { u16 phy_offset ; u16 phy_shift ; u16 rf_addr ; u16 rf_shift ; u16 mask ; }; struct lpphy_iq_est { u32 iq_prod ; u32 i_pwr ; u32 q_pwr ; }; struct lpphy_tx_gains { u16 gm ; u16 pga ; u16 pad ; u16 dac ; }; struct lpphy_rx_iq_comp { u8 chan ; s8 c1 ; s8 c0 ; }; struct b206x_channel { u8 channel ; u16 freq ; u8 data[12U] ; }; enum hrtimer_restart; struct lpphy_tx_gain_table_entry { u8 gm ; u8 pga ; u8 pad ; u8 dac ; u8 bb_mult ; }; struct b206x_init_tab_entry { u16 offset ; u16 value_a ; u16 value_g ; u8 flags ; }; enum hrtimer_restart; struct __ssb_dev_wrapper { struct device dev ; struct ssb_device *sdev ; }; enum hrtimer_restart; struct ieee80211_hdr { __le16 frame_control ; __le16 duration_id ; u8 addr1[6U] ; u8 addr2[6U] ; u8 addr3[6U] ; __le16 seq_ctrl ; u8 addr4[6U] ; }; struct ieee80211_rts { __le16 frame_control ; __le16 duration ; u8 ra[6U] ; u8 ta[6U] ; }; struct ieee80211_cts { __le16 frame_control ; __le16 duration ; u8 ra[6U] ; }; struct ieee80211_rx_status; struct ieee80211_rx_status { u64 mactime ; enum ieee80211_band band ; int freq ; int signal ; int antenna ; int rate_idx ; int flag ; }; enum ieee80211_tkip_key_type { IEEE80211_TKIP_P1_KEY = 0, IEEE80211_TKIP_P2_KEY = 1 } ; union __anonunion____missing_field_name_225___0 { __le32 data ; __u8 raw[6U] ; }; struct b43_plcp_hdr6 { union __anonunion____missing_field_name_225___0 __annonCompField43 ; }; struct __anonstruct_new_format_227 { __le16 mimo_antenna ; __le16 preload_size ; u8 __p4dding53[2U] ; __le16 cookie ; __le16 tx_status ; struct b43_plcp_hdr6 rts_plcp ; __u8 rts_frame[16U] ; u8 __p4dding58[2U] ; struct b43_plcp_hdr6 plcp ; }; struct __anonstruct_old_format_228 { u8 __p4dding64[2U] ; __le16 cookie ; __le16 tx_status ; struct b43_plcp_hdr6 rts_plcp ; __u8 rts_frame[16U] ; u8 __p4dding69[2U] ; struct b43_plcp_hdr6 plcp ; }; union __anonunion____missing_field_name_226 { struct __anonstruct_new_format_227 new_format ; struct __anonstruct_old_format_228 old_format ; }; struct b43_txhdr { __le32 mac_ctl ; __le16 mac_frame_ctl ; __le16 tx_fes_time_norm ; __le16 phy_ctl ; __le16 phy_ctl1 ; __le16 phy_ctl1_fb ; __le16 phy_ctl1_rts ; __le16 phy_ctl1_rts_fb ; __u8 phy_rate ; __u8 phy_rate_rts ; __u8 extra_ft ; __u8 chan_radio_code ; __u8 iv[16U] ; __u8 tx_receiver[6U] ; __le16 tx_fes_time_fb ; struct b43_plcp_hdr6 rts_plcp_fb ; __le16 rts_dur_fb ; struct b43_plcp_hdr6 plcp_fb ; __le16 dur_fb ; __le16 mimo_modelen ; __le16 mimo_ratelen_fb ; __le32 timeout ; union __anonunion____missing_field_name_226 __annonCompField44 ; }; struct __anonstruct____missing_field_name_230 { __u8 jssi ; __u8 sig_qual ; }; struct __anonstruct____missing_field_name_231 { __s8 power0 ; __s8 power1 ; }; union __anonunion____missing_field_name_229 { struct __anonstruct____missing_field_name_230 __annonCompField45 ; struct __anonstruct____missing_field_name_231 __annonCompField46 ; }; struct b43_rxhdr_fw4 { __le16 frame_len ; u8 __p4dding214[2U] ; __le16 phy_status0 ; union __anonunion____missing_field_name_229 __annonCompField47 ; __le16 phy_status2 ; __le16 phy_status3 ; __le32 mac_status ; __le16 mac_time ; __le16 channel ; }; enum hrtimer_restart; struct b43_loctl { s8 i ; s8 q ; }; struct b43_lo_calib { struct b43_bbatt bbatt ; struct b43_rfatt rfatt ; struct b43_loctl ctl ; unsigned long calib_time ; struct list_head list ; }; struct lo_g_saved_values { u8 old_channel ; u16 reg_3F4 ; u16 reg_3E2 ; u16 phy_lo_mask ; u16 phy_extg_01 ; u16 phy_dacctl_hwpctl ; u16 phy_dacctl ; u16 phy_cck_14 ; u16 phy_hpwr_tssictl ; u16 phy_analogover ; u16 phy_analogoverval ; u16 phy_rfover ; u16 phy_rfoverval ; u16 phy_classctl ; u16 phy_cck_3E ; u16 phy_crs0 ; u16 phy_pgactl ; u16 phy_cck_2A ; u16 phy_syncctl ; u16 phy_cck_30 ; u16 phy_cck_06 ; u16 radio_43 ; u16 radio_7A ; u16 radio_52 ; }; struct b43_lo_g_statemachine { int current_state ; int nr_measured ; int state_val_multiplier ; u16 lowest_feedth ; struct b43_loctl min_loctl ; }; enum hrtimer_restart; 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 b43_private_tx_info { void *bouncebuffer ; }; enum hrtimer_restart; enum hrtimer_restart; enum hrtimer_restart; enum b43_led_behaviour { B43_LED_OFF = 0, B43_LED_ON = 1, B43_LED_ACTIVITY = 2, B43_LED_RADIO_ALL = 3, B43_LED_RADIO_A = 4, B43_LED_RADIO_B = 5, B43_LED_MODE_BG = 6, B43_LED_TRANSFER = 7, B43_LED_APTRANSFER = 8, B43_LED_WEIRD = 9, B43_LED_ASSOC = 10, B43_LED_INACTIVE = 11 } ; typedef unsigned short u_short; typedef unsigned int u_int; typedef unsigned long u_long; enum hrtimer_restart; struct pcmcia_device_id { __u16 match_flags ; __u16 manf_id ; __u16 card_id ; __u8 func_id ; __u8 function ; __u8 device_no ; __u32 prod_id_hash[4U] ; char const *prod_id[4U] ; kernel_ulong_t driver_info ; char *cisfile ; }; struct config_req_t { u_int Attributes ; u_int Vpp ; u_int IntType ; u_int ConfigBase ; u_char Status ; u_char Pin ; u_char Copy ; u_char ExtStatus ; u_char ConfigIndex ; u_int Present ; }; typedef struct config_req_t config_req_t; struct win_req_t { u_int Attributes ; u_long Base ; u_int Size ; u_int AccessSpeed ; }; typedef struct win_req_t win_req_t; struct socket_state_t { u_int flags ; u_int csc_mask ; u_char Vcc ; u_char Vpp ; u_char io_irq ; }; typedef struct socket_state_t socket_state_t; struct pccard_io_map { u_char map ; u_char flags ; u_short speed ; phys_addr_t start ; phys_addr_t stop ; }; struct pccard_mem_map { u_char map ; u_char flags ; u_short speed ; phys_addr_t static_start ; u_int card_start ; struct resource *res ; }; typedef struct pccard_mem_map pccard_mem_map; struct io_window_t { u_int InUse ; u_int Config ; struct resource *res ; }; typedef struct io_window_t io_window_t; struct pcmcia_socket; struct pccard_resource_ops; struct config_t; struct pcmcia_callback; struct pccard_operations { int (*init)(struct pcmcia_socket * ) ; int (*suspend)(struct pcmcia_socket * ) ; int (*get_status)(struct pcmcia_socket * , u_int * ) ; int (*set_socket)(struct pcmcia_socket * , socket_state_t * ) ; int (*set_io_map)(struct pcmcia_socket * , struct pccard_io_map * ) ; int (*set_mem_map)(struct pcmcia_socket * , struct pccard_mem_map * ) ; }; struct pcmcia_socket { struct module *owner ; socket_state_t socket ; u_int state ; u_int suspended_state ; u_short functions ; u_short lock_count ; pccard_mem_map cis_mem ; void *cis_virt ; io_window_t io[2U] ; pccard_mem_map win[4U] ; struct list_head cis_cache ; size_t fake_cis_len ; u8 *fake_cis ; struct list_head socket_list ; struct completion socket_released ; unsigned int sock ; u_int features ; u_int irq_mask ; u_int map_size ; u_int io_offset ; u_int pci_irq ; struct pci_dev *cb_dev ; u8 resource_setup_done ; struct pccard_operations *ops ; struct pccard_resource_ops *resource_ops ; void *resource_data ; void (*zoom_video)(struct pcmcia_socket * , int ) ; int (*power_hook)(struct pcmcia_socket * , int ) ; void (*tune_bridge)(struct pcmcia_socket * , struct pci_bus * ) ; struct task_struct *thread ; struct completion thread_done ; unsigned int thread_events ; unsigned int sysfs_events ; struct mutex skt_mutex ; struct mutex ops_mutex ; spinlock_t thread_lock ; struct pcmcia_callback *callback ; struct list_head devices_list ; u8 device_count ; u8 pcmcia_pfc ; atomic_t present ; unsigned int pcmcia_irq ; struct device dev ; void *driver_data ; int resume_status ; }; typedef struct resource *window_handle_t; struct pcmcia_dynids { struct mutex lock ; struct list_head list ; }; struct pcmcia_driver { int (*probe)(struct pcmcia_device * ) ; void (*remove)(struct pcmcia_device * ) ; int (*suspend)(struct pcmcia_device * ) ; int (*resume)(struct pcmcia_device * ) ; struct module *owner ; struct pcmcia_device_id *id_table ; struct device_driver drv ; struct pcmcia_dynids dynids ; }; struct pcmcia_device { struct pcmcia_socket *socket ; char *devname ; u8 device_no ; u8 func ; struct config_t *function_config ; struct list_head socket_device_list ; config_req_t conf ; window_handle_t win ; unsigned int irq ; struct resource *resource[6U] ; unsigned int io_lines ; unsigned char suspended : 1 ; unsigned char _irq : 1 ; unsigned char _io : 1 ; unsigned char _win : 4 ; unsigned char _locked : 1 ; unsigned char allow_func_id_match : 1 ; unsigned char has_manf_id : 1 ; unsigned char has_card_id : 1 ; unsigned char has_func_id : 1 ; unsigned char reserved : 4 ; u8 func_id ; u16 manf_id ; u16 card_id ; char *prod_id[4U] ; u64 dma_mask ; struct device dev ; void *priv ; unsigned int open ; }; enum hrtimer_restart; struct mmc_host; struct mmc_cid { unsigned int manfid ; char prod_name[8U] ; unsigned int serial ; unsigned short oemid ; unsigned short year ; unsigned char hwrev ; unsigned char fwrev ; unsigned char month ; }; struct mmc_csd { unsigned char structure ; unsigned char mmca_vsn ; unsigned short cmdclass ; unsigned short tacc_clks ; unsigned int tacc_ns ; unsigned int r2w_factor ; unsigned int max_dtr ; unsigned int erase_size ; unsigned int read_blkbits ; unsigned int write_blkbits ; unsigned int capacity ; unsigned char read_partial : 1 ; unsigned char read_misalign : 1 ; unsigned char write_partial : 1 ; unsigned char write_misalign : 1 ; }; struct mmc_ext_csd { u8 rev ; u8 erase_group_def ; u8 sec_feature_support ; unsigned int sa_timeout ; unsigned int hs_max_dtr ; unsigned int sectors ; unsigned int hc_erase_size ; unsigned int hc_erase_timeout ; unsigned int sec_trim_mult ; unsigned int sec_erase_mult ; unsigned int trim_timeout ; }; struct sd_scr { unsigned char sda_vsn ; unsigned char bus_widths ; }; struct sd_ssr { unsigned int au ; unsigned int erase_timeout ; unsigned int erase_offset ; }; struct sd_switch_caps { unsigned int hs_max_dtr ; }; struct sdio_cccr { unsigned int sdio_vsn ; unsigned int sd_vsn ; unsigned char multi_block : 1 ; unsigned char low_speed : 1 ; unsigned char wide_bus : 1 ; unsigned char high_power : 1 ; unsigned char high_speed : 1 ; unsigned char disable_cd : 1 ; }; struct sdio_cis { unsigned short vendor ; unsigned short device ; unsigned short blksize ; unsigned int max_dtr ; }; struct mmc_card { struct mmc_host *host ; struct device dev ; unsigned int rca ; unsigned int type ; unsigned int state ; unsigned int quirks ; unsigned int erase_size ; unsigned int erase_shift ; unsigned int pref_erase ; u8 erased_byte ; u32 raw_cid[4U] ; u32 raw_csd[4U] ; u32 raw_scr[2U] ; struct mmc_cid cid ; struct mmc_csd csd ; struct mmc_ext_csd ext_csd ; struct sd_scr scr ; struct sd_ssr ssr ; struct sd_switch_caps sw_caps ; unsigned int sdio_funcs ; struct sdio_cccr cccr ; struct sdio_cis cis ; struct sdio_func *sdio_func[7U] ; unsigned int num_info ; char const **info ; struct sdio_func_tuple *tuples ; struct dentry *debugfs_root ; }; struct sdio_device_id { __u8 class ; __u16 vendor ; __u16 device ; kernel_ulong_t driver_data ; }; struct sdio_driver { char *name ; struct sdio_device_id const *id_table ; int (*probe)(struct sdio_func * , struct sdio_device_id const * ) ; void (*remove)(struct sdio_func * ) ; struct device_driver drv ; }; struct b43_sdio { struct ssb_bus ssb ; void *irq_handler_opaque ; void (*irq_handler)(struct b43_wldev * ) ; }; struct b43_sdio_quirk { u16 vendor ; u16 device ; unsigned int quirks ; }; enum hrtimer_restart; struct b43_debugfs_fops { ssize_t (*read)(struct b43_wldev * , char * , size_t ) ; int (*write)(struct b43_wldev * , char const * , size_t ) ; struct file_operations fops ; size_t file_struct_offset ; }; struct notifier_block { int (*notifier_call)(struct notifier_block * , unsigned long , void * ) ; struct notifier_block *next ; int priority ; }; enum hrtimer_restart; typedef unsigned int mmc_pm_flag_t; struct mmc_data; struct mmc_request; struct mmc_command { u32 opcode ; u32 arg ; u32 resp[4U] ; unsigned int flags ; unsigned int retries ; unsigned int error ; unsigned int erase_timeout ; struct mmc_data *data ; struct mmc_request *mrq ; }; struct mmc_data { unsigned int timeout_ns ; unsigned int timeout_clks ; unsigned int blksz ; unsigned int blocks ; unsigned int error ; unsigned int flags ; unsigned int bytes_xfered ; struct mmc_command *stop ; struct mmc_request *mrq ; unsigned int sg_len ; struct scatterlist *sg ; }; struct mmc_request { struct mmc_command *cmd ; struct mmc_data *data ; struct mmc_command *stop ; void *done_data ; void (*done)(struct mmc_request * ) ; }; struct mmc_ios { unsigned int clock ; unsigned short vdd ; unsigned char bus_mode ; unsigned char chip_select ; unsigned char power_mode ; unsigned char bus_width ; unsigned char timing ; }; struct mmc_host_ops { int (*enable)(struct mmc_host * ) ; int (*disable)(struct mmc_host * , int ) ; void (*request)(struct mmc_host * , struct mmc_request * ) ; void (*set_ios)(struct mmc_host * , struct mmc_ios * ) ; int (*get_ro)(struct mmc_host * ) ; int (*get_cd)(struct mmc_host * ) ; void (*enable_sdio_irq)(struct mmc_host * , int ) ; void (*init_card)(struct mmc_host * , struct mmc_card * ) ; }; struct mmc_bus_ops; struct mmc_host { struct device *parent ; struct device class_dev ; int index ; struct mmc_host_ops const *ops ; unsigned int f_min ; unsigned int f_max ; u32 ocr_avail ; struct notifier_block pm_notify ; unsigned long caps ; mmc_pm_flag_t pm_caps ; unsigned int max_seg_size ; unsigned short max_hw_segs ; unsigned short max_phys_segs ; unsigned short unused ; unsigned int max_req_size ; unsigned int max_blk_size ; unsigned int max_blk_count ; spinlock_t lock ; struct mmc_ios ios ; u32 ocr ; unsigned char use_spi_crc : 1 ; unsigned char claimed : 1 ; unsigned char bus_dead : 1 ; unsigned char removed : 1 ; int enabled ; int rescan_disable ; int nesting_cnt ; int en_dis_recurs ; unsigned int disable_delay ; struct delayed_work disable ; struct mmc_card *card ; wait_queue_head_t wq ; struct task_struct *claimer ; int claim_cnt ; struct delayed_work detect ; struct mmc_bus_ops const *bus_ops ; unsigned int bus_refs ; unsigned int sdio_irqs ; struct task_struct *sdio_irq_thread ; atomic_t sdio_irq_thread_abort ; mmc_pm_flag_t pm_flags ; struct led_trigger *led ; struct dentry *debugfs_root ; unsigned long private[0U] ; }; void ldv__builtin_va_end(__builtin_va_list ) ; void __builtin_prefetch(void const * , ...) ; __inline static long ldv__builtin_expect(long exp , long c ) ; void ldv__builtin_va_start(__builtin_va_list ) ; __inline static __u32 __arch_swab32(__u32 val ) { { __asm__ ("bswapl %0": "=r" (val): "0" (val)); return (val); } } __inline static __u16 __fswab16(__u16 val ) { { return ((__u16 )((int )((short )((int )val << 8)) | (int )((short )((int )val >> 8)))); } } __inline static __u32 __fswab32(__u32 val ) { __u32 tmp ; { tmp = __arch_swab32(val); return (tmp); } } __inline static __u32 __swab32p(__u32 const *p ) { __u32 tmp ; { tmp = __fswab32(*p); return (tmp); } } __inline static __u32 __be32_to_cpup(__be32 const *p ) { __u32 tmp ; { tmp = __swab32p(p); return (tmp); } } extern void warn_slowpath_null(char const * , int const ) ; extern void __might_sleep(char const * , int , int ) ; extern int snprintf(char * , size_t , char const * , ...) ; extern int vprintk(char const * , va_list * ) ; extern int printk(char const * , ...) ; extern void print_hex_dump(char const * , char const * , int , int , int , void const * , size_t , bool ) ; extern void *memcpy(void * , void const * , size_t ) ; extern void *memset(void * , int , size_t ) ; extern size_t strlen(char const * ) ; extern int strcmp(char const * , char const * ) ; __inline static void INIT_LIST_HEAD(struct list_head *list ) { { list->next = list; list->prev = list; return; } } extern void __list_add(struct list_head * , struct list_head * , struct list_head * ) ; __inline static void list_add(struct list_head *new , struct list_head *head ) { { __list_add(new, head, head->next); return; } } extern void list_del(struct list_head * ) ; __inline static int list_empty(struct list_head const *head ) { { return ((unsigned long )((struct list_head const *)head->next) == (unsigned long )head); } } __inline static int atomic_read(atomic_t const *v ) { { return ((int )*((int volatile *)(& v->counter))); } } __inline static void atomic_set(atomic_t *v , int i ) { { v->counter = i; return; } } __inline static int atomic_dec_and_test(atomic_t *v ) { unsigned char c ; { __asm__ volatile (".section .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.previous\n671:\n\tlock; decl %0; sete %1": "+m" (v->counter), "=qm" (c): : "memory"); return ((unsigned int )c != 0U); } } extern void lockdep_init_map(struct lockdep_map * , char const * , struct lock_class_key * , int ) ; extern void __raw_spin_lock_init(raw_spinlock_t * , char const * , struct lock_class_key * ) ; extern void _raw_spin_lock(raw_spinlock_t * ) ; extern void _raw_spin_lock_irq(raw_spinlock_t * ) ; extern void _raw_spin_unlock(raw_spinlock_t * ) ; extern void _raw_spin_unlock_irq(raw_spinlock_t * ) ; __inline static raw_spinlock_t *spinlock_check(spinlock_t *lock ) { { return (& lock->__annonCompField19.rlock); } } __inline static void spin_lock(spinlock_t *lock ) { { _raw_spin_lock(& lock->__annonCompField19.rlock); return; } } __inline static void spin_lock_irq(spinlock_t *lock ) { { _raw_spin_lock_irq(& lock->__annonCompField19.rlock); return; } } __inline static void spin_unlock(spinlock_t *lock ) { { _raw_spin_unlock(& lock->__annonCompField19.rlock); return; } } __inline static void spin_unlock_irq(spinlock_t *lock ) { { _raw_spin_unlock_irq(& lock->__annonCompField19.rlock); return; } } extern void __mutex_init(struct mutex * , char const * , struct lock_class_key * ) ; __inline static int mutex_is_locked(struct mutex *lock ) { int tmp ; { tmp = atomic_read((atomic_t const *)(& lock->count)); return (tmp != 1); } } extern void mutex_lock_nested(struct mutex * , unsigned int ) ; extern void mutex_unlock(struct mutex * ) ; extern void __const_udelay(unsigned long ) ; extern void msleep(unsigned int ) ; extern unsigned long volatile jiffies ; extern unsigned long msecs_to_jiffies(unsigned int const ) ; extern int del_timer(struct timer_list * ) ; int ldv_del_timer_2(struct timer_list *ldv_func_arg1 ) ; extern int del_timer_sync(struct timer_list * ) ; int ldv_del_timer_sync_1(struct timer_list *ldv_func_arg1 ) ; extern unsigned long round_jiffies_relative(unsigned long ) ; extern void __init_work(struct work_struct * , int ) ; extern int cancel_work_sync(struct work_struct * ) ; extern int cancel_delayed_work_sync(struct delayed_work * ) ; __inline static char const *kobject_name(struct kobject const *kobj ) { { return ((char const *)kobj->name); } } 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___1 ; { tmp___1 = __kmalloc(size, flags); return (tmp___1); } } __inline static void *kzalloc(size_t size , gfp_t flags ) { void *tmp ; { tmp = kmalloc(size, flags | 32768U); return (tmp); } } extern void *malloc(size_t ) ; extern void *calloc(size_t , size_t ) ; extern int __VERIFIER_nondet_int(void) ; extern unsigned long __VERIFIER_nondet_ulong(void) ; extern void *__VERIFIER_nondet_pointer(void) ; extern void __VERIFIER_assume(int ) ; void *ldv_malloc(size_t size ) { void *p ; void *tmp ; int tmp___0 ; { tmp___0 = __VERIFIER_nondet_int(); if (tmp___0 != 0) { return ((void *)0); } else { tmp = malloc(size); p = tmp; __VERIFIER_assume((unsigned long )p != (unsigned long )((void *)0)); return (p); } } } void *ldv_zalloc(size_t size ) { void *p ; void *tmp ; int tmp___0 ; { tmp___0 = __VERIFIER_nondet_int(); if (tmp___0 != 0) { return ((void *)0); } else { tmp = calloc(1UL, size); p = tmp; __VERIFIER_assume((unsigned long )p != (unsigned long )((void *)0)); return (p); } } } void *ldv_init_zalloc(size_t size ) { void *p ; void *tmp ; { tmp = calloc(1UL, size); p = tmp; __VERIFIER_assume((unsigned long )p != (unsigned long )((void *)0)); return (p); } } void *ldv_memset(void *s , int c , size_t n ) { void *tmp ; { tmp = memset(s, c, n); return (tmp); } } int ldv_undef_int(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); return (tmp); } } void *ldv_undef_ptr(void) { void *tmp ; { tmp = __VERIFIER_nondet_pointer(); return (tmp); } } unsigned long ldv_undef_ulong(void) { unsigned long tmp ; { tmp = __VERIFIER_nondet_ulong(); return (tmp); } } __inline static void ldv_stop(void) { { LDV_STOP: ; goto LDV_STOP; } } __inline static long ldv__builtin_expect(long exp , long c ) { { return (exp); } } struct file *fops_mmio16read_group0 ; int ldv_state_variable_20 ; struct work_struct *ldv_work_struct_3_1 ; int ldv_state_variable_30 ; struct file *fops_mmio32read_group0 ; int ldv_work_8_1 ; int ldv_state_variable_0 ; struct file *fops_loctls_group0 ; int ldv_irq_2_0 = 0; int ldv_state_variable_12 ; struct ieee80211_hw *b43_hw_ops_group0 ; int ldv_state_variable_22 ; int ldv_state_variable_14 ; int ldv_state_variable_29 ; int ldv_state_variable_17 ; struct work_struct *ldv_work_struct_8_1 ; void *ldv_irq_data_2_3 ; int ldv_work_7_2 ; struct b43_wldev *b43_phyops_lp_group0 ; int ldv_state_variable_19 ; struct work_struct *ldv_work_struct_4_3 ; int ldv_state_variable_27 ; int ldv_state_variable_9 ; struct work_struct *ldv_work_struct_7_1 ; int ldv_work_6_0 ; struct b43_wldev *b43_phyops_g_group0 ; struct work_struct *ldv_work_struct_6_1 ; int ref_cnt ; int ldv_irq_line_1_1 ; void *ldv_irq_data_2_2 ; int ldv_work_3_3 ; struct work_struct *ldv_work_struct_4_0 ; struct ssb_device *b43_ssb_driver_group0 ; struct work_struct *ldv_work_struct_8_3 ; int ldv_state_variable_7 ; int ldv_state_variable_23 ; struct work_struct *ldv_work_struct_3_3 ; int ldv_irq_2_1 = 0; void *ldv_irq_data_2_1 ; int ldv_irq_1_3 = 0; int ldv_irq_line_2_2 ; struct file *fops_mmio16write_group0 ; int ldv_work_4_0 ; struct work_struct *ldv_work_struct_3_2 ; int ldv_state_variable_6 ; void *ldv_irq_data_1_0 ; struct file *fops_mmio32write_group0 ; int ldv_work_5_0 ; void *ldv_irq_data_1_3 ; struct work_struct *ldv_work_struct_7_2 ; int ldv_state_variable_26 ; struct work_struct *ldv_work_struct_4_2 ; int ldv_state_variable_28 ; struct work_struct *ldv_work_struct_7_0 ; struct file *fops_restart_group0 ; int LDV_IN_INTERRUPT = 1; struct work_struct *ldv_work_struct_6_0 ; int ldv_irq_1_1 = 0; int ldv_work_8_3 ; struct work_struct *ldv_work_struct_5_1 ; struct b43_dmaring *dma64_ops_group0 ; int ldv_work_5_2 ; int ldv_work_7_1 ; int ldv_state_variable_3 ; int ldv_irq_line_1_0 ; int ldv_work_6_2 ; int ldv_state_variable_4 ; int ldv_state_variable_8 ; int ldv_state_variable_15 ; struct work_struct *ldv_work_struct_6_3 ; int ldv_work_8_0 ; struct device_attribute *dev_attr_interference_group0 ; struct work_struct *ldv_work_struct_5_2 ; int ldv_state_variable_21 ; struct work_struct *ldv_work_struct_5_3 ; int ldv_state_variable_5 ; int ldv_state_variable_13 ; struct work_struct *ldv_work_struct_8_0 ; int ldv_work_3_2 ; int ldv_timer_state_9 = 0; int ldv_work_3_0 ; int ldv_irq_2_2 = 0; struct b43_wldev *b43_phyops_a_group0 ; int ldv_state_variable_24 ; int ldv_work_7_3 ; int ldv_irq_line_2_0 ; struct file *fops_shm16write_group0 ; struct file *fops_shm32read_group0 ; int ldv_state_variable_1 ; int ldv_work_5_3 ; int ldv_irq_line_1_2 ; int ldv_irq_line_2_3 ; struct file *fops_shm32write_group0 ; int ldv_work_6_1 ; void *ldv_irq_data_1_1 ; struct work_struct *ldv_work_struct_6_2 ; int ldv_state_variable_10 ; int ldv_irq_1_0 = 0; int ldv_work_7_0 ; struct pcmcia_device *b43_pcmcia_driver_group0 ; struct work_struct *ldv_work_struct_8_2 ; int ldv_work_4_1 ; int ldv_work_4_3 ; int ldv_state_variable_16 ; int ldv_work_3_1 ; int ldv_irq_line_2_1 ; struct work_struct *ldv_work_struct_7_3 ; int ldv_state_variable_2 ; int ldv_state_variable_25 ; int ldv_work_5_1 ; struct device *dev_attr_interference_group1 ; struct sdio_func *b43_sdio_driver_group0 ; void *ldv_irq_data_1_2 ; int ldv_work_6_3 ; struct timer_list *ldv_timer_list_9 ; void *ldv_irq_data_2_0 ; struct work_struct *ldv_work_struct_3_0 ; int ldv_work_4_2 ; int ldv_state_variable_11 ; struct b43_dmaring *dma32_ops_group0 ; int ldv_irq_1_2 = 0; int ldv_state_variable_18 ; int ldv_irq_2_3 = 0; struct work_struct *ldv_work_struct_5_0 ; int ldv_irq_line_1_3 ; struct file *fops_shm16read_group0 ; int ldv_work_8_2 ; struct work_struct *ldv_work_struct_4_1 ; struct file *fops_txstat_group0 ; void activate_work_5(struct work_struct *work , int state ) ; void ldv_initialize_b43_debugfs_fops_17(void) ; void work_init_3(void) ; void call_and_disable_all_7(int state ) ; void disable_suitable_irq_2(int line , void *data ) ; void invoke_work_6(void) ; void activate_pending_timer_9(struct timer_list *timer , unsigned long data , int pending_flag ) ; int reg_check_1(irqreturn_t (*handler)(int , void * ) , irqreturn_t (*thread_fn)(int , void * ) ) ; void activate_work_3(struct work_struct *work , int state ) ; void work_init_5(void) ; void call_and_disable_all_4(int state ) ; void ldv_initialize_b43_phy_operations_26(void) ; void ldv_initialize_b43_debugfs_fops_15(void) ; void work_init_7(void) ; void invoke_work_7(void) ; void disable_work_5(struct work_struct *work ) ; void call_and_disable_work_3(struct work_struct *work ) ; void disable_work_7(struct work_struct *work ) ; void disable_work_3(struct work_struct *work ) ; void ldv_initialize_b43_debugfs_fops_20(void) ; void call_and_disable_all_6(int state ) ; void disable_suitable_irq_1(int line , void *data ) ; void activate_suitable_irq_1(int line , void *data ) ; void ldv_initialize_b43_debugfs_fops_13(void) ; void invoke_work_4(void) ; void call_and_disable_work_5(struct work_struct *work ) ; void ldv_initialize_b43_debugfs_fops_18(void) ; void ldv_initialize_b43_debugfs_fops_14(void) ; int ldv_irq_2(int state , int line , void *data ) ; void ldv_initialize_b43_dma_ops_24(void) ; void activate_work_6(struct work_struct *work , int state ) ; void ldv_initialize_sdio_driver_21(void) ; void choose_interrupt_2(void) ; void activate_work_4(struct work_struct *work , int state ) ; void call_and_disable_work_7(struct work_struct *work ) ; void ldv_initialize_b43_dma_ops_23(void) ; void call_and_disable_all_5(int state ) ; int reg_timer_9(struct timer_list *timer ) ; void activate_suitable_irq_2(int line , void *data ) ; void work_init_8(void) ; void disable_suitable_timer_9(struct timer_list *timer ) ; void ldv_initialize_b43_phy_operations_28(void) ; void ldv_initialize_b43_debugfs_fops_11(void) ; void work_init_6(void) ; void disable_work_6(struct work_struct *work ) ; void ldv_initialize_pcmcia_driver_22(void) ; void ldv_initialize_b43_phy_operations_27(void) ; void choose_interrupt_1(void) ; void invoke_work_5(void) ; void ldv_initialize_b43_debugfs_fops_16(void) ; int reg_check_2(irqreturn_t (*handler)(int , void * ) , irqreturn_t (*thread_fn)(int , void * ) ) ; void ldv_initialize_device_attribute_25(void) ; void activate_work_7(struct work_struct *work , int state ) ; void choose_timer_9(struct timer_list *timer ) ; void disable_work_4(struct work_struct *work ) ; void work_init_4(void) ; void invoke_work_3(void) ; int ldv_irq_1(int state , int line , void *data ) ; void ldv_initialize_b43_debugfs_fops_10(void) ; void call_and_disable_all_3(int state ) ; void ldv_initialize_b43_debugfs_fops_19(void) ; void ldv_initialize_b43_debugfs_fops_12(void) ; void call_and_disable_work_6(struct work_struct *work ) ; void call_and_disable_work_4(struct work_struct *work ) ; void ldv_initialize_ieee80211_ops_30(void) ; void ldv_initialize_ssb_driver_29(void) ; extern int net_ratelimit(void) ; __inline static char const *dev_name(struct device const *dev ) { char const *tmp ; { if ((unsigned long )dev->init_name != (unsigned long )((char const */* const */)0)) { return ((char const *)dev->init_name); } else { } tmp = kobject_name(& dev->kobj); return (tmp); } } extern void consume_skb(struct sk_buff * ) ; __inline static unsigned char *skb_end_pointer(struct sk_buff const *skb ) { { return ((unsigned char *)skb->head + (unsigned long )skb->end); } } __inline static __u32 skb_queue_len(struct sk_buff_head const *list_ ) { { return ((__u32 )list_->qlen); } } __inline static void __skb_queue_head_init(struct sk_buff_head *list ) { struct sk_buff *tmp ; { tmp = (struct sk_buff *)list; list->next = tmp; list->prev = tmp; list->qlen = 0U; return; } } __inline static void skb_queue_head_init(struct sk_buff_head *list ) { struct lock_class_key __key ; { spinlock_check(& list->lock); __raw_spin_lock_init(& list->lock.__annonCompField19.rlock, "&(&list->lock)->rlock", & __key); __skb_queue_head_init(list); return; } } extern void skb_queue_tail(struct sk_buff_head * , struct sk_buff * ) ; extern struct sk_buff *skb_dequeue(struct sk_buff_head * ) ; extern void synchronize_irq(unsigned int ) ; extern int request_threaded_irq(unsigned int , irqreturn_t (*)(int , void * ) , irqreturn_t (*)(int , void * ) , unsigned long , char const * , void * ) ; int ldv_request_threaded_irq_3(unsigned int ldv_func_arg1 , irqreturn_t (*handler)(int , void * ) , irqreturn_t (*thread_fn)(int , void * ) , unsigned long ldv_func_arg4 , char const *ldv_func_arg5 , void *ldv_func_arg6 ) ; int ldv_request_threaded_irq_5(unsigned int ldv_func_arg1 , irqreturn_t (*handler)(int , void * ) , irqreturn_t (*thread_fn)(int , void * ) , unsigned long ldv_func_arg4 , char const *ldv_func_arg5 , void *ldv_func_arg6 ) ; extern void free_irq(unsigned int , void * ) ; void ldv_free_irq_4(unsigned int ldv_func_arg1 , void *ldv_func_arg2 ) ; extern void dev_kfree_skb_any(struct sk_buff * ) ; __inline static u32 get_unaligned_be32(void const *p ) { __u32 tmp ; { tmp = __be32_to_cpup((__be32 const *)p); return (tmp); } } __inline static int is_zero_ether_addr(u8 const *addr ) { { return ((unsigned int )((((((int )((unsigned char )*addr) | (int )((unsigned char )*(addr + 1UL))) | (int )((unsigned char )*(addr + 2UL))) | (int )((unsigned char )*(addr + 3UL))) | (int )((unsigned char )*(addr + 4UL))) | (int )((unsigned char )*(addr + 5UL))) == 0U); } } __inline static int is_multicast_ether_addr(u8 const *addr ) { { return ((int )*addr & 1); } } __inline static int is_valid_ether_addr(u8 const *addr ) { int tmp ; int tmp___0 ; int tmp___1 ; { tmp = is_multicast_ether_addr(addr); if (tmp == 0) { tmp___0 = is_zero_ether_addr(addr); if (tmp___0 == 0) { tmp___1 = 1; } else { tmp___1 = 0; } } else { tmp___1 = 0; } return (tmp___1); } } extern int request_firmware(struct firmware const ** , char const * , struct device * ) ; extern void release_firmware(struct firmware const * ) ; extern int hwrng_register(struct hwrng * ) ; extern void hwrng_unregister(struct hwrng * ) ; __inline static void ssb_set_drvdata(struct ssb_device *dev , void *data ) { { dev->drvdata = data; return; } } __inline static void *ssb_get_drvdata(struct ssb_device *dev ) { { return (dev->drvdata); } } extern void ssb_set_devtypedata(struct ssb_device * , void * ) ; __inline static void *ssb_get_devtypedata(struct ssb_device *dev ) { { return (dev->devtypedata); } } extern int __ssb_driver_register(struct ssb_driver * , struct module * ) ; __inline static int ssb_driver_register(struct ssb_driver *drv ) { int tmp ; { tmp = __ssb_driver_register(drv, & __this_module); return (tmp); } } extern void ssb_driver_unregister(struct ssb_driver * ) ; extern int ssb_pcicore_dev_irqvecs_enable(struct ssb_pcicore * , struct ssb_device * ) ; extern int ssb_device_is_enabled(struct ssb_device * ) ; extern void ssb_device_enable(struct ssb_device * , u32 ) ; extern void ssb_device_disable(struct ssb_device * , u32 ) ; __inline static u16 ssb_read16(struct ssb_device *dev , u16 offset ) { u16 tmp ; { tmp = (*((dev->ops)->read16))(dev, (int )offset); return (tmp); } } __inline static u32 ssb_read32(struct ssb_device *dev , u16 offset ) { u32 tmp ; { tmp = (*((dev->ops)->read32))(dev, (int )offset); return (tmp); } } __inline static void ssb_write16(struct ssb_device *dev , u16 offset , u16 value ) { { (*((dev->ops)->write16))(dev, (int )offset, (int )value); return; } } __inline static void ssb_write32(struct ssb_device *dev , u16 offset , u32 value ) { { (*((dev->ops)->write32))(dev, (int )offset, value); return; } } extern int ssb_bus_may_powerdown(struct ssb_bus * ) ; extern int ssb_bus_powerup(struct ssb_bus * , bool ) ; __inline static void set_wiphy_dev(struct wiphy *wiphy , struct device *dev ) { { wiphy->dev.parent = dev; return; } } __inline static char const *wiphy_name(struct wiphy const *wiphy ) { char const *tmp ; { tmp = dev_name(& wiphy->dev); return (tmp); } } extern struct ieee80211_rate *ieee80211_get_response_rate(struct ieee80211_supported_band * , u32 , int ) ; extern void wiphy_rfkill_start_polling(struct wiphy * ) ; __inline static struct ieee80211_tx_info *IEEE80211_SKB_CB(struct sk_buff *skb ) { { return ((struct ieee80211_tx_info *)(& skb->cb)); } } __inline static void SET_IEEE80211_DEV(struct ieee80211_hw *hw , struct device *dev ) { { set_wiphy_dev(hw->wiphy, dev); return; } } __inline static void SET_IEEE80211_PERM_ADDR(struct ieee80211_hw *hw , u8 *addr ) { size_t __len ; void *__ret ; { __len = 6UL; if (__len > 63UL) { __ret = memcpy((void *)(& (hw->wiphy)->perm_addr), (void const *)addr, __len); } else { __ret = __builtin_memcpy((void *)(& (hw->wiphy)->perm_addr), (void const *)addr, __len); } return; } } __inline static struct ieee80211_rate *ieee80211_get_tx_rate(struct ieee80211_hw const *hw , struct ieee80211_tx_info const *c ) { int __ret_warn_on ; long tmp ; long tmp___0 ; { __ret_warn_on = (int )((signed char )c->__annonCompField39.control.__annonCompField37.__annonCompField36.rates[0].idx) < 0; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("include/net/mac80211.h", 1178); } else { } tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { return ((struct ieee80211_rate *)0); } else { } return (((hw->wiphy)->bands[(int )c->band])->bitrates + (unsigned long )c->__annonCompField39.control.__annonCompField37.__annonCompField36.rates[0].idx); } } extern struct ieee80211_hw *ieee80211_alloc_hw(size_t , struct ieee80211_ops const * ) ; struct ieee80211_hw *ldv_ieee80211_alloc_hw_7(size_t ldv_func_arg1 , struct ieee80211_ops const *ldv_func_arg2 ) ; extern int ieee80211_register_hw(struct ieee80211_hw * ) ; extern void ieee80211_unregister_hw(struct ieee80211_hw * ) ; extern void ieee80211_free_hw(struct ieee80211_hw * ) ; void ldv_ieee80211_free_hw_6(struct ieee80211_hw *ldv_func_arg1 ) ; extern struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw * , struct ieee80211_vif * , u16 * , u16 * ) ; __inline static struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw , struct ieee80211_vif *vif ) { struct sk_buff *tmp ; { tmp = ieee80211_beacon_get_tim(hw, vif, (u16 *)0U, (u16 *)0U); return (tmp); } } extern void ieee80211_wake_queues(struct ieee80211_hw * ) ; extern void ieee80211_queue_work(struct ieee80211_hw * , struct work_struct * ) ; extern void ieee80211_queue_delayed_work(struct ieee80211_hw * , struct delayed_work * , unsigned long ) ; __inline static bool conf_is_ht40_minus(struct ieee80211_conf *conf ) { { return ((unsigned int )conf->channel_type == 2U); } } __inline static bool conf_is_ht40_plus(struct ieee80211_conf *conf ) { { return ((unsigned int )conf->channel_type == 3U); } } __inline static bool conf_is_ht(struct ieee80211_conf *conf ) { { return ((unsigned int )conf->channel_type != 0U); } } bool b43_debug(struct b43_wldev *dev , enum b43_dyndbg feature ) ; void b43_debugfs_init(void) ; void b43_debugfs_exit(void) ; void b43_debugfs_add_device(struct b43_wldev *dev ) ; void b43_debugfs_remove_device(struct b43_wldev *dev ) ; void b43_leds_register(struct b43_wldev *dev ) ; void b43_leds_unregister(struct b43_wl *wl ) ; void b43_leds_init(struct b43_wldev *dev ) ; void b43_leds_exit(struct b43_wldev *dev ) ; void b43_leds_stop(struct b43_wldev *dev ) ; void b43_rfkill_poll(struct ieee80211_hw *hw ) ; int b43_phy_allocate(struct b43_wldev *dev ) ; void b43_phy_free(struct b43_wldev *dev ) ; int b43_phy_init(struct b43_wldev *dev ) ; void b43_phy_exit(struct b43_wldev *dev ) ; void b43_radio_write(struct b43_wldev *dev , u16 reg , u16 value ) ; int b43_switch_channel(struct b43_wldev *dev , unsigned int new_channel ) ; void b43_software_rfkill(struct b43_wldev *dev , bool blocked ) ; void b43_phy_txpower_check(struct b43_wldev *dev , unsigned int flags ) ; void b43_phy_txpower_adjust_work(struct work_struct *work ) ; __inline static struct b43_wl *hw_to_b43_wl(struct ieee80211_hw *hw ) { { return ((struct b43_wl *)hw->priv); } } __inline static int b43_is_mode(struct b43_wl *wl , int type ) { { return ((int )wl->operating && wl->if_type == type); } } __inline static enum ieee80211_band b43_current_band(struct b43_wl *wl ) { { return (((wl->hw)->conf.channel)->band); } } __inline static u16 b43_read16(struct b43_wldev *dev , u16 offset ) { u16 tmp ; { tmp = ssb_read16(dev->dev, (int )offset); return (tmp); } } __inline static void b43_write16(struct b43_wldev *dev , u16 offset , u16 value ) { { ssb_write16(dev->dev, (int )offset, (int )value); return; } } __inline static u32 b43_read32(struct b43_wldev *dev , u16 offset ) { u32 tmp ; { tmp = ssb_read32(dev->dev, (int )offset); return (tmp); } } __inline static void b43_write32(struct b43_wldev *dev , u16 offset , u32 value ) { { ssb_write32(dev->dev, (int )offset, value); return; } } __inline static bool b43_using_pio_transfers(struct b43_wldev *dev ) { { return (dev->__using_pio_transfers); } } void b43info(struct b43_wl *wl , char const *fmt , ...) ; void b43err(struct b43_wl *wl , char const *fmt , ...) ; void b43warn(struct b43_wl *wl , char const *fmt , ...) ; void b43dbg(struct b43_wl *wl , char const *fmt , ...) ; int b43_modparam_verbose ; __inline static int b43_is_cck_rate(int rate ) { { return (((rate == 2 || rate == 4) || rate == 11) || rate == 22); } } u8 b43_ieee80211_antenna_sanitize(struct b43_wldev *dev , u8 antenna_nr ) ; void b43_tsf_read(struct b43_wldev *dev , u64 *tsf ) ; void b43_tsf_write(struct b43_wldev *dev , u64 tsf ) ; u32 b43_shm_read32(struct b43_wldev *dev , u16 routing , u16 offset ) ; u16 b43_shm_read16(struct b43_wldev *dev , u16 routing , u16 offset ) ; void b43_shm_write32(struct b43_wldev *dev , u16 routing , u16 offset , u32 value ) ; void b43_shm_write16(struct b43_wldev *dev , u16 routing , u16 offset , u16 value ) ; u64 b43_hf_read(struct b43_wldev *dev ) ; void b43_hf_write(struct b43_wldev *dev , u64 value ) ; void b43_dummy_transmission(struct b43_wldev *dev , bool ofdm , bool pa_on ) ; void b43_wireless_core_reset(struct b43_wldev *dev , u32 flags ) ; void b43_controller_restart(struct b43_wldev *dev , char const *reason ) ; void b43_power_saving_ctl_bits(struct b43_wldev *dev , unsigned int ps_flags ) ; void b43_mac_suspend(struct b43_wldev *dev ) ; void b43_mac_enable(struct b43_wldev *dev ) ; int b43_do_request_fw(struct b43_request_fw_context *ctx , char const *name , struct b43_firmware_file *fw ) ; void b43_do_release_fw(struct b43_firmware_file *fw ) ; int b43_dma_init(struct b43_wldev *dev ) ; void b43_dma_free(struct b43_wldev *dev ) ; int b43_dma_tx(struct b43_wldev *dev , struct sk_buff *skb ) ; void b43_dma_rx(struct b43_dmaring *ring ) ; int b43_pio_init(struct b43_wldev *dev ) ; void b43_pio_free(struct b43_wldev *dev ) ; int b43_pio_tx(struct b43_wldev *dev , struct sk_buff *skb ) ; void b43_pio_rx(struct b43_pio_rxqueue *q ) ; __inline static bool b43_is_old_txhdr_format(struct b43_wldev *dev ) { { return ((unsigned int )dev->fw.rev <= 351U); } } u8 b43_plcp_get_ratecode_cck(u8 const bitrate ) ; u8 b43_plcp_get_ratecode_ofdm(u8 const bitrate ) ; void b43_generate_plcp_hdr(struct b43_plcp_hdr4 *plcp , u16 const octets , u8 const bitrate ) ; void b43_handle_txstatus(struct b43_wldev *dev , struct b43_txstatus const *status ) ; __inline static int b43_new_kidx_api(struct b43_wldev *dev ) { { return ((unsigned int )dev->fw.rev > 350U); } } __inline static u8 b43_kidx_to_fw(struct b43_wldev *dev , u8 raw_kidx ) { u8 firmware_kidx ; int tmp ; { tmp = b43_new_kidx_api(dev); if (tmp != 0) { firmware_kidx = raw_kidx; } else if ((unsigned int )raw_kidx > 3U) { firmware_kidx = (unsigned int )raw_kidx + 252U; } else { firmware_kidx = raw_kidx; } return (firmware_kidx); } } int b43_pcmcia_init(void) ; void b43_pcmcia_exit(void) ; int b43_sdio_request_irq(struct b43_wldev *dev , void (*handler)(struct b43_wldev * ) ) ; void b43_sdio_free_irq(struct b43_wldev *dev ) ; int b43_sdio_init(void) ; void b43_sdio_exit(void) ; static int modparam_bad_frames_preempt ; static char modparam_fwpostfix[16U] ; static int modparam_hwpctl ; static int modparam_nohwcrypt ; static int modparam_hwtkip ; static int modparam_qos = 1; static int modparam_btcoex = 1; int b43_modparam_verbose = 3; static int b43_modparam_pio = 1; static struct ssb_device_id const b43_ssb_tbl[11U] = { {16963U, 2066U, 5U}, {16963U, 2066U, 6U}, {16963U, 2066U, 7U}, {16963U, 2066U, 9U}, {16963U, 2066U, 10U}, {16963U, 2066U, 11U}, {16963U, 2066U, 12U}, {16963U, 2066U, 13U}, {16963U, 2066U, 15U}, {16963U, 2066U, 16U}, {0U, (unsigned short)0, (unsigned char)0}}; struct ssb_device_id const __mod_ssb_device_table ; static struct ieee80211_rate __b43_ratetable[12U] = { {0U, 10U, 2U, (unsigned short)0}, {1U, 20U, 4U, (unsigned short)0}, {1U, 55U, 11U, (unsigned short)0}, {1U, 110U, 22U, (unsigned short)0}, {0U, 60U, 12U, (unsigned short)0}, {0U, 90U, 18U, (unsigned short)0}, {0U, 120U, 24U, (unsigned short)0}, {0U, 180U, 36U, (unsigned short)0}, {0U, 240U, 48U, (unsigned short)0}, {0U, 360U, 72U, (unsigned short)0}, {0U, 480U, 96U, (unsigned short)0}, {0U, 540U, 108U, (unsigned short)0}}; static struct ieee80211_channel b43_2ghz_chantable[14U] = { {0, 2412U, 1U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {0, 2417U, 2U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {0, 2422U, 3U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {0, 2427U, 4U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {0, 2432U, 5U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {0, 2437U, 6U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {0, 2442U, 7U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {0, 2447U, 8U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {0, 2452U, 9U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {0, 2457U, 10U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {0, 2462U, 11U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {0, 2467U, 12U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {0, 2472U, 13U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {0, 2484U, 14U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}}; static struct ieee80211_channel b43_5ghz_nphy_chantable[110U] = { {1, 5160U, 32U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5170U, 34U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5180U, 36U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5190U, 38U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5200U, 40U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5210U, 42U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5220U, 44U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5230U, 46U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5240U, 48U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5250U, 50U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5260U, 52U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5270U, 54U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5280U, 56U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5290U, 58U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5300U, 60U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5310U, 62U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5320U, 64U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5330U, 66U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5340U, 68U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5350U, 70U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5360U, 72U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5370U, 74U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5380U, 76U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5390U, 78U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5400U, 80U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5410U, 82U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5420U, 84U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5430U, 86U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5440U, 88U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5450U, 90U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5460U, 92U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5470U, 94U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5480U, 96U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5490U, 98U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5500U, 100U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5510U, 102U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5520U, 104U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5530U, 106U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5540U, 108U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5550U, 110U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5560U, 112U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5570U, 114U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5580U, 116U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5590U, 118U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5600U, 120U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5610U, 122U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5620U, 124U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5630U, 126U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5640U, 128U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5650U, 130U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5660U, 132U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5670U, 134U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5680U, 136U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5690U, 138U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5700U, 140U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5710U, 142U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5720U, 144U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5725U, 145U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5730U, 146U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5735U, 147U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5740U, 148U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5745U, 149U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5750U, 150U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5755U, 151U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5760U, 152U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5765U, 153U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5770U, 154U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5775U, 155U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5780U, 156U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5785U, 157U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5790U, 158U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5795U, 159U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5800U, 160U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5805U, 161U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5810U, 162U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5815U, 163U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5820U, 164U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5825U, 165U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5830U, 166U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5840U, 168U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5850U, 170U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5860U, 172U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5870U, 174U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5880U, 176U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5890U, 178U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5900U, 180U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5910U, 182U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5920U, 184U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5930U, 186U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5940U, 188U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5950U, 190U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5960U, 192U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5970U, 194U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5980U, 196U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5990U, 198U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 6000U, 200U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 6010U, 202U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 6020U, 204U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 6030U, 206U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 6040U, 208U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 6050U, 210U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 6060U, 212U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 6070U, 214U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 6080U, 216U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 6090U, 218U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 6100U, 220U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 6110U, 222U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 6120U, 224U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 6130U, 226U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 6140U, 228U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}}; static struct ieee80211_channel b43_5ghz_aphy_chantable[37U] = { {1, 5170U, 34U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5180U, 36U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5190U, 38U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5200U, 40U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5210U, 42U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5220U, 44U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5230U, 46U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5240U, 48U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5260U, 52U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5280U, 56U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5300U, 60U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5320U, 64U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5500U, 100U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5520U, 104U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5540U, 108U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5560U, 112U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5580U, 116U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5600U, 120U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5620U, 124U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5640U, 128U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5660U, 132U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5680U, 136U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5700U, 140U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5745U, 149U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5765U, 153U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5785U, 157U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5805U, 161U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5825U, 165U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5920U, 184U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5940U, 188U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5960U, 192U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 5980U, 196U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 6000U, 200U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 6020U, 204U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 6040U, 208U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 6060U, 212U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}, {1, 6080U, 216U, 0U, 0, 30, (_Bool)0, 0U, 0, 0}}; static struct ieee80211_supported_band b43_band_5GHz_nphy = {(struct ieee80211_channel *)(& b43_5ghz_nphy_chantable), (struct ieee80211_rate *)(& __b43_ratetable) + 4UL, 1, 110, 8, {(unsigned short)0, (_Bool)0, (unsigned char)0, (unsigned char)0, {{(unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0}, (unsigned short)0, (unsigned char)0, {(unsigned char)0, (unsigned char)0, (unsigned char)0}}}}; static struct ieee80211_supported_band b43_band_5GHz_aphy = {(struct ieee80211_channel *)(& b43_5ghz_aphy_chantable), (struct ieee80211_rate *)(& __b43_ratetable) + 4UL, 1, 37, 8, {(unsigned short)0, (_Bool)0, (unsigned char)0, (unsigned char)0, {{(unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0}, (unsigned short)0, (unsigned char)0, {(unsigned char)0, (unsigned char)0, (unsigned char)0}}}}; static struct ieee80211_supported_band b43_band_2GHz = {(struct ieee80211_channel *)(& b43_2ghz_chantable), (struct ieee80211_rate *)(& __b43_ratetable), 0, 14, 12, {(unsigned short)0, (_Bool)0, (unsigned char)0, (unsigned char)0, {{(unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0}, (unsigned short)0, (unsigned char)0, {(unsigned char)0, (unsigned char)0, (unsigned char)0}}}}; static void b43_wireless_core_exit(struct b43_wldev *dev ) ; static int b43_wireless_core_init(struct b43_wldev *dev ) ; static struct b43_wldev *b43_wireless_core_stop(struct b43_wldev *dev ) ; static int b43_wireless_core_start(struct b43_wldev *dev ) ; static int b43_ratelimit(struct b43_wl *wl ) { int tmp ; int tmp___0 ; { if ((unsigned long )wl == (unsigned long )((struct b43_wl *)0) || (unsigned long )wl->current_dev == (unsigned long )((struct b43_wldev *)0)) { return (1); } else { } tmp = atomic_read((atomic_t const *)(& (wl->current_dev)->__init_status)); if (tmp <= 1) { return (1); } else { } tmp___0 = net_ratelimit(); return (tmp___0); } } void b43info(struct b43_wl *wl , char const *fmt , ...) { va_list args ; int tmp ; char const *tmp___0 ; char const *tmp___1 ; { if (b43_modparam_verbose <= 1) { return; } else { } tmp = b43_ratelimit(wl); if (tmp == 0) { return; } else { } ldv__builtin_va_start((va_list *)(& args)); if ((unsigned long )wl != (unsigned long )((struct b43_wl *)0) && (unsigned long )wl->hw != (unsigned long )((struct ieee80211_hw *)0)) { tmp___0 = wiphy_name((struct wiphy const *)(wl->hw)->wiphy); tmp___1 = tmp___0; } else { tmp___1 = "wlan"; } printk("<6>b43-%s: ", tmp___1); vprintk(fmt, (va_list *)(& args)); ldv__builtin_va_end((va_list *)(& args)); return; } } void b43err(struct b43_wl *wl , char const *fmt , ...) { va_list args ; int tmp ; char const *tmp___0 ; char const *tmp___1 ; { if (b43_modparam_verbose < 0) { return; } else { } tmp = b43_ratelimit(wl); if (tmp == 0) { return; } else { } ldv__builtin_va_start((va_list *)(& args)); if ((unsigned long )wl != (unsigned long )((struct b43_wl *)0) && (unsigned long )wl->hw != (unsigned long )((struct ieee80211_hw *)0)) { tmp___0 = wiphy_name((struct wiphy const *)(wl->hw)->wiphy); tmp___1 = tmp___0; } else { tmp___1 = "wlan"; } printk("<3>b43-%s OLD_ERROR: ", tmp___1); vprintk(fmt, (va_list *)(& args)); ldv__builtin_va_end((va_list *)(& args)); return; } } void b43warn(struct b43_wl *wl , char const *fmt , ...) { va_list args ; int tmp ; char const *tmp___0 ; char const *tmp___1 ; { if (b43_modparam_verbose <= 0) { return; } else { } tmp = b43_ratelimit(wl); if (tmp == 0) { return; } else { } ldv__builtin_va_start((va_list *)(& args)); if ((unsigned long )wl != (unsigned long )((struct b43_wl *)0) && (unsigned long )wl->hw != (unsigned long )((struct ieee80211_hw *)0)) { tmp___0 = wiphy_name((struct wiphy const *)(wl->hw)->wiphy); tmp___1 = tmp___0; } else { tmp___1 = "wlan"; } printk("<4>b43-%s warning: ", tmp___1); vprintk(fmt, (va_list *)(& args)); ldv__builtin_va_end((va_list *)(& args)); return; } } void b43dbg(struct b43_wl *wl , char const *fmt , ...) { va_list args ; char const *tmp ; char const *tmp___0 ; { if (b43_modparam_verbose <= 2) { return; } else { } ldv__builtin_va_start((va_list *)(& args)); if ((unsigned long )wl != (unsigned long )((struct b43_wl *)0) && (unsigned long )wl->hw != (unsigned long )((struct ieee80211_hw *)0)) { tmp = wiphy_name((struct wiphy const *)(wl->hw)->wiphy); tmp___0 = tmp; } else { tmp___0 = "wlan"; } printk("<7>b43-%s debug: ", tmp___0); vprintk(fmt, (va_list *)(& args)); ldv__builtin_va_end((va_list *)(& args)); return; } } static void b43_ram_write(struct b43_wldev *dev , u16 offset , u32 val ) { u32 macctl ; int __ret_warn_on ; long tmp ; __u32 tmp___0 ; { __ret_warn_on = ((unsigned int )offset & 3U) != 0U; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 385); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); macctl = b43_read32(dev, 288); if ((macctl & 65536U) != 0U) { tmp___0 = __fswab32(val); val = tmp___0; } else { } b43_write32(dev, 304, (u32 )offset); __asm__ volatile ("": : : "memory"); b43_write32(dev, 308, val); return; } } __inline static void b43_shm_control_word(struct b43_wldev *dev , u16 routing , u16 offset ) { u32 control ; { control = (u32 )routing; control = control << 16; control = (u32 )offset | control; b43_write32(dev, 352, control); return; } } u32 b43_shm_read32(struct b43_wldev *dev , u16 routing , u16 offset ) { u32 ret ; int __ret_warn_on ; long tmp ; u16 tmp___0 ; u16 tmp___1 ; { if ((unsigned int )routing == 1U) { __ret_warn_on = (int )offset & 1; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 413); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); if (((int )offset & 3) != 0) { b43_shm_control_word(dev, (int )routing, (int )offset >> 2); tmp___0 = b43_read16(dev, 358); ret = (u32 )tmp___0; b43_shm_control_word(dev, (int )routing, (int )((unsigned int )((u16 )((int )offset >> 2)) + 1U)); tmp___1 = b43_read16(dev, 356); ret = ((unsigned int )tmp___1 << 16) | ret; goto out; } else { } offset = (u16 )((int )offset >> 2); } else { } b43_shm_control_word(dev, (int )routing, (int )offset); ret = b43_read32(dev, 356); out: ; return (ret); } } u16 b43_shm_read16(struct b43_wldev *dev , u16 routing , u16 offset ) { u16 ret ; int __ret_warn_on ; long tmp ; { if ((unsigned int )routing == 1U) { __ret_warn_on = (int )offset & 1; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 436); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); if (((int )offset & 3) != 0) { b43_shm_control_word(dev, (int )routing, (int )offset >> 2); ret = b43_read16(dev, 358); goto out; } else { } offset = (u16 )((int )offset >> 2); } else { } b43_shm_control_word(dev, (int )routing, (int )offset); ret = b43_read16(dev, 356); out: ; return (ret); } } void b43_shm_write32(struct b43_wldev *dev , u16 routing , u16 offset , u32 value ) { int __ret_warn_on ; long tmp ; { if ((unsigned int )routing == 1U) { __ret_warn_on = (int )offset & 1; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 455); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); if (((int )offset & 3) != 0) { b43_shm_control_word(dev, (int )routing, (int )offset >> 2); b43_write16(dev, 358, (int )((u16 )value)); b43_shm_control_word(dev, (int )routing, (int )((unsigned int )((u16 )((int )offset >> 2)) + 1U)); b43_write16(dev, 356, (int )((u16 )(value >> 16))); return; } else { } offset = (u16 )((int )offset >> 2); } else { } b43_shm_control_word(dev, (int )routing, (int )offset); b43_write32(dev, 356, value); return; } } void b43_shm_write16(struct b43_wldev *dev , u16 routing , u16 offset , u16 value ) { int __ret_warn_on ; long tmp ; { if ((unsigned int )routing == 1U) { __ret_warn_on = (int )offset & 1; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 475); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); if (((int )offset & 3) != 0) { b43_shm_control_word(dev, (int )routing, (int )offset >> 2); b43_write16(dev, 358, (int )value); return; } else { } offset = (u16 )((int )offset >> 2); } else { } b43_shm_control_word(dev, (int )routing, (int )offset); b43_write16(dev, 356, (int )value); return; } } u64 b43_hf_read(struct b43_wldev *dev ) { u64 ret ; u16 tmp ; u16 tmp___0 ; u16 tmp___1 ; { tmp = b43_shm_read16(dev, 1, 98); ret = (u64 )tmp; ret = ret << 16; tmp___0 = b43_shm_read16(dev, 1, 96); ret = (u64 )tmp___0 | ret; ret = ret << 16; tmp___1 = b43_shm_read16(dev, 1, 94); ret = (u64 )tmp___1 | ret; return (ret); } } void b43_hf_write(struct b43_wldev *dev , u64 value ) { u16 lo ; u16 mi ; u16 hi ; { lo = (u16 )value; mi = (u16 )((value & 4294901760ULL) >> 16); hi = (u16 )((value & 281470681743360ULL) >> 32); b43_shm_write16(dev, 1, 94, (int )lo); b43_shm_write16(dev, 1, 96, (int )mi); b43_shm_write16(dev, 1, 98, (int )hi); return; } } static u16 b43_fwcapa_read(struct b43_wldev *dev ) { int __ret_warn_on ; long tmp ; u16 tmp___0 ; { __ret_warn_on = ! dev->fw.opensource; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 518); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); tmp___0 = b43_shm_read16(dev, 1, 66); return (tmp___0); } } void b43_tsf_read(struct b43_wldev *dev , u64 *tsf ) { u32 low ; u32 high ; int __ret_warn_on ; long tmp ; { __ret_warn_on = (unsigned int )(dev->dev)->id.revision <= 2U; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 526); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); low = b43_read32(dev, 384); high = b43_read32(dev, 388); *tsf = (u64 )high; *tsf = *tsf << 32; *tsf = *tsf | (u64 )low; return; } } static void b43_time_lock(struct b43_wldev *dev ) { u32 macctl ; { macctl = b43_read32(dev, 288); macctl = macctl | 268435456U; b43_write32(dev, 288, macctl); b43_read32(dev, 288); return; } } static void b43_time_unlock(struct b43_wldev *dev ) { u32 macctl ; { macctl = b43_read32(dev, 288); macctl = macctl & 4026531839U; b43_write32(dev, 288, macctl); b43_read32(dev, 288); return; } } static void b43_tsf_write_locked(struct b43_wldev *dev , u64 tsf ) { u32 low ; u32 high ; int __ret_warn_on ; long tmp ; { __ret_warn_on = (unsigned int )(dev->dev)->id.revision <= 2U; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 564); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); low = (u32 )tsf; high = (u32 )(tsf >> 32); b43_write32(dev, 384, low); __asm__ volatile ("": : : "memory"); b43_write32(dev, 388, high); __asm__ volatile ("": : : "memory"); return; } } void b43_tsf_write(struct b43_wldev *dev , u64 tsf ) { { b43_time_lock(dev); b43_tsf_write_locked(dev, tsf); b43_time_unlock(dev); return; } } static void b43_macfilter_set(struct b43_wldev *dev , u16 offset , u8 const *mac ) { u8 zero_addr[6U] ; unsigned int tmp ; u16 data ; { zero_addr[0] = 0U; tmp = 1U; while (1) { if (tmp >= 6U) { break; } else { } zero_addr[tmp] = (unsigned char)0; tmp = tmp + 1U; } if ((unsigned long )mac == (unsigned long )((u8 const *)0U)) { mac = (u8 const *)(& zero_addr); } else { } offset = (u16 )((unsigned int )offset | 32U); b43_write16(dev, 1056, (int )offset); data = (u16 )*mac; data = (u16 )((int )((short )((int )*(mac + 1UL) << 8)) | (int )((short )data)); b43_write16(dev, 1058, (int )data); data = (u16 )*(mac + 2UL); data = (u16 )((int )((short )((int )*(mac + 3UL) << 8)) | (int )((short )data)); b43_write16(dev, 1058, (int )data); data = (u16 )*(mac + 4UL); data = (u16 )((int )((short )((int )*(mac + 5UL) << 8)) | (int )((short )data)); b43_write16(dev, 1058, (int )data); return; } } static void b43_write_mac_bssid_templates(struct b43_wldev *dev ) { u8 const *mac ; u8 const *bssid ; u8 mac_bssid[12U] ; int i ; u32 tmp ; size_t __len ; void *__ret ; size_t __len___0 ; void *__ret___0 ; { bssid = (u8 const *)(& (dev->wl)->bssid); mac = (u8 const *)(& (dev->wl)->mac_addr); b43_macfilter_set(dev, 3, bssid); __len = 6UL; if (__len > 63UL) { __ret = memcpy((void *)(& mac_bssid), (void const *)mac, __len); } else { __ret = __builtin_memcpy((void *)(& mac_bssid), (void const *)mac, __len); } __len___0 = 6UL; if (__len___0 > 63UL) { __ret___0 = memcpy((void *)(& mac_bssid) + 6U, (void const *)bssid, __len___0); } else { __ret___0 = __builtin_memcpy((void *)(& mac_bssid) + 6U, (void const *)bssid, __len___0); } i = 0; goto ldv_38065; ldv_38064: tmp = (unsigned int )mac_bssid[i]; tmp = ((unsigned int )mac_bssid[i + 1] << 8) | tmp; tmp = ((unsigned int )mac_bssid[i + 2] << 16) | tmp; tmp = ((unsigned int )mac_bssid[i + 3] << 24) | tmp; b43_ram_write(dev, (int )((unsigned int )((u16 )i) + 32U), tmp); i = (int )((unsigned int )i + 4U); ldv_38065: ; if ((unsigned int )i <= 11U) { goto ldv_38064; } else { } return; } } static void b43_upload_card_macaddress(struct b43_wldev *dev ) { { b43_write_mac_bssid_templates(dev); b43_macfilter_set(dev, 0, (u8 const *)(& (dev->wl)->mac_addr)); return; } } static void b43_set_slot_time(struct b43_wldev *dev , u16 slot_time ) { enum ieee80211_band tmp ; { tmp = b43_current_band(dev->wl); if ((unsigned int )tmp == 1U) { return; } else { } b43_write16(dev, 1668, (int )((unsigned int )slot_time + 510U)); return; } } static void b43_short_slot_timing_enable(struct b43_wldev *dev ) { { b43_set_slot_time(dev, 9); return; } } static void b43_short_slot_timing_disable(struct b43_wldev *dev ) { { b43_set_slot_time(dev, 20); return; } } void b43_dummy_transmission(struct b43_wldev *dev , bool ofdm , bool pa_on ) { struct b43_phy *phy ; unsigned int i ; unsigned int max_loop ; u16 value ; u32 buffer[5U] ; { phy = & dev->phy; buffer[0] = 0U; buffer[1] = 13893632U; buffer[2] = 0U; buffer[3] = 16777216U; buffer[4] = 0U; if ((int )ofdm) { max_loop = 30U; buffer[0] = 131532U; } else { max_loop = 250U; buffer[0] = 754798U; } i = 0U; goto ldv_38091; ldv_38090: b43_ram_write(dev, (int )((unsigned int )((u16 )i) * 4U), buffer[i]); i = i + 1U; ldv_38091: ; if (i <= 4U) { goto ldv_38090; } else { } b43_write16(dev, 1384, 0); if ((unsigned int )(dev->dev)->id.revision <= 10U) { b43_write16(dev, 1984, 0); } else { b43_write16(dev, 1984, 256); } value = (int )ofdm ? 65U : 64U; b43_write16(dev, 1292, (int )value); if ((unsigned int )phy->type == 4U || (unsigned int )phy->type == 5U) { b43_write16(dev, 1300, 6658); } else { } b43_write16(dev, 1288, 0); b43_write16(dev, 1290, 0); b43_write16(dev, 1356, 0); b43_write16(dev, 1386, 20); b43_write16(dev, 1384, 2086); b43_write16(dev, 1280, 0); switch ((int )phy->type) { case 4: b43_write16(dev, 1282, 208); goto ldv_38094; case 5: b43_write16(dev, 1282, 80); goto ldv_38094; default: b43_write16(dev, 1282, 48); } ldv_38094: ; if ((unsigned int )phy->radio_ver == 8272U && (unsigned int )phy->radio_rev <= 5U) { b43_radio_write(dev, 81, 23); } else { } i = 0U; goto ldv_38099; ldv_38098: value = b43_read16(dev, 1294); if (((int )value & 128) != 0) { goto ldv_38097; } else { } __const_udelay(42950UL); i = i + 1U; ldv_38099: ; if (i < max_loop) { goto ldv_38098; } else { } ldv_38097: i = 0U; goto ldv_38102; ldv_38101: value = b43_read16(dev, 1294); if (((int )value & 1024) != 0) { goto ldv_38100; } else { } __const_udelay(42950UL); i = i + 1U; ldv_38102: ; if (i <= 9U) { goto ldv_38101; } else { } ldv_38100: i = 0U; goto ldv_38105; ldv_38104: value = b43_read16(dev, 1680); if (((int )value & 256) == 0) { goto ldv_38103; } else { } __const_udelay(42950UL); i = i + 1U; ldv_38105: ; if (i <= 24U) { goto ldv_38104; } else { } ldv_38103: ; if ((unsigned int )phy->radio_ver == 8272U && (unsigned int )phy->radio_rev <= 5U) { b43_radio_write(dev, 81, 55); } else { } return; } } static void key_write(struct b43_wldev *dev , u8 index , u8 algorithm , u8 const *key ) { unsigned int i ; u32 offset ; u16 value ; u16 kidx ; u8 tmp ; { tmp = b43_kidx_to_fw(dev, (int )index); kidx = (u16 )tmp; value = (u16 )((int )((short )((int )kidx << 4)) | (int )((short )algorithm)); b43_shm_write16(dev, 1, (int )((unsigned int )((u16 )((int )kidx + 746)) * 2U), (int )value); offset = (u32 )((int )dev->ktp + (int )index * 16); i = 0U; goto ldv_38117; ldv_38116: value = (u16 )*(key + (unsigned long )i); value = (u16 )((int )((short )((int )*(key + (unsigned long )(i + 1U)) << 8)) | (int )((short )value)); b43_shm_write16(dev, 1, (int )((u16 )offset) + (int )((u16 )i), (int )value); i = i + 2U; ldv_38117: ; if (i <= 15U) { goto ldv_38116; } else { } return; } } static void keymac_write(struct b43_wldev *dev , u8 index , u8 const *addr ) { u32 addrtmp[2U] ; u8 pairwise_keys_start ; int tmp ; int __ret_warn_on ; long tmp___0 ; int __ret_warn_on___0 ; long tmp___1 ; { addrtmp[0] = 0U; addrtmp[1] = 0U; pairwise_keys_start = 8U; tmp = b43_new_kidx_api(dev); if (tmp != 0) { pairwise_keys_start = 4U; } else { } __ret_warn_on = (int )index < (int )pairwise_keys_start; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 776); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); index = (int )index - (int )pairwise_keys_start; __ret_warn_on___0 = (unsigned int )index > 49U; tmp___1 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 783); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if ((unsigned long )addr != (unsigned long )((u8 const *)0U)) { addrtmp[0] = (u32 )*addr; addrtmp[0] = addrtmp[0] | ((unsigned int )*(addr + 1UL) << 8); addrtmp[0] = addrtmp[0] | ((unsigned int )*(addr + 2UL) << 16); addrtmp[0] = addrtmp[0] | ((unsigned int )*(addr + 3UL) << 24); addrtmp[1] = (u32 )*(addr + 4UL); addrtmp[1] = addrtmp[1] | ((unsigned int )*(addr + 5UL) << 8); } else { } b43_shm_write32(dev, 4, (int )((unsigned int )((u16 )index) * 2U), addrtmp[0]); b43_shm_write16(dev, 4, (int )((unsigned int )((u16 )index) * 2U + 1U), (int )((u16 )addrtmp[1])); return; } } static void rx_tkip_phase1_write(struct b43_wldev *dev , u8 index , u32 iv32 , u16 *phase1key ) { unsigned int i ; u32 offset ; u8 pairwise_keys_start ; int tmp ; int __ret_warn_on ; long tmp___0 ; int __ret_warn_on___0 ; long tmp___1 ; bool tmp___2 ; { pairwise_keys_start = 8U; if (modparam_hwtkip == 0) { return; } else { } tmp = b43_new_kidx_api(dev); if (tmp != 0) { pairwise_keys_start = 4U; } else { } __ret_warn_on = (int )index < (int )pairwise_keys_start; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 831); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); index = (int )index - (int )pairwise_keys_start; __ret_warn_on___0 = (unsigned int )index > 49U; tmp___1 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 838); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); tmp___2 = b43_debug(dev, 7); if ((int )tmp___2) { b43dbg(dev->wl, "rx_tkip_phase1_write : idx 0x%x, iv32 0x%x\n", (int )index, iv32); } else { } offset = (u32 )((int )index * 14 + 792); i = 0U; goto ldv_38144; ldv_38143: b43_shm_write16(dev, 1, (int )((u16 )offset) + (int )((u16 )i), (unsigned long )phase1key != (unsigned long )((u16 *)0U) ? (int )*(phase1key + (unsigned long )(i / 2U)) : 0); i = i + 2U; ldv_38144: ; if (i <= 9U) { goto ldv_38143; } else { } b43_shm_write16(dev, 1, (int )((u16 )offset) + (int )((u16 )i), (int )((u16 )iv32)); b43_shm_write16(dev, 1, (int )((unsigned int )((int )((u16 )offset) + (int )((u16 )i)) + 2U), (int )((u16 )(iv32 >> 16))); return; } } static void b43_op_update_tkip_key(struct ieee80211_hw *hw , struct ieee80211_vif *vif , struct ieee80211_key_conf *keyconf , struct ieee80211_sta *sta , u32 iv32 , u16 *phase1key ) { struct b43_wl *wl ; struct b43_wl *tmp ; struct b43_wldev *dev ; int index ; int __ret_warn_on ; long tmp___0 ; long tmp___1 ; int __ret_warn_on___0 ; int tmp___2 ; long tmp___3 ; int __ret_warn_on___1 ; int tmp___4 ; int tmp___5 ; long tmp___6 ; int __ret_warn_on___2 ; long tmp___7 ; long tmp___8 ; { tmp = hw_to_b43_wl(hw); wl = tmp; index = (int )keyconf->hw_key_idx; __ret_warn_on = modparam_hwtkip == 0; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 864); } else { } tmp___1 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___1 != 0L) { return; } else { } tmp___2 = mutex_is_locked(& wl->mutex); __ret_warn_on___0 = tmp___2 == 0; tmp___3 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___3 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 869); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); dev = wl->current_dev; if ((unsigned long )dev == (unsigned long )((struct b43_wldev *)0)) { tmp___5 = 1; } else { tmp___4 = atomic_read((atomic_t const *)(& dev->__init_status)); if (tmp___4 <= 0) { tmp___5 = 1; } else { tmp___5 = 0; } } __ret_warn_on___1 = tmp___5; tmp___6 = ldv__builtin_expect(__ret_warn_on___1 != 0, 0L); if (tmp___6 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 871); } else { } ldv__builtin_expect(__ret_warn_on___1 != 0, 0L); keymac_write(dev, (int )((u8 )index), (u8 const *)0U); rx_tkip_phase1_write(dev, (int )((u8 )index), iv32, phase1key); __ret_warn_on___2 = (unsigned long )sta == (unsigned long )((struct ieee80211_sta *)0); tmp___7 = ldv__builtin_expect(__ret_warn_on___2 != 0, 0L); if (tmp___7 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 877); } else { } tmp___8 = ldv__builtin_expect(__ret_warn_on___2 != 0, 0L); if (tmp___8 != 0L) { return; } else { } keymac_write(dev, (int )((u8 )index), (u8 const *)(& sta->addr)); return; } } static void do_key_write(struct b43_wldev *dev , u8 index , u8 algorithm , u8 const *key , size_t key_len , u8 const *mac_addr ) { u8 buf[16U] ; unsigned int tmp ; u8 pairwise_keys_start ; int tmp___0 ; int __ret_warn_on ; long tmp___1 ; int __ret_warn_on___0 ; long tmp___2 ; size_t __len ; void *__ret ; { buf[0] = 0U; tmp = 1U; while (1) { if (tmp >= 16U) { break; } else { } buf[tmp] = (unsigned char)0; tmp = tmp + 1U; } pairwise_keys_start = 8U; tmp___0 = b43_new_kidx_api(dev); if (tmp___0 != 0) { pairwise_keys_start = 4U; } else { } __ret_warn_on = (unsigned int )index > 57U; tmp___1 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 892); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); __ret_warn_on___0 = key_len > 16UL; tmp___2 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___2 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 893); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if ((int )index >= (int )pairwise_keys_start) { keymac_write(dev, (int )index, (u8 const *)0U); } else { } if ((unsigned int )algorithm == 2U) { rx_tkip_phase1_write(dev, (int )index, 4294967295U, (u16 *)(& buf)); } else if ((int )index >= (int )pairwise_keys_start) { rx_tkip_phase1_write(dev, (int )index, 0U, (u16 *)0U); } else { } if ((unsigned long )key != (unsigned long )((u8 const *)0U)) { __len = key_len; __ret = __builtin_memcpy((void *)(& buf), (void const *)key, __len); } else { } key_write(dev, (int )index, (int )algorithm, (u8 const *)(& buf)); if ((int )index >= (int )pairwise_keys_start) { keymac_write(dev, (int )index, mac_addr); } else { } dev->key[(int )index].algorithm = algorithm; return; } } static int b43_key_write(struct b43_wldev *dev , int index , u8 algorithm , u8 const *key , size_t key_len , u8 const *mac_addr , struct ieee80211_key_conf *keyconf ) { int i ; int pairwise_keys_start ; int __ret_warn_on ; long tmp ; int tmp___0 ; int __ret_warn_on___0 ; long tmp___1 ; int __ret_warn_on___1 ; long tmp___2 ; int __ret_warn_on___2 ; long tmp___3 ; int tmp___4 ; { if ((unsigned int )algorithm == 2U && key_len == 32UL) { key_len = 16UL; } else { } if (key_len > 16UL) { return (-22); } else { } i = 0; goto ldv_38200; ldv_38199: __ret_warn_on = (unsigned long )dev->key[i].keyconf == (unsigned long )keyconf; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 941); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); i = i + 1; ldv_38200: ; if ((unsigned int )i <= 57U) { goto ldv_38199; } else { } if (index < 0) { tmp___0 = b43_new_kidx_api(dev); if (tmp___0 != 0) { pairwise_keys_start = 4; } else { pairwise_keys_start = 8; } i = pairwise_keys_start; goto ldv_38208; ldv_38207: __ret_warn_on___0 = (unsigned int )i > 57U; tmp___1 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 952); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if ((unsigned long )dev->key[i].keyconf == (unsigned long )((struct ieee80211_key_conf *)0)) { index = i; goto ldv_38206; } else { } i = i + 1; ldv_38208: ; if (pairwise_keys_start + 50 > i) { goto ldv_38207; } else { } ldv_38206: ; if (index < 0) { b43warn(dev->wl, "Out of hardware key memory\n"); return (-28); } else { } } else { __ret_warn_on___1 = index > 3; tmp___2 = ldv__builtin_expect(__ret_warn_on___1 != 0, 0L); if (tmp___2 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 964); } else { } ldv__builtin_expect(__ret_warn_on___1 != 0, 0L); } do_key_write(dev, (int )((u8 )index), (int )algorithm, key, key_len, mac_addr); if (index <= 3) { tmp___4 = b43_new_kidx_api(dev); if (tmp___4 == 0) { __ret_warn_on___2 = (unsigned long )mac_addr != (unsigned long )((u8 const *)0U); tmp___3 = ldv__builtin_expect(__ret_warn_on___2 != 0, 0L); if (tmp___3 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 969); } else { } ldv__builtin_expect(__ret_warn_on___2 != 0, 0L); do_key_write(dev, (int )((unsigned int )((u8 )index) + 4U), (int )algorithm, key, key_len, (u8 const *)0U); } else { } } else { } keyconf->hw_key_idx = (u8 )index; dev->key[index].keyconf = keyconf; return (0); } } static int b43_key_clear(struct b43_wldev *dev , int index ) { int __ret_warn_on ; long tmp ; long tmp___0 ; int tmp___1 ; { __ret_warn_on = index < 0 || (unsigned int )index > 57U; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 980); } else { } tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { return (-22); } else { } do_key_write(dev, (int )((u8 )index), 0, (u8 const *)0U, 16UL, (u8 const *)0U); if (index <= 3) { tmp___1 = b43_new_kidx_api(dev); if (tmp___1 == 0) { do_key_write(dev, (int )((unsigned int )((u8 )index) + 4U), 0, (u8 const *)0U, 16UL, (u8 const *)0U); } else { } } else { } dev->key[index].keyconf = (struct ieee80211_key_conf *)0; return (0); } } static void b43_clear_keys(struct b43_wldev *dev ) { int i ; int count ; int tmp ; { tmp = b43_new_kidx_api(dev); if (tmp != 0) { count = 54; } else { count = 58; } i = 0; goto ldv_38227; ldv_38226: b43_key_clear(dev, i); i = i + 1; ldv_38227: ; if (i < count) { goto ldv_38226; } else { } return; } } static void b43_dump_keymemory(struct b43_wldev *dev ) { unsigned int i ; unsigned int index ; unsigned int count ; unsigned int offset ; unsigned int pairwise_keys_start ; u8 mac[6U] ; u16 algo ; u32 rcmta0 ; u16 rcmta1 ; u64 hf ; struct b43_key *key ; bool tmp ; int tmp___0 ; int tmp___1 ; u16 tmp___2 ; u16 tmp___3 ; u16 tmp___4 ; u16 tmp___5 ; { tmp = b43_debug(dev, 7); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { return; } else { } hf = b43_hf_read(dev); b43dbg(dev->wl, "Hardware key memory dump: USEDEFKEYS=%u\n", (hf & 16384ULL) != 0ULL); tmp___1 = b43_new_kidx_api(dev); if (tmp___1 != 0) { pairwise_keys_start = 4U; count = 54U; } else { pairwise_keys_start = 8U; count = 58U; } index = 0U; goto ldv_38252; ldv_38251: key = (struct b43_key *)(& dev->key) + (unsigned long )index; printk("<7>Key slot %02u: %s", index, (unsigned long )key->keyconf == (unsigned long )((struct ieee80211_key_conf *)0) ? (char *)" " : (char *)"*"); offset = (unsigned int )dev->ktp + index * 16U; i = 0U; goto ldv_38245; ldv_38244: tmp___3 = b43_shm_read16(dev, 1, (int )((u16 )offset) + (int )((u16 )i)); tmp___2 = tmp___3; printk("%02X%02X", (int )tmp___2 & 255, ((int )tmp___2 >> 8) & 255); i = i + 2U; ldv_38245: ; if (i <= 15U) { goto ldv_38244; } else { } algo = b43_shm_read16(dev, 1, (int )((unsigned int )((u16 )(index + 746U)) * 2U)); printk(" Algo: %04X/%02X", (int )algo, (int )key->algorithm); if (index >= pairwise_keys_start) { if ((unsigned int )key->algorithm == 2U) { printk(" TKIP: "); offset = index * 14U + 736U; i = 0U; goto ldv_38249; ldv_38248: tmp___5 = b43_shm_read16(dev, 1, (int )((u16 )offset) + (int )((u16 )i)); tmp___4 = tmp___5; printk("%02X%02X", (int )tmp___4 & 255, ((int )tmp___4 >> 8) & 255); i = i + 2U; ldv_38249: ; if (i <= 13U) { goto ldv_38248; } else { } } else { } rcmta0 = b43_shm_read32(dev, 4, (int )((unsigned int )((u16 )(index - pairwise_keys_start)) * 2U)); rcmta1 = b43_shm_read16(dev, 4, (int )((unsigned int )((u16 )(index - pairwise_keys_start)) * 2U + 1U)); *((__le32 *)(& mac)) = rcmta0; *((__le16 *)(& mac) + 4U) = rcmta1; printk(" MAC: %pM", (u8 *)(& mac)); } else { printk(" DEFAULT KEY"); } printk("\n"); index = index + 1U; ldv_38252: ; if (index < count) { goto ldv_38251; } else { } return; } } void b43_power_saving_ctl_bits(struct b43_wldev *dev , unsigned int ps_flags ) { u32 macctl ; u16 ucstat ; bool hwps ; bool awake ; int i ; int __ret_warn_on ; long tmp ; int __ret_warn_on___0 ; long tmp___0 ; { __ret_warn_on = (int )ps_flags & 1 && (ps_flags & 2U) != 0U; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 1073); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); __ret_warn_on___0 = (ps_flags & 4U) != 0U && (ps_flags & 8U) != 0U; tmp___0 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 1074); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if ((int )ps_flags & 1) { hwps = 1; } else if ((ps_flags & 2U) != 0U) { hwps = 0; } else { } if ((ps_flags & 4U) != 0U) { awake = 1; } else if ((ps_flags & 8U) != 0U) { awake = 0; } else { } hwps = 0; awake = 1; macctl = b43_read32(dev, 288); if ((int )hwps) { macctl = macctl | 33554432U; } else { macctl = macctl & 4261412863U; } if ((int )awake) { macctl = macctl | 67108864U; } else { macctl = macctl & 4227858431U; } b43_write32(dev, 288, macctl); b43_read32(dev, 288); if ((int )awake && (unsigned int )(dev->dev)->id.revision > 4U) { i = 0; goto ldv_38269; ldv_38268: ucstat = b43_shm_read16(dev, 1, 64); if ((unsigned int )ucstat != 4U) { goto ldv_38267; } else { } __const_udelay(42950UL); i = i + 1; ldv_38269: ; if (i <= 99) { goto ldv_38268; } else { } ldv_38267: ; } else { } return; } } void b43_wireless_core_reset(struct b43_wldev *dev , u32 flags ) { u32 tmslow ; u32 macctl ; { flags = flags | 262144U; flags = flags | 524288U; ssb_device_enable(dev->dev, flags); msleep(2U); tmslow = ssb_read32(dev->dev, 3992); tmslow = tmslow | 131072U; tmslow = tmslow & 4294443007U; ssb_write32(dev->dev, 3992, tmslow); ssb_read32(dev->dev, 3992); msleep(1U); tmslow = tmslow & 4294836223U; ssb_write32(dev->dev, 3992, tmslow); ssb_read32(dev->dev, 3992); msleep(1U); if ((unsigned long )dev->phy.ops != (unsigned long )((struct b43_phy_operations const *)0)) { (*((dev->phy.ops)->switch_analog))(dev, 1); } else { } macctl = b43_read32(dev, 288); macctl = macctl & 2147483647U; if ((flags & 536870912U) != 0U) { macctl = macctl | 2147483648U; } else { } macctl = macctl | 1024U; b43_write32(dev, 288, macctl); return; } } static void handle_irq_transmit_status(struct b43_wldev *dev ) { u32 v0 ; u32 v1 ; u16 tmp ; struct b43_txstatus stat ; { ldv_38284: v0 = b43_read32(dev, 368); if ((v0 & 1U) == 0U) { goto ldv_38283; } else { } v1 = b43_read32(dev, 372); stat.cookie = (u16 )(v0 >> 16); stat.seq = (u16 )v1; stat.phy_stat = (u8 )((v1 & 16711680U) >> 16); tmp = (u16 )v0; stat.frame_count = (u8 )((int )tmp >> 12); stat.rts_count = (u8 )(((int )tmp & 3840) >> 8); stat.supp_reason = (u8 )(((int )tmp & 28) >> 2); stat.pm_indicated = ((int )tmp & 128) != 0; stat.intermediate = ((int )tmp & 64) != 0; stat.for_ampdu = ((int )tmp & 32) != 0; stat.acked = ((int )tmp & 2) != 0; b43_handle_txstatus(dev, (struct b43_txstatus const *)(& stat)); goto ldv_38284; ldv_38283: ; return; } } static void drain_txstatus_queue(struct b43_wldev *dev ) { u32 dummy ; { if ((unsigned int )(dev->dev)->id.revision <= 4U) { return; } else { } ldv_38290: dummy = b43_read32(dev, 368); if ((dummy & 1U) == 0U) { goto ldv_38289; } else { } dummy = b43_read32(dev, 372); goto ldv_38290; ldv_38289: ; return; } } static u32 b43_jssi_read(struct b43_wldev *dev ) { u32 val ; u16 tmp ; u16 tmp___0 ; { val = 0U; tmp = b43_shm_read16(dev, 1, 138); val = (u32 )tmp; val = val << 16; tmp___0 = b43_shm_read16(dev, 1, 136); val = (u32 )tmp___0 | val; return (val); } } static void b43_jssi_write(struct b43_wldev *dev , u32 jssi ) { { b43_shm_write16(dev, 1, 136, (int )((u16 )jssi)); b43_shm_write16(dev, 1, 138, (int )((u16 )(jssi >> 16))); return; } } static void b43_generate_noise_sample(struct b43_wldev *dev ) { u32 tmp ; { b43_jssi_write(dev, 2139062143U); tmp = b43_read32(dev, 292); b43_write32(dev, 292, tmp | 16U); return; } } static void b43_calculate_link_quality(struct b43_wldev *dev ) { { if ((unsigned int )dev->phy.type != 2U) { return; } else { } if ((int )dev->noisecalc.calculation_running) { return; } else { } dev->noisecalc.calculation_running = 1; dev->noisecalc.nr_samples = 0U; b43_generate_noise_sample(dev); return; } } static void handle_irq_noise(struct b43_wldev *dev ) { struct b43_phy_g *phy ; u16 tmp ; u8 noise[4U] ; u8 i ; u8 j ; s32 average ; int __ret_warn_on ; long tmp___0 ; int __ret_warn_on___0 ; long tmp___1 ; u8 __val ; u8 __min ; u8 __max ; u8 __val___0 ; u8 __min___0 ; u8 __max___0 ; u8 __val___1 ; u8 __min___1 ; u8 __max___1 ; u8 __val___2 ; u8 __min___2 ; u8 __max___2 ; { phy = dev->phy.__annonCompField40.g; if ((unsigned int )dev->phy.type != 2U) { return; } else { } __ret_warn_on = ! dev->noisecalc.calculation_running; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 1264); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); *((__le32 *)(& noise)) = b43_jssi_read(dev); if ((((unsigned int )noise[0] == 127U || (unsigned int )noise[1] == 127U) || (unsigned int )noise[2] == 127U) || (unsigned int )noise[3] == 127U) { goto generate_new; } else { } __ret_warn_on___0 = (unsigned int )dev->noisecalc.nr_samples > 7U; tmp___1 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 1271); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); i = dev->noisecalc.nr_samples; __val = noise[0]; __min = 0U; __max = 63U; __val = (u8 )((int )__min > (int )__val ? __min : __val); noise[0] = (u8 )((int )__max < (int )__val ? __max : __val); __val___0 = noise[1]; __min___0 = 0U; __max___0 = 63U; __val___0 = (u8 )((int )__min___0 > (int )__val___0 ? __min___0 : __val___0); noise[1] = (u8 )((int )__max___0 < (int )__val___0 ? __max___0 : __val___0); __val___1 = noise[2]; __min___1 = 0U; __max___1 = 63U; __val___1 = (u8 )((int )__min___1 > (int )__val___1 ? __min___1 : __val___1); noise[2] = (u8 )((int )__max___1 < (int )__val___1 ? __max___1 : __val___1); __val___2 = noise[3]; __min___2 = 0U; __max___2 = 63U; __val___2 = (u8 )((int )__min___2 > (int )__val___2 ? __min___2 : __val___2); noise[3] = (u8 )((int )__max___2 < (int )__val___2 ? __max___2 : __val___2); dev->noisecalc.samples[(int )i][0] = phy->nrssi_lt[(int )noise[0]]; dev->noisecalc.samples[(int )i][1] = phy->nrssi_lt[(int )noise[1]]; dev->noisecalc.samples[(int )i][2] = phy->nrssi_lt[(int )noise[2]]; dev->noisecalc.samples[(int )i][3] = phy->nrssi_lt[(int )noise[3]]; dev->noisecalc.nr_samples = (u8 )((int )dev->noisecalc.nr_samples + 1); if ((unsigned int )dev->noisecalc.nr_samples == 8U) { average = 0; i = 0U; goto ldv_38347; ldv_38346: j = 0U; goto ldv_38344; ldv_38343: average = (int )dev->noisecalc.samples[(int )i][(int )j] + average; j = (u8 )((int )j + 1); ldv_38344: ; if ((unsigned int )j <= 3U) { goto ldv_38343; } else { } i = (u8 )((int )i + 1); ldv_38347: ; if ((unsigned int )i <= 7U) { goto ldv_38346; } else { } average = average / 32; average = average * 125; average = average + 64; average = average / 128; tmp = b43_shm_read16(dev, 1, 1036); tmp = (unsigned int )((u16 )((unsigned int )tmp / 128U)) & 31U; if ((unsigned int )tmp > 7U) { average = average + 2; } else { average = average + -25; } if ((unsigned int )tmp == 8U) { average = average + -72; } else { average = average + -48; } dev->stats.link_noise = (u8 )average; dev->noisecalc.calculation_running = 0; return; } else { } generate_new: b43_generate_noise_sample(dev); return; } } static void handle_irq_tbtt_indication(struct b43_wldev *dev ) { int tmp ; int tmp___0 ; { tmp = b43_is_mode(dev->wl, 3); if (tmp != 0) { } else { b43_power_saving_ctl_bits(dev, 0U); } tmp___0 = b43_is_mode(dev->wl, 1); if (tmp___0 != 0) { dev->dfq_valid = 1; } else { } return; } } static void handle_irq_atim_end(struct b43_wldev *dev ) { u32 tmp ; { if ((int )dev->dfq_valid) { tmp = b43_read32(dev, 292); b43_write32(dev, 292, tmp | 4U); dev->dfq_valid = 0; } else { } return; } } static void handle_irq_pmq(struct b43_wldev *dev ) { u32 tmp ; { ldv_38360: tmp = b43_read32(dev, 320); if ((tmp & 8U) == 0U) { goto ldv_38359; } else { } goto ldv_38360; ldv_38359: b43_write16(dev, 320, 2); return; } } static void b43_write_template_common(struct b43_wldev *dev , u8 const *data , u16 size , u16 ram_offset , u16 shm_size_offset , u8 rate ) { u32 i ; u32 tmp ; struct b43_plcp_hdr4 plcp ; { plcp.__annonCompField43.data = 0U; b43_generate_plcp_hdr(& plcp, (int )((unsigned int )((u16 const )size) + 4U), (int )rate); b43_ram_write(dev, (int )ram_offset, plcp.__annonCompField43.data); ram_offset = (unsigned int )ram_offset + 4U; tmp = (unsigned int )*data << 16; tmp = ((unsigned int )*(data + 1UL) << 24) | tmp; b43_ram_write(dev, (int )ram_offset, tmp); ram_offset = (unsigned int )ram_offset + 4U; i = 2U; goto ldv_38373; ldv_38372: tmp = (unsigned int )*(data + (unsigned long )i); if (i + 1U < (u32 )size) { tmp = ((unsigned int )*(data + (unsigned long )(i + 1U)) << 8) | tmp; } else { } if (i + 2U < (u32 )size) { tmp = ((unsigned int )*(data + (unsigned long )(i + 2U)) << 16) | tmp; } else { } if (i + 3U < (u32 )size) { tmp = ((unsigned int )*(data + (unsigned long )(i + 3U)) << 24) | tmp; } else { } b43_ram_write(dev, (int )((unsigned int )((int )((u16 )i) + (int )ram_offset) - 2U), tmp); i = i + 4U; ldv_38373: ; if ((u32 )size > i) { goto ldv_38372; } else { } b43_shm_write16(dev, 1, (int )shm_size_offset, (int )((unsigned int )size + 6U)); return; } } u8 b43_ieee80211_antenna_sanitize(struct b43_wldev *dev , u8 antenna_nr ) { u8 antenna_mask ; { if ((unsigned int )antenna_nr == 0U) { return (0U); } else { } if ((int )dev->phy.gmode) { antenna_mask = ((dev->dev)->bus)->sprom.ant_available_bg; } else { antenna_mask = ((dev->dev)->bus)->sprom.ant_available_a; } if ((((int )antenna_mask >> ((int )antenna_nr + -1)) & 1) == 0) { return (0U); } else { } return (antenna_nr); } } static u16 b43_antenna_to_phyctl(int antenna ) { int __ret_warn_on ; long tmp ; { switch (antenna) { case 0: ; return (0U); case 1: ; return (64U); case 4: ; return (256U); case 8: ; return (512U); case 2: ; case 3: ; return (192U); } __ret_warn_on = 1; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 1425); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); return (0U); } } static void b43_write_beacon_template(struct b43_wldev *dev , u16 ram_offset , u16 shm_size_offset ) { unsigned int i ; unsigned int len ; unsigned int variable_len ; struct ieee80211_mgmt const *bcn ; u8 const *ie ; bool tim_found ; unsigned int rate ; u16 ctl ; int antenna ; struct ieee80211_tx_info *info ; struct ieee80211_tx_info *tmp ; unsigned long _min1 ; unsigned long _min2 ; struct ieee80211_rate *tmp___0 ; u16 tmp___1 ; int tmp___2 ; uint8_t ie_id ; uint8_t ie_len ; u16 tim_position ; u16 dtim_period ; { tim_found = 0; tmp = IEEE80211_SKB_CB((dev->wl)->current_beacon); info = tmp; bcn = (struct ieee80211_mgmt const *)((dev->wl)->current_beacon)->data; _min1 = (unsigned long )((dev->wl)->current_beacon)->len; _min2 = 506UL; len = (unsigned int )(_min1 < _min2 ? _min1 : _min2); tmp___0 = ieee80211_get_tx_rate((struct ieee80211_hw const *)(dev->wl)->hw, (struct ieee80211_tx_info const *)info); rate = (unsigned int )tmp___0->hw_value; b43_write_template_common(dev, (u8 const *)bcn, (int )((u16 )len), (int )ram_offset, (int )shm_size_offset, (int )((u8 )rate)); antenna = 2; tmp___1 = b43_antenna_to_phyctl(antenna); antenna = (int )tmp___1; ctl = b43_shm_read16(dev, 1, 84); ctl = (unsigned int )ctl & 65519U; ctl = (unsigned int )ctl & 64575U; ctl = (unsigned int )ctl & 65532U; ctl = (u16 )((int )((short )antenna) | (int )((short )ctl)); tmp___2 = b43_is_cck_rate((int )rate); if (tmp___2 != 0) { ctl = ctl; } else { ctl = (u16 )((unsigned int )ctl | 1U); } b43_shm_write16(dev, 1, 84, (int )ctl); ie = (u8 const *)(& bcn->u.beacon.variable); variable_len = len - 36U; i = 0U; goto ldv_38415; ldv_38414: ie_id = *(ie + (unsigned long )i); ie_len = *(ie + (unsigned long )(i + 1U)); if ((unsigned int )ie_id == 5U) { if (((unsigned int )ie_len + i) + 2U > variable_len) { goto ldv_38413; } else { } if ((unsigned int )ie_len <= 3U) { goto ldv_38413; } else { } tim_found = 1; tim_position = 6U; tim_position = (unsigned int )tim_position + 36U; tim_position = (int )((u16 )i) + (int )tim_position; dtim_period = (u16 )*(ie + (unsigned long )(i + 3U)); b43_shm_write16(dev, 1, 30, (int )tim_position); b43_shm_write16(dev, 1, 18, (int )dtim_period); goto ldv_38413; } else { } i = ((unsigned int )ie_len + i) + 2U; ldv_38415: ; if (variable_len - 2U > i) { goto ldv_38414; } else { } ldv_38413: ; if (! tim_found) { b43_shm_write16(dev, 1, 30, (int )((unsigned int )((u16 )len) + 6U)); b43_shm_write16(dev, 1, 18, 0); } else { } b43dbg(dev->wl, "Updated beacon template at 0x%x\n", (int )ram_offset); return; } } static void b43_upload_beacon0(struct b43_wldev *dev ) { struct b43_wl *wl ; { wl = dev->wl; if ((int )wl->beacon0_uploaded) { return; } else { } b43_write_beacon_template(dev, 104, 24); wl->beacon0_uploaded = 1; return; } } static void b43_upload_beacon1(struct b43_wldev *dev ) { struct b43_wl *wl ; { wl = dev->wl; if ((int )wl->beacon1_uploaded) { return; } else { } b43_write_beacon_template(dev, 1128, 26); wl->beacon1_uploaded = 1; return; } } static void handle_irq_beacon(struct b43_wldev *dev ) { struct b43_wl *wl ; u32 cmd ; u32 beacon0_valid ; u32 beacon1_valid ; int tmp ; int tmp___0 ; long tmp___1 ; { wl = dev->wl; tmp = b43_is_mode(wl, 3); if (tmp == 0) { tmp___0 = b43_is_mode(wl, 7); if (tmp___0 == 0) { return; } else { } } else { } dev->irq_mask = dev->irq_mask & 4294967293U; cmd = b43_read32(dev, 292); beacon0_valid = cmd & 1U; beacon1_valid = cmd & 2U; if (beacon0_valid != 0U && beacon1_valid != 0U) { b43_write32(dev, 296, 2U); dev->irq_mask = dev->irq_mask | 2U; return; } else { } tmp___1 = ldv__builtin_expect((long )wl->beacon_templates_virgin, 0L); if (tmp___1 != 0L) { wl->beacon_templates_virgin = 0; b43_upload_beacon0(dev); b43_upload_beacon1(dev); cmd = b43_read32(dev, 292); cmd = cmd | 1U; b43_write32(dev, 292, cmd); } else if (beacon0_valid == 0U) { b43_upload_beacon0(dev); cmd = b43_read32(dev, 292); cmd = cmd | 1U; b43_write32(dev, 292, cmd); } else if (beacon1_valid == 0U) { b43_upload_beacon1(dev); cmd = b43_read32(dev, 292); cmd = cmd | 2U; b43_write32(dev, 292, cmd); } else { } return; } } static void b43_do_beacon_update_trigger_work(struct b43_wldev *dev ) { u32 old_irq_mask ; int __ret_warn_on ; long tmp ; u32 tmp___0 ; { old_irq_mask = dev->irq_mask; handle_irq_beacon(dev); if (dev->irq_mask != old_irq_mask) { __ret_warn_on = dev->irq_mask == 0U; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 1592); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); tmp___0 = b43_read32(dev, 300); if (tmp___0 != 0U) { b43_write32(dev, 300, dev->irq_mask); } else { } } else { } return; } } static void b43_beacon_update_trigger_work(struct work_struct *work ) { struct b43_wl *wl ; struct work_struct const *__mptr ; struct b43_wldev *dev ; int tmp ; int tmp___0 ; long tmp___1 ; { __mptr = (struct work_struct const *)work; wl = (struct b43_wl *)__mptr + 0xfffffffffffffe50UL; mutex_lock_nested(& wl->mutex, 0U); dev = wl->current_dev; if ((unsigned long )dev != (unsigned long )((struct b43_wldev *)0)) { tmp = atomic_read((atomic_t const *)(& dev->__init_status)); if (tmp > 0) { tmp___0 = 1; } else { tmp___0 = 0; } } else { tmp___0 = 0; } tmp___1 = ldv__builtin_expect((long )tmp___0, 1L); if (tmp___1 != 0L) { if ((unsigned int )((dev->dev)->bus)->bustype == 3U) { b43_do_beacon_update_trigger_work(dev); __asm__ volatile ("": : : "memory"); } else { spin_lock_irq(& wl->hardirq_lock); b43_do_beacon_update_trigger_work(dev); __asm__ volatile ("": : : "memory"); spin_unlock_irq(& wl->hardirq_lock); } } else { } mutex_unlock(& wl->mutex); return; } } static void b43_update_templates(struct b43_wl *wl ) { struct sk_buff *beacon ; long tmp ; { beacon = ieee80211_beacon_get(wl->hw, wl->vif); tmp = ldv__builtin_expect((unsigned long )beacon == (unsigned long )((struct sk_buff *)0), 0L); if (tmp != 0L) { return; } else { } if ((unsigned long )wl->current_beacon != (unsigned long )((struct sk_buff *)0)) { dev_kfree_skb_any(wl->current_beacon); } else { } wl->current_beacon = beacon; wl->beacon0_uploaded = 0; wl->beacon1_uploaded = 0; ieee80211_queue_work(wl->hw, & wl->beacon_update_trigger); return; } } static void b43_set_beacon_int(struct b43_wldev *dev , u16 beacon_int ) { { b43_time_lock(dev); if ((unsigned int )(dev->dev)->id.revision > 2U) { b43_write32(dev, 392, (u32 )((int )beacon_int << 16)); b43_write32(dev, 396, (u32 )((int )beacon_int << 10)); } else { b43_write16(dev, 1542, (int )beacon_int >> 6); b43_write16(dev, 1552, (int )beacon_int); } b43_time_unlock(dev); b43dbg(dev->wl, "Set beacon interval to %u\n", (int )beacon_int); return; } } static void b43_handle_firmware_panic(struct b43_wldev *dev ) { u16 reason ; { reason = b43_shm_read16(dev, 2, 3); b43err(dev->wl, "Whoopsy, firmware panic! Reason: %u\n", (int )reason); switch ((int )reason) { default: b43dbg(dev->wl, "The panic reason is unknown.\n"); case 0: ; goto ldv_38458; case 1: b43_controller_restart(dev, "Microcode panic"); goto ldv_38458; } ldv_38458: ; return; } } static void handle_irq_ucode_debug(struct b43_wldev *dev ) { unsigned int i ; unsigned int cnt ; u16 reason ; u16 marker_id ; u16 marker_line ; __le16 *buf ; void *tmp ; u16 tmp___0 ; u16 tmp___1 ; u16 tmp___2 ; u16 tmp___3 ; { if (! dev->fw.opensource) { return; } else { } reason = b43_shm_read16(dev, 2, 63); switch ((int )reason) { case 0: b43_handle_firmware_panic(dev); goto ldv_38470; case 1: tmp = kmalloc(4096UL, 32U); buf = (__le16 *)tmp; if ((unsigned long )buf == (unsigned long )((__le16 *)0U)) { b43dbg(dev->wl, "SHM-dump: Failed to allocate memory\n"); goto out; } else { } i = 0U; goto ldv_38475; ldv_38474: tmp___1 = b43_shm_read16(dev, 1, (int )((u16 )i)); tmp___0 = tmp___1; *(buf + (unsigned long )(i / 2U)) = tmp___0; i = i + 2U; ldv_38475: ; if (i <= 4095U) { goto ldv_38474; } else { } b43info(dev->wl, "Shared memory dump:\n"); print_hex_dump("<6>", "", 2, 16, 2, (void const *)buf, 4096UL, 1); kfree((void const *)buf); goto ldv_38470; case 2: b43info(dev->wl, "Microcode register dump:\n"); i = 0U; cnt = 0U; goto ldv_38480; ldv_38479: tmp___3 = b43_shm_read16(dev, 2, (int )((u16 )i)); tmp___2 = tmp___3; if (cnt == 0U) { printk("<6>"); } else { } printk("r%02u: 0x%04X ", i, (int )tmp___2); cnt = cnt + 1U; if (cnt == 6U) { printk("\n"); cnt = 0U; } else { } i = i + 1U; ldv_38480: ; if (i <= 63U) { goto ldv_38479; } else { } printk("\n"); goto ldv_38470; case 3: marker_id = b43_shm_read16(dev, 2, 2); marker_line = b43_shm_read16(dev, 2, 3); b43info(dev->wl, "The firmware just executed the MARKER(%u) at line number %u\n", (int )marker_id, (int )marker_line); goto ldv_38470; default: b43dbg(dev->wl, "Debug-IRQ triggered for unknown reason: %u\n", (int )reason); } ldv_38470: ; out: b43_shm_write16(dev, 2, 63, 65535); return; } } static void b43_do_interrupt_thread(struct b43_wldev *dev ) { u32 reason ; u32 dma_reason[6U] ; u32 merged_dma_reason ; int i ; int tmp ; long tmp___0 ; long tmp___1 ; int tmp___2 ; long tmp___3 ; long tmp___4 ; long tmp___5 ; long tmp___6 ; bool tmp___7 ; int __ret_warn_on ; long tmp___8 ; int __ret_warn_on___0 ; long tmp___9 ; int __ret_warn_on___1 ; long tmp___10 ; int __ret_warn_on___2 ; long tmp___11 ; int __ret_warn_on___3 ; long tmp___12 ; bool tmp___13 ; { merged_dma_reason = 0U; tmp = atomic_read((atomic_t const *)(& dev->__init_status)); tmp___0 = ldv__builtin_expect(tmp != 2, 0L); if (tmp___0 != 0L) { return; } else { } reason = dev->irq_reason; i = 0; goto ldv_38496; ldv_38495: dma_reason[i] = dev->dma_reason[i]; merged_dma_reason = dma_reason[i] | merged_dma_reason; i = i + 1; ldv_38496: ; if ((unsigned int )i <= 5U) { goto ldv_38495; } else { } tmp___1 = ldv__builtin_expect((reason & 512U) != 0U, 0L); if (tmp___1 != 0L) { b43err(dev->wl, "MAC transmission error\n"); } else { } tmp___4 = ldv__builtin_expect((reason & 2048U) != 0U, 0L); if (tmp___4 != 0L) { b43err(dev->wl, "PHY transmission error\n"); __asm__ volatile ("lfence": : : "memory"); tmp___2 = atomic_dec_and_test(& dev->phy.txerr_cnt); tmp___3 = ldv__builtin_expect(tmp___2 != 0, 0L); if (tmp___3 != 0L) { atomic_set(& dev->phy.txerr_cnt, 1000); b43err(dev->wl, "Too many PHY TX errors, restarting the controller\n"); b43_controller_restart(dev, "PHY TX errors"); } else { } } else { } tmp___5 = ldv__builtin_expect((merged_dma_reason & 64512U) != 0U, 0L); if (tmp___5 != 0L) { if ((merged_dma_reason & 56320U) != 0U) { b43err(dev->wl, "Fatal DMA error: 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X\n", dma_reason[0], dma_reason[1], dma_reason[2], dma_reason[3], dma_reason[4], dma_reason[5]); b43err(dev->wl, "This device does not support DMA on your system. It will now be switched to PIO.\n"); dev->use_pio = 1; b43_controller_restart(dev, "DMA error"); return; } else { } if ((merged_dma_reason & 8192U) != 0U) { b43err(dev->wl, "DMA error: 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X\n", dma_reason[0], dma_reason[1], dma_reason[2], dma_reason[3], dma_reason[4], dma_reason[5]); } else { } } else { } tmp___6 = ldv__builtin_expect((reason & 134217728U) != 0U, 0L); if (tmp___6 != 0L) { handle_irq_ucode_debug(dev); } else { } if ((reason & 4U) != 0U) { handle_irq_tbtt_indication(dev); } else { } if ((reason & 32U) != 0U) { handle_irq_atim_end(dev); } else { } if ((reason & 2U) != 0U) { handle_irq_beacon(dev); } else { } if ((reason & 64U) != 0U) { handle_irq_pmq(dev); } else { } if ((reason & 262144U) != 0U) { handle_irq_noise(dev); } else { } if ((dma_reason[0] & 65536U) != 0U) { tmp___7 = b43_using_pio_transfers(dev); if ((int )tmp___7) { b43_pio_rx(dev->__annonCompField41.pio.rx_queue); } else { b43_dma_rx(dev->__annonCompField41.dma.rx_ring); } } else { } __ret_warn_on = (dma_reason[1] & 65536U) != 0U; tmp___8 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___8 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 1845); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); __ret_warn_on___0 = (dma_reason[2] & 65536U) != 0U; tmp___9 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___9 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 1846); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); __ret_warn_on___1 = (dma_reason[3] & 65536U) != 0U; tmp___10 = ldv__builtin_expect(__ret_warn_on___1 != 0, 0L); if (tmp___10 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 1847); } else { } ldv__builtin_expect(__ret_warn_on___1 != 0, 0L); __ret_warn_on___2 = (dma_reason[4] & 65536U) != 0U; tmp___11 = ldv__builtin_expect(__ret_warn_on___2 != 0, 0L); if (tmp___11 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 1848); } else { } ldv__builtin_expect(__ret_warn_on___2 != 0, 0L); __ret_warn_on___3 = (dma_reason[5] & 65536U) != 0U; tmp___12 = ldv__builtin_expect(__ret_warn_on___3 != 0, 0L); if (tmp___12 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 1849); } else { } ldv__builtin_expect(__ret_warn_on___3 != 0, 0L); if ((reason & 536870912U) != 0U) { handle_irq_transmit_status(dev); } else { } b43_write32(dev, 300, dev->irq_mask); tmp___13 = b43_debug(dev, 8); if ((int )tmp___13) { dev->irq_count = dev->irq_count + 1U; i = 0; goto ldv_38511; ldv_38510: ; if (((u32 )(1 << i) & reason) != 0U) { dev->irq_bit_count[i] = dev->irq_bit_count[i] + 1U; } else { } i = i + 1; ldv_38511: ; if ((unsigned int )i <= 31U) { goto ldv_38510; } else { } } else { } return; } } static irqreturn_t b43_interrupt_thread_handler(int irq , void *dev_id ) { struct b43_wldev *dev ; { dev = (struct b43_wldev *)dev_id; mutex_lock_nested(& (dev->wl)->mutex, 0U); b43_do_interrupt_thread(dev); __asm__ volatile ("": : : "memory"); mutex_unlock(& (dev->wl)->mutex); return (1); } } static irqreturn_t b43_do_interrupt(struct b43_wldev *dev ) { u32 reason ; u32 tmp ; u32 tmp___0 ; u32 tmp___1 ; u32 tmp___2 ; u32 tmp___3 ; { reason = b43_read32(dev, 296); if (reason == 4294967295U) { return (0); } else { } reason = dev->irq_mask & reason; if (reason == 0U) { return (1); } else { } tmp = b43_read32(dev, 32); dev->dma_reason[0] = tmp & 121856U; tmp___0 = b43_read32(dev, 40); dev->dma_reason[1] = tmp___0 & 56320U; tmp___1 = b43_read32(dev, 48); dev->dma_reason[2] = tmp___1 & 56320U; tmp___2 = b43_read32(dev, 56); dev->dma_reason[3] = tmp___2 & 121856U; tmp___3 = b43_read32(dev, 64); dev->dma_reason[4] = tmp___3 & 56320U; b43_write32(dev, 296, reason); b43_write32(dev, 32, dev->dma_reason[0]); b43_write32(dev, 40, dev->dma_reason[1]); b43_write32(dev, 48, dev->dma_reason[2]); b43_write32(dev, 56, dev->dma_reason[3]); b43_write32(dev, 64, dev->dma_reason[4]); b43_write32(dev, 300, 0U); dev->irq_reason = reason; return (2); } } static irqreturn_t b43_interrupt_handler(int irq , void *dev_id ) { struct b43_wldev *dev ; irqreturn_t ret ; int tmp ; long tmp___0 ; { dev = (struct b43_wldev *)dev_id; tmp = atomic_read((atomic_t const *)(& dev->__init_status)); tmp___0 = ldv__builtin_expect(tmp <= 1, 0L); if (tmp___0 != 0L) { return (0); } else { } spin_lock(& (dev->wl)->hardirq_lock); ret = b43_do_interrupt(dev); __asm__ volatile ("": : : "memory"); spin_unlock(& (dev->wl)->hardirq_lock); return (ret); } } static void b43_sdio_interrupt_handler(struct b43_wldev *dev ) { struct b43_wl *wl ; irqreturn_t ret ; { wl = dev->wl; mutex_lock_nested(& wl->mutex, 0U); ret = b43_do_interrupt(dev); if ((unsigned int )ret == 2U) { b43_do_interrupt_thread(dev); } else { } mutex_unlock(& wl->mutex); return; } } void b43_do_release_fw(struct b43_firmware_file *fw ) { { release_firmware(fw->data); fw->data = (struct firmware const *)0; fw->filename = (char const *)0; return; } } static void b43_release_firmware(struct b43_wldev *dev ) { { b43_do_release_fw(& dev->fw.ucode); b43_do_release_fw(& dev->fw.pcm); b43_do_release_fw(& dev->fw.initvals); b43_do_release_fw(& dev->fw.initvals_band); return; } } static void b43_print_fw_helptext(struct b43_wl *wl , bool error ) { char text[194U] ; { text[0] = 'Y'; text[1] = 'o'; text[2] = 'u'; text[3] = ' '; text[4] = 'm'; text[5] = 'u'; text[6] = 's'; text[7] = 't'; text[8] = ' '; text[9] = 'g'; text[10] = 'o'; text[11] = ' '; text[12] = 't'; text[13] = 'o'; text[14] = ' '; text[15] = 'h'; text[16] = 't'; text[17] = 't'; text[18] = 'p'; text[19] = ':'; text[20] = '/'; text[21] = '/'; text[22] = 'w'; text[23] = 'i'; text[24] = 'r'; text[25] = 'e'; text[26] = 'l'; text[27] = 'e'; text[28] = 's'; text[29] = 's'; text[30] = '.'; text[31] = 'k'; text[32] = 'e'; text[33] = 'r'; text[34] = 'n'; text[35] = 'e'; text[36] = 'l'; text[37] = '.'; text[38] = 'o'; text[39] = 'r'; text[40] = 'g'; text[41] = '/'; text[42] = 'e'; text[43] = 'n'; text[44] = '/'; text[45] = 'u'; text[46] = 's'; text[47] = 'e'; text[48] = 'r'; text[49] = 's'; text[50] = '/'; text[51] = 'D'; text[52] = 'r'; text[53] = 'i'; text[54] = 'v'; text[55] = 'e'; text[56] = 'r'; text[57] = 's'; text[58] = '/'; text[59] = 'b'; text[60] = '4'; text[61] = '3'; text[62] = '#'; text[63] = 'd'; text[64] = 'e'; text[65] = 'v'; text[66] = 'i'; text[67] = 'c'; text[68] = 'e'; text[69] = 'f'; text[70] = 'i'; text[71] = 'r'; text[72] = 'm'; text[73] = 'w'; text[74] = 'a'; text[75] = 'r'; text[76] = 'e'; text[77] = ' '; text[78] = 'a'; text[79] = 'n'; text[80] = 'd'; text[81] = ' '; text[82] = 'd'; text[83] = 'o'; text[84] = 'w'; text[85] = 'n'; text[86] = 'l'; text[87] = 'o'; text[88] = 'a'; text[89] = 'd'; text[90] = ' '; text[91] = 't'; text[92] = 'h'; text[93] = 'e'; text[94] = ' '; text[95] = 'c'; text[96] = 'o'; text[97] = 'r'; text[98] = 'r'; text[99] = 'e'; text[100] = 'c'; text[101] = 't'; text[102] = ' '; text[103] = 'f'; text[104] = 'i'; text[105] = 'r'; text[106] = 'm'; text[107] = 'w'; text[108] = 'a'; text[109] = 'r'; text[110] = 'e'; text[111] = ' '; text[112] = 'f'; text[113] = 'o'; text[114] = 'r'; text[115] = ' '; text[116] = 't'; text[117] = 'h'; text[118] = 'i'; text[119] = 's'; text[120] = ' '; text[121] = 'd'; text[122] = 'r'; text[123] = 'i'; text[124] = 'v'; text[125] = 'e'; text[126] = 'r'; text[127] = ' '; text[128] = 'v'; text[129] = 'e'; text[130] = 'r'; text[131] = 's'; text[132] = 'i'; text[133] = 'o'; text[134] = 'n'; text[135] = '.'; text[136] = ' '; text[137] = 'P'; text[138] = 'l'; text[139] = 'e'; text[140] = 'a'; text[141] = 's'; text[142] = 'e'; text[143] = ' '; text[144] = 'c'; text[145] = 'a'; text[146] = 'r'; text[147] = 'e'; text[148] = 'f'; text[149] = 'u'; text[150] = 'l'; text[151] = 'l'; text[152] = 'y'; text[153] = ' '; text[154] = 'r'; text[155] = 'e'; text[156] = 'a'; text[157] = 'd'; text[158] = ' '; text[159] = 'a'; text[160] = 'l'; text[161] = 'l'; text[162] = ' '; text[163] = 'i'; text[164] = 'n'; text[165] = 's'; text[166] = 't'; text[167] = 'r'; text[168] = 'u'; text[169] = 'c'; text[170] = 't'; text[171] = 'i'; text[172] = 'o'; text[173] = 'n'; text[174] = 's'; text[175] = ' '; text[176] = 'o'; text[177] = 'n'; text[178] = ' '; text[179] = 't'; text[180] = 'h'; text[181] = 'i'; text[182] = 's'; text[183] = ' '; text[184] = 'w'; text[185] = 'e'; text[186] = 'b'; text[187] = 's'; text[188] = 'i'; text[189] = 't'; text[190] = 'e'; text[191] = '.'; text[192] = '\n'; text[193] = '\000'; if ((int )error) { b43err(wl, (char const *)(& text)); } else { b43warn(wl, (char const *)(& text)); } return; } } int b43_do_request_fw(struct b43_request_fw_context *ctx , char const *name , struct b43_firmware_file *fw ) { struct firmware const *blob ; struct b43_fw_header *hdr ; u32 size ; int err ; int tmp ; int __ret_warn_on ; long tmp___0 ; __u32 tmp___1 ; { if ((unsigned long )name == (unsigned long )((char const *)0)) { b43_do_release_fw(fw); return (0); } else { } if ((unsigned long )fw->filename != (unsigned long )((char const *)0)) { if ((unsigned int )fw->type == (unsigned int )ctx->req_type) { tmp = strcmp(fw->filename, name); if (tmp == 0) { return (0); } else { } } else { } b43_do_release_fw(fw); } else { } switch ((unsigned int )ctx->req_type) { case 0U: snprintf((char *)(& ctx->fwname), 64UL, "b43%s/%s.fw", (char *)(& modparam_fwpostfix), name); goto ldv_38554; case 1U: snprintf((char *)(& ctx->fwname), 64UL, "b43-open%s/%s.fw", (char *)(& modparam_fwpostfix), name); goto ldv_38554; default: __ret_warn_on = 1; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 2030); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); return (-38); } ldv_38554: err = request_firmware(& blob, (char const *)(& ctx->fwname), ((ctx->dev)->dev)->dev); if (err == -2) { snprintf((char *)(& ctx->errors) + (unsigned long )ctx->req_type, 128UL, "Firmware file \"%s\" not found\n", (char *)(& ctx->fwname)); return (err); } else if (err != 0) { snprintf((char *)(& ctx->errors) + (unsigned long )ctx->req_type, 128UL, "Firmware file \"%s\" request failed (err=%d)\n", (char *)(& ctx->fwname), err); return (err); } else { } if ((unsigned long )blob->size <= 7UL) { goto err_format; } else { } hdr = (struct b43_fw_header *)blob->data; switch ((int )hdr->type) { case 117: ; case 112: tmp___1 = __fswab32(hdr->size); size = tmp___1; if ((unsigned long )size != (unsigned long )blob->size - 8UL) { goto err_format; } else { } case 105: ; if ((unsigned int )hdr->ver != 1U) { goto err_format; } else { } goto ldv_38563; default: ; goto err_format; } ldv_38563: fw->data = blob; fw->filename = name; fw->type = ctx->req_type; return (0); err_format: snprintf((char *)(& ctx->errors) + (unsigned long )ctx->req_type, 128UL, "Firmware file \"%s\" format error.\n", (char *)(& ctx->fwname)); release_firmware(blob); return (-71); } } static int b43_try_request_fw(struct b43_request_fw_context *ctx ) { struct b43_wldev *dev ; struct b43_firmware *fw ; u8 rev ; char const *filename ; u32 tmshigh ; int err ; int tmp ; int tmp___0 ; int tmp___1 ; { dev = ctx->dev; fw = & (ctx->dev)->fw; rev = ((ctx->dev)->dev)->id.revision; tmshigh = ssb_read32(dev->dev, 3996); if ((unsigned int )rev > 4U && (unsigned int )rev <= 10U) { filename = "ucode5"; } else if ((unsigned int )rev > 10U && (unsigned int )rev <= 12U) { filename = "ucode11"; } else if ((unsigned int )rev == 13U) { filename = "ucode13"; } else if ((unsigned int )rev == 14U) { filename = "ucode14"; } else if ((unsigned int )rev > 14U) { filename = "ucode15"; } else { goto err_no_ucode; } err = b43_do_request_fw(ctx, filename, & fw->ucode); if (err != 0) { goto err_load; } else { } if ((unsigned int )rev > 4U && (unsigned int )rev <= 10U) { filename = "pcm5"; } else if ((unsigned int )rev > 10U) { filename = (char const *)0; } else { goto err_no_pcm; } fw->pcm_request_failed = 0; err = b43_do_request_fw(ctx, filename, & fw->pcm); if (err == -2) { fw->pcm_request_failed = 1; } else if (err != 0) { goto err_load; } else { } switch ((int )dev->phy.type) { case 0: ; if ((unsigned int )rev > 4U && (unsigned int )rev <= 10U) { if ((tmshigh & 65536U) != 0U) { filename = "a0g1initvals5"; } else { filename = "a0g0initvals5"; } } else { goto err_no_initvals; } goto ldv_38579; case 2: ; if ((unsigned int )rev > 4U && (unsigned int )rev <= 10U) { filename = "b0g0initvals5"; } else if ((unsigned int )rev > 12U) { filename = "b0g0initvals13"; } else { goto err_no_initvals; } goto ldv_38579; case 4: ; if ((unsigned int )rev > 10U && (unsigned int )rev <= 12U) { filename = "n0initvals11"; } else { goto err_no_initvals; } goto ldv_38579; case 5: ; if ((unsigned int )rev == 13U) { filename = "lp0initvals13"; } else if ((unsigned int )rev == 14U) { filename = "lp0initvals14"; } else if ((unsigned int )rev > 14U) { filename = "lp0initvals15"; } else { goto err_no_initvals; } goto ldv_38579; default: ; goto err_no_initvals; } ldv_38579: err = b43_do_request_fw(ctx, filename, & fw->initvals); if (err != 0) { goto err_load; } else { } switch ((int )dev->phy.type) { case 0: ; if ((unsigned int )rev > 4U && (unsigned int )rev <= 10U) { if ((tmshigh & 65536U) != 0U) { filename = "a0g1bsinitvals5"; } else { filename = "a0g0bsinitvals5"; } } else if ((unsigned int )rev > 10U) { filename = (char const *)0; } else { goto err_no_initvals; } goto ldv_38585; case 2: ; if ((unsigned int )rev > 4U && (unsigned int )rev <= 10U) { filename = "b0g0bsinitvals5"; } else if ((unsigned int )rev > 10U) { filename = (char const *)0; } else { goto err_no_initvals; } goto ldv_38585; case 4: ; if ((unsigned int )rev > 10U && (unsigned int )rev <= 12U) { filename = "n0bsinitvals11"; } else { goto err_no_initvals; } goto ldv_38585; case 5: ; if ((unsigned int )rev == 13U) { filename = "lp0bsinitvals13"; } else if ((unsigned int )rev == 14U) { filename = "lp0bsinitvals14"; } else if ((unsigned int )rev > 14U) { filename = "lp0bsinitvals15"; } else { goto err_no_initvals; } goto ldv_38585; default: ; goto err_no_initvals; } ldv_38585: err = b43_do_request_fw(ctx, filename, & fw->initvals_band); if (err != 0) { goto err_load; } else { } return (0); err_no_ucode: tmp = -95; ctx->fatal_failure = tmp; err = tmp; b43err(dev->wl, "The driver does not know which firmware (ucode) is required for your device (wl-core rev %u)\n", (int )rev); goto error; err_no_pcm: tmp___0 = -95; ctx->fatal_failure = tmp___0; err = tmp___0; b43err(dev->wl, "The driver does not know which firmware (PCM) is required for your device (wl-core rev %u)\n", (int )rev); goto error; err_no_initvals: tmp___1 = -95; ctx->fatal_failure = tmp___1; err = tmp___1; b43err(dev->wl, "The driver does not know which firmware (initvals) is required for your device (wl-core rev %u)\n", (int )rev); goto error; err_load: ; goto error; error: b43_release_firmware(dev); return (err); } } static int b43_request_firmware(struct b43_wldev *dev ) { struct b43_request_fw_context *ctx ; unsigned int i ; int err ; char const *errmsg ; void *tmp ; size_t tmp___0 ; { tmp = kzalloc(336UL, 208U); ctx = (struct b43_request_fw_context *)tmp; if ((unsigned long )ctx == (unsigned long )((struct b43_request_fw_context *)0)) { return (-12); } else { } ctx->dev = dev; ctx->req_type = 0; err = b43_try_request_fw(ctx); if (err == 0) { goto out; } else { } err = ctx->fatal_failure; if (err != 0) { goto out; } else { } ctx->req_type = 1; err = b43_try_request_fw(ctx); if (err == 0) { goto out; } else { } err = ctx->fatal_failure; if (err != 0) { goto out; } else { } i = 0U; goto ldv_38600; ldv_38599: errmsg = (char const *)(& ctx->errors) + (unsigned long )i; tmp___0 = strlen(errmsg); if (tmp___0 != 0UL) { b43err(dev->wl, errmsg); } else { } i = i + 1U; ldv_38600: ; if (i <= 1U) { goto ldv_38599; } else { } b43_print_fw_helptext(dev->wl, 1); err = -2; out: kfree((void const *)ctx); return (err); } } static int b43_upload_microcode(struct b43_wldev *dev ) { size_t hdr_len ; __be32 const *data ; unsigned int i ; unsigned int len ; u16 fwrev ; u16 fwpatch ; u16 fwdate ; u16 fwtime ; u32 tmp ; u32 macctl ; int err ; int __ret_warn_on ; long tmp___0 ; __u32 tmp___1 ; __u32 tmp___2 ; u16 fwcapa ; bool tmp___3 ; { hdr_len = 8UL; err = 0; macctl = b43_read32(dev, 288); __ret_warn_on = (macctl & 2U) != 0U; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 2292); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); macctl = macctl | 4U; b43_write32(dev, 288, macctl); i = 0U; goto ldv_38619; ldv_38618: b43_shm_write16(dev, 2, (int )((u16 )i), 0); i = i + 1U; ldv_38619: ; if (i <= 63U) { goto ldv_38618; } else { } i = 0U; goto ldv_38622; ldv_38621: b43_shm_write16(dev, 1, (int )((u16 )i), 0); i = i + 2U; ldv_38622: ; if (i <= 4095U) { goto ldv_38621; } else { } data = (__be32 const *)((dev->fw.ucode.data)->data + hdr_len); len = (unsigned int )(((unsigned long )(dev->fw.ucode.data)->size - hdr_len) / 4UL); b43_shm_control_word(dev, 256, 0); i = 0U; goto ldv_38625; ldv_38624: tmp___1 = __fswab32(*(data + (unsigned long )i)); b43_write32(dev, 356, tmp___1); __const_udelay(42950UL); i = i + 1U; ldv_38625: ; if (i < len) { goto ldv_38624; } else { } if ((unsigned long )dev->fw.pcm.data != (unsigned long )((struct firmware const *)0)) { data = (__be32 const *)((dev->fw.pcm.data)->data + hdr_len); len = (unsigned int )(((unsigned long )(dev->fw.pcm.data)->size - hdr_len) / 4UL); b43_shm_control_word(dev, 3, 490); b43_write32(dev, 356, 16384U); b43_shm_control_word(dev, 3, 491); i = 0U; goto ldv_38628; ldv_38627: tmp___2 = __fswab32(*(data + (unsigned long )i)); b43_write32(dev, 356, tmp___2); __const_udelay(42950UL); i = i + 1U; ldv_38628: ; if (i < len) { goto ldv_38627; } else { } } else { } b43_write32(dev, 296, 4294967295U); macctl = b43_read32(dev, 288); macctl = macctl & 4294967291U; macctl = macctl | 2U; b43_write32(dev, 288, macctl); i = 0U; ldv_38632: tmp = b43_read32(dev, 296); if (tmp == 1U) { goto ldv_38630; } else { } i = i + 1U; if (i > 19U) { b43err(dev->wl, "Microcode not responding\n"); b43_print_fw_helptext(dev->wl, 1); err = -19; goto error; } else { } msleep(50U); goto ldv_38632; ldv_38630: b43_read32(dev, 296); fwrev = b43_shm_read16(dev, 1, 0); fwpatch = b43_shm_read16(dev, 1, 2); fwdate = b43_shm_read16(dev, 1, 4); fwtime = b43_shm_read16(dev, 1, 6); if ((unsigned int )fwrev <= 296U) { b43err(dev->wl, "YOUR FIRMWARE IS TOO OLD. Firmware from binary drivers older than version 4.x is unsupported. You must upgrade your firmware files.\n"); b43_print_fw_helptext(dev->wl, 1); err = -95; goto error; } else { } dev->fw.rev = fwrev; dev->fw.patch = fwpatch; dev->fw.opensource = (unsigned int )fwdate == 65535U; ((dev->wl)->hw)->queues = (dev->wl)->mac80211_initially_registered_queues; dev->qos_enabled = modparam_qos != 0; dev->hwcrypto_enabled = 1; if ((int )dev->fw.opensource) { dev->fw.patch = fwtime; b43info(dev->wl, "Loading OpenSource firmware version %u.%u\n", (int )dev->fw.rev, (int )dev->fw.patch); fwcapa = b43_fwcapa_read(dev); if (((int )fwcapa & 1) == 0 || (int )dev->fw.pcm_request_failed) { b43info(dev->wl, "Hardware crypto acceleration not supported by firmware\n"); dev->hwcrypto_enabled = 0; } else { } if (((int )fwcapa & 2) == 0) { b43info(dev->wl, "QoS not supported by firmware\n"); ((dev->wl)->hw)->queues = 1U; dev->qos_enabled = 0; } else { } } else { b43info(dev->wl, "Loading firmware version %u.%u (20%.2i-%.2i-%.2i %.2i:%.2i:%.2i)\n", (int )fwrev, (int )fwpatch, ((int )fwdate >> 12) & 15, ((int )fwdate >> 8) & 15, (int )fwdate & 255, ((int )fwtime >> 11) & 31, ((int )fwtime >> 5) & 63, (int )fwtime & 31); if ((int )dev->fw.pcm_request_failed) { b43warn(dev->wl, "No \"pcm5.fw\" firmware file found. Hardware accelerated cryptography is disabled.\n"); b43_print_fw_helptext(dev->wl, 0); } else { } } tmp___3 = b43_is_old_txhdr_format(dev); if ((int )tmp___3) { b43warn(dev->wl, "You are using an old firmware image. Support for old firmware will be removed soon (official deadline was July 2008).\n"); b43_print_fw_helptext(dev->wl, 0); } else { } return (0); error: macctl = b43_read32(dev, 288); macctl = macctl & 4294967293U; macctl = macctl | 4U; b43_write32(dev, 288, macctl); return (err); } } static int b43_write_initvals(struct b43_wldev *dev , struct b43_iv const *ivals , size_t count , size_t array_size ) { struct b43_iv const *iv ; u16 offset ; size_t i ; bool bit32 ; __u16 tmp ; u32 value ; u16 value___0 ; __u16 tmp___0 ; { iv = ivals; i = 0UL; goto ldv_38648; ldv_38647: ; if (array_size <= 1UL) { goto err_format; } else { } array_size = array_size - 2UL; tmp = __fswab16((int )iv->offset_size); offset = tmp; bit32 = (int )((short )offset) < 0; offset = (unsigned int )offset & 32767U; if ((unsigned int )offset > 4095U) { goto err_format; } else { } if ((int )bit32) { if (array_size <= 3UL) { goto err_format; } else { } array_size = array_size - 4UL; value = get_unaligned_be32((void const *)(& iv->data.d32)); b43_write32(dev, (int )offset, value); iv = iv + 6U; } else { if (array_size <= 1UL) { goto err_format; } else { } array_size = array_size - 2UL; tmp___0 = __fswab16((int )iv->data.d16); value___0 = tmp___0; b43_write16(dev, (int )offset, (int )value___0); iv = iv + 4U; } i = i + 1UL; ldv_38648: ; if (i < count) { goto ldv_38647; } else { } if (array_size != 0UL) { goto err_format; } else { } return (0); err_format: b43err(dev->wl, "Initial Values Firmware file-format error.\n"); b43_print_fw_helptext(dev->wl, 1); return (-71); } } static int b43_upload_initvals(struct b43_wldev *dev ) { size_t hdr_len ; struct b43_fw_header const *hdr ; struct b43_firmware *fw ; struct b43_iv const *ivals ; size_t count ; int err ; __u32 tmp ; __u32 tmp___0 ; { hdr_len = 8UL; fw = & dev->fw; hdr = (struct b43_fw_header const *)(fw->initvals.data)->data; ivals = (struct b43_iv const *)((fw->initvals.data)->data + hdr_len); tmp = __fswab32(hdr->size); count = (size_t )tmp; err = b43_write_initvals(dev, ivals, count, (unsigned long )(fw->initvals.data)->size - hdr_len); if (err != 0) { goto out; } else { } if ((unsigned long )fw->initvals_band.data != (unsigned long )((struct firmware const *)0)) { hdr = (struct b43_fw_header const *)(fw->initvals_band.data)->data; ivals = (struct b43_iv const *)((fw->initvals_band.data)->data + hdr_len); tmp___0 = __fswab32(hdr->size); count = (size_t )tmp___0; err = b43_write_initvals(dev, ivals, count, (unsigned long )(fw->initvals_band.data)->size - hdr_len); if (err != 0) { goto out; } else { } } else { } out: ; return (err); } } static int b43_gpio_init(struct b43_wldev *dev ) { struct ssb_bus *bus ; struct ssb_device *gpiodev ; struct ssb_device *pcidev ; u32 mask ; u32 set ; u32 tmp ; u16 tmp___0 ; u16 tmp___2 ; u32 tmp___3 ; { bus = (dev->dev)->bus; pcidev = (struct ssb_device *)0; tmp = b43_read32(dev, 288); b43_write32(dev, 288, tmp & 4294918143U); tmp___0 = b43_read16(dev, 1182); b43_write16(dev, 1182, (int )((unsigned int )tmp___0 | 15U)); mask = 31U; set = 15U; if ((unsigned int )((dev->dev)->bus)->chip_id == 17153U) { mask = mask | 96U; set = set | 96U; } else { } if (((int )((dev->dev)->bus)->sprom.boardflags_lo & 2) != 0) { tmp___2 = b43_read16(dev, 1182); b43_write16(dev, 1182, (int )((unsigned int )tmp___2 | 512U)); mask = mask | 512U; set = set | 512U; } else { } if ((unsigned int )(dev->dev)->id.revision > 1U) { mask = mask | 16U; } else { } pcidev = bus->pcicore.dev; gpiodev = (unsigned long )bus->chipco.dev != (unsigned long )((struct ssb_device *)0) ? (unsigned long )bus->chipco.dev != (unsigned long )((struct ssb_device *)0) : pcidev; if ((unsigned long )gpiodev == (unsigned long )((struct ssb_device *)0)) { return (0); } else { } tmp___3 = ssb_read32(gpiodev, 108); ssb_write32(gpiodev, 108, (tmp___3 & mask) | set); return (0); } } static void b43_gpio_cleanup(struct b43_wldev *dev ) { struct ssb_bus *bus ; struct ssb_device *gpiodev ; struct ssb_device *pcidev ; { bus = (dev->dev)->bus; pcidev = (struct ssb_device *)0; pcidev = bus->pcicore.dev; gpiodev = (unsigned long )bus->chipco.dev != (unsigned long )((struct ssb_device *)0) ? (unsigned long )bus->chipco.dev != (unsigned long )((struct ssb_device *)0) : pcidev; if ((unsigned long )gpiodev == (unsigned long )((struct ssb_device *)0)) { return; } else { } ssb_write32(gpiodev, 108, 0U); return; } } void b43_mac_enable(struct b43_wldev *dev ) { u16 fwstate ; bool tmp ; int __ret_warn_on ; long tmp___0 ; u32 tmp___1 ; { tmp = b43_debug(dev, 6); if ((int )tmp) { fwstate = b43_shm_read16(dev, 1, 64); if ((unsigned int )fwstate != 3U && (unsigned int )fwstate != 4U) { b43err(dev->wl, "b43_mac_enable(): The firmware should be suspended, but current state is %u\n", (int )fwstate); } else { } } else { } dev->mac_suspended = dev->mac_suspended - 1; __ret_warn_on = dev->mac_suspended < 0; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 2602); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); if (dev->mac_suspended == 0) { tmp___1 = b43_read32(dev, 288); b43_write32(dev, 288, tmp___1 | 1U); b43_write32(dev, 296, 1U); b43_read32(dev, 288); b43_read32(dev, 296); b43_power_saving_ctl_bits(dev, 0U); } else { } return; } } void b43_mac_suspend(struct b43_wldev *dev ) { int i ; u32 tmp ; int __ret_warn_on ; long tmp___0 ; u32 tmp___1 ; { __might_sleep("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 2622, 0); __ret_warn_on = dev->mac_suspended < 0; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 2623); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); if (dev->mac_suspended == 0) { b43_power_saving_ctl_bits(dev, 4U); tmp___1 = b43_read32(dev, 288); b43_write32(dev, 288, tmp___1 & 4294967294U); b43_read32(dev, 288); i = 35; goto ldv_38689; ldv_38688: tmp = b43_read32(dev, 296); if ((int )tmp & 1) { goto out; } else { } __const_udelay(42950UL); i = i - 1; ldv_38689: ; if (i != 0) { goto ldv_38688; } else { } i = 40; goto ldv_38692; ldv_38691: tmp = b43_read32(dev, 296); if ((int )tmp & 1) { goto out; } else { } msleep(1U); i = i - 1; ldv_38692: ; if (i != 0) { goto ldv_38691; } else { } b43err(dev->wl, "MAC suspend failed\n"); } else { } out: dev->mac_suspended = dev->mac_suspended + 1; return; } } static void b43_adjust_opmode(struct b43_wldev *dev ) { struct b43_wl *wl ; u32 ctl ; u16 cfp_pretbtt ; int tmp ; int tmp___0 ; int tmp___1 ; u32 tmp___3 ; { wl = dev->wl; ctl = b43_read32(dev, 288); ctl = ctl & 4294705151U; ctl = ctl & 4290772991U; ctl = ctl & 4292870143U; ctl = ctl & 4286578687U; ctl = ctl & 4278190079U; ctl = ctl & 4293918719U; ctl = ctl | 131072U; tmp___0 = b43_is_mode(wl, 3); if (tmp___0 != 0) { ctl = ctl | 262144U; } else { tmp___1 = b43_is_mode(wl, 7); if (tmp___1 != 0) { ctl = ctl | 262144U; } else { tmp = b43_is_mode(wl, 1); if (tmp != 0) { ctl = ctl & 4294836223U; } else { } } } if ((wl->filter_flags & 32U) != 0U) { ctl = ctl | 4194304U; } else { } if ((wl->filter_flags & 4U) != 0U) { ctl = ctl | 8388608U; } else { } if ((wl->filter_flags & 8U) != 0U) { ctl = ctl | 2097152U; } else { } if ((int )wl->filter_flags & 1) { ctl = ctl | 16777216U; } else { } if ((wl->filter_flags & 16U) != 0U) { ctl = ctl | 1048576U; } else { } if ((unsigned int )(dev->dev)->id.revision <= 4U) { ctl = ctl | 16777216U; } else { } b43_write32(dev, 288, ctl); cfp_pretbtt = 2U; if ((ctl & 131072U) != 0U && (ctl & 262144U) == 0U) { if ((unsigned int )((dev->dev)->bus)->chip_id == 17158U && (unsigned int )((dev->dev)->bus)->chip_rev == 3U) { cfp_pretbtt = 100U; } else { cfp_pretbtt = 50U; } } else { } b43_write16(dev, 1554, (int )cfp_pretbtt); tmp___3 = b43_read32(dev, 288); b43_write32(dev, 288, tmp___3 | 1073741824U); return; } } static void b43_rate_memory_write(struct b43_wldev *dev , u16 rate , int is_ofdm ) { u16 offset ; u8 tmp ; u8 tmp___0 ; u16 tmp___1 ; { if (is_ofdm != 0) { offset = 1152U; tmp = b43_plcp_get_ratecode_ofdm((int )((u8 const )rate)); offset = ((unsigned int )((u16 )tmp) & 15U) * 2U + (unsigned int )offset; } else { offset = 1216U; tmp___0 = b43_plcp_get_ratecode_cck((int )((u8 const )rate)); offset = ((unsigned int )((u16 )tmp___0) & 15U) * 2U + (unsigned int )offset; } tmp___1 = b43_shm_read16(dev, 1, (int )offset); b43_shm_write16(dev, 1, (int )((unsigned int )offset + 32U), (int )tmp___1); return; } } static void b43_rate_memory_init(struct b43_wldev *dev ) { int __ret_warn_on ; long tmp ; { switch ((int )dev->phy.type) { case 0: ; case 2: ; case 4: ; case 5: b43_rate_memory_write(dev, 12, 1); b43_rate_memory_write(dev, 24, 1); b43_rate_memory_write(dev, 36, 1); b43_rate_memory_write(dev, 48, 1); b43_rate_memory_write(dev, 72, 1); b43_rate_memory_write(dev, 96, 1); b43_rate_memory_write(dev, 108, 1); if ((unsigned int )dev->phy.type == 0U) { goto ldv_38713; } else { } case 1: b43_rate_memory_write(dev, 2, 0); b43_rate_memory_write(dev, 4, 0); b43_rate_memory_write(dev, 11, 0); b43_rate_memory_write(dev, 22, 0); goto ldv_38713; default: __ret_warn_on = 1; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 2756); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); } ldv_38713: ; return; } } static void b43_set_phytxctl_defaults(struct b43_wldev *dev ) { u16 ctl ; { ctl = 0U; ctl = ctl; ctl = (u16 )((unsigned int )ctl | 192U); ctl = (u16 )((unsigned int )ctl | 64512U); b43_shm_write16(dev, 1, 84, (int )ctl); b43_shm_write16(dev, 1, 34, (int )ctl); b43_shm_write16(dev, 1, 392, (int )ctl); return; } } static void b43_mgmtframe_txantenna(struct b43_wldev *dev , int antenna ) { u16 ant ; u16 tmp ; { ant = b43_antenna_to_phyctl(antenna); tmp = b43_shm_read16(dev, 1, 34); tmp = (u16 )(((int )((short )tmp) & -961) | (int )((short )ant)); b43_shm_write16(dev, 1, 34, (int )tmp); tmp = b43_shm_read16(dev, 1, 392); tmp = (u16 )(((int )((short )tmp) & -961) | (int )((short )ant)); b43_shm_write16(dev, 1, 392, (int )tmp); return; } } static void b43_chip_exit(struct b43_wldev *dev ) { { b43_phy_exit(dev); b43_gpio_cleanup(dev); return; } } static int b43_chip_init(struct b43_wldev *dev ) { struct b43_phy *phy ; int err ; u32 value32 ; u32 macctl ; u16 value16 ; u32 tmp ; u32 tmp___0 ; { phy = & dev->phy; macctl = 1280U; if ((int )dev->phy.gmode) { macctl = macctl | 2147483648U; } else { } macctl = macctl | 131072U; b43_write32(dev, 288, macctl); err = b43_request_firmware(dev); if (err != 0) { goto out; } else { } err = b43_upload_microcode(dev); if (err != 0) { goto out; } else { } err = b43_gpio_init(dev); if (err != 0) { goto out; } else { } err = b43_upload_initvals(dev); if (err != 0) { goto err_gpio_clean; } else { } (*((phy->ops)->switch_analog))(dev, 1); err = b43_phy_init(dev); if (err != 0) { goto err_gpio_clean; } else { } if ((unsigned long )(phy->ops)->interf_mitigation != (unsigned long )((int (*/* const */)(struct b43_wldev * , enum b43_interference_mitigation ))0)) { (*((phy->ops)->interf_mitigation))(dev, 0); } else { } if ((unsigned long )(phy->ops)->set_rx_antenna != (unsigned long )((void (*/* const */)(struct b43_wldev * , int ))0)) { (*((phy->ops)->set_rx_antenna))(dev, 2); } else { } b43_mgmtframe_txantenna(dev, 2); if ((unsigned int )phy->type == 1U) { value16 = b43_read16(dev, 94); value16 = (u16 )((unsigned int )value16 | 4U); b43_write16(dev, 94, (int )value16); } else { } b43_write32(dev, 256, 16777216U); if ((unsigned int )(dev->dev)->id.revision <= 4U) { b43_write32(dev, 268, 16777216U); } else { } tmp = b43_read32(dev, 288); b43_write32(dev, 288, tmp & 4294836223U); tmp___0 = b43_read32(dev, 288); b43_write32(dev, 288, tmp___0 | 131072U); b43_shm_write16(dev, 1, 116, 0); b43_adjust_opmode(dev); if ((unsigned int )(dev->dev)->id.revision <= 2U) { b43_write16(dev, 1550, 0); b43_write16(dev, 1552, 32768); b43_write16(dev, 1540, 0); b43_write16(dev, 1542, 512); } else { b43_write32(dev, 392, 2147483648U); b43_write32(dev, 396, 33554432U); } b43_write32(dev, 296, 16384U); b43_write32(dev, 36, 121856U); b43_write32(dev, 44, 56320U); b43_write32(dev, 52, 56320U); b43_write32(dev, 60, 121856U); b43_write32(dev, 68, 56320U); b43_write32(dev, 76, 56320U); value32 = ssb_read32(dev->dev, 3992); value32 = value32 | 1048576U; ssb_write32(dev->dev, 3992, value32); b43_write16(dev, 1704, (int )((dev->dev)->bus)->chipco.fast_pwrup_delay); err = 0; b43dbg(dev->wl, "Chip initialized\n"); out: ; return (err); err_gpio_clean: b43_gpio_cleanup(dev); return (err); } } static void b43_periodic_every60sec(struct b43_wldev *dev ) { struct b43_phy_operations const *ops ; { ops = dev->phy.ops; if ((unsigned long )ops->pwork_60sec != (unsigned long )((void (*/* const */)(struct b43_wldev * ))0)) { (*(ops->pwork_60sec))(dev); } else { } b43_phy_txpower_check(dev, 1U); return; } } static void b43_periodic_every30sec(struct b43_wldev *dev ) { { b43_calculate_link_quality(dev); return; } } static void b43_periodic_every15sec(struct b43_wldev *dev ) { struct b43_phy *phy ; u16 wdr ; long tmp ; unsigned int i ; bool tmp___0 ; { phy = & dev->phy; if ((int )dev->fw.opensource) { wdr = b43_shm_read16(dev, 2, 1); tmp = ldv__builtin_expect((unsigned int )wdr != 0U, 0L); if (tmp != 0L) { b43err(dev->wl, "Firmware watchdog: The firmware died!\n"); b43_controller_restart(dev, "Firmware watchdog"); return; } else { b43_shm_write16(dev, 2, 1, 1); } } else { } if ((unsigned long )(phy->ops)->pwork_15sec != (unsigned long )((void (*/* const */)(struct b43_wldev * ))0)) { (*((phy->ops)->pwork_15sec))(dev); } else { } atomic_set(& phy->txerr_cnt, 1000); __asm__ volatile ("sfence": : : "memory"); tmp___0 = b43_debug(dev, 8); if ((int )tmp___0) { b43dbg(dev->wl, "Stats: %7u IRQs/sec, %7u TX/sec, %7u RX/sec\n", dev->irq_count / 15U, dev->tx_count / 15U, dev->rx_count / 15U); dev->irq_count = 0U; dev->tx_count = 0U; dev->rx_count = 0U; i = 0U; goto ldv_38757; ldv_38756: ; if (dev->irq_bit_count[i] != 0U) { b43dbg(dev->wl, "Stats: %7u IRQ-%02u/sec (0x%08X)\n", dev->irq_bit_count[i] / 15U, i, 1 << (int )i); dev->irq_bit_count[i] = 0U; } else { } i = i + 1U; ldv_38757: ; if (i <= 31U) { goto ldv_38756; } else { } } else { } return; } } static void do_periodic_work(struct b43_wldev *dev ) { unsigned int state ; { state = dev->periodic_state; if ((state & 3U) == 0U) { b43_periodic_every60sec(dev); } else { } if ((state & 1U) == 0U) { b43_periodic_every30sec(dev); } else { } b43_periodic_every15sec(dev); return; } } static void b43_periodic_work_handler(struct work_struct *work ) { struct b43_wldev *dev ; struct work_struct const *__mptr ; struct b43_wl *wl ; unsigned long delay ; int tmp ; long tmp___0 ; bool tmp___1 ; bool tmp___2 ; { __mptr = (struct work_struct const *)work; dev = (struct b43_wldev *)__mptr + 0xffffffffffffff08UL; wl = dev->wl; mutex_lock_nested(& wl->mutex, 0U); tmp = atomic_read((atomic_t const *)(& dev->__init_status)); tmp___0 = ldv__builtin_expect(tmp != 2, 0L); if (tmp___0 != 0L) { goto out; } else { } tmp___1 = b43_debug(dev, 4); if ((int )tmp___1) { goto out_requeue; } else { } do_periodic_work(dev); dev->periodic_state = dev->periodic_state + 1U; out_requeue: tmp___2 = b43_debug(dev, 3); if ((int )tmp___2) { delay = msecs_to_jiffies(50U); } else { delay = round_jiffies_relative(3750UL); } ieee80211_queue_delayed_work(wl->hw, & dev->periodic_work, delay); out: mutex_unlock(& wl->mutex); return; } } static void b43_periodic_tasks_setup(struct b43_wldev *dev ) { struct delayed_work *work ; struct lock_class_key __key ; atomic_long_t __constr_expr_0 ; { work = & dev->periodic_work; dev->periodic_state = 0U; __init_work(& work->work, 0); __constr_expr_0.counter = 2097664L; work->work.data = __constr_expr_0; lockdep_init_map(& work->work.lockdep_map, "(&(work)->work)", & __key, 0); INIT_LIST_HEAD(& work->work.entry); work->work.func = & b43_periodic_work_handler; reg_timer_9(& work->timer); ieee80211_queue_delayed_work((dev->wl)->hw, work, 0UL); return; } } static int b43_validate_chipaccess(struct b43_wldev *dev ) { u32 v ; u32 backup0 ; u32 backup4 ; u32 tmp ; u32 tmp___0 ; u32 tmp___1 ; u16 tmp___2 ; u16 tmp___3 ; u16 tmp___4 ; u16 tmp___5 ; u16 tmp___6 ; u16 tmp___7 ; { backup0 = b43_shm_read32(dev, 1, 0); backup4 = b43_shm_read32(dev, 1, 4); b43_shm_write32(dev, 1, 0, 1437248085U); tmp = b43_shm_read32(dev, 1, 0); if (tmp != 1437248085U) { goto error; } else { } b43_shm_write32(dev, 1, 0, 2857719210U); tmp___0 = b43_shm_read32(dev, 1, 0); if (tmp___0 != 2857719210U) { goto error; } else { } b43_shm_write16(dev, 1, 0, 4386); b43_shm_write16(dev, 1, 2, 13124); b43_shm_write16(dev, 1, 4, 21862); b43_shm_write16(dev, 1, 6, 30600); tmp___1 = b43_shm_read32(dev, 1, 2); if (tmp___1 != 1432761156U) { b43warn(dev->wl, "Unaligned 32bit SHM read access is broken\n"); } else { } b43_shm_write32(dev, 1, 2, 2864434397U); tmp___2 = b43_shm_read16(dev, 1, 0); if ((unsigned int )tmp___2 != 4386U) { b43warn(dev->wl, "Unaligned 32bit SHM write access is broken\n"); } else { tmp___3 = b43_shm_read16(dev, 1, 2); if ((unsigned int )tmp___3 != 52445U) { b43warn(dev->wl, "Unaligned 32bit SHM write access is broken\n"); } else { tmp___4 = b43_shm_read16(dev, 1, 4); if ((unsigned int )tmp___4 != 43707U) { b43warn(dev->wl, "Unaligned 32bit SHM write access is broken\n"); } else { tmp___5 = b43_shm_read16(dev, 1, 6); if ((unsigned int )tmp___5 != 30600U) { b43warn(dev->wl, "Unaligned 32bit SHM write access is broken\n"); } else { } } } } b43_shm_write32(dev, 1, 0, backup0); b43_shm_write32(dev, 1, 4, backup4); if ((unsigned int )(dev->dev)->id.revision > 2U && (unsigned int )(dev->dev)->id.revision <= 10U) { b43_write16(dev, 396, 43690); b43_write32(dev, 396, 3435969467U); tmp___6 = b43_read16(dev, 1540); if ((unsigned int )tmp___6 != 48059U) { goto error; } else { } tmp___7 = b43_read16(dev, 1542); if ((unsigned int )tmp___7 != 52428U) { goto error; } else { } } else { } b43_write32(dev, 396, 0U); v = b43_read32(dev, 288); v = v | 2147483648U; if (v != 2147484672U) { goto error; } else { } return (0); error: b43err(dev->wl, "Failed to validate the chipaccess\n"); return (-19); } } static void b43_security_init(struct b43_wldev *dev ) { { dev->ktp = b43_shm_read16(dev, 1, 86); dev->ktp = (unsigned int )dev->ktp * 2U; b43_write16(dev, 1084, 50); b43_clear_keys(dev); return; } } static int b43_rng_read(struct hwrng *rng , u32 *data ) { struct b43_wl *wl ; struct b43_wldev *dev ; int count ; u16 tmp ; int tmp___0 ; int tmp___1 ; long tmp___2 ; { wl = (struct b43_wl *)rng->priv; count = -19; mutex_lock_nested(& wl->mutex, 0U); dev = wl->current_dev; if ((unsigned long )dev != (unsigned long )((struct b43_wldev *)0)) { tmp___0 = atomic_read((atomic_t const *)(& dev->__init_status)); if (tmp___0 > 0) { tmp___1 = 1; } else { tmp___1 = 0; } } else { tmp___1 = 0; } tmp___2 = ldv__builtin_expect((long )tmp___1, 1L); if (tmp___2 != 0L) { tmp = b43_read16(dev, 1626); *data = (u32 )tmp; count = 2; } else { } mutex_unlock(& wl->mutex); return (count); } } static void b43_rng_exit(struct b43_wl *wl ) { { if ((int )wl->rng_initialized) { hwrng_unregister(& wl->rng); } else { } return; } } static int b43_rng_init(struct b43_wl *wl ) { int err ; char const *tmp ; { err = 0; tmp = wiphy_name((struct wiphy const *)(wl->hw)->wiphy); snprintf((char *)(& wl->rng_name), 31UL, "%s_%s", (char *)"b43", tmp); wl->rng.name = (char const *)(& wl->rng_name); wl->rng.data_read = & b43_rng_read; wl->rng.priv = (unsigned long )wl; wl->rng_initialized = 1; err = hwrng_register(& wl->rng); if (err != 0) { wl->rng_initialized = 0; b43err(wl, "Failed to register the random number generator (%d)\n", err); } else { } return (err); } } static void b43_tx_work(struct work_struct *work ) { struct b43_wl *wl ; struct work_struct const *__mptr ; struct b43_wldev *dev ; struct sk_buff *skb ; int err ; int tmp ; int tmp___0 ; long tmp___1 ; bool tmp___2 ; long tmp___3 ; __u32 tmp___4 ; { __mptr = (struct work_struct const *)work; wl = (struct b43_wl *)__mptr + 0xfffffffffffffda0UL; err = 0; mutex_lock_nested(& wl->mutex, 0U); dev = wl->current_dev; if ((unsigned long )dev == (unsigned long )((struct b43_wldev *)0)) { tmp___0 = 1; } else { tmp = atomic_read((atomic_t const *)(& dev->__init_status)); if (tmp <= 1) { tmp___0 = 1; } else { tmp___0 = 0; } } tmp___1 = ldv__builtin_expect((long )tmp___0, 0L); if (tmp___1 != 0L) { mutex_unlock(& wl->mutex); return; } else { } goto ldv_38815; ldv_38814: skb = skb_dequeue(& wl->tx_queue); tmp___2 = b43_using_pio_transfers(dev); if ((int )tmp___2) { err = b43_pio_tx(dev, skb); } else { err = b43_dma_tx(dev, skb); } tmp___3 = ldv__builtin_expect(err != 0, 0L); if (tmp___3 != 0L) { consume_skb(skb); } else { } ldv_38815: tmp___4 = skb_queue_len((struct sk_buff_head const *)(& wl->tx_queue)); if (tmp___4 != 0U) { goto ldv_38814; } else { } dev->tx_count = dev->tx_count + 1U; mutex_unlock(& wl->mutex); return; } } static int b43_op_tx(struct ieee80211_hw *hw , struct sk_buff *skb ) { struct b43_wl *wl ; struct b43_wl *tmp ; long tmp___0 ; int __ret_warn_on ; unsigned char *tmp___1 ; long tmp___2 ; { tmp = hw_to_b43_wl(hw); wl = tmp; tmp___0 = ldv__builtin_expect(skb->len <= 9U, 0L); if (tmp___0 != 0L) { dev_kfree_skb_any(skb); return (0); } else { } tmp___1 = skb_end_pointer((struct sk_buff const *)skb); __ret_warn_on = (unsigned int )((struct skb_shared_info *)tmp___1)->nr_frags != 0U; tmp___2 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___2 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 3179); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); skb_queue_tail(& wl->tx_queue, skb); ieee80211_queue_work(wl->hw, & wl->tx_work); return (0); } } static void b43_qos_params_upload(struct b43_wldev *dev , struct ieee80211_tx_queue_params const *p , u16 shm_offset ) { u16 params[16U] ; int bslots ; int tmp ; unsigned int i ; u16 tmp___0 ; u16 tmp___1 ; { if (! dev->qos_enabled) { return; } else { } tmp___0 = b43_read16(dev, 1626); bslots = (int )tmp___0 & (int )((unsigned short )p->cw_min); memset((void *)(& params), 0, 32UL); params[0] = (unsigned int )((u16 )p->txop) * 32U; params[1] = p->cw_min; params[2] = p->cw_max; params[3] = p->cw_min; params[4] = (u16 )p->aifs; params[5] = (u16 )bslots; params[6] = (int )((u16 )p->aifs) + (int )((u16 )bslots); i = 0U; goto ldv_38836; ldv_38835: ; if (i == 7U) { tmp___1 = b43_shm_read16(dev, 1, (int )((unsigned int )((u16 )i) * 2U + (unsigned int )shm_offset)); tmp = (int )tmp___1; tmp = tmp | 256; b43_shm_write16(dev, 1, (int )((unsigned int )((u16 )i) * 2U + (unsigned int )shm_offset), (int )((u16 )tmp)); } else { b43_shm_write16(dev, 1, (int )((unsigned int )((u16 )i) * 2U + (unsigned int )shm_offset), (int )params[i]); } i = i + 1U; ldv_38836: ; if (i <= 15U) { goto ldv_38835; } else { } return; } } static u16 const b43_qos_shm_offsets[4U] = { 672U, 640U, 608U, 576U}; static void b43_qos_upload_all(struct b43_wldev *dev ) { struct b43_wl *wl ; struct b43_qos_params *params ; unsigned int i ; { wl = dev->wl; if (! dev->qos_enabled) { return; } else { } b43_mac_suspend(dev); i = 0U; goto ldv_38848; ldv_38847: params = (struct b43_qos_params *)(& wl->qos_params) + (unsigned long )i; b43_qos_params_upload(dev, (struct ieee80211_tx_queue_params const *)(& params->p), (int )b43_qos_shm_offsets[i]); i = i + 1U; ldv_38848: ; if (i <= 3U) { goto ldv_38847; } else { } b43_mac_enable(dev); return; } } static void b43_qos_clear(struct b43_wl *wl ) { struct b43_qos_params *params ; unsigned int i ; int __ret_warn_on ; long tmp ; { i = 0U; goto ldv_38866; ldv_38865: params = (struct b43_qos_params *)(& wl->qos_params) + (unsigned long )i; switch ((int )b43_qos_shm_offsets[i]) { case 672: params->p.txop = 0U; params->p.aifs = 2U; params->p.cw_min = 1U; params->p.cw_max = 1U; goto ldv_38858; case 640: params->p.txop = 0U; params->p.aifs = 2U; params->p.cw_min = 1U; params->p.cw_max = 1U; goto ldv_38858; case 608: params->p.txop = 0U; params->p.aifs = 3U; params->p.cw_min = 1U; params->p.cw_max = 1023U; goto ldv_38858; case 576: params->p.txop = 0U; params->p.aifs = 7U; params->p.cw_min = 1U; params->p.cw_max = 1023U; goto ldv_38858; default: __ret_warn_on = 1; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 3297); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); } ldv_38858: i = i + 1U; ldv_38866: ; if (i <= 3U) { goto ldv_38865; } else { } return; } } static void b43_qos_init(struct b43_wldev *dev ) { u64 tmp ; u16 tmp___0 ; u64 tmp___1 ; u16 tmp___2 ; { if (! dev->qos_enabled) { tmp = b43_hf_read(dev); b43_hf_write(dev, tmp & 0xfffffffffffffeffULL); tmp___0 = b43_read16(dev, 1672); b43_write16(dev, 1672, (int )tmp___0 & 65531); b43dbg(dev->wl, "QoS disabled\n"); return; } else { } b43_qos_upload_all(dev); tmp___1 = b43_hf_read(dev); b43_hf_write(dev, tmp___1 | 256ULL); tmp___2 = b43_read16(dev, 1672); b43_write16(dev, 1672, (int )((unsigned int )tmp___2 | 4U)); b43dbg(dev->wl, "QoS enabled\n"); return; } } static int b43_op_conf_tx(struct ieee80211_hw *hw , u16 _queue , struct ieee80211_tx_queue_params const *params ) { struct b43_wl *wl ; struct b43_wl *tmp ; struct b43_wldev *dev ; unsigned int queue ; int err ; int tmp___0 ; int tmp___1 ; long tmp___2 ; size_t __len ; void *__ret ; { tmp = hw_to_b43_wl(hw); wl = tmp; queue = (unsigned int )_queue; err = -19; if (queue > 3U) { return (0); } else { } mutex_lock_nested(& wl->mutex, 0U); dev = wl->current_dev; if ((unsigned long )dev == (unsigned long )((struct b43_wldev *)0)) { tmp___1 = 1; } else { tmp___0 = atomic_read((atomic_t const *)(& dev->__init_status)); if (tmp___0 <= 0) { tmp___1 = 1; } else { tmp___1 = 0; } } tmp___2 = ldv__builtin_expect((long )tmp___1, 0L); if (tmp___2 != 0L) { goto out_unlock; } else { } __len = 8UL; if (__len > 63UL) { __ret = memcpy((void *)(& wl->qos_params[queue].p), (void const *)params, __len); } else { __ret = __builtin_memcpy((void *)(& wl->qos_params[queue].p), (void const *)params, __len); } b43_mac_suspend(dev); b43_qos_params_upload(dev, (struct ieee80211_tx_queue_params const *)(& wl->qos_params[queue].p), (int )b43_qos_shm_offsets[queue]); b43_mac_enable(dev); err = 0; out_unlock: mutex_unlock(& wl->mutex); return (err); } } static int b43_op_get_stats(struct ieee80211_hw *hw , struct ieee80211_low_level_stats *stats ) { struct b43_wl *wl ; struct b43_wl *tmp ; size_t __len ; void *__ret ; { tmp = hw_to_b43_wl(hw); wl = tmp; mutex_lock_nested(& wl->mutex, 0U); __len = 16UL; if (__len > 63UL) { __ret = memcpy((void *)stats, (void const *)(& wl->ieee_stats), __len); } else { __ret = __builtin_memcpy((void *)stats, (void const *)(& wl->ieee_stats), __len); } mutex_unlock(& wl->mutex); return (0); } } static u64 b43_op_get_tsf(struct ieee80211_hw *hw ) { struct b43_wl *wl ; struct b43_wl *tmp ; struct b43_wldev *dev ; u64 tsf ; int tmp___0 ; { tmp = hw_to_b43_wl(hw); wl = tmp; mutex_lock_nested(& wl->mutex, 0U); dev = wl->current_dev; if ((unsigned long )dev != (unsigned long )((struct b43_wldev *)0)) { tmp___0 = atomic_read((atomic_t const *)(& dev->__init_status)); if (tmp___0 > 0) { b43_tsf_read(dev, & tsf); } else { tsf = 0ULL; } } else { tsf = 0ULL; } mutex_unlock(& wl->mutex); return (tsf); } } static void b43_op_set_tsf(struct ieee80211_hw *hw , u64 tsf ) { struct b43_wl *wl ; struct b43_wl *tmp ; struct b43_wldev *dev ; int tmp___0 ; { tmp = hw_to_b43_wl(hw); wl = tmp; mutex_lock_nested(& wl->mutex, 0U); dev = wl->current_dev; if ((unsigned long )dev != (unsigned long )((struct b43_wldev *)0)) { tmp___0 = atomic_read((atomic_t const *)(& dev->__init_status)); if (tmp___0 > 0) { b43_tsf_write(dev, tsf); } else { } } else { } mutex_unlock(& wl->mutex); return; } } static void b43_put_phy_into_reset(struct b43_wldev *dev ) { struct ssb_device *sdev ; u32 tmslow ; { sdev = dev->dev; tmslow = ssb_read32(sdev, 3992); tmslow = tmslow & 3758096383U; tmslow = tmslow | 524288U; tmslow = tmslow | 131072U; ssb_write32(sdev, 3992, tmslow); msleep(1U); tmslow = ssb_read32(sdev, 3992); tmslow = tmslow & 4294836223U; tmslow = tmslow | 524288U; ssb_write32(sdev, 3992, tmslow); msleep(1U); return; } } static char const *band_to_string(enum ieee80211_band band ) { int __ret_warn_on ; long tmp ; { switch ((unsigned int )band) { case 1U: ; return ("5"); case 0U: ; return ("2.4"); default: ; goto ldv_38917; } ldv_38917: __ret_warn_on = 1; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 3435); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); return (""); } } static int b43_switch_band(struct b43_wl *wl , struct ieee80211_channel *chan ) { struct b43_wldev *up_dev ; struct b43_wldev *down_dev ; struct b43_wldev *d ; int err ; bool gmode ; int prev_status ; struct list_head const *__mptr ; int __ret_warn_on ; long tmp ; struct list_head const *__mptr___0 ; char const *tmp___0 ; char const *tmp___1 ; char const *tmp___2 ; char const *tmp___3 ; int __ret_warn_on___0 ; int tmp___4 ; long tmp___5 ; { up_dev = (struct b43_wldev *)0; gmode = gmode; __mptr = (struct list_head const *)wl->devlist.next; d = (struct b43_wldev *)__mptr + 0xfffffffffffff9e0UL; goto ldv_38942; ldv_38941: ; switch ((unsigned int )chan->band) { case 1U: ; if ((int )d->phy.supports_5ghz) { up_dev = d; gmode = 0; } else { } goto ldv_38935; case 0U: ; if ((int )d->phy.supports_2ghz) { up_dev = d; gmode = 1; } else { } goto ldv_38935; default: __ret_warn_on = 1; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 3465); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); return (-22); } ldv_38935: ; if ((unsigned long )up_dev != (unsigned long )((struct b43_wldev *)0)) { goto ldv_38940; } else { } __mptr___0 = (struct list_head const *)d->list.next; d = (struct b43_wldev *)__mptr___0 + 0xfffffffffffff9e0UL; ldv_38942: __builtin_prefetch((void const *)d->list.next); if ((unsigned long )(& d->list) != (unsigned long )(& wl->devlist)) { goto ldv_38941; } else { } ldv_38940: ; if ((unsigned long )up_dev == (unsigned long )((struct b43_wldev *)0)) { tmp___0 = band_to_string(chan->band); b43err(wl, "Could not find a device for %s-GHz band operation\n", tmp___0); return (-19); } else { } if ((unsigned long )wl->current_dev == (unsigned long )up_dev && (int )(wl->current_dev)->phy.gmode == (int )gmode) { return (0); } else { } tmp___1 = band_to_string(chan->band); b43dbg(wl, "Switching to %s-GHz band\n", tmp___1); down_dev = wl->current_dev; prev_status = atomic_read((atomic_t const *)(& down_dev->__init_status)); if (prev_status > 1) { down_dev = b43_wireless_core_stop(down_dev); } else { } if (prev_status > 0) { b43_wireless_core_exit(down_dev); } else { } if ((unsigned long )down_dev != (unsigned long )up_dev) { b43_put_phy_into_reset(down_dev); } else { } up_dev->phy.gmode = gmode; if (prev_status > 0) { err = b43_wireless_core_init(up_dev); if (err != 0) { tmp___2 = band_to_string(chan->band); b43err(wl, "Fatal: Could not initialize device for selected %s-GHz band\n", tmp___2); goto init_failure; } else { } } else { } if (prev_status > 1) { err = b43_wireless_core_start(up_dev); if (err != 0) { tmp___3 = band_to_string(chan->band); b43err(wl, "Fatal: Coult not start device for selected %s-GHz band\n", tmp___3); b43_wireless_core_exit(up_dev); goto init_failure; } else { } } else { } tmp___4 = atomic_read((atomic_t const *)(& up_dev->__init_status)); __ret_warn_on___0 = tmp___4 != prev_status; tmp___5 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___5 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 3519); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); wl->current_dev = up_dev; return (0); init_failure: wl->current_dev = (struct b43_wldev *)0; return (err); } } static void b43_set_retry_limits(struct b43_wldev *dev , unsigned int short_retry , unsigned int long_retry ) { unsigned int _min1 ; unsigned int _min2 ; unsigned int _min1___0 ; unsigned int _min2___0 ; { _min1 = short_retry; _min2 = 15U; short_retry = _min1 < _min2 ? _min1 : _min2; _min1___0 = long_retry; _min2___0 = 15U; long_retry = _min1___0 < _min2___0 ? _min1___0 : _min2___0; b43_shm_write16(dev, 2, 6, (int )((u16 )short_retry)); b43_shm_write16(dev, 2, 7, (int )((u16 )long_retry)); return; } } static int b43_op_config(struct ieee80211_hw *hw , u32 changed ) { struct b43_wl *wl ; struct b43_wl *tmp ; struct b43_wldev *dev ; struct b43_phy *phy ; struct ieee80211_conf *conf ; int antenna ; int err ; bool tmp___0 ; bool tmp___1 ; int tmp___2 ; bool tmp___3 ; { tmp = hw_to_b43_wl(hw); wl = tmp; conf = & hw->conf; err = 0; mutex_lock_nested(& wl->mutex, 0U); err = b43_switch_band(wl, conf->channel); if (err != 0) { goto out_unlock_mutex; } else { } dev = wl->current_dev; phy = & dev->phy; tmp___3 = conf_is_ht(conf); if ((int )tmp___3) { tmp___0 = conf_is_ht40_minus(conf); if ((int )tmp___0) { tmp___2 = 1; } else { tmp___1 = conf_is_ht40_plus(conf); if ((int )tmp___1) { tmp___2 = 1; } else { tmp___2 = 0; } } phy->is_40mhz = (bool )tmp___2; } else { phy->is_40mhz = 0; } b43_mac_suspend(dev); if ((changed & 128U) != 0U) { b43_set_retry_limits(dev, (unsigned int )conf->short_frame_max_tx_count, (unsigned int )conf->long_frame_max_tx_count); } else { } changed = changed & 4294967167U; if (changed == 0U) { goto out_mac_enable; } else { } if ((unsigned int )(conf->channel)->hw_value != phy->channel) { b43_switch_channel(dev, (unsigned int )(conf->channel)->hw_value); } else { } (dev->wl)->radiotap_enabled = ((int )conf->flags & 1) != 0; if (conf->power_level != 0) { if (conf->power_level != phy->desired_txpower) { phy->desired_txpower = conf->power_level; b43_phy_txpower_check(dev, 3U); } else { } } else { } antenna = 2; b43_mgmtframe_txantenna(dev, antenna); antenna = 2; if ((unsigned long )(phy->ops)->set_rx_antenna != (unsigned long )((void (*/* const */)(struct b43_wldev * , int ))0)) { (*((phy->ops)->set_rx_antenna))(dev, antenna); } else { } if ((int )wl->radio_enabled != (int )phy->radio_on) { if ((int )wl->radio_enabled) { b43_software_rfkill(dev, 0); b43info(dev->wl, "Radio turned on by software\n"); if (! dev->radio_hw_enable) { b43info(dev->wl, "The hardware RF-kill button still turns the radio physically off. Press the button to turn it on.\n"); } else { } } else { b43_software_rfkill(dev, 1); b43info(dev->wl, "Radio turned off by software\n"); } } else { } out_mac_enable: b43_mac_enable(dev); out_unlock_mutex: mutex_unlock(& wl->mutex); return (err); } } static void b43_update_basic_rates(struct b43_wldev *dev , u32 brates ) { struct ieee80211_supported_band *sband ; enum ieee80211_band tmp ; struct ieee80211_rate *rate ; int i ; u16 basic ; u16 direct ; u16 offset ; u16 basic_offset ; u16 rateptr ; u8 tmp___0 ; u8 tmp___1 ; int tmp___2 ; u8 tmp___3 ; u8 tmp___4 ; int tmp___5 ; { tmp = b43_current_band(dev->wl); sband = (((dev->wl)->hw)->wiphy)->bands[(unsigned int )tmp]; i = 0; goto ldv_38982; ldv_38981: rate = sband->bitrates + (unsigned long )i; tmp___2 = b43_is_cck_rate((int )rate->hw_value); if (tmp___2 != 0) { direct = 512U; basic = 544U; tmp___0 = b43_plcp_get_ratecode_cck((int )((u8 const )rate->hw_value)); offset = (u16 )tmp___0; offset = (unsigned int )offset & 15U; } else { direct = 448U; basic = 480U; tmp___1 = b43_plcp_get_ratecode_ofdm((int )((u8 const )rate->hw_value)); offset = (u16 )tmp___1; offset = (unsigned int )offset & 15U; } rate = ieee80211_get_response_rate(sband, brates, (int )rate->bitrate); tmp___5 = b43_is_cck_rate((int )rate->hw_value); if (tmp___5 != 0) { tmp___3 = b43_plcp_get_ratecode_cck((int )((u8 const )rate->hw_value)); basic_offset = (u16 )tmp___3; basic_offset = (unsigned int )basic_offset & 15U; } else { tmp___4 = b43_plcp_get_ratecode_ofdm((int )((u8 const )rate->hw_value)); basic_offset = (u16 )tmp___4; basic_offset = (unsigned int )basic_offset & 15U; } rateptr = b43_shm_read16(dev, 1, (int )((unsigned int )basic_offset * 2U + (unsigned int )direct)); b43_shm_write16(dev, 1, (int )((unsigned int )offset * 2U + (unsigned int )basic), (int )rateptr); i = i + 1; ldv_38982: ; if (sband->n_bitrates > i) { goto ldv_38981; } else { } return; } } static void b43_op_bss_info_changed(struct ieee80211_hw *hw , struct ieee80211_vif *vif , struct ieee80211_bss_conf *conf , u32 changed ) { struct b43_wl *wl ; struct b43_wl *tmp ; struct b43_wldev *dev ; int tmp___0 ; int __ret_warn_on ; long tmp___1 ; size_t __len ; void *__ret ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; int tmp___6 ; int tmp___7 ; int tmp___8 ; { tmp = hw_to_b43_wl(hw); wl = tmp; mutex_lock_nested(& wl->mutex, 0U); dev = wl->current_dev; if ((unsigned long )dev == (unsigned long )((struct b43_wldev *)0)) { goto out_unlock_mutex; } else { tmp___0 = atomic_read((atomic_t const *)(& dev->__init_status)); if (tmp___0 <= 1) { goto out_unlock_mutex; } else { } } __ret_warn_on = (unsigned long )wl->vif != (unsigned long )vif; tmp___1 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 3684); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); if ((changed & 128U) != 0U) { if ((unsigned long )conf->bssid != (unsigned long )((u8 const *)0U)) { __len = 6UL; if (__len > 63UL) { __ret = memcpy((void *)(& wl->bssid), (void const *)conf->bssid, __len); } else { __ret = __builtin_memcpy((void *)(& wl->bssid), (void const *)conf->bssid, __len); } } else { memset((void *)(& wl->bssid), 0, 6UL); } } else { } tmp___5 = atomic_read((atomic_t const *)(& dev->__init_status)); if (tmp___5 > 0) { if ((changed & 256U) != 0U) { tmp___2 = b43_is_mode(wl, 3); if (tmp___2 != 0) { b43_update_templates(wl); } else { tmp___3 = b43_is_mode(wl, 7); if (tmp___3 != 0) { b43_update_templates(wl); } else { tmp___4 = b43_is_mode(wl, 1); if (tmp___4 != 0) { b43_update_templates(wl); } else { } } } } else { } if ((changed & 128U) != 0U) { b43_write_mac_bssid_templates(dev); } else { } } else { } b43_mac_suspend(dev); if ((changed & 64U) != 0U) { tmp___6 = b43_is_mode(wl, 3); if (tmp___6 != 0) { b43_set_beacon_int(dev, (int )conf->beacon_int); } else { tmp___7 = b43_is_mode(wl, 7); if (tmp___7 != 0) { b43_set_beacon_int(dev, (int )conf->beacon_int); } else { tmp___8 = b43_is_mode(wl, 1); if (tmp___8 != 0) { b43_set_beacon_int(dev, (int )conf->beacon_int); } else { } } } } else { } if ((changed & 32U) != 0U) { b43_update_basic_rates(dev, conf->basic_rates); } else { } if ((changed & 8U) != 0U) { if ((int )conf->use_short_slot) { b43_short_slot_timing_enable(dev); } else { b43_short_slot_timing_disable(dev); } } else { } b43_mac_enable(dev); out_unlock_mutex: mutex_unlock(& wl->mutex); return; } } static int b43_op_set_key(struct ieee80211_hw *hw , enum set_key_cmd cmd , struct ieee80211_vif *vif , struct ieee80211_sta *sta , struct ieee80211_key_conf *key ) { struct b43_wl *wl ; struct b43_wl *tmp ; struct b43_wldev *dev ; u8 algorithm ; u8 index ; int err ; u8 bcast_addr[6U] ; int tmp___0 ; int __ret_warn_on ; long tmp___1 ; int __ret_warn_on___0 ; long tmp___2 ; long tmp___3 ; u64 tmp___4 ; u64 tmp___5 ; int __ret_warn_on___1 ; long tmp___6 ; { tmp = hw_to_b43_wl(hw); wl = tmp; bcast_addr[0] = 255U; bcast_addr[1] = 255U; bcast_addr[2] = 255U; bcast_addr[3] = 255U; bcast_addr[4] = 255U; bcast_addr[5] = 255U; if (modparam_nohwcrypt != 0) { return (-28); } else { } mutex_lock_nested(& wl->mutex, 0U); dev = wl->current_dev; err = -19; if ((unsigned long )dev == (unsigned long )((struct b43_wldev *)0)) { goto out_unlock; } else { tmp___0 = atomic_read((atomic_t const *)(& dev->__init_status)); if (tmp___0 <= 0) { goto out_unlock; } else { } } if ((int )dev->fw.pcm_request_failed || ! dev->hwcrypto_enabled) { err = -95; goto out_unlock; } else { } err = -22; switch ((unsigned int )key->alg) { case 0U: ; if ((unsigned int )key->keylen == 5U) { algorithm = 1U; } else { algorithm = 4U; } goto ldv_39013; case 1U: algorithm = 2U; goto ldv_39013; case 2U: algorithm = 3U; goto ldv_39013; default: __ret_warn_on = 1; tmp___1 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 3771); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); goto out_unlock; } ldv_39013: index = (unsigned char )key->keyidx; if ((unsigned int )index > 3U) { goto out_unlock; } else { } switch ((unsigned int )cmd) { case 0U: ; if ((unsigned int )algorithm == 2U && (((int )key->flags & 8) == 0 || modparam_hwtkip == 0)) { err = -95; goto out_unlock; } else { } if (((int )key->flags & 8) != 0) { __ret_warn_on___0 = (unsigned long )sta == (unsigned long )((struct ieee80211_sta *)0); tmp___2 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___2 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 3789); } else { } tmp___3 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___3 != 0L) { err = -95; goto out_unlock; } else { } err = b43_key_write(dev, -1, (int )algorithm, (u8 const *)(& key->key), (size_t )key->keylen, (u8 const *)(& sta->addr), key); } else { err = b43_key_write(dev, (int )index, (int )algorithm, (u8 const *)(& key->key), (size_t )key->keylen, (u8 const *)0U, key); } if (err != 0) { goto out_unlock; } else { } if ((unsigned int )algorithm == 1U || (unsigned int )algorithm == 4U) { tmp___4 = b43_hf_read(dev); b43_hf_write(dev, tmp___4 | 16384ULL); } else { tmp___5 = b43_hf_read(dev); b43_hf_write(dev, tmp___5 & 0xffffffffffffbfffULL); } key->flags = (u8 )((unsigned int )key->flags | 2U); if ((unsigned int )algorithm == 2U) { key->flags = (u8 )((unsigned int )key->flags | 4U); } else { } goto ldv_39022; case 1U: err = b43_key_clear(dev, (int )key->hw_key_idx); if (err != 0) { goto out_unlock; } else { } goto ldv_39022; default: __ret_warn_on___1 = 1; tmp___6 = ldv__builtin_expect(__ret_warn_on___1 != 0, 0L); if (tmp___6 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 3823); } else { } ldv__builtin_expect(__ret_warn_on___1 != 0, 0L); } ldv_39022: ; out_unlock: ; if (err == 0) { b43dbg(wl, "%s hardware based encryption for keyidx: %d, mac: %pM\n", (unsigned int )cmd == 0U ? (char *)"Using" : (char *)"Disabling", (int )key->keyidx, (unsigned long )sta != (unsigned long )((struct ieee80211_sta *)0) ? (unsigned char const *)(& sta->addr) : (unsigned char const *)(& bcast_addr)); b43_dump_keymemory(dev); } else { } mutex_unlock(& wl->mutex); return (err); } } static void b43_op_configure_filter(struct ieee80211_hw *hw , unsigned int changed , unsigned int *fflags , u64 multicast ) { struct b43_wl *wl ; struct b43_wl *tmp ; struct b43_wldev *dev ; int tmp___0 ; { tmp = hw_to_b43_wl(hw); wl = tmp; mutex_lock_nested(& wl->mutex, 0U); dev = wl->current_dev; if ((unsigned long )dev == (unsigned long )((struct b43_wldev *)0)) { *fflags = 0U; goto out_unlock; } else { } *fflags = *fflags & 127U; changed = changed & 127U; wl->filter_flags = *fflags; if (changed != 0U) { tmp___0 = atomic_read((atomic_t const *)(& dev->__init_status)); if (tmp___0 > 0) { b43_adjust_opmode(dev); } else { } } else { } out_unlock: mutex_unlock(& wl->mutex); return; } } static struct b43_wldev *b43_wireless_core_stop(struct b43_wldev *dev ) { struct b43_wl *wl ; struct b43_wldev *orig_dev ; u32 mask ; int tmp ; int tmp___0 ; int tmp___1 ; int __ret_warn_on ; long tmp___2 ; struct sk_buff *tmp___3 ; __u32 tmp___4 ; { wl = dev->wl; redo: ; if ((unsigned long )dev == (unsigned long )((struct b43_wldev *)0)) { return (dev); } else { tmp = atomic_read((atomic_t const *)(& dev->__init_status)); if (tmp <= 1) { return (dev); } else { } } mutex_unlock(& wl->mutex); cancel_delayed_work_sync(& dev->periodic_work); cancel_work_sync(& wl->tx_work); mutex_lock_nested(& wl->mutex, 0U); dev = wl->current_dev; if ((unsigned long )dev == (unsigned long )((struct b43_wldev *)0)) { return (dev); } else { tmp___0 = atomic_read((atomic_t const *)(& dev->__init_status)); if (tmp___0 <= 1) { return (dev); } else { } } atomic_set(& dev->__init_status, 1); __asm__ volatile ("": : : "memory"); if ((unsigned int )((dev->dev)->bus)->bustype == 3U) { b43_write32(dev, 300, 0U); b43_read32(dev, 300); } else { spin_lock_irq(& wl->hardirq_lock); b43_write32(dev, 300, 0U); b43_read32(dev, 300); spin_unlock_irq(& wl->hardirq_lock); } orig_dev = dev; mutex_unlock(& wl->mutex); if ((unsigned int )((dev->dev)->bus)->bustype == 3U) { b43_sdio_free_irq(dev); } else { synchronize_irq((dev->dev)->irq); ldv_free_irq_4((dev->dev)->irq, (void *)dev); } mutex_lock_nested(& wl->mutex, 0U); dev = wl->current_dev; if ((unsigned long )dev == (unsigned long )((struct b43_wldev *)0)) { return (dev); } else { } if ((unsigned long )dev != (unsigned long )orig_dev) { tmp___1 = atomic_read((atomic_t const *)(& dev->__init_status)); if (tmp___1 > 1) { goto redo; } else { } return (dev); } else { } mask = b43_read32(dev, 300); __ret_warn_on = mask != 4294967295U && mask != 0U; tmp___2 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___2 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 3933); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); goto ldv_39046; ldv_39045: tmp___3 = skb_dequeue(& wl->tx_queue); consume_skb(tmp___3); ldv_39046: tmp___4 = skb_queue_len((struct sk_buff_head const *)(& wl->tx_queue)); if (tmp___4 != 0U) { goto ldv_39045; } else { } b43_mac_suspend(dev); b43_leds_exit(dev); b43dbg(wl, "Wireless interface stopped\n"); return (dev); } } static int b43_wireless_core_start(struct b43_wldev *dev ) { int err ; int __ret_warn_on ; int tmp ; long tmp___0 ; { tmp = atomic_read((atomic_t const *)(& dev->__init_status)); __ret_warn_on = tmp != 1; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 3951); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); drain_txstatus_queue(dev); if ((unsigned int )((dev->dev)->bus)->bustype == 3U) { err = b43_sdio_request_irq(dev, & b43_sdio_interrupt_handler); if (err != 0) { b43err(dev->wl, "Cannot request SDIO IRQ\n"); goto out; } else { } } else { err = ldv_request_threaded_irq_5((dev->dev)->irq, & b43_interrupt_handler, & b43_interrupt_thread_handler, 128UL, "b43", (void *)dev); if (err != 0) { b43err(dev->wl, "Cannot request IRQ-%d\n", (dev->dev)->irq); goto out; } else { } } ieee80211_wake_queues((dev->wl)->hw); atomic_set(& dev->__init_status, 2); __asm__ volatile ("": : : "memory"); b43_mac_enable(dev); b43_write32(dev, 300, dev->irq_mask); b43_periodic_tasks_setup(dev); b43_leds_init(dev); b43dbg(dev->wl, "Wireless interface started\n"); out: ; return (err); } } static int b43_phy_versioning(struct b43_wldev *dev ) { struct b43_phy *phy ; u32 tmp ; u8 analog_type ; u8 phy_type ; u8 phy_rev ; u16 radio_manuf ; u16 radio_ver ; u16 radio_rev ; int unsupported ; u16 tmp___0 ; u16 tmp___1 ; u16 tmp___2 ; int __ret_warn_on ; long tmp___3 ; { phy = & dev->phy; unsupported = 0; tmp___0 = b43_read16(dev, 992); tmp = (u32 )tmp___0; analog_type = (u8 )((tmp & 61440U) >> 12); phy_type = (u8 )((tmp & 3840U) >> 8); phy_rev = (u8 )tmp; switch ((int )phy_type) { case 0: ; if ((unsigned int )phy_rev > 3U) { unsupported = 1; } else { } goto ldv_39068; case 1: ; if ((((unsigned int )phy_rev != 2U && (unsigned int )phy_rev != 4U) && (unsigned int )phy_rev != 6U) && (unsigned int )phy_rev != 7U) { unsupported = 1; } else { } goto ldv_39068; case 2: ; if ((unsigned int )phy_rev > 9U) { unsupported = 1; } else { } goto ldv_39068; case 5: ; if ((unsigned int )phy_rev > 2U) { unsupported = 1; } else { } goto ldv_39068; default: unsupported = 1; } ldv_39068: ; if (unsupported != 0) { b43err(dev->wl, "FOUND UNSUPPORTED PHY (Analog %u, Type %u, Revision %u)\n", (int )analog_type, (int )phy_type, (int )phy_rev); return (-95); } else { } b43dbg(dev->wl, "Found PHY: Analog %u, Type %u, Revision %u\n", (int )analog_type, (int )phy_type, (int )phy_rev); if ((unsigned int )((dev->dev)->bus)->chip_id == 17175U) { if ((unsigned int )((dev->dev)->bus)->chip_rev == 0U) { tmp = 839188863U; } else if ((unsigned int )((dev->dev)->bus)->chip_rev == 1U) { tmp = 1107624319U; } else { tmp = 1376059775U; } } else { b43_write16(dev, 1014, 1); tmp___1 = b43_read16(dev, 1018); tmp = (u32 )tmp___1; b43_write16(dev, 1014, 1); tmp___2 = b43_read16(dev, 1016); tmp = ((unsigned int )tmp___2 << 16) | tmp; } radio_manuf = (unsigned int )((u16 )tmp) & 4095U; radio_ver = (u16 )((tmp & 268431360U) >> 12); radio_rev = (u16 )(tmp >> 28); if ((unsigned int )radio_manuf != 383U) { unsupported = 1; } else { } switch ((int )phy_type) { case 0: ; if ((unsigned int )radio_ver != 8288U) { unsupported = 1; } else { } if ((unsigned int )radio_rev != 1U) { unsupported = 1; } else { } if ((unsigned int )radio_manuf != 383U) { unsupported = 1; } else { } goto ldv_39074; case 1: ; if (((int )radio_ver & 65520) != 8272) { unsupported = 1; } else { } goto ldv_39074; case 2: ; if ((unsigned int )radio_ver != 8272U) { unsupported = 1; } else { } goto ldv_39074; case 4: ; if ((unsigned int )radio_ver != 8277U && (unsigned int )radio_ver != 8278U) { unsupported = 1; } else { } goto ldv_39074; case 5: ; if ((unsigned int )radio_ver != 8290U && (unsigned int )radio_ver != 8291U) { unsupported = 1; } else { } goto ldv_39074; default: __ret_warn_on = 1; tmp___3 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___3 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 4089); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); } ldv_39074: ; if (unsupported != 0) { b43err(dev->wl, "FOUND UNSUPPORTED RADIO (Manuf 0x%X, Version 0x%X, Revision %u)\n", (int )radio_manuf, (int )radio_ver, (int )radio_rev); return (-95); } else { } b43dbg(dev->wl, "Found Radio: Manuf 0x%X, Version 0x%X, Revision %u\n", (int )radio_manuf, (int )radio_ver, (int )radio_rev); phy->radio_manuf = radio_manuf; phy->radio_ver = radio_ver; phy->radio_rev = (u8 )radio_rev; phy->analog = analog_type; phy->type = phy_type; phy->rev = phy_rev; return (0); } } static void setup_struct_phy_for_init(struct b43_wldev *dev , struct b43_phy *phy ) { { phy->hardware_power_control = modparam_hwpctl != 0; phy->next_txpwr_check_time = jiffies; atomic_set(& phy->txerr_cnt, 1000); phy->phy_locked = 0; phy->radio_locked = 0; return; } } static void setup_struct_wldev_for_init(struct b43_wldev *dev ) { { dev->dfq_valid = 0; dev->radio_hw_enable = 1; memset((void *)(& dev->stats), 0, 1UL); setup_struct_phy_for_init(dev, & dev->phy); dev->irq_reason = 0U; memset((void *)(& dev->dma_reason), 0, 24UL); dev->irq_mask = 939887204U; if (b43_modparam_verbose <= 2) { dev->irq_mask = dev->irq_mask & 4294965247U; } else { } dev->mac_suspended = 1; memset((void *)(& dev->noisecalc), 0, 34UL); return; } } static void b43_bluetooth_coext_enable(struct b43_wldev *dev ) { struct ssb_sprom *sprom ; u64 hf ; { sprom = & ((dev->dev)->bus)->sprom; if (modparam_btcoex == 0) { return; } else { } if (((int )sprom->boardflags_lo & 1) == 0) { return; } else { } if ((unsigned int )dev->phy.type != 1U && ! dev->phy.gmode) { return; } else { } hf = b43_hf_read(dev); if (((int )sprom->boardflags_lo & 16384) != 0) { hf = hf | 16777216ULL; } else { hf = hf | 16ULL; } b43_hf_write(dev, hf); return; } } static void b43_bluetooth_coext_disable(struct b43_wldev *dev ) { { if (modparam_btcoex == 0) { return; } else { } return; } } static void b43_imcfglo_timeouts_workaround(struct b43_wldev *dev ) { struct ssb_bus *bus ; u32 tmp ; { bus = (dev->dev)->bus; if (((unsigned long )bus->pcicore.dev != (unsigned long )((struct ssb_device *)0) && (unsigned int )(bus->pcicore.dev)->id.coreid == 2052U) && (unsigned int )(bus->pcicore.dev)->id.revision <= 5U) { tmp = ssb_read32(dev->dev, 4008); switch ((unsigned int )bus->bustype) { case 1U: ; case 2U: tmp = tmp & 4294967183U; tmp = tmp & 4294967288U; tmp = tmp | 50U; goto ldv_39104; case 0U: tmp = tmp & 4294967183U; tmp = tmp & 4294967288U; tmp = tmp | 83U; goto ldv_39104; default: ; goto ldv_39104; } ldv_39104: ssb_write32(dev->dev, 4008, tmp); } else { } return; } } static void b43_set_synth_pu_delay(struct b43_wldev *dev , bool idle ) { u16 pu_delay ; int tmp ; u16 _max1 ; unsigned short _max2 ; { if ((unsigned int )dev->phy.type == 0U) { pu_delay = 3700U; } else { pu_delay = 1050U; } tmp = b43_is_mode(dev->wl, 1); if (tmp != 0 || (int )idle) { pu_delay = 500U; } else { } if ((unsigned int )dev->phy.radio_ver == 8272U && (unsigned int )dev->phy.radio_rev == 8U) { _max1 = pu_delay; _max2 = 2400U; pu_delay = (u16 )((int )_max1 > (int )_max2 ? (int )_max1 : (int )_max2); } else { } b43_shm_write16(dev, 1, 148, (int )pu_delay); return; } } static void b43_set_pretbtt(struct b43_wldev *dev ) { u16 pretbtt ; int tmp ; { tmp = b43_is_mode(dev->wl, 1); if (tmp != 0) { pretbtt = 2U; } else if ((unsigned int )dev->phy.type == 0U) { pretbtt = 120U; } else { pretbtt = 250U; } b43_shm_write16(dev, 1, 150, (int )pretbtt); b43_write16(dev, 1554, (int )pretbtt); return; } } static void b43_wireless_core_exit(struct b43_wldev *dev ) { u32 macctl ; int __ret_warn_on ; int tmp ; int tmp___0 ; long tmp___1 ; int tmp___2 ; { if ((unsigned long )dev != (unsigned long )((struct b43_wldev *)0)) { tmp = atomic_read((atomic_t const *)(& dev->__init_status)); if (tmp > 1) { tmp___0 = 1; } else { tmp___0 = 0; } } else { tmp___0 = 0; } __ret_warn_on = tmp___0; tmp___1 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 4250); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); if ((unsigned long )dev == (unsigned long )((struct b43_wldev *)0)) { return; } else { tmp___2 = atomic_read((atomic_t const *)(& dev->__init_status)); if (tmp___2 != 1) { return; } else { } } atomic_set(& dev->__init_status, 0); __asm__ volatile ("": : : "memory"); macctl = b43_read32(dev, 288); macctl = macctl & 4294967293U; macctl = macctl | 4U; b43_write32(dev, 288, macctl); b43_dma_free(dev); b43_pio_free(dev); b43_chip_exit(dev); (*((dev->phy.ops)->switch_analog))(dev, 0); if ((unsigned long )(dev->wl)->current_beacon != (unsigned long )((struct sk_buff *)0)) { dev_kfree_skb_any((dev->wl)->current_beacon); (dev->wl)->current_beacon = (struct sk_buff *)0; } else { } ssb_device_disable(dev->dev, 0U); ssb_bus_may_powerdown((dev->dev)->bus); return; } } static int b43_wireless_core_init(struct b43_wldev *dev ) { struct ssb_bus *bus ; struct ssb_sprom *sprom ; struct b43_phy *phy ; int err ; u64 hf ; u32 tmp ; int __ret_warn_on ; int tmp___0 ; long tmp___1 ; int tmp___2 ; int __ret_warn_on___0 ; int tmp___3 ; long tmp___4 ; { bus = (dev->dev)->bus; sprom = & bus->sprom; phy = & dev->phy; tmp___0 = atomic_read((atomic_t const *)(& dev->__init_status)); __ret_warn_on = tmp___0 != 0; tmp___1 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 4284); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); err = ssb_bus_powerup(bus, 0); if (err != 0) { goto out; } else { } tmp___2 = ssb_device_is_enabled(dev->dev); if (tmp___2 == 0) { tmp = (int )phy->gmode ? 536870912U : 0U; b43_wireless_core_reset(dev, tmp); } else { } setup_struct_wldev_for_init(dev); (*((phy->ops)->prepare_structs))(dev); ssb_pcicore_dev_irqvecs_enable(& bus->pcicore, dev->dev); b43_imcfglo_timeouts_workaround(dev); b43_bluetooth_coext_disable(dev); if ((unsigned long )(phy->ops)->prepare_hardware != (unsigned long )((int (*/* const */)(struct b43_wldev * ))0)) { err = (*((phy->ops)->prepare_hardware))(dev); if (err != 0) { goto err_busdown; } else { } } else { } err = b43_chip_init(dev); if (err != 0) { goto err_busdown; } else { } b43_shm_write16(dev, 1, 22, (int )(dev->dev)->id.revision); hf = b43_hf_read(dev); if ((unsigned int )phy->type == 2U) { hf = hf | 2ULL; if ((unsigned int )phy->rev == 1U) { hf = hf | 32ULL; } else { } if (((int )sprom->boardflags_lo & 2) != 0) { hf = hf | 64ULL; } else { } } else { } if ((unsigned int )phy->radio_ver == 8272U) { if ((unsigned int )phy->radio_rev == 6U) { hf = hf | 2097152ULL; } else { } if ((unsigned int )phy->radio_rev <= 5U) { hf = hf | 262144ULL; } else { } } else { } if (((int )sprom->boardflags_lo & 32) != 0) { hf = hf | 1024ULL; } else { } if ((unsigned int )bus->bustype == 1U && (unsigned int )(bus->pcicore.dev)->id.revision <= 10U) { hf = hf | 524288ULL; } else { } hf = hf & 0xfffffffffbffffffULL; b43_hf_write(dev, hf); b43_set_retry_limits(dev, 7U, 4U); b43_shm_write16(dev, 1, 68, 3); b43_shm_write16(dev, 1, 70, 2); b43_shm_write16(dev, 1, 116, 1); b43_rate_memory_init(dev); b43_set_phytxctl_defaults(dev); if ((unsigned int )phy->type == 1U) { b43_shm_write16(dev, 2, 3, 31); } else { b43_shm_write16(dev, 2, 3, 15); } b43_shm_write16(dev, 2, 4, 1023); if (((unsigned int )((dev->dev)->bus)->bustype == 2U || (unsigned int )((dev->dev)->bus)->bustype == 3U) || (int )dev->use_pio) { dev->__using_pio_transfers = 1; err = b43_pio_init(dev); } else { dev->__using_pio_transfers = 0; err = b43_dma_init(dev); } if (err != 0) { goto err_chip_exit; } else { } b43_qos_init(dev); b43_set_synth_pu_delay(dev, 1); b43_bluetooth_coext_enable(dev); ssb_bus_powerup(bus, ((int )sprom->boardflags_lo & 32) == 0); b43_upload_card_macaddress(dev); b43_security_init(dev); ieee80211_wake_queues((dev->wl)->hw); atomic_set(& dev->__init_status, 1); __asm__ volatile ("": : : "memory"); out: ; return (err); err_chip_exit: b43_chip_exit(dev); err_busdown: ssb_bus_may_powerdown(bus); tmp___3 = atomic_read((atomic_t const *)(& dev->__init_status)); __ret_warn_on___0 = tmp___3 != 0; tmp___4 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___4 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 4389); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); return (err); } } static int b43_op_add_interface(struct ieee80211_hw *hw , struct ieee80211_vif *vif ) { struct b43_wl *wl ; struct b43_wl *tmp ; struct b43_wldev *dev ; int err ; size_t __len ; void *__ret ; { tmp = hw_to_b43_wl(hw); wl = tmp; err = -95; if (((((unsigned int )vif->type != 3U && (unsigned int )vif->type != 7U) && (unsigned int )vif->type != 2U) && (unsigned int )vif->type != 5U) && (unsigned int )vif->type != 1U) { return (-95); } else { } mutex_lock_nested(& wl->mutex, 0U); if ((int )wl->operating) { goto out_mutex_unlock; } else { } b43dbg(wl, "Adding Interface type %d\n", (unsigned int )vif->type); dev = wl->current_dev; wl->operating = 1; wl->vif = vif; wl->if_type = (int )vif->type; __len = 6UL; if (__len > 63UL) { __ret = memcpy((void *)(& wl->mac_addr), (void const *)(& vif->addr), __len); } else { __ret = __builtin_memcpy((void *)(& wl->mac_addr), (void const *)(& vif->addr), __len); } b43_adjust_opmode(dev); b43_set_pretbtt(dev); b43_set_synth_pu_delay(dev, 0); b43_upload_card_macaddress(dev); err = 0; out_mutex_unlock: mutex_unlock(& wl->mutex); return (err); } } static void b43_op_remove_interface(struct ieee80211_hw *hw , struct ieee80211_vif *vif ) { struct b43_wl *wl ; struct b43_wl *tmp ; struct b43_wldev *dev ; int __ret_warn_on ; long tmp___0 ; int __ret_warn_on___0 ; long tmp___1 ; { tmp = hw_to_b43_wl(hw); wl = tmp; dev = wl->current_dev; b43dbg(wl, "Removing Interface type %d\n", (unsigned int )vif->type); mutex_lock_nested(& wl->mutex, 0U); __ret_warn_on = ! wl->operating; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 4443); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); __ret_warn_on___0 = (unsigned long )wl->vif != (unsigned long )vif; tmp___1 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 4444); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); wl->vif = (struct ieee80211_vif *)0; wl->operating = 0; b43_adjust_opmode(dev); memset((void *)(& wl->mac_addr), 0, 6UL); b43_upload_card_macaddress(dev); mutex_unlock(& wl->mutex); return; } } static int b43_op_start(struct ieee80211_hw *hw ) { struct b43_wl *wl ; struct b43_wl *tmp ; struct b43_wldev *dev ; int did_init ; int err ; int tmp___0 ; int tmp___1 ; { tmp = hw_to_b43_wl(hw); wl = tmp; dev = wl->current_dev; did_init = 0; err = 0; memset((void *)(& wl->bssid), 0, 6UL); memset((void *)(& wl->mac_addr), 0, 6UL); wl->filter_flags = 0U; wl->radiotap_enabled = 0; b43_qos_clear(wl); wl->beacon0_uploaded = 0; wl->beacon1_uploaded = 0; wl->beacon_templates_virgin = 1; wl->radio_enabled = 1; mutex_lock_nested(& wl->mutex, 0U); tmp___0 = atomic_read((atomic_t const *)(& dev->__init_status)); if (tmp___0 <= 0) { err = b43_wireless_core_init(dev); if (err != 0) { goto out_mutex_unlock; } else { } did_init = 1; } else { } tmp___1 = atomic_read((atomic_t const *)(& dev->__init_status)); if (tmp___1 <= 1) { err = b43_wireless_core_start(dev); if (err != 0) { if (did_init != 0) { b43_wireless_core_exit(dev); } else { } goto out_mutex_unlock; } else { } } else { } wiphy_rfkill_start_polling(hw->wiphy); out_mutex_unlock: mutex_unlock(& wl->mutex); return (err); } } static void b43_op_stop(struct ieee80211_hw *hw ) { struct b43_wl *wl ; struct b43_wl *tmp ; struct b43_wldev *dev ; int tmp___0 ; { tmp = hw_to_b43_wl(hw); wl = tmp; dev = wl->current_dev; cancel_work_sync(& wl->beacon_update_trigger); mutex_lock_nested(& wl->mutex, 0U); tmp___0 = atomic_read((atomic_t const *)(& dev->__init_status)); if (tmp___0 > 1) { dev = b43_wireless_core_stop(dev); if ((unsigned long )dev == (unsigned long )((struct b43_wldev *)0)) { goto out_unlock; } else { } } else { } b43_wireless_core_exit(dev); wl->radio_enabled = 0; out_unlock: mutex_unlock(& wl->mutex); cancel_work_sync(& wl->txpower_adjust_work); return; } } static int b43_op_beacon_set_tim(struct ieee80211_hw *hw , struct ieee80211_sta *sta , bool set ) { struct b43_wl *wl ; struct b43_wl *tmp ; { tmp = hw_to_b43_wl(hw); wl = tmp; b43_update_templates(wl); return (0); } } static void b43_op_sta_notify(struct ieee80211_hw *hw , struct ieee80211_vif *vif , enum sta_notify_cmd notify_cmd , struct ieee80211_sta *sta ) { struct b43_wl *wl ; struct b43_wl *tmp ; int __ret_warn_on ; long tmp___0 ; { tmp = hw_to_b43_wl(hw); wl = tmp; __ret_warn_on = (unsigned long )vif == (unsigned long )((struct ieee80211_vif *)0) || (unsigned long )wl->vif != (unsigned long )vif; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 4543); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); return; } } static void b43_op_sw_scan_start_notifier(struct ieee80211_hw *hw ) { struct b43_wl *wl ; struct b43_wl *tmp ; struct b43_wldev *dev ; u64 tmp___0 ; int tmp___1 ; { tmp = hw_to_b43_wl(hw); wl = tmp; mutex_lock_nested(& wl->mutex, 0U); dev = wl->current_dev; if ((unsigned long )dev != (unsigned long )((struct b43_wldev *)0)) { tmp___1 = atomic_read((atomic_t const *)(& dev->__init_status)); if (tmp___1 > 0) { tmp___0 = b43_hf_read(dev); b43_hf_write(dev, tmp___0 | 67108864ULL); } else { } } else { } mutex_unlock(& wl->mutex); return; } } static void b43_op_sw_scan_complete_notifier(struct ieee80211_hw *hw ) { struct b43_wl *wl ; struct b43_wl *tmp ; struct b43_wldev *dev ; u64 tmp___0 ; int tmp___1 ; { tmp = hw_to_b43_wl(hw); wl = tmp; mutex_lock_nested(& wl->mutex, 0U); dev = wl->current_dev; if ((unsigned long )dev != (unsigned long )((struct b43_wldev *)0)) { tmp___1 = atomic_read((atomic_t const *)(& dev->__init_status)); if (tmp___1 > 0) { tmp___0 = b43_hf_read(dev); b43_hf_write(dev, tmp___0 & 0xfffffffffbffffffULL); } else { } } else { } mutex_unlock(& wl->mutex); return; } } static int b43_op_get_survey(struct ieee80211_hw *hw , int idx , struct survey_info *survey ) { struct b43_wl *wl ; struct b43_wl *tmp ; struct b43_wldev *dev ; struct ieee80211_conf *conf ; { tmp = hw_to_b43_wl(hw); wl = tmp; dev = wl->current_dev; conf = & hw->conf; if (idx != 0) { return (-2); } else { } survey->channel = conf->channel; survey->filled = 1U; survey->noise = (s8 )dev->stats.link_noise; return (0); } } static struct ieee80211_ops const b43_hw_ops = {& b43_op_tx, & b43_op_start, & b43_op_stop, & b43_op_add_interface, & b43_op_remove_interface, & b43_op_config, & b43_op_bss_info_changed, 0, & b43_op_configure_filter, & b43_op_beacon_set_tim, & b43_op_set_key, & b43_op_update_tkip_key, 0, & b43_op_sw_scan_start_notifier, & b43_op_sw_scan_complete_notifier, & b43_op_get_stats, 0, 0, 0, 0, & b43_op_sta_notify, & b43_op_conf_tx, & b43_op_get_tsf, & b43_op_set_tsf, 0, 0, 0, & b43_op_get_survey, & b43_rfkill_poll, 0, 0, 0, 0}; static void b43_chip_reset(struct work_struct *work ) { struct b43_wldev *dev ; struct work_struct const *__mptr ; struct b43_wl *wl ; int err ; int prev_status ; { __mptr = (struct work_struct const *)work; dev = (struct b43_wldev *)__mptr + 0xfffffffffffffe38UL; wl = dev->wl; err = 0; mutex_lock_nested(& wl->mutex, 0U); prev_status = atomic_read((atomic_t const *)(& dev->__init_status)); if (prev_status > 1) { dev = b43_wireless_core_stop(dev); if ((unsigned long )dev == (unsigned long )((struct b43_wldev *)0)) { err = -19; goto out; } else { } } else { } if (prev_status > 0) { b43_wireless_core_exit(dev); } else { } if (prev_status > 0) { err = b43_wireless_core_init(dev); if (err != 0) { goto out; } else { } } else { } if (prev_status > 1) { err = b43_wireless_core_start(dev); if (err != 0) { b43_wireless_core_exit(dev); goto out; } else { } } else { } out: ; if (err != 0) { wl->current_dev = (struct b43_wldev *)0; } else { } mutex_unlock(& wl->mutex); if (err != 0) { b43err(wl, "Controller restart FAILED\n"); } else { b43info(wl, "Controller restarted\n"); } return; } } static int b43_setup_bands(struct b43_wldev *dev , bool have_2ghz_phy , bool have_5ghz_phy ) { struct ieee80211_hw *hw ; { hw = (dev->wl)->hw; if ((int )have_2ghz_phy) { (hw->wiphy)->bands[0] = & b43_band_2GHz; } else { } if ((unsigned int )dev->phy.type == 4U) { if ((int )have_5ghz_phy) { (hw->wiphy)->bands[1] = & b43_band_5GHz_nphy; } else { } } else if ((int )have_5ghz_phy) { (hw->wiphy)->bands[1] = & b43_band_5GHz_aphy; } else { } dev->phy.supports_2ghz = have_2ghz_phy; dev->phy.supports_5ghz = have_5ghz_phy; return (0); } } static void b43_wireless_core_detach(struct b43_wldev *dev ) { { b43_release_firmware(dev); b43_phy_free(dev); return; } } static int b43_wireless_core_attach(struct b43_wldev *dev ) { struct b43_wl *wl ; struct ssb_bus *bus ; struct pci_dev *pdev ; int err ; bool have_2ghz_phy ; bool have_5ghz_phy ; u32 tmp ; u32 tmshigh ; int __ret_warn_on ; long tmp___0 ; int __ret_warn_on___0 ; long tmp___1 ; struct lock_class_key __key ; atomic_long_t __constr_expr_0 ; { wl = dev->wl; bus = (dev->dev)->bus; pdev = (unsigned int )bus->bustype == 1U ? bus->__annonCompField34.host_pci : (struct pci_dev *)0; have_2ghz_phy = 0; have_5ghz_phy = 0; err = ssb_bus_powerup(bus, 0); if (err != 0) { b43err(wl, "Bus powerup failed\n"); goto out; } else { } if ((unsigned int )(dev->dev)->id.revision > 4U) { tmshigh = ssb_read32(dev->dev, 3996); have_2ghz_phy = (tmshigh & 65536U) != 0U; have_5ghz_phy = (tmshigh & 131072U) != 0U; } else { __ret_warn_on = 1; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 4720); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); } dev->phy.gmode = have_2ghz_phy; dev->phy.radio_on = 1; tmp = (int )dev->phy.gmode ? 536870912U : 0U; b43_wireless_core_reset(dev, tmp); err = b43_phy_versioning(dev); if (err != 0) { goto err_powerdown; } else { } if ((unsigned long )pdev == (unsigned long )((struct pci_dev *)0) || (((unsigned int )pdev->device != 17170U && (unsigned int )pdev->device != 17177U) && (unsigned int )pdev->device != 17188U)) { have_2ghz_phy = 0; have_5ghz_phy = 0; switch ((int )dev->phy.type) { case 0: have_5ghz_phy = 1; goto ldv_39245; case 5: ; case 2: ; case 4: have_2ghz_phy = 1; goto ldv_39245; default: __ret_warn_on___0 = 1; tmp___1 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 4750); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); } ldv_39245: ; } else { } if ((unsigned int )dev->phy.type == 0U) { b43err(wl, "IEEE 802.11a devices are unsupported\n"); err = -95; goto err_powerdown; } else { } if ((unsigned int )dev->phy.type != 4U && (unsigned int )dev->phy.type != 5U) { have_2ghz_phy = 1; have_5ghz_phy = 0; } else { } err = b43_phy_allocate(dev); if (err != 0) { goto err_powerdown; } else { } dev->phy.gmode = have_2ghz_phy; tmp = (int )dev->phy.gmode ? 536870912U : 0U; b43_wireless_core_reset(dev, tmp); err = b43_validate_chipaccess(dev); if (err != 0) { goto err_phy_free; } else { } err = b43_setup_bands(dev, (int )have_2ghz_phy, (int )have_5ghz_phy); if (err != 0) { goto err_phy_free; } else { } if ((unsigned long )wl->current_dev == (unsigned long )((struct b43_wldev *)0)) { wl->current_dev = dev; } else { } __init_work(& dev->restart_work, 0); __constr_expr_0.counter = 2097664L; dev->restart_work.data = __constr_expr_0; lockdep_init_map(& dev->restart_work.lockdep_map, "(&dev->restart_work)", & __key, 0); INIT_LIST_HEAD(& dev->restart_work.entry); dev->restart_work.func = & b43_chip_reset; (*((dev->phy.ops)->switch_analog))(dev, 0); ssb_device_disable(dev->dev, 0U); ssb_bus_may_powerdown(bus); out: ; return (err); err_phy_free: b43_phy_free(dev); err_powerdown: ssb_bus_may_powerdown(bus); return (err); } } static void b43_one_core_detach(struct ssb_device *dev ) { struct b43_wldev *wldev ; struct b43_wl *wl ; void *tmp ; { tmp = ssb_get_drvdata(dev); wldev = (struct b43_wldev *)tmp; wl = wldev->wl; b43_debugfs_remove_device(wldev); b43_wireless_core_detach(wldev); list_del(& wldev->list); wl->nr_devs = (u8 )((int )wl->nr_devs - 1); ssb_set_drvdata(dev, (void *)0); kfree((void const *)wldev); return; } } static int b43_one_core_attach(struct ssb_device *dev , struct b43_wl *wl ) { struct b43_wldev *wldev ; struct pci_dev *pdev ; int err ; int tmp ; void *tmp___0 ; { err = -12; tmp = list_empty((struct list_head const *)(& wl->devlist)); if (tmp == 0) { pdev = (unsigned int )(dev->bus)->bustype == 1U ? (dev->bus)->__annonCompField34.host_pci : (struct pci_dev *)0; if ((unsigned long )pdev == (unsigned long )((struct pci_dev *)0) || (((unsigned int )pdev->device != 17185U && (unsigned int )pdev->device != 17171U) && (unsigned int )pdev->device != 17178U)) { b43dbg(wl, "Ignoring unconnected 802.11 core\n"); return (-19); } else { } } else { } tmp___0 = kzalloc(1736UL, 208U); wldev = (struct b43_wldev *)tmp___0; if ((unsigned long )wldev == (unsigned long )((struct b43_wldev *)0)) { goto out; } else { } wldev->use_pio = b43_modparam_pio != 0; wldev->dev = dev; wldev->wl = wl; atomic_set(& wldev->__init_status, 0); __asm__ volatile ("": : : "memory"); wldev->bad_frames_preempt = modparam_bad_frames_preempt != 0; INIT_LIST_HEAD(& wldev->list); err = b43_wireless_core_attach(wldev); if (err != 0) { goto err_kfree_wldev; } else { } list_add(& wldev->list, & wl->devlist); wl->nr_devs = (u8 )((int )wl->nr_devs + 1); ssb_set_drvdata(dev, (void *)wldev); b43_debugfs_add_device(wldev); out: ; return (err); err_kfree_wldev: kfree((void const *)wldev); return (err); } } static void b43_sprom_fixup(struct ssb_bus *bus ) { struct pci_dev *pdev ; { if (((unsigned int )bus->boardinfo.vendor == 4136U && (unsigned int )bus->chip_id == 17153U) && (unsigned int )bus->boardinfo.rev == 116U) { bus->sprom.boardflags_lo = (u16 )((unsigned int )bus->sprom.boardflags_lo | 1U); } else { } if (((unsigned int )bus->boardinfo.vendor == 4203U && (unsigned int )bus->boardinfo.type == 78U) && (unsigned int )bus->boardinfo.rev > 64U) { bus->sprom.boardflags_lo = (u16 )((unsigned int )bus->sprom.boardflags_lo | 2U); } else { } if ((unsigned int )bus->bustype == 1U) { pdev = bus->__annonCompField34.host_pci; if ((((((((((unsigned int )pdev->vendor == 5348U && (unsigned int )pdev->device == 17176U) && (unsigned int )pdev->subsystem_vendor == 4163U) && (unsigned int )pdev->subsystem_device == 4111U) || ((((unsigned int )pdev->vendor == 5348U && (unsigned int )pdev->device == 17184U) && (unsigned int )pdev->subsystem_vendor == 4136U) && (unsigned int )pdev->subsystem_device == 3U)) || ((((unsigned int )pdev->vendor == 5348U && (unsigned int )pdev->device == 17184U) && (unsigned int )pdev->subsystem_vendor == 4156U) && (unsigned int )pdev->subsystem_device == 4856U)) || ((((unsigned int )pdev->vendor == 5348U && (unsigned int )pdev->device == 17184U) && (unsigned int )pdev->subsystem_vendor == 5943U) && (unsigned int )pdev->subsystem_device == 21U)) || ((((unsigned int )pdev->vendor == 5348U && (unsigned int )pdev->device == 17184U) && (unsigned int )pdev->subsystem_vendor == 5943U) && (unsigned int )pdev->subsystem_device == 20U)) || ((((unsigned int )pdev->vendor == 5348U && (unsigned int )pdev->device == 17184U) && (unsigned int )pdev->subsystem_vendor == 5943U) && (unsigned int )pdev->subsystem_device == 19U)) || ((((unsigned int )pdev->vendor == 5348U && (unsigned int )pdev->device == 17184U) && (unsigned int )pdev->subsystem_vendor == 4183U) && (unsigned int )pdev->subsystem_device == 28688U)) { bus->sprom.boardflags_lo = (unsigned int )bus->sprom.boardflags_lo & 65534U; } else { } } else { } return; } } static void b43_wireless_exit(struct ssb_device *dev , struct b43_wl *wl ) { struct ieee80211_hw *hw ; { hw = wl->hw; ssb_set_devtypedata(dev, (void *)0); ldv_ieee80211_free_hw_6(hw); return; } } static int b43_wireless_init(struct ssb_device *dev ) { struct ssb_sprom *sprom ; struct ieee80211_hw *hw ; struct b43_wl *wl ; int err ; int tmp ; struct lock_class_key __key ; struct lock_class_key __key___0 ; struct lock_class_key __key___1 ; atomic_long_t __constr_expr_0 ; struct lock_class_key __key___2 ; atomic_long_t __constr_expr_1 ; struct lock_class_key __key___3 ; atomic_long_t __constr_expr_2 ; { sprom = & (dev->bus)->sprom; err = -12; b43_sprom_fixup(dev->bus); hw = ldv_ieee80211_alloc_hw_7(2152UL, & b43_hw_ops); if ((unsigned long )hw == (unsigned long )((struct ieee80211_hw *)0)) { b43err((struct b43_wl *)0, "Could not allocate ieee80211 device\n"); goto out; } else { } wl = hw_to_b43_wl(hw); hw->flags = 66U; (hw->wiphy)->interface_modes = 174U; hw->queues = modparam_qos != 0 ? 4U : 1U; wl->mac80211_initially_registered_queues = hw->queues; hw->max_rates = 2U; SET_IEEE80211_DEV(hw, dev->dev); tmp = is_valid_ether_addr((u8 const *)(& sprom->et1mac)); if (tmp != 0) { SET_IEEE80211_PERM_ADDR(hw, (u8 *)(& sprom->et1mac)); } else { SET_IEEE80211_PERM_ADDR(hw, (u8 *)(& sprom->il0mac)); } wl->hw = hw; __mutex_init(& wl->mutex, "&wl->mutex", & __key); spinlock_check(& wl->hardirq_lock); __raw_spin_lock_init(& wl->hardirq_lock.__annonCompField19.rlock, "&(&wl->hardirq_lock)->rlock", & __key___0); INIT_LIST_HEAD(& wl->devlist); __init_work(& wl->beacon_update_trigger, 0); __constr_expr_0.counter = 2097664L; wl->beacon_update_trigger.data = __constr_expr_0; lockdep_init_map(& wl->beacon_update_trigger.lockdep_map, "(&wl->beacon_update_trigger)", & __key___1, 0); INIT_LIST_HEAD(& wl->beacon_update_trigger.entry); wl->beacon_update_trigger.func = & b43_beacon_update_trigger_work; __init_work(& wl->txpower_adjust_work, 0); __constr_expr_1.counter = 2097664L; wl->txpower_adjust_work.data = __constr_expr_1; lockdep_init_map(& wl->txpower_adjust_work.lockdep_map, "(&wl->txpower_adjust_work)", & __key___2, 0); INIT_LIST_HEAD(& wl->txpower_adjust_work.entry); wl->txpower_adjust_work.func = & b43_phy_txpower_adjust_work; __init_work(& wl->tx_work, 0); __constr_expr_2.counter = 2097664L; wl->tx_work.data = __constr_expr_2; lockdep_init_map(& wl->tx_work.lockdep_map, "(&wl->tx_work)", & __key___3, 0); INIT_LIST_HEAD(& wl->tx_work.entry); wl->tx_work.func = & b43_tx_work; skb_queue_head_init(& wl->tx_queue); ssb_set_devtypedata(dev, (void *)wl); b43info(wl, "Broadcom %04X WLAN found (core revision %u)\n", (int )(dev->bus)->chip_id, (int )dev->id.revision); err = 0; out: ; return (err); } } static int b43_probe(struct ssb_device *dev , struct ssb_device_id const *id ) { struct b43_wl *wl ; int err ; int first ; void *tmp ; void *tmp___0 ; int __ret_warn_on ; long tmp___1 ; { first = 0; tmp = ssb_get_devtypedata(dev); wl = (struct b43_wl *)tmp; if ((unsigned long )wl == (unsigned long )((struct b43_wl *)0)) { first = 1; err = b43_wireless_init(dev); if (err != 0) { goto out; } else { } tmp___0 = ssb_get_devtypedata(dev); wl = (struct b43_wl *)tmp___0; __ret_warn_on = (unsigned long )wl == (unsigned long )((struct b43_wl *)0); tmp___1 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 4976); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); } else { } err = b43_one_core_attach(dev, wl); if (err != 0) { goto err_wireless_exit; } else { } if (first != 0) { err = ieee80211_register_hw(wl->hw); if (err != 0) { goto err_one_core_detach; } else { } b43_leds_register(wl->current_dev); b43_rng_init(wl); } else { } out: ; return (err); err_one_core_detach: b43_one_core_detach(dev); err_wireless_exit: ; if (first != 0) { b43_wireless_exit(dev, wl); } else { } return (err); } } static void b43_remove(struct ssb_device *dev ) { struct b43_wl *wl ; void *tmp ; struct b43_wldev *wldev ; void *tmp___0 ; int __ret_warn_on ; long tmp___1 ; int tmp___2 ; { tmp = ssb_get_devtypedata(dev); wl = (struct b43_wl *)tmp; tmp___0 = ssb_get_drvdata(dev); wldev = (struct b43_wldev *)tmp___0; cancel_work_sync(& wldev->restart_work); __ret_warn_on = (unsigned long )wl == (unsigned long )((struct b43_wl *)0); tmp___1 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/main.c", 5010); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); if ((unsigned long )wl->current_dev == (unsigned long )wldev) { (wl->hw)->queues = wl->mac80211_initially_registered_queues; b43_leds_stop(wldev); ieee80211_unregister_hw(wl->hw); } else { } b43_one_core_detach(dev); tmp___2 = list_empty((struct list_head const *)(& wl->devlist)); if (tmp___2 != 0) { b43_rng_exit(wl); b43_leds_unregister(wl); b43_wireless_exit(dev, wl); } else { } return; } } void b43_controller_restart(struct b43_wldev *dev , char const *reason ) { int tmp ; { tmp = atomic_read((atomic_t const *)(& dev->__init_status)); if (tmp <= 0) { return; } else { } b43info(dev->wl, "Controller RESET (%s) ...\n", reason); ieee80211_queue_work((dev->wl)->hw, & dev->restart_work); return; } } static struct ssb_driver b43_ssb_driver = {"b43", (struct ssb_device_id const *)(& b43_ssb_tbl), & b43_probe, & b43_remove, 0, 0, 0, {0, 0, 0, 0, (_Bool)0, 0, 0, 0, 0, 0, 0, 0, 0}}; static void b43_print_driverinfo(void) { char const *feat_pci ; char const *feat_pcmcia ; char const *feat_nphy ; char const *feat_leds ; char const *feat_sdio ; { feat_pci = ""; feat_pcmcia = ""; feat_nphy = ""; feat_leds = ""; feat_sdio = ""; feat_pci = "P"; feat_pcmcia = "M"; feat_leds = "L"; feat_sdio = "S"; printk("<6>Broadcom 43xx driver loaded [ Features: %s%s%s%s%s, Firmware-ID: FW13 ]\n", feat_pci, feat_pcmcia, feat_nphy, feat_leds, feat_sdio); return; } } static int b43_init(void) { int err ; { b43_debugfs_init(); err = b43_pcmcia_init(); if (err != 0) { goto err_dfs_exit; } else { } err = b43_sdio_init(); if (err != 0) { goto err_pcmcia_exit; } else { } err = ssb_driver_register(& b43_ssb_driver); if (err != 0) { goto err_sdio_exit; } else { } b43_print_driverinfo(); return (err); err_sdio_exit: b43_sdio_exit(); err_pcmcia_exit: b43_pcmcia_exit(); err_dfs_exit: b43_debugfs_exit(); return (err); } } static void b43_exit(void) { { ssb_driver_unregister(& b43_ssb_driver); b43_sdio_exit(); b43_pcmcia_exit(); b43_debugfs_exit(); return; } } int ldv_retval_11 ; extern void ldv_initialize(void) ; void ldv_check_final_state(void) ; int ldv_retval_8 ; int ldv_retval_7 ; void activate_work_5(struct work_struct *work , int state ) { { if (ldv_work_5_0 == 0) { ldv_work_struct_5_0 = work; ldv_work_5_0 = state; return; } else { } if (ldv_work_5_1 == 0) { ldv_work_struct_5_1 = work; ldv_work_5_1 = state; return; } else { } if (ldv_work_5_2 == 0) { ldv_work_struct_5_2 = work; ldv_work_5_2 = state; return; } else { } if (ldv_work_5_3 == 0) { ldv_work_struct_5_3 = work; ldv_work_5_3 = state; return; } else { } return; } } void work_init_3(void) { { ldv_work_3_0 = 0; ldv_work_3_1 = 0; ldv_work_3_2 = 0; ldv_work_3_3 = 0; return; } } void call_and_disable_all_7(int state ) { { if (ldv_work_7_0 == state) { call_and_disable_work_7(ldv_work_struct_7_0); } else { } if (ldv_work_7_1 == state) { call_and_disable_work_7(ldv_work_struct_7_1); } else { } if (ldv_work_7_2 == state) { call_and_disable_work_7(ldv_work_struct_7_2); } else { } if (ldv_work_7_3 == state) { call_and_disable_work_7(ldv_work_struct_7_3); } else { } return; } } void disable_suitable_irq_2(int line , void *data ) { { if (ldv_irq_2_0 != 0 && line == ldv_irq_line_2_0) { ldv_irq_2_0 = 0; return; } else { } if (ldv_irq_2_1 != 0 && line == ldv_irq_line_2_1) { ldv_irq_2_1 = 0; return; } else { } if (ldv_irq_2_2 != 0 && line == ldv_irq_line_2_2) { ldv_irq_2_2 = 0; return; } else { } if (ldv_irq_2_3 != 0 && line == ldv_irq_line_2_3) { ldv_irq_2_3 = 0; return; } else { } return; } } void invoke_work_6(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_work_6_0 == 2 || ldv_work_6_0 == 3) { ldv_work_6_0 = 4; b43_phy_txpower_adjust_work(ldv_work_struct_6_0); ldv_work_6_0 = 1; } else { } goto ldv_39373; case 1: ; if (ldv_work_6_1 == 2 || ldv_work_6_1 == 3) { ldv_work_6_1 = 4; b43_phy_txpower_adjust_work(ldv_work_struct_6_0); ldv_work_6_1 = 1; } else { } goto ldv_39373; case 2: ; if (ldv_work_6_2 == 2 || ldv_work_6_2 == 3) { ldv_work_6_2 = 4; b43_phy_txpower_adjust_work(ldv_work_struct_6_0); ldv_work_6_2 = 1; } else { } goto ldv_39373; case 3: ; if (ldv_work_6_3 == 2 || ldv_work_6_3 == 3) { ldv_work_6_3 = 4; b43_phy_txpower_adjust_work(ldv_work_struct_6_0); ldv_work_6_3 = 1; } else { } goto ldv_39373; default: ldv_stop(); } ldv_39373: ; return; } } void activate_pending_timer_9(struct timer_list *timer , unsigned long data , int pending_flag ) { { if ((unsigned long )ldv_timer_list_9 == (unsigned long )timer) { if (ldv_timer_state_9 == 2 || pending_flag != 0) { ldv_timer_list_9 = timer; ldv_timer_list_9->data = data; ldv_timer_state_9 = 1; } else { } return; } else { } reg_timer_9(timer); ldv_timer_list_9->data = data; return; } } int reg_check_1(irqreturn_t (*handler)(int , void * ) , irqreturn_t (*thread_fn)(int , void * ) ) { { if ((unsigned long )handler == (unsigned long )(& b43_interrupt_handler) && (unsigned long )thread_fn == (unsigned long )(& b43_interrupt_thread_handler)) { return (1); } else { } return (0); } } void activate_work_3(struct work_struct *work , int state ) { { if (ldv_work_3_0 == 0) { ldv_work_struct_3_0 = work; ldv_work_3_0 = state; return; } else { } if (ldv_work_3_1 == 0) { ldv_work_struct_3_1 = work; ldv_work_3_1 = state; return; } else { } if (ldv_work_3_2 == 0) { ldv_work_struct_3_2 = work; ldv_work_3_2 = state; return; } else { } if (ldv_work_3_3 == 0) { ldv_work_struct_3_3 = work; ldv_work_3_3 = state; return; } else { } return; } } void work_init_5(void) { { ldv_work_5_0 = 0; ldv_work_5_1 = 0; ldv_work_5_2 = 0; ldv_work_5_3 = 0; return; } } void call_and_disable_all_4(int state ) { { if (ldv_work_4_0 == state) { call_and_disable_work_4(ldv_work_struct_4_0); } else { } if (ldv_work_4_1 == state) { call_and_disable_work_4(ldv_work_struct_4_1); } else { } if (ldv_work_4_2 == state) { call_and_disable_work_4(ldv_work_struct_4_2); } else { } if (ldv_work_4_3 == state) { call_and_disable_work_4(ldv_work_struct_4_3); } else { } return; } } void work_init_7(void) { { ldv_work_7_0 = 0; ldv_work_7_1 = 0; ldv_work_7_2 = 0; ldv_work_7_3 = 0; return; } } void invoke_work_7(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_work_7_0 == 2 || ldv_work_7_0 == 3) { ldv_work_7_0 = 4; b43_tx_work(ldv_work_struct_7_0); ldv_work_7_0 = 1; } else { } goto ldv_39410; case 1: ; if (ldv_work_7_1 == 2 || ldv_work_7_1 == 3) { ldv_work_7_1 = 4; b43_tx_work(ldv_work_struct_7_0); ldv_work_7_1 = 1; } else { } goto ldv_39410; case 2: ; if (ldv_work_7_2 == 2 || ldv_work_7_2 == 3) { ldv_work_7_2 = 4; b43_tx_work(ldv_work_struct_7_0); ldv_work_7_2 = 1; } else { } goto ldv_39410; case 3: ; if (ldv_work_7_3 == 2 || ldv_work_7_3 == 3) { ldv_work_7_3 = 4; b43_tx_work(ldv_work_struct_7_0); ldv_work_7_3 = 1; } else { } goto ldv_39410; default: ldv_stop(); } ldv_39410: ; return; } } void disable_work_5(struct work_struct *work ) { { if ((ldv_work_5_0 == 3 || ldv_work_5_0 == 2) && (unsigned long )ldv_work_struct_5_0 == (unsigned long )work) { ldv_work_5_0 = 1; } else { } if ((ldv_work_5_1 == 3 || ldv_work_5_1 == 2) && (unsigned long )ldv_work_struct_5_1 == (unsigned long )work) { ldv_work_5_1 = 1; } else { } if ((ldv_work_5_2 == 3 || ldv_work_5_2 == 2) && (unsigned long )ldv_work_struct_5_2 == (unsigned long )work) { ldv_work_5_2 = 1; } else { } if ((ldv_work_5_3 == 3 || ldv_work_5_3 == 2) && (unsigned long )ldv_work_struct_5_3 == (unsigned long )work) { ldv_work_5_3 = 1; } else { } return; } } void call_and_disable_work_3(struct work_struct *work ) { { if ((ldv_work_3_0 == 2 || ldv_work_3_0 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_3_0) { b43_periodic_work_handler(work); ldv_work_3_0 = 1; return; } else { } if ((ldv_work_3_1 == 2 || ldv_work_3_1 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_3_1) { b43_periodic_work_handler(work); ldv_work_3_1 = 1; return; } else { } if ((ldv_work_3_2 == 2 || ldv_work_3_2 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_3_2) { b43_periodic_work_handler(work); ldv_work_3_2 = 1; return; } else { } if ((ldv_work_3_3 == 2 || ldv_work_3_3 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_3_3) { b43_periodic_work_handler(work); ldv_work_3_3 = 1; return; } else { } return; } } void disable_work_7(struct work_struct *work ) { { if ((ldv_work_7_0 == 3 || ldv_work_7_0 == 2) && (unsigned long )ldv_work_struct_7_0 == (unsigned long )work) { ldv_work_7_0 = 1; } else { } if ((ldv_work_7_1 == 3 || ldv_work_7_1 == 2) && (unsigned long )ldv_work_struct_7_1 == (unsigned long )work) { ldv_work_7_1 = 1; } else { } if ((ldv_work_7_2 == 3 || ldv_work_7_2 == 2) && (unsigned long )ldv_work_struct_7_2 == (unsigned long )work) { ldv_work_7_2 = 1; } else { } if ((ldv_work_7_3 == 3 || ldv_work_7_3 == 2) && (unsigned long )ldv_work_struct_7_3 == (unsigned long )work) { ldv_work_7_3 = 1; } else { } return; } } void disable_work_3(struct work_struct *work ) { { if ((ldv_work_3_0 == 3 || ldv_work_3_0 == 2) && (unsigned long )ldv_work_struct_3_0 == (unsigned long )work) { ldv_work_3_0 = 1; } else { } if ((ldv_work_3_1 == 3 || ldv_work_3_1 == 2) && (unsigned long )ldv_work_struct_3_1 == (unsigned long )work) { ldv_work_3_1 = 1; } else { } if ((ldv_work_3_2 == 3 || ldv_work_3_2 == 2) && (unsigned long )ldv_work_struct_3_2 == (unsigned long )work) { ldv_work_3_2 = 1; } else { } if ((ldv_work_3_3 == 3 || ldv_work_3_3 == 2) && (unsigned long )ldv_work_struct_3_3 == (unsigned long )work) { ldv_work_3_3 = 1; } else { } return; } } void call_and_disable_all_6(int state ) { { if (ldv_work_6_0 == state) { call_and_disable_work_6(ldv_work_struct_6_0); } else { } if (ldv_work_6_1 == state) { call_and_disable_work_6(ldv_work_struct_6_1); } else { } if (ldv_work_6_2 == state) { call_and_disable_work_6(ldv_work_struct_6_2); } else { } if (ldv_work_6_3 == state) { call_and_disable_work_6(ldv_work_struct_6_3); } else { } return; } } void disable_suitable_irq_1(int line , void *data ) { { if (ldv_irq_1_0 != 0 && line == ldv_irq_line_1_0) { ldv_irq_1_0 = 0; return; } else { } if (ldv_irq_1_1 != 0 && line == ldv_irq_line_1_1) { ldv_irq_1_1 = 0; return; } else { } if (ldv_irq_1_2 != 0 && line == ldv_irq_line_1_2) { ldv_irq_1_2 = 0; return; } else { } if (ldv_irq_1_3 != 0 && line == ldv_irq_line_1_3) { ldv_irq_1_3 = 0; return; } else { } return; } } void activate_suitable_irq_1(int line , void *data ) { { if (ldv_irq_1_0 == 0) { ldv_irq_line_1_0 = line; ldv_irq_data_1_0 = data; ldv_irq_1_0 = 1; return; } else { } if (ldv_irq_1_1 == 0) { ldv_irq_line_1_1 = line; ldv_irq_data_1_1 = data; ldv_irq_1_1 = 1; return; } else { } if (ldv_irq_1_2 == 0) { ldv_irq_line_1_2 = line; ldv_irq_data_1_2 = data; ldv_irq_1_2 = 1; return; } else { } if (ldv_irq_1_3 == 0) { ldv_irq_line_1_3 = line; ldv_irq_data_1_3 = data; ldv_irq_1_3 = 1; return; } else { } return; } } void invoke_work_4(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_work_4_0 == 2 || ldv_work_4_0 == 3) { ldv_work_4_0 = 4; b43_chip_reset(ldv_work_struct_4_0); ldv_work_4_0 = 1; } else { } goto ldv_39446; case 1: ; if (ldv_work_4_1 == 2 || ldv_work_4_1 == 3) { ldv_work_4_1 = 4; b43_chip_reset(ldv_work_struct_4_0); ldv_work_4_1 = 1; } else { } goto ldv_39446; case 2: ; if (ldv_work_4_2 == 2 || ldv_work_4_2 == 3) { ldv_work_4_2 = 4; b43_chip_reset(ldv_work_struct_4_0); ldv_work_4_2 = 1; } else { } goto ldv_39446; case 3: ; if (ldv_work_4_3 == 2 || ldv_work_4_3 == 3) { ldv_work_4_3 = 4; b43_chip_reset(ldv_work_struct_4_0); ldv_work_4_3 = 1; } else { } goto ldv_39446; default: ldv_stop(); } ldv_39446: ; return; } } void call_and_disable_work_5(struct work_struct *work ) { { if ((ldv_work_5_0 == 2 || ldv_work_5_0 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_5_0) { b43_beacon_update_trigger_work(work); ldv_work_5_0 = 1; return; } else { } if ((ldv_work_5_1 == 2 || ldv_work_5_1 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_5_1) { b43_beacon_update_trigger_work(work); ldv_work_5_1 = 1; return; } else { } if ((ldv_work_5_2 == 2 || ldv_work_5_2 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_5_2) { b43_beacon_update_trigger_work(work); ldv_work_5_2 = 1; return; } else { } if ((ldv_work_5_3 == 2 || ldv_work_5_3 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_5_3) { b43_beacon_update_trigger_work(work); ldv_work_5_3 = 1; return; } else { } return; } } int ldv_irq_2(int state , int line , void *data ) { irqreturn_t irq_retval ; int tmp ; int tmp___0 ; { tmp = __VERIFIER_nondet_int(); irq_retval = (irqreturn_t )tmp; if (state != 0) { tmp___0 = __VERIFIER_nondet_int(); switch (tmp___0) { case 0: ; if (state == 1) { LDV_IN_INTERRUPT = 2; irq_retval = b43_interrupt_handler(line, data); LDV_IN_INTERRUPT = 1; if ((unsigned int )irq_retval == 2U) { state = 2; } else { state = 1; } return (state); } else { } goto ldv_39463; case 1: ; if (state == 2) { b43_interrupt_thread_handler(line, data); state = 1; return (state); } else { } goto ldv_39463; default: ldv_stop(); } ldv_39463: ; } else { } return (state); } } void activate_work_6(struct work_struct *work , int state ) { { if (ldv_work_6_0 == 0) { ldv_work_struct_6_0 = work; ldv_work_6_0 = state; return; } else { } if (ldv_work_6_1 == 0) { ldv_work_struct_6_1 = work; ldv_work_6_1 = state; return; } else { } if (ldv_work_6_2 == 0) { ldv_work_struct_6_2 = work; ldv_work_6_2 = state; return; } else { } if (ldv_work_6_3 == 0) { ldv_work_struct_6_3 = work; ldv_work_6_3 = state; return; } else { } return; } } void choose_interrupt_2(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ldv_irq_2_0 = ldv_irq_2(ldv_irq_2_0, ldv_irq_line_2_0, ldv_irq_data_2_0); goto ldv_39474; case 1: ldv_irq_2_0 = ldv_irq_2(ldv_irq_2_1, ldv_irq_line_2_1, ldv_irq_data_2_1); goto ldv_39474; case 2: ldv_irq_2_0 = ldv_irq_2(ldv_irq_2_2, ldv_irq_line_2_2, ldv_irq_data_2_2); goto ldv_39474; case 3: ldv_irq_2_0 = ldv_irq_2(ldv_irq_2_3, ldv_irq_line_2_3, ldv_irq_data_2_3); goto ldv_39474; default: ldv_stop(); } ldv_39474: ; return; } } void activate_work_4(struct work_struct *work , int state ) { { if (ldv_work_4_0 == 0) { ldv_work_struct_4_0 = work; ldv_work_4_0 = state; return; } else { } if (ldv_work_4_1 == 0) { ldv_work_struct_4_1 = work; ldv_work_4_1 = state; return; } else { } if (ldv_work_4_2 == 0) { ldv_work_struct_4_2 = work; ldv_work_4_2 = state; return; } else { } if (ldv_work_4_3 == 0) { ldv_work_struct_4_3 = work; ldv_work_4_3 = state; return; } else { } return; } } void call_and_disable_work_7(struct work_struct *work ) { { if ((ldv_work_7_0 == 2 || ldv_work_7_0 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_7_0) { b43_tx_work(work); ldv_work_7_0 = 1; return; } else { } if ((ldv_work_7_1 == 2 || ldv_work_7_1 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_7_1) { b43_tx_work(work); ldv_work_7_1 = 1; return; } else { } if ((ldv_work_7_2 == 2 || ldv_work_7_2 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_7_2) { b43_tx_work(work); ldv_work_7_2 = 1; return; } else { } if ((ldv_work_7_3 == 2 || ldv_work_7_3 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_7_3) { b43_tx_work(work); ldv_work_7_3 = 1; return; } else { } return; } } void call_and_disable_all_5(int state ) { { if (ldv_work_5_0 == state) { call_and_disable_work_5(ldv_work_struct_5_0); } else { } if (ldv_work_5_1 == state) { call_and_disable_work_5(ldv_work_struct_5_1); } else { } if (ldv_work_5_2 == state) { call_and_disable_work_5(ldv_work_struct_5_2); } else { } if (ldv_work_5_3 == state) { call_and_disable_work_5(ldv_work_struct_5_3); } else { } return; } } int reg_timer_9(struct timer_list *timer ) { { ldv_timer_list_9 = timer; ldv_timer_state_9 = 1; return (0); } } void activate_suitable_irq_2(int line , void *data ) { { if (ldv_irq_2_0 == 0) { ldv_irq_line_2_0 = line; ldv_irq_data_2_0 = data; ldv_irq_2_0 = 1; return; } else { } if (ldv_irq_2_1 == 0) { ldv_irq_line_2_1 = line; ldv_irq_data_2_1 = data; ldv_irq_2_1 = 1; return; } else { } if (ldv_irq_2_2 == 0) { ldv_irq_line_2_2 = line; ldv_irq_data_2_2 = data; ldv_irq_2_2 = 1; return; } else { } if (ldv_irq_2_3 == 0) { ldv_irq_line_2_3 = line; ldv_irq_data_2_3 = data; ldv_irq_2_3 = 1; return; } else { } return; } } void disable_suitable_timer_9(struct timer_list *timer ) { { if ((unsigned long )timer == (unsigned long )ldv_timer_list_9) { ldv_timer_state_9 = 0; return; } else { } return; } } void work_init_6(void) { { ldv_work_6_0 = 0; ldv_work_6_1 = 0; ldv_work_6_2 = 0; ldv_work_6_3 = 0; return; } } void disable_work_6(struct work_struct *work ) { { if ((ldv_work_6_0 == 3 || ldv_work_6_0 == 2) && (unsigned long )ldv_work_struct_6_0 == (unsigned long )work) { ldv_work_6_0 = 1; } else { } if ((ldv_work_6_1 == 3 || ldv_work_6_1 == 2) && (unsigned long )ldv_work_struct_6_1 == (unsigned long )work) { ldv_work_6_1 = 1; } else { } if ((ldv_work_6_2 == 3 || ldv_work_6_2 == 2) && (unsigned long )ldv_work_struct_6_2 == (unsigned long )work) { ldv_work_6_2 = 1; } else { } if ((ldv_work_6_3 == 3 || ldv_work_6_3 == 2) && (unsigned long )ldv_work_struct_6_3 == (unsigned long )work) { ldv_work_6_3 = 1; } else { } return; } } void choose_interrupt_1(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ldv_irq_1_0 = ldv_irq_1(ldv_irq_1_0, ldv_irq_line_1_0, ldv_irq_data_1_0); goto ldv_39511; case 1: ldv_irq_1_0 = ldv_irq_1(ldv_irq_1_1, ldv_irq_line_1_1, ldv_irq_data_1_1); goto ldv_39511; case 2: ldv_irq_1_0 = ldv_irq_1(ldv_irq_1_2, ldv_irq_line_1_2, ldv_irq_data_1_2); goto ldv_39511; case 3: ldv_irq_1_0 = ldv_irq_1(ldv_irq_1_3, ldv_irq_line_1_3, ldv_irq_data_1_3); goto ldv_39511; default: ldv_stop(); } ldv_39511: ; return; } } void invoke_work_5(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_work_5_0 == 2 || ldv_work_5_0 == 3) { ldv_work_5_0 = 4; b43_beacon_update_trigger_work(ldv_work_struct_5_0); ldv_work_5_0 = 1; } else { } goto ldv_39522; case 1: ; if (ldv_work_5_1 == 2 || ldv_work_5_1 == 3) { ldv_work_5_1 = 4; b43_beacon_update_trigger_work(ldv_work_struct_5_0); ldv_work_5_1 = 1; } else { } goto ldv_39522; case 2: ; if (ldv_work_5_2 == 2 || ldv_work_5_2 == 3) { ldv_work_5_2 = 4; b43_beacon_update_trigger_work(ldv_work_struct_5_0); ldv_work_5_2 = 1; } else { } goto ldv_39522; case 3: ; if (ldv_work_5_3 == 2 || ldv_work_5_3 == 3) { ldv_work_5_3 = 4; b43_beacon_update_trigger_work(ldv_work_struct_5_0); ldv_work_5_3 = 1; } else { } goto ldv_39522; default: ldv_stop(); } ldv_39522: ; return; } } int reg_check_2(irqreturn_t (*handler)(int , void * ) , irqreturn_t (*thread_fn)(int , void * ) ) { { if ((unsigned long )handler == (unsigned long )(& b43_interrupt_handler) && (unsigned long )thread_fn == (unsigned long )(& b43_interrupt_thread_handler)) { return (1); } else { } return (0); } } void activate_work_7(struct work_struct *work , int state ) { { if (ldv_work_7_0 == 0) { ldv_work_struct_7_0 = work; ldv_work_7_0 = state; return; } else { } if (ldv_work_7_1 == 0) { ldv_work_struct_7_1 = work; ldv_work_7_1 = state; return; } else { } if (ldv_work_7_2 == 0) { ldv_work_struct_7_2 = work; ldv_work_7_2 = state; return; } else { } if (ldv_work_7_3 == 0) { ldv_work_struct_7_3 = work; ldv_work_7_3 = state; return; } else { } return; } } void choose_timer_9(struct timer_list *timer ) { { LDV_IN_INTERRUPT = 2; (*(timer->function))(timer->data); LDV_IN_INTERRUPT = 1; ldv_timer_state_9 = 2; return; } } void disable_work_4(struct work_struct *work ) { { if ((ldv_work_4_0 == 3 || ldv_work_4_0 == 2) && (unsigned long )ldv_work_struct_4_0 == (unsigned long )work) { ldv_work_4_0 = 1; } else { } if ((ldv_work_4_1 == 3 || ldv_work_4_1 == 2) && (unsigned long )ldv_work_struct_4_1 == (unsigned long )work) { ldv_work_4_1 = 1; } else { } if ((ldv_work_4_2 == 3 || ldv_work_4_2 == 2) && (unsigned long )ldv_work_struct_4_2 == (unsigned long )work) { ldv_work_4_2 = 1; } else { } if ((ldv_work_4_3 == 3 || ldv_work_4_3 == 2) && (unsigned long )ldv_work_struct_4_3 == (unsigned long )work) { ldv_work_4_3 = 1; } else { } return; } } void work_init_4(void) { { ldv_work_4_0 = 0; ldv_work_4_1 = 0; ldv_work_4_2 = 0; ldv_work_4_3 = 0; return; } } void invoke_work_3(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_work_3_0 == 2 || ldv_work_3_0 == 3) { ldv_work_3_0 = 4; b43_periodic_work_handler(ldv_work_struct_3_0); ldv_work_3_0 = 1; } else { } goto ldv_39554; case 1: ; if (ldv_work_3_1 == 2 || ldv_work_3_1 == 3) { ldv_work_3_1 = 4; b43_periodic_work_handler(ldv_work_struct_3_0); ldv_work_3_1 = 1; } else { } goto ldv_39554; case 2: ; if (ldv_work_3_2 == 2 || ldv_work_3_2 == 3) { ldv_work_3_2 = 4; b43_periodic_work_handler(ldv_work_struct_3_0); ldv_work_3_2 = 1; } else { } goto ldv_39554; case 3: ; if (ldv_work_3_3 == 2 || ldv_work_3_3 == 3) { ldv_work_3_3 = 4; b43_periodic_work_handler(ldv_work_struct_3_0); ldv_work_3_3 = 1; } else { } goto ldv_39554; default: ldv_stop(); } ldv_39554: ; return; } } int ldv_irq_1(int state , int line , void *data ) { irqreturn_t irq_retval ; int tmp ; int tmp___0 ; { tmp = __VERIFIER_nondet_int(); irq_retval = (irqreturn_t )tmp; if (state != 0) { tmp___0 = __VERIFIER_nondet_int(); switch (tmp___0) { case 0: ; if (state == 1) { LDV_IN_INTERRUPT = 2; irq_retval = b43_interrupt_handler(line, data); LDV_IN_INTERRUPT = 1; if ((unsigned int )irq_retval == 2U) { state = 2; } else { state = 1; } return (state); } else { } goto ldv_39566; case 1: ; if (state == 2) { b43_interrupt_thread_handler(line, data); state = 1; return (state); } else { } goto ldv_39566; default: ldv_stop(); } ldv_39566: ; } else { } return (state); } } void call_and_disable_all_3(int state ) { { if (ldv_work_3_0 == state) { call_and_disable_work_3(ldv_work_struct_3_0); } else { } if (ldv_work_3_1 == state) { call_and_disable_work_3(ldv_work_struct_3_1); } else { } if (ldv_work_3_2 == state) { call_and_disable_work_3(ldv_work_struct_3_2); } else { } if (ldv_work_3_3 == state) { call_and_disable_work_3(ldv_work_struct_3_3); } else { } return; } } void call_and_disable_work_6(struct work_struct *work ) { { if ((ldv_work_6_0 == 2 || ldv_work_6_0 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_6_0) { b43_phy_txpower_adjust_work(work); ldv_work_6_0 = 1; return; } else { } if ((ldv_work_6_1 == 2 || ldv_work_6_1 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_6_1) { b43_phy_txpower_adjust_work(work); ldv_work_6_1 = 1; return; } else { } if ((ldv_work_6_2 == 2 || ldv_work_6_2 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_6_2) { b43_phy_txpower_adjust_work(work); ldv_work_6_2 = 1; return; } else { } if ((ldv_work_6_3 == 2 || ldv_work_6_3 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_6_3) { b43_phy_txpower_adjust_work(work); ldv_work_6_3 = 1; return; } else { } return; } } void call_and_disable_work_4(struct work_struct *work ) { { if ((ldv_work_4_0 == 2 || ldv_work_4_0 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_4_0) { b43_chip_reset(work); ldv_work_4_0 = 1; return; } else { } if ((ldv_work_4_1 == 2 || ldv_work_4_1 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_4_1) { b43_chip_reset(work); ldv_work_4_1 = 1; return; } else { } if ((ldv_work_4_2 == 2 || ldv_work_4_2 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_4_2) { b43_chip_reset(work); ldv_work_4_2 = 1; return; } else { } if ((ldv_work_4_3 == 2 || ldv_work_4_3 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_4_3) { b43_chip_reset(work); ldv_work_4_3 = 1; return; } else { } return; } } void ldv_initialize_ieee80211_ops_30(void) { void *tmp ; { tmp = ldv_init_zalloc(96UL); b43_hw_ops_group0 = (struct ieee80211_hw *)tmp; return; } } void ldv_initialize_ssb_driver_29(void) { void *tmp ; { tmp = ldv_init_zalloc(64UL); b43_ssb_driver_group0 = (struct ssb_device *)tmp; return; } } void ldv_main_exported_22(void) ; void ldv_main_exported_11(void) ; void ldv_main_exported_17(void) ; void ldv_main_exported_12(void) ; void ldv_main_exported_20(void) ; void ldv_main_exported_15(void) ; void ldv_main_exported_14(void) ; void ldv_main_exported_18(void) ; void ldv_main_exported_19(void) ; void ldv_main_exported_10(void) ; void ldv_main_exported_13(void) ; void ldv_main_exported_16(void) ; void ldv_main_exported_24(void) ; void ldv_main_exported_23(void) ; void ldv_main_exported_21(void) ; void ldv_main_exported_25(void) ; void ldv_main_exported_27(void) ; void ldv_main_exported_26(void) ; void ldv_main_exported_28(void) ; int main(void) { struct ieee80211_sta *ldvarg39 ; void *tmp ; struct ieee80211_tx_queue_params *ldvarg51 ; void *tmp___0 ; struct ieee80211_vif *ldvarg60 ; void *tmp___1 ; struct ieee80211_vif *ldvarg41 ; void *tmp___2 ; struct ieee80211_low_level_stats *ldvarg43 ; void *tmp___3 ; u32 ldvarg42 ; struct ieee80211_bss_conf *ldvarg59 ; void *tmp___4 ; enum sta_notify_cmd ldvarg56 ; u64 ldvarg49 ; struct ieee80211_vif *ldvarg62 ; void *tmp___5 ; struct sk_buff *ldvarg50 ; void *tmp___6 ; u64 ldvarg46 ; u32 ldvarg65 ; struct ieee80211_vif *ldvarg57 ; void *tmp___7 ; u32 ldvarg58 ; struct ieee80211_vif *ldvarg37 ; void *tmp___8 ; bool ldvarg53 ; struct ieee80211_key_conf *ldvarg64 ; void *tmp___9 ; struct ieee80211_sta *ldvarg55 ; void *tmp___10 ; struct ieee80211_vif *ldvarg36 ; void *tmp___11 ; struct ieee80211_key_conf *ldvarg40 ; void *tmp___12 ; struct survey_info *ldvarg44 ; void *tmp___13 ; int ldvarg45 ; enum set_key_cmd ldvarg63 ; u16 *ldvarg38 ; void *tmp___14 ; unsigned int ldvarg48 ; struct ieee80211_sta *ldvarg54 ; void *tmp___15 ; struct ieee80211_sta *ldvarg61 ; void *tmp___16 ; u16 ldvarg52 ; unsigned int *ldvarg47 ; void *tmp___17 ; struct ssb_device_id *ldvarg90 ; void *tmp___18 ; int tmp___19 ; int tmp___20 ; int tmp___21 ; int tmp___22 ; { tmp = ldv_init_zalloc(40UL); ldvarg39 = (struct ieee80211_sta *)tmp; tmp___0 = ldv_init_zalloc(8UL); ldvarg51 = (struct ieee80211_tx_queue_params *)tmp___0; tmp___1 = ldv_init_zalloc(88UL); ldvarg60 = (struct ieee80211_vif *)tmp___1; tmp___2 = ldv_init_zalloc(88UL); ldvarg41 = (struct ieee80211_vif *)tmp___2; tmp___3 = ldv_init_zalloc(16UL); ldvarg43 = (struct ieee80211_low_level_stats *)tmp___3; tmp___4 = ldv_init_zalloc(72UL); ldvarg59 = (struct ieee80211_bss_conf *)tmp___4; tmp___5 = ldv_init_zalloc(88UL); ldvarg62 = (struct ieee80211_vif *)tmp___5; tmp___6 = ldv_init_zalloc(240UL); ldvarg50 = (struct sk_buff *)tmp___6; tmp___7 = ldv_init_zalloc(88UL); ldvarg57 = (struct ieee80211_vif *)tmp___7; tmp___8 = ldv_init_zalloc(88UL); ldvarg37 = (struct ieee80211_vif *)tmp___8; tmp___9 = ldv_init_zalloc(12UL); ldvarg64 = (struct ieee80211_key_conf *)tmp___9; tmp___10 = ldv_init_zalloc(40UL); ldvarg55 = (struct ieee80211_sta *)tmp___10; tmp___11 = ldv_init_zalloc(88UL); ldvarg36 = (struct ieee80211_vif *)tmp___11; tmp___12 = ldv_init_zalloc(12UL); ldvarg40 = (struct ieee80211_key_conf *)tmp___12; tmp___13 = ldv_init_zalloc(16UL); ldvarg44 = (struct survey_info *)tmp___13; tmp___14 = ldv_init_zalloc(2UL); ldvarg38 = (u16 *)tmp___14; tmp___15 = ldv_init_zalloc(40UL); ldvarg54 = (struct ieee80211_sta *)tmp___15; tmp___16 = ldv_init_zalloc(40UL); ldvarg61 = (struct ieee80211_sta *)tmp___16; tmp___17 = ldv_init_zalloc(4UL); ldvarg47 = (unsigned int *)tmp___17; tmp___18 = ldv_init_zalloc(6UL); ldvarg90 = (struct ssb_device_id *)tmp___18; ldv_initialize(); ldv_memset((void *)(& ldvarg42), 0, 4UL); ldv_memset((void *)(& ldvarg56), 0, 4UL); ldv_memset((void *)(& ldvarg49), 0, 8UL); ldv_memset((void *)(& ldvarg46), 0, 8UL); ldv_memset((void *)(& ldvarg65), 0, 4UL); ldv_memset((void *)(& ldvarg58), 0, 4UL); ldv_memset((void *)(& ldvarg53), 0, 1UL); ldv_memset((void *)(& ldvarg45), 0, 4UL); ldv_memset((void *)(& ldvarg63), 0, 4UL); ldv_memset((void *)(& ldvarg48), 0, 4UL); ldv_memset((void *)(& ldvarg52), 0, 2UL); ldv_state_variable_11 = 0; ldv_state_variable_21 = 0; work_init_7(); ldv_state_variable_7 = 1; ldv_state_variable_26 = 0; ldv_state_variable_17 = 0; ldv_state_variable_2 = 1; ldv_state_variable_22 = 0; ldv_state_variable_1 = 1; ldv_state_variable_18 = 0; ref_cnt = 0; ldv_state_variable_0 = 1; ldv_state_variable_30 = 0; ldv_state_variable_23 = 0; ldv_state_variable_16 = 0; ldv_state_variable_13 = 0; ldv_state_variable_29 = 0; ldv_state_variable_27 = 0; ldv_state_variable_25 = 0; work_init_6(); ldv_state_variable_6 = 1; ldv_state_variable_28 = 0; work_init_3(); ldv_state_variable_3 = 1; ldv_state_variable_9 = 1; ldv_state_variable_12 = 0; ldv_state_variable_20 = 0; ldv_state_variable_14 = 0; ldv_state_variable_15 = 0; work_init_8(); ldv_state_variable_8 = 1; work_init_4(); ldv_state_variable_4 = 1; ldv_state_variable_24 = 0; ldv_state_variable_19 = 0; ldv_state_variable_10 = 0; work_init_5(); ldv_state_variable_5 = 1; ldv_39732: tmp___19 = __VERIFIER_nondet_int(); switch (tmp___19) { case 0: ; if (ldv_state_variable_11 != 0) { ldv_main_exported_11(); } else { } goto ldv_39669; case 1: ; if (ldv_state_variable_21 != 0) { ldv_main_exported_21(); } else { } goto ldv_39669; case 2: ; if (ldv_state_variable_7 != 0) { invoke_work_7(); } else { } goto ldv_39669; case 3: ; if (ldv_state_variable_26 != 0) { ldv_main_exported_26(); } else { } goto ldv_39669; case 4: ; if (ldv_state_variable_17 != 0) { ldv_main_exported_17(); } else { } goto ldv_39669; case 5: ; if (ldv_state_variable_2 != 0) { choose_interrupt_2(); } else { } goto ldv_39669; case 6: ; if (ldv_state_variable_22 != 0) { ldv_main_exported_22(); } else { } goto ldv_39669; case 7: ; if (ldv_state_variable_1 != 0) { choose_interrupt_1(); } else { } goto ldv_39669; case 8: ; if (ldv_state_variable_18 != 0) { ldv_main_exported_18(); } else { } goto ldv_39669; case 9: ; if (ldv_state_variable_0 != 0) { tmp___20 = __VERIFIER_nondet_int(); switch (tmp___20) { case 0: ; if (ldv_state_variable_0 == 2 && ref_cnt == 0) { b43_exit(); ldv_state_variable_0 = 3; goto ldv_final; } else { } goto ldv_39681; case 1: ; if (ldv_state_variable_0 == 1) { ldv_retval_7 = b43_init(); if (ldv_retval_7 != 0) { ldv_state_variable_0 = 3; goto ldv_final; } else { } if (ldv_retval_7 == 0) { ldv_state_variable_0 = 2; ldv_state_variable_19 = 1; ldv_initialize_b43_debugfs_fops_19(); ldv_state_variable_10 = 1; ldv_initialize_b43_debugfs_fops_10(); ldv_state_variable_24 = 1; ldv_initialize_b43_dma_ops_24(); ldv_state_variable_20 = 1; ldv_initialize_b43_debugfs_fops_20(); ldv_state_variable_15 = 1; ldv_initialize_b43_debugfs_fops_15(); ldv_state_variable_14 = 1; ldv_initialize_b43_debugfs_fops_14(); ldv_state_variable_12 = 1; ldv_initialize_b43_debugfs_fops_12(); ldv_state_variable_28 = 1; ldv_initialize_b43_phy_operations_28(); ldv_state_variable_25 = 1; ldv_initialize_device_attribute_25(); ldv_state_variable_27 = 1; ldv_initialize_b43_phy_operations_27(); ldv_state_variable_29 = 1; ldv_initialize_ssb_driver_29(); ldv_state_variable_16 = 1; ldv_initialize_b43_debugfs_fops_16(); ldv_state_variable_13 = 1; ldv_initialize_b43_debugfs_fops_13(); ldv_state_variable_23 = 1; ldv_initialize_b43_dma_ops_23(); ldv_state_variable_18 = 1; ldv_initialize_b43_debugfs_fops_18(); ldv_state_variable_22 = 1; ldv_initialize_pcmcia_driver_22(); ldv_state_variable_17 = 1; ldv_initialize_b43_debugfs_fops_17(); ldv_state_variable_26 = 1; ldv_initialize_b43_phy_operations_26(); ldv_state_variable_21 = 1; ldv_initialize_sdio_driver_21(); ldv_state_variable_11 = 1; ldv_initialize_b43_debugfs_fops_11(); } else { } } else { } goto ldv_39681; default: ldv_stop(); } ldv_39681: ; } else { } goto ldv_39669; case 10: ; if (ldv_state_variable_30 != 0) { tmp___21 = __VERIFIER_nondet_int(); switch (tmp___21) { case 0: ; if (ldv_state_variable_30 == 1) { ldv_retval_8 = b43_op_start(b43_hw_ops_group0); if (ldv_retval_8 == 0) { ldv_state_variable_30 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_39686; case 1: ; if (ldv_state_variable_30 == 1) { b43_op_config(b43_hw_ops_group0, ldvarg65); ldv_state_variable_30 = 1; } else { } if (ldv_state_variable_30 == 2) { b43_op_config(b43_hw_ops_group0, ldvarg65); ldv_state_variable_30 = 2; } else { } goto ldv_39686; case 2: ; if (ldv_state_variable_30 == 1) { b43_op_get_tsf(b43_hw_ops_group0); ldv_state_variable_30 = 1; } else { } if (ldv_state_variable_30 == 2) { b43_op_get_tsf(b43_hw_ops_group0); ldv_state_variable_30 = 2; } else { } goto ldv_39686; case 3: ; if (ldv_state_variable_30 == 1) { b43_op_set_key(b43_hw_ops_group0, ldvarg63, ldvarg62, ldvarg61, ldvarg64); ldv_state_variable_30 = 1; } else { } if (ldv_state_variable_30 == 2) { b43_op_set_key(b43_hw_ops_group0, ldvarg63, ldvarg62, ldvarg61, ldvarg64); ldv_state_variable_30 = 2; } else { } goto ldv_39686; case 4: ; if (ldv_state_variable_30 == 1) { b43_op_bss_info_changed(b43_hw_ops_group0, ldvarg60, ldvarg59, ldvarg58); ldv_state_variable_30 = 1; } else { } if (ldv_state_variable_30 == 2) { b43_op_bss_info_changed(b43_hw_ops_group0, ldvarg60, ldvarg59, ldvarg58); ldv_state_variable_30 = 2; } else { } goto ldv_39686; case 5: ; if (ldv_state_variable_30 == 1) { b43_op_sta_notify(b43_hw_ops_group0, ldvarg57, ldvarg56, ldvarg55); ldv_state_variable_30 = 1; } else { } if (ldv_state_variable_30 == 2) { b43_op_sta_notify(b43_hw_ops_group0, ldvarg57, ldvarg56, ldvarg55); ldv_state_variable_30 = 2; } else { } goto ldv_39686; case 6: ; if (ldv_state_variable_30 == 1) { b43_op_beacon_set_tim(b43_hw_ops_group0, ldvarg54, (int )ldvarg53); ldv_state_variable_30 = 1; } else { } if (ldv_state_variable_30 == 2) { b43_op_beacon_set_tim(b43_hw_ops_group0, ldvarg54, (int )ldvarg53); ldv_state_variable_30 = 2; } else { } goto ldv_39686; case 7: ; if (ldv_state_variable_30 == 1) { b43_op_conf_tx(b43_hw_ops_group0, (int )ldvarg52, (struct ieee80211_tx_queue_params const *)ldvarg51); ldv_state_variable_30 = 1; } else { } if (ldv_state_variable_30 == 2) { b43_op_conf_tx(b43_hw_ops_group0, (int )ldvarg52, (struct ieee80211_tx_queue_params const *)ldvarg51); ldv_state_variable_30 = 2; } else { } goto ldv_39686; case 8: ; if (ldv_state_variable_30 == 1) { b43_op_sw_scan_complete_notifier(b43_hw_ops_group0); ldv_state_variable_30 = 1; } else { } if (ldv_state_variable_30 == 2) { b43_op_sw_scan_complete_notifier(b43_hw_ops_group0); ldv_state_variable_30 = 2; } else { } goto ldv_39686; case 9: ; if (ldv_state_variable_30 == 2) { b43_op_stop(b43_hw_ops_group0); ldv_state_variable_30 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_39686; case 10: ; if (ldv_state_variable_30 == 1) { b43_op_tx(b43_hw_ops_group0, ldvarg50); ldv_state_variable_30 = 1; } else { } if (ldv_state_variable_30 == 2) { b43_op_tx(b43_hw_ops_group0, ldvarg50); ldv_state_variable_30 = 2; } else { } goto ldv_39686; case 11: ; if (ldv_state_variable_30 == 1) { b43_op_set_tsf(b43_hw_ops_group0, ldvarg49); ldv_state_variable_30 = 1; } else { } if (ldv_state_variable_30 == 2) { b43_op_set_tsf(b43_hw_ops_group0, ldvarg49); ldv_state_variable_30 = 2; } else { } goto ldv_39686; case 12: ; if (ldv_state_variable_30 == 1) { b43_op_configure_filter(b43_hw_ops_group0, ldvarg48, ldvarg47, ldvarg46); ldv_state_variable_30 = 1; } else { } if (ldv_state_variable_30 == 2) { b43_op_configure_filter(b43_hw_ops_group0, ldvarg48, ldvarg47, ldvarg46); ldv_state_variable_30 = 2; } else { } goto ldv_39686; case 13: ; if (ldv_state_variable_30 == 1) { b43_op_get_survey(b43_hw_ops_group0, ldvarg45, ldvarg44); ldv_state_variable_30 = 1; } else { } if (ldv_state_variable_30 == 2) { b43_op_get_survey(b43_hw_ops_group0, ldvarg45, ldvarg44); ldv_state_variable_30 = 2; } else { } goto ldv_39686; case 14: ; if (ldv_state_variable_30 == 1) { b43_op_get_stats(b43_hw_ops_group0, ldvarg43); ldv_state_variable_30 = 1; } else { } if (ldv_state_variable_30 == 2) { b43_op_get_stats(b43_hw_ops_group0, ldvarg43); ldv_state_variable_30 = 2; } else { } goto ldv_39686; case 15: ; if (ldv_state_variable_30 == 1) { b43_op_update_tkip_key(b43_hw_ops_group0, ldvarg41, ldvarg40, ldvarg39, ldvarg42, ldvarg38); ldv_state_variable_30 = 1; } else { } if (ldv_state_variable_30 == 2) { b43_op_update_tkip_key(b43_hw_ops_group0, ldvarg41, ldvarg40, ldvarg39, ldvarg42, ldvarg38); ldv_state_variable_30 = 2; } else { } goto ldv_39686; case 16: ; if (ldv_state_variable_30 == 1) { b43_rfkill_poll(b43_hw_ops_group0); ldv_state_variable_30 = 1; } else { } if (ldv_state_variable_30 == 2) { b43_rfkill_poll(b43_hw_ops_group0); ldv_state_variable_30 = 2; } else { } goto ldv_39686; case 17: ; if (ldv_state_variable_30 == 1) { b43_op_sw_scan_start_notifier(b43_hw_ops_group0); ldv_state_variable_30 = 1; } else { } if (ldv_state_variable_30 == 2) { b43_op_sw_scan_start_notifier(b43_hw_ops_group0); ldv_state_variable_30 = 2; } else { } goto ldv_39686; case 18: ; if (ldv_state_variable_30 == 1) { b43_op_add_interface(b43_hw_ops_group0, ldvarg37); ldv_state_variable_30 = 1; } else { } if (ldv_state_variable_30 == 2) { b43_op_add_interface(b43_hw_ops_group0, ldvarg37); ldv_state_variable_30 = 2; } else { } goto ldv_39686; case 19: ; if (ldv_state_variable_30 == 1) { b43_op_remove_interface(b43_hw_ops_group0, ldvarg36); ldv_state_variable_30 = 1; } else { } if (ldv_state_variable_30 == 2) { b43_op_remove_interface(b43_hw_ops_group0, ldvarg36); ldv_state_variable_30 = 2; } else { } goto ldv_39686; default: ldv_stop(); } ldv_39686: ; } else { } goto ldv_39669; case 11: ; if (ldv_state_variable_23 != 0) { ldv_main_exported_23(); } else { } goto ldv_39669; case 12: ; if (ldv_state_variable_16 != 0) { ldv_main_exported_16(); } else { } goto ldv_39669; case 13: ; if (ldv_state_variable_13 != 0) { ldv_main_exported_13(); } else { } goto ldv_39669; case 14: ; if (ldv_state_variable_29 != 0) { tmp___22 = __VERIFIER_nondet_int(); switch (tmp___22) { case 0: ; if (ldv_state_variable_29 == 1) { ldv_retval_11 = b43_probe(b43_ssb_driver_group0, (struct ssb_device_id const *)ldvarg90); if (ldv_retval_11 == 0) { ldv_state_variable_29 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_39712; case 1: ; if (ldv_state_variable_29 == 2) { b43_remove(b43_ssb_driver_group0); ldv_state_variable_29 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_39712; default: ldv_stop(); } ldv_39712: ; } else { } goto ldv_39669; case 15: ; if (ldv_state_variable_27 != 0) { ldv_main_exported_27(); } else { } goto ldv_39669; case 16: ; if (ldv_state_variable_25 != 0) { ldv_main_exported_25(); } else { } goto ldv_39669; case 17: ; if (ldv_state_variable_6 != 0) { invoke_work_6(); } else { } goto ldv_39669; case 18: ; if (ldv_state_variable_28 != 0) { ldv_main_exported_28(); } else { } goto ldv_39669; case 19: ; if (ldv_state_variable_3 != 0) { invoke_work_3(); } else { } goto ldv_39669; case 20: ; if (ldv_state_variable_9 != 0) { choose_timer_9(ldv_timer_list_9); } else { } goto ldv_39669; case 21: ; if (ldv_state_variable_12 != 0) { ldv_main_exported_12(); } else { } goto ldv_39669; case 22: ; if (ldv_state_variable_20 != 0) { ldv_main_exported_20(); } else { } goto ldv_39669; case 23: ; if (ldv_state_variable_14 != 0) { ldv_main_exported_14(); } else { } goto ldv_39669; case 24: ; if (ldv_state_variable_15 != 0) { ldv_main_exported_15(); } else { } goto ldv_39669; case 25: ; goto ldv_39669; case 26: ; if (ldv_state_variable_4 != 0) { invoke_work_4(); } else { } goto ldv_39669; case 27: ; if (ldv_state_variable_24 != 0) { ldv_main_exported_24(); } else { } goto ldv_39669; case 28: ; if (ldv_state_variable_19 != 0) { ldv_main_exported_19(); } else { } goto ldv_39669; case 29: ; if (ldv_state_variable_10 != 0) { ldv_main_exported_10(); } else { } goto ldv_39669; case 30: ; if (ldv_state_variable_5 != 0) { invoke_work_5(); } else { } goto ldv_39669; default: ldv_stop(); } ldv_39669: ; goto ldv_39732; ldv_final: ldv_check_final_state(); return 0; } } int ldv_del_timer_sync_1(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type ldv_func_res ; int tmp ; { tmp = del_timer_sync(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_9(ldv_func_arg1); return (ldv_func_res); } } int ldv_del_timer_2(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___0 ldv_func_res ; int tmp ; { tmp = del_timer(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_9(ldv_func_arg1); return (ldv_func_res); } } int ldv_request_threaded_irq_3(unsigned int ldv_func_arg1 , irqreturn_t (*handler)(int , void * ) , irqreturn_t (*thread_fn)(int , void * ) , unsigned long ldv_func_arg4 , char const *ldv_func_arg5 , void *ldv_func_arg6 ) { ldv_func_ret_type___1 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = request_threaded_irq(ldv_func_arg1, handler, thread_fn, ldv_func_arg4, ldv_func_arg5, ldv_func_arg6); ldv_func_res = tmp; tmp___0 = reg_check_2(handler, thread_fn); if (tmp___0 != 0 && ldv_func_res >= 0) { activate_suitable_irq_2((int )ldv_func_arg1, ldv_func_arg6); } else { } return (ldv_func_res); } } void ldv_free_irq_4(unsigned int ldv_func_arg1 , void *ldv_func_arg2 ) { { free_irq(ldv_func_arg1, ldv_func_arg2); disable_suitable_irq_2((int )ldv_func_arg1, ldv_func_arg2); return; } } int ldv_request_threaded_irq_5(unsigned int ldv_func_arg1 , irqreturn_t (*handler)(int , void * ) , irqreturn_t (*thread_fn)(int , void * ) , unsigned long ldv_func_arg4 , char const *ldv_func_arg5 , void *ldv_func_arg6 ) { ldv_func_ret_type___2 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = request_threaded_irq(ldv_func_arg1, handler, thread_fn, ldv_func_arg4, ldv_func_arg5, ldv_func_arg6); ldv_func_res = tmp; tmp___0 = reg_check_2(handler, thread_fn); if (tmp___0 != 0 && ldv_func_res >= 0) { activate_suitable_irq_2((int )ldv_func_arg1, ldv_func_arg6); } else { } return (ldv_func_res); } } void ldv_ieee80211_free_hw_6(struct ieee80211_hw *ldv_func_arg1 ) { { ieee80211_free_hw(ldv_func_arg1); if ((unsigned long )b43_hw_ops_group0 == (unsigned long )ldv_func_arg1) { ldv_state_variable_30 = 0; } else { } return; } } struct ieee80211_hw *ldv_ieee80211_alloc_hw_7(size_t ldv_func_arg1 , struct ieee80211_ops const *ldv_func_arg2 ) { ldv_func_ret_type___3 ldv_func_res ; struct ieee80211_hw *tmp ; { tmp = ieee80211_alloc_hw(ldv_func_arg1, ldv_func_arg2); ldv_func_res = tmp; if ((unsigned long )ldv_func_res != (unsigned long )((ldv_func_ret_type___3 )0)) { ldv_state_variable_30 = 1; ldv_initialize_ieee80211_ops_30(); b43_hw_ops_group0 = ldv_func_res; } else { } return (ldv_func_res); } } int ldv_del_timer_16(struct timer_list *ldv_func_arg1 ) ; int ldv_del_timer_sync_15(struct timer_list *ldv_func_arg1 ) ; int ldv_request_threaded_irq_17(unsigned int ldv_func_arg1 , irqreturn_t (*handler)(int , void * ) , irqreturn_t (*thread_fn)(int , void * ) , unsigned long ldv_func_arg4 , char const *ldv_func_arg5 , void *ldv_func_arg6 ) ; u16 b43_phy_read(struct b43_wldev *dev , u16 reg ) ; void b43_phy_write(struct b43_wldev *dev , u16 reg , u16 value ) ; u16 b43_ofdmtab_read16(struct b43_wldev *dev , u16 table , u16 offset ) ; void b43_ofdmtab_write16(struct b43_wldev *dev , u16 table , u16 offset , u16 value ) ; u32 b43_ofdmtab_read32(struct b43_wldev *dev , u16 table , u16 offset ) ; void b43_ofdmtab_write32(struct b43_wldev *dev , u16 table , u16 offset , u32 value ) ; u16 b43_gtab_read(struct b43_wldev *dev , u16 table , u16 offset ) ; void b43_gtab_write(struct b43_wldev *dev , u16 table , u16 offset , u16 value ) ; u32 const b43_tab_rotor[53U] ; u32 const b43_tab_retard[53U] ; u16 const b43_tab_finefreqa[256U] ; u16 const b43_tab_finefreqg[256U] ; u16 const b43_tab_noisea2[8U] ; u16 const b43_tab_noisea3[8U] ; u16 const b43_tab_noiseg1[8U] ; u16 const b43_tab_noiseg2[8U] ; u16 const b43_tab_noisescalea2[27U] ; u16 const b43_tab_noisescalea3[27U] ; u16 const b43_tab_noisescaleg1[27U] ; u16 const b43_tab_noisescaleg2[27U] ; u16 const b43_tab_noisescaleg3[27U] ; u16 const b43_tab_sigmasqr1[53U] ; u16 const b43_tab_sigmasqr2[53U] ; u16 const b43_tab_rssiagc1[16U] ; u16 const b43_tab_rssiagc2[48U] ; u32 const b43_tab_rotor[53U] = { 4273553405U, 4274405373U, 4275191805U, 4276043773U, 4276895742U, 4277682174U, 4278534142U, 4279320574U, 4280172542U, 4280958975U, 4281810943U, 4282662911U, 4283449343U, 4284301311U, 4285087743U, 4285939711U, 4286726144U, 4287578112U, 4288364544U, 4289216512U, 4290068480U, 4290854912U, 4291706880U, 4292493312U, 4293345280U, 4294131712U, 16384U, 868352U, 1654784U, 2506752U, 3293184U, 4145152U, 4931584U, 5783552U, 6635520U, 7421952U, 8273920U, 9060351U, 9912319U, 10698751U, 11550719U, 12337151U, 13189119U, 14041087U, 14827518U, 15679486U, 16465918U, 17317886U, 18104318U, 18956285U, 19808253U, 20594685U, 21446653U}; u32 const b43_tab_retard[53U] = { 3683896199U, 3597061988U, 3523072856U, 3450263590U, 3392724383U, 3341410996U, 3295275150U, 3261787691U, 3235837036U, 3228826210U, 3223126229U, 3228960579U, 3243642142U, 3269792617U, 3303872767U, 3349946071U, 3408405426U, 3472500953U, 3539348799U, 3619369367U, 3706008936U, 3791534197U, 3889249077U, 3982900533U, 4087037636U, 4186849191U, 16384U, 108150695U, 207961796U, 312098101U, 405748533U, 503462005U, 588985704U, 675623319U, 755641663U, 822487257U, 886580146U, 945037015U, 991107327U, 1025184617U, 1051331870U, 1066010435U, 1071841493U, 1066269282U, 1059255404U, 1033301547U, 999811214U, 953672372U, 902356383U, 844814374U, 772002648U, 698011492U, 611175303U}; u16 const b43_tab_finefreqa[256U] = { 130U, 130U, 258U, 386U, 514U, 642U, 770U, 898U, 1026U, 1154U, 1282U, 1410U, 1506U, 1634U, 1762U, 1890U, 2018U, 2114U, 2242U, 2370U, 2498U, 2594U, 2722U, 2818U, 2946U, 3042U, 3170U, 3266U, 3394U, 3490U, 3586U, 3682U, 3810U, 3906U, 4002U, 4098U, 4194U, 4290U, 4386U, 4482U, 4578U, 4674U, 4770U, 4834U, 4930U, 5026U, 5122U, 5186U, 5282U, 5346U, 5442U, 5506U, 5602U, 5666U, 5730U, 5825U, 5889U, 5953U, 6017U, 6113U, 6177U, 6241U, 6305U, 6369U, 6433U, 6497U, 6561U, 6625U, 6689U, 6753U, 6817U, 6849U, 6913U, 6977U, 7041U, 7073U, 7137U, 7201U, 7233U, 7297U, 7329U, 7393U, 7425U, 7489U, 7521U, 7585U, 7617U, 7681U, 7713U, 7777U, 7809U, 7841U, 7905U, 7937U, 7969U, 8001U, 8065U, 8097U, 8129U, 8161U, 8193U, 8257U, 8289U, 8321U, 8353U, 8385U, 8417U, 8449U, 8481U, 8513U, 8545U, 8577U, 8609U, 8641U, 8673U, 8705U, 8737U, 8769U, 8801U, 8833U, 8865U, 8897U, 8897U, 8929U, 8961U, 8993U, 9025U, 9057U, 9057U, 9089U, 9121U, 9153U, 9185U, 9185U, 9217U, 9249U, 9281U, 9281U, 9313U, 9345U, 9345U, 9377U, 9409U, 9409U, 9441U, 9473U, 9473U, 9505U, 9537U, 9537U, 9569U, 9569U, 9601U, 9633U, 9633U, 9665U, 9665U, 9697U, 9729U, 9729U, 9761U, 9761U, 9793U, 9793U, 9825U, 9825U, 9857U, 9857U, 9889U, 9889U, 9921U, 9921U, 9953U, 9953U, 9985U, 9985U, 10017U, 10017U, 10048U, 10048U, 10080U, 10080U, 10112U, 10112U, 10112U, 10144U, 10144U, 10176U, 10176U, 10208U, 10208U, 10208U, 10240U, 10240U, 10272U, 10272U, 10272U, 10304U, 10304U, 10304U, 10336U, 10336U, 10368U, 10368U, 10368U, 10400U, 10400U, 10400U, 10432U, 10432U, 10432U, 10464U, 10464U, 10464U, 10496U, 10496U, 10496U, 10528U, 10528U, 10528U, 10560U, 10560U, 10560U, 10592U, 10592U, 10592U, 10592U, 10624U, 10624U, 10624U, 10656U, 10656U, 10656U, 10656U, 10688U, 10688U, 10688U, 10720U, 10720U, 10720U, 10720U, 10752U, 10752U, 10752U, 10752U, 10784U, 10784U, 10784U, 10784U, 10816U, 10816U, 10816U, 10816U, 10848U, 10848U, 10848U}; u16 const b43_tab_finefreqg[256U] = { 137U, 745U, 1033U, 1257U, 1449U, 1641U, 1801U, 1929U, 2089U, 2217U, 2345U, 2441U, 2569U, 2665U, 2761U, 2857U, 2985U, 3049U, 3145U, 3241U, 3337U, 3433U, 3497U, 3593U, 3689U, 3753U, 3849U, 3913U, 4009U, 4073U, 4137U, 4233U, 4297U, 4361U, 4457U, 4521U, 4585U, 4649U, 4745U, 4809U, 4873U, 4937U, 5001U, 5065U, 5129U, 5193U, 5289U, 5353U, 5417U, 5481U, 5545U, 5609U, 5673U, 5737U, 5801U, 5864U, 5928U, 5992U, 6056U, 6120U, 6184U, 6248U, 6312U, 6376U, 6440U, 6504U, 6568U, 6632U, 6696U, 6760U, 6824U, 6888U, 6952U, 7016U, 7080U, 7144U, 7208U, 7272U, 7336U, 7400U, 7464U, 7528U, 7624U, 7688U, 7752U, 7816U, 7880U, 7944U, 8008U, 8072U, 8168U, 8232U, 8296U, 8360U, 8456U, 8520U, 8584U, 8648U, 8744U, 8808U, 8904U, 8968U, 9032U, 9128U, 9192U, 9288U, 9384U, 9448U, 9544U, 9640U, 9736U, 9832U, 9928U, 10024U, 10119U, 10215U, 10311U, 10439U, 10567U, 10663U, 10791U, 10951U, 11079U, 11239U, 11431U, 11623U, 11847U, 12135U, 12871U, 13606U, 13894U, 14118U, 14342U, 14502U, 14662U, 14822U, 14950U, 15078U, 15206U, 15302U, 15429U, 15525U, 15621U, 15749U, 15845U, 15941U, 16037U, 16101U, 16197U, 16293U, 16389U, 16453U, 16549U, 16613U, 16709U, 16773U, 16869U, 16933U, 16997U, 17093U, 17157U, 17221U, 17317U, 17381U, 17444U, 17508U, 17604U, 17668U, 17732U, 17796U, 17860U, 17924U, 17988U, 18084U, 18148U, 18212U, 18276U, 18340U, 18404U, 18468U, 18532U, 18596U, 18660U, 18724U, 18788U, 18852U, 18916U, 18980U, 19044U, 19108U, 19172U, 19235U, 19299U, 19363U, 19427U, 19491U, 19555U, 19619U, 19683U, 19747U, 19811U, 19875U, 19939U, 20003U, 20067U, 20131U, 20195U, 20259U, 20323U, 20419U, 20483U, 20547U, 20611U, 20675U, 20739U, 20803U, 20867U, 20962U, 21026U, 21090U, 21154U, 21218U, 21314U, 21378U, 21442U, 21506U, 21602U, 21666U, 21762U, 21826U, 21922U, 21986U, 22082U, 22146U, 22242U, 22306U, 22402U, 22497U, 22593U, 22689U, 22785U, 22881U, 22977U, 23073U, 23201U, 23297U, 23425U, 23521U, 23649U, 23809U, 23936U, 24096U, 24288U, 24480U, 24704U, 25024U}; u16 const b43_tab_noisea2[8U] = { 1U, 1U, 1U, 65534U, 65534U, 16383U, 4096U, 915U}; u16 const b43_tab_noisea3[8U] = { 24158U, 24158U, 24158U, 16200U, 19532U, 19532U, 19532U, 11574U}; u16 const b43_tab_noiseg1[8U] = { 316U, 501U, 794U, 1585U, 1U, 1U, 1U, 1U}; u16 const b43_tab_noiseg2[8U] = { 21636U, 15424U, 0U, 0U, 0U, 0U, 0U, 0U}; u16 const b43_tab_noisescalea2[27U] = { 26471U, 26471U, 26471U, 26471U, 26471U, 26471U, 26471U, 26471U, 26471U, 26471U, 26471U, 26471U, 26471U, 26368U, 26471U, 26471U, 26471U, 26471U, 26471U, 26471U, 26471U, 26471U, 26471U, 26471U, 26471U, 26471U, 103U}; u16 const b43_tab_noisescalea3[27U] = { 8995U, 8995U, 8995U, 8995U, 8995U, 8995U, 8995U, 8995U, 8995U, 8995U, 8995U, 8995U, 8995U, 8960U, 8995U, 8995U, 8995U, 8995U, 8995U, 8995U, 8995U, 8995U, 8995U, 8995U, 8995U, 8995U, 35U}; u16 const b43_tab_noisescaleg1[27U] = { 27767U, 20834U, 15168U, 13109U, 12077U, 10794U, 9511U, 7969U, 6685U, 5913U, 5654U, 5140U, 5140U, 5120U, 5140U, 5652U, 5910U, 6681U, 7965U, 9505U, 10791U, 12074U, 13101U, 15157U, 20800U, 27746U, 119U}; u16 const b43_tab_noisescaleg2[27U] = { 55517U, 52180U, 48320U, 46775U, 45744U, 44461U, 42921U, 40865U, 38555U, 37269U, 36751U, 35466U, 35466U, 35328U, 35466U, 36746U, 37263U, 38549U, 40859U, 42913U, 44457U, 45741U, 46768U, 48311U, 52160U, 55508U, 221U}; u16 const b43_tab_noisescaleg3[27U] = { 42148U, 42148U, 42148U, 42148U, 42148U, 42148U, 42148U, 42148U, 42148U, 42148U, 42148U, 42148U, 42148U, 41984U, 42148U, 42148U, 42148U, 42148U, 42148U, 42148U, 42148U, 42148U, 42148U, 42148U, 42148U, 42148U, 164U}; u16 const b43_tab_sigmasqr1[53U] = { 122U, 117U, 113U, 108U, 103U, 99U, 94U, 89U, 84U, 80U, 75U, 70U, 66U, 61U, 61U, 61U, 61U, 61U, 61U, 61U, 61U, 61U, 61U, 61U, 61U, 61U, 0U, 61U, 61U, 61U, 61U, 61U, 61U, 61U, 61U, 61U, 61U, 61U, 61U, 61U, 66U, 70U, 75U, 80U, 84U, 89U, 94U, 99U, 103U, 108U, 113U, 117U, 122U}; u16 const b43_tab_sigmasqr2[53U] = { 222U, 220U, 218U, 216U, 214U, 212U, 210U, 207U, 205U, 202U, 199U, 196U, 193U, 190U, 190U, 190U, 190U, 190U, 190U, 190U, 190U, 190U, 190U, 190U, 190U, 190U, 0U, 190U, 190U, 190U, 190U, 190U, 190U, 190U, 190U, 190U, 190U, 190U, 190U, 190U, 193U, 196U, 199U, 202U, 205U, 207U, 210U, 212U, 214U, 216U, 218U, 220U, 222U}; u16 const b43_tab_rssiagc1[16U] = { 65528U, 65528U, 65528U, 65528U, 65528U, 65529U, 65532U, 65534U, 65528U, 65528U, 65528U, 65528U, 65528U, 65528U, 65528U, 65528U}; u16 const b43_tab_rssiagc2[48U] = { 2080U, 2080U, 2336U, 3128U, 2080U, 2080U, 2080U, 2080U, 2080U, 2080U, 2336U, 2616U, 2080U, 2080U, 2080U, 2080U, 2080U, 2080U, 2336U, 2616U, 2080U, 2080U, 2080U, 2080U, 2080U, 2080U, 2336U, 2616U, 2080U, 2080U, 2080U, 2080U, 2080U, 2080U, 2336U, 2616U, 2080U, 2080U, 2080U, 2080U, 2080U, 2080U, 2336U, 2616U, 2080U, 2080U, 2080U, 2080U}; __inline static void assert_sizes(void) { { return; } } u16 b43_ofdmtab_read16(struct b43_wldev *dev , u16 table , u16 offset ) { struct b43_phy_g *gphy ; u16 addr ; u16 tmp ; { gphy = dev->phy.__annonCompField40.g; addr = (int )table + (int )offset; if ((unsigned int )gphy->ofdmtab_addr_direction != 1U || (int )addr + -1 != (int )gphy->ofdmtab_addr) { b43_phy_write(dev, 1138, (int )addr); gphy->ofdmtab_addr_direction = 1; } else { } gphy->ofdmtab_addr = addr; tmp = b43_phy_read(dev, 1139); return (tmp); assert_sizes(); } } void b43_ofdmtab_write16(struct b43_wldev *dev , u16 table , u16 offset , u16 value ) { struct b43_phy_g *gphy ; u16 addr ; { gphy = dev->phy.__annonCompField40.g; addr = (int )table + (int )offset; if ((unsigned int )gphy->ofdmtab_addr_direction != 2U || (int )addr + -1 != (int )gphy->ofdmtab_addr) { b43_phy_write(dev, 1138, (int )addr); gphy->ofdmtab_addr_direction = 2; } else { } gphy->ofdmtab_addr = addr; b43_phy_write(dev, 1139, (int )value); return; } } u32 b43_ofdmtab_read32(struct b43_wldev *dev , u16 table , u16 offset ) { struct b43_phy_g *gphy ; u32 ret ; u16 addr ; u16 tmp ; u16 tmp___0 ; { gphy = dev->phy.__annonCompField40.g; addr = (int )table + (int )offset; if ((unsigned int )gphy->ofdmtab_addr_direction != 1U || (int )addr + -1 != (int )gphy->ofdmtab_addr) { b43_phy_write(dev, 1138, (int )addr); gphy->ofdmtab_addr_direction = 1; } else { } gphy->ofdmtab_addr = addr; tmp = b43_phy_read(dev, 1140); ret = (u32 )tmp; ret = ret << 16; tmp___0 = b43_phy_read(dev, 1139); ret = (u32 )tmp___0 | ret; return (ret); } } void b43_ofdmtab_write32(struct b43_wldev *dev , u16 table , u16 offset , u32 value ) { struct b43_phy_g *gphy ; u16 addr ; { gphy = dev->phy.__annonCompField40.g; addr = (int )table + (int )offset; if ((unsigned int )gphy->ofdmtab_addr_direction != 2U || (int )addr + -1 != (int )gphy->ofdmtab_addr) { b43_phy_write(dev, 1138, (int )addr); gphy->ofdmtab_addr_direction = 2; } else { } gphy->ofdmtab_addr = addr; b43_phy_write(dev, 1139, (int )((u16 )value)); b43_phy_write(dev, 1140, (int )((u16 )(value >> 16))); return; } } u16 b43_gtab_read(struct b43_wldev *dev , u16 table , u16 offset ) { u16 tmp ; { b43_phy_write(dev, 2051, (int )table + (int )offset); tmp = b43_phy_read(dev, 2052); return (tmp); } } void b43_gtab_write(struct b43_wldev *dev , u16 table , u16 offset , u16 value ) { { b43_phy_write(dev, 2051, (int )table + (int )offset); b43_phy_write(dev, 2052, (int )value); return; } } int ldv_del_timer_sync_15(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type ldv_func_res ; int tmp ; { tmp = del_timer_sync(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_9(ldv_func_arg1); return (ldv_func_res); } } int ldv_del_timer_16(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___0 ldv_func_res ; int tmp ; { tmp = del_timer(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_9(ldv_func_arg1); return (ldv_func_res); } } int ldv_request_threaded_irq_17(unsigned int ldv_func_arg1 , irqreturn_t (*handler)(int , void * ) , irqreturn_t (*thread_fn)(int , void * ) , unsigned long ldv_func_arg4 , char const *ldv_func_arg5 , void *ldv_func_arg6 ) { ldv_func_ret_type___1 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = request_threaded_irq(ldv_func_arg1, handler, thread_fn, ldv_func_arg4, ldv_func_arg5, ldv_func_arg6); ldv_func_res = tmp; tmp___0 = reg_check_2(handler, thread_fn); if (tmp___0 != 0 && ldv_func_res >= 0) { activate_suitable_irq_2((int )ldv_func_arg1, ldv_func_arg6); } else { } return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; extern void dump_stack(void) ; int ldv_del_timer_22(struct timer_list *ldv_func_arg1 ) ; int ldv_del_timer_sync_21(struct timer_list *ldv_func_arg1 ) ; extern unsigned long round_jiffies(unsigned long ) ; bool b43_has_hardware_pctl(struct b43_wldev *dev ) ; void b43_phy_copy(struct b43_wldev *dev , u16 destreg , u16 srcreg ) ; void b43_phy_mask(struct b43_wldev *dev , u16 offset , u16 mask ) ; void b43_phy_set(struct b43_wldev *dev , u16 offset , u16 set ) ; void b43_phy_maskset(struct b43_wldev *dev , u16 offset , u16 mask , u16 set ) ; u16 b43_radio_read(struct b43_wldev *dev , u16 reg ) ; void b43_radio_mask(struct b43_wldev *dev , u16 offset , u16 mask ) ; void b43_radio_set(struct b43_wldev *dev , u16 offset , u16 set ) ; void b43_radio_maskset(struct b43_wldev *dev , u16 offset , u16 mask , u16 set ) ; void b43_radio_lock(struct b43_wldev *dev ) ; void b43_radio_unlock(struct b43_wldev *dev ) ; void b43_phy_lock(struct b43_wldev *dev ) ; void b43_phy_unlock(struct b43_wldev *dev ) ; int b43_phy_shm_tssi_read(struct b43_wldev *dev , u16 shm_offset ) ; void b43_phyop_switch_analog_generic(struct b43_wldev *dev , bool on ) ; struct b43_c32 b43_cordic(int theta ) ; struct b43_phy_operations const b43_phyops_a ; struct b43_phy_operations const b43_phyops_g ; struct b43_phy_operations const b43_phyops_lp ; int ldv_request_threaded_irq_23(unsigned int ldv_func_arg1 , irqreturn_t (*handler)(int , void * ) , irqreturn_t (*thread_fn)(int , void * ) , unsigned long ldv_func_arg4 , char const *ldv_func_arg5 , void *ldv_func_arg6 ) ; int b43_phy_allocate(struct b43_wldev *dev ) { struct b43_phy *phy ; int err ; int __ret_warn_on ; long tmp ; long tmp___0 ; { phy = & dev->phy; phy->ops = (struct b43_phy_operations const *)0; switch ((int )phy->type) { case 0: phy->ops = & b43_phyops_a; goto ldv_37142; case 2: phy->ops = & b43_phyops_g; goto ldv_37142; case 4: ; goto ldv_37142; case 5: phy->ops = & b43_phyops_lp; goto ldv_37142; } ldv_37142: __ret_warn_on = (unsigned long )phy->ops == (unsigned long )((struct b43_phy_operations const *)0); tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_common.c", 63); } else { } tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { return (-19); } else { } err = (*((phy->ops)->allocate))(dev); if (err != 0) { phy->ops = (struct b43_phy_operations const *)0; } else { } return (err); } } void b43_phy_free(struct b43_wldev *dev ) { { (*((dev->phy.ops)->free))(dev); dev->phy.ops = (struct b43_phy_operations const *)0; return; } } int b43_phy_init(struct b43_wldev *dev ) { struct b43_phy *phy ; struct b43_phy_operations const *ops ; int err ; unsigned int tmp ; { phy = & dev->phy; ops = phy->ops; phy->channel = (*(ops->get_default_chan))(dev); (*(ops->software_rfkill))(dev, 0); err = (*(ops->init))(dev); if (err != 0) { b43err(dev->wl, "PHY init failed\n"); goto err_block_rf; } else { } tmp = (*(ops->get_default_chan))(dev); err = b43_switch_channel(dev, tmp); if (err != 0) { b43err(dev->wl, "PHY init: Channel switch to default failed\n"); goto err_phy_exit; } else { } return (0); err_phy_exit: ; if ((unsigned long )ops->exit != (unsigned long )((void (*/* const */)(struct b43_wldev * ))0)) { (*(ops->exit))(dev); } else { } err_block_rf: (*(ops->software_rfkill))(dev, 1); return (err); } } void b43_phy_exit(struct b43_wldev *dev ) { struct b43_phy_operations const *ops ; { ops = dev->phy.ops; (*(ops->software_rfkill))(dev, 1); if ((unsigned long )ops->exit != (unsigned long )((void (*/* const */)(struct b43_wldev * ))0)) { (*(ops->exit))(dev); } else { } return; } } bool b43_has_hardware_pctl(struct b43_wldev *dev ) { bool tmp ; { if (! dev->phy.hardware_power_control) { return (0); } else { } if ((unsigned long )(dev->phy.ops)->supports_hwpctl == (unsigned long )((bool (*/* const */)(struct b43_wldev * ))0)) { return (0); } else { } tmp = (*((dev->phy.ops)->supports_hwpctl))(dev); return (tmp); } } void b43_radio_lock(struct b43_wldev *dev ) { u32 macctl ; int __ret_warn_on ; long tmp ; { __ret_warn_on = (int )dev->phy.radio_locked; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_common.c", 135); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); dev->phy.radio_locked = 1; macctl = b43_read32(dev, 288); macctl = macctl | 524288U; b43_write32(dev, 288, macctl); b43_read32(dev, 288); __const_udelay(42950UL); return; } } void b43_radio_unlock(struct b43_wldev *dev ) { u32 macctl ; int __ret_warn_on ; long tmp ; { __ret_warn_on = ! dev->phy.radio_locked; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_common.c", 153); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); dev->phy.radio_locked = 0; b43_read16(dev, 992); macctl = b43_read32(dev, 288); macctl = macctl & 4294443007U; b43_write32(dev, 288, macctl); return; } } void b43_phy_lock(struct b43_wldev *dev ) { int __ret_warn_on ; long tmp ; int __ret_warn_on___0 ; long tmp___0 ; int tmp___1 ; { __ret_warn_on = (int )dev->phy.phy_locked; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_common.c", 168); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); dev->phy.phy_locked = 1; __ret_warn_on___0 = (unsigned int )(dev->dev)->id.revision <= 2U; tmp___0 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_common.c", 171); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); tmp___1 = b43_is_mode(dev->wl, 3); if (tmp___1 == 0) { b43_power_saving_ctl_bits(dev, 4U); } else { } return; } } void b43_phy_unlock(struct b43_wldev *dev ) { int __ret_warn_on ; long tmp ; int __ret_warn_on___0 ; long tmp___0 ; int tmp___1 ; { __ret_warn_on = ! dev->phy.phy_locked; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_common.c", 180); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); dev->phy.phy_locked = 0; __ret_warn_on___0 = (unsigned int )(dev->dev)->id.revision <= 2U; tmp___0 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_common.c", 183); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); tmp___1 = b43_is_mode(dev->wl, 3); if (tmp___1 == 0) { b43_power_saving_ctl_bits(dev, 0U); } else { } return; } } __inline static void assert_mac_suspended(struct b43_wldev *dev ) { int tmp ; { tmp = atomic_read((atomic_t const *)(& dev->__init_status)); if (tmp > 0 && dev->mac_suspended <= 0) { b43dbg(dev->wl, "PHY/RADIO register access with enabled MAC.\n"); dump_stack(); } else { } return; } } u16 b43_radio_read(struct b43_wldev *dev , u16 reg ) { u16 tmp ; { assert_mac_suspended(dev); tmp = (*((dev->phy.ops)->radio_read))(dev, (int )reg); return (tmp); } } void b43_radio_write(struct b43_wldev *dev , u16 reg , u16 value ) { { assert_mac_suspended(dev); (*((dev->phy.ops)->radio_write))(dev, (int )reg, (int )value); return; } } void b43_radio_mask(struct b43_wldev *dev , u16 offset , u16 mask ) { u16 tmp ; { tmp = b43_radio_read(dev, (int )offset); b43_radio_write(dev, (int )offset, (int )tmp & (int )mask); return; } } void b43_radio_set(struct b43_wldev *dev , u16 offset , u16 set ) { u16 tmp ; { tmp = b43_radio_read(dev, (int )offset); b43_radio_write(dev, (int )offset, (int )tmp | (int )set); return; } } void b43_radio_maskset(struct b43_wldev *dev , u16 offset , u16 mask , u16 set ) { u16 tmp ; { tmp = b43_radio_read(dev, (int )offset); b43_radio_write(dev, (int )offset, ((int )tmp & (int )mask) | (int )set); return; } } u16 b43_phy_read(struct b43_wldev *dev , u16 reg ) { u16 tmp ; { assert_mac_suspended(dev); tmp = (*((dev->phy.ops)->phy_read))(dev, (int )reg); return (tmp); } } void b43_phy_write(struct b43_wldev *dev , u16 reg , u16 value ) { { assert_mac_suspended(dev); (*((dev->phy.ops)->phy_write))(dev, (int )reg, (int )value); return; } } void b43_phy_copy(struct b43_wldev *dev , u16 destreg , u16 srcreg ) { u16 tmp ; { assert_mac_suspended(dev); tmp = (*((dev->phy.ops)->phy_read))(dev, (int )srcreg); (*((dev->phy.ops)->phy_write))(dev, (int )destreg, (int )tmp); return; } } void b43_phy_mask(struct b43_wldev *dev , u16 offset , u16 mask ) { u16 tmp ; { if ((unsigned long )(dev->phy.ops)->phy_maskset != (unsigned long )((void (*/* const */)(struct b43_wldev * , u16 , u16 , u16 ))0)) { assert_mac_suspended(dev); (*((dev->phy.ops)->phy_maskset))(dev, (int )offset, (int )mask, 0); } else { tmp = b43_phy_read(dev, (int )offset); b43_phy_write(dev, (int )offset, (int )tmp & (int )mask); } return; } } void b43_phy_set(struct b43_wldev *dev , u16 offset , u16 set ) { u16 tmp ; { if ((unsigned long )(dev->phy.ops)->phy_maskset != (unsigned long )((void (*/* const */)(struct b43_wldev * , u16 , u16 , u16 ))0)) { assert_mac_suspended(dev); (*((dev->phy.ops)->phy_maskset))(dev, (int )offset, 65535, (int )set); } else { tmp = b43_phy_read(dev, (int )offset); b43_phy_write(dev, (int )offset, (int )tmp | (int )set); } return; } } void b43_phy_maskset(struct b43_wldev *dev , u16 offset , u16 mask , u16 set ) { u16 tmp ; { if ((unsigned long )(dev->phy.ops)->phy_maskset != (unsigned long )((void (*/* const */)(struct b43_wldev * , u16 , u16 , u16 ))0)) { assert_mac_suspended(dev); (*((dev->phy.ops)->phy_maskset))(dev, (int )offset, (int )mask, (int )set); } else { tmp = b43_phy_read(dev, (int )offset); b43_phy_write(dev, (int )offset, ((int )tmp & (int )mask) | (int )set); } return; } } int b43_switch_channel(struct b43_wldev *dev , unsigned int new_channel ) { struct b43_phy *phy ; u16 channelcookie ; u16 savedcookie ; int err ; enum ieee80211_band tmp ; { phy = & dev->phy; if (new_channel == 4294967295U) { new_channel = (*((phy->ops)->get_default_chan))(dev); } else { } channelcookie = (u16 )new_channel; tmp = b43_current_band(dev->wl); if ((unsigned int )tmp == 1U) { channelcookie = (u16 )((unsigned int )channelcookie | 256U); } else { } savedcookie = b43_shm_read16(dev, 1, 160); b43_shm_write16(dev, 1, 160, (int )channelcookie); err = (*((phy->ops)->switch_channel))(dev, new_channel); if (err != 0) { goto err_restore_cookie; } else { } dev->phy.channel = new_channel; msleep(8U); return (0); err_restore_cookie: b43_shm_write16(dev, 1, 160, (int )savedcookie); return (err); } } void b43_software_rfkill(struct b43_wldev *dev , bool blocked ) { struct b43_phy *phy ; { phy = & dev->phy; b43_mac_suspend(dev); (*((phy->ops)->software_rfkill))(dev, (int )blocked); phy->radio_on = (bool )(! ((int )blocked != 0)); b43_mac_enable(dev); return; } } void b43_phy_txpower_adjust_work(struct work_struct *work ) { struct b43_wl *wl ; struct work_struct const *__mptr ; struct b43_wldev *dev ; int tmp ; int tmp___0 ; long tmp___1 ; { __mptr = (struct work_struct const *)work; wl = (struct b43_wl *)__mptr + 0xfffffffffffffde8UL; mutex_lock_nested(& wl->mutex, 0U); dev = wl->current_dev; if ((unsigned long )dev != (unsigned long )((struct b43_wldev *)0)) { tmp = atomic_read((atomic_t const *)(& dev->__init_status)); if (tmp > 1) { tmp___0 = 1; } else { tmp___0 = 0; } } else { tmp___0 = 0; } tmp___1 = ldv__builtin_expect((long )tmp___0, 1L); if (tmp___1 != 0L) { (*((dev->phy.ops)->adjust_txpower))(dev); } else { } mutex_unlock(& wl->mutex); return; } } void b43_phy_txpower_check(struct b43_wldev *dev , unsigned int flags ) { struct b43_phy *phy ; unsigned long now ; enum b43_txpwr_result result ; int __ret_warn_on ; long tmp ; int __ret_warn_on___0 ; long tmp___0 ; { phy = & dev->phy; now = jiffies; if ((flags & 1U) == 0U) { if ((long )now - (long )phy->next_txpwr_check_time < 0L) { return; } else { } } else { } phy->next_txpwr_check_time = round_jiffies(now + 500UL); if ((unsigned int )((dev->dev)->bus)->boardinfo.vendor == 5348U && (unsigned int )((dev->dev)->bus)->boardinfo.type == 1046U) { return; } else { } result = (*((phy->ops)->recalc_txpower))(dev, (flags & 2U) != 0U); if ((unsigned int )result == 1U) { return; } else { } __ret_warn_on = (unsigned int )result != 0U; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_common.c", 371); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); __ret_warn_on___0 = (unsigned long )(phy->ops)->adjust_txpower == (unsigned long )((void (*/* const */)(struct b43_wldev * ))0); tmp___0 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_common.c", 372); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); ieee80211_queue_work((dev->wl)->hw, & (dev->wl)->txpower_adjust_work); return; } } int b43_phy_shm_tssi_read(struct b43_wldev *dev , u16 shm_offset ) { bool is_ofdm ; unsigned int a ; unsigned int b ; unsigned int c ; unsigned int d ; unsigned int average ; u32 tmp ; u16 tmp___0 ; { is_ofdm = (unsigned int )shm_offset != 88U; tmp = b43_shm_read32(dev, 1, (int )shm_offset); a = tmp & 255U; b = (tmp >> 8) & 255U; c = (tmp >> 16) & 255U; d = tmp >> 24; if (((((((a == 0U || a == 127U) || b == 0U) || b == 127U) || c == 0U) || c == 127U) || d == 0U) || d == 127U) { return (-2); } else { } tmp = 2139062143U; b43_shm_write32(dev, 1, (int )shm_offset, tmp); if ((int )is_ofdm) { a = (a + 32U) & 63U; b = (b + 32U) & 63U; c = (c + 32U) & 63U; d = (d + 32U) & 63U; } else { } average = ((((a + b) + c) + d) + 2U) / 4U; if ((int )is_ofdm) { tmp___0 = b43_shm_read16(dev, 1, 94); if (((unsigned long long )tmp___0 & 8ULL) != 0ULL) { average = average > 12U ? average - 13U : 0U; } else { } } else { } return ((int )average); } } void b43_phyop_switch_analog_generic(struct b43_wldev *dev , bool on ) { { b43_write16(dev, 998, (int )on ? 0 : 244); return; } } struct b43_c32 b43_cordic(int theta ) { u32 arctg[18U] ; u8 i ; s32 tmp ; s8 signx ; u32 angle ; struct b43_c32 ret ; { arctg[0] = 2949120U; arctg[1] = 1740967U; arctg[2] = 919879U; arctg[3] = 466945U; arctg[4] = 234379U; arctg[5] = 117304U; arctg[6] = 58666U; arctg[7] = 29335U; arctg[8] = 14668U; arctg[9] = 7334U; arctg[10] = 3667U; arctg[11] = 1833U; arctg[12] = 917U; arctg[13] = 458U; arctg[14] = 229U; arctg[15] = 115U; arctg[16] = 57U; arctg[17] = 29U; signx = 1; angle = 0U; ret.i = 39797; ret.q = 0; goto ldv_37313; ldv_37312: theta = theta + -23592960; ldv_37313: ; if (theta > 11796480) { goto ldv_37312; } else { } goto ldv_37316; ldv_37315: theta = theta + 23592960; ldv_37316: ; if (theta < -11796480) { goto ldv_37315; } else { } if (theta > 5898240) { theta = theta + -11796480; signx = -1; } else if (theta < -5898240) { theta = theta + 11796480; signx = -1; } else { } i = 0U; goto ldv_37319; ldv_37318: ; if ((u32 )theta > angle) { tmp = ret.i - (ret.q >> (int )i); ret.q = ret.q + (ret.i >> (int )i); ret.i = tmp; angle = arctg[(int )i] + angle; } else { tmp = ret.i + (ret.q >> (int )i); ret.q = ret.q - (ret.i >> (int )i); ret.i = tmp; angle = angle - arctg[(int )i]; } i = (u8 )((int )i + 1); ldv_37319: ; if ((unsigned int )i <= 17U) { goto ldv_37318; } else { } ret.i = ret.i * (int )signx; ret.q = ret.q * (int )signx; return (ret); } } int ldv_del_timer_sync_21(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type ldv_func_res ; int tmp ; { tmp = del_timer_sync(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_9(ldv_func_arg1); return (ldv_func_res); } } int ldv_del_timer_22(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___0 ldv_func_res ; int tmp ; { tmp = del_timer(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_9(ldv_func_arg1); return (ldv_func_res); } } int ldv_request_threaded_irq_23(unsigned int ldv_func_arg1 , irqreturn_t (*handler)(int , void * ) , irqreturn_t (*thread_fn)(int , void * ) , unsigned long ldv_func_arg4 , char const *ldv_func_arg5 , void *ldv_func_arg6 ) { ldv_func_ret_type___1 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = request_threaded_irq(ldv_func_arg1, handler, thread_fn, ldv_func_arg4, ldv_func_arg5, ldv_func_arg6); ldv_func_res = tmp; tmp___0 = reg_check_2(handler, thread_fn); if (tmp___0 != 0 && ldv_func_res >= 0) { activate_suitable_irq_2((int )ldv_func_arg1, ldv_func_arg6); } else { } return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; extern void *memmove(void * , void const * , size_t ) ; int ldv_del_timer_28(struct timer_list *ldv_func_arg1 ) ; int ldv_del_timer_sync_27(struct timer_list *ldv_func_arg1 ) ; int ldv_request_threaded_irq_29(unsigned int ldv_func_arg1 , irqreturn_t (*handler)(int , void * ) , irqreturn_t (*thread_fn)(int , void * ) , unsigned long ldv_func_arg4 , char const *ldv_func_arg5 , void *ldv_func_arg6 ) ; void b43_phy_inita(struct b43_wldev *dev ) ; void b43_gphy_set_baseband_attenuation(struct b43_wldev *dev , u16 baseband_attenuation ) ; void b43_gphy_channel_switch(struct b43_wldev *dev , unsigned int channel , bool synthetic_pu_workaround ) ; u8 *b43_generate_dyn_tssi2dbm_tab(struct b43_wldev *dev , s16 pab0 , s16 pab1 , s16 pab2 ) ; void b43_lo_g_adjust(struct b43_wldev *dev ) ; void b43_gphy_dc_lt_init(struct b43_wldev *dev , bool update_all ) ; void b43_lo_g_maintanance_work(struct b43_wldev *dev ) ; void b43_lo_g_cleanup(struct b43_wldev *dev ) ; void b43_lo_g_init(struct b43_wldev *dev ) ; extern u8 const byte_rev_table[256U] ; __inline static u8 bitrev8(u8 byte ) { { return ((u8 )byte_rev_table[(int )byte]); } } static s8 const b43_tssi2dbm_g_table[64U] = { 77, 77, 77, 76, 76, 76, 75, 75, 74, 74, 73, 73, 73, 72, 72, 71, 71, 70, 70, 69, 68, 68, 67, 67, 66, 65, 65, 64, 63, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 50, 49, 47, 45, 43, 40, 37, 33, 28, 22, 14, 5, -7, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20}; static u8 const b43_radio_channel_codes_bg[14U] = { 12U, 17U, 22U, 27U, 32U, 37U, 42U, 47U, 52U, 57U, 62U, 67U, 72U, 84U}; static void b43_calc_nrssi_threshold(struct b43_wldev *dev ) ; __inline static u16 channel2freq_bg(u8 channel ) { int __ret_warn_on ; long tmp ; { __ret_warn_on = (unsigned int )channel == 0U || (unsigned int )channel > 14U; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_g.c", 75); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); return ((u16 )b43_radio_channel_codes_bg[(int )channel + -1]); } } static void generate_rfatt_list(struct b43_wldev *dev , struct b43_rfatt_list *list ) { struct b43_phy *phy ; struct b43_rfatt rfatt_0[14U] ; struct b43_rfatt rfatt_1[7U] ; struct b43_rfatt rfatt_2[7U] ; bool tmp ; int tmp___0 ; { phy = & dev->phy; rfatt_0[0].att = 3U; rfatt_0[0].with_padmix = 0; rfatt_0[1].att = 1U; rfatt_0[1].with_padmix = 0; rfatt_0[2].att = 5U; rfatt_0[2].with_padmix = 0; rfatt_0[3].att = 7U; rfatt_0[3].with_padmix = 0; rfatt_0[4].att = 9U; rfatt_0[4].with_padmix = 0; rfatt_0[5].att = 2U; rfatt_0[5].with_padmix = 0; rfatt_0[6].att = 0U; rfatt_0[6].with_padmix = 0; rfatt_0[7].att = 4U; rfatt_0[7].with_padmix = 0; rfatt_0[8].att = 6U; rfatt_0[8].with_padmix = 0; rfatt_0[9].att = 8U; rfatt_0[9].with_padmix = 0; rfatt_0[10].att = 1U; rfatt_0[10].with_padmix = 1; rfatt_0[11].att = 2U; rfatt_0[11].with_padmix = 1; rfatt_0[12].att = 3U; rfatt_0[12].with_padmix = 1; rfatt_0[13].att = 4U; rfatt_0[13].with_padmix = 1; rfatt_1[0].att = 2U; rfatt_1[0].with_padmix = 1; rfatt_1[1].att = 4U; rfatt_1[1].with_padmix = 1; rfatt_1[2].att = 6U; rfatt_1[2].with_padmix = 1; rfatt_1[3].att = 8U; rfatt_1[3].with_padmix = 1; rfatt_1[4].att = 10U; rfatt_1[4].with_padmix = 1; rfatt_1[5].att = 12U; rfatt_1[5].with_padmix = 1; rfatt_1[6].att = 14U; rfatt_1[6].with_padmix = 1; rfatt_2[0].att = 0U; rfatt_2[0].with_padmix = 1; rfatt_2[1].att = 2U; rfatt_2[1].with_padmix = 1; rfatt_2[2].att = 4U; rfatt_2[2].with_padmix = 1; rfatt_2[3].att = 6U; rfatt_2[3].with_padmix = 1; rfatt_2[4].att = 8U; rfatt_2[4].with_padmix = 1; rfatt_2[5].att = 9U; rfatt_2[5].with_padmix = 1; rfatt_2[6].att = 9U; rfatt_2[6].with_padmix = 1; tmp = b43_has_hardware_pctl(dev); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { list->list = (struct b43_rfatt const *)(& rfatt_0); list->len = 14U; list->min_val = 0U; list->max_val = 9U; return; } else { } if ((unsigned int )phy->radio_ver == 8272U && (unsigned int )phy->radio_rev == 8U) { list->list = (struct b43_rfatt const *)(& rfatt_1); list->len = 7U; list->min_val = 0U; list->max_val = 14U; return; } else { } list->list = (struct b43_rfatt const *)(& rfatt_2); list->len = 7U; list->min_val = 0U; list->max_val = 9U; return; } } static void generate_bbatt_list(struct b43_wldev *dev , struct b43_bbatt_list *list ) { struct b43_bbatt bbatt_0[9U] ; { bbatt_0[0].att = 0U; bbatt_0[1].att = 1U; bbatt_0[2].att = 2U; bbatt_0[3].att = 3U; bbatt_0[4].att = 4U; bbatt_0[5].att = 5U; bbatt_0[6].att = 6U; bbatt_0[7].att = 7U; bbatt_0[8].att = 8U; list->list = (struct b43_bbatt const *)(& bbatt_0); list->len = 9U; list->min_val = 0U; list->max_val = 8U; return; } } static void b43_shm_clear_tssi(struct b43_wldev *dev ) { { b43_shm_write16(dev, 1, 88, 32639); b43_shm_write16(dev, 1, 90, 32639); b43_shm_write16(dev, 1, 112, 32639); b43_shm_write16(dev, 1, 114, 32639); return; } } static void b43_synth_pu_workaround(struct b43_wldev *dev , u8 channel ) { struct b43_phy *phy ; u16 tmp ; u16 tmp___0 ; u16 tmp___1 ; { phy = & dev->phy; __might_sleep("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_g.c", 180, 0); if ((unsigned int )phy->radio_ver != 8272U || (unsigned int )phy->radio_rev > 5U) { return; } else { } if ((unsigned int )channel <= 10U) { tmp = channel2freq_bg((int )((unsigned int )channel + 4U)); b43_write16(dev, 1008, (int )tmp); } else { tmp___0 = channel2freq_bg(1); b43_write16(dev, 1008, (int )tmp___0); } msleep(1U); tmp___1 = channel2freq_bg((int )channel); b43_write16(dev, 1008, (int )tmp___1); return; } } void b43_gphy_set_baseband_attenuation(struct b43_wldev *dev , u16 baseband_attenuation ) { struct b43_phy *phy ; u16 tmp ; { phy = & dev->phy; if ((unsigned int )phy->analog == 0U) { tmp = b43_read16(dev, 998); b43_write16(dev, 998, (int )((u16 )(((int )((short )tmp) & -16) | (int )((short )baseband_attenuation)))); } else if ((unsigned int )phy->analog > 1U) { b43_phy_maskset(dev, 96, 65475, (int )baseband_attenuation << 2U); } else { b43_phy_maskset(dev, 96, 65415, (int )baseband_attenuation << 3U); } return; } } static void b43_set_txpower_g(struct b43_wldev *dev , struct b43_bbatt const *bbatt , struct b43_rfatt const *rfatt , u8 tx_control ) { struct b43_phy *phy ; struct b43_phy_g *gphy ; struct b43_txpower_lo_control *lo ; u16 bb ; u16 rf ; u16 tx_bias ; u16 tx_magn ; long tmp ; bool tmp___0 ; { phy = & dev->phy; gphy = phy->__annonCompField40.g; lo = gphy->lo_control; bb = (u16 )bbatt->att; rf = (u16 )rfatt->att; tx_bias = (u16 )lo->tx_bias; tx_magn = (u16 )lo->tx_magn; tmp = ldv__builtin_expect((unsigned int )tx_bias == 255U, 0L); if (tmp != 0L) { tx_bias = 0U; } else { } gphy->tx_control = tx_control; memmove((void *)(& gphy->rfatt), (void const *)rfatt, 2UL); gphy->rfatt.with_padmix = ((int )tx_control & 16) != 0; memmove((void *)(& gphy->bbatt), (void const *)bbatt, 1UL); tmp___0 = b43_debug(dev, 0); if ((int )tmp___0) { b43dbg(dev->wl, "Tuning TX-power to bbatt(%u), rfatt(%u), tx_control(0x%02X), tx_bias(0x%02X), tx_magn(0x%02X)\n", (int )bb, (int )rf, (int )tx_control, (int )tx_bias, (int )tx_magn); } else { } b43_gphy_set_baseband_attenuation(dev, (int )bb); b43_shm_write16(dev, 1, 100, (int )rf); if ((unsigned int )phy->radio_ver == 8272U && (unsigned int )phy->radio_rev == 8U) { b43_radio_write(dev, 67, (int )((u16 )(((int )((short )rf) & 15) | ((int )((short )tx_control) & 112)))); } else { b43_radio_maskset(dev, 67, 65520, (int )rf & 15); b43_radio_maskset(dev, 82, 65423, (int )tx_control & 112); } if (((unsigned int )phy->rev > 1U && (unsigned int )phy->radio_ver == 8272U) && (unsigned int )phy->radio_rev == 8U) { b43_radio_write(dev, 82, (int )tx_magn | (int )tx_bias); } else { b43_radio_maskset(dev, 82, 65520, (int )tx_bias & 15); } b43_lo_g_adjust(dev); return; } } static void b43_gphy_tssi_power_lt_init(struct b43_wldev *dev ) { struct b43_phy_g *gphy ; int i ; u16 value ; { gphy = dev->phy.__annonCompField40.g; i = 0; goto ldv_37083; ldv_37082: b43_ofdmtab_write16(dev, 15392, (int )((u16 )i), (int )((u16 )*(gphy->tssi2dbm + (unsigned long )i))); i = i + 1; ldv_37083: ; if (i <= 31) { goto ldv_37082; } else { } i = 32; goto ldv_37086; ldv_37085: b43_ofdmtab_write16(dev, 15360, (int )((unsigned int )((u16 )i) + 65504U), (int )((u16 )*(gphy->tssi2dbm + (unsigned long )i))); i = i + 1; ldv_37086: ; if (i <= 63) { goto ldv_37085; } else { } i = 0; goto ldv_37089; ldv_37088: value = (unsigned short )*(gphy->tssi2dbm + (unsigned long )i); value = (u16 )((int )((short )((int )((unsigned short )*(gphy->tssi2dbm + ((unsigned long )i + 1UL))) << 8)) | (int )((short )value)); b43_phy_write(dev, (int )((unsigned int )((u16 )(i / 2)) + 896U), (int )value); i = i + 2; ldv_37089: ; if (i <= 63) { goto ldv_37088; } else { } return; } } static void b43_gphy_gain_lt_init(struct b43_wldev *dev ) { struct b43_phy *phy ; struct b43_phy_g *gphy ; struct b43_txpower_lo_control *lo ; u16 nr_written ; u16 tmp ; u8 rf ; u8 bb ; { phy = & dev->phy; gphy = phy->__annonCompField40.g; lo = gphy->lo_control; nr_written = 0U; rf = 0U; goto ldv_37105; ldv_37104: bb = 0U; goto ldv_37102; ldv_37101: ; if ((unsigned int )nr_written > 63U) { return; } else { } tmp = (u16 )(lo->bbatt_list.list + (unsigned long )bb)->att; tmp = (int )tmp << 8U; if ((unsigned int )phy->radio_rev == 8U) { tmp = (u16 )((unsigned int )tmp | 80U); } else { tmp = (u16 )((unsigned int )tmp | 64U); } tmp = (int )((u16 )(lo->rfatt_list.list + (unsigned long )rf)->att) | (int )tmp; b43_phy_write(dev, (int )((unsigned int )nr_written + 960U), (int )tmp); nr_written = (u16 )((int )nr_written + 1); bb = (u8 )((int )bb + 1); ldv_37102: ; if ((int )lo->bbatt_list.len > (int )bb) { goto ldv_37101; } else { } rf = (u8 )((int )rf + 1); ldv_37105: ; if ((int )lo->rfatt_list.len > (int )rf) { goto ldv_37104; } else { } return; } } static void b43_set_all_gains(struct b43_wldev *dev , s16 first , s16 second , s16 third ) { struct b43_phy *phy ; u16 i ; u16 start ; u16 end ; u16 tmp ; u16 table ; { phy = & dev->phy; start = 8U; end = 24U; if ((unsigned int )phy->rev <= 1U) { start = 16U; end = 32U; } else { } table = 1024U; if ((unsigned int )phy->rev <= 1U) { table = 20480U; } else { } i = 0U; goto ldv_37120; ldv_37119: b43_ofdmtab_write16(dev, (int )table, (int )i, (int )((u16 )first)); i = (u16 )((int )i + 1); ldv_37120: ; if ((unsigned int )i <= 3U) { goto ldv_37119; } else { } i = start; goto ldv_37123; ldv_37122: b43_ofdmtab_write16(dev, (int )table, (int )i, (int )((u16 )second)); i = (u16 )((int )i + 1); ldv_37123: ; if ((int )i < (int )end) { goto ldv_37122; } else { } if ((int )third != -1) { tmp = (u16 )((int )((short )((int )((unsigned short )third) << 14)) | (int )((short )((int )((unsigned short )third) << 6))); b43_phy_maskset(dev, 1184, 49087, (int )tmp); b43_phy_maskset(dev, 1185, 49087, (int )tmp); b43_phy_maskset(dev, 1186, 49087, (int )tmp); } else { } b43_dummy_transmission(dev, 0, 1); return; } } static void b43_set_original_gains(struct b43_wldev *dev ) { struct b43_phy *phy ; u16 i ; u16 tmp ; u16 table ; u16 start ; u16 end ; { phy = & dev->phy; start = 8U; end = 24U; if ((unsigned int )phy->rev <= 1U) { start = 16U; end = 32U; } else { } table = 1024U; if ((unsigned int )phy->rev <= 1U) { table = 20480U; } else { } i = 0U; goto ldv_37135; ldv_37134: tmp = (unsigned int )i & 65532U; tmp = (u16 )((int )((short )(((int )i & 1) << 1)) | (int )((short )tmp)); tmp = (u16 )((int )((short )(((int )i & 2) >> 1)) | (int )((short )tmp)); b43_ofdmtab_write16(dev, (int )table, (int )i, (int )tmp); i = (u16 )((int )i + 1); ldv_37135: ; if ((unsigned int )i <= 3U) { goto ldv_37134; } else { } i = start; goto ldv_37138; ldv_37137: b43_ofdmtab_write16(dev, (int )table, (int )i, (int )i - (int )start); i = (u16 )((int )i + 1); ldv_37138: ; if ((int )i < (int )end) { goto ldv_37137; } else { } b43_phy_maskset(dev, 1184, 49087, 16448); b43_phy_maskset(dev, 1185, 49087, 16448); b43_phy_maskset(dev, 1186, 49087, 16384); b43_dummy_transmission(dev, 0, 1); return; } } static void b43_nrssi_hw_write(struct b43_wldev *dev , u16 offset , s16 val ) { { b43_phy_write(dev, 2051, (int )offset); b43_phy_write(dev, 2052, (int )((unsigned short )val)); return; } } static s16 b43_nrssi_hw_read(struct b43_wldev *dev , u16 offset ) { u16 val ; { b43_phy_write(dev, 2051, (int )offset); val = b43_phy_read(dev, 2052); return ((s16 )val); } } static void b43_nrssi_hw_update(struct b43_wldev *dev , u16 val ) { u16 i ; s16 tmp ; s16 __val ; s16 __min ; s16 __max ; { i = 0U; goto ldv_37161; ldv_37160: tmp = b43_nrssi_hw_read(dev, (int )i); tmp = (s16 )((int )((unsigned short )tmp) - (int )val); __val = tmp; __min = -32; __max = 31; __val = (s16 )((int )__min > (int )__val ? __min : __val); tmp = (s16 )((int )__max < (int )__val ? __max : __val); b43_nrssi_hw_write(dev, (int )i, (int )tmp); i = (u16 )((int )i + 1); ldv_37161: ; if ((unsigned int )i <= 63U) { goto ldv_37160; } else { } return; } } static void b43_nrssi_mem_update(struct b43_wldev *dev ) { struct b43_phy_g *gphy ; s16 i ; s16 delta ; s32 tmp ; s32 __val ; s32 __min ; s32 __max ; { gphy = dev->phy.__annonCompField40.g; delta = (s16 )(31U - (unsigned int )((unsigned short )gphy->nrssi[0])); i = 0; goto ldv_37175; ldv_37174: tmp = ((int )i - (int )delta) * gphy->nrssislope; tmp = tmp / 65536; tmp = tmp + 58; __val = tmp; __min = 0; __max = 63; __val = __min > __val ? __min : __val; tmp = __max < __val ? __max : __val; gphy->nrssi_lt[(int )i] = (s8 )tmp; i = (s16 )((int )i + 1); ldv_37175: ; if ((int )i <= 63) { goto ldv_37174; } else { } return; } } static void b43_calc_nrssi_offset(struct b43_wldev *dev ) { struct b43_phy *phy ; u16 backup[20U] ; unsigned int tmp ; s16 v47F ; u16 i ; u16 saved ; u16 tmp___0 ; u16 tmp___1 ; u16 tmp___2 ; u16 tmp___3 ; u16 tmp___4 ; { phy = & dev->phy; backup[0] = 0U; tmp = 1U; while (1) { if (tmp >= 20U) { break; } else { } backup[tmp] = (unsigned short)0; tmp = tmp + 1U; } saved = 65535U; backup[0] = b43_phy_read(dev, 1); backup[1] = b43_phy_read(dev, 2065); backup[2] = b43_phy_read(dev, 2066); if ((unsigned int )phy->rev != 1U) { backup[3] = b43_phy_read(dev, 2068); backup[4] = b43_phy_read(dev, 2069); } else { } backup[5] = b43_phy_read(dev, 90); backup[6] = b43_phy_read(dev, 89); backup[7] = b43_phy_read(dev, 88); backup[8] = b43_phy_read(dev, 10); backup[9] = b43_phy_read(dev, 3); backup[10] = b43_radio_read(dev, 122); backup[11] = b43_radio_read(dev, 67); b43_phy_mask(dev, 1065, 32767); b43_phy_maskset(dev, 1, 16383, 16384); b43_phy_set(dev, 2065, 12); b43_phy_maskset(dev, 2066, 65523, 4); b43_phy_mask(dev, 2050, 65532); if ((unsigned int )phy->rev > 5U) { backup[12] = b43_phy_read(dev, 46); backup[13] = b43_phy_read(dev, 47); backup[14] = b43_phy_read(dev, 2063); backup[15] = b43_phy_read(dev, 2064); backup[16] = b43_phy_read(dev, 2049); backup[17] = b43_phy_read(dev, 96); backup[18] = b43_phy_read(dev, 20); backup[19] = b43_phy_read(dev, 1144); b43_phy_write(dev, 46, 0); b43_phy_write(dev, 47, 0); b43_phy_write(dev, 2063, 0); b43_phy_write(dev, 2064, 0); b43_phy_set(dev, 1144, 256); b43_phy_set(dev, 2049, 64); b43_phy_set(dev, 96, 64); b43_phy_set(dev, 20, 512); } else { } b43_radio_set(dev, 122, 112); b43_radio_set(dev, 122, 128); __const_udelay(128850UL); tmp___0 = b43_phy_read(dev, 1151); v47F = (int )((short )((int )tmp___0 >> 8)) & 63; if ((int )v47F > 31) { v47F = (s16 )((unsigned int )((unsigned short )v47F) + 65472U); } else { } if ((int )v47F == 31) { i = 7U; goto ldv_37186; ldv_37185: b43_radio_write(dev, 123, (int )i); __const_udelay(85900UL); tmp___1 = b43_phy_read(dev, 1151); v47F = (int )((short )((int )tmp___1 >> 8)) & 63; if ((int )v47F > 31) { v47F = (s16 )((unsigned int )((unsigned short )v47F) + 65472U); } else { } if ((int )v47F <= 30 && (unsigned int )saved == 65535U) { saved = i; } else { } i = (u16 )((int )i - 1); ldv_37186: ; if ((unsigned int )i > 3U) { goto ldv_37185; } else { } if ((unsigned int )saved == 65535U) { saved = 4U; } else { } } else { b43_radio_mask(dev, 122, 127); if ((unsigned int )phy->rev != 1U) { b43_phy_set(dev, 2068, 1); b43_phy_mask(dev, 2069, 65534); } else { } b43_phy_set(dev, 2065, 12); b43_phy_set(dev, 2066, 12); b43_phy_set(dev, 2065, 48); b43_phy_set(dev, 2066, 48); b43_phy_write(dev, 90, 1152); b43_phy_write(dev, 89, 2064); b43_phy_write(dev, 88, 13); if ((unsigned int )phy->rev == 0U) { b43_phy_write(dev, 3, 290); } else { b43_phy_set(dev, 10, 8192); } if ((unsigned int )phy->rev != 1U) { b43_phy_set(dev, 2068, 4); b43_phy_mask(dev, 2069, 65531); } else { } b43_phy_maskset(dev, 3, 65439, 64); b43_radio_set(dev, 122, 15); b43_set_all_gains(dev, 3, 0, 1); b43_radio_maskset(dev, 67, 240, 15); __const_udelay(128850UL); tmp___2 = b43_phy_read(dev, 1151); v47F = (int )((short )((int )tmp___2 >> 8)) & 63; if ((int )v47F > 31) { v47F = (s16 )((unsigned int )((unsigned short )v47F) + 65472U); } else { } if ((int )v47F == -32) { i = 0U; goto ldv_37189; ldv_37188: b43_radio_write(dev, 123, (int )i); __const_udelay(85900UL); tmp___3 = b43_phy_read(dev, 1151); v47F = (int )((short )((int )tmp___3 >> 8)) & 63; if ((int )v47F > 31) { v47F = (s16 )((unsigned int )((unsigned short )v47F) + 65472U); } else { } if ((int )v47F >= -30 && (unsigned int )saved == 65535U) { saved = i; } else { } i = (u16 )((int )i + 1); ldv_37189: ; if ((unsigned int )i <= 3U) { goto ldv_37188; } else { } if ((unsigned int )saved == 65535U) { saved = 3U; } else { } } else { saved = 0U; } } b43_radio_write(dev, 123, (int )saved); if ((unsigned int )phy->rev > 5U) { b43_phy_write(dev, 46, (int )backup[12]); b43_phy_write(dev, 47, (int )backup[13]); b43_phy_write(dev, 2063, (int )backup[14]); b43_phy_write(dev, 2064, (int )backup[15]); } else { } if ((unsigned int )phy->rev != 1U) { b43_phy_write(dev, 2068, (int )backup[3]); b43_phy_write(dev, 2069, (int )backup[4]); } else { } b43_phy_write(dev, 90, (int )backup[5]); b43_phy_write(dev, 89, (int )backup[6]); b43_phy_write(dev, 88, (int )backup[7]); b43_phy_write(dev, 10, (int )backup[8]); b43_phy_write(dev, 3, (int )backup[9]); b43_radio_write(dev, 67, (int )backup[11]); b43_radio_write(dev, 122, (int )backup[10]); tmp___4 = b43_phy_read(dev, 2050); b43_phy_write(dev, 2050, (int )((unsigned int )tmp___4 | 3U)); b43_phy_set(dev, 1065, 32768); b43_set_original_gains(dev); if ((unsigned int )phy->rev > 5U) { b43_phy_write(dev, 2049, (int )backup[16]); b43_phy_write(dev, 96, (int )backup[17]); b43_phy_write(dev, 20, (int )backup[18]); b43_phy_write(dev, 1144, (int )backup[19]); } else { } b43_phy_write(dev, 1, (int )backup[0]); b43_phy_write(dev, 2066, (int )backup[2]); b43_phy_write(dev, 2065, (int )backup[1]); return; } } static void b43_calc_nrssi_slope(struct b43_wldev *dev ) { struct b43_phy *phy ; struct b43_phy_g *gphy ; u16 backup[18U] ; unsigned int tmp ; u16 tmp___0 ; s16 nrssi0 ; s16 nrssi1 ; int __ret_warn_on ; long tmp___1 ; u16 tmp___2 ; u16 tmp___3 ; u16 tmp___4 ; u16 tmp___5 ; u16 tmp___6 ; u16 tmp___7 ; { phy = & dev->phy; gphy = phy->__annonCompField40.g; backup[0] = 0U; tmp = 1U; while (1) { if (tmp >= 18U) { break; } else { } backup[tmp] = (unsigned short)0; tmp = tmp + 1U; } __ret_warn_on = (unsigned int )phy->type != 2U; tmp___1 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_g.c", 576); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); if ((unsigned int )phy->radio_rev > 8U) { return; } else { } if ((unsigned int )phy->radio_rev == 8U) { b43_calc_nrssi_offset(dev); } else { } b43_phy_mask(dev, 1065, 32767); b43_phy_mask(dev, 2050, 65532); backup[7] = b43_read16(dev, 994); tmp___2 = b43_read16(dev, 994); b43_write16(dev, 994, (int )((unsigned int )tmp___2 | 32768U)); backup[0] = b43_radio_read(dev, 122); backup[1] = b43_radio_read(dev, 82); backup[2] = b43_radio_read(dev, 67); backup[3] = b43_phy_read(dev, 21); backup[4] = b43_phy_read(dev, 90); backup[5] = b43_phy_read(dev, 89); backup[6] = b43_phy_read(dev, 88); backup[8] = b43_read16(dev, 998); backup[9] = b43_read16(dev, 1012); if ((unsigned int )phy->rev > 2U) { backup[10] = b43_phy_read(dev, 46); backup[11] = b43_phy_read(dev, 47); backup[12] = b43_phy_read(dev, 2063); backup[13] = b43_phy_read(dev, 2064); backup[14] = b43_phy_read(dev, 2049); backup[15] = b43_phy_read(dev, 96); backup[16] = b43_phy_read(dev, 20); backup[17] = b43_phy_read(dev, 1144); b43_phy_write(dev, 46, 0); b43_phy_write(dev, 2064, 0); switch ((int )phy->rev) { case 4: ; case 6: ; case 7: b43_phy_set(dev, 1144, 256); b43_phy_set(dev, 2049, 64); goto ldv_37205; case 3: ; case 5: b43_phy_mask(dev, 2049, 65471); goto ldv_37205; } ldv_37205: b43_phy_set(dev, 96, 64); b43_phy_set(dev, 20, 512); } else { } b43_radio_set(dev, 122, 112); b43_set_all_gains(dev, 0, 8, 0); b43_radio_mask(dev, 122, 247); if ((unsigned int )phy->rev > 1U) { b43_phy_maskset(dev, 2065, 65487, 48); b43_phy_maskset(dev, 2066, 65487, 16); } else { } b43_radio_set(dev, 122, 128); __const_udelay(85900UL); tmp___3 = b43_phy_read(dev, 1151); nrssi0 = (int )((short )((int )tmp___3 >> 8)) & 63; if ((int )nrssi0 > 31) { nrssi0 = (s16 )((unsigned int )((unsigned short )nrssi0) + 65472U); } else { } b43_radio_mask(dev, 122, 127); if ((unsigned int )phy->rev > 1U) { b43_phy_maskset(dev, 3, 65439, 64); } else { } tmp___4 = b43_read16(dev, 1012); b43_write16(dev, 1012, (int )((unsigned int )tmp___4 | 8192U)); b43_radio_set(dev, 122, 15); b43_phy_write(dev, 21, 62256); if ((unsigned int )phy->rev > 1U) { b43_phy_maskset(dev, 2066, 65487, 32); b43_phy_maskset(dev, 2065, 65487, 32); } else { } b43_set_all_gains(dev, 3, 0, 1); if ((unsigned int )phy->radio_rev == 8U) { b43_radio_write(dev, 67, 31); } else { tmp___5 = b43_radio_read(dev, 82); tmp___0 = (unsigned int )tmp___5 & 65295U; b43_radio_write(dev, 82, (int )((unsigned int )tmp___0 | 96U)); tmp___6 = b43_radio_read(dev, 67); tmp___0 = (unsigned int )tmp___6 & 65520U; b43_radio_write(dev, 67, (int )((unsigned int )tmp___0 | 9U)); } b43_phy_write(dev, 90, 1152); b43_phy_write(dev, 89, 2064); b43_phy_write(dev, 88, 13); __const_udelay(85900UL); tmp___7 = b43_phy_read(dev, 1151); nrssi1 = (int )((short )((int )tmp___7 >> 8)) & 63; if ((int )nrssi1 > 31) { nrssi1 = (s16 )((unsigned int )((unsigned short )nrssi1) + 65472U); } else { } if ((int )nrssi0 == (int )nrssi1) { gphy->nrssislope = 65536; } else { gphy->nrssislope = 4194304 / ((int )nrssi0 - (int )nrssi1); } if ((int )nrssi0 >= -4) { gphy->nrssi[0] = nrssi1; gphy->nrssi[1] = nrssi0; } else { } if ((unsigned int )phy->rev > 2U) { b43_phy_write(dev, 46, (int )backup[10]); b43_phy_write(dev, 47, (int )backup[11]); b43_phy_write(dev, 2063, (int )backup[12]); b43_phy_write(dev, 2064, (int )backup[13]); } else { } if ((unsigned int )phy->rev > 1U) { b43_phy_mask(dev, 2066, 65487); b43_phy_mask(dev, 2065, 65487); } else { } b43_radio_write(dev, 122, (int )backup[0]); b43_radio_write(dev, 82, (int )backup[1]); b43_radio_write(dev, 67, (int )backup[2]); b43_write16(dev, 994, (int )backup[7]); b43_write16(dev, 998, (int )backup[8]); b43_write16(dev, 1012, (int )backup[9]); b43_phy_write(dev, 21, (int )backup[3]); b43_phy_write(dev, 90, (int )backup[4]); b43_phy_write(dev, 89, (int )backup[5]); b43_phy_write(dev, 88, (int )backup[6]); b43_synth_pu_workaround(dev, (int )((u8 )phy->channel)); b43_phy_set(dev, 2050, 3); b43_set_original_gains(dev); b43_phy_set(dev, 1065, 32768); if ((unsigned int )phy->rev > 2U) { b43_phy_write(dev, 2049, (int )backup[14]); b43_phy_write(dev, 96, (int )backup[15]); b43_phy_write(dev, 20, (int )backup[16]); b43_phy_write(dev, 1144, (int )backup[17]); } else { } b43_nrssi_mem_update(dev); b43_calc_nrssi_threshold(dev); return; } } static void b43_calc_nrssi_threshold(struct b43_wldev *dev ) { struct b43_phy *phy ; struct b43_phy_g *gphy ; s32 a ; s32 b ; s16 tmp16 ; u16 tmp_u16 ; int __ret_warn_on ; long tmp ; s32 __val ; s32 __min ; s32 __max ; s32 __val___0 ; s32 __min___0 ; s32 __max___0 ; u16 tmp___0 ; { phy = & dev->phy; gphy = phy->__annonCompField40.g; __ret_warn_on = (unsigned int )phy->type != 2U; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_g.c", 718); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); if (! phy->gmode || ((int )((dev->dev)->bus)->sprom.boardflags_lo & 8) == 0) { tmp16 = b43_nrssi_hw_read(dev, 32); if ((int )tmp16 > 31) { tmp16 = (s16 )((unsigned int )((unsigned short )tmp16) + 65472U); } else { } if ((int )tmp16 <= 2) { b43_phy_maskset(dev, 1162, 61440, 2539); } else { b43_phy_maskset(dev, 1162, 61440, 2797); } } else { if (gphy->interfmode == 1) { a = 14; b = 10; } else if (! gphy->aci_wlan_automatic && (int )gphy->aci_enable) { a = 19; b = 18; } else { a = 14; b = 17; } a = ((int )gphy->nrssi[1] - (int )gphy->nrssi[0]) * a; a = ((int )gphy->nrssi[0] << 6) + a; if (a <= 31) { a = a + 31; } else { a = a + 32; } a = a >> 6; __val = a; __min = -31; __max = 31; __val = __min > __val ? __min : __val; a = __max < __val ? __max : __val; b = ((int )gphy->nrssi[1] - (int )gphy->nrssi[0]) * b; b = ((int )gphy->nrssi[0] << 6) + b; if (b <= 31) { b = b + 31; } else { b = b + 32; } b = b >> 6; __val___0 = b; __min___0 = -31; __max___0 = 31; __val___0 = __min___0 > __val___0 ? __min___0 : __val___0; b = __max___0 < __val___0 ? __max___0 : __val___0; tmp___0 = b43_phy_read(dev, 1162); tmp_u16 = (unsigned int )tmp___0 & 61440U; tmp_u16 = ((unsigned int )((u16 )b) & 63U) | (unsigned int )tmp_u16; tmp_u16 = (((unsigned int )((u16 )a) & 63U) << 6U) | (unsigned int )tmp_u16; b43_phy_write(dev, 1162, (int )tmp_u16); } return; } } static void _stack_save(u32 *_stackptr , size_t *stackidx , u8 id , u16 offset , u16 value ) { u32 *stackptr ; int __ret_warn_on ; long tmp ; int __ret_warn_on___0 ; long tmp___0 ; int __ret_warn_on___1 ; long tmp___1 ; { stackptr = _stackptr + *stackidx; __ret_warn_on = ((int )offset & 61440) != 0; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_g.c", 776); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); __ret_warn_on___0 = ((int )id & 240) != 0; tmp___0 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_g.c", 777); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); *stackptr = (u32 )offset; *stackptr = *stackptr | ((unsigned int )id << 12); *stackptr = *stackptr | ((unsigned int )value << 16); *stackidx = *stackidx + 1UL; __ret_warn_on___1 = *stackidx > 25UL; tmp___1 = ldv__builtin_expect(__ret_warn_on___1 != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_g.c", 782); } else { } ldv__builtin_expect(__ret_warn_on___1 != 0, 0L); return; } } static u16 _stack_restore(u32 *stackptr , u8 id , u16 offset ) { size_t i ; int __ret_warn_on ; long tmp ; int __ret_warn_on___0 ; long tmp___0 ; int __ret_warn_on___1 ; long tmp___1 ; { __ret_warn_on = ((int )offset & 61440) != 0; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_g.c", 789); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); __ret_warn_on___0 = ((int )id & 240) != 0; tmp___0 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_g.c", 790); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); i = 0UL; goto ldv_37253; ldv_37252: ; if ((*stackptr & 4095U) != (u32 )offset) { goto ldv_37251; } else { } if ((*stackptr & 61440U) >> 12 != (u32 )id) { goto ldv_37251; } else { } return ((u16 )(*stackptr >> 16)); ldv_37251: i = i + 1UL; stackptr = stackptr + 1; ldv_37253: ; if (i <= 25UL) { goto ldv_37252; } else { } __ret_warn_on___1 = 1; tmp___1 = ldv__builtin_expect(__ret_warn_on___1 != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_g.c", 798); } else { } ldv__builtin_expect(__ret_warn_on___1 != 0, 0L); return (0U); } } static void b43_radio_interference_mitigation_enable(struct b43_wldev *dev , int mode ) { struct b43_phy *phy ; struct b43_phy_g *gphy ; u16 tmp ; u16 flipped ; size_t stackidx ; u32 *stack ; u16 tmp___0 ; u16 tmp___1 ; int __ret_warn_on ; long tmp___2 ; u8 tmp___3 ; u8 tmp___4 ; u16 tmp___5 ; u16 tmp___6 ; u16 tmp___7 ; u16 tmp___8 ; u16 tmp___9 ; u16 tmp___10 ; u16 tmp___11 ; u16 tmp___12 ; u16 tmp___13 ; u16 tmp___14 ; u16 tmp___15 ; u16 tmp___16 ; u16 tmp___17 ; u16 tmp___18 ; u16 tmp___19 ; u16 tmp___20 ; u16 tmp___21 ; u16 tmp___22 ; u16 tmp___23 ; u16 tmp___24 ; u16 tmp___25 ; u16 tmp___26 ; u16 tmp___27 ; u16 tmp___28 ; u16 tmp___29 ; u16 tmp___30 ; u16 tmp___31 ; u16 tmp___32 ; u16 tmp___33 ; u16 tmp___34 ; u16 tmp___35 ; u16 tmp___36 ; u16 tmp___37 ; u16 tmp___38 ; u16 tmp___39 ; u16 tmp___40 ; u16 tmp___41 ; u16 tmp___42 ; u16 tmp___43 ; u16 tmp___44 ; u16 tmp___45 ; u64 tmp___46 ; int __ret_warn_on___0 ; long tmp___47 ; { phy = & dev->phy; gphy = phy->__annonCompField40.g; stackidx = 0UL; stack = (u32 *)(& gphy->interfstack); switch (mode) { case 1: ; if ((unsigned int )phy->rev != 1U) { b43_phy_set(dev, 1067, 2048); b43_phy_mask(dev, 1065, 49151); goto ldv_37268; } else { } tmp___0 = b43_radio_read(dev, 120); _stack_save(stack, & stackidx, 2, 120, (int )tmp___0); tmp___1 = b43_radio_read(dev, 120); tmp = (unsigned int )tmp___1 & 30U; __ret_warn_on = (unsigned int )tmp > 15U; tmp___2 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___2 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_g.c", 855); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); tmp___3 = bitrev8((int )((u8 )tmp)); flipped = (u16 )((int )tmp___3 >> 4); if ((unsigned int )flipped <= 9U && (unsigned int )flipped > 7U) { flipped = 7U; } else if ((unsigned int )flipped > 9U) { flipped = (unsigned int )flipped + 65533U; } else { } tmp___4 = bitrev8((int )((u8 )flipped)); flipped = (u16 )((int )((short )(((int )tmp___4 >> 4) << 1)) | 32); b43_radio_write(dev, 120, (int )flipped); b43_calc_nrssi_threshold(dev); tmp___5 = b43_phy_read(dev, 1030); _stack_save(stack, & stackidx, 1, 1030, (int )tmp___5); b43_phy_write(dev, 1030, 32296); b43_phy_set(dev, 1067, 2048); b43_phy_set(dev, 1025, 4096); tmp___6 = b43_phy_read(dev, 1184); _stack_save(stack, & stackidx, 1, 1184, (int )tmp___6); b43_phy_maskset(dev, 1184, 49344, 8); tmp___7 = b43_phy_read(dev, 1185); _stack_save(stack, & stackidx, 1, 1185, (int )tmp___7); b43_phy_maskset(dev, 1185, 49344, 1541); tmp___8 = b43_phy_read(dev, 1186); _stack_save(stack, & stackidx, 1, 1186, (int )tmp___8); b43_phy_maskset(dev, 1186, 49344, 516); tmp___9 = b43_phy_read(dev, 1192); _stack_save(stack, & stackidx, 1, 1192, (int )tmp___9); b43_phy_maskset(dev, 1192, 49344, 2051); tmp___10 = b43_phy_read(dev, 1195); _stack_save(stack, & stackidx, 1, 1195, (int )tmp___10); b43_phy_maskset(dev, 1195, 49344, 1541); tmp___11 = b43_phy_read(dev, 1191); _stack_save(stack, & stackidx, 1, 1191, (int )tmp___11); b43_phy_write(dev, 1191, 2); tmp___12 = b43_phy_read(dev, 1187); _stack_save(stack, & stackidx, 1, 1187, (int )tmp___12); b43_phy_write(dev, 1187, 10362); tmp___13 = b43_phy_read(dev, 1193); _stack_save(stack, & stackidx, 1, 1193, (int )tmp___13); b43_phy_write(dev, 1193, 8231); tmp___14 = b43_phy_read(dev, 1171); _stack_save(stack, & stackidx, 1, 1171, (int )tmp___14); b43_phy_write(dev, 1171, 13045); tmp___15 = b43_phy_read(dev, 1194); _stack_save(stack, & stackidx, 1, 1194, (int )tmp___15); b43_phy_write(dev, 1194, 8231); tmp___16 = b43_phy_read(dev, 1196); _stack_save(stack, & stackidx, 1, 1196, (int )tmp___16); b43_phy_write(dev, 1196, 13045); goto ldv_37268; case 2: tmp___17 = b43_phy_read(dev, 51); if (((int )tmp___17 & 2048) != 0) { goto ldv_37268; } else { } gphy->aci_enable = 1; tmp___18 = b43_phy_read(dev, 1025); _stack_save(stack, & stackidx, 1, 1025, (int )tmp___18); tmp___19 = b43_phy_read(dev, 1065); _stack_save(stack, & stackidx, 1, 1065, (int )tmp___19); if ((unsigned int )phy->rev <= 1U) { tmp___20 = b43_phy_read(dev, 1030); _stack_save(stack, & stackidx, 1, 1030, (int )tmp___20); } else { tmp___21 = b43_phy_read(dev, 1216); _stack_save(stack, & stackidx, 1, 1216, (int )tmp___21); tmp___22 = b43_phy_read(dev, 1217); _stack_save(stack, & stackidx, 1, 1217, (int )tmp___22); } tmp___23 = b43_phy_read(dev, 51); _stack_save(stack, & stackidx, 1, 51, (int )tmp___23); tmp___24 = b43_phy_read(dev, 1191); _stack_save(stack, & stackidx, 1, 1191, (int )tmp___24); tmp___25 = b43_phy_read(dev, 1187); _stack_save(stack, & stackidx, 1, 1187, (int )tmp___25); tmp___26 = b43_phy_read(dev, 1193); _stack_save(stack, & stackidx, 1, 1193, (int )tmp___26); tmp___27 = b43_phy_read(dev, 1194); _stack_save(stack, & stackidx, 1, 1194, (int )tmp___27); tmp___28 = b43_phy_read(dev, 1196); _stack_save(stack, & stackidx, 1, 1196, (int )tmp___28); tmp___29 = b43_phy_read(dev, 1171); _stack_save(stack, & stackidx, 1, 1171, (int )tmp___29); tmp___30 = b43_phy_read(dev, 1185); _stack_save(stack, & stackidx, 1, 1185, (int )tmp___30); tmp___31 = b43_phy_read(dev, 1184); _stack_save(stack, & stackidx, 1, 1184, (int )tmp___31); tmp___32 = b43_phy_read(dev, 1186); _stack_save(stack, & stackidx, 1, 1186, (int )tmp___32); tmp___33 = b43_phy_read(dev, 1162); _stack_save(stack, & stackidx, 1, 1162, (int )tmp___33); tmp___34 = b43_phy_read(dev, 1192); _stack_save(stack, & stackidx, 1, 1192, (int )tmp___34); tmp___35 = b43_phy_read(dev, 1195); _stack_save(stack, & stackidx, 1, 1195, (int )tmp___35); if ((unsigned int )phy->rev == 2U) { tmp___36 = b43_phy_read(dev, 1197); _stack_save(stack, & stackidx, 1, 1197, (int )tmp___36); tmp___37 = b43_phy_read(dev, 1198); _stack_save(stack, & stackidx, 1, 1198, (int )tmp___37); } else if ((unsigned int )phy->rev > 2U) { tmp___38 = b43_phy_read(dev, 1197); _stack_save(stack, & stackidx, 1, 1197, (int )tmp___38); tmp___39 = b43_phy_read(dev, 1045); _stack_save(stack, & stackidx, 1, 1045, (int )tmp___39); tmp___40 = b43_phy_read(dev, 1046); _stack_save(stack, & stackidx, 1, 1046, (int )tmp___40); tmp___41 = b43_phy_read(dev, 1047); _stack_save(stack, & stackidx, 1, 1047, (int )tmp___41); tmp___42 = b43_ofdmtab_read16(dev, 6656, 2); _stack_save(stack, & stackidx, 3, 6658, (int )tmp___42); tmp___43 = b43_ofdmtab_read16(dev, 6656, 3); _stack_save(stack, & stackidx, 3, 6659, (int )tmp___43); } else { } tmp___44 = b43_phy_read(dev, 1067); _stack_save(stack, & stackidx, 1, 1067, (int )tmp___44); tmp___45 = b43_phy_read(dev, 1164); _stack_save(stack, & stackidx, 1, 1164, (int )tmp___45); b43_phy_mask(dev, 1025, 61439); b43_phy_maskset(dev, 1065, 65532, 2); b43_phy_write(dev, 51, 2048); b43_phy_write(dev, 1187, 8231); b43_phy_write(dev, 1193, 7336); b43_phy_write(dev, 1171, 10362); b43_phy_write(dev, 1194, 7336); b43_phy_write(dev, 1196, 10362); b43_phy_maskset(dev, 1184, 65472, 26); b43_phy_write(dev, 1191, 13); if ((unsigned int )phy->rev <= 1U) { b43_phy_write(dev, 1030, 65293); } else if ((unsigned int )phy->rev == 2U) { b43_phy_write(dev, 1216, 65535); b43_phy_write(dev, 1217, 169); } else { b43_phy_write(dev, 1216, 193); b43_phy_write(dev, 1217, 89); } b43_phy_maskset(dev, 1185, 49407, 6144); b43_phy_maskset(dev, 1185, 65472, 21); b43_phy_maskset(dev, 1192, 53247, 4096); b43_phy_maskset(dev, 1192, 61695, 2560); b43_phy_maskset(dev, 1195, 53247, 4096); b43_phy_maskset(dev, 1195, 61695, 2048); b43_phy_maskset(dev, 1195, 65487, 16); b43_phy_maskset(dev, 1195, 65520, 5); b43_phy_maskset(dev, 1192, 65487, 16); b43_phy_maskset(dev, 1192, 65520, 6); b43_phy_maskset(dev, 1186, 61695, 2048); b43_phy_maskset(dev, 1184, 61695, 1280); b43_phy_maskset(dev, 1186, 65520, 11); if ((unsigned int )phy->rev > 2U) { b43_phy_mask(dev, 1162, 32767); b43_phy_maskset(dev, 1045, 32768, 14040); b43_phy_maskset(dev, 1046, 32768, 14040); b43_phy_maskset(dev, 1047, 65024, 365); } else { b43_phy_set(dev, 1162, 4096); b43_phy_maskset(dev, 1162, 40959, 8192); tmp___46 = b43_hf_read(dev); b43_hf_write(dev, tmp___46 | 2048ULL); } if ((unsigned int )phy->rev > 1U) { b43_phy_set(dev, 1067, 2048); } else { } b43_phy_maskset(dev, 1164, 61695, 512); if ((unsigned int )phy->rev == 2U) { b43_phy_maskset(dev, 1198, 65280, 127); b43_phy_maskset(dev, 1197, 255, 4864); } else if ((unsigned int )phy->rev > 5U) { b43_ofdmtab_write16(dev, 6656, 3, 127); b43_ofdmtab_write16(dev, 6656, 2, 127); b43_phy_mask(dev, 1197, 255); } else { } b43_calc_nrssi_slope(dev); goto ldv_37268; default: __ret_warn_on___0 = 1; tmp___47 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___47 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_g.c", 999); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); } ldv_37268: ; return; } } static void b43_radio_interference_mitigation_disable(struct b43_wldev *dev , int mode ) { struct b43_phy *phy ; struct b43_phy_g *gphy ; u32 *stack ; u16 tmp ; u16 tmp___0 ; u16 tmp___1 ; u16 tmp___2 ; u16 tmp___3 ; u16 tmp___4 ; u16 tmp___5 ; u16 tmp___6 ; u16 tmp___7 ; u16 tmp___8 ; u16 tmp___9 ; u16 tmp___10 ; u16 tmp___11 ; u16 tmp___12 ; u16 tmp___13 ; u16 tmp___14 ; u16 tmp___15 ; u16 tmp___16 ; u16 tmp___17 ; u16 tmp___18 ; u16 tmp___19 ; u16 tmp___20 ; u16 tmp___21 ; u16 tmp___22 ; u16 tmp___23 ; u16 tmp___24 ; u16 tmp___25 ; u16 tmp___26 ; u16 tmp___27 ; u16 tmp___28 ; u16 tmp___29 ; u16 tmp___30 ; u16 tmp___31 ; u16 tmp___32 ; u16 tmp___33 ; u16 tmp___34 ; u16 tmp___35 ; u16 tmp___36 ; u16 tmp___37 ; u16 tmp___38 ; u16 tmp___39 ; u16 tmp___40 ; u64 tmp___41 ; int __ret_warn_on ; long tmp___42 ; { phy = & dev->phy; gphy = phy->__annonCompField40.g; stack = (u32 *)(& gphy->interfstack); switch (mode) { case 1: ; if ((unsigned int )phy->rev != 1U) { b43_phy_mask(dev, 1067, 63487); b43_phy_set(dev, 1065, 16384); goto ldv_37283; } else { } tmp = _stack_restore(stack, 2, 120); b43_radio_write(dev, 120, (int )tmp); b43_calc_nrssi_threshold(dev); tmp___0 = _stack_restore(stack, 1, 1030); b43_phy_write(dev, 1030, (int )tmp___0); b43_phy_mask(dev, 1067, 63487); if (! dev->bad_frames_preempt) { b43_phy_mask(dev, 1025, 63487); } else { } b43_phy_set(dev, 1065, 16384); tmp___1 = _stack_restore(stack, 1, 1184); b43_phy_write(dev, 1184, (int )tmp___1); tmp___2 = _stack_restore(stack, 1, 1185); b43_phy_write(dev, 1185, (int )tmp___2); tmp___3 = _stack_restore(stack, 1, 1186); b43_phy_write(dev, 1186, (int )tmp___3); tmp___4 = _stack_restore(stack, 1, 1192); b43_phy_write(dev, 1192, (int )tmp___4); tmp___5 = _stack_restore(stack, 1, 1195); b43_phy_write(dev, 1195, (int )tmp___5); tmp___6 = _stack_restore(stack, 1, 1191); b43_phy_write(dev, 1191, (int )tmp___6); tmp___7 = _stack_restore(stack, 1, 1187); b43_phy_write(dev, 1187, (int )tmp___7); tmp___8 = _stack_restore(stack, 1, 1193); b43_phy_write(dev, 1193, (int )tmp___8); tmp___9 = _stack_restore(stack, 1, 1171); b43_phy_write(dev, 1171, (int )tmp___9); tmp___10 = _stack_restore(stack, 1, 1194); b43_phy_write(dev, 1194, (int )tmp___10); tmp___11 = _stack_restore(stack, 1, 1196); b43_phy_write(dev, 1196, (int )tmp___11); goto ldv_37283; case 2: tmp___12 = b43_phy_read(dev, 51); if (((int )tmp___12 & 2048) == 0) { goto ldv_37283; } else { } gphy->aci_enable = 0; tmp___13 = _stack_restore(stack, 1, 1025); b43_phy_write(dev, 1025, (int )tmp___13); tmp___14 = _stack_restore(stack, 1, 1065); b43_phy_write(dev, 1065, (int )tmp___14); tmp___15 = _stack_restore(stack, 1, 51); b43_phy_write(dev, 51, (int )tmp___15); tmp___16 = _stack_restore(stack, 1, 1187); b43_phy_write(dev, 1187, (int )tmp___16); tmp___17 = _stack_restore(stack, 1, 1193); b43_phy_write(dev, 1193, (int )tmp___17); tmp___18 = _stack_restore(stack, 1, 1171); b43_phy_write(dev, 1171, (int )tmp___18); tmp___19 = _stack_restore(stack, 1, 1194); b43_phy_write(dev, 1194, (int )tmp___19); tmp___20 = _stack_restore(stack, 1, 1196); b43_phy_write(dev, 1196, (int )tmp___20); tmp___21 = _stack_restore(stack, 1, 1184); b43_phy_write(dev, 1184, (int )tmp___21); tmp___22 = _stack_restore(stack, 1, 1191); b43_phy_write(dev, 1191, (int )tmp___22); if ((unsigned int )phy->rev > 1U) { tmp___23 = _stack_restore(stack, 1, 1216); b43_phy_write(dev, 1216, (int )tmp___23); tmp___24 = _stack_restore(stack, 1, 1217); b43_phy_write(dev, 1217, (int )tmp___24); } else { tmp___25 = _stack_restore(stack, 1, 1030); b43_phy_write(dev, 1030, (int )tmp___25); } tmp___26 = _stack_restore(stack, 1, 1185); b43_phy_write(dev, 1185, (int )tmp___26); tmp___27 = _stack_restore(stack, 1, 1195); b43_phy_write(dev, 1195, (int )tmp___27); tmp___28 = _stack_restore(stack, 1, 1192); b43_phy_write(dev, 1192, (int )tmp___28); if ((unsigned int )phy->rev == 2U) { tmp___29 = _stack_restore(stack, 1, 1197); b43_phy_write(dev, 1197, (int )tmp___29); tmp___30 = _stack_restore(stack, 1, 1198); b43_phy_write(dev, 1198, (int )tmp___30); } else if ((unsigned int )phy->rev > 2U) { tmp___31 = _stack_restore(stack, 1, 1197); b43_phy_write(dev, 1197, (int )tmp___31); tmp___32 = _stack_restore(stack, 1, 1045); b43_phy_write(dev, 1045, (int )tmp___32); tmp___33 = _stack_restore(stack, 1, 1046); b43_phy_write(dev, 1046, (int )tmp___33); tmp___34 = _stack_restore(stack, 1, 1047); b43_phy_write(dev, 1047, (int )tmp___34); tmp___35 = _stack_restore(stack, 3, 6658); b43_ofdmtab_write16(dev, 6656, 2, (int )tmp___35); tmp___36 = _stack_restore(stack, 3, 6659); b43_ofdmtab_write16(dev, 6656, 3, (int )tmp___36); } else { } tmp___37 = _stack_restore(stack, 1, 1186); b43_phy_write(dev, 1186, (int )tmp___37); tmp___38 = _stack_restore(stack, 1, 1162); b43_phy_write(dev, 1162, (int )tmp___38); tmp___39 = _stack_restore(stack, 1, 1067); b43_phy_write(dev, 1067, (int )tmp___39); tmp___40 = _stack_restore(stack, 1, 1164); b43_phy_write(dev, 1164, (int )tmp___40); tmp___41 = b43_hf_read(dev); b43_hf_write(dev, tmp___41 & 0xfffffffffffff7ffULL); b43_calc_nrssi_slope(dev); goto ldv_37283; default: __ret_warn_on = 1; tmp___42 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___42 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_g.c", 1080); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); } ldv_37283: ; return; } } static u16 b43_radio_core_calibration_value(struct b43_wldev *dev ) { u16 reg ; u16 index ; u16 ret ; u8 rcc_table[16U] ; { rcc_table[0] = 2U; rcc_table[1] = 3U; rcc_table[2] = 1U; rcc_table[3] = 15U; rcc_table[4] = 6U; rcc_table[5] = 7U; rcc_table[6] = 5U; rcc_table[7] = 15U; rcc_table[8] = 10U; rcc_table[9] = 11U; rcc_table[10] = 9U; rcc_table[11] = 15U; rcc_table[12] = 14U; rcc_table[13] = 15U; rcc_table[14] = 13U; rcc_table[15] = 15U; reg = b43_radio_read(dev, 96); index = (u16 )(((int )reg & 30) >> 1); ret = (int )((u16 )rcc_table[(int )index]) << 1U; ret = (u16 )(((int )((short )reg) & 1) | (int )((short )ret)); ret = (u16 )((unsigned int )ret | 32U); return (ret); } } static u16 radio2050_rfover_val(struct b43_wldev *dev , u16 phy_register , unsigned int lpd ) { struct b43_phy *phy ; struct b43_phy_g *gphy ; struct ssb_sprom *sprom ; int max_lb_gain ; u16 extlna ; u16 i ; int __ret_warn_on ; long tmp ; int __ret_warn_on___0 ; long tmp___0 ; int __ret_warn_on___1 ; long tmp___1 ; int __ret_warn_on___2 ; long tmp___2 ; int __ret_warn_on___3 ; long tmp___3 ; int __ret_warn_on___4 ; long tmp___4 ; int __ret_warn_on___5 ; long tmp___5 ; int __ret_warn_on___6 ; long tmp___6 ; { phy = & dev->phy; gphy = phy->__annonCompField40.g; sprom = & ((dev->dev)->bus)->sprom; if (! phy->gmode) { return (0U); } else { } if ((unsigned int )phy->rev > 1U || (int )phy->gmode) { max_lb_gain = (int )gphy->max_lb_gain; if ((unsigned int )phy->radio_rev == 8U) { max_lb_gain = max_lb_gain + 62; } else { max_lb_gain = max_lb_gain + 38; } if (max_lb_gain > 69) { extlna = 12288U; max_lb_gain = max_lb_gain + -70; } else if (max_lb_gain > 57) { extlna = 4096U; max_lb_gain = max_lb_gain + -58; } else if (max_lb_gain > 45) { extlna = 8192U; max_lb_gain = max_lb_gain + -46; } else { extlna = 0U; max_lb_gain = max_lb_gain + -16; } i = 0U; goto ldv_37308; ldv_37307: max_lb_gain = (int )i * -6 + max_lb_gain; if (max_lb_gain <= 5) { goto ldv_37306; } else { } i = (u16 )((int )i + 1); ldv_37308: ; if ((unsigned int )i <= 15U) { goto ldv_37307; } else { } ldv_37306: ; if ((unsigned int )phy->rev <= 6U || ((int )sprom->boardflags_lo & 4096) == 0) { if ((unsigned int )phy_register == 2065U) { return (435U); } else if ((unsigned int )phy_register == 2066U) { extlna = (u16 )((int )((short )((int )i << 8)) | (int )((short )extlna)); switch (lpd) { case 3U: ; return (3986U); case 1U: ; case 5U: ; return ((u16 )((unsigned int )extlna | 146U)); case 4U: ; return ((u16 )((unsigned int )extlna | 147U)); } __ret_warn_on = 1; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_g.c", 1166); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); } else { } __ret_warn_on___0 = 1; tmp___0 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_g.c", 1168); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); } else { if ((unsigned int )phy_register == 2065U) { return (2483U); } else if ((unsigned int )phy_register == 2066U) { if ((unsigned int )extlna != 0U) { extlna = (u16 )((unsigned int )extlna | 32768U); } else { } extlna = (u16 )((int )((short )((int )i << 8)) | (int )((short )extlna)); switch (lpd) { case 3U: ; return (36754U); case 1U: ; return ((u16 )((unsigned int )extlna | 32914U)); case 5U: ; return ((u16 )((unsigned int )extlna | 8338U)); case 4U: ; return ((u16 )((unsigned int )extlna | 8339U)); } __ret_warn_on___1 = 1; tmp___1 = ldv__builtin_expect(__ret_warn_on___1 != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_g.c", 1186); } else { } ldv__builtin_expect(__ret_warn_on___1 != 0, 0L); } else { } __ret_warn_on___2 = 1; tmp___2 = ldv__builtin_expect(__ret_warn_on___2 != 0, 0L); if (tmp___2 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_g.c", 1188); } else { } ldv__builtin_expect(__ret_warn_on___2 != 0, 0L); } } else if ((unsigned int )phy->rev <= 6U || ((int )sprom->boardflags_lo & 4096) == 0) { if ((unsigned int )phy_register == 2065U) { return (435U); } else if ((unsigned int )phy_register == 2066U) { switch (lpd) { case 3U: ; return (4018U); case 1U: ; return (178U); case 5U: ; return (12466U); case 4U: ; return (12467U); } __ret_warn_on___3 = 1; tmp___3 = ldv__builtin_expect(__ret_warn_on___3 != 0, 0L); if (tmp___3 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_g.c", 1206); } else { } ldv__builtin_expect(__ret_warn_on___3 != 0, 0L); } else { } __ret_warn_on___4 = 1; tmp___4 = ldv__builtin_expect(__ret_warn_on___4 != 0, 0L); if (tmp___4 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_g.c", 1208); } else { } ldv__builtin_expect(__ret_warn_on___4 != 0, 0L); } else { if ((unsigned int )phy_register == 2065U) { return (2483U); } else if ((unsigned int )phy_register == 2066U) { switch (lpd) { case 3U: ; return (36786U); case 1U: ; return (32946U); case 5U: ; return (8370U); case 4U: ; return (8371U); } __ret_warn_on___5 = 1; tmp___5 = ldv__builtin_expect(__ret_warn_on___5 != 0, 0L); if (tmp___5 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_g.c", 1223); } else { } ldv__builtin_expect(__ret_warn_on___5 != 0, 0L); } else { } __ret_warn_on___6 = 1; tmp___6 = ldv__builtin_expect(__ret_warn_on___6 != 0, 0L); if (tmp___6 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_g.c", 1225); } else { } ldv__builtin_expect(__ret_warn_on___6 != 0, 0L); } return (0U); } } static u16 b43_radio_init2050(struct b43_wldev *dev ) { struct b43_phy *phy ; struct init2050_saved_values sav ; u16 rcc ; u16 radio78 ; u16 ret ; u16 i ; u16 j ; u32 tmp1 ; u32 tmp2 ; u16 tmp ; u16 tmp___0 ; u16 tmp___1 ; u16 tmp___2 ; u16 tmp___3 ; u16 tmp___4 ; u16 tmp___5 ; u16 tmp___6 ; u16 tmp___7 ; u16 tmp___8 ; u16 tmp___9 ; u8 tmp___10 ; u16 tmp___11 ; u16 tmp___12 ; u16 tmp___13 ; u16 tmp___14 ; u16 tmp___15 ; u16 tmp___16 ; { phy = & dev->phy; tmp1 = 0U; tmp2 = 0U; memset((void *)(& sav), 0, 40UL); sav.radio_43 = b43_radio_read(dev, 67); sav.radio_51 = b43_radio_read(dev, 81); sav.radio_52 = b43_radio_read(dev, 82); sav.phy_pgactl = b43_phy_read(dev, 21); sav.phy_cck_5A = b43_phy_read(dev, 90); sav.phy_cck_59 = b43_phy_read(dev, 89); sav.phy_cck_58 = b43_phy_read(dev, 88); if ((unsigned int )phy->type == 1U) { sav.phy_cck_30 = b43_phy_read(dev, 48); sav.reg_3EC = b43_read16(dev, 1004); b43_phy_write(dev, 48, 255); b43_write16(dev, 1004, 16191); } else if ((int )phy->gmode || (unsigned int )phy->rev > 1U) { sav.phy_rfover = b43_phy_read(dev, 2065); sav.phy_rfoverval = b43_phy_read(dev, 2066); sav.phy_analogover = b43_phy_read(dev, 2068); sav.phy_analogoverval = b43_phy_read(dev, 2069); sav.phy_crs0 = b43_phy_read(dev, 1065); sav.phy_classctl = b43_phy_read(dev, 2050); b43_phy_set(dev, 2068, 3); b43_phy_mask(dev, 2069, 65532); b43_phy_mask(dev, 1065, 32767); b43_phy_mask(dev, 2050, 65532); if ((unsigned int )phy->rev > 1U || (int )phy->gmode) { sav.phy_lo_mask = b43_phy_read(dev, 2063); sav.phy_lo_ctl = b43_phy_read(dev, 2064); if ((unsigned int )phy->rev > 2U) { b43_phy_write(dev, 2063, 49184); } else { b43_phy_write(dev, 2063, 32800); } b43_phy_write(dev, 2064, 0); } else { } tmp = radio2050_rfover_val(dev, 2066, 3U); b43_phy_write(dev, 2066, (int )tmp); tmp___0 = radio2050_rfover_val(dev, 2065, 0U); b43_phy_write(dev, 2065, (int )tmp___0); } else { } tmp___1 = b43_read16(dev, 994); b43_write16(dev, 994, (int )((unsigned int )tmp___1 | 32768U)); sav.phy_syncctl = b43_phy_read(dev, 53); b43_phy_mask(dev, 53, 65407); sav.reg_3E6 = b43_read16(dev, 998); sav.reg_3F4 = b43_read16(dev, 1012); if ((unsigned int )phy->analog == 0U) { b43_write16(dev, 998, 290); } else { if ((unsigned int )phy->analog > 1U) { b43_phy_maskset(dev, 3, 65471, 64); } else { } tmp___2 = b43_read16(dev, 1012); b43_write16(dev, 1012, (int )((unsigned int )tmp___2 | 8192U)); } rcc = b43_radio_core_calibration_value(dev); if ((unsigned int )phy->type == 1U) { b43_radio_write(dev, 120, 38); } else { } if ((int )phy->gmode || (unsigned int )phy->rev > 1U) { tmp___3 = radio2050_rfover_val(dev, 2066, 3U); b43_phy_write(dev, 2066, (int )tmp___3); } else { } b43_phy_write(dev, 21, 49071); b43_phy_write(dev, 43, 5123); if ((int )phy->gmode || (unsigned int )phy->rev > 1U) { tmp___4 = radio2050_rfover_val(dev, 2066, 1U); b43_phy_write(dev, 2066, (int )tmp___4); } else { } b43_phy_write(dev, 21, 49056); b43_radio_set(dev, 81, 4); if ((unsigned int )phy->radio_rev == 8U) { b43_radio_write(dev, 67, 31); } else { b43_radio_write(dev, 82, 0); b43_radio_maskset(dev, 67, 65520, 9); } b43_phy_write(dev, 88, 0); i = 0U; goto ldv_37375; ldv_37374: b43_phy_write(dev, 90, 1152); b43_phy_write(dev, 89, 51216); b43_phy_write(dev, 88, 13); if ((int )phy->gmode || (unsigned int )phy->rev > 1U) { tmp___5 = radio2050_rfover_val(dev, 2066, 5U); b43_phy_write(dev, 2066, (int )tmp___5); } else { } b43_phy_write(dev, 21, 44976); __const_udelay(42950UL); if ((int )phy->gmode || (unsigned int )phy->rev > 1U) { tmp___6 = radio2050_rfover_val(dev, 2066, 5U); b43_phy_write(dev, 2066, (int )tmp___6); } else { } b43_phy_write(dev, 21, 61360); __const_udelay(42950UL); if ((int )phy->gmode || (unsigned int )phy->rev > 1U) { tmp___7 = radio2050_rfover_val(dev, 2066, 4U); b43_phy_write(dev, 2066, (int )tmp___7); } else { } b43_phy_write(dev, 21, 65520); __const_udelay(85900UL); tmp___8 = b43_phy_read(dev, 45); tmp1 = (u32 )tmp___8 + tmp1; b43_phy_write(dev, 88, 0); if ((int )phy->gmode || (unsigned int )phy->rev > 1U) { tmp___9 = radio2050_rfover_val(dev, 2066, 5U); b43_phy_write(dev, 2066, (int )tmp___9); } else { } b43_phy_write(dev, 21, 44976); i = (u16 )((int )i + 1); ldv_37375: ; if ((unsigned int )i <= 15U) { goto ldv_37374; } else { } __const_udelay(42950UL); b43_phy_write(dev, 88, 0); tmp1 = tmp1 + 1U; tmp1 = tmp1 >> 9; i = 0U; goto ldv_37382; ldv_37381: tmp___10 = bitrev8((int )((u8 )i)); radio78 = (u16 )((int )((short )(((int )tmp___10 >> 4) << 1)) | 32); b43_radio_write(dev, 120, (int )radio78); __const_udelay(42950UL); j = 0U; goto ldv_37378; ldv_37377: b43_phy_write(dev, 90, 3456); b43_phy_write(dev, 89, 51216); b43_phy_write(dev, 88, 13); if ((int )phy->gmode || (unsigned int )phy->rev > 1U) { tmp___11 = radio2050_rfover_val(dev, 2066, 5U); b43_phy_write(dev, 2066, (int )tmp___11); } else { } b43_phy_write(dev, 21, 44976); __const_udelay(42950UL); if ((int )phy->gmode || (unsigned int )phy->rev > 1U) { tmp___12 = radio2050_rfover_val(dev, 2066, 5U); b43_phy_write(dev, 2066, (int )tmp___12); } else { } b43_phy_write(dev, 21, 61360); __const_udelay(42950UL); if ((int )phy->gmode || (unsigned int )phy->rev > 1U) { tmp___13 = radio2050_rfover_val(dev, 2066, 4U); b43_phy_write(dev, 2066, (int )tmp___13); } else { } b43_phy_write(dev, 21, 65520); __const_udelay(42950UL); tmp___14 = b43_phy_read(dev, 45); tmp2 = (u32 )tmp___14 + tmp2; b43_phy_write(dev, 88, 0); if ((int )phy->gmode || (unsigned int )phy->rev > 1U) { tmp___15 = radio2050_rfover_val(dev, 2066, 5U); b43_phy_write(dev, 2066, (int )tmp___15); } else { } b43_phy_write(dev, 21, 44976); j = (u16 )((int )j + 1); ldv_37378: ; if ((unsigned int )j <= 15U) { goto ldv_37377; } else { } tmp2 = tmp2 + 1U; tmp2 = tmp2 >> 8; if (tmp1 < tmp2) { goto ldv_37380; } else { } i = (u16 )((int )i + 1); ldv_37382: ; if ((unsigned int )i <= 15U) { goto ldv_37381; } else { } ldv_37380: b43_phy_write(dev, 21, (int )sav.phy_pgactl); b43_radio_write(dev, 81, (int )sav.radio_51); b43_radio_write(dev, 82, (int )sav.radio_52); b43_radio_write(dev, 67, (int )sav.radio_43); b43_phy_write(dev, 90, (int )sav.phy_cck_5A); b43_phy_write(dev, 89, (int )sav.phy_cck_59); b43_phy_write(dev, 88, (int )sav.phy_cck_58); b43_write16(dev, 998, (int )sav.reg_3E6); if ((unsigned int )phy->analog != 0U) { b43_write16(dev, 1012, (int )sav.reg_3F4); } else { } b43_phy_write(dev, 53, (int )sav.phy_syncctl); b43_synth_pu_workaround(dev, (int )((u8 )phy->channel)); if ((unsigned int )phy->type == 1U) { b43_phy_write(dev, 48, (int )sav.phy_cck_30); b43_write16(dev, 1004, (int )sav.reg_3EC); } else if ((int )phy->gmode) { tmp___16 = b43_read16(dev, 994); b43_write16(dev, 994, (int )tmp___16 & 32767); b43_phy_write(dev, 2065, (int )sav.phy_rfover); b43_phy_write(dev, 2066, (int )sav.phy_rfoverval); b43_phy_write(dev, 2068, (int )sav.phy_analogover); b43_phy_write(dev, 2069, (int )sav.phy_analogoverval); b43_phy_write(dev, 1065, (int )sav.phy_crs0); b43_phy_write(dev, 2050, (int )sav.phy_classctl); if ((unsigned int )phy->rev > 1U || (int )phy->gmode) { b43_phy_write(dev, 2063, (int )sav.phy_lo_mask); b43_phy_write(dev, 2064, (int )sav.phy_lo_ctl); } else { } } else { } if ((unsigned int )i > 15U) { ret = radio78; } else { ret = rcc; } return (ret); } } static void b43_phy_initb5(struct b43_wldev *dev ) { struct ssb_bus *bus ; struct b43_phy *phy ; struct b43_phy_g *gphy ; u16 offset ; u16 value ; u8 old_channel ; u16 tmp ; { bus = (dev->dev)->bus; phy = & dev->phy; gphy = phy->__annonCompField40.g; if ((unsigned int )phy->analog == 1U) { b43_radio_set(dev, 122, 80); } else { } if ((unsigned int )bus->boardinfo.vendor != 5348U && (unsigned int )bus->boardinfo.type != 1046U) { value = 8480U; offset = 168U; goto ldv_37393; ldv_37392: b43_phy_write(dev, (int )offset, (int )value); value = (unsigned int )value + 514U; offset = (u16 )((int )offset + 1); ldv_37393: ; if ((unsigned int )offset <= 198U) { goto ldv_37392; } else { } } else { } b43_phy_maskset(dev, 53, 61695, 1792); if ((unsigned int )phy->radio_ver == 8272U) { b43_phy_write(dev, 56, 1639); } else { } if ((int )phy->gmode || (unsigned int )phy->rev > 1U) { if ((unsigned int )phy->radio_ver == 8272U) { b43_radio_set(dev, 122, 32); b43_radio_set(dev, 81, 4); } else { } b43_write16(dev, 994, 0); b43_phy_set(dev, 2050, 256); b43_phy_set(dev, 1067, 8192); b43_phy_write(dev, 28, 6250); b43_phy_maskset(dev, 19, 255, 6400); b43_phy_maskset(dev, 53, 65472, 100); b43_phy_maskset(dev, 93, 65408, 10); } else { } if ((int )dev->bad_frames_preempt) { b43_phy_set(dev, 1025, 2048); } else { } if ((unsigned int )phy->analog == 1U) { b43_phy_write(dev, 38, 52736); b43_phy_write(dev, 33, 14179); b43_phy_write(dev, 34, 7107); b43_phy_write(dev, 35, 1785); b43_phy_write(dev, 36, 894); } else { b43_phy_write(dev, 38, 52224); } b43_phy_write(dev, 48, 198); b43_write16(dev, 1004, 16162); if ((unsigned int )phy->analog == 1U) { b43_phy_write(dev, 32, 15900); } else { b43_phy_write(dev, 32, 12316); } if ((unsigned int )phy->analog == 0U) { b43_write16(dev, 996, 12288); } else { } old_channel = (u8 )phy->channel; b43_gphy_channel_switch(dev, 7U, 0); if ((unsigned int )phy->radio_ver != 8272U) { b43_radio_write(dev, 117, 128); b43_radio_write(dev, 121, 129); } else { } b43_radio_write(dev, 80, 32); b43_radio_write(dev, 80, 35); if ((unsigned int )phy->radio_ver == 8272U) { b43_radio_write(dev, 80, 32); b43_radio_write(dev, 90, 112); } else { } b43_radio_write(dev, 91, 123); b43_radio_write(dev, 92, 176); b43_radio_set(dev, 122, 7); b43_gphy_channel_switch(dev, (unsigned int )old_channel, 0); b43_phy_write(dev, 20, 128); b43_phy_write(dev, 50, 202); b43_phy_write(dev, 42, 34979); b43_set_txpower_g(dev, (struct b43_bbatt const *)(& gphy->bbatt), (struct b43_rfatt const *)(& gphy->rfatt), (int )gphy->tx_control); if ((unsigned int )phy->radio_ver == 8272U) { b43_radio_write(dev, 93, 13); } else { } tmp = b43_read16(dev, 996); b43_write16(dev, 996, (int )((u16 )(((int )((short )tmp) & -64) | 4))); return; } } static void b43_phy_initb6(struct b43_wldev *dev ) { struct b43_phy *phy ; struct b43_phy_g *gphy ; u16 offset ; u16 val ; u8 old_channel ; u16 tmp ; u64 tmp___0 ; int __ret_warn_on ; long tmp___1 ; u16 tmp___2 ; int __ret_warn_on___0 ; long tmp___3 ; { phy = & dev->phy; gphy = phy->__annonCompField40.g; b43_phy_write(dev, 62, 33146); tmp = b43_radio_read(dev, 122); b43_radio_write(dev, 122, (int )((unsigned int )tmp | 88U)); if ((unsigned int )phy->radio_rev == 4U || (unsigned int )phy->radio_rev == 5U) { b43_radio_write(dev, 81, 55); b43_radio_write(dev, 82, 112); b43_radio_write(dev, 83, 179); b43_radio_write(dev, 84, 155); b43_radio_write(dev, 90, 136); b43_radio_write(dev, 91, 136); b43_radio_write(dev, 93, 136); b43_radio_write(dev, 94, 136); b43_radio_write(dev, 125, 136); tmp___0 = b43_hf_read(dev); b43_hf_write(dev, tmp___0 | 512ULL); } else { } __ret_warn_on = (unsigned int )phy->radio_rev == 6U || (unsigned int )phy->radio_rev == 7U; tmp___1 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_g.c", 1614); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); if ((unsigned int )phy->radio_rev == 8U) { b43_radio_write(dev, 81, 0); b43_radio_write(dev, 82, 64); b43_radio_write(dev, 83, 183); b43_radio_write(dev, 84, 152); b43_radio_write(dev, 90, 136); b43_radio_write(dev, 91, 107); b43_radio_write(dev, 92, 15); if ((int )((short )((dev->dev)->bus)->sprom.boardflags_lo) < 0) { b43_radio_write(dev, 93, 250); b43_radio_write(dev, 94, 216); } else { b43_radio_write(dev, 93, 245); b43_radio_write(dev, 94, 184); } b43_radio_write(dev, 115, 3); b43_radio_write(dev, 125, 168); b43_radio_write(dev, 124, 1); b43_radio_write(dev, 126, 8); } else { } val = 7711U; offset = 136U; goto ldv_37406; ldv_37405: b43_phy_write(dev, (int )offset, (int )val); val = (unsigned int )val + 65022U; offset = (u16 )((int )offset + 1); ldv_37406: ; if ((unsigned int )offset <= 151U) { goto ldv_37405; } else { } val = 15935U; offset = 152U; goto ldv_37409; ldv_37408: b43_phy_write(dev, (int )offset, (int )val); val = (unsigned int )val + 65022U; offset = (u16 )((int )offset + 1); ldv_37409: ; if ((unsigned int )offset <= 167U) { goto ldv_37408; } else { } val = 8480U; offset = 168U; goto ldv_37412; ldv_37411: b43_phy_write(dev, (int )offset, (int )val & 16191); val = (unsigned int )val + 514U; offset = (u16 )((int )offset + 1); ldv_37412: ; if ((unsigned int )offset <= 199U) { goto ldv_37411; } else { } if ((unsigned int )phy->type == 2U) { b43_radio_set(dev, 122, 32); b43_radio_set(dev, 81, 4); b43_phy_set(dev, 2050, 256); b43_phy_set(dev, 1067, 8192); b43_phy_write(dev, 91, 0); b43_phy_write(dev, 92, 0); } else { } old_channel = (u8 )phy->channel; if ((unsigned int )old_channel > 7U) { b43_gphy_channel_switch(dev, 1U, 0); } else { b43_gphy_channel_switch(dev, 13U, 0); } b43_radio_write(dev, 80, 32); b43_radio_write(dev, 80, 35); __const_udelay(171800UL); if ((unsigned int )phy->radio_rev <= 5U || (unsigned int )phy->radio_rev == 8U) { tmp___2 = b43_radio_read(dev, 124); b43_radio_write(dev, 124, (int )((unsigned int )tmp___2 | 2U)); b43_radio_write(dev, 80, 32); } else { } if ((unsigned int )phy->radio_rev <= 2U) { b43_radio_write(dev, 124, 32); b43_radio_write(dev, 90, 112); b43_radio_write(dev, 91, 123); b43_radio_write(dev, 92, 176); } else { } b43_radio_maskset(dev, 122, 248, 7); b43_gphy_channel_switch(dev, (unsigned int )old_channel, 0); b43_phy_write(dev, 20, 512); if ((unsigned int )phy->radio_rev > 5U) { b43_phy_write(dev, 42, 35010); } else { b43_phy_write(dev, 42, 35520); } b43_phy_write(dev, 56, 1640); b43_set_txpower_g(dev, (struct b43_bbatt const *)(& gphy->bbatt), (struct b43_rfatt const *)(& gphy->rfatt), (int )gphy->tx_control); if ((unsigned int )phy->radio_rev <= 5U) { b43_phy_maskset(dev, 93, 65408, 3); } else { } if ((unsigned int )phy->radio_rev <= 2U) { b43_radio_write(dev, 93, 13); } else { } if ((unsigned int )phy->analog == 4U) { b43_write16(dev, 996, 9); b43_phy_mask(dev, 97, 4095); } else { b43_phy_maskset(dev, 2, 65472, 4); } if ((unsigned int )phy->type == 1U) { __ret_warn_on___0 = 1; tmp___3 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___3 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_g.c", 1703); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); } else if ((unsigned int )phy->type == 2U) { b43_write16(dev, 998, 0); } else { } return; } } static void b43_calc_loopback_gain(struct b43_wldev *dev ) { struct b43_phy *phy ; struct b43_phy_g *gphy ; u16 backup_phy[16U] ; unsigned int tmp ; u16 backup_radio[3U] ; u16 backup_bband ; u16 i ; u16 j ; u16 loop_i_max ; u16 trsw_rx ; u16 loop1_outer_done ; u16 loop1_inner_done ; u16 tmp___0 ; u16 tmp___1 ; { phy = & dev->phy; gphy = phy->__annonCompField40.g; backup_phy[0] = 0U; tmp = 1U; while (1) { if (tmp >= 16U) { break; } else { } backup_phy[tmp] = (unsigned short)0; tmp = tmp + 1U; } backup_phy[0] = b43_phy_read(dev, 1065); backup_phy[1] = b43_phy_read(dev, 1); backup_phy[2] = b43_phy_read(dev, 2065); backup_phy[3] = b43_phy_read(dev, 2066); if ((unsigned int )phy->rev != 1U) { backup_phy[4] = b43_phy_read(dev, 2068); backup_phy[5] = b43_phy_read(dev, 2069); } else { } backup_phy[6] = b43_phy_read(dev, 90); backup_phy[7] = b43_phy_read(dev, 89); backup_phy[8] = b43_phy_read(dev, 88); backup_phy[9] = b43_phy_read(dev, 10); backup_phy[10] = b43_phy_read(dev, 3); backup_phy[11] = b43_phy_read(dev, 2063); backup_phy[12] = b43_phy_read(dev, 2064); backup_phy[13] = b43_phy_read(dev, 43); backup_phy[14] = b43_phy_read(dev, 21); backup_phy[15] = b43_phy_read(dev, 45); backup_bband = (u16 )gphy->bbatt.att; backup_radio[0] = b43_radio_read(dev, 82); backup_radio[1] = b43_radio_read(dev, 67); backup_radio[2] = b43_radio_read(dev, 122); b43_phy_mask(dev, 1065, 16383); b43_phy_set(dev, 1, 32768); b43_phy_set(dev, 2065, 2); b43_phy_mask(dev, 2066, 65533); b43_phy_set(dev, 2065, 1); b43_phy_mask(dev, 2066, 65534); if ((unsigned int )phy->rev != 1U) { b43_phy_set(dev, 2068, 1); b43_phy_mask(dev, 2069, 65534); b43_phy_set(dev, 2068, 2); b43_phy_mask(dev, 2069, 65533); } else { } b43_phy_set(dev, 2065, 12); b43_phy_set(dev, 2066, 12); b43_phy_set(dev, 2065, 48); b43_phy_maskset(dev, 2066, 65487, 16); b43_phy_write(dev, 90, 1920); b43_phy_write(dev, 89, 51216); b43_phy_write(dev, 88, 13); b43_phy_set(dev, 10, 8192); if ((unsigned int )phy->rev != 1U) { b43_phy_set(dev, 2068, 4); b43_phy_mask(dev, 2069, 65531); } else { } b43_phy_maskset(dev, 3, 65439, 64); if ((unsigned int )phy->radio_rev == 8U) { b43_radio_write(dev, 67, 15); } else { b43_radio_write(dev, 82, 0); b43_radio_maskset(dev, 67, 65520, 9); } b43_gphy_set_baseband_attenuation(dev, 11); if ((unsigned int )phy->rev > 2U) { b43_phy_write(dev, 2063, 49184); } else { b43_phy_write(dev, 2063, 32800); } b43_phy_write(dev, 2064, 0); b43_phy_maskset(dev, 43, 65472, 1); b43_phy_maskset(dev, 43, 49407, 2048); b43_phy_set(dev, 2065, 256); b43_phy_mask(dev, 2066, 53247); if (((int )((dev->dev)->bus)->sprom.boardflags_lo & 4096) != 0) { if ((unsigned int )phy->rev > 6U) { b43_phy_set(dev, 2065, 2048); b43_phy_set(dev, 2066, 32768); } else { } } else { } b43_radio_mask(dev, 122, 247); j = 0U; loop_i_max = (unsigned int )phy->radio_rev == 8U ? 15U : 9U; i = 0U; goto ldv_37435; ldv_37434: j = 0U; goto ldv_37432; ldv_37431: b43_radio_write(dev, 67, (int )i); b43_phy_maskset(dev, 2066, 61695, (int )j << 8U); b43_phy_maskset(dev, 21, 4095, 40960); b43_phy_set(dev, 21, 61440); __const_udelay(85900UL); tmp___0 = b43_phy_read(dev, 45); if ((unsigned int )tmp___0 > 3579U) { goto exit_loop1; } else { } j = (u16 )((int )j + 1); ldv_37432: ; if ((unsigned int )j <= 15U) { goto ldv_37431; } else { } i = (u16 )((int )i + 1); ldv_37435: ; if ((int )i < (int )loop_i_max) { goto ldv_37434; } else { } exit_loop1: loop1_outer_done = i; loop1_inner_done = j; if ((unsigned int )j > 7U) { b43_phy_set(dev, 2066, 48); trsw_rx = 27U; j = (unsigned int )j + 65528U; goto ldv_37439; ldv_37438: b43_phy_maskset(dev, 2066, 61695, (int )j << 8U); b43_phy_maskset(dev, 21, 4095, 40960); b43_phy_set(dev, 21, 61440); __const_udelay(85900UL); trsw_rx = (unsigned int )trsw_rx + 65533U; tmp___1 = b43_phy_read(dev, 45); if ((unsigned int )tmp___1 > 3579U) { goto exit_loop2; } else { } j = (u16 )((int )j + 1); ldv_37439: ; if ((unsigned int )j <= 15U) { goto ldv_37438; } else { } } else { trsw_rx = 24U; } exit_loop2: ; if ((unsigned int )phy->rev != 1U) { b43_phy_write(dev, 2068, (int )backup_phy[4]); b43_phy_write(dev, 2069, (int )backup_phy[5]); } else { } b43_phy_write(dev, 90, (int )backup_phy[6]); b43_phy_write(dev, 89, (int )backup_phy[7]); b43_phy_write(dev, 88, (int )backup_phy[8]); b43_phy_write(dev, 10, (int )backup_phy[9]); b43_phy_write(dev, 3, (int )backup_phy[10]); b43_phy_write(dev, 2063, (int )backup_phy[11]); b43_phy_write(dev, 2064, (int )backup_phy[12]); b43_phy_write(dev, 43, (int )backup_phy[13]); b43_phy_write(dev, 21, (int )backup_phy[14]); b43_gphy_set_baseband_attenuation(dev, (int )backup_bband); b43_radio_write(dev, 82, (int )backup_radio[0]); b43_radio_write(dev, 67, (int )backup_radio[1]); b43_radio_write(dev, 122, (int )backup_radio[2]); b43_phy_write(dev, 2065, (int )((unsigned int )backup_phy[2] | 3U)); __const_udelay(42950UL); b43_phy_write(dev, 2065, (int )backup_phy[2]); b43_phy_write(dev, 2066, (int )backup_phy[3]); b43_phy_write(dev, 1065, (int )backup_phy[0]); b43_phy_write(dev, 1, (int )backup_phy[1]); gphy->max_lb_gain = (s16 )(((unsigned int )loop1_inner_done * 6U + (unsigned int )loop1_outer_done * 65532U) + 65525U); gphy->trsw_rx_gain = (s16 )((unsigned int )trsw_rx * 2U); return; } } static void b43_hardware_pctl_early_init(struct b43_wldev *dev ) { struct b43_phy *phy ; bool tmp ; int tmp___0 ; { phy = & dev->phy; tmp = b43_has_hardware_pctl(dev); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { b43_phy_write(dev, 1146, 49425); return; } else { } b43_phy_mask(dev, 54, 65279); b43_phy_write(dev, 47, 514); b43_phy_set(dev, 1148, 2); b43_phy_set(dev, 1146, 61440); if ((unsigned int )phy->radio_ver == 8272U && (unsigned int )phy->radio_rev == 8U) { b43_phy_maskset(dev, 1146, 65295, 16); b43_phy_set(dev, 93, 32768); b43_phy_maskset(dev, 78, 65472, 16); b43_phy_write(dev, 46, 49279); b43_phy_set(dev, 54, 1024); } else { b43_phy_set(dev, 54, 512); b43_phy_set(dev, 54, 1024); b43_phy_mask(dev, 93, 32767); b43_phy_mask(dev, 79, 65534); b43_phy_maskset(dev, 78, 65472, 16); b43_phy_write(dev, 46, 49279); b43_phy_maskset(dev, 1146, 65295, 16); } return; } } static void b43_hardware_pctl_init_gphy(struct b43_wldev *dev ) { struct b43_phy *phy ; struct b43_phy_g *gphy ; u64 tmp ; bool tmp___0 ; int tmp___1 ; int __ret_warn_on ; long tmp___2 ; u64 tmp___3 ; { phy = & dev->phy; gphy = phy->__annonCompField40.g; tmp___0 = b43_has_hardware_pctl(dev); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { tmp = b43_hf_read(dev); b43_hf_write(dev, tmp & 0xffffffffff7fffffULL); return; } else { } b43_phy_maskset(dev, 54, 65472, (int )((u16 )gphy->tgt_idle_tssi) - (int )((u16 )gphy->cur_idle_tssi)); b43_phy_maskset(dev, 1144, 65280, (int )((u16 )gphy->tgt_idle_tssi) - (int )((u16 )gphy->cur_idle_tssi)); b43_gphy_tssi_power_lt_init(dev); b43_gphy_gain_lt_init(dev); b43_phy_mask(dev, 96, 65471); b43_phy_write(dev, 20, 0); __ret_warn_on = (unsigned int )phy->rev <= 5U; tmp___2 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___2 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_g.c", 1911); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); b43_phy_set(dev, 1144, 2048); b43_phy_mask(dev, 1144, 65279); b43_phy_mask(dev, 2049, 65471); b43_gphy_dc_lt_init(dev, 1); tmp___3 = b43_hf_read(dev); b43_hf_write(dev, tmp___3 | 8388608ULL); return; } } static void b43_phy_init_pctl(struct b43_wldev *dev ) { struct ssb_bus *bus ; struct b43_phy *phy ; struct b43_phy_g *gphy ; struct b43_rfatt old_rfatt ; struct b43_bbatt old_bbatt ; u8 old_tx_control ; int __ret_warn_on ; long tmp ; u16 tmp___0 ; struct b43_rfatt rfatt ; struct b43_bbatt bbatt ; size_t __len ; void *__ret ; size_t __len___0 ; void *__ret___0 ; u16 tmp___1 ; long __x ; { bus = (dev->dev)->bus; phy = & dev->phy; gphy = phy->__annonCompField40.g; old_tx_control = 0U; __ret_warn_on = (unsigned int )phy->type != 2U; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_g.c", 1932); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); if ((unsigned int )bus->boardinfo.vendor == 5348U && (unsigned int )bus->boardinfo.type == 1046U) { return; } else { } b43_phy_write(dev, 40, 32792); tmp___0 = b43_read16(dev, 998); b43_write16(dev, 998, (int )tmp___0 & 65503); if (! phy->gmode) { return; } else { } b43_hardware_pctl_early_init(dev); if (gphy->cur_idle_tssi == 0) { if ((unsigned int )phy->radio_ver == 8272U && (unsigned int )phy->analog == 0U) { b43_radio_maskset(dev, 118, 247, 132); } else { __len = 2UL; if (__len > 63UL) { __ret = memcpy((void *)(& old_rfatt), (void const *)(& gphy->rfatt), __len); } else { __ret = __builtin_memcpy((void *)(& old_rfatt), (void const *)(& gphy->rfatt), __len); } __len___0 = 1UL; if (__len___0 > 63UL) { __ret___0 = memcpy((void *)(& old_bbatt), (void const *)(& gphy->bbatt), __len___0); } else { __ret___0 = __builtin_memcpy((void *)(& old_bbatt), (void const *)(& gphy->bbatt), __len___0); } old_tx_control = gphy->tx_control; bbatt.att = 11U; if ((unsigned int )phy->radio_rev == 8U) { rfatt.att = 15U; rfatt.with_padmix = 1; } else { rfatt.att = 9U; rfatt.with_padmix = 0; } b43_set_txpower_g(dev, (struct b43_bbatt const *)(& bbatt), (struct b43_rfatt const *)(& rfatt), 0); } b43_dummy_transmission(dev, 0, 1); tmp___1 = b43_phy_read(dev, 41); gphy->cur_idle_tssi = (int )tmp___1; __x = (long )(gphy->cur_idle_tssi - gphy->tgt_idle_tssi); if ((__x < 0L ? - __x : __x) > 19L) { b43dbg(dev->wl, "!WARNING! Idle-TSSI phy->cur_idle_tssi measuring failed. (cur=%d, tgt=%d). Disabling TX power adjustment.\n", gphy->cur_idle_tssi, gphy->tgt_idle_tssi); gphy->cur_idle_tssi = 0; } else { } if ((unsigned int )phy->radio_ver == 8272U && (unsigned int )phy->analog == 0U) { b43_radio_mask(dev, 118, 65403); } else { b43_set_txpower_g(dev, (struct b43_bbatt const *)(& old_bbatt), (struct b43_rfatt const *)(& old_rfatt), (int )old_tx_control); } } else { } b43_hardware_pctl_init_gphy(dev); b43_shm_clear_tssi(dev); return; } } static void b43_phy_initg(struct b43_wldev *dev ) { struct b43_phy *phy ; struct b43_phy_g *gphy ; u16 tmp ; u16 tmp___0 ; int __ret_warn_on ; long tmp___1 ; { phy = & dev->phy; gphy = phy->__annonCompField40.g; if ((unsigned int )phy->rev == 1U) { b43_phy_initb5(dev); } else { b43_phy_initb6(dev); } if ((unsigned int )phy->rev > 1U || (int )phy->gmode) { b43_phy_inita(dev); } else { } if ((unsigned int )phy->rev > 1U) { b43_phy_write(dev, 2068, 0); b43_phy_write(dev, 2069, 0); } else { } if ((unsigned int )phy->rev == 2U) { b43_phy_write(dev, 2065, 0); b43_phy_write(dev, 21, 192); } else { } if ((unsigned int )phy->rev > 5U) { b43_phy_write(dev, 2065, 1024); b43_phy_write(dev, 21, 192); } else { } if ((int )phy->gmode || (unsigned int )phy->rev > 1U) { tmp = b43_phy_read(dev, 1024); tmp = (unsigned int )tmp & 255U; if ((unsigned int )tmp == 3U || (unsigned int )tmp == 5U) { b43_phy_write(dev, 1218, 6166); b43_phy_write(dev, 1219, 32774); } else { } if ((unsigned int )tmp == 5U) { b43_phy_maskset(dev, 1228, 255, 7936); } else { } } else { } if (((unsigned int )phy->rev <= 2U && (int )phy->gmode) || (unsigned int )phy->rev > 1U) { b43_phy_write(dev, 1150, 120); } else { } if ((unsigned int )phy->radio_rev == 8U) { b43_phy_set(dev, 2049, 128); b43_phy_set(dev, 1086, 4); } else { } if ((unsigned int )phy->rev > 1U || (int )phy->gmode) { b43_calc_loopback_gain(dev); } else { } if ((unsigned int )phy->radio_rev != 8U) { if ((unsigned int )gphy->initval == 65535U) { gphy->initval = b43_radio_init2050(dev); } else { b43_radio_write(dev, 120, (int )gphy->initval); } } else { } b43_lo_g_init(dev); if (((unsigned int )phy->rev > 1U && (unsigned int )phy->radio_ver == 8272U) && (unsigned int )phy->radio_rev == 8U) { tmp___0 = b43_radio_read(dev, 82); b43_radio_write(dev, 82, (int )((u16 )((((int )((short )tmp___0) & -256) | (int )((short )(gphy->lo_control)->tx_bias)) | (int )((short )(gphy->lo_control)->tx_magn)))); } else { b43_radio_maskset(dev, 82, 65520, (int )(gphy->lo_control)->tx_bias); } if ((unsigned int )phy->rev > 5U) { b43_phy_maskset(dev, 54, 4095, (int )((u16 )(gphy->lo_control)->tx_bias) << 12U); } else { } if (((int )((dev->dev)->bus)->sprom.boardflags_lo & 2) != 0) { b43_phy_write(dev, 46, 32885); } else { b43_phy_write(dev, 46, 32895); } if ((unsigned int )phy->rev <= 1U) { b43_phy_write(dev, 47, 257); } else { b43_phy_write(dev, 47, 514); } if ((int )phy->gmode || (unsigned int )phy->rev > 1U) { b43_lo_g_adjust(dev); b43_phy_write(dev, 2063, 32888); } else { } if (((int )((dev->dev)->bus)->sprom.boardflags_lo & 8) == 0) { b43_nrssi_hw_update(dev, 65535); b43_calc_nrssi_threshold(dev); } else if ((int )phy->gmode || (unsigned int )phy->rev > 1U) { if ((int )gphy->nrssi[0] == -1000) { __ret_warn_on = (int )gphy->nrssi[1] != -1000; tmp___1 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_g.c", 2080); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); b43_calc_nrssi_slope(dev); } else { b43_calc_nrssi_threshold(dev); } } else { } if ((unsigned int )phy->radio_rev == 8U) { b43_phy_write(dev, 2053, 12848); } else { } b43_phy_init_pctl(dev); if ((unsigned int )((dev->dev)->bus)->chip_id == 17158U && (unsigned int )((dev->dev)->bus)->chip_package == 2U) { b43_phy_mask(dev, 1065, 49151); b43_phy_mask(dev, 1219, 32767); } else { } return; } } void b43_gphy_channel_switch(struct b43_wldev *dev , unsigned int channel , bool synthetic_pu_workaround ) { u16 tmp ; u64 tmp___0 ; u64 tmp___1 ; u16 tmp___2 ; u16 tmp___3 ; { if ((int )synthetic_pu_workaround) { b43_synth_pu_workaround(dev, (int )((u8 )channel)); } else { } tmp = channel2freq_bg((int )((u8 )channel)); b43_write16(dev, 1008, (int )tmp); if (channel == 14U) { if ((unsigned int )((dev->dev)->bus)->sprom.country_code == 5U) { tmp___0 = b43_hf_read(dev); b43_hf_write(dev, tmp___0 & 0xffffffffffffff7fULL); } else { tmp___1 = b43_hf_read(dev); b43_hf_write(dev, tmp___1 | 128ULL); } tmp___2 = b43_read16(dev, 1012); b43_write16(dev, 1012, (int )((unsigned int )tmp___2 | 2048U)); } else { tmp___3 = b43_read16(dev, 1012); b43_write16(dev, 1012, (int )tmp___3 & 63423); } return; } } static void default_baseband_attenuation(struct b43_wldev *dev , struct b43_bbatt *bb ) { struct b43_phy *phy ; { phy = & dev->phy; if ((unsigned int )phy->radio_ver == 8272U && (unsigned int )phy->radio_rev <= 5U) { bb->att = 0U; } else { bb->att = 2U; } return; } } static void default_radio_attenuation(struct b43_wldev *dev , struct b43_rfatt *rf ) { struct ssb_bus *bus ; struct b43_phy *phy ; { bus = (dev->dev)->bus; phy = & dev->phy; rf->with_padmix = 0; if ((unsigned int )bus->boardinfo.vendor == 5348U && (unsigned int )bus->boardinfo.type == 1057U) { if ((unsigned int )bus->boardinfo.rev <= 66U) { rf->att = 2U; return; } else if ((unsigned int )bus->boardinfo.rev <= 80U) { rf->att = 3U; return; } else { } } else { } if ((unsigned int )phy->type == 0U) { rf->att = 96U; return; } else { } switch ((int )phy->radio_ver) { case 8275: ; switch ((int )phy->radio_rev) { case 1: rf->att = 6U; return; } goto ldv_37499; case 8272: ; switch ((int )phy->radio_rev) { case 0: rf->att = 5U; return; case 1: ; if ((unsigned int )phy->type == 2U) { if (((unsigned int )bus->boardinfo.vendor == 5348U && (unsigned int )bus->boardinfo.type == 1057U) && (unsigned int )bus->boardinfo.rev > 29U) { rf->att = 3U; } else if ((unsigned int )bus->boardinfo.vendor == 5348U && (unsigned int )bus->boardinfo.type == 1046U) { rf->att = 3U; } else { rf->att = 1U; } } else if (((unsigned int )bus->boardinfo.vendor == 5348U && (unsigned int )bus->boardinfo.type == 1057U) && (unsigned int )bus->boardinfo.rev > 29U) { rf->att = 7U; } else { rf->att = 6U; } return; case 2: ; if ((unsigned int )phy->type == 2U) { if (((unsigned int )bus->boardinfo.vendor == 5348U && (unsigned int )bus->boardinfo.type == 1057U) && (unsigned int )bus->boardinfo.rev > 29U) { rf->att = 3U; } else if ((unsigned int )bus->boardinfo.vendor == 5348U && (unsigned int )bus->boardinfo.type == 1046U) { rf->att = 5U; } else if ((unsigned int )bus->chip_id == 17184U) { rf->att = 4U; } else { rf->att = 3U; } } else { rf->att = 6U; } return; case 3: rf->att = 5U; return; case 4: ; case 5: rf->att = 1U; return; case 6: ; case 7: rf->att = 5U; return; case 8: rf->att = 10U; rf->with_padmix = 1; return; case 9: ; default: rf->att = 5U; return; } } ldv_37499: rf->att = 5U; return; } } static u16 default_tx_control(struct b43_wldev *dev ) { struct b43_phy *phy ; { phy = & dev->phy; if ((unsigned int )phy->radio_ver != 8272U) { return (0U); } else { } if ((unsigned int )phy->radio_rev == 1U) { return (48U); } else { } if ((unsigned int )phy->radio_rev <= 5U) { return (32U); } else { } if ((unsigned int )phy->radio_rev == 8U) { return (16U); } else { } return (0U); } } static s32 b43_tssi2dbm_ad(s32 num , s32 den ) { { if (num < 0) { return (num / den); } else { return ((den / 2 + num) / den); } } } static s8 b43_tssi2dbm_entry(s8 *entry , u8 index , s16 pab0 , s16 pab1 , s16 pab2 ) { s32 m1 ; s32 m2 ; s32 f ; s32 q ; s32 delta ; s8 i ; s32 _max1 ; s32 tmp ; int _max2 ; s32 tmp___0 ; long __x ; s32 __val ; s32 tmp___1 ; s32 __min ; s32 __max ; { f = 256; i = 0; m1 = b43_tssi2dbm_ad((int )pab0 * 16 + (int )index * (int )pab1, 32); tmp = b43_tssi2dbm_ad((int )index * (int )pab2 + 32768, 256); _max1 = tmp; _max2 = 1; m2 = _max1 > _max2 ? _max1 : _max2; ldv_37575: ; if ((int )i > 15) { return (-22); } else { } tmp___0 = b43_tssi2dbm_ad(m2 * f, 16); q = b43_tssi2dbm_ad((4096 - tmp___0) * f, 2048); __x = (long )(q - f); delta = (s32 )(__x < 0L ? - __x : __x); f = q; i = (s8 )((int )i + 1); if (delta > 1) { goto ldv_37575; } else { } tmp___1 = b43_tssi2dbm_ad(m1 * f, 8192); __val = tmp___1; __min = -127; __max = 128; __val = __min > __val ? __min : __val; *(entry + (unsigned long )index) = (s8 )(__max < __val ? __max : __val); return (0); } } u8 *b43_generate_dyn_tssi2dbm_tab(struct b43_wldev *dev , s16 pab0 , s16 pab1 , s16 pab2 ) { unsigned int i ; u8 *tab ; int err ; void *tmp ; s8 tmp___0 ; { tmp = kmalloc(64UL, 208U); tab = (u8 *)tmp; if ((unsigned long )tab == (unsigned long )((u8 *)0U)) { b43err(dev->wl, "Could not allocate memory for tssi2dbm table\n"); return ((u8 *)0U); } else { } i = 0U; goto ldv_37591; ldv_37590: tmp___0 = b43_tssi2dbm_entry((s8 *)tab, (int )((u8 )i), (int )pab0, (int )pab1, (int )pab2); err = (int )tmp___0; if (err != 0) { b43err(dev->wl, "Could not generate tssi2dBm table\n"); kfree((void const *)tab); return ((u8 *)0U); } else { } i = i + 1U; ldv_37591: ; if (i <= 63U) { goto ldv_37590; } else { } return (tab); } } static int b43_gphy_init_tssi2dbm_table(struct b43_wldev *dev ) { struct b43_phy *phy ; struct b43_phy_g *gphy ; s16 pab0 ; s16 pab1 ; s16 pab2 ; int __ret_warn_on ; long tmp ; u8 *tmp___0 ; { phy = & dev->phy; gphy = phy->__annonCompField40.g; pab0 = (short )((dev->dev)->bus)->sprom.pa0b0; pab1 = (short )((dev->dev)->bus)->sprom.pa0b1; pab2 = (short )((dev->dev)->bus)->sprom.pa0b2; __ret_warn_on = (unsigned int )((dev->dev)->bus)->chip_id == 17153U && (unsigned int )phy->radio_ver != 8272U; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_g.c", 2392); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); gphy->dyn_tssi_tbl = 0; if ((((((int )pab0 != 0 && (int )pab1 != 0) && (int )pab2 != 0) && (int )pab0 != -1) && (int )pab1 != -1) && (int )pab2 != -1) { if ((unsigned int )((dev->dev)->bus)->sprom.itssi_bg != 0U && (unsigned int )((dev->dev)->bus)->sprom.itssi_bg != 255U) { gphy->tgt_idle_tssi = (int )((signed char )((dev->dev)->bus)->sprom.itssi_bg); } else { gphy->tgt_idle_tssi = 62; } tmp___0 = b43_generate_dyn_tssi2dbm_tab(dev, (int )pab0, (int )pab1, (int )pab2); gphy->tssi2dbm = (s8 const *)tmp___0; if ((unsigned long )gphy->tssi2dbm == (unsigned long )((s8 const *)0)) { return (-12); } else { } gphy->dyn_tssi_tbl = 1; } else { gphy->tgt_idle_tssi = 52; gphy->tssi2dbm = (s8 const *)(& b43_tssi2dbm_g_table); } return (0); } } static int b43_gphy_op_allocate(struct b43_wldev *dev ) { struct b43_phy_g *gphy ; struct b43_txpower_lo_control *lo ; int err ; void *tmp ; void *tmp___0 ; { tmp = kzalloc(280UL, 208U); gphy = (struct b43_phy_g *)tmp; if ((unsigned long )gphy == (unsigned long )((struct b43_phy_g *)0)) { err = -12; goto error; } else { } dev->phy.__annonCompField40.g = gphy; tmp___0 = kzalloc(144UL, 208U); lo = (struct b43_txpower_lo_control *)tmp___0; if ((unsigned long )lo == (unsigned long )((struct b43_txpower_lo_control *)0)) { err = -12; goto err_free_gphy; } else { } gphy->lo_control = lo; err = b43_gphy_init_tssi2dbm_table(dev); if (err != 0) { goto err_free_lo; } else { } return (0); err_free_lo: kfree((void const *)lo); err_free_gphy: kfree((void const *)gphy); error: ; return (err); } } static void b43_gphy_op_prepare_structs(struct b43_wldev *dev ) { struct b43_phy *phy ; struct b43_phy_g *gphy ; void const *tssi2dbm ; int tgt_idle_tssi ; struct b43_txpower_lo_control *lo ; unsigned int i ; { phy = & dev->phy; gphy = phy->__annonCompField40.g; tssi2dbm = (void const *)gphy->tssi2dbm; tgt_idle_tssi = gphy->tgt_idle_tssi; lo = gphy->lo_control; memset((void *)gphy, 0, 280UL); gphy->tssi2dbm = (s8 const *)tssi2dbm; gphy->tgt_idle_tssi = tgt_idle_tssi; gphy->lo_control = lo; memset((void *)(& gphy->minlowsig), 255, 4UL); i = 0U; goto ldv_37624; ldv_37623: gphy->nrssi[i] = -1000; i = i + 1U; ldv_37624: ; if (i <= 1U) { goto ldv_37623; } else { } i = 0U; goto ldv_37629; ldv_37628: gphy->nrssi_lt[i] = (s8 )i; i = i + 1U; ldv_37629: ; if (i <= 63U) { goto ldv_37628; } else { } gphy->lofcal = 65535U; gphy->initval = 65535U; gphy->interfmode = 0; gphy->ofdmtab_addr_direction = 0; gphy->average_tssi = 255U; lo->tx_bias = 255U; INIT_LIST_HEAD(& lo->calib_list); return; } } static void b43_gphy_op_free(struct b43_wldev *dev ) { struct b43_phy *phy ; struct b43_phy_g *gphy ; { phy = & dev->phy; gphy = phy->__annonCompField40.g; kfree((void const *)gphy->lo_control); if ((int )gphy->dyn_tssi_tbl) { kfree((void const *)gphy->tssi2dbm); } else { } gphy->dyn_tssi_tbl = 0; gphy->tssi2dbm = (s8 const *)0; kfree((void const *)gphy); dev->phy.__annonCompField40.g = (struct b43_phy_g *)0; return; } } static int b43_gphy_op_prepare_hardware(struct b43_wldev *dev ) { struct b43_phy *phy ; struct b43_phy_g *gphy ; struct b43_txpower_lo_control *lo ; int __ret_warn_on ; long tmp ; u16 tmp___0 ; { phy = & dev->phy; gphy = phy->__annonCompField40.g; lo = gphy->lo_control; __ret_warn_on = (unsigned int )phy->type != 2U; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_g.c", 2522); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); default_baseband_attenuation(dev, & gphy->bbatt); default_radio_attenuation(dev, & gphy->rfatt); tmp___0 = default_tx_control(dev); gphy->tx_control = (int )((u8 )tmp___0) << 4U; generate_rfatt_list(dev, & lo->rfatt_list); generate_bbatt_list(dev, & lo->bbatt_list); b43_read32(dev, 288); if ((unsigned int )phy->rev == 1U) { phy->gmode = 0; b43_wireless_core_reset(dev, 0U); b43_phy_initg(dev); phy->gmode = 1; b43_wireless_core_reset(dev, 536870912U); } else { } return (0); } } static int b43_gphy_op_init(struct b43_wldev *dev ) { { b43_phy_initg(dev); return (0); } } static void b43_gphy_op_exit(struct b43_wldev *dev ) { { b43_lo_g_cleanup(dev); return; } } static u16 b43_gphy_op_read(struct b43_wldev *dev , u16 reg ) { u16 tmp ; { b43_write16(dev, 1020, (int )reg); tmp = b43_read16(dev, 1022); return (tmp); } } static void b43_gphy_op_write(struct b43_wldev *dev , u16 reg , u16 value ) { { b43_write16(dev, 1020, (int )reg); b43_write16(dev, 1022, (int )value); return; } } static u16 b43_gphy_op_radio_read(struct b43_wldev *dev , u16 reg ) { int __ret_warn_on ; long tmp ; u16 tmp___0 ; { __ret_warn_on = (unsigned int )reg == 1U; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_g.c", 2573); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); reg = (u16 )((unsigned int )reg | 128U); b43_write16(dev, 1014, (int )reg); tmp___0 = b43_read16(dev, 1018); return (tmp___0); } } static void b43_gphy_op_radio_write(struct b43_wldev *dev , u16 reg , u16 value ) { int __ret_warn_on ; long tmp ; { __ret_warn_on = (unsigned int )reg == 1U; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_g.c", 2584); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); b43_write16(dev, 1014, (int )reg); b43_write16(dev, 1018, (int )value); return; } } static bool b43_gphy_op_supports_hwpctl(struct b43_wldev *dev ) { { return ((unsigned int )dev->phy.rev > 5U); } } static void b43_gphy_op_software_rfkill(struct b43_wldev *dev , bool blocked ) { struct b43_phy *phy ; struct b43_phy_g *gphy ; unsigned int channel ; u16 rfover ; u16 rfoverval ; { phy = & dev->phy; gphy = phy->__annonCompField40.g; __might_sleep("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_g.c", 2602, 0); if (! blocked) { if ((int )phy->radio_on) { return; } else { } b43_phy_write(dev, 21, 32768); b43_phy_write(dev, 21, 52224); b43_phy_write(dev, 21, (int )phy->gmode ? 192 : 0); if ((int )gphy->radio_off_context.valid) { b43_phy_write(dev, 2065, (int )gphy->radio_off_context.rfover); b43_phy_write(dev, 2066, (int )gphy->radio_off_context.rfoverval); gphy->radio_off_context.valid = 0; } else { } channel = phy->channel; b43_gphy_channel_switch(dev, 6U, 1); b43_gphy_channel_switch(dev, channel, 0); } else { rfover = b43_phy_read(dev, 2065); rfoverval = b43_phy_read(dev, 2066); gphy->radio_off_context.rfover = rfover; gphy->radio_off_context.rfoverval = rfoverval; gphy->radio_off_context.valid = 1; b43_phy_write(dev, 2065, (int )((unsigned int )rfover | 140U)); b43_phy_write(dev, 2066, (int )rfoverval & 65395); } return; } } static int b43_gphy_op_switch_channel(struct b43_wldev *dev , unsigned int new_channel ) { { if (new_channel == 0U || new_channel > 14U) { return (-22); } else { } b43_gphy_channel_switch(dev, new_channel, 0); return (0); } } static unsigned int b43_gphy_op_get_default_chan(struct b43_wldev *dev ) { { return (1U); } } static void b43_gphy_op_set_rx_antenna(struct b43_wldev *dev , int antenna ) { struct b43_phy *phy ; u16 tmp ; int autodiv ; u64 tmp___0 ; u64 tmp___1 ; { phy = & dev->phy; autodiv = 0; if (antenna == 2 || antenna == 3) { autodiv = 1; } else { } tmp___0 = b43_hf_read(dev); b43_hf_write(dev, tmp___0 & 0xfffffffffffffffeULL); b43_phy_maskset(dev, 1025, 65151, autodiv == 0 ? (int )((u16 )antenna) << 7U : 384); if (autodiv != 0) { tmp = b43_phy_read(dev, 1067); if (antenna == 3) { tmp = (unsigned int )tmp & 65279U; } else { tmp = (u16 )((unsigned int )tmp | 256U); } b43_phy_write(dev, 1067, (int )tmp); } else { } tmp = b43_phy_read(dev, 1164); if (autodiv != 0) { tmp = (u16 )((unsigned int )tmp | 8192U); } else { tmp = (unsigned int )tmp & 57343U; } b43_phy_write(dev, 1164, (int )tmp); if (autodiv != 0) { b43_phy_set(dev, 1164, 8192); } else { b43_phy_mask(dev, 1164, 8192); } if ((unsigned int )phy->rev > 1U) { b43_phy_set(dev, 1121, 16); b43_phy_maskset(dev, 1197, 65280, 21); if ((unsigned int )phy->rev == 2U) { b43_phy_write(dev, 1063, 8); } else { b43_phy_maskset(dev, 1063, 65280, 8); } } else { } if ((unsigned int )phy->rev > 5U) { b43_phy_write(dev, 1179, 220); } else { } tmp___1 = b43_hf_read(dev); b43_hf_write(dev, tmp___1 | 1ULL); return; } } static int b43_gphy_op_interf_mitigation(struct b43_wldev *dev , enum b43_interference_mitigation mode ) { struct b43_phy *phy ; struct b43_phy_g *gphy ; int currentmode ; int __ret_warn_on ; long tmp ; { phy = & dev->phy; gphy = phy->__annonCompField40.g; __ret_warn_on = (unsigned int )phy->type != 2U; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_g.c", 2712); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); if ((unsigned int )phy->rev == 0U || ! phy->gmode) { return (-19); } else { } gphy->aci_wlan_automatic = 0; switch ((unsigned int )mode) { case 3U: gphy->aci_wlan_automatic = 1; if ((int )gphy->aci_enable) { mode = 2; } else { mode = 0; } goto ldv_37708; case 0U: ; case 1U: ; case 2U: ; goto ldv_37708; default: ; return (-22); } ldv_37708: currentmode = gphy->interfmode; if ((unsigned int )currentmode == (unsigned int )mode) { return (0); } else { } if (currentmode != 0) { b43_radio_interference_mitigation_disable(dev, currentmode); } else { } if ((unsigned int )mode == 0U) { gphy->aci_enable = 0; gphy->aci_hw_rssi = 0; } else { b43_radio_interference_mitigation_enable(dev, (int )mode); } gphy->interfmode = (int )mode; return (0); } } static s8 b43_gphy_estimate_power_out(struct b43_wldev *dev , s8 tssi ) { struct b43_phy_g *gphy ; s8 dbm ; s32 tmp ; s32 __val ; s32 __min ; s32 __max ; { gphy = dev->phy.__annonCompField40.g; tmp = (gphy->tgt_idle_tssi - gphy->cur_idle_tssi) + (int )tssi; __val = tmp; __min = 0; __max = 63; __val = __min > __val ? __min : __val; tmp = __max < __val ? __max : __val; dbm = *(gphy->tssi2dbm + (unsigned long )tmp); return (dbm); } } static void b43_put_attenuation_into_ranges(struct b43_wldev *dev , int *_bbatt , int *_rfatt ) { int rfatt ; int bbatt ; struct b43_txpower_lo_control *lo ; int rf_min ; int rf_max ; int bb_min ; int bb_max ; int __val ; int __min ; int __max ; int __val___0 ; int __min___0 ; int __max___0 ; { rfatt = *_rfatt; bbatt = *_bbatt; lo = (dev->phy.__annonCompField40.g)->lo_control; rf_min = (int const )lo->rfatt_list.min_val; rf_max = (int const )lo->rfatt_list.max_val; bb_min = (int const )lo->bbatt_list.min_val; bb_max = (int const )lo->bbatt_list.max_val; ldv_37738: ; if (rfatt > rf_max && bb_max + -4 < bbatt) { goto ldv_37736; } else { } if (rfatt < rf_min && bb_min + 4 > bbatt) { goto ldv_37736; } else { } if (bbatt > bb_max && rf_max + -1 < rfatt) { goto ldv_37736; } else { } if (bbatt < bb_min && rf_min + 1 > rfatt) { goto ldv_37736; } else { } if (bbatt > bb_max) { bbatt = bbatt + -4; rfatt = rfatt + 1; goto ldv_37737; } else { } if (bbatt < bb_min) { bbatt = bbatt + 4; rfatt = rfatt + -1; goto ldv_37737; } else { } if (rfatt > rf_max) { rfatt = rfatt + -1; bbatt = bbatt + 4; goto ldv_37737; } else { } if (rfatt < rf_min) { rfatt = rfatt + 1; bbatt = bbatt + -4; goto ldv_37737; } else { } goto ldv_37736; ldv_37737: ; goto ldv_37738; ldv_37736: __val = rfatt; __min = rf_min; __max = rf_max; __val = __min > __val ? __min : __val; *_rfatt = __max < __val ? __max : __val; __val___0 = bbatt; __min___0 = bb_min; __max___0 = bb_max; __val___0 = __min___0 > __val___0 ? __min___0 : __val___0; *_bbatt = __max___0 < __val___0 ? __max___0 : __val___0; return; } } static void b43_gphy_op_adjust_txpower(struct b43_wldev *dev ) { struct b43_phy *phy ; struct b43_phy_g *gphy ; int rfatt ; int bbatt ; u8 tx_control ; bool tmp ; { phy = & dev->phy; gphy = phy->__annonCompField40.g; b43_mac_suspend(dev); bbatt = (int )gphy->bbatt.att; bbatt = gphy->bbatt_delta + bbatt; rfatt = (int )gphy->rfatt.att; rfatt = gphy->rfatt_delta + rfatt; b43_put_attenuation_into_ranges(dev, & bbatt, & rfatt); tx_control = gphy->tx_control; if ((unsigned int )phy->radio_ver == 8272U && (unsigned int )phy->radio_rev == 2U) { if (rfatt <= 1) { if ((unsigned int )tx_control == 0U) { tx_control = 48U; rfatt = rfatt + 2; bbatt = bbatt + 2; } else if (((int )((dev->dev)->bus)->sprom.boardflags_lo & 2) != 0) { bbatt = (rfatt + -2) * 4 + bbatt; rfatt = 2; } else { } } else if (rfatt > 4 && (unsigned int )tx_control != 0U) { tx_control = 0U; if (bbatt <= 2) { rfatt = rfatt + -3; bbatt = bbatt + 2; } else { rfatt = rfatt + -2; bbatt = bbatt + -2; } } else { } } else { } gphy->tx_control = tx_control; b43_put_attenuation_into_ranges(dev, & bbatt, & rfatt); gphy->rfatt.att = (u8 )rfatt; gphy->bbatt.att = (u8 )bbatt; tmp = b43_debug(dev, 0); if ((int )tmp) { b43dbg(dev->wl, "Adjusting TX power\n"); } else { } b43_phy_lock(dev); b43_radio_lock(dev); b43_set_txpower_g(dev, (struct b43_bbatt const *)(& gphy->bbatt), (struct b43_rfatt const *)(& gphy->rfatt), (int )gphy->tx_control); b43_radio_unlock(dev); b43_phy_unlock(dev); b43_mac_enable(dev); return; } } static enum b43_txpwr_result b43_gphy_op_recalc_txpower(struct b43_wldev *dev , bool ignore_tssi ) { struct b43_phy *phy ; struct b43_phy_g *gphy ; unsigned int average_tssi ; int cck_result ; int ofdm_result ; int estimated_pwr ; int desired_pwr ; int pwr_adjust ; int rfatt_delta ; int bbatt_delta ; unsigned int max_pwr ; long tmp ; int __ret_warn_on ; long tmp___0 ; s8 tmp___1 ; int __ret_warn_on___0 ; long tmp___2 ; long tmp___3 ; int __val ; int __min ; int __max ; bool tmp___4 ; int dbm ; bool tmp___5 ; { phy = & dev->phy; gphy = phy->__annonCompField40.g; cck_result = b43_phy_shm_tssi_read(dev, 88); ofdm_result = b43_phy_shm_tssi_read(dev, 112); if (cck_result < 0 && ofdm_result < 0) { if (! ignore_tssi) { goto no_adjustment_needed; } else { } cck_result = 0; ofdm_result = 0; } else { } if (cck_result < 0) { average_tssi = (unsigned int )ofdm_result; } else if (ofdm_result < 0) { average_tssi = (unsigned int )cck_result; } else { average_tssi = (unsigned int )((cck_result + ofdm_result) / 2); } tmp = ldv__builtin_expect((unsigned int )gphy->average_tssi != 255U, 1L); if (tmp != 0L) { average_tssi = ((unsigned int )gphy->average_tssi + average_tssi) / 2U; } else { } gphy->average_tssi = (u8 )average_tssi; __ret_warn_on = average_tssi > 126U; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_g.c", 2911); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); tmp___1 = b43_gphy_estimate_power_out(dev, (int )((s8 )average_tssi)); estimated_pwr = (int )tmp___1; __ret_warn_on___0 = (unsigned int )phy->type != 2U; tmp___2 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___2 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_g.c", 2916); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); max_pwr = (unsigned int )((dev->dev)->bus)->sprom.maxpwr_bg; if (((int )((dev->dev)->bus)->sprom.boardflags_lo & 2) != 0) { max_pwr = max_pwr - 3U; } else { } tmp___3 = ldv__builtin_expect(max_pwr > 119U, 0L); if (tmp___3 != 0L) { b43warn(dev->wl, "Invalid max-TX-power value in SPROM.\n"); max_pwr = 80U; ((dev->dev)->bus)->sprom.maxpwr_bg = (u16 )max_pwr; } else { } if (phy->desired_txpower < 0) { desired_pwr = 0; } else { desired_pwr = phy->desired_txpower << 2; } __val = desired_pwr; __min = 0; __max = (int )max_pwr; __val = __min > __val ? __min : __val; desired_pwr = __max < __val ? __max : __val; tmp___4 = b43_debug(dev, 0); if ((int )tmp___4) { b43dbg(dev->wl, "[TX power] current = %u.%u dBm, desired = %u.%u dBm, max = %u.%u\n", estimated_pwr >> 2, ((estimated_pwr & 3) * 100) / 4, desired_pwr >> 2, ((desired_pwr & 3) * 100) / 4, max_pwr >> 2, ((max_pwr & 3U) * 100U) / 4U); } else { } pwr_adjust = desired_pwr - estimated_pwr; if (pwr_adjust == 0) { goto no_adjustment_needed; } else { } rfatt_delta = (pwr_adjust + 7) / 8; rfatt_delta = - rfatt_delta; bbatt_delta = pwr_adjust / 2; bbatt_delta = - bbatt_delta; bbatt_delta = rfatt_delta * -4 + bbatt_delta; tmp___5 = b43_debug(dev, 0); if ((int )tmp___5) { dbm = pwr_adjust < 0 ? - pwr_adjust : pwr_adjust; b43dbg(dev->wl, "[TX power deltas] %s%u.%u dBm => bbatt-delta = %d, rfatt-delta = %d\n", pwr_adjust < 0 ? (char *)"-" : (char *)"", dbm >> 2, ((dbm & 3) * 100) / 4, bbatt_delta, rfatt_delta); } else { } if (rfatt_delta == 0 && bbatt_delta == 0) { goto no_adjustment_needed; } else { } gphy->bbatt_delta = bbatt_delta; gphy->rfatt_delta = rfatt_delta; return (0); no_adjustment_needed: ; return (1); } } static void b43_gphy_op_pwork_15sec(struct b43_wldev *dev ) { struct b43_phy *phy ; struct b43_phy_g *gphy ; { phy = & dev->phy; gphy = phy->__annonCompField40.g; b43_mac_suspend(dev); b43_lo_g_maintanance_work(dev); b43_mac_enable(dev); return; } } static void b43_gphy_op_pwork_60sec(struct b43_wldev *dev ) { struct b43_phy *phy ; u8 old_chan ; { phy = & dev->phy; if (((int )((dev->dev)->bus)->sprom.boardflags_lo & 8) == 0) { return; } else { } b43_mac_suspend(dev); b43_calc_nrssi_slope(dev); if ((unsigned int )phy->radio_ver == 8272U && (unsigned int )phy->radio_rev == 8U) { old_chan = (u8 )phy->channel; if ((unsigned int )old_chan > 7U) { b43_switch_channel(dev, 1U); } else { b43_switch_channel(dev, 13U); } b43_switch_channel(dev, (unsigned int )old_chan); } else { } b43_mac_enable(dev); return; } } struct b43_phy_operations const b43_phyops_g = {& b43_gphy_op_allocate, & b43_gphy_op_free, & b43_gphy_op_prepare_structs, & b43_gphy_op_prepare_hardware, & b43_gphy_op_init, & b43_gphy_op_exit, & b43_gphy_op_read, & b43_gphy_op_write, 0, & b43_gphy_op_radio_read, & b43_gphy_op_radio_write, & b43_gphy_op_supports_hwpctl, & b43_gphy_op_software_rfkill, & b43_phyop_switch_analog_generic, & b43_gphy_op_switch_channel, & b43_gphy_op_get_default_chan, & b43_gphy_op_set_rx_antenna, & b43_gphy_op_interf_mitigation, & b43_gphy_op_recalc_txpower, & b43_gphy_op_adjust_txpower, & b43_gphy_op_pwork_15sec, & b43_gphy_op_pwork_60sec}; void ldv_initialize_b43_phy_operations_28(void) { void *tmp ; { tmp = ldv_init_zalloc(1736UL); b43_phyops_g_group0 = (struct b43_wldev *)tmp; return; } } void ldv_main_exported_28(void) { unsigned int ldvarg107 ; u16 ldvarg114 ; u16 ldvarg113 ; u16 ldvarg112 ; u16 ldvarg110 ; bool ldvarg108 ; int ldvarg111 ; enum b43_interference_mitigation ldvarg109 ; u16 ldvarg115 ; bool ldvarg105 ; bool ldvarg106 ; u16 ldvarg116 ; int tmp ; { ldv_memset((void *)(& ldvarg107), 0, 4UL); ldv_memset((void *)(& ldvarg114), 0, 2UL); ldv_memset((void *)(& ldvarg113), 0, 2UL); ldv_memset((void *)(& ldvarg112), 0, 2UL); ldv_memset((void *)(& ldvarg110), 0, 2UL); ldv_memset((void *)(& ldvarg108), 0, 1UL); ldv_memset((void *)(& ldvarg111), 0, 4UL); ldv_memset((void *)(& ldvarg109), 0, 4UL); ldv_memset((void *)(& ldvarg115), 0, 2UL); ldv_memset((void *)(& ldvarg105), 0, 1UL); ldv_memset((void *)(& ldvarg106), 0, 1UL); ldv_memset((void *)(& ldvarg116), 0, 2UL); tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_state_variable_28 == 1) { b43_gphy_op_prepare_structs(b43_phyops_g_group0); ldv_state_variable_28 = 1; } else { } goto ldv_37810; case 1: ; if (ldv_state_variable_28 == 1) { b43_gphy_op_read(b43_phyops_g_group0, (int )ldvarg116); ldv_state_variable_28 = 1; } else { } goto ldv_37810; case 2: ; if (ldv_state_variable_28 == 1) { b43_gphy_op_allocate(b43_phyops_g_group0); ldv_state_variable_28 = 1; } else { } goto ldv_37810; case 3: ; if (ldv_state_variable_28 == 1) { b43_gphy_op_get_default_chan(b43_phyops_g_group0); ldv_state_variable_28 = 1; } else { } goto ldv_37810; case 4: ; if (ldv_state_variable_28 == 1) { b43_gphy_op_write(b43_phyops_g_group0, (int )ldvarg115, (int )ldvarg114); ldv_state_variable_28 = 1; } else { } goto ldv_37810; case 5: ; if (ldv_state_variable_28 == 1) { b43_gphy_op_pwork_15sec(b43_phyops_g_group0); ldv_state_variable_28 = 1; } else { } goto ldv_37810; case 6: ; if (ldv_state_variable_28 == 1) { b43_gphy_op_radio_write(b43_phyops_g_group0, (int )ldvarg113, (int )ldvarg112); ldv_state_variable_28 = 1; } else { } goto ldv_37810; case 7: ; if (ldv_state_variable_28 == 1) { b43_gphy_op_set_rx_antenna(b43_phyops_g_group0, ldvarg111); ldv_state_variable_28 = 1; } else { } goto ldv_37810; case 8: ; if (ldv_state_variable_28 == 1) { b43_gphy_op_radio_read(b43_phyops_g_group0, (int )ldvarg110); ldv_state_variable_28 = 1; } else { } goto ldv_37810; case 9: ; if (ldv_state_variable_28 == 1) { b43_gphy_op_supports_hwpctl(b43_phyops_g_group0); ldv_state_variable_28 = 1; } else { } goto ldv_37810; case 10: ; if (ldv_state_variable_28 == 1) { b43_gphy_op_adjust_txpower(b43_phyops_g_group0); ldv_state_variable_28 = 1; } else { } goto ldv_37810; case 11: ; if (ldv_state_variable_28 == 1) { b43_gphy_op_prepare_hardware(b43_phyops_g_group0); ldv_state_variable_28 = 1; } else { } goto ldv_37810; case 12: ; if (ldv_state_variable_28 == 1) { b43_gphy_op_interf_mitigation(b43_phyops_g_group0, ldvarg109); ldv_state_variable_28 = 1; } else { } goto ldv_37810; case 13: ; if (ldv_state_variable_28 == 1) { b43_gphy_op_software_rfkill(b43_phyops_g_group0, (int )ldvarg108); ldv_state_variable_28 = 1; } else { } goto ldv_37810; case 14: ; if (ldv_state_variable_28 == 1) { b43_gphy_op_free(b43_phyops_g_group0); ldv_state_variable_28 = 1; } else { } goto ldv_37810; case 15: ; if (ldv_state_variable_28 == 1) { b43_gphy_op_switch_channel(b43_phyops_g_group0, ldvarg107); ldv_state_variable_28 = 1; } else { } goto ldv_37810; case 16: ; if (ldv_state_variable_28 == 1) { b43_gphy_op_recalc_txpower(b43_phyops_g_group0, (int )ldvarg106); ldv_state_variable_28 = 1; } else { } goto ldv_37810; case 17: ; if (ldv_state_variable_28 == 1) { b43_gphy_op_init(b43_phyops_g_group0); ldv_state_variable_28 = 1; } else { } goto ldv_37810; case 18: ; if (ldv_state_variable_28 == 1) { b43_gphy_op_exit(b43_phyops_g_group0); ldv_state_variable_28 = 1; } else { } goto ldv_37810; case 19: ; if (ldv_state_variable_28 == 1) { b43_gphy_op_pwork_60sec(b43_phyops_g_group0); ldv_state_variable_28 = 1; } else { } goto ldv_37810; case 20: ; if (ldv_state_variable_28 == 1) { b43_phyop_switch_analog_generic(b43_phyops_g_group0, (int )ldvarg105); ldv_state_variable_28 = 1; } else { } goto ldv_37810; default: ldv_stop(); } ldv_37810: ; return; } } int ldv_del_timer_sync_27(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type ldv_func_res ; int tmp ; { tmp = del_timer_sync(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_9(ldv_func_arg1); return (ldv_func_res); } } int ldv_del_timer_28(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___0 ldv_func_res ; int tmp ; { tmp = del_timer(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_9(ldv_func_arg1); return (ldv_func_res); } } int ldv_request_threaded_irq_29(unsigned int ldv_func_arg1 , irqreturn_t (*handler)(int , void * ) , irqreturn_t (*thread_fn)(int , void * ) , unsigned long ldv_func_arg4 , char const *ldv_func_arg5 , void *ldv_func_arg6 ) { ldv_func_ret_type___1 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = request_threaded_irq(ldv_func_arg1, handler, thread_fn, ldv_func_arg4, ldv_func_arg5, ldv_func_arg6); ldv_func_res = tmp; tmp___0 = reg_check_2(handler, thread_fn); if (tmp___0 != 0 && ldv_func_res >= 0) { activate_suitable_irq_2((int )ldv_func_arg1, ldv_func_arg6); } else { } return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; int ldv_del_timer_34(struct timer_list *ldv_func_arg1 ) ; int ldv_del_timer_sync_33(struct timer_list *ldv_func_arg1 ) ; int ldv_request_threaded_irq_35(unsigned int ldv_func_arg1 , irqreturn_t (*handler)(int , void * ) , irqreturn_t (*thread_fn)(int , void * ) , unsigned long ldv_func_arg4 , char const *ldv_func_arg5 , void *ldv_func_arg6 ) ; void b43_wa_initgains(struct b43_wldev *dev ) ; void b43_wa_all(struct b43_wldev *dev ) ; __inline static u16 channel2freq_a(u8 channel ) { int __ret_warn_on ; long tmp ; { __ret_warn_on = (unsigned int )channel > 200U; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_a.c", 42); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); return ((unsigned int )((u16 )channel) * 5U + 5000U); } } __inline static u16 freq_r3A_value(u16 frequency ) { u16 value ; { if ((unsigned int )frequency <= 5090U) { value = 64U; } else if ((unsigned int )frequency <= 5320U) { value = 0U; } else if ((unsigned int )frequency <= 5805U) { value = 128U; } else { value = 64U; } return (value); } } static void b43_radio_set_tx_iq(struct b43_wldev *dev ) { u8 data_high[5U] ; u8 data_low[5U] ; u16 tmp ; u16 tmp___0 ; int i ; int j ; { data_high[0] = 0U; data_high[1] = 64U; data_high[2] = 128U; data_high[3] = 144U; data_high[4] = 208U; data_low[0] = 0U; data_low[1] = 1U; data_low[2] = 5U; data_low[3] = 6U; data_low[4] = 10U; tmp___0 = b43_radio_read(dev, 30); tmp = tmp___0; i = 0; goto ldv_37054; ldv_37053: j = 0; goto ldv_37051; ldv_37050: ; if ((int )tmp == (((int )data_high[i] << 4) | (int )data_low[j])) { b43_phy_write(dev, 105, (int )((u16 )((int )((short )((i - j) << 8)) | 192))); return; } else { } j = j + 1; ldv_37051: ; if (j <= 4) { goto ldv_37050; } else { } i = i + 1; ldv_37054: ; if (i <= 4) { goto ldv_37053; } else { } return; } } static void aphy_channel_switch(struct b43_wldev *dev , unsigned int channel ) { u16 freq ; u16 r8 ; u16 tmp ; u16 tmp___0 ; { freq = channel2freq_a((int )((u8 )channel)); r8 = b43_radio_read(dev, 8); b43_write16(dev, 1008, (int )freq); b43_radio_write(dev, 8, (int )r8); tmp = b43_radio_read(dev, 46); tmp = (unsigned int )tmp & 128U; b43_radio_write(dev, 46, (int )tmp); if ((unsigned int )freq > 4919U && (unsigned int )freq <= 5500U) { r8 = (u16 )(((int )freq * 3) / 116); } else { } b43_radio_write(dev, 7, (int )((u16 )((int )((short )((int )r8 << 4)) | (int )((short )r8)))); b43_radio_write(dev, 32, (int )((u16 )((int )((short )((int )r8 << 4)) | (int )((short )r8)))); b43_radio_write(dev, 33, (int )((u16 )((int )((short )((int )r8 << 4)) | (int )((short )r8)))); b43_radio_maskset(dev, 34, 15, (int )r8 << 4U); b43_radio_write(dev, 42, (int )r8 << 4U); b43_radio_write(dev, 43, (int )r8 << 4U); b43_radio_maskset(dev, 8, 240, (int )r8 << 4U); b43_radio_maskset(dev, 41, 65295, 176); b43_radio_write(dev, 53, 170); b43_radio_write(dev, 54, 133); tmp___0 = freq_r3A_value((int )freq); b43_radio_maskset(dev, 58, 65312, (int )tmp___0); b43_radio_mask(dev, 61, 255); b43_radio_maskset(dev, 129, 65407, 128); b43_radio_mask(dev, 53, 65519); b43_radio_maskset(dev, 53, 65519, 16); b43_radio_set_tx_iq(dev); return; } } static void b43_radio_init2060(struct b43_wldev *dev ) { u16 tmp ; unsigned int tmp___0 ; { b43_radio_write(dev, 4, 192); b43_radio_write(dev, 5, 8); b43_radio_write(dev, 9, 64); b43_radio_write(dev, 5, 170); b43_radio_write(dev, 50, 143); b43_radio_write(dev, 6, 143); b43_radio_write(dev, 52, 143); b43_radio_write(dev, 44, 7); b43_radio_write(dev, 130, 128); b43_radio_write(dev, 128, 0); b43_radio_write(dev, 63, 218); b43_radio_mask(dev, 5, 65527); b43_radio_mask(dev, 129, 65519); b43_radio_mask(dev, 129, 65503); b43_radio_mask(dev, 129, 65503); msleep(1U); b43_radio_maskset(dev, 129, 65503, 16); msleep(1U); b43_radio_maskset(dev, 5, 65527, 8); b43_radio_mask(dev, 133, 65519); b43_radio_mask(dev, 5, 65527); b43_radio_mask(dev, 129, 65471); b43_radio_maskset(dev, 129, 65471, 64); tmp = b43_radio_read(dev, 129); b43_radio_write(dev, 5, (int )((unsigned int )tmp | 8U)); b43_phy_write(dev, 99, 56774); b43_phy_write(dev, 105, 1982); b43_phy_write(dev, 106, 0); tmp___0 = (*((dev->phy.ops)->get_default_chan))(dev); aphy_channel_switch(dev, tmp___0); msleep(1U); return; } } static void b43_phy_rssiagc(struct b43_wldev *dev , u8 enable ) { int i ; { if ((unsigned int )dev->phy.rev <= 2U) { if ((unsigned int )enable != 0U) { i = 0; goto ldv_37072; ldv_37071: b43_ofdmtab_write16(dev, 3072, (int )((u16 )i), 65528); b43_ofdmtab_write16(dev, 4096, (int )((u16 )i), 65528); i = i + 1; ldv_37072: ; if (i <= 15) { goto ldv_37071; } else { } } else { i = 0; goto ldv_37075; ldv_37074: b43_ofdmtab_write16(dev, 3072, (int )((u16 )i), (int )b43_tab_rssiagc1[i]); b43_ofdmtab_write16(dev, 4096, (int )((u16 )i), (int )b43_tab_rssiagc1[i]); i = i + 1; ldv_37075: ; if (i <= 15) { goto ldv_37074; } else { } } } else if ((unsigned int )enable != 0U) { i = 0; goto ldv_37078; ldv_37077: b43_ofdmtab_write16(dev, 4096, (int )((u16 )i), 2080); i = i + 1; ldv_37078: ; if (i <= 15) { goto ldv_37077; } else { } } else { i = 0; goto ldv_37081; ldv_37080: b43_ofdmtab_write16(dev, 4096, (int )((u16 )i), (int )b43_tab_rssiagc2[i]); i = i + 1; ldv_37081: ; if (i <= 47) { goto ldv_37080; } else { } } return; } } static void b43_phy_ww(struct b43_wldev *dev ) { u16 b ; u16 curr_s ; u16 best_s ; int i ; u16 tmp ; { best_s = 65535U; b43_phy_mask(dev, 1065, 49151); b43_phy_set(dev, 1051, 4096); b43_phy_maskset(dev, 1154, 61695, 768); b43_radio_set(dev, 9, 128); b43_radio_maskset(dev, 18, 65532, 2); b43_wa_initgains(dev); b43_phy_write(dev, 1210, 16085); b = b43_phy_read(dev, 1027); b43_phy_write(dev, 1027, (int )((u16 )(((int )((short )b) & -8) | 5))); b43_radio_set(dev, 4, 4); i = 16; goto ldv_37092; ldv_37091: b43_radio_write(dev, 19, (int )((u16 )i)); tmp = b43_phy_read(dev, 1140); curr_s = (unsigned int )tmp & 255U; if ((unsigned int )curr_s == 0U) { best_s = 0U; goto ldv_37090; } else if ((unsigned int )curr_s > 127U) { curr_s = 256U - (unsigned int )curr_s; } else { } if ((int )curr_s < (int )best_s) { best_s = curr_s; } else { } i = i + 1; ldv_37092: ; if (i <= 32) { goto ldv_37091; } else { } ldv_37090: b43_phy_write(dev, 1027, (int )b); b43_radio_mask(dev, 4, 65531); b43_radio_write(dev, 19, (int )best_s); b43_ofdmtab_write16(dev, 19456, 0, 65516); b43_phy_write(dev, 1207, 7808); b43_phy_write(dev, 1206, 7168); b43_phy_write(dev, 1205, 3776); b43_phy_write(dev, 1202, 192); b43_phy_write(dev, 1209, 8191); b43_phy_maskset(dev, 1211, 61440, 83); b43_phy_maskset(dev, 1121, 65055, 288); b43_phy_maskset(dev, 1043, 4095, 12288); b43_phy_maskset(dev, 1044, 4095, 12288); b43_ofdmtab_write16(dev, 0, 6, 23); i = 0; goto ldv_37094; ldv_37093: b43_ofdmtab_write16(dev, 0, (int )((u16 )i), 15); i = i + 1; ldv_37094: ; if (i <= 5) { goto ldv_37093; } else { } b43_ofdmtab_write16(dev, 0, 13, 14); b43_ofdmtab_write16(dev, 0, 14, 17); b43_ofdmtab_write16(dev, 0, 15, 19); b43_phy_write(dev, 1075, 20528); b43_phy_set(dev, 1065, 16384); return; } } static void hardware_pctl_init_aphy(struct b43_wldev *dev ) { { return; } } void b43_phy_inita(struct b43_wldev *dev ) { struct ssb_bus *bus ; struct b43_phy *phy ; int __ret_warn_on ; long tmp ; u16 tmp___0 ; { bus = (dev->dev)->bus; phy = & dev->phy; __ret_warn_on = (unsigned int )phy->type != 0U && (unsigned int )phy->type != 2U; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_a.c", 275); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); __might_sleep("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_a.c", 277, 0); if ((unsigned int )phy->rev > 5U) { if ((unsigned int )phy->type == 0U) { b43_phy_mask(dev, 1051, 61439); } else { } tmp___0 = b43_phy_read(dev, 1097); if (((int )tmp___0 & 512) != 0) { b43_phy_set(dev, 1097, 16); } else { b43_phy_mask(dev, 1097, 61423); } } else { } b43_wa_all(dev); if ((unsigned int )phy->type == 0U) { if ((int )phy->gmode && (unsigned int )phy->rev <= 2U) { b43_phy_set(dev, 52, 1); } else { } b43_phy_rssiagc(dev, 0); b43_phy_set(dev, 1065, 16384); b43_radio_init2060(dev); if ((unsigned int )phy->rev > 2U) { b43_phy_ww(dev); } else { } hardware_pctl_init_aphy(dev); } else { } if ((unsigned int )phy->type == 2U && ((int )((dev->dev)->bus)->sprom.boardflags_lo & 2) != 0) { b43_phy_maskset(dev, 1134, 57344, 975); } else { } return; } } static int b43_aphy_init_tssi2dbm_table(struct b43_wldev *dev ) { struct b43_phy *phy ; struct b43_phy_a *aphy ; s16 pab0 ; s16 pab1 ; s16 pab2 ; u8 *tmp ; { phy = & dev->phy; aphy = phy->__annonCompField40.a; pab0 = (short )((dev->dev)->bus)->sprom.pa1b0; pab1 = (short )((dev->dev)->bus)->sprom.pa1b1; pab2 = (short )((dev->dev)->bus)->sprom.pa1b2; if ((((((int )pab0 != 0 && (int )pab1 != 0) && (int )pab2 != 0) && (int )pab0 != -1) && (int )pab1 != -1) && (int )pab2 != -1) { if ((unsigned int )((dev->dev)->bus)->sprom.itssi_a != 0U && (unsigned int )((dev->dev)->bus)->sprom.itssi_a != 255U) { aphy->tgt_idle_tssi = (int )((signed char )((dev->dev)->bus)->sprom.itssi_a); } else { aphy->tgt_idle_tssi = 62; } tmp = b43_generate_dyn_tssi2dbm_tab(dev, (int )pab0, (int )pab1, (int )pab2); aphy->tssi2dbm = (s8 const *)tmp; if ((unsigned long )aphy->tssi2dbm == (unsigned long )((s8 const *)0)) { return (-12); } else { } } else { aphy->tssi2dbm = (s8 const *)0; b43err(dev->wl, "Could not generate tssi2dBm table (wrong SPROM info)!\n"); return (-19); } return (0); } } static int b43_aphy_op_allocate(struct b43_wldev *dev ) { struct b43_phy_a *aphy ; int err ; void *tmp ; { tmp = kzalloc(24UL, 208U); aphy = (struct b43_phy_a *)tmp; if ((unsigned long )aphy == (unsigned long )((struct b43_phy_a *)0)) { return (-12); } else { } dev->phy.__annonCompField40.a = aphy; err = b43_aphy_init_tssi2dbm_table(dev); if (err != 0) { goto err_free_aphy; } else { } return (0); err_free_aphy: kfree((void const *)aphy); dev->phy.__annonCompField40.a = (struct b43_phy_a *)0; return (err); } } static void b43_aphy_op_prepare_structs(struct b43_wldev *dev ) { struct b43_phy *phy ; struct b43_phy_a *aphy ; void const *tssi2dbm ; int tgt_idle_tssi ; { phy = & dev->phy; aphy = phy->__annonCompField40.a; tssi2dbm = (void const *)aphy->tssi2dbm; tgt_idle_tssi = aphy->tgt_idle_tssi; memset((void *)aphy, 0, 24UL); aphy->tssi2dbm = (s8 const *)tssi2dbm; aphy->tgt_idle_tssi = tgt_idle_tssi; return; } } static void b43_aphy_op_free(struct b43_wldev *dev ) { struct b43_phy *phy ; struct b43_phy_a *aphy ; { phy = & dev->phy; aphy = phy->__annonCompField40.a; kfree((void const *)aphy->tssi2dbm); aphy->tssi2dbm = (s8 const *)0; kfree((void const *)aphy); dev->phy.__annonCompField40.a = (struct b43_phy_a *)0; return; } } static int b43_aphy_op_init(struct b43_wldev *dev ) { { b43_phy_inita(dev); return (0); } } __inline static u16 adjust_phyreg(struct b43_wldev *dev , u16 offset ) { { if (((int )offset & 3072) == 1024) { offset = (unsigned int )offset & 62463U; offset = offset; } else { } if (((int )offset & 3072) == 2048) { b43err(dev->wl, "Invalid EXT-G PHY access at 0x%04X on A-PHY\n", (int )offset); dump_stack(); } else { } if (((int )offset & 3072) == 3072) { b43err(dev->wl, "Invalid N-BMODE PHY access at 0x%04X on A-PHY\n", (int )offset); dump_stack(); } else { } return (offset); } } static u16 b43_aphy_op_read(struct b43_wldev *dev , u16 reg ) { u16 tmp ; { reg = adjust_phyreg(dev, (int )reg); b43_write16(dev, 1020, (int )reg); tmp = b43_read16(dev, 1022); return (tmp); } } static void b43_aphy_op_write(struct b43_wldev *dev , u16 reg , u16 value ) { { reg = adjust_phyreg(dev, (int )reg); b43_write16(dev, 1020, (int )reg); b43_write16(dev, 1022, (int )value); return; } } static u16 b43_aphy_op_radio_read(struct b43_wldev *dev , u16 reg ) { int __ret_warn_on ; long tmp ; u16 tmp___0 ; { __ret_warn_on = (unsigned int )reg == 1U; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_a.c", 462); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); reg = (u16 )((unsigned int )reg | 64U); b43_write16(dev, 1014, (int )reg); tmp___0 = b43_read16(dev, 1018); return (tmp___0); } } static void b43_aphy_op_radio_write(struct b43_wldev *dev , u16 reg , u16 value ) { int __ret_warn_on ; long tmp ; { __ret_warn_on = (unsigned int )reg == 1U; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_a.c", 473); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); b43_write16(dev, 1014, (int )reg); b43_write16(dev, 1018, (int )value); return; } } static bool b43_aphy_op_supports_hwpctl(struct b43_wldev *dev ) { { return ((unsigned int )dev->phy.rev > 4U); } } static void b43_aphy_op_software_rfkill(struct b43_wldev *dev , bool blocked ) { struct b43_phy *phy ; { phy = & dev->phy; if (! blocked) { if ((int )phy->radio_on) { return; } else { } b43_radio_write(dev, 4, 192); b43_radio_write(dev, 5, 8); b43_phy_mask(dev, 16, 65527); b43_phy_mask(dev, 17, 65527); b43_radio_init2060(dev); } else { b43_radio_write(dev, 4, 255); b43_radio_write(dev, 5, 251); b43_phy_set(dev, 16, 8); b43_phy_set(dev, 17, 8); } return; } } static int b43_aphy_op_switch_channel(struct b43_wldev *dev , unsigned int new_channel ) { { if (new_channel > 200U) { return (-22); } else { } aphy_channel_switch(dev, new_channel); return (0); } } static unsigned int b43_aphy_op_get_default_chan(struct b43_wldev *dev ) { { return (36U); } } static void b43_aphy_op_set_rx_antenna(struct b43_wldev *dev , int antenna ) { struct b43_phy *phy ; u16 tmp ; int autodiv ; u64 tmp___0 ; u64 tmp___1 ; { phy = & dev->phy; autodiv = 0; if (antenna == 2 || antenna == 3) { autodiv = 1; } else { } tmp___0 = b43_hf_read(dev); b43_hf_write(dev, tmp___0 & 0xfffffffffffffffeULL); b43_phy_maskset(dev, 1025, 65151, autodiv == 0 ? (int )((u16 )antenna) << 7U : 384); if (autodiv != 0) { tmp = b43_phy_read(dev, 1067); if (antenna == 3) { tmp = (unsigned int )tmp & 65279U; } else { tmp = (u16 )((unsigned int )tmp | 256U); } b43_phy_write(dev, 1067, (int )tmp); } else { } if ((unsigned int )phy->rev <= 2U) { b43_phy_maskset(dev, 1067, 65280, 36); } else { b43_phy_set(dev, 1121, 16); if ((unsigned int )phy->rev == 3U) { b43_phy_write(dev, 1171, 29); b43_phy_write(dev, 1063, 8); } else { b43_phy_write(dev, 1171, 58); b43_phy_maskset(dev, 1063, 65280, 8); } } tmp___1 = b43_hf_read(dev); b43_hf_write(dev, tmp___1 | 1ULL); return; } } static void b43_aphy_op_adjust_txpower(struct b43_wldev *dev ) { { return; } } static enum b43_txpwr_result b43_aphy_op_recalc_txpower(struct b43_wldev *dev , bool ignore_tssi ) { { return (1); } } static void b43_aphy_op_pwork_15sec(struct b43_wldev *dev ) { { return; } } static void b43_aphy_op_pwork_60sec(struct b43_wldev *dev ) { { return; } } struct b43_phy_operations const b43_phyops_a = {& b43_aphy_op_allocate, & b43_aphy_op_free, & b43_aphy_op_prepare_structs, 0, & b43_aphy_op_init, 0, & b43_aphy_op_read, & b43_aphy_op_write, 0, & b43_aphy_op_radio_read, & b43_aphy_op_radio_write, & b43_aphy_op_supports_hwpctl, & b43_aphy_op_software_rfkill, & b43_phyop_switch_analog_generic, & b43_aphy_op_switch_channel, & b43_aphy_op_get_default_chan, & b43_aphy_op_set_rx_antenna, 0, & b43_aphy_op_recalc_txpower, & b43_aphy_op_adjust_txpower, & b43_aphy_op_pwork_15sec, & b43_aphy_op_pwork_60sec}; void ldv_initialize_b43_phy_operations_27(void) { void *tmp ; { tmp = ldv_init_zalloc(1736UL); b43_phyops_a_group0 = (struct b43_wldev *)tmp; return; } } void ldv_main_exported_27(void) { u16 ldvarg99 ; int ldvarg96 ; bool ldvarg92 ; u16 ldvarg97 ; u16 ldvarg98 ; unsigned int ldvarg93 ; u16 ldvarg100 ; bool ldvarg91 ; bool ldvarg94 ; u16 ldvarg101 ; u16 ldvarg95 ; int tmp ; { ldv_memset((void *)(& ldvarg99), 0, 2UL); ldv_memset((void *)(& ldvarg96), 0, 4UL); ldv_memset((void *)(& ldvarg92), 0, 1UL); ldv_memset((void *)(& ldvarg97), 0, 2UL); ldv_memset((void *)(& ldvarg98), 0, 2UL); ldv_memset((void *)(& ldvarg93), 0, 4UL); ldv_memset((void *)(& ldvarg100), 0, 2UL); ldv_memset((void *)(& ldvarg91), 0, 1UL); ldv_memset((void *)(& ldvarg94), 0, 1UL); ldv_memset((void *)(& ldvarg101), 0, 2UL); ldv_memset((void *)(& ldvarg95), 0, 2UL); tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_state_variable_27 == 1) { b43_aphy_op_prepare_structs(b43_phyops_a_group0); ldv_state_variable_27 = 1; } else { } goto ldv_37215; case 1: ; if (ldv_state_variable_27 == 1) { b43_aphy_op_read(b43_phyops_a_group0, (int )ldvarg101); ldv_state_variable_27 = 1; } else { } goto ldv_37215; case 2: ; if (ldv_state_variable_27 == 1) { b43_aphy_op_allocate(b43_phyops_a_group0); ldv_state_variable_27 = 1; } else { } goto ldv_37215; case 3: ; if (ldv_state_variable_27 == 1) { b43_aphy_op_get_default_chan(b43_phyops_a_group0); ldv_state_variable_27 = 1; } else { } goto ldv_37215; case 4: ; if (ldv_state_variable_27 == 1) { b43_aphy_op_write(b43_phyops_a_group0, (int )ldvarg100, (int )ldvarg99); ldv_state_variable_27 = 1; } else { } goto ldv_37215; case 5: ; if (ldv_state_variable_27 == 1) { b43_aphy_op_pwork_15sec(b43_phyops_a_group0); ldv_state_variable_27 = 1; } else { } goto ldv_37215; case 6: ; if (ldv_state_variable_27 == 1) { b43_aphy_op_radio_write(b43_phyops_a_group0, (int )ldvarg98, (int )ldvarg97); ldv_state_variable_27 = 1; } else { } goto ldv_37215; case 7: ; if (ldv_state_variable_27 == 1) { b43_aphy_op_set_rx_antenna(b43_phyops_a_group0, ldvarg96); ldv_state_variable_27 = 1; } else { } goto ldv_37215; case 8: ; if (ldv_state_variable_27 == 1) { b43_aphy_op_radio_read(b43_phyops_a_group0, (int )ldvarg95); ldv_state_variable_27 = 1; } else { } goto ldv_37215; case 9: ; if (ldv_state_variable_27 == 1) { b43_aphy_op_supports_hwpctl(b43_phyops_a_group0); ldv_state_variable_27 = 1; } else { } goto ldv_37215; case 10: ; if (ldv_state_variable_27 == 1) { b43_aphy_op_adjust_txpower(b43_phyops_a_group0); ldv_state_variable_27 = 1; } else { } goto ldv_37215; case 11: ; if (ldv_state_variable_27 == 1) { b43_aphy_op_software_rfkill(b43_phyops_a_group0, (int )ldvarg94); ldv_state_variable_27 = 1; } else { } goto ldv_37215; case 12: ; if (ldv_state_variable_27 == 1) { b43_aphy_op_free(b43_phyops_a_group0); ldv_state_variable_27 = 1; } else { } goto ldv_37215; case 13: ; if (ldv_state_variable_27 == 1) { b43_aphy_op_switch_channel(b43_phyops_a_group0, ldvarg93); ldv_state_variable_27 = 1; } else { } goto ldv_37215; case 14: ; if (ldv_state_variable_27 == 1) { b43_aphy_op_recalc_txpower(b43_phyops_a_group0, (int )ldvarg92); ldv_state_variable_27 = 1; } else { } goto ldv_37215; case 15: ; if (ldv_state_variable_27 == 1) { b43_aphy_op_init(b43_phyops_a_group0); ldv_state_variable_27 = 1; } else { } goto ldv_37215; case 16: ; if (ldv_state_variable_27 == 1) { b43_aphy_op_pwork_60sec(b43_phyops_a_group0); ldv_state_variable_27 = 1; } else { } goto ldv_37215; case 17: ; if (ldv_state_variable_27 == 1) { b43_phyop_switch_analog_generic(b43_phyops_a_group0, (int )ldvarg91); ldv_state_variable_27 = 1; } else { } goto ldv_37215; default: ldv_stop(); } ldv_37215: ; return; } } int ldv_del_timer_sync_33(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type ldv_func_res ; int tmp ; { tmp = del_timer_sync(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_9(ldv_func_arg1); return (ldv_func_res); } } int ldv_del_timer_34(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___0 ldv_func_res ; int tmp ; { tmp = del_timer(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_9(ldv_func_arg1); return (ldv_func_res); } } int ldv_request_threaded_irq_35(unsigned int ldv_func_arg1 , irqreturn_t (*handler)(int , void * ) , irqreturn_t (*thread_fn)(int , void * ) , unsigned long ldv_func_arg4 , char const *ldv_func_arg5 , void *ldv_func_arg6 ) { ldv_func_ret_type___1 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = request_threaded_irq(ldv_func_arg1, handler, thread_fn, ldv_func_arg4, ldv_func_arg5, ldv_func_arg6); ldv_func_res = tmp; tmp___0 = reg_check_2(handler, thread_fn); if (tmp___0 != 0 && ldv_func_res >= 0) { activate_suitable_irq_2((int )ldv_func_arg1, ldv_func_arg6); } else { } return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; __inline static int fls(int x ) { int r ; { __asm__ ("bsrl %1,%0\n\tcmovzl %2,%0": "=&r" (r): "rm" (x), "rm" (-1)); return (r + 1); } } extern unsigned long int_sqrt(unsigned long ) ; int ldv_del_timer_40(struct timer_list *ldv_func_arg1 ) ; int ldv_del_timer_sync_39(struct timer_list *ldv_func_arg1 ) ; __inline static void *kcalloc(size_t n , size_t size , gfp_t flags ) { void *tmp ; { if (size != 0UL && 0xffffffffffffffffUL / size < n) { return ((void *)0); } else { } tmp = __kmalloc(n * size, flags | 32768U); return (tmp); } } int ldv_request_threaded_irq_41(unsigned int ldv_func_arg1 , irqreturn_t (*handler)(int , void * ) , irqreturn_t (*thread_fn)(int , void * ) , unsigned long ldv_func_arg4 , char const *ldv_func_arg5 , void *ldv_func_arg6 ) ; extern void ssb_pmu_set_ldo_voltage(struct ssb_chipcommon * , enum ssb_pmu_ldo_volt_id , u32 ) ; extern void ssb_pmu_set_ldo_paref(struct ssb_chipcommon * , bool ) ; u32 b43_lptab_read(struct b43_wldev *dev , u32 offset ) ; void b43_lptab_write(struct b43_wldev *dev , u32 offset , u32 value ) ; void b43_lptab_read_bulk(struct b43_wldev *dev , u32 offset , unsigned int nr_elements , void *_data___0 ) ; void b43_lptab_write_bulk(struct b43_wldev *dev , u32 offset , unsigned int nr_elements , void const *_data___0 ) ; void b2062_upload_init_table(struct b43_wldev *dev ) ; void b2063_upload_init_table(struct b43_wldev *dev ) ; void lpphy_rev0_1_table_init(struct b43_wldev *dev ) ; void lpphy_rev2plus_table_init(struct b43_wldev *dev ) ; void lpphy_init_tx_gain_table(struct b43_wldev *dev ) ; __inline static u16 channel2freq_lp(u8 channel ) { { if ((unsigned int )channel <= 13U) { return ((unsigned int )((u16 )channel) * 5U + 2407U); } else if ((unsigned int )channel == 14U) { return (2484U); } else if ((unsigned int )channel <= 183U) { return ((unsigned int )((u16 )channel) * 5U + 5000U); } else { return ((unsigned int )((u16 )channel) * 5U + 4000U); } } } static unsigned int b43_lpphy_op_get_default_chan(struct b43_wldev *dev ) { enum ieee80211_band tmp ; { tmp = b43_current_band(dev->wl); if ((unsigned int )tmp == 0U) { return (1U); } else { } return (36U); } } static int b43_lpphy_op_allocate(struct b43_wldev *dev ) { struct b43_phy_lp *lpphy ; void *tmp ; { tmp = kzalloc(188UL, 208U); lpphy = (struct b43_phy_lp *)tmp; if ((unsigned long )lpphy == (unsigned long )((struct b43_phy_lp *)0)) { return (-12); } else { } dev->phy.__annonCompField40.lp = lpphy; return (0); } } static void b43_lpphy_op_prepare_structs(struct b43_wldev *dev ) { struct b43_phy *phy ; struct b43_phy_lp *lpphy ; { phy = & dev->phy; lpphy = phy->__annonCompField40.lp; memset((void *)lpphy, 0, 188UL); lpphy->antenna = 2; return; } } static void b43_lpphy_op_free(struct b43_wldev *dev ) { struct b43_phy_lp *lpphy ; { lpphy = dev->phy.__annonCompField40.lp; kfree((void const *)lpphy); dev->phy.__annonCompField40.lp = (struct b43_phy_lp *)0; return; } } static void lpphy_read_band_sprom(struct b43_wldev *dev ) { struct b43_phy_lp *lpphy ; struct ssb_bus *bus ; u16 cckpo ; u16 maxpwr ; u32 ofdmpo ; int i ; int __ret_warn_on ; long tmp ; enum ieee80211_band tmp___0 ; { lpphy = dev->phy.__annonCompField40.lp; bus = (dev->dev)->bus; tmp___0 = b43_current_band(dev->wl); if ((unsigned int )tmp___0 == 0U) { lpphy->tx_isolation_med_band = bus->sprom.tri2g; lpphy->bx_arch = bus->sprom.bxa2g; lpphy->rx_pwr_offset = bus->sprom.rxpo2g; lpphy->rssi_vf = bus->sprom.rssismf2g; lpphy->rssi_vc = bus->sprom.rssismc2g; lpphy->rssi_gs = bus->sprom.rssisav2g; lpphy->txpa[0] = (s16 )bus->sprom.pa0b0; lpphy->txpa[1] = (s16 )bus->sprom.pa0b1; lpphy->txpa[2] = (s16 )bus->sprom.pa0b2; maxpwr = bus->sprom.maxpwr_bg; lpphy->max_tx_pwr_med_band = maxpwr; cckpo = bus->sprom.cck2gpo; __ret_warn_on = (unsigned int )bus->sprom.revision <= 7U; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_lp.c", 112); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); ofdmpo = bus->sprom.ofdm2gpo; if ((unsigned int )cckpo != 0U) { i = 0; goto ldv_37129; ldv_37128: lpphy->tx_max_rate[i] = (unsigned int )maxpwr - ((unsigned int )((u16 )ofdmpo) & 15U) * 2U; ofdmpo = ofdmpo >> 4; i = i + 1; ldv_37129: ; if (i <= 3) { goto ldv_37128; } else { } ofdmpo = bus->sprom.ofdm2gpo; i = 4; goto ldv_37132; ldv_37131: lpphy->tx_max_rate[i] = (unsigned int )maxpwr - ((unsigned int )((u16 )ofdmpo) & 15U) * 2U; ofdmpo = ofdmpo >> 4; i = i + 1; ldv_37132: ; if (i <= 14) { goto ldv_37131; } else { } } else { ofdmpo = ofdmpo & 255U; i = 0; goto ldv_37135; ldv_37134: lpphy->tx_max_rate[i] = maxpwr; i = i + 1; ldv_37135: ; if (i <= 3) { goto ldv_37134; } else { } i = 4; goto ldv_37138; ldv_37137: lpphy->tx_max_rate[i] = (int )maxpwr - (int )((u16 )ofdmpo); i = i + 1; ldv_37138: ; if (i <= 14) { goto ldv_37137; } else { } } } else { lpphy->tx_isolation_low_band = bus->sprom.tri5gl; lpphy->tx_isolation_med_band = bus->sprom.tri5g; lpphy->tx_isolation_hi_band = bus->sprom.tri5gh; lpphy->bx_arch = bus->sprom.bxa5g; lpphy->rx_pwr_offset = bus->sprom.rxpo5g; lpphy->rssi_vf = bus->sprom.rssismf5g; lpphy->rssi_vc = bus->sprom.rssismc5g; lpphy->rssi_gs = bus->sprom.rssisav5g; lpphy->txpa[0] = (s16 )bus->sprom.pa1b0; lpphy->txpa[1] = (s16 )bus->sprom.pa1b1; lpphy->txpa[2] = (s16 )bus->sprom.pa1b2; lpphy->txpal[0] = (s16 )bus->sprom.pa1lob0; lpphy->txpal[1] = (s16 )bus->sprom.pa1lob1; lpphy->txpal[2] = (s16 )bus->sprom.pa1lob2; lpphy->txpah[0] = (s16 )bus->sprom.pa1hib0; lpphy->txpah[1] = (s16 )bus->sprom.pa1hib1; lpphy->txpah[2] = (s16 )bus->sprom.pa1hib2; maxpwr = bus->sprom.maxpwr_al; ofdmpo = bus->sprom.ofdm5glpo; lpphy->max_tx_pwr_low_band = maxpwr; i = 4; goto ldv_37141; ldv_37140: lpphy->tx_max_ratel[i] = (unsigned int )maxpwr - ((unsigned int )((u16 )ofdmpo) & 15U) * 2U; ofdmpo = ofdmpo >> 4; i = i + 1; ldv_37141: ; if (i <= 11) { goto ldv_37140; } else { } maxpwr = bus->sprom.maxpwr_a; ofdmpo = bus->sprom.ofdm5gpo; lpphy->max_tx_pwr_med_band = maxpwr; i = 4; goto ldv_37144; ldv_37143: lpphy->tx_max_rate[i] = (unsigned int )maxpwr - ((unsigned int )((u16 )ofdmpo) & 15U) * 2U; ofdmpo = ofdmpo >> 4; i = i + 1; ldv_37144: ; if (i <= 11) { goto ldv_37143; } else { } maxpwr = bus->sprom.maxpwr_ah; ofdmpo = bus->sprom.ofdm5ghpo; lpphy->max_tx_pwr_hi_band = maxpwr; i = 4; goto ldv_37147; ldv_37146: lpphy->tx_max_rateh[i] = (unsigned int )maxpwr - ((unsigned int )((u16 )ofdmpo) & 15U) * 2U; ofdmpo = ofdmpo >> 4; i = i + 1; ldv_37147: ; if (i <= 11) { goto ldv_37146; } else { } } return; } } static void lpphy_adjust_gain_table(struct b43_wldev *dev , u32 freq ) { struct b43_phy_lp *lpphy ; u16 temp[3U] ; u16 isolation ; int __ret_warn_on ; long tmp ; enum ieee80211_band tmp___0 ; { lpphy = dev->phy.__annonCompField40.lp; __ret_warn_on = (unsigned int )dev->phy.rev > 1U; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_lp.c", 181); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); tmp___0 = b43_current_band(dev->wl); if ((unsigned int )tmp___0 == 0U) { isolation = (u16 )lpphy->tx_isolation_med_band; } else if (freq <= 5320U) { isolation = (u16 )lpphy->tx_isolation_low_band; } else if (freq <= 5700U) { isolation = (u16 )lpphy->tx_isolation_med_band; } else { isolation = (u16 )lpphy->tx_isolation_hi_band; } temp[0] = (int )((u16 )(((int )isolation + -26) / 12)) << 12U; temp[1] = (unsigned int )temp[0] + 4096U; temp[2] = (unsigned int )temp[0] + 8192U; b43_lptab_write_bulk(dev, 536884224U, 3U, (void const *)(& temp)); b43_lptab_write_bulk(dev, 536883200U, 3U, (void const *)(& temp)); return; } } static void lpphy_table_init(struct b43_wldev *dev ) { u32 freq ; unsigned int tmp ; u16 tmp___0 ; { tmp = b43_lpphy_op_get_default_chan(dev); tmp___0 = channel2freq_lp((int )((u8 )tmp)); freq = (u32 )tmp___0; if ((unsigned int )dev->phy.rev <= 1U) { lpphy_rev0_1_table_init(dev); } else { lpphy_rev2plus_table_init(dev); } lpphy_init_tx_gain_table(dev); if ((unsigned int )dev->phy.rev <= 1U) { lpphy_adjust_gain_table(dev, freq); } else { } return; } } static void lpphy_baseband_rev0_1_init(struct b43_wldev *dev ) { struct ssb_bus *bus ; struct b43_phy_lp *lpphy ; u16 tmp ; u16 tmp2 ; enum ieee80211_band tmp___0 ; enum ieee80211_band tmp___1 ; u64 tmp___2 ; enum ieee80211_band tmp___3 ; { bus = (dev->dev)->bus; lpphy = dev->phy.__annonCompField40.lp; b43_phy_mask(dev, 1081, 63487); b43_phy_write(dev, 1082, 0); b43_phy_write(dev, 1083, 0); b43_phy_write(dev, 1100, 0); b43_phy_write(dev, 1200, 0); b43_phy_set(dev, 1081, 4); b43_phy_maskset(dev, 1047, 65280, 120); b43_phy_maskset(dev, 1056, 33791, 22528); b43_phy_write(dev, 1136, 22); b43_phy_maskset(dev, 1078, 65528, 4); b43_phy_maskset(dev, 1061, 255, 21504); b43_phy_maskset(dev, 1059, 255, 9216); b43_phy_maskset(dev, 1060, 255, 8448); b43_phy_maskset(dev, 1061, 65280, 6); b43_phy_mask(dev, 1198, 65534); b43_phy_maskset(dev, 1056, 65504, 5); b43_phy_maskset(dev, 1056, 64543, 384); b43_phy_maskset(dev, 1056, 33791, 15360); b43_phy_maskset(dev, 1063, 65520, 5); b43_phy_maskset(dev, 1073, 65472, 26); b43_phy_maskset(dev, 1074, 65280, 179); b43_phy_maskset(dev, 1074, 255, 44288); b43_phy_maskset(dev, 1076, 65280, (int )lpphy->rx_pwr_offset); if (((int )bus->sprom.boardflags_lo & 2048) != 0) { tmp___0 = b43_current_band(dev->wl); if ((unsigned int )tmp___0 == 1U || ((int )bus->sprom.boardflags_hi & 4) != 0) { ssb_pmu_set_ldo_voltage(& bus->chipco, 0, 40U); ssb_pmu_set_ldo_paref(& bus->chipco, 1); if ((unsigned int )dev->phy.rev == 0U) { b43_phy_maskset(dev, 1196, 65487, 16); } else { } b43_lptab_write(dev, 536882183U, 60U); } else { ssb_pmu_set_ldo_paref(& bus->chipco, 0); b43_phy_maskset(dev, 1196, 65487, 32); b43_lptab_write(dev, 536882183U, 100U); } } else { ssb_pmu_set_ldo_paref(& bus->chipco, 0); b43_phy_maskset(dev, 1196, 65487, 32); b43_lptab_write(dev, 536882183U, 100U); } tmp = (u16 )(((int )((short )lpphy->rssi_vf) | (int )((short )((int )lpphy->rssi_vc << 4))) | -24576); b43_phy_write(dev, 1085, (int )tmp); if (((int )bus->sprom.boardflags_hi & 2) != 0) { b43_phy_maskset(dev, 1086, 61440, 2730); } else { b43_phy_maskset(dev, 1086, 61440, 682); } b43_lptab_write(dev, 536882177U, 24U); b43_phy_maskset(dev, 1198, 65529, (int )((u16 )lpphy->bx_arch) << 1U); if ((unsigned int )dev->phy.rev == 1U && ((int )bus->sprom.boardflags_hi & 64) != 0) { b43_phy_maskset(dev, 1102, 65472, 10); b43_phy_maskset(dev, 1102, 16128, 2304); b43_phy_maskset(dev, 1103, 65472, 10); b43_phy_maskset(dev, 1103, 49407, 2816); b43_phy_maskset(dev, 1211, 65472, 10); b43_phy_maskset(dev, 1211, 49407, 1024); b43_phy_maskset(dev, 1212, 65472, 10); b43_phy_maskset(dev, 1212, 49407, 2816); b43_phy_maskset(dev, 1223, 65472, 10); b43_phy_maskset(dev, 1223, 49407, 2304); b43_phy_maskset(dev, 1224, 65472, 10); b43_phy_maskset(dev, 1224, 49407, 2816); b43_phy_maskset(dev, 1225, 65472, 10); b43_phy_maskset(dev, 1225, 49407, 2304); b43_phy_maskset(dev, 1226, 65472, 10); b43_phy_maskset(dev, 1226, 49407, 2816); } else { tmp___1 = b43_current_band(dev->wl); if (((unsigned int )tmp___1 == 1U || (unsigned int )bus->boardinfo.type == 1162U) || ((unsigned int )dev->phy.rev == 0U && ((int )bus->sprom.boardflags_lo & 2048) != 0)) { b43_phy_maskset(dev, 1102, 65472, 1); b43_phy_maskset(dev, 1102, 49407, 1024); b43_phy_maskset(dev, 1103, 65472, 1); b43_phy_maskset(dev, 1103, 49407, 1280); b43_phy_maskset(dev, 1211, 65472, 2); b43_phy_maskset(dev, 1211, 49407, 2048); b43_phy_maskset(dev, 1212, 65472, 2); b43_phy_maskset(dev, 1212, 49407, 2560); } else if ((unsigned int )dev->phy.rev == 1U || ((int )bus->sprom.boardflags_lo & 2048) != 0) { b43_phy_maskset(dev, 1102, 65472, 4); b43_phy_maskset(dev, 1102, 49407, 2048); b43_phy_maskset(dev, 1103, 65472, 4); b43_phy_maskset(dev, 1103, 49407, 3072); b43_phy_maskset(dev, 1211, 65472, 2); b43_phy_maskset(dev, 1211, 49407, 256); b43_phy_maskset(dev, 1212, 65472, 2); b43_phy_maskset(dev, 1212, 49407, 768); } else { b43_phy_maskset(dev, 1102, 65472, 10); b43_phy_maskset(dev, 1102, 49407, 2304); b43_phy_maskset(dev, 1103, 65472, 10); b43_phy_maskset(dev, 1103, 49407, 2816); b43_phy_maskset(dev, 1211, 65472, 6); b43_phy_maskset(dev, 1211, 49407, 1280); b43_phy_maskset(dev, 1212, 65472, 6); b43_phy_maskset(dev, 1212, 49407, 1792); } } if ((unsigned int )dev->phy.rev == 1U && ((int )bus->sprom.boardflags_hi & 4) != 0) { b43_phy_copy(dev, 1223, 1102); b43_phy_copy(dev, 1224, 1103); b43_phy_copy(dev, 1225, 1211); b43_phy_copy(dev, 1226, 1212); } else { } if ((((int )bus->sprom.boardflags_hi & 64) != 0 && (unsigned int )bus->chip_id == 21332U) && (unsigned int )bus->chip_package == 1U) { b43_phy_set(dev, 1040, 6); b43_phy_write(dev, 1215, 5); b43_phy_write(dev, 1214, 65535); tmp___2 = b43_hf_read(dev); b43_hf_write(dev, tmp___2 | 8796093022208ULL); } else { } tmp___3 = b43_current_band(dev->wl); if ((unsigned int )tmp___3 == 0U) { b43_phy_set(dev, 1096, 32768); b43_phy_set(dev, 1040, 64); b43_phy_maskset(dev, 1046, 255, 41984); b43_phy_maskset(dev, 1040, 61695, 2816); b43_phy_maskset(dev, 48, 65528, 7); b43_phy_maskset(dev, 1071, 65528, 3); b43_phy_maskset(dev, 1071, 65479, 32); b43_phy_mask(dev, 1050, 255); } else { b43_phy_mask(dev, 1096, 32767); b43_phy_mask(dev, 1040, 65471); } if ((unsigned int )dev->phy.rev == 1U) { tmp = b43_phy_read(dev, 1056); tmp2 = (u16 )(((int )tmp & 992) >> 5); tmp2 = (u16 )((int )((short )((int )tmp2 << 5)) | (int )((short )tmp2)); b43_phy_write(dev, 1219, (int )tmp2); tmp = b43_phy_read(dev, 1063); tmp2 = (u16 )(((int )tmp & 7936) >> 8); tmp2 = (u16 )((int )((short )((int )tmp2 << 5)) | (int )((short )tmp2)); b43_phy_write(dev, 1220, (int )tmp2); tmp = b43_phy_read(dev, 1061); tmp2 = (unsigned int )tmp & 255U; tmp2 = (u16 )((int )((short )((int )tmp << 8)) | (int )((short )tmp2)); b43_phy_write(dev, 1221, (int )tmp2); } else { } return; } } static void lpphy_save_dig_flt_state(struct b43_wldev *dev ) { u16 addr[9U] ; u16 coefs[9U] ; struct b43_phy_lp *lpphy ; int i ; { addr[0] = 1217U; addr[1] = 1218U; addr[2] = 1219U; addr[3] = 1220U; addr[4] = 1221U; addr[5] = 1222U; addr[6] = 1223U; addr[7] = 1224U; addr[8] = 1231U; coefs[0] = 56926U; coefs[1] = 59442U; coefs[2] = 58161U; coefs[3] = 19750U; coefs[4] = 38U; coefs[5] = 5152U; coefs[6] = 32U; coefs[7] = 65032U; coefs[8] = 8U; lpphy = dev->phy.__annonCompField40.lp; i = 0; goto ldv_37179; ldv_37178: lpphy->dig_flt_state[i] = b43_phy_read(dev, (int )addr[i]); b43_phy_write(dev, (int )addr[i], (int )coefs[i]); i = i + 1; ldv_37179: ; if ((unsigned int )i <= 8U) { goto ldv_37178; } else { } return; } } static void lpphy_restore_dig_flt_state(struct b43_wldev *dev ) { u16 addr[9U] ; struct b43_phy_lp *lpphy ; int i ; { addr[0] = 1217U; addr[1] = 1218U; addr[2] = 1219U; addr[3] = 1220U; addr[4] = 1221U; addr[5] = 1222U; addr[6] = 1223U; addr[7] = 1224U; addr[8] = 1231U; lpphy = dev->phy.__annonCompField40.lp; i = 0; goto ldv_37190; ldv_37189: b43_phy_write(dev, (int )addr[i], (int )lpphy->dig_flt_state[i]); i = i + 1; ldv_37190: ; if ((unsigned int )i <= 8U) { goto ldv_37189; } else { } return; } } static void lpphy_baseband_rev2plus_init(struct b43_wldev *dev ) { struct ssb_bus *bus ; struct b43_phy_lp *lpphy ; enum ieee80211_band tmp ; { bus = (dev->dev)->bus; lpphy = dev->phy.__annonCompField40.lp; b43_phy_write(dev, 1081, 80); b43_phy_write(dev, 1082, 34816); b43_phy_write(dev, 1083, 0); b43_phy_write(dev, 1084, 0); b43_phy_write(dev, 1100, 0); b43_phy_write(dev, 1200, 0); b43_phy_write(dev, 1273, 0); b43_phy_write(dev, 1102, 0); b43_phy_set(dev, 1136, 16); b43_phy_maskset(dev, 1047, 65280, 180); b43_phy_maskset(dev, 1052, 63743, 512); b43_phy_maskset(dev, 1052, 65280, 127); b43_phy_maskset(dev, 1063, 65295, 64); b43_phy_maskset(dev, 1054, 65280, 2); b43_phy_mask(dev, 1040, 49151); b43_phy_mask(dev, 1040, 57343); b43_phy_set(dev, 1290, 1); if ((unsigned int )bus->boardinfo.rev > 23U) { b43_lptab_write(dev, 805323841U, 236U); b43_phy_maskset(dev, 1290, 65281, 20); } else { b43_phy_maskset(dev, 1290, 65281, 16); } b43_phy_maskset(dev, 1247, 65280, 244); b43_phy_maskset(dev, 1247, 255, 61696); b43_phy_write(dev, 1055, 72); b43_phy_maskset(dev, 1059, 65280, 70); b43_phy_maskset(dev, 1252, 65280, 16); b43_phy_maskset(dev, 1065, 65520, 9); b43_phy_mask(dev, 1063, 65520); b43_phy_maskset(dev, 1061, 255, 21760); b43_phy_maskset(dev, 1056, 64543, 160); b43_phy_maskset(dev, 1063, 57599, 768); b43_phy_maskset(dev, 1059, 255, 10752); if ((unsigned int )bus->chip_id == 17189U && (unsigned int )bus->chip_rev == 0U) { b43_phy_maskset(dev, 1060, 255, 8448); b43_phy_maskset(dev, 1061, 65280, 10); } else { b43_phy_maskset(dev, 1060, 255, 7680); b43_phy_maskset(dev, 1061, 65280, 13); } b43_phy_maskset(dev, 1278, 65504, 31); b43_phy_maskset(dev, 1279, 65504, 12); b43_phy_maskset(dev, 1280, 65280, 25); b43_phy_maskset(dev, 1279, 1023, 15360); b43_phy_maskset(dev, 1278, 64543, 992); b43_phy_maskset(dev, 1279, 65504, 12); b43_phy_maskset(dev, 1280, 255, 6400); b43_phy_maskset(dev, 1056, 33791, 22528); b43_phy_maskset(dev, 1056, 65504, 18); b43_phy_maskset(dev, 1062, 4095, 36864); if ((unsigned int )bus->chip_id == 17189U && (unsigned int )bus->chip_rev == 0U) { b43_lptab_write(dev, 536879124U, 0U); b43_lptab_write(dev, 536879122U, 64U); } else { } tmp = b43_current_band(dev->wl); if ((unsigned int )tmp == 0U) { b43_phy_set(dev, 1040, 64); b43_phy_maskset(dev, 1040, 61695, 2816); b43_phy_maskset(dev, 48, 65528, 6); b43_phy_maskset(dev, 1046, 255, 40192); b43_phy_maskset(dev, 1046, 65280, 161); b43_phy_mask(dev, 1050, 255); } else { b43_phy_mask(dev, 1040, 65471); } b43_phy_maskset(dev, 1074, 65280, 179); b43_phy_maskset(dev, 1074, 255, 44288); b43_phy_maskset(dev, 1076, 65280, (int )lpphy->rx_pwr_offset); b43_phy_set(dev, 1098, 68); b43_phy_write(dev, 1098, 128); b43_phy_write(dev, 1085, 43348); b43_phy_write(dev, 1086, (int )((u16 )((((int )((short )((int )lpphy->rssi_gs << 10)) | 8192) | (int )((short )((int )lpphy->rssi_vc << 4))) | (int )((short )lpphy->rssi_vf)))); if ((unsigned int )bus->chip_id == 17189U && (unsigned int )bus->chip_rev == 0U) { b43_phy_set(dev, 1078, 28); b43_phy_maskset(dev, 1082, 255, 34816); b43_phy_maskset(dev, 1079, 64572, 1024); } else { } lpphy_save_dig_flt_state(dev); return; } } static void lpphy_baseband_init(struct b43_wldev *dev ) { { lpphy_table_init(dev); if ((unsigned int )dev->phy.rev > 1U) { lpphy_baseband_rev2plus_init(dev); } else { lpphy_baseband_rev0_1_init(dev); } return; } } static void lpphy_2062_init(struct b43_wldev *dev ) { struct b43_phy_lp *lpphy ; struct ssb_bus *bus ; u32 crystalfreq ; u32 tmp ; u32 ref ; unsigned int i ; struct b2062_freqdata const *fd ; struct b2062_freqdata freqdata_tab[6U] ; u16 tmp___0 ; enum ieee80211_band tmp___1 ; int __ret_warn_on ; long tmp___2 ; int __ret_warn_on___0 ; long tmp___3 ; { lpphy = dev->phy.__annonCompField40.lp; bus = (dev->dev)->bus; fd = (struct b2062_freqdata const *)0; freqdata_tab[0].freq = 12000U; freqdata_tab[0].data[0] = 6U; freqdata_tab[0].data[1] = 6U; freqdata_tab[0].data[2] = 6U; freqdata_tab[0].data[3] = 6U; freqdata_tab[0].data[4] = 10U; freqdata_tab[0].data[5] = 6U; freqdata_tab[1].freq = 13000U; freqdata_tab[1].data[0] = 4U; freqdata_tab[1].data[1] = 4U; freqdata_tab[1].data[2] = 4U; freqdata_tab[1].data[3] = 4U; freqdata_tab[1].data[4] = 11U; freqdata_tab[1].data[5] = 7U; freqdata_tab[2].freq = 14400U; freqdata_tab[2].data[0] = 3U; freqdata_tab[2].data[1] = 3U; freqdata_tab[2].data[2] = 3U; freqdata_tab[2].data[3] = 3U; freqdata_tab[2].data[4] = 12U; freqdata_tab[2].data[5] = 7U; freqdata_tab[3].freq = 16200U; freqdata_tab[3].data[0] = 3U; freqdata_tab[3].data[1] = 3U; freqdata_tab[3].data[2] = 3U; freqdata_tab[3].data[3] = 3U; freqdata_tab[3].data[4] = 13U; freqdata_tab[3].data[5] = 8U; freqdata_tab[4].freq = 18000U; freqdata_tab[4].data[0] = 2U; freqdata_tab[4].data[1] = 2U; freqdata_tab[4].data[2] = 2U; freqdata_tab[4].data[3] = 2U; freqdata_tab[4].data[4] = 14U; freqdata_tab[4].data[5] = 8U; freqdata_tab[5].freq = 19200U; freqdata_tab[5].data[0] = 1U; freqdata_tab[5].data[1] = 1U; freqdata_tab[5].data[2] = 1U; freqdata_tab[5].data[3] = 1U; freqdata_tab[5].data[4] = 14U; freqdata_tab[5].data[5] = 9U; b2062_upload_init_table(dev); b43_radio_write(dev, 72, 0); b43_radio_write(dev, 73, 0); b43_radio_write(dev, 74, 0); b43_radio_write(dev, 75, 0); b43_radio_write(dev, 16, 64); b43_radio_write(dev, 16, 0); b43_radio_write(dev, 93, 16); b43_radio_write(dev, 93, 0); if ((unsigned int )dev->phy.rev != 0U) { tmp___0 = b43_radio_read(dev, 2); b43_radio_write(dev, 16405, (int )((unsigned int )((int )tmp___0 >> 1) | 128U)); } else { } tmp___1 = b43_current_band(dev->wl); if ((unsigned int )tmp___1 == 0U) { b43_radio_set(dev, 87, 1); } else { b43_radio_mask(dev, 87, 65534); } crystalfreq = bus->chipco.pmu.crystalfreq * 1000U; __ret_warn_on = (bus->chipco.capabilities & 268435456U) == 0U; tmp___2 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___2 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_lp.c", 564); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); __ret_warn_on___0 = crystalfreq == 0U; tmp___3 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___3 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_lp.c", 565); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (crystalfreq <= 30000000U) { lpphy->pdiv = 1U; b43_radio_mask(dev, 16437, 65531); } else { lpphy->pdiv = 2U; b43_radio_set(dev, 16437, 4); } tmp = ((lpphy->pdiv * 800000000U + crystalfreq) / (crystalfreq * 2U) - 8U) & 255U; b43_radio_write(dev, 16443, (int )((u16 )tmp)); tmp = ((crystalfreq * 100U + lpphy->pdiv * 16000000U) / (lpphy->pdiv * 32000000U) - 1U) & 255U; b43_radio_write(dev, 16454, (int )((u16 )tmp)); tmp = (((lpphy->pdiv * 500000U + crystalfreq) * 2U) / (lpphy->pdiv * 2000000U) - 1U) & 255U; b43_radio_write(dev, 16455, (int )((u16 )tmp)); ref = ((lpphy->pdiv * 500U + crystalfreq) * 2U) / (lpphy->pdiv * 2000U); ref = ref & 65535U; i = 0U; goto ldv_37222; ldv_37221: ; if ((u32 )freqdata_tab[i].freq > ref) { fd = (struct b2062_freqdata const *)(& freqdata_tab) + (unsigned long )i; goto ldv_37220; } else { } i = i + 1U; ldv_37222: ; if (i <= 5U) { goto ldv_37221; } else { } ldv_37220: ; if ((unsigned long )fd == (unsigned long )((struct b2062_freqdata const *)0)) { fd = (struct b2062_freqdata const *)(& freqdata_tab) + 5UL; } else { } b43dbg(dev->wl, "b2062: Using crystal tab entry %u kHz.\n", (int )fd->freq); b43_radio_write(dev, 16444, (int )((u16 )((int )((short )((int )fd->data[1] << 4)) | (int )((short )fd->data[0])))); b43_radio_write(dev, 16445, (int )((u16 )((int )((short )((int )fd->data[3] << 4)) | (int )((short )fd->data[2])))); b43_radio_write(dev, 16446, (int )fd->data[4]); b43_radio_write(dev, 16447, (int )fd->data[5]); return; } } static void lpphy_2063_init(struct b43_wldev *dev ) { { b2063_upload_init_table(dev); b43_radio_write(dev, 32, 0); b43_radio_set(dev, 8, 56); b43_radio_write(dev, 86, 86); b43_radio_mask(dev, 243, 65533); b43_radio_write(dev, 82, 0); b43_radio_write(dev, 64, 32); b43_radio_write(dev, 67, 64); if ((unsigned int )dev->phy.rev == 2U) { b43_radio_write(dev, 78, 160); b43_radio_write(dev, 79, 160); b43_radio_write(dev, 77, 24); } else { b43_radio_write(dev, 78, 32); b43_radio_write(dev, 77, 32); } return; } } static struct lpphy_stx_table_entry const lpphy_stx_table[29U] = { {2U, 6U, 61U, 3U, 1U}, {1U, 12U, 76U, 1U, 1U}, {1U, 8U, 80U, 0U, 127U}, {0U, 8U, 68U, 0U, 255U}, {1U, 0U, 74U, 0U, 255U}, {0U, 4U, 77U, 0U, 255U}, {1U, 4U, 78U, 0U, 255U}, {0U, 12U, 79U, 0U, 15U}, {1U, 0U, 79U, 4U, 15U}, {3U, 0U, 73U, 0U, 15U}, {4U, 3U, 70U, 4U, 7U}, {3U, 15U, 70U, 0U, 1U}, {4U, 0U, 70U, 1U, 7U}, {3U, 8U, 72U, 4U, 7U}, {3U, 11U, 72U, 0U, 15U}, {3U, 4U, 73U, 4U, 15U}, {2U, 15U, 69U, 0U, 1U}, {5U, 13U, 82U, 4U, 7U}, {6U, 0U, 82U, 7U, 1U}, {5U, 3U, 65U, 5U, 7U}, {5U, 6U, 65U, 0U, 15U}, {5U, 10U, 66U, 5U, 7U}, {4U, 15U, 66U, 0U, 1U}, {5U, 0U, 66U, 1U, 7U}, {4U, 11U, 67U, 4U, 15U}, {4U, 7U, 67U, 0U, 15U}, {4U, 6U, 69U, 1U, 1U}, {2U, 7U, 64U, 4U, 15U}, {2U, 11U, 64U, 0U, 15U}}; static void lpphy_sync_stx(struct b43_wldev *dev ) { struct lpphy_stx_table_entry const *e ; unsigned int i ; u16 tmp ; { i = 0U; goto ldv_37244; ldv_37243: e = (struct lpphy_stx_table_entry const *)(& lpphy_stx_table) + (unsigned long )i; tmp = b43_radio_read(dev, (int )e->rf_addr); tmp = (u16 )((int )tmp >> (int )e->rf_shift); tmp = (u16 )((int )tmp << (int )e->phy_shift); b43_phy_maskset(dev, (int )((u16 )((int )((short )((unsigned int )((unsigned short )e->phy_offset) + 242U)) | 1024)), ~ ((int )((u16 )((int )e->mask << (int )e->phy_shift))), (int )tmp); i = i + 1U; ldv_37244: ; if (i <= 28U) { goto ldv_37243; } else { } return; } } static void lpphy_radio_init(struct b43_wldev *dev ) { { b43_phy_set(dev, 1186, 2); __const_udelay(4295UL); b43_phy_mask(dev, 1186, 65533); __const_udelay(4295UL); if ((unsigned int )dev->phy.radio_ver == 8290U) { lpphy_2062_init(dev); } else { lpphy_2063_init(dev); lpphy_sync_stx(dev); b43_phy_write(dev, 1264, 24448); b43_phy_write(dev, 1265, 0); } return; } } static void lpphy_set_rc_cap(struct b43_wldev *dev ) { struct b43_phy_lp *lpphy ; u8 rc_cap ; u8 __min1 ; u8 __min2 ; u8 __max1 ; u8 __max2 ; { lpphy = dev->phy.__annonCompField40.lp; rc_cap = (u8 )(((int )lpphy->rc_cap & 31) >> 1); if ((unsigned int )dev->phy.rev == 1U) { __min1 = (unsigned int )rc_cap + 5U; __min2 = 15U; rc_cap = (u8 )((int )__min1 < (int )__min2 ? __min1 : __min2); } else { } __max1 = (unsigned int )lpphy->rc_cap + 252U; __max2 = 128U; b43_radio_write(dev, 58, (int )((u16 )((int )__max1 > (int )__max2 ? __max1 : __max2))); b43_radio_write(dev, 79, (int )((unsigned int )rc_cap | 128U)); b43_radio_write(dev, 16487, (int )((u16 )((int )((short )(((int )lpphy->rc_cap & 31) >> 2)) | 128))); return; } } static u8 lpphy_get_bb_mult(struct b43_wldev *dev ) { u32 tmp ; { tmp = b43_lptab_read(dev, 536870999U); return ((u8 )((tmp & 65280U) >> 8)); } } static void lpphy_set_bb_mult(struct b43_wldev *dev , u8 bb_mult ) { { b43_lptab_write(dev, 536870999U, (u32 )((int )bb_mult << 8)); return; } } static void lpphy_set_deaf(struct b43_wldev *dev , bool user ) { struct b43_phy_lp *lpphy ; { lpphy = dev->phy.__annonCompField40.lp; if ((int )user) { lpphy->crs_usr_disable = 1; } else { lpphy->crs_sys_disable = 1; } b43_phy_maskset(dev, 1040, 65311, 128); return; } } static void lpphy_clear_deaf(struct b43_wldev *dev , bool user ) { struct b43_phy_lp *lpphy ; enum ieee80211_band tmp ; { lpphy = dev->phy.__annonCompField40.lp; if ((int )user) { lpphy->crs_usr_disable = 0; } else { lpphy->crs_sys_disable = 0; } if (! lpphy->crs_usr_disable && ! lpphy->crs_sys_disable) { tmp = b43_current_band(dev->wl); if ((unsigned int )tmp == 0U) { b43_phy_maskset(dev, 1040, 65311, 96); } else { b43_phy_maskset(dev, 1040, 65311, 32); } } else { } return; } } static void lpphy_set_trsw_over(struct b43_wldev *dev , bool tx , bool rx ) { u16 trsw ; { trsw = (u16 )((int )((short )((int )tx << 1)) | (int )((short )rx)); b43_phy_maskset(dev, 1101, 65532, (int )trsw); b43_phy_set(dev, 1100, 3); return; } } static void lpphy_disable_crs(struct b43_wldev *dev , bool user ) { { lpphy_set_deaf(dev, (int )user); lpphy_set_trsw_over(dev, 0, 1); b43_phy_mask(dev, 1101, 65531); b43_phy_set(dev, 1100, 4); b43_phy_mask(dev, 1101, 65527); b43_phy_set(dev, 1100, 8); b43_phy_set(dev, 1101, 16); b43_phy_set(dev, 1100, 16); b43_phy_mask(dev, 1101, 65503); b43_phy_set(dev, 1100, 32); b43_phy_mask(dev, 1101, 65471); b43_phy_set(dev, 1100, 64); b43_phy_set(dev, 1201, 7); b43_phy_set(dev, 1201, 56); b43_phy_mask(dev, 1201, 65343); b43_phy_set(dev, 1201, 256); b43_phy_mask(dev, 1201, 65023); b43_phy_write(dev, 1202, 0); b43_phy_write(dev, 1203, 1); b43_phy_write(dev, 1204, 32); b43_phy_mask(dev, 1201, 64511); b43_phy_mask(dev, 1201, 63487); b43_phy_write(dev, 1205, 0); b43_phy_write(dev, 1206, 17839); b43_phy_write(dev, 1200, 1023); return; } } static void lpphy_restore_crs(struct b43_wldev *dev , bool user ) { { lpphy_clear_deaf(dev, (int )user); b43_phy_mask(dev, 1100, 65408); b43_phy_mask(dev, 1200, 64512); return; } } static void lpphy_disable_rx_gain_override(struct b43_wldev *dev ) { enum ieee80211_band tmp ; { b43_phy_mask(dev, 1100, 65534); b43_phy_mask(dev, 1100, 65519); b43_phy_mask(dev, 1100, 65471); if ((unsigned int )dev->phy.rev > 1U) { b43_phy_mask(dev, 1200, 65279); tmp = b43_current_band(dev->wl); if ((unsigned int )tmp == 0U) { b43_phy_mask(dev, 1200, 64511); b43_phy_mask(dev, 1253, 65527); } else { } } else { b43_phy_mask(dev, 1200, 65023); } return; } } static void lpphy_enable_rx_gain_override(struct b43_wldev *dev ) { enum ieee80211_band tmp ; { b43_phy_set(dev, 1100, 1); b43_phy_set(dev, 1100, 16); b43_phy_set(dev, 1100, 64); if ((unsigned int )dev->phy.rev > 1U) { b43_phy_set(dev, 1200, 256); tmp = b43_current_band(dev->wl); if ((unsigned int )tmp == 0U) { b43_phy_set(dev, 1200, 1024); b43_phy_set(dev, 1253, 8); } else { } } else { b43_phy_set(dev, 1200, 512); } return; } } static void lpphy_disable_tx_gain_override(struct b43_wldev *dev ) { { if ((unsigned int )dev->phy.rev <= 1U) { b43_phy_mask(dev, 1200, 65279); } else { b43_phy_mask(dev, 1200, 65407); b43_phy_mask(dev, 1200, 49151); } b43_phy_mask(dev, 1083, 65471); return; } } static void lpphy_enable_tx_gain_override(struct b43_wldev *dev ) { { if ((unsigned int )dev->phy.rev <= 1U) { b43_phy_set(dev, 1200, 256); } else { b43_phy_set(dev, 1200, 128); b43_phy_set(dev, 1200, 16384); } b43_phy_set(dev, 1083, 64); return; } } static struct lpphy_tx_gains lpphy_get_tx_gains(struct b43_wldev *dev ) { struct lpphy_tx_gains gains ; u16 tmp ; u16 tmp___0 ; u16 tmp___1 ; u16 tmp___2 ; { tmp___0 = b43_phy_read(dev, 1081); gains.dac = (u16 )(((int )tmp___0 & 896) >> 7); if ((unsigned int )dev->phy.rev <= 1U) { tmp___1 = b43_phy_read(dev, 1205); tmp = (unsigned int )tmp___1 & 2047U; gains.gm = (unsigned int )tmp & 7U; gains.pga = (u16 )(((int )tmp & 120) >> 3); gains.pad = (u16 )(((int )tmp & 1920) >> 7); } else { tmp = b43_phy_read(dev, 1205); tmp___2 = b43_phy_read(dev, 1275); gains.pad = (unsigned int )tmp___2 & 255U; gains.gm = (unsigned int )tmp & 255U; gains.pga = (u16 )((int )tmp >> 8); } return (gains); } } static void lpphy_set_dac_gain(struct b43_wldev *dev , u16 dac ) { u16 ctl ; u16 tmp ; { tmp = b43_phy_read(dev, 1081); ctl = (unsigned int )tmp & 3199U; ctl = (u16 )((int )((short )((int )dac << 7)) | (int )((short )ctl)); b43_phy_maskset(dev, 1081, 61440, (int )ctl); return; } } static u16 lpphy_get_pa_gain(struct b43_wldev *dev ) { u16 tmp ; { tmp = b43_phy_read(dev, 1275); return ((unsigned int )tmp & 127U); } } static void lpphy_set_pa_gain(struct b43_wldev *dev , u16 gain ) { { b43_phy_maskset(dev, 1275, 57407, (int )gain << 6U); b43_phy_maskset(dev, 1277, 33023, (int )gain << 8U); return; } } static void lpphy_set_tx_gains(struct b43_wldev *dev , struct lpphy_tx_gains gains ) { u16 rf_gain ; u16 pa_gain ; { if ((unsigned int )dev->phy.rev <= 1U) { rf_gain = (u16 )(((int )((short )((int )gains.pad << 7)) | (int )((short )((int )gains.pga << 3))) | (int )((short )gains.gm)); b43_phy_maskset(dev, 1205, 63488, (int )rf_gain); } else { pa_gain = lpphy_get_pa_gain(dev); b43_phy_write(dev, 1205, (int )((u16 )((int )((short )((int )gains.pga << 8)) | (int )((short )gains.gm)))); b43_phy_maskset(dev, 1275, 32768, (int )((u16 )((int )((short )gains.pad) | (int )((short )((int )pa_gain << 6))))); b43_phy_write(dev, 1276, (int )((u16 )((int )((short )((int )gains.pga << 8)) | (int )((short )gains.gm)))); b43_phy_maskset(dev, 1277, 32768, (int )((u16 )((int )((short )gains.pad) | (int )((short )((int )pa_gain << 8))))); } lpphy_set_dac_gain(dev, (int )gains.dac); lpphy_enable_tx_gain_override(dev); return; } } static void lpphy_rev0_1_set_rx_gain(struct b43_wldev *dev , u32 gain ) { u16 trsw ; u16 lna ; u16 ext_lna ; { trsw = (unsigned int )((u16 )gain) & 1U; lna = ((unsigned int )((u16 )gain) & 65532U) | (unsigned int )((u16 )((gain & 12U) >> 2)); ext_lna = (u16 )((gain & 2U) >> 1); b43_phy_maskset(dev, 1101, 65534, (int )trsw); b43_phy_maskset(dev, 1201, 64511, (int )ext_lna << 10U); b43_phy_maskset(dev, 1201, 63487, (int )ext_lna << 11U); b43_phy_write(dev, 1206, (int )lna); return; } } static void lpphy_rev2plus_set_rx_gain(struct b43_wldev *dev , u32 gain ) { u16 low_gain ; u16 high_gain ; u16 ext_lna ; u16 trsw ; u16 tmp ; enum ieee80211_band tmp___0 ; { low_gain = (u16 )gain; high_gain = (unsigned int )((u16 )(gain >> 16)) & 15U; ext_lna = (unsigned int )((u16 )(gain >> 21)) & 1U; trsw = (gain & 1048576U) == 0U; b43_phy_maskset(dev, 1101, 65534, (int )trsw); b43_phy_maskset(dev, 1201, 65023, (int )ext_lna << 9U); b43_phy_maskset(dev, 1201, 64511, (int )ext_lna << 10U); b43_phy_write(dev, 1206, (int )low_gain); b43_phy_maskset(dev, 1207, 65520, (int )high_gain); tmp___0 = b43_current_band(dev->wl); if ((unsigned int )tmp___0 == 0U) { tmp = (unsigned int )((u16 )(gain >> 2)) & 3U; b43_phy_maskset(dev, 1201, 59391, (int )tmp << 11U); b43_phy_maskset(dev, 1254, 65511, (int )tmp << 3U); } else { } return; } } static void lpphy_set_rx_gain(struct b43_wldev *dev , u32 gain ) { { if ((unsigned int )dev->phy.rev <= 1U) { lpphy_rev0_1_set_rx_gain(dev, gain); } else { lpphy_rev2plus_set_rx_gain(dev, gain); } lpphy_enable_rx_gain_override(dev); return; } } static void lpphy_set_rx_gain_by_index(struct b43_wldev *dev , u16 idx ) { u32 gain ; u32 tmp ; { tmp = b43_lptab_read(dev, (u32 )((int )((unsigned int )idx | 12288U) | 536870912)); gain = tmp; lpphy_set_rx_gain(dev, gain); return; } } static void lpphy_stop_ddfs(struct b43_wldev *dev ) { { b43_phy_mask(dev, 1207, 65533); b43_phy_mask(dev, 1096, 65503); return; } } static void lpphy_run_ddfs(struct b43_wldev *dev , int i_on , int q_on , int incr1 , int incr2 , int scale_idx ) { { lpphy_stop_ddfs(dev); b43_phy_mask(dev, 1208, 65408); b43_phy_mask(dev, 1208, 33023); b43_phy_maskset(dev, 1209, 65408, (int )((u16 )incr1)); b43_phy_maskset(dev, 1209, 33023, (int )((u16 )incr2) << 8U); b43_phy_maskset(dev, 1207, 65527, (int )((u16 )i_on) << 3U); b43_phy_maskset(dev, 1207, 65519, (int )((u16 )q_on) << 4U); b43_phy_maskset(dev, 1207, 65439, (int )((u16 )scale_idx) << 5U); b43_phy_mask(dev, 1207, 65531); b43_phy_set(dev, 1207, 2); b43_phy_set(dev, 1096, 32); return; } } static bool lpphy_rx_iq_est(struct b43_wldev *dev , u16 samples , u8 time , struct lpphy_iq_est *iq_est ) { int i ; u16 tmp ; u16 tmp___0 ; u16 tmp___1 ; u16 tmp___2 ; u16 tmp___3 ; u16 tmp___4 ; u16 tmp___5 ; u16 tmp___6 ; { b43_phy_mask(dev, 1040, 65527); b43_phy_write(dev, 1154, (int )samples); b43_phy_maskset(dev, 1153, 65280, (int )time); b43_phy_mask(dev, 1153, 65279); b43_phy_set(dev, 1153, 512); i = 0; goto ldv_37380; ldv_37379: tmp = b43_phy_read(dev, 1153); if (((int )tmp & 512) == 0) { goto ldv_37378; } else { } msleep(1U); i = i + 1; ldv_37380: ; if (i <= 499) { goto ldv_37379; } else { } ldv_37378: tmp___0 = b43_phy_read(dev, 1153); if (((int )tmp___0 & 512) != 0) { b43_phy_set(dev, 1040, 8); return (0); } else { } tmp___1 = b43_phy_read(dev, 1155); iq_est->iq_prod = (u32 )tmp___1; iq_est->iq_prod = iq_est->iq_prod << 16; tmp___2 = b43_phy_read(dev, 1156); iq_est->iq_prod = iq_est->iq_prod | (u32 )tmp___2; tmp___3 = b43_phy_read(dev, 1157); iq_est->i_pwr = (u32 )tmp___3; iq_est->i_pwr = iq_est->i_pwr << 16; tmp___4 = b43_phy_read(dev, 1158); iq_est->i_pwr = iq_est->i_pwr | (u32 )tmp___4; tmp___5 = b43_phy_read(dev, 1159); iq_est->q_pwr = (u32 )tmp___5; iq_est->q_pwr = iq_est->q_pwr << 16; tmp___6 = b43_phy_read(dev, 1160); iq_est->q_pwr = iq_est->q_pwr | (u32 )tmp___6; b43_phy_set(dev, 1040, 8); return (1); } } static int lpphy_loopback(struct b43_wldev *dev ) { struct lpphy_iq_est iq_est ; int i ; int index ; u32 tmp ; bool tmp___0 ; int tmp___1 ; { index = -1; memset((void *)(& iq_est), 0, 12UL); lpphy_set_trsw_over(dev, 1, 1); b43_phy_set(dev, 1083, 1); b43_phy_mask(dev, 1084, 65534); b43_phy_set(dev, 1100, 2048); b43_phy_set(dev, 1101, 2048); b43_phy_set(dev, 1100, 8); b43_phy_set(dev, 1101, 8); b43_radio_write(dev, 79, 128); b43_phy_set(dev, 1100, 128); b43_phy_set(dev, 1101, 128); i = 0; goto ldv_37391; ldv_37390: lpphy_set_rx_gain_by_index(dev, (int )((u16 )i)); lpphy_run_ddfs(dev, 1, 1, 5, 5, 0); tmp___0 = lpphy_rx_iq_est(dev, 1000, 32, & iq_est); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { goto ldv_37388; } else { } tmp = (iq_est.i_pwr + iq_est.q_pwr) / 1000U; if (tmp > 4000U && tmp <= 9999U) { index = i; goto ldv_37389; } else { } ldv_37388: i = i + 1; ldv_37391: ; if (i <= 31) { goto ldv_37390; } else { } ldv_37389: lpphy_stop_ddfs(dev); return (index); } } static u32 lpphy_qdiv_roundup(u32 dividend , u32 divisor , u8 precision ) { u32 quotient ; u32 remainder ; { if (divisor == 0U) { return (0U); } else { } quotient = dividend / divisor; remainder = dividend % divisor; goto ldv_37400; ldv_37399: quotient = quotient << 1; if (remainder << 1 >= divisor) { quotient = quotient + 1U; remainder = (remainder << 1) - divisor; } else { } precision = (u8 )((int )precision - 1); ldv_37400: ; if ((unsigned int )precision != 0U) { goto ldv_37399; } else { } if (remainder << 1 >= divisor) { quotient = quotient + 1U; } else { } return (quotient); } } static void lpphy_read_tx_pctl_mode_from_hardware(struct b43_wldev *dev ) { struct b43_phy_lp *lpphy ; u16 ctl ; int __ret_warn_on ; long tmp ; { lpphy = dev->phy.__annonCompField40.lp; ctl = b43_phy_read(dev, 1188); switch ((int )ctl & 57344) { case 0: lpphy->txpctl_mode = 1; goto ldv_37408; case 32768: lpphy->txpctl_mode = 2; goto ldv_37408; case 57344: lpphy->txpctl_mode = 3; goto ldv_37408; default: lpphy->txpctl_mode = 0; __ret_warn_on = 1; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_lp.c", 1122); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); goto ldv_37408; } ldv_37408: ; return; } } static void lpphy_write_tx_pctl_mode_to_hardware(struct b43_wldev *dev ) { struct b43_phy_lp *lpphy ; u16 ctl ; int __ret_warn_on ; long tmp ; { lpphy = dev->phy.__annonCompField40.lp; switch ((unsigned int )lpphy->txpctl_mode) { case 1U: ctl = 0U; goto ldv_37420; case 3U: ctl = 57344U; goto ldv_37420; case 2U: ctl = 32768U; goto ldv_37420; default: ctl = 0U; __ret_warn_on = 1; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_lp.c", 1145); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); } ldv_37420: b43_phy_maskset(dev, 1188, 8191, (int )ctl); return; } } static void lpphy_set_tx_power_control(struct b43_wldev *dev , enum b43_lpphy_txpctl_mode mode ) { struct b43_phy_lp *lpphy ; enum b43_lpphy_txpctl_mode oldmode ; { lpphy = dev->phy.__annonCompField40.lp; lpphy_read_tx_pctl_mode_from_hardware(dev); oldmode = lpphy->txpctl_mode; if ((unsigned int )oldmode == (unsigned int )mode) { return; } else { } lpphy->txpctl_mode = mode; if ((unsigned int )oldmode == 3U) { } else if ((unsigned int )mode == 3U) { b43_phy_maskset(dev, 1188, 65408, (int )lpphy->tssi_idx); b43_phy_maskset(dev, 1189, 36863, 0); lpphy_disable_tx_gain_override(dev); lpphy->tx_pwr_idx_over = -1; } else { } if ((unsigned int )dev->phy.rev > 1U) { if ((unsigned int )mode == 3U) { b43_phy_set(dev, 1232, 2); } else { b43_phy_mask(dev, 1232, 65533); } } else { } lpphy_write_tx_pctl_mode_to_hardware(dev); return; } } static int b43_lpphy_op_switch_channel(struct b43_wldev *dev , unsigned int new_channel ) ; static void lpphy_rev0_1_rc_calib(struct b43_wldev *dev ) { struct b43_phy_lp *lpphy ; struct lpphy_iq_est iq_est ; struct lpphy_tx_gains tx_gains ; u32 ideal_pwr_table[21U] ; bool old_txg_ovr ; u8 old_bbmult ; u16 old_rf_ovr ; u16 old_rf_ovrval ; u16 old_afe_ovr ; u16 old_afe_ovrval ; u16 old_rf2_ovr ; u16 old_rf2_ovrval ; u16 old_phy_ctl ; enum b43_lpphy_txpctl_mode old_txpctl ; u32 normal_pwr ; u32 ideal_pwr ; u32 mean_sq_pwr ; u32 tmp ; u32 mean_sq_pwr_min ; int loopback ; int i ; int j ; int inner_sum ; int err ; u16 tmp___0 ; bool tmp___1 ; int tmp___2 ; { lpphy = dev->phy.__annonCompField40.lp; ideal_pwr_table[0] = 65536U; ideal_pwr_table[1] = 66903U; ideal_pwr_table[2] = 69165U; ideal_pwr_table[3] = 70624U; ideal_pwr_table[4] = 69410U; ideal_pwr_table[5] = 65380U; ideal_pwr_table[6] = 60834U; ideal_pwr_table[7] = 58836U; ideal_pwr_table[8] = 61393U; ideal_pwr_table[9] = 64488U; ideal_pwr_table[10] = 47032U; ideal_pwr_table[11] = 19253U; ideal_pwr_table[12] = 6750U; ideal_pwr_table[13] = 2571U; ideal_pwr_table[14] = 1092U; ideal_pwr_table[15] = 509U; ideal_pwr_table[16] = 255U; ideal_pwr_table[17] = 136U; ideal_pwr_table[18] = 76U; ideal_pwr_table[19] = 44U; ideal_pwr_table[20] = 26U; tmp = 0U; mean_sq_pwr_min = 0U; memset((void *)(& iq_est), 0, 12UL); err = b43_lpphy_op_switch_channel(dev, 7U); if (err != 0) { b43dbg(dev->wl, "RC calib: Failed to switch to channel 7, error = %d\n", err); } else { } tmp___0 = b43_phy_read(dev, 1083); old_txg_ovr = ((int )tmp___0 & 64) != 0; old_bbmult = lpphy_get_bb_mult(dev); if ((int )old_txg_ovr) { tx_gains = lpphy_get_tx_gains(dev); } else { } old_rf_ovr = b43_phy_read(dev, 1100); old_rf_ovrval = b43_phy_read(dev, 1101); old_afe_ovr = b43_phy_read(dev, 1083); old_afe_ovrval = b43_phy_read(dev, 1084); old_rf2_ovr = b43_phy_read(dev, 1200); old_rf2_ovrval = b43_phy_read(dev, 1201); old_phy_ctl = b43_phy_read(dev, 1096); lpphy_read_tx_pctl_mode_from_hardware(dev); old_txpctl = lpphy->txpctl_mode; lpphy_set_tx_power_control(dev, 1); lpphy_disable_crs(dev, 1); loopback = lpphy_loopback(dev); if (loopback == -1) { goto finish; } else { } lpphy_set_rx_gain_by_index(dev, (int )((u16 )loopback)); b43_phy_maskset(dev, 1096, 65471, 64); b43_phy_maskset(dev, 1201, 65528, 1); b43_phy_maskset(dev, 1201, 65479, 8); b43_phy_maskset(dev, 1201, 65343, 192); i = 128; goto ldv_37467; ldv_37466: b43_radio_write(dev, 58, (int )((u16 )i)); inner_sum = 0; j = 5; goto ldv_37464; ldv_37463: lpphy_run_ddfs(dev, 1, 1, j, j, 0); tmp___1 = lpphy_rx_iq_est(dev, 1000, 32, & iq_est); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { goto finish; } else { } mean_sq_pwr = iq_est.i_pwr + iq_est.q_pwr; if (j == 5) { tmp = mean_sq_pwr; } else { } ideal_pwr = ((ideal_pwr_table[j + -5] >> 3) + 1U) >> 1; normal_pwr = lpphy_qdiv_roundup(mean_sq_pwr, tmp, 12); mean_sq_pwr = ideal_pwr - normal_pwr; mean_sq_pwr = mean_sq_pwr * mean_sq_pwr; inner_sum = (int )((u32 )inner_sum + mean_sq_pwr); if (i == 128 || (u32 )inner_sum < mean_sq_pwr_min) { lpphy->rc_cap = (u8 )i; mean_sq_pwr_min = (u32 )inner_sum; } else { } j = j + 1; ldv_37464: ; if (j <= 25) { goto ldv_37463; } else { } i = i + 1; ldv_37467: ; if (i <= 159) { goto ldv_37466; } else { } lpphy_stop_ddfs(dev); finish: lpphy_restore_crs(dev, 1); b43_phy_write(dev, 1101, (int )old_rf_ovrval); b43_phy_write(dev, 1100, (int )old_rf_ovr); b43_phy_write(dev, 1084, (int )old_afe_ovrval); b43_phy_write(dev, 1083, (int )old_afe_ovr); b43_phy_write(dev, 1201, (int )old_rf2_ovrval); b43_phy_write(dev, 1200, (int )old_rf2_ovr); b43_phy_write(dev, 1096, (int )old_phy_ctl); lpphy_set_bb_mult(dev, (int )old_bbmult); if ((int )old_txg_ovr) { lpphy_set_tx_gains(dev, tx_gains); } else { } lpphy_set_tx_power_control(dev, old_txpctl); if ((unsigned int )lpphy->rc_cap != 0U) { lpphy_set_rc_cap(dev); } else { } return; } } static void lpphy_rev2plus_rc_calib(struct b43_wldev *dev ) { struct ssb_bus *bus ; u32 crystal_freq ; u8 tmp ; u16 tmp___0 ; int i ; u16 tmp___1 ; u16 tmp___2 ; u16 tmp___3 ; u16 tmp___4 ; u16 tmp___5 ; { bus = (dev->dev)->bus; crystal_freq = bus->chipco.pmu.crystalfreq * 1000U; tmp___0 = b43_radio_read(dev, 58); tmp = (u8 )tmp___0; b43_radio_write(dev, 58, 0); b43_radio_write(dev, 90, 126); b43_radio_mask(dev, 26, 247); b43_radio_write(dev, 90, 124); b43_radio_write(dev, 91, 21); b43_radio_write(dev, 92, 112); b43_radio_write(dev, 93, 82); b43_radio_write(dev, 94, 1); b43_radio_write(dev, 90, 125); i = 0; goto ldv_37478; ldv_37477: tmp___1 = b43_radio_read(dev, 95); if (((int )tmp___1 & 2) != 0) { goto ldv_37476; } else { } msleep(1U); i = i + 1; ldv_37478: ; if (i <= 9999) { goto ldv_37477; } else { } ldv_37476: tmp___2 = b43_radio_read(dev, 95); if (((int )tmp___2 & 2) == 0) { b43_radio_write(dev, 58, (int )tmp); } else { } tmp___3 = b43_radio_read(dev, 85); tmp = (u8 )tmp___3; b43_radio_write(dev, 85, 0); b43_radio_write(dev, 90, 126); b43_radio_write(dev, 90, 124); b43_radio_write(dev, 91, 85); b43_radio_write(dev, 92, 118); if (crystal_freq == 24000000U) { b43_radio_write(dev, 93, 252); b43_radio_write(dev, 94, 0); } else { b43_radio_write(dev, 93, 19); b43_radio_write(dev, 94, 1); } b43_radio_write(dev, 82, 125); i = 0; goto ldv_37481; ldv_37480: tmp___4 = b43_radio_read(dev, 95); if (((int )tmp___4 & 2) != 0) { goto ldv_37479; } else { } msleep(1U); i = i + 1; ldv_37481: ; if (i <= 9999) { goto ldv_37480; } else { } ldv_37479: tmp___5 = b43_radio_read(dev, 95); if (((int )tmp___5 & 2) == 0) { b43_radio_write(dev, 85, (int )tmp); } else { } b43_radio_write(dev, 90, 126); return; } } static void lpphy_calibrate_rc(struct b43_wldev *dev ) { struct b43_phy_lp *lpphy ; enum ieee80211_band tmp ; { lpphy = dev->phy.__annonCompField40.lp; if ((unsigned int )dev->phy.rev > 1U) { lpphy_rev2plus_rc_calib(dev); } else if ((unsigned int )lpphy->rc_cap == 0U) { tmp = b43_current_band(dev->wl); if ((unsigned int )tmp == 0U) { lpphy_rev0_1_rc_calib(dev); } else { } } else { lpphy_set_rc_cap(dev); } return; } } static void b43_lpphy_op_set_rx_antenna(struct b43_wldev *dev , int antenna ) { int __ret_warn_on ; long tmp ; long tmp___0 ; u64 tmp___1 ; u64 tmp___2 ; { if ((unsigned int )dev->phy.rev > 1U) { return; } else { } __ret_warn_on = antenna > 3; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_lp.c", 1365); } else { } tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { return; } else { } tmp___1 = b43_hf_read(dev); b43_hf_write(dev, tmp___1 & 0xfffffffffffffffeULL); b43_phy_maskset(dev, 1040, 65533, (int )((u16 )antenna) & 2); b43_phy_maskset(dev, 1040, 65534, (int )((u16 )antenna) & 1); tmp___2 = b43_hf_read(dev); b43_hf_write(dev, tmp___2 | 1ULL); (dev->phy.__annonCompField40.lp)->antenna = antenna; return; } } static void lpphy_set_tx_iqcc(struct b43_wldev *dev , u16 a , u16 b ) { u16 tmp[2U] ; { tmp[0] = a; tmp[1] = b; b43_lptab_write_bulk(dev, 536870992U, 2U, (void const *)(& tmp)); return; } } static void lpphy_set_tx_power_by_index(struct b43_wldev *dev , u8 index ) { struct b43_phy_lp *lpphy ; struct lpphy_tx_gains gains ; u32 iq_comp ; u32 tx_gain ; u32 coeff ; u32 rf_power ; { lpphy = dev->phy.__annonCompField40.lp; lpphy->tx_pwr_idx_over = (s8 )index; lpphy_read_tx_pctl_mode_from_hardware(dev); if ((unsigned int )lpphy->txpctl_mode != 1U) { lpphy_set_tx_power_control(dev, 2); } else { } if ((unsigned int )dev->phy.rev > 1U) { iq_comp = b43_lptab_read(dev, (u32 )(((int )index + 320) | 805313536)); tx_gain = b43_lptab_read(dev, (u32 )(((int )index + 192) | 805313536)); gains.pad = (unsigned int )((u16 )(tx_gain >> 16)) & 255U; gains.gm = (unsigned int )((u16 )tx_gain) & 255U; gains.pga = (unsigned int )((u16 )(tx_gain >> 8)) & 255U; gains.dac = (u16 )(iq_comp >> 28); lpphy_set_tx_gains(dev, gains); } else { iq_comp = b43_lptab_read(dev, (u32 )(((int )index + 320) | 805316608)); tx_gain = b43_lptab_read(dev, (u32 )(((int )index + 192) | 805316608)); b43_phy_maskset(dev, 1205, 63488, (int )((u16 )(tx_gain >> 4)) & 32767); lpphy_set_dac_gain(dev, (int )((u16 )tx_gain) & 7); lpphy_set_pa_gain(dev, (int )((u16 )(tx_gain >> 24)) & 127); } lpphy_set_bb_mult(dev, (int )((u8 )(iq_comp >> 20))); lpphy_set_tx_iqcc(dev, (int )((u16 )(iq_comp >> 10)) & 1023, (int )((u16 )iq_comp) & 1023); if ((unsigned int )dev->phy.rev > 1U) { coeff = b43_lptab_read(dev, (u32 )(((int )index + 448) | 805313536)); } else { coeff = b43_lptab_read(dev, (u32 )(((int )index + 448) | 805316608)); } b43_lptab_write(dev, 536870997U, coeff & 65535U); if ((unsigned int )dev->phy.rev > 1U) { rf_power = b43_lptab_read(dev, (u32 )(((int )index + 576) | 805313536)); b43_phy_maskset(dev, 1235, 65280, (int )((u16 )rf_power)); } else { } lpphy_enable_tx_gain_override(dev); return; } } static void lpphy_btcoex_override(struct b43_wldev *dev ) { { b43_write16(dev, 1716, 3); b43_write16(dev, 1720, 255); return; } } static void b43_lpphy_op_software_rfkill(struct b43_wldev *dev , bool blocked ) { { if ((int )blocked) { if ((unsigned int )dev->phy.rev > 1U) { b43_phy_mask(dev, 1101, 33791); b43_phy_set(dev, 1100, 7936); b43_phy_mask(dev, 1207, 33023); b43_phy_mask(dev, 1201, 57343); b43_phy_set(dev, 1200, 2056); } else { b43_phy_mask(dev, 1101, 57599); b43_phy_set(dev, 1100, 7936); b43_phy_mask(dev, 1201, 64767); b43_phy_set(dev, 1200, 24); } } else { b43_phy_mask(dev, 1100, 57599); if ((unsigned int )dev->phy.rev > 1U) { b43_phy_mask(dev, 1200, 63479); } else { b43_phy_mask(dev, 1200, 65511); } } return; } } static void lpphy_set_analog_filter(struct b43_wldev *dev , int channel ) { struct b43_phy_lp *lpphy ; u16 tmp ; { lpphy = dev->phy.__annonCompField40.lp; tmp = channel == 14; if ((unsigned int )dev->phy.rev <= 1U) { b43_phy_maskset(dev, 1096, 64767, (int )tmp << 9U); if ((unsigned int )dev->phy.rev == 1U && (unsigned int )lpphy->rc_cap != 0U) { lpphy_set_rc_cap(dev); } else { } } else { b43_radio_write(dev, 85, 63); } return; } } static void lpphy_tx_pctl_init_sw(struct b43_wldev *dev ) { struct lpphy_tx_gains gains ; enum ieee80211_band tmp ; { tmp = b43_current_band(dev->wl); if ((unsigned int )tmp == 0U) { gains.gm = 4U; gains.pad = 12U; gains.pga = 12U; gains.dac = 0U; } else { gains.gm = 7U; gains.pad = 14U; gains.pga = 15U; gains.dac = 0U; } lpphy_set_tx_gains(dev, gains); lpphy_set_bb_mult(dev, 150); return; } } static void lpphy_tx_pctl_init(struct b43_wldev *dev ) { { lpphy_tx_pctl_init_sw(dev); return; } } static void lpphy_pr41573_workaround(struct b43_wldev *dev ) { struct b43_phy_lp *lpphy ; u32 *saved_tab ; unsigned int saved_tab_size ; enum b43_lpphy_txpctl_mode txpctl_mode ; s8 tx_pwr_idx_over ; u16 tssi_npt ; u16 tssi_idx ; void *tmp ; { lpphy = dev->phy.__annonCompField40.lp; saved_tab_size = 256U; tmp = kcalloc((size_t )saved_tab_size, 4UL, 208U); saved_tab = (u32 *)tmp; if ((unsigned long )saved_tab == (unsigned long )((u32 *)0U)) { b43err(dev->wl, "PR41573 failed. Out of memory!\n"); return; } else { } lpphy_read_tx_pctl_mode_from_hardware(dev); txpctl_mode = lpphy->txpctl_mode; tx_pwr_idx_over = lpphy->tx_pwr_idx_over; tssi_npt = lpphy->tssi_npt; tssi_idx = lpphy->tssi_idx; if ((unsigned int )dev->phy.rev <= 1U) { b43_lptab_read_bulk(dev, 805316928U, saved_tab_size, (void *)saved_tab); } else { b43_lptab_read_bulk(dev, 805313856U, saved_tab_size, (void *)saved_tab); } lpphy_table_init(dev); lpphy_baseband_init(dev); lpphy_tx_pctl_init(dev); b43_lpphy_op_software_rfkill(dev, 0); lpphy_set_tx_power_control(dev, 1); if ((unsigned int )dev->phy.rev <= 1U) { b43_lptab_write_bulk(dev, 805316928U, saved_tab_size, (void const *)saved_tab); } else { b43_lptab_write_bulk(dev, 805313856U, saved_tab_size, (void const *)saved_tab); } b43_write16(dev, 1008, (int )lpphy->channel); lpphy->tssi_npt = tssi_npt; lpphy->tssi_idx = tssi_idx; lpphy_set_analog_filter(dev, (int )lpphy->channel); if ((int )tx_pwr_idx_over != -1) { lpphy_set_tx_power_by_index(dev, (int )((u8 )tx_pwr_idx_over)); } else { } if ((unsigned int )lpphy->rc_cap != 0U) { lpphy_set_rc_cap(dev); } else { } b43_lpphy_op_set_rx_antenna(dev, lpphy->antenna); lpphy_set_tx_power_control(dev, txpctl_mode); kfree((void const *)saved_tab); return; } } static struct lpphy_rx_iq_comp const lpphy_5354_iq_table[14U] = { {1U, -66, 15}, {2U, -66, 15}, {3U, -66, 15}, {4U, -66, 15}, {5U, -66, 15}, {6U, -66, 15}, {7U, -66, 14}, {8U, -66, 14}, {9U, -66, 14}, {10U, -66, 14}, {11U, -66, 14}, {12U, -66, 13}, {13U, -66, 13}, {14U, -66, 13}}; static struct lpphy_rx_iq_comp const lpphy_rev0_1_iq_table[51U] = { {1U, -64, 13}, {2U, -64, 13}, {3U, -64, 13}, {4U, -64, 13}, {5U, -64, 12}, {6U, -64, 12}, {7U, -64, 12}, {8U, -64, 12}, {9U, -64, 12}, {10U, -64, 11}, {11U, -64, 11}, {12U, -64, 11}, {13U, -64, 11}, {14U, -64, 10}, {34U, -62, 24}, {38U, -62, 24}, {42U, -62, 24}, {46U, -62, 23}, {36U, -62, 24}, {40U, -62, 24}, {44U, -62, 23}, {48U, -62, 23}, {52U, -62, 23}, {56U, -62, 22}, {60U, -62, 22}, {64U, -62, 22}, {100U, -62, 16}, {104U, -62, 16}, {108U, -62, 15}, {112U, -62, 14}, {116U, -62, 14}, {120U, -62, 13}, {124U, -62, 12}, {128U, -62, 12}, {132U, -62, 12}, {136U, -62, 11}, {140U, -62, 10}, {149U, -61, 9}, {153U, -61, 9}, {157U, -61, 9}, {161U, -61, 8}, {165U, -61, 8}, {184U, -62, 25}, {188U, -62, 25}, {192U, -62, 25}, {196U, -62, 25}, {200U, -62, 25}, {204U, -62, 25}, {208U, -62, 25}, {212U, -62, 25}, {216U, -62, 26}}; static struct lpphy_rx_iq_comp const lpphy_rev2plus_iq_comp = {0U, -64, 0}; static int lpphy_calc_rx_iq_comp(struct b43_wldev *dev , u16 samples ) { struct lpphy_iq_est iq_est ; u16 c0 ; u16 c1 ; int prod ; int ipwr ; int qpwr ; int prod_msb ; int q_msb ; int tmp1 ; int tmp2 ; int tmp3 ; int tmp4 ; int ret ; bool tmp ; long __x ; long __x___0 ; unsigned long tmp___0 ; { c1 = b43_phy_read(dev, 1182); c0 = (u16 )((int )c1 >> 8); c1 = (u16 )((unsigned int )c1 | 255U); b43_phy_maskset(dev, 1182, 65280, 192); b43_phy_mask(dev, 1182, 255); tmp = lpphy_rx_iq_est(dev, (int )samples, 32, & iq_est); ret = (int )tmp; if (ret == 0) { goto out; } else { } prod = (int )iq_est.iq_prod; ipwr = (int )iq_est.i_pwr; qpwr = (int )iq_est.q_pwr; if (ipwr + qpwr <= 1) { ret = 0; goto out; } else { } __x = (long )prod; prod_msb = fls((int )(__x < 0L ? - __x : __x)); __x___0 = (long )qpwr; q_msb = fls((int )(__x___0 < 0L ? - __x___0 : __x___0)); tmp1 = prod_msb + -20; if (tmp1 >= 0) { tmp3 = ((prod << (30 - prod_msb)) + (ipwr >> (tmp1 + 1))) / (ipwr >> tmp1); } else { tmp3 = ((prod << (30 - prod_msb)) + (ipwr << ~ tmp1)) / (ipwr << - tmp1); } tmp2 = q_msb + -11; if (tmp2 >= 0) { tmp4 = (qpwr << (31 - q_msb)) / (ipwr >> tmp2); } else { tmp4 = (qpwr << (31 - q_msb)) / (ipwr << - tmp2); } tmp4 = tmp4 - tmp3 * tmp3; tmp___0 = int_sqrt((unsigned long )tmp4); tmp4 = (int )(- ((unsigned int )tmp___0)); c0 = (u16 )(tmp3 >> 3); c1 = (u16 )(tmp4 >> 4); out: b43_phy_maskset(dev, 1182, 65280, (int )c1); b43_phy_maskset(dev, 1182, 255, (int )c0 << 8U); return (ret); } } static void lpphy_run_samples(struct b43_wldev *dev , u16 samples , u16 loops , u16 wait ) { { b43_phy_maskset(dev, 1185, 65472, (int )((unsigned int )samples + 65535U)); if ((unsigned int )loops != 65535U) { loops = (u16 )((int )loops - 1); } else { } b43_phy_maskset(dev, 1184, 61440, (int )loops); b43_phy_maskset(dev, 1185, 63, (int )wait << 6U); b43_phy_set(dev, 1180, 1); return; } } static void lpphy_start_tx_tone(struct b43_wldev *dev , s32 freq , u16 max ) { struct b43_phy_lp *lpphy ; u16 buf[64U] ; int i ; int samples ; int angle ; int rotation ; struct b43_c32 sample ; long __x ; int __ret_warn_on ; long tmp ; long tmp___0 ; long __x___0 ; { lpphy = dev->phy.__annonCompField40.lp; samples = 0; angle = 0; rotation = ((freq * 36) / 20 << 16) / 100; lpphy->tx_tone_freq = freq; if (freq != 0) { i = 1; goto ldv_37606; ldv_37605: __x = (long )freq; samples = (int )((long )(i * 20000) / (__x < 0L ? - __x : __x)); __ret_warn_on = samples > 63; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_lp.c", 1799); } else { } tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { return; } else { } i = i + 1; ldv_37606: __x___0 = (long )freq; if ((long )samples * (__x___0 < 0L ? - __x___0 : __x___0) != (long )(i * 20000)) { goto ldv_37605; } else { } } else { samples = 2; } i = 0; goto ldv_37609; ldv_37608: sample = b43_cordic(angle); angle = angle + rotation; buf[i] = 0U; buf[i] = buf[i]; i = i + 1; ldv_37609: ; if (i < samples) { goto ldv_37608; } else { } b43_lptab_write_bulk(dev, 536876032U, (unsigned int )samples, (void const *)(& buf)); lpphy_run_samples(dev, (int )((u16 )samples), 65535, 0); return; } } static void lpphy_stop_tx_tone(struct b43_wldev *dev ) { struct b43_phy_lp *lpphy ; int i ; u16 tmp ; { lpphy = dev->phy.__annonCompField40.lp; lpphy->tx_tone_freq = 0; b43_phy_mask(dev, 1184, 61440); i = 0; goto ldv_37618; ldv_37617: tmp = b43_phy_read(dev, 1180); if (((int )tmp & 1) == 0) { goto ldv_37616; } else { } __const_udelay(429500UL); i = i + 1; ldv_37618: ; if (i <= 30) { goto ldv_37617; } else { } ldv_37616: ; return; } } static void lpphy_papd_cal(struct b43_wldev *dev , struct lpphy_tx_gains gains , int mode , bool useindex , u8 index ) { { return; } } static void lpphy_papd_cal_txpwr(struct b43_wldev *dev ) { struct b43_phy_lp *lpphy ; struct ssb_bus *bus ; struct lpphy_tx_gains gains ; struct lpphy_tx_gains oldgains ; int old_txpctl ; int old_afe_ovr ; int old_rf ; int old_bbmult ; u16 tmp ; u16 tmp___0 ; u8 tmp___1 ; { lpphy = dev->phy.__annonCompField40.lp; bus = (dev->dev)->bus; lpphy_read_tx_pctl_mode_from_hardware(dev); old_txpctl = (int )lpphy->txpctl_mode; tmp = b43_phy_read(dev, 1083); old_afe_ovr = (int )tmp & 64; if (old_afe_ovr != 0) { oldgains = lpphy_get_tx_gains(dev); } else { } tmp___0 = b43_phy_read(dev, 1235); old_rf = (int )tmp___0 & 255; tmp___1 = lpphy_get_bb_mult(dev); old_bbmult = (int )tmp___1; lpphy_set_tx_power_control(dev, 1); if ((unsigned int )bus->chip_id == 17189U && (unsigned int )bus->chip_rev == 0U) { lpphy_papd_cal(dev, gains, 0, 1, 30); } else { lpphy_papd_cal(dev, gains, 0, 1, 65); } if (old_afe_ovr != 0) { lpphy_set_tx_gains(dev, oldgains); } else { } lpphy_set_bb_mult(dev, (int )((u8 )old_bbmult)); lpphy_set_tx_power_control(dev, (enum b43_lpphy_txpctl_mode )old_txpctl); b43_phy_maskset(dev, 1235, 65280, (int )((u16 )old_rf)); return; } } static int lpphy_rx_iq_cal(struct b43_wldev *dev , bool noise , bool tx , bool rx , bool pa , struct lpphy_tx_gains *gains ) { struct b43_phy_lp *lpphy ; struct ssb_bus *bus ; struct lpphy_rx_iq_comp const *iqcomp ; struct lpphy_tx_gains nogains ; struct lpphy_tx_gains oldgains ; u16 tmp ; int i ; int ret ; int __ret_warn_on ; long tmp___0 ; long tmp___1 ; enum ieee80211_band tmp___2 ; u16 tmp___3 ; { lpphy = dev->phy.__annonCompField40.lp; bus = (dev->dev)->bus; iqcomp = (struct lpphy_rx_iq_comp const *)0; memset((void *)(& nogains), 0, 8UL); memset((void *)(& oldgains), 0, 8UL); if ((unsigned int )bus->chip_id == 21332U) { i = 0; goto ldv_37656; ldv_37655: ; if ((int )((unsigned char )lpphy_5354_iq_table[i].chan) == (int )lpphy->channel) { iqcomp = (struct lpphy_rx_iq_comp const *)(& lpphy_5354_iq_table) + (unsigned long )i; } else { } i = i + 1; ldv_37656: ; if ((unsigned int )i <= 13U) { goto ldv_37655; } else { } } else if ((unsigned int )dev->phy.rev > 1U) { iqcomp = & lpphy_rev2plus_iq_comp; } else { i = 0; goto ldv_37661; ldv_37660: ; if ((int )((unsigned char )lpphy_rev0_1_iq_table[i].chan) == (int )lpphy->channel) { iqcomp = (struct lpphy_rx_iq_comp const *)(& lpphy_rev0_1_iq_table) + (unsigned long )i; } else { } i = i + 1; ldv_37661: ; if ((unsigned int )i <= 50U) { goto ldv_37660; } else { } } __ret_warn_on = (unsigned long )iqcomp == (unsigned long )((struct lpphy_rx_iq_comp const *)0); tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_lp.c", 1898); } else { } tmp___1 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___1 != 0L) { return (0); } else { } b43_phy_maskset(dev, 1182, 65280, (int )((u16 )iqcomp->c1)); b43_phy_maskset(dev, 1182, 255, (int )((u16 )iqcomp->c0) << 8U); if ((int )noise) { tx = 1; rx = 0; pa = 0; } else { } lpphy_set_trsw_over(dev, (int )tx, (int )rx); tmp___2 = b43_current_band(dev->wl); if ((unsigned int )tmp___2 == 0U) { b43_phy_set(dev, 1100, 8); b43_phy_maskset(dev, 1101, 65527, (int )((u16 )pa) << 3U); } else { b43_phy_set(dev, 1100, 32); b43_phy_maskset(dev, 1101, 65503, (int )((u16 )pa) << 5U); } tmp___3 = b43_phy_read(dev, 1083); tmp = (unsigned int )tmp___3 & 64U; if ((int )noise) { lpphy_set_rx_gain(dev, 11613U); } else { if ((unsigned int )tmp != 0U) { oldgains = lpphy_get_tx_gains(dev); } else { } if ((unsigned long )gains == (unsigned long )((struct lpphy_tx_gains *)0)) { gains = & nogains; } else { } lpphy_set_tx_gains(dev, *gains); } b43_phy_mask(dev, 1083, 65534); b43_phy_mask(dev, 1084, 65534); b43_phy_set(dev, 1100, 2048); b43_phy_set(dev, 1101, 2048); lpphy_set_deaf(dev, 0); if ((int )noise) { ret = lpphy_calc_rx_iq_comp(dev, 65520); } else { lpphy_start_tx_tone(dev, 4000, 100); ret = lpphy_calc_rx_iq_comp(dev, 16384); lpphy_stop_tx_tone(dev); } lpphy_clear_deaf(dev, 0); b43_phy_mask(dev, 1100, 65532); b43_phy_mask(dev, 1100, 65527); b43_phy_mask(dev, 1100, 65503); if (! noise) { if ((unsigned int )tmp != 0U) { lpphy_set_tx_gains(dev, oldgains); } else { lpphy_disable_tx_gain_override(dev); } } else { } lpphy_disable_rx_gain_override(dev); b43_phy_mask(dev, 1083, 65534); b43_phy_mask(dev, 1084, 63487); return (ret); } } static void lpphy_calibration(struct b43_wldev *dev ) { struct b43_phy_lp *lpphy ; enum b43_lpphy_txpctl_mode saved_pctl_mode ; bool full_cal ; { lpphy = dev->phy.__annonCompField40.lp; full_cal = 0; if ((int )lpphy->full_calib_chan != (int )lpphy->channel) { full_cal = 1; lpphy->full_calib_chan = lpphy->channel; } else { } b43_mac_suspend(dev); lpphy_btcoex_override(dev); if ((unsigned int )dev->phy.rev > 1U) { lpphy_save_dig_flt_state(dev); } else { } lpphy_read_tx_pctl_mode_from_hardware(dev); saved_pctl_mode = lpphy->txpctl_mode; lpphy_set_tx_power_control(dev, 1); if ((unsigned int )dev->phy.rev == 0U && (unsigned int )saved_pctl_mode != 1U) { lpphy_pr41573_workaround(dev); } else { } if ((unsigned int )dev->phy.rev > 1U && (int )full_cal) { lpphy_papd_cal_txpwr(dev); } else { } lpphy_set_tx_power_control(dev, saved_pctl_mode); if ((unsigned int )dev->phy.rev > 1U) { lpphy_restore_dig_flt_state(dev); } else { } lpphy_rx_iq_cal(dev, 1, 1, 0, 0, (struct lpphy_tx_gains *)0); b43_mac_enable(dev); return; } } static u16 b43_lpphy_op_read(struct b43_wldev *dev , u16 reg ) { u16 tmp ; { b43_write16(dev, 1020, (int )reg); tmp = b43_read16(dev, 1022); return (tmp); } } static void b43_lpphy_op_write(struct b43_wldev *dev , u16 reg , u16 value ) { { b43_write16(dev, 1020, (int )reg); b43_write16(dev, 1022, (int )value); return; } } static void b43_lpphy_op_maskset(struct b43_wldev *dev , u16 reg , u16 mask , u16 set ) { u16 tmp ; { b43_write16(dev, 1020, (int )reg); tmp = b43_read16(dev, 1022); b43_write16(dev, 1022, ((int )tmp & (int )mask) | (int )set); return; } } static u16 b43_lpphy_op_radio_read(struct b43_wldev *dev , u16 reg ) { int __ret_warn_on ; long tmp ; u16 tmp___0 ; { __ret_warn_on = (unsigned int )reg == 1U; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_lp.c", 2019); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); if ((unsigned int )dev->phy.rev <= 1U) { if ((unsigned int )reg != 16385U) { reg = (u16 )((unsigned int )reg | 256U); } else { } } else { reg = (u16 )((unsigned int )reg | 512U); } b43_write16(dev, 1014, (int )reg); tmp___0 = b43_read16(dev, 1018); return (tmp___0); } } static void b43_lpphy_op_radio_write(struct b43_wldev *dev , u16 reg , u16 value ) { int __ret_warn_on ; long tmp ; { __ret_warn_on = (unsigned int )reg == 1U; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_lp.c", 2034); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); b43_write16(dev, 1014, (int )reg); b43_write16(dev, 1018, (int )value); return; } } static struct b206x_channel const b2062_chantbl[51U] = { {1U, 2412U, {255U, 255U, 181U, 27U, 36U, 50U, 50U, 136U, 136U}}, {2U, 2417U, {255U, 255U, 181U, 27U, 36U, 50U, 50U, 136U, 136U}}, {3U, 2422U, {255U, 255U, 181U, 27U, 36U, 50U, 50U, 136U, 136U}}, {4U, 2427U, {255U, 255U, 181U, 27U, 36U, 50U, 50U, 136U, 136U}}, {5U, 2432U, {255U, 255U, 181U, 27U, 36U, 50U, 50U, 136U, 136U}}, {6U, 2437U, {255U, 255U, 181U, 27U, 36U, 50U, 50U, 136U, 136U}}, {7U, 2442U, {255U, 255U, 181U, 27U, 36U, 50U, 50U, 136U, 136U}}, {8U, 2447U, {255U, 255U, 181U, 27U, 36U, 50U, 50U, 136U, 136U}}, {9U, 2452U, {255U, 255U, 181U, 27U, 36U, 50U, 50U, 136U, 136U}}, {10U, 2457U, {255U, 255U, 181U, 27U, 36U, 50U, 50U, 136U, 136U}}, {11U, 2462U, {255U, 255U, 181U, 27U, 36U, 50U, 50U, 136U, 136U}}, {12U, 2467U, {255U, 255U, 181U, 27U, 36U, 50U, 50U, 136U, 136U}}, {13U, 2472U, {255U, 255U, 181U, 27U, 36U, 50U, 50U, 136U, 136U}}, {14U, 2484U, {255U, 255U, 181U, 27U, 36U, 50U, 50U, 136U, 136U}}, {34U, 5170U, {0U, 34U, 32U, 132U, 60U, 119U, 53U, 255U, 136U}}, {38U, 5190U, {0U, 17U, 16U, 131U, 60U, 119U, 53U, 255U, 136U}}, {42U, 5210U, {0U, 17U, 16U, 131U, 60U, 119U, 53U, 255U, 136U}}, {46U, 5230U, {0U, 0U, 0U, 131U, 60U, 119U, 53U, 255U, 136U}}, {36U, 5180U, {0U, 17U, 32U, 131U, 60U, 119U, 53U, 255U, 136U}}, {40U, 5200U, {0U, 17U, 16U, 132U, 60U, 119U, 53U, 255U, 136U}}, {44U, 5220U, {0U, 17U, 0U, 131U, 60U, 119U, 53U, 255U, 136U}}, {48U, 5240U, {0U, 0U, 0U, 131U, 60U, 119U, 53U, 255U, 136U}}, {52U, 5260U, {0U, 0U, 0U, 131U, 60U, 119U, 53U, 255U, 136U}}, {56U, 5280U, {0U, 0U, 0U, 131U, 60U, 119U, 53U, 255U, 136U}}, {60U, 5300U, {0U, 0U, 0U, 99U, 60U, 119U, 53U, 255U, 136U}}, {64U, 5320U, {0U, 0U, 0U, 98U, 60U, 119U, 53U, 255U, 136U}}, {100U, 5500U, {0U, 0U, 0U, 48U, 60U, 119U, 55U, 255U, 136U}}, {104U, 5520U, {0U, 0U, 0U, 32U, 60U, 119U, 55U, 255U, 136U}}, {108U, 5540U, {0U, 0U, 0U, 32U, 60U, 119U, 55U, 255U, 136U}}, {112U, 5560U, {0U, 0U, 0U, 32U, 60U, 119U, 55U, 255U, 136U}}, {116U, 5580U, {0U, 0U, 0U, 16U, 60U, 119U, 55U, 255U, 136U}}, {120U, 5600U, {0U, 0U, 0U, 0U, 60U, 119U, 55U, 255U, 136U}}, {124U, 5620U, {0U, 0U, 0U, 0U, 60U, 119U, 55U, 255U, 136U}}, {128U, 5640U, {0U, 0U, 0U, 0U, 60U, 119U, 55U, 255U, 136U}}, {132U, 5660U, {0U, 0U, 0U, 0U, 60U, 119U, 55U, 255U, 136U}}, {136U, 5680U, {0U, 0U, 0U, 0U, 60U, 119U, 55U, 255U, 136U}}, {140U, 5700U, {0U, 0U, 0U, 0U, 60U, 119U, 55U, 255U, 136U}}, {149U, 5745U, {0U, 0U, 0U, 0U, 60U, 119U, 55U, 255U, 136U}}, {153U, 5765U, {0U, 0U, 0U, 0U, 60U, 119U, 55U, 255U, 136U}}, {157U, 5785U, {0U, 0U, 0U, 0U, 60U, 119U, 55U, 255U, 136U}}, {161U, 5805U, {0U, 0U, 0U, 0U, 60U, 119U, 55U, 255U, 136U}}, {165U, 5825U, {0U, 0U, 0U, 0U, 60U, 119U, 55U, 255U, 136U}}, {184U, 4920U, {85U, 119U, 144U, 247U, 60U, 119U, 53U, 255U, 255U}}, {188U, 4940U, {68U, 119U, 128U, 231U, 60U, 119U, 53U, 255U, 255U}}, {192U, 4960U, {68U, 102U, 128U, 231U, 60U, 119U, 53U, 255U, 255U}}, {196U, 4980U, {51U, 102U, 112U, 199U, 60U, 119U, 53U, 255U, 255U}}, {200U, 5000U, {34U, 85U, 96U, 215U, 60U, 119U, 53U, 255U, 255U}}, {204U, 5020U, {34U, 85U, 96U, 199U, 60U, 119U, 53U, 255U, 255U}}, {208U, 5040U, {34U, 68U, 80U, 199U, 60U, 119U, 53U, 255U, 255U}}, {212U, 5060U, {17U, 68U, 80U, 165U, 60U, 119U, 53U, 255U, 136U}}, {216U, 5080U, {0U, 68U, 64U, 182U, 60U, 119U, 53U, 255U, 136U}}}; static struct b206x_channel const b2063_chantbl[51U] = { {1U, 2412U, {111U, 60U, 60U, 4U, 5U, 5U, 5U, 5U, 119U, 128U, 128U, 112U}}, {2U, 2417U, {111U, 60U, 60U, 4U, 5U, 5U, 5U, 5U, 119U, 128U, 128U, 112U}}, {3U, 2422U, {111U, 60U, 60U, 4U, 5U, 5U, 5U, 5U, 119U, 128U, 128U, 112U}}, {4U, 2427U, {111U, 44U, 44U, 4U, 5U, 5U, 5U, 5U, 119U, 128U, 128U, 112U}}, {5U, 2432U, {111U, 44U, 44U, 4U, 5U, 5U, 5U, 5U, 119U, 128U, 128U, 112U}}, {6U, 2437U, {111U, 44U, 44U, 4U, 5U, 5U, 5U, 5U, 119U, 128U, 128U, 112U}}, {7U, 2442U, {111U, 44U, 44U, 4U, 5U, 5U, 5U, 5U, 119U, 128U, 128U, 112U}}, {8U, 2447U, {111U, 44U, 44U, 4U, 5U, 5U, 5U, 5U, 119U, 128U, 128U, 112U}}, {9U, 2452U, {111U, 28U, 28U, 4U, 5U, 5U, 5U, 5U, 119U, 128U, 128U, 112U}}, {10U, 2457U, {111U, 28U, 28U, 4U, 5U, 5U, 5U, 5U, 119U, 128U, 128U, 112U}}, {11U, 2462U, {110U, 28U, 28U, 4U, 5U, 5U, 5U, 5U, 119U, 128U, 128U, 112U}}, {12U, 2467U, {110U, 28U, 28U, 4U, 5U, 5U, 5U, 5U, 119U, 128U, 128U, 112U}}, {13U, 2472U, {110U, 28U, 28U, 4U, 5U, 5U, 5U, 5U, 119U, 128U, 128U, 112U}}, {14U, 2484U, {110U, 12U, 12U, 4U, 5U, 5U, 5U, 5U, 119U, 128U, 128U, 112U}}, {34U, 5170U, {106U, 12U, 12U, 0U, 2U, 5U, 13U, 13U, 119U, 128U, 32U, 0U}}, {36U, 5180U, {106U, 12U, 12U, 0U, 1U, 5U, 13U, 12U, 119U, 128U, 32U, 0U}}, {38U, 5190U, {106U, 12U, 12U, 0U, 1U, 4U, 12U, 12U, 119U, 128U, 32U, 0U}}, {40U, 5200U, {105U, 12U, 12U, 0U, 1U, 4U, 12U, 12U, 119U, 112U, 32U, 0U}}, {42U, 5210U, {105U, 12U, 12U, 0U, 1U, 4U, 11U, 12U, 119U, 112U, 32U, 0U}}, {44U, 5220U, {105U, 12U, 12U, 0U, 0U, 4U, 11U, 11U, 119U, 96U, 32U, 0U}}, {46U, 5230U, {105U, 12U, 12U, 0U, 0U, 3U, 10U, 11U, 119U, 96U, 32U, 0U}}, {48U, 5240U, {105U, 12U, 12U, 0U, 0U, 3U, 10U, 10U, 119U, 96U, 32U, 0U}}, {52U, 5260U, {104U, 12U, 12U, 0U, 0U, 2U, 9U, 9U, 119U, 96U, 32U, 0U}}, {56U, 5280U, {104U, 12U, 12U, 0U, 0U, 1U, 8U, 8U, 119U, 80U, 16U, 0U}}, {60U, 5300U, {104U, 12U, 12U, 0U, 0U, 1U, 8U, 8U, 119U, 80U, 16U, 0U}}, {64U, 5320U, {103U, 12U, 12U, 0U, 0U, 0U, 8U, 8U, 119U, 80U, 16U, 0U}}, {100U, 5500U, {100U, 12U, 12U, 0U, 0U, 0U, 2U, 1U, 119U, 32U, 0U, 0U}}, {104U, 5520U, {100U, 12U, 12U, 0U, 0U, 0U, 1U, 1U, 119U, 32U, 0U, 0U}}, {108U, 5540U, {99U, 12U, 12U, 0U, 0U, 0U, 1U, 0U, 119U, 16U, 0U, 0U}}, {112U, 5560U, {99U, 12U, 12U, 0U, 0U, 0U, 0U, 0U, 119U, 16U, 0U, 0U}}, {116U, 5580U, {98U, 12U, 12U, 0U, 0U, 0U, 0U, 0U, 119U, 16U, 0U, 0U}}, {120U, 5600U, {98U, 12U, 12U, 0U, 0U, 0U, 0U, 0U, 119U, 0U, 0U, 0U}}, {124U, 5620U, {98U, 12U, 12U, 0U, 0U, 0U, 0U, 0U, 119U, 0U, 0U, 0U}}, {128U, 5640U, {97U, 12U, 12U, 0U, 0U, 0U, 0U, 0U, 119U, 0U, 0U, 0U}}, {132U, 5660U, {97U, 12U, 12U, 0U, 0U, 0U, 0U, 0U, 119U, 0U, 0U, 0U}}, {136U, 5680U, {97U, 12U, 12U, 0U, 0U, 0U, 0U, 0U, 119U, 0U, 0U, 0U}}, {140U, 5700U, {96U, 12U, 12U, 0U, 0U, 0U, 0U, 0U, 119U, 0U, 0U, 0U}}, {149U, 5745U, {96U, 12U, 12U, 0U, 0U, 0U, 0U, 0U, 119U, 0U, 0U, 0U}}, {153U, 5765U, {96U, 12U, 12U, 0U, 0U, 0U, 0U, 0U, 119U, 0U, 0U, 0U}}, {157U, 5785U, {96U, 12U, 12U, 0U, 0U, 0U, 0U, 0U, 119U, 0U, 0U, 0U}}, {161U, 5805U, {96U, 12U, 12U, 0U, 0U, 0U, 0U, 0U, 119U, 0U, 0U, 0U}}, {165U, 5825U, {96U, 12U, 12U, 0U, 0U, 0U, 0U, 0U, 119U, 0U, 0U, 0U}}, {184U, 4920U, {110U, 12U, 12U, 0U, 9U, 14U, 15U, 15U, 119U, 192U, 80U, 0U}}, {188U, 4940U, {110U, 12U, 12U, 0U, 9U, 13U, 15U, 15U, 119U, 176U, 80U, 0U}}, {192U, 4960U, {110U, 12U, 12U, 0U, 8U, 12U, 15U, 15U, 119U, 176U, 80U, 0U}}, {196U, 4980U, {109U, 12U, 12U, 0U, 8U, 12U, 15U, 15U, 119U, 160U, 64U, 0U}}, {200U, 5000U, {109U, 12U, 12U, 0U, 8U, 11U, 15U, 15U, 119U, 160U, 64U, 0U}}, {204U, 5020U, {109U, 12U, 12U, 0U, 8U, 10U, 15U, 15U, 119U, 160U, 64U, 0U}}, {208U, 5040U, {108U, 12U, 12U, 0U, 7U, 9U, 15U, 15U, 119U, 144U, 64U, 0U}}, {212U, 5060U, {108U, 12U, 12U, 0U, 6U, 8U, 15U, 15U, 119U, 144U, 64U, 0U}}, {216U, 5080U, {108U, 12U, 12U, 0U, 5U, 8U, 15U, 15U, 119U, 144U, 64U, 0U}}}; static void lpphy_b2062_reset_pll_bias(struct b43_wldev *dev ) { struct ssb_bus *bus ; { bus = (dev->dev)->bus; b43_radio_write(dev, 16438, 255); __const_udelay(85900UL); if ((unsigned int )bus->chip_id == 21332U) { b43_radio_write(dev, 0, 4); b43_radio_write(dev, 16438, 4); } else { b43_radio_write(dev, 16438, 0); } __const_udelay(21475UL); return; } } static void lpphy_b2062_vco_calib(struct b43_wldev *dev ) { { b43_radio_write(dev, 16457, 66); b43_radio_write(dev, 16457, 98); __const_udelay(859000UL); return; } } static int lpphy_b2062_tune(struct b43_wldev *dev , unsigned int channel ) { struct b43_phy_lp *lpphy ; struct ssb_bus *bus ; struct b206x_channel const *chandata ; u32 crystal_freq ; u32 tmp1 ; u32 tmp2 ; u32 tmp3 ; u32 tmp4 ; u32 tmp5 ; u32 tmp6 ; u32 tmp7 ; u32 tmp8 ; u32 tmp9 ; int i ; int err ; int __ret_warn_on ; long tmp ; long tmp___0 ; u16 tmp___1 ; u16 tmp___2 ; u16 tmp___3 ; u16 tmp___4 ; u16 tmp___5 ; { lpphy = dev->phy.__annonCompField40.lp; bus = (dev->dev)->bus; chandata = (struct b206x_channel const *)0; crystal_freq = bus->chipco.pmu.crystalfreq * 1000U; err = 0; i = 0; goto ldv_37735; ldv_37734: ; if ((unsigned int )b2062_chantbl[i].channel == channel) { chandata = (struct b206x_channel const *)(& b2062_chantbl) + (unsigned long )i; goto ldv_37733; } else { } i = i + 1; ldv_37735: ; if ((unsigned int )i <= 50U) { goto ldv_37734; } else { } ldv_37733: __ret_warn_on = (unsigned long )chandata == (unsigned long )((struct b206x_channel const *)0); tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_lp.c", 2448); } else { } tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { return (-22); } else { } b43_radio_set(dev, 16450, 4); b43_radio_write(dev, 30, (int )chandata->data[0]); b43_radio_write(dev, 32, (int )chandata->data[1]); b43_radio_write(dev, 33, (int )chandata->data[2]); b43_radio_write(dev, 82, (int )chandata->data[3]); b43_radio_write(dev, 16408, (int )chandata->data[4]); b43_radio_write(dev, 36, (int )chandata->data[5]); b43_radio_write(dev, 37, (int )chandata->data[6]); b43_radio_write(dev, 84, (int )chandata->data[7]); b43_radio_write(dev, 83, (int )chandata->data[8]); tmp1 = crystal_freq / 1000U; tmp2 = lpphy->pdiv * 1000U; b43_radio_write(dev, 16469, 204); b43_radio_write(dev, 16470, 7); lpphy_b2062_reset_pll_bias(dev); tmp___1 = channel2freq_lp((int )((u8 )channel)); tmp3 = (u32 )tmp___1 * tmp2; tmp___2 = channel2freq_lp((int )((u8 )channel)); if ((unsigned int )tmp___2 <= 3999U) { tmp3 = tmp3 * 2U; } else { } tmp4 = tmp1 * 48U; tmp6 = tmp3 / tmp4; tmp7 = tmp3 % tmp4; b43_radio_write(dev, 16462, (int )((u16 )tmp6)); tmp5 = tmp7 * 256U; tmp6 = tmp5 / tmp4; tmp7 = tmp5 % tmp4; b43_radio_write(dev, 16463, (int )((u16 )tmp6)); tmp5 = tmp7 * 256U; tmp6 = tmp5 / tmp4; tmp7 = tmp5 % tmp4; b43_radio_write(dev, 16464, (int )((u16 )tmp6)); tmp5 = tmp7 * 256U; tmp6 = tmp5 / tmp4; tmp7 = tmp5 % tmp4; b43_radio_write(dev, 16465, (int )((u16 )((tmp7 * 2U) / tmp4)) + (int )((u16 )tmp6)); tmp___3 = b43_radio_read(dev, 16455); tmp8 = (u32 )tmp___3; tmp9 = (((tmp8 + 1U) * tmp3) * 2U + tmp1 * 3U) / (tmp1 * 6U); b43_radio_write(dev, 16459, (int )((unsigned int )((u16 )(tmp9 >> 8)) + 16U)); b43_radio_write(dev, 16460, (int )((u16 )tmp9) & 255); lpphy_b2062_vco_calib(dev); tmp___5 = b43_radio_read(dev, 16439); if (((int )tmp___5 & 16) != 0) { b43_radio_write(dev, 16469, 252); b43_radio_write(dev, 16470, 0); lpphy_b2062_reset_pll_bias(dev); lpphy_b2062_vco_calib(dev); tmp___4 = b43_radio_read(dev, 16439); if (((int )tmp___4 & 16) != 0) { err = -5; } else { } } else { } b43_radio_mask(dev, 16450, 65531); return (err); } } static void lpphy_b2063_vco_calib(struct b43_wldev *dev ) { u16 tmp ; u16 tmp___0 ; { b43_radio_mask(dev, 26, 65471); tmp___0 = b43_radio_read(dev, 100); tmp = (unsigned int )tmp___0 & 248U; b43_radio_write(dev, 100, (int )tmp); __const_udelay(4295UL); b43_radio_write(dev, 100, (int )((unsigned int )tmp | 4U)); __const_udelay(4295UL); b43_radio_write(dev, 100, (int )((unsigned int )tmp | 6U)); __const_udelay(4295UL); b43_radio_write(dev, 100, (int )((unsigned int )tmp | 7U)); __const_udelay(1288500UL); b43_radio_set(dev, 26, 64); return; } } static int lpphy_b2063_tune(struct b43_wldev *dev , unsigned int channel ) { struct ssb_bus *bus ; struct b206x_channel const *chandata ; u32 crystal_freq ; u32 freqref ; u32 vco_freq ; u32 val1 ; u32 val2 ; u32 val3 ; u32 timeout ; u32 timeoutref ; u32 count ; u16 old_comm15 ; u16 scale ; u32 tmp1 ; u32 tmp2 ; u32 tmp3 ; u32 tmp4 ; u32 tmp5 ; u32 tmp6 ; int i ; int div ; int __ret_warn_on ; long tmp ; long tmp___0 ; { bus = (dev->dev)->bus; chandata = (struct b206x_channel const *)0; crystal_freq = bus->chipco.pmu.crystalfreq * 1000U; div = crystal_freq <= 26000000U ? 1 : 2; i = 0; goto ldv_37771; ldv_37770: ; if ((unsigned int )b2063_chantbl[i].channel == channel) { chandata = (struct b206x_channel const *)(& b2063_chantbl) + (unsigned long )i; goto ldv_37769; } else { } i = i + 1; ldv_37771: ; if ((unsigned int )i <= 50U) { goto ldv_37770; } else { } ldv_37769: __ret_warn_on = (unsigned long )chandata == (unsigned long )((struct b206x_channel const *)0); tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/phy_lp.c", 2541); } else { } tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { return (-22); } else { } b43_radio_write(dev, 162, (int )chandata->data[0]); b43_radio_write(dev, 164, (int )chandata->data[1]); b43_radio_write(dev, 166, (int )chandata->data[2]); b43_radio_write(dev, 161, (int )chandata->data[3]); b43_radio_write(dev, 208, (int )chandata->data[4]); b43_radio_write(dev, 211, (int )chandata->data[5]); b43_radio_write(dev, 214, (int )chandata->data[6]); b43_radio_write(dev, 217, (int )chandata->data[7]); b43_radio_write(dev, 223, (int )chandata->data[8]); b43_radio_write(dev, 256, (int )chandata->data[9]); b43_radio_write(dev, 259, (int )chandata->data[10]); b43_radio_write(dev, 277, (int )chandata->data[11]); old_comm15 = b43_radio_read(dev, 15); b43_radio_set(dev, 15, 30); if ((unsigned int )((unsigned short )chandata->freq) > 4000U) { vco_freq = (u32 )((int )chandata->freq << 1); } else { vco_freq = (u32 )((int )chandata->freq << 2); } freqref = crystal_freq * 3U; val1 = lpphy_qdiv_roundup(crystal_freq, 1000000U, 16); val2 = lpphy_qdiv_roundup(crystal_freq, (u32 )(div * 1000000), 16); val3 = lpphy_qdiv_roundup(vco_freq, 3U, 16); timeout = (((crystal_freq * 8U) / (u32 )(div * 5000000) + 1U) >> 1) - 1U; b43_radio_write(dev, 121, 2); b43_radio_maskset(dev, 124, 65528, (int )((u16 )(timeout >> 2))); b43_radio_maskset(dev, 125, 65439, (int )((u16 )timeout) << 5U); timeoutref = ((crystal_freq * 8U) / ((timeout + 1U) * (u32 )div) + 999999U) / 1000000U + 1U; b43_radio_write(dev, 123, (int )((u16 )timeoutref)); count = lpphy_qdiv_roundup(val3, val2 + 16U, 16); count = ((timeout + 1U) * (timeoutref + 1U)) * count; count = count - 1U; b43_radio_maskset(dev, 125, 240, (int )((u16 )(count >> 8))); b43_radio_write(dev, 126, (int )((u16 )count) & 255); tmp1 = (val3 * 62500U) / freqref << 4; tmp2 = (val3 * 62500U) % freqref << 4; goto ldv_37775; ldv_37774: tmp1 = tmp1 + 1U; tmp2 = tmp2 - freqref; ldv_37775: ; if (tmp2 >= freqref) { goto ldv_37774; } else { } b43_radio_maskset(dev, 112, 65504, (int )((u16 )(tmp1 >> 4))); b43_radio_maskset(dev, 113, 65039, (int )((u16 )tmp1) << 4U); b43_radio_maskset(dev, 113, 65520, (int )((u16 )(tmp1 >> 16))); b43_radio_write(dev, 114, (int )((u16 )(tmp2 >> 8)) & 255); b43_radio_write(dev, 115, (int )((u16 )tmp2) & 255); b43_radio_write(dev, 108, 185); b43_radio_write(dev, 109, 136); b43_radio_write(dev, 110, 40); b43_radio_write(dev, 111, 99); tmp3 = (val3 * 41U + 4294844296U) / 1200U + 27U; tmp4 = lpphy_qdiv_roundup(tmp1 * 132000U, 8451U, 16); if (((tmp4 + tmp3) - 1U) / tmp3 > 60U) { scale = 1U; tmp5 = (tmp4 + tmp3) / (tmp3 << 1) - 8U; } else { scale = 0U; tmp5 = ((tmp3 >> 1) + tmp4) / tmp3 - 8U; } b43_radio_maskset(dev, 104, 65472, (int )((u16 )tmp5)); b43_radio_maskset(dev, 104, 65471, (int )scale << 6U); tmp6 = lpphy_qdiv_roundup(val1 * 100U, val3, 16); tmp6 = (((u32 )((int )scale + 1) * tmp5) * tmp6) * 8U; if (tmp6 > 150U) { tmp6 = 0U; } else { } b43_radio_maskset(dev, 105, 65504, (int )((u16 )tmp6)); b43_radio_maskset(dev, 105, 65503, (int )scale << 5U); b43_radio_maskset(dev, 129, 65531, 4); if (crystal_freq > 26000000U) { b43_radio_set(dev, 129, 2); } else { b43_radio_mask(dev, 129, 253); } if (val1 == 45U) { b43_radio_set(dev, 117, 2); } else { b43_radio_mask(dev, 117, 253); } b43_radio_set(dev, 27, 3); __const_udelay(4295UL); b43_radio_mask(dev, 27, 65532); lpphy_b2063_vco_calib(dev); b43_radio_write(dev, 15, (int )old_comm15); return (0); } } static int b43_lpphy_op_switch_channel(struct b43_wldev *dev , unsigned int new_channel ) { struct b43_phy_lp *lpphy ; int err ; u16 tmp ; { lpphy = dev->phy.__annonCompField40.lp; if ((unsigned int )dev->phy.radio_ver == 8291U) { err = lpphy_b2063_tune(dev, new_channel); if (err != 0) { return (err); } else { } } else { err = lpphy_b2062_tune(dev, new_channel); if (err != 0) { return (err); } else { } lpphy_set_analog_filter(dev, (int )new_channel); tmp = channel2freq_lp((int )((u8 )new_channel)); lpphy_adjust_gain_table(dev, (u32 )tmp); } lpphy->channel = (u8 )new_channel; b43_write16(dev, 1008, (int )((u16 )new_channel)); return (0); } } static int b43_lpphy_op_init(struct b43_wldev *dev ) { int err ; { lpphy_read_band_sprom(dev); lpphy_baseband_init(dev); lpphy_radio_init(dev); lpphy_calibrate_rc(dev); err = b43_lpphy_op_switch_channel(dev, 7U); if (err != 0) { b43dbg(dev->wl, "Switch to channel 7 failed, error = %d.\n", err); } else { } lpphy_tx_pctl_init(dev); lpphy_calibration(dev); return (0); } } static void b43_lpphy_op_adjust_txpower(struct b43_wldev *dev ) { { return; } } static enum b43_txpwr_result b43_lpphy_op_recalc_txpower(struct b43_wldev *dev , bool ignore_tssi ) { { return (1); } } static void b43_lpphy_op_switch_analog(struct b43_wldev *dev , bool on ) { { if ((int )on) { b43_phy_mask(dev, 1083, 65528); } else { b43_phy_set(dev, 1084, 7); b43_phy_set(dev, 1083, 7); } return; } } static void b43_lpphy_op_pwork_15sec(struct b43_wldev *dev ) { { return; } } struct b43_phy_operations const b43_phyops_lp = {& b43_lpphy_op_allocate, & b43_lpphy_op_free, & b43_lpphy_op_prepare_structs, 0, & b43_lpphy_op_init, 0, & b43_lpphy_op_read, & b43_lpphy_op_write, & b43_lpphy_op_maskset, & b43_lpphy_op_radio_read, & b43_lpphy_op_radio_write, 0, & b43_lpphy_op_software_rfkill, & b43_lpphy_op_switch_analog, & b43_lpphy_op_switch_channel, & b43_lpphy_op_get_default_chan, & b43_lpphy_op_set_rx_antenna, 0, & b43_lpphy_op_recalc_txpower, & b43_lpphy_op_adjust_txpower, & b43_lpphy_op_pwork_15sec, & lpphy_calibration}; void ldv_initialize_b43_phy_operations_26(void) { void *tmp ; { tmp = ldv_init_zalloc(1736UL); b43_phyops_lp_group0 = (struct b43_wldev *)tmp; return; } } void ldv_main_exported_26(void) { u16 ldvarg9 ; u16 ldvarg19 ; u16 ldvarg10 ; unsigned int ldvarg13 ; bool ldvarg14 ; u16 ldvarg17 ; u16 ldvarg8 ; u16 ldvarg21 ; u16 ldvarg15 ; int ldvarg16 ; bool ldvarg12 ; u16 ldvarg20 ; bool ldvarg11 ; u16 ldvarg18 ; int tmp ; { ldv_memset((void *)(& ldvarg9), 0, 2UL); ldv_memset((void *)(& ldvarg19), 0, 2UL); ldv_memset((void *)(& ldvarg10), 0, 2UL); ldv_memset((void *)(& ldvarg13), 0, 4UL); ldv_memset((void *)(& ldvarg14), 0, 1UL); ldv_memset((void *)(& ldvarg17), 0, 2UL); ldv_memset((void *)(& ldvarg8), 0, 2UL); ldv_memset((void *)(& ldvarg21), 0, 2UL); ldv_memset((void *)(& ldvarg15), 0, 2UL); ldv_memset((void *)(& ldvarg16), 0, 4UL); ldv_memset((void *)(& ldvarg12), 0, 1UL); ldv_memset((void *)(& ldvarg20), 0, 2UL); ldv_memset((void *)(& ldvarg11), 0, 1UL); ldv_memset((void *)(& ldvarg18), 0, 2UL); tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_state_variable_26 == 1) { b43_lpphy_op_prepare_structs(b43_phyops_lp_group0); ldv_state_variable_26 = 1; } else { } goto ldv_37823; case 1: ; if (ldv_state_variable_26 == 1) { b43_lpphy_op_read(b43_phyops_lp_group0, (int )ldvarg21); ldv_state_variable_26 = 1; } else { } goto ldv_37823; case 2: ; if (ldv_state_variable_26 == 1) { b43_lpphy_op_allocate(b43_phyops_lp_group0); ldv_state_variable_26 = 1; } else { } goto ldv_37823; case 3: ; if (ldv_state_variable_26 == 1) { b43_lpphy_op_get_default_chan(b43_phyops_lp_group0); ldv_state_variable_26 = 1; } else { } goto ldv_37823; case 4: ; if (ldv_state_variable_26 == 1) { b43_lpphy_op_write(b43_phyops_lp_group0, (int )ldvarg20, (int )ldvarg19); ldv_state_variable_26 = 1; } else { } goto ldv_37823; case 5: ; if (ldv_state_variable_26 == 1) { b43_lpphy_op_pwork_15sec(b43_phyops_lp_group0); ldv_state_variable_26 = 1; } else { } goto ldv_37823; case 6: ; if (ldv_state_variable_26 == 1) { b43_lpphy_op_radio_write(b43_phyops_lp_group0, (int )ldvarg18, (int )ldvarg17); ldv_state_variable_26 = 1; } else { } goto ldv_37823; case 7: ; if (ldv_state_variable_26 == 1) { b43_lpphy_op_set_rx_antenna(b43_phyops_lp_group0, ldvarg16); ldv_state_variable_26 = 1; } else { } goto ldv_37823; case 8: ; if (ldv_state_variable_26 == 1) { b43_lpphy_op_radio_read(b43_phyops_lp_group0, (int )ldvarg15); ldv_state_variable_26 = 1; } else { } goto ldv_37823; case 9: ; if (ldv_state_variable_26 == 1) { b43_lpphy_op_adjust_txpower(b43_phyops_lp_group0); ldv_state_variable_26 = 1; } else { } goto ldv_37823; case 10: ; if (ldv_state_variable_26 == 1) { b43_lpphy_op_software_rfkill(b43_phyops_lp_group0, (int )ldvarg14); ldv_state_variable_26 = 1; } else { } goto ldv_37823; case 11: ; if (ldv_state_variable_26 == 1) { b43_lpphy_op_free(b43_phyops_lp_group0); ldv_state_variable_26 = 1; } else { } goto ldv_37823; case 12: ; if (ldv_state_variable_26 == 1) { b43_lpphy_op_switch_channel(b43_phyops_lp_group0, ldvarg13); ldv_state_variable_26 = 1; } else { } goto ldv_37823; case 13: ; if (ldv_state_variable_26 == 1) { b43_lpphy_op_recalc_txpower(b43_phyops_lp_group0, (int )ldvarg12); ldv_state_variable_26 = 1; } else { } goto ldv_37823; case 14: ; if (ldv_state_variable_26 == 1) { b43_lpphy_op_init(b43_phyops_lp_group0); ldv_state_variable_26 = 1; } else { } goto ldv_37823; case 15: ; if (ldv_state_variable_26 == 1) { lpphy_calibration(b43_phyops_lp_group0); ldv_state_variable_26 = 1; } else { } goto ldv_37823; case 16: ; if (ldv_state_variable_26 == 1) { b43_lpphy_op_switch_analog(b43_phyops_lp_group0, (int )ldvarg11); ldv_state_variable_26 = 1; } else { } goto ldv_37823; case 17: ; if (ldv_state_variable_26 == 1) { b43_lpphy_op_maskset(b43_phyops_lp_group0, (int )ldvarg10, (int )ldvarg9, (int )ldvarg8); ldv_state_variable_26 = 1; } else { } goto ldv_37823; default: ldv_stop(); } ldv_37823: ; return; } } int ldv_del_timer_sync_39(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type ldv_func_res ; int tmp ; { tmp = del_timer_sync(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_9(ldv_func_arg1); return (ldv_func_res); } } int ldv_del_timer_40(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___0 ldv_func_res ; int tmp ; { tmp = del_timer(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_9(ldv_func_arg1); return (ldv_func_res); } } int ldv_request_threaded_irq_41(unsigned int ldv_func_arg1 , irqreturn_t (*handler)(int , void * ) , irqreturn_t (*thread_fn)(int , void * ) , unsigned long ldv_func_arg4 , char const *ldv_func_arg5 , void *ldv_func_arg6 ) { ldv_func_ret_type___1 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = request_threaded_irq(ldv_func_arg1, handler, thread_fn, ldv_func_arg4, ldv_func_arg5, ldv_func_arg6); ldv_func_res = tmp; tmp___0 = reg_check_2(handler, thread_fn); if (tmp___0 != 0 && ldv_func_res >= 0) { activate_suitable_irq_2((int )ldv_func_arg1, ldv_func_arg6); } else { } return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; int ldv_del_timer_46(struct timer_list *ldv_func_arg1 ) ; int ldv_del_timer_sync_45(struct timer_list *ldv_func_arg1 ) ; int ldv_request_threaded_irq_47(unsigned int ldv_func_arg1 , irqreturn_t (*handler)(int , void * ) , irqreturn_t (*thread_fn)(int , void * ) , unsigned long ldv_func_arg4 , char const *ldv_func_arg5 , void *ldv_func_arg6 ) ; void lpphy_write_gain_table(struct b43_wldev *dev , int offset , struct lpphy_tx_gain_table_entry data ) ; void lpphy_write_gain_table_bulk(struct b43_wldev *dev , int offset , int count , struct lpphy_tx_gain_table_entry *table ) ; static struct b206x_init_tab_entry const b2062_init_tab[47U] = { {4U, 1U, 0U, 3U}, {17U, 0U, 202U, 2U}, {19U, 0U, 0U, 3U}, {20U, 21U, 42U, 3U}, {23U, 219U, 255U, 1U}, {30U, 221U, 0U, 3U}, {32U, 221U, 0U, 3U}, {33U, 119U, 181U, 3U}, {34U, 0U, 255U, 3U}, {38U, 51U, 51U, 3U}, {40U, 0U, 0U, 2U}, {47U, 130U, 128U, 3U}, {51U, 4U, 4U, 3U}, {52U, 0U, 0U, 3U}, {73U, 3U, 3U, 3U}, {74U, 2U, 2U, 3U}, {82U, 136U, 27U, 3U}, {16388U, 1U, 0U, 3U}, {16400U, 255U, 255U, 3U}, {16407U, 248U, 216U, 3U}, {16408U, 60U, 36U, 3U}, {16415U, 136U, 128U, 3U}, {16417U, 136U, 128U, 3U}, {16436U, 152U, 152U, 3U}, {16437U, 16U, 16U, 3U}, {16441U, 67U, 67U, 3U}, {16442U, 71U, 71U, 3U}, {16443U, 12U, 12U, 3U}, {16444U, 17U, 17U, 3U}, {16445U, 17U, 17U, 3U}, {16446U, 14U, 14U, 3U}, {16447U, 8U, 8U, 3U}, {16448U, 51U, 51U, 3U}, {16449U, 10U, 10U, 3U}, {16450U, 6U, 6U, 3U}, {16454U, 62U, 62U, 3U}, {16455U, 19U, 19U, 3U}, {16457U, 98U, 98U, 3U}, {16458U, 7U, 7U, 3U}, {16459U, 22U, 22U, 3U}, {16460U, 92U, 92U, 3U}, {16461U, 149U, 149U, 3U}, {16466U, 160U, 160U, 3U}, {16467U, 4U, 4U, 3U}, {16469U, 204U, 204U, 3U}, {16470U, 7U, 7U, 3U}, {16479U, 15U, 15U, 1U}}; static struct b206x_init_tab_entry const b2063_init_tab[42U] = { {0U, 0U, 0U, 2U}, {10U, 1U, 0U, 1U}, {16U, 0U, 0U, 2U}, {17U, 0U, 0U, 2U}, {18U, 0U, 0U, 2U}, {19U, 0U, 0U, 2U}, {20U, 0U, 0U, 2U}, {21U, 0U, 0U, 2U}, {22U, 0U, 0U, 2U}, {23U, 0U, 0U, 2U}, {24U, 0U, 0U, 2U}, {28U, 232U, 212U, 3U}, {29U, 167U, 83U, 3U}, {31U, 240U, 15U, 3U}, {33U, 31U, 94U, 2U}, {34U, 127U, 126U, 2U}, {35U, 48U, 240U, 2U}, {39U, 127U, 127U, 3U}, {42U, 12U, 12U, 3U}, {44U, 60U, 63U, 1U}, {45U, 252U, 254U, 1U}, {50U, 8U, 8U, 3U}, {54U, 96U, 96U, 3U}, {58U, 48U, 48U, 3U}, {61U, 12U, 11U, 3U}, {62U, 16U, 15U, 3U}, {76U, 61U, 253U, 3U}, {83U, 2U, 2U, 3U}, {87U, 86U, 86U, 3U}, {118U, 247U, 247U, 3U}, {196U, 113U, 113U, 3U}, {197U, 113U, 113U, 3U}, {207U, 240U, 48U, 1U}, {223U, 119U, 119U, 3U}, {227U, 3U, 3U, 3U}, {228U, 15U, 15U, 3U}, {229U, 15U, 15U, 3U}, {236U, 119U, 119U, 3U}, {238U, 119U, 119U, 3U}, {243U, 4U, 4U, 3U}, {267U, 0U, 4U, 1U}, {285U, 3U, 3U, 3U}}; void b2062_upload_init_table(struct b43_wldev *dev ) { struct b206x_init_tab_entry const *e ; unsigned int i ; enum ieee80211_band tmp ; { i = 0U; goto ldv_37030; ldv_37029: e = (struct b206x_init_tab_entry const *)(& b2062_init_tab) + (unsigned long )i; tmp = b43_current_band(dev->wl); if ((unsigned int )tmp == 0U) { if (((int )e->flags & 2) == 0) { goto ldv_37028; } else { } b43_radio_write(dev, (int )e->offset, (int )e->value_g); } else { if (((int )e->flags & 1) == 0) { goto ldv_37028; } else { } b43_radio_write(dev, (int )e->offset, (int )e->value_a); } ldv_37028: i = i + 1U; ldv_37030: ; if (i <= 46U) { goto ldv_37029; } else { } return; } } void b2063_upload_init_table(struct b43_wldev *dev ) { struct b206x_init_tab_entry const *e ; unsigned int i ; enum ieee80211_band tmp ; { i = 0U; goto ldv_37041; ldv_37040: e = (struct b206x_init_tab_entry const *)(& b2063_init_tab) + (unsigned long )i; tmp = b43_current_band(dev->wl); if ((unsigned int )tmp == 0U) { if (((int )e->flags & 2) == 0) { goto ldv_37039; } else { } b43_radio_write(dev, (int )e->offset, (int )e->value_g); } else { if (((int )e->flags & 1) == 0) { goto ldv_37039; } else { } b43_radio_write(dev, (int )e->offset, (int )e->value_a); } ldv_37039: i = i + 1U; ldv_37041: ; if (i <= 41U) { goto ldv_37040; } else { } return; } } u32 b43_lptab_read(struct b43_wldev *dev , u32 offset ) { u32 type ; u32 value ; int __ret_warn_on ; long tmp ; u16 tmp___0 ; u16 tmp___1 ; u16 tmp___2 ; u16 tmp___3 ; int __ret_warn_on___0 ; long tmp___4 ; { type = offset & 4026531840U; offset = offset & 268435455U; __ret_warn_on = offset > 65535U; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/tables_lpphy.c", 600); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); switch (type) { case 268435456U: b43_phy_write(dev, 1109, (int )((u16 )offset)); tmp___0 = b43_phy_read(dev, 1110); value = (u32 )tmp___0 & 255U; goto ldv_37052; case 536870912U: b43_phy_write(dev, 1109, (int )((u16 )offset)); tmp___1 = b43_phy_read(dev, 1110); value = (u32 )tmp___1; goto ldv_37052; case 805306368U: b43_phy_write(dev, 1109, (int )((u16 )offset)); tmp___2 = b43_phy_read(dev, 1111); value = (u32 )tmp___2; value = value << 16; tmp___3 = b43_phy_read(dev, 1110); value = (u32 )tmp___3 | value; goto ldv_37052; default: __ret_warn_on___0 = 1; tmp___4 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___4 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/tables_lpphy.c", 618); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); value = 0U; } ldv_37052: ; return (value); } } void b43_lptab_read_bulk(struct b43_wldev *dev , u32 offset , unsigned int nr_elements , void *_data___0 ) { u32 type ; u8 *data ; unsigned int i ; int __ret_warn_on ; long tmp ; u16 tmp___0 ; u16 tmp___1 ; u16 tmp___2 ; int __ret_warn_on___0 ; long tmp___3 ; { data = (u8 *)_data___0; type = offset & 4026531840U; offset = offset & 268435455U; __ret_warn_on = offset > 65535U; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/tables_lpphy.c", 634); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); b43_phy_write(dev, 1109, (int )((u16 )offset)); i = 0U; goto ldv_37077; ldv_37076: ; switch (type) { case 268435456U: tmp___0 = b43_phy_read(dev, 1110); *data = (u8 )tmp___0; data = data + 1; goto ldv_37070; case 536870912U: *((u16 *)data) = b43_phy_read(dev, 1110); data = data + 2UL; goto ldv_37070; case 805306368U: tmp___1 = b43_phy_read(dev, 1111); *((u32 *)data) = (u32 )tmp___1; *((u32 *)data) = *((u32 *)data) << 16; tmp___2 = b43_phy_read(dev, 1110); *((u32 *)data) = *((u32 *)data) | (u32 )tmp___2; data = data + 4UL; goto ldv_37070; default: __ret_warn_on___0 = 1; tmp___3 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___3 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/tables_lpphy.c", 655); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); } ldv_37070: i = i + 1U; ldv_37077: ; if (i < nr_elements) { goto ldv_37076; } else { } return; } } void b43_lptab_write(struct b43_wldev *dev , u32 offset , u32 value ) { u32 type ; int __ret_warn_on ; long tmp ; int __ret_warn_on___0 ; long tmp___0 ; int __ret_warn_on___1 ; long tmp___1 ; int __ret_warn_on___2 ; long tmp___2 ; { type = offset & 4026531840U; offset = offset & 268435455U; __ret_warn_on = offset > 65535U; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/tables_lpphy.c", 666); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); switch (type) { case 268435456U: __ret_warn_on___0 = (value & 4294967040U) != 0U; tmp___0 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/tables_lpphy.c", 670); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); b43_phy_write(dev, 1109, (int )((u16 )offset)); b43_phy_write(dev, 1110, (int )((u16 )value)); goto ldv_37090; case 536870912U: __ret_warn_on___1 = (value & 4294901760U) != 0U; tmp___1 = ldv__builtin_expect(__ret_warn_on___1 != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/tables_lpphy.c", 675); } else { } ldv__builtin_expect(__ret_warn_on___1 != 0, 0L); b43_phy_write(dev, 1109, (int )((u16 )offset)); b43_phy_write(dev, 1110, (int )((u16 )value)); goto ldv_37090; case 805306368U: b43_phy_write(dev, 1109, (int )((u16 )offset)); b43_phy_write(dev, 1111, (int )((u16 )(value >> 16))); b43_phy_write(dev, 1110, (int )((u16 )value)); goto ldv_37090; default: __ret_warn_on___2 = 1; tmp___2 = ldv__builtin_expect(__ret_warn_on___2 != 0, 0L); if (tmp___2 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/tables_lpphy.c", 685); } else { } ldv__builtin_expect(__ret_warn_on___2 != 0, 0L); } ldv_37090: ; return; } } void b43_lptab_write_bulk(struct b43_wldev *dev , u32 offset , unsigned int nr_elements , void const *_data___0 ) { u32 type ; u32 value ; u8 const *data ; unsigned int i ; int __ret_warn_on ; long tmp ; int __ret_warn_on___0 ; long tmp___0 ; int __ret_warn_on___1 ; long tmp___1 ; int __ret_warn_on___2 ; long tmp___2 ; { data = (u8 const *)_data___0; type = offset & 4026531840U; offset = offset & 268435455U; __ret_warn_on = offset > 65535U; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/tables_lpphy.c", 698); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); b43_phy_write(dev, 1109, (int )((u16 )offset)); i = 0U; goto ldv_37122; ldv_37121: ; switch (type) { case 268435456U: value = (u32 )*data; data = data + 1; __ret_warn_on___0 = (value & 4294967040U) != 0U; tmp___0 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/tables_lpphy.c", 707); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); b43_phy_write(dev, 1110, (int )((u16 )value)); goto ldv_37113; case 536870912U: value = (u32 )*((u16 *)data); data = data + 2UL; __ret_warn_on___1 = (value & 4294901760U) != 0U; tmp___1 = ldv__builtin_expect(__ret_warn_on___1 != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/tables_lpphy.c", 713); } else { } ldv__builtin_expect(__ret_warn_on___1 != 0, 0L); b43_phy_write(dev, 1110, (int )((u16 )value)); goto ldv_37113; case 805306368U: value = *((u32 *)data); data = data + 4UL; b43_phy_write(dev, 1111, (int )((u16 )(value >> 16))); b43_phy_write(dev, 1110, (int )((u16 )value)); goto ldv_37113; default: __ret_warn_on___2 = 1; tmp___2 = ldv__builtin_expect(__ret_warn_on___2 != 0, 0L); if (tmp___2 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/tables_lpphy.c", 723); } else { } ldv__builtin_expect(__ret_warn_on___2 != 0, 0L); } ldv_37113: i = i + 1U; ldv_37122: ; if (i < nr_elements) { goto ldv_37121; } else { } return; } } static u8 const lpphy_min_sig_sq_table[53U] = { 222U, 220U, 218U, 216U, 214U, 212U, 210U, 207U, 205U, 202U, 199U, 196U, 193U, 190U, 190U, 190U, 190U, 190U, 190U, 190U, 190U, 190U, 190U, 190U, 190U, 190U, 0U, 190U, 190U, 190U, 190U, 190U, 190U, 190U, 190U, 190U, 190U, 190U, 190U, 190U, 193U, 196U, 199U, 202U, 205U, 207U, 210U, 212U, 214U, 216U, 218U, 220U, 222U}; static u16 const lpphy_rev01_noise_scale_table[40U] = { 42148U, 42148U, 42148U, 42148U, 42148U, 42148U, 42148U, 42148U, 42148U, 42148U, 42148U, 42148U, 42148U, 41984U, 42148U, 42148U, 42148U, 42148U, 42148U, 42148U, 42148U, 42148U, 42148U, 42148U, 42148U, 42148U, 164U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 19456U, 11574U, 0U, 0U, 19456U, 11574U}; static u16 const lpphy_rev2plus_noise_scale_table[53U] = { 164U, 164U, 164U, 164U, 164U, 164U, 164U, 164U, 164U, 164U, 164U, 164U, 164U, 164U, 164U, 164U, 164U, 164U, 164U, 164U, 164U, 164U, 164U, 164U, 164U, 164U, 0U, 164U, 164U, 164U, 164U, 164U, 164U, 164U, 164U, 164U, 164U, 164U, 164U, 164U, 164U, 164U, 164U, 164U, 164U, 164U, 164U, 164U, 164U, 164U, 164U, 164U, 164U}; static u16 const lpphy_crs_gain_nft_table[33U] = { 870U, 874U, 879U, 868U, 871U, 877U, 884U, 895U, 879U, 891U, 906U, 888U, 871U, 877U, 885U, 897U, 884U, 897U, 914U, 937U, 964U, 993U, 1U, 31U, 64U, 94U, 127U, 158U, 189U, 221U, 253U, 285U, 317U}; static u16 const lpphy_rev01_filter_control_table[10U] = { 41212U, 4348U, 4315U, 8375U, 65427U, 4287U, 4251U, 8311U, 65363U, 295U}; static u32 const lpphy_rev2plus_filter_control_table[10U] = { 82428U, 8700U, 8631U, 16751U, 130855U, 8575U, 8503U, 16623U, 130727U, 591U}; static u32 const lpphy_rev01_ps_control_table[40U] = { 65536U, 160U, 262144U, 72U, 134742273U, 128U, 134742273U, 64U, 134742273U, 192U, 145233153U, 192U, 266927361U, 192U, 137363717U, 192U, 134742529U, 192U, 136839685U, 192U, 3892839166U, 199U, 671613446U, 192U, 134742530U, 192U, 195589634U, 192U, 275251517U, 192U, 271057157U, 192U, 143130882U, 192U, 136839430U, 192U, 3892838909U, 199U, 2819096853U, 192U}; static u32 const lpphy_rev2plus_ps_control_table[20U] = { 14913032U, 14716472U, 0U, 0U, 0U, 8320U, 24960U, 12290U, 64U, 8258U, 1572935U, 524355U, 65U, 8385U, 286726U, 270338U, 262144U, 8195U, 1572870U, 524290U}; static u8 const lpphy_pll_fraction_table[16U] = { 128U, 128U, 128U, 128U, 128U, 128U, 0U, 0U, 128U, 128U, 128U, 128U, 128U, 128U, 128U, 128U}; static u16 const lpphy_iqlo_cal_table[108U] = { 512U, 768U, 1024U, 1536U, 2048U, 2816U, 4096U, 4097U, 4098U, 4099U, 4100U, 4101U, 4102U, 4103U, 5895U, 8199U, 11527U, 16391U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 512U, 768U, 1024U, 1536U, 2048U, 2816U, 4096U, 4097U, 4098U, 4099U, 4100U, 4101U, 4102U, 4103U, 5895U, 8199U, 11527U, 16391U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 16384U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U}; static u16 const lpphy_rev0_ofdm_cck_gain_table[33U] = { 1U, 1U, 1U, 1U, 4097U, 8193U, 12289U, 16385U, 20481U, 24577U, 28673U, 28689U, 28705U, 8245U, 8261U, 8277U, 8293U, 8309U, 109U, 125U, 333U, 349U, 4445U, 861U, 4957U, 1373U, 5469U, 3421U, 7517U, 11613U, 21853U, 25949U, 30045U}; static u16 const lpphy_rev1_ofdm_cck_gain_table[33U] = { 20480U, 24576U, 28672U, 1U, 4097U, 8193U, 12289U, 16385U, 20481U, 24577U, 28673U, 28689U, 28705U, 8245U, 8261U, 8277U, 8293U, 8309U, 109U, 125U, 333U, 349U, 4445U, 861U, 4957U, 1373U, 5469U, 3421U, 7517U, 11613U, 21853U, 25949U, 30045U}; static u16 const lpphy_gain_delta_table[9U] = { 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U}; static u32 const lpphy_tx_power_control_table[576U] = { 80U, 79U, 78U, 77U, 76U, 75U, 74U, 73U, 72U, 71U, 70U, 69U, 68U, 67U, 66U, 65U, 64U, 63U, 62U, 61U, 60U, 59U, 58U, 57U, 56U, 55U, 54U, 53U, 52U, 51U, 50U, 49U, 48U, 47U, 46U, 45U, 44U, 43U, 42U, 41U, 40U, 39U, 38U, 37U, 36U, 35U, 34U, 33U, 32U, 31U, 30U, 29U, 28U, 27U, 26U, 25U, 24U, 23U, 22U, 21U, 20U, 19U, 18U, 17U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 30112U, 30112U, 30113U, 30113U, 30114U, 30114U, 30115U, 30115U, 29872U, 29872U, 29873U, 29873U, 29874U, 29874U, 29875U, 29875U, 27936U, 27936U, 27937U, 27937U, 27938U, 27938U, 27939U, 27939U, 18016U, 18016U, 18017U, 18017U, 18018U, 18018U, 18019U, 18019U, 15968U, 15968U, 15969U, 15969U, 15970U, 15970U, 15971U, 15971U, 13920U, 13920U, 13921U, 13921U, 13922U, 13922U, 13923U, 13923U, 11872U, 11872U, 11873U, 11873U, 11874U, 11874U, 11875U, 11875U, 9824U, 9824U, 9825U, 9825U, 9826U, 9826U, 9827U, 9827U, 9696U, 9696U, 9697U, 9697U, 9698U, 9698U, 9699U, 9699U, 7648U, 7648U, 7649U, 7649U, 7650U, 7650U, 7651U, 7651U, 7520U, 7520U, 7521U, 7521U, 7522U, 7522U, 7523U, 7523U, 5472U, 5472U, 5473U, 5473U, 5474U, 5474U, 5475U, 5475U, 3424U, 3424U, 3425U, 3425U, 3426U, 3426U, 3427U, 3427U, 3296U, 3296U, 3297U, 3297U, 3298U, 3298U, 3299U, 3299U, 3600U, 3600U, 3601U, 3601U, 3602U, 3602U, 3603U, 3603U, 3056U, 3056U, 3057U, 3057U, 3058U, 3058U, 3059U, 3059U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 69206016U, 67108864U, 255U, 764U, 64008U, 773U, 518U, 772U, 64260U, 64767U, 1531U, 64769U, 1025U, 6U, 65283U, 2044U, 64520U, 515U, 65531U, 1536U, 64001U, 64515U, 65030U, 65024U, 258U, 2045U, 1275U, 1791U, 1277U, 65018U, 2043U, 65018U, 64006U, 1280U, 63746U, 2042U, 64250U, 1280U, 2042U, 1792U, 773U, 1279U, 2049U, 1283U, 1529U, 1028U, 64264U, 1533U, 1281U, 1029U, 64259U, 2044U, 1027U, 771U, 1026U, 64255U, 65029U, 1533U, 65025U, 2042U, 514U, 1284U, 258U, 2302U, 64004U, 64252U, 65032U, 249U, 762U, 1022U, 772U, 1273U, 256U, 64774U, 2300U, 1793U, 1284U, 65022U, 65020U, 1022U, 1796U, 764U, 1273U, 65021U, 64007U, 517U, 1021U, 1531U, 1273U, 2052U, 64518U, 64761U, 256U, 65029U, 1032U, 64258U, 772U, 1790U, 1274U, 773U, 2300U, 258U, 509U, 1276U, 65027U, 1793U, 507U, 505U, 518U, 1789U, 1288U, 1792U, 772U, 1534U, 1535U, 64004U, 771U, 65275U, 2041U, 65276U, 1277U, 1532U, 65533U, 64520U, 64505U, 64775U, 2299U, 65026U, 1787U, 1794U}; static u32 const lpphy_gain_idx_table[148U] = { 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 268435457U, 0U, 536871042U, 0U, 1073742084U, 0U, 1610629639U, 1U, 1879081866U, 1U, 3491824909U, 1U, 3762407043U, 1U, 1350731781U, 0U, 2162377352U, 0U, 2974024715U, 0U, 3785753998U, 0U, 302401297U, 1U, 2963375634U, 16U, 3775022996U, 16U, 291703061U, 17U, 834914843U, 17U, 3246688924U, 24U, 4058320288U, 24U, 575049249U, 25U, 1116131363U, 25U, 2739392676U, 25U, 3009941926U, 25U, 4092105255U, 25U, 67687209U, 26U, 608785322U, 26U, 879334571U, 26U, 1420432684U, 26U, 1690981805U, 26U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 268435457U, 0U, 536871042U, 0U, 1073742084U, 0U, 1610629639U, 1U, 1879081866U, 1U, 3491824909U, 1U, 3762407043U, 1U, 1350731781U, 0U, 2162377352U, 0U, 2974024715U, 0U, 3785753998U, 0U, 302401297U, 1U, 2963375634U, 16U, 3775022996U, 16U, 291703061U, 17U, 834914843U, 17U, 3246688924U, 24U, 4058320288U, 24U, 575049249U, 25U, 1116131363U, 25U, 2739392676U, 25U, 3009941926U, 25U, 4092105255U, 25U, 67687209U, 26U, 608785322U, 26U, 879334571U, 26U, 1420432684U, 26U, 1690981805U, 26U}; static u16 const lpphy_aux_gain_idx_table[26U] = { 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 1U, 2U, 4U, 22U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 1U, 2U, 4U, 22U}; static u32 const lpphy_gain_value_table[68U] = { 8U, 14U, 20U, 26U, 251U, 4U, 8U, 13U, 1U, 4U, 7U, 10U, 13U, 16U, 18U, 21U, 0U, 6U, 12U, 0U, 0U, 0U, 18U, 0U, 0U, 0U, 24U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 30U, 0U, 0U, 0U, 0U, 0U, 0U, 3U, 6U, 9U, 12U, 15U, 18U, 21U, 24U, 27U, 30U, 0U, 0U, 0U, 0U, 0U, 9U, 241U, 0U, 0U}; static u16 const lpphy_gain_table[96U] = { 0U, 1024U, 2048U, 2050U, 2052U, 2054U, 2055U, 2056U, 2058U, 2059U, 2060U, 2062U, 2063U, 2064U, 2066U, 2067U, 2068U, 2070U, 2071U, 2074U, 2075U, 2079U, 2080U, 2084U, 2096U, 2100U, 2103U, 2107U, 2111U, 2112U, 2116U, 2135U, 2139U, 2143U, 2263U, 2267U, 2271U, 2391U, 2395U, 2399U, 2903U, 2907U, 2911U, 3935U, 4959U, 5983U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U}; static u32 const lpphy_a0_gain_idx_table[64U] = { 1118688U, 6627409U, 6316117U, 5963866U, 5591136U, 5312613U, 5013611U, 4706418U, 4472952U, 4194432U, 3973255U, 3752079U, 3530904U, 3334305U, 3158186U, 2982068U, 2810047U, 2654410U, 2506966U, 2363619U, 2236656U, 2105599U, 1986830U, 1876254U, 1769775U, 1675584U, 1581395U, 1491304U, 1409405U, 1331603U, 1253803U, 1184197U, 1118688U, 1057276U, 995866U, 938554U, 889436U, 840319U, 791205U, 746189U, 705272U, 664357U, 627541U, 594823U, 558013U, 529397U, 500786U, 472177U, 443573U, 419068U, 398663U, 374168U, 353772U, 333382U, 317093U, 296714U, 280437U, 264166U, 251998U, 235741U, 223587U, 211442U, 199305U, 187176U}; static u16 const lpphy_a0_aux_gain_idx_table[26U] = { 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 2U, 20U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 2U, 20U}; static u32 const lpphy_a0_gain_value_table[68U] = { 8U, 14U, 20U, 26U, 251U, 4U, 8U, 13U, 1U, 4U, 7U, 10U, 13U, 16U, 18U, 21U, 0U, 6U, 12U, 0U, 0U, 0U, 18U, 0U, 0U, 0U, 24U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 30U, 0U, 0U, 0U, 0U, 0U, 0U, 3U, 6U, 9U, 12U, 15U, 18U, 21U, 24U, 27U, 30U, 0U, 0U, 0U, 0U, 0U, 15U, 247U, 0U, 0U}; static u16 const lpphy_a0_gain_table[96U] = { 0U, 2U, 4U, 6U, 7U, 8U, 10U, 11U, 12U, 14U, 15U, 16U, 18U, 19U, 20U, 22U, 23U, 26U, 27U, 31U, 32U, 36U, 48U, 52U, 55U, 59U, 63U, 64U, 68U, 87U, 91U, 95U, 215U, 219U, 223U, 343U, 347U, 351U, 855U, 859U, 863U, 1887U, 2911U, 3935U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U}; static u16 const lpphy_sw_control_table[64U] = { 296U, 296U, 9U, 9U, 40U, 40U, 40U, 40U, 296U, 296U, 9U, 9U, 40U, 40U, 40U, 40U, 9U, 9U, 9U, 9U, 9U, 9U, 9U, 9U, 24U, 24U, 24U, 24U, 24U, 24U, 24U, 24U, 296U, 296U, 9U, 9U, 40U, 40U, 40U, 40U, 296U, 296U, 9U, 9U, 40U, 40U, 40U, 40U, 9U, 9U, 9U, 9U, 9U, 9U, 9U, 9U, 24U, 24U, 24U, 24U, 24U, 24U, 24U, 24U}; static u8 const lpphy_hf_table[16U] = { 75U, 54U, 36U, 24U, 73U, 52U, 35U, 23U, 72U, 51U, 35U, 23U, 72U, 51U, 35U, 23U}; static u32 const lpphy_papd_eps_table[64U] = { 0U, 81916U, 122867U, 114672U, 147433U, 139231U, 167903U, 212946U, 237515U, 278471U, 323522U, 352181U, 380848U, 409512U, 429987U, 466840U, 520082U, 544651U, 581506U, 622455U, 647017U, 671586U, 712535U, 749388U, 786241U, 827193U, 851760U, 900903U, 937758U, 974614U, 1015571U, 1060625U, 1117968U, 1171217U, 1240853U, 1326876U, 1412903U, 1519413U, 1654599U, 1814367U, 1994622U, 2215844U, 2473938U, 2760712U, 3125319U, 3539088U, 4014304U, 4571445U, 5222793U, 5956055U, 6758941U, 7668314U, 8385169U, 8385215U, 8385251U, 8385279U, 8385301U, 8385321U, 8385343U, 8385366U, 8385390U, 8385436U, 8385601U, 8385798U}; static u32 const lpphy_papd_mult_table[64U] = { 1118688U, 6627409U, 6316117U, 5963866U, 5591136U, 5312613U, 5013611U, 4706418U, 4472952U, 4194432U, 3973255U, 3752079U, 3530904U, 3334305U, 3158186U, 2982068U, 2810047U, 2654410U, 2506966U, 2363619U, 2236656U, 2105599U, 1986830U, 1876254U, 1769775U, 1675584U, 1581395U, 1491304U, 1409405U, 1331603U, 1253803U, 1184197U, 1118688U, 1057276U, 995866U, 938554U, 889436U, 840319U, 791205U, 746189U, 705272U, 664357U, 627541U, 594823U, 558013U, 529397U, 500786U, 472177U, 443573U, 419068U, 398663U, 374168U, 353772U, 333382U, 317093U, 296714U, 280437U, 264166U, 251998U, 235741U, 223587U, 211442U, 199305U, 187176U}; static struct lpphy_tx_gain_table_entry lpphy_rev0_nopa_tx_gain_table[128U] = { {7U, 15U, 14U, 0U, 152U}, {7U, 15U, 14U, 0U, 147U}, {7U, 15U, 14U, 0U, 143U}, {7U, 15U, 14U, 0U, 139U}, {7U, 15U, 14U, 0U, 135U}, {7U, 15U, 14U, 0U, 131U}, {7U, 15U, 14U, 0U, 128U}, {7U, 15U, 14U, 0U, 124U}, {7U, 15U, 14U, 0U, 121U}, {7U, 15U, 14U, 0U, 117U}, {7U, 15U, 14U, 0U, 114U}, {7U, 15U, 14U, 0U, 111U}, {7U, 15U, 14U, 0U, 107U}, {7U, 15U, 14U, 0U, 104U}, {7U, 15U, 14U, 0U, 101U}, {7U, 15U, 14U, 0U, 99U}, {7U, 15U, 14U, 0U, 96U}, {7U, 15U, 14U, 0U, 93U}, {7U, 15U, 14U, 0U, 90U}, {7U, 15U, 14U, 0U, 88U}, {7U, 15U, 14U, 0U, 85U}, {7U, 15U, 14U, 0U, 83U}, {7U, 15U, 14U, 0U, 81U}, {7U, 15U, 14U, 0U, 78U}, {7U, 15U, 14U, 0U, 76U}, {7U, 15U, 14U, 0U, 74U}, {7U, 15U, 14U, 0U, 72U}, {7U, 15U, 14U, 0U, 70U}, {7U, 15U, 14U, 0U, 68U}, {7U, 15U, 14U, 0U, 66U}, {7U, 15U, 14U, 0U, 64U}, {7U, 15U, 14U, 0U, 62U}, {7U, 15U, 14U, 0U, 60U}, {7U, 15U, 14U, 0U, 59U}, {7U, 15U, 14U, 0U, 57U}, {7U, 15U, 13U, 0U, 72U}, {7U, 15U, 13U, 0U, 70U}, {7U, 15U, 13U, 0U, 68U}, {7U, 15U, 13U, 0U, 66U}, {7U, 15U, 13U, 0U, 64U}, {7U, 15U, 13U, 0U, 62U}, {7U, 15U, 13U, 0U, 60U}, {7U, 15U, 13U, 0U, 59U}, {7U, 15U, 13U, 0U, 57U}, {7U, 15U, 12U, 0U, 71U}, {7U, 15U, 12U, 0U, 69U}, {7U, 15U, 12U, 0U, 67U}, {7U, 15U, 12U, 0U, 65U}, {7U, 15U, 12U, 0U, 63U}, {7U, 15U, 12U, 0U, 62U}, {7U, 15U, 12U, 0U, 60U}, {7U, 15U, 12U, 0U, 58U}, {7U, 15U, 12U, 0U, 57U}, {7U, 15U, 11U, 0U, 70U}, {7U, 15U, 11U, 0U, 68U}, {7U, 15U, 11U, 0U, 66U}, {7U, 15U, 11U, 0U, 65U}, {7U, 15U, 11U, 0U, 63U}, {7U, 15U, 11U, 0U, 61U}, {7U, 15U, 11U, 0U, 59U}, {7U, 15U, 11U, 0U, 58U}, {7U, 15U, 10U, 0U, 71U}, {7U, 15U, 10U, 0U, 69U}, {7U, 15U, 10U, 0U, 67U}, {7U, 15U, 10U, 0U, 65U}, {7U, 15U, 10U, 0U, 63U}, {7U, 15U, 10U, 0U, 61U}, {7U, 15U, 10U, 0U, 60U}, {7U, 15U, 10U, 0U, 58U}, {7U, 15U, 10U, 0U, 56U}, {7U, 15U, 9U, 0U, 70U}, {7U, 15U, 9U, 0U, 68U}, {7U, 15U, 9U, 0U, 66U}, {7U, 15U, 9U, 0U, 64U}, {7U, 15U, 9U, 0U, 62U}, {7U, 15U, 9U, 0U, 60U}, {7U, 15U, 9U, 0U, 59U}, {7U, 14U, 9U, 0U, 72U}, {7U, 14U, 9U, 0U, 70U}, {7U, 14U, 9U, 0U, 68U}, {7U, 14U, 9U, 0U, 66U}, {7U, 14U, 9U, 0U, 64U}, {7U, 14U, 9U, 0U, 62U}, {7U, 14U, 9U, 0U, 60U}, {7U, 14U, 9U, 0U, 59U}, {7U, 13U, 9U, 0U, 72U}, {7U, 13U, 9U, 0U, 70U}, {7U, 13U, 9U, 0U, 68U}, {7U, 13U, 9U, 0U, 66U}, {7U, 13U, 9U, 0U, 64U}, {7U, 13U, 9U, 0U, 63U}, {7U, 13U, 9U, 0U, 61U}, {7U, 13U, 9U, 0U, 59U}, {7U, 13U, 9U, 0U, 57U}, {7U, 13U, 8U, 0U, 72U}, {7U, 13U, 8U, 0U, 70U}, {7U, 13U, 8U, 0U, 68U}, {7U, 13U, 8U, 0U, 66U}, {7U, 13U, 8U, 0U, 64U}, {7U, 13U, 8U, 0U, 62U}, {7U, 13U, 8U, 0U, 60U}, {7U, 13U, 8U, 0U, 59U}, {7U, 12U, 8U, 0U, 72U}, {7U, 12U, 8U, 0U, 70U}, {7U, 12U, 8U, 0U, 68U}, {7U, 12U, 8U, 0U, 66U}, {7U, 12U, 8U, 0U, 64U}, {7U, 12U, 8U, 0U, 62U}, {7U, 12U, 8U, 0U, 61U}, {7U, 12U, 8U, 0U, 59U}, {7U, 12U, 7U, 0U, 73U}, {7U, 12U, 7U, 0U, 71U}, {7U, 12U, 7U, 0U, 69U}, {7U, 12U, 7U, 0U, 67U}, {7U, 12U, 7U, 0U, 65U}, {7U, 12U, 7U, 0U, 63U}, {7U, 12U, 7U, 0U, 61U}, {7U, 12U, 7U, 0U, 59U}, {7U, 11U, 7U, 0U, 72U}, {7U, 11U, 7U, 0U, 70U}, {7U, 11U, 7U, 0U, 68U}, {7U, 11U, 7U, 0U, 66U}, {7U, 11U, 7U, 0U, 65U}, {7U, 11U, 7U, 0U, 63U}, {7U, 11U, 7U, 0U, 61U}, {7U, 11U, 7U, 0U, 59U}, {7U, 11U, 6U, 0U, 73U}, {7U, 11U, 6U, 0U, 71U}}; static struct lpphy_tx_gain_table_entry lpphy_rev0_2ghz_tx_gain_table[128U] = { {4U, 15U, 9U, 0U, 64U}, {4U, 15U, 9U, 0U, 62U}, {4U, 15U, 9U, 0U, 60U}, {4U, 15U, 9U, 0U, 59U}, {4U, 14U, 9U, 0U, 72U}, {4U, 14U, 9U, 0U, 70U}, {4U, 14U, 9U, 0U, 68U}, {4U, 14U, 9U, 0U, 66U}, {4U, 14U, 9U, 0U, 64U}, {4U, 14U, 9U, 0U, 62U}, {4U, 14U, 9U, 0U, 60U}, {4U, 14U, 9U, 0U, 59U}, {4U, 13U, 9U, 0U, 72U}, {4U, 13U, 9U, 0U, 70U}, {4U, 13U, 9U, 0U, 68U}, {4U, 13U, 9U, 0U, 66U}, {4U, 13U, 9U, 0U, 64U}, {4U, 13U, 9U, 0U, 63U}, {4U, 13U, 9U, 0U, 61U}, {4U, 13U, 9U, 0U, 59U}, {4U, 13U, 9U, 0U, 57U}, {4U, 13U, 8U, 0U, 72U}, {4U, 13U, 8U, 0U, 70U}, {4U, 13U, 8U, 0U, 68U}, {4U, 13U, 8U, 0U, 66U}, {4U, 13U, 8U, 0U, 64U}, {4U, 13U, 8U, 0U, 62U}, {4U, 13U, 8U, 0U, 60U}, {4U, 13U, 8U, 0U, 59U}, {4U, 12U, 8U, 0U, 72U}, {4U, 12U, 8U, 0U, 70U}, {4U, 12U, 8U, 0U, 68U}, {4U, 12U, 8U, 0U, 66U}, {4U, 12U, 8U, 0U, 64U}, {4U, 12U, 8U, 0U, 62U}, {4U, 12U, 8U, 0U, 61U}, {4U, 12U, 8U, 0U, 59U}, {4U, 12U, 7U, 0U, 73U}, {4U, 12U, 7U, 0U, 71U}, {4U, 12U, 7U, 0U, 69U}, {4U, 12U, 7U, 0U, 67U}, {4U, 12U, 7U, 0U, 65U}, {4U, 12U, 7U, 0U, 63U}, {4U, 12U, 7U, 0U, 61U}, {4U, 12U, 7U, 0U, 59U}, {4U, 11U, 7U, 0U, 72U}, {4U, 11U, 7U, 0U, 70U}, {4U, 11U, 7U, 0U, 68U}, {4U, 11U, 7U, 0U, 66U}, {4U, 11U, 7U, 0U, 65U}, {4U, 11U, 7U, 0U, 63U}, {4U, 11U, 7U, 0U, 61U}, {4U, 11U, 7U, 0U, 59U}, {4U, 11U, 6U, 0U, 73U}, {4U, 11U, 6U, 0U, 71U}, {4U, 11U, 6U, 0U, 69U}, {4U, 11U, 6U, 0U, 67U}, {4U, 11U, 6U, 0U, 65U}, {4U, 11U, 6U, 0U, 63U}, {4U, 11U, 6U, 0U, 61U}, {4U, 11U, 6U, 0U, 60U}, {4U, 10U, 6U, 0U, 72U}, {4U, 10U, 6U, 0U, 70U}, {4U, 10U, 6U, 0U, 68U}, {4U, 10U, 6U, 0U, 66U}, {4U, 10U, 6U, 0U, 64U}, {4U, 10U, 6U, 0U, 62U}, {4U, 10U, 6U, 0U, 60U}, {4U, 10U, 6U, 0U, 59U}, {4U, 10U, 5U, 0U, 72U}, {4U, 10U, 5U, 0U, 70U}, {4U, 10U, 5U, 0U, 68U}, {4U, 10U, 5U, 0U, 66U}, {4U, 10U, 5U, 0U, 64U}, {4U, 10U, 5U, 0U, 62U}, {4U, 10U, 5U, 0U, 60U}, {4U, 10U, 5U, 0U, 59U}, {4U, 9U, 5U, 0U, 70U}, {4U, 9U, 5U, 0U, 68U}, {4U, 9U, 5U, 0U, 66U}, {4U, 9U, 5U, 0U, 64U}, {4U, 9U, 5U, 0U, 63U}, {4U, 9U, 5U, 0U, 61U}, {4U, 9U, 5U, 0U, 59U}, {4U, 9U, 4U, 0U, 71U}, {4U, 9U, 4U, 0U, 69U}, {4U, 9U, 4U, 0U, 67U}, {4U, 9U, 4U, 0U, 65U}, {4U, 9U, 4U, 0U, 63U}, {4U, 9U, 4U, 0U, 62U}, {4U, 9U, 4U, 0U, 60U}, {4U, 9U, 4U, 0U, 58U}, {4U, 8U, 4U, 0U, 70U}, {4U, 8U, 4U, 0U, 68U}, {4U, 8U, 4U, 0U, 66U}, {4U, 8U, 4U, 0U, 65U}, {4U, 8U, 4U, 0U, 63U}, {4U, 8U, 4U, 0U, 61U}, {4U, 8U, 4U, 0U, 59U}, {4U, 7U, 4U, 0U, 68U}, {4U, 7U, 4U, 0U, 66U}, {4U, 7U, 4U, 0U, 64U}, {4U, 7U, 4U, 0U, 62U}, {4U, 7U, 4U, 0U, 61U}, {4U, 7U, 4U, 0U, 59U}, {4U, 7U, 3U, 0U, 67U}, {4U, 7U, 3U, 0U, 65U}, {4U, 7U, 3U, 0U, 63U}, {4U, 7U, 3U, 0U, 62U}, {4U, 7U, 3U, 0U, 60U}, {4U, 6U, 3U, 0U, 65U}, {4U, 6U, 3U, 0U, 63U}, {4U, 6U, 3U, 0U, 61U}, {4U, 6U, 3U, 0U, 60U}, {4U, 6U, 3U, 0U, 58U}, {4U, 5U, 3U, 0U, 68U}, {4U, 5U, 3U, 0U, 66U}, {4U, 5U, 3U, 0U, 64U}, {4U, 5U, 3U, 0U, 62U}, {4U, 5U, 3U, 0U, 60U}, {4U, 5U, 3U, 0U, 59U}, {4U, 5U, 3U, 0U, 57U}, {4U, 4U, 2U, 0U, 83U}, {4U, 4U, 2U, 0U, 81U}, {4U, 4U, 2U, 0U, 78U}, {4U, 4U, 2U, 0U, 76U}, {4U, 4U, 2U, 0U, 74U}, {4U, 4U, 2U, 0U, 72U}}; static struct lpphy_tx_gain_table_entry lpphy_rev0_5ghz_tx_gain_table[128U] = { {7U, 15U, 15U, 0U, 99U}, {7U, 15U, 15U, 0U, 96U}, {7U, 15U, 15U, 0U, 93U}, {7U, 15U, 15U, 0U, 90U}, {7U, 15U, 15U, 0U, 88U}, {7U, 15U, 15U, 0U, 85U}, {7U, 15U, 15U, 0U, 83U}, {7U, 15U, 15U, 0U, 81U}, {7U, 15U, 15U, 0U, 78U}, {7U, 15U, 15U, 0U, 76U}, {7U, 15U, 15U, 0U, 74U}, {7U, 15U, 15U, 0U, 72U}, {7U, 15U, 15U, 0U, 70U}, {7U, 15U, 15U, 0U, 68U}, {7U, 15U, 15U, 0U, 66U}, {7U, 15U, 15U, 0U, 64U}, {7U, 15U, 15U, 0U, 62U}, {7U, 15U, 15U, 0U, 60U}, {7U, 15U, 15U, 0U, 59U}, {7U, 15U, 15U, 0U, 57U}, {7U, 15U, 15U, 0U, 55U}, {7U, 15U, 14U, 0U, 72U}, {7U, 15U, 14U, 0U, 70U}, {7U, 15U, 14U, 0U, 68U}, {7U, 15U, 14U, 0U, 66U}, {7U, 15U, 14U, 0U, 64U}, {7U, 15U, 14U, 0U, 62U}, {7U, 15U, 14U, 0U, 60U}, {7U, 15U, 14U, 0U, 58U}, {7U, 15U, 14U, 0U, 56U}, {7U, 15U, 14U, 0U, 55U}, {7U, 15U, 13U, 0U, 71U}, {7U, 15U, 13U, 0U, 69U}, {7U, 15U, 13U, 0U, 67U}, {7U, 15U, 13U, 0U, 65U}, {7U, 15U, 13U, 0U, 63U}, {7U, 15U, 13U, 0U, 62U}, {7U, 15U, 13U, 0U, 60U}, {7U, 15U, 13U, 0U, 58U}, {7U, 15U, 13U, 0U, 56U}, {7U, 15U, 12U, 0U, 72U}, {7U, 15U, 12U, 0U, 70U}, {7U, 15U, 12U, 0U, 68U}, {7U, 15U, 12U, 0U, 66U}, {7U, 15U, 12U, 0U, 64U}, {7U, 15U, 12U, 0U, 62U}, {7U, 15U, 12U, 0U, 60U}, {7U, 15U, 12U, 0U, 59U}, {7U, 15U, 12U, 0U, 57U}, {7U, 15U, 11U, 0U, 73U}, {7U, 15U, 11U, 0U, 71U}, {7U, 15U, 11U, 0U, 69U}, {7U, 15U, 11U, 0U, 67U}, {7U, 15U, 11U, 0U, 65U}, {7U, 15U, 11U, 0U, 63U}, {7U, 15U, 11U, 0U, 61U}, {7U, 15U, 11U, 0U, 60U}, {7U, 15U, 11U, 0U, 58U}, {7U, 15U, 10U, 0U, 71U}, {7U, 15U, 10U, 0U, 69U}, {7U, 15U, 10U, 0U, 67U}, {7U, 15U, 10U, 0U, 65U}, {7U, 15U, 10U, 0U, 63U}, {7U, 15U, 10U, 0U, 61U}, {7U, 15U, 10U, 0U, 60U}, {7U, 15U, 10U, 0U, 58U}, {7U, 15U, 9U, 0U, 70U}, {7U, 15U, 9U, 0U, 68U}, {7U, 15U, 9U, 0U, 66U}, {7U, 15U, 9U, 0U, 64U}, {7U, 15U, 9U, 0U, 62U}, {7U, 15U, 9U, 0U, 61U}, {7U, 15U, 9U, 0U, 59U}, {7U, 15U, 9U, 0U, 57U}, {7U, 15U, 9U, 0U, 56U}, {7U, 14U, 9U, 0U, 68U}, {7U, 14U, 9U, 0U, 66U}, {7U, 14U, 9U, 0U, 65U}, {7U, 14U, 9U, 0U, 63U}, {7U, 14U, 9U, 0U, 61U}, {7U, 14U, 9U, 0U, 59U}, {7U, 14U, 9U, 0U, 58U}, {7U, 13U, 9U, 0U, 70U}, {7U, 13U, 9U, 0U, 68U}, {7U, 13U, 9U, 0U, 66U}, {7U, 13U, 9U, 0U, 64U}, {7U, 13U, 9U, 0U, 63U}, {7U, 13U, 9U, 0U, 61U}, {7U, 13U, 9U, 0U, 59U}, {7U, 13U, 9U, 0U, 57U}, {7U, 13U, 8U, 0U, 70U}, {7U, 13U, 8U, 0U, 68U}, {7U, 13U, 8U, 0U, 66U}, {7U, 13U, 8U, 0U, 64U}, {7U, 13U, 8U, 0U, 62U}, {7U, 13U, 8U, 0U, 60U}, {7U, 13U, 8U, 0U, 59U}, {7U, 13U, 8U, 0U, 57U}, {7U, 12U, 8U, 0U, 70U}, {7U, 12U, 8U, 0U, 68U}, {7U, 12U, 8U, 0U, 66U}, {7U, 12U, 8U, 0U, 64U}, {7U, 12U, 8U, 0U, 62U}, {7U, 12U, 8U, 0U, 61U}, {7U, 12U, 8U, 0U, 59U}, {7U, 12U, 8U, 0U, 57U}, {7U, 12U, 7U, 0U, 70U}, {7U, 12U, 7U, 0U, 68U}, {7U, 12U, 7U, 0U, 66U}, {7U, 12U, 7U, 0U, 64U}, {7U, 12U, 7U, 0U, 62U}, {7U, 12U, 7U, 0U, 61U}, {7U, 12U, 7U, 0U, 59U}, {7U, 12U, 7U, 0U, 57U}, {7U, 11U, 7U, 0U, 70U}, {7U, 11U, 7U, 0U, 68U}, {7U, 11U, 7U, 0U, 66U}, {7U, 11U, 7U, 0U, 64U}, {7U, 11U, 7U, 0U, 62U}, {7U, 11U, 7U, 0U, 61U}, {7U, 11U, 7U, 0U, 59U}, {7U, 11U, 7U, 0U, 57U}, {7U, 11U, 6U, 0U, 69U}, {7U, 11U, 6U, 0U, 67U}, {7U, 11U, 6U, 0U, 65U}, {7U, 11U, 6U, 0U, 63U}, {7U, 11U, 6U, 0U, 62U}, {7U, 11U, 6U, 0U, 60U}}; static struct lpphy_tx_gain_table_entry lpphy_rev1_nopa_tx_gain_table[137U] = { {7U, 15U, 14U, 0U, 152U}, {7U, 15U, 14U, 0U, 147U}, {7U, 15U, 14U, 0U, 143U}, {7U, 15U, 14U, 0U, 139U}, {7U, 15U, 14U, 0U, 135U}, {7U, 15U, 14U, 0U, 131U}, {7U, 15U, 14U, 0U, 128U}, {7U, 15U, 14U, 0U, 124U}, {7U, 15U, 14U, 0U, 121U}, {7U, 15U, 14U, 0U, 117U}, {7U, 15U, 14U, 0U, 114U}, {7U, 15U, 14U, 0U, 111U}, {7U, 15U, 14U, 0U, 107U}, {7U, 15U, 14U, 0U, 104U}, {7U, 15U, 14U, 0U, 101U}, {7U, 15U, 14U, 0U, 99U}, {7U, 15U, 14U, 0U, 96U}, {7U, 15U, 14U, 0U, 93U}, {7U, 15U, 14U, 0U, 90U}, {7U, 15U, 14U, 0U, 88U}, {7U, 15U, 14U, 0U, 85U}, {7U, 15U, 14U, 0U, 83U}, {7U, 15U, 14U, 0U, 81U}, {7U, 15U, 14U, 0U, 78U}, {7U, 15U, 14U, 0U, 76U}, {7U, 15U, 14U, 0U, 74U}, {7U, 15U, 14U, 0U, 72U}, {7U, 15U, 14U, 0U, 70U}, {7U, 15U, 14U, 0U, 68U}, {7U, 15U, 14U, 0U, 66U}, {7U, 15U, 14U, 0U, 64U}, {7U, 15U, 14U, 0U, 62U}, {7U, 15U, 14U, 0U, 60U}, {7U, 15U, 14U, 0U, 59U}, {7U, 15U, 14U, 0U, 57U}, {7U, 15U, 13U, 0U, 72U}, {7U, 15U, 13U, 0U, 70U}, {7U, 15U, 14U, 0U, 68U}, {7U, 15U, 14U, 0U, 66U}, {7U, 15U, 14U, 0U, 64U}, {7U, 15U, 14U, 0U, 62U}, {7U, 15U, 14U, 0U, 60U}, {7U, 15U, 14U, 0U, 59U}, {7U, 15U, 14U, 0U, 57U}, {7U, 15U, 13U, 0U, 72U}, {7U, 15U, 13U, 0U, 70U}, {7U, 15U, 13U, 0U, 68U}, {7U, 15U, 13U, 0U, 66U}, {7U, 15U, 13U, 0U, 64U}, {7U, 15U, 13U, 0U, 62U}, {7U, 15U, 13U, 0U, 60U}, {7U, 15U, 13U, 0U, 59U}, {7U, 15U, 13U, 0U, 57U}, {7U, 15U, 12U, 0U, 71U}, {7U, 15U, 12U, 0U, 69U}, {7U, 15U, 12U, 0U, 67U}, {7U, 15U, 12U, 0U, 65U}, {7U, 15U, 12U, 0U, 63U}, {7U, 15U, 12U, 0U, 62U}, {7U, 15U, 12U, 0U, 60U}, {7U, 15U, 12U, 0U, 58U}, {7U, 15U, 12U, 0U, 57U}, {7U, 15U, 11U, 0U, 70U}, {7U, 15U, 11U, 0U, 68U}, {7U, 15U, 11U, 0U, 66U}, {7U, 15U, 11U, 0U, 65U}, {7U, 15U, 11U, 0U, 63U}, {7U, 15U, 11U, 0U, 61U}, {7U, 15U, 11U, 0U, 59U}, {7U, 15U, 11U, 0U, 58U}, {7U, 15U, 10U, 0U, 71U}, {7U, 15U, 10U, 0U, 69U}, {7U, 15U, 10U, 0U, 67U}, {7U, 15U, 10U, 0U, 65U}, {7U, 15U, 10U, 0U, 63U}, {7U, 15U, 10U, 0U, 61U}, {7U, 15U, 10U, 0U, 60U}, {7U, 15U, 10U, 0U, 58U}, {7U, 15U, 10U, 0U, 56U}, {7U, 15U, 9U, 0U, 70U}, {7U, 15U, 9U, 0U, 68U}, {7U, 15U, 9U, 0U, 66U}, {7U, 15U, 9U, 0U, 64U}, {7U, 15U, 9U, 0U, 62U}, {7U, 15U, 9U, 0U, 60U}, {7U, 15U, 9U, 0U, 59U}, {7U, 14U, 9U, 0U, 72U}, {7U, 14U, 9U, 0U, 70U}, {7U, 14U, 9U, 0U, 68U}, {7U, 14U, 9U, 0U, 66U}, {7U, 14U, 9U, 0U, 64U}, {7U, 14U, 9U, 0U, 62U}, {7U, 14U, 9U, 0U, 60U}, {7U, 14U, 9U, 0U, 59U}, {7U, 13U, 9U, 0U, 72U}, {7U, 13U, 9U, 0U, 70U}, {7U, 13U, 9U, 0U, 68U}, {7U, 13U, 9U, 0U, 66U}, {7U, 13U, 9U, 0U, 64U}, {7U, 13U, 9U, 0U, 63U}, {7U, 13U, 9U, 0U, 61U}, {7U, 13U, 9U, 0U, 59U}, {7U, 13U, 9U, 0U, 57U}, {7U, 13U, 8U, 0U, 72U}, {7U, 13U, 8U, 0U, 70U}, {7U, 13U, 8U, 0U, 68U}, {7U, 13U, 8U, 0U, 66U}, {7U, 13U, 8U, 0U, 64U}, {7U, 13U, 8U, 0U, 62U}, {7U, 13U, 8U, 0U, 60U}, {7U, 13U, 8U, 0U, 59U}, {7U, 12U, 8U, 0U, 72U}, {7U, 12U, 8U, 0U, 70U}, {7U, 12U, 8U, 0U, 68U}, {7U, 12U, 8U, 0U, 66U}, {7U, 12U, 8U, 0U, 64U}, {7U, 12U, 8U, 0U, 62U}, {7U, 12U, 8U, 0U, 61U}, {7U, 12U, 8U, 0U, 59U}, {7U, 12U, 7U, 0U, 73U}, {7U, 12U, 7U, 0U, 71U}, {7U, 12U, 7U, 0U, 69U}, {7U, 12U, 7U, 0U, 67U}, {7U, 12U, 7U, 0U, 65U}, {7U, 12U, 7U, 0U, 63U}, {7U, 12U, 7U, 0U, 61U}, {7U, 12U, 7U, 0U, 59U}, {7U, 11U, 7U, 0U, 72U}, {7U, 11U, 7U, 0U, 70U}, {7U, 11U, 7U, 0U, 68U}, {7U, 11U, 7U, 0U, 66U}, {7U, 11U, 7U, 0U, 65U}, {7U, 11U, 7U, 0U, 63U}, {7U, 11U, 7U, 0U, 61U}, {7U, 11U, 7U, 0U, 59U}, {7U, 11U, 6U, 0U, 73U}, {7U, 11U, 6U, 0U, 71U}}; static struct lpphy_tx_gain_table_entry lpphy_rev1_2ghz_tx_gain_table[128U] = { {4U, 15U, 15U, 0U, 90U}, {4U, 15U, 15U, 0U, 88U}, {4U, 15U, 15U, 0U, 85U}, {4U, 15U, 15U, 0U, 83U}, {4U, 15U, 15U, 0U, 81U}, {4U, 15U, 15U, 0U, 78U}, {4U, 15U, 15U, 0U, 76U}, {4U, 15U, 15U, 0U, 74U}, {4U, 15U, 15U, 0U, 72U}, {4U, 15U, 15U, 0U, 70U}, {4U, 15U, 15U, 0U, 68U}, {4U, 15U, 15U, 0U, 66U}, {4U, 15U, 15U, 0U, 64U}, {4U, 15U, 15U, 0U, 62U}, {4U, 15U, 15U, 0U, 60U}, {4U, 15U, 15U, 0U, 59U}, {4U, 15U, 14U, 0U, 72U}, {4U, 15U, 14U, 0U, 70U}, {4U, 15U, 14U, 0U, 68U}, {4U, 15U, 14U, 0U, 66U}, {4U, 15U, 14U, 0U, 64U}, {4U, 15U, 14U, 0U, 62U}, {4U, 15U, 14U, 0U, 60U}, {4U, 15U, 14U, 0U, 59U}, {4U, 15U, 13U, 0U, 72U}, {4U, 15U, 13U, 0U, 70U}, {4U, 15U, 13U, 0U, 68U}, {4U, 15U, 13U, 0U, 66U}, {4U, 15U, 13U, 0U, 64U}, {4U, 15U, 13U, 0U, 62U}, {4U, 15U, 13U, 0U, 60U}, {4U, 15U, 13U, 0U, 59U}, {4U, 15U, 12U, 0U, 72U}, {4U, 15U, 12U, 0U, 70U}, {4U, 15U, 12U, 0U, 68U}, {4U, 15U, 12U, 0U, 66U}, {4U, 15U, 12U, 0U, 64U}, {4U, 15U, 12U, 0U, 62U}, {4U, 15U, 12U, 0U, 60U}, {4U, 15U, 12U, 0U, 59U}, {4U, 15U, 11U, 0U, 72U}, {4U, 15U, 11U, 0U, 70U}, {4U, 15U, 11U, 0U, 68U}, {4U, 15U, 11U, 0U, 66U}, {4U, 15U, 11U, 0U, 64U}, {4U, 15U, 11U, 0U, 62U}, {4U, 15U, 11U, 0U, 60U}, {4U, 15U, 11U, 0U, 59U}, {4U, 15U, 10U, 0U, 72U}, {4U, 15U, 10U, 0U, 70U}, {4U, 15U, 10U, 0U, 68U}, {4U, 15U, 10U, 0U, 66U}, {4U, 15U, 10U, 0U, 64U}, {4U, 15U, 10U, 0U, 62U}, {4U, 15U, 10U, 0U, 60U}, {4U, 15U, 10U, 0U, 59U}, {4U, 15U, 9U, 0U, 72U}, {4U, 15U, 9U, 0U, 70U}, {4U, 15U, 9U, 0U, 68U}, {4U, 15U, 9U, 0U, 66U}, {4U, 15U, 9U, 0U, 64U}, {4U, 15U, 9U, 0U, 62U}, {4U, 15U, 9U, 0U, 60U}, {4U, 15U, 9U, 0U, 59U}, {4U, 14U, 9U, 0U, 72U}, {4U, 14U, 9U, 0U, 70U}, {4U, 14U, 9U, 0U, 68U}, {4U, 14U, 9U, 0U, 66U}, {4U, 14U, 9U, 0U, 64U}, {4U, 14U, 9U, 0U, 62U}, {4U, 14U, 9U, 0U, 60U}, {4U, 14U, 9U, 0U, 59U}, {4U, 13U, 9U, 0U, 72U}, {4U, 13U, 9U, 0U, 70U}, {4U, 13U, 9U, 0U, 68U}, {4U, 13U, 9U, 0U, 66U}, {4U, 13U, 9U, 0U, 64U}, {4U, 13U, 9U, 0U, 63U}, {4U, 13U, 9U, 0U, 61U}, {4U, 13U, 9U, 0U, 59U}, {4U, 13U, 9U, 0U, 57U}, {4U, 13U, 8U, 0U, 72U}, {4U, 13U, 8U, 0U, 70U}, {4U, 13U, 8U, 0U, 68U}, {4U, 13U, 8U, 0U, 66U}, {4U, 13U, 8U, 0U, 64U}, {4U, 13U, 8U, 0U, 62U}, {4U, 13U, 8U, 0U, 60U}, {4U, 13U, 8U, 0U, 59U}, {4U, 12U, 8U, 0U, 72U}, {4U, 12U, 8U, 0U, 70U}, {4U, 12U, 8U, 0U, 68U}, {4U, 12U, 8U, 0U, 66U}, {4U, 12U, 8U, 0U, 64U}, {4U, 12U, 8U, 0U, 62U}, {4U, 12U, 8U, 0U, 61U}, {4U, 12U, 8U, 0U, 59U}, {4U, 12U, 7U, 0U, 73U}, {4U, 12U, 7U, 0U, 71U}, {4U, 12U, 7U, 0U, 69U}, {4U, 12U, 7U, 0U, 67U}, {4U, 12U, 7U, 0U, 65U}, {4U, 12U, 7U, 0U, 63U}, {4U, 12U, 7U, 0U, 61U}, {4U, 12U, 7U, 0U, 59U}, {4U, 11U, 7U, 0U, 72U}, {4U, 11U, 7U, 0U, 70U}, {4U, 11U, 7U, 0U, 68U}, {4U, 11U, 7U, 0U, 66U}, {4U, 11U, 7U, 0U, 65U}, {4U, 11U, 7U, 0U, 63U}, {4U, 11U, 7U, 0U, 61U}, {4U, 11U, 7U, 0U, 59U}, {4U, 11U, 6U, 0U, 73U}, {4U, 11U, 6U, 0U, 71U}, {4U, 11U, 6U, 0U, 69U}, {4U, 11U, 6U, 0U, 67U}, {4U, 11U, 6U, 0U, 65U}, {4U, 11U, 6U, 0U, 63U}, {4U, 11U, 6U, 0U, 61U}, {4U, 11U, 6U, 0U, 60U}, {4U, 10U, 6U, 0U, 72U}, {4U, 10U, 6U, 0U, 70U}, {4U, 10U, 6U, 0U, 68U}, {4U, 10U, 6U, 0U, 66U}, {4U, 10U, 6U, 0U, 64U}, {4U, 10U, 6U, 0U, 62U}, {4U, 10U, 6U, 0U, 60U}}; static struct lpphy_tx_gain_table_entry lpphy_rev1_5ghz_tx_gain_table[128U] = { {7U, 15U, 15U, 0U, 99U}, {7U, 15U, 15U, 0U, 96U}, {7U, 15U, 15U, 0U, 93U}, {7U, 15U, 15U, 0U, 90U}, {7U, 15U, 15U, 0U, 88U}, {7U, 15U, 15U, 0U, 85U}, {7U, 15U, 15U, 0U, 83U}, {7U, 15U, 15U, 0U, 81U}, {7U, 15U, 15U, 0U, 78U}, {7U, 15U, 15U, 0U, 76U}, {7U, 15U, 15U, 0U, 74U}, {7U, 15U, 15U, 0U, 72U}, {7U, 15U, 15U, 0U, 70U}, {7U, 15U, 15U, 0U, 68U}, {7U, 15U, 15U, 0U, 66U}, {7U, 15U, 15U, 0U, 64U}, {7U, 15U, 15U, 0U, 62U}, {7U, 15U, 15U, 0U, 60U}, {7U, 15U, 15U, 0U, 59U}, {7U, 15U, 15U, 0U, 57U}, {7U, 15U, 15U, 0U, 55U}, {7U, 15U, 14U, 0U, 72U}, {7U, 15U, 14U, 0U, 70U}, {7U, 15U, 14U, 0U, 68U}, {7U, 15U, 14U, 0U, 66U}, {7U, 15U, 14U, 0U, 64U}, {7U, 15U, 14U, 0U, 62U}, {7U, 15U, 14U, 0U, 60U}, {7U, 15U, 14U, 0U, 58U}, {7U, 15U, 14U, 0U, 56U}, {7U, 15U, 14U, 0U, 55U}, {7U, 15U, 13U, 0U, 71U}, {7U, 15U, 13U, 0U, 69U}, {7U, 15U, 13U, 0U, 67U}, {7U, 15U, 13U, 0U, 65U}, {7U, 15U, 13U, 0U, 63U}, {7U, 15U, 13U, 0U, 62U}, {7U, 15U, 13U, 0U, 60U}, {7U, 15U, 13U, 0U, 58U}, {7U, 15U, 13U, 0U, 56U}, {7U, 15U, 12U, 0U, 72U}, {7U, 15U, 12U, 0U, 70U}, {7U, 15U, 12U, 0U, 68U}, {7U, 15U, 12U, 0U, 66U}, {7U, 15U, 12U, 0U, 64U}, {7U, 15U, 12U, 0U, 62U}, {7U, 15U, 12U, 0U, 60U}, {7U, 15U, 12U, 0U, 59U}, {7U, 15U, 12U, 0U, 57U}, {7U, 15U, 11U, 0U, 73U}, {7U, 15U, 11U, 0U, 71U}, {7U, 15U, 11U, 0U, 69U}, {7U, 15U, 11U, 0U, 67U}, {7U, 15U, 11U, 0U, 65U}, {7U, 15U, 11U, 0U, 63U}, {7U, 15U, 11U, 0U, 61U}, {7U, 15U, 11U, 0U, 60U}, {7U, 15U, 11U, 0U, 58U}, {7U, 15U, 10U, 0U, 71U}, {7U, 15U, 10U, 0U, 69U}, {7U, 15U, 10U, 0U, 67U}, {7U, 15U, 10U, 0U, 65U}, {7U, 15U, 10U, 0U, 63U}, {7U, 15U, 10U, 0U, 61U}, {7U, 15U, 10U, 0U, 60U}, {7U, 15U, 10U, 0U, 58U}, {7U, 15U, 9U, 0U, 70U}, {7U, 15U, 9U, 0U, 68U}, {7U, 15U, 9U, 0U, 66U}, {7U, 15U, 9U, 0U, 64U}, {7U, 15U, 9U, 0U, 62U}, {7U, 15U, 9U, 0U, 61U}, {7U, 15U, 9U, 0U, 59U}, {7U, 15U, 9U, 0U, 57U}, {7U, 15U, 9U, 0U, 56U}, {7U, 14U, 9U, 0U, 68U}, {7U, 14U, 9U, 0U, 66U}, {7U, 14U, 9U, 0U, 65U}, {7U, 14U, 9U, 0U, 63U}, {7U, 14U, 9U, 0U, 61U}, {7U, 14U, 9U, 0U, 59U}, {7U, 14U, 9U, 0U, 58U}, {7U, 13U, 9U, 0U, 70U}, {7U, 13U, 9U, 0U, 68U}, {7U, 13U, 9U, 0U, 66U}, {7U, 13U, 9U, 0U, 64U}, {7U, 13U, 9U, 0U, 63U}, {7U, 13U, 9U, 0U, 61U}, {7U, 13U, 9U, 0U, 59U}, {7U, 13U, 9U, 0U, 57U}, {7U, 13U, 8U, 0U, 70U}, {7U, 13U, 8U, 0U, 68U}, {7U, 13U, 8U, 0U, 66U}, {7U, 13U, 8U, 0U, 64U}, {7U, 13U, 8U, 0U, 62U}, {7U, 13U, 8U, 0U, 60U}, {7U, 13U, 8U, 0U, 59U}, {7U, 13U, 8U, 0U, 57U}, {7U, 12U, 8U, 0U, 70U}, {7U, 12U, 8U, 0U, 68U}, {7U, 12U, 8U, 0U, 66U}, {7U, 12U, 8U, 0U, 64U}, {7U, 12U, 8U, 0U, 62U}, {7U, 12U, 8U, 0U, 61U}, {7U, 12U, 8U, 0U, 59U}, {7U, 12U, 8U, 0U, 57U}, {7U, 12U, 7U, 0U, 70U}, {7U, 12U, 7U, 0U, 68U}, {7U, 12U, 7U, 0U, 66U}, {7U, 12U, 7U, 0U, 64U}, {7U, 12U, 7U, 0U, 62U}, {7U, 12U, 7U, 0U, 61U}, {7U, 12U, 7U, 0U, 59U}, {7U, 12U, 7U, 0U, 57U}, {7U, 11U, 7U, 0U, 70U}, {7U, 11U, 7U, 0U, 68U}, {7U, 11U, 7U, 0U, 66U}, {7U, 11U, 7U, 0U, 64U}, {7U, 11U, 7U, 0U, 62U}, {7U, 11U, 7U, 0U, 61U}, {7U, 11U, 7U, 0U, 59U}, {7U, 11U, 7U, 0U, 57U}, {7U, 11U, 6U, 0U, 69U}, {7U, 11U, 6U, 0U, 67U}, {7U, 11U, 6U, 0U, 65U}, {7U, 11U, 6U, 0U, 63U}, {7U, 11U, 6U, 0U, 62U}, {7U, 11U, 6U, 0U, 60U}}; static struct lpphy_tx_gain_table_entry lpphy_rev2_nopa_tx_gain_table[128U] = { {255U, 255U, 203U, 0U, 152U}, {255U, 255U, 203U, 0U, 147U}, {255U, 255U, 203U, 0U, 143U}, {255U, 255U, 203U, 0U, 139U}, {255U, 255U, 203U, 0U, 135U}, {255U, 255U, 203U, 0U, 131U}, {255U, 255U, 203U, 0U, 128U}, {255U, 255U, 203U, 0U, 124U}, {255U, 255U, 203U, 0U, 121U}, {255U, 255U, 203U, 0U, 117U}, {255U, 255U, 203U, 0U, 114U}, {255U, 255U, 203U, 0U, 111U}, {255U, 255U, 203U, 0U, 107U}, {255U, 255U, 203U, 0U, 104U}, {255U, 255U, 203U, 0U, 101U}, {255U, 255U, 203U, 0U, 99U}, {255U, 255U, 203U, 0U, 96U}, {255U, 255U, 203U, 0U, 93U}, {255U, 255U, 203U, 0U, 90U}, {255U, 255U, 203U, 0U, 88U}, {255U, 255U, 203U, 0U, 85U}, {255U, 255U, 203U, 0U, 83U}, {255U, 255U, 203U, 0U, 81U}, {255U, 255U, 203U, 0U, 78U}, {255U, 255U, 203U, 0U, 76U}, {255U, 255U, 203U, 0U, 74U}, {255U, 255U, 203U, 0U, 72U}, {255U, 255U, 203U, 0U, 70U}, {255U, 255U, 203U, 0U, 68U}, {255U, 255U, 203U, 0U, 66U}, {255U, 255U, 203U, 0U, 64U}, {255U, 255U, 197U, 0U, 64U}, {255U, 255U, 192U, 0U, 64U}, {255U, 255U, 186U, 0U, 64U}, {255U, 255U, 181U, 0U, 64U}, {255U, 255U, 176U, 0U, 64U}, {255U, 255U, 171U, 0U, 64U}, {255U, 255U, 166U, 0U, 64U}, {255U, 255U, 161U, 0U, 64U}, {255U, 255U, 157U, 0U, 64U}, {255U, 255U, 152U, 0U, 64U}, {255U, 255U, 148U, 0U, 64U}, {255U, 255U, 144U, 0U, 64U}, {255U, 255U, 140U, 0U, 64U}, {255U, 255U, 136U, 0U, 64U}, {255U, 255U, 132U, 0U, 64U}, {255U, 255U, 128U, 0U, 64U}, {255U, 255U, 124U, 0U, 64U}, {255U, 255U, 121U, 0U, 64U}, {255U, 255U, 117U, 0U, 64U}, {255U, 255U, 114U, 0U, 64U}, {255U, 255U, 111U, 0U, 64U}, {255U, 255U, 108U, 0U, 64U}, {255U, 255U, 105U, 0U, 64U}, {255U, 255U, 102U, 0U, 64U}, {255U, 255U, 99U, 0U, 64U}, {255U, 255U, 96U, 0U, 64U}, {255U, 255U, 93U, 0U, 64U}, {255U, 255U, 91U, 0U, 64U}, {255U, 255U, 88U, 0U, 64U}, {255U, 255U, 86U, 0U, 64U}, {255U, 255U, 83U, 0U, 64U}, {255U, 255U, 81U, 0U, 64U}, {255U, 255U, 79U, 0U, 64U}, {255U, 255U, 76U, 0U, 64U}, {255U, 255U, 74U, 0U, 64U}, {255U, 255U, 72U, 0U, 64U}, {255U, 255U, 70U, 0U, 64U}, {255U, 255U, 68U, 0U, 64U}, {255U, 255U, 66U, 0U, 64U}, {255U, 255U, 64U, 0U, 64U}, {255U, 248U, 64U, 0U, 64U}, {255U, 248U, 62U, 0U, 64U}, {255U, 241U, 62U, 0U, 64U}, {255U, 241U, 60U, 0U, 64U}, {255U, 234U, 60U, 0U, 64U}, {255U, 234U, 59U, 0U, 64U}, {255U, 227U, 59U, 0U, 64U}, {255U, 227U, 57U, 0U, 64U}, {255U, 221U, 57U, 0U, 64U}, {255U, 221U, 55U, 0U, 64U}, {255U, 215U, 55U, 0U, 64U}, {255U, 215U, 54U, 0U, 64U}, {255U, 208U, 54U, 0U, 64U}, {255U, 208U, 52U, 0U, 64U}, {255U, 203U, 52U, 0U, 64U}, {255U, 203U, 51U, 0U, 64U}, {255U, 197U, 51U, 0U, 64U}, {255U, 197U, 49U, 0U, 64U}, {255U, 191U, 49U, 0U, 64U}, {255U, 191U, 48U, 0U, 64U}, {255U, 186U, 48U, 0U, 64U}, {255U, 186U, 47U, 0U, 64U}, {255U, 181U, 47U, 0U, 64U}, {255U, 181U, 45U, 0U, 64U}, {255U, 175U, 45U, 0U, 64U}, {255U, 175U, 44U, 0U, 64U}, {255U, 170U, 44U, 0U, 64U}, {255U, 170U, 43U, 0U, 64U}, {255U, 166U, 43U, 0U, 64U}, {255U, 166U, 42U, 0U, 64U}, {255U, 161U, 42U, 0U, 64U}, {255U, 161U, 40U, 0U, 64U}, {255U, 156U, 40U, 0U, 64U}, {255U, 156U, 39U, 0U, 64U}, {255U, 152U, 39U, 0U, 64U}, {255U, 152U, 38U, 0U, 64U}, {255U, 148U, 38U, 0U, 64U}, {255U, 148U, 37U, 0U, 64U}, {255U, 143U, 37U, 0U, 64U}, {255U, 143U, 36U, 0U, 64U}, {255U, 139U, 36U, 0U, 64U}, {255U, 139U, 35U, 0U, 64U}, {255U, 135U, 35U, 0U, 64U}, {255U, 135U, 34U, 0U, 64U}, {255U, 132U, 34U, 0U, 64U}, {255U, 132U, 33U, 0U, 64U}, {255U, 128U, 33U, 0U, 64U}, {255U, 128U, 32U, 0U, 64U}, {255U, 124U, 32U, 0U, 64U}, {255U, 124U, 31U, 0U, 64U}, {255U, 121U, 31U, 0U, 64U}, {255U, 121U, 30U, 0U, 64U}, {255U, 117U, 30U, 0U, 64U}, {255U, 117U, 29U, 0U, 64U}, {255U, 114U, 29U, 0U, 64U}, {255U, 114U, 29U, 0U, 64U}, {255U, 111U, 29U, 0U, 64U}}; static struct lpphy_tx_gain_table_entry lpphy_rev2_2ghz_tx_gain_table[128U] = { {7U, 99U, 255U, 0U, 64U}, {7U, 96U, 255U, 0U, 64U}, {7U, 93U, 255U, 0U, 64U}, {7U, 90U, 255U, 0U, 64U}, {7U, 88U, 255U, 0U, 64U}, {7U, 85U, 255U, 0U, 64U}, {7U, 83U, 255U, 0U, 64U}, {7U, 81U, 255U, 0U, 64U}, {7U, 78U, 255U, 0U, 64U}, {7U, 76U, 255U, 0U, 64U}, {7U, 74U, 255U, 0U, 64U}, {7U, 72U, 255U, 0U, 64U}, {7U, 70U, 255U, 0U, 64U}, {7U, 68U, 255U, 0U, 64U}, {7U, 66U, 255U, 0U, 64U}, {7U, 64U, 255U, 0U, 64U}, {7U, 64U, 255U, 0U, 64U}, {7U, 62U, 255U, 0U, 64U}, {7U, 62U, 248U, 0U, 64U}, {7U, 60U, 248U, 0U, 64U}, {7U, 60U, 241U, 0U, 64U}, {7U, 59U, 241U, 0U, 64U}, {7U, 59U, 234U, 0U, 64U}, {7U, 57U, 234U, 0U, 64U}, {7U, 57U, 227U, 0U, 64U}, {7U, 55U, 227U, 0U, 64U}, {7U, 55U, 221U, 0U, 64U}, {7U, 54U, 221U, 0U, 64U}, {7U, 54U, 215U, 0U, 64U}, {7U, 52U, 215U, 0U, 64U}, {7U, 52U, 208U, 0U, 64U}, {7U, 51U, 208U, 0U, 64U}, {7U, 51U, 203U, 0U, 64U}, {7U, 49U, 203U, 0U, 64U}, {7U, 49U, 197U, 0U, 64U}, {7U, 48U, 197U, 0U, 64U}, {7U, 48U, 191U, 0U, 64U}, {7U, 47U, 191U, 0U, 64U}, {7U, 47U, 186U, 0U, 64U}, {7U, 45U, 186U, 0U, 64U}, {7U, 45U, 181U, 0U, 64U}, {7U, 44U, 181U, 0U, 64U}, {7U, 44U, 175U, 0U, 64U}, {7U, 43U, 175U, 0U, 64U}, {7U, 43U, 170U, 0U, 64U}, {7U, 42U, 170U, 0U, 64U}, {7U, 42U, 166U, 0U, 64U}, {7U, 40U, 166U, 0U, 64U}, {7U, 40U, 161U, 0U, 64U}, {7U, 39U, 161U, 0U, 64U}, {7U, 39U, 156U, 0U, 64U}, {7U, 38U, 156U, 0U, 64U}, {7U, 38U, 152U, 0U, 64U}, {7U, 37U, 152U, 0U, 64U}, {7U, 37U, 148U, 0U, 64U}, {7U, 36U, 148U, 0U, 64U}, {7U, 36U, 143U, 0U, 64U}, {7U, 35U, 143U, 0U, 64U}, {7U, 35U, 139U, 0U, 64U}, {7U, 34U, 139U, 0U, 64U}, {7U, 34U, 135U, 0U, 64U}, {7U, 33U, 135U, 0U, 64U}, {7U, 33U, 132U, 0U, 64U}, {7U, 32U, 132U, 0U, 64U}, {7U, 32U, 128U, 0U, 64U}, {7U, 31U, 128U, 0U, 64U}, {7U, 31U, 124U, 0U, 64U}, {7U, 30U, 124U, 0U, 64U}, {7U, 30U, 121U, 0U, 64U}, {7U, 29U, 121U, 0U, 64U}, {7U, 29U, 117U, 0U, 64U}, {7U, 29U, 117U, 0U, 64U}, {7U, 29U, 114U, 0U, 64U}, {7U, 28U, 114U, 0U, 64U}, {7U, 28U, 111U, 0U, 64U}, {7U, 27U, 111U, 0U, 64U}, {7U, 27U, 108U, 0U, 64U}, {7U, 26U, 108U, 0U, 64U}, {7U, 26U, 104U, 0U, 64U}, {7U, 25U, 104U, 0U, 64U}, {7U, 25U, 102U, 0U, 64U}, {7U, 25U, 102U, 0U, 64U}, {7U, 25U, 99U, 0U, 64U}, {7U, 24U, 99U, 0U, 64U}, {7U, 24U, 96U, 0U, 64U}, {7U, 23U, 96U, 0U, 64U}, {7U, 23U, 93U, 0U, 64U}, {7U, 23U, 93U, 0U, 64U}, {7U, 23U, 90U, 0U, 64U}, {7U, 22U, 90U, 0U, 64U}, {7U, 22U, 88U, 0U, 64U}, {7U, 21U, 88U, 0U, 64U}, {7U, 21U, 85U, 0U, 64U}, {7U, 21U, 85U, 0U, 64U}, {7U, 21U, 83U, 0U, 64U}, {7U, 20U, 83U, 0U, 64U}, {7U, 20U, 81U, 0U, 64U}, {7U, 20U, 81U, 0U, 64U}, {7U, 20U, 78U, 0U, 64U}, {7U, 19U, 78U, 0U, 64U}, {7U, 19U, 76U, 0U, 64U}, {7U, 19U, 76U, 0U, 64U}, {7U, 19U, 74U, 0U, 64U}, {7U, 18U, 74U, 0U, 64U}, {7U, 18U, 72U, 0U, 64U}, {7U, 18U, 72U, 0U, 64U}, {7U, 18U, 70U, 0U, 64U}, {7U, 17U, 70U, 0U, 64U}, {7U, 17U, 68U, 0U, 64U}, {7U, 17U, 68U, 0U, 64U}, {7U, 17U, 66U, 0U, 64U}, {7U, 16U, 66U, 0U, 64U}, {7U, 16U, 64U, 0U, 64U}, {7U, 16U, 64U, 0U, 64U}, {7U, 16U, 62U, 0U, 64U}, {7U, 15U, 62U, 0U, 64U}, {7U, 15U, 60U, 0U, 64U}, {7U, 15U, 60U, 0U, 64U}, {7U, 15U, 59U, 0U, 64U}, {7U, 14U, 59U, 0U, 64U}, {7U, 14U, 57U, 0U, 64U}, {7U, 14U, 57U, 0U, 64U}, {7U, 14U, 55U, 0U, 64U}, {7U, 14U, 55U, 0U, 64U}, {7U, 14U, 54U, 0U, 64U}, {7U, 13U, 54U, 0U, 64U}, {7U, 13U, 52U, 0U, 64U}, {7U, 13U, 52U, 0U, 64U}}; static struct lpphy_tx_gain_table_entry lpphy_rev2_5ghz_tx_gain_table[128U] = { {255U, 255U, 255U, 0U, 152U}, {255U, 255U, 255U, 0U, 147U}, {255U, 255U, 255U, 0U, 143U}, {255U, 255U, 255U, 0U, 139U}, {255U, 255U, 255U, 0U, 135U}, {255U, 255U, 255U, 0U, 131U}, {255U, 255U, 255U, 0U, 128U}, {255U, 255U, 255U, 0U, 124U}, {255U, 255U, 255U, 0U, 121U}, {255U, 255U, 255U, 0U, 117U}, {255U, 255U, 255U, 0U, 114U}, {255U, 255U, 255U, 0U, 111U}, {255U, 255U, 255U, 0U, 107U}, {255U, 255U, 255U, 0U, 104U}, {255U, 255U, 255U, 0U, 101U}, {255U, 255U, 255U, 0U, 99U}, {255U, 255U, 255U, 0U, 96U}, {255U, 255U, 255U, 0U, 93U}, {255U, 255U, 255U, 0U, 90U}, {255U, 255U, 255U, 0U, 88U}, {255U, 255U, 255U, 0U, 85U}, {255U, 255U, 255U, 0U, 83U}, {255U, 255U, 255U, 0U, 81U}, {255U, 255U, 255U, 0U, 78U}, {255U, 255U, 255U, 0U, 76U}, {255U, 255U, 255U, 0U, 74U}, {255U, 255U, 255U, 0U, 72U}, {255U, 255U, 255U, 0U, 70U}, {255U, 255U, 255U, 0U, 68U}, {255U, 255U, 255U, 0U, 66U}, {255U, 255U, 255U, 0U, 64U}, {255U, 255U, 248U, 0U, 64U}, {255U, 255U, 241U, 0U, 64U}, {255U, 255U, 234U, 0U, 64U}, {255U, 255U, 227U, 0U, 64U}, {255U, 255U, 221U, 0U, 64U}, {255U, 255U, 215U, 0U, 64U}, {255U, 255U, 208U, 0U, 64U}, {255U, 255U, 203U, 0U, 64U}, {255U, 255U, 197U, 0U, 64U}, {255U, 255U, 191U, 0U, 64U}, {255U, 255U, 186U, 0U, 64U}, {255U, 255U, 181U, 0U, 64U}, {255U, 255U, 175U, 0U, 64U}, {255U, 255U, 170U, 0U, 64U}, {255U, 255U, 166U, 0U, 64U}, {255U, 255U, 161U, 0U, 64U}, {255U, 255U, 156U, 0U, 64U}, {255U, 255U, 152U, 0U, 64U}, {255U, 255U, 148U, 0U, 64U}, {255U, 255U, 143U, 0U, 64U}, {255U, 255U, 139U, 0U, 64U}, {255U, 255U, 135U, 0U, 64U}, {255U, 255U, 132U, 0U, 64U}, {255U, 255U, 128U, 0U, 64U}, {255U, 255U, 124U, 0U, 64U}, {255U, 255U, 121U, 0U, 64U}, {255U, 255U, 117U, 0U, 64U}, {255U, 255U, 114U, 0U, 64U}, {255U, 255U, 111U, 0U, 64U}, {255U, 255U, 108U, 0U, 64U}, {255U, 255U, 104U, 0U, 64U}, {255U, 255U, 102U, 0U, 64U}, {255U, 255U, 99U, 0U, 64U}, {255U, 255U, 96U, 0U, 64U}, {255U, 255U, 93U, 0U, 64U}, {255U, 255U, 90U, 0U, 64U}, {255U, 255U, 88U, 0U, 64U}, {255U, 255U, 85U, 0U, 64U}, {255U, 255U, 83U, 0U, 64U}, {255U, 255U, 81U, 0U, 64U}, {255U, 255U, 78U, 0U, 64U}, {255U, 255U, 76U, 0U, 64U}, {255U, 255U, 74U, 0U, 64U}, {255U, 255U, 72U, 0U, 64U}, {255U, 255U, 70U, 0U, 64U}, {255U, 255U, 68U, 0U, 64U}, {255U, 255U, 66U, 0U, 64U}, {255U, 255U, 64U, 0U, 64U}, {255U, 255U, 64U, 0U, 64U}, {255U, 255U, 62U, 0U, 64U}, {255U, 248U, 62U, 0U, 64U}, {255U, 248U, 60U, 0U, 64U}, {255U, 241U, 60U, 0U, 64U}, {255U, 241U, 59U, 0U, 64U}, {255U, 234U, 59U, 0U, 64U}, {255U, 234U, 57U, 0U, 64U}, {255U, 227U, 57U, 0U, 64U}, {255U, 227U, 55U, 0U, 64U}, {255U, 221U, 55U, 0U, 64U}, {255U, 221U, 54U, 0U, 64U}, {255U, 215U, 54U, 0U, 64U}, {255U, 215U, 52U, 0U, 64U}, {255U, 208U, 52U, 0U, 64U}, {255U, 208U, 51U, 0U, 64U}, {255U, 203U, 51U, 0U, 64U}, {255U, 203U, 49U, 0U, 64U}, {255U, 197U, 49U, 0U, 64U}, {255U, 197U, 48U, 0U, 64U}, {255U, 191U, 48U, 0U, 64U}, {255U, 191U, 47U, 0U, 64U}, {255U, 186U, 47U, 0U, 64U}, {255U, 186U, 45U, 0U, 64U}, {255U, 181U, 45U, 0U, 64U}, {255U, 181U, 44U, 0U, 64U}, {255U, 175U, 44U, 0U, 64U}, {255U, 175U, 43U, 0U, 64U}, {255U, 170U, 43U, 0U, 64U}, {255U, 170U, 42U, 0U, 64U}, {255U, 166U, 42U, 0U, 64U}, {255U, 166U, 40U, 0U, 64U}, {255U, 161U, 40U, 0U, 64U}, {255U, 161U, 39U, 0U, 64U}, {255U, 156U, 39U, 0U, 64U}, {255U, 156U, 38U, 0U, 64U}, {255U, 152U, 38U, 0U, 64U}, {255U, 152U, 37U, 0U, 64U}, {255U, 148U, 37U, 0U, 64U}, {255U, 148U, 36U, 0U, 64U}, {255U, 143U, 36U, 0U, 64U}, {255U, 143U, 35U, 0U, 64U}, {255U, 139U, 35U, 0U, 64U}, {255U, 139U, 34U, 0U, 64U}, {255U, 135U, 34U, 0U, 64U}, {255U, 135U, 33U, 0U, 64U}, {255U, 132U, 33U, 0U, 64U}, {255U, 132U, 32U, 0U, 64U}, {255U, 128U, 32U, 0U, 64U}}; void lpphy_rev0_1_table_init(struct b43_wldev *dev ) { int __ret_warn_on ; long tmp ; { __ret_warn_on = (unsigned int )dev->phy.rev > 1U; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/tables_lpphy.c", 2272); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); b43_lptab_write_bulk(dev, 268437504U, 53U, (void const *)(& lpphy_min_sig_sq_table)); b43_lptab_write_bulk(dev, 536871936U, 40U, (void const *)(& lpphy_rev01_noise_scale_table)); b43_lptab_write_bulk(dev, 536885248U, 33U, (void const *)(& lpphy_crs_gain_nft_table)); b43_lptab_write_bulk(dev, 536879104U, 10U, (void const *)(& lpphy_rev01_filter_control_table)); b43_lptab_write_bulk(dev, 805315584U, 40U, (void const *)(& lpphy_rev01_ps_control_table)); b43_lptab_write_bulk(dev, 268441600U, 16U, (void const *)(& lpphy_pll_fraction_table)); b43_lptab_write_bulk(dev, 536870912U, 108U, (void const *)(& lpphy_iqlo_cal_table)); if ((unsigned int )dev->phy.rev == 0U) { b43_lptab_write_bulk(dev, 536884224U, 33U, (void const *)(& lpphy_rev0_ofdm_cck_gain_table)); b43_lptab_write_bulk(dev, 536883200U, 33U, (void const *)(& lpphy_rev0_ofdm_cck_gain_table)); } else { b43_lptab_write_bulk(dev, 536884224U, 33U, (void const *)(& lpphy_rev1_ofdm_cck_gain_table)); b43_lptab_write_bulk(dev, 536883200U, 33U, (void const *)(& lpphy_rev1_ofdm_cck_gain_table)); } b43_lptab_write_bulk(dev, 536886272U, 9U, (void const *)(& lpphy_gain_delta_table)); b43_lptab_write_bulk(dev, 805316608U, 576U, (void const *)(& lpphy_tx_power_control_table)); return; } } void lpphy_rev2plus_table_init(struct b43_wldev *dev ) { struct ssb_bus *bus ; int i ; int __ret_warn_on ; long tmp ; { bus = (dev->dev)->bus; __ret_warn_on = (unsigned int )dev->phy.rev <= 1U; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/tables_lpphy.c", 2310); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); i = 0; goto ldv_37198; ldv_37197: b43_lptab_write(dev, (u32 )(i | 805313536), 0U); i = i + 1; ldv_37198: ; if (i <= 703) { goto ldv_37197; } else { } b43_lptab_write_bulk(dev, 268437504U, 53U, (void const *)(& lpphy_min_sig_sq_table)); b43_lptab_write_bulk(dev, 536871936U, 53U, (void const *)(& lpphy_rev2plus_noise_scale_table)); b43_lptab_write_bulk(dev, 805317632U, 10U, (void const *)(& lpphy_rev2plus_filter_control_table)); b43_lptab_write_bulk(dev, 805318656U, 20U, (void const *)(& lpphy_rev2plus_ps_control_table)); b43_lptab_write_bulk(dev, 805319680U, 148U, (void const *)(& lpphy_gain_idx_table)); b43_lptab_write_bulk(dev, 536885248U, 26U, (void const *)(& lpphy_aux_gain_idx_table)); b43_lptab_write_bulk(dev, 536886272U, 64U, (void const *)(& lpphy_sw_control_table)); b43_lptab_write_bulk(dev, 268451840U, 16U, (void const *)(& lpphy_hf_table)); b43_lptab_write_bulk(dev, 805323776U, 68U, (void const *)(& lpphy_gain_value_table)); b43_lptab_write_bulk(dev, 536889344U, 96U, (void const *)(& lpphy_gain_table)); b43_lptab_write_bulk(dev, 268441600U, 16U, (void const *)(& lpphy_pll_fraction_table)); b43_lptab_write_bulk(dev, 536870912U, 108U, (void const *)(& lpphy_iqlo_cal_table)); b43_lptab_write_bulk(dev, 805315584U, 64U, (void const *)(& lpphy_papd_eps_table)); b43_lptab_write_bulk(dev, 805316608U, 64U, (void const *)(& lpphy_papd_mult_table)); if ((unsigned int )bus->chip_id == 17189U && (unsigned int )bus->chip_rev == 0U) { b43_lptab_write_bulk(dev, 805319680U, 64U, (void const *)(& lpphy_a0_gain_idx_table)); b43_lptab_write_bulk(dev, 536885248U, 26U, (void const *)(& lpphy_a0_aux_gain_idx_table)); b43_lptab_write_bulk(dev, 805323776U, 68U, (void const *)(& lpphy_a0_gain_value_table)); b43_lptab_write_bulk(dev, 536889344U, 96U, (void const *)(& lpphy_a0_gain_table)); } else { } return; } } static void lpphy_rev0_1_write_gain_table(struct b43_wldev *dev , int offset , struct lpphy_tx_gain_table_entry data ) { u32 tmp ; int __ret_warn_on ; long tmp___0 ; { __ret_warn_on = (unsigned int )dev->phy.rev > 1U; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/tables_lpphy.c", 2361); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); tmp = (u32 )((int )data.pad << 11); tmp = (u32 )((int )data.pga << 7) | tmp; tmp = (u32 )((int )data.gm << 4) | tmp; tmp = (u32 )data.dac | tmp; b43_lptab_write(dev, (u32 )((offset + 192) | 805316608), tmp); tmp = (u32 )((int )data.bb_mult << 20); b43_lptab_write(dev, (u32 )((offset + 320) | 805316608), tmp); return; } } static void lpphy_rev2plus_write_gain_table(struct b43_wldev *dev , int offset , struct lpphy_tx_gain_table_entry data ) { u32 tmp ; int __ret_warn_on ; long tmp___0 ; enum ieee80211_band tmp___1 ; enum ieee80211_band tmp___2 ; { __ret_warn_on = (unsigned int )dev->phy.rev <= 1U; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/tables_lpphy.c", 2377); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); tmp = (u32 )((int )data.pad << 16); tmp = (u32 )((int )data.pga << 8) | tmp; tmp = (u32 )data.gm | tmp; if ((unsigned int )dev->phy.rev > 2U) { tmp___1 = b43_current_band(dev->wl); if ((unsigned int )tmp___1 == 1U) { tmp = tmp | 268435456U; } else { tmp = tmp | 1879048192U; } } else { tmp___2 = b43_current_band(dev->wl); if ((unsigned int )tmp___2 == 1U) { tmp = tmp | 335544320U; } else { tmp = tmp | 2130706432U; } } b43_lptab_write(dev, (u32 )((offset + 192) | 805313536), tmp); tmp = (u32 )((int )data.bb_mult << 20); tmp = (u32 )((int )data.dac << 28) | tmp; b43_lptab_write(dev, (u32 )((offset + 320) | 805313536), tmp); return; } } void lpphy_write_gain_table(struct b43_wldev *dev , int offset , struct lpphy_tx_gain_table_entry data ) { { if ((unsigned int )dev->phy.rev > 1U) { lpphy_rev2plus_write_gain_table(dev, offset, data); } else { lpphy_rev0_1_write_gain_table(dev, offset, data); } return; } } void lpphy_write_gain_table_bulk(struct b43_wldev *dev , int offset , int count , struct lpphy_tx_gain_table_entry *table ) { int i ; { i = offset; goto ldv_37265; ldv_37264: lpphy_write_gain_table(dev, i, *(table + (unsigned long )i)); i = i + 1; ldv_37265: ; if (i < count) { goto ldv_37264; } else { } return; } } void lpphy_init_tx_gain_table(struct b43_wldev *dev ) { struct ssb_bus *bus ; enum ieee80211_band tmp ; enum ieee80211_band tmp___0 ; enum ieee80211_band tmp___1 ; { bus = (dev->dev)->bus; switch ((int )dev->phy.rev) { case 0: ; if ((int )bus->sprom.boardflags_hi & 1 || ((int )bus->sprom.boardflags_lo & 8192) != 0) { lpphy_write_gain_table_bulk(dev, 0, 128, (struct lpphy_tx_gain_table_entry *)(& lpphy_rev0_nopa_tx_gain_table)); } else { tmp = b43_current_band(dev->wl); if ((unsigned int )tmp == 0U) { lpphy_write_gain_table_bulk(dev, 0, 128, (struct lpphy_tx_gain_table_entry *)(& lpphy_rev0_2ghz_tx_gain_table)); } else { lpphy_write_gain_table_bulk(dev, 0, 128, (struct lpphy_tx_gain_table_entry *)(& lpphy_rev0_5ghz_tx_gain_table)); } } goto ldv_37272; case 1: ; if ((int )bus->sprom.boardflags_hi & 1 || ((int )bus->sprom.boardflags_lo & 8192) != 0) { lpphy_write_gain_table_bulk(dev, 0, 128, (struct lpphy_tx_gain_table_entry *)(& lpphy_rev1_nopa_tx_gain_table)); } else { tmp___0 = b43_current_band(dev->wl); if ((unsigned int )tmp___0 == 0U) { lpphy_write_gain_table_bulk(dev, 0, 128, (struct lpphy_tx_gain_table_entry *)(& lpphy_rev1_2ghz_tx_gain_table)); } else { lpphy_write_gain_table_bulk(dev, 0, 128, (struct lpphy_tx_gain_table_entry *)(& lpphy_rev1_5ghz_tx_gain_table)); } } goto ldv_37272; default: ; if ((int )bus->sprom.boardflags_hi & 1) { lpphy_write_gain_table_bulk(dev, 0, 128, (struct lpphy_tx_gain_table_entry *)(& lpphy_rev2_nopa_tx_gain_table)); } else { tmp___1 = b43_current_band(dev->wl); if ((unsigned int )tmp___1 == 0U) { lpphy_write_gain_table_bulk(dev, 0, 128, (struct lpphy_tx_gain_table_entry *)(& lpphy_rev2_2ghz_tx_gain_table)); } else { lpphy_write_gain_table_bulk(dev, 0, 128, (struct lpphy_tx_gain_table_entry *)(& lpphy_rev2_5ghz_tx_gain_table)); } } } ldv_37272: ; return; } } int ldv_del_timer_sync_45(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type ldv_func_res ; int tmp ; { tmp = del_timer_sync(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_9(ldv_func_arg1); return (ldv_func_res); } } int ldv_del_timer_46(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___0 ldv_func_res ; int tmp ; { tmp = del_timer(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_9(ldv_func_arg1); return (ldv_func_res); } } int ldv_request_threaded_irq_47(unsigned int ldv_func_arg1 , irqreturn_t (*handler)(int , void * ) , irqreturn_t (*thread_fn)(int , void * ) , unsigned long ldv_func_arg4 , char const *ldv_func_arg5 , void *ldv_func_arg6 ) { ldv_func_ret_type___1 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = request_threaded_irq(ldv_func_arg1, handler, thread_fn, ldv_func_arg4, ldv_func_arg5, ldv_func_arg6); ldv_func_res = tmp; tmp___0 = reg_check_2(handler, thread_fn); if (tmp___0 != 0 && ldv_func_res >= 0) { activate_suitable_irq_2((int )ldv_func_arg1, ldv_func_arg6); } else { } return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; extern long simple_strtol(char const * , char ** , unsigned int ) ; int ldv_del_timer_52(struct timer_list *ldv_func_arg1 ) ; int ldv_del_timer_sync_51(struct timer_list *ldv_func_arg1 ) ; extern int capable(int ) ; int ldv_request_threaded_irq_53(unsigned int ldv_func_arg1 , irqreturn_t (*handler)(int , void * ) , irqreturn_t (*thread_fn)(int , void * ) , unsigned long ldv_func_arg4 , char const *ldv_func_arg5 , void *ldv_func_arg6 ) ; extern int device_create_file(struct device * , struct device_attribute const * ) ; extern void device_remove_file(struct device * , struct device_attribute const * ) ; __inline static struct ssb_device *dev_to_ssb_dev(struct device *dev ) { struct __ssb_dev_wrapper *wrap ; struct device const *__mptr ; { __mptr = (struct device const *)dev; wrap = (struct __ssb_dev_wrapper *)__mptr; return (wrap->sdev); } } __inline static struct b43_wldev *dev_to_b43_wldev(struct device *dev ) { struct ssb_device *ssb_dev ; struct ssb_device *tmp ; void *tmp___0 ; { tmp = dev_to_ssb_dev(dev); ssb_dev = tmp; tmp___0 = ssb_get_drvdata(ssb_dev); return ((struct b43_wldev *)tmp___0); } } int b43_sysfs_register(struct b43_wldev *wldev ) ; void b43_sysfs_unregister(struct b43_wldev *wldev ) ; static int get_integer(char const *buf , size_t count ) { char tmp[11U] ; unsigned int tmp___0 ; int ret ; size_t _min1 ; unsigned long _min2 ; size_t __len ; void *__ret ; long tmp___1 ; { tmp[0] = 0; tmp___0 = 1U; while (1) { if (tmp___0 >= 11U) { break; } else { } tmp[tmp___0] = (char)0; tmp___0 = tmp___0 + 1U; } ret = -22; if (count == 0UL) { goto out; } else { } _min1 = count; _min2 = 10UL; count = _min1 < _min2 ? _min1 : _min2; __len = count; __ret = __builtin_memcpy((void *)(& tmp), (void const *)buf, __len); tmp___1 = simple_strtol((char const *)(& tmp), (char **)0, 10U); ret = (int )tmp___1; out: ; return (ret); } } static ssize_t b43_attr_interfmode_show(struct device *dev , struct device_attribute *attr , char *buf ) { struct b43_wldev *wldev ; struct b43_wldev *tmp ; ssize_t count ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int __ret_warn_on ; long tmp___4 ; { tmp = dev_to_b43_wldev(dev); wldev = tmp; count = 0L; tmp___0 = capable(12); if (tmp___0 == 0) { return (-1L); } else { } mutex_lock_nested(& (wldev->wl)->mutex, 0U); if ((unsigned int )wldev->phy.type != 2U) { mutex_unlock(& (wldev->wl)->mutex); return (-38L); } else { } switch ((wldev->phy.__annonCompField40.g)->interfmode) { case 0: tmp___1 = snprintf(buf, 4096UL, "0 (No Interference Mitigation)\n"); count = (ssize_t )tmp___1; goto ldv_37037; case 1: tmp___2 = snprintf(buf, 4096UL, "1 (Non-WLAN Interference Mitigation)\n"); count = (ssize_t )tmp___2; goto ldv_37037; case 2: tmp___3 = snprintf(buf, 4096UL, "2 (WLAN Interference Mitigation)\n"); count = (ssize_t )tmp___3; goto ldv_37037; default: __ret_warn_on = 1; tmp___4 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___4 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/sysfs.c", 84); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); } ldv_37037: mutex_unlock(& (wldev->wl)->mutex); return (count); } } static ssize_t b43_attr_interfmode_store(struct device *dev , struct device_attribute *attr , char const *buf , size_t count ) { struct b43_wldev *wldev ; struct b43_wldev *tmp ; int err ; int mode ; int tmp___0 ; { tmp = dev_to_b43_wldev(dev); wldev = tmp; tmp___0 = capable(12); if (tmp___0 == 0) { return (-1L); } else { } mode = get_integer(buf, count); switch (mode) { case 0: mode = 0; goto ldv_37053; case 1: mode = 1; goto ldv_37053; case 2: mode = 2; goto ldv_37053; case 3: mode = 3; goto ldv_37053; default: ; return (-22L); } ldv_37053: mutex_lock_nested(& (wldev->wl)->mutex, 0U); if ((unsigned long )(wldev->phy.ops)->interf_mitigation != (unsigned long )((int (*/* const */)(struct b43_wldev * , enum b43_interference_mitigation ))0)) { err = (*((wldev->phy.ops)->interf_mitigation))(wldev, (enum b43_interference_mitigation )mode); if (err != 0) { b43err(wldev->wl, "Interference Mitigation not supported by device\n"); } else { } } else { err = -38; } __asm__ volatile ("": : : "memory"); mutex_unlock(& (wldev->wl)->mutex); return ((ssize_t )(err != 0 ? (size_t )err : count)); } } static struct device_attribute dev_attr_interference = {{"interference", 420U, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & b43_attr_interfmode_show, & b43_attr_interfmode_store}; int b43_sysfs_register(struct b43_wldev *wldev ) { struct device *dev ; int __ret_warn_on ; int tmp ; long tmp___0 ; int tmp___1 ; { dev = (wldev->dev)->dev; tmp = atomic_read((atomic_t const *)(& wldev->__init_status)); __ret_warn_on = tmp != 1; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/sysfs.c", 145); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); tmp___1 = device_create_file(dev, (struct device_attribute const *)(& dev_attr_interference)); return (tmp___1); } } void b43_sysfs_unregister(struct b43_wldev *wldev ) { struct device *dev ; { dev = (wldev->dev)->dev; device_remove_file(dev, (struct device_attribute const *)(& dev_attr_interference)); return; } } void ldv_initialize_device_attribute_25(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(48UL); dev_attr_interference_group0 = (struct device_attribute *)tmp; tmp___0 = ldv_init_zalloc(1024UL); dev_attr_interference_group1 = (struct device *)tmp___0; return; } } void ldv_main_exported_25(void) { size_t ldvarg103 ; char *ldvarg102 ; void *tmp ; char *ldvarg104 ; void *tmp___0 ; int tmp___1 ; { tmp = ldv_init_zalloc(1UL); ldvarg102 = (char *)tmp; tmp___0 = ldv_init_zalloc(1UL); ldvarg104 = (char *)tmp___0; ldv_memset((void *)(& ldvarg103), 0, 8UL); tmp___1 = __VERIFIER_nondet_int(); switch (tmp___1) { case 0: ; if (ldv_state_variable_25 == 1) { b43_attr_interfmode_store(dev_attr_interference_group1, dev_attr_interference_group0, (char const *)ldvarg104, ldvarg103); ldv_state_variable_25 = 1; } else { } goto ldv_37079; case 1: ; if (ldv_state_variable_25 == 1) { b43_attr_interfmode_show(dev_attr_interference_group1, dev_attr_interference_group0, ldvarg102); ldv_state_variable_25 = 1; } else { } goto ldv_37079; default: ldv_stop(); } ldv_37079: ; return; } } int ldv_del_timer_sync_51(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type ldv_func_res ; int tmp ; { tmp = del_timer_sync(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_9(ldv_func_arg1); return (ldv_func_res); } } int ldv_del_timer_52(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___0 ldv_func_res ; int tmp ; { tmp = del_timer(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_9(ldv_func_arg1); return (ldv_func_res); } } int ldv_request_threaded_irq_53(unsigned int ldv_func_arg1 , irqreturn_t (*handler)(int , void * ) , irqreturn_t (*thread_fn)(int , void * ) , unsigned long ldv_func_arg4 , char const *ldv_func_arg5 , void *ldv_func_arg6 ) { ldv_func_ret_type___1 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = request_threaded_irq(ldv_func_arg1, handler, thread_fn, ldv_func_arg4, ldv_func_arg5, ldv_func_arg6); ldv_func_res = tmp; tmp___0 = reg_check_2(handler, thread_fn); if (tmp___0 != 0 && ldv_func_res >= 0) { activate_suitable_irq_2((int )ldv_func_arg1, ldv_func_arg6); } else { } return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; extern void local_bh_disable(void) ; extern void local_bh_enable(void) ; int ldv_del_timer_58(struct timer_list *ldv_func_arg1 ) ; int ldv_del_timer_sync_57(struct timer_list *ldv_func_arg1 ) ; int ldv_request_threaded_irq_59(unsigned int ldv_func_arg1 , irqreturn_t (*handler)(int , void * ) , irqreturn_t (*thread_fn)(int , void * ) , unsigned long ldv_func_arg4 , char const *ldv_func_arg5 , void *ldv_func_arg6 ) ; extern unsigned char *skb_pull(struct sk_buff * , unsigned int ) ; __inline static int ieee80211_is_beacon(__le16 fc ) { { return (((int )fc & 252) == 128); } } extern unsigned int ieee80211_hdrlen(__le16 ) ; __inline static struct ieee80211_rx_status *IEEE80211_SKB_RXCB(struct sk_buff *skb ) { { return ((struct ieee80211_rx_status *)(& skb->cb)); } } __inline static void ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info ) { int i ; { i = 0; goto ldv_35628; ldv_35627: info->__annonCompField39.status.rates[i].count = 0U; i = i + 1; ldv_35628: ; if (i <= 4) { goto ldv_35627; } else { } memset((void *)(& info->__annonCompField39.status.ampdu_ack_len), 0, 25UL); return; } } __inline static struct ieee80211_rate *ieee80211_get_rts_cts_rate(struct ieee80211_hw const *hw , struct ieee80211_tx_info const *c ) { { if ((int )((signed char )c->__annonCompField39.control.__annonCompField37.__annonCompField36.rts_cts_rate_idx) < 0) { return ((struct ieee80211_rate *)0); } else { } return (((hw->wiphy)->bands[(int )c->band])->bitrates + (unsigned long )c->__annonCompField39.control.__annonCompField37.__annonCompField36.rts_cts_rate_idx); } } __inline static struct ieee80211_rate *ieee80211_get_alt_retry_rate(struct ieee80211_hw const *hw , struct ieee80211_tx_info const *c , int idx ) { { if ((int )((signed char )c->__annonCompField39.control.__annonCompField37.__annonCompField36.rates[idx + 1].idx) < 0) { return ((struct ieee80211_rate *)0); } else { } return (((hw->wiphy)->bands[(int )c->band])->bitrates + (unsigned long )c->__annonCompField39.control.__annonCompField37.__annonCompField36.rates[idx + 1].idx); } } extern void ieee80211_rx(struct ieee80211_hw * , struct sk_buff * ) ; __inline static void ieee80211_rx_ni(struct ieee80211_hw *hw , struct sk_buff *skb ) { { local_bh_disable(); ieee80211_rx(hw, skb); local_bh_enable(); return; } } extern void ieee80211_rts_get(struct ieee80211_hw * , struct ieee80211_vif * , void const * , size_t , struct ieee80211_tx_info const * , struct ieee80211_rts * ) ; extern void ieee80211_ctstoself_get(struct ieee80211_hw * , struct ieee80211_vif * , void const * , size_t , struct ieee80211_tx_info const * , struct ieee80211_cts * ) ; extern __le16 ieee80211_generic_frame_duration(struct ieee80211_hw * , struct ieee80211_vif * , size_t , struct ieee80211_rate * ) ; extern void ieee80211_get_tkip_key(struct ieee80211_key_conf * , struct sk_buff * , enum ieee80211_tkip_key_type , u8 * ) ; void b43_debugfs_log_txstat(struct b43_wldev *dev , struct b43_txstatus const *status ) ; __inline static u8 b43_freq_to_channel_5ghz(int freq ) { { return ((u8 )((freq + -5000) / 5)); } } __inline static u8 b43_freq_to_channel_2ghz(int freq ) { u8 channel ; { if (freq == 2484) { channel = 14U; } else { channel = (u8 )((freq + -2407) / 5); } return (channel); } } __inline static int b43_channel_to_freq_5ghz(u8 channel ) { { return ((int )channel * 5 + 5000); } } __inline static int b43_is_ofdm_rate(int rate ) { int tmp ; { tmp = b43_is_cck_rate(rate); return (tmp == 0); } } int b43_generate_txhdr(struct b43_wldev *dev , u8 *_txhdr , struct sk_buff *skb_frag , struct ieee80211_tx_info *info , u16 cookie ) ; void b43_rx(struct b43_wldev *dev , struct sk_buff *skb , void const *_rxhdr ) ; bool b43_fill_txstatus_report(struct b43_wldev *dev , struct ieee80211_tx_info *report , struct b43_txstatus const *status ) ; void b43_tx_suspend(struct b43_wldev *dev ) ; void b43_tx_resume(struct b43_wldev *dev ) ; __inline static u8 b43_kidx_to_raw(struct b43_wldev *dev , u8 firmware_kidx ) { u8 raw_kidx ; int tmp ; { tmp = b43_new_kidx_api(dev); if (tmp != 0) { raw_kidx = firmware_kidx; } else { raw_kidx = (unsigned int )firmware_kidx + 4U; } return (raw_kidx); } } void b43_dma_tx_suspend(struct b43_wldev *dev ) ; void b43_dma_tx_resume(struct b43_wldev *dev ) ; void b43_dma_handle_txstatus(struct b43_wldev *dev , struct b43_txstatus const *status ) ; void b43_pio_handle_txstatus(struct b43_wldev *dev , struct b43_txstatus const *status ) ; void b43_pio_tx_suspend(struct b43_wldev *dev ) ; void b43_pio_tx_resume(struct b43_wldev *dev ) ; static int b43_plcp_get_bitrate_idx_cck(struct b43_plcp_hdr6 *plcp ) { { switch ((int )plcp->__annonCompField43.raw[0]) { case 10: ; return (0); case 20: ; return (1); case 55: ; return (2); case 110: ; return (3); } return (-1); } } static int b43_plcp_get_bitrate_idx_ofdm(struct b43_plcp_hdr6 *plcp , bool aphy ) { int base ; { base = (int )aphy ? 0 : 4; switch ((int )plcp->__annonCompField43.raw[0] & 15) { case 11: ; return (base); case 15: ; return (base + 1); case 10: ; return (base + 2); case 14: ; return (base + 3); case 9: ; return (base + 4); case 13: ; return (base + 5); case 8: ; return (base + 6); case 12: ; return (base + 7); } return (-1); } } u8 b43_plcp_get_ratecode_cck(u8 const bitrate ) { int __ret_warn_on ; long tmp ; { switch ((int )bitrate) { case 2: ; return (10U); case 4: ; return (20U); case 11: ; return (55U); case 22: ; return (110U); } __ret_warn_on = 1; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/xmit.c", 90); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); return (0U); } } u8 b43_plcp_get_ratecode_ofdm(u8 const bitrate ) { int __ret_warn_on ; long tmp ; { switch ((int )bitrate) { case 12: ; return (11U); case 18: ; return (15U); case 24: ; return (10U); case 36: ; return (14U); case 48: ; return (9U); case 72: ; return (13U); case 96: ; return (8U); case 108: ; return (12U); } __ret_warn_on = 1; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/xmit.c", 114); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); return (0U); } } void b43_generate_plcp_hdr(struct b43_plcp_hdr4 *plcp , u16 const octets , u8 const bitrate ) { __u8 *raw ; u32 d ; u8 tmp ; int __ret_warn_on ; long tmp___0 ; u32 plen ; int tmp___1 ; { raw = (__u8 *)(& plcp->__annonCompField43.raw); tmp___1 = b43_is_ofdm_rate((int )bitrate); if (tmp___1 != 0) { tmp = b43_plcp_get_ratecode_ofdm((int )bitrate); d = (u32 )tmp; __ret_warn_on = ((int )octets & 61440) != 0; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/xmit.c", 127); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); d = (u32 )((int )octets << 5) | d; plcp->__annonCompField43.data = d; } else { plen = (u32 )(((int )octets * 16) / (int )bitrate); if (((int )octets * 16) % (int )bitrate > 0) { plen = plen + 1U; if ((unsigned int )((unsigned char )bitrate) == 22U && ((int )octets * 8) % 11 <= 3) { *(raw + 1UL) = 132U; } else { *(raw + 1UL) = 4U; } } else { *(raw + 1UL) = 4U; } plcp->__annonCompField43.data = plcp->__annonCompField43.data | (plen << 16); *raw = b43_plcp_get_ratecode_cck((int )bitrate); } return; } } static u8 b43_calc_fallback_rate(u8 bitrate ) { int __ret_warn_on ; long tmp ; { switch ((int )bitrate) { case 2: ; return (2U); case 4: ; return (2U); case 11: ; return (4U); case 22: ; return (11U); case 12: ; return (11U); case 18: ; return (12U); case 24: ; return (18U); case 36: ; return (24U); case 48: ; return (36U); case 72: ; return (48U); case 96: ; return (72U); case 108: ; return (96U); } __ret_warn_on = 1; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/xmit.c", 176); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); return (0U); } } int b43_generate_txhdr(struct b43_wldev *dev , u8 *_txhdr , struct sk_buff *skb_frag , struct ieee80211_tx_info *info , u16 cookie ) { unsigned char const *fragment_data ; unsigned int fragment_len ; struct b43_txhdr *txhdr ; struct b43_phy const *phy ; struct ieee80211_hdr const *wlhdr ; int use_encryption ; __le16 fctl ; struct ieee80211_rate *fbrate ; u8 rate ; u8 rate_fb ; int rate_ofdm ; int rate_fb_ofdm ; unsigned int plcp_fragment_len ; u32 mac_ctl ; u16 phy_ctl ; u8 extra_ft ; struct ieee80211_rate *txrate ; struct ieee80211_tx_rate *rates ; struct ieee80211_rate *tmp ; size_t __len ; void *__ret ; u8 key_idx ; struct b43_key *key ; int wlhdr_len ; size_t iv_len ; int __ret_warn_on ; long tmp___0 ; long tmp___1 ; unsigned int tmp___2 ; u16 phase1key[5U] ; int i ; size_t __len___0 ; void *__ret___0 ; unsigned long _min1 ; unsigned long _min2 ; size_t __len___1 ; void *__ret___1 ; bool tmp___3 ; u8 tmp___4 ; int __ret_warn_on___0 ; long tmp___5 ; unsigned int len ; struct ieee80211_hdr *hdr ; int rts_rate ; int rts_rate_fb ; int rts_rate_ofdm ; int rts_rate_fb_ofdm ; struct b43_plcp_hdr6 *plcp ; struct ieee80211_rate *rts_cts_rate ; u8 tmp___6 ; struct ieee80211_cts *cts ; bool tmp___7 ; struct ieee80211_rts *rts ; bool tmp___8 ; bool tmp___9 ; bool tmp___10 ; bool tmp___11 ; { fragment_data = (unsigned char const *)skb_frag->data; fragment_len = skb_frag->len; txhdr = (struct b43_txhdr *)_txhdr; phy = (struct b43_phy const *)(& dev->phy); wlhdr = (struct ieee80211_hdr const *)fragment_data; use_encryption = (unsigned long )info->__annonCompField39.control.hw_key != (unsigned long )((struct ieee80211_key_conf *)0); fctl = wlhdr->frame_control; mac_ctl = 0U; phy_ctl = 0U; extra_ft = 0U; memset((void *)txhdr, 0, 110UL); txrate = ieee80211_get_tx_rate((struct ieee80211_hw const *)(dev->wl)->hw, (struct ieee80211_tx_info const *)info); rate = (unsigned long )txrate != (unsigned long )((struct ieee80211_rate *)0) ? (u8 )txrate->hw_value : 2U; rate_ofdm = b43_is_ofdm_rate((int )rate); tmp = ieee80211_get_alt_retry_rate((struct ieee80211_hw const *)(dev->wl)->hw, (struct ieee80211_tx_info const *)info, 0); fbrate = (unsigned long )tmp != (unsigned long )((struct ieee80211_rate *)0) ? (unsigned long )tmp != (unsigned long )((struct ieee80211_rate *)0) : txrate; rate_fb = (u8 )fbrate->hw_value; rate_fb_ofdm = b43_is_ofdm_rate((int )rate_fb); if (rate_ofdm != 0) { txhdr->phy_rate = b43_plcp_get_ratecode_ofdm((int )rate); } else { txhdr->phy_rate = b43_plcp_get_ratecode_cck((int )rate); } txhdr->mac_frame_ctl = wlhdr->frame_control; __len = 6UL; if (__len > 63UL) { __ret = memcpy((void *)(& txhdr->tx_receiver), (void const *)(& wlhdr->addr1), __len); } else { __ret = __builtin_memcpy((void *)(& txhdr->tx_receiver), (void const *)(& wlhdr->addr1), __len); } if (((int )rate_fb == (int )rate || (int )((short )wlhdr->duration_id) < 0) || (unsigned int )((unsigned short )wlhdr->duration_id) == 0U) { txhdr->dur_fb = wlhdr->duration_id; } else { txhdr->dur_fb = ieee80211_generic_frame_duration((dev->wl)->hw, info->__annonCompField39.control.vif, (size_t )fragment_len, fbrate); } plcp_fragment_len = fragment_len + 4U; if (use_encryption != 0) { key_idx = (info->__annonCompField39.control.hw_key)->hw_key_idx; __ret_warn_on = (unsigned int )key_idx > 57U; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/xmit.c", 241); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); key = (struct b43_key *)(& dev->key) + (unsigned long )key_idx; tmp___1 = ldv__builtin_expect((unsigned long )key->keyconf == (unsigned long )((struct ieee80211_key_conf *)0), 0L); if (tmp___1 != 0L) { return (-126); } else { } plcp_fragment_len = (unsigned int )(info->__annonCompField39.control.hw_key)->icv_len + plcp_fragment_len; key_idx = b43_kidx_to_fw(dev, (int )key_idx); mac_ctl = ((u32 )((int )key_idx << 20) & 267386880U) | mac_ctl; mac_ctl = ((u32 )((int )key->algorithm << 16) & 458752U) | mac_ctl; tmp___2 = ieee80211_hdrlen((int )fctl); wlhdr_len = (int )tmp___2; if ((unsigned int )key->algorithm == 2U) { ieee80211_get_tkip_key(info->__annonCompField39.control.hw_key, skb_frag, 0, (u8 *)(& phase1key)); i = 0; goto ldv_37435; ldv_37434: txhdr->iv[i * 2] = (__u8 )phase1key[i]; txhdr->iv[i * 2 + 1] = (__u8 )((int )phase1key[i] >> 8); i = i + 1; ldv_37435: ; if (i <= 4) { goto ldv_37434; } else { } __len___0 = 3UL; if (__len___0 > 63UL) { __ret___0 = memcpy((void *)(& txhdr->iv) + 10U, (void const *)wlhdr + (unsigned long )wlhdr_len, __len___0); } else { __ret___0 = __builtin_memcpy((void *)(& txhdr->iv) + 10U, (void const *)wlhdr + (unsigned long )wlhdr_len, __len___0); } } else { _min1 = (unsigned long )(info->__annonCompField39.control.hw_key)->iv_len; _min2 = 16UL; iv_len = _min1 < _min2 ? _min1 : _min2; __len___1 = iv_len; __ret___1 = __builtin_memcpy((void *)(& txhdr->iv), (void const *)wlhdr + (unsigned long )wlhdr_len, __len___1); } } else { } tmp___3 = b43_is_old_txhdr_format(dev); if ((int )tmp___3) { b43_generate_plcp_hdr((struct b43_plcp_hdr4 *)(& txhdr->__annonCompField44.old_format.plcp), (int )((u16 const )plcp_fragment_len), (int )rate); } else { b43_generate_plcp_hdr((struct b43_plcp_hdr4 *)(& txhdr->__annonCompField44.new_format.plcp), (int )((u16 const )plcp_fragment_len), (int )rate); } b43_generate_plcp_hdr((struct b43_plcp_hdr4 *)(& txhdr->plcp_fb), (int )((u16 const )plcp_fragment_len), (int )rate_fb); if (rate_fb_ofdm != 0) { extra_ft = (u8 )((unsigned int )extra_ft | 1U); } else { extra_ft = extra_ft; } txhdr->chan_radio_code = (__u8 )phy->channel; if (rate_ofdm != 0) { phy_ctl = (u16 )((unsigned int )phy_ctl | 1U); } else { phy_ctl = phy_ctl; } if (((int )info->__annonCompField39.control.__annonCompField37.__annonCompField36.rates[0].flags & 4) != 0) { phy_ctl = (u16 )((unsigned int )phy_ctl | 16U); } else { } tmp___4 = b43_ieee80211_antenna_sanitize(dev, (int )info->antenna_sel_tx); switch ((int )tmp___4) { case 0: phy_ctl = (u16 )((unsigned int )phy_ctl | 192U); goto ldv_37451; case 1: phy_ctl = phy_ctl; goto ldv_37451; case 2: phy_ctl = (u16 )((unsigned int )phy_ctl | 64U); goto ldv_37451; case 3: phy_ctl = (u16 )((unsigned int )phy_ctl | 256U); goto ldv_37451; case 4: phy_ctl = (u16 )((unsigned int )phy_ctl | 512U); goto ldv_37451; default: __ret_warn_on___0 = 1; tmp___5 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___5 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/xmit.c", 330); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); } ldv_37451: rates = (struct ieee80211_tx_rate *)(& info->__annonCompField39.control.__annonCompField37.__annonCompField36.rates); if ((info->flags & 4U) == 0U) { mac_ctl = mac_ctl | 1U; } else { } if ((info->flags & 2U) != 0U) { mac_ctl = mac_ctl | 16U; } else { } if ((info->flags & 16U) != 0U) { mac_ctl = mac_ctl | 8U; } else { } if ((unsigned int )((unsigned char )phy->type) == 0U) { mac_ctl = mac_ctl | 128U; } else { } if ((int )rates->flags & 1 || (int )rates->count <= (int )((dev->wl)->hw)->conf.long_frame_max_tx_count) { rates->count = ((dev->wl)->hw)->conf.long_frame_max_tx_count; mac_ctl = mac_ctl | 2U; } else { rates->count = ((dev->wl)->hw)->conf.short_frame_max_tx_count; } if ((int )rates->flags & 1 || ((int )rates->flags & 2) != 0) { rts_cts_rate = ieee80211_get_rts_cts_rate((struct ieee80211_hw const *)(dev->wl)->hw, (struct ieee80211_tx_info const *)info); rts_rate = (unsigned long )rts_cts_rate != (unsigned long )((struct ieee80211_rate *)0) ? (int )rts_cts_rate->hw_value : 2; rts_rate_ofdm = b43_is_ofdm_rate(rts_rate); tmp___6 = b43_calc_fallback_rate((int )((u8 )rts_rate)); rts_rate_fb = (int )tmp___6; rts_rate_fb_ofdm = b43_is_ofdm_rate(rts_rate_fb); if (((int )rates->flags & 2) != 0) { tmp___7 = b43_is_old_txhdr_format(dev); if ((int )tmp___7) { cts = (struct ieee80211_cts *)(& txhdr->__annonCompField44.old_format.rts_frame); } else { cts = (struct ieee80211_cts *)(& txhdr->__annonCompField44.new_format.rts_frame); } ieee80211_ctstoself_get((dev->wl)->hw, info->__annonCompField39.control.vif, (void const *)fragment_data, (size_t )fragment_len, (struct ieee80211_tx_info const *)info, cts); mac_ctl = mac_ctl | 2048U; len = 10U; } else { tmp___8 = b43_is_old_txhdr_format(dev); if ((int )tmp___8) { rts = (struct ieee80211_rts *)(& txhdr->__annonCompField44.old_format.rts_frame); } else { rts = (struct ieee80211_rts *)(& txhdr->__annonCompField44.new_format.rts_frame); } ieee80211_rts_get((dev->wl)->hw, info->__annonCompField39.control.vif, (void const *)fragment_data, (size_t )fragment_len, (struct ieee80211_tx_info const *)info, rts); mac_ctl = mac_ctl | 4U; len = 16U; } len = len + 4U; tmp___9 = b43_is_old_txhdr_format(dev); if ((int )tmp___9) { plcp = & txhdr->__annonCompField44.old_format.rts_plcp; } else { plcp = & txhdr->__annonCompField44.new_format.rts_plcp; } b43_generate_plcp_hdr((struct b43_plcp_hdr4 *)plcp, (int )((u16 const )len), (int )((u8 const )rts_rate)); plcp = & txhdr->rts_plcp_fb; b43_generate_plcp_hdr((struct b43_plcp_hdr4 *)plcp, (int )((u16 const )len), (int )((u8 const )rts_rate_fb)); tmp___10 = b43_is_old_txhdr_format(dev); if ((int )tmp___10) { hdr = (struct ieee80211_hdr *)(& txhdr->__annonCompField44.old_format.rts_frame); } else { hdr = (struct ieee80211_hdr *)(& txhdr->__annonCompField44.new_format.rts_frame); } txhdr->rts_dur_fb = hdr->duration_id; if (rts_rate_ofdm != 0) { extra_ft = (u8 )((unsigned int )extra_ft | 4U); txhdr->phy_rate_rts = b43_plcp_get_ratecode_ofdm((int )((u8 const )rts_rate)); } else { extra_ft = extra_ft; txhdr->phy_rate_rts = b43_plcp_get_ratecode_cck((int )((u8 const )rts_rate)); } if (rts_rate_fb_ofdm != 0) { extra_ft = (u8 )((unsigned int )extra_ft | 16U); } else { extra_ft = extra_ft; } } else { } tmp___11 = b43_is_old_txhdr_format(dev); if ((int )tmp___11) { txhdr->__annonCompField44.old_format.cookie = cookie; } else { txhdr->__annonCompField44.new_format.cookie = cookie; } txhdr->mac_ctl = mac_ctl; txhdr->phy_ctl = phy_ctl; txhdr->extra_ft = extra_ft; return (0); } } static s8 b43_rssi_postprocess(struct b43_wldev *dev , u8 in_rssi , int ofdm , int adjust_2053 , int adjust_2050 ) { struct b43_phy *phy ; struct b43_phy_g *gphy ; s32 tmp ; int __ret_warn_on ; long tmp___0 ; { phy = & dev->phy; gphy = phy->__annonCompField40.g; switch ((int )phy->radio_ver) { case 8272: ; if (ofdm != 0) { tmp = (s32 )in_rssi; if (tmp > 127) { tmp = tmp + -256; } else { } tmp = tmp * 73; tmp = tmp / 64; if (adjust_2050 != 0) { tmp = tmp + 25; } else { tmp = tmp + -3; } } else { if (((int )((dev->dev)->bus)->sprom.boardflags_lo & 8) != 0) { if ((unsigned int )in_rssi > 63U) { in_rssi = 63U; } else { } __ret_warn_on = (unsigned int )phy->type != 2U; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/xmit.c", 481); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); tmp = (s32 )gphy->nrssi_lt[(int )in_rssi]; tmp = 31 - tmp; tmp = tmp * -131; tmp = tmp / 128; tmp = tmp + -57; } else { tmp = (s32 )in_rssi; tmp = 31 - tmp; tmp = tmp * -149; tmp = tmp / 128; tmp = tmp + -68; } if ((unsigned int )phy->type == 2U && adjust_2050 != 0) { tmp = tmp + 25; } else { } } goto ldv_37482; case 8288: ; if ((int )((signed char )in_rssi) < 0) { tmp = (int )in_rssi + -256; } else { tmp = (s32 )in_rssi; } goto ldv_37482; default: tmp = (s32 )in_rssi; tmp = tmp + -11; tmp = tmp * 103; tmp = tmp / 64; if (adjust_2053 != 0) { tmp = tmp + -109; } else { tmp = tmp + -83; } } ldv_37482: ; return ((s8 )tmp); } } void b43_rx(struct b43_wldev *dev , struct sk_buff *skb , void const *_rxhdr ) { struct ieee80211_rx_status status ; struct b43_plcp_hdr6 *plcp ; struct ieee80211_hdr *wlhdr ; struct b43_rxhdr_fw4 const *rxhdr ; __le16 fctl ; u16 phystat0 ; u16 phystat3 ; u16 chanstat ; u16 mactime ; u32 macstat ; u16 chanid ; u16 phytype ; int padding ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; unsigned int keyidx ; int wlhdr_len ; u8 tmp___3 ; int __ret_warn_on ; long tmp___4 ; unsigned int tmp___5 ; long tmp___6 ; s8 tmp___7 ; long tmp___8 ; u16 low_mactime_now ; int tmp___9 ; int __ret_warn_on___0 ; long tmp___10 ; u8 tmp___11 ; u8 tmp___12 ; int __ret_warn_on___1 ; long tmp___13 ; size_t __len ; void *__ret ; struct ieee80211_rx_status *tmp___14 ; struct ieee80211_rx_status *tmp___15 ; { rxhdr = (struct b43_rxhdr_fw4 const *)_rxhdr; memset((void *)(& status), 0, 32UL); phystat0 = rxhdr->phy_status0; phystat3 = rxhdr->phy_status3; macstat = rxhdr->mac_status; mactime = rxhdr->mac_time; chanstat = rxhdr->channel; phytype = (unsigned int )chanstat & 7U; tmp = ldv__builtin_expect((long )((int )macstat) & 1L, 0L); if (tmp != 0L) { (dev->wl)->ieee_stats.dot11FCSErrorCount = (dev->wl)->ieee_stats.dot11FCSErrorCount + 1U; status.flag = status.flag | 32; } else { } tmp___0 = ldv__builtin_expect(((int )phystat0 & 768) != 0, 0L); if (tmp___0 != 0L) { status.flag = status.flag | 64; } else { } if (((int )phystat0 & 128) != 0) { status.flag = status.flag | 256; } else { } if ((macstat & 16U) != 0U) { goto drop; } else { } padding = (macstat & 4U) != 0U ? 2 : 0; tmp___1 = ldv__builtin_expect((unsigned long )skb->len < (unsigned long )padding + 6UL, 0L); if (tmp___1 != 0L) { b43dbg(dev->wl, "RX: Packet size underrun (1)\n"); goto drop; } else { } plcp = (struct b43_plcp_hdr6 *)skb->data + (unsigned long )padding; skb_pull(skb, (unsigned int )padding + 6U); tmp___2 = ldv__builtin_expect(skb->len <= 13U, 0L); if (tmp___2 != 0L) { b43dbg(dev->wl, "RX: Packet size underrun (2)\n"); goto drop; } else { } wlhdr = (struct ieee80211_hdr *)skb->data; fctl = wlhdr->frame_control; if ((macstat & 8U) != 0U) { keyidx = (macstat & 2016U) >> 5; tmp___3 = b43_kidx_to_raw(dev, (int )((u8 )keyidx)); keyidx = (unsigned int )tmp___3; __ret_warn_on = keyidx > 57U; tmp___4 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___4 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/xmit.c", 599); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); if ((unsigned int )dev->key[keyidx].algorithm != 0U) { tmp___5 = ieee80211_hdrlen((int )fctl); wlhdr_len = (int )tmp___5; tmp___6 = ldv__builtin_expect(skb->len < (unsigned int )(wlhdr_len + 3), 0L); if (tmp___6 != 0L) { b43dbg(dev->wl, "RX: Packet size underrun (3)\n"); goto drop; } else { } status.flag = status.flag | 2; } else { } } else { } if (((int )chanstat & 7) == 4) { } else { tmp___7 = b43_rssi_postprocess(dev, (int )rxhdr->__annonCompField47.__annonCompField45.jssi, (int )phystat0 & 1, (int )phystat0 & 16384, (int )phystat3 & 1024); status.signal = (int )tmp___7; } if ((int )phystat0 & 1) { status.rate_idx = b43_plcp_get_bitrate_idx_ofdm(plcp, (unsigned int )phytype == 0U); } else { status.rate_idx = b43_plcp_get_bitrate_idx_cck(plcp); } tmp___8 = ldv__builtin_expect(status.rate_idx == -1, 0L); if (tmp___8 != 0L) { if (((dev->wl)->filter_flags & 8U) == 0U) { goto drop; } else { } } else { } status.antenna = ((int )phystat0 & 32) != 0; tmp___9 = ieee80211_is_beacon((int )fctl); if (tmp___9 != 0 || (int )(dev->wl)->radiotap_enabled) { b43_tsf_read(dev, & status.mactime); low_mactime_now = (u16 )status.mactime; status.mactime = status.mactime & 0xffffffffffff0000ULL; status.mactime = status.mactime + (u64 )mactime; if ((int )low_mactime_now <= (int )mactime) { status.mactime = status.mactime - 65536ULL; } else { } status.flag = status.flag | 128; } else { } chanid = (u16 )(((int )chanstat & 2040) >> 3); switch ((int )chanstat & 7) { case 0: status.band = 1; __ret_warn_on___0 = 1; tmp___10 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___10 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/xmit.c", 662); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); status.freq = b43_channel_to_freq_5ghz((int )((u8 )chanid)); goto ldv_37514; case 2: status.band = 0; status.freq = (int )chanid + 2400; goto ldv_37514; case 4: ; case 5: ; if (((int )chanstat & 2048) != 0) { status.band = 1; tmp___11 = b43_freq_to_channel_5ghz((int )chanid); status.freq = (int )tmp___11; } else { status.band = 0; tmp___12 = b43_freq_to_channel_2ghz((int )chanid); status.freq = (int )tmp___12; } goto ldv_37514; default: __ret_warn_on___1 = 1; tmp___13 = ldv__builtin_expect(__ret_warn_on___1 != 0, 0L); if (tmp___13 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/xmit.c", 686); } else { } ldv__builtin_expect(__ret_warn_on___1 != 0, 0L); goto drop; } ldv_37514: __len = 32UL; if (__len > 63UL) { tmp___14 = IEEE80211_SKB_RXCB(skb); __ret = memcpy((void *)tmp___14, (void const *)(& status), __len); } else { tmp___15 = IEEE80211_SKB_RXCB(skb); __ret = __builtin_memcpy((void *)tmp___15, (void const *)(& status), __len); } ieee80211_rx_ni((dev->wl)->hw, skb); dev->rx_count = dev->rx_count + 1U; return; drop: b43dbg(dev->wl, "RX: Packet dropped\n"); dev_kfree_skb_any(skb); return; } } void b43_handle_txstatus(struct b43_wldev *dev , struct b43_txstatus const *status ) { bool tmp ; { b43_debugfs_log_txstat(dev, status); if ((unsigned int )((unsigned char )status->intermediate) != 0U) { return; } else { } if ((unsigned int )((unsigned char )status->for_ampdu) != 0U) { return; } else { } if ((unsigned int )((unsigned char )status->acked) == 0U) { (dev->wl)->ieee_stats.dot11ACKFailureCount = (dev->wl)->ieee_stats.dot11ACKFailureCount + 1U; } else { } if ((unsigned int )((unsigned char )status->rts_count) != 0U) { if ((unsigned int )((unsigned char )status->rts_count) == 15U) { (dev->wl)->ieee_stats.dot11RTSFailureCount = (dev->wl)->ieee_stats.dot11RTSFailureCount + 1U; } else { (dev->wl)->ieee_stats.dot11RTSSuccessCount = (dev->wl)->ieee_stats.dot11RTSSuccessCount + 1U; } } else { } tmp = b43_using_pio_transfers(dev); if ((int )tmp) { b43_pio_handle_txstatus(dev, status); } else { b43_dma_handle_txstatus(dev, status); } b43_phy_txpower_check(dev, 0U); return; } } bool b43_fill_txstatus_report(struct b43_wldev *dev , struct ieee80211_tx_info *report , struct b43_txstatus const *status ) { bool frame_success ; int retry_limit ; { frame_success = 1; retry_limit = (int )report->__annonCompField39.status.rates[0].count; ieee80211_tx_info_clear_status(report); if ((unsigned int )((unsigned char )status->acked) != 0U) { report->flags = report->flags | 512U; } else if ((report->flags & 4U) == 0U) { frame_success = 0; } else { } if ((unsigned int )((unsigned char )status->frame_count) == 0U) { report->__annonCompField39.status.rates[0].count = 0U; } else if ((int )((unsigned char )status->rts_count) > (int )((dev->wl)->hw)->conf.short_frame_max_tx_count) { report->__annonCompField39.status.rates[0].count = 0U; report->__annonCompField39.status.rates[1].count = status->frame_count; } else if ((int )status->frame_count > retry_limit) { report->__annonCompField39.status.rates[0].count = (u8 )retry_limit; report->__annonCompField39.status.rates[1].count = (int )((u8 )status->frame_count) - (int )((u8 )retry_limit); } else { report->__annonCompField39.status.rates[0].count = status->frame_count; report->__annonCompField39.status.rates[1].idx = -1; } return (frame_success); } } void b43_tx_suspend(struct b43_wldev *dev ) { bool tmp ; { tmp = b43_using_pio_transfers(dev); if ((int )tmp) { b43_pio_tx_suspend(dev); } else { b43_dma_tx_suspend(dev); } return; } } void b43_tx_resume(struct b43_wldev *dev ) { bool tmp ; { tmp = b43_using_pio_transfers(dev); if ((int )tmp) { b43_pio_tx_resume(dev); } else { b43_dma_tx_resume(dev); } return; } } int ldv_del_timer_sync_57(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type ldv_func_res ; int tmp ; { tmp = del_timer_sync(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_9(ldv_func_arg1); return (ldv_func_res); } } int ldv_del_timer_58(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___0 ldv_func_res ; int tmp ; { tmp = del_timer(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_9(ldv_func_arg1); return (ldv_func_res); } } int ldv_request_threaded_irq_59(unsigned int ldv_func_arg1 , irqreturn_t (*handler)(int , void * ) , irqreturn_t (*thread_fn)(int , void * ) , unsigned long ldv_func_arg4 , char const *ldv_func_arg5 , void *ldv_func_arg6 ) { ldv_func_ret_type___1 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = request_threaded_irq(ldv_func_arg1, handler, thread_fn, ldv_func_arg4, ldv_func_arg5, ldv_func_arg6); ldv_func_res = tmp; tmp___0 = reg_check_2(handler, thread_fn); if (tmp___0 != 0 && ldv_func_res >= 0) { activate_suitable_irq_2((int )ldv_func_arg1, ldv_func_arg6); } else { } return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; int ldv_del_timer_64(struct timer_list *ldv_func_arg1 ) ; int ldv_del_timer_sync_63(struct timer_list *ldv_func_arg1 ) ; int ldv_request_threaded_irq_65(unsigned int ldv_func_arg1 , irqreturn_t (*handler)(int , void * ) , irqreturn_t (*thread_fn)(int , void * ) , unsigned long ldv_func_arg4 , char const *ldv_func_arg5 , void *ldv_func_arg6 ) ; extern int _cond_resched(void) ; __inline static bool b43_compare_rfatt(struct b43_rfatt const *a , struct b43_rfatt const *b ) { { return ((bool )((int )((unsigned char )a->att) == (int )((unsigned char )b->att) && (int const )a->with_padmix == (int const )b->with_padmix)); } } __inline static bool b43_compare_bbatt(struct b43_bbatt const *a , struct b43_bbatt const *b ) { { return ((int )((unsigned char )a->att) == (int )((unsigned char )b->att)); } } void b43_lo_g_adjust_to(struct b43_wldev *dev , u16 rfatt , u16 bbatt , u16 tx_control ) ; static struct b43_lo_calib *b43_find_lo_calib(struct b43_txpower_lo_control *lo , struct b43_bbatt const *bbatt , struct b43_rfatt const *rfatt ) { struct b43_lo_calib *c ; struct list_head const *__mptr ; bool tmp ; int tmp___0 ; bool tmp___1 ; int tmp___2 ; struct list_head const *__mptr___0 ; { __mptr = (struct list_head const *)lo->calib_list.next; c = (struct b43_lo_calib *)__mptr + 0xfffffffffffffff0UL; goto ldv_37024; ldv_37023: tmp = b43_compare_bbatt((struct b43_bbatt const *)(& c->bbatt), bbatt); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { goto ldv_37022; } else { } tmp___1 = b43_compare_rfatt((struct b43_rfatt const *)(& c->rfatt), rfatt); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { goto ldv_37022; } else { } return (c); ldv_37022: __mptr___0 = (struct list_head const *)c->list.next; c = (struct b43_lo_calib *)__mptr___0 + 0xfffffffffffffff0UL; ldv_37024: __builtin_prefetch((void const *)c->list.next); if ((unsigned long )(& c->list) != (unsigned long )(& lo->calib_list)) { goto ldv_37023; } else { } return ((struct b43_lo_calib *)0); } } static void b43_lo_write(struct b43_wldev *dev , struct b43_loctl *control ) { struct b43_phy *phy ; u16 value ; long __x ; long __x___0 ; int tmp ; long tmp___0 ; int __ret_warn_on ; long tmp___1 ; { phy = & dev->phy; __x = (long )control->i; if ((__x < 0L ? - __x : __x) > 16L) { tmp = 1; } else { __x___0 = (long )control->q; if ((__x___0 < 0L ? - __x___0 : __x___0) > 16L) { tmp = 1; } else { tmp = 0; } } tmp___0 = ldv__builtin_expect((long )tmp, 0L); if (tmp___0 != 0L) { b43dbg(dev->wl, "Invalid LO control pair (I: %d, Q: %d)\n", (int )control->i, (int )control->q); dump_stack(); return; } else { } __ret_warn_on = (unsigned int )phy->type != 2U; tmp___1 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/lo.c", 71); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); value = (u16 )((unsigned char )control->q); value = (u16 )((int )((short )((int )((unsigned char )control->i) << 8)) | (int )((short )value)); b43_phy_write(dev, 2064, (int )value); return; } } static u16 lo_measure_feedthrough(struct b43_wldev *dev , u16 lna , u16 pga , u16 trsw_rx ) { struct b43_phy *phy ; u16 rfover ; u16 feedthrough ; int __ret_warn_on ; long tmp ; int __ret_warn_on___0 ; long tmp___0 ; { phy = & dev->phy; if ((int )phy->gmode) { lna = (int )lna << 12U; pga = (int )pga << 8U; __ret_warn_on = ((int )lna & -28673) != 0; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/lo.c", 89); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); __ret_warn_on___0 = ((int )pga & -3841) != 0; tmp___0 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/lo.c", 90); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); trsw_rx = (unsigned int )trsw_rx & 227U; rfover = 16U; rfover = (u16 )((int )rfover | (int )pga); rfover = (u16 )((int )rfover | (int )lna); rfover = (u16 )((int )rfover | (int )trsw_rx); if (((int )((dev->dev)->bus)->sprom.boardflags_lo & 4096) != 0 && (unsigned int )phy->rev > 6U) { rfover = (u16 )((unsigned int )rfover | 32768U); } else { } b43_phy_write(dev, 21, 58112); b43_phy_write(dev, 2066, (int )rfover); __const_udelay(42950UL); rfover = (u16 )((unsigned int )rfover | 2U); b43_phy_write(dev, 2066, (int )rfover); __const_udelay(42950UL); rfover = (u16 )((unsigned int )rfover | 1U); b43_phy_write(dev, 2066, (int )rfover); __const_udelay(42950UL); b43_phy_write(dev, 21, 62208); } else { pga = (u16 )((unsigned int )pga | 61344U); b43_phy_write(dev, 21, (int )pga); __const_udelay(42950UL); pga = (u16 )((unsigned int )pga | 64U); b43_phy_write(dev, 21, (int )pga); __const_udelay(42950UL); pga = (u16 )((unsigned int )pga | 4096U); b43_phy_write(dev, 21, (int )pga); } __const_udelay(90195UL); feedthrough = b43_phy_read(dev, 45); __might_sleep("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/lo.c", 131, 0); _cond_resched(); return (feedthrough); } } static u16 lo_txctl_register_table(struct b43_wldev *dev , u16 *value , u16 *pad_mix_gain ) { struct b43_phy *phy ; u16 reg ; u16 v ; u16 padmix ; { phy = & dev->phy; if ((unsigned int )phy->type == 1U) { v = 48U; if ((unsigned int )phy->radio_rev <= 5U) { reg = 67U; padmix = 0U; } else { reg = 82U; padmix = 5U; } } else if ((unsigned int )phy->rev > 1U && (unsigned int )phy->radio_rev == 8U) { reg = 67U; v = 16U; padmix = 2U; } else { reg = 82U; v = 48U; padmix = 5U; } if ((unsigned long )value != (unsigned long )((u16 *)0U)) { *value = v; } else { } if ((unsigned long )pad_mix_gain != (unsigned long )((u16 *)0U)) { *pad_mix_gain = padmix; } else { } return (reg); } } static void lo_measure_txctl_values(struct b43_wldev *dev ) { struct b43_phy *phy ; struct b43_phy_g *gphy ; struct b43_txpower_lo_control *lo ; u16 reg ; u16 mask ; u16 trsw_rx ; u16 pga ; u16 radio_pctl_reg ; u8 tx_bias_values[9U] ; u8 tx_magn_values[2U] ; int lb_gain ; long __x ; u16 __val ; u16 __min ; u16 __max ; int cmp_val ; int tmp ; int i ; int j ; int feedthrough ; int min_feedth ; u8 tx_magn ; u8 tx_bias ; u16 tmp___0 ; u16 tmp___1 ; { phy = & dev->phy; gphy = phy->__annonCompField40.g; lo = gphy->lo_control; tx_bias_values[0] = 9U; tx_bias_values[1] = 8U; tx_bias_values[2] = 10U; tx_bias_values[3] = 1U; tx_bias_values[4] = 0U; tx_bias_values[5] = 2U; tx_bias_values[6] = 5U; tx_bias_values[7] = 4U; tx_bias_values[8] = 6U; tx_magn_values[0] = 112U; tx_magn_values[1] = 64U; if ((unsigned int )phy->rev <= 1U && ! phy->gmode) { radio_pctl_reg = 6U; trsw_rx = 2U; pga = 0U; } else { trsw_rx = 0U; lb_gain = (int )gphy->max_lb_gain / 2; if (lb_gain > 10) { radio_pctl_reg = 0U; __x = (long )(10 - lb_gain); pga = (u16 )((__x < 0L ? - __x : __x) / 6L); __val = pga; __min = 0U; __max = 15U; __val = (u16 )((int )__min > (int )__val ? __min : __val); pga = (u16 )((int )__max < (int )__val ? __max : __val); } else { pga = 0U; cmp_val = 36; if (((unsigned int )phy->rev > 1U && (unsigned int )phy->radio_ver == 8272U) && (unsigned int )phy->radio_rev == 8U) { cmp_val = 60; } else { } tmp = lb_gain; if (10 - lb_gain < cmp_val) { tmp = 10 - lb_gain; } else { } if (tmp < 0) { tmp = tmp + 6; } else { tmp = tmp + 3; } cmp_val = cmp_val / 4; tmp = tmp / 4; if (tmp >= cmp_val) { radio_pctl_reg = (u16 )cmp_val; } else { radio_pctl_reg = (u16 )tmp; } } } b43_radio_maskset(dev, 67, 65520, (int )radio_pctl_reg); b43_gphy_set_baseband_attenuation(dev, 2); reg = lo_txctl_register_table(dev, & mask, (u16 *)0U); mask = ~ ((int )mask); b43_radio_mask(dev, (int )reg, (int )mask); if (((unsigned int )phy->rev > 1U && (unsigned int )phy->radio_ver == 8272U) && (unsigned int )phy->radio_rev == 8U) { min_feedth = 65535; i = 0; goto ldv_37097; ldv_37096: tx_magn = tx_magn_values[i]; b43_radio_maskset(dev, 82, 65295, (int )tx_magn); j = 0; goto ldv_37095; ldv_37094: tx_bias = tx_bias_values[j]; b43_radio_maskset(dev, 82, 65520, (int )tx_bias); tmp___0 = lo_measure_feedthrough(dev, 0, (int )pga, (int )trsw_rx); feedthrough = (int )tmp___0; if (feedthrough < min_feedth) { lo->tx_bias = tx_bias; lo->tx_magn = tx_magn; min_feedth = feedthrough; } else { } if ((unsigned int )lo->tx_bias == 0U) { goto ldv_37093; } else { } j = j + 1; ldv_37095: ; if ((unsigned int )j <= 8U) { goto ldv_37094; } else { } ldv_37093: tmp___1 = b43_radio_read(dev, 82); b43_radio_write(dev, 82, (int )((u16 )((((int )((short )tmp___1) & -256) | (int )((short )lo->tx_bias)) | (int )((short )lo->tx_magn)))); i = i + 1; ldv_37097: ; if ((unsigned int )i <= 1U) { goto ldv_37096; } else { } } else { lo->tx_magn = 0U; lo->tx_bias = 0U; b43_radio_mask(dev, 82, 65520); } lo->txctl_measured_time = jiffies; return; } } static void lo_read_power_vector(struct b43_wldev *dev ) { struct b43_phy *phy ; struct b43_phy_g *gphy ; struct b43_txpower_lo_control *lo ; int i ; u64 tmp ; u64 power_vector ; u16 tmp___0 ; { phy = & dev->phy; gphy = phy->__annonCompField40.g; lo = gphy->lo_control; power_vector = 0ULL; i = 0; goto ldv_37109; ldv_37108: tmp___0 = b43_shm_read16(dev, 1, (int )((unsigned int )((u16 )i) + 784U)); tmp = (u64 )tmp___0; power_vector = (tmp << i * 8) | power_vector; b43_shm_write16(dev, 1, (int )((unsigned int )((u16 )i) + 784U), 0); i = i + 2; ldv_37109: ; if (i <= 7) { goto ldv_37108; } else { } if (power_vector != 0ULL) { lo->power_vector = power_vector; } else { } lo->pwr_vec_read_time = jiffies; return; } } static void lo_measure_gain_values(struct b43_wldev *dev , s16 max_rx_gain , int use_trsw_rx ) { struct b43_phy *phy ; struct b43_phy_g *gphy ; u16 tmp ; int trsw_rx ; int trsw_rx_gain ; int __val ; int __min ; int __max ; { phy = & dev->phy; gphy = phy->__annonCompField40.g; if ((int )max_rx_gain < 0) { max_rx_gain = 0; } else { } if ((unsigned int )phy->rev > 1U || (int )phy->gmode) { trsw_rx = 0; if (use_trsw_rx != 0) { trsw_rx_gain = (int )gphy->trsw_rx_gain / 2; if ((int )max_rx_gain >= trsw_rx_gain) { trsw_rx_gain = (int )max_rx_gain - trsw_rx_gain; trsw_rx = 32; } else { } } else { trsw_rx_gain = (int )max_rx_gain; } if (trsw_rx_gain <= 8) { gphy->lna_lod_gain = 0; } else { gphy->lna_lod_gain = 1; trsw_rx_gain = trsw_rx_gain + -8; } __val = trsw_rx_gain; __min = 0; __max = 45; __val = __min > __val ? __min : __val; trsw_rx_gain = __max < __val ? __max : __val; gphy->pga_gain = (s16 )(trsw_rx_gain / 3); if ((int )gphy->pga_gain > 4) { gphy->pga_gain = (s16 )((unsigned int )((unsigned short )gphy->pga_gain) + 65531U); gphy->lna_gain = 2; } else { gphy->lna_gain = 0; } } else { gphy->lna_gain = 0; gphy->trsw_rx_gain = 32; if ((int )max_rx_gain > 19) { gphy->lna_lod_gain = 1; gphy->pga_gain = 2; } else if ((int )max_rx_gain > 17) { gphy->lna_lod_gain = 1; gphy->pga_gain = 1; } else if ((int )max_rx_gain > 14) { gphy->lna_lod_gain = 1; gphy->pga_gain = 0; } else { gphy->lna_lod_gain = 0; gphy->pga_gain = 0; } } tmp = b43_radio_read(dev, 122); if ((int )gphy->lna_lod_gain == 0) { tmp = (unsigned int )tmp & 65527U; } else { tmp = (u16 )((unsigned int )tmp | 8U); } b43_radio_write(dev, 122, (int )tmp); return; } } static void lo_measure_setup(struct b43_wldev *dev , struct lo_g_saved_values *sav ) { struct ssb_sprom *sprom ; struct b43_phy *phy ; struct b43_phy_g *gphy ; struct b43_txpower_lo_control *lo ; u16 tmp ; bool tmp___0 ; u16 tmp___1 ; u16 tmp___2 ; { sprom = & ((dev->dev)->bus)->sprom; phy = & dev->phy; gphy = phy->__annonCompField40.g; lo = gphy->lo_control; tmp___0 = b43_has_hardware_pctl(dev); if ((int )tmp___0) { sav->phy_lo_mask = b43_phy_read(dev, 2063); sav->phy_extg_01 = b43_phy_read(dev, 2049); sav->phy_dacctl_hwpctl = b43_phy_read(dev, 96); sav->phy_cck_14 = b43_phy_read(dev, 20); sav->phy_hpwr_tssictl = b43_phy_read(dev, 1144); b43_phy_set(dev, 1144, 256); b43_phy_set(dev, 2049, 64); b43_phy_set(dev, 96, 64); b43_phy_set(dev, 20, 512); } else { } if (((unsigned int )phy->type == 1U && (unsigned int )phy->radio_ver == 8272U) && (unsigned int )phy->radio_rev <= 5U) { b43_phy_write(dev, 22, 1040); b43_phy_write(dev, 23, 2080); } else { } if ((unsigned int )phy->rev > 1U) { sav->phy_analogover = b43_phy_read(dev, 2068); sav->phy_analogoverval = b43_phy_read(dev, 2069); sav->phy_rfover = b43_phy_read(dev, 2065); sav->phy_rfoverval = b43_phy_read(dev, 2066); sav->phy_classctl = b43_phy_read(dev, 2050); sav->phy_cck_3E = b43_phy_read(dev, 62); sav->phy_crs0 = b43_phy_read(dev, 1065); b43_phy_mask(dev, 2050, 65532); b43_phy_mask(dev, 1065, 32767); b43_phy_set(dev, 2068, 3); b43_phy_mask(dev, 2069, 65532); if ((unsigned int )phy->type == 2U) { if ((unsigned int )phy->rev > 6U && ((int )sprom->boardflags_lo & 4096) != 0) { b43_phy_write(dev, 2065, 2355); } else { b43_phy_write(dev, 2065, 307); } } else { b43_phy_write(dev, 2065, 0); } b43_phy_write(dev, 62, 0); } else { } sav->reg_3F4 = b43_read16(dev, 1012); sav->reg_3E2 = b43_read16(dev, 994); sav->radio_43 = b43_radio_read(dev, 67); sav->radio_7A = b43_radio_read(dev, 122); sav->phy_pgactl = b43_phy_read(dev, 21); sav->phy_cck_2A = b43_phy_read(dev, 42); sav->phy_syncctl = b43_phy_read(dev, 53); sav->phy_dacctl = b43_phy_read(dev, 96); if (((unsigned int )phy->rev <= 1U || (unsigned int )phy->radio_ver != 8272U) || (unsigned int )phy->radio_rev != 8U) { sav->radio_52 = b43_radio_read(dev, 82); sav->radio_52 = (unsigned int )sav->radio_52 & 240U; } else { } if ((unsigned int )phy->type == 1U) { sav->phy_cck_30 = b43_phy_read(dev, 48); sav->phy_cck_06 = b43_phy_read(dev, 6); b43_phy_write(dev, 48, 255); b43_phy_write(dev, 6, 16191); } else { tmp___1 = b43_read16(dev, 994); b43_write16(dev, 994, (int )((unsigned int )tmp___1 | 32768U)); } tmp___2 = b43_read16(dev, 1012); b43_write16(dev, 1012, (int )tmp___2 & 61440); tmp = (unsigned int )phy->type == 2U ? 2063U : 46U; b43_phy_write(dev, (int )tmp, 127); tmp = sav->phy_syncctl; b43_phy_write(dev, 53, (int )tmp & 65407); tmp = sav->radio_7A; b43_radio_write(dev, 122, (int )tmp & 65520); b43_phy_write(dev, 42, 2211); if ((unsigned int )phy->type == 2U || (((unsigned int )phy->type == 1U && (unsigned int )phy->radio_ver == 8272U) && (unsigned int )phy->radio_rev > 5U)) { b43_phy_write(dev, 43, 4099); } else { b43_phy_write(dev, 43, 2050); } if ((unsigned int )phy->rev > 1U) { b43_dummy_transmission(dev, 0, 1); } else { } b43_gphy_channel_switch(dev, 6U, 0); b43_radio_read(dev, 81); if ((unsigned int )phy->type == 2U) { b43_phy_write(dev, 47, 0); } else { } if ((long )lo->txctl_measured_time + (long )(44000UL - (unsigned long )jiffies) < 0L) { lo_measure_txctl_values(dev); } else { } if ((unsigned int )phy->type == 2U && (unsigned int )phy->rev > 2U) { b43_phy_write(dev, 2063, 49272); } else if ((unsigned int )phy->type == 1U) { b43_phy_write(dev, 46, 32888); } else { b43_phy_write(dev, 2063, 32888); } return; } } static void lo_measure_restore(struct b43_wldev *dev , struct lo_g_saved_values *sav ) { struct b43_phy *phy ; struct b43_phy_g *gphy ; u16 tmp ; bool tmp___0 ; { phy = & dev->phy; gphy = phy->__annonCompField40.g; if ((unsigned int )phy->rev > 1U) { b43_phy_write(dev, 21, 58112); tmp = (int )((u16 )gphy->pga_gain) << 8U; b43_phy_write(dev, 2066, (int )((unsigned int )tmp | 160U)); __const_udelay(21475UL); b43_phy_write(dev, 2066, (int )((unsigned int )tmp | 162U)); __const_udelay(8590UL); b43_phy_write(dev, 2066, (int )((unsigned int )tmp | 163U)); } else { tmp = (u16 )((int )gphy->pga_gain | -4192); b43_phy_write(dev, 21, (int )tmp); } if ((unsigned int )phy->type == 2U) { if ((unsigned int )phy->rev > 2U) { b43_phy_write(dev, 46, 49272); } else { b43_phy_write(dev, 46, 32888); } if ((unsigned int )phy->rev > 1U) { b43_phy_write(dev, 47, 514); } else { b43_phy_write(dev, 47, 257); } } else { } b43_write16(dev, 1012, (int )sav->reg_3F4); b43_phy_write(dev, 21, (int )sav->phy_pgactl); b43_phy_write(dev, 42, (int )sav->phy_cck_2A); b43_phy_write(dev, 53, (int )sav->phy_syncctl); b43_phy_write(dev, 96, (int )sav->phy_dacctl); b43_radio_write(dev, 67, (int )sav->radio_43); b43_radio_write(dev, 122, (int )sav->radio_7A); if (((unsigned int )phy->rev <= 1U || (unsigned int )phy->radio_ver != 8272U) || (unsigned int )phy->radio_rev != 8U) { tmp = sav->radio_52; b43_radio_maskset(dev, 82, 65295, (int )tmp); } else { } b43_write16(dev, 994, (int )sav->reg_3E2); if (((unsigned int )phy->type == 1U && (unsigned int )phy->radio_ver == 8272U) && (unsigned int )phy->radio_rev <= 5U) { b43_phy_write(dev, 48, (int )sav->phy_cck_30); b43_phy_write(dev, 6, (int )sav->phy_cck_06); } else { } if ((unsigned int )phy->rev > 1U) { b43_phy_write(dev, 2068, (int )sav->phy_analogover); b43_phy_write(dev, 2069, (int )sav->phy_analogoverval); b43_phy_write(dev, 2050, (int )sav->phy_classctl); b43_phy_write(dev, 2065, (int )sav->phy_rfover); b43_phy_write(dev, 2066, (int )sav->phy_rfoverval); b43_phy_write(dev, 62, (int )sav->phy_cck_3E); b43_phy_write(dev, 1065, (int )sav->phy_crs0); } else { } tmp___0 = b43_has_hardware_pctl(dev); if ((int )tmp___0) { tmp = (unsigned int )sav->phy_lo_mask & 49151U; b43_phy_write(dev, 2063, (int )tmp); b43_phy_write(dev, 2049, (int )sav->phy_extg_01); b43_phy_write(dev, 96, (int )sav->phy_dacctl_hwpctl); b43_phy_write(dev, 20, (int )sav->phy_cck_14); b43_phy_write(dev, 1144, (int )sav->phy_hpwr_tssictl); } else { } b43_gphy_channel_switch(dev, (unsigned int )sav->old_channel, 1); return; } } static int lo_probe_possible_loctls(struct b43_wldev *dev , struct b43_loctl *probe_loctl , struct b43_lo_g_statemachine *d ) { struct b43_phy *phy ; struct b43_phy_g *gphy ; struct b43_loctl test_loctl ; struct b43_loctl orig_loctl ; struct b43_loctl prev_loctl ; int i ; int begin ; int end ; int found_lower ; u16 feedth ; struct b43_loctl modifiers[8U] ; size_t __len ; void *__ret ; int __ret_warn_on ; long tmp ; size_t __len___0 ; void *__ret___0 ; size_t __len___1 ; void *__ret___1 ; long __x ; long __x___0 ; size_t __len___2 ; void *__ret___2 ; { phy = & dev->phy; gphy = phy->__annonCompField40.g; prev_loctl.i = -100; prev_loctl.q = -100; found_lower = 0; modifiers[0].i = 1; modifiers[0].q = 1; modifiers[1].i = 1; modifiers[1].q = 0; modifiers[2].i = 1; modifiers[2].q = -1; modifiers[3].i = 0; modifiers[3].q = -1; modifiers[4].i = -1; modifiers[4].q = -1; modifiers[5].i = -1; modifiers[5].q = 0; modifiers[6].i = -1; modifiers[6].q = 1; modifiers[7].i = 0; modifiers[7].q = 1; if (d->current_state == 0) { begin = 1; end = 8; } else if (((unsigned int )d->current_state & 1U) == 0U) { begin = d->current_state + -1; end = d->current_state + 1; } else { begin = d->current_state + -2; end = d->current_state + 2; } if (begin <= 0) { begin = begin + 8; } else { } if (end > 8) { end = end + -8; } else { } __len = 2UL; if (__len > 63UL) { __ret = memcpy((void *)(& orig_loctl), (void const *)probe_loctl, __len); } else { __ret = __builtin_memcpy((void *)(& orig_loctl), (void const *)probe_loctl, __len); } i = begin; d->current_state = i; ldv_37213: __ret_warn_on = i <= 0 || i > 8; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/lo.c", 625); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); __len___0 = 2UL; if (__len___0 > 63UL) { __ret___0 = memcpy((void *)(& test_loctl), (void const *)(& orig_loctl), __len___0); } else { __ret___0 = __builtin_memcpy((void *)(& test_loctl), (void const *)(& orig_loctl), __len___0); } test_loctl.i = (s8 )((int )((unsigned char )test_loctl.i) + (int )((unsigned char )modifiers[i + -1].i) * (int )((unsigned char )d->state_val_multiplier)); test_loctl.q = (s8 )((int )((unsigned char )test_loctl.q) + (int )((unsigned char )modifiers[i + -1].q) * (int )((unsigned char )d->state_val_multiplier)); if ((int )test_loctl.i != (int )prev_loctl.i || (int )test_loctl.q != (int )prev_loctl.q) { __x = (long )test_loctl.i; if ((__x < 0L ? - __x : __x) <= 16L) { __x___0 = (long )test_loctl.q; if ((__x___0 < 0L ? - __x___0 : __x___0) <= 16L) { b43_lo_write(dev, & test_loctl); feedth = lo_measure_feedthrough(dev, (int )((u16 )gphy->lna_gain), (int )((u16 )gphy->pga_gain), (int )((u16 )gphy->trsw_rx_gain)); if ((int )d->lowest_feedth > (int )feedth) { __len___1 = 2UL; if (__len___1 > 63UL) { __ret___1 = memcpy((void *)probe_loctl, (void const *)(& test_loctl), __len___1); } else { __ret___1 = __builtin_memcpy((void *)probe_loctl, (void const *)(& test_loctl), __len___1); } found_lower = 1; d->lowest_feedth = feedth; if (d->nr_measured <= 1 && ((unsigned int )phy->rev <= 1U && ! phy->gmode)) { goto ldv_37209; } else { } } else { } } else { } } else { } } else { } __len___2 = 2UL; if (__len___2 > 63UL) { __ret___2 = memcpy((void *)(& prev_loctl), (void const *)(& test_loctl), __len___2); } else { __ret___2 = __builtin_memcpy((void *)(& prev_loctl), (void const *)(& test_loctl), __len___2); } if (i == end) { goto ldv_37209; } else { } if (i == 8) { i = 1; } else { i = i + 1; } d->current_state = i; goto ldv_37213; ldv_37209: ; return (found_lower); } } static void lo_probe_loctls_statemachine(struct b43_wldev *dev , struct b43_loctl *loctl , int *max_rx_gain ) { struct b43_phy *phy ; struct b43_phy_g *gphy ; struct b43_lo_g_statemachine d ; u16 feedth ; int found_lower ; struct b43_loctl probe_loctl ; int max_repeat ; int repeat_cnt ; size_t __len ; void *__ret ; int __ret_warn_on ; long tmp ; size_t __len___0 ; void *__ret___0 ; size_t __len___1 ; void *__ret___1 ; size_t __len___2 ; void *__ret___2 ; { phy = & dev->phy; gphy = phy->__annonCompField40.g; max_repeat = 1; repeat_cnt = 0; d.nr_measured = 0; d.state_val_multiplier = 1; if ((unsigned int )phy->rev > 1U || (int )phy->gmode) { d.state_val_multiplier = 3; } else { } __len = 2UL; if (__len > 63UL) { __ret = memcpy((void *)(& d.min_loctl), (void const *)loctl, __len); } else { __ret = __builtin_memcpy((void *)(& d.min_loctl), (void const *)loctl, __len); } if ((unsigned int )phy->rev > 1U || (int )phy->gmode) { max_repeat = 4; } else { } ldv_37243: b43_lo_write(dev, & d.min_loctl); feedth = lo_measure_feedthrough(dev, (int )((u16 )gphy->lna_gain), (int )((u16 )gphy->pga_gain), (int )((u16 )gphy->trsw_rx_gain)); if ((unsigned int )feedth <= 599U) { if ((unsigned int )feedth > 299U) { *max_rx_gain = *max_rx_gain + 6; } else { *max_rx_gain = *max_rx_gain + 3; } feedth = lo_measure_feedthrough(dev, (int )((u16 )gphy->lna_gain), (int )((u16 )gphy->pga_gain), (int )((u16 )gphy->trsw_rx_gain)); } else { } d.lowest_feedth = feedth; d.current_state = 0; ldv_37239: __ret_warn_on = d.current_state < 0 || d.current_state > 8; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/lo.c", 699); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); __len___0 = 2UL; if (__len___0 > 63UL) { __ret___0 = memcpy((void *)(& probe_loctl), (void const *)(& d.min_loctl), __len___0); } else { __ret___0 = __builtin_memcpy((void *)(& probe_loctl), (void const *)(& d.min_loctl), __len___0); } found_lower = lo_probe_possible_loctls(dev, & probe_loctl, & d); if (found_lower == 0) { goto ldv_37235; } else { } if ((int )probe_loctl.i == (int )d.min_loctl.i && (int )probe_loctl.q == (int )d.min_loctl.q) { goto ldv_37235; } else { } __len___1 = 2UL; if (__len___1 > 63UL) { __ret___1 = memcpy((void *)(& d.min_loctl), (void const *)(& probe_loctl), __len___1); } else { __ret___1 = __builtin_memcpy((void *)(& d.min_loctl), (void const *)(& probe_loctl), __len___1); } d.nr_measured = d.nr_measured + 1; if (d.nr_measured <= 23) { goto ldv_37239; } else { } ldv_37235: __len___2 = 2UL; if (__len___2 > 63UL) { __ret___2 = memcpy((void *)loctl, (void const *)(& d.min_loctl), __len___2); } else { __ret___2 = __builtin_memcpy((void *)loctl, (void const *)(& d.min_loctl), __len___2); } if ((unsigned int )phy->rev > 1U || (int )phy->gmode) { if ((unsigned int )d.lowest_feedth > 4500U) { *max_rx_gain = *max_rx_gain + -6; } else if ((unsigned int )d.lowest_feedth <= 1499U) { *max_rx_gain = *max_rx_gain + 3; } else { } if (repeat_cnt == 0) { if ((unsigned int )d.lowest_feedth <= 1500U) { d.state_val_multiplier = 1; repeat_cnt = repeat_cnt + 1; } else { d.state_val_multiplier = 2; } } else if (repeat_cnt == 2) { d.state_val_multiplier = 1; } else { } } else { } lo_measure_gain_values(dev, (int )((s16 )*max_rx_gain), (unsigned int )phy->rev > 1U || (int )phy->gmode); repeat_cnt = repeat_cnt + 1; if (repeat_cnt < max_repeat) { goto ldv_37243; } else { } return; } } static struct b43_lo_calib *b43_calibrate_lo_setting(struct b43_wldev *dev , struct b43_bbatt const *bbatt , struct b43_rfatt const *rfatt ) { struct b43_phy *phy ; struct b43_phy_g *gphy ; struct b43_loctl loctl ; int max_rx_gain ; struct b43_lo_calib *cal ; struct lo_g_saved_values saved_regs ; u16 txctl_reg ; u16 txctl_value ; u16 pad_mix_gain ; bool tmp ; void *tmp___0 ; size_t __len ; void *__ret ; size_t __len___0 ; void *__ret___0 ; size_t __len___1 ; void *__ret___1 ; { phy = & dev->phy; gphy = phy->__annonCompField40.g; loctl.i = 0; loctl.q = 0; saved_regs = saved_regs; saved_regs.old_channel = (u8 )phy->channel; b43_mac_suspend(dev); lo_measure_setup(dev, & saved_regs); txctl_reg = lo_txctl_register_table(dev, & txctl_value, & pad_mix_gain); b43_radio_maskset(dev, 67, 65520, (int )rfatt->att); b43_radio_maskset(dev, (int )txctl_reg, ~ ((int )txctl_value), (int )rfatt->with_padmix ? (int )txctl_value : 0); max_rx_gain = (int )rfatt->att * 2; max_rx_gain = (int )((unsigned int )((unsigned char )bbatt->att) / 2U) + max_rx_gain; if ((int )rfatt->with_padmix) { max_rx_gain = max_rx_gain - (int )pad_mix_gain; } else { } if ((unsigned int )phy->rev > 1U || (int )phy->gmode) { max_rx_gain = (int )gphy->max_lb_gain + max_rx_gain; } else { } lo_measure_gain_values(dev, (int )((s16 )max_rx_gain), (unsigned int )phy->rev > 1U || (int )phy->gmode); b43_gphy_set_baseband_attenuation(dev, (int )bbatt->att); lo_probe_loctls_statemachine(dev, & loctl, & max_rx_gain); lo_measure_restore(dev, & saved_regs); b43_mac_enable(dev); tmp = b43_debug(dev, 5); if ((int )tmp) { b43dbg(dev->wl, "LO: Calibrated for BB(%u), RF(%u,%u) => I=%d Q=%d\n", (int )bbatt->att, (int )rfatt->att, (int )rfatt->with_padmix, (int )loctl.i, (int )loctl.q); } else { } tmp___0 = kmalloc(32UL, 208U); cal = (struct b43_lo_calib *)tmp___0; if ((unsigned long )cal == (unsigned long )((struct b43_lo_calib *)0)) { b43warn(dev->wl, "LO calib: out of memory\n"); return ((struct b43_lo_calib *)0); } else { } __len = 1UL; if (__len > 63UL) { __ret = memcpy((void *)(& cal->bbatt), (void const *)bbatt, __len); } else { __ret = __builtin_memcpy((void *)(& cal->bbatt), (void const *)bbatt, __len); } __len___0 = 2UL; if (__len___0 > 63UL) { __ret___0 = memcpy((void *)(& cal->rfatt), (void const *)rfatt, __len___0); } else { __ret___0 = __builtin_memcpy((void *)(& cal->rfatt), (void const *)rfatt, __len___0); } __len___1 = 2UL; if (__len___1 > 63UL) { __ret___1 = memcpy((void *)(& cal->ctl), (void const *)(& loctl), __len___1); } else { __ret___1 = __builtin_memcpy((void *)(& cal->ctl), (void const *)(& loctl), __len___1); } cal->calib_time = jiffies; INIT_LIST_HEAD(& cal->list); return (cal); } } static struct b43_lo_calib *b43_get_calib_lo_settings(struct b43_wldev *dev , struct b43_bbatt const *bbatt , struct b43_rfatt const *rfatt ) { struct b43_txpower_lo_control *lo ; struct b43_lo_calib *c ; { lo = (dev->phy.__annonCompField40.g)->lo_control; c = b43_find_lo_calib(lo, bbatt, rfatt); if ((unsigned long )c != (unsigned long )((struct b43_lo_calib *)0)) { return (c); } else { } c = b43_calibrate_lo_setting(dev, bbatt, rfatt); if ((unsigned long )c == (unsigned long )((struct b43_lo_calib *)0)) { return ((struct b43_lo_calib *)0); } else { } list_add(& c->list, & lo->calib_list); return (c); } } void b43_gphy_dc_lt_init(struct b43_wldev *dev , bool update_all ) { struct b43_phy *phy ; struct b43_phy_g *gphy ; struct b43_txpower_lo_control *lo ; int i ; int rf_offset ; int bb_offset ; struct b43_rfatt const *rfatt ; struct b43_bbatt const *bbatt ; u64 power_vector ; bool table_changed ; int __ret_warn_on ; long tmp ; struct b43_lo_calib *cal ; int idx ; u16 val ; { phy = & dev->phy; gphy = phy->__annonCompField40.g; lo = gphy->lo_control; table_changed = 0; __ret_warn_on = (int )lo->rfatt_list.len * (int )lo->bbatt_list.len > 64; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/lo.c", 834); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); power_vector = lo->power_vector; if (! update_all && power_vector == 0ULL) { return; } else { } b43_mac_suspend(dev); i = 0; goto ldv_37296; ldv_37295: ; if (! update_all && ((power_vector >> i) & 1ULL) == 0ULL) { goto ldv_37294; } else { } bb_offset = i / (int )lo->rfatt_list.len; rf_offset = i % (int )lo->rfatt_list.len; bbatt = lo->bbatt_list.list + (unsigned long )bb_offset; rfatt = lo->rfatt_list.list + (unsigned long )rf_offset; cal = b43_calibrate_lo_setting(dev, bbatt, rfatt); if ((unsigned long )cal == (unsigned long )((struct b43_lo_calib *)0)) { b43warn(dev->wl, "LO: Could not calibrate DC table entry\n"); goto ldv_37294; } else { } val = (u16 )((unsigned char )cal->ctl.q); val = (u16 )((int )((short )((int )((unsigned char )cal->ctl.i) << 4)) | (int )((short )val)); kfree((void const *)cal); idx = i / 2; if (i & 1) { lo->dc_lt[idx] = (u16 )(((int )((short )lo->dc_lt[idx]) & 255) | (int )((short )((int )val << 8))); } else { lo->dc_lt[idx] = (u16 )(((int )((short )lo->dc_lt[idx]) & -256) | ((int )((short )val) & 255)); } table_changed = 1; ldv_37294: i = i + 1; ldv_37296: ; if (i <= 63) { goto ldv_37295; } else { } if ((int )table_changed) { i = 0; goto ldv_37299; ldv_37298: b43_phy_write(dev, (int )((unsigned int )((u16 )i) + 928U), (int )lo->dc_lt[i]); i = i + 1; ldv_37299: ; if (i <= 31) { goto ldv_37298; } else { } } else { } b43_mac_enable(dev); return; } } __inline static void b43_lo_fixup_rfatt(struct b43_rfatt *rf ) { { if (! rf->with_padmix) { return; } else { } if (((unsigned int )rf->att != 1U && (unsigned int )rf->att != 2U) && (unsigned int )rf->att != 3U) { rf->att = 4U; } else { } return; } } void b43_lo_g_adjust(struct b43_wldev *dev ) { struct b43_phy_g *gphy ; struct b43_lo_calib *cal ; struct b43_rfatt rf ; size_t __len ; void *__ret ; { gphy = dev->phy.__annonCompField40.g; __len = 2UL; if (__len > 63UL) { __ret = memcpy((void *)(& rf), (void const *)(& gphy->rfatt), __len); } else { __ret = __builtin_memcpy((void *)(& rf), (void const *)(& gphy->rfatt), __len); } b43_lo_fixup_rfatt(& rf); cal = b43_get_calib_lo_settings(dev, (struct b43_bbatt const *)(& gphy->bbatt), (struct b43_rfatt const *)(& rf)); if ((unsigned long )cal == (unsigned long )((struct b43_lo_calib *)0)) { return; } else { } b43_lo_write(dev, & cal->ctl); return; } } void b43_lo_g_adjust_to(struct b43_wldev *dev , u16 rfatt , u16 bbatt , u16 tx_control ) { struct b43_rfatt rf ; struct b43_bbatt bb ; struct b43_lo_calib *cal ; { memset((void *)(& rf), 0, 2UL); memset((void *)(& bb), 0, 1UL); rf.att = (u8 )rfatt; bb.att = (u8 )bbatt; b43_lo_fixup_rfatt(& rf); cal = b43_get_calib_lo_settings(dev, (struct b43_bbatt const *)(& bb), (struct b43_rfatt const *)(& rf)); if ((unsigned long )cal == (unsigned long )((struct b43_lo_calib *)0)) { return; } else { } b43_lo_write(dev, & cal->ctl); return; } } void b43_lo_g_maintanance_work(struct b43_wldev *dev ) { struct b43_phy *phy ; struct b43_phy_g *gphy ; struct b43_txpower_lo_control *lo ; unsigned long now ; unsigned long expire ; struct b43_lo_calib *cal ; struct b43_lo_calib *tmp ; bool current_item_expired ; bool hwpctl ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; int __ret_warn_on ; long tmp___0 ; bool tmp___1 ; bool tmp___2 ; bool tmp___3 ; struct list_head const *__mptr___1 ; bool tmp___4 ; int tmp___5 ; long tmp___6 ; { phy = & dev->phy; gphy = phy->__annonCompField40.g; lo = gphy->lo_control; current_item_expired = 0; if ((unsigned long )lo == (unsigned long )((struct b43_txpower_lo_control *)0)) { return; } else { } now = jiffies; hwpctl = b43_has_hardware_pctl(dev); if ((int )hwpctl) { expire = now - 7000UL; if ((long )lo->pwr_vec_read_time - (long )expire < 0L) { lo_read_power_vector(dev); b43_gphy_dc_lt_init(dev, 0); } else { } } else { } if ((int )hwpctl) { return; } else { } expire = now - 7000UL; __mptr = (struct list_head const *)lo->calib_list.next; cal = (struct b43_lo_calib *)__mptr + 0xfffffffffffffff0UL; __mptr___0 = (struct list_head const *)cal->list.next; tmp = (struct b43_lo_calib *)__mptr___0 + 0xfffffffffffffff0UL; goto ldv_37356; ldv_37355: ; if ((long )cal->calib_time - (long )expire >= 0L) { goto ldv_37352; } else { } tmp___1 = b43_compare_bbatt((struct b43_bbatt const *)(& cal->bbatt), (struct b43_bbatt const *)(& gphy->bbatt)); if ((int )tmp___1) { tmp___2 = b43_compare_rfatt((struct b43_rfatt const *)(& cal->rfatt), (struct b43_rfatt const *)(& gphy->rfatt)); if ((int )tmp___2) { __ret_warn_on = (int )current_item_expired; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/lo.c", 972); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); current_item_expired = 1; } else { } } else { } tmp___3 = b43_debug(dev, 5); if ((int )tmp___3) { b43dbg(dev->wl, "LO: Item BB(%u), RF(%u,%u), I=%d, Q=%d expired\n", (int )cal->bbatt.att, (int )cal->rfatt.att, (int )cal->rfatt.with_padmix, (int )cal->ctl.i, (int )cal->ctl.q); } else { } list_del(& cal->list); kfree((void const *)cal); ldv_37352: cal = tmp; __mptr___1 = (struct list_head const *)tmp->list.next; tmp = (struct b43_lo_calib *)__mptr___1 + 0xfffffffffffffff0UL; ldv_37356: ; if ((unsigned long )(& cal->list) != (unsigned long )(& lo->calib_list)) { goto ldv_37355; } else { } if ((int )current_item_expired) { goto _L; } else { tmp___5 = list_empty((struct list_head const *)(& lo->calib_list)); tmp___6 = ldv__builtin_expect(tmp___5 != 0, 0L); if (tmp___6 != 0L) { _L: /* CIL Label */ tmp___4 = b43_debug(dev, 5); if ((int )tmp___4) { b43dbg(dev->wl, "LO: Recalibrating current LO setting\n"); } else { } cal = b43_calibrate_lo_setting(dev, (struct b43_bbatt const *)(& gphy->bbatt), (struct b43_rfatt const *)(& gphy->rfatt)); if ((unsigned long )cal != (unsigned long )((struct b43_lo_calib *)0)) { list_add(& cal->list, & lo->calib_list); b43_lo_write(dev, & cal->ctl); } else { b43warn(dev->wl, "Failed to recalibrate current LO setting\n"); } } else { } } return; } } void b43_lo_g_cleanup(struct b43_wldev *dev ) { struct b43_txpower_lo_control *lo ; struct b43_lo_calib *cal ; struct b43_lo_calib *tmp ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; { lo = (dev->phy.__annonCompField40.g)->lo_control; if ((unsigned long )lo == (unsigned long )((struct b43_txpower_lo_control *)0)) { return; } else { } __mptr = (struct list_head const *)lo->calib_list.next; cal = (struct b43_lo_calib *)__mptr + 0xfffffffffffffff0UL; __mptr___0 = (struct list_head const *)cal->list.next; tmp = (struct b43_lo_calib *)__mptr___0 + 0xfffffffffffffff0UL; goto ldv_37371; ldv_37370: list_del(& cal->list); kfree((void const *)cal); cal = tmp; __mptr___1 = (struct list_head const *)tmp->list.next; tmp = (struct b43_lo_calib *)__mptr___1 + 0xfffffffffffffff0UL; ldv_37371: ; if ((unsigned long )(& cal->list) != (unsigned long )(& lo->calib_list)) { goto ldv_37370; } else { } return; } } void b43_lo_g_init(struct b43_wldev *dev ) { bool tmp ; { tmp = b43_has_hardware_pctl(dev); if ((int )tmp) { lo_read_power_vector(dev); b43_gphy_dc_lt_init(dev, 1); } else { } return; } } int ldv_del_timer_sync_63(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type ldv_func_res ; int tmp ; { tmp = del_timer_sync(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_9(ldv_func_arg1); return (ldv_func_res); } } int ldv_del_timer_64(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___0 ldv_func_res ; int tmp ; { tmp = del_timer(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_9(ldv_func_arg1); return (ldv_func_res); } } int ldv_request_threaded_irq_65(unsigned int ldv_func_arg1 , irqreturn_t (*handler)(int , void * ) , irqreturn_t (*thread_fn)(int , void * ) , unsigned long ldv_func_arg4 , char const *ldv_func_arg5 , void *ldv_func_arg6 ) { ldv_func_ret_type___1 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = request_threaded_irq(ldv_func_arg1, handler, thread_fn, ldv_func_arg4, ldv_func_arg5, ldv_func_arg6); ldv_func_res = tmp; tmp___0 = reg_check_2(handler, thread_fn); if (tmp___0 != 0 && ldv_func_res >= 0) { activate_suitable_irq_2((int )ldv_func_arg1, ldv_func_arg6); } else { } return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; int ldv_del_timer_70(struct timer_list *ldv_func_arg1 ) ; int ldv_del_timer_sync_69(struct timer_list *ldv_func_arg1 ) ; int ldv_request_threaded_irq_71(unsigned int ldv_func_arg1 , irqreturn_t (*handler)(int , void * ) , irqreturn_t (*thread_fn)(int , void * ) , unsigned long ldv_func_arg4 , char const *ldv_func_arg5 , void *ldv_func_arg6 ) ; static void b43_wa_papd(struct b43_wldev *dev ) { u16 backup ; { backup = b43_ofdmtab_read16(dev, 14348, 0); b43_ofdmtab_write16(dev, 14348, 0, 7); b43_ofdmtab_write16(dev, 15367, 0, 0); b43_dummy_transmission(dev, 1, 1); b43_ofdmtab_write16(dev, 14348, 0, (int )backup); return; } } static void b43_wa_auxclipthr(struct b43_wldev *dev ) { { b43_phy_write(dev, 1166, 14336); return; } } static void b43_wa_afcdac(struct b43_wldev *dev ) { { b43_phy_write(dev, 53, 1023); b43_phy_write(dev, 54, 1024); return; } } static void b43_wa_txdc_offset(struct b43_wldev *dev ) { { b43_ofdmtab_write16(dev, 14343, 0, 81); return; } } void b43_wa_initgains(struct b43_wldev *dev ) { struct b43_phy *phy ; { phy = & dev->phy; b43_phy_write(dev, 1052, 8185); b43_phy_mask(dev, 1056, 65295); if ((unsigned int )phy->rev <= 2U) { b43_ofdmtab_write16(dev, 15372, 0, 8127); } else { } b43_radio_write(dev, 2, 8127); b43_phy_write(dev, 36, 18048); b43_phy_write(dev, 32, 3); b43_phy_write(dev, 29, 3904); b43_phy_write(dev, 31, 7168); if ((unsigned int )phy->rev <= 3U) { b43_phy_maskset(dev, 42, 255, 1024); } else if ((unsigned int )phy->rev == 5U) { b43_phy_maskset(dev, 42, 255, 6656); b43_phy_write(dev, 204, 8481); } else { } if ((unsigned int )phy->rev > 2U) { b43_phy_write(dev, 186, 16085); } else { } return; } } static void b43_wa_divider(struct b43_wldev *dev ) { { b43_phy_mask(dev, 43, 65279); b43_phy_write(dev, 142, 22721); return; } } static void b43_wa_gt(struct b43_wldev *dev ) { { if ((unsigned int )dev->phy.rev <= 2U) { b43_ofdmtab_write16(dev, 2051, 0, 15); b43_ofdmtab_write16(dev, 2051, 1, 31); b43_ofdmtab_write16(dev, 2051, 2, 42); b43_ofdmtab_write16(dev, 2051, 3, 48); b43_ofdmtab_write16(dev, 2051, 4, 58); b43_ofdmtab_write16(dev, 0, 0, 19); b43_ofdmtab_write16(dev, 0, 1, 19); b43_ofdmtab_write16(dev, 0, 2, 19); b43_ofdmtab_write16(dev, 0, 3, 19); b43_ofdmtab_write16(dev, 0, 4, 21); b43_ofdmtab_write16(dev, 0, 5, 21); b43_ofdmtab_write16(dev, 0, 6, 25); b43_ofdmtab_write16(dev, 1028, 0, 3); b43_ofdmtab_write16(dev, 1028, 1, 3); b43_ofdmtab_write16(dev, 1028, 2, 7); } else { b43_ofdmtab_write16(dev, 0, 0, 19); b43_ofdmtab_write16(dev, 0, 1, 19); b43_ofdmtab_write16(dev, 0, 2, 19); b43_ofdmtab_write16(dev, 0, 3, 19); b43_ofdmtab_write16(dev, 0, 4, 21); b43_ofdmtab_write16(dev, 0, 5, 21); b43_ofdmtab_write16(dev, 0, 6, 25); } return; } } static void b43_wa_rssi_lt(struct b43_wldev *dev ) { int i ; { if (0) { i = 0; goto ldv_37061; ldv_37060: b43_ofdmtab_write16(dev, 16384, (int )((u16 )i), (int )((unsigned int )((u16 )i) + 8U)); i = i + 1; ldv_37061: ; if (i <= 7) { goto ldv_37060; } else { } i = 8; goto ldv_37064; ldv_37063: b43_ofdmtab_write16(dev, 16384, (int )((u16 )i), (int )((unsigned int )((u16 )i) + 65528U)); i = i + 1; ldv_37064: ; if (i <= 15) { goto ldv_37063; } else { } } else { i = 0; goto ldv_37067; ldv_37066: b43_ofdmtab_write16(dev, 16384, (int )((u16 )i), (int )((u16 )i)); i = i + 1; ldv_37067: ; if (i <= 63) { goto ldv_37066; } else { } } return; } } static void b43_wa_analog(struct b43_wldev *dev ) { struct b43_phy *phy ; u16 ofdmrev ; u16 tmp ; { phy = & dev->phy; tmp = b43_phy_read(dev, 1024); ofdmrev = (unsigned int )tmp & 255U; if ((unsigned int )ofdmrev > 2U) { if ((unsigned int )phy->type == 0U) { b43_phy_write(dev, 1027, 6152); } else { b43_phy_write(dev, 1027, 4096); } } else { b43_ofdmtab_write16(dev, 12288, 3, 4164); b43_ofdmtab_write16(dev, 12288, 4, 29185); b43_ofdmtab_write16(dev, 12288, 6, 64); } return; } } static void b43_wa_dac(struct b43_wldev *dev ) { u16 tmp ; u16 tmp___0 ; { if ((unsigned int )dev->phy.analog == 1U) { tmp = b43_ofdmtab_read16(dev, 12288, 1); b43_ofdmtab_write16(dev, 12288, 1, (int )((u16 )(((int )((short )tmp) & -61) | 8))); } else { tmp___0 = b43_ofdmtab_read16(dev, 12288, 1); b43_ofdmtab_write16(dev, 12288, 1, (int )((u16 )(((int )((short )tmp___0) & -121) | 16))); } return; } } static void b43_wa_fft(struct b43_wldev *dev ) { int i ; { if ((unsigned int )dev->phy.type == 0U) { i = 0; goto ldv_37082; ldv_37081: b43_ofdmtab_write16(dev, 22528, (int )((u16 )i), (int )b43_tab_finefreqa[i]); i = i + 1; ldv_37082: ; if (i <= 255) { goto ldv_37081; } else { } } else { i = 0; goto ldv_37085; ldv_37084: b43_ofdmtab_write16(dev, 22528, (int )((u16 )i), (int )b43_tab_finefreqg[i]); i = i + 1; ldv_37085: ; if (i <= 255) { goto ldv_37084; } else { } } return; } } static void b43_wa_nft(struct b43_wldev *dev ) { struct b43_phy *phy ; int i ; { phy = & dev->phy; if ((unsigned int )phy->type == 0U) { if ((unsigned int )phy->rev == 2U) { i = 0; goto ldv_37093; ldv_37092: b43_ofdmtab_write16(dev, 6144, (int )((u16 )i), (int )b43_tab_noisea2[i]); i = i + 1; ldv_37093: ; if (i <= 7) { goto ldv_37092; } else { } } else { i = 0; goto ldv_37096; ldv_37095: b43_ofdmtab_write16(dev, 6144, (int )((u16 )i), (int )b43_tab_noisea3[i]); i = i + 1; ldv_37096: ; if (i <= 7) { goto ldv_37095; } else { } } } else if ((unsigned int )phy->rev == 1U) { i = 0; goto ldv_37099; ldv_37098: b43_ofdmtab_write16(dev, 6144, (int )((u16 )i), (int )b43_tab_noiseg1[i]); i = i + 1; ldv_37099: ; if (i <= 7) { goto ldv_37098; } else { } } else { i = 0; goto ldv_37102; ldv_37101: b43_ofdmtab_write16(dev, 6144, (int )((u16 )i), (int )b43_tab_noiseg2[i]); i = i + 1; ldv_37102: ; if (i <= 7) { goto ldv_37101; } else { } } return; } } static void b43_wa_rt(struct b43_wldev *dev ) { int i ; { i = 0; goto ldv_37109; ldv_37108: b43_ofdmtab_write32(dev, 8192, (int )((u16 )i), b43_tab_rotor[i]); i = i + 1; ldv_37109: ; if (i <= 52) { goto ldv_37108; } else { } return; } } static void b43_write_null_nst(struct b43_wldev *dev ) { int i ; { i = 0; goto ldv_37116; ldv_37115: b43_ofdmtab_write16(dev, 5120, (int )((u16 )i), 0); i = i + 1; ldv_37116: ; if (i <= 26) { goto ldv_37115; } else { } return; } } static void b43_write_nst(struct b43_wldev *dev , u16 const *nst ) { int i ; { i = 0; goto ldv_37124; ldv_37123: b43_ofdmtab_write16(dev, 5120, (int )((u16 )i), (int )*(nst + (unsigned long )i)); i = i + 1; ldv_37124: ; if (i <= 26) { goto ldv_37123; } else { } return; } } static void b43_wa_nst(struct b43_wldev *dev ) { struct b43_phy *phy ; u16 tmp ; { phy = & dev->phy; if ((unsigned int )phy->type == 0U) { if ((unsigned int )phy->rev <= 1U) { b43_write_null_nst(dev); } else if ((unsigned int )phy->rev == 2U) { b43_write_nst(dev, (u16 const *)(& b43_tab_noisescalea2)); } else if ((unsigned int )phy->rev == 3U) { b43_write_nst(dev, (u16 const *)(& b43_tab_noisescalea3)); } else { b43_write_nst(dev, (u16 const *)(& b43_tab_noisescaleg3)); } } else if ((unsigned int )phy->rev > 5U) { tmp = b43_phy_read(dev, 1097); if (((int )tmp & 512) != 0) { b43_write_nst(dev, (u16 const *)(& b43_tab_noisescaleg3)); } else { b43_write_nst(dev, (u16 const *)(& b43_tab_noisescaleg2)); } } else { b43_write_nst(dev, (u16 const *)(& b43_tab_noisescaleg1)); } return; } } static void b43_wa_art(struct b43_wldev *dev ) { int i ; { i = 0; goto ldv_37135; ldv_37134: b43_ofdmtab_write32(dev, 9216, (int )((u16 )i), b43_tab_retard[i]); i = i + 1; ldv_37135: ; if (i <= 52) { goto ldv_37134; } else { } return; } } static void b43_wa_txlna_gain(struct b43_wldev *dev ) { { b43_ofdmtab_write16(dev, 14343, 13, 0); return; } } static void b43_wa_crs_reset(struct b43_wldev *dev ) { { b43_phy_write(dev, 44, 100); return; } } static void b43_wa_2060txlna_gain(struct b43_wldev *dev ) { u64 tmp ; { tmp = b43_hf_read(dev); b43_hf_write(dev, tmp | 4096ULL); return; } } static void b43_wa_lms(struct b43_wldev *dev ) { { b43_phy_maskset(dev, 85, 65472, 4); return; } } static void b43_wa_mixedsignal(struct b43_wldev *dev ) { { b43_ofdmtab_write16(dev, 12288, 1, 3); return; } } static void b43_wa_msst(struct b43_wldev *dev ) { struct b43_phy *phy ; int i ; u16 const *tab ; int __ret_warn_on ; long tmp ; { phy = & dev->phy; if ((unsigned int )phy->type == 0U) { tab = (u16 const *)(& b43_tab_sigmasqr1); } else if ((unsigned int )phy->type == 2U) { tab = (u16 const *)(& b43_tab_sigmasqr2); } else { __ret_warn_on = 1; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/wa.c", 291); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); return; } i = 0; goto ldv_37161; ldv_37160: b43_ofdmtab_write16(dev, 20480, (int )((u16 )i), (int )*(tab + (unsigned long )i)); i = i + 1; ldv_37161: ; if (i <= 52) { goto ldv_37160; } else { } return; } } static void b43_wa_iqadc(struct b43_wldev *dev ) { u16 tmp ; { if ((unsigned int )dev->phy.analog == 4U) { tmp = b43_ofdmtab_read16(dev, 12288, 0); b43_ofdmtab_write16(dev, 12288, 0, (int )tmp & 4095); } else { } return; } } static void b43_wa_crs_ed(struct b43_wldev *dev ) { struct b43_phy *phy ; { phy = & dev->phy; if ((unsigned int )phy->rev == 1U) { b43_phy_write(dev, 1030, 20249); } else if ((unsigned int )phy->rev == 2U) { b43_phy_write(dev, 1216, 6241); b43_phy_write(dev, 1217, 625); b43_phy_set(dev, 1067, 2048); } else { b43_phy_write(dev, 1216, 152); b43_phy_write(dev, 1217, 112); b43_phy_write(dev, 1225, 128); b43_phy_set(dev, 1067, 2048); } return; } } static void b43_wa_crs_thr(struct b43_wldev *dev ) { { b43_phy_maskset(dev, 1065, 64575, 53248); return; } } static void b43_wa_crs_blank(struct b43_wldev *dev ) { { b43_phy_write(dev, 1068, 90); return; } } static void b43_wa_cck_shiftbits(struct b43_wldev *dev ) { { b43_phy_write(dev, 1191, 38); return; } } static void b43_wa_wrssi_offset(struct b43_wldev *dev ) { int i ; { if ((unsigned int )dev->phy.rev == 1U) { i = 0; goto ldv_37184; ldv_37183: b43_ofdmtab_write16(dev, 21508, (int )((u16 )i), 32); i = i + 1; ldv_37184: ; if (i <= 15) { goto ldv_37183; } else { } } else { i = 0; goto ldv_37187; ldv_37186: b43_ofdmtab_write16(dev, 4096, (int )((u16 )i), 2080); i = i + 1; ldv_37187: ; if (i <= 31) { goto ldv_37186; } else { } } return; } } static void b43_wa_txpuoff_rxpuon(struct b43_wldev *dev ) { { b43_ofdmtab_write16(dev, 15360, 2, 15); b43_ofdmtab_write16(dev, 15360, 3, 20); return; } } static void b43_wa_altagc(struct b43_wldev *dev ) { struct b43_phy *phy ; { phy = & dev->phy; if ((unsigned int )phy->rev == 1U) { b43_ofdmtab_write16(dev, 19456, 0, 254); b43_ofdmtab_write16(dev, 19456, 1, 13); b43_ofdmtab_write16(dev, 19456, 2, 19); b43_ofdmtab_write16(dev, 19456, 3, 25); b43_ofdmtab_write16(dev, 6144, 0, 10000); b43_ofdmtab_write16(dev, 6144, 1, 39811); b43_ofdmtab_write16(dev, 6144, 2, 39811); b43_ofdmtab_write16(dev, 6144, 3, 3981); b43_phy_write(dev, 1109, 4); } else { b43_ofdmtab_write16(dev, 0, 0, 254); b43_ofdmtab_write16(dev, 0, 1, 13); b43_ofdmtab_write16(dev, 0, 2, 19); b43_ofdmtab_write16(dev, 0, 3, 25); } b43_phy_maskset(dev, 1189, 255, 22272); b43_phy_maskset(dev, 1050, 65408, 15); b43_phy_maskset(dev, 1050, 49279, 11136); b43_phy_maskset(dev, 1164, 61695, 768); b43_radio_set(dev, 122, 8); b43_phy_maskset(dev, 1184, 65520, 8); b43_phy_maskset(dev, 1185, 61695, 1536); b43_phy_maskset(dev, 1186, 61695, 1792); b43_phy_maskset(dev, 1184, 61695, 256); if ((unsigned int )phy->rev == 1U) { b43_phy_maskset(dev, 1186, 65520, 7); } else { } b43_phy_maskset(dev, 1160, 65280, 28); b43_phy_maskset(dev, 1160, 49407, 512); b43_phy_maskset(dev, 1174, 65280, 28); b43_phy_maskset(dev, 1161, 65280, 32); b43_phy_maskset(dev, 1161, 49407, 512); b43_phy_maskset(dev, 1154, 65280, 46); b43_phy_maskset(dev, 1174, 255, 6656); b43_phy_maskset(dev, 1153, 65280, 40); b43_phy_maskset(dev, 1153, 255, 11264); if ((unsigned int )phy->rev == 1U) { b43_phy_write(dev, 1072, 2347); b43_phy_maskset(dev, 1051, 65505, 2); } else { b43_phy_mask(dev, 1051, 65505); b43_phy_write(dev, 1055, 10362); b43_phy_maskset(dev, 1056, 65520, 4); if ((unsigned int )phy->rev > 5U) { b43_phy_write(dev, 1058, 10362); b43_phy_maskset(dev, 1056, 4095, 12288); } else { } } b43_phy_maskset(dev, 1192, 32896, 30836); b43_phy_write(dev, 1166, 7168); if ((unsigned int )phy->rev == 1U) { b43_phy_maskset(dev, 1195, 61695, 1536); b43_phy_write(dev, 1163, 94); b43_phy_maskset(dev, 1164, 65280, 30); b43_phy_write(dev, 1165, 2); b43_ofdmtab_write16(dev, 21504, 0, 0); b43_ofdmtab_write16(dev, 21504, 1, 7); b43_ofdmtab_write16(dev, 21504, 2, 16); b43_ofdmtab_write16(dev, 21504, 3, 28); } else { b43_ofdmtab_write16(dev, 2048, 0, 0); b43_ofdmtab_write16(dev, 2048, 1, 7); b43_ofdmtab_write16(dev, 2048, 2, 16); b43_ofdmtab_write16(dev, 2048, 3, 28); } if ((unsigned int )phy->rev > 5U) { b43_phy_mask(dev, 1062, 65532); b43_phy_mask(dev, 1062, 61439); } else { } b43_phy_read(dev, 1024); return; } } static void b43_wa_tr_ltov(struct b43_wldev *dev ) { { b43_gtab_write(dev, 47768, 0, 50304); return; } } static void b43_wa_cpll_nonpilot(struct b43_wldev *dev ) { { b43_ofdmtab_write16(dev, 17412, 0, 0); b43_ofdmtab_write16(dev, 17412, 1, 0); return; } } static void b43_wa_rssi_adc(struct b43_wldev *dev ) { { if ((unsigned int )dev->phy.analog == 4U) { b43_phy_write(dev, 220, 29780); } else { } return; } } static void b43_wa_boards_a(struct b43_wldev *dev ) { struct ssb_bus *bus ; { bus = (dev->dev)->bus; if (((unsigned int )bus->boardinfo.vendor == 5348U && (unsigned int )bus->boardinfo.type == 1046U) && (unsigned int )bus->boardinfo.rev <= 47U) { b43_phy_write(dev, 16, 57344); b43_phy_write(dev, 19, 320); b43_phy_write(dev, 20, 640); } else { if ((unsigned int )bus->boardinfo.type == 1098U && (unsigned int )bus->boardinfo.rev <= 31U) { b43_phy_write(dev, 19, 528); b43_phy_write(dev, 20, 2112); } else { b43_phy_write(dev, 19, 320); b43_phy_write(dev, 20, 640); } if ((unsigned int )dev->phy.rev <= 4U) { b43_phy_write(dev, 16, 57344); } else { b43_phy_write(dev, 16, 8192); } b43_ofdmtab_write16(dev, 14343, 1, 57); b43_ofdmtab_write16(dev, 15367, 7, 64); } return; } } static void b43_wa_boards_g(struct b43_wldev *dev ) { struct ssb_bus *bus ; struct b43_phy *phy ; { bus = (dev->dev)->bus; phy = & dev->phy; if (((unsigned int )bus->boardinfo.vendor != 5348U || (unsigned int )bus->boardinfo.type != 1046U) || (unsigned int )bus->boardinfo.rev != 23U) { if ((unsigned int )phy->rev <= 1U) { b43_ofdmtab_write16(dev, 20480, 1, 2); b43_ofdmtab_write16(dev, 20480, 2, 1); } else { b43_ofdmtab_write16(dev, 1024, 1, 2); b43_ofdmtab_write16(dev, 1024, 2, 1); if (((int )bus->sprom.boardflags_lo & 4096) != 0 && (unsigned int )phy->rev > 6U) { b43_phy_mask(dev, 2065, 63487); b43_ofdmtab_write16(dev, 1024, 32, 1); b43_ofdmtab_write16(dev, 1024, 33, 1); b43_ofdmtab_write16(dev, 1024, 34, 1); b43_ofdmtab_write16(dev, 1024, 35, 0); b43_ofdmtab_write16(dev, 1024, 0, 0); b43_ofdmtab_write16(dev, 1024, 3, 2); } else { } } } else { } if (((int )bus->sprom.boardflags_lo & 2048) != 0) { b43_phy_write(dev, 2051, 12576); b43_phy_write(dev, 2052, 50304); } else { } return; } } void b43_wa_all(struct b43_wldev *dev ) { struct b43_phy *phy ; int __ret_warn_on ; long tmp ; int __ret_warn_on___0 ; long tmp___0 ; int __ret_warn_on___1 ; long tmp___1 ; { phy = & dev->phy; if ((unsigned int )phy->type == 0U) { switch ((int )phy->rev) { case 2: b43_wa_papd(dev); b43_wa_auxclipthr(dev); b43_wa_afcdac(dev); b43_wa_txdc_offset(dev); b43_wa_initgains(dev); b43_wa_divider(dev); b43_wa_gt(dev); b43_wa_rssi_lt(dev); b43_wa_analog(dev); b43_wa_dac(dev); b43_wa_fft(dev); b43_wa_nft(dev); b43_wa_rt(dev); b43_wa_nst(dev); b43_wa_art(dev); b43_wa_txlna_gain(dev); b43_wa_crs_reset(dev); b43_wa_2060txlna_gain(dev); b43_wa_lms(dev); goto ldv_37219; case 3: b43_wa_papd(dev); b43_wa_mixedsignal(dev); b43_wa_rssi_lt(dev); b43_wa_txdc_offset(dev); b43_wa_initgains(dev); b43_wa_dac(dev); b43_wa_nft(dev); b43_wa_nst(dev); b43_wa_msst(dev); b43_wa_analog(dev); b43_wa_gt(dev); b43_wa_txpuoff_rxpuon(dev); b43_wa_txlna_gain(dev); goto ldv_37219; case 5: b43_wa_iqadc(dev); case 6: b43_wa_papd(dev); b43_wa_rssi_lt(dev); b43_wa_txdc_offset(dev); b43_wa_initgains(dev); b43_wa_dac(dev); b43_wa_nft(dev); b43_wa_nst(dev); b43_wa_msst(dev); b43_wa_analog(dev); b43_wa_gt(dev); b43_wa_txpuoff_rxpuon(dev); b43_wa_txlna_gain(dev); goto ldv_37219; case 7: b43_wa_iqadc(dev); b43_wa_papd(dev); b43_wa_rssi_lt(dev); b43_wa_txdc_offset(dev); b43_wa_initgains(dev); b43_wa_dac(dev); b43_wa_nft(dev); b43_wa_nst(dev); b43_wa_msst(dev); b43_wa_analog(dev); b43_wa_gt(dev); b43_wa_txpuoff_rxpuon(dev); b43_wa_txlna_gain(dev); b43_wa_rssi_adc(dev); default: __ret_warn_on = 1; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/wa.c", 593); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); } ldv_37219: b43_wa_boards_a(dev); } else if ((unsigned int )phy->type == 2U) { switch ((int )phy->rev) { case 1: b43_wa_crs_ed(dev); b43_wa_crs_thr(dev); b43_wa_crs_blank(dev); b43_wa_cck_shiftbits(dev); b43_wa_fft(dev); b43_wa_nft(dev); b43_wa_rt(dev); b43_wa_nst(dev); b43_wa_art(dev); b43_wa_wrssi_offset(dev); b43_wa_altagc(dev); goto ldv_37228; case 2: ; case 6: ; case 7: ; case 8: ; case 9: b43_wa_tr_ltov(dev); b43_wa_crs_ed(dev); b43_wa_rssi_lt(dev); b43_wa_nft(dev); b43_wa_nst(dev); b43_wa_msst(dev); b43_wa_wrssi_offset(dev); b43_wa_altagc(dev); b43_wa_analog(dev); b43_wa_txpuoff_rxpuon(dev); goto ldv_37228; default: __ret_warn_on___0 = 1; tmp___0 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/wa.c", 628); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); } ldv_37228: b43_wa_boards_g(dev); } else { __ret_warn_on___1 = 1; tmp___1 = ldv__builtin_expect(__ret_warn_on___1 != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/wa.c", 632); } else { } ldv__builtin_expect(__ret_warn_on___1 != 0, 0L); } b43_wa_cpll_nonpilot(dev); return; } } int ldv_del_timer_sync_69(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type ldv_func_res ; int tmp ; { tmp = del_timer_sync(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_9(ldv_func_arg1); return (ldv_func_res); } } int ldv_del_timer_70(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___0 ldv_func_res ; int tmp ; { tmp = del_timer(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_9(ldv_func_arg1); return (ldv_func_res); } } int ldv_request_threaded_irq_71(unsigned int ldv_func_arg1 , irqreturn_t (*handler)(int , void * ) , irqreturn_t (*thread_fn)(int , void * ) , unsigned long ldv_func_arg4 , char const *ldv_func_arg5 , void *ldv_func_arg6 ) { ldv_func_ret_type___1 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = request_threaded_irq(ldv_func_arg1, handler, thread_fn, ldv_func_arg4, ldv_func_arg5, ldv_func_arg6); ldv_func_res = tmp; tmp___0 = reg_check_2(handler, thread_fn); if (tmp___0 != 0 && ldv_func_res >= 0) { activate_suitable_irq_2((int )ldv_func_arg1, ldv_func_arg6); } else { } return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; extern unsigned long __phys_addr(unsigned long ) ; extern struct pv_irq_ops pv_irq_ops ; extern void *kmemdup(void const * , size_t , gfp_t ) ; __inline static unsigned long __raw_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 *)"/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/inst/current/envs/linux-stable-1575714-1/linux-stable-1575714-1/arch/x86/include/asm/paravirt.h"), "i" (834), "i" (12UL)); ldv_4219: ; goto ldv_4219; } 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.save_fl.func), [paravirt_clobber] "i" (1): "memory", "cc"); __ret = __eax; return (__ret); } } __inline static int raw_irqs_disabled_flags(unsigned long flags ) { { return ((flags & 512UL) == 0UL); } } __inline static void *ERR_PTR(long error ) { { return ((void *)error); } } int ldv_del_timer_76(struct timer_list *ldv_func_arg1 ) ; int ldv_del_timer_sync_75(struct timer_list *ldv_func_arg1 ) ; int ldv_request_threaded_irq_77(unsigned int ldv_func_arg1 , irqreturn_t (*handler)(int , void * ) , irqreturn_t (*thread_fn)(int , void * ) , unsigned long ldv_func_arg4 , char const *ldv_func_arg5 , void *ldv_func_arg6 ) ; __inline static int valid_dma_direction(int dma_direction ) { { return ((dma_direction == 0 || dma_direction == 1) || dma_direction == 2); } } __inline static int is_device_dma_capable(struct device *dev ) { { return ((unsigned long )dev->dma_mask != (unsigned long )((u64 *)0ULL) && *(dev->dma_mask) != 0ULL); } } __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_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 void debug_dma_sync_single_for_cpu(struct device * , dma_addr_t , size_t , int ) ; extern void debug_dma_sync_single_for_device(struct device * , dma_addr_t , size_t , int ) ; extern struct device x86_dma_fallback_dev ; 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" (18), "i" (12UL)); ldv_19076: ; goto ldv_19076; } else { } tmp___2 = __phys_addr((unsigned long )ptr); addr = (*(ops->map_page))(dev, (struct page *)-24189255811072L + (tmp___2 >> 12), (unsigned long )ptr & 4095UL, size, dir, attrs); tmp___3 = __phys_addr((unsigned long )ptr); debug_dma_map_page(dev, (struct page *)-24189255811072L + (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" (35), "i" (12UL)); ldv_19085: ; goto ldv_19085; } 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 void dma_sync_single_for_cpu(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" (102), "i" (12UL)); ldv_19135: ; goto ldv_19135; } else { } if ((unsigned long )ops->sync_single_for_cpu != (unsigned long )((void (*)(struct device * , dma_addr_t , size_t , enum dma_data_direction ))0)) { (*(ops->sync_single_for_cpu))(dev, addr, size, dir); } else { } debug_dma_sync_single_for_cpu(dev, addr, size, (int )dir); return; } } __inline static void dma_sync_single_for_device(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" (114), "i" (12UL)); ldv_19143: ; goto ldv_19143; } else { } if ((unsigned long )ops->sync_single_for_device != (unsigned long )((void (*)(struct device * , dma_addr_t , size_t , enum dma_data_direction ))0)) { (*(ops->sync_single_for_device))(dev, addr, size, dir); } else { } debug_dma_sync_single_for_device(dev, addr, size, (int )dir); 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); } } extern int dma_supported(struct device * , u64 ) ; extern int dma_set_mask(struct device * , u64 ) ; __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_coherent(struct device *dev , size_t size , dma_addr_t *dma_handle , gfp_t gfp ) { 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 ((void *)0); } else { } if ((unsigned long )ops->alloc_coherent == (unsigned long )((void *(*)(struct device * , size_t , dma_addr_t * , gfp_t ))0)) { return ((void *)0); } else { } tmp___1 = dma_alloc_coherent_gfp_flags(dev, gfp); memory = (*(ops->alloc_coherent))(dev, size, dma_handle, tmp___1); debug_dma_alloc_coherent(dev, size, *dma_handle, memory); return (memory); } } __inline static void dma_free_coherent(struct device *dev , size_t size , void *vaddr , dma_addr_t bus ) { 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 = __raw_local_save_flags(); tmp___0 = raw_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("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/inst/current/envs/linux-stable-1575714-1/linux-stable-1575714-1/arch/x86/include/asm/dma-mapping.h", 147); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); debug_dma_free_coherent(dev, size, vaddr, bus); if ((unsigned long )ops->free_coherent != (unsigned long )((void (*)(struct device * , size_t , void * , dma_addr_t ))0)) { (*(ops->free_coherent))(dev, size, vaddr, bus); } else { } return; } } __inline static int dma_set_coherent_mask(struct device *dev , u64 mask ) { int tmp ; { tmp = dma_supported(dev, mask); if (tmp == 0) { return (-5); } else { } dev->coherent_dma_mask = mask; return (0); } } extern u32 ssb_dma_translation(struct ssb_device * ) ; extern struct sk_buff *__alloc_skb(unsigned int , gfp_t , int , int ) ; __inline static struct sk_buff *alloc_skb(unsigned int size , gfp_t priority ) { struct sk_buff *tmp ; { tmp = __alloc_skb(size, priority, 0, -1); return (tmp); } } extern unsigned char *skb_put(struct sk_buff * , unsigned int ) ; __inline static void skb_reserve(struct sk_buff *skb , int len ) { { skb->data = skb->data + (unsigned long )len; skb->tail = skb->tail + (sk_buff_data_t )len; return; } } __inline static struct sk_buff *__dev_alloc_skb(unsigned int length , gfp_t gfp_mask ) { struct sk_buff *skb ; int _max1 ; int _max2 ; struct sk_buff *tmp ; int _max1___0 ; int _max2___0 ; long tmp___0 ; { _max1 = 32; _max2 = 64; tmp = alloc_skb((unsigned int )(_max1 > _max2 ? _max1 : _max2) + length, gfp_mask); skb = tmp; tmp___0 = ldv__builtin_expect((unsigned long )skb != (unsigned long )((struct sk_buff *)0), 1L); if (tmp___0 != 0L) { _max1___0 = 32; _max2___0 = 64; skb_reserve(skb, _max1___0 > _max2___0 ? _max1___0 : _max2___0); } else { } return (skb); } } __inline static u16 skb_get_queue_mapping(struct sk_buff const *skb ) { { return ((u16 )skb->queue_mapping); } } extern void ieee80211_tx_status(struct ieee80211_hw * , struct sk_buff * ) ; extern void ieee80211_wake_queue(struct ieee80211_hw * , int ) ; extern void ieee80211_stop_queue(struct ieee80211_hw * , int ) ; __inline static u32 b43_dma_read(struct b43_dmaring *ring , u16 offset ) { u32 tmp ; { tmp = b43_read32(ring->dev, (int )ring->mmio_base + (int )offset); return (tmp); } } __inline static void b43_dma_write(struct b43_dmaring *ring , u16 offset , u32 value ) { { b43_write32(ring->dev, (int )ring->mmio_base + (int )offset, value); return; } } void b43_dma_direct_fifo_rx(struct b43_wldev *dev , unsigned int engine_index , bool enable ) ; __inline static size_t b43_txhdr_size(struct b43_wldev *dev ) { bool tmp ; { tmp = b43_is_old_txhdr_format(dev); if ((int )tmp) { return (106UL); } else { } return (110UL); } } __inline static struct b43_private_tx_info *b43_get_priv_tx_info(struct ieee80211_tx_info *info ) { { return ((struct b43_private_tx_info *)(& info->__annonCompField39.__annonCompField38.rate_driver_data)); } } static struct b43_dmadesc_generic *op32_idx2desc(struct b43_dmaring *ring , int slot , struct b43_dmadesc_meta **meta ) { struct b43_dmadesc32 *desc ; { *meta = ring->meta + (unsigned long )slot; desc = (struct b43_dmadesc32 *)ring->descbase; desc = desc + (unsigned long )slot; return ((struct b43_dmadesc_generic *)desc); } } static void op32_fill_descriptor(struct b43_dmaring *ring , struct b43_dmadesc_generic *desc , dma_addr_t dmaaddr , u16 bufsize , int start , int end , int irq ) { struct b43_dmadesc32 *descbase ; int slot ; u32 ctl ; u32 addr ; u32 addrext ; int __ret_warn_on ; long tmp ; u32 tmp___0 ; { descbase = (struct b43_dmadesc32 *)ring->descbase; slot = (int )(((long )(& desc->__annonCompField42.dma32) - (long )descbase) / 8L); __ret_warn_on = slot < 0 || ring->nr_slots <= slot; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/dma.c", 78); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); addr = (unsigned int )dmaaddr & 1073741823U; addrext = (unsigned int )dmaaddr >> 30; tmp___0 = ssb_dma_translation((ring->dev)->dev); addr = tmp___0 | addr; ctl = (u32 )bufsize & 8191U; if (ring->nr_slots + -1 == slot) { ctl = ctl | 268435456U; } else { } if (start != 0) { ctl = ctl | 2147483648U; } else { } if (end != 0) { ctl = ctl | 1073741824U; } else { } if (irq != 0) { ctl = ctl | 536870912U; } else { } ctl = ((addrext << 16) & 196608U) | ctl; desc->__annonCompField42.dma32.control = ctl; desc->__annonCompField42.dma32.address = addr; return; } } static void op32_poke_tx(struct b43_dmaring *ring , int slot ) { { b43_dma_write(ring, 8, (unsigned int )((unsigned long )slot) * 8U); return; } } static void op32_tx_suspend(struct b43_dmaring *ring ) { u32 tmp ; { tmp = b43_dma_read(ring, 0); b43_dma_write(ring, 0, tmp | 2U); return; } } static void op32_tx_resume(struct b43_dmaring *ring ) { u32 tmp ; { tmp = b43_dma_read(ring, 0); b43_dma_write(ring, 0, tmp & 4294967293U); return; } } static int op32_get_current_rxslot(struct b43_dmaring *ring ) { u32 val ; { val = b43_dma_read(ring, 28); val = val & 4095U; return ((int )(val / 8U)); } } static void op32_set_current_rxslot(struct b43_dmaring *ring , int slot ) { { b43_dma_write(ring, 24, (unsigned int )((unsigned long )slot) * 8U); return; } } static struct b43_dma_ops const dma32_ops = {& op32_idx2desc, & op32_fill_descriptor, & op32_poke_tx, & op32_tx_suspend, & op32_tx_resume, & op32_get_current_rxslot, & op32_set_current_rxslot}; static struct b43_dmadesc_generic *op64_idx2desc(struct b43_dmaring *ring , int slot , struct b43_dmadesc_meta **meta ) { struct b43_dmadesc64 *desc ; { *meta = ring->meta + (unsigned long )slot; desc = (struct b43_dmadesc64 *)ring->descbase; desc = desc + (unsigned long )slot; return ((struct b43_dmadesc_generic *)desc); } } static void op64_fill_descriptor(struct b43_dmaring *ring , struct b43_dmadesc_generic *desc , dma_addr_t dmaaddr , u16 bufsize , int start , int end , int irq ) { struct b43_dmadesc64 *descbase ; int slot ; u32 ctl0 ; u32 ctl1 ; u32 addrlo ; u32 addrhi ; u32 addrext ; int __ret_warn_on ; long tmp ; u32 tmp___0 ; { descbase = (struct b43_dmadesc64 *)ring->descbase; ctl0 = 0U; ctl1 = 0U; slot = (int )(((long )(& desc->__annonCompField42.dma64) - (long )descbase) / 16L); __ret_warn_on = slot < 0 || ring->nr_slots <= slot; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/dma.c", 171); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); addrlo = (unsigned int )dmaaddr; addrhi = (u32 )(dmaaddr >> 32) & 1073741823U; addrext = (u32 )(dmaaddr >> 62ULL); tmp___0 = ssb_dma_translation((ring->dev)->dev); addrhi = (tmp___0 << 1) | addrhi; if (ring->nr_slots + -1 == slot) { ctl0 = ctl0 | 268435456U; } else { } if (start != 0) { ctl0 = ctl0 | 2147483648U; } else { } if (end != 0) { ctl0 = ctl0 | 1073741824U; } else { } if (irq != 0) { ctl0 = ctl0 | 536870912U; } else { } ctl1 = ((u32 )bufsize & 8191U) | ctl1; ctl1 = ((addrext << 16) & 196608U) | ctl1; desc->__annonCompField42.dma64.control0 = ctl0; desc->__annonCompField42.dma64.control1 = ctl1; desc->__annonCompField42.dma64.address_low = addrlo; desc->__annonCompField42.dma64.address_high = addrhi; return; } } static void op64_poke_tx(struct b43_dmaring *ring , int slot ) { { b43_dma_write(ring, 4, (unsigned int )((unsigned long )slot) * 16U); return; } } static void op64_tx_suspend(struct b43_dmaring *ring ) { u32 tmp ; { tmp = b43_dma_read(ring, 0); b43_dma_write(ring, 0, tmp | 2U); return; } } static void op64_tx_resume(struct b43_dmaring *ring ) { u32 tmp ; { tmp = b43_dma_read(ring, 0); b43_dma_write(ring, 0, tmp & 4294967293U); return; } } static int op64_get_current_rxslot(struct b43_dmaring *ring ) { u32 val ; { val = b43_dma_read(ring, 48); val = val & 8191U; return ((int )(val / 16U)); } } static void op64_set_current_rxslot(struct b43_dmaring *ring , int slot ) { { b43_dma_write(ring, 36, (unsigned int )((unsigned long )slot) * 16U); return; } } static struct b43_dma_ops const dma64_ops = {& op64_idx2desc, & op64_fill_descriptor, & op64_poke_tx, & op64_tx_suspend, & op64_tx_resume, & op64_get_current_rxslot, & op64_set_current_rxslot}; __inline static int free_slots(struct b43_dmaring *ring ) { { return (ring->nr_slots - ring->used_slots); } } __inline static int next_slot(struct b43_dmaring *ring , int slot ) { int __ret_warn_on ; long tmp ; { __ret_warn_on = slot < -1 || ring->nr_slots + -1 < slot; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/dma.c", 247); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); if (ring->nr_slots + -1 == slot) { return (0); } else { } return (slot + 1); } } static void update_max_used_slots(struct b43_dmaring *ring , int current_used_slots ) { bool tmp ; { if (ring->max_used_slots >= current_used_slots) { return; } else { } ring->max_used_slots = current_used_slots; tmp = b43_debug(ring->dev, 2); if ((int )tmp) { b43dbg((ring->dev)->wl, "max_used_slots increased to %d on %s ring %d\n", ring->max_used_slots, (int )ring->tx ? (char *)"TX" : (char *)"RX", ring->index); } else { } return; } } __inline static int request_slot(struct b43_dmaring *ring ) { int slot ; int __ret_warn_on ; long tmp ; int __ret_warn_on___0 ; long tmp___0 ; int __ret_warn_on___1 ; int tmp___1 ; long tmp___2 ; { __ret_warn_on = ! ring->tx; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/dma.c", 287); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); __ret_warn_on___0 = (int )ring->stopped; tmp___0 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/dma.c", 288); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); tmp___1 = free_slots(ring); __ret_warn_on___1 = tmp___1 == 0; tmp___2 = ldv__builtin_expect(__ret_warn_on___1 != 0, 0L); if (tmp___2 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/dma.c", 289); } else { } ldv__builtin_expect(__ret_warn_on___1 != 0, 0L); slot = next_slot(ring, ring->current_slot); ring->current_slot = slot; ring->used_slots = ring->used_slots + 1; update_max_used_slots(ring, ring->used_slots); return (slot); } } static u16 b43_dmacontroller_base(enum b43_dmatype type , int controller_idx ) { u16 map64[6U] ; u16 map32[6U] ; int __ret_warn_on ; long tmp ; int __ret_warn_on___0 ; long tmp___0 ; { map64[0] = 512U; map64[1] = 576U; map64[2] = 640U; map64[3] = 704U; map64[4] = 768U; map64[5] = 832U; map32[0] = 512U; map32[1] = 544U; map32[2] = 576U; map32[3] = 608U; map32[4] = 640U; map32[5] = 672U; if ((unsigned int )type == 64U) { __ret_warn_on = controller_idx < 0 || (unsigned int )controller_idx > 5U; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/dma.c", 321); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); return (map64[controller_idx]); } else { } __ret_warn_on___0 = controller_idx < 0 || (unsigned int )controller_idx > 5U; tmp___0 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/dma.c", 325); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); return (map32[controller_idx]); } } __inline static dma_addr_t map_descbuffer(struct b43_dmaring *ring , unsigned char *buf , size_t len , int tx ) { dma_addr_t dmaaddr ; { if (tx != 0) { dmaaddr = dma_map_single_attrs(((ring->dev)->dev)->dma_dev, (void *)buf, len, 1, (struct dma_attrs *)0); } else { dmaaddr = dma_map_single_attrs(((ring->dev)->dev)->dma_dev, (void *)buf, len, 2, (struct dma_attrs *)0); } return (dmaaddr); } } __inline static void unmap_descbuffer(struct b43_dmaring *ring , dma_addr_t addr , size_t len , int tx ) { { if (tx != 0) { dma_unmap_single_attrs(((ring->dev)->dev)->dma_dev, addr, len, 1, (struct dma_attrs *)0); } else { dma_unmap_single_attrs(((ring->dev)->dev)->dma_dev, addr, len, 2, (struct dma_attrs *)0); } return; } } __inline static void sync_descbuffer_for_cpu(struct b43_dmaring *ring , dma_addr_t addr , size_t len ) { int __ret_warn_on ; long tmp ; { __ret_warn_on = (int )ring->tx; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/dma.c", 363); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); dma_sync_single_for_cpu(((ring->dev)->dev)->dma_dev, addr, len, 2); return; } } __inline static void sync_descbuffer_for_device(struct b43_dmaring *ring , dma_addr_t addr , size_t len ) { int __ret_warn_on ; long tmp ; { __ret_warn_on = (int )ring->tx; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/dma.c", 372); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); dma_sync_single_for_device(((ring->dev)->dev)->dma_dev, addr, len, 2); return; } } __inline static void free_descriptor_buffer(struct b43_dmaring *ring , struct b43_dmadesc_meta *meta ) { { if ((unsigned long )meta->skb != (unsigned long )((struct sk_buff *)0)) { dev_kfree_skb_any(meta->skb); meta->skb = (struct sk_buff *)0; } else { } return; } } static int alloc_ringmemory(struct b43_dmaring *ring ) { gfp_t flags ; { flags = 208U; if ((unsigned int )ring->type == 64U) { flags = flags | 1U; } else { } ring->descbase = dma_alloc_coherent(((ring->dev)->dev)->dma_dev, 4096UL, & ring->dmabase, flags); if ((unsigned long )ring->descbase == (unsigned long )((void *)0)) { b43err((ring->dev)->wl, "DMA ringmemory allocation failed\n"); return (-12); } else { } memset(ring->descbase, 0, 4096UL); return (0); } } static void free_ringmemory(struct b43_dmaring *ring ) { gfp_t flags ; { flags = 208U; if ((unsigned int )ring->type == 64U) { flags = flags | 1U; } else { } dma_free_coherent(((ring->dev)->dev)->dma_dev, 4096UL, ring->descbase, ring->dmabase); return; } } static int b43_dmacontroller_rx_reset(struct b43_wldev *dev , u16 mmio_base , enum b43_dmatype type ) { int i ; u32 value ; u16 offset ; { __might_sleep("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/dma.c", 435, 0); offset = (unsigned int )type == 64U ? 32U : 16U; b43_write32(dev, (int )mmio_base + (int )offset, 0U); i = 0; goto ldv_37569; ldv_37568: offset = (unsigned int )type == 64U ? 48U : 28U; value = b43_read32(dev, (int )mmio_base + (int )offset); if ((unsigned int )type == 64U) { value = value & 4026531840U; if (value == 0U) { i = -1; goto ldv_37567; } else { } } else { value = value & 61440U; if (value == 0U) { i = -1; goto ldv_37567; } else { } } msleep(1U); i = i + 1; ldv_37569: ; if (i <= 9) { goto ldv_37568; } else { } ldv_37567: ; if (i != -1) { b43err(dev->wl, "DMA RX reset timed out\n"); return (-19); } else { } return (0); } } static int b43_dmacontroller_tx_reset(struct b43_wldev *dev , u16 mmio_base , enum b43_dmatype type ) { int i ; u32 value ; u16 offset ; { __might_sleep("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/dma.c", 474, 0); i = 0; goto ldv_37580; ldv_37579: offset = (unsigned int )type == 64U ? 16U : 12U; value = b43_read32(dev, (int )mmio_base + (int )offset); if ((unsigned int )type == 64U) { value = value & 4026531840U; if ((value == 0U || value == 536870912U) || value == 805306368U) { goto ldv_37578; } else { } } else { value = value & 61440U; if ((value == 0U || value == 8192U) || value == 12288U) { goto ldv_37578; } else { } } msleep(1U); i = i + 1; ldv_37580: ; if (i <= 9) { goto ldv_37579; } else { } ldv_37578: offset = 0U; b43_write32(dev, (int )mmio_base + (int )offset, 0U); i = 0; goto ldv_37583; ldv_37582: offset = (unsigned int )type == 64U ? 16U : 12U; value = b43_read32(dev, (int )mmio_base + (int )offset); if ((unsigned int )type == 64U) { value = value & 4026531840U; if (value == 0U) { i = -1; goto ldv_37581; } else { } } else { value = value & 61440U; if (value == 0U) { i = -1; goto ldv_37581; } else { } } msleep(1U); i = i + 1; ldv_37583: ; if (i <= 9) { goto ldv_37582; } else { } ldv_37581: ; if (i != -1) { b43err(dev->wl, "DMA TX reset timed out\n"); return (-19); } else { } msleep(1U); return (0); } } static bool b43_dma_mapping_error(struct b43_dmaring *ring , dma_addr_t addr , size_t buffersize , bool dma_to_device ) { int tmp ; long tmp___0 ; { tmp = dma_mapping_error(((ring->dev)->dev)->dma_dev, addr); tmp___0 = ldv__builtin_expect(tmp != 0, 0L); if (tmp___0 != 0L) { return (1); } else { } switch ((unsigned int )ring->type) { case 30U: ; if (addr + (unsigned long long )buffersize > 1073741824ULL) { goto address_error; } else { } goto ldv_37592; case 32U: ; if (addr + (unsigned long long )buffersize > 4294967296ULL) { goto address_error; } else { } goto ldv_37592; case 64U: ; goto ldv_37592; } ldv_37592: ; return (0); address_error: unmap_descbuffer(ring, addr, buffersize, (int )dma_to_device); return (1); } } static bool b43_rx_buffer_is_poisoned(struct b43_dmaring *ring , struct sk_buff *skb ) { unsigned char *f ; { f = skb->data + (unsigned long )ring->frameoffset; return ((unsigned int )((((((((int )*f & (int )*(f + 1UL)) & (int )*(f + 2UL)) & (int )*(f + 3UL)) & (int )*(f + 4UL)) & (int )*(f + 5UL)) & (int )*(f + 6UL)) & (int )*(f + 7UL)) == 255U); } } static void b43_poison_rx_buffer(struct b43_dmaring *ring , struct sk_buff *skb ) { struct b43_rxhdr_fw4 *rxhdr ; unsigned char *frame ; int __ret_warn_on ; long tmp ; { rxhdr = (struct b43_rxhdr_fw4 *)skb->data; rxhdr->frame_len = 0U; __ret_warn_on = (unsigned long )ring->rx_buffersize < (unsigned long )ring->frameoffset + 8UL; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/dma.c", 576); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); frame = skb->data + (unsigned long )ring->frameoffset; memset((void *)frame, 255, 8UL); return; } } static int setup_rx_descbuffer(struct b43_dmaring *ring , struct b43_dmadesc_generic *desc , struct b43_dmadesc_meta *meta , gfp_t gfp_flags ) { dma_addr_t dmaaddr ; struct sk_buff *skb ; int __ret_warn_on ; long tmp ; long tmp___0 ; long tmp___1 ; bool tmp___2 ; bool tmp___3 ; { __ret_warn_on = (int )ring->tx; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/dma.c", 588); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); skb = __dev_alloc_skb((unsigned int )ring->rx_buffersize, gfp_flags); tmp___0 = ldv__builtin_expect((unsigned long )skb == (unsigned long )((struct sk_buff *)0), 0L); if (tmp___0 != 0L) { return (-12); } else { } b43_poison_rx_buffer(ring, skb); dmaaddr = map_descbuffer(ring, skb->data, (size_t )ring->rx_buffersize, 0); tmp___3 = b43_dma_mapping_error(ring, dmaaddr, (size_t )ring->rx_buffersize, 0); if ((int )tmp___3) { gfp_flags = gfp_flags | 1U; dev_kfree_skb_any(skb); skb = __dev_alloc_skb((unsigned int )ring->rx_buffersize, gfp_flags); tmp___1 = ldv__builtin_expect((unsigned long )skb == (unsigned long )((struct sk_buff *)0), 0L); if (tmp___1 != 0L) { return (-12); } else { } b43_poison_rx_buffer(ring, skb); dmaaddr = map_descbuffer(ring, skb->data, (size_t )ring->rx_buffersize, 0); tmp___2 = b43_dma_mapping_error(ring, dmaaddr, (size_t )ring->rx_buffersize, 0); if ((int )tmp___2) { b43err((ring->dev)->wl, "RX DMA buffer allocation failed\n"); dev_kfree_skb_any(skb); return (-5); } else { } } else { } meta->skb = skb; meta->dmaaddr = dmaaddr; (*((ring->ops)->fill_descriptor))(ring, desc, dmaaddr, (int )ring->rx_buffersize, 0, 0, 0); return (0); } } static int alloc_initial_descbuffers(struct b43_dmaring *ring ) { int i ; int err ; struct b43_dmadesc_generic *desc ; struct b43_dmadesc_meta *meta ; { err = -12; i = 0; goto ldv_37627; ldv_37626: desc = (*((ring->ops)->idx2desc))(ring, i, & meta); err = setup_rx_descbuffer(ring, desc, meta, 208U); if (err != 0) { b43err((ring->dev)->wl, "Failed to allocate initial descbuffers\n"); goto err_unwind; } else { } i = i + 1; ldv_37627: ; if (ring->nr_slots > i) { goto ldv_37626; } else { } __asm__ volatile ("mfence": : : "memory"); ring->used_slots = ring->nr_slots; err = 0; out: ; return (err); err_unwind: i = i - 1; goto ldv_37631; ldv_37630: desc = (*((ring->ops)->idx2desc))(ring, i, & meta); unmap_descbuffer(ring, meta->dmaaddr, (size_t )ring->rx_buffersize, 0); consume_skb(meta->skb); i = i - 1; ldv_37631: ; if (i >= 0) { goto ldv_37630; } else { } goto out; } } static int dmacontroller_setup(struct b43_dmaring *ring ) { int err ; u32 value ; u32 addrext ; u32 trans ; u32 tmp ; u64 ringbase ; u32 ringbase___0 ; u64 ringbase___1 ; u32 ringbase___2 ; { err = 0; tmp = ssb_dma_translation((ring->dev)->dev); trans = tmp; if ((int )ring->tx) { if ((unsigned int )ring->type == 64U) { ringbase = ring->dmabase; addrext = (u32 )(ringbase >> 62ULL); value = 1U; value = ((addrext << 16) & 196608U) | value; b43_dma_write(ring, 0, value); b43_dma_write(ring, 8, (u32 )ringbase); b43_dma_write(ring, 12, ((u32 )(ringbase >> 32) & 1073741823U) | (trans << 1)); } else { ringbase___0 = (unsigned int )ring->dmabase; addrext = ringbase___0 >> 30; value = 1U; value = ((addrext << 16) & 196608U) | value; b43_dma_write(ring, 0, value); b43_dma_write(ring, 4, (ringbase___0 & 1073741823U) | trans); } } else { err = alloc_initial_descbuffers(ring); if (err != 0) { goto out; } else { } if ((unsigned int )ring->type == 64U) { ringbase___1 = ring->dmabase; addrext = (u32 )(ringbase___1 >> 62ULL); value = ring->frameoffset << 1; value = value | 1U; value = ((addrext << 16) & 196608U) | value; b43_dma_write(ring, 32, value); b43_dma_write(ring, 40, (u32 )ringbase___1); b43_dma_write(ring, 44, ((u32 )(ringbase___1 >> 32) & 1073741823U) | (trans << 1)); b43_dma_write(ring, 36, (u32 )((unsigned long )ring->nr_slots) * 16U); } else { ringbase___2 = (unsigned int )ring->dmabase; addrext = ringbase___2 >> 30; value = ring->frameoffset << 1; value = value | 1U; value = ((addrext << 16) & 196608U) | value; b43_dma_write(ring, 16, value); b43_dma_write(ring, 20, (ringbase___2 & 1073741823U) | trans); b43_dma_write(ring, 24, (u32 )((unsigned long )ring->nr_slots) * 8U); } } out: ; return (err); } } static void dmacontroller_cleanup(struct b43_dmaring *ring ) { { if ((int )ring->tx) { b43_dmacontroller_tx_reset(ring->dev, (int )ring->mmio_base, ring->type); if ((unsigned int )ring->type == 64U) { b43_dma_write(ring, 8, 0U); b43_dma_write(ring, 12, 0U); } else { b43_dma_write(ring, 4, 0U); } } else { b43_dmacontroller_rx_reset(ring->dev, (int )ring->mmio_base, ring->type); if ((unsigned int )ring->type == 64U) { b43_dma_write(ring, 40, 0U); b43_dma_write(ring, 44, 0U); } else { b43_dma_write(ring, 20, 0U); } } return; } } static void free_all_descbuffers(struct b43_dmaring *ring ) { struct b43_dmadesc_generic *desc ; struct b43_dmadesc_meta *meta ; int i ; int __ret_warn_on ; long tmp ; void *tmp___0 ; long tmp___1 ; { if (ring->used_slots == 0) { return; } else { } i = 0; goto ldv_37658; ldv_37657: desc = (*((ring->ops)->idx2desc))(ring, i, & meta); if ((unsigned long )meta->skb == (unsigned long )((struct sk_buff *)0)) { goto _L; } else { tmp___0 = ERR_PTR(-12L); tmp___1 = ldv__builtin_expect((unsigned long )((void *)meta->skb) == (unsigned long )tmp___0, 0L); if (tmp___1 != 0L) { _L: /* CIL Label */ __ret_warn_on = ! ring->tx; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/dma.c", 775); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); goto ldv_37656; } else { } } if ((int )ring->tx) { unmap_descbuffer(ring, meta->dmaaddr, (size_t )(meta->skb)->len, 1); } else { unmap_descbuffer(ring, meta->dmaaddr, (size_t )ring->rx_buffersize, 0); } free_descriptor_buffer(ring, meta); ldv_37656: i = i + 1; ldv_37658: ; if (ring->nr_slots > i) { goto ldv_37657; } else { } return; } } static u64 supported_dma_mask(struct b43_wldev *dev ) { u32 tmp ; u16 mmio_base ; { tmp = b43_read32(dev, 3996); if ((tmp & 268435456U) != 0U) { return (0xffffffffffffffffULL); } else { } mmio_base = b43_dmacontroller_base(0, 0); b43_write32(dev, (int )mmio_base, 196608U); tmp = b43_read32(dev, (int )mmio_base); if ((tmp & 196608U) != 0U) { return (4294967295ULL); } else { } return (1073741823ULL); } } static enum b43_dmatype dma_mask_to_engine_type(u64 dmamask ) { int __ret_warn_on ; long tmp ; { if (dmamask == 1073741823ULL) { return (30); } else { } if (dmamask == 4294967295ULL) { return (32); } else { } if (dmamask == 0xffffffffffffffffULL) { return (64); } else { } __ret_warn_on = 1; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/dma.c", 814); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); return (30); } } static struct b43_dmaring *b43_setup_dmaring(struct b43_wldev *dev , int controller_index , int for_tx , enum b43_dmatype type ) { struct b43_dmaring *ring ; int i ; int err ; dma_addr_t dma_test ; void *tmp ; void *tmp___0 ; void *tmp___1 ; int __ret_warn_on ; long tmp___2 ; size_t tmp___3 ; void *tmp___4 ; size_t tmp___5 ; size_t tmp___6 ; void *tmp___7 ; size_t tmp___8 ; size_t tmp___9 ; bool tmp___10 ; size_t tmp___11 ; bool tmp___12 ; size_t tmp___13 ; { tmp = kzalloc(128UL, 208U); ring = (struct b43_dmaring *)tmp; if ((unsigned long )ring == (unsigned long )((struct b43_dmaring *)0)) { goto out; } else { } ring->nr_slots = 64; if (for_tx != 0) { ring->nr_slots = 256; } else { } tmp___0 = kcalloc((size_t )ring->nr_slots, 24UL, 208U); ring->meta = (struct b43_dmadesc_meta *)tmp___0; if ((unsigned long )ring->meta == (unsigned long )((struct b43_dmadesc_meta *)0)) { goto err_kfree_ring; } else { } i = 0; goto ldv_37683; ldv_37682: tmp___1 = ERR_PTR(-12L); (ring->meta)->skb = (struct sk_buff *)tmp___1; i = i + 1; ldv_37683: ; if (ring->nr_slots > i) { goto ldv_37682; } else { } ring->type = type; ring->dev = dev; ring->mmio_base = b43_dmacontroller_base(type, controller_index); ring->index = controller_index; if ((unsigned int )type == 64U) { ring->ops = & dma64_ops; } else { ring->ops = & dma32_ops; } if (for_tx != 0) { ring->tx = 1; ring->current_slot = -1; } else if (ring->index == 0) { ring->rx_buffersize = 2352U; ring->frameoffset = 30U; } else { __ret_warn_on = 1; tmp___2 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___2 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/dma.c", 860); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); } ring->last_injected_overflow = jiffies; if (for_tx != 0) { tmp___3 = b43_txhdr_size(dev); tmp___4 = kcalloc((size_t )(ring->nr_slots / 2), tmp___3, 208U); ring->txhdr_cache = (u8 *)tmp___4; if ((unsigned long )ring->txhdr_cache == (unsigned long )((u8 *)0U)) { goto err_kfree_meta; } else { } tmp___5 = b43_txhdr_size(dev); dma_test = dma_map_single_attrs((dev->dev)->dma_dev, (void *)ring->txhdr_cache, tmp___5, 1, (struct dma_attrs *)0); tmp___11 = b43_txhdr_size(dev); tmp___12 = b43_dma_mapping_error(ring, dma_test, tmp___11, 1); if ((int )tmp___12) { kfree((void const *)ring->txhdr_cache); tmp___6 = b43_txhdr_size(dev); tmp___7 = kcalloc((size_t )(ring->nr_slots / 2), tmp___6, 209U); ring->txhdr_cache = (u8 *)tmp___7; if ((unsigned long )ring->txhdr_cache == (unsigned long )((u8 *)0U)) { goto err_kfree_meta; } else { } tmp___8 = b43_txhdr_size(dev); dma_test = dma_map_single_attrs((dev->dev)->dma_dev, (void *)ring->txhdr_cache, tmp___8, 1, (struct dma_attrs *)0); tmp___9 = b43_txhdr_size(dev); tmp___10 = b43_dma_mapping_error(ring, dma_test, tmp___9, 1); if ((int )tmp___10) { b43err(dev->wl, "TXHDR DMA allocation failed\n"); goto err_kfree_txhdr_cache; } else { } } else { } tmp___13 = b43_txhdr_size(dev); dma_unmap_single_attrs((dev->dev)->dma_dev, dma_test, tmp___13, 1, (struct dma_attrs *)0); } else { } err = alloc_ringmemory(ring); if (err != 0) { goto err_kfree_txhdr_cache; } else { } err = dmacontroller_setup(ring); if (err != 0) { goto err_free_ringmemory; } else { } out: ; return (ring); err_free_ringmemory: free_ringmemory(ring); err_kfree_txhdr_cache: kfree((void const *)ring->txhdr_cache); err_kfree_meta: kfree((void const *)ring->meta); err_kfree_ring: kfree((void const *)ring); ring = (struct b43_dmaring *)0; goto out; } } static void b43_destroy_dmaring(struct b43_dmaring *ring , char const *ringname ) { u64 failed_packets ; u64 succeed_packets ; u64 nr_packets ; u64 permille_failed ; u64 average_tries ; u64 __a ; uint32_t __base ; uint32_t __rem ; u64 __a___0 ; uint32_t __base___0 ; uint32_t __rem___0 ; u64 __a___1 ; uint32_t __base___1 ; uint32_t __rem___1 ; u64 __a___2 ; uint32_t __base___2 ; uint32_t __rem___2 ; u64 __a___3 ; uint32_t __base___3 ; uint32_t __rem___3 ; u64 __a___4 ; uint32_t __base___4 ; uint32_t __rem___4 ; { if ((unsigned long )ring == (unsigned long )((struct b43_dmaring *)0)) { return; } else { } failed_packets = ring->nr_failed_tx_packets; succeed_packets = ring->nr_succeed_tx_packets; nr_packets = failed_packets + succeed_packets; permille_failed = 0ULL; average_tries = 0ULL; if (nr_packets != 0ULL) { __a = failed_packets * 1000ULL; __base = (uint32_t )nr_packets; __rem = (uint32_t )(__a % (u64 )__base); __a = __a / (u64 )__base; permille_failed = __a; } else { } if (nr_packets != 0ULL) { __a___0 = ring->nr_total_packet_tries * 100ULL; __base___0 = (uint32_t )nr_packets; __rem___0 = (uint32_t )(__a___0 % (u64 )__base___0); __a___0 = __a___0 / (u64 )__base___0; average_tries = __a___0; } else { } __a___1 = average_tries; __base___1 = 100U; __rem___1 = (uint32_t )(__a___1 % (u64 )__base___1); __a___1 = __a___1 / (u64 )__base___1; __a___2 = average_tries; __base___2 = 100U; __rem___2 = (uint32_t )(__a___2 % (u64 )__base___2); __a___2 = __a___2 / (u64 )__base___2; __a___3 = permille_failed; __base___3 = 10U; __rem___3 = (uint32_t )(__a___3 % (u64 )__base___3); __a___3 = __a___3 / (u64 )__base___3; __a___4 = permille_failed; __base___4 = 10U; __rem___4 = (uint32_t )(__a___4 % (u64 )__base___4); __a___4 = __a___4 / (u64 )__base___4; b43dbg((ring->dev)->wl, "DMA-%u %s: Used slots %d/%d, Failed frames %llu/%llu = %llu.%01llu%%, Average tries %llu.%02llu\n", (unsigned int )ring->type, ringname, ring->max_used_slots, ring->nr_slots, failed_packets, nr_packets, __a___4, (unsigned long long )__rem___3, __a___2, (unsigned long long )__rem___1); dmacontroller_cleanup(ring); free_all_descbuffers(ring); free_ringmemory(ring); kfree((void const *)ring->txhdr_cache); kfree((void const *)ring->meta); kfree((void const *)ring); return; } } void b43_dma_free(struct b43_wldev *dev ) { struct b43_dma *dma ; bool tmp ; { tmp = b43_using_pio_transfers(dev); if ((int )tmp) { return; } else { } dma = & dev->__annonCompField41.dma; b43_destroy_dmaring(dma->rx_ring, "rx_ring"); dma->rx_ring = (struct b43_dmaring *)0; b43_destroy_dmaring(dma->tx_ring_AC_BK, "tx_ring_AC_BK"); dma->tx_ring_AC_BK = (struct b43_dmaring *)0; b43_destroy_dmaring(dma->tx_ring_AC_BE, "tx_ring_AC_BE"); dma->tx_ring_AC_BE = (struct b43_dmaring *)0; b43_destroy_dmaring(dma->tx_ring_AC_VI, "tx_ring_AC_VI"); dma->tx_ring_AC_VI = (struct b43_dmaring *)0; b43_destroy_dmaring(dma->tx_ring_AC_VO, "tx_ring_AC_VO"); dma->tx_ring_AC_VO = (struct b43_dmaring *)0; b43_destroy_dmaring(dma->tx_ring_mcast, "tx_ring_mcast"); dma->tx_ring_mcast = (struct b43_dmaring *)0; return; } } static int b43_dma_set_mask(struct b43_wldev *dev , u64 mask ) { u64 orig_mask ; bool fallback ; int err ; enum b43_dmatype tmp ; enum b43_dmatype tmp___0 ; enum b43_dmatype tmp___1 ; { orig_mask = mask; fallback = 0; ldv_37742: err = dma_set_mask((dev->dev)->dma_dev, mask); if (err == 0) { err = dma_set_coherent_mask((dev->dev)->dma_dev, mask); if (err == 0) { goto ldv_37740; } else { } } else { } if (mask == 0xffffffffffffffffULL) { mask = 4294967295ULL; fallback = 1; goto ldv_37741; } else { } if (mask == 4294967295ULL) { mask = 1073741823ULL; fallback = 1; goto ldv_37741; } else { } tmp = dma_mask_to_engine_type(orig_mask); b43err(dev->wl, "The machine/kernel does not support the required %u-bit DMA mask\n", (unsigned int )tmp); return (-95); ldv_37741: ; goto ldv_37742; ldv_37740: ; if ((int )fallback) { tmp___0 = dma_mask_to_engine_type(mask); tmp___1 = dma_mask_to_engine_type(orig_mask); b43info(dev->wl, "DMA mask fallback from %u-bit to %u-bit\n", (unsigned int )tmp___1, (unsigned int )tmp___0); } else { } return (0); } } int b43_dma_init(struct b43_wldev *dev ) { struct b43_dma *dma ; int err ; u64 dmamask ; enum b43_dmatype type ; int __ret_warn_on ; long tmp ; { dma = & dev->__annonCompField41.dma; dmamask = supported_dma_mask(dev); type = dma_mask_to_engine_type(dmamask); err = b43_dma_set_mask(dev, dmamask); if (err != 0) { return (err); } else { } err = -12; dma->tx_ring_AC_BK = b43_setup_dmaring(dev, 0, 1, type); if ((unsigned long )dma->tx_ring_AC_BK == (unsigned long )((struct b43_dmaring *)0)) { goto out; } else { } dma->tx_ring_AC_BE = b43_setup_dmaring(dev, 1, 1, type); if ((unsigned long )dma->tx_ring_AC_BE == (unsigned long )((struct b43_dmaring *)0)) { goto err_destroy_bk; } else { } dma->tx_ring_AC_VI = b43_setup_dmaring(dev, 2, 1, type); if ((unsigned long )dma->tx_ring_AC_VI == (unsigned long )((struct b43_dmaring *)0)) { goto err_destroy_be; } else { } dma->tx_ring_AC_VO = b43_setup_dmaring(dev, 3, 1, type); if ((unsigned long )dma->tx_ring_AC_VO == (unsigned long )((struct b43_dmaring *)0)) { goto err_destroy_vi; } else { } dma->tx_ring_mcast = b43_setup_dmaring(dev, 4, 1, type); if ((unsigned long )dma->tx_ring_mcast == (unsigned long )((struct b43_dmaring *)0)) { goto err_destroy_vo; } else { } dma->rx_ring = b43_setup_dmaring(dev, 0, 0, type); if ((unsigned long )dma->rx_ring == (unsigned long )((struct b43_dmaring *)0)) { goto err_destroy_mcast; } else { } __ret_warn_on = (unsigned int )(dev->dev)->id.revision <= 4U; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/dma.c", 1092); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); b43dbg(dev->wl, "%u-bit DMA initialized\n", (unsigned int )type); err = 0; out: ; return (err); err_destroy_mcast: b43_destroy_dmaring(dma->tx_ring_mcast, "tx_ring_mcast"); dma->tx_ring_mcast = (struct b43_dmaring *)0; err_destroy_vo: b43_destroy_dmaring(dma->tx_ring_AC_VO, "tx_ring_AC_VO"); dma->tx_ring_AC_VO = (struct b43_dmaring *)0; err_destroy_vi: b43_destroy_dmaring(dma->tx_ring_AC_VI, "tx_ring_AC_VI"); dma->tx_ring_AC_VI = (struct b43_dmaring *)0; err_destroy_be: b43_destroy_dmaring(dma->tx_ring_AC_BE, "tx_ring_AC_BE"); dma->tx_ring_AC_BE = (struct b43_dmaring *)0; err_destroy_bk: b43_destroy_dmaring(dma->tx_ring_AC_BK, "tx_ring_AC_BK"); dma->tx_ring_AC_BK = (struct b43_dmaring *)0; return (err); } } static u16 generate_cookie(struct b43_dmaring *ring , int slot ) { u16 cookie ; int __ret_warn_on ; long tmp ; { cookie = ((unsigned int )((u16 )ring->index) + 1U) << 12U; __ret_warn_on = (slot & -4096) != 0; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/dma.c", 1127); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); cookie = (u16 )((int )((unsigned short )slot) | (int )cookie); return (cookie); } } static struct b43_dmaring *parse_cookie(struct b43_wldev *dev , u16 cookie , int *slot ) { struct b43_dma *dma ; struct b43_dmaring *ring ; long tmp ; { dma = & dev->__annonCompField41.dma; ring = (struct b43_dmaring *)0; switch ((int )cookie & 61440) { case 4096: ring = dma->tx_ring_AC_BK; goto ldv_37773; case 8192: ring = dma->tx_ring_AC_BE; goto ldv_37773; case 12288: ring = dma->tx_ring_AC_VI; goto ldv_37773; case 16384: ring = dma->tx_ring_AC_VO; goto ldv_37773; case 20480: ring = dma->tx_ring_mcast; goto ldv_37773; } ldv_37773: *slot = (int )cookie & 4095; tmp = ldv__builtin_expect((long )(((unsigned long )ring == (unsigned long )((struct b43_dmaring *)0) || *slot < 0) || *slot >= ring->nr_slots), 0L); if (tmp != 0L) { b43dbg(dev->wl, "TX-status contains invalid cookie: 0x%04X\n", (int )cookie); return ((struct b43_dmaring *)0); } else { } return (ring); } } static int dma_tx_fragment(struct b43_dmaring *ring , struct sk_buff *skb ) { struct b43_dma_ops const *ops ; struct ieee80211_tx_info *info ; struct ieee80211_tx_info *tmp ; struct b43_private_tx_info *priv_info ; struct b43_private_tx_info *tmp___0 ; u8 *header ; int slot ; int old_top_slot ; int old_used_slots ; int err ; struct b43_dmadesc_generic *desc ; struct b43_dmadesc_meta *meta ; struct b43_dmadesc_meta *meta_hdr ; u16 cookie ; size_t hdrsize ; size_t tmp___1 ; long tmp___2 ; bool tmp___3 ; bool tmp___4 ; bool tmp___5 ; int tmp___6 ; { ops = ring->ops; tmp = IEEE80211_SKB_CB(skb); info = tmp; tmp___0 = b43_get_priv_tx_info(info); priv_info = tmp___0; tmp___1 = b43_txhdr_size(ring->dev); hdrsize = tmp___1; old_top_slot = ring->current_slot; old_used_slots = ring->used_slots; slot = request_slot(ring); desc = (*(ops->idx2desc))(ring, slot, & meta_hdr); memset((void *)meta_hdr, 0, 24UL); header = ring->txhdr_cache + (size_t )(slot / 2) * hdrsize; cookie = generate_cookie(ring, slot); err = b43_generate_txhdr(ring->dev, header, skb, info, (int )cookie); tmp___2 = ldv__builtin_expect(err != 0, 0L); if (tmp___2 != 0L) { ring->current_slot = old_top_slot; ring->used_slots = old_used_slots; return (err); } else { } meta_hdr->dmaaddr = map_descbuffer(ring, header, hdrsize, 1); tmp___3 = b43_dma_mapping_error(ring, meta_hdr->dmaaddr, hdrsize, 1); if ((int )tmp___3) { ring->current_slot = old_top_slot; ring->used_slots = old_used_slots; return (-5); } else { } (*(ops->fill_descriptor))(ring, desc, meta_hdr->dmaaddr, (int )((u16 )hdrsize), 1, 0, 0); slot = request_slot(ring); desc = (*(ops->idx2desc))(ring, slot, & meta); memset((void *)meta, 0, 24UL); meta->skb = skb; meta->is_last_fragment = 1; priv_info->bouncebuffer = (void *)0; meta->dmaaddr = map_descbuffer(ring, skb->data, (size_t )skb->len, 1); tmp___5 = b43_dma_mapping_error(ring, meta->dmaaddr, (size_t )skb->len, 1); if ((int )tmp___5) { priv_info->bouncebuffer = kmemdup((void const *)skb->data, (size_t )skb->len, 33U); if ((unsigned long )priv_info->bouncebuffer == (unsigned long )((void *)0)) { ring->current_slot = old_top_slot; ring->used_slots = old_used_slots; err = -12; goto out_unmap_hdr; } else { } meta->dmaaddr = map_descbuffer(ring, (unsigned char *)priv_info->bouncebuffer, (size_t )skb->len, 1); tmp___4 = b43_dma_mapping_error(ring, meta->dmaaddr, (size_t )skb->len, 1); if ((int )tmp___4) { kfree((void const *)priv_info->bouncebuffer); priv_info->bouncebuffer = (void *)0; ring->current_slot = old_top_slot; ring->used_slots = old_used_slots; err = -5; goto out_unmap_hdr; } else { } } else { } (*(ops->fill_descriptor))(ring, desc, meta->dmaaddr, (int )((u16 )skb->len), 0, 1, 1); if ((info->flags & 32U) != 0U) { b43_shm_write16(ring->dev, 1, 168, (int )cookie); } else { } __asm__ volatile ("sfence": : : "memory"); tmp___6 = next_slot(ring, slot); (*(ops->poke_tx))(ring, tmp___6); return (0); out_unmap_hdr: unmap_descbuffer(ring, meta_hdr->dmaaddr, hdrsize, 1); return (err); } } __inline static int should_inject_overflow(struct b43_dmaring *ring ) { unsigned long next_overflow ; bool tmp ; long tmp___0 ; { tmp = b43_debug(ring->dev, 1); tmp___0 = ldv__builtin_expect((long )tmp, 0L); if (tmp___0 != 0L) { next_overflow = ring->last_injected_overflow + 250UL; if ((long )next_overflow - (long )jiffies < 0L) { ring->last_injected_overflow = jiffies; b43dbg((ring->dev)->wl, "Injecting TX ring overflow on DMA controller %d\n", ring->index); return (1); } else { } } else { } return (0); } } static struct b43_dmaring *select_ring_by_priority(struct b43_wldev *dev , u8 queue_prio ) { struct b43_dmaring *ring ; int __ret_warn_on ; long tmp ; { if ((int )dev->qos_enabled) { switch ((int )queue_prio) { default: __ret_warn_on = 1; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/dma.c", 1297); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); case 0: ring = dev->__annonCompField41.dma.tx_ring_AC_VO; goto ldv_37815; case 1: ring = dev->__annonCompField41.dma.tx_ring_AC_VI; goto ldv_37815; case 2: ring = dev->__annonCompField41.dma.tx_ring_AC_BE; goto ldv_37815; case 3: ring = dev->__annonCompField41.dma.tx_ring_AC_BK; goto ldv_37815; } ldv_37815: ; } else { ring = dev->__annonCompField41.dma.tx_ring_AC_BE; } return (ring); } } int b43_dma_tx(struct b43_wldev *dev , struct sk_buff *skb ) { struct b43_dmaring *ring ; struct ieee80211_hdr *hdr ; int err ; struct ieee80211_tx_info *info ; struct ieee80211_tx_info *tmp ; u16 tmp___0 ; int __ret_warn_on ; long tmp___1 ; bool tmp___2 ; long tmp___3 ; int __ret_warn_on___0 ; int tmp___4 ; long tmp___5 ; long tmp___6 ; long tmp___7 ; u16 tmp___8 ; long tmp___9 ; long tmp___10 ; u16 tmp___11 ; bool tmp___12 ; int tmp___13 ; int tmp___14 ; { err = 0; tmp = IEEE80211_SKB_CB(skb); info = tmp; hdr = (struct ieee80211_hdr *)skb->data; if ((info->flags & 32U) != 0U) { ring = dev->__annonCompField41.dma.tx_ring_mcast; hdr->frame_control = (__le16 )((unsigned int )hdr->frame_control | 8192U); } else { tmp___0 = skb_get_queue_mapping((struct sk_buff const *)skb); ring = select_ring_by_priority(dev, (int )((u8 )tmp___0)); } __ret_warn_on = ! ring->tx; tmp___1 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/dma.c", 1338); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); tmp___3 = ldv__builtin_expect((long )ring->stopped, 0L); if (tmp___3 != 0L) { tmp___2 = b43_debug(dev, 2); if ((int )tmp___2) { b43err(dev->wl, "Packet after queue stopped\n"); } else { } err = -28; goto out; } else { } tmp___4 = free_slots(ring); __ret_warn_on___0 = tmp___4 <= 1; tmp___5 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___5 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/dma.c", 1351); } else { } tmp___6 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); tmp___7 = ldv__builtin_expect(tmp___6 != 0L, 0L); if (tmp___7 != 0L) { b43err(dev->wl, "DMA queue overflow\n"); err = -28; goto out; } else { } tmp___8 = skb_get_queue_mapping((struct sk_buff const *)skb); ring->queue_prio = (u8 )tmp___8; err = dma_tx_fragment(ring, skb); tmp___9 = ldv__builtin_expect(err == -126, 0L); if (tmp___9 != 0L) { dev_kfree_skb_any(skb); err = 0; goto out; } else { } tmp___10 = ldv__builtin_expect(err != 0, 0L); if (tmp___10 != 0L) { b43err(dev->wl, "DMA tx mapping failure\n"); goto out; } else { } tmp___13 = free_slots(ring); if (tmp___13 <= 1) { goto _L; } else { tmp___14 = should_inject_overflow(ring); if (tmp___14 != 0) { _L: /* CIL Label */ tmp___11 = skb_get_queue_mapping((struct sk_buff const *)skb); ieee80211_stop_queue((dev->wl)->hw, (int )tmp___11); ring->stopped = 1; tmp___12 = b43_debug(dev, 2); if ((int )tmp___12) { b43dbg(dev->wl, "Stopped TX ring %d\n", ring->index); } else { } } else { } } out: ; return (err); } } void b43_dma_handle_txstatus(struct b43_wldev *dev , struct b43_txstatus const *status ) { struct b43_dma_ops const *ops ; struct b43_dmaring *ring ; struct b43_dmadesc_generic *desc ; struct b43_dmadesc_meta *meta ; int slot ; int firstused ; bool frame_succeed ; long tmp ; int __ret_warn_on ; long tmp___0 ; long tmp___1 ; int __ret_warn_on___0 ; long tmp___2 ; void *tmp___3 ; long tmp___4 ; struct b43_private_tx_info *priv_info ; struct ieee80211_tx_info *tmp___5 ; struct b43_private_tx_info *tmp___6 ; size_t tmp___7 ; struct ieee80211_tx_info *info ; long tmp___8 ; void *tmp___9 ; long tmp___10 ; int __ret_warn_on___1 ; int tmp___11 ; long tmp___12 ; bool tmp___13 ; { ring = parse_cookie(dev, (int )status->cookie, & slot); tmp = ldv__builtin_expect((unsigned long )ring == (unsigned long )((struct b43_dmaring *)0), 0L); if (tmp != 0L) { return; } else { } __ret_warn_on = ! ring->tx; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/dma.c", 1403); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); firstused = (ring->current_slot - ring->used_slots) + 1; if (firstused < 0) { firstused = ring->nr_slots + firstused; } else { } tmp___1 = ldv__builtin_expect(slot != firstused, 0L); if (tmp___1 != 0L) { b43dbg(dev->wl, "Out of order TX status report on DMA ring %d. Expected %d, but got %d\n", ring->index, firstused, slot); return; } else { } ops = ring->ops; ldv_37850: __ret_warn_on___0 = slot < 0 || ring->nr_slots <= slot; tmp___2 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___2 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/dma.c", 1422); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); desc = (*(ops->idx2desc))(ring, slot, & meta); tmp___3 = ERR_PTR(-12L); tmp___4 = ldv__builtin_expect((unsigned long )((void *)meta->skb) == (unsigned long )tmp___3, 0L); if (tmp___4 != 0L) { b43dbg(dev->wl, "Poisoned TX slot %d (first=%d) on ring %d\n", slot, firstused, ring->index); goto ldv_37847; } else { } if ((unsigned long )meta->skb != (unsigned long )((struct sk_buff *)0)) { tmp___5 = IEEE80211_SKB_CB(meta->skb); tmp___6 = b43_get_priv_tx_info(tmp___5); priv_info = tmp___6; unmap_descbuffer(ring, meta->dmaaddr, (size_t )(meta->skb)->len, 1); kfree((void const *)priv_info->bouncebuffer); priv_info->bouncebuffer = (void *)0; } else { tmp___7 = b43_txhdr_size(dev); unmap_descbuffer(ring, meta->dmaaddr, tmp___7, 1); } if ((int )meta->is_last_fragment) { tmp___8 = ldv__builtin_expect((unsigned long )meta->skb == (unsigned long )((struct sk_buff *)0), 0L); if (tmp___8 != 0L) { b43dbg(dev->wl, "TX status unexpected NULL skb at slot %d (first=%d) on ring %d\n", slot, firstused, ring->index); goto ldv_37847; } else { } info = IEEE80211_SKB_CB(meta->skb); frame_succeed = b43_fill_txstatus_report(dev, info, status); if ((int )frame_succeed) { ring->nr_succeed_tx_packets = ring->nr_succeed_tx_packets + 1ULL; } else { ring->nr_failed_tx_packets = ring->nr_failed_tx_packets + 1ULL; } ring->nr_total_packet_tries = ring->nr_total_packet_tries + (u64 )status->frame_count; ieee80211_tx_status((dev->wl)->hw, meta->skb); tmp___9 = ERR_PTR(-12L); meta->skb = (struct sk_buff *)tmp___9; } else { tmp___10 = ldv__builtin_expect((unsigned long )meta->skb != (unsigned long )((struct sk_buff *)0), 0L); if (tmp___10 != 0L) { b43dbg(dev->wl, "TX status unexpected non-NULL skb at slot %d (first=%d) on ring %d\n", slot, firstused, ring->index); goto ldv_37847; } else { } } ring->used_slots = ring->used_slots - 1; if ((int )meta->is_last_fragment) { goto ldv_37847; } else { } slot = next_slot(ring, slot); goto ldv_37850; ldv_37847: ; if ((int )ring->stopped) { tmp___11 = free_slots(ring); __ret_warn_on___1 = tmp___11 <= 1; tmp___12 = ldv__builtin_expect(__ret_warn_on___1 != 0, 0L); if (tmp___12 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/dma.c", 1497); } else { } ldv__builtin_expect(__ret_warn_on___1 != 0, 0L); ieee80211_wake_queue((dev->wl)->hw, (int )ring->queue_prio); ring->stopped = 0; tmp___13 = b43_debug(dev, 2); if ((int )tmp___13) { b43dbg(dev->wl, "Woke up TX ring %d\n", ring->index); } else { } } else { } return; } } static void dma_rx(struct b43_dmaring *ring , int *slot ) { struct b43_dma_ops const *ops ; struct b43_dmadesc_generic *desc ; struct b43_dmadesc_meta *meta ; struct b43_rxhdr_fw4 *rxhdr ; struct sk_buff *skb ; u16 len ; int err ; dma_addr_t dmaaddr ; int i ; int tmp ; long tmp___0 ; bool tmp___1 ; long tmp___2 ; int cnt ; s32 tmp___3 ; long tmp___4 ; long tmp___5 ; { ops = ring->ops; desc = (*(ops->idx2desc))(ring, *slot, & meta); sync_descbuffer_for_cpu(ring, meta->dmaaddr, (size_t )ring->rx_buffersize); skb = meta->skb; rxhdr = (struct b43_rxhdr_fw4 *)skb->data; len = rxhdr->frame_len; if ((unsigned int )len == 0U) { i = 0; ldv_37866: __const_udelay(8590UL); __asm__ volatile ("": : : "memory"); len = rxhdr->frame_len; if ((unsigned int )len == 0U) { tmp = i; i = i + 1; if (tmp <= 4) { goto ldv_37866; } else { goto ldv_37867; } } else { } ldv_37867: tmp___0 = ldv__builtin_expect((unsigned int )len == 0U, 0L); if (tmp___0 != 0L) { dmaaddr = meta->dmaaddr; goto drop_recycle_buffer; } else { } } else { } tmp___1 = b43_rx_buffer_is_poisoned(ring, skb); tmp___2 = ldv__builtin_expect((long )tmp___1, 0L); if (tmp___2 != 0L) { b43dbg((ring->dev)->wl, "DMA RX: Dropping poisoned buffer.\n"); dmaaddr = meta->dmaaddr; goto drop_recycle_buffer; } else { } tmp___4 = ldv__builtin_expect((int )ring->rx_buffersize < (int )len, 0L); if (tmp___4 != 0L) { cnt = 0; tmp___3 = (s32 )len; ldv_37872: desc = (*(ops->idx2desc))(ring, *slot, & meta); b43_poison_rx_buffer(ring, meta->skb); sync_descbuffer_for_device(ring, meta->dmaaddr, (size_t )ring->rx_buffersize); *slot = next_slot(ring, *slot); cnt = cnt + 1; tmp___3 = tmp___3 - (int )ring->rx_buffersize; if (tmp___3 <= 0) { goto ldv_37871; } else { } goto ldv_37872; ldv_37871: b43err((ring->dev)->wl, "DMA RX buffer too small (len: %u, buffer: %u, nr-dropped: %d)\n", (int )len, (int )ring->rx_buffersize, cnt); goto drop; } else { } dmaaddr = meta->dmaaddr; err = setup_rx_descbuffer(ring, desc, meta, 32U); tmp___5 = ldv__builtin_expect(err != 0, 0L); if (tmp___5 != 0L) { b43dbg((ring->dev)->wl, "DMA RX: setup_rx_descbuffer() failed\n"); goto drop_recycle_buffer; } else { } unmap_descbuffer(ring, dmaaddr, (size_t )ring->rx_buffersize, 0); skb_put(skb, (u32 )len + ring->frameoffset); skb_pull(skb, ring->frameoffset); b43_rx(ring->dev, skb, (void const *)rxhdr); drop: ; return; drop_recycle_buffer: b43_poison_rx_buffer(ring, skb); sync_descbuffer_for_device(ring, dmaaddr, (size_t )ring->rx_buffersize); return; } } void b43_dma_rx(struct b43_dmaring *ring ) { struct b43_dma_ops const *ops ; int slot ; int current_slot ; int used_slots ; int __ret_warn_on ; long tmp ; int __ret_warn_on___0 ; long tmp___0 ; { ops = ring->ops; used_slots = 0; __ret_warn_on = (int )ring->tx; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/dma.c", 1598); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); current_slot = (*(ops->get_current_rxslot))(ring); __ret_warn_on___0 = current_slot < 0 || ring->nr_slots <= current_slot; tmp___0 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/dma.c", 1600); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); slot = ring->current_slot; goto ldv_37886; ldv_37885: dma_rx(ring, & slot); used_slots = used_slots + 1; update_max_used_slots(ring, used_slots); slot = next_slot(ring, slot); ldv_37886: ; if (slot != current_slot) { goto ldv_37885; } else { } (*(ops->set_current_rxslot))(ring, slot); ring->current_slot = slot; return; } } static void b43_dma_tx_suspend_ring(struct b43_dmaring *ring ) { int __ret_warn_on ; long tmp ; { __ret_warn_on = ! ring->tx; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/dma.c", 1613); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); (*((ring->ops)->tx_suspend))(ring); return; } } static void b43_dma_tx_resume_ring(struct b43_dmaring *ring ) { int __ret_warn_on ; long tmp ; { __ret_warn_on = ! ring->tx; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/dma.c", 1619); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); (*((ring->ops)->tx_resume))(ring); return; } } void b43_dma_tx_suspend(struct b43_wldev *dev ) { { b43_power_saving_ctl_bits(dev, 4U); b43_dma_tx_suspend_ring(dev->__annonCompField41.dma.tx_ring_AC_BK); b43_dma_tx_suspend_ring(dev->__annonCompField41.dma.tx_ring_AC_BE); b43_dma_tx_suspend_ring(dev->__annonCompField41.dma.tx_ring_AC_VI); b43_dma_tx_suspend_ring(dev->__annonCompField41.dma.tx_ring_AC_VO); b43_dma_tx_suspend_ring(dev->__annonCompField41.dma.tx_ring_mcast); return; } } void b43_dma_tx_resume(struct b43_wldev *dev ) { { b43_dma_tx_resume_ring(dev->__annonCompField41.dma.tx_ring_mcast); b43_dma_tx_resume_ring(dev->__annonCompField41.dma.tx_ring_AC_VO); b43_dma_tx_resume_ring(dev->__annonCompField41.dma.tx_ring_AC_VI); b43_dma_tx_resume_ring(dev->__annonCompField41.dma.tx_ring_AC_BE); b43_dma_tx_resume_ring(dev->__annonCompField41.dma.tx_ring_AC_BK); b43_power_saving_ctl_bits(dev, 0U); return; } } static void direct_fifo_rx(struct b43_wldev *dev , enum b43_dmatype type , u16 mmio_base , bool enable ) { u32 ctl ; { if ((unsigned int )type == 64U) { ctl = b43_read32(dev, (int )((unsigned int )mmio_base + 32U)); ctl = ctl & 4294967039U; if ((int )enable) { ctl = ctl | 256U; } else { } b43_write32(dev, (int )((unsigned int )mmio_base + 32U), ctl); } else { ctl = b43_read32(dev, (int )((unsigned int )mmio_base + 16U)); ctl = ctl & 4294967039U; if ((int )enable) { ctl = ctl | 256U; } else { } b43_write32(dev, (int )((unsigned int )mmio_base + 16U), ctl); } return; } } void b43_dma_direct_fifo_rx(struct b43_wldev *dev , unsigned int engine_index , bool enable ) { enum b43_dmatype type ; u16 mmio_base ; u64 tmp ; { tmp = supported_dma_mask(dev); type = dma_mask_to_engine_type(tmp); mmio_base = b43_dmacontroller_base(type, (int )engine_index); direct_fifo_rx(dev, type, (int )mmio_base, (int )enable); return; } } void ldv_initialize_b43_dma_ops_24(void) { void *tmp ; { tmp = ldv_init_zalloc(128UL); dma32_ops_group0 = (struct b43_dmaring *)tmp; return; } } void ldv_initialize_b43_dma_ops_23(void) { void *tmp ; { tmp = ldv_init_zalloc(128UL); dma64_ops_group0 = (struct b43_dmaring *)tmp; return; } } void ldv_main_exported_24(void) { u16 ldvarg148 ; dma_addr_t ldvarg149 ; int ldvarg153 ; int ldvarg150 ; int ldvarg152 ; int ldvarg146 ; struct b43_dmadesc_meta **ldvarg145 ; void *tmp ; struct b43_dmadesc_generic *ldvarg151 ; void *tmp___0 ; int ldvarg154 ; int ldvarg147 ; int tmp___1 ; { tmp = ldv_init_zalloc(8UL); ldvarg145 = (struct b43_dmadesc_meta **)tmp; tmp___0 = ldv_init_zalloc(16UL); ldvarg151 = (struct b43_dmadesc_generic *)tmp___0; ldv_memset((void *)(& ldvarg148), 0, 2UL); ldv_memset((void *)(& ldvarg149), 0, 8UL); ldv_memset((void *)(& ldvarg153), 0, 4UL); ldv_memset((void *)(& ldvarg150), 0, 4UL); ldv_memset((void *)(& ldvarg152), 0, 4UL); ldv_memset((void *)(& ldvarg146), 0, 4UL); ldv_memset((void *)(& ldvarg154), 0, 4UL); ldv_memset((void *)(& ldvarg147), 0, 4UL); tmp___1 = __VERIFIER_nondet_int(); switch (tmp___1) { case 0: ; if (ldv_state_variable_24 == 1) { op32_tx_resume(dma32_ops_group0); ldv_state_variable_24 = 1; } else { } goto ldv_37938; case 1: ; if (ldv_state_variable_24 == 1) { op32_tx_suspend(dma32_ops_group0); ldv_state_variable_24 = 1; } else { } goto ldv_37938; case 2: ; if (ldv_state_variable_24 == 1) { op32_poke_tx(dma32_ops_group0, ldvarg154); ldv_state_variable_24 = 1; } else { } goto ldv_37938; case 3: ; if (ldv_state_variable_24 == 1) { op32_set_current_rxslot(dma32_ops_group0, ldvarg153); ldv_state_variable_24 = 1; } else { } goto ldv_37938; case 4: ; if (ldv_state_variable_24 == 1) { op32_get_current_rxslot(dma32_ops_group0); ldv_state_variable_24 = 1; } else { } goto ldv_37938; case 5: ; if (ldv_state_variable_24 == 1) { op32_fill_descriptor(dma32_ops_group0, ldvarg151, ldvarg149, (int )ldvarg148, ldvarg152, ldvarg147, ldvarg150); ldv_state_variable_24 = 1; } else { } goto ldv_37938; case 6: ; if (ldv_state_variable_24 == 1) { op32_idx2desc(dma32_ops_group0, ldvarg146, ldvarg145); ldv_state_variable_24 = 1; } else { } goto ldv_37938; default: ldv_stop(); } ldv_37938: ; return; } } void ldv_main_exported_23(void) { int ldvarg75 ; int ldvarg74 ; struct b43_dmadesc_meta **ldvarg66 ; void *tmp ; u16 ldvarg69 ; struct b43_dmadesc_generic *ldvarg72 ; void *tmp___0 ; int ldvarg68 ; int ldvarg71 ; int ldvarg67 ; dma_addr_t ldvarg70 ; int ldvarg73 ; int tmp___1 ; { tmp = ldv_init_zalloc(8UL); ldvarg66 = (struct b43_dmadesc_meta **)tmp; tmp___0 = ldv_init_zalloc(16UL); ldvarg72 = (struct b43_dmadesc_generic *)tmp___0; ldv_memset((void *)(& ldvarg75), 0, 4UL); ldv_memset((void *)(& ldvarg74), 0, 4UL); ldv_memset((void *)(& ldvarg69), 0, 2UL); ldv_memset((void *)(& ldvarg68), 0, 4UL); ldv_memset((void *)(& ldvarg71), 0, 4UL); ldv_memset((void *)(& ldvarg67), 0, 4UL); ldv_memset((void *)(& ldvarg70), 0, 8UL); ldv_memset((void *)(& ldvarg73), 0, 4UL); tmp___1 = __VERIFIER_nondet_int(); switch (tmp___1) { case 0: ; if (ldv_state_variable_23 == 1) { op64_tx_resume(dma64_ops_group0); ldv_state_variable_23 = 1; } else { } goto ldv_37960; case 1: ; if (ldv_state_variable_23 == 1) { op64_tx_suspend(dma64_ops_group0); ldv_state_variable_23 = 1; } else { } goto ldv_37960; case 2: ; if (ldv_state_variable_23 == 1) { op64_poke_tx(dma64_ops_group0, ldvarg75); ldv_state_variable_23 = 1; } else { } goto ldv_37960; case 3: ; if (ldv_state_variable_23 == 1) { op64_set_current_rxslot(dma64_ops_group0, ldvarg74); ldv_state_variable_23 = 1; } else { } goto ldv_37960; case 4: ; if (ldv_state_variable_23 == 1) { op64_get_current_rxslot(dma64_ops_group0); ldv_state_variable_23 = 1; } else { } goto ldv_37960; case 5: ; if (ldv_state_variable_23 == 1) { op64_fill_descriptor(dma64_ops_group0, ldvarg72, ldvarg70, (int )ldvarg69, ldvarg73, ldvarg68, ldvarg71); ldv_state_variable_23 = 1; } else { } goto ldv_37960; case 6: ; if (ldv_state_variable_23 == 1) { op64_idx2desc(dma64_ops_group0, ldvarg67, ldvarg66); ldv_state_variable_23 = 1; } else { } goto ldv_37960; default: ldv_stop(); } ldv_37960: ; return; } } int ldv_del_timer_sync_75(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type ldv_func_res ; int tmp ; { tmp = del_timer_sync(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_9(ldv_func_arg1); return (ldv_func_res); } } int ldv_del_timer_76(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___0 ldv_func_res ; int tmp ; { tmp = del_timer(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_9(ldv_func_arg1); return (ldv_func_res); } } int ldv_request_threaded_irq_77(unsigned int ldv_func_arg1 , irqreturn_t (*handler)(int , void * ) , irqreturn_t (*thread_fn)(int , void * ) , unsigned long ldv_func_arg4 , char const *ldv_func_arg5 , void *ldv_func_arg6 ) { ldv_func_ret_type___1 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = request_threaded_irq(ldv_func_arg1, handler, thread_fn, ldv_func_arg4, ldv_func_arg5, ldv_func_arg6); ldv_func_res = tmp; tmp___0 = reg_check_2(handler, thread_fn); if (tmp___0 != 0 && ldv_func_res >= 0) { activate_suitable_irq_2((int )ldv_func_arg1, ldv_func_arg6); } else { } return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; int ldv_del_timer_82(struct timer_list *ldv_func_arg1 ) ; int ldv_del_timer_sync_81(struct timer_list *ldv_func_arg1 ) ; int ldv_request_threaded_irq_83(unsigned int ldv_func_arg1 , irqreturn_t (*handler)(int , void * ) , irqreturn_t (*thread_fn)(int , void * ) , unsigned long ldv_func_arg4 , char const *ldv_func_arg5 , void *ldv_func_arg6 ) ; __inline static void ssb_block_read(struct ssb_device *dev , void *buffer , size_t count , u16 offset , u8 reg_width ) { { (*((dev->ops)->block_read))(dev, buffer, count, (int )offset, (int )reg_width); return; } } __inline static void ssb_block_write(struct ssb_device *dev , void const *buffer , size_t count , u16 offset , u8 reg_width ) { { (*((dev->ops)->block_write))(dev, buffer, count, (int )offset, (int )reg_width); return; } } extern struct sk_buff *dev_alloc_skb(unsigned int ) ; __inline static u16 b43_piotx_read16(struct b43_pio_txqueue *q , u16 offset ) { u16 tmp ; { tmp = b43_read16(q->dev, (int )q->mmio_base + (int )offset); return (tmp); } } __inline static u32 b43_piotx_read32(struct b43_pio_txqueue *q , u16 offset ) { u32 tmp ; { tmp = b43_read32(q->dev, (int )q->mmio_base + (int )offset); return (tmp); } } __inline static void b43_piotx_write16(struct b43_pio_txqueue *q , u16 offset , u16 value ) { { b43_write16(q->dev, (int )q->mmio_base + (int )offset, (int )value); return; } } __inline static void b43_piotx_write32(struct b43_pio_txqueue *q , u16 offset , u32 value ) { { b43_write32(q->dev, (int )q->mmio_base + (int )offset, value); return; } } __inline static u16 b43_piorx_read16(struct b43_pio_rxqueue *q , u16 offset ) { u16 tmp ; { tmp = b43_read16(q->dev, (int )q->mmio_base + (int )offset); return (tmp); } } __inline static u32 b43_piorx_read32(struct b43_pio_rxqueue *q , u16 offset ) { u32 tmp ; { tmp = b43_read32(q->dev, (int )q->mmio_base + (int )offset); return (tmp); } } __inline static void b43_piorx_write16(struct b43_pio_rxqueue *q , u16 offset , u16 value ) { { b43_write16(q->dev, (int )q->mmio_base + (int )offset, (int )value); return; } } __inline static void b43_piorx_write32(struct b43_pio_rxqueue *q , u16 offset , u32 value ) { { b43_write32(q->dev, (int )q->mmio_base + (int )offset, value); return; } } static u16 generate_cookie___0(struct b43_pio_txqueue *q , struct b43_pio_txpacket *pack ) { u16 cookie ; { cookie = ((unsigned int )((u16 )q->index) + 1U) << 12U; cookie = (int )((u16 )pack->index) | (int )cookie; return (cookie); } } static struct b43_pio_txqueue *parse_cookie___0(struct b43_wldev *dev , u16 cookie , struct b43_pio_txpacket **pack ) { struct b43_pio *pio ; struct b43_pio_txqueue *q ; unsigned int pack_index ; int __ret_warn_on ; long tmp ; long tmp___0 ; int __ret_warn_on___0 ; long tmp___1 ; long tmp___2 ; { pio = & dev->__annonCompField41.pio; q = (struct b43_pio_txqueue *)0; switch ((int )cookie & 61440) { case 4096: q = pio->tx_queue_AC_BK; goto ldv_37341; case 8192: q = pio->tx_queue_AC_BE; goto ldv_37341; case 12288: q = pio->tx_queue_AC_VI; goto ldv_37341; case 16384: q = pio->tx_queue_AC_VO; goto ldv_37341; case 20480: q = pio->tx_queue_mcast; goto ldv_37341; } ldv_37341: __ret_warn_on = (unsigned long )q == (unsigned long )((struct b43_pio_txqueue *)0); tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/pio.c", 82); } else { } tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { return ((struct b43_pio_txqueue *)0); } else { } pack_index = (unsigned int )cookie & 4095U; __ret_warn_on___0 = pack_index > 31U; tmp___1 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/pio.c", 85); } else { } tmp___2 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___2 != 0L) { return ((struct b43_pio_txqueue *)0); } else { } *pack = (struct b43_pio_txpacket *)(& q->packets) + (unsigned long )pack_index; return (q); } } static u16 index_to_pioqueue_base(struct b43_wldev *dev , unsigned int index ) { u16 bases[8U] ; u16 bases_rev11[6U] ; int __ret_warn_on ; long tmp ; int __ret_warn_on___0 ; long tmp___0 ; { bases[0] = 768U; bases[1] = 784U; bases[2] = 800U; bases[3] = 816U; bases[4] = 832U; bases[5] = 848U; bases[6] = 864U; bases[7] = 880U; bases_rev11[0] = 512U; bases_rev11[1] = 576U; bases_rev11[2] = 640U; bases_rev11[3] = 704U; bases_rev11[4] = 768U; bases_rev11[5] = 832U; if ((unsigned int )(dev->dev)->id.revision > 10U) { __ret_warn_on = index > 5U; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/pio.c", 115); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); return (bases_rev11[index]); } else { } __ret_warn_on___0 = index > 7U; tmp___0 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/pio.c", 118); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); return (bases[index]); } } static u16 pio_txqueue_offset(struct b43_wldev *dev ) { { if ((unsigned int )(dev->dev)->id.revision > 10U) { return (24U); } else { } return (0U); } } static u16 pio_rxqueue_offset(struct b43_wldev *dev ) { { if ((unsigned int )(dev->dev)->id.revision > 10U) { return (56U); } else { } return (8U); } } static struct b43_pio_txqueue *b43_setup_pioqueue_tx(struct b43_wldev *dev , unsigned int index ) { struct b43_pio_txqueue *q ; struct b43_pio_txpacket *p ; unsigned int i ; void *tmp ; u16 tmp___0 ; u16 tmp___1 ; { tmp = kzalloc(1328UL, 208U); q = (struct b43_pio_txqueue *)tmp; if ((unsigned long )q == (unsigned long )((struct b43_pio_txqueue *)0)) { return ((struct b43_pio_txqueue *)0); } else { } q->dev = dev; q->rev = (dev->dev)->id.revision; tmp___0 = index_to_pioqueue_base(dev, index); tmp___1 = pio_txqueue_offset(dev); q->mmio_base = (int )tmp___0 + (int )tmp___1; q->index = (u8 )index; q->free_packet_slots = 32U; if ((unsigned int )q->rev > 7U) { q->buffer_size = 1920U; } else { q->buffer_size = b43_piotx_read16(q, 4); q->buffer_size = (unsigned int )q->buffer_size + 65456U; } INIT_LIST_HEAD(& q->packets_list); i = 0U; goto ldv_37382; ldv_37381: p = (struct b43_pio_txpacket *)(& q->packets) + (unsigned long )i; INIT_LIST_HEAD(& p->list); p->index = (u8 )i; p->queue = q; list_add(& p->list, & q->packets_list); i = i + 1U; ldv_37382: ; if (i <= 31U) { goto ldv_37381; } else { } return (q); } } static struct b43_pio_rxqueue *b43_setup_pioqueue_rx(struct b43_wldev *dev , unsigned int index ) { struct b43_pio_rxqueue *q ; void *tmp ; u16 tmp___0 ; u16 tmp___1 ; { tmp = kzalloc(16UL, 208U); q = (struct b43_pio_rxqueue *)tmp; if ((unsigned long )q == (unsigned long )((struct b43_pio_rxqueue *)0)) { return ((struct b43_pio_rxqueue *)0); } else { } q->dev = dev; q->rev = (dev->dev)->id.revision; tmp___0 = index_to_pioqueue_base(dev, index); tmp___1 = pio_rxqueue_offset(dev); q->mmio_base = (int )tmp___0 + (int )tmp___1; b43_dma_direct_fifo_rx(dev, index, 1); return (q); } } static void b43_pio_cancel_tx_packets(struct b43_pio_txqueue *q ) { struct b43_pio_txpacket *pack ; unsigned int i ; { i = 0U; goto ldv_37397; ldv_37396: pack = (struct b43_pio_txpacket *)(& q->packets) + (unsigned long )i; if ((unsigned long )pack->skb != (unsigned long )((struct sk_buff *)0)) { dev_kfree_skb_any(pack->skb); pack->skb = (struct sk_buff *)0; } else { } i = i + 1U; ldv_37397: ; if (i <= 31U) { goto ldv_37396; } else { } return; } } static void b43_destroy_pioqueue_tx(struct b43_pio_txqueue *q , char const *name ) { { if ((unsigned long )q == (unsigned long )((struct b43_pio_txqueue *)0)) { return; } else { } b43_pio_cancel_tx_packets(q); kfree((void const *)q); return; } } static void b43_destroy_pioqueue_rx(struct b43_pio_rxqueue *q , char const *name ) { { if ((unsigned long )q == (unsigned long )((struct b43_pio_rxqueue *)0)) { return; } else { } kfree((void const *)q); return; } } void b43_pio_free(struct b43_wldev *dev ) { struct b43_pio *pio ; bool tmp ; int tmp___0 ; { tmp = b43_using_pio_transfers(dev); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { return; } else { } pio = & dev->__annonCompField41.pio; b43_destroy_pioqueue_rx(pio->rx_queue, "rx_queue"); pio->rx_queue = (struct b43_pio_rxqueue *)0; b43_destroy_pioqueue_tx(pio->tx_queue_mcast, "tx_queue_mcast"); pio->tx_queue_mcast = (struct b43_pio_txqueue *)0; b43_destroy_pioqueue_tx(pio->tx_queue_AC_VO, "tx_queue_AC_VO"); pio->tx_queue_AC_VO = (struct b43_pio_txqueue *)0; b43_destroy_pioqueue_tx(pio->tx_queue_AC_VI, "tx_queue_AC_VI"); pio->tx_queue_AC_VI = (struct b43_pio_txqueue *)0; b43_destroy_pioqueue_tx(pio->tx_queue_AC_BE, "tx_queue_AC_BE"); pio->tx_queue_AC_BE = (struct b43_pio_txqueue *)0; b43_destroy_pioqueue_tx(pio->tx_queue_AC_BK, "tx_queue_AC_BK"); pio->tx_queue_AC_BK = (struct b43_pio_txqueue *)0; return; } } int b43_pio_init(struct b43_wldev *dev ) { struct b43_pio *pio ; int err ; u32 tmp ; { pio = & dev->__annonCompField41.pio; err = -12; tmp = b43_read32(dev, 288); b43_write32(dev, 288, tmp & 4294901759U); b43_shm_write16(dev, 1, 52, 0); pio->tx_queue_AC_BK = b43_setup_pioqueue_tx(dev, 0U); if ((unsigned long )pio->tx_queue_AC_BK == (unsigned long )((struct b43_pio_txqueue *)0)) { goto out; } else { } pio->tx_queue_AC_BE = b43_setup_pioqueue_tx(dev, 1U); if ((unsigned long )pio->tx_queue_AC_BE == (unsigned long )((struct b43_pio_txqueue *)0)) { goto err_destroy_bk; } else { } pio->tx_queue_AC_VI = b43_setup_pioqueue_tx(dev, 2U); if ((unsigned long )pio->tx_queue_AC_VI == (unsigned long )((struct b43_pio_txqueue *)0)) { goto err_destroy_be; } else { } pio->tx_queue_AC_VO = b43_setup_pioqueue_tx(dev, 3U); if ((unsigned long )pio->tx_queue_AC_VO == (unsigned long )((struct b43_pio_txqueue *)0)) { goto err_destroy_vi; } else { } pio->tx_queue_mcast = b43_setup_pioqueue_tx(dev, 4U); if ((unsigned long )pio->tx_queue_mcast == (unsigned long )((struct b43_pio_txqueue *)0)) { goto err_destroy_vo; } else { } pio->rx_queue = b43_setup_pioqueue_rx(dev, 0U); if ((unsigned long )pio->rx_queue == (unsigned long )((struct b43_pio_rxqueue *)0)) { goto err_destroy_mcast; } else { } b43dbg(dev->wl, "PIO initialized\n"); err = 0; out: ; return (err); err_destroy_mcast: b43_destroy_pioqueue_tx(pio->tx_queue_mcast, "tx_queue_mcast"); pio->tx_queue_mcast = (struct b43_pio_txqueue *)0; err_destroy_vo: b43_destroy_pioqueue_tx(pio->tx_queue_AC_VO, "tx_queue_AC_VO"); pio->tx_queue_AC_VO = (struct b43_pio_txqueue *)0; err_destroy_vi: b43_destroy_pioqueue_tx(pio->tx_queue_AC_VI, "tx_queue_AC_VI"); pio->tx_queue_AC_VI = (struct b43_pio_txqueue *)0; err_destroy_be: b43_destroy_pioqueue_tx(pio->tx_queue_AC_BE, "tx_queue_AC_BE"); pio->tx_queue_AC_BE = (struct b43_pio_txqueue *)0; err_destroy_bk: b43_destroy_pioqueue_tx(pio->tx_queue_AC_BK, "tx_queue_AC_BK"); pio->tx_queue_AC_BK = (struct b43_pio_txqueue *)0; return (err); } } static struct b43_pio_txqueue *select_queue_by_priority(struct b43_wldev *dev , u8 queue_prio ) { struct b43_pio_txqueue *q ; int __ret_warn_on ; long tmp ; { if ((int )dev->qos_enabled) { switch ((int )queue_prio) { default: __ret_warn_on = 1; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/pio.c", 309); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); case 0: q = dev->__annonCompField41.pio.tx_queue_AC_VO; goto ldv_37431; case 1: q = dev->__annonCompField41.pio.tx_queue_AC_VI; goto ldv_37431; case 2: q = dev->__annonCompField41.pio.tx_queue_AC_BE; goto ldv_37431; case 3: q = dev->__annonCompField41.pio.tx_queue_AC_BK; goto ldv_37431; } ldv_37431: ; } else { q = dev->__annonCompField41.pio.tx_queue_AC_BE; } return (q); } } static u16 tx_write_2byte_queue(struct b43_pio_txqueue *q , u16 ctl , void const *_data___0 , unsigned int data_len ) { struct b43_wldev *dev ; struct b43_wl *wl ; u8 const *data ; u8 *tail ; { dev = q->dev; wl = dev->wl; data = (u8 const *)_data___0; ctl = (u16 )((unsigned int )ctl | 3U); b43_piotx_write16(q, 0, (int )ctl); ssb_block_write(dev->dev, (void const *)data, (size_t )data_len & 4294967294UL, (int )((unsigned int )q->mmio_base + 2U), 2); if ((int )data_len & 1) { tail = (u8 *)(& wl->pio_tailspace); ctl = (unsigned int )ctl & 65533U; b43_piotx_write16(q, 0, (int )ctl); *tail = *(data + (unsigned long )(data_len - 1U)); *(tail + 1UL) = 0U; ssb_block_write(dev->dev, (void const *)tail, 2UL, (int )((unsigned int )q->mmio_base + 2U), 2); } else { } return (ctl); } } static void pio_tx_frame_2byte_queue(struct b43_pio_txpacket *pack , u8 const *hdr , unsigned int hdrlen ) { struct b43_pio_txqueue *q ; char const *frame ; unsigned int frame_len ; u16 ctl ; { q = pack->queue; frame = (char const *)(pack->skb)->data; frame_len = (pack->skb)->len; ctl = b43_piotx_read16(q, 0); ctl = (u16 )((unsigned int )ctl | 8U); ctl = (unsigned int )ctl & 65531U; ctl = tx_write_2byte_queue(q, (int )ctl, (void const *)hdr, hdrlen); ctl = tx_write_2byte_queue(q, (int )ctl, (void const *)frame, frame_len); ctl = (u16 )((unsigned int )ctl | 4U); b43_piotx_write16(q, 0, (int )ctl); return; } } static u32 tx_write_4byte_queue(struct b43_pio_txqueue *q , u32 ctl , void const *_data___0 , unsigned int data_len ) { struct b43_wldev *dev ; struct b43_wl *wl ; u8 const *data ; u8 *tail ; { dev = q->dev; wl = dev->wl; data = (u8 const *)_data___0; ctl = ctl | 15U; b43_piotx_write32(q, 0, ctl); ssb_block_write(dev->dev, (void const *)data, (size_t )data_len & 4294967292UL, (int )((unsigned int )q->mmio_base + 4U), 4); if ((data_len & 3U) != 0U) { tail = (u8 *)(& wl->pio_tailspace); memset((void *)tail, 0, 4UL); ctl = ctl & 4294967281U; switch (data_len & 3U) { case 3U: ctl = ctl | 6U; *tail = *(data + (unsigned long )(data_len - 3U)); *(tail + 1UL) = *(data + (unsigned long )(data_len - 2U)); *(tail + 2UL) = *(data + (unsigned long )(data_len - 1U)); goto ldv_37465; case 2U: ctl = ctl | 2U; *tail = *(data + (unsigned long )(data_len - 2U)); *(tail + 1UL) = *(data + (unsigned long )(data_len - 1U)); goto ldv_37465; case 1U: *tail = *(data + (unsigned long )(data_len - 1U)); goto ldv_37465; } ldv_37465: b43_piotx_write32(q, 0, ctl); ssb_block_write(dev->dev, (void const *)tail, 4UL, (int )((unsigned int )q->mmio_base + 4U), 4); } else { } return (ctl); } } static void pio_tx_frame_4byte_queue(struct b43_pio_txpacket *pack , u8 const *hdr , unsigned int hdrlen ) { struct b43_pio_txqueue *q ; char const *frame ; unsigned int frame_len ; u32 ctl ; { q = pack->queue; frame = (char const *)(pack->skb)->data; frame_len = (pack->skb)->len; ctl = b43_piotx_read32(q, 0); ctl = ctl | 128U; ctl = ctl & 4294967279U; ctl = tx_write_4byte_queue(q, ctl, (void const *)hdr, hdrlen); ctl = tx_write_4byte_queue(q, ctl, (void const *)frame, frame_len); ctl = ctl | 16U; b43_piotx_write32(q, 0, ctl); return; } } static int pio_tx_frame(struct b43_pio_txqueue *q , struct sk_buff *skb ) { struct b43_wldev *dev ; struct b43_wl *wl ; struct b43_pio_txpacket *pack ; u16 cookie ; int err ; unsigned int hdrlen ; struct ieee80211_tx_info *info ; struct ieee80211_tx_info *tmp ; struct b43_txhdr *txhdr ; int __ret_warn_on ; int tmp___0 ; long tmp___1 ; struct list_head const *__mptr ; size_t tmp___2 ; int __ret_warn_on___0 ; long tmp___3 ; { dev = q->dev; wl = dev->wl; tmp = IEEE80211_SKB_CB(skb); info = tmp; txhdr = (struct b43_txhdr *)(& wl->pio_scratchspace); tmp___0 = list_empty((struct list_head const *)(& q->packets_list)); __ret_warn_on = tmp___0 != 0; tmp___1 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/pio.c", 465); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); __mptr = (struct list_head const *)q->packets_list.next; pack = (struct b43_pio_txpacket *)__mptr + 0xffffffffffffffe8UL; cookie = generate_cookie___0(q, pack); tmp___2 = b43_txhdr_size(dev); hdrlen = (unsigned int )tmp___2; __ret_warn_on___0 = hdrlen > 110U; tmp___3 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___3 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/pio.c", 472); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); err = b43_generate_txhdr(dev, (u8 *)txhdr, skb, info, (int )cookie); if (err != 0) { return (err); } else { } if ((info->flags & 32U) != 0U) { b43_shm_write16(dev, 1, 168, (int )cookie); } else { } pack->skb = skb; if ((unsigned int )q->rev > 7U) { pio_tx_frame_4byte_queue(pack, (u8 const *)txhdr, hdrlen); } else { pio_tx_frame_2byte_queue(pack, (u8 const *)txhdr, hdrlen); } list_del(& pack->list); q->buffer_used = (unsigned int )q->buffer_used + (unsigned int )((u16 )(((skb->len + hdrlen) + 3U) / 4U)) * 4U; q->free_packet_slots = (unsigned int )q->free_packet_slots + 65535U; return (0); } } int b43_pio_tx(struct b43_wldev *dev , struct sk_buff *skb ) { struct b43_pio_txqueue *q ; struct ieee80211_hdr *hdr ; unsigned int hdrlen ; unsigned int total_len ; int err ; struct ieee80211_tx_info *info ; struct ieee80211_tx_info *tmp ; u16 tmp___0 ; size_t tmp___1 ; long tmp___2 ; long tmp___3 ; int __ret_warn_on ; long tmp___4 ; u16 tmp___5 ; u16 tmp___6 ; long tmp___7 ; long tmp___8 ; int __ret_warn_on___0 ; long tmp___9 ; u16 tmp___10 ; { err = 0; tmp = IEEE80211_SKB_CB(skb); info = tmp; hdr = (struct ieee80211_hdr *)skb->data; if ((info->flags & 32U) != 0U) { q = dev->__annonCompField41.pio.tx_queue_mcast; hdr->frame_control = (__le16 )((unsigned int )hdr->frame_control | 8192U); } else { tmp___0 = skb_get_queue_mapping((struct sk_buff const *)skb); q = select_queue_by_priority(dev, (int )((u8 )tmp___0)); } tmp___1 = b43_txhdr_size(dev); hdrlen = (unsigned int )tmp___1; total_len = (((skb->len + hdrlen) + 3U) / 4U) * 4U; tmp___2 = ldv__builtin_expect((unsigned int )q->buffer_size < total_len, 0L); if (tmp___2 != 0L) { err = -105; b43dbg(dev->wl, "PIO: TX packet longer than queue.\n"); goto out; } else { } tmp___3 = ldv__builtin_expect((unsigned int )q->free_packet_slots == 0U, 0L); if (tmp___3 != 0L) { err = -105; b43warn(dev->wl, "PIO: TX packet overflow.\n"); goto out; } else { } __ret_warn_on = (int )q->buffer_used > (int )q->buffer_size; tmp___4 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___4 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/pio.c", 536); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); if ((unsigned int )((int )q->buffer_size - (int )q->buffer_used) < total_len) { err = -16; tmp___5 = skb_get_queue_mapping((struct sk_buff const *)skb); ieee80211_stop_queue((dev->wl)->hw, (int )tmp___5); q->stopped = 1; goto out; } else { } tmp___6 = skb_get_queue_mapping((struct sk_buff const *)skb); q->queue_prio = (u8 )tmp___6; err = pio_tx_frame(q, skb); tmp___7 = ldv__builtin_expect(err == -126, 0L); if (tmp___7 != 0L) { dev_kfree_skb_any(skb); err = 0; goto out; } else { } tmp___8 = ldv__builtin_expect(err != 0, 0L); if (tmp___8 != 0L) { b43err(dev->wl, "PIO transmission failure\n"); goto out; } else { } __ret_warn_on___0 = (int )q->buffer_used > (int )q->buffer_size; tmp___9 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___9 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/pio.c", 564); } else { } ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if ((int )q->buffer_size - (int )q->buffer_used <= 11 || (unsigned int )q->free_packet_slots == 0U) { tmp___10 = skb_get_queue_mapping((struct sk_buff const *)skb); ieee80211_stop_queue((dev->wl)->hw, (int )tmp___10); q->stopped = 1; } else { } out: ; return (err); } } void b43_pio_handle_txstatus(struct b43_wldev *dev , struct b43_txstatus const *status ) { struct b43_pio_txqueue *q ; struct b43_pio_txpacket *pack ; unsigned int total_len ; struct ieee80211_tx_info *info ; long tmp ; int __ret_warn_on ; long tmp___0 ; size_t tmp___1 ; { pack = (struct b43_pio_txpacket *)0; q = parse_cookie___0(dev, (int )status->cookie, & pack); tmp = ldv__builtin_expect((unsigned long )q == (unsigned long )((struct b43_pio_txqueue *)0), 0L); if (tmp != 0L) { return; } else { } __ret_warn_on = (unsigned long )pack == (unsigned long )((struct b43_pio_txpacket *)0); tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/pio.c", 587); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); info = IEEE80211_SKB_CB(pack->skb); b43_fill_txstatus_report(dev, info, status); tmp___1 = b43_txhdr_size(dev); total_len = (pack->skb)->len + (unsigned int )tmp___1; total_len = ((total_len + 3U) / 4U) * 4U; q->buffer_used = (int )q->buffer_used - (int )((u16 )total_len); q->free_packet_slots = (unsigned int )q->free_packet_slots + 1U; ieee80211_tx_status((dev->wl)->hw, pack->skb); pack->skb = (struct sk_buff *)0; list_add(& pack->list, & q->packets_list); if ((int )q->stopped) { ieee80211_wake_queue((dev->wl)->hw, (int )q->queue_prio); q->stopped = 0; } else { } return; } } static bool pio_rx_frame(struct b43_pio_rxqueue *q ) { struct b43_wldev *dev ; struct b43_wl *wl ; u16 len ; u32 macstat ; unsigned int i ; unsigned int padding ; struct sk_buff *skb ; char const *err_msg ; struct b43_rxhdr_fw4 *rxhdr ; u32 ctl ; u16 ctl___0 ; long tmp ; long tmp___0 ; long tmp___1 ; u8 *tail ; u8 *tail___0 ; { dev = q->dev; wl = dev->wl; err_msg = (char const *)0; rxhdr = (struct b43_rxhdr_fw4 *)(& wl->pio_scratchspace); memset((void *)rxhdr, 0, 20UL); if ((unsigned int )q->rev > 7U) { ctl = b43_piorx_read32(q, 0); if ((ctl & 1U) == 0U) { return (0); } else { } b43_piorx_write32(q, 0, 1U); i = 0U; goto ldv_37535; ldv_37534: ctl = b43_piorx_read32(q, 0); if ((ctl & 2U) != 0U) { goto data_ready; } else { } __const_udelay(42950UL); i = i + 1U; ldv_37535: ; if (i <= 9U) { goto ldv_37534; } else { } } else { ctl___0 = b43_piorx_read16(q, 0); if (((int )ctl___0 & 1) == 0) { return (0); } else { } b43_piorx_write16(q, 0, 1); i = 0U; goto ldv_37539; ldv_37538: ctl___0 = b43_piorx_read16(q, 0); if (((int )ctl___0 & 2) != 0) { goto data_ready; } else { } __const_udelay(42950UL); i = i + 1U; ldv_37539: ; if (i <= 9U) { goto ldv_37538; } else { } } b43dbg((q->dev)->wl, "PIO RX timed out\n"); return (1); data_ready: ; if ((unsigned int )q->rev > 7U) { ssb_block_read(dev->dev, (void *)rxhdr, 20UL, (int )((unsigned int )q->mmio_base + 4U), 4); } else { ssb_block_read(dev->dev, (void *)rxhdr, 20UL, (int )((unsigned int )q->mmio_base + 2U), 2); } len = rxhdr->frame_len; tmp = ldv__builtin_expect((unsigned int )len > 1792U, 0L); if (tmp != 0L) { err_msg = "len > 0x700"; goto rx_error; } else { } tmp___0 = ldv__builtin_expect((unsigned int )len == 0U, 0L); if (tmp___0 != 0L) { err_msg = "len == 0"; goto rx_error; } else { } macstat = rxhdr->mac_status; if ((int )macstat & 1) { if ((((q->dev)->wl)->filter_flags & 4U) == 0U) { err_msg = "Frame FCS error"; goto rx_error; } else { } } else { } padding = (macstat & 4U) != 0U ? 2U : 0U; skb = dev_alloc_skb(((unsigned int )len + padding) + 2U); tmp___1 = ldv__builtin_expect((unsigned long )skb == (unsigned long )((struct sk_buff *)0), 0L); if (tmp___1 != 0L) { err_msg = "Out of memory"; goto rx_error; } else { } skb_reserve(skb, 2); skb_put(skb, (unsigned int )len + padding); if ((unsigned int )q->rev > 7U) { ssb_block_read(dev->dev, (void *)skb->data + (unsigned long )padding, (size_t )((int )len & -4), (int )((unsigned int )q->mmio_base + 4U), 4); if (((int )len & 3) != 0) { tail = (u8 *)(& wl->pio_tailspace); ssb_block_read(dev->dev, (void *)tail, 4UL, (int )((unsigned int )q->mmio_base + 4U), 4); switch ((int )len & 3) { case 3: *(skb->data + (unsigned long )(((unsigned int )len + padding) - 3U)) = *tail; *(skb->data + (unsigned long )(((unsigned int )len + padding) - 2U)) = *(tail + 1UL); *(skb->data + (unsigned long )(((unsigned int )len + padding) - 1U)) = *(tail + 2UL); goto ldv_37544; case 2: *(skb->data + (unsigned long )(((unsigned int )len + padding) - 2U)) = *tail; *(skb->data + (unsigned long )(((unsigned int )len + padding) - 1U)) = *(tail + 1UL); goto ldv_37544; case 1: *(skb->data + (unsigned long )(((unsigned int )len + padding) - 1U)) = *tail; goto ldv_37544; } ldv_37544: ; } else { } } else { ssb_block_read(dev->dev, (void *)skb->data + (unsigned long )padding, (size_t )((int )len & -2), (int )((unsigned int )q->mmio_base + 2U), 2); if ((int )len & 1) { tail___0 = (u8 *)(& wl->pio_tailspace); ssb_block_read(dev->dev, (void *)tail___0, 2UL, (int )((unsigned int )q->mmio_base + 2U), 2); *(skb->data + (unsigned long )(((unsigned int )len + padding) - 1U)) = *tail___0; } else { } } b43_rx(q->dev, skb, (void const *)rxhdr); return (1); rx_error: ; if ((unsigned long )err_msg != (unsigned long )((char const *)0)) { b43dbg((q->dev)->wl, "PIO RX error: %s\n", err_msg); } else { } if ((unsigned int )q->rev > 7U) { b43_piorx_write32(q, 0, 2U); } else { b43_piorx_write16(q, 0, 2); } return (1); } } void b43_pio_rx(struct b43_pio_rxqueue *q ) { unsigned int count ; bool stop ; bool tmp ; int tmp___0 ; bool __warned ; int __ret_warn_once ; int __ret_warn_on ; long tmp___1 ; long tmp___2 ; long tmp___3 ; long tmp___4 ; { count = 0U; ldv_37560: tmp = pio_rx_frame(q); if ((int )tmp != 0) { tmp___0 = 0; } else { tmp___0 = 1; } stop = (bool )tmp___0; if ((int )stop) { goto ldv_37553; } else { } __might_sleep("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/pio.c", 766, 0); _cond_resched(); count = count + 1U; __ret_warn_once = count > 10000U; tmp___3 = ldv__builtin_expect(__ret_warn_once != 0, 0L); if (tmp___3 != 0L) { __ret_warn_on = ! __warned; tmp___1 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/pio.c", 767); } else { } tmp___2 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___2 != 0L) { __warned = 1; } else { } } else { } tmp___4 = ldv__builtin_expect(__ret_warn_once != 0, 0L); if (tmp___4 != 0L) { goto ldv_37553; } else { } goto ldv_37560; ldv_37553: ; return; } } static void b43_pio_tx_suspend_queue(struct b43_pio_txqueue *q ) { u32 tmp ; u16 tmp___0 ; { if ((unsigned int )q->rev > 7U) { tmp = b43_piotx_read32(q, 0); b43_piotx_write32(q, 0, tmp | 256U); } else { tmp___0 = b43_piotx_read16(q, 0); b43_piotx_write16(q, 0, (int )((unsigned int )tmp___0 | 128U)); } return; } } static void b43_pio_tx_resume_queue(struct b43_pio_txqueue *q ) { u32 tmp ; u16 tmp___0 ; { if ((unsigned int )q->rev > 7U) { tmp = b43_piotx_read32(q, 0); b43_piotx_write32(q, 0, tmp & 4294967039U); } else { tmp___0 = b43_piotx_read16(q, 0); b43_piotx_write16(q, 0, (int )tmp___0 & 65407); } return; } } void b43_pio_tx_suspend(struct b43_wldev *dev ) { { b43_power_saving_ctl_bits(dev, 4U); b43_pio_tx_suspend_queue(dev->__annonCompField41.pio.tx_queue_AC_BK); b43_pio_tx_suspend_queue(dev->__annonCompField41.pio.tx_queue_AC_BE); b43_pio_tx_suspend_queue(dev->__annonCompField41.pio.tx_queue_AC_VI); b43_pio_tx_suspend_queue(dev->__annonCompField41.pio.tx_queue_AC_VO); b43_pio_tx_suspend_queue(dev->__annonCompField41.pio.tx_queue_mcast); return; } } void b43_pio_tx_resume(struct b43_wldev *dev ) { { b43_pio_tx_resume_queue(dev->__annonCompField41.pio.tx_queue_mcast); b43_pio_tx_resume_queue(dev->__annonCompField41.pio.tx_queue_AC_VO); b43_pio_tx_resume_queue(dev->__annonCompField41.pio.tx_queue_AC_VI); b43_pio_tx_resume_queue(dev->__annonCompField41.pio.tx_queue_AC_BE); b43_pio_tx_resume_queue(dev->__annonCompField41.pio.tx_queue_AC_BK); b43_power_saving_ctl_bits(dev, 0U); return; } } int ldv_del_timer_sync_81(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type ldv_func_res ; int tmp ; { tmp = del_timer_sync(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_9(ldv_func_arg1); return (ldv_func_res); } } int ldv_del_timer_82(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___0 ldv_func_res ; int tmp ; { tmp = del_timer(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_9(ldv_func_arg1); return (ldv_func_res); } } int ldv_request_threaded_irq_83(unsigned int ldv_func_arg1 , irqreturn_t (*handler)(int , void * ) , irqreturn_t (*thread_fn)(int , void * ) , unsigned long ldv_func_arg4 , char const *ldv_func_arg5 , void *ldv_func_arg6 ) { ldv_func_ret_type___1 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = request_threaded_irq(ldv_func_arg1, handler, thread_fn, ldv_func_arg4, ldv_func_arg5, ldv_func_arg6); ldv_func_res = tmp; tmp___0 = reg_check_2(handler, thread_fn); if (tmp___0 != 0 && ldv_func_res >= 0) { activate_suitable_irq_2((int )ldv_func_arg1, ldv_func_arg6); } else { } return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; int ldv_del_timer_88(struct timer_list *ldv_func_arg1 ) ; int ldv_del_timer_sync_87(struct timer_list *ldv_func_arg1 ) ; int ldv_request_threaded_irq_89(unsigned int ldv_func_arg1 , irqreturn_t (*handler)(int , void * ) , irqreturn_t (*thread_fn)(int , void * ) , unsigned long ldv_func_arg4 , char const *ldv_func_arg5 , void *ldv_func_arg6 ) ; extern void wiphy_rfkill_set_hw_state(struct wiphy * , bool ) ; bool b43_is_hw_radio_enabled(struct b43_wldev *dev ) ; bool b43_is_hw_radio_enabled(struct b43_wldev *dev ) { u32 tmp ; int tmp___0 ; u16 tmp___1 ; { if ((unsigned int )dev->phy.rev > 2U || (unsigned int )dev->phy.type == 5U) { tmp = b43_read32(dev, 344); if ((tmp & 65536U) == 0U) { return (1); } else { } } else { tmp___0 = atomic_read((atomic_t const *)(& dev->__init_status)); if (tmp___0 <= 1) { return (1); } else { } tmp___1 = b43_read16(dev, 1178); if (((int )tmp___1 & 16) != 0) { return (1); } else { } } return (0); } } void b43_rfkill_poll(struct ieee80211_hw *hw ) { struct b43_wl *wl ; struct b43_wl *tmp ; struct b43_wldev *dev ; struct ssb_bus *bus ; bool enabled ; bool brought_up ; int tmp___0 ; int tmp___1 ; long tmp___2 ; long tmp___3 ; { tmp = hw_to_b43_wl(hw); wl = tmp; dev = wl->current_dev; bus = (dev->dev)->bus; brought_up = 0; mutex_lock_nested(& wl->mutex, 0U); tmp___1 = atomic_read((atomic_t const *)(& dev->__init_status)); tmp___2 = ldv__builtin_expect(tmp___1 <= 0, 0L); if (tmp___2 != 0L) { tmp___0 = ssb_bus_powerup(bus, 0); if (tmp___0 != 0) { mutex_unlock(& wl->mutex); return; } else { } ssb_device_enable(dev->dev, 0U); brought_up = 1; } else { } enabled = b43_is_hw_radio_enabled(dev); tmp___3 = ldv__builtin_expect((int )dev->radio_hw_enable != (int )enabled, 0L); if (tmp___3 != 0L) { dev->radio_hw_enable = enabled; b43info(wl, "Radio hardware status changed to %s\n", (int )enabled ? (char *)"ENABLED" : (char *)"DISABLED"); wiphy_rfkill_set_hw_state(hw->wiphy, (int )((bool )(! ((int )enabled != 0)))); if ((int )dev->phy.radio_on != (int )enabled) { b43_software_rfkill(dev, (int )((bool )(! ((int )enabled != 0)))); } else { } } else { } if ((int )brought_up) { ssb_device_disable(dev->dev, 0U); ssb_bus_may_powerdown(bus); } else { } mutex_unlock(& wl->mutex); return; } } int ldv_del_timer_sync_87(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type ldv_func_res ; int tmp ; { tmp = del_timer_sync(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_9(ldv_func_arg1); return (ldv_func_res); } } int ldv_del_timer_88(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___0 ldv_func_res ; int tmp ; { tmp = del_timer(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_9(ldv_func_arg1); return (ldv_func_res); } } int ldv_request_threaded_irq_89(unsigned int ldv_func_arg1 , irqreturn_t (*handler)(int , void * ) , irqreturn_t (*thread_fn)(int , void * ) , unsigned long ldv_func_arg4 , char const *ldv_func_arg5 , void *ldv_func_arg6 ) { ldv_func_ret_type___1 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = request_threaded_irq(ldv_func_arg1, handler, thread_fn, ldv_func_arg4, ldv_func_arg5, ldv_func_arg6); ldv_func_res = tmp; tmp___0 = reg_check_2(handler, thread_fn); if (tmp___0 != 0 && ldv_func_res >= 0) { activate_suitable_irq_2((int )ldv_func_arg1, ldv_func_arg6); } else { } return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; extern char *strncpy(char * , char const * , __kernel_size_t ) ; int ldv_del_timer_94(struct timer_list *ldv_func_arg1 ) ; int ldv_del_timer_sync_93(struct timer_list *ldv_func_arg1 ) ; void invoke_work_8(void) ; void call_and_disable_all_8(int state ) ; void activate_work_8(struct work_struct *work , int state ) ; void call_and_disable_work_8(struct work_struct *work ) ; void disable_work_8(struct work_struct *work ) ; int ldv_request_threaded_irq_95(unsigned int ldv_func_arg1 , irqreturn_t (*handler)(int , void * ) , irqreturn_t (*thread_fn)(int , void * ) , unsigned long ldv_func_arg4 , char const *ldv_func_arg5 , void *ldv_func_arg6 ) ; extern char *__ieee80211_get_tx_led_name(struct ieee80211_hw * ) ; extern char *__ieee80211_get_rx_led_name(struct ieee80211_hw * ) ; extern char *__ieee80211_get_assoc_led_name(struct ieee80211_hw * ) ; extern char *__ieee80211_get_radio_led_name(struct ieee80211_hw * ) ; __inline static char *ieee80211_get_tx_led_name(struct ieee80211_hw *hw ) { char *tmp ; { tmp = __ieee80211_get_tx_led_name(hw); return (tmp); } } __inline static char *ieee80211_get_rx_led_name(struct ieee80211_hw *hw ) { char *tmp ; { tmp = __ieee80211_get_rx_led_name(hw); return (tmp); } } __inline static char *ieee80211_get_assoc_led_name(struct ieee80211_hw *hw ) { char *tmp ; { tmp = __ieee80211_get_assoc_led_name(hw); return (tmp); } } __inline static char *ieee80211_get_radio_led_name(struct ieee80211_hw *hw ) { char *tmp ; { tmp = __ieee80211_get_radio_led_name(hw); return (tmp); } } extern int led_classdev_register(struct device * , struct led_classdev * ) ; extern void led_classdev_unregister(struct led_classdev * ) ; static void b43_led_turn_on(struct b43_wldev *dev , u8 led_index , bool activelow ) { u16 ctl ; { ctl = b43_read16(dev, 1180); if ((int )activelow) { ctl = (u16 )(~ ((int )((short )(1 << (int )led_index))) & (int )((short )ctl)); } else { ctl = (u16 )((int )((short )(1 << (int )led_index)) | (int )((short )ctl)); } b43_write16(dev, 1180, (int )ctl); return; } } static void b43_led_turn_off(struct b43_wldev *dev , u8 led_index , bool activelow ) { u16 ctl ; { ctl = b43_read16(dev, 1180); if ((int )activelow) { ctl = (u16 )((int )((short )(1 << (int )led_index)) | (int )((short )ctl)); } else { ctl = (u16 )(~ ((int )((short )(1 << (int )led_index))) & (int )((short )ctl)); } b43_write16(dev, 1180, (int )ctl); return; } } static void b43_led_update(struct b43_wldev *dev , struct b43_led *led ) { bool radio_enabled ; bool turn_on ; int tmp ; { if ((unsigned long )led->wl == (unsigned long )((struct b43_wl *)0)) { return; } else { } radio_enabled = (bool )((int )dev->phy.radio_on && (int )dev->radio_hw_enable); if ((int )radio_enabled) { tmp = atomic_read((atomic_t const *)(& led->state)); turn_on = tmp != 0; } else { turn_on = 0; } if ((int )led->hw_state == (int )turn_on) { return; } else { } led->hw_state = turn_on; if ((int )turn_on) { b43_led_turn_on(dev, (int )led->index, (int )led->activelow); } else { b43_led_turn_off(dev, (int )led->index, (int )led->activelow); } return; } } static void b43_leds_work(struct work_struct *work ) { struct b43_leds *leds ; struct work_struct const *__mptr ; struct b43_wl *wl ; struct b43_leds const *__mptr___0 ; struct b43_wldev *dev ; int tmp ; int tmp___0 ; long tmp___1 ; { __mptr = (struct work_struct const *)work; leds = (struct b43_leds *)__mptr + 0xfffffffffffffb58UL; __mptr___0 = (struct b43_leds const *)leds; wl = (struct b43_wl *)__mptr___0 + 0xfffffffffffffd00UL; mutex_lock_nested(& wl->mutex, 0U); dev = wl->current_dev; if ((unsigned long )dev == (unsigned long )((struct b43_wldev *)0)) { tmp___0 = 1; } else { tmp = atomic_read((atomic_t const *)(& dev->__init_status)); if (tmp <= 1) { tmp___0 = 1; } else { tmp___0 = 0; } } tmp___1 = ldv__builtin_expect((long )tmp___0, 0L); if (tmp___1 != 0L) { goto out_unlock; } else { } b43_led_update(dev, & wl->leds.led_tx); b43_led_update(dev, & wl->leds.led_rx); b43_led_update(dev, & wl->leds.led_radio); b43_led_update(dev, & wl->leds.led_assoc); out_unlock: mutex_unlock(& wl->mutex); return; } } static void b43_led_brightness_set(struct led_classdev *led_dev , enum led_brightness brightness ) { struct b43_led *led ; struct led_classdev const *__mptr ; struct b43_wl *wl ; long tmp ; { __mptr = (struct led_classdev const *)led_dev; led = (struct b43_led *)__mptr + 0xfffffffffffffff8UL; wl = led->wl; tmp = ldv__builtin_expect((long )(! wl->leds.stop), 1L); if (tmp != 0L) { atomic_set(& led->state, (int )brightness); ieee80211_queue_work(wl->hw, & wl->leds.work); } else { } return; } } static int b43_register_led(struct b43_wldev *dev , struct b43_led *led , char const *name , char const *default_trigger , u8 led_index , bool activelow ) { int err ; { if ((unsigned long )led->wl != (unsigned long )((struct b43_wl *)0)) { return (-17); } else { } if ((unsigned long )default_trigger == (unsigned long )((char const *)0)) { return (-22); } else { } led->wl = dev->wl; led->index = led_index; led->activelow = activelow; strncpy((char *)(& led->name), name, 32UL); atomic_set(& led->state, 0); led->led_dev.name = (char const *)(& led->name); led->led_dev.default_trigger = default_trigger; led->led_dev.brightness_set = & b43_led_brightness_set; err = led_classdev_register((dev->dev)->dev, & led->led_dev); if (err != 0) { b43warn(dev->wl, "LEDs: Failed to register %s\n", name); led->wl = (struct b43_wl *)0; return (err); } else { } return (0); } } static void b43_unregister_led(struct b43_led *led ) { { if ((unsigned long )led->wl == (unsigned long )((struct b43_wl *)0)) { return; } else { } led_classdev_unregister(& led->led_dev); led->wl = (struct b43_wl *)0; return; } } static void b43_map_led(struct b43_wldev *dev , u8 led_index , enum b43_led_behaviour behaviour , bool activelow ) { struct ieee80211_hw *hw ; char name[32U] ; char const *tmp ; char *tmp___0 ; char const *tmp___1 ; char *tmp___2 ; char const *tmp___3 ; char *tmp___4 ; char const *tmp___5 ; char *tmp___6 ; { hw = (dev->wl)->hw; switch ((unsigned int )behaviour) { case 11U: ; case 0U: ; case 1U: ; goto ldv_36988; case 2U: ; case 7U: ; case 8U: tmp = wiphy_name((struct wiphy const *)hw->wiphy); snprintf((char *)(& name), 32UL, "b43-%s::tx", tmp); tmp___0 = ieee80211_get_tx_led_name(hw); b43_register_led(dev, & (dev->wl)->leds.led_tx, (char const *)(& name), (char const *)tmp___0, (int )led_index, (int )activelow); tmp___1 = wiphy_name((struct wiphy const *)hw->wiphy); snprintf((char *)(& name), 32UL, "b43-%s::rx", tmp___1); tmp___2 = ieee80211_get_rx_led_name(hw); b43_register_led(dev, & (dev->wl)->leds.led_rx, (char const *)(& name), (char const *)tmp___2, (int )led_index, (int )activelow); goto ldv_36988; case 3U: ; case 4U: ; case 5U: ; case 6U: tmp___3 = wiphy_name((struct wiphy const *)hw->wiphy); snprintf((char *)(& name), 32UL, "b43-%s::radio", tmp___3); tmp___4 = ieee80211_get_radio_led_name(hw); b43_register_led(dev, & (dev->wl)->leds.led_radio, (char const *)(& name), (char const *)tmp___4, (int )led_index, (int )activelow); goto ldv_36988; case 9U: ; case 10U: tmp___5 = wiphy_name((struct wiphy const *)hw->wiphy); snprintf((char *)(& name), 32UL, "b43-%s::assoc", tmp___5); tmp___6 = ieee80211_get_assoc_led_name(hw); b43_register_led(dev, & (dev->wl)->leds.led_assoc, (char const *)(& name), (char const *)tmp___6, (int )led_index, (int )activelow); goto ldv_36988; default: b43warn(dev->wl, "LEDs: Unknown behaviour 0x%02X\n", (unsigned int )behaviour); goto ldv_36988; } ldv_36988: ; return; } } static void b43_led_get_sprominfo(struct b43_wldev *dev , unsigned int led_index , enum b43_led_behaviour *behaviour , bool *activelow ) { struct ssb_bus *bus ; u8 sprom[4U] ; int __ret_warn_on ; long tmp ; { bus = (dev->dev)->bus; sprom[0] = bus->sprom.gpio0; sprom[1] = bus->sprom.gpio1; sprom[2] = bus->sprom.gpio2; sprom[3] = bus->sprom.gpio3; if ((unsigned int )sprom[led_index] == 255U) { *activelow = 0; switch (led_index) { case 0U: *behaviour = 2; *activelow = 1; if ((unsigned int )bus->boardinfo.vendor == 3601U) { *behaviour = 3; } else { } goto ldv_37008; case 1U: *behaviour = 5; if ((unsigned int )bus->boardinfo.vendor == 4163U) { *behaviour = 10; } else { } goto ldv_37008; case 2U: *behaviour = 4; goto ldv_37008; case 3U: *behaviour = 0; goto ldv_37008; default: *behaviour = 0; __ret_warn_on = 1; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/leds.c", 250); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); return; } ldv_37008: ; } else { *behaviour = (enum b43_led_behaviour )((int )sprom[led_index] & 127); *activelow = (int )((signed char )sprom[led_index]) < 0; } return; } } void b43_leds_init(struct b43_wldev *dev ) { struct b43_led *led ; unsigned int i ; enum b43_led_behaviour behaviour ; bool activelow ; bool tmp ; { led = & (dev->wl)->leds.led_radio; if ((unsigned long )led->wl != (unsigned long )((struct b43_wl *)0)) { if ((int )dev->phy.radio_on) { tmp = b43_is_hw_radio_enabled(dev); if ((int )tmp) { b43_led_turn_on(dev, (int )led->index, (int )led->activelow); led->hw_state = 1; atomic_set(& led->state, 1); } else { b43_led_turn_off(dev, (int )led->index, (int )led->activelow); led->hw_state = 0; atomic_set(& led->state, 0); } } else { b43_led_turn_off(dev, (int )led->index, (int )led->activelow); led->hw_state = 0; atomic_set(& led->state, 0); } } else { } led = & (dev->wl)->leds.led_tx; if ((unsigned long )led->wl != (unsigned long )((struct b43_wl *)0)) { b43_led_turn_off(dev, (int )led->index, (int )led->activelow); led->hw_state = 0; atomic_set(& led->state, 0); } else { } led = & (dev->wl)->leds.led_rx; if ((unsigned long )led->wl != (unsigned long )((struct b43_wl *)0)) { b43_led_turn_off(dev, (int )led->index, (int )led->activelow); led->hw_state = 0; atomic_set(& led->state, 0); } else { } led = & (dev->wl)->leds.led_assoc; if ((unsigned long )led->wl != (unsigned long )((struct b43_wl *)0)) { b43_led_turn_off(dev, (int )led->index, (int )led->activelow); led->hw_state = 0; atomic_set(& led->state, 0); } else { } i = 0U; goto ldv_37027; ldv_37026: b43_led_get_sprominfo(dev, i, & behaviour, & activelow); switch ((unsigned int )behaviour) { case 0U: b43_led_turn_off(dev, (int )((u8 )i), (int )activelow); goto ldv_37023; case 1U: b43_led_turn_on(dev, (int )((u8 )i), (int )activelow); goto ldv_37023; default: ; goto ldv_37023; } ldv_37023: i = i + 1U; ldv_37027: ; if (i <= 3U) { goto ldv_37026; } else { } (dev->wl)->leds.stop = 0; return; } } void b43_leds_exit(struct b43_wldev *dev ) { struct b43_leds *leds ; { leds = & (dev->wl)->leds; b43_led_turn_off(dev, (int )leds->led_tx.index, (int )leds->led_tx.activelow); b43_led_turn_off(dev, (int )leds->led_rx.index, (int )leds->led_rx.activelow); b43_led_turn_off(dev, (int )leds->led_assoc.index, (int )leds->led_assoc.activelow); b43_led_turn_off(dev, (int )leds->led_radio.index, (int )leds->led_radio.activelow); return; } } void b43_leds_stop(struct b43_wldev *dev ) { struct b43_leds *leds ; { leds = & (dev->wl)->leds; leds->stop = 1; cancel_work_sync(& leds->work); return; } } void b43_leds_register(struct b43_wldev *dev ) { unsigned int i ; enum b43_led_behaviour behaviour ; bool activelow ; struct lock_class_key __key ; atomic_long_t __constr_expr_0 ; { __init_work(& (dev->wl)->leds.work, 0); __constr_expr_0.counter = 2097664L; (dev->wl)->leds.work.data = __constr_expr_0; lockdep_init_map(& (dev->wl)->leds.work.lockdep_map, "(&dev->wl->leds.work)", & __key, 0); INIT_LIST_HEAD(& (dev->wl)->leds.work.entry); (dev->wl)->leds.work.func = & b43_leds_work; i = 0U; goto ldv_37046; ldv_37045: b43_led_get_sprominfo(dev, i, & behaviour, & activelow); b43_map_led(dev, (int )((u8 )i), behaviour, (int )activelow); i = i + 1U; ldv_37046: ; if (i <= 3U) { goto ldv_37045; } else { } return; } } void b43_leds_unregister(struct b43_wl *wl ) { struct b43_leds *leds ; { leds = & wl->leds; b43_unregister_led(& leds->led_tx); b43_unregister_led(& leds->led_rx); b43_unregister_led(& leds->led_assoc); b43_unregister_led(& leds->led_radio); return; } } void invoke_work_8(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_work_8_0 == 2 || ldv_work_8_0 == 3) { ldv_work_8_0 = 4; b43_leds_work(ldv_work_struct_8_0); ldv_work_8_0 = 1; } else { } goto ldv_37058; case 1: ; if (ldv_work_8_1 == 2 || ldv_work_8_1 == 3) { ldv_work_8_1 = 4; b43_leds_work(ldv_work_struct_8_0); ldv_work_8_1 = 1; } else { } goto ldv_37058; case 2: ; if (ldv_work_8_2 == 2 || ldv_work_8_2 == 3) { ldv_work_8_2 = 4; b43_leds_work(ldv_work_struct_8_0); ldv_work_8_2 = 1; } else { } goto ldv_37058; case 3: ; if (ldv_work_8_3 == 2 || ldv_work_8_3 == 3) { ldv_work_8_3 = 4; b43_leds_work(ldv_work_struct_8_0); ldv_work_8_3 = 1; } else { } goto ldv_37058; default: ldv_stop(); } ldv_37058: ; return; } } void call_and_disable_all_8(int state ) { { if (ldv_work_8_0 == state) { call_and_disable_work_8(ldv_work_struct_8_0); } else { } if (ldv_work_8_1 == state) { call_and_disable_work_8(ldv_work_struct_8_1); } else { } if (ldv_work_8_2 == state) { call_and_disable_work_8(ldv_work_struct_8_2); } else { } if (ldv_work_8_3 == state) { call_and_disable_work_8(ldv_work_struct_8_3); } else { } return; } } void activate_work_8(struct work_struct *work , int state ) { { if (ldv_work_8_0 == 0) { ldv_work_struct_8_0 = work; ldv_work_8_0 = state; return; } else { } if (ldv_work_8_1 == 0) { ldv_work_struct_8_1 = work; ldv_work_8_1 = state; return; } else { } if (ldv_work_8_2 == 0) { ldv_work_struct_8_2 = work; ldv_work_8_2 = state; return; } else { } if (ldv_work_8_3 == 0) { ldv_work_struct_8_3 = work; ldv_work_8_3 = state; return; } else { } return; } } void work_init_8(void) { { ldv_work_8_0 = 0; ldv_work_8_1 = 0; ldv_work_8_2 = 0; ldv_work_8_3 = 0; return; } } void call_and_disable_work_8(struct work_struct *work ) { { if ((ldv_work_8_0 == 2 || ldv_work_8_0 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_8_0) { b43_leds_work(work); ldv_work_8_0 = 1; return; } else { } if ((ldv_work_8_1 == 2 || ldv_work_8_1 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_8_1) { b43_leds_work(work); ldv_work_8_1 = 1; return; } else { } if ((ldv_work_8_2 == 2 || ldv_work_8_2 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_8_2) { b43_leds_work(work); ldv_work_8_2 = 1; return; } else { } if ((ldv_work_8_3 == 2 || ldv_work_8_3 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_8_3) { b43_leds_work(work); ldv_work_8_3 = 1; return; } else { } return; } } void disable_work_8(struct work_struct *work ) { { if ((ldv_work_8_0 == 3 || ldv_work_8_0 == 2) && (unsigned long )ldv_work_struct_8_0 == (unsigned long )work) { ldv_work_8_0 = 1; } else { } if ((ldv_work_8_1 == 3 || ldv_work_8_1 == 2) && (unsigned long )ldv_work_struct_8_1 == (unsigned long )work) { ldv_work_8_1 = 1; } else { } if ((ldv_work_8_2 == 3 || ldv_work_8_2 == 2) && (unsigned long )ldv_work_struct_8_2 == (unsigned long )work) { ldv_work_8_2 = 1; } else { } if ((ldv_work_8_3 == 3 || ldv_work_8_3 == 2) && (unsigned long )ldv_work_struct_8_3 == (unsigned long )work) { ldv_work_8_3 = 1; } else { } return; } } int ldv_del_timer_sync_93(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type ldv_func_res ; int tmp ; { tmp = del_timer_sync(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_9(ldv_func_arg1); return (ldv_func_res); } } int ldv_del_timer_94(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___0 ldv_func_res ; int tmp ; { tmp = del_timer(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_9(ldv_func_arg1); return (ldv_func_res); } } int ldv_request_threaded_irq_95(unsigned int ldv_func_arg1 , irqreturn_t (*handler)(int , void * ) , irqreturn_t (*thread_fn)(int , void * ) , unsigned long ldv_func_arg4 , char const *ldv_func_arg5 , void *ldv_func_arg6 ) { ldv_func_ret_type___1 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = request_threaded_irq(ldv_func_arg1, handler, thread_fn, ldv_func_arg4, ldv_func_arg5, ldv_func_arg6); ldv_func_res = tmp; tmp___0 = reg_check_2(handler, thread_fn); if (tmp___0 != 0 && ldv_func_res >= 0) { activate_suitable_irq_2((int )ldv_func_arg1, ldv_func_arg6); } else { } return (ldv_func_res); } } int ldv_del_timer_100(struct timer_list *ldv_func_arg1 ) ; int ldv_del_timer_sync_99(struct timer_list *ldv_func_arg1 ) ; extern int ssb_bus_pcmciabus_register(struct ssb_bus * , struct pcmcia_device * , unsigned long ) ; extern void ssb_bus_unregister(struct ssb_bus * ) ; extern int ssb_bus_suspend(struct ssb_bus * ) ; extern int ssb_bus_resume(struct ssb_bus * ) ; int ldv_request_threaded_irq_101(unsigned int ldv_func_arg1 , irqreturn_t (*handler)(int , void * ) , irqreturn_t (*thread_fn)(int , void * ) , unsigned long ldv_func_arg4 , char const *ldv_func_arg5 , void *ldv_func_arg6 ) ; extern int pcmcia_register_driver(struct pcmcia_driver * ) ; extern void pcmcia_unregister_driver(struct pcmcia_driver * ) ; extern int pcmcia_request_configuration(struct pcmcia_device * , config_req_t * ) ; extern int pcmcia_request_window(struct pcmcia_device * , win_req_t * , window_handle_t ** ) ; extern int pcmcia_map_mem_page(struct pcmcia_device * , window_handle_t , unsigned int ) ; extern void pcmcia_disable_device(struct pcmcia_device * ) ; static struct pcmcia_device_id b43_pcmcia_tbl[3U] = { {3U, 720U, 1096U, (unsigned char)0, (unsigned char)0, (unsigned char)0, {0U, 0U, 0U, 0U}, {0, 0, 0, 0}, 0UL, 0}, {3U, 720U, 1142U, (unsigned char)0, (unsigned char)0, (unsigned char)0, {0U, 0U, 0U, 0U}, {0, 0, 0, 0}, 0UL, 0}, {0U, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, {0U, 0U, 0U, 0U}, {0, 0, 0, 0}, 0UL, 0}}; struct pcmcia_device_id const __mod_pcmcia_device_table ; static int b43_pcmcia_suspend(struct pcmcia_device *dev ) { struct ssb_bus *ssb ; int tmp ; { ssb = (struct ssb_bus *)dev->priv; tmp = ssb_bus_suspend(ssb); return (tmp); } } static int b43_pcmcia_resume(struct pcmcia_device *dev ) { struct ssb_bus *ssb ; int tmp ; { ssb = (struct ssb_bus *)dev->priv; tmp = ssb_bus_resume(ssb); return (tmp); } } static int b43_pcmcia_probe(struct pcmcia_device *dev ) { struct ssb_bus *ssb ; win_req_t win ; int err ; int res ; void *tmp ; { err = -12; res = 0; tmp = kzalloc(1512UL, 208U); ssb = (struct ssb_bus *)tmp; if ((unsigned long )ssb == (unsigned long )((struct ssb_bus *)0)) { goto out_error; } else { } err = -19; dev->conf.Attributes = 1U; dev->conf.IntType = 2U; win.Attributes = 67U; win.Base = 0UL; win.Size = 4096U; win.AccessSpeed = 250U; res = pcmcia_request_window(dev, & win, & dev->win); if (res != 0) { goto err_kfree_ssb; } else { } res = pcmcia_map_mem_page(dev, dev->win, 0U); if (res != 0) { goto err_disable; } else { } if (dev->irq == 0U) { goto err_disable; } else { } res = pcmcia_request_configuration(dev, & dev->conf); if (res != 0) { goto err_disable; } else { } err = ssb_bus_pcmciabus_register(ssb, dev, win.Base); if (err != 0) { goto err_disable; } else { } dev->priv = (void *)ssb; return (0); err_disable: pcmcia_disable_device(dev); err_kfree_ssb: kfree((void const *)ssb); out_error: printk("<3>b43-pcmcia: Initialization failed (%d, %d)\n", res, err); return (err); } } static void b43_pcmcia_remove(struct pcmcia_device *dev ) { struct ssb_bus *ssb ; { ssb = (struct ssb_bus *)dev->priv; ssb_bus_unregister(ssb); pcmcia_disable_device(dev); kfree((void const *)ssb); dev->priv = (void *)0; return; } } static struct pcmcia_driver b43_pcmcia_driver = {& b43_pcmcia_probe, & b43_pcmcia_remove, & b43_pcmcia_suspend, & b43_pcmcia_resume, & __this_module, (struct pcmcia_device_id *)(& b43_pcmcia_tbl), {"b43-pcmcia", 0, 0, 0, (_Bool)0, 0, 0, 0, 0, 0, 0, 0, 0}, {{{0}, {{{{0U}, 0U, 0U, 0, {0, 0, 0, 0, 0UL}}}}, {0, 0}, 0, 0, 0, {0, 0, 0, 0, 0UL}}, {0, 0}}}; int b43_pcmcia_init(void) { int tmp ; { tmp = pcmcia_register_driver(& b43_pcmcia_driver); return (tmp); } } void b43_pcmcia_exit(void) { { pcmcia_unregister_driver(& b43_pcmcia_driver); return; } } int ldv_retval_5 ; int ldv_retval_4 ; int ldv_retval_3 ; void ldv_initialize_pcmcia_driver_22(void) { void *tmp ; { tmp = ldv_init_zalloc(1240UL); b43_pcmcia_driver_group0 = (struct pcmcia_device *)tmp; return; } } void ldv_main_exported_22(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_state_variable_22 == 1) { ldv_retval_5 = b43_pcmcia_probe(b43_pcmcia_driver_group0); if (ldv_retval_5 == 0) { ldv_state_variable_22 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_24053; case 1: ; if (ldv_state_variable_22 == 2) { ldv_retval_4 = b43_pcmcia_suspend(b43_pcmcia_driver_group0); if (ldv_retval_4 == 0) { ldv_state_variable_22 = 3; } else { } } else { } goto ldv_24053; case 2: ; if (ldv_state_variable_22 == 3) { ldv_retval_3 = b43_pcmcia_resume(b43_pcmcia_driver_group0); if (ldv_retval_3 == 0) { ldv_state_variable_22 = 2; } else { } } else { } goto ldv_24053; case 3: ; if (ldv_state_variable_22 == 3) { b43_pcmcia_remove(b43_pcmcia_driver_group0); ldv_state_variable_22 = 1; ref_cnt = ref_cnt - 1; } else { } if (ldv_state_variable_22 == 2) { b43_pcmcia_remove(b43_pcmcia_driver_group0); ldv_state_variable_22 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_24053; default: ldv_stop(); } ldv_24053: ; return; } } int ldv_del_timer_sync_99(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type ldv_func_res ; int tmp ; { tmp = del_timer_sync(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_9(ldv_func_arg1); return (ldv_func_res); } } int ldv_del_timer_100(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___0 ldv_func_res ; int tmp ; { tmp = del_timer(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_9(ldv_func_arg1); return (ldv_func_res); } } int ldv_request_threaded_irq_101(unsigned int ldv_func_arg1 , irqreturn_t (*handler)(int , void * ) , irqreturn_t (*thread_fn)(int , void * ) , unsigned long ldv_func_arg4 , char const *ldv_func_arg5 , void *ldv_func_arg6 ) { ldv_func_ret_type___1 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = request_threaded_irq(ldv_func_arg1, handler, thread_fn, ldv_func_arg4, ldv_func_arg5, ldv_func_arg6); ldv_func_res = tmp; tmp___0 = reg_check_2(handler, thread_fn); if (tmp___0 != 0 && ldv_func_res >= 0) { activate_suitable_irq_2((int )ldv_func_arg1, ldv_func_arg6); } else { } return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; int ldv_del_timer_106(struct timer_list *ldv_func_arg1 ) ; int ldv_del_timer_sync_105(struct timer_list *ldv_func_arg1 ) ; void ldv_sdio_claim_host(struct sdio_func *func ) ; void ldv_sdio_release_host(struct sdio_func *func ) ; void ldv_check_context(struct sdio_func *func ) ; int ldv_request_threaded_irq_107(unsigned int ldv_func_arg1 , irqreturn_t (*handler)(int , void * ) , irqreturn_t (*thread_fn)(int , void * ) , unsigned long ldv_func_arg4 , char const *ldv_func_arg5 , void *ldv_func_arg6 ) ; extern void *dev_get_drvdata(struct device const * ) ; extern void dev_set_drvdata(struct device * , void * ) ; extern int dev_err(struct device const * , char const * , ...) ; extern int _dev_info(struct device const * , char const * , ...) ; extern int sdio_register_driver(struct sdio_driver * ) ; extern void sdio_unregister_driver(struct sdio_driver * ) ; void ldv_sdio_claim_host_109(struct sdio_func *func ) ; void ldv_sdio_claim_host_110(struct sdio_func *func ) ; void ldv_sdio_claim_host_113(struct sdio_func *func ) ; void ldv_sdio_claim_host_116(struct sdio_func *func ) ; void ldv_sdio_claim_host_121(struct sdio_func *func ) ; void ldv_sdio_release_host_108(struct sdio_func *func ) ; void ldv_sdio_release_host_112(struct sdio_func *func ) ; void ldv_sdio_release_host_115(struct sdio_func *func ) ; void ldv_sdio_release_host_118(struct sdio_func *func ) ; void ldv_sdio_release_host_120(struct sdio_func *func ) ; void ldv_sdio_release_host_123(struct sdio_func *func ) ; extern int sdio_enable_func(struct sdio_func * ) ; int ldv_sdio_enable_func_117(struct sdio_func *func ) ; extern int sdio_disable_func(struct sdio_func * ) ; int ldv_sdio_disable_func_119(struct sdio_func *func ) ; int ldv_sdio_disable_func_122(struct sdio_func *func ) ; extern int sdio_set_block_size(struct sdio_func * , unsigned int ) ; extern int sdio_claim_irq(struct sdio_func * , void (*)(struct sdio_func * ) ) ; int ldv_sdio_claim_irq_111(struct sdio_func *func , void (*ldv_func_arg2)(struct sdio_func * ) ) ; extern int sdio_release_irq(struct sdio_func * ) ; int ldv_sdio_release_irq_114(struct sdio_func *func ) ; extern int ssb_bus_sdiobus_register(struct ssb_bus * , struct sdio_func * , unsigned int ) ; static struct b43_sdio_quirk const b43_sdio_quirks[2U] = { {5348U, 17176U, 1U}}; static unsigned int b43_sdio_get_quirks(u16 vendor , u16 device ) { struct b43_sdio_quirk const *q ; { q = (struct b43_sdio_quirk const *)(& b43_sdio_quirks); goto ldv_37329; ldv_37328: ; if ((int )((unsigned short )q->vendor) == (int )vendor && (int )((unsigned short )q->device) == (int )device) { return ((unsigned int )q->quirks); } else { } q = q + 1; ldv_37329: ; if ((unsigned int )q->quirks != 0U) { goto ldv_37328; } else { } return (0U); } } static void b43_sdio_interrupt_dispatcher(struct sdio_func *func ) { struct b43_sdio *sdio ; void *tmp ; struct b43_wldev *dev ; int tmp___0 ; long tmp___1 ; { tmp = dev_get_drvdata((struct device const *)(& func->dev)); sdio = (struct b43_sdio *)tmp; dev = (struct b43_wldev *)sdio->irq_handler_opaque; tmp___0 = atomic_read((atomic_t const *)(& dev->__init_status)); tmp___1 = ldv__builtin_expect(tmp___0 <= 1, 0L); if (tmp___1 != 0L) { return; } else { } ldv_sdio_release_host_108(func); (*(sdio->irq_handler))(dev); ldv_sdio_claim_host_109(func); return; } } int b43_sdio_request_irq(struct b43_wldev *dev , void (*handler)(struct b43_wldev * ) ) { struct ssb_bus *bus ; struct sdio_func *func ; struct b43_sdio *sdio ; void *tmp ; int err ; { bus = (dev->dev)->bus; func = bus->__annonCompField34.host_sdio; tmp = dev_get_drvdata((struct device const *)(& func->dev)); sdio = (struct b43_sdio *)tmp; sdio->irq_handler_opaque = (void *)dev; sdio->irq_handler = handler; ldv_sdio_claim_host_110(func); err = ldv_sdio_claim_irq_111(func, & b43_sdio_interrupt_dispatcher); ldv_sdio_release_host_112(func); return (err); } } void b43_sdio_free_irq(struct b43_wldev *dev ) { struct ssb_bus *bus ; struct sdio_func *func ; struct b43_sdio *sdio ; void *tmp ; { bus = (dev->dev)->bus; func = bus->__annonCompField34.host_sdio; tmp = dev_get_drvdata((struct device const *)(& func->dev)); sdio = (struct b43_sdio *)tmp; ldv_sdio_claim_host_113(func); ldv_sdio_release_irq_114(func); ldv_sdio_release_host_115(func); sdio->irq_handler_opaque = (void *)0; sdio->irq_handler = (void (*)(struct b43_wldev * ))0; return; } } static int b43_sdio_probe(struct sdio_func *func , struct sdio_device_id const *id ) { struct b43_sdio *sdio ; struct sdio_func_tuple *tuple ; u16 vendor ; u16 device ; int error ; void *tmp ; unsigned int tmp___0 ; { vendor = 0U; device = 0U; tuple = func->tuples; goto ldv_37367; ldv_37366: ; switch ((int )tuple->code) { case 128: ; switch ((int )tuple->data[0]) { case 1: ; if ((unsigned int )tuple->size != 5U) { goto ldv_37362; } else { } vendor = (u16 )((int )((short )tuple->data[1]) | (int )((short )((int )tuple->data[2] << 8))); device = (u16 )((int )((short )tuple->data[3]) | (int )((short )((int )tuple->data[4] << 8))); _dev_info((struct device const *)(& func->dev), "Chip ID %04x:%04x\n", (int )vendor, (int )device); goto ldv_37362; default: ; goto ldv_37362; } ldv_37362: ; goto ldv_37364; default: ; goto ldv_37364; } ldv_37364: tuple = tuple->next; ldv_37367: ; if ((unsigned long )tuple != (unsigned long )((struct sdio_func_tuple *)0)) { goto ldv_37366; } else { } if ((unsigned int )vendor == 0U || (unsigned int )device == 0U) { error = -19; goto out; } else { } ldv_sdio_claim_host_116(func); error = sdio_set_block_size(func, 64U); if (error != 0) { dev_err((struct device const *)(& func->dev), "failed to set block size to %u bytes, error %d\n", 64, error); goto err_release_host; } else { } error = ldv_sdio_enable_func_117(func); if (error != 0) { dev_err((struct device const *)(& func->dev), "failed to enable func, error %d\n", error); goto err_release_host; } else { } ldv_sdio_release_host_118(func); tmp = kzalloc(1528UL, 208U); sdio = (struct b43_sdio *)tmp; if ((unsigned long )sdio == (unsigned long )((struct b43_sdio *)0)) { error = -12; dev_err((struct device const *)(& func->dev), "failed to allocate ssb bus\n"); goto err_disable_func; } else { } tmp___0 = b43_sdio_get_quirks((int )vendor, (int )device); error = ssb_bus_sdiobus_register(& sdio->ssb, func, tmp___0); if (error != 0) { dev_err((struct device const *)(& func->dev), "failed to register ssb sdio bus, error %d\n", error); goto err_free_ssb; } else { } dev_set_drvdata(& func->dev, (void *)sdio); return (0); err_free_ssb: kfree((void const *)sdio); err_disable_func: ldv_sdio_disable_func_119(func); err_release_host: ldv_sdio_release_host_120(func); out: ; return (error); } } static void b43_sdio_remove(struct sdio_func *func ) { struct b43_sdio *sdio ; void *tmp ; { tmp = dev_get_drvdata((struct device const *)(& func->dev)); sdio = (struct b43_sdio *)tmp; ssb_bus_unregister(& sdio->ssb); ldv_sdio_claim_host_121(func); ldv_sdio_disable_func_122(func); ldv_sdio_release_host_123(func); kfree((void const *)sdio); dev_set_drvdata(& func->dev, (void *)0); return; } } static struct sdio_device_id const b43_sdio_ids[3U] = { {255U, 720U, 1099U, 0UL}, {255U, 146U, 4U, 0UL}}; static struct sdio_driver b43_sdio_driver = {(char *)"b43-sdio", (struct sdio_device_id const *)(& b43_sdio_ids), & b43_sdio_probe, & b43_sdio_remove, {0, 0, 0, 0, (_Bool)0, 0, 0, 0, 0, 0, 0, 0, 0}}; int b43_sdio_init(void) { int tmp ; { tmp = sdio_register_driver(& b43_sdio_driver); return (tmp); } } void b43_sdio_exit(void) { { sdio_unregister_driver(& b43_sdio_driver); return; } } int ldv_retval_1 ; void ldv_initialize_sdio_driver_21(void) { void *tmp ; { tmp = ldv_init_zalloc(1096UL); b43_sdio_driver_group0 = (struct sdio_func *)tmp; return; } } void ldv_main_exported_21(void) { struct sdio_device_id *ldvarg7 ; void *tmp ; int tmp___0 ; { tmp = ldv_init_zalloc(16UL); ldvarg7 = (struct sdio_device_id *)tmp; tmp___0 = __VERIFIER_nondet_int(); switch (tmp___0) { case 0: ; if (ldv_state_variable_21 == 1) { ldv_retval_1 = b43_sdio_probe(b43_sdio_driver_group0, (struct sdio_device_id const *)ldvarg7); if (ldv_retval_1 == 0) { ldv_state_variable_21 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_37394; case 1: ; if (ldv_state_variable_21 == 2) { b43_sdio_remove(b43_sdio_driver_group0); ldv_state_variable_21 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_37394; default: ldv_stop(); } ldv_37394: ; return; } } int ldv_del_timer_sync_105(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type ldv_func_res ; int tmp ; { tmp = del_timer_sync(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_9(ldv_func_arg1); return (ldv_func_res); } } int ldv_del_timer_106(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___0 ldv_func_res ; int tmp ; { tmp = del_timer(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_9(ldv_func_arg1); return (ldv_func_res); } } int ldv_request_threaded_irq_107(unsigned int ldv_func_arg1 , irqreturn_t (*handler)(int , void * ) , irqreturn_t (*thread_fn)(int , void * ) , unsigned long ldv_func_arg4 , char const *ldv_func_arg5 , void *ldv_func_arg6 ) { ldv_func_ret_type___1 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = request_threaded_irq(ldv_func_arg1, handler, thread_fn, ldv_func_arg4, ldv_func_arg5, ldv_func_arg6); ldv_func_res = tmp; tmp___0 = reg_check_2(handler, thread_fn); if (tmp___0 != 0 && ldv_func_res >= 0) { activate_suitable_irq_2((int )ldv_func_arg1, ldv_func_arg6); } else { } return (ldv_func_res); } } void ldv_sdio_release_host_108(struct sdio_func *func ) { { ldv_sdio_release_host(func); return; } } void ldv_sdio_claim_host_109(struct sdio_func *func ) { { ldv_sdio_claim_host(func); return; } } void ldv_sdio_claim_host_110(struct sdio_func *func ) { { ldv_sdio_claim_host(func); return; } } int ldv_sdio_claim_irq_111(struct sdio_func *func , void (*ldv_func_arg2)(struct sdio_func * ) ) { int tmp ; { ldv_check_context(func); tmp = sdio_claim_irq(func, ldv_func_arg2); return (tmp); } } void ldv_sdio_release_host_112(struct sdio_func *func ) { { ldv_sdio_release_host(func); return; } } void ldv_sdio_claim_host_113(struct sdio_func *func ) { { ldv_sdio_claim_host(func); return; } } int ldv_sdio_release_irq_114(struct sdio_func *func ) { int tmp ; { ldv_check_context(func); tmp = sdio_release_irq(func); return (tmp); } } void ldv_sdio_release_host_115(struct sdio_func *func ) { { ldv_sdio_release_host(func); return; } } void ldv_sdio_claim_host_116(struct sdio_func *func ) { { ldv_sdio_claim_host(func); return; } } int ldv_sdio_enable_func_117(struct sdio_func *func ) { int tmp ; { ldv_check_context(func); tmp = sdio_enable_func(func); return (tmp); } } void ldv_sdio_release_host_118(struct sdio_func *func ) { { ldv_sdio_release_host(func); return; } } int ldv_sdio_disable_func_119(struct sdio_func *func ) { int tmp ; { ldv_check_context(func); tmp = sdio_disable_func(func); return (tmp); } } void ldv_sdio_release_host_120(struct sdio_func *func ) { { ldv_sdio_release_host(func); return; } } void ldv_sdio_claim_host_121(struct sdio_func *func ) { { ldv_sdio_claim_host(func); return; } } int ldv_sdio_disable_func_122(struct sdio_func *func ) { int tmp ; { ldv_check_context(func); tmp = sdio_disable_func(func); return (tmp); } } void ldv_sdio_release_host_123(struct sdio_func *func ) { { ldv_sdio_release_host(func); return; } } __inline static long ldv__builtin_expect(long exp , long c ) ; extern void warn_slowpath_fmt(char const * , int const , char const * , ...) ; extern void might_fault(void) ; extern int sscanf(char const * , char const * , ...) ; __inline static int get_order(unsigned long size ) { int order ; { size = (size - 1UL) >> 11; order = -1; ldv_4361: size = size >> 1; order = order + 1; if (size != 0UL) { goto ldv_4361; } else { } return (order); } } __inline static long IS_ERR(void const *ptr ) { long tmp ; { tmp = ldv__builtin_expect((unsigned long )ptr > 0xfffffffffffff000UL, 0L); return (tmp); } } int ldv_del_timer_133(struct timer_list *ldv_func_arg1 ) ; int ldv_del_timer_sync_132(struct timer_list *ldv_func_arg1 ) ; extern unsigned long __get_free_pages(gfp_t , unsigned int ) ; extern unsigned long get_zeroed_page(gfp_t ) ; extern void free_pages(unsigned long , unsigned int ) ; extern ssize_t simple_read_from_buffer(void * , size_t , loff_t * , void const * , size_t ) ; extern struct dentry *debugfs_create_file(char const * , mode_t , struct dentry * , void * , struct file_operations const * ) ; extern struct dentry *debugfs_create_dir(char const * , struct dentry * ) ; extern void debugfs_remove(struct dentry * ) ; extern struct dentry *debugfs_create_bool(char const * , mode_t , struct dentry * , u32 * ) ; extern unsigned long _copy_from_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 ; { tmp = __builtin_object_size((void const *)to, 0); sz = (int )tmp; might_fault(); tmp___1 = ldv__builtin_expect((long )(sz == -1 || (unsigned long )sz >= n), 1L); if (tmp___1 != 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("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/inst/current/envs/linux-stable-1575714-1/linux-stable-1575714-1/arch/x86/include/asm/uaccess_64.h", 58, "Buffer overflow detected!\n"); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); } return (n); } } int ldv_request_threaded_irq_134(unsigned int ldv_func_arg1 , irqreturn_t (*handler)(int , void * ) , irqreturn_t (*thread_fn)(int , void * ) , unsigned long ldv_func_arg4 , char const *ldv_func_arg5 , void *ldv_func_arg6 ) ; static struct dentry *rootdir ; __inline static struct b43_dfs_file *fops_to_dfs_file(struct b43_wldev *dev , struct b43_debugfs_fops const *dfops ) { void *p ; { p = (void *)dev->dfsentry; p = p + dfops->file_struct_offset; return ((struct b43_dfs_file *)p); } } static ssize_t shm16read__read_file(struct b43_wldev *dev , char *buf , size_t bufsize ) { ssize_t count ; unsigned int routing ; unsigned int addr ; u16 val ; int tmp ; { count = 0L; routing = (dev->dfsentry)->shm16read_routing_next; addr = (dev->dfsentry)->shm16read_addr_next; if (routing > 4U || addr > 65535U) { return (-89L); } else { } val = b43_shm_read16(dev, (int )((u16 )routing), (int )((u16 )addr)); if ((unsigned long )count != bufsize) { tmp = snprintf(buf + (unsigned long )count, bufsize - (unsigned long )count, "0x%04X\n", (int )val); count = (ssize_t )tmp + count; } else { printk("<3>b43: fappend overflow\n"); } return (count); } } static int shm16read__write_file(struct b43_wldev *dev , char const *buf , size_t count ) { unsigned int routing ; unsigned int addr ; int res ; { res = sscanf(buf, "0x%X 0x%X", & routing, & addr); if (res != 2) { return (-22); } else { } if (routing > 4U) { return (-99); } else { } if (addr > 65535U) { return (-99); } else { } if (routing == 1U) { if ((int )addr & 1) { return (-99); } else { } } else { } (dev->dfsentry)->shm16read_routing_next = routing; (dev->dfsentry)->shm16read_addr_next = addr; return (0); } } static int shm16write__write_file(struct b43_wldev *dev , char const *buf , size_t count ) { unsigned int routing ; unsigned int addr ; unsigned int mask ; unsigned int set ; u16 val ; int res ; { res = sscanf(buf, "0x%X 0x%X 0x%X 0x%X", & routing, & addr, & mask, & set); if (res != 4) { return (-22); } else { } if (routing > 4U) { return (-99); } else { } if (addr > 65535U) { return (-99); } else { } if (routing == 1U) { if ((int )addr & 1) { return (-99); } else { } } else { } if (mask > 65535U || set > 65535U) { return (-7); } else { } if (mask == 0U) { val = 0U; } else { val = b43_shm_read16(dev, (int )((u16 )routing), (int )((u16 )addr)); } val = (int )((u16 )mask) & (int )val; val = (int )((u16 )set) | (int )val; b43_shm_write16(dev, (int )((u16 )routing), (int )((u16 )addr), (int )val); return (0); } } static ssize_t shm32read__read_file(struct b43_wldev *dev , char *buf , size_t bufsize ) { ssize_t count ; unsigned int routing ; unsigned int addr ; u32 val ; int tmp ; { count = 0L; routing = (dev->dfsentry)->shm32read_routing_next; addr = (dev->dfsentry)->shm32read_addr_next; if (routing > 4U || addr > 65535U) { return (-89L); } else { } val = b43_shm_read32(dev, (int )((u16 )routing), (int )((u16 )addr)); if ((unsigned long )count != bufsize) { tmp = snprintf(buf + (unsigned long )count, bufsize - (unsigned long )count, "0x%08X\n", val); count = (ssize_t )tmp + count; } else { printk("<3>b43: fappend overflow\n"); } return (count); } } static int shm32read__write_file(struct b43_wldev *dev , char const *buf , size_t count ) { unsigned int routing ; unsigned int addr ; int res ; { res = sscanf(buf, "0x%X 0x%X", & routing, & addr); if (res != 2) { return (-22); } else { } if (routing > 4U) { return (-99); } else { } if (addr > 65535U) { return (-99); } else { } if (routing == 1U) { if ((int )addr & 1) { return (-99); } else { } } else { } (dev->dfsentry)->shm32read_routing_next = routing; (dev->dfsentry)->shm32read_addr_next = addr; return (0); } } static int shm32write__write_file(struct b43_wldev *dev , char const *buf , size_t count ) { unsigned int routing ; unsigned int addr ; unsigned int mask ; unsigned int set ; u32 val ; int res ; { res = sscanf(buf, "0x%X 0x%X 0x%X 0x%X", & routing, & addr, & mask, & set); if (res != 4) { return (-22); } else { } if (routing > 4U) { return (-99); } else { } if (addr > 65535U) { return (-99); } else { } if (routing == 1U) { if ((int )addr & 1) { return (-99); } else { } } else { } if (mask == 0U) { val = 0U; } else { val = b43_shm_read32(dev, (int )((u16 )routing), (int )((u16 )addr)); } val = val & mask; val = val | set; b43_shm_write32(dev, (int )((u16 )routing), (int )((u16 )addr), val); return (0); } } static ssize_t mmio16read__read_file(struct b43_wldev *dev , char *buf , size_t bufsize ) { ssize_t count ; unsigned int addr ; u16 val ; int tmp ; { count = 0L; addr = (unsigned int )(dev->dfsentry)->mmio16read_next; if (addr > 3839U) { return (-89L); } else { } val = b43_read16(dev, (int )((u16 )addr)); if ((unsigned long )count != bufsize) { tmp = snprintf(buf + (unsigned long )count, bufsize - (unsigned long )count, "0x%04X\n", (int )val); count = (ssize_t )tmp + count; } else { printk("<3>b43: fappend overflow\n"); } return (count); } } static int mmio16read__write_file(struct b43_wldev *dev , char const *buf , size_t count ) { unsigned int addr ; int res ; { res = sscanf(buf, "0x%X", & addr); if (res != 1) { return (-22); } else { } if (addr > 3839U) { return (-99); } else { } if ((int )addr & 1) { return (-22); } else { } (dev->dfsentry)->mmio16read_next = (u16 )addr; return (0); } } static int mmio16write__write_file(struct b43_wldev *dev , char const *buf , size_t count ) { unsigned int addr ; unsigned int mask ; unsigned int set ; int res ; u16 val ; { res = sscanf(buf, "0x%X 0x%X 0x%X", & addr, & mask, & set); if (res != 3) { return (-22); } else { } if (addr > 3839U) { return (-99); } else { } if (mask > 65535U || set > 65535U) { return (-7); } else { } if ((int )addr & 1) { return (-22); } else { } if (mask == 0U) { val = 0U; } else { val = b43_read16(dev, (int )((u16 )addr)); } val = (int )((u16 )mask) & (int )val; val = (int )((u16 )set) | (int )val; b43_write16(dev, (int )((u16 )addr), (int )val); return (0); } } static ssize_t mmio32read__read_file(struct b43_wldev *dev , char *buf , size_t bufsize ) { ssize_t count ; unsigned int addr ; u32 val ; int tmp ; { count = 0L; addr = (unsigned int )(dev->dfsentry)->mmio32read_next; if (addr > 3839U) { return (-89L); } else { } val = b43_read32(dev, (int )((u16 )addr)); if ((unsigned long )count != bufsize) { tmp = snprintf(buf + (unsigned long )count, bufsize - (unsigned long )count, "0x%08X\n", val); count = (ssize_t )tmp + count; } else { printk("<3>b43: fappend overflow\n"); } return (count); } } static int mmio32read__write_file(struct b43_wldev *dev , char const *buf , size_t count ) { unsigned int addr ; int res ; { res = sscanf(buf, "0x%X", & addr); if (res != 1) { return (-22); } else { } if (addr > 3839U) { return (-99); } else { } if ((addr & 3U) != 0U) { return (-22); } else { } (dev->dfsentry)->mmio32read_next = (u16 )addr; return (0); } } static int mmio32write__write_file(struct b43_wldev *dev , char const *buf , size_t count ) { unsigned int addr ; unsigned int mask ; unsigned int set ; int res ; u32 val ; { res = sscanf(buf, "0x%X 0x%X 0x%X", & addr, & mask, & set); if (res != 3) { return (-22); } else { } if (addr > 3839U) { return (-99); } else { } if ((addr & 3U) != 0U) { return (-22); } else { } if (mask == 0U) { val = 0U; } else { val = b43_read32(dev, (int )((u16 )addr)); } val = val & mask; val = val | set; b43_write32(dev, (int )((u16 )addr), val); return (0); } } static ssize_t txstat_read_file(struct b43_wldev *dev , char *buf , size_t bufsize ) { struct b43_txstatus_log *log ; ssize_t count ; int i ; int idx ; struct b43_txstatus *stat ; int tmp ; int tmp___0 ; int tmp___1 ; { log = & (dev->dfsentry)->txstatlog; count = 0L; if (log->end < 0) { if ((unsigned long )count != bufsize) { tmp = snprintf(buf + (unsigned long )count, bufsize - (unsigned long )count, "Nothing transmitted, yet\n"); count = (ssize_t )tmp + count; } else { printk("<3>b43: fappend overflow\n"); } goto out; } else { } if ((unsigned long )count != bufsize) { tmp___0 = snprintf(buf + (unsigned long )count, bufsize - (unsigned long )count, "b43 TX status reports:\n\nindex | cookie | seq | phy_stat | frame_count | rts_count | supp_reason | pm_indicated | intermediate | for_ampdu | acked\n---\n"); count = (ssize_t )tmp___0 + count; } else { printk("<3>b43: fappend overflow\n"); } i = log->end + 1; idx = 0; ldv_37391: ; if (i == 100) { i = 0; } else { } stat = log->log + (unsigned long )i; if ((unsigned int )stat->cookie != 0U) { if ((unsigned long )count != bufsize) { tmp___1 = snprintf(buf + (unsigned long )count, bufsize - (unsigned long )count, "%03d | 0x%04X | 0x%04X | 0x%02X | 0x%X | 0x%X | %u | %u | %u | %u | %u\n", idx, (int )stat->cookie, (int )stat->seq, (int )stat->phy_stat, (int )stat->frame_count, (int )stat->rts_count, (int )stat->supp_reason, (int )stat->pm_indicated, (int )stat->intermediate, (int )stat->for_ampdu, (int )stat->acked); count = (ssize_t )tmp___1 + count; } else { printk("<3>b43: fappend overflow\n"); } idx = idx + 1; } else { } if (log->end == i) { goto ldv_37390; } else { } i = i + 1; goto ldv_37391; ldv_37390: ; out: ; return (count); } } static int restart_write_file(struct b43_wldev *dev , char const *buf , size_t count ) { int err ; { err = 0; if (count != 0UL && (int )((signed char )*buf) == 49) { b43_controller_restart(dev, "manually restarted"); } else { err = -22; } return (err); } } static unsigned long calc_expire_secs(unsigned long now , unsigned long time , unsigned long expire ) { int __ret_warn_on ; long tmp ; { expire = time + expire; if ((long )expire - (long )now < 0L) { return (0UL); } else { } if (expire < now) { expire = expire - 4611686018427387902UL; now = now - 4611686018427387902UL; } else { } __ret_warn_on = expire < now; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/debugfs.c", 433); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); return ((expire - now) / 250UL); } } static ssize_t loctls_read_file(struct b43_wldev *dev , char *buf , size_t bufsize ) { ssize_t count ; struct b43_txpower_lo_control *lo ; int i ; int err ; struct b43_lo_calib *cal ; unsigned long now ; struct b43_phy *phy ; int tmp ; int tmp___0 ; int tmp___1 ; unsigned long tmp___2 ; int tmp___3 ; unsigned long tmp___4 ; int tmp___5 ; int tmp___6 ; struct list_head const *__mptr ; bool active ; bool tmp___7 ; bool tmp___8 ; int tmp___9 ; unsigned long tmp___10 ; int tmp___11 ; struct list_head const *__mptr___0 ; int tmp___12 ; int tmp___13 ; int tmp___14 ; int tmp___15 ; int tmp___16 ; int tmp___17 ; { count = 0L; err = 0; now = jiffies; phy = & dev->phy; if ((unsigned int )phy->type != 2U) { if ((unsigned long )count != bufsize) { tmp = snprintf(buf + (unsigned long )count, bufsize - (unsigned long )count, "Device is not a G-PHY\n"); count = (ssize_t )tmp + count; } else { printk("<3>b43: fappend overflow\n"); } err = -19; goto out; } else { } lo = (phy->__annonCompField40.g)->lo_control; if ((unsigned long )count != bufsize) { tmp___0 = snprintf(buf + (unsigned long )count, bufsize - (unsigned long )count, "-- Local Oscillator calibration data --\n\n"); count = (ssize_t )tmp___0 + count; } else { printk("<3>b43: fappend overflow\n"); } if ((unsigned long )count != bufsize) { tmp___1 = snprintf(buf + (unsigned long )count, bufsize - (unsigned long )count, "HW-power-control enabled: %d\n", (int )dev->phy.hardware_power_control); count = (ssize_t )tmp___1 + count; } else { printk("<3>b43: fappend overflow\n"); } if ((unsigned long )count != bufsize) { tmp___2 = calc_expire_secs(now, lo->txctl_measured_time, 44000UL); tmp___3 = snprintf(buf + (unsigned long )count, bufsize - (unsigned long )count, "TX Bias: 0x%02X, TX Magn: 0x%02X (expire in %lu sec)\n", (int )lo->tx_bias, (int )lo->tx_magn, tmp___2); count = (ssize_t )tmp___3 + count; } else { printk("<3>b43: fappend overflow\n"); } if ((unsigned long )count != bufsize) { tmp___4 = calc_expire_secs(now, lo->pwr_vec_read_time, 7000UL); tmp___5 = snprintf(buf + (unsigned long )count, bufsize - (unsigned long )count, "Power Vector: 0x%08X%08X (expires in %lu sec)\n", (unsigned int )(lo->power_vector >> 32), (unsigned int )lo->power_vector, tmp___4); count = (ssize_t )tmp___5 + count; } else { printk("<3>b43: fappend overflow\n"); } if ((unsigned long )count != bufsize) { tmp___6 = snprintf(buf + (unsigned long )count, bufsize - (unsigned long )count, "\nCalibrated settings:\n"); count = (ssize_t )tmp___6 + count; } else { printk("<3>b43: fappend overflow\n"); } __mptr = (struct list_head const *)lo->calib_list.next; cal = (struct b43_lo_calib *)__mptr + 0xfffffffffffffff0UL; goto ldv_37430; ldv_37429: tmp___7 = b43_compare_bbatt((struct b43_bbatt const *)(& cal->bbatt), (struct b43_bbatt const *)(& (phy->__annonCompField40.g)->bbatt)); if ((int )tmp___7) { tmp___8 = b43_compare_rfatt((struct b43_rfatt const *)(& cal->rfatt), (struct b43_rfatt const *)(& (phy->__annonCompField40.g)->rfatt)); if ((int )tmp___8) { tmp___9 = 1; } else { tmp___9 = 0; } } else { tmp___9 = 0; } active = (bool )tmp___9; if ((unsigned long )count != bufsize) { tmp___10 = calc_expire_secs(now, cal->calib_time, 7000UL); tmp___11 = snprintf(buf + (unsigned long )count, bufsize - (unsigned long )count, "BB(%d), RF(%d,%d) -> I=%d, Q=%d (expires in %lu sec)%s\n", (int )cal->bbatt.att, (int )cal->rfatt.att, (int )cal->rfatt.with_padmix, (int )cal->ctl.i, (int )cal->ctl.q, tmp___10, (int )active ? (char *)" ACTIVE" : (char *)""); count = (ssize_t )tmp___11 + count; } else { printk("<3>b43: fappend overflow\n"); } __mptr___0 = (struct list_head const *)cal->list.next; cal = (struct b43_lo_calib *)__mptr___0 + 0xfffffffffffffff0UL; ldv_37430: __builtin_prefetch((void const *)cal->list.next); if ((unsigned long )(& cal->list) != (unsigned long )(& lo->calib_list)) { goto ldv_37429; } else { } if ((unsigned long )count != bufsize) { tmp___12 = snprintf(buf + (unsigned long )count, bufsize - (unsigned long )count, "\nUsed RF attenuation values: Value(WithPadmix flag)\n"); count = (ssize_t )tmp___12 + count; } else { printk("<3>b43: fappend overflow\n"); } i = 0; goto ldv_37433; ldv_37432: ; if ((unsigned long )count != bufsize) { tmp___13 = snprintf(buf + (unsigned long )count, bufsize - (unsigned long )count, "%u(%d), ", (int )(lo->rfatt_list.list + (unsigned long )i)->att, (int )(lo->rfatt_list.list + (unsigned long )i)->with_padmix); count = (ssize_t )tmp___13 + count; } else { printk("<3>b43: fappend overflow\n"); } i = i + 1; ldv_37433: ; if ((int )lo->rfatt_list.len > i) { goto ldv_37432; } else { } if ((unsigned long )count != bufsize) { tmp___14 = snprintf(buf + (unsigned long )count, bufsize - (unsigned long )count, "\n"); count = (ssize_t )tmp___14 + count; } else { printk("<3>b43: fappend overflow\n"); } if ((unsigned long )count != bufsize) { tmp___15 = snprintf(buf + (unsigned long )count, bufsize - (unsigned long )count, "\nUsed Baseband attenuation values:\n"); count = (ssize_t )tmp___15 + count; } else { printk("<3>b43: fappend overflow\n"); } i = 0; goto ldv_37436; ldv_37435: ; if ((unsigned long )count != bufsize) { tmp___16 = snprintf(buf + (unsigned long )count, bufsize - (unsigned long )count, "%u, ", (int )(lo->bbatt_list.list + (unsigned long )i)->att); count = (ssize_t )tmp___16 + count; } else { printk("<3>b43: fappend overflow\n"); } i = i + 1; ldv_37436: ; if ((int )lo->bbatt_list.len > i) { goto ldv_37435; } else { } if ((unsigned long )count != bufsize) { tmp___17 = snprintf(buf + (unsigned long )count, bufsize - (unsigned long )count, "\n"); count = (ssize_t )tmp___17 + count; } else { printk("<3>b43: fappend overflow\n"); } out: ; return (err != 0 ? (ssize_t )err : count); } } static int b43_debugfs_open(struct inode *inode , struct file *file ) { { file->private_data = inode->i_private; return (0); } } static ssize_t b43_debugfs_read(struct file *file , char *userbuf , size_t count , loff_t *ppos ) { struct b43_wldev *dev ; struct b43_debugfs_fops *dfops ; struct b43_dfs_file *dfile ; ssize_t ret ; char *buf ; size_t bufsize ; size_t buforder ; int tmp ; int err ; int tmp___0 ; struct file_operations const *__mptr ; unsigned long tmp___1 ; { ret = ret; bufsize = 16384UL; tmp = get_order(bufsize); buforder = (size_t const )tmp; err = 0; if (count == 0UL) { return (0L); } else { } dev = (struct b43_wldev *)file->private_data; if ((unsigned long )dev == (unsigned long )((struct b43_wldev *)0)) { return (-19L); } else { } mutex_lock_nested(& (dev->wl)->mutex, 0U); tmp___0 = atomic_read((atomic_t const *)(& dev->__init_status)); if (tmp___0 <= 0) { err = -19; goto out_unlock; } else { } __mptr = file->f_op; dfops = (struct b43_debugfs_fops *)__mptr + 0xfffffffffffffff0UL; if ((unsigned long )dfops->read == (unsigned long )((ssize_t (*)(struct b43_wldev * , char * , size_t ))0)) { err = -38; goto out_unlock; } else { } dfile = fops_to_dfs_file(dev, (struct b43_debugfs_fops const *)dfops); if ((unsigned long )dfile->buffer == (unsigned long )((char *)0)) { tmp___1 = __get_free_pages(208U, (unsigned int )buforder); buf = (char *)tmp___1; if ((unsigned long )buf == (unsigned long )((char *)0)) { err = -12; goto out_unlock; } else { } memset((void *)buf, 0, bufsize); ret = (*(dfops->read))(dev, buf, bufsize); if (ret <= 0L) { free_pages((unsigned long )buf, (unsigned int )buforder); err = (int )ret; goto out_unlock; } else { } dfile->data_len = (size_t )ret; dfile->buffer = buf; } else { } ret = simple_read_from_buffer((void *)userbuf, count, ppos, (void const *)dfile->buffer, dfile->data_len); if ((unsigned long long )*ppos >= (unsigned long long )dfile->data_len) { free_pages((unsigned long )dfile->buffer, (unsigned int )buforder); dfile->buffer = (char *)0; dfile->data_len = 0UL; } else { } out_unlock: mutex_unlock(& (dev->wl)->mutex); return (err != 0 ? (ssize_t )err : ret); } } static ssize_t b43_debugfs_write(struct file *file , char const *userbuf , size_t count , loff_t *ppos ) { struct b43_wldev *dev ; struct b43_debugfs_fops *dfops ; char *buf ; int err ; int tmp ; struct file_operations const *__mptr ; unsigned long tmp___0 ; unsigned long tmp___1 ; { err = 0; if (count == 0UL) { return (0L); } else { } if (count > 4096UL) { return (-7L); } else { } dev = (struct b43_wldev *)file->private_data; if ((unsigned long )dev == (unsigned long )((struct b43_wldev *)0)) { return (-19L); } else { } mutex_lock_nested(& (dev->wl)->mutex, 0U); tmp = atomic_read((atomic_t const *)(& dev->__init_status)); if (tmp <= 0) { err = -19; goto out_unlock; } else { } __mptr = file->f_op; dfops = (struct b43_debugfs_fops *)__mptr + 0xfffffffffffffff0UL; if ((unsigned long )dfops->write == (unsigned long )((int (*)(struct b43_wldev * , char const * , size_t ))0)) { err = -38; goto out_unlock; } else { } tmp___0 = get_zeroed_page(208U); buf = (char *)tmp___0; if ((unsigned long )buf == (unsigned long )((char *)0)) { err = -12; goto out_unlock; } else { } tmp___1 = copy_from_user((void *)buf, (void const *)userbuf, count); if (tmp___1 != 0UL) { err = -14; goto out_freepage; } else { } err = (*(dfops->write))(dev, (char const *)buf, count); if (err != 0) { } else { } out_freepage: free_pages((unsigned long )buf, 0U); out_unlock: mutex_unlock(& (dev->wl)->mutex); return ((ssize_t )(err != 0 ? (size_t )err : count)); } } static struct b43_debugfs_fops fops_shm16read = {& shm16read__read_file, & shm16read__write_file, {0, 0, & b43_debugfs_read, & b43_debugfs_write, 0, 0, 0, 0, 0, 0, 0, & b43_debugfs_open, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 16UL}; static struct b43_debugfs_fops fops_shm16write = {(ssize_t (*)(struct b43_wldev * , char * , size_t ))0, & shm16write__write_file, {0, 0, & b43_debugfs_read, & b43_debugfs_write, 0, 0, 0, 0, 0, 0, 0, & b43_debugfs_open, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 40UL}; static struct b43_debugfs_fops fops_shm32read = {& shm32read__read_file, & shm32read__write_file, {0, 0, & b43_debugfs_read, & b43_debugfs_write, 0, 0, 0, 0, 0, 0, 0, & b43_debugfs_open, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 64UL}; static struct b43_debugfs_fops fops_shm32write = {(ssize_t (*)(struct b43_wldev * , char * , size_t ))0, & shm32write__write_file, {0, 0, & b43_debugfs_read, & b43_debugfs_write, 0, 0, 0, 0, 0, 0, 0, & b43_debugfs_open, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 88UL}; static struct b43_debugfs_fops fops_mmio16read = {& mmio16read__read_file, & mmio16read__write_file, {0, 0, & b43_debugfs_read, & b43_debugfs_write, 0, 0, 0, 0, 0, 0, 0, & b43_debugfs_open, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 112UL}; static struct b43_debugfs_fops fops_mmio16write = {(ssize_t (*)(struct b43_wldev * , char * , size_t ))0, & mmio16write__write_file, {0, 0, & b43_debugfs_read, & b43_debugfs_write, 0, 0, 0, 0, 0, 0, 0, & b43_debugfs_open, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 136UL}; static struct b43_debugfs_fops fops_mmio32read = {& mmio32read__read_file, & mmio32read__write_file, {0, 0, & b43_debugfs_read, & b43_debugfs_write, 0, 0, 0, 0, 0, 0, 0, & b43_debugfs_open, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 160UL}; static struct b43_debugfs_fops fops_mmio32write = {(ssize_t (*)(struct b43_wldev * , char * , size_t ))0, & mmio32write__write_file, {0, 0, & b43_debugfs_read, & b43_debugfs_write, 0, 0, 0, 0, 0, 0, 0, & b43_debugfs_open, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 184UL}; static struct b43_debugfs_fops fops_txstat = {& txstat_read_file, (int (*)(struct b43_wldev * , char const * , size_t ))0, {0, 0, & b43_debugfs_read, & b43_debugfs_write, 0, 0, 0, 0, 0, 0, 0, & b43_debugfs_open, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 208UL}; static struct b43_debugfs_fops fops_restart = {(ssize_t (*)(struct b43_wldev * , char * , size_t ))0, & restart_write_file, {0, 0, & b43_debugfs_read, & b43_debugfs_write, 0, 0, 0, 0, 0, 0, 0, & b43_debugfs_open, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 256UL}; static struct b43_debugfs_fops fops_loctls = {& loctls_read_file, (int (*)(struct b43_wldev * , char const * , size_t ))0, {0, 0, & b43_debugfs_read, & b43_debugfs_write, 0, 0, 0, 0, 0, 0, 0, & b43_debugfs_open, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 280UL}; bool b43_debug(struct b43_wldev *dev , enum b43_dyndbg feature ) { bool enabled ; long tmp ; { enabled = (bool )((unsigned long )dev->dfsentry != (unsigned long )((struct b43_dfsentry *)0) && (dev->dfsentry)->dyn_debug[(unsigned int )feature] != 0U); tmp = ldv__builtin_expect((long )enabled, 0L); if (tmp != 0L) { b43_modparam_verbose = 3; } else { } return (enabled); } } static void b43_remove_dynamic_debug(struct b43_wldev *dev ) { struct b43_dfsentry *e ; int i ; { e = dev->dfsentry; i = 0; goto ldv_37495; ldv_37494: debugfs_remove(e->dyn_debug_dentries[i]); i = i + 1; ldv_37495: ; if (i <= 8) { goto ldv_37494; } else { } return; } } static void b43_add_dynamic_debug(struct b43_wldev *dev ) { struct b43_dfsentry *e ; struct dentry *d ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; long tmp___4 ; long tmp___5 ; long tmp___6 ; long tmp___7 ; { e = dev->dfsentry; e->dyn_debug[0] = 0U; d = debugfs_create_bool("debug_xmitpower", 384U, e->subdir, (u32 *)(& e->dyn_debug)); tmp = IS_ERR((void const *)d); if (tmp == 0L) { e->dyn_debug_dentries[0] = d; } else { } e->dyn_debug[1] = 0U; d = debugfs_create_bool("debug_dmaoverflow", 384U, e->subdir, (u32 *)(& e->dyn_debug) + 1UL); tmp___0 = IS_ERR((void const *)d); if (tmp___0 == 0L) { e->dyn_debug_dentries[1] = d; } else { } e->dyn_debug[2] = 0U; d = debugfs_create_bool("debug_dmaverbose", 384U, e->subdir, (u32 *)(& e->dyn_debug) + 2UL); tmp___1 = IS_ERR((void const *)d); if (tmp___1 == 0L) { e->dyn_debug_dentries[2] = d; } else { } e->dyn_debug[3] = 0U; d = debugfs_create_bool("debug_pwork_fast", 384U, e->subdir, (u32 *)(& e->dyn_debug) + 3UL); tmp___2 = IS_ERR((void const *)d); if (tmp___2 == 0L) { e->dyn_debug_dentries[3] = d; } else { } e->dyn_debug[4] = 0U; d = debugfs_create_bool("debug_pwork_stop", 384U, e->subdir, (u32 *)(& e->dyn_debug) + 4UL); tmp___3 = IS_ERR((void const *)d); if (tmp___3 == 0L) { e->dyn_debug_dentries[4] = d; } else { } e->dyn_debug[5] = 0U; d = debugfs_create_bool("debug_lo", 384U, e->subdir, (u32 *)(& e->dyn_debug) + 5UL); tmp___4 = IS_ERR((void const *)d); if (tmp___4 == 0L) { e->dyn_debug_dentries[5] = d; } else { } e->dyn_debug[6] = 0U; d = debugfs_create_bool("debug_firmware", 384U, e->subdir, (u32 *)(& e->dyn_debug) + 6UL); tmp___5 = IS_ERR((void const *)d); if (tmp___5 == 0L) { e->dyn_debug_dentries[6] = d; } else { } e->dyn_debug[7] = 0U; d = debugfs_create_bool("debug_keys", 384U, e->subdir, (u32 *)(& e->dyn_debug) + 7UL); tmp___6 = IS_ERR((void const *)d); if (tmp___6 == 0L) { e->dyn_debug_dentries[7] = d; } else { } e->dyn_debug[8] = 0U; d = debugfs_create_bool("debug_verbose_stats", 384U, e->subdir, (u32 *)(& e->dyn_debug) + 8UL); tmp___7 = IS_ERR((void const *)d); if (tmp___7 == 0L) { e->dyn_debug_dentries[8] = d; } else { } return; } } void b43_debugfs_add_device(struct b43_wldev *dev ) { struct b43_dfsentry *e ; struct b43_txstatus_log *log ; char devdir[16U] ; int __ret_warn_on ; long tmp ; void *tmp___0 ; void *tmp___1 ; char const *tmp___2 ; void *tmp___3 ; long tmp___4 ; struct dentry *d ; long tmp___5 ; struct dentry *d___0 ; long tmp___6 ; struct dentry *d___1 ; long tmp___7 ; struct dentry *d___2 ; long tmp___8 ; struct dentry *d___3 ; long tmp___9 ; struct dentry *d___4 ; long tmp___10 ; struct dentry *d___5 ; long tmp___11 ; struct dentry *d___6 ; long tmp___12 ; struct dentry *d___7 ; long tmp___13 ; struct dentry *d___8 ; long tmp___14 ; struct dentry *d___9 ; long tmp___15 ; { __ret_warn_on = (unsigned long )dev == (unsigned long )((struct b43_wldev *)0); tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/home/ldvuser/andrianov/commit-tester-work/task-056--linux-stable--dir/work/current--X--drivers/net/wireless/b43/b43.ko--X--defaultlinux-stable-1575714-1--X--150_1a--X--cpachecker/linux-stable-1575714-1/csd_deg_dscv/28/dscv_tempdir/dscv/ri/150_1a/drivers/net/wireless/b43/debugfs.c", 703); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); tmp___0 = kzalloc(448UL, 208U); e = (struct b43_dfsentry *)tmp___0; if ((unsigned long )e == (unsigned long )((struct b43_dfsentry *)0)) { b43err(dev->wl, "debugfs: add device OOM\n"); return; } else { } e->dev = dev; log = & e->txstatlog; tmp___1 = kcalloc(100UL, 12UL, 208U); log->log = (struct b43_txstatus *)tmp___1; if ((unsigned long )log->log == (unsigned long )((struct b43_txstatus *)0)) { b43err(dev->wl, "debugfs: add device txstatus OOM\n"); kfree((void const *)e); return; } else { } log->end = -1; dev->dfsentry = e; tmp___2 = wiphy_name((struct wiphy const *)((dev->wl)->hw)->wiphy); snprintf((char *)(& devdir), 16UL, "%s", tmp___2); e->subdir = debugfs_create_dir((char const *)(& devdir), rootdir); if ((unsigned long )e->subdir == (unsigned long )((struct dentry *)0)) { goto _L; } else { tmp___4 = IS_ERR((void const *)e->subdir); if (tmp___4 != 0L) { _L: /* CIL Label */ tmp___3 = ERR_PTR(-19L); if ((unsigned long )((void *)e->subdir) == (unsigned long )tmp___3) { b43dbg(dev->wl, "DebugFS (CONFIG_DEBUG_FS) not enabled in kernel config\n"); } else { b43err(dev->wl, "debugfs: cannot create %s directory\n", (char *)(& devdir)); } dev->dfsentry = (struct b43_dfsentry *)0; kfree((void const *)log->log); kfree((void const *)e); return; } else { } } e->mmio16read_next = 65535U; e->mmio32read_next = 65535U; e->shm16read_routing_next = 4294967295U; e->shm16read_addr_next = 4294967295U; e->shm32read_routing_next = 4294967295U; e->shm32read_addr_next = 4294967295U; d = debugfs_create_file("shm16read", 384U, e->subdir, (void *)dev, (struct file_operations const *)(& fops_shm16read.fops)); e->file_shm16read.dentry = (struct dentry *)0; tmp___5 = IS_ERR((void const *)d); if (tmp___5 == 0L) { e->file_shm16read.dentry = d; } else { } d___0 = debugfs_create_file("shm16write", 128U, e->subdir, (void *)dev, (struct file_operations const *)(& fops_shm16write.fops)); e->file_shm16write.dentry = (struct dentry *)0; tmp___6 = IS_ERR((void const *)d___0); if (tmp___6 == 0L) { e->file_shm16write.dentry = d___0; } else { } d___1 = debugfs_create_file("shm32read", 384U, e->subdir, (void *)dev, (struct file_operations const *)(& fops_shm32read.fops)); e->file_shm32read.dentry = (struct dentry *)0; tmp___7 = IS_ERR((void const *)d___1); if (tmp___7 == 0L) { e->file_shm32read.dentry = d___1; } else { } d___2 = debugfs_create_file("shm32write", 128U, e->subdir, (void *)dev, (struct file_operations const *)(& fops_shm32write.fops)); e->file_shm32write.dentry = (struct dentry *)0; tmp___8 = IS_ERR((void const *)d___2); if (tmp___8 == 0L) { e->file_shm32write.dentry = d___2; } else { } d___3 = debugfs_create_file("mmio16read", 384U, e->subdir, (void *)dev, (struct file_operations const *)(& fops_mmio16read.fops)); e->file_mmio16read.dentry = (struct dentry *)0; tmp___9 = IS_ERR((void const *)d___3); if (tmp___9 == 0L) { e->file_mmio16read.dentry = d___3; } else { } d___4 = debugfs_create_file("mmio16write", 128U, e->subdir, (void *)dev, (struct file_operations const *)(& fops_mmio16write.fops)); e->file_mmio16write.dentry = (struct dentry *)0; tmp___10 = IS_ERR((void const *)d___4); if (tmp___10 == 0L) { e->file_mmio16write.dentry = d___4; } else { } d___5 = debugfs_create_file("mmio32read", 384U, e->subdir, (void *)dev, (struct file_operations const *)(& fops_mmio32read.fops)); e->file_mmio32read.dentry = (struct dentry *)0; tmp___11 = IS_ERR((void const *)d___5); if (tmp___11 == 0L) { e->file_mmio32read.dentry = d___5; } else { } d___6 = debugfs_create_file("mmio32write", 128U, e->subdir, (void *)dev, (struct file_operations const *)(& fops_mmio32write.fops)); e->file_mmio32write.dentry = (struct dentry *)0; tmp___12 = IS_ERR((void const *)d___6); if (tmp___12 == 0L) { e->file_mmio32write.dentry = d___6; } else { } d___7 = debugfs_create_file("txstat", 256U, e->subdir, (void *)dev, (struct file_operations const *)(& fops_txstat.fops)); e->file_txstat.dentry = (struct dentry *)0; tmp___13 = IS_ERR((void const *)d___7); if (tmp___13 == 0L) { e->file_txstat.dentry = d___7; } else { } d___8 = debugfs_create_file("restart", 128U, e->subdir, (void *)dev, (struct file_operations const *)(& fops_restart.fops)); e->file_restart.dentry = (struct dentry *)0; tmp___14 = IS_ERR((void const *)d___8); if (tmp___14 == 0L) { e->file_restart.dentry = d___8; } else { } d___9 = debugfs_create_file("loctls", 256U, e->subdir, (void *)dev, (struct file_operations const *)(& fops_loctls.fops)); e->file_loctls.dentry = (struct dentry *)0; tmp___15 = IS_ERR((void const *)d___9); if (tmp___15 == 0L) { e->file_loctls.dentry = d___9; } else { } b43_add_dynamic_debug(dev); return; } } void b43_debugfs_remove_device(struct b43_wldev *dev ) { struct b43_dfsentry *e ; { if ((unsigned long )dev == (unsigned long )((struct b43_wldev *)0)) { return; } else { } e = dev->dfsentry; if ((unsigned long )e == (unsigned long )((struct b43_dfsentry *)0)) { return; } else { } b43_remove_dynamic_debug(dev); debugfs_remove(e->file_shm16read.dentry); debugfs_remove(e->file_shm16write.dentry); debugfs_remove(e->file_shm32read.dentry); debugfs_remove(e->file_shm32write.dentry); debugfs_remove(e->file_mmio16read.dentry); debugfs_remove(e->file_mmio16write.dentry); debugfs_remove(e->file_mmio32read.dentry); debugfs_remove(e->file_mmio32write.dentry); debugfs_remove(e->file_txstat.dentry); debugfs_remove(e->file_restart.dentry); debugfs_remove(e->file_loctls.dentry); debugfs_remove(e->subdir); kfree((void const *)e->txstatlog.log); kfree((void const *)e); return; } } void b43_debugfs_log_txstat(struct b43_wldev *dev , struct b43_txstatus const *status ) { struct b43_dfsentry *e ; struct b43_txstatus_log *log ; struct b43_txstatus *cur ; int i ; size_t __len ; void *__ret ; { e = dev->dfsentry; if ((unsigned long )e == (unsigned long )((struct b43_dfsentry *)0)) { return; } else { } log = & e->txstatlog; i = log->end + 1; if (i == 100) { i = 0; } else { } log->end = i; cur = log->log + (unsigned long )i; __len = 12UL; if (__len > 63UL) { __ret = memcpy((void *)cur, (void const *)status, __len); } else { __ret = __builtin_memcpy((void *)cur, (void const *)status, __len); } return; } } void b43_debugfs_init(void) { long tmp ; { rootdir = debugfs_create_dir("b43", (struct dentry *)0); tmp = IS_ERR((void const *)rootdir); if (tmp != 0L) { rootdir = (struct dentry *)0; } else { } return; } } void b43_debugfs_exit(void) { { debugfs_remove(rootdir); return; } } extern int ldv_release_14(void) ; extern int ldv_release_20(void) ; extern int ldv_release_11(void) ; int ldv_retval_14 ; int ldv_retval_17 ; int ldv_retval_2 ; int ldv_retval_12 ; int ldv_retval_0 ; extern int ldv_release_16(void) ; extern int ldv_release_12(void) ; int ldv_retval_6 ; extern int ldv_release_18(void) ; extern int ldv_release_10(void) ; extern int ldv_release_13(void) ; int ldv_retval_15 ; extern int ldv_release_19(void) ; int ldv_retval_16 ; int ldv_retval_13 ; extern int ldv_release_17(void) ; int ldv_retval_9 ; int ldv_retval_10 ; extern int ldv_release_15(void) ; void ldv_initialize_b43_debugfs_fops_17(void) { void *tmp ; { tmp = __VERIFIER_nondet_pointer(); fops_shm32write_group0 = (struct file *)tmp; return; } } void ldv_initialize_b43_debugfs_fops_15(void) { void *tmp ; { tmp = __VERIFIER_nondet_pointer(); fops_mmio16write_group0 = (struct file *)tmp; return; } } void ldv_initialize_b43_debugfs_fops_20(void) { void *tmp ; { tmp = __VERIFIER_nondet_pointer(); fops_shm16read_group0 = (struct file *)tmp; return; } } void ldv_initialize_b43_debugfs_fops_13(void) { void *tmp ; { tmp = __VERIFIER_nondet_pointer(); fops_mmio32write_group0 = (struct file *)tmp; return; } } void ldv_initialize_b43_debugfs_fops_18(void) { void *tmp ; { tmp = __VERIFIER_nondet_pointer(); fops_shm32read_group0 = (struct file *)tmp; return; } } void ldv_initialize_b43_debugfs_fops_14(void) { void *tmp ; { tmp = __VERIFIER_nondet_pointer(); fops_mmio32read_group0 = (struct file *)tmp; return; } } void ldv_initialize_b43_debugfs_fops_11(void) { void *tmp ; { tmp = __VERIFIER_nondet_pointer(); fops_restart_group0 = (struct file *)tmp; return; } } void ldv_initialize_b43_debugfs_fops_16(void) { void *tmp ; { tmp = __VERIFIER_nondet_pointer(); fops_mmio16read_group0 = (struct file *)tmp; return; } } void ldv_initialize_b43_debugfs_fops_10(void) { void *tmp ; { tmp = __VERIFIER_nondet_pointer(); fops_loctls_group0 = (struct file *)tmp; return; } } void ldv_initialize_b43_debugfs_fops_19(void) { void *tmp ; { tmp = __VERIFIER_nondet_pointer(); fops_shm16write_group0 = (struct file *)tmp; return; } } void ldv_initialize_b43_debugfs_fops_12(void) { void *tmp ; { tmp = __VERIFIER_nondet_pointer(); fops_txstat_group0 = (struct file *)tmp; return; } } void ldv_main_exported_11(void) { struct inode *ldvarg6 ; void *tmp ; char *ldvarg2 ; void *tmp___0 ; char *ldvarg5 ; void *tmp___1 ; loff_t *ldvarg0 ; void *tmp___2 ; loff_t *ldvarg3 ; void *tmp___3 ; size_t ldvarg4 ; size_t ldvarg1 ; int tmp___4 ; { tmp = ldv_init_zalloc(1000UL); ldvarg6 = (struct inode *)tmp; tmp___0 = ldv_init_zalloc(1UL); ldvarg2 = (char *)tmp___0; tmp___1 = ldv_init_zalloc(1UL); ldvarg5 = (char *)tmp___1; tmp___2 = ldv_init_zalloc(8UL); ldvarg0 = (loff_t *)tmp___2; tmp___3 = ldv_init_zalloc(8UL); ldvarg3 = (loff_t *)tmp___3; ldv_memset((void *)(& ldvarg4), 0, 8UL); ldv_memset((void *)(& ldvarg1), 0, 8UL); tmp___4 = __VERIFIER_nondet_int(); switch (tmp___4) { case 0: ; if (ldv_state_variable_11 == 1) { ldv_retval_0 = b43_debugfs_open(ldvarg6, fops_restart_group0); if (ldv_retval_0 == 0) { ldv_state_variable_11 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_37619; case 1: ; if (ldv_state_variable_11 == 2) { b43_debugfs_write(fops_restart_group0, (char const *)ldvarg5, ldvarg4, ldvarg3); ldv_state_variable_11 = 2; } else { } goto ldv_37619; case 2: ; if (ldv_state_variable_11 == 2) { b43_debugfs_read(fops_restart_group0, ldvarg2, ldvarg1, ldvarg0); ldv_state_variable_11 = 2; } else { } goto ldv_37619; case 3: ; if (ldv_state_variable_11 == 2) { ldv_release_11(); ldv_state_variable_11 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_37619; default: ldv_stop(); } ldv_37619: ; return; } } void ldv_main_exported_17(void) { struct inode *ldvarg28 ; void *tmp ; loff_t *ldvarg22 ; void *tmp___0 ; size_t ldvarg23 ; loff_t *ldvarg25 ; void *tmp___1 ; size_t ldvarg26 ; char *ldvarg27 ; void *tmp___2 ; char *ldvarg24 ; void *tmp___3 ; int tmp___4 ; { tmp = ldv_init_zalloc(1000UL); ldvarg28 = (struct inode *)tmp; tmp___0 = ldv_init_zalloc(8UL); ldvarg22 = (loff_t *)tmp___0; tmp___1 = ldv_init_zalloc(8UL); ldvarg25 = (loff_t *)tmp___1; tmp___2 = ldv_init_zalloc(1UL); ldvarg27 = (char *)tmp___2; tmp___3 = ldv_init_zalloc(1UL); ldvarg24 = (char *)tmp___3; ldv_memset((void *)(& ldvarg23), 0, 8UL); ldv_memset((void *)(& ldvarg26), 0, 8UL); tmp___4 = __VERIFIER_nondet_int(); switch (tmp___4) { case 0: ; if (ldv_state_variable_17 == 1) { ldv_retval_2 = b43_debugfs_open(ldvarg28, fops_shm32write_group0); if (ldv_retval_2 == 0) { ldv_state_variable_17 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_37635; case 1: ; if (ldv_state_variable_17 == 2) { b43_debugfs_write(fops_shm32write_group0, (char const *)ldvarg27, ldvarg26, ldvarg25); ldv_state_variable_17 = 2; } else { } goto ldv_37635; case 2: ; if (ldv_state_variable_17 == 2) { b43_debugfs_read(fops_shm32write_group0, ldvarg24, ldvarg23, ldvarg22); ldv_state_variable_17 = 2; } else { } goto ldv_37635; case 3: ; if (ldv_state_variable_17 == 2) { ldv_release_17(); ldv_state_variable_17 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_37635; default: ldv_stop(); } ldv_37635: ; return; } } void ldv_main_exported_12(void) { size_t ldvarg118 ; loff_t *ldvarg117 ; void *tmp ; char *ldvarg119 ; void *tmp___0 ; loff_t *ldvarg120 ; void *tmp___1 ; char *ldvarg122 ; void *tmp___2 ; size_t ldvarg121 ; struct inode *ldvarg123 ; void *tmp___3 ; int tmp___4 ; { tmp = ldv_init_zalloc(8UL); ldvarg117 = (loff_t *)tmp; tmp___0 = ldv_init_zalloc(1UL); ldvarg119 = (char *)tmp___0; tmp___1 = ldv_init_zalloc(8UL); ldvarg120 = (loff_t *)tmp___1; tmp___2 = ldv_init_zalloc(1UL); ldvarg122 = (char *)tmp___2; tmp___3 = ldv_init_zalloc(1000UL); ldvarg123 = (struct inode *)tmp___3; ldv_memset((void *)(& ldvarg118), 0, 8UL); ldv_memset((void *)(& ldvarg121), 0, 8UL); tmp___4 = __VERIFIER_nondet_int(); switch (tmp___4) { case 0: ; if (ldv_state_variable_12 == 1) { ldv_retval_12 = b43_debugfs_open(ldvarg123, fops_txstat_group0); if (ldv_retval_12 == 0) { ldv_state_variable_12 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_37651; case 1: ; if (ldv_state_variable_12 == 2) { b43_debugfs_write(fops_txstat_group0, (char const *)ldvarg122, ldvarg121, ldvarg120); ldv_state_variable_12 = 2; } else { } goto ldv_37651; case 2: ; if (ldv_state_variable_12 == 2) { b43_debugfs_read(fops_txstat_group0, ldvarg119, ldvarg118, ldvarg117); ldv_state_variable_12 = 2; } else { } goto ldv_37651; case 3: ; if (ldv_state_variable_12 == 2) { ldv_release_12(); ldv_state_variable_12 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_37651; default: ldv_stop(); } ldv_37651: ; return; } } void ldv_main_exported_20(void) { char *ldvarg126 ; void *tmp ; size_t ldvarg128 ; size_t ldvarg125 ; struct inode *ldvarg130 ; void *tmp___0 ; loff_t *ldvarg124 ; void *tmp___1 ; char *ldvarg129 ; void *tmp___2 ; loff_t *ldvarg127 ; void *tmp___3 ; int tmp___4 ; { tmp = ldv_init_zalloc(1UL); ldvarg126 = (char *)tmp; tmp___0 = ldv_init_zalloc(1000UL); ldvarg130 = (struct inode *)tmp___0; tmp___1 = ldv_init_zalloc(8UL); ldvarg124 = (loff_t *)tmp___1; tmp___2 = ldv_init_zalloc(1UL); ldvarg129 = (char *)tmp___2; tmp___3 = ldv_init_zalloc(8UL); ldvarg127 = (loff_t *)tmp___3; ldv_memset((void *)(& ldvarg128), 0, 8UL); ldv_memset((void *)(& ldvarg125), 0, 8UL); tmp___4 = __VERIFIER_nondet_int(); switch (tmp___4) { case 0: ; if (ldv_state_variable_20 == 1) { ldv_retval_13 = b43_debugfs_open(ldvarg130, fops_shm16read_group0); if (ldv_retval_13 == 0) { ldv_state_variable_20 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_37667; case 1: ; if (ldv_state_variable_20 == 2) { b43_debugfs_write(fops_shm16read_group0, (char const *)ldvarg129, ldvarg128, ldvarg127); ldv_state_variable_20 = 2; } else { } goto ldv_37667; case 2: ; if (ldv_state_variable_20 == 2) { b43_debugfs_read(fops_shm16read_group0, ldvarg126, ldvarg125, ldvarg124); ldv_state_variable_20 = 2; } else { } goto ldv_37667; case 3: ; if (ldv_state_variable_20 == 2) { ldv_release_20(); ldv_state_variable_20 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_37667; default: ldv_stop(); } ldv_37667: ; return; } } void ldv_main_exported_15(void) { size_t ldvarg139 ; loff_t *ldvarg141 ; void *tmp ; size_t ldvarg142 ; struct inode *ldvarg144 ; void *tmp___0 ; char *ldvarg140 ; void *tmp___1 ; char *ldvarg143 ; void *tmp___2 ; loff_t *ldvarg138 ; void *tmp___3 ; int tmp___4 ; { tmp = ldv_init_zalloc(8UL); ldvarg141 = (loff_t *)tmp; tmp___0 = ldv_init_zalloc(1000UL); ldvarg144 = (struct inode *)tmp___0; tmp___1 = ldv_init_zalloc(1UL); ldvarg140 = (char *)tmp___1; tmp___2 = ldv_init_zalloc(1UL); ldvarg143 = (char *)tmp___2; tmp___3 = ldv_init_zalloc(8UL); ldvarg138 = (loff_t *)tmp___3; ldv_memset((void *)(& ldvarg139), 0, 8UL); ldv_memset((void *)(& ldvarg142), 0, 8UL); tmp___4 = __VERIFIER_nondet_int(); switch (tmp___4) { case 0: ; if (ldv_state_variable_15 == 1) { ldv_retval_15 = b43_debugfs_open(ldvarg144, fops_mmio16write_group0); if (ldv_retval_15 == 0) { ldv_state_variable_15 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_37683; case 1: ; if (ldv_state_variable_15 == 2) { b43_debugfs_write(fops_mmio16write_group0, (char const *)ldvarg143, ldvarg142, ldvarg141); ldv_state_variable_15 = 2; } else { } goto ldv_37683; case 2: ; if (ldv_state_variable_15 == 2) { b43_debugfs_read(fops_mmio16write_group0, ldvarg140, ldvarg139, ldvarg138); ldv_state_variable_15 = 2; } else { } goto ldv_37683; case 3: ; if (ldv_state_variable_15 == 2) { ldv_release_15(); ldv_state_variable_15 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_37683; default: ldv_stop(); } ldv_37683: ; return; } } void ldv_main_exported_14(void) { size_t ldvarg132 ; char *ldvarg133 ; void *tmp ; size_t ldvarg135 ; loff_t *ldvarg134 ; void *tmp___0 ; struct inode *ldvarg137 ; void *tmp___1 ; loff_t *ldvarg131 ; void *tmp___2 ; char *ldvarg136 ; void *tmp___3 ; int tmp___4 ; { tmp = ldv_init_zalloc(1UL); ldvarg133 = (char *)tmp; tmp___0 = ldv_init_zalloc(8UL); ldvarg134 = (loff_t *)tmp___0; tmp___1 = ldv_init_zalloc(1000UL); ldvarg137 = (struct inode *)tmp___1; tmp___2 = ldv_init_zalloc(8UL); ldvarg131 = (loff_t *)tmp___2; tmp___3 = ldv_init_zalloc(1UL); ldvarg136 = (char *)tmp___3; ldv_memset((void *)(& ldvarg132), 0, 8UL); ldv_memset((void *)(& ldvarg135), 0, 8UL); tmp___4 = __VERIFIER_nondet_int(); switch (tmp___4) { case 0: ; if (ldv_state_variable_14 == 1) { ldv_retval_14 = b43_debugfs_open(ldvarg137, fops_mmio32read_group0); if (ldv_retval_14 == 0) { ldv_state_variable_14 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_37699; case 1: ; if (ldv_state_variable_14 == 2) { b43_debugfs_write(fops_mmio32read_group0, (char const *)ldvarg136, ldvarg135, ldvarg134); ldv_state_variable_14 = 2; } else { } goto ldv_37699; case 2: ; if (ldv_state_variable_14 == 2) { b43_debugfs_read(fops_mmio32read_group0, ldvarg133, ldvarg132, ldvarg131); ldv_state_variable_14 = 2; } else { } goto ldv_37699; case 3: ; if (ldv_state_variable_14 == 2) { ldv_release_14(); ldv_state_variable_14 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_37699; default: ldv_stop(); } ldv_37699: ; return; } } void ldv_main_exported_18(void) { size_t ldvarg30 ; size_t ldvarg33 ; char *ldvarg34 ; void *tmp ; loff_t *ldvarg29 ; void *tmp___0 ; char *ldvarg31 ; void *tmp___1 ; loff_t *ldvarg32 ; void *tmp___2 ; struct inode *ldvarg35 ; void *tmp___3 ; int tmp___4 ; { tmp = ldv_init_zalloc(1UL); ldvarg34 = (char *)tmp; tmp___0 = ldv_init_zalloc(8UL); ldvarg29 = (loff_t *)tmp___0; tmp___1 = ldv_init_zalloc(1UL); ldvarg31 = (char *)tmp___1; tmp___2 = ldv_init_zalloc(8UL); ldvarg32 = (loff_t *)tmp___2; tmp___3 = ldv_init_zalloc(1000UL); ldvarg35 = (struct inode *)tmp___3; ldv_memset((void *)(& ldvarg30), 0, 8UL); ldv_memset((void *)(& ldvarg33), 0, 8UL); tmp___4 = __VERIFIER_nondet_int(); switch (tmp___4) { case 0: ; if (ldv_state_variable_18 == 1) { ldv_retval_6 = b43_debugfs_open(ldvarg35, fops_shm32read_group0); if (ldv_retval_6 == 0) { ldv_state_variable_18 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_37715; case 1: ; if (ldv_state_variable_18 == 2) { b43_debugfs_write(fops_shm32read_group0, (char const *)ldvarg34, ldvarg33, ldvarg32); ldv_state_variable_18 = 2; } else { } goto ldv_37715; case 2: ; if (ldv_state_variable_18 == 2) { b43_debugfs_read(fops_shm32read_group0, ldvarg31, ldvarg30, ldvarg29); ldv_state_variable_18 = 2; } else { } goto ldv_37715; case 3: ; if (ldv_state_variable_18 == 2) { ldv_release_18(); ldv_state_variable_18 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_37715; default: ldv_stop(); } ldv_37715: ; return; } } void ldv_main_exported_19(void) { loff_t *ldvarg158 ; void *tmp ; char *ldvarg160 ; void *tmp___0 ; loff_t *ldvarg155 ; void *tmp___1 ; struct inode *ldvarg161 ; void *tmp___2 ; char *ldvarg157 ; void *tmp___3 ; size_t ldvarg159 ; size_t ldvarg156 ; int tmp___4 ; { tmp = ldv_init_zalloc(8UL); ldvarg158 = (loff_t *)tmp; tmp___0 = ldv_init_zalloc(1UL); ldvarg160 = (char *)tmp___0; tmp___1 = ldv_init_zalloc(8UL); ldvarg155 = (loff_t *)tmp___1; tmp___2 = ldv_init_zalloc(1000UL); ldvarg161 = (struct inode *)tmp___2; tmp___3 = ldv_init_zalloc(1UL); ldvarg157 = (char *)tmp___3; ldv_memset((void *)(& ldvarg159), 0, 8UL); ldv_memset((void *)(& ldvarg156), 0, 8UL); tmp___4 = __VERIFIER_nondet_int(); switch (tmp___4) { case 0: ; if (ldv_state_variable_19 == 1) { ldv_retval_16 = b43_debugfs_open(ldvarg161, fops_shm16write_group0); if (ldv_retval_16 == 0) { ldv_state_variable_19 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_37731; case 1: ; if (ldv_state_variable_19 == 2) { b43_debugfs_write(fops_shm16write_group0, (char const *)ldvarg160, ldvarg159, ldvarg158); ldv_state_variable_19 = 2; } else { } goto ldv_37731; case 2: ; if (ldv_state_variable_19 == 2) { b43_debugfs_read(fops_shm16write_group0, ldvarg157, ldvarg156, ldvarg155); ldv_state_variable_19 = 2; } else { } goto ldv_37731; case 3: ; if (ldv_state_variable_19 == 2) { ldv_release_19(); ldv_state_variable_19 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_37731; default: ldv_stop(); } ldv_37731: ; return; } } void ldv_main_exported_10(void) { loff_t *ldvarg162 ; void *tmp ; size_t ldvarg166 ; size_t ldvarg163 ; loff_t *ldvarg165 ; void *tmp___0 ; struct inode *ldvarg168 ; void *tmp___1 ; char *ldvarg164 ; void *tmp___2 ; char *ldvarg167 ; void *tmp___3 ; int tmp___4 ; { tmp = ldv_init_zalloc(8UL); ldvarg162 = (loff_t *)tmp; tmp___0 = ldv_init_zalloc(8UL); ldvarg165 = (loff_t *)tmp___0; tmp___1 = ldv_init_zalloc(1000UL); ldvarg168 = (struct inode *)tmp___1; tmp___2 = ldv_init_zalloc(1UL); ldvarg164 = (char *)tmp___2; tmp___3 = ldv_init_zalloc(1UL); ldvarg167 = (char *)tmp___3; ldv_memset((void *)(& ldvarg166), 0, 8UL); ldv_memset((void *)(& ldvarg163), 0, 8UL); tmp___4 = __VERIFIER_nondet_int(); switch (tmp___4) { case 0: ; if (ldv_state_variable_10 == 1) { ldv_retval_17 = b43_debugfs_open(ldvarg168, fops_loctls_group0); if (ldv_retval_17 == 0) { ldv_state_variable_10 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_37747; case 1: ; if (ldv_state_variable_10 == 2) { b43_debugfs_write(fops_loctls_group0, (char const *)ldvarg167, ldvarg166, ldvarg165); ldv_state_variable_10 = 2; } else { } goto ldv_37747; case 2: ; if (ldv_state_variable_10 == 2) { b43_debugfs_read(fops_loctls_group0, ldvarg164, ldvarg163, ldvarg162); ldv_state_variable_10 = 2; } else { } goto ldv_37747; case 3: ; if (ldv_state_variable_10 == 2) { ldv_release_10(); ldv_state_variable_10 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_37747; default: ldv_stop(); } ldv_37747: ; return; } } void ldv_main_exported_13(void) { loff_t *ldvarg83 ; void *tmp ; loff_t *ldvarg86 ; void *tmp___0 ; size_t ldvarg87 ; struct inode *ldvarg89 ; void *tmp___1 ; char *ldvarg88 ; void *tmp___2 ; size_t ldvarg84 ; char *ldvarg85 ; void *tmp___3 ; int tmp___4 ; { tmp = ldv_init_zalloc(8UL); ldvarg83 = (loff_t *)tmp; tmp___0 = ldv_init_zalloc(8UL); ldvarg86 = (loff_t *)tmp___0; tmp___1 = ldv_init_zalloc(1000UL); ldvarg89 = (struct inode *)tmp___1; tmp___2 = ldv_init_zalloc(1UL); ldvarg88 = (char *)tmp___2; tmp___3 = ldv_init_zalloc(1UL); ldvarg85 = (char *)tmp___3; ldv_memset((void *)(& ldvarg87), 0, 8UL); ldv_memset((void *)(& ldvarg84), 0, 8UL); tmp___4 = __VERIFIER_nondet_int(); switch (tmp___4) { case 0: ; if (ldv_state_variable_13 == 1) { ldv_retval_10 = b43_debugfs_open(ldvarg89, fops_mmio32write_group0); if (ldv_retval_10 == 0) { ldv_state_variable_13 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_37763; case 1: ; if (ldv_state_variable_13 == 2) { b43_debugfs_write(fops_mmio32write_group0, (char const *)ldvarg88, ldvarg87, ldvarg86); ldv_state_variable_13 = 2; } else { } goto ldv_37763; case 2: ; if (ldv_state_variable_13 == 2) { b43_debugfs_read(fops_mmio32write_group0, ldvarg85, ldvarg84, ldvarg83); ldv_state_variable_13 = 2; } else { } goto ldv_37763; case 3: ; if (ldv_state_variable_13 == 2) { ldv_release_13(); ldv_state_variable_13 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_37763; default: ldv_stop(); } ldv_37763: ; return; } } void ldv_main_exported_16(void) { loff_t *ldvarg76 ; void *tmp ; struct inode *ldvarg82 ; void *tmp___0 ; char *ldvarg78 ; void *tmp___1 ; size_t ldvarg80 ; loff_t *ldvarg79 ; void *tmp___2 ; size_t ldvarg77 ; char *ldvarg81 ; void *tmp___3 ; int tmp___4 ; { tmp = ldv_init_zalloc(8UL); ldvarg76 = (loff_t *)tmp; tmp___0 = ldv_init_zalloc(1000UL); ldvarg82 = (struct inode *)tmp___0; tmp___1 = ldv_init_zalloc(1UL); ldvarg78 = (char *)tmp___1; tmp___2 = ldv_init_zalloc(8UL); ldvarg79 = (loff_t *)tmp___2; tmp___3 = ldv_init_zalloc(1UL); ldvarg81 = (char *)tmp___3; ldv_memset((void *)(& ldvarg80), 0, 8UL); ldv_memset((void *)(& ldvarg77), 0, 8UL); tmp___4 = __VERIFIER_nondet_int(); switch (tmp___4) { case 0: ; if (ldv_state_variable_16 == 1) { ldv_retval_9 = b43_debugfs_open(ldvarg82, fops_mmio16read_group0); if (ldv_retval_9 == 0) { ldv_state_variable_16 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_37779; case 1: ; if (ldv_state_variable_16 == 2) { b43_debugfs_write(fops_mmio16read_group0, (char const *)ldvarg81, ldvarg80, ldvarg79); ldv_state_variable_16 = 2; } else { } goto ldv_37779; case 2: ; if (ldv_state_variable_16 == 2) { b43_debugfs_read(fops_mmio16read_group0, ldvarg78, ldvarg77, ldvarg76); ldv_state_variable_16 = 2; } else { } goto ldv_37779; case 3: ; if (ldv_state_variable_16 == 2) { ldv_release_16(); ldv_state_variable_16 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_37779; default: ldv_stop(); } ldv_37779: ; return; } } int ldv_del_timer_sync_132(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type ldv_func_res ; int tmp ; { tmp = del_timer_sync(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_9(ldv_func_arg1); return (ldv_func_res); } } int ldv_del_timer_133(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___0 ldv_func_res ; int tmp ; { tmp = del_timer(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_9(ldv_func_arg1); return (ldv_func_res); } } int ldv_request_threaded_irq_134(unsigned int ldv_func_arg1 , irqreturn_t (*handler)(int , void * ) , irqreturn_t (*thread_fn)(int , void * ) , unsigned long ldv_func_arg4 , char const *ldv_func_arg5 , void *ldv_func_arg6 ) { ldv_func_ret_type___1 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = request_threaded_irq(ldv_func_arg1, handler, thread_fn, ldv_func_arg4, ldv_func_arg5, ldv_func_arg6); ldv_func_res = tmp; tmp___0 = reg_check_2(handler, thread_fn); if (tmp___0 != 0 && ldv_func_res >= 0) { activate_suitable_irq_2((int )ldv_func_arg1, ldv_func_arg6); } else { } return (ldv_func_res); } } __inline static void ldv_error(void) { { ERROR: ; __VERIFIER_error(); } } unsigned short ldv_sdio_element = 0U; void ldv_check_context(struct sdio_func *func ) { { if ((int )ldv_sdio_element != ((func->card)->host)->index) { ldv_error(); } else { } return; } } void ldv_sdio_claim_host(struct sdio_func *func ) { { if ((unsigned int )ldv_sdio_element != 0U) { ldv_error(); } else { } ldv_sdio_element = (unsigned short )((func->card)->host)->index; return; } } void ldv_sdio_release_host(struct sdio_func *func ) { { if ((int )ldv_sdio_element != ((func->card)->host)->index) { ldv_error(); } else { } ldv_sdio_element = 0U; return; } } void ldv_check_final_state(void) { { if ((unsigned int )ldv_sdio_element != 0U) { ldv_error(); } else { } return; } }