extern void __VERIFIER_error() __attribute__ ((__noreturn__)); /* Generated by CIL v. 1.5.1 */ /* print_CIL_Input is false */ typedef signed char __s8; typedef unsigned char __u8; typedef short __s16; typedef unsigned short __u16; typedef int __s32; typedef unsigned int __u32; typedef 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 long __kernel_long_t; typedef unsigned long __kernel_ulong_t; typedef int __kernel_pid_t; typedef unsigned int __kernel_uid32_t; typedef unsigned int __kernel_gid32_t; typedef __kernel_ulong_t __kernel_size_t; typedef __kernel_long_t __kernel_ssize_t; typedef long long __kernel_loff_t; typedef __kernel_long_t __kernel_time_t; typedef __kernel_long_t __kernel_clock_t; typedef int __kernel_timer_t; typedef int __kernel_clockid_t; typedef __u16 __le16; typedef __u16 __be16; typedef __u32 __le32; typedef __u32 __be32; typedef __u64 __le64; typedef __u32 __wsum; struct kernel_symbol { unsigned long value ; char const *name ; }; struct module; typedef __u32 __kernel_dev_t; typedef __kernel_dev_t dev_t; typedef unsigned short umode_t; typedef __kernel_pid_t pid_t; typedef __kernel_clockid_t clockid_t; typedef _Bool bool; typedef __kernel_uid32_t uid_t; typedef __kernel_gid32_t gid_t; typedef __kernel_loff_t loff_t; typedef __kernel_size_t size_t; typedef __kernel_ssize_t ssize_t; typedef __kernel_time_t time_t; typedef __s8 int8_t; typedef __s16 int16_t; typedef __s32 int32_t; typedef __u8 uint8_t; typedef __u32 uint32_t; typedef __u64 uint64_t; typedef unsigned long sector_t; typedef unsigned long blkcnt_t; typedef u64 dma_addr_t; typedef unsigned int gfp_t; typedef unsigned int fmode_t; typedef unsigned int oom_flags_t; struct __anonstruct_atomic_t_6 { int counter ; }; typedef struct __anonstruct_atomic_t_6 atomic_t; struct __anonstruct_atomic64_t_7 { long counter ; }; typedef struct __anonstruct_atomic64_t_7 atomic64_t; struct list_head { struct list_head *next ; struct list_head *prev ; }; struct hlist_node; struct hlist_head { struct hlist_node *first ; }; struct hlist_node { struct hlist_node *next ; struct hlist_node **pprev ; }; struct callback_head { struct callback_head *next ; void (*func)(struct callback_head * ) ; }; struct pt_regs { unsigned long r15 ; unsigned long r14 ; unsigned long r13 ; unsigned long r12 ; unsigned long bp ; unsigned long bx ; unsigned long r11 ; unsigned long r10 ; unsigned long r9 ; unsigned long r8 ; unsigned long ax ; unsigned long cx ; unsigned long dx ; unsigned long si ; unsigned long di ; unsigned long orig_ax ; unsigned long ip ; unsigned long cs ; unsigned long flags ; unsigned long sp ; unsigned long ss ; }; struct __anonstruct____missing_field_name_9 { unsigned int a ; unsigned int b ; }; struct __anonstruct____missing_field_name_10 { u16 limit0 ; u16 base0 ; unsigned char base1 ; unsigned char type : 4 ; unsigned char s : 1 ; unsigned char dpl : 2 ; unsigned char p : 1 ; unsigned char limit : 4 ; unsigned char avl : 1 ; unsigned char l : 1 ; unsigned char d : 1 ; unsigned char g : 1 ; unsigned char base2 ; }; union __anonunion____missing_field_name_8 { struct __anonstruct____missing_field_name_9 __annonCompField4 ; struct __anonstruct____missing_field_name_10 __annonCompField5 ; }; struct desc_struct { union __anonunion____missing_field_name_8 __annonCompField6 ; }; typedef unsigned long pteval_t; typedef unsigned long pgdval_t; typedef unsigned long pgprotval_t; struct __anonstruct_pte_t_11 { pteval_t pte ; }; typedef struct __anonstruct_pte_t_11 pte_t; struct pgprot { pgprotval_t pgprot ; }; typedef struct pgprot pgprot_t; struct __anonstruct_pgd_t_12 { pgdval_t pgd ; }; typedef struct __anonstruct_pgd_t_12 pgd_t; struct page; typedef struct page *pgtable_t; struct file; struct seq_file; struct thread_struct; struct mm_struct; struct task_struct; struct cpumask; struct qspinlock { atomic_t val ; }; typedef struct qspinlock arch_spinlock_t; struct qrwlock { atomic_t cnts ; arch_spinlock_t lock ; }; typedef struct qrwlock arch_rwlock_t; typedef void (*ctor_fn_t)(void); struct device; struct net_device; struct file_operations; struct completion; struct bug_entry { int bug_addr_disp ; int file_disp ; unsigned short line ; unsigned short flags ; }; struct timespec; struct compat_timespec; struct __anonstruct_futex_16 { u32 *uaddr ; u32 val ; u32 flags ; u32 bitset ; u64 time ; u32 *uaddr2 ; }; struct __anonstruct_nanosleep_17 { clockid_t clockid ; struct timespec *rmtp ; struct compat_timespec *compat_rmtp ; u64 expires ; }; struct pollfd; struct __anonstruct_poll_18 { struct pollfd *ufds ; int nfds ; int has_timeout ; unsigned long tv_sec ; unsigned long tv_nsec ; }; union __anonunion____missing_field_name_15 { struct __anonstruct_futex_16 futex ; struct __anonstruct_nanosleep_17 nanosleep ; struct __anonstruct_poll_18 poll ; }; struct restart_block { long (*fn)(struct restart_block * ) ; union __anonunion____missing_field_name_15 __annonCompField7 ; }; struct kernel_vm86_regs { struct pt_regs pt ; unsigned short es ; unsigned short __esh ; unsigned short ds ; unsigned short __dsh ; unsigned short fs ; unsigned short __fsh ; unsigned short gs ; unsigned short __gsh ; }; union __anonunion____missing_field_name_19 { struct pt_regs *regs ; struct kernel_vm86_regs *vm86 ; }; struct math_emu_info { long ___orig_eip ; union __anonunion____missing_field_name_19 __annonCompField8 ; }; struct cpumask { unsigned long bits[128U] ; }; typedef struct cpumask cpumask_t; typedef struct cpumask *cpumask_var_t; struct fregs_state { u32 cwd ; u32 swd ; u32 twd ; u32 fip ; u32 fcs ; u32 foo ; u32 fos ; u32 st_space[20U] ; u32 status ; }; struct __anonstruct____missing_field_name_29 { u64 rip ; u64 rdp ; }; struct __anonstruct____missing_field_name_30 { u32 fip ; u32 fcs ; u32 foo ; u32 fos ; }; union __anonunion____missing_field_name_28 { struct __anonstruct____missing_field_name_29 __annonCompField12 ; struct __anonstruct____missing_field_name_30 __annonCompField13 ; }; union __anonunion____missing_field_name_31 { u32 padding1[12U] ; u32 sw_reserved[12U] ; }; struct fxregs_state { u16 cwd ; u16 swd ; u16 twd ; u16 fop ; union __anonunion____missing_field_name_28 __annonCompField14 ; u32 mxcsr ; u32 mxcsr_mask ; u32 st_space[32U] ; u32 xmm_space[64U] ; u32 padding[12U] ; union __anonunion____missing_field_name_31 __annonCompField15 ; }; struct swregs_state { u32 cwd ; u32 swd ; u32 twd ; u32 fip ; u32 fcs ; u32 foo ; u32 fos ; u32 st_space[20U] ; u8 ftop ; u8 changed ; u8 lookahead ; u8 no_update ; u8 rm ; u8 alimit ; struct math_emu_info *info ; u32 entry_eip ; }; struct xstate_header { u64 xfeatures ; u64 xcomp_bv ; u64 reserved[6U] ; }; struct xregs_state { struct fxregs_state i387 ; struct xstate_header header ; u8 __reserved[464U] ; }; union fpregs_state { struct fregs_state fsave ; struct fxregs_state fxsave ; struct swregs_state soft ; struct xregs_state xsave ; }; struct fpu { union fpregs_state state ; unsigned int last_cpu ; unsigned char fpstate_active ; unsigned char fpregs_active ; unsigned char counter ; }; struct seq_operations; struct perf_event; struct thread_struct { struct desc_struct tls_array[3U] ; unsigned long sp0 ; unsigned long sp ; unsigned short es ; unsigned short ds ; unsigned short fsindex ; unsigned short gsindex ; unsigned long fs ; unsigned long gs ; struct fpu fpu ; struct perf_event *ptrace_bps[4U] ; unsigned long debugreg6 ; unsigned long ptrace_dr7 ; unsigned long cr2 ; unsigned long trap_nr ; unsigned long error_code ; unsigned long *io_bitmap_ptr ; unsigned long iopl ; unsigned int io_bitmap_max ; }; typedef atomic64_t atomic_long_t; struct lockdep_map; struct stack_trace { unsigned int nr_entries ; unsigned int max_entries ; unsigned long *entries ; int skip ; }; struct lockdep_subclass_key { char __one_byte ; }; struct lock_class_key { struct lockdep_subclass_key subkeys[8U] ; }; struct lock_class { struct list_head hash_entry ; struct list_head lock_entry ; struct lockdep_subclass_key *key ; unsigned int subclass ; unsigned int dep_gen_id ; unsigned long usage_mask ; struct stack_trace usage_traces[13U] ; struct list_head locks_after ; struct list_head locks_before ; unsigned int version ; unsigned long ops ; char const *name ; int name_version ; unsigned long contention_point[4U] ; unsigned long contending_point[4U] ; }; struct lockdep_map { struct lock_class_key *key ; struct lock_class *class_cache[2U] ; char const *name ; int cpu ; unsigned long ip ; }; struct held_lock { u64 prev_chain_key ; unsigned long acquire_ip ; struct lockdep_map *instance ; struct lockdep_map *nest_lock ; u64 waittime_stamp ; u64 holdtime_stamp ; unsigned short class_idx : 13 ; unsigned char irq_context : 2 ; unsigned char trylock : 1 ; unsigned char read : 2 ; unsigned char check : 1 ; unsigned char hardirqs_off : 1 ; unsigned short references : 12 ; unsigned int pin_count ; }; struct raw_spinlock { arch_spinlock_t raw_lock ; unsigned int magic ; unsigned int owner_cpu ; void *owner ; struct lockdep_map dep_map ; }; typedef struct raw_spinlock raw_spinlock_t; struct __anonstruct____missing_field_name_35 { u8 __padding[24U] ; struct lockdep_map dep_map ; }; union __anonunion____missing_field_name_34 { struct raw_spinlock rlock ; struct __anonstruct____missing_field_name_35 __annonCompField17 ; }; struct spinlock { union __anonunion____missing_field_name_34 __annonCompField18 ; }; typedef struct spinlock spinlock_t; struct __anonstruct_rwlock_t_36 { arch_rwlock_t raw_lock ; unsigned int magic ; unsigned int owner_cpu ; void *owner ; struct lockdep_map dep_map ; }; typedef struct __anonstruct_rwlock_t_36 rwlock_t; struct seqcount { unsigned int sequence ; struct lockdep_map dep_map ; }; typedef struct seqcount seqcount_t; struct __anonstruct_seqlock_t_45 { struct seqcount seqcount ; spinlock_t lock ; }; typedef struct __anonstruct_seqlock_t_45 seqlock_t; struct timespec { __kernel_time_t tv_sec ; long tv_nsec ; }; struct user_namespace; struct __anonstruct_kuid_t_46 { uid_t val ; }; typedef struct __anonstruct_kuid_t_46 kuid_t; struct __anonstruct_kgid_t_47 { gid_t val ; }; typedef struct __anonstruct_kgid_t_47 kgid_t; struct kstat { u64 ino ; dev_t dev ; umode_t mode ; unsigned int nlink ; kuid_t uid ; kgid_t gid ; dev_t rdev ; loff_t size ; struct timespec atime ; struct timespec mtime ; struct timespec ctime ; unsigned long blksize ; unsigned long long blocks ; }; struct vm_area_struct; struct __wait_queue_head { spinlock_t lock ; struct list_head task_list ; }; typedef struct __wait_queue_head wait_queue_head_t; struct __anonstruct_nodemask_t_48 { unsigned long bits[16U] ; }; typedef struct __anonstruct_nodemask_t_48 nodemask_t; struct optimistic_spin_queue { atomic_t tail ; }; struct mutex { atomic_t count ; spinlock_t wait_lock ; struct list_head wait_list ; struct task_struct *owner ; void *magic ; struct lockdep_map dep_map ; }; struct mutex_waiter { struct list_head list ; struct task_struct *task ; void *magic ; }; struct rw_semaphore; struct rw_semaphore { long count ; struct list_head wait_list ; raw_spinlock_t wait_lock ; struct optimistic_spin_queue osq ; struct task_struct *owner ; struct lockdep_map dep_map ; }; struct completion { unsigned int done ; wait_queue_head_t wait ; }; union ktime { s64 tv64 ; }; typedef union ktime ktime_t; struct notifier_block; struct timer_list { struct hlist_node entry ; unsigned long expires ; void (*function)(unsigned long ) ; unsigned long data ; u32 flags ; int slack ; int start_pid ; void *start_site ; char start_comm[16U] ; struct lockdep_map lockdep_map ; }; struct hrtimer; enum hrtimer_restart; struct rb_node { unsigned long __rb_parent_color ; struct rb_node *rb_right ; struct rb_node *rb_left ; }; struct rb_root { struct rb_node *rb_node ; }; struct ctl_table; struct nsproxy; struct ctl_table_root; struct ctl_table_header; struct ctl_dir; typedef int proc_handler(struct ctl_table * , int , void * , size_t * , loff_t * ); struct ctl_table_poll { atomic_t event ; wait_queue_head_t wait ; }; struct ctl_table { char const *procname ; void *data ; int maxlen ; umode_t mode ; struct ctl_table *child ; proc_handler *proc_handler ; struct ctl_table_poll *poll ; void *extra1 ; void *extra2 ; }; struct ctl_node { struct rb_node node ; struct ctl_table_header *header ; }; struct __anonstruct____missing_field_name_50 { struct ctl_table *ctl_table ; int used ; int count ; int nreg ; }; union __anonunion____missing_field_name_49 { struct __anonstruct____missing_field_name_50 __annonCompField19 ; struct callback_head rcu ; }; struct ctl_table_set; struct ctl_table_header { union __anonunion____missing_field_name_49 __annonCompField20 ; struct completion *unregistering ; struct ctl_table *ctl_table_arg ; struct ctl_table_root *root ; struct ctl_table_set *set ; struct ctl_dir *parent ; struct ctl_node *node ; }; struct ctl_dir { struct ctl_table_header header ; struct rb_root root ; }; struct ctl_table_set { int (*is_seen)(struct ctl_table_set * ) ; struct ctl_dir dir ; }; struct ctl_table_root { struct ctl_table_set default_set ; struct ctl_table_set *(*lookup)(struct ctl_table_root * , struct nsproxy * ) ; int (*permissions)(struct ctl_table_header * , struct ctl_table * ) ; }; struct workqueue_struct; struct work_struct; struct work_struct { atomic_long_t data ; struct list_head entry ; void (*func)(struct work_struct * ) ; struct lockdep_map lockdep_map ; }; struct delayed_work { struct work_struct work ; struct timer_list timer ; struct workqueue_struct *wq ; int cpu ; }; struct notifier_block { int (*notifier_call)(struct notifier_block * , unsigned long , void * ) ; struct notifier_block *next ; int priority ; }; struct pm_message { int event ; }; typedef struct pm_message pm_message_t; struct dev_pm_ops { int (*prepare)(struct device * ) ; void (*complete)(struct device * ) ; int (*suspend)(struct device * ) ; int (*resume)(struct device * ) ; int (*freeze)(struct device * ) ; int (*thaw)(struct device * ) ; int (*poweroff)(struct device * ) ; int (*restore)(struct device * ) ; int (*suspend_late)(struct device * ) ; int (*resume_early)(struct device * ) ; int (*freeze_late)(struct device * ) ; int (*thaw_early)(struct device * ) ; int (*poweroff_late)(struct device * ) ; int (*restore_early)(struct device * ) ; int (*suspend_noirq)(struct device * ) ; int (*resume_noirq)(struct device * ) ; int (*freeze_noirq)(struct device * ) ; int (*thaw_noirq)(struct device * ) ; int (*poweroff_noirq)(struct device * ) ; int (*restore_noirq)(struct device * ) ; int (*runtime_suspend)(struct device * ) ; int (*runtime_resume)(struct device * ) ; int (*runtime_idle)(struct device * ) ; }; enum rpm_status { RPM_ACTIVE = 0, RPM_RESUMING = 1, RPM_SUSPENDED = 2, RPM_SUSPENDING = 3 } ; enum rpm_request { RPM_REQ_NONE = 0, RPM_REQ_IDLE = 1, RPM_REQ_SUSPEND = 2, RPM_REQ_AUTOSUSPEND = 3, RPM_REQ_RESUME = 4 } ; struct wakeup_source; struct wake_irq; struct pm_subsys_data { spinlock_t lock ; unsigned int refcount ; struct list_head clock_list ; }; struct dev_pm_qos; struct dev_pm_info { pm_message_t power_state ; unsigned char can_wakeup : 1 ; unsigned char async_suspend : 1 ; bool is_prepared ; bool is_suspended ; bool is_noirq_suspended ; bool is_late_suspended ; bool ignore_children ; bool early_init ; bool direct_complete ; spinlock_t lock ; struct list_head entry ; struct completion completion ; struct wakeup_source *wakeup ; bool wakeup_path ; bool syscore ; struct timer_list suspend_timer ; unsigned long timer_expires ; struct work_struct work ; wait_queue_head_t wait_queue ; struct wake_irq *wakeirq ; atomic_t usage_count ; atomic_t child_count ; unsigned char disable_depth : 3 ; unsigned char idle_notification : 1 ; unsigned char request_pending : 1 ; unsigned char deferred_resume : 1 ; unsigned char run_wake : 1 ; unsigned char runtime_auto : 1 ; unsigned char no_callbacks : 1 ; unsigned char irq_safe : 1 ; unsigned char use_autosuspend : 1 ; unsigned char timer_autosuspends : 1 ; unsigned char memalloc_noio : 1 ; enum rpm_request request ; enum rpm_status runtime_status ; int runtime_error ; int autosuspend_delay ; unsigned long last_busy ; unsigned long active_jiffies ; unsigned long suspended_jiffies ; unsigned long accounting_timestamp ; struct pm_subsys_data *subsys_data ; void (*set_latency_tolerance)(struct device * , s32 ) ; struct dev_pm_qos *qos ; }; struct dev_pm_domain { struct dev_pm_ops ops ; void (*detach)(struct device * , bool ) ; int (*activate)(struct device * ) ; void (*sync)(struct device * ) ; void (*dismiss)(struct device * ) ; }; struct __anonstruct_mm_context_t_115 { void *ldt ; int size ; unsigned short ia32_compat ; struct mutex lock ; void *vdso ; atomic_t perf_rdpmc_allowed ; }; typedef struct __anonstruct_mm_context_t_115 mm_context_t; struct bio_vec; struct llist_node; struct llist_node { struct llist_node *next ; }; struct cred; struct inode; struct arch_uprobe_task { unsigned long saved_scratch_register ; unsigned int saved_trap_nr ; unsigned int saved_tf ; }; enum uprobe_task_state { UTASK_RUNNING = 0, UTASK_SSTEP = 1, UTASK_SSTEP_ACK = 2, UTASK_SSTEP_TRAPPED = 3 } ; struct __anonstruct____missing_field_name_148 { struct arch_uprobe_task autask ; unsigned long vaddr ; }; struct __anonstruct____missing_field_name_149 { struct callback_head dup_xol_work ; unsigned long dup_xol_addr ; }; union __anonunion____missing_field_name_147 { struct __anonstruct____missing_field_name_148 __annonCompField33 ; struct __anonstruct____missing_field_name_149 __annonCompField34 ; }; struct uprobe; struct return_instance; struct uprobe_task { enum uprobe_task_state state ; union __anonunion____missing_field_name_147 __annonCompField35 ; struct uprobe *active_uprobe ; unsigned long xol_vaddr ; struct return_instance *return_instances ; unsigned int depth ; }; struct xol_area; struct uprobes_state { struct xol_area *xol_area ; }; struct address_space; struct mem_cgroup; typedef void compound_page_dtor(struct page * ); union __anonunion____missing_field_name_150 { struct address_space *mapping ; void *s_mem ; }; union __anonunion____missing_field_name_152 { unsigned long index ; void *freelist ; bool pfmemalloc ; }; struct __anonstruct____missing_field_name_156 { unsigned short inuse ; unsigned short objects : 15 ; unsigned char frozen : 1 ; }; union __anonunion____missing_field_name_155 { atomic_t _mapcount ; struct __anonstruct____missing_field_name_156 __annonCompField38 ; int units ; }; struct __anonstruct____missing_field_name_154 { union __anonunion____missing_field_name_155 __annonCompField39 ; atomic_t _count ; }; union __anonunion____missing_field_name_153 { unsigned long counters ; struct __anonstruct____missing_field_name_154 __annonCompField40 ; unsigned int active ; }; struct __anonstruct____missing_field_name_151 { union __anonunion____missing_field_name_152 __annonCompField37 ; union __anonunion____missing_field_name_153 __annonCompField41 ; }; struct __anonstruct____missing_field_name_158 { struct page *next ; int pages ; int pobjects ; }; struct slab; struct __anonstruct____missing_field_name_159 { compound_page_dtor *compound_dtor ; unsigned long compound_order ; }; union __anonunion____missing_field_name_157 { struct list_head lru ; struct __anonstruct____missing_field_name_158 __annonCompField43 ; struct slab *slab_page ; struct callback_head callback_head ; struct __anonstruct____missing_field_name_159 __annonCompField44 ; pgtable_t pmd_huge_pte ; }; struct kmem_cache; union __anonunion____missing_field_name_160 { unsigned long private ; spinlock_t *ptl ; struct kmem_cache *slab_cache ; struct page *first_page ; }; struct page { unsigned long flags ; union __anonunion____missing_field_name_150 __annonCompField36 ; struct __anonstruct____missing_field_name_151 __annonCompField42 ; union __anonunion____missing_field_name_157 __annonCompField45 ; union __anonunion____missing_field_name_160 __annonCompField46 ; struct mem_cgroup *mem_cgroup ; }; struct page_frag { struct page *page ; __u32 offset ; __u32 size ; }; struct __anonstruct_shared_161 { struct rb_node rb ; unsigned long rb_subtree_last ; }; struct anon_vma; struct vm_operations_struct; struct mempolicy; struct vm_area_struct { unsigned long vm_start ; unsigned long vm_end ; struct vm_area_struct *vm_next ; struct vm_area_struct *vm_prev ; struct rb_node vm_rb ; unsigned long rb_subtree_gap ; struct mm_struct *vm_mm ; pgprot_t vm_page_prot ; unsigned long vm_flags ; struct __anonstruct_shared_161 shared ; struct list_head anon_vma_chain ; struct anon_vma *anon_vma ; struct vm_operations_struct const *vm_ops ; unsigned long vm_pgoff ; struct file *vm_file ; void *vm_private_data ; struct mempolicy *vm_policy ; }; struct core_thread { struct task_struct *task ; struct core_thread *next ; }; struct core_state { atomic_t nr_threads ; struct core_thread dumper ; struct completion startup ; }; struct task_rss_stat { int events ; int count[3U] ; }; struct mm_rss_stat { atomic_long_t count[3U] ; }; struct kioctx_table; struct linux_binfmt; struct mmu_notifier_mm; struct mm_struct { struct vm_area_struct *mmap ; struct rb_root mm_rb ; u32 vmacache_seqnum ; unsigned long (*get_unmapped_area)(struct file * , unsigned long , unsigned long , unsigned long , unsigned long ) ; unsigned long mmap_base ; unsigned long mmap_legacy_base ; unsigned long task_size ; unsigned long highest_vm_end ; pgd_t *pgd ; atomic_t mm_users ; atomic_t mm_count ; atomic_long_t nr_ptes ; atomic_long_t nr_pmds ; int map_count ; spinlock_t page_table_lock ; struct rw_semaphore mmap_sem ; struct list_head mmlist ; unsigned long hiwater_rss ; unsigned long hiwater_vm ; unsigned long total_vm ; unsigned long locked_vm ; unsigned long pinned_vm ; unsigned long shared_vm ; unsigned long exec_vm ; unsigned long stack_vm ; unsigned long def_flags ; unsigned long start_code ; unsigned long end_code ; unsigned long start_data ; unsigned long end_data ; unsigned long start_brk ; unsigned long brk ; unsigned long start_stack ; unsigned long arg_start ; unsigned long arg_end ; unsigned long env_start ; unsigned long env_end ; unsigned long saved_auxv[46U] ; struct mm_rss_stat rss_stat ; struct linux_binfmt *binfmt ; cpumask_var_t cpu_vm_mask_var ; mm_context_t context ; unsigned long flags ; struct core_state *core_state ; spinlock_t ioctx_lock ; struct kioctx_table *ioctx_table ; struct task_struct *owner ; struct file *exe_file ; struct mmu_notifier_mm *mmu_notifier_mm ; struct cpumask cpumask_allocation ; unsigned long numa_next_scan ; unsigned long numa_scan_offset ; int numa_scan_seq ; bool tlb_flush_pending ; struct uprobes_state uprobes_state ; void *bd_addr ; }; typedef __u64 Elf64_Addr; typedef __u16 Elf64_Half; typedef __u32 Elf64_Word; typedef __u64 Elf64_Xword; struct elf64_sym { Elf64_Word st_name ; unsigned char st_info ; unsigned char st_other ; Elf64_Half st_shndx ; Elf64_Addr st_value ; Elf64_Xword st_size ; }; typedef struct elf64_sym Elf64_Sym; union __anonunion____missing_field_name_166 { unsigned long bitmap[4U] ; struct callback_head callback_head ; }; struct idr_layer { int prefix ; int layer ; struct idr_layer *ary[256U] ; int count ; union __anonunion____missing_field_name_166 __annonCompField47 ; }; struct idr { struct idr_layer *hint ; struct idr_layer *top ; int layers ; int cur ; spinlock_t lock ; int id_free_cnt ; struct idr_layer *id_free ; }; struct ida_bitmap { long nr_busy ; unsigned long bitmap[15U] ; }; struct ida { struct idr idr ; struct ida_bitmap *free_bitmap ; }; struct dentry; struct iattr; struct super_block; struct file_system_type; struct kernfs_open_node; struct kernfs_iattrs; struct kernfs_root; struct kernfs_elem_dir { unsigned long subdirs ; struct rb_root children ; struct kernfs_root *root ; }; struct kernfs_node; struct kernfs_elem_symlink { struct kernfs_node *target_kn ; }; struct kernfs_ops; struct kernfs_elem_attr { struct kernfs_ops const *ops ; struct kernfs_open_node *open ; loff_t size ; struct kernfs_node *notify_next ; }; union __anonunion____missing_field_name_171 { struct kernfs_elem_dir dir ; struct kernfs_elem_symlink symlink ; struct kernfs_elem_attr attr ; }; struct kernfs_node { atomic_t count ; atomic_t active ; struct lockdep_map dep_map ; struct kernfs_node *parent ; char const *name ; struct rb_node rb ; void const *ns ; unsigned int hash ; union __anonunion____missing_field_name_171 __annonCompField48 ; void *priv ; unsigned short flags ; umode_t mode ; unsigned int ino ; struct kernfs_iattrs *iattr ; }; struct kernfs_syscall_ops { int (*remount_fs)(struct kernfs_root * , int * , char * ) ; int (*show_options)(struct seq_file * , struct kernfs_root * ) ; int (*mkdir)(struct kernfs_node * , char const * , umode_t ) ; int (*rmdir)(struct kernfs_node * ) ; int (*rename)(struct kernfs_node * , struct kernfs_node * , char const * ) ; }; struct kernfs_root { struct kernfs_node *kn ; unsigned int flags ; struct ida ino_ida ; struct kernfs_syscall_ops *syscall_ops ; struct list_head supers ; wait_queue_head_t deactivate_waitq ; }; struct kernfs_open_file { struct kernfs_node *kn ; struct file *file ; void *priv ; struct mutex mutex ; int event ; struct list_head list ; char *prealloc_buf ; size_t atomic_write_len ; bool mmapped ; struct vm_operations_struct const *vm_ops ; }; struct kernfs_ops { int (*seq_show)(struct seq_file * , void * ) ; void *(*seq_start)(struct seq_file * , loff_t * ) ; void *(*seq_next)(struct seq_file * , void * , loff_t * ) ; void (*seq_stop)(struct seq_file * , void * ) ; ssize_t (*read)(struct kernfs_open_file * , char * , size_t , loff_t ) ; size_t atomic_write_len ; bool prealloc ; ssize_t (*write)(struct kernfs_open_file * , char * , size_t , loff_t ) ; int (*mmap)(struct kernfs_open_file * , struct vm_area_struct * ) ; struct lock_class_key lockdep_key ; }; struct sock; struct kobject; enum kobj_ns_type { KOBJ_NS_TYPE_NONE = 0, KOBJ_NS_TYPE_NET = 1, KOBJ_NS_TYPES = 2 } ; struct kobj_ns_type_operations { enum kobj_ns_type type ; bool (*current_may_mount)(void) ; void *(*grab_current_ns)(void) ; void const *(*netlink_ns)(struct sock * ) ; void const *(*initial_ns)(void) ; void (*drop_ns)(void * ) ; }; struct bin_attribute; struct attribute { char const *name ; umode_t mode ; bool ignore_lockdep ; struct lock_class_key *key ; struct lock_class_key skey ; }; struct attribute_group { char const *name ; umode_t (*is_visible)(struct kobject * , struct attribute * , int ) ; struct attribute **attrs ; struct bin_attribute **bin_attrs ; }; struct bin_attribute { struct attribute attr ; size_t size ; void *private ; ssize_t (*read)(struct file * , struct kobject * , struct bin_attribute * , char * , loff_t , size_t ) ; ssize_t (*write)(struct file * , struct kobject * , struct bin_attribute * , char * , loff_t , size_t ) ; int (*mmap)(struct file * , struct kobject * , struct bin_attribute * , struct vm_area_struct * ) ; }; struct sysfs_ops { ssize_t (*show)(struct kobject * , struct attribute * , char * ) ; ssize_t (*store)(struct kobject * , struct attribute * , char const * , size_t ) ; }; struct kref { atomic_t refcount ; }; struct kset; struct kobj_type; struct kobject { char const *name ; struct list_head entry ; struct kobject *parent ; struct kset *kset ; struct kobj_type *ktype ; struct kernfs_node *sd ; struct kref kref ; struct delayed_work release ; unsigned char state_initialized : 1 ; unsigned char state_in_sysfs : 1 ; unsigned char state_add_uevent_sent : 1 ; unsigned char state_remove_uevent_sent : 1 ; unsigned char uevent_suppress : 1 ; }; struct kobj_type { void (*release)(struct kobject * ) ; struct sysfs_ops const *sysfs_ops ; struct attribute **default_attrs ; struct kobj_ns_type_operations const *(*child_ns_type)(struct kobject * ) ; void const *(*namespace)(struct kobject * ) ; }; struct kobj_uevent_env { char *argv[3U] ; char *envp[32U] ; int envp_idx ; char buf[2048U] ; int buflen ; }; struct kset_uevent_ops { int (* const filter)(struct kset * , struct kobject * ) ; char const *(* const name)(struct kset * , struct kobject * ) ; int (* const uevent)(struct kset * , struct kobject * , struct kobj_uevent_env * ) ; }; struct kset { struct list_head list ; spinlock_t list_lock ; struct kobject kobj ; struct kset_uevent_ops const *uevent_ops ; }; struct kernel_param; struct kernel_param_ops { unsigned int flags ; int (*set)(char const * , struct kernel_param const * ) ; int (*get)(char * , struct kernel_param const * ) ; void (*free)(void * ) ; }; struct kparam_string; struct kparam_array; union __anonunion____missing_field_name_172 { void *arg ; struct kparam_string const *str ; struct kparam_array const *arr ; }; struct kernel_param { char const *name ; struct module *mod ; struct kernel_param_ops const *ops ; u16 const perm ; s8 level ; u8 flags ; union __anonunion____missing_field_name_172 __annonCompField49 ; }; struct kparam_string { unsigned int maxlen ; char *string ; }; struct kparam_array { unsigned int max ; unsigned int elemsize ; unsigned int *num ; struct kernel_param_ops const *ops ; void *elem ; }; struct latch_tree_node { struct rb_node node[2U] ; }; struct mod_arch_specific { }; struct module_param_attrs; struct module_kobject { struct kobject kobj ; struct module *mod ; struct kobject *drivers_dir ; struct module_param_attrs *mp ; struct completion *kobj_completion ; }; struct module_attribute { struct attribute attr ; ssize_t (*show)(struct module_attribute * , struct module_kobject * , char * ) ; ssize_t (*store)(struct module_attribute * , struct module_kobject * , char const * , size_t ) ; void (*setup)(struct module * , char const * ) ; int (*test)(struct module * ) ; void (*free)(struct module * ) ; }; struct exception_table_entry; enum module_state { MODULE_STATE_LIVE = 0, MODULE_STATE_COMING = 1, MODULE_STATE_GOING = 2, MODULE_STATE_UNFORMED = 3 } ; struct mod_tree_node { struct module *mod ; struct latch_tree_node node ; }; struct module_sect_attrs; struct module_notes_attrs; struct tracepoint; struct trace_event_call; struct trace_enum_map; struct module { enum module_state state ; struct list_head list ; char name[56U] ; struct module_kobject mkobj ; struct module_attribute *modinfo_attrs ; char const *version ; char const *srcversion ; struct kobject *holders_dir ; struct kernel_symbol const *syms ; unsigned long const *crcs ; unsigned int num_syms ; struct mutex param_lock ; struct kernel_param *kp ; unsigned int num_kp ; unsigned int num_gpl_syms ; struct kernel_symbol const *gpl_syms ; unsigned long const *gpl_crcs ; struct kernel_symbol const *unused_syms ; unsigned long const *unused_crcs ; unsigned int num_unused_syms ; unsigned int num_unused_gpl_syms ; struct kernel_symbol const *unused_gpl_syms ; unsigned long const *unused_gpl_crcs ; bool sig_ok ; bool async_probe_requested ; struct kernel_symbol const *gpl_future_syms ; unsigned long const *gpl_future_crcs ; unsigned int num_gpl_future_syms ; unsigned int num_exentries ; struct exception_table_entry *extable ; int (*init)(void) ; void *module_init ; void *module_core ; unsigned int init_size ; unsigned int core_size ; unsigned int init_text_size ; unsigned int core_text_size ; struct mod_tree_node mtn_core ; struct mod_tree_node mtn_init ; unsigned int init_ro_size ; unsigned int core_ro_size ; struct mod_arch_specific arch ; unsigned int taints ; unsigned int num_bugs ; struct list_head bug_list ; struct bug_entry *bug_table ; Elf64_Sym *symtab ; Elf64_Sym *core_symtab ; unsigned int num_symtab ; unsigned int core_num_syms ; char *strtab ; char *core_strtab ; struct module_sect_attrs *sect_attrs ; struct module_notes_attrs *notes_attrs ; char *args ; void *percpu ; unsigned int percpu_size ; unsigned int num_tracepoints ; struct tracepoint * const *tracepoints_ptrs ; unsigned int num_trace_bprintk_fmt ; char const **trace_bprintk_fmt_start ; struct trace_event_call **trace_events ; unsigned int num_trace_events ; struct trace_enum_map **trace_enums ; unsigned int num_trace_enums ; unsigned int num_ftrace_callsites ; unsigned long *ftrace_callsites ; bool klp_alive ; struct list_head source_list ; struct list_head target_list ; void (*exit)(void) ; atomic_t refcnt ; ctor_fn_t (**ctors)(void) ; unsigned int num_ctors ; }; struct kernel_cap_struct { __u32 cap[2U] ; }; typedef struct kernel_cap_struct kernel_cap_t; struct plist_node { int prio ; struct list_head prio_list ; struct list_head node_list ; }; typedef unsigned long cputime_t; struct sem_undo_list; struct sysv_sem { struct sem_undo_list *undo_list ; }; struct user_struct; struct sysv_shm { struct list_head shm_clist ; }; struct __anonstruct_sigset_t_180 { unsigned long sig[1U] ; }; typedef struct __anonstruct_sigset_t_180 sigset_t; struct siginfo; typedef void __signalfn_t(int ); typedef __signalfn_t *__sighandler_t; typedef void __restorefn_t(void); typedef __restorefn_t *__sigrestore_t; union sigval { int sival_int ; void *sival_ptr ; }; typedef union sigval sigval_t; struct __anonstruct__kill_182 { __kernel_pid_t _pid ; __kernel_uid32_t _uid ; }; struct __anonstruct__timer_183 { __kernel_timer_t _tid ; int _overrun ; char _pad[0U] ; sigval_t _sigval ; int _sys_private ; }; struct __anonstruct__rt_184 { __kernel_pid_t _pid ; __kernel_uid32_t _uid ; sigval_t _sigval ; }; struct __anonstruct__sigchld_185 { __kernel_pid_t _pid ; __kernel_uid32_t _uid ; int _status ; __kernel_clock_t _utime ; __kernel_clock_t _stime ; }; struct __anonstruct__addr_bnd_187 { void *_lower ; void *_upper ; }; struct __anonstruct__sigfault_186 { void *_addr ; short _addr_lsb ; struct __anonstruct__addr_bnd_187 _addr_bnd ; }; struct __anonstruct__sigpoll_188 { long _band ; int _fd ; }; struct __anonstruct__sigsys_189 { void *_call_addr ; int _syscall ; unsigned int _arch ; }; union __anonunion__sifields_181 { int _pad[28U] ; struct __anonstruct__kill_182 _kill ; struct __anonstruct__timer_183 _timer ; struct __anonstruct__rt_184 _rt ; struct __anonstruct__sigchld_185 _sigchld ; struct __anonstruct__sigfault_186 _sigfault ; struct __anonstruct__sigpoll_188 _sigpoll ; struct __anonstruct__sigsys_189 _sigsys ; }; struct siginfo { int si_signo ; int si_errno ; int si_code ; union __anonunion__sifields_181 _sifields ; }; typedef struct siginfo siginfo_t; struct sigpending { struct list_head list ; sigset_t signal ; }; struct sigaction { __sighandler_t sa_handler ; unsigned long sa_flags ; __sigrestore_t sa_restorer ; sigset_t sa_mask ; }; struct k_sigaction { struct sigaction sa ; }; enum pid_type { PIDTYPE_PID = 0, PIDTYPE_PGID = 1, PIDTYPE_SID = 2, PIDTYPE_MAX = 3 } ; struct pid_namespace; struct upid { int nr ; struct pid_namespace *ns ; struct hlist_node pid_chain ; }; struct pid { atomic_t count ; unsigned int level ; struct hlist_head tasks[3U] ; struct callback_head rcu ; struct upid numbers[1U] ; }; struct pid_link { struct hlist_node node ; struct pid *pid ; }; struct percpu_counter { raw_spinlock_t lock ; s64 count ; struct list_head list ; s32 *counters ; }; struct seccomp_filter; struct seccomp { int mode ; struct seccomp_filter *filter ; }; struct rt_mutex_waiter; struct rlimit { __kernel_ulong_t rlim_cur ; __kernel_ulong_t rlim_max ; }; struct timerqueue_node { struct rb_node node ; ktime_t expires ; }; struct timerqueue_head { struct rb_root head ; struct timerqueue_node *next ; }; struct hrtimer_clock_base; struct hrtimer_cpu_base; enum hrtimer_restart { HRTIMER_NORESTART = 0, HRTIMER_RESTART = 1 } ; struct hrtimer { struct timerqueue_node node ; ktime_t _softexpires ; enum hrtimer_restart (*function)(struct hrtimer * ) ; struct hrtimer_clock_base *base ; unsigned long state ; int start_pid ; void *start_site ; char start_comm[16U] ; }; struct hrtimer_clock_base { struct hrtimer_cpu_base *cpu_base ; int index ; clockid_t clockid ; struct timerqueue_head active ; ktime_t (*get_time)(void) ; ktime_t offset ; }; struct hrtimer_cpu_base { raw_spinlock_t lock ; seqcount_t seq ; struct hrtimer *running ; unsigned int cpu ; unsigned int active_bases ; unsigned int clock_was_set_seq ; bool migration_enabled ; bool nohz_active ; unsigned char in_hrtirq : 1 ; unsigned char hres_active : 1 ; unsigned char hang_detected : 1 ; ktime_t expires_next ; struct hrtimer *next_timer ; unsigned int nr_events ; unsigned int nr_retries ; unsigned int nr_hangs ; unsigned int max_hang_time ; struct hrtimer_clock_base clock_base[4U] ; }; struct task_io_accounting { u64 rchar ; u64 wchar ; u64 syscr ; u64 syscw ; u64 read_bytes ; u64 write_bytes ; u64 cancelled_write_bytes ; }; struct latency_record { unsigned long backtrace[12U] ; unsigned int count ; unsigned long time ; unsigned long max ; }; struct assoc_array_ptr; struct assoc_array { struct assoc_array_ptr *root ; unsigned long nr_leaves_on_tree ; }; typedef int32_t key_serial_t; typedef uint32_t key_perm_t; struct key; struct signal_struct; struct key_type; struct keyring_index_key { struct key_type *type ; char const *description ; size_t desc_len ; }; union __anonunion____missing_field_name_196 { struct list_head graveyard_link ; struct rb_node serial_node ; }; struct key_user; union __anonunion____missing_field_name_197 { time_t expiry ; time_t revoked_at ; }; struct __anonstruct____missing_field_name_199 { struct key_type *type ; char *description ; }; union __anonunion____missing_field_name_198 { struct keyring_index_key index_key ; struct __anonstruct____missing_field_name_199 __annonCompField52 ; }; union __anonunion_type_data_200 { struct list_head link ; unsigned long x[2U] ; void *p[2U] ; int reject_error ; }; union __anonunion_payload_202 { unsigned long value ; void *rcudata ; void *data ; void *data2[2U] ; }; union __anonunion____missing_field_name_201 { union __anonunion_payload_202 payload ; struct assoc_array keys ; }; struct key { atomic_t usage ; key_serial_t serial ; union __anonunion____missing_field_name_196 __annonCompField50 ; struct rw_semaphore sem ; struct key_user *user ; void *security ; union __anonunion____missing_field_name_197 __annonCompField51 ; time_t last_used_at ; kuid_t uid ; kgid_t gid ; key_perm_t perm ; unsigned short quotalen ; unsigned short datalen ; unsigned long flags ; union __anonunion____missing_field_name_198 __annonCompField53 ; union __anonunion_type_data_200 type_data ; union __anonunion____missing_field_name_201 __annonCompField54 ; }; struct audit_context; struct group_info { atomic_t usage ; int ngroups ; int nblocks ; kgid_t small_block[32U] ; kgid_t *blocks[0U] ; }; struct cred { atomic_t usage ; atomic_t subscribers ; void *put_addr ; unsigned int magic ; kuid_t uid ; kgid_t gid ; kuid_t suid ; kgid_t sgid ; kuid_t euid ; kgid_t egid ; kuid_t fsuid ; kgid_t fsgid ; unsigned int securebits ; kernel_cap_t cap_inheritable ; kernel_cap_t cap_permitted ; kernel_cap_t cap_effective ; kernel_cap_t cap_bset ; unsigned char jit_keyring ; struct key *session_keyring ; struct key *process_keyring ; struct key *thread_keyring ; struct key *request_key_auth ; void *security ; struct user_struct *user ; struct user_namespace *user_ns ; struct group_info *group_info ; struct callback_head rcu ; }; struct percpu_ref; typedef void percpu_ref_func_t(struct percpu_ref * ); struct percpu_ref { atomic_long_t count ; unsigned long percpu_count_ptr ; percpu_ref_func_t *release ; percpu_ref_func_t *confirm_switch ; bool force_atomic ; struct callback_head rcu ; }; struct cgroup; struct cgroup_root; struct cgroup_subsys; struct cgroup_taskset; struct cgroup_subsys_state { struct cgroup *cgroup ; struct cgroup_subsys *ss ; struct percpu_ref refcnt ; struct cgroup_subsys_state *parent ; struct list_head sibling ; struct list_head children ; int id ; unsigned int flags ; u64 serial_nr ; struct callback_head callback_head ; struct work_struct destroy_work ; }; struct css_set { atomic_t refcount ; struct hlist_node hlist ; struct list_head tasks ; struct list_head mg_tasks ; struct list_head cgrp_links ; struct cgroup *dfl_cgrp ; struct cgroup_subsys_state *subsys[12U] ; struct list_head mg_preload_node ; struct list_head mg_node ; struct cgroup *mg_src_cgrp ; struct css_set *mg_dst_cset ; struct list_head e_cset_node[12U] ; struct callback_head callback_head ; }; struct cgroup { struct cgroup_subsys_state self ; unsigned long flags ; int id ; int populated_cnt ; struct kernfs_node *kn ; struct kernfs_node *procs_kn ; struct kernfs_node *populated_kn ; unsigned int subtree_control ; unsigned int child_subsys_mask ; struct cgroup_subsys_state *subsys[12U] ; struct cgroup_root *root ; struct list_head cset_links ; struct list_head e_csets[12U] ; struct list_head pidlists ; struct mutex pidlist_mutex ; wait_queue_head_t offline_waitq ; struct work_struct release_agent_work ; }; struct cgroup_root { struct kernfs_root *kf_root ; unsigned int subsys_mask ; int hierarchy_id ; struct cgroup cgrp ; atomic_t nr_cgrps ; struct list_head root_list ; unsigned int flags ; struct idr cgroup_idr ; char release_agent_path[4096U] ; char name[64U] ; }; struct cftype { char name[64U] ; int private ; umode_t mode ; size_t max_write_len ; unsigned int flags ; struct cgroup_subsys *ss ; struct list_head node ; struct kernfs_ops *kf_ops ; u64 (*read_u64)(struct cgroup_subsys_state * , struct cftype * ) ; s64 (*read_s64)(struct cgroup_subsys_state * , struct cftype * ) ; int (*seq_show)(struct seq_file * , void * ) ; void *(*seq_start)(struct seq_file * , loff_t * ) ; void *(*seq_next)(struct seq_file * , void * , loff_t * ) ; void (*seq_stop)(struct seq_file * , void * ) ; int (*write_u64)(struct cgroup_subsys_state * , struct cftype * , u64 ) ; int (*write_s64)(struct cgroup_subsys_state * , struct cftype * , s64 ) ; ssize_t (*write)(struct kernfs_open_file * , char * , size_t , loff_t ) ; struct lock_class_key lockdep_key ; }; struct cgroup_subsys { struct cgroup_subsys_state *(*css_alloc)(struct cgroup_subsys_state * ) ; int (*css_online)(struct cgroup_subsys_state * ) ; void (*css_offline)(struct cgroup_subsys_state * ) ; void (*css_released)(struct cgroup_subsys_state * ) ; void (*css_free)(struct cgroup_subsys_state * ) ; void (*css_reset)(struct cgroup_subsys_state * ) ; void (*css_e_css_changed)(struct cgroup_subsys_state * ) ; int (*can_attach)(struct cgroup_subsys_state * , struct cgroup_taskset * ) ; void (*cancel_attach)(struct cgroup_subsys_state * , struct cgroup_taskset * ) ; void (*attach)(struct cgroup_subsys_state * , struct cgroup_taskset * ) ; void (*fork)(struct task_struct * ) ; void (*exit)(struct cgroup_subsys_state * , struct cgroup_subsys_state * , struct task_struct * ) ; void (*bind)(struct cgroup_subsys_state * ) ; int disabled ; int early_init ; bool broken_hierarchy ; bool warned_broken_hierarchy ; int id ; char const *name ; struct cgroup_root *root ; struct idr css_idr ; struct list_head cfts ; struct cftype *dfl_cftypes ; struct cftype *legacy_cftypes ; unsigned int depends_on ; }; struct futex_pi_state; struct robust_list_head; struct bio_list; struct fs_struct; struct perf_event_context; struct blk_plug; struct nameidata; struct cfs_rq; struct task_group; struct sighand_struct { atomic_t count ; struct k_sigaction action[64U] ; spinlock_t siglock ; wait_queue_head_t signalfd_wqh ; }; struct pacct_struct { int ac_flag ; long ac_exitcode ; unsigned long ac_mem ; cputime_t ac_utime ; cputime_t ac_stime ; unsigned long ac_minflt ; unsigned long ac_majflt ; }; struct cpu_itimer { cputime_t expires ; cputime_t incr ; u32 error ; u32 incr_error ; }; struct cputime { cputime_t utime ; cputime_t stime ; }; struct task_cputime { cputime_t utime ; cputime_t stime ; unsigned long long sum_exec_runtime ; }; struct task_cputime_atomic { atomic64_t utime ; atomic64_t stime ; atomic64_t sum_exec_runtime ; }; struct thread_group_cputimer { struct task_cputime_atomic cputime_atomic ; int running ; }; struct autogroup; struct tty_struct; struct taskstats; struct tty_audit_buf; struct signal_struct { atomic_t sigcnt ; atomic_t live ; int nr_threads ; struct list_head thread_head ; wait_queue_head_t wait_chldexit ; struct task_struct *curr_target ; struct sigpending shared_pending ; int group_exit_code ; int notify_count ; struct task_struct *group_exit_task ; int group_stop_count ; unsigned int flags ; unsigned char is_child_subreaper : 1 ; unsigned char has_child_subreaper : 1 ; int posix_timer_id ; struct list_head posix_timers ; struct hrtimer real_timer ; struct pid *leader_pid ; ktime_t it_real_incr ; struct cpu_itimer it[2U] ; struct thread_group_cputimer cputimer ; struct task_cputime cputime_expires ; struct list_head cpu_timers[3U] ; struct pid *tty_old_pgrp ; int leader ; struct tty_struct *tty ; struct autogroup *autogroup ; seqlock_t stats_lock ; cputime_t utime ; cputime_t stime ; cputime_t cutime ; cputime_t cstime ; cputime_t gtime ; cputime_t cgtime ; struct cputime prev_cputime ; unsigned long nvcsw ; unsigned long nivcsw ; unsigned long cnvcsw ; unsigned long cnivcsw ; unsigned long min_flt ; unsigned long maj_flt ; unsigned long cmin_flt ; unsigned long cmaj_flt ; unsigned long inblock ; unsigned long oublock ; unsigned long cinblock ; unsigned long coublock ; unsigned long maxrss ; unsigned long cmaxrss ; struct task_io_accounting ioac ; unsigned long long sum_sched_runtime ; struct rlimit rlim[16U] ; struct pacct_struct pacct ; struct taskstats *stats ; unsigned int audit_tty ; unsigned int audit_tty_log_passwd ; struct tty_audit_buf *tty_audit_buf ; oom_flags_t oom_flags ; short oom_score_adj ; short oom_score_adj_min ; struct mutex cred_guard_mutex ; }; struct user_struct { atomic_t __count ; atomic_t processes ; atomic_t sigpending ; atomic_t inotify_watches ; atomic_t inotify_devs ; atomic_t fanotify_listeners ; atomic_long_t epoll_watches ; unsigned long mq_bytes ; unsigned long locked_shm ; struct key *uid_keyring ; struct key *session_keyring ; struct hlist_node uidhash_node ; kuid_t uid ; atomic_long_t locked_vm ; }; struct backing_dev_info; struct reclaim_state; struct sched_info { unsigned long pcount ; unsigned long long run_delay ; unsigned long long last_arrival ; unsigned long long last_queued ; }; struct task_delay_info { spinlock_t lock ; unsigned int flags ; u64 blkio_start ; u64 blkio_delay ; u64 swapin_delay ; u32 blkio_count ; u32 swapin_count ; u64 freepages_start ; u64 freepages_delay ; u32 freepages_count ; }; struct wake_q_node { struct wake_q_node *next ; }; struct io_context; struct pipe_inode_info; struct uts_namespace; struct load_weight { unsigned long weight ; u32 inv_weight ; }; struct sched_avg { u64 last_runnable_update ; s64 decay_count ; unsigned long load_avg_contrib ; unsigned long utilization_avg_contrib ; u32 runnable_avg_sum ; u32 avg_period ; u32 running_avg_sum ; }; struct sched_statistics { u64 wait_start ; u64 wait_max ; u64 wait_count ; u64 wait_sum ; u64 iowait_count ; u64 iowait_sum ; u64 sleep_start ; u64 sleep_max ; s64 sum_sleep_runtime ; u64 block_start ; u64 block_max ; u64 exec_max ; u64 slice_max ; u64 nr_migrations_cold ; u64 nr_failed_migrations_affine ; u64 nr_failed_migrations_running ; u64 nr_failed_migrations_hot ; u64 nr_forced_migrations ; u64 nr_wakeups ; u64 nr_wakeups_sync ; u64 nr_wakeups_migrate ; u64 nr_wakeups_local ; u64 nr_wakeups_remote ; u64 nr_wakeups_affine ; u64 nr_wakeups_affine_attempts ; u64 nr_wakeups_passive ; u64 nr_wakeups_idle ; }; struct sched_entity { struct load_weight load ; struct rb_node run_node ; struct list_head group_node ; unsigned int on_rq ; u64 exec_start ; u64 sum_exec_runtime ; u64 vruntime ; u64 prev_sum_exec_runtime ; u64 nr_migrations ; struct sched_statistics statistics ; int depth ; struct sched_entity *parent ; struct cfs_rq *cfs_rq ; struct cfs_rq *my_q ; struct sched_avg avg ; }; struct rt_rq; struct sched_rt_entity { struct list_head run_list ; unsigned long timeout ; unsigned long watchdog_stamp ; unsigned int time_slice ; struct sched_rt_entity *back ; struct sched_rt_entity *parent ; struct rt_rq *rt_rq ; struct rt_rq *my_q ; }; struct sched_dl_entity { struct rb_node rb_node ; u64 dl_runtime ; u64 dl_deadline ; u64 dl_period ; u64 dl_bw ; s64 runtime ; u64 deadline ; unsigned int flags ; int dl_throttled ; int dl_new ; int dl_boosted ; int dl_yielded ; struct hrtimer dl_timer ; }; struct memcg_oom_info { struct mem_cgroup *memcg ; gfp_t gfp_mask ; int order ; unsigned char may_oom : 1 ; }; struct sched_class; struct files_struct; struct compat_robust_list_head; struct numa_group; struct ftrace_ret_stack; struct task_struct { long volatile state ; void *stack ; atomic_t usage ; unsigned int flags ; unsigned int ptrace ; struct llist_node wake_entry ; int on_cpu ; struct task_struct *last_wakee ; unsigned long wakee_flips ; unsigned long wakee_flip_decay_ts ; int wake_cpu ; int on_rq ; int prio ; int static_prio ; int normal_prio ; unsigned int rt_priority ; struct sched_class const *sched_class ; struct sched_entity se ; struct sched_rt_entity rt ; struct task_group *sched_task_group ; struct sched_dl_entity dl ; struct hlist_head preempt_notifiers ; unsigned int btrace_seq ; unsigned int policy ; int nr_cpus_allowed ; cpumask_t cpus_allowed ; unsigned long rcu_tasks_nvcsw ; bool rcu_tasks_holdout ; struct list_head rcu_tasks_holdout_list ; int rcu_tasks_idle_cpu ; struct sched_info sched_info ; struct list_head tasks ; struct plist_node pushable_tasks ; struct rb_node pushable_dl_tasks ; struct mm_struct *mm ; struct mm_struct *active_mm ; u32 vmacache_seqnum ; struct vm_area_struct *vmacache[4U] ; struct task_rss_stat rss_stat ; int exit_state ; int exit_code ; int exit_signal ; int pdeath_signal ; unsigned long jobctl ; unsigned int personality ; unsigned char in_execve : 1 ; unsigned char in_iowait : 1 ; unsigned char sched_reset_on_fork : 1 ; unsigned char sched_contributes_to_load : 1 ; unsigned char sched_migrated : 1 ; unsigned char memcg_kmem_skip_account : 1 ; unsigned char brk_randomized : 1 ; unsigned long atomic_flags ; struct restart_block restart_block ; pid_t pid ; pid_t tgid ; struct task_struct *real_parent ; struct task_struct *parent ; struct list_head children ; struct list_head sibling ; struct task_struct *group_leader ; struct list_head ptraced ; struct list_head ptrace_entry ; struct pid_link pids[3U] ; struct list_head thread_group ; struct list_head thread_node ; struct completion *vfork_done ; int *set_child_tid ; int *clear_child_tid ; cputime_t utime ; cputime_t stime ; cputime_t utimescaled ; cputime_t stimescaled ; cputime_t gtime ; struct cputime prev_cputime ; unsigned long nvcsw ; unsigned long nivcsw ; u64 start_time ; u64 real_start_time ; unsigned long min_flt ; unsigned long maj_flt ; struct task_cputime cputime_expires ; struct list_head cpu_timers[3U] ; struct cred const *real_cred ; struct cred const *cred ; char comm[16U] ; struct nameidata *nameidata ; struct sysv_sem sysvsem ; struct sysv_shm sysvshm ; unsigned long last_switch_count ; struct thread_struct thread ; struct fs_struct *fs ; struct files_struct *files ; struct nsproxy *nsproxy ; struct signal_struct *signal ; struct sighand_struct *sighand ; sigset_t blocked ; sigset_t real_blocked ; sigset_t saved_sigmask ; struct sigpending pending ; unsigned long sas_ss_sp ; size_t sas_ss_size ; int (*notifier)(void * ) ; void *notifier_data ; sigset_t *notifier_mask ; struct callback_head *task_works ; struct audit_context *audit_context ; kuid_t loginuid ; unsigned int sessionid ; struct seccomp seccomp ; u32 parent_exec_id ; u32 self_exec_id ; spinlock_t alloc_lock ; raw_spinlock_t pi_lock ; struct wake_q_node wake_q ; struct rb_root pi_waiters ; struct rb_node *pi_waiters_leftmost ; struct rt_mutex_waiter *pi_blocked_on ; struct mutex_waiter *blocked_on ; unsigned int irq_events ; unsigned long hardirq_enable_ip ; unsigned long hardirq_disable_ip ; unsigned int hardirq_enable_event ; unsigned int hardirq_disable_event ; int hardirqs_enabled ; int hardirq_context ; unsigned long softirq_disable_ip ; unsigned long softirq_enable_ip ; unsigned int softirq_disable_event ; unsigned int softirq_enable_event ; int softirqs_enabled ; int softirq_context ; u64 curr_chain_key ; int lockdep_depth ; unsigned int lockdep_recursion ; struct held_lock held_locks[48U] ; gfp_t lockdep_reclaim_gfp ; void *journal_info ; struct bio_list *bio_list ; struct blk_plug *plug ; struct reclaim_state *reclaim_state ; struct backing_dev_info *backing_dev_info ; struct io_context *io_context ; unsigned long ptrace_message ; siginfo_t *last_siginfo ; struct task_io_accounting ioac ; u64 acct_rss_mem1 ; u64 acct_vm_mem1 ; cputime_t acct_timexpd ; nodemask_t mems_allowed ; seqcount_t mems_allowed_seq ; int cpuset_mem_spread_rotor ; int cpuset_slab_spread_rotor ; struct css_set *cgroups ; struct list_head cg_list ; struct robust_list_head *robust_list ; struct compat_robust_list_head *compat_robust_list ; struct list_head pi_state_list ; struct futex_pi_state *pi_state_cache ; struct perf_event_context *perf_event_ctxp[2U] ; struct mutex perf_event_mutex ; struct list_head perf_event_list ; struct mempolicy *mempolicy ; short il_next ; short pref_node_fork ; int numa_scan_seq ; unsigned int numa_scan_period ; unsigned int numa_scan_period_max ; int numa_preferred_nid ; unsigned long numa_migrate_retry ; u64 node_stamp ; u64 last_task_numa_placement ; u64 last_sum_exec_runtime ; struct callback_head numa_work ; struct list_head numa_entry ; struct numa_group *numa_group ; unsigned long *numa_faults ; unsigned long total_numa_faults ; unsigned long numa_faults_locality[3U] ; unsigned long numa_pages_migrated ; struct callback_head rcu ; struct pipe_inode_info *splice_pipe ; struct page_frag task_frag ; struct task_delay_info *delays ; int make_it_fail ; int nr_dirtied ; int nr_dirtied_pause ; unsigned long dirty_paused_when ; int latency_record_count ; struct latency_record latency_record[32U] ; unsigned long timer_slack_ns ; unsigned long default_timer_slack_ns ; unsigned int kasan_depth ; int curr_ret_stack ; struct ftrace_ret_stack *ret_stack ; unsigned long long ftrace_timestamp ; atomic_t trace_overrun ; atomic_t tracing_graph_pause ; unsigned long trace ; unsigned long trace_recursion ; struct memcg_oom_info memcg_oom ; struct uprobe_task *utask ; unsigned int sequential_io ; unsigned int sequential_io_avg ; unsigned long task_state_change ; int pagefault_disabled ; }; struct ieee80211_hw; struct ath_common; struct klist_node; struct klist_node { void *n_klist ; struct list_head n_node ; struct kref n_ref ; }; struct path; struct seq_file { char *buf ; size_t size ; size_t from ; size_t count ; size_t pad_until ; loff_t index ; loff_t read_pos ; u64 version ; struct mutex lock ; struct seq_operations const *op ; int poll_event ; struct user_namespace *user_ns ; void *private ; }; struct seq_operations { void *(*start)(struct seq_file * , loff_t * ) ; void (*stop)(struct seq_file * , void * ) ; void *(*next)(struct seq_file * , void * , loff_t * ) ; int (*show)(struct seq_file * , void * ) ; }; struct pinctrl; struct pinctrl_state; struct dev_pin_info { struct pinctrl *p ; struct pinctrl_state *default_state ; struct pinctrl_state *sleep_state ; struct pinctrl_state *idle_state ; }; struct dma_map_ops; struct dev_archdata { struct dma_map_ops *dma_ops ; void *iommu ; }; struct device_private; struct device_driver; struct driver_private; struct class; struct subsys_private; struct bus_type; struct device_node; struct fwnode_handle; struct iommu_ops; struct iommu_group; struct device_attribute; struct bus_type { char const *name ; char const *dev_name ; struct device *dev_root ; struct device_attribute *dev_attrs ; struct attribute_group const **bus_groups ; struct attribute_group const **dev_groups ; struct attribute_group const **drv_groups ; int (*match)(struct device * , struct device_driver * ) ; int (*uevent)(struct device * , struct kobj_uevent_env * ) ; int (*probe)(struct device * ) ; int (*remove)(struct device * ) ; void (*shutdown)(struct device * ) ; int (*online)(struct device * ) ; int (*offline)(struct device * ) ; int (*suspend)(struct device * , pm_message_t ) ; int (*resume)(struct device * ) ; struct dev_pm_ops const *pm ; struct iommu_ops const *iommu_ops ; struct subsys_private *p ; struct lock_class_key lock_key ; }; struct device_type; enum probe_type { PROBE_DEFAULT_STRATEGY = 0, PROBE_PREFER_ASYNCHRONOUS = 1, PROBE_FORCE_SYNCHRONOUS = 2 } ; struct of_device_id; struct acpi_device_id; struct device_driver { char const *name ; struct bus_type *bus ; struct module *owner ; char const *mod_name ; bool suppress_bind_attrs ; enum probe_type probe_type ; struct of_device_id const *of_match_table ; struct acpi_device_id const *acpi_match_table ; int (*probe)(struct device * ) ; int (*remove)(struct device * ) ; void (*shutdown)(struct device * ) ; int (*suspend)(struct device * , pm_message_t ) ; int (*resume)(struct device * ) ; struct attribute_group const **groups ; struct dev_pm_ops const *pm ; struct driver_private *p ; }; struct class_attribute; struct class { char const *name ; struct module *owner ; struct class_attribute *class_attrs ; struct attribute_group const **dev_groups ; struct kobject *dev_kobj ; int (*dev_uevent)(struct device * , struct kobj_uevent_env * ) ; char *(*devnode)(struct device * , umode_t * ) ; void (*class_release)(struct class * ) ; void (*dev_release)(struct device * ) ; int (*suspend)(struct device * , pm_message_t ) ; int (*resume)(struct device * ) ; struct kobj_ns_type_operations const *ns_type ; void const *(*namespace)(struct device * ) ; struct dev_pm_ops const *pm ; struct subsys_private *p ; }; struct class_attribute { struct attribute attr ; ssize_t (*show)(struct class * , struct class_attribute * , char * ) ; ssize_t (*store)(struct class * , struct class_attribute * , char const * , size_t ) ; }; struct device_type { char const *name ; struct attribute_group const **groups ; int (*uevent)(struct device * , struct kobj_uevent_env * ) ; char *(*devnode)(struct device * , umode_t * , kuid_t * , kgid_t * ) ; void (*release)(struct device * ) ; struct dev_pm_ops const *pm ; }; struct device_attribute { struct attribute attr ; ssize_t (*show)(struct device * , struct device_attribute * , char * ) ; ssize_t (*store)(struct device * , struct device_attribute * , char const * , size_t ) ; }; struct device_dma_parameters { unsigned int max_segment_size ; unsigned long segment_boundary_mask ; }; struct dma_coherent_mem; struct cma; struct device { struct device *parent ; struct device_private *p ; struct kobject kobj ; char const *init_name ; struct device_type const *type ; struct mutex mutex ; struct bus_type *bus ; struct device_driver *driver ; void *platform_data ; void *driver_data ; struct dev_pm_info power ; struct dev_pm_domain *pm_domain ; struct dev_pin_info *pins ; int numa_node ; u64 *dma_mask ; u64 coherent_dma_mask ; unsigned long dma_pfn_offset ; struct device_dma_parameters *dma_parms ; struct list_head dma_pools ; struct dma_coherent_mem *dma_mem ; struct cma *cma_area ; struct dev_archdata archdata ; struct device_node *of_node ; struct fwnode_handle *fwnode ; dev_t devt ; u32 id ; spinlock_t devres_lock ; struct list_head devres_head ; struct klist_node knode_class ; struct class *class ; struct attribute_group const **groups ; void (*release)(struct device * ) ; struct iommu_group *iommu_group ; bool offline_disabled ; bool offline ; }; struct wakeup_source { char const *name ; struct list_head entry ; spinlock_t lock ; struct wake_irq *wakeirq ; struct timer_list timer ; unsigned long timer_expires ; ktime_t total_time ; ktime_t max_time ; ktime_t last_time ; ktime_t start_prevent_time ; ktime_t prevent_sleep_time ; unsigned long event_count ; unsigned long active_count ; unsigned long relax_count ; unsigned long expire_count ; unsigned long wakeup_count ; bool active ; bool autosleep_enabled ; }; struct dma_attrs { unsigned long flags[1U] ; }; enum dma_data_direction { DMA_BIDIRECTIONAL = 0, DMA_TO_DEVICE = 1, DMA_FROM_DEVICE = 2, DMA_NONE = 3 } ; struct shrink_control { gfp_t gfp_mask ; unsigned long nr_to_scan ; int nid ; struct mem_cgroup *memcg ; }; struct shrinker { unsigned long (*count_objects)(struct shrinker * , struct shrink_control * ) ; unsigned long (*scan_objects)(struct shrinker * , struct shrink_control * ) ; int seeks ; long batch ; unsigned long flags ; struct list_head list ; atomic_long_t *nr_deferred ; }; struct file_ra_state; struct writeback_control; struct bdi_writeback; struct vm_fault { unsigned int flags ; unsigned long pgoff ; void *virtual_address ; struct page *cow_page ; struct page *page ; unsigned long max_pgoff ; pte_t *pte ; }; struct vm_operations_struct { void (*open)(struct vm_area_struct * ) ; void (*close)(struct vm_area_struct * ) ; int (*fault)(struct vm_area_struct * , struct vm_fault * ) ; void (*map_pages)(struct vm_area_struct * , struct vm_fault * ) ; int (*page_mkwrite)(struct vm_area_struct * , struct vm_fault * ) ; int (*pfn_mkwrite)(struct vm_area_struct * , struct vm_fault * ) ; int (*access)(struct vm_area_struct * , unsigned long , void * , int , int ) ; char const *(*name)(struct vm_area_struct * ) ; int (*set_policy)(struct vm_area_struct * , struct mempolicy * ) ; struct mempolicy *(*get_policy)(struct vm_area_struct * , unsigned long ) ; struct page *(*find_special_page)(struct vm_area_struct * , unsigned long ) ; }; struct kvec; struct scatterlist { unsigned long sg_magic ; unsigned long page_link ; unsigned int offset ; unsigned int length ; dma_addr_t dma_address ; unsigned int dma_length ; }; struct sg_table { struct scatterlist *sgl ; unsigned int nents ; unsigned int orig_nents ; }; struct dma_map_ops { void *(*alloc)(struct device * , size_t , dma_addr_t * , gfp_t , struct dma_attrs * ) ; void (*free)(struct device * , size_t , void * , dma_addr_t , struct dma_attrs * ) ; int (*mmap)(struct device * , struct vm_area_struct * , void * , dma_addr_t , size_t , struct dma_attrs * ) ; int (*get_sgtable)(struct device * , struct sg_table * , void * , dma_addr_t , size_t , struct dma_attrs * ) ; dma_addr_t (*map_page)(struct device * , struct page * , unsigned long , size_t , enum dma_data_direction , struct dma_attrs * ) ; void (*unmap_page)(struct device * , dma_addr_t , size_t , enum dma_data_direction , struct dma_attrs * ) ; int (*map_sg)(struct device * , struct scatterlist * , int , enum dma_data_direction , struct dma_attrs * ) ; void (*unmap_sg)(struct device * , struct scatterlist * , int , enum dma_data_direction , struct dma_attrs * ) ; void (*sync_single_for_cpu)(struct device * , dma_addr_t , size_t , enum dma_data_direction ) ; void (*sync_single_for_device)(struct device * , dma_addr_t , size_t , enum dma_data_direction ) ; void (*sync_sg_for_cpu)(struct device * , struct scatterlist * , int , enum dma_data_direction ) ; void (*sync_sg_for_device)(struct device * , struct scatterlist * , int , enum dma_data_direction ) ; int (*mapping_error)(struct device * , dma_addr_t ) ; int (*dma_supported)(struct device * , u64 ) ; int (*set_dma_mask)(struct device * , u64 ) ; int is_phys ; }; struct iovec { void *iov_base ; __kernel_size_t iov_len ; }; struct kvec { void *iov_base ; size_t iov_len ; }; union __anonunion____missing_field_name_217 { struct iovec const *iov ; struct kvec const *kvec ; struct bio_vec const *bvec ; }; struct iov_iter { int type ; size_t iov_offset ; size_t count ; union __anonunion____missing_field_name_217 __annonCompField58 ; unsigned long nr_segs ; }; typedef unsigned short __kernel_sa_family_t; typedef __kernel_sa_family_t sa_family_t; struct sockaddr { sa_family_t sa_family ; char sa_data[14U] ; }; struct kiocb; struct msghdr { void *msg_name ; int msg_namelen ; struct iov_iter msg_iter ; void *msg_control ; __kernel_size_t msg_controllen ; unsigned int msg_flags ; struct kiocb *msg_iocb ; }; enum ldv_21447 { SS_FREE = 0, SS_UNCONNECTED = 1, SS_CONNECTING = 2, SS_CONNECTED = 3, SS_DISCONNECTING = 4 } ; typedef enum ldv_21447 socket_state; struct poll_table_struct; struct net; struct fasync_struct; struct socket_wq { wait_queue_head_t wait ; struct fasync_struct *fasync_list ; struct callback_head rcu ; }; struct proto_ops; struct socket { socket_state state ; short type ; unsigned long flags ; struct socket_wq *wq ; struct file *file ; struct sock *sk ; struct proto_ops const *ops ; }; struct proto_ops { int family ; struct module *owner ; int (*release)(struct socket * ) ; int (*bind)(struct socket * , struct sockaddr * , int ) ; int (*connect)(struct socket * , struct sockaddr * , int , int ) ; int (*socketpair)(struct socket * , struct socket * ) ; int (*accept)(struct socket * , struct socket * , int ) ; int (*getname)(struct socket * , struct sockaddr * , int * , int ) ; unsigned int (*poll)(struct file * , struct socket * , struct poll_table_struct * ) ; int (*ioctl)(struct socket * , unsigned int , unsigned long ) ; int (*compat_ioctl)(struct socket * , unsigned int , unsigned long ) ; int (*listen)(struct socket * , int ) ; int (*shutdown)(struct socket * , int ) ; int (*setsockopt)(struct socket * , int , int , char * , unsigned int ) ; int (*getsockopt)(struct socket * , int , int , char * , int * ) ; int (*compat_setsockopt)(struct socket * , int , int , char * , unsigned int ) ; int (*compat_getsockopt)(struct socket * , int , int , char * , int * ) ; int (*sendmsg)(struct socket * , struct msghdr * , size_t ) ; int (*recvmsg)(struct socket * , struct msghdr * , size_t , int ) ; int (*mmap)(struct file * , struct socket * , struct vm_area_struct * ) ; ssize_t (*sendpage)(struct socket * , struct page * , int , size_t , int ) ; ssize_t (*splice_read)(struct socket * , loff_t * , struct pipe_inode_info * , size_t , unsigned int ) ; int (*set_peek_off)(struct sock * , int ) ; }; struct exception_table_entry { int insn ; int fixup ; }; struct in6_addr; struct sk_buff; typedef u64 netdev_features_t; union __anonunion_in6_u_218 { __u8 u6_addr8[16U] ; __be16 u6_addr16[8U] ; __be32 u6_addr32[4U] ; }; struct in6_addr { union __anonunion_in6_u_218 in6_u ; }; struct ethhdr { unsigned char h_dest[6U] ; unsigned char h_source[6U] ; __be16 h_proto ; }; struct pipe_buf_operations; struct pipe_buffer { struct page *page ; unsigned int offset ; unsigned int len ; struct pipe_buf_operations const *ops ; unsigned int flags ; unsigned long private ; }; struct pipe_inode_info { struct mutex mutex ; wait_queue_head_t wait ; unsigned int nrbufs ; unsigned int curbuf ; unsigned int buffers ; unsigned int readers ; unsigned int writers ; unsigned int files ; unsigned int waiting_writers ; unsigned int r_counter ; unsigned int w_counter ; struct page *tmp_page ; struct fasync_struct *fasync_readers ; struct fasync_struct *fasync_writers ; struct pipe_buffer *bufs ; }; struct pipe_buf_operations { int can_merge ; int (*confirm)(struct pipe_inode_info * , struct pipe_buffer * ) ; void (*release)(struct pipe_inode_info * , struct pipe_buffer * ) ; int (*steal)(struct pipe_inode_info * , struct pipe_buffer * ) ; void (*get)(struct pipe_inode_info * , struct pipe_buffer * ) ; }; struct napi_struct; struct nf_conntrack { atomic_t use ; }; union __anonunion____missing_field_name_223 { struct net_device *physoutdev ; char neigh_header[8U] ; }; union __anonunion____missing_field_name_224 { __be32 ipv4_daddr ; struct in6_addr ipv6_daddr ; }; struct nf_bridge_info { atomic_t use ; unsigned char orig_proto ; bool pkt_otherhost ; __u16 frag_max_size ; unsigned int mask ; struct net_device *physindev ; union __anonunion____missing_field_name_223 __annonCompField62 ; union __anonunion____missing_field_name_224 __annonCompField63 ; }; struct sk_buff_head { struct sk_buff *next ; struct sk_buff *prev ; __u32 qlen ; spinlock_t lock ; }; typedef unsigned int sk_buff_data_t; struct __anonstruct____missing_field_name_227 { u32 stamp_us ; u32 stamp_jiffies ; }; union __anonunion____missing_field_name_226 { u64 v64 ; struct __anonstruct____missing_field_name_227 __annonCompField64 ; }; struct skb_mstamp { union __anonunion____missing_field_name_226 __annonCompField65 ; }; union __anonunion____missing_field_name_230 { ktime_t tstamp ; struct skb_mstamp skb_mstamp ; }; struct __anonstruct____missing_field_name_229 { struct sk_buff *next ; struct sk_buff *prev ; union __anonunion____missing_field_name_230 __annonCompField66 ; }; union __anonunion____missing_field_name_228 { struct __anonstruct____missing_field_name_229 __annonCompField67 ; struct rb_node rbnode ; }; struct sec_path; struct __anonstruct____missing_field_name_232 { __u16 csum_start ; __u16 csum_offset ; }; union __anonunion____missing_field_name_231 { __wsum csum ; struct __anonstruct____missing_field_name_232 __annonCompField69 ; }; union __anonunion____missing_field_name_233 { unsigned int napi_id ; unsigned int sender_cpu ; }; union __anonunion____missing_field_name_234 { __u32 mark ; __u32 reserved_tailroom ; }; union __anonunion____missing_field_name_235 { __be16 inner_protocol ; __u8 inner_ipproto ; }; struct sk_buff { union __anonunion____missing_field_name_228 __annonCompField68 ; struct sock *sk ; struct net_device *dev ; char cb[48U] ; unsigned long _skb_refdst ; void (*destructor)(struct sk_buff * ) ; struct sec_path *sp ; struct nf_conntrack *nfct ; struct nf_bridge_info *nf_bridge ; unsigned int len ; unsigned int data_len ; __u16 mac_len ; __u16 hdr_len ; __u16 queue_mapping ; unsigned char cloned : 1 ; unsigned char nohdr : 1 ; unsigned char fclone : 2 ; unsigned char peeked : 1 ; unsigned char head_frag : 1 ; unsigned char xmit_more : 1 ; __u32 headers_start[0U] ; __u8 __pkt_type_offset[0U] ; unsigned char pkt_type : 3 ; unsigned char pfmemalloc : 1 ; unsigned char ignore_df : 1 ; unsigned char nfctinfo : 3 ; unsigned char nf_trace : 1 ; unsigned char ip_summed : 2 ; unsigned char ooo_okay : 1 ; unsigned char l4_hash : 1 ; unsigned char sw_hash : 1 ; unsigned char wifi_acked_valid : 1 ; unsigned char wifi_acked : 1 ; unsigned char no_fcs : 1 ; unsigned char encapsulation : 1 ; unsigned char encap_hdr_csum : 1 ; unsigned char csum_valid : 1 ; unsigned char csum_complete_sw : 1 ; unsigned char csum_level : 2 ; unsigned char csum_bad : 1 ; unsigned char ndisc_nodetype : 2 ; unsigned char ipvs_property : 1 ; unsigned char inner_protocol_type : 1 ; unsigned char remcsum_offload : 1 ; __u16 tc_index ; __u16 tc_verd ; union __anonunion____missing_field_name_231 __annonCompField70 ; __u32 priority ; int skb_iif ; __u32 hash ; __be16 vlan_proto ; __u16 vlan_tci ; union __anonunion____missing_field_name_233 __annonCompField71 ; __u32 secmark ; union __anonunion____missing_field_name_234 __annonCompField72 ; union __anonunion____missing_field_name_235 __annonCompField73 ; __u16 inner_transport_header ; __u16 inner_network_header ; __u16 inner_mac_header ; __be16 protocol ; __u16 transport_header ; __u16 network_header ; __u16 mac_header ; __u32 headers_end[0U] ; 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 dql { unsigned int num_queued ; unsigned int adj_limit ; unsigned int last_obj_cnt ; unsigned int limit ; unsigned int num_completed ; unsigned int prev_ovlimit ; unsigned int prev_num_queued ; unsigned int prev_last_obj_cnt ; unsigned int lowest_slack ; unsigned long slack_start_time ; unsigned int max_limit ; unsigned int min_limit ; unsigned int slack_hold_time ; }; struct __anonstruct_sync_serial_settings_237 { unsigned int clock_rate ; unsigned int clock_type ; unsigned short loopback ; }; typedef struct __anonstruct_sync_serial_settings_237 sync_serial_settings; struct __anonstruct_te1_settings_238 { unsigned int clock_rate ; unsigned int clock_type ; unsigned short loopback ; unsigned int slot_map ; }; typedef struct __anonstruct_te1_settings_238 te1_settings; struct __anonstruct_raw_hdlc_proto_239 { unsigned short encoding ; unsigned short parity ; }; typedef struct __anonstruct_raw_hdlc_proto_239 raw_hdlc_proto; struct __anonstruct_fr_proto_240 { 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_240 fr_proto; struct __anonstruct_fr_proto_pvc_241 { unsigned int dlci ; }; typedef struct __anonstruct_fr_proto_pvc_241 fr_proto_pvc; struct __anonstruct_fr_proto_pvc_info_242 { unsigned int dlci ; char master[16U] ; }; typedef struct __anonstruct_fr_proto_pvc_info_242 fr_proto_pvc_info; struct __anonstruct_cisco_proto_243 { unsigned int interval ; unsigned int timeout ; }; typedef struct __anonstruct_cisco_proto_243 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_244 { 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_244 ifs_ifsu ; }; union __anonunion_ifr_ifrn_245 { char ifrn_name[16U] ; }; union __anonunion_ifr_ifru_246 { 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_245 ifr_ifrn ; union __anonunion_ifr_ifru_246 ifr_ifru ; }; struct hlist_bl_node; struct hlist_bl_head { struct hlist_bl_node *first ; }; struct hlist_bl_node { struct hlist_bl_node *next ; struct hlist_bl_node **pprev ; }; struct __anonstruct____missing_field_name_251 { spinlock_t lock ; int count ; }; union __anonunion____missing_field_name_250 { struct __anonstruct____missing_field_name_251 __annonCompField74 ; }; struct lockref { union __anonunion____missing_field_name_250 __annonCompField75 ; }; struct vfsmount; struct __anonstruct____missing_field_name_253 { u32 hash ; u32 len ; }; union __anonunion____missing_field_name_252 { struct __anonstruct____missing_field_name_253 __annonCompField76 ; u64 hash_len ; }; struct qstr { union __anonunion____missing_field_name_252 __annonCompField77 ; unsigned char const *name ; }; struct dentry_operations; union __anonunion_d_u_254 { struct hlist_node d_alias ; struct callback_head d_rcu ; }; struct dentry { unsigned int d_flags ; seqcount_t d_seq ; struct hlist_bl_node d_hash ; struct dentry *d_parent ; struct qstr d_name ; struct inode *d_inode ; unsigned char d_iname[32U] ; struct lockref d_lockref ; struct dentry_operations const *d_op ; struct super_block *d_sb ; unsigned long d_time ; void *d_fsdata ; struct list_head d_lru ; struct list_head d_child ; struct list_head d_subdirs ; union __anonunion_d_u_254 d_u ; }; struct dentry_operations { int (*d_revalidate)(struct dentry * , unsigned int ) ; int (*d_weak_revalidate)(struct dentry * , unsigned int ) ; int (*d_hash)(struct dentry const * , struct qstr * ) ; int (*d_compare)(struct dentry const * , struct dentry const * , unsigned int , char const * , struct qstr const * ) ; int (*d_delete)(struct dentry const * ) ; void (*d_release)(struct dentry * ) ; void (*d_prune)(struct dentry * ) ; void (*d_iput)(struct dentry * , struct inode * ) ; char *(*d_dname)(struct dentry * , char * , int ) ; struct vfsmount *(*d_automount)(struct path * ) ; int (*d_manage)(struct dentry * , bool ) ; struct inode *(*d_select_inode)(struct dentry * , unsigned int ) ; }; struct path { struct vfsmount *mnt ; struct dentry *dentry ; }; struct list_lru_one { struct list_head list ; long nr_items ; }; struct list_lru_memcg { struct list_lru_one *lru[0U] ; }; struct list_lru_node { spinlock_t lock ; struct list_lru_one lru ; struct list_lru_memcg *memcg_lrus ; }; struct list_lru { struct list_lru_node *node ; struct list_head list ; }; struct __anonstruct____missing_field_name_258 { struct radix_tree_node *parent ; void *private_data ; }; union __anonunion____missing_field_name_257 { struct __anonstruct____missing_field_name_258 __annonCompField78 ; struct callback_head callback_head ; }; struct radix_tree_node { unsigned int path ; unsigned int count ; union __anonunion____missing_field_name_257 __annonCompField79 ; struct list_head private_list ; void *slots[64U] ; unsigned long tags[3U][1U] ; }; struct radix_tree_root { unsigned int height ; gfp_t gfp_mask ; struct radix_tree_node *rnode ; }; struct fiemap_extent { __u64 fe_logical ; __u64 fe_physical ; __u64 fe_length ; __u64 fe_reserved64[2U] ; __u32 fe_flags ; __u32 fe_reserved[3U] ; }; enum migrate_mode { MIGRATE_ASYNC = 0, MIGRATE_SYNC_LIGHT = 1, MIGRATE_SYNC = 2 } ; struct block_device; struct bio_vec { struct page *bv_page ; unsigned int bv_len ; unsigned int bv_offset ; }; struct export_operations; struct kstatfs; struct swap_info_struct; struct iattr { unsigned int ia_valid ; umode_t ia_mode ; kuid_t ia_uid ; kgid_t ia_gid ; loff_t ia_size ; struct timespec ia_atime ; struct timespec ia_mtime ; struct timespec ia_ctime ; struct file *ia_file ; }; struct dquot; typedef __kernel_uid32_t projid_t; struct __anonstruct_kprojid_t_262 { projid_t val ; }; typedef struct __anonstruct_kprojid_t_262 kprojid_t; enum quota_type { USRQUOTA = 0, GRPQUOTA = 1, PRJQUOTA = 2 } ; typedef long long qsize_t; union __anonunion____missing_field_name_263 { kuid_t uid ; kgid_t gid ; kprojid_t projid ; }; struct kqid { union __anonunion____missing_field_name_263 __annonCompField81 ; enum quota_type type ; }; struct mem_dqblk { qsize_t dqb_bhardlimit ; qsize_t dqb_bsoftlimit ; qsize_t dqb_curspace ; qsize_t dqb_rsvspace ; qsize_t dqb_ihardlimit ; qsize_t dqb_isoftlimit ; qsize_t dqb_curinodes ; time_t dqb_btime ; time_t dqb_itime ; }; struct quota_format_type; struct mem_dqinfo { struct quota_format_type *dqi_format ; int dqi_fmt_id ; struct list_head dqi_dirty_list ; unsigned long dqi_flags ; unsigned int dqi_bgrace ; unsigned int dqi_igrace ; qsize_t dqi_max_spc_limit ; qsize_t dqi_max_ino_limit ; void *dqi_priv ; }; struct dquot { struct hlist_node dq_hash ; struct list_head dq_inuse ; struct list_head dq_free ; struct list_head dq_dirty ; struct mutex dq_lock ; atomic_t dq_count ; wait_queue_head_t dq_wait_unused ; struct super_block *dq_sb ; struct kqid dq_id ; loff_t dq_off ; unsigned long dq_flags ; struct mem_dqblk dq_dqb ; }; struct quota_format_ops { int (*check_quota_file)(struct super_block * , int ) ; int (*read_file_info)(struct super_block * , int ) ; int (*write_file_info)(struct super_block * , int ) ; int (*free_file_info)(struct super_block * , int ) ; int (*read_dqblk)(struct dquot * ) ; int (*commit_dqblk)(struct dquot * ) ; int (*release_dqblk)(struct dquot * ) ; }; struct dquot_operations { int (*write_dquot)(struct dquot * ) ; struct dquot *(*alloc_dquot)(struct super_block * , int ) ; void (*destroy_dquot)(struct dquot * ) ; int (*acquire_dquot)(struct dquot * ) ; int (*release_dquot)(struct dquot * ) ; int (*mark_dirty)(struct dquot * ) ; int (*write_info)(struct super_block * , int ) ; qsize_t *(*get_reserved_space)(struct inode * ) ; int (*get_projid)(struct inode * , kprojid_t * ) ; }; struct qc_dqblk { int d_fieldmask ; u64 d_spc_hardlimit ; u64 d_spc_softlimit ; u64 d_ino_hardlimit ; u64 d_ino_softlimit ; u64 d_space ; u64 d_ino_count ; s64 d_ino_timer ; s64 d_spc_timer ; int d_ino_warns ; int d_spc_warns ; u64 d_rt_spc_hardlimit ; u64 d_rt_spc_softlimit ; u64 d_rt_space ; s64 d_rt_spc_timer ; int d_rt_spc_warns ; }; struct qc_type_state { unsigned int flags ; unsigned int spc_timelimit ; unsigned int ino_timelimit ; unsigned int rt_spc_timelimit ; unsigned int spc_warnlimit ; unsigned int ino_warnlimit ; unsigned int rt_spc_warnlimit ; unsigned long long ino ; blkcnt_t blocks ; blkcnt_t nextents ; }; struct qc_state { unsigned int s_incoredqs ; struct qc_type_state s_state[3U] ; }; struct qc_info { int i_fieldmask ; unsigned int i_flags ; unsigned int i_spc_timelimit ; unsigned int i_ino_timelimit ; unsigned int i_rt_spc_timelimit ; unsigned int i_spc_warnlimit ; unsigned int i_ino_warnlimit ; unsigned int i_rt_spc_warnlimit ; }; struct quotactl_ops { int (*quota_on)(struct super_block * , int , int , struct path * ) ; int (*quota_off)(struct super_block * , int ) ; int (*quota_enable)(struct super_block * , unsigned int ) ; int (*quota_disable)(struct super_block * , unsigned int ) ; int (*quota_sync)(struct super_block * , int ) ; int (*set_info)(struct super_block * , int , struct qc_info * ) ; int (*get_dqblk)(struct super_block * , struct kqid , struct qc_dqblk * ) ; int (*set_dqblk)(struct super_block * , struct kqid , struct qc_dqblk * ) ; int (*get_state)(struct super_block * , struct qc_state * ) ; int (*rm_xquota)(struct super_block * , unsigned int ) ; }; struct quota_format_type { int qf_fmt_id ; struct quota_format_ops const *qf_ops ; struct module *qf_owner ; struct quota_format_type *qf_next ; }; struct quota_info { unsigned int flags ; struct mutex dqio_mutex ; struct mutex dqonoff_mutex ; struct inode *files[3U] ; struct mem_dqinfo info[3U] ; struct quota_format_ops const *ops[3U] ; }; struct kiocb { struct file *ki_filp ; loff_t ki_pos ; void (*ki_complete)(struct kiocb * , long , long ) ; void *private ; int ki_flags ; }; struct address_space_operations { int (*writepage)(struct page * , struct writeback_control * ) ; int (*readpage)(struct file * , struct page * ) ; int (*writepages)(struct address_space * , struct writeback_control * ) ; int (*set_page_dirty)(struct page * ) ; int (*readpages)(struct file * , struct address_space * , struct list_head * , unsigned int ) ; int (*write_begin)(struct file * , struct address_space * , loff_t , unsigned int , unsigned int , struct page ** , void ** ) ; int (*write_end)(struct file * , struct address_space * , loff_t , unsigned int , unsigned int , struct page * , void * ) ; sector_t (*bmap)(struct address_space * , sector_t ) ; void (*invalidatepage)(struct page * , unsigned int , unsigned int ) ; int (*releasepage)(struct page * , gfp_t ) ; void (*freepage)(struct page * ) ; ssize_t (*direct_IO)(struct kiocb * , struct iov_iter * , loff_t ) ; int (*migratepage)(struct address_space * , struct page * , struct page * , enum migrate_mode ) ; int (*launder_page)(struct page * ) ; int (*is_partially_uptodate)(struct page * , unsigned long , unsigned long ) ; void (*is_dirty_writeback)(struct page * , bool * , bool * ) ; int (*error_remove_page)(struct address_space * , struct page * ) ; int (*swap_activate)(struct swap_info_struct * , struct file * , sector_t * ) ; void (*swap_deactivate)(struct file * ) ; }; struct address_space { struct inode *host ; struct radix_tree_root page_tree ; spinlock_t tree_lock ; atomic_t i_mmap_writable ; struct rb_root i_mmap ; struct rw_semaphore i_mmap_rwsem ; unsigned long nrpages ; unsigned long nrshadows ; unsigned long writeback_index ; struct address_space_operations const *a_ops ; unsigned long flags ; spinlock_t private_lock ; struct list_head private_list ; void *private_data ; }; struct request_queue; struct hd_struct; struct gendisk; struct block_device { dev_t bd_dev ; int bd_openers ; struct inode *bd_inode ; struct super_block *bd_super ; struct mutex bd_mutex ; struct list_head bd_inodes ; void *bd_claiming ; void *bd_holder ; int bd_holders ; bool bd_write_holder ; struct list_head bd_holder_disks ; struct block_device *bd_contains ; unsigned int bd_block_size ; struct hd_struct *bd_part ; unsigned int bd_part_count ; int bd_invalidated ; struct gendisk *bd_disk ; struct request_queue *bd_queue ; struct list_head bd_list ; unsigned long bd_private ; int bd_fsfreeze_count ; struct mutex bd_fsfreeze_mutex ; }; struct posix_acl; struct inode_operations; union __anonunion____missing_field_name_266 { unsigned int const i_nlink ; unsigned int __i_nlink ; }; union __anonunion____missing_field_name_267 { struct hlist_head i_dentry ; struct callback_head i_rcu ; }; struct file_lock_context; struct cdev; union __anonunion____missing_field_name_268 { struct pipe_inode_info *i_pipe ; struct block_device *i_bdev ; struct cdev *i_cdev ; char *i_link ; }; struct inode { umode_t i_mode ; unsigned short i_opflags ; kuid_t i_uid ; kgid_t i_gid ; unsigned int i_flags ; struct posix_acl *i_acl ; struct posix_acl *i_default_acl ; struct inode_operations const *i_op ; struct super_block *i_sb ; struct address_space *i_mapping ; void *i_security ; unsigned long i_ino ; union __anonunion____missing_field_name_266 __annonCompField82 ; dev_t i_rdev ; loff_t i_size ; struct timespec i_atime ; struct timespec i_mtime ; struct timespec i_ctime ; spinlock_t i_lock ; unsigned short i_bytes ; unsigned int i_blkbits ; blkcnt_t i_blocks ; unsigned long i_state ; struct mutex i_mutex ; unsigned long dirtied_when ; unsigned long dirtied_time_when ; struct hlist_node i_hash ; struct list_head i_wb_list ; struct bdi_writeback *i_wb ; int i_wb_frn_winner ; u16 i_wb_frn_avg_time ; u16 i_wb_frn_history ; struct list_head i_lru ; struct list_head i_sb_list ; union __anonunion____missing_field_name_267 __annonCompField83 ; u64 i_version ; atomic_t i_count ; atomic_t i_dio_count ; atomic_t i_writecount ; atomic_t i_readcount ; struct file_operations const *i_fop ; struct file_lock_context *i_flctx ; struct address_space i_data ; struct list_head i_devices ; union __anonunion____missing_field_name_268 __annonCompField84 ; __u32 i_generation ; __u32 i_fsnotify_mask ; struct hlist_head i_fsnotify_marks ; void *i_private ; }; struct fown_struct { rwlock_t lock ; struct pid *pid ; enum pid_type pid_type ; kuid_t uid ; kuid_t euid ; int signum ; }; struct file_ra_state { unsigned long start ; unsigned int size ; unsigned int async_size ; unsigned int ra_pages ; unsigned int mmap_miss ; loff_t prev_pos ; }; union __anonunion_f_u_269 { struct llist_node fu_llist ; struct callback_head fu_rcuhead ; }; struct file { union __anonunion_f_u_269 f_u ; struct path f_path ; struct inode *f_inode ; struct file_operations const *f_op ; spinlock_t f_lock ; atomic_long_t f_count ; unsigned int f_flags ; fmode_t f_mode ; struct mutex f_pos_lock ; loff_t f_pos ; struct fown_struct f_owner ; struct cred const *f_cred ; struct file_ra_state f_ra ; u64 f_version ; void *f_security ; void *private_data ; struct list_head f_ep_links ; struct list_head f_tfile_llink ; struct address_space *f_mapping ; }; typedef void *fl_owner_t; struct file_lock; struct file_lock_operations { void (*fl_copy_lock)(struct file_lock * , struct file_lock * ) ; void (*fl_release_private)(struct file_lock * ) ; }; struct lock_manager_operations { int (*lm_compare_owner)(struct file_lock * , struct file_lock * ) ; unsigned long (*lm_owner_key)(struct file_lock * ) ; fl_owner_t (*lm_get_owner)(fl_owner_t ) ; void (*lm_put_owner)(fl_owner_t ) ; void (*lm_notify)(struct file_lock * ) ; int (*lm_grant)(struct file_lock * , int ) ; bool (*lm_break)(struct file_lock * ) ; int (*lm_change)(struct file_lock * , int , struct list_head * ) ; void (*lm_setup)(struct file_lock * , void ** ) ; }; struct 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_271 { struct list_head link ; int state ; }; union __anonunion_fl_u_270 { struct nfs_lock_info nfs_fl ; struct nfs4_lock_info nfs4_fl ; struct __anonstruct_afs_271 afs ; }; struct file_lock { struct file_lock *fl_next ; struct list_head fl_list ; struct hlist_node fl_link ; struct list_head fl_block ; fl_owner_t fl_owner ; unsigned int fl_flags ; unsigned char fl_type ; unsigned int fl_pid ; int fl_link_cpu ; struct pid *fl_nspid ; wait_queue_head_t fl_wait ; struct file *fl_file ; loff_t fl_start ; loff_t fl_end ; struct fasync_struct *fl_fasync ; unsigned long fl_break_time ; unsigned long fl_downgrade_time ; struct file_lock_operations const *fl_ops ; struct lock_manager_operations const *fl_lmops ; union __anonunion_fl_u_270 fl_u ; }; struct file_lock_context { spinlock_t flc_lock ; struct list_head flc_flock ; struct list_head flc_posix ; struct list_head flc_lease ; }; struct fasync_struct { spinlock_t fa_lock ; int magic ; int fa_fd ; struct fasync_struct *fa_next ; struct file *fa_file ; struct callback_head fa_rcu ; }; struct sb_writers { struct percpu_counter counter[3U] ; wait_queue_head_t wait ; int frozen ; wait_queue_head_t wait_unfrozen ; struct lockdep_map lock_map[3U] ; }; struct super_operations; struct xattr_handler; struct mtd_info; struct super_block { struct list_head s_list ; dev_t s_dev ; unsigned char s_blocksize_bits ; unsigned long s_blocksize ; loff_t s_maxbytes ; struct file_system_type *s_type ; struct super_operations const *s_op ; struct dquot_operations const *dq_op ; struct quotactl_ops const *s_qcop ; struct export_operations const *s_export_op ; unsigned long s_flags ; unsigned long s_iflags ; unsigned long s_magic ; struct dentry *s_root ; struct rw_semaphore s_umount ; int s_count ; atomic_t s_active ; void *s_security ; struct xattr_handler const **s_xattr ; struct list_head s_inodes ; struct hlist_bl_head s_anon ; struct list_head s_mounts ; struct block_device *s_bdev ; struct backing_dev_info *s_bdi ; struct mtd_info *s_mtd ; struct hlist_node s_instances ; unsigned int s_quota_types ; struct quota_info s_dquot ; struct sb_writers s_writers ; char s_id[32U] ; u8 s_uuid[16U] ; void *s_fs_info ; unsigned int s_max_links ; fmode_t s_mode ; u32 s_time_gran ; struct mutex s_vfs_rename_mutex ; char *s_subtype ; char *s_options ; struct dentry_operations const *s_d_op ; int cleancache_poolid ; struct shrinker s_shrink ; atomic_long_t s_remove_count ; int s_readonly_remount ; struct workqueue_struct *s_dio_done_wq ; struct hlist_head s_pins ; struct list_lru s_dentry_lru ; struct list_lru s_inode_lru ; struct callback_head rcu ; int s_stack_depth ; }; struct fiemap_extent_info { unsigned int fi_flags ; unsigned int fi_extents_mapped ; unsigned int fi_extents_max ; struct fiemap_extent *fi_extents_start ; }; struct dir_context; struct dir_context { int (*actor)(struct dir_context * , char const * , int , loff_t , u64 , unsigned int ) ; loff_t pos ; }; struct file_operations { struct module *owner ; loff_t (*llseek)(struct file * , loff_t , int ) ; ssize_t (*read)(struct file * , char * , size_t , loff_t * ) ; ssize_t (*write)(struct file * , char const * , size_t , loff_t * ) ; ssize_t (*read_iter)(struct kiocb * , struct iov_iter * ) ; ssize_t (*write_iter)(struct kiocb * , struct iov_iter * ) ; int (*iterate)(struct file * , struct dir_context * ) ; unsigned int (*poll)(struct file * , struct poll_table_struct * ) ; long (*unlocked_ioctl)(struct file * , unsigned int , unsigned long ) ; long (*compat_ioctl)(struct file * , unsigned int , unsigned long ) ; int (*mmap)(struct file * , struct vm_area_struct * ) ; int (*mremap)(struct file * , struct vm_area_struct * ) ; int (*open)(struct inode * , struct file * ) ; int (*flush)(struct file * , fl_owner_t ) ; int (*release)(struct inode * , struct file * ) ; int (*fsync)(struct file * , loff_t , loff_t , int ) ; int (*aio_fsync)(struct kiocb * , int ) ; int (*fasync)(int , struct file * , int ) ; int (*lock)(struct file * , int , struct file_lock * ) ; ssize_t (*sendpage)(struct file * , struct page * , int , size_t , loff_t * , int ) ; unsigned long (*get_unmapped_area)(struct file * , unsigned long , unsigned long , unsigned long , unsigned long ) ; int (*check_flags)(int ) ; int (*flock)(struct file * , int , struct file_lock * ) ; ssize_t (*splice_write)(struct pipe_inode_info * , struct file * , loff_t * , size_t , unsigned int ) ; ssize_t (*splice_read)(struct file * , loff_t * , struct pipe_inode_info * , size_t , unsigned int ) ; int (*setlease)(struct file * , long , struct file_lock ** , void ** ) ; long (*fallocate)(struct file * , int , loff_t , loff_t ) ; void (*show_fdinfo)(struct seq_file * , struct file * ) ; }; struct inode_operations { struct dentry *(*lookup)(struct inode * , struct dentry * , unsigned int ) ; char const *(*follow_link)(struct dentry * , void ** ) ; int (*permission)(struct inode * , int ) ; struct posix_acl *(*get_acl)(struct inode * , int ) ; int (*readlink)(struct dentry * , char * , int ) ; void (*put_link)(struct inode * , void * ) ; int (*create)(struct inode * , struct dentry * , umode_t , bool ) ; int (*link)(struct dentry * , struct inode * , struct dentry * ) ; int (*unlink)(struct inode * , struct dentry * ) ; int (*symlink)(struct inode * , struct dentry * , char const * ) ; int (*mkdir)(struct inode * , struct dentry * , umode_t ) ; int (*rmdir)(struct inode * , struct dentry * ) ; int (*mknod)(struct inode * , struct dentry * , umode_t , dev_t ) ; int (*rename)(struct inode * , struct dentry * , struct inode * , struct dentry * ) ; int (*rename2)(struct inode * , struct dentry * , struct inode * , struct dentry * , unsigned int ) ; int (*setattr)(struct dentry * , struct iattr * ) ; int (*getattr)(struct vfsmount * , struct dentry * , struct kstat * ) ; int (*setxattr)(struct dentry * , char const * , void const * , size_t , int ) ; ssize_t (*getxattr)(struct dentry * , char const * , void * , size_t ) ; ssize_t (*listxattr)(struct dentry * , char * , size_t ) ; int (*removexattr)(struct dentry * , char const * ) ; int (*fiemap)(struct inode * , struct fiemap_extent_info * , u64 , u64 ) ; int (*update_time)(struct inode * , struct timespec * , int ) ; int (*atomic_open)(struct inode * , struct dentry * , struct file * , unsigned int , umode_t , int * ) ; int (*tmpfile)(struct inode * , struct dentry * , umode_t ) ; int (*set_acl)(struct inode * , struct posix_acl * , int ) ; }; struct super_operations { struct inode *(*alloc_inode)(struct super_block * ) ; void (*destroy_inode)(struct inode * ) ; void (*dirty_inode)(struct inode * , int ) ; int (*write_inode)(struct inode * , struct writeback_control * ) ; int (*drop_inode)(struct inode * ) ; void (*evict_inode)(struct inode * ) ; void (*put_super)(struct super_block * ) ; int (*sync_fs)(struct super_block * , int ) ; int (*freeze_super)(struct super_block * ) ; int (*freeze_fs)(struct super_block * ) ; int (*thaw_super)(struct super_block * ) ; int (*unfreeze_fs)(struct super_block * ) ; int (*statfs)(struct dentry * , struct kstatfs * ) ; int (*remount_fs)(struct super_block * , int * , char * ) ; void (*umount_begin)(struct super_block * ) ; int (*show_options)(struct seq_file * , struct dentry * ) ; int (*show_devname)(struct seq_file * , struct dentry * ) ; int (*show_path)(struct seq_file * , struct dentry * ) ; int (*show_stats)(struct seq_file * , struct dentry * ) ; ssize_t (*quota_read)(struct super_block * , int , char * , size_t , loff_t ) ; ssize_t (*quota_write)(struct super_block * , int , char const * , size_t , loff_t ) ; struct dquot **(*get_dquots)(struct inode * ) ; int (*bdev_try_to_free_page)(struct super_block * , struct page * , gfp_t ) ; long (*nr_cached_objects)(struct super_block * , struct shrink_control * ) ; long (*free_cached_objects)(struct super_block * , struct shrink_control * ) ; }; struct file_system_type { char const *name ; int fs_flags ; struct dentry *(*mount)(struct file_system_type * , int , char const * , void * ) ; void (*kill_sb)(struct super_block * ) ; struct module *owner ; struct file_system_type *next ; struct hlist_head fs_supers ; struct lock_class_key s_lock_key ; struct lock_class_key s_umount_key ; struct lock_class_key s_vfs_rename_key ; struct lock_class_key s_writers_key[3U] ; struct lock_class_key i_lock_key ; struct lock_class_key i_mutex_key ; struct lock_class_key i_mutex_dir_key ; }; typedef s32 compat_time_t; typedef s32 compat_long_t; typedef u32 compat_uptr_t; struct compat_timespec { compat_time_t tv_sec ; s32 tv_nsec ; }; struct compat_robust_list { compat_uptr_t next ; }; struct compat_robust_list_head { struct compat_robust_list list ; compat_long_t futex_offset ; compat_uptr_t list_op_pending ; }; struct 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 eth_tp_mdix_ctrl ; __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 erom_version[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_tunable { __u32 cmd ; __u32 id ; __u32 type_id ; __u32 len ; void *data[0U] ; }; 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_eee { __u32 cmd ; __u32 supported ; __u32 advertised ; __u32 lp_advertised ; __u32 eee_active ; __u32 eee_enabled ; __u32 tx_lpi_enabled ; __u32 tx_lpi_timer ; __u32 reserved[2U] ; }; struct ethtool_modinfo { __u32 cmd ; __u32 type ; __u32 eeprom_len ; __u32 reserved[8U] ; }; 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_channels { __u32 cmd ; __u32 max_rx ; __u32 max_tx ; __u32 max_other ; __u32 max_combined ; __u32 rx_count ; __u32 tx_count ; __u32 other_count ; __u32 combined_count ; }; 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_usrip4_spec { __be32 ip4src ; __be32 ip4dst ; __be32 l4_4_bytes ; __u8 tos ; __u8 ip_ver ; __u8 proto ; }; union ethtool_flow_union { 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_usrip4_spec usr_ip4_spec ; struct ethhdr ether_spec ; __u8 hdata[52U] ; }; struct ethtool_flow_ext { __u8 padding[2U] ; unsigned char h_dest[6U] ; __be16 vlan_etype ; __be16 vlan_tci ; __be32 data[2U] ; }; struct ethtool_rx_flow_spec { __u32 flow_type ; union ethtool_flow_union h_u ; struct ethtool_flow_ext h_ext ; union ethtool_flow_union m_u ; struct ethtool_flow_ext m_ext ; __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_flash { __u32 cmd ; __u32 region ; char data[128U] ; }; struct ethtool_dump { __u32 cmd ; __u32 version ; __u32 flag ; __u32 len ; __u8 data[0U] ; }; struct ethtool_ts_info { __u32 cmd ; __u32 so_timestamping ; __s32 phc_index ; __u32 tx_types ; __u32 tx_reserved[3U] ; __u32 rx_filters ; __u32 rx_reserved[3U] ; }; enum ethtool_phys_id_state { ETHTOOL_ID_INACTIVE = 0, ETHTOOL_ID_ACTIVE = 1, ETHTOOL_ID_ON = 2, ETHTOOL_ID_OFF = 3 } ; 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 * ) ; void (*self_test)(struct net_device * , struct ethtool_test * , u64 * ) ; void (*get_strings)(struct net_device * , u32 , u8 * ) ; int (*set_phys_id)(struct net_device * , enum ethtool_phys_id_state ) ; void (*get_ethtool_stats)(struct net_device * , struct ethtool_stats * , u64 * ) ; int (*begin)(struct net_device * ) ; void (*complete)(struct net_device * ) ; 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 * , u32 * ) ; int (*set_rxnfc)(struct net_device * , struct ethtool_rxnfc * ) ; int (*flash_device)(struct net_device * , struct ethtool_flash * ) ; int (*reset)(struct net_device * , u32 * ) ; u32 (*get_rxfh_key_size)(struct net_device * ) ; u32 (*get_rxfh_indir_size)(struct net_device * ) ; int (*get_rxfh)(struct net_device * , u32 * , u8 * , u8 * ) ; int (*set_rxfh)(struct net_device * , u32 const * , u8 const * , u8 const ) ; void (*get_channels)(struct net_device * , struct ethtool_channels * ) ; int (*set_channels)(struct net_device * , struct ethtool_channels * ) ; int (*get_dump_flag)(struct net_device * , struct ethtool_dump * ) ; int (*get_dump_data)(struct net_device * , struct ethtool_dump * , void * ) ; int (*set_dump)(struct net_device * , struct ethtool_dump * ) ; int (*get_ts_info)(struct net_device * , struct ethtool_ts_info * ) ; int (*get_module_info)(struct net_device * , struct ethtool_modinfo * ) ; int (*get_module_eeprom)(struct net_device * , struct ethtool_eeprom * , u8 * ) ; int (*get_eee)(struct net_device * , struct ethtool_eee * ) ; int (*set_eee)(struct net_device * , struct ethtool_eee * ) ; int (*get_tunable)(struct net_device * , struct ethtool_tunable const * , void * ) ; int (*set_tunable)(struct net_device * , struct ethtool_tunable const * , void 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[36U] ; struct u64_stats_sync syncp ; }; struct icmp_mib { unsigned long mibs[28U] ; }; struct icmpmsg_mib { atomic_long_t mibs[512U] ; }; struct icmpv6_mib { unsigned long mibs[6U] ; }; struct icmpv6msg_mib { atomic_long_t mibs[512U] ; }; struct tcp_mib { unsigned long mibs[16U] ; }; struct udp_mib { unsigned long mibs[9U] ; }; struct linux_mib { unsigned long mibs[115U] ; }; struct linux_xfrm_mib { unsigned long mibs[29U] ; }; struct proc_dir_entry; struct netns_mib { struct tcp_mib *tcp_statistics ; struct ipstats_mib *ip_statistics ; struct linux_mib *net_statistics ; struct udp_mib *udp_statistics ; struct udp_mib *udplite_statistics ; struct icmp_mib *icmp_statistics ; struct icmpmsg_mib *icmpmsg_statistics ; struct proc_dir_entry *proc_net_devsnmp6 ; struct udp_mib *udp_stats_in6 ; struct udp_mib *udplite_stats_in6 ; struct ipstats_mib *ipv6_statistics ; struct icmpv6_mib *icmpv6_statistics ; struct icmpv6msg_mib *icmpv6msg_statistics ; struct linux_xfrm_mib *xfrm_statistics ; }; struct netns_unix { int sysctl_max_dgram_qlen ; struct ctl_table_header *ctl ; }; struct netns_packet { struct mutex sklist_lock ; struct hlist_head sklist ; }; struct netns_frags { struct percpu_counter mem ; int timeout ; int high_thresh ; int low_thresh ; }; struct ipv4_devconf; struct fib_rules_ops; struct fib_table; struct local_ports { seqlock_t lock ; int range[2U] ; bool warned ; }; struct ping_group_range { seqlock_t lock ; kgid_t range[2U] ; }; struct inet_peer_base; 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 ctl_table_header *xfrm4_hdr ; struct ipv4_devconf *devconf_all ; struct ipv4_devconf *devconf_dflt ; struct fib_rules_ops *rules_ops ; bool fib_has_custom_rules ; struct fib_table *fib_local ; struct fib_table *fib_main ; struct fib_table *fib_default ; int fib_num_tclassid_users ; struct hlist_head *fib_table_hash ; bool fib_offload_disabled ; struct sock *fibnl ; struct sock **icmp_sk ; struct sock *mc_autojoin_sk ; struct inet_peer_base *peers ; struct sock **tcp_sk ; 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 ; 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 ; struct local_ports ip_local_ports ; int sysctl_tcp_ecn ; int sysctl_tcp_ecn_fallback ; int sysctl_ip_no_pmtu_disc ; int sysctl_ip_fwd_use_pmtu ; int sysctl_ip_nonlocal_bind ; int sysctl_fwmark_reflect ; int sysctl_tcp_fwmark_accept ; int sysctl_tcp_mtu_probing ; int sysctl_tcp_base_mss ; int sysctl_tcp_probe_threshold ; u32 sysctl_tcp_probe_interval ; struct ping_group_range ping_group_range ; atomic_t dev_addr_genid ; unsigned long *sysctl_local_reserved_ports ; struct list_head mr_tables ; struct fib_rules_ops *mr_rules_ops ; atomic_t rt_genid ; }; struct neighbour; struct dst_ops { unsigned short family ; unsigned int gc_thresh ; int (*gc)(struct dst_ops * ) ; struct dst_entry *(*check)(struct dst_entry * , __u32 ) ; unsigned int (*default_advmss)(struct dst_entry const * ) ; unsigned int (*mtu)(struct dst_entry const * ) ; u32 *(*cow_metrics)(struct dst_entry * , unsigned long ) ; 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 * , struct sock * , struct sk_buff * , u32 ) ; void (*redirect)(struct dst_entry * , struct sock * , struct sk_buff * ) ; int (*local_out)(struct sk_buff * ) ; struct neighbour *(*neigh_lookup)(struct dst_entry const * , struct sk_buff * , void const * ) ; struct kmem_cache *kmem_cachep ; struct percpu_counter pcpuc_entries ; }; struct netns_sysctl_ipv6 { struct ctl_table_header *hdr ; struct ctl_table_header *route_hdr ; struct ctl_table_header *icmp_hdr ; struct ctl_table_header *frags_hdr ; struct ctl_table_header *xfrm6_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 flowlabel_consistency ; int auto_flowlabels ; int icmpv6_time ; int anycast_src_echo_reply ; int fwmark_reflect ; int idgen_retries ; int idgen_delay ; int flowlabel_state_ranges ; }; 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 inet_peer_base *peers ; 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 xt_table *ip6table_nat ; 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 sock *mc_autojoin_sk ; struct list_head mr6_tables ; struct fib_rules_ops *mr6_rules_ops ; atomic_t dev_addr_genid ; atomic_t fib6_sernum ; }; struct netns_nf_frag { struct netns_sysctl_ipv6 sysctl ; struct netns_frags frags ; }; struct netns_sysctl_lowpan { struct ctl_table_header *frags_hdr ; }; struct netns_ieee802154_lowpan { struct netns_sysctl_lowpan sysctl ; struct netns_frags frags ; }; struct sctp_mib; struct netns_sctp { struct sctp_mib *sctp_statistics ; struct proc_dir_entry *proc_net_sctp ; struct ctl_table_header *sysctl_header ; struct sock *ctl_sock ; struct list_head local_addr_list ; struct list_head addr_waitq ; struct timer_list addr_wq_timer ; struct list_head auto_asconf_splist ; spinlock_t addr_wq_lock ; spinlock_t local_addr_lock ; unsigned int rto_initial ; unsigned int rto_min ; unsigned int rto_max ; int rto_alpha ; int rto_beta ; int max_burst ; int cookie_preserve_enable ; char *sctp_hmac_alg ; unsigned int valid_cookie_life ; unsigned int sack_timeout ; unsigned int hb_interval ; int max_retrans_association ; int max_retrans_path ; int max_retrans_init ; int pf_retrans ; int sndbuf_policy ; int rcvbuf_policy ; int default_auto_asconf ; int addip_enable ; int addip_noauth ; int prsctp_enable ; int auth_enable ; int scope_policy ; int rwnd_upd_shift ; unsigned long max_autoclose ; }; struct netns_dccp { struct sock *v4_ctl_sk ; struct sock *v6_ctl_sk ; }; struct nf_logger; struct netns_nf { struct proc_dir_entry *proc_netfilter ; struct nf_logger const *nf_loggers[13U] ; struct ctl_table_header *nf_log_dir_header ; }; struct ebt_table; struct netns_xt { struct list_head tables[13U] ; bool notrack_deprecated_warning ; bool clusterip_deprecated_warning ; 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 nf_proto_net { struct ctl_table_header *ctl_table_header ; struct ctl_table *ctl_table ; struct ctl_table_header *ctl_compat_header ; struct ctl_table *ctl_compat_table ; unsigned int users ; }; struct nf_generic_net { struct nf_proto_net pn ; unsigned int timeout ; }; struct nf_tcp_net { struct nf_proto_net pn ; unsigned int timeouts[14U] ; unsigned int tcp_loose ; unsigned int tcp_be_liberal ; unsigned int tcp_max_retrans ; }; struct nf_udp_net { struct nf_proto_net pn ; unsigned int timeouts[2U] ; }; struct nf_icmp_net { struct nf_proto_net pn ; unsigned int timeout ; }; struct nf_ip_net { struct nf_generic_net generic ; struct nf_tcp_net tcp ; struct nf_udp_net udp ; struct nf_icmp_net icmp ; struct nf_icmp_net icmpv6 ; struct ctl_table_header *ctl_table_header ; struct ctl_table *ctl_table ; }; struct ct_pcpu { spinlock_t lock ; struct hlist_nulls_head unconfirmed ; struct hlist_nulls_head dying ; struct hlist_nulls_head tmpl ; }; struct ip_conntrack_stat; struct nf_ct_event_notifier; struct nf_exp_event_notifier; struct netns_ct { atomic_t count ; unsigned int expect_count ; struct delayed_work ecache_dwork ; bool ecache_dwork_pending ; struct ctl_table_header *sysctl_header ; struct ctl_table_header *acct_sysctl_header ; struct ctl_table_header *tstamp_sysctl_header ; struct ctl_table_header *event_sysctl_header ; struct ctl_table_header *helper_sysctl_header ; char *slabname ; unsigned int sysctl_log_invalid ; int sysctl_events ; int sysctl_acct ; int sysctl_auto_assign_helper ; bool auto_assign_helper_warned ; int sysctl_tstamp ; int sysctl_checksum ; unsigned int htable_size ; seqcount_t generation ; struct kmem_cache *nf_conntrack_cachep ; struct hlist_nulls_head *hash ; struct hlist_head *expect_hash ; struct ct_pcpu *pcpu_lists ; struct ip_conntrack_stat *stat ; struct nf_ct_event_notifier *nf_conntrack_event_cb ; struct nf_exp_event_notifier *nf_expect_event_cb ; struct nf_ip_net nf_ct_proto ; unsigned int labels_used ; u8 label_words ; struct hlist_head *nat_bysource ; unsigned int nat_htable_size ; }; struct nft_af_info; struct netns_nftables { struct list_head af_info ; struct list_head commit_list ; struct nft_af_info *ipv4 ; struct nft_af_info *ipv6 ; struct nft_af_info *inet ; struct nft_af_info *arp ; struct nft_af_info *bridge ; struct nft_af_info *netdev ; unsigned int base_seq ; u8 gencursor ; }; struct tasklet_struct { struct tasklet_struct *next ; unsigned long state ; atomic_t count ; void (*func)(unsigned long ) ; unsigned long data ; }; struct flow_cache_percpu { struct hlist_head *hash_table ; int hash_count ; u32 hash_rnd ; int hash_rnd_recalc ; struct tasklet_struct flush_tasklet ; }; struct flow_cache { u32 hash_shift ; struct flow_cache_percpu *percpu ; struct notifier_block hotcpu_notifier ; int low_watermark ; int high_watermark ; struct timer_list rnd_timer ; }; struct xfrm_policy_hash { struct hlist_head *table ; unsigned int hmask ; u8 dbits4 ; u8 sbits4 ; u8 dbits6 ; u8 sbits6 ; }; struct xfrm_policy_hthresh { struct work_struct work ; seqlock_t lock ; u8 lbits4 ; u8 rbits4 ; u8 lbits6 ; u8 rbits6 ; }; 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 ; struct list_head policy_all ; struct hlist_head *policy_byidx ; unsigned int policy_idx_hmask ; struct hlist_head policy_inexact[3U] ; struct xfrm_policy_hash policy_bydst[3U] ; unsigned int policy_count[6U] ; struct work_struct policy_hash_work ; struct xfrm_policy_hthresh policy_hthresh ; 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 dst_ops xfrm4_dst_ops ; struct dst_ops xfrm6_dst_ops ; spinlock_t xfrm_state_lock ; rwlock_t xfrm_policy_lock ; struct mutex xfrm_cfg_mutex ; struct flow_cache flow_cache_global ; atomic_t flow_cache_genid ; struct list_head flow_cache_gc_list ; spinlock_t flow_cache_gc_lock ; struct work_struct flow_cache_gc_work ; struct work_struct flow_cache_flush_work ; struct mutex flow_flush_sem ; }; struct mpls_route; struct netns_mpls { size_t platform_labels ; struct mpls_route **platform_label ; struct ctl_table_header *ctl ; }; struct proc_ns_operations; struct ns_common { atomic_long_t stashed ; struct proc_ns_operations const *ops ; unsigned int inum ; }; struct net_generic; struct netns_ipvs; struct net { atomic_t passive ; atomic_t count ; spinlock_t rules_mod_lock ; atomic64_t cookie_gen ; struct list_head list ; struct list_head cleanup_list ; struct list_head exit_list ; struct user_namespace *user_ns ; spinlock_t nsid_lock ; struct idr netns_ids ; struct ns_common ns ; struct proc_dir_entry *proc_net ; struct proc_dir_entry *proc_net_stat ; struct ctl_table_set sysctls ; struct sock *rtnl ; struct sock *genl_sock ; struct list_head dev_base_head ; struct hlist_head *dev_name_head ; struct hlist_head *dev_index_head ; unsigned int dev_base_seq ; int ifindex ; unsigned int dev_unreg_count ; struct list_head rules_ops ; struct net_device *loopback_dev ; 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_ieee802154_lowpan ieee802154_lowpan ; struct netns_sctp sctp ; struct netns_dccp dccp ; struct netns_nf nf ; struct netns_xt xt ; struct netns_ct ct ; struct netns_nftables nft ; struct netns_nf_frag nf_frag ; struct sock *nfnl ; struct sock *nfnl_stash ; struct sk_buff_head wext_nlevents ; struct net_generic *gen ; struct netns_xfrm xfrm ; struct netns_ipvs *ipvs ; struct netns_mpls mpls ; struct sock *diag_nlsk ; atomic_t fnhe_genid ; }; struct __anonstruct_possible_net_t_302 { struct net *net ; }; typedef struct __anonstruct_possible_net_t_302 possible_net_t; typedef unsigned long kernel_ulong_t; struct acpi_device_id { __u8 id[9U] ; kernel_ulong_t driver_data ; }; struct of_device_id { char name[32U] ; char type[32U] ; char compatible[128U] ; void const *data ; }; enum fwnode_type { FWNODE_INVALID = 0, FWNODE_OF = 1, FWNODE_ACPI = 2, FWNODE_PDATA = 3 } ; struct fwnode_handle { enum fwnode_type type ; struct fwnode_handle *secondary ; }; typedef u32 phandle; struct property { char *name ; int length ; void *value ; struct property *next ; unsigned long _flags ; unsigned int unique_id ; struct bin_attribute attr ; }; struct device_node { char const *name ; char const *type ; phandle phandle ; char const *full_name ; struct fwnode_handle fwnode ; struct property *properties ; struct property *deadprops ; struct device_node *parent ; struct device_node *child ; struct device_node *sibling ; struct kobject kobj ; unsigned long _flags ; void *data ; }; enum ldv_27839 { PHY_INTERFACE_MODE_NA = 0, PHY_INTERFACE_MODE_MII = 1, PHY_INTERFACE_MODE_GMII = 2, PHY_INTERFACE_MODE_SGMII = 3, PHY_INTERFACE_MODE_TBI = 4, PHY_INTERFACE_MODE_REVMII = 5, PHY_INTERFACE_MODE_RMII = 6, PHY_INTERFACE_MODE_RGMII = 7, PHY_INTERFACE_MODE_RGMII_ID = 8, PHY_INTERFACE_MODE_RGMII_RXID = 9, PHY_INTERFACE_MODE_RGMII_TXID = 10, PHY_INTERFACE_MODE_RTBI = 11, PHY_INTERFACE_MODE_SMII = 12, PHY_INTERFACE_MODE_XGMII = 13, PHY_INTERFACE_MODE_MOCA = 14, PHY_INTERFACE_MODE_QSGMII = 15, PHY_INTERFACE_MODE_MAX = 16 } ; typedef enum ldv_27839 phy_interface_t; enum ldv_27893 { MDIOBUS_ALLOCATED = 1, MDIOBUS_REGISTERED = 2, MDIOBUS_UNREGISTERED = 3, MDIOBUS_RELEASED = 4 } ; struct phy_device; struct mii_bus { char const *name ; char id[17U] ; void *priv ; int (*read)(struct mii_bus * , int , int ) ; int (*write)(struct mii_bus * , int , int , u16 ) ; int (*reset)(struct mii_bus * ) ; struct mutex mdio_lock ; struct device *parent ; enum ldv_27893 state ; struct device dev ; struct phy_device *phy_map[32U] ; u32 phy_mask ; u32 phy_ignore_ta_mask ; int *irq ; }; enum phy_state { PHY_DOWN = 0, PHY_STARTING = 1, PHY_READY = 2, PHY_PENDING = 3, PHY_UP = 4, PHY_AN = 5, PHY_RUNNING = 6, PHY_NOLINK = 7, PHY_FORCING = 8, PHY_CHANGELINK = 9, PHY_HALTED = 10, PHY_RESUMING = 11 } ; struct phy_c45_device_ids { u32 devices_in_package ; u32 device_ids[8U] ; }; struct phy_driver; struct phy_device { struct phy_driver *drv ; struct mii_bus *bus ; struct device dev ; u32 phy_id ; struct phy_c45_device_ids c45_ids ; bool is_c45 ; bool is_internal ; bool has_fixups ; bool suspended ; enum phy_state state ; u32 dev_flags ; phy_interface_t interface ; int addr ; int speed ; int duplex ; int pause ; int asym_pause ; int link ; u32 interrupts ; u32 supported ; u32 advertising ; u32 lp_advertising ; int autoneg ; int link_timeout ; int irq ; void *priv ; struct work_struct phy_queue ; struct delayed_work state_queue ; atomic_t irq_disable ; struct mutex lock ; struct net_device *attached_dev ; void (*adjust_link)(struct net_device * ) ; }; struct phy_driver { u32 phy_id ; char *name ; unsigned int phy_id_mask ; u32 features ; u32 flags ; void const *driver_data ; int (*soft_reset)(struct phy_device * ) ; int (*config_init)(struct phy_device * ) ; int (*probe)(struct phy_device * ) ; int (*suspend)(struct phy_device * ) ; int (*resume)(struct phy_device * ) ; int (*config_aneg)(struct phy_device * ) ; int (*aneg_done)(struct phy_device * ) ; int (*read_status)(struct phy_device * ) ; int (*ack_interrupt)(struct phy_device * ) ; int (*config_intr)(struct phy_device * ) ; int (*did_interrupt)(struct phy_device * ) ; void (*remove)(struct phy_device * ) ; int (*match_phy_device)(struct phy_device * ) ; int (*ts_info)(struct phy_device * , struct ethtool_ts_info * ) ; int (*hwtstamp)(struct phy_device * , struct ifreq * ) ; bool (*rxtstamp)(struct phy_device * , struct sk_buff * , int ) ; void (*txtstamp)(struct phy_device * , struct sk_buff * , int ) ; int (*set_wol)(struct phy_device * , struct ethtool_wolinfo * ) ; void (*get_wol)(struct phy_device * , struct ethtool_wolinfo * ) ; void (*link_change_notify)(struct phy_device * ) ; int (*read_mmd_indirect)(struct phy_device * , int , int , int ) ; void (*write_mmd_indirect)(struct phy_device * , int , int , int , u32 ) ; int (*module_info)(struct phy_device * , struct ethtool_modinfo * ) ; int (*module_eeprom)(struct phy_device * , struct ethtool_eeprom * , u8 * ) ; struct device_driver driver ; }; struct fixed_phy_status { int link ; int speed ; int duplex ; int pause ; int asym_pause ; }; enum dsa_tag_protocol { DSA_TAG_PROTO_NONE = 0, DSA_TAG_PROTO_DSA = 1, DSA_TAG_PROTO_TRAILER = 2, DSA_TAG_PROTO_EDSA = 3, DSA_TAG_PROTO_BRCM = 4 } ; struct dsa_chip_data { struct device *host_dev ; int sw_addr ; int eeprom_len ; struct device_node *of_node ; char *port_names[12U] ; struct device_node *port_dn[12U] ; s8 *rtable ; }; struct dsa_platform_data { struct device *netdev ; struct net_device *of_netdev ; int nr_chips ; struct dsa_chip_data *chip ; }; struct packet_type; struct dsa_switch; struct dsa_switch_tree { struct dsa_platform_data *pd ; struct net_device *master_netdev ; int (*rcv)(struct sk_buff * , struct net_device * , struct packet_type * , struct net_device * ) ; enum dsa_tag_protocol tag_protocol ; s8 cpu_switch ; s8 cpu_port ; int link_poll_needed ; struct work_struct link_poll_work ; struct timer_list link_poll_timer ; struct dsa_switch *ds[4U] ; }; struct dsa_switch_driver; struct dsa_switch { struct dsa_switch_tree *dst ; int index ; enum dsa_tag_protocol tag_protocol ; struct dsa_chip_data *pd ; struct dsa_switch_driver *drv ; struct device *master_dev ; char hwmon_name[24U] ; struct device *hwmon_dev ; u32 dsa_port_mask ; u32 phys_port_mask ; u32 phys_mii_mask ; struct mii_bus *slave_mii_bus ; struct net_device *ports[12U] ; }; struct dsa_switch_driver { struct list_head list ; enum dsa_tag_protocol tag_protocol ; int priv_size ; char *(*probe)(struct device * , int ) ; int (*setup)(struct dsa_switch * ) ; int (*set_addr)(struct dsa_switch * , u8 * ) ; u32 (*get_phy_flags)(struct dsa_switch * , int ) ; int (*phy_read)(struct dsa_switch * , int , int ) ; int (*phy_write)(struct dsa_switch * , int , int , u16 ) ; void (*poll_link)(struct dsa_switch * ) ; void (*adjust_link)(struct dsa_switch * , int , struct phy_device * ) ; void (*fixed_link_update)(struct dsa_switch * , int , struct fixed_phy_status * ) ; void (*get_strings)(struct dsa_switch * , int , uint8_t * ) ; void (*get_ethtool_stats)(struct dsa_switch * , int , uint64_t * ) ; int (*get_sset_count)(struct dsa_switch * ) ; void (*get_wol)(struct dsa_switch * , int , struct ethtool_wolinfo * ) ; int (*set_wol)(struct dsa_switch * , int , struct ethtool_wolinfo * ) ; int (*suspend)(struct dsa_switch * ) ; int (*resume)(struct dsa_switch * ) ; int (*port_enable)(struct dsa_switch * , int , struct phy_device * ) ; void (*port_disable)(struct dsa_switch * , int , struct phy_device * ) ; int (*set_eee)(struct dsa_switch * , int , struct phy_device * , struct ethtool_eee * ) ; int (*get_eee)(struct dsa_switch * , int , struct ethtool_eee * ) ; int (*get_temp)(struct dsa_switch * , int * ) ; int (*get_temp_limit)(struct dsa_switch * , int * ) ; int (*set_temp_limit)(struct dsa_switch * , int ) ; int (*get_temp_alarm)(struct dsa_switch * , bool * ) ; int (*get_eeprom_len)(struct dsa_switch * ) ; int (*get_eeprom)(struct dsa_switch * , struct ethtool_eeprom * , u8 * ) ; int (*set_eeprom)(struct dsa_switch * , struct ethtool_eeprom * , u8 * ) ; int (*get_regs_len)(struct dsa_switch * , int ) ; void (*get_regs)(struct dsa_switch * , int , struct ethtool_regs * , void * ) ; int (*port_join_bridge)(struct dsa_switch * , int , u32 ) ; int (*port_leave_bridge)(struct dsa_switch * , int , u32 ) ; int (*port_stp_update)(struct dsa_switch * , int , u8 ) ; int (*fdb_add)(struct dsa_switch * , int , unsigned char const * , u16 ) ; int (*fdb_del)(struct dsa_switch * , int , unsigned char const * , u16 ) ; int (*fdb_getnext)(struct dsa_switch * , int , unsigned char * , bool * ) ; }; struct ieee_ets { __u8 willing ; __u8 ets_cap ; __u8 cbs ; __u8 tc_tx_bw[8U] ; __u8 tc_rx_bw[8U] ; __u8 tc_tsa[8U] ; __u8 prio_tc[8U] ; __u8 tc_reco_bw[8U] ; __u8 tc_reco_tsa[8U] ; __u8 reco_prio_tc[8U] ; }; struct ieee_maxrate { __u64 tc_maxrate[8U] ; }; struct ieee_qcn { __u8 rpg_enable[8U] ; __u32 rppp_max_rps[8U] ; __u32 rpg_time_reset[8U] ; __u32 rpg_byte_reset[8U] ; __u32 rpg_threshold[8U] ; __u32 rpg_max_rate[8U] ; __u32 rpg_ai_rate[8U] ; __u32 rpg_hai_rate[8U] ; __u32 rpg_gd[8U] ; __u32 rpg_min_dec_fac[8U] ; __u32 rpg_min_rate[8U] ; __u32 cndd_state_machine[8U] ; }; struct ieee_qcn_stats { __u64 rppp_rp_centiseconds[8U] ; __u32 rppp_created_rps[8U] ; }; struct ieee_pfc { __u8 pfc_cap ; __u8 pfc_en ; __u8 mbc ; __u16 delay ; __u64 requests[8U] ; __u64 indications[8U] ; }; struct cee_pg { __u8 willing ; __u8 error ; __u8 pg_en ; __u8 tcs_supported ; __u8 pg_bw[8U] ; __u8 prio_pg[8U] ; }; struct cee_pfc { __u8 willing ; __u8 error ; __u8 pfc_en ; __u8 tcs_supported ; }; struct dcb_app { __u8 selector ; __u8 priority ; __u16 protocol ; }; struct dcb_peer_app_info { __u8 willing ; __u8 error ; }; struct dcbnl_rtnl_ops { int (*ieee_getets)(struct net_device * , struct ieee_ets * ) ; int (*ieee_setets)(struct net_device * , struct ieee_ets * ) ; int (*ieee_getmaxrate)(struct net_device * , struct ieee_maxrate * ) ; int (*ieee_setmaxrate)(struct net_device * , struct ieee_maxrate * ) ; int (*ieee_getqcn)(struct net_device * , struct ieee_qcn * ) ; int (*ieee_setqcn)(struct net_device * , struct ieee_qcn * ) ; int (*ieee_getqcnstats)(struct net_device * , struct ieee_qcn_stats * ) ; int (*ieee_getpfc)(struct net_device * , struct ieee_pfc * ) ; int (*ieee_setpfc)(struct net_device * , struct ieee_pfc * ) ; int (*ieee_getapp)(struct net_device * , struct dcb_app * ) ; int (*ieee_setapp)(struct net_device * , struct dcb_app * ) ; int (*ieee_delapp)(struct net_device * , struct dcb_app * ) ; int (*ieee_peer_getets)(struct net_device * , struct ieee_ets * ) ; int (*ieee_peer_getpfc)(struct net_device * , struct ieee_pfc * ) ; 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 * ) ; int (*getnumtcs)(struct net_device * , int , u8 * ) ; int (*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 ) ; int (*setapp)(struct net_device * , u8 , u16 , u8 ) ; int (*getapp)(struct net_device * , u8 , u16 ) ; u8 (*getfeatcfg)(struct net_device * , int , u8 * ) ; u8 (*setfeatcfg)(struct net_device * , int , u8 ) ; u8 (*getdcbx)(struct net_device * ) ; u8 (*setdcbx)(struct net_device * , u8 ) ; int (*peer_getappinfo)(struct net_device * , struct dcb_peer_app_info * , u16 * ) ; int (*peer_getapptable)(struct net_device * , struct dcb_app * ) ; int (*cee_peer_getpg)(struct net_device * , struct cee_pg * ) ; int (*cee_peer_getpfc)(struct net_device * , struct cee_pfc * ) ; }; struct taskstats { __u16 version ; __u32 ac_exitcode ; __u8 ac_flag ; __u8 ac_nice ; __u64 cpu_count ; __u64 cpu_delay_total ; __u64 blkio_count ; __u64 blkio_delay_total ; __u64 swapin_count ; __u64 swapin_delay_total ; __u64 cpu_run_real_total ; __u64 cpu_run_virtual_total ; char ac_comm[32U] ; __u8 ac_sched ; __u8 ac_pad[3U] ; __u32 ac_uid ; __u32 ac_gid ; __u32 ac_pid ; __u32 ac_ppid ; __u32 ac_btime ; __u64 ac_etime ; __u64 ac_utime ; __u64 ac_stime ; __u64 ac_minflt ; __u64 ac_majflt ; __u64 coremem ; __u64 virtmem ; __u64 hiwater_rss ; __u64 hiwater_vm ; __u64 read_char ; __u64 write_char ; __u64 read_syscalls ; __u64 write_syscalls ; __u64 read_bytes ; __u64 write_bytes ; __u64 cancelled_write_bytes ; __u64 nvcsw ; __u64 nivcsw ; __u64 ac_utimescaled ; __u64 ac_stimescaled ; __u64 cpu_scaled_run_real_total ; __u64 freepages_count ; __u64 freepages_delay_total ; }; struct netprio_map { struct callback_head rcu ; u32 priomap_len ; u32 priomap[] ; }; struct mnt_namespace; struct ipc_namespace; struct nsproxy { atomic_t count ; struct uts_namespace *uts_ns ; struct ipc_namespace *ipc_ns ; struct mnt_namespace *mnt_ns ; struct pid_namespace *pid_ns_for_children ; struct net *net_ns ; }; struct nlmsghdr { __u32 nlmsg_len ; __u16 nlmsg_type ; __u16 nlmsg_flags ; __u32 nlmsg_seq ; __u32 nlmsg_pid ; }; struct nlattr { __u16 nla_len ; __u16 nla_type ; }; struct netlink_callback { struct sk_buff *skb ; struct nlmsghdr const *nlh ; int (*dump)(struct sk_buff * , struct netlink_callback * ) ; int (*done)(struct netlink_callback * ) ; void *data ; struct module *module ; u16 family ; u16 min_dump_alloc ; unsigned int prev_seq ; unsigned int seq ; long args[6U] ; }; struct ndmsg { __u8 ndm_family ; __u8 ndm_pad1 ; __u16 ndm_pad2 ; __s32 ndm_ifindex ; __u16 ndm_state ; __u8 ndm_flags ; __u8 ndm_type ; }; 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_stats { __u64 rx_packets ; __u64 tx_packets ; __u64 rx_bytes ; __u64 tx_bytes ; __u64 broadcast ; __u64 multicast ; }; struct ifla_vf_info { __u32 vf ; __u8 mac[32U] ; __u32 vlan ; __u32 qos ; __u32 spoofchk ; __u32 linkstate ; __u32 min_tx_rate ; __u32 max_tx_rate ; __u32 rss_query_en ; }; struct netpoll_info; struct wireless_dev; struct wpan_dev; struct mpls_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 neigh_parms; struct netdev_hw_addr_list { struct list_head list ; int count ; }; struct hh_cache { u16 hh_len ; u16 __pad ; 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 (*cache)(struct neighbour const * , struct hh_cache * , __be16 ) ; void (*cache_update)(struct hh_cache * , struct net_device const * , unsigned char const * ) ; }; struct napi_struct { struct list_head poll_list ; unsigned long state ; int weight ; unsigned int gro_count ; int (*poll)(struct napi_struct * , int ) ; spinlock_t poll_lock ; int poll_owner ; struct net_device *dev ; struct sk_buff *gro_list ; struct sk_buff *skb ; struct hrtimer timer ; struct list_head dev_list ; struct hlist_node napi_hash_node ; unsigned int napi_id ; }; enum rx_handler_result { RX_HANDLER_CONSUMED = 0, RX_HANDLER_ANOTHER = 1, RX_HANDLER_EXACT = 2, RX_HANDLER_PASS = 3 } ; typedef enum rx_handler_result rx_handler_result_t; typedef rx_handler_result_t rx_handler_func_t(struct sk_buff ** ); struct Qdisc; struct netdev_queue { struct net_device *dev ; struct Qdisc *qdisc ; struct Qdisc *qdisc_sleeping ; struct kobject kobj ; int numa_node ; spinlock_t _xmit_lock ; int xmit_lock_owner ; unsigned long trans_start ; unsigned long trans_timeout ; unsigned long state ; struct dql dql ; unsigned long tx_maxrate ; }; struct rps_map { unsigned int len ; struct callback_head rcu ; u16 cpus[0U] ; }; struct rps_dev_flow { u16 cpu ; u16 filter ; unsigned int last_qtail ; }; struct rps_dev_flow_table { unsigned int mask ; struct callback_head rcu ; 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 net_device *dev ; }; struct xps_map { unsigned int len ; unsigned int alloc_len ; struct callback_head rcu ; u16 queues[0U] ; }; struct xps_dev_maps { struct callback_head rcu ; struct xps_map *cpu_map[0U] ; }; struct netdev_tc_txq { u16 count ; u16 offset ; }; struct netdev_fcoe_hbainfo { char manufacturer[64U] ; char serial_number[64U] ; char hardware_version[64U] ; char driver_version[64U] ; char optionrom_version[64U] ; char firmware_version[64U] ; char model[256U] ; char model_description[256U] ; }; struct netdev_phys_item_id { unsigned char id[32U] ; unsigned char id_len ; }; 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 * , u16 (*)(struct net_device * , struct sk_buff * ) ) ; void (*ndo_change_rx_flags)(struct net_device * , int ) ; void (*ndo_set_rx_mode)(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 * ) ; int (*ndo_vlan_rx_add_vid)(struct net_device * , __be16 , u16 ) ; int (*ndo_vlan_rx_kill_vid)(struct net_device * , __be16 , u16 ) ; 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_busy_poll)(struct napi_struct * ) ; 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_rate)(struct net_device * , int , int , int ) ; int (*ndo_set_vf_spoofchk)(struct net_device * , int , bool ) ; int (*ndo_get_vf_config)(struct net_device * , int , struct ifla_vf_info * ) ; int (*ndo_set_vf_link_state)(struct net_device * , int , int ) ; int (*ndo_get_vf_stats)(struct net_device * , int , struct ifla_vf_stats * ) ; 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_set_vf_rss_query_en)(struct net_device * , int , bool ) ; int (*ndo_setup_tc)(struct net_device * , u8 ) ; 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_ddp_target)(struct net_device * , u16 , struct scatterlist * , unsigned int ) ; int (*ndo_fcoe_get_hbainfo)(struct net_device * , struct netdev_fcoe_hbainfo * ) ; int (*ndo_fcoe_get_wwn)(struct net_device * , u64 * , int ) ; int (*ndo_rx_flow_steer)(struct net_device * , struct sk_buff const * , u16 , u32 ) ; int (*ndo_add_slave)(struct net_device * , struct net_device * ) ; int (*ndo_del_slave)(struct net_device * , struct net_device * ) ; netdev_features_t (*ndo_fix_features)(struct net_device * , netdev_features_t ) ; int (*ndo_set_features)(struct net_device * , netdev_features_t ) ; int (*ndo_neigh_construct)(struct neighbour * ) ; void (*ndo_neigh_destroy)(struct neighbour * ) ; int (*ndo_fdb_add)(struct ndmsg * , struct nlattr ** , struct net_device * , unsigned char const * , u16 , u16 ) ; int (*ndo_fdb_del)(struct ndmsg * , struct nlattr ** , struct net_device * , unsigned char const * , u16 ) ; int (*ndo_fdb_dump)(struct sk_buff * , struct netlink_callback * , struct net_device * , struct net_device * , int ) ; int (*ndo_bridge_setlink)(struct net_device * , struct nlmsghdr * , u16 ) ; int (*ndo_bridge_getlink)(struct sk_buff * , u32 , u32 , struct net_device * , u32 , int ) ; int (*ndo_bridge_dellink)(struct net_device * , struct nlmsghdr * , u16 ) ; int (*ndo_change_carrier)(struct net_device * , bool ) ; int (*ndo_get_phys_port_id)(struct net_device * , struct netdev_phys_item_id * ) ; int (*ndo_get_phys_port_name)(struct net_device * , char * , size_t ) ; void (*ndo_add_vxlan_port)(struct net_device * , sa_family_t , __be16 ) ; void (*ndo_del_vxlan_port)(struct net_device * , sa_family_t , __be16 ) ; void *(*ndo_dfwd_add_station)(struct net_device * , struct net_device * ) ; void (*ndo_dfwd_del_station)(struct net_device * , void * ) ; netdev_tx_t (*ndo_dfwd_start_xmit)(struct sk_buff * , struct net_device * , void * ) ; int (*ndo_get_lock_subclass)(struct net_device * ) ; netdev_features_t (*ndo_features_check)(struct sk_buff * , struct net_device * , netdev_features_t ) ; int (*ndo_set_tx_maxrate)(struct net_device * , int , u32 ) ; int (*ndo_get_iflink)(struct net_device const * ) ; }; struct __anonstruct_adj_list_315 { struct list_head upper ; struct list_head lower ; }; struct __anonstruct_all_adj_list_316 { struct list_head upper ; struct list_head lower ; }; struct iw_handler_def; struct iw_public_data; struct switchdev_ops; struct vlan_info; struct tipc_bearer; struct in_device; struct dn_dev; struct inet6_dev; struct tcf_proto; struct cpu_rmap; struct pcpu_lstats; struct pcpu_sw_netstats; struct pcpu_dstats; struct pcpu_vstats; union __anonunion____missing_field_name_317 { void *ml_priv ; struct pcpu_lstats *lstats ; struct pcpu_sw_netstats *tstats ; struct pcpu_dstats *dstats ; struct pcpu_vstats *vstats ; }; struct garp_port; struct mrp_port; struct rtnl_link_ops; struct net_device { char name[16U] ; struct hlist_node name_hlist ; char *ifalias ; unsigned long mem_end ; unsigned long mem_start ; unsigned long base_addr ; int irq ; atomic_t carrier_changes ; unsigned long state ; struct list_head dev_list ; struct list_head napi_list ; struct list_head unreg_list ; struct list_head close_list ; struct list_head ptype_all ; struct list_head ptype_specific ; struct __anonstruct_adj_list_315 adj_list ; struct __anonstruct_all_adj_list_316 all_adj_list ; netdev_features_t features ; netdev_features_t hw_features ; netdev_features_t wanted_features ; netdev_features_t vlan_features ; netdev_features_t hw_enc_features ; netdev_features_t mpls_features ; int ifindex ; int group ; struct net_device_stats stats ; atomic_long_t rx_dropped ; atomic_long_t tx_dropped ; 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 switchdev_ops const *switchdev_ops ; struct header_ops const *header_ops ; unsigned int flags ; unsigned int priv_flags ; unsigned short gflags ; unsigned short padded ; unsigned char operstate ; unsigned char link_mode ; unsigned char if_port ; unsigned char dma ; unsigned int mtu ; unsigned short type ; unsigned short hard_header_len ; unsigned short needed_headroom ; unsigned short needed_tailroom ; unsigned char perm_addr[32U] ; unsigned char addr_assign_type ; unsigned char addr_len ; unsigned short neigh_priv_len ; unsigned short dev_id ; unsigned short dev_port ; spinlock_t addr_list_lock ; unsigned char name_assign_type ; bool uc_promisc ; struct netdev_hw_addr_list uc ; struct netdev_hw_addr_list mc ; struct netdev_hw_addr_list dev_addrs ; struct kset *queues_kset ; unsigned int promiscuity ; unsigned int allmulti ; struct vlan_info *vlan_info ; struct dsa_switch_tree *dsa_ptr ; struct tipc_bearer *tipc_ptr ; void *atalk_ptr ; struct in_device *ip_ptr ; struct dn_dev *dn_ptr ; struct inet6_dev *ip6_ptr ; void *ax25_ptr ; struct wireless_dev *ieee80211_ptr ; struct wpan_dev *ieee802154_ptr ; struct mpls_dev *mpls_ptr ; unsigned long last_rx ; unsigned char *dev_addr ; struct netdev_rx_queue *_rx ; unsigned int num_rx_queues ; unsigned int real_num_rx_queues ; unsigned long gro_flush_timeout ; rx_handler_func_t *rx_handler ; void *rx_handler_data ; struct tcf_proto *ingress_cl_list ; struct netdev_queue *ingress_queue ; struct list_head nf_hooks_ingress ; unsigned char broadcast[32U] ; struct cpu_rmap *rx_cpu_rmap ; struct hlist_node index_hlist ; 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 ; int watchdog_timeo ; struct xps_dev_maps *xps_maps ; unsigned long trans_start ; struct timer_list watchdog_timer ; int *pcpu_refcnt ; struct list_head todo_list ; struct list_head link_watch_list ; unsigned char reg_state ; bool dismantle ; unsigned short rtnl_link_state ; void (*destructor)(struct net_device * ) ; struct netpoll_info *npinfo ; possible_net_t nd_net ; union __anonunion____missing_field_name_317 __annonCompField94 ; struct garp_port *garp_port ; struct mrp_port *mrp_port ; struct device dev ; struct attribute_group const *sysfs_groups[4U] ; struct attribute_group const *sysfs_rx_queue_group ; struct rtnl_link_ops const *rtnl_link_ops ; unsigned int gso_max_size ; u16 gso_max_segs ; u16 gso_min_segs ; struct dcbnl_rtnl_ops const *dcbnl_ops ; u8 num_tc ; struct netdev_tc_txq tc_to_txq[16U] ; u8 prio_tc_map[16U] ; unsigned int fcoe_ddp_xid ; struct netprio_map *priomap ; struct phy_device *phydev ; struct lock_class_key *qdisc_tx_busylock ; }; struct packet_type { __be16 type ; struct net_device *dev ; int (*func)(struct sk_buff * , struct net_device * , struct packet_type * , struct net_device * ) ; bool (*id_match)(struct packet_type * , struct sock * ) ; void *af_packet_priv ; struct list_head list ; }; struct pcpu_sw_netstats { u64 rx_packets ; u64 rx_bytes ; u64 tx_packets ; u64 tx_bytes ; struct u64_stats_sync syncp ; }; enum skb_free_reason { SKB_REASON_CONSUMED = 0, SKB_REASON_DROPPED = 1 } ; enum led_brightness { LED_OFF = 0, LED_HALF = 127, LED_FULL = 255 } ; struct led_trigger; struct led_classdev { char const *name ; enum led_brightness brightness ; enum led_brightness max_brightness ; int flags ; void (*brightness_set)(struct led_classdev * , enum led_brightness ) ; int (*brightness_set_sync)(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 attribute_group const **groups ; struct list_head node ; char const *default_trigger ; unsigned long blink_delay_on ; unsigned long blink_delay_off ; struct timer_list blink_timer ; int blink_brightness ; void (*flash_resume)(struct led_classdev * ) ; struct work_struct set_brightness_work ; int delayed_set_value ; struct rw_semaphore trigger_lock ; struct led_trigger *trigger ; struct list_head trig_list ; void *trigger_data ; bool activated ; struct mutex led_access ; }; 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 ieee80211_msrment_ie { u8 token ; u8 mode ; u8 type ; u8 request[0U] ; }; struct ieee80211_ext_chansw_ie { u8 mode ; u8 new_operating_class ; u8 new_ch_num ; u8 count ; }; struct ieee80211_tpc_report_ie { u8 tx_power ; u8 link_margin ; }; struct __anonstruct_auth_327 { __le16 auth_alg ; __le16 auth_transaction ; __le16 status_code ; u8 variable[0U] ; }; struct __anonstruct_deauth_328 { __le16 reason_code ; }; struct __anonstruct_assoc_req_329 { __le16 capab_info ; __le16 listen_interval ; u8 variable[0U] ; }; struct __anonstruct_assoc_resp_330 { __le16 capab_info ; __le16 status_code ; __le16 aid ; u8 variable[0U] ; }; struct __anonstruct_reassoc_resp_331 { __le16 capab_info ; __le16 status_code ; __le16 aid ; u8 variable[0U] ; }; struct __anonstruct_reassoc_req_332 { __le16 capab_info ; __le16 listen_interval ; u8 current_ap[6U] ; u8 variable[0U] ; }; struct __anonstruct_disassoc_333 { __le16 reason_code ; }; struct __anonstruct_beacon_334 { __le64 timestamp ; __le16 beacon_int ; __le16 capab_info ; u8 variable[0U] ; }; struct __anonstruct_probe_req_335 { u8 variable[0U] ; }; struct __anonstruct_probe_resp_336 { __le64 timestamp ; __le16 beacon_int ; __le16 capab_info ; u8 variable[0U] ; }; struct __anonstruct_wme_action_339 { u8 action_code ; u8 dialog_token ; u8 status_code ; u8 variable[0U] ; }; struct __anonstruct_chan_switch_340 { u8 action_code ; u8 variable[0U] ; }; struct __anonstruct_ext_chan_switch_341 { u8 action_code ; struct ieee80211_ext_chansw_ie data ; u8 variable[0U] ; }; struct __anonstruct_measurement_342 { u8 action_code ; u8 dialog_token ; u8 element_id ; u8 length ; struct ieee80211_msrment_ie msr_elem ; }; struct __anonstruct_addba_req_343 { u8 action_code ; u8 dialog_token ; __le16 capab ; __le16 timeout ; __le16 start_seq_num ; }; struct __anonstruct_addba_resp_344 { u8 action_code ; u8 dialog_token ; __le16 status ; __le16 capab ; __le16 timeout ; }; struct __anonstruct_delba_345 { u8 action_code ; __le16 params ; __le16 reason_code ; }; struct __anonstruct_self_prot_346 { u8 action_code ; u8 variable[0U] ; }; struct __anonstruct_mesh_action_347 { u8 action_code ; u8 variable[0U] ; }; struct __anonstruct_sa_query_348 { u8 action ; u8 trans_id[2U] ; }; struct __anonstruct_ht_smps_349 { u8 action ; u8 smps_control ; }; struct __anonstruct_ht_notify_cw_350 { u8 action_code ; u8 chanwidth ; }; struct __anonstruct_tdls_discover_resp_351 { u8 action_code ; u8 dialog_token ; __le16 capability ; u8 variable[0U] ; }; struct __anonstruct_vht_opmode_notif_352 { u8 action_code ; u8 operating_mode ; }; struct __anonstruct_tpc_report_353 { u8 action_code ; u8 dialog_token ; u8 tpc_elem_id ; u8 tpc_elem_length ; struct ieee80211_tpc_report_ie tpc ; }; union __anonunion_u_338 { struct __anonstruct_wme_action_339 wme_action ; struct __anonstruct_chan_switch_340 chan_switch ; struct __anonstruct_ext_chan_switch_341 ext_chan_switch ; struct __anonstruct_measurement_342 measurement ; struct __anonstruct_addba_req_343 addba_req ; struct __anonstruct_addba_resp_344 addba_resp ; struct __anonstruct_delba_345 delba ; struct __anonstruct_self_prot_346 self_prot ; struct __anonstruct_mesh_action_347 mesh_action ; struct __anonstruct_sa_query_348 sa_query ; struct __anonstruct_ht_smps_349 ht_smps ; struct __anonstruct_ht_notify_cw_350 ht_notify_cw ; struct __anonstruct_tdls_discover_resp_351 tdls_discover_resp ; struct __anonstruct_vht_opmode_notif_352 vht_opmode_notif ; struct __anonstruct_tpc_report_353 tpc_report ; }; struct __anonstruct_action_337 { u8 category ; union __anonunion_u_338 u ; }; union __anonunion_u_326 { struct __anonstruct_auth_327 auth ; struct __anonstruct_deauth_328 deauth ; struct __anonstruct_assoc_req_329 assoc_req ; struct __anonstruct_assoc_resp_330 assoc_resp ; struct __anonstruct_reassoc_resp_331 reassoc_resp ; struct __anonstruct_reassoc_req_332 reassoc_req ; struct __anonstruct_disassoc_333 disassoc ; struct __anonstruct_beacon_334 beacon ; struct __anonstruct_probe_req_335 probe_req ; struct __anonstruct_probe_resp_336 probe_resp ; struct __anonstruct_action_337 action ; }; struct ieee80211_mgmt { __le16 frame_control ; __le16 duration ; u8 da[6U] ; u8 sa[6U] ; u8 bssid[6U] ; __le16 seq_ctrl ; union __anonunion_u_326 u ; }; struct ieee80211_p2p_noa_desc { u8 count ; __le32 duration ; __le32 interval ; __le32 start_time ; }; struct ieee80211_p2p_noa_attr { u8 index ; u8 oppps_ctwindow ; struct ieee80211_p2p_noa_desc desc[4U] ; }; struct ieee80211_mcs_info { u8 rx_mask[10U] ; __le16 rx_highest ; u8 tx_params ; u8 reserved[3U] ; }; struct ieee80211_ht_cap { __le16 cap_info ; u8 ampdu_params_info ; struct ieee80211_mcs_info mcs ; __le16 extended_ht_cap_info ; __le32 tx_BF_cap_info ; u8 antenna_selection_info ; }; struct ieee80211_vht_mcs_info { __le16 rx_mcs_map ; __le16 rx_highest ; __le16 tx_mcs_map ; __le16 tx_highest ; }; struct ieee80211_vht_cap { __le32 vht_cap_info ; struct ieee80211_vht_mcs_info supp_mcs ; }; 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_P2P_CLIENT = 8, NL80211_IFTYPE_P2P_GO = 9, NL80211_IFTYPE_P2P_DEVICE = 10, NL80211_IFTYPE_OCB = 11, NUM_NL80211_IFTYPES = 12, NL80211_IFTYPE_MAX = 11 } ; 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_dfs_regions { NL80211_DFS_UNSET = 0, NL80211_DFS_FCC = 1, NL80211_DFS_ETSI = 2, NL80211_DFS_JP = 3 } ; enum nl80211_user_reg_hint_type { NL80211_USER_REG_HINT_USER = 0, NL80211_USER_REG_HINT_CELL_BASE = 1, NL80211_USER_REG_HINT_INDOOR = 2 } ; enum nl80211_chan_width { NL80211_CHAN_WIDTH_20_NOHT = 0, NL80211_CHAN_WIDTH_20 = 1, NL80211_CHAN_WIDTH_40 = 2, NL80211_CHAN_WIDTH_80 = 3, NL80211_CHAN_WIDTH_80P80 = 4, NL80211_CHAN_WIDTH_160 = 5, NL80211_CHAN_WIDTH_5 = 6, NL80211_CHAN_WIDTH_10 = 7 } ; enum nl80211_bss_scan_width { NL80211_BSS_CHAN_WIDTH_20 = 0, NL80211_BSS_CHAN_WIDTH_10 = 1, NL80211_BSS_CHAN_WIDTH_5 = 2 } ; 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_SAE = 4, __NL80211_AUTHTYPE_NUM = 5, NL80211_AUTHTYPE_MAX = 4, NL80211_AUTHTYPE_AUTOMATIC = 5 } ; enum nl80211_mfp { NL80211_MFP_NO = 0, NL80211_MFP_REQUIRED = 1 } ; enum nl80211_tx_power_setting { NL80211_TX_POWER_AUTOMATIC = 0, NL80211_TX_POWER_LIMITED = 1, NL80211_TX_POWER_FIXED = 2 } ; struct nl80211_wowlan_tcp_data_seq { __u32 start ; __u32 offset ; __u32 len ; }; struct nl80211_wowlan_tcp_data_token { __u32 offset ; __u32 len ; __u8 token_stream[] ; }; struct nl80211_wowlan_tcp_data_token_feature { __u32 min_len ; __u32 max_len ; __u32 bufsize ; }; enum nl80211_dfs_state { NL80211_DFS_USABLE = 0, NL80211_DFS_UNAVAILABLE = 1, NL80211_DFS_AVAILABLE = 2 } ; struct nl80211_vendor_cmd_info { __u32 vendor_id ; __u32 subcmd ; }; enum environment_cap { ENVIRON_ANY = 0, ENVIRON_INDOOR = 1, ENVIRON_OUTDOOR = 2 } ; struct regulatory_request { struct callback_head callback_head ; int wiphy_idx ; enum nl80211_reg_initiator initiator ; enum nl80211_user_reg_hint_type user_reg_hint_type ; char alpha2[2U] ; enum nl80211_dfs_regions dfs_region ; bool intersect ; bool processed ; 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 ; u32 dfs_cac_ms ; }; struct ieee80211_regdomain { struct callback_head callback_head ; u32 n_reg_rules ; char alpha2[3U] ; enum nl80211_dfs_regions dfs_region ; struct ieee80211_reg_rule reg_rules[] ; }; struct wiphy; enum ieee80211_band { IEEE80211_BAND_2GHZ = 0, IEEE80211_BAND_5GHZ = 1, IEEE80211_BAND_60GHZ = 2, IEEE80211_NUM_BANDS = 3 } ; struct ieee80211_channel { enum ieee80211_band band ; u16 center_freq ; u16 hw_value ; u32 flags ; int max_antenna_gain ; int max_power ; int max_reg_power ; bool beacon_found ; u32 orig_flags ; int orig_mag ; int orig_mpwr ; enum nl80211_dfs_state dfs_state ; unsigned long dfs_state_entered ; unsigned int dfs_cac_ms ; }; 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_sta_vht_cap { bool vht_supported ; u32 cap ; struct ieee80211_vht_mcs_info vht_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 ieee80211_sta_vht_cap vht_cap ; }; struct cfg80211_chan_def { struct ieee80211_channel *chan ; enum nl80211_chan_width width ; u32 center_freq1 ; u32 center_freq2 ; }; struct survey_info { struct ieee80211_channel *channel ; u64 time ; u64 time_busy ; u64 time_ext_busy ; u64 time_rx ; u64 time_tx ; u64 time_scan ; u32 filled ; s8 noise ; }; 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 ; __be16 control_port_ethertype ; bool control_port_no_encrypt ; }; struct mac_address { u8 addr[6U] ; }; struct cfg80211_ssid { u8 ssid[32U] ; u8 ssid_len ; }; struct cfg80211_scan_request { struct cfg80211_ssid *ssids ; int n_ssids ; u32 n_channels ; enum nl80211_bss_scan_width scan_width ; u8 const *ie ; size_t ie_len ; u32 flags ; u32 rates[3U] ; struct wireless_dev *wdev ; u8 mac_addr[6U] ; u8 mac_addr_mask[6U] ; struct wiphy *wiphy ; unsigned long scan_start ; bool aborted ; bool notified ; bool no_cck ; struct ieee80211_channel *channels[0U] ; }; struct cfg80211_match_set { struct cfg80211_ssid ssid ; s32 rssi_thold ; }; struct cfg80211_sched_scan_request { struct cfg80211_ssid *ssids ; int n_ssids ; u32 n_channels ; enum nl80211_bss_scan_width scan_width ; u32 interval ; u8 const *ie ; size_t ie_len ; u32 flags ; struct cfg80211_match_set *match_sets ; int n_match_sets ; s32 min_rssi_thold ; u32 delay ; u8 mac_addr[6U] ; u8 mac_addr_mask[6U] ; struct wiphy *wiphy ; struct net_device *dev ; unsigned long scan_start ; struct callback_head callback_head ; u32 owner_nlportid ; 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_ibss_params { u8 const *ssid ; u8 const *bssid ; struct cfg80211_chan_def chandef ; u8 const *ie ; u8 ssid_len ; u8 ie_len ; u16 beacon_interval ; u32 basic_rates ; bool channel_fixed ; bool privacy ; bool control_port ; bool userspace_handles_dfs ; int mcast_rate[3U] ; struct ieee80211_ht_cap ht_capa ; struct ieee80211_ht_cap ht_capa_mask ; }; struct cfg80211_connect_params { struct ieee80211_channel *channel ; struct ieee80211_channel *channel_hint ; u8 const *bssid ; u8 const *bssid_hint ; u8 const *ssid ; size_t ssid_len ; enum nl80211_auth_type auth_type ; u8 const *ie ; size_t ie_len ; bool privacy ; enum nl80211_mfp mfp ; struct cfg80211_crypto_settings crypto ; u8 const *key ; u8 key_len ; u8 key_idx ; u32 flags ; int bg_scan_period ; struct ieee80211_ht_cap ht_capa ; struct ieee80211_ht_cap ht_capa_mask ; struct ieee80211_vht_cap vht_capa ; struct ieee80211_vht_cap vht_capa_mask ; }; struct cfg80211_pkt_pattern { u8 const *mask ; u8 const *pattern ; int pattern_len ; int pkt_offset ; }; struct cfg80211_wowlan_tcp { struct socket *sock ; __be32 src ; __be32 dst ; u16 src_port ; u16 dst_port ; u8 dst_mac[6U] ; int payload_len ; u8 const *payload ; struct nl80211_wowlan_tcp_data_seq payload_seq ; u32 data_interval ; u32 wake_len ; u8 const *wake_data ; u8 const *wake_mask ; u32 tokens_size ; struct nl80211_wowlan_tcp_data_token payload_tok ; }; struct cfg80211_wowlan { bool any ; bool disconnect ; bool magic_pkt ; bool gtk_rekey_failure ; bool eap_identity_req ; bool four_way_handshake ; bool rfkill_release ; struct cfg80211_pkt_pattern *patterns ; struct cfg80211_wowlan_tcp *tcp ; int n_patterns ; struct cfg80211_sched_scan_request *nd_config ; }; struct ieee80211_iface_limit { u16 max ; u16 types ; }; struct ieee80211_iface_combination { struct ieee80211_iface_limit const *limits ; u32 num_different_channels ; u16 max_interfaces ; u8 n_limits ; bool beacon_int_infra_match ; u8 radar_detect_widths ; u8 radar_detect_regions ; }; struct ieee80211_txrx_stypes { u16 tx ; u16 rx ; }; struct wiphy_wowlan_tcp_support { struct nl80211_wowlan_tcp_data_token_feature const *tok ; u32 data_payload_max ; u32 data_interval_max ; u32 wake_payload_max ; bool seq ; }; struct wiphy_wowlan_support { u32 flags ; int n_patterns ; int pattern_max_len ; int pattern_min_len ; int max_pkt_offset ; int max_nd_match_sets ; struct wiphy_wowlan_tcp_support const *tcp ; }; struct wiphy_coalesce_support { int n_rules ; int max_delay ; int n_patterns ; int pattern_max_len ; int pattern_min_len ; int max_pkt_offset ; }; struct wiphy_vendor_command { struct nl80211_vendor_cmd_info info ; u32 flags ; int (*doit)(struct wiphy * , struct wireless_dev * , void const * , int ) ; }; struct wiphy { u8 perm_addr[6U] ; u8 addr_mask[6U] ; struct mac_address *addresses ; struct ieee80211_txrx_stypes const *mgmt_stypes ; struct ieee80211_iface_combination const *iface_combinations ; int n_iface_combinations ; u16 software_iftypes ; u16 n_addresses ; u16 interface_modes ; u16 max_acl_mac_addrs ; u32 flags ; u32 regulatory_flags ; u32 features ; u8 ext_features[1U] ; u32 ap_sme_capa ; enum cfg80211_signal_type signal_type ; int bss_priv_size ; u8 max_scan_ssids ; u8 max_sched_scan_ssids ; u8 max_match_sets ; u16 max_scan_ie_len ; u16 max_sched_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 ; struct wiphy_wowlan_support const *wowlan ; struct cfg80211_wowlan *wowlan_config ; u16 max_remain_on_channel_duration ; u8 max_num_pmkids ; u32 available_antennas_tx ; u32 available_antennas_rx ; u32 probe_resp_offload ; u8 const *extended_capabilities ; u8 const *extended_capabilities_mask ; u8 extended_capabilities_len ; void const *privid ; struct ieee80211_supported_band *bands[3U] ; void (*reg_notifier)(struct wiphy * , struct regulatory_request * ) ; struct ieee80211_regdomain const *regd ; struct device dev ; bool registered ; struct dentry *debugfsdir ; struct ieee80211_ht_cap const *ht_capa_mod_mask ; struct ieee80211_vht_cap const *vht_capa_mod_mask ; possible_net_t _net ; struct iw_handler_def const *wext ; struct wiphy_coalesce_support const *coalesce ; struct wiphy_vendor_command const *vendor_commands ; struct nl80211_vendor_cmd_info const *vendor_events ; int n_vendor_commands ; int n_vendor_events ; u16 max_ap_assoc_sta ; u8 max_num_csa_counters ; u8 max_adj_channel_rssi_comp ; char priv[0U] ; }; struct cfg80211_conn; struct cfg80211_internal_bss; struct cfg80211_cached_keys; struct __anonstruct_wext_366 { struct cfg80211_ibss_params ibss ; struct cfg80211_connect_params connect ; struct cfg80211_cached_keys *keys ; u8 const *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 ; u32 identifier ; struct list_head mgmt_registrations ; spinlock_t mgmt_registrations_lock ; struct mutex mtx ; bool use_4addr ; bool p2p_started ; u8 address[6U] ; u8 ssid[32U] ; u8 ssid_len ; u8 mesh_id_len ; u8 mesh_id_up_len ; struct cfg80211_conn *conn ; struct cfg80211_cached_keys *connect_keys ; struct list_head event_list ; spinlock_t event_lock ; struct cfg80211_internal_bss *current_bss ; struct cfg80211_chan_def preset_chandef ; struct cfg80211_chan_def chandef ; bool ibss_fixed ; bool ibss_dfs_possible ; bool ps ; int ps_timeout ; int beacon_interval ; u32 ap_unexpected_nlportid ; bool cac_started ; unsigned long cac_start_time ; unsigned int cac_time_ms ; u32 owner_nlportid ; struct __anonstruct_wext_366 wext ; }; struct ieee80211_chanctx_conf { struct cfg80211_chan_def def ; struct cfg80211_chan_def min_def ; u8 rx_chains_static ; u8 rx_chains_dynamic ; bool radar_enabled ; u8 drv_priv[0U] ; }; struct ieee80211_vif; struct ieee80211_sta; struct ieee80211_bss_conf { u8 const *bssid ; bool assoc ; bool ibss_joined ; bool ibss_creator ; 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 sync_tsf ; u32 sync_device_ts ; u8 sync_dtim_count ; u32 basic_rates ; struct ieee80211_rate *beacon_rate ; int mcast_rate[3U] ; u16 ht_operation_mode ; s32 cqm_rssi_thold ; u32 cqm_rssi_hyst ; struct cfg80211_chan_def chandef ; __be32 arp_addr_list[4U] ; int arp_addr_cnt ; bool qos ; bool idle ; bool ps ; u8 ssid[32U] ; size_t ssid_len ; bool hidden_ssid ; int txpower ; enum nl80211_tx_power_setting txpower_type ; struct ieee80211_p2p_noa_attr p2p_noa_attr ; }; struct ieee80211_tx_rate { s8 idx ; unsigned char count : 5 ; unsigned short flags : 11 ; }; struct __anonstruct____missing_field_name_371 { struct ieee80211_tx_rate rates[4U] ; s8 rts_cts_rate_idx ; unsigned char use_rts : 1 ; unsigned char use_cts_prot : 1 ; unsigned char short_preamble : 1 ; unsigned char skip_table : 1 ; }; union __anonunion____missing_field_name_370 { struct __anonstruct____missing_field_name_371 __annonCompField96 ; unsigned long jiffies ; }; struct ieee80211_key_conf; struct __anonstruct_control_369 { union __anonunion____missing_field_name_370 __annonCompField97 ; struct ieee80211_vif *vif ; struct ieee80211_key_conf *hw_key ; u32 flags ; }; struct __anonstruct_ack_372 { u64 cookie ; }; struct __anonstruct_status_373 { struct ieee80211_tx_rate rates[4U] ; s32 ack_signal ; u8 ampdu_ack_len ; u8 ampdu_len ; u8 antenna ; u16 tx_time ; void *status_driver_data[2U] ; }; struct __anonstruct____missing_field_name_374 { struct ieee80211_tx_rate driver_rates[4U] ; u8 pad[4U] ; void *rate_driver_data[3U] ; }; union __anonunion____missing_field_name_368 { struct __anonstruct_control_369 control ; struct __anonstruct_ack_372 ack ; struct __anonstruct_status_373 status ; struct __anonstruct____missing_field_name_374 __annonCompField98 ; void *driver_data[5U] ; }; struct ieee80211_tx_info { u32 flags ; u8 band ; u8 hw_queue ; u16 ack_frame_id ; union __anonunion____missing_field_name_368 __annonCompField99 ; }; 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 cfg80211_chan_def chandef ; bool radar_enabled ; enum ieee80211_smps_mode smps_mode ; }; struct ieee80211_txq; struct ieee80211_vif { enum nl80211_iftype type ; struct ieee80211_bss_conf bss_conf ; u8 addr[6U] ; bool p2p ; bool csa_active ; u8 cab_queue ; u8 hw_queue[4U] ; struct ieee80211_txq *txq ; struct ieee80211_chanctx_conf *chanctx_conf ; u32 driver_flags ; struct dentry *debugfs_dir ; u8 drv_priv[0U] ; }; struct ieee80211_key_conf { atomic64_t tx_pn ; u32 cipher ; u8 icv_len ; u8 iv_len ; u8 hw_key_idx ; u8 flags ; s8 keyidx ; u8 keylen ; u8 key[0U] ; }; struct ieee80211_cipher_scheme { u32 cipher ; u16 iftype ; u8 hdr_len ; u8 pn_len ; u8 pn_off ; u8 key_idx_off ; u8 key_idx_mask ; u8 key_idx_shift ; u8 mic_len ; }; enum ieee80211_sta_rx_bandwidth { IEEE80211_STA_RX_BW_20 = 0, IEEE80211_STA_RX_BW_40 = 1, IEEE80211_STA_RX_BW_80 = 2, IEEE80211_STA_RX_BW_160 = 3 } ; struct __anonstruct_rate_382 { s8 idx ; u8 count ; u8 count_cts ; u8 count_rts ; u16 flags ; }; struct ieee80211_sta_rates { struct callback_head callback_head ; struct __anonstruct_rate_382 rate[4U] ; }; struct ieee80211_sta { u32 supp_rates[3U] ; u8 addr[6U] ; u16 aid ; struct ieee80211_sta_ht_cap ht_cap ; struct ieee80211_sta_vht_cap vht_cap ; bool wme ; u8 uapsd_queues ; u8 max_sp ; u8 rx_nss ; enum ieee80211_sta_rx_bandwidth bandwidth ; enum ieee80211_smps_mode smps_mode ; struct ieee80211_sta_rates *rates ; bool tdls ; bool tdls_initiator ; bool mfp ; struct ieee80211_txq *txq[16U] ; u8 drv_priv[0U] ; }; struct ieee80211_txq { struct ieee80211_vif *vif ; struct ieee80211_sta *sta ; u8 tid ; u8 ac ; u8 drv_priv[0U] ; }; struct ieee80211_hw { struct ieee80211_conf conf ; struct wiphy *wiphy ; char const *rate_control_algorithm ; void *priv ; unsigned long flags[1U] ; unsigned int extra_tx_headroom ; unsigned int extra_beacon_tailroom ; int vif_data_size ; int sta_data_size ; int chanctx_data_size ; int txq_data_size ; u16 queues ; u16 max_listen_interval ; s8 max_signal ; u8 max_rates ; u8 max_report_rates ; u8 max_rate_tries ; u8 max_rx_aggregation_subframes ; u8 max_tx_aggregation_subframes ; u8 offchannel_tx_hw_queue ; u8 radiotap_mcs_details ; u16 radiotap_vht_details ; netdev_features_t netdev_features ; u8 uapsd_queues ; u8 uapsd_max_sp_len ; u8 n_cipher_schemes ; struct ieee80211_cipher_scheme const *cipher_schemes ; int txq_ac_max_pending ; }; struct __anonstruct_desc_383 { u32 start ; u32 duration ; u32 interval ; }; struct ieee80211_noa_data { u32 next_tsf ; bool has_next_tsf ; u8 absent ; u8 count[4U] ; struct __anonstruct_desc_383 desc[4U] ; }; struct ath_ani { bool caldone ; unsigned int longcal_timer ; unsigned int shortcal_timer ; unsigned int resetcal_timer ; unsigned int checkani_timer ; struct timer_list timer ; }; struct ath_cycle_counters { u32 cycles ; u32 rx_busy ; u32 rx_frame ; u32 tx_frame ; }; enum ath_device_state { ATH_HW_UNAVAILABLE = 0, ATH_HW_INITIALIZED = 1 } ; enum ath_bus_type { ATH_PCI = 0, ATH_AHB = 1, ATH_USB = 2 } ; struct reg_dmn_pair_mapping { u16 reg_domain ; u16 reg_5ghz_ctl ; u16 reg_2ghz_ctl ; }; struct ath_regulatory { char alpha2[2U] ; enum nl80211_dfs_regions region ; u16 country_code ; u16 max_power_level ; u16 current_rd ; int16_t power_limit ; struct reg_dmn_pair_mapping *regpair ; }; enum ath_crypt_caps { ATH_CRYPT_CAP_CIPHER_AESCCM = 1, ATH_CRYPT_CAP_MIC_COMBINED = 2 } ; struct ath_ops { unsigned int (*read)(void * , u32 ) ; void (*multi_read)(void * , u32 * , u32 * , u16 ) ; void (*write)(void * , u32 , u32 ) ; void (*enable_write_buffer)(void * ) ; void (*write_flush)(void * ) ; u32 (*rmw)(void * , u32 , u32 , u32 ) ; void (*enable_rmw_buffer)(void * ) ; void (*rmw_flush)(void * ) ; }; struct ath_bus_ops; struct ath_ps_ops { void (*wakeup)(struct ath_common * ) ; void (*restore)(struct ath_common * ) ; }; struct ath_common { void *ah ; void *priv ; struct ieee80211_hw *hw ; int debug_mask ; enum ath_device_state state ; unsigned long op_flags ; struct ath_ani ani ; u16 cachelsz ; u16 curaid ; u8 macaddr[6U] ; u8 curbssid[6U] ; u8 bssidmask[6U] ; u32 rx_bufsize ; u32 keymax ; unsigned long keymap[2U] ; unsigned long tkip_keymap[2U] ; unsigned long ccmp_keymap[2U] ; enum ath_crypt_caps crypt_caps ; unsigned int clockrate ; spinlock_t cc_lock ; struct ath_cycle_counters cc_ani ; struct ath_cycle_counters cc_survey ; struct ath_regulatory regulatory ; struct ath_regulatory reg_world_copy ; struct ath_ops const *ops ; struct ath_bus_ops const *bus_ops ; struct ath_ps_ops const *ps_ops ; bool btcoex_enabled ; bool disable_ani ; bool bt_ant_diversity ; int last_rssi ; struct ieee80211_supported_band sbands[3U] ; }; struct firmware { size_t size ; u8 const *data ; struct page **pages ; void *priv ; }; struct ath_tx_status { u32 ts_tstamp ; u16 ts_seqnum ; u8 ts_status ; u8 ts_rateindex ; int8_t ts_rssi ; u8 ts_shortretry ; u8 ts_longretry ; u8 ts_virtcol ; u8 ts_flags ; int8_t ts_rssi_ctl0 ; int8_t ts_rssi_ctl1 ; int8_t ts_rssi_ctl2 ; int8_t ts_rssi_ext0 ; int8_t ts_rssi_ext1 ; int8_t ts_rssi_ext2 ; u8 qid ; u16 desc_id ; u8 tid ; u32 ba_low ; u32 ba_high ; u32 evm0 ; u32 evm1 ; u32 evm2 ; u32 duration ; }; enum ath9k_tx_queue { ATH9K_TX_QUEUE_INACTIVE = 0, ATH9K_TX_QUEUE_DATA = 1, ATH9K_TX_QUEUE_BEACON = 2, ATH9K_TX_QUEUE_CAB = 3, ATH9K_TX_QUEUE_UAPSD = 4, ATH9K_TX_QUEUE_PSPOLL = 5 } ; enum ath9k_tx_queue_flags { TXQ_FLAG_TXINT_ENABLE = 1, TXQ_FLAG_TXDESCINT_ENABLE = 2, TXQ_FLAG_TXEOLINT_ENABLE = 4, TXQ_FLAG_TXURNINT_ENABLE = 8, TXQ_FLAG_BACKOFF_DISABLE = 16, TXQ_FLAG_COMPRESSION_ENABLE = 32, TXQ_FLAG_RDYTIME_EXP_POLICY_ENABLE = 64, TXQ_FLAG_FRAG_BURST_BACKOFF_ENABLE = 128 } ; enum ath9k_pkt_type { ATH9K_PKT_TYPE_NORMAL = 0, ATH9K_PKT_TYPE_ATIM = 1, ATH9K_PKT_TYPE_PSPOLL = 2, ATH9K_PKT_TYPE_BEACON = 3, ATH9K_PKT_TYPE_PROBE_RESP = 4, ATH9K_PKT_TYPE_CHIRP = 5, ATH9K_PKT_TYPE_GRP_POLL = 6 } ; struct ath9k_tx_queue_info { u32 tqi_ver ; enum ath9k_tx_queue tqi_type ; int tqi_subtype ; enum ath9k_tx_queue_flags tqi_qflags ; u32 tqi_priority ; u32 tqi_aifs ; u32 tqi_cwmin ; u32 tqi_cwmax ; u16 tqi_shretry ; u16 tqi_lgretry ; u32 tqi_cbrPeriod ; u32 tqi_cbrOverflowLimit ; u32 tqi_burstTime ; u32 tqi_readyTime ; u32 tqi_physCompBuf ; u32 tqi_intFlags ; }; struct ath9k_11n_rate_series { u32 Tries ; u32 Rate ; u32 PktDuration ; u32 ChSel ; u32 RateFlags ; }; enum aggr_type { AGGR_BUF_NONE = 0, AGGR_BUF_FIRST = 1, AGGR_BUF_MIDDLE = 2, AGGR_BUF_LAST = 3 } ; enum ath9k_key_type { ATH9K_KEY_TYPE_CLEAR = 0, ATH9K_KEY_TYPE_WEP = 1, ATH9K_KEY_TYPE_AES = 2, ATH9K_KEY_TYPE_TKIP = 3 } ; struct ath_tx_info { u8 qcu ; bool is_first ; bool is_last ; enum aggr_type aggr ; u8 ndelim ; u16 aggr_len ; dma_addr_t link ; int pkt_len ; u32 flags ; dma_addr_t buf_addr[4U] ; int buf_len[4U] ; struct ath9k_11n_rate_series rates[4U] ; u8 rtscts_rate ; bool dur_update ; enum ath9k_pkt_type type ; enum ath9k_key_type keytype ; u8 keyix ; u8 txpower[4U] ; }; struct ath_hw; struct ath9k_channel; enum ath9k_int; enum ath9k_int; enum ath9k_ani_cmd { ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION = 1, ATH9K_ANI_FIRSTEP_LEVEL = 2, ATH9K_ANI_SPUR_IMMUNITY_LEVEL = 4, ATH9K_ANI_MRC_CCK = 8, ATH9K_ANI_ALL = 4095 } ; struct ath9k_mib_stats { u32 ackrcv_bad ; u32 rts_bad ; u32 rts_good ; u32 fcs_bad ; u32 beacons ; }; struct ath9k_ani_default { u16 m1ThreshLow ; u16 m2ThreshLow ; u16 m1Thresh ; u16 m2Thresh ; u16 m2CountThr ; u16 m2CountThrLow ; u16 m1ThreshLowExt ; u16 m2ThreshLowExt ; u16 m1ThreshExt ; u16 m2ThreshExt ; u16 firstep ; u16 firstepLow ; u16 cycpwrThr1 ; u16 cycpwrThr1Ext ; }; struct ar5416AniState { u8 noiseImmunityLevel ; u8 ofdmNoiseImmunityLevel ; u8 cckNoiseImmunityLevel ; bool ofdmsTurn ; u8 mrcCCK ; u8 spurImmunityLevel ; u8 firstepLevel ; bool ofdmWeakSigDetect ; u32 listenTime ; u32 ofdmPhyErrCount ; u32 cckPhyErrCount ; struct ath9k_ani_default iniDef ; }; struct ar5416Stats { u32 ast_ani_spurup ; u32 ast_ani_spurdown ; u32 ast_ani_ofdmon ; u32 ast_ani_ofdmoff ; u32 ast_ani_cckhigh ; u32 ast_ani_ccklow ; u32 ast_ani_stepup ; u32 ast_ani_stepdown ; u32 ast_ani_ofdmerrs ; u32 ast_ani_cckerrs ; u32 ast_ani_reset ; u32 ast_ani_lneg_or_lzero ; u32 avgbrssi ; struct ath9k_mib_stats ast_mibstats ; }; struct eepFlags { u8 opFlags ; u8 eepMisc ; }; struct ar9300_base_eep_hdr { __le16 regDmn[2U] ; u8 txrxMask ; struct eepFlags opCapFlags ; u8 rfSilent ; u8 blueToothOptions ; u8 deviceCap ; u8 deviceType ; int8_t pwrTableOffset ; u8 params_for_tuning_caps[2U] ; u8 featureEnable ; u8 miscConfiguration ; u8 eepromWriteEnableGpio ; u8 wlanDisableGpio ; u8 wlanLedGpio ; u8 rxBandSelectGpio ; u8 txrxgain ; __le32 swreg ; }; struct ar9300_modal_eep_header { __le32 antCtrlCommon ; __le32 antCtrlCommon2 ; __le16 antCtrlChain[3U] ; u8 xatten1DB[3U] ; u8 xatten1Margin[3U] ; int8_t tempSlope ; int8_t voltSlope ; u8 spurChans[5U] ; int8_t noiseFloorThreshCh[3U] ; u8 reserved[11U] ; int8_t quick_drop ; u8 xpaBiasLvl ; u8 txFrameToDataStart ; u8 txFrameToPaOn ; u8 txClip ; int8_t antennaGain ; u8 switchSettling ; int8_t adcDesiredSize ; u8 txEndToXpaOff ; u8 txEndToRxOn ; u8 txFrameToXpaOn ; u8 thresh62 ; __le32 papdRateMaskHt20 ; __le32 papdRateMaskHt40 ; __le16 switchcomspdt ; u8 xlna_bias_strength ; u8 futureModal[7U] ; }; struct ar9300_cal_data_per_freq_op_loop { int8_t refPower ; u8 voltMeas ; u8 tempMeas ; int8_t rxNoisefloorCal ; int8_t rxNoisefloorPower ; u8 rxTempMeas ; }; struct cal_tgt_pow_legacy { u8 tPow2x[4U] ; }; struct cal_tgt_pow_ht { u8 tPow2x[14U] ; }; struct cal_ctl_data_2g { u8 ctlEdges[4U] ; }; struct cal_ctl_data_5g { u8 ctlEdges[8U] ; }; struct ar9300_BaseExtension_1 { u8 ant_div_control ; u8 future[2U] ; u8 misc_enable ; int8_t tempslopextension[8U] ; int8_t quick_drop_low ; int8_t quick_drop_high ; }; struct ar9300_BaseExtension_2 { int8_t tempSlopeLow ; int8_t tempSlopeHigh ; u8 xatten1DBLow[3U] ; u8 xatten1MarginLow[3U] ; u8 xatten1DBHigh[3U] ; u8 xatten1MarginHigh[3U] ; }; struct ar9300_eeprom { u8 eepromVersion ; u8 templateVersion ; u8 macAddr[6U] ; u8 custData[20U] ; struct ar9300_base_eep_hdr baseEepHeader ; struct ar9300_modal_eep_header modalHeader2G ; struct ar9300_BaseExtension_1 base_ext1 ; u8 calFreqPier2G[3U] ; struct ar9300_cal_data_per_freq_op_loop calPierData2G[3U][3U] ; u8 calTarget_freqbin_Cck[2U] ; u8 calTarget_freqbin_2G[3U] ; u8 calTarget_freqbin_2GHT20[3U] ; u8 calTarget_freqbin_2GHT40[3U] ; struct cal_tgt_pow_legacy calTargetPowerCck[2U] ; struct cal_tgt_pow_legacy calTargetPower2G[3U] ; struct cal_tgt_pow_ht calTargetPower2GHT20[3U] ; struct cal_tgt_pow_ht calTargetPower2GHT40[3U] ; u8 ctlIndex_2G[12U] ; u8 ctl_freqbin_2G[12U][4U] ; struct cal_ctl_data_2g ctlPowerData_2G[12U] ; struct ar9300_modal_eep_header modalHeader5G ; struct ar9300_BaseExtension_2 base_ext2 ; u8 calFreqPier5G[8U] ; struct ar9300_cal_data_per_freq_op_loop calPierData5G[3U][8U] ; u8 calTarget_freqbin_5G[8U] ; u8 calTarget_freqbin_5GHT20[8U] ; u8 calTarget_freqbin_5GHT40[8U] ; struct cal_tgt_pow_legacy calTargetPower5G[8U] ; struct cal_tgt_pow_ht calTargetPower5GHT20[8U] ; struct cal_tgt_pow_ht calTargetPower5GHT40[8U] ; u8 ctlIndex_5G[9U] ; u8 ctl_freqbin_5G[9U][8U] ; struct cal_ctl_data_5g ctlPowerData_5G[9U] ; }; enum eeprom_param { EEP_NFTHRESH_5 = 0, EEP_NFTHRESH_2 = 1, EEP_MAC_MSW = 2, EEP_MAC_MID = 3, EEP_MAC_LSW = 4, EEP_REG_0 = 5, EEP_OP_CAP = 6, EEP_OP_MODE = 7, EEP_RF_SILENT = 8, EEP_OB_5 = 9, EEP_DB_5 = 10, EEP_OB_2 = 11, EEP_DB_2 = 12, EEP_MINOR_REV = 13, EEP_TX_MASK = 14, EEP_RX_MASK = 15, EEP_FSTCLK_5G = 16, EEP_RXGAIN_TYPE = 17, EEP_OL_PWRCTRL = 18, EEP_TXGAIN_TYPE = 19, EEP_RC_CHAIN_MASK = 20, EEP_DAC_HPWR_5G = 21, EEP_FRAC_N_5G = 22, EEP_DEV_TYPE = 23, EEP_TEMPSENSE_SLOPE = 24, EEP_TEMPSENSE_SLOPE_PAL_ON = 25, EEP_PWR_TABLE_OFFSET = 26, EEP_PAPRD = 27, EEP_MODAL_VER = 28, EEP_ANT_DIV_CTL1 = 29, EEP_CHAIN_MASK_REDUCE = 30, EEP_ANTENNA_GAIN_2G = 31, EEP_ANTENNA_GAIN_5G = 32 } ; struct base_eep_header { u16 length ; u16 checksum ; u16 version ; u8 opCapFlags ; u8 eepMisc ; u16 regDmn[2U] ; u8 macAddr[6U] ; u8 rxMask ; u8 txMask ; u16 rfSilent ; u16 blueToothOptions ; u16 deviceCap ; u32 binBuildNumber ; u8 deviceType ; u8 pwdclkind ; u8 fastClk5g ; u8 divChain ; u8 rxGainType ; u8 dacHiPwrMode_5G ; u8 openLoopPwrCntl ; u8 dacLpMode ; u8 txGainType ; u8 rcChainMask ; u8 desiredScaleCCK ; u8 pwr_table_offset ; u8 frac_n_5g ; u8 futureBase_3[21U] ; }; struct base_eep_header_4k { u16 length ; u16 checksum ; u16 version ; u8 opCapFlags ; u8 eepMisc ; u16 regDmn[2U] ; u8 macAddr[6U] ; u8 rxMask ; u8 txMask ; u16 rfSilent ; u16 blueToothOptions ; u16 deviceCap ; u32 binBuildNumber ; u8 deviceType ; u8 txGainType ; }; struct spur_chan { u16 spurChan ; u8 spurRangeLow ; u8 spurRangeHigh ; }; struct modal_eep_header { u32 antCtrlChain[3U] ; u32 antCtrlCommon ; u8 antennaGainCh[3U] ; u8 switchSettling ; u8 txRxAttenCh[3U] ; u8 rxTxMarginCh[3U] ; u8 adcDesiredSize ; u8 pgaDesiredSize ; u8 xlnaGainCh[3U] ; u8 txEndToXpaOff ; u8 txEndToRxOn ; u8 txFrameToXpaOn ; u8 thresh62 ; u8 noiseFloorThreshCh[3U] ; u8 xpdGain ; u8 xpd ; u8 iqCalICh[3U] ; u8 iqCalQCh[3U] ; u8 pdGainOverlap ; u8 ob ; u8 db ; u8 xpaBiasLvl ; u8 pwrDecreaseFor2Chain ; u8 pwrDecreaseFor3Chain ; u8 txFrameToDataStart ; u8 txFrameToPaOn ; u8 ht40PowerIncForPdadc ; u8 bswAtten[3U] ; u8 bswMargin[3U] ; u8 swSettleHt40 ; u8 xatten2Db[3U] ; u8 xatten2Margin[3U] ; u8 ob_ch1 ; u8 db_ch1 ; u8 lna_ctl ; u8 miscBits ; u16 xpaBiasLvlFreq[3U] ; u8 futureModal[6U] ; struct spur_chan spurChans[5U] ; }; struct modal_eep_4k_header { u32 antCtrlChain[1U] ; u32 antCtrlCommon ; u8 antennaGainCh[1U] ; u8 switchSettling ; u8 txRxAttenCh[1U] ; u8 rxTxMarginCh[1U] ; u8 adcDesiredSize ; u8 pgaDesiredSize ; u8 xlnaGainCh[1U] ; u8 txEndToXpaOff ; u8 txEndToRxOn ; u8 txFrameToXpaOn ; u8 thresh62 ; u8 noiseFloorThreshCh[1U] ; u8 xpdGain ; u8 xpd ; u8 iqCalICh[1U] ; u8 iqCalQCh[1U] ; u8 pdGainOverlap ; unsigned char ob_0 : 4 ; unsigned char ob_1 : 4 ; unsigned char db1_0 : 4 ; unsigned char db1_1 : 4 ; u8 xpaBiasLvl ; u8 txFrameToDataStart ; u8 txFrameToPaOn ; u8 ht40PowerIncForPdadc ; u8 bswAtten[1U] ; u8 bswMargin[1U] ; u8 swSettleHt40 ; u8 xatten2Db[1U] ; u8 xatten2Margin[1U] ; unsigned char db2_0 : 4 ; unsigned char db2_1 : 4 ; u8 version ; unsigned char ob_2 : 4 ; unsigned char ob_3 : 4 ; unsigned char ob_4 : 4 ; unsigned char antdiv_ctl1 : 4 ; unsigned char db1_2 : 4 ; unsigned char db1_3 : 4 ; unsigned char db1_4 : 4 ; unsigned char antdiv_ctl2 : 4 ; unsigned char db2_2 : 4 ; unsigned char db2_3 : 4 ; unsigned char db2_4 : 4 ; unsigned char reserved : 4 ; u8 tx_diversity ; u8 flc_pwr_thresh ; u8 bb_scale_smrt_antenna ; u8 futureModal[1U] ; struct spur_chan spurChans[5U] ; }; struct base_eep_ar9287_header { u16 length ; u16 checksum ; u16 version ; u8 opCapFlags ; u8 eepMisc ; u16 regDmn[2U] ; u8 macAddr[6U] ; u8 rxMask ; u8 txMask ; u16 rfSilent ; u16 blueToothOptions ; u16 deviceCap ; u32 binBuildNumber ; u8 deviceType ; u8 openLoopPwrCntl ; int8_t pwrTableOffset ; int8_t tempSensSlope ; int8_t tempSensSlopePalOn ; u8 futureBase[29U] ; }; struct modal_eep_ar9287_header { u32 antCtrlChain[2U] ; u32 antCtrlCommon ; int8_t antennaGainCh[2U] ; u8 switchSettling ; u8 txRxAttenCh[2U] ; u8 rxTxMarginCh[2U] ; int8_t adcDesiredSize ; u8 txEndToXpaOff ; u8 txEndToRxOn ; u8 txFrameToXpaOn ; u8 thresh62 ; int8_t noiseFloorThreshCh[2U] ; u8 xpdGain ; u8 xpd ; int8_t iqCalICh[2U] ; int8_t iqCalQCh[2U] ; u8 pdGainOverlap ; u8 xpaBiasLvl ; u8 txFrameToDataStart ; u8 txFrameToPaOn ; u8 ht40PowerIncForPdadc ; u8 bswAtten[2U] ; u8 bswMargin[2U] ; u8 swSettleHt40 ; u8 version ; u8 db1 ; u8 db2 ; u8 ob_cck ; u8 ob_psk ; u8 ob_qam ; u8 ob_pal_off ; u8 futureModal[30U] ; struct spur_chan spurChans[5U] ; }; struct cal_data_per_freq { u8 pwrPdg[4U][5U] ; u8 vpdPdg[4U][5U] ; }; struct cal_data_per_freq_4k { u8 pwrPdg[2U][5U] ; u8 vpdPdg[2U][5U] ; }; struct cal_target_power_leg { u8 bChannel ; u8 tPow2x[4U] ; }; struct cal_target_power_ht { u8 bChannel ; u8 tPow2x[8U] ; }; struct cal_ctl_edges { u8 bChannel ; u8 ctl ; }; struct cal_data_op_loop_ar9287 { u8 pwrPdg[2U][5U] ; u8 vpdPdg[2U][5U] ; u8 pcdac[2U][5U] ; u8 empty[2U][5U] ; }; struct cal_data_per_freq_ar9287 { u8 pwrPdg[4U][1U] ; u8 vpdPdg[4U][1U] ; }; union cal_data_per_freq_ar9287_u { struct cal_data_op_loop_ar9287 calDataOpen ; struct cal_data_per_freq_ar9287 calDataClose ; }; struct cal_ctl_data_ar9287 { struct cal_ctl_edges ctlEdges[2U][4U] ; }; struct cal_ctl_data { struct cal_ctl_edges ctlEdges[3U][8U] ; }; struct cal_ctl_data_4k { struct cal_ctl_edges ctlEdges[1U][4U] ; }; struct ar5416_eeprom_def { struct base_eep_header baseEepHeader ; u8 custData[64U] ; struct modal_eep_header modalHeader[2U] ; u8 calFreqPier5G[8U] ; u8 calFreqPier2G[4U] ; struct cal_data_per_freq calPierData5G[3U][8U] ; struct cal_data_per_freq calPierData2G[3U][4U] ; struct cal_target_power_leg calTargetPower5G[8U] ; struct cal_target_power_ht calTargetPower5GHT20[8U] ; struct cal_target_power_ht calTargetPower5GHT40[8U] ; struct cal_target_power_leg calTargetPowerCck[3U] ; struct cal_target_power_leg calTargetPower2G[4U] ; struct cal_target_power_ht calTargetPower2GHT20[4U] ; struct cal_target_power_ht calTargetPower2GHT40[4U] ; u8 ctlIndex[24U] ; struct cal_ctl_data ctlData[24U] ; u8 padding ; }; struct ar5416_eeprom_4k { struct base_eep_header_4k baseEepHeader ; u8 custData[20U] ; struct modal_eep_4k_header modalHeader ; u8 calFreqPier2G[3U] ; struct cal_data_per_freq_4k calPierData2G[1U][3U] ; struct cal_target_power_leg calTargetPowerCck[3U] ; struct cal_target_power_leg calTargetPower2G[3U] ; struct cal_target_power_ht calTargetPower2GHT20[3U] ; struct cal_target_power_ht calTargetPower2GHT40[3U] ; u8 ctlIndex[12U] ; struct cal_ctl_data_4k ctlData[12U] ; u8 padding ; }; struct ar9287_eeprom { struct base_eep_ar9287_header baseEepHeader ; u8 custData[32U] ; struct modal_eep_ar9287_header modalHeader ; u8 calFreqPier2G[3U] ; union cal_data_per_freq_ar9287_u calPierData2G[2U][3U] ; struct cal_target_power_leg calTargetPowerCck[3U] ; struct cal_target_power_leg calTargetPower2G[3U] ; struct cal_target_power_ht calTargetPower2GHT20[3U] ; struct cal_target_power_ht calTargetPower2GHT40[3U] ; u8 ctlIndex[12U] ; struct cal_ctl_data_ar9287 ctlData[12U] ; u8 padding ; }; struct eeprom_ops { int (*check_eeprom)(struct ath_hw * ) ; u32 (*get_eeprom)(struct ath_hw * , enum eeprom_param ) ; bool (*fill_eeprom)(struct ath_hw * ) ; u32 (*dump_eeprom)(struct ath_hw * , bool , u8 * , u32 , u32 ) ; int (*get_eeprom_ver)(struct ath_hw * ) ; int (*get_eeprom_rev)(struct ath_hw * ) ; void (*set_board_values)(struct ath_hw * , struct ath9k_channel * ) ; void (*set_addac)(struct ath_hw * , struct ath9k_channel * ) ; void (*set_txpower)(struct ath_hw * , struct ath9k_channel * , u16 , u8 , u8 , bool ) ; u16 (*get_spur_channel)(struct ath_hw * , u16 , bool ) ; }; struct ar5416IniArray { u32 *ia_array ; u32 ia_rows ; u32 ia_columns ; }; enum ath9k_cal_state { CAL_INACTIVE = 0, CAL_WAITING = 1, CAL_RUNNING = 2, CAL_DONE = 3 } ; struct ath9k_percal_data { u32 calType ; u32 calNumSamples ; u32 calCountMax ; void (*calCollect)(struct ath_hw * ) ; void (*calPostProc)(struct ath_hw * , u8 ) ; }; struct ath9k_cal_list { struct ath9k_percal_data const *calData ; enum ath9k_cal_state calState ; struct ath9k_cal_list *calNext ; }; struct ath9k_nfcal_hist { int16_t nfCalBuffer[5U] ; u8 currIndex ; int16_t privNF ; u8 invalidNFcount ; }; struct ath9k_pacal_info { int32_t prev_offset ; int8_t max_skipcount ; int8_t skipcount ; }; enum ath_usb_dev { AR9280_USB = 1, AR9287_USB = 2, STORAGE_DEVICE = 3 } ; enum ath9k_ant_div_comb_lna_conf { ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2 = 0, ATH_ANT_DIV_COMB_LNA2 = 1, ATH_ANT_DIV_COMB_LNA1 = 2, ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2 = 3 } ; enum ath_btcoex_scheme { ATH_BTCOEX_CFG_NONE = 0, ATH_BTCOEX_CFG_2WIRE = 1, ATH_BTCOEX_CFG_3WIRE = 2, ATH_BTCOEX_CFG_MCI = 3 } ; struct ath9k_hw_mci { u32 raw_intr ; u32 rx_msg_intr ; u32 cont_status ; u32 gpm_addr ; u32 gpm_len ; u32 gpm_idx ; u32 sched_addr ; u32 wlan_channels[4U] ; u32 wlan_cal_seq ; u32 wlan_cal_done ; u32 config ; u8 *gpm_buf ; bool ready ; bool update_2g5g ; bool is_2g ; bool query_bt ; bool unhalt_bt_gpm ; bool halted_bt_gpm ; bool need_flush_btinfo ; bool bt_version_known ; bool wlan_channels_update ; u8 wlan_ver_major ; u8 wlan_ver_minor ; u8 bt_ver_major ; u8 bt_ver_minor ; u8 bt_state ; u8 stomp_ftp ; bool concur_tx ; u32 last_recovery ; }; struct ath9k_hw_aic { bool aic_enabled ; u8 aic_cal_state ; u8 aic_caled_chan ; u32 aic_sram[79U] ; u32 aic_cal_start_time ; }; struct ath_btcoex_hw { enum ath_btcoex_scheme scheme ; struct ath9k_hw_mci mci ; struct ath9k_hw_aic aic ; bool enabled ; u8 wlanactive_gpio ; u8 btactive_gpio ; u8 btpriority_gpio ; u32 bt_coex_mode ; u32 bt_coex_weights ; u32 bt_coex_mode2 ; u32 bt_weight[4U] ; u32 wlan_weight[4U] ; u8 tx_prio[5U] ; }; struct ath_node; struct ath_dyn_rxbuf { u16 h_rb ; u16 t_rb ; u32 tstamp[64U] ; }; struct ts_info { u32 tstamp ; u32 dur ; }; struct haddr_pair { u8 h_dest[6U] ; u8 h_src[6U] ; }; struct ath_dyn_txbuf { u16 h_rb ; u16 t_rb ; struct haddr_pair addr[64U] ; struct ts_info ts[64U] ; }; struct ath_dynack { bool enabled ; int ackto ; unsigned long lto ; struct list_head nodes ; spinlock_t qlock ; struct ath_dyn_rxbuf ack_rbf ; struct ath_dyn_txbuf st_rbf ; }; struct ath9k_hw_wow { u32 wow_event_mask ; u32 wow_event_mask2 ; u8 max_patterns ; }; struct ath9k_hw_capabilities { u32 hw_caps ; u16 rts_aggr_limit ; u8 tx_chainmask ; u8 rx_chainmask ; u8 chip_chainmask ; u8 max_txchains ; u8 max_rxchains ; u8 num_gpio_pins ; u8 rx_hp_qdepth ; u8 rx_lp_qdepth ; u8 rx_status_len ; u8 tx_desc_len ; u8 txs_len ; }; struct ath9k_ops_config { int dma_beacon_response_time ; int sw_beacon_response_time ; u32 cwm_ignore_extcca ; u32 pcie_waen ; u8 analog_shiftreg ; u32 ofdm_trig_low ; u32 ofdm_trig_high ; u32 cck_trig_high ; u32 cck_trig_low ; u32 enable_paprd ; int serialize_regmode ; bool rx_intr_mitigation ; bool tx_intr_mitigation ; u8 max_txtrig_level ; u16 ani_poll_interval ; u16 hw_hang_checks ; u16 rimt_first ; u16 rimt_last ; u32 aspm_l1_fix ; u32 xlna_gpio ; u32 ant_ctrl_comm2g_switch_enable ; bool xatten_margin_cfg ; bool alt_mingainidx ; u8 pll_pwrsave ; bool tx_gain_buffalo ; bool led_active_high ; }; enum ath9k_int { ATH9K_INT_RX = 1, ATH9K_INT_RXDESC = 2, ATH9K_INT_RXHP = 1, ATH9K_INT_RXLP = 2, ATH9K_INT_RXNOFRM = 8, ATH9K_INT_RXEOL = 16, ATH9K_INT_RXORN = 32, ATH9K_INT_TX = 64, ATH9K_INT_TXDESC = 128, ATH9K_INT_TIM_TIMER = 256, ATH9K_INT_MCI = 512, ATH9K_INT_BB_WATCHDOG = 1024, ATH9K_INT_TXURN = 2048, ATH9K_INT_MIB = 4096, ATH9K_INT_RXPHY = 16384, ATH9K_INT_RXKCM = 32768, ATH9K_INT_SWBA = 65536, ATH9K_INT_BMISS = 262144, ATH9K_INT_BNR = 1048576, ATH9K_INT_TIM = 2097152, ATH9K_INT_DTIM = 4194304, ATH9K_INT_DTIMSYNC = 8388608, ATH9K_INT_GPIO = 16777216, ATH9K_INT_CABEND = 33554432, ATH9K_INT_TSFOOR = 67108864, ATH9K_INT_GENTIMER = 134217728, ATH9K_INT_CST = 268435456, ATH9K_INT_GTT = 536870912, ATH9K_INT_FATAL = 1073741824, ATH9K_INT_GLOBAL = 2147483648U, ATH9K_INT_BMISC = 115343360, ATH9K_INT_COMMON = 17160378, ATH9K_INT_NOCARD = 4294967295U } ; struct ath9k_hw_cal_data { u16 channel ; u16 channelFlags ; unsigned long cal_flags ; int32_t CalValid ; int8_t iCoff ; int8_t qCoff ; u8 caldac[2U] ; u16 small_signal_gain[3U] ; u32 pa_table[3U][24U] ; u32 num_measures[3U] ; int tx_corr_coeff[8U][3U] ; u32 tx_clcal[3U][16U] ; u32 rtt_table[3U][6U] ; struct ath9k_nfcal_hist nfCalHist[6U] ; }; struct ath9k_channel { struct ieee80211_channel *chan ; u16 channel ; u16 channelFlags ; s16 noisefloor ; }; enum ath9k_power_mode { ATH9K_PM_AWAKE = 0, ATH9K_PM_FULL_SLEEP = 1, ATH9K_PM_NETWORK_SLEEP = 2, ATH9K_PM_UNDEFINED = 3 } ; struct ath9k_beacon_state { u32 bs_nexttbtt ; u32 bs_nextdtim ; u32 bs_intval ; u32 bs_dtimperiod ; u16 bs_bmissthreshold ; u32 bs_sleepduration ; u32 bs_tsfoor_threshold ; }; struct ath9k_hw_version { u32 magic ; u16 devid ; u16 subvendorid ; u32 macVersion ; u16 macRev ; u16 phyRev ; u16 analog5GhzRev ; u16 analog2GhzRev ; enum ath_usb_dev usbdev ; }; struct ath_gen_timer { void (*trigger)(void * ) ; void (*overflow)(void * ) ; void *arg ; u8 index ; }; struct ath_gen_timer_table { struct ath_gen_timer *timers[16U] ; u16 timer_mask ; bool tsf2_enabled ; }; struct ath_hw_antcomb_conf { u8 main_lna_conf ; u8 alt_lna_conf ; u8 fast_div_bias ; u8 main_gaintb ; u8 alt_gaintb ; int lna1_lna2_delta ; int lna1_lna2_switch_delta ; u8 div_group ; }; struct ath_hw_radar_conf { unsigned int pulse_inband ; unsigned int pulse_inband_step ; unsigned int pulse_height ; unsigned int pulse_rssi ; unsigned int pulse_maxlen ; unsigned int radar_rssi ; unsigned int radar_inband ; int fir_power ; bool ext_channel ; }; struct ath_hw_private_ops { void (*init_hang_checks)(struct ath_hw * ) ; bool (*detect_mac_hang)(struct ath_hw * ) ; bool (*detect_bb_hang)(struct ath_hw * ) ; void (*init_cal_settings)(struct ath_hw * ) ; bool (*init_cal)(struct ath_hw * , struct ath9k_channel * ) ; void (*init_mode_gain_regs)(struct ath_hw * ) ; void (*setup_calibration)(struct ath_hw * , struct ath9k_cal_list * ) ; int (*rf_set_freq)(struct ath_hw * , struct ath9k_channel * ) ; void (*spur_mitigate_freq)(struct ath_hw * , struct ath9k_channel * ) ; bool (*set_rf_regs)(struct ath_hw * , struct ath9k_channel * , u16 ) ; void (*set_channel_regs)(struct ath_hw * , struct ath9k_channel * ) ; void (*init_bb)(struct ath_hw * , struct ath9k_channel * ) ; int (*process_ini)(struct ath_hw * , struct ath9k_channel * ) ; void (*olc_init)(struct ath_hw * ) ; void (*set_rfmode)(struct ath_hw * , struct ath9k_channel * ) ; void (*mark_phy_inactive)(struct ath_hw * ) ; void (*set_delta_slope)(struct ath_hw * , struct ath9k_channel * ) ; bool (*rfbus_req)(struct ath_hw * ) ; void (*rfbus_done)(struct ath_hw * ) ; void (*restore_chainmask)(struct ath_hw * ) ; u32 (*compute_pll_control)(struct ath_hw * , struct ath9k_channel * ) ; bool (*ani_control)(struct ath_hw * , enum ath9k_ani_cmd , int ) ; void (*do_getnf)(struct ath_hw * , int16_t * ) ; void (*set_radar_params)(struct ath_hw * , struct ath_hw_radar_conf * ) ; int (*fast_chan_change)(struct ath_hw * , struct ath9k_channel * , u8 * ) ; void (*ani_cache_ini_regs)(struct ath_hw * ) ; bool (*is_aic_enabled)(struct ath_hw * ) ; }; struct ath_spec_scan { bool enabled ; bool short_repeat ; bool endless ; u8 count ; u8 period ; u8 fft_period ; }; struct ath_hw_ops { void (*config_pci_powersave)(struct ath_hw * , bool ) ; void (*rx_enable)(struct ath_hw * ) ; void (*set_desc_link)(void * , u32 ) ; int (*calibrate)(struct ath_hw * , struct ath9k_channel * , u8 , bool ) ; bool (*get_isr)(struct ath_hw * , enum ath9k_int * , u32 * ) ; void (*set_txdesc)(struct ath_hw * , void * , struct ath_tx_info * ) ; int (*proc_txdesc)(struct ath_hw * , void * , struct ath_tx_status * ) ; int (*get_duration)(struct ath_hw * , void const * , int ) ; void (*antdiv_comb_conf_get)(struct ath_hw * , struct ath_hw_antcomb_conf * ) ; void (*antdiv_comb_conf_set)(struct ath_hw * , struct ath_hw_antcomb_conf * ) ; void (*spectral_scan_config)(struct ath_hw * , struct ath_spec_scan * ) ; void (*spectral_scan_trigger)(struct ath_hw * ) ; void (*spectral_scan_wait)(struct ath_hw * ) ; void (*tx99_start)(struct ath_hw * , u32 ) ; void (*tx99_stop)(struct ath_hw * ) ; void (*tx99_set_txpower)(struct ath_hw * , u8 ) ; void (*set_bt_ant_diversity)(struct ath_hw * , bool ) ; }; struct ath_nf_limits { s16 max ; s16 min ; s16 nominal ; }; union __anonunion_eeprom_387 { struct ar5416_eeprom_def def ; struct ar5416_eeprom_4k map4k ; struct ar9287_eeprom map9287 ; struct ar9300_eeprom ar9300_eep ; }; union __anonunion_meas0_388 { u32 unsign[3U] ; int32_t sign[3U] ; }; union __anonunion_meas1_389 { u32 unsign[3U] ; int32_t sign[3U] ; }; union __anonunion_meas2_390 { u32 unsign[3U] ; int32_t sign[3U] ; }; union __anonunion_meas3_391 { u32 unsign[3U] ; int32_t sign[3U] ; }; struct ar9003_txs; struct ath_hw { struct ath_ops reg_ops ; struct device *dev ; struct ieee80211_hw *hw ; struct ath_common common ; struct ath9k_hw_version hw_version ; struct ath9k_ops_config config ; struct ath9k_hw_capabilities caps ; struct ath9k_channel channels[38U] ; struct ath9k_channel *curchan ; union __anonunion_eeprom_387 eeprom ; struct eeprom_ops const *eep_ops ; bool sw_mgmt_crypto_tx ; bool sw_mgmt_crypto_rx ; bool is_pciexpress ; bool aspm_enabled ; bool is_monitoring ; bool need_an_top2_fixup ; u16 tx_trig_level ; u32 nf_regs[6U] ; struct ath_nf_limits nf_2g ; struct ath_nf_limits nf_5g ; u16 rfsilent ; u32 rfkill_gpio ; u32 rfkill_polarity ; u32 ah_flags ; bool reset_power_on ; bool htc_reset_init ; enum nl80211_iftype opmode ; enum ath9k_power_mode power_mode ; s8 noise ; struct ath9k_hw_cal_data *caldata ; struct ath9k_pacal_info pacal_info ; struct ar5416Stats stats ; struct ath9k_tx_queue_info txq[10U] ; enum ath9k_int imask ; u32 imrs2_reg ; u32 txok_interrupt_mask ; u32 txerr_interrupt_mask ; u32 txdesc_interrupt_mask ; u32 txeol_interrupt_mask ; u32 txurn_interrupt_mask ; atomic_t intr_ref_cnt ; bool chip_fullsleep ; u32 modes_index ; u32 supp_cals ; struct ath9k_cal_list iq_caldata ; struct ath9k_cal_list adcgain_caldata ; struct ath9k_cal_list adcdc_caldata ; struct ath9k_cal_list *cal_list ; struct ath9k_cal_list *cal_list_last ; struct ath9k_cal_list *cal_list_curr ; union __anonunion_meas0_388 meas0 ; union __anonunion_meas1_389 meas1 ; union __anonunion_meas2_390 meas2 ; union __anonunion_meas3_391 meas3 ; u16 cal_samples ; u8 enabled_cals ; u32 sta_id1_defaults ; u32 misc_mode ; struct ath_hw_private_ops private_ops ; struct ath_hw_ops ops ; u32 *analogBank6Data ; int coverage_class ; u32 slottime ; u32 globaltxtimeout ; u32 aniperiod ; enum ath9k_ani_cmd ani_function ; u32 ani_skip_count ; struct ar5416AniState ani ; struct ath_btcoex_hw btcoex_hw ; u32 intr_txqs ; u8 txchainmask ; u8 rxchainmask ; struct ath_hw_radar_conf radar_conf ; u32 originalGain[22U] ; int initPDADC ; int PDADCdelta ; int led_pin ; u32 gpio_mask ; u32 gpio_val ; struct ar5416IniArray ini_dfs ; struct ar5416IniArray iniModes ; struct ar5416IniArray iniCommon ; struct ar5416IniArray iniBB_RfGain ; struct ar5416IniArray iniBank6 ; struct ar5416IniArray iniAddac ; struct ar5416IniArray iniPcieSerdes ; struct ar5416IniArray iniPcieSerdesLowPower ; struct ar5416IniArray iniModesFastClock ; struct ar5416IniArray iniAdditional ; struct ar5416IniArray iniModesRxGain ; struct ar5416IniArray ini_modes_rx_gain_bounds ; struct ar5416IniArray iniModesTxGain ; struct ar5416IniArray iniCckfirNormal ; struct ar5416IniArray iniCckfirJapan2484 ; struct ar5416IniArray iniModes_9271_ANI_reg ; struct ar5416IniArray ini_radio_post_sys2ant ; struct ar5416IniArray ini_modes_rxgain_5g_xlna ; struct ar5416IniArray ini_modes_rxgain_bb_core ; struct ar5416IniArray ini_modes_rxgain_bb_postamble ; struct ar5416IniArray iniMac[3U] ; struct ar5416IniArray iniBB[3U] ; struct ar5416IniArray iniRadio[3U] ; struct ar5416IniArray iniSOC[3U] ; u32 intr_gen_timer_trigger ; u32 intr_gen_timer_thresh ; struct ath_gen_timer_table hw_gen_timers ; struct ar9003_txs *ts_ring ; u32 ts_paddr_start ; u32 ts_paddr_end ; u16 ts_tail ; u16 ts_size ; u32 bb_watchdog_last_status ; u32 bb_watchdog_timeout_ms ; u8 bb_hang_rx_ofdm ; unsigned int paprd_target_power ; unsigned int paprd_training_power ; unsigned int paprd_ratemask ; unsigned int paprd_ratemask_ht40 ; bool paprd_table_write_done ; u32 paprd_gain_table_entries[32U] ; u8 paprd_gain_table_index[32U] ; u32 WARegVal ; u32 ent_mode ; struct ath9k_hw_wow wow ; bool is_clk_25mhz ; int (*get_mac_revision)(void) ; int (*external_reset)(void) ; bool disable_2ghz ; bool disable_5ghz ; struct firmware const *eeprom_blob ; struct ath_dynack dynack ; bool tpc_enabled ; u8 tx_power[36U] ; u8 tx_power_stbc[36U] ; }; struct ath_bus_ops { enum ath_bus_type ath_bus_type ; void (*read_cachesize)(struct ath_common * , int * ) ; bool (*eeprom_read)(struct ath_common * , u32 , u16 * ) ; void (*bt_coex_prep)(struct ath_common * ) ; void (*aspm_init)(struct ath_common * ) ; }; struct ath_beacon_config; struct ath_rx_stats { u32 rx_pkts_all ; u32 rx_bytes_all ; u32 crc_err ; u32 decrypt_crc_err ; u32 phy_err ; u32 mic_err ; u32 pre_delim_crc_err ; u32 post_delim_crc_err ; u32 decrypt_busy_err ; u32 phy_err_stats[39U] ; u32 rx_len_err ; u32 rx_oom_err ; u32 rx_rate_err ; u32 rx_too_many_frags_err ; u32 rx_beacons ; u32 rx_frags ; u32 rx_spectral ; }; enum spectral_mode { SPECTRAL_DISABLED = 0, SPECTRAL_BACKGROUND = 1, SPECTRAL_MANUAL = 2, SPECTRAL_CHANSCAN = 3 } ; struct rchan; struct ath_spec_scan_priv { struct ath_hw *ah ; struct rchan *rfs_chan_spec_scan ; enum spectral_mode spectral_mode ; struct ath_spec_scan spec_config ; }; struct ath_beacon_config { int beacon_interval ; u16 dtim_period ; u16 bmiss_timeout ; u8 dtim_count ; u8 enable_beacon ; bool ibss_creator ; u32 nexttbtt ; u32 intval ; }; struct ath_softc; struct ath_dfs_stats { u32 pulses_total ; u32 pulses_no_dfs ; u32 pulses_detected ; u32 datalen_discards ; u32 rssi_discards ; u32 bwinfo_discards ; u32 pri_phy_errors ; u32 ext_phy_errors ; u32 dc_phy_errors ; u32 pulses_processed ; u32 radar_detected ; }; struct ath_dfs_pool_stats; struct ath_txq; struct ath_buf; enum ath_reset_type { RESET_TYPE_BB_HANG = 0, RESET_TYPE_BB_WATCHDOG = 1, RESET_TYPE_FATAL_INT = 2, RESET_TYPE_TX_ERROR = 3, RESET_TYPE_TX_GTT = 4, RESET_TYPE_TX_HANG = 5, RESET_TYPE_PLL_HANG = 6, RESET_TYPE_MAC_HANG = 7, RESET_TYPE_BEACON_STUCK = 8, RESET_TYPE_MCI = 9, RESET_TYPE_CALIBRATION = 10, __RESET_TYPE_MAX = 11 } ; struct ath_interrupt_stats { u32 total ; u32 rxok ; u32 rxlp ; u32 rxhp ; u32 rxeol ; u32 rxorn ; u32 txok ; u32 txeol ; u32 txurn ; u32 mib ; u32 rxphyerr ; u32 rx_keycache_miss ; u32 swba ; u32 bmiss ; u32 bnr ; u32 cst ; u32 gtt ; u32 tim ; u32 cabend ; u32 dtimsync ; u32 dtim ; u32 bb_watchdog ; u32 tsfoor ; u32 mci ; u32 gen_timer ; u32 sync_cause_all ; u32 sync_rtc_irq ; u32 sync_mac_irq ; u32 eeprom_illegal_access ; u32 apb_timeout ; u32 pci_mode_conflict ; u32 host1_fatal ; u32 host1_perr ; u32 trcv_fifo_perr ; u32 radm_cpl_ep ; u32 radm_cpl_dllp_abort ; u32 radm_cpl_tlp_abort ; u32 radm_cpl_ecrc_err ; u32 radm_cpl_timeout ; u32 local_timeout ; u32 pm_access ; u32 mac_awake ; u32 mac_asleep ; u32 mac_sleep_access ; }; struct ath_tx_stats { u32 tx_pkts_all ; u32 tx_bytes_all ; u32 queued ; u32 completed ; u32 xretries ; u32 a_aggr ; u32 a_queued_hw ; u32 a_queued_sw ; u32 a_completed ; u32 a_retries ; u32 a_xretries ; u32 txerr_filtered ; u32 fifo_underrun ; u32 xtxop ; u32 timer_exp ; u32 desc_cfg_err ; u32 data_underrun ; u32 delim_underrun ; u32 puttxbuf ; u32 txstart ; u32 txprocdesc ; u32 txfailed ; }; struct __anonstruct_ht_stats_392 { u32 ht20_cnt ; u32 ht40_cnt ; u32 sgi_cnt ; u32 lgi_cnt ; }; struct __anonstruct_ofdm_stats_393 { u32 ofdm_cnt ; }; struct __anonstruct_cck_stats_394 { u32 cck_lp_cnt ; u32 cck_sp_cnt ; }; struct ath_rx_rate_stats { struct __anonstruct_ht_stats_392 ht_stats[24U] ; struct __anonstruct_ofdm_stats_393 ofdm_stats[8U] ; struct __anonstruct_cck_stats_394 cck_stats[4U] ; }; struct ath_antenna_stats { u32 recv_cnt ; u32 rssi_avg ; u32 lna_recv_cnt[4U] ; u32 lna_attempt_cnt[4U] ; }; struct ath_stats { struct ath_interrupt_stats istats ; struct ath_tx_stats txstats[10U] ; struct ath_rx_stats rxstats ; struct ath_dfs_stats dfs_stats ; struct ath_antenna_stats ant_stats[2U] ; u32 reset[11U] ; }; struct ath9k_debug { struct dentry *debugfs_phy ; u32 regidx ; struct ath_stats stats ; }; struct ath_mci_profile { struct list_head info ; unsigned long status[1U] ; u16 aggr_limit ; u8 num_mgmt ; u8 num_sco ; u8 num_a2dp ; u8 num_hid ; u8 num_pan ; u8 num_other_acl ; u8 num_bdr ; u8 voice_priority ; }; struct ath_mci_buf { void *bf_addr ; dma_addr_t bf_paddr ; u32 bf_len ; }; struct ath_mci_coex { struct ath_mci_buf sched_buf ; struct ath_mci_buf gpm_buf ; }; struct ath_dfs_pool_stats { u32 pool_reference ; u32 pulse_allocated ; u32 pulse_alloc_error ; u32 pulse_used ; u32 pseq_allocated ; u32 pseq_alloc_error ; u32 pseq_used ; }; struct pulse_event { u64 ts ; u16 freq ; u8 width ; u8 rssi ; bool chirp ; }; struct radar_detector_specs { u8 type_id ; u8 width_min ; u8 width_max ; u16 pri_min ; u16 pri_max ; u8 num_pri ; u8 ppb ; u8 ppb_thresh ; u8 max_pri_tolerance ; bool chirp ; }; struct dfs_pattern_detector { void (*exit)(struct dfs_pattern_detector * ) ; bool (*set_dfs_domain)(struct dfs_pattern_detector * , enum nl80211_dfs_regions ) ; bool (*add_pulse)(struct dfs_pattern_detector * , struct pulse_event * ) ; struct ath_dfs_pool_stats (*get_stats)(struct dfs_pattern_detector * ) ; enum nl80211_dfs_regions region ; u8 num_radar_types ; u64 last_pulse_ts ; struct ath_common *common ; struct radar_detector_specs const *radar_spec ; struct list_head channel_detectors ; }; struct ath_vif; struct ath_descdma { void *dd_desc ; dma_addr_t dd_desc_paddr ; u32 dd_desc_len ; }; struct ath_txq { int mac80211_qnum ; u32 axq_qnum ; void *axq_link ; struct list_head axq_q ; spinlock_t axq_lock ; u32 axq_depth ; u32 axq_ampdu_depth ; bool stopped ; bool axq_tx_inprogress ; struct list_head txq_fifo[8U] ; u8 txq_headidx ; u8 txq_tailidx ; int pending_frames ; struct sk_buff_head complete_q ; }; struct ath_atx_ac { struct ath_txq *txq ; struct list_head list ; struct list_head tid_q ; bool clear_ps_filter ; bool sched ; }; struct ath_rxbuf { struct list_head list ; struct sk_buff *bf_mpdu ; void *bf_desc ; dma_addr_t bf_daddr ; dma_addr_t bf_buf_addr ; }; struct ath_buf_state { u8 bf_type ; u8 bfs_paprd ; u8 ndelim ; bool stale ; u16 seqno ; unsigned long bfs_paprd_timestamp ; }; struct ath_buf { struct list_head list ; struct ath_buf *bf_lastbf ; struct ath_buf *bf_next ; struct sk_buff *bf_mpdu ; void *bf_desc ; dma_addr_t bf_daddr ; dma_addr_t bf_buf_addr ; struct ieee80211_tx_rate rates[4U] ; struct ath_buf_state bf_state ; }; struct ath_atx_tid { struct list_head list ; struct sk_buff_head buf_q ; struct sk_buff_head retry_q ; struct ath_node *an ; struct ath_atx_ac *ac ; unsigned long tx_buf[2U] ; u16 seq_start ; u16 seq_next ; u16 baw_size ; u8 tidno ; int baw_head ; int baw_tail ; s8 bar_index ; bool sched ; bool active ; }; struct ath_node { struct ath_softc *sc ; struct ieee80211_sta *sta ; struct ieee80211_vif *vif ; struct ath_atx_tid tid[16U] ; struct ath_atx_ac ac[4U] ; u16 maxampdu ; u8 mpdudensity ; s8 ps_key ; bool sleeping ; bool no_ps_filter ; struct ath_rx_rate_stats rx_rate_stats ; u8 key_idx[4U] ; u32 ackto ; struct list_head list ; }; struct ath_tx { u32 txqsetup ; spinlock_t txbuflock ; struct list_head txbuf ; struct ath_txq txq[10U] ; struct ath_descdma txdma ; struct ath_txq *txq_map[4U] ; struct ath_txq *uapsdq ; u32 txq_max_pending[4U] ; u16 max_aggr_framelen[4U][4U][32U] ; }; struct ath_rx_edma { struct sk_buff_head rx_fifo ; u32 rx_fifo_hwsize ; }; struct ath_rx { u8 defant ; u8 rxotherant ; bool discard_next ; u32 *rxlink ; u32 num_pkts ; struct list_head rxbuf ; struct ath_descdma rxdma ; struct ath_rx_edma rx_edma[2U] ; struct ath_rxbuf *buf_hold ; struct sk_buff *frag ; u32 ampdu_ref ; }; struct ath_chanctx { struct cfg80211_chan_def chandef ; struct list_head vifs ; struct list_head acq[4U] ; int hw_queue_base ; struct ieee80211_vif *primary_sta ; struct ath_beacon_config beacon ; struct ath9k_hw_cal_data caldata ; struct timespec tsf_ts ; u64 tsf_val ; u32 last_beacon ; int flush_timeout ; u16 txpower ; u16 cur_txpower ; bool offchannel ; bool stopped ; bool active ; bool assigned ; bool switch_after_beacon ; short nvifs ; short nvifs_assigned ; unsigned int rxfilter ; }; enum ath_chanctx_event { ATH_CHANCTX_EVENT_BEACON_PREPARE = 0, ATH_CHANCTX_EVENT_BEACON_SENT = 1, ATH_CHANCTX_EVENT_TSF_TIMER = 2, ATH_CHANCTX_EVENT_BEACON_RECEIVED = 3, ATH_CHANCTX_EVENT_AUTHORIZED = 4, ATH_CHANCTX_EVENT_SWITCH = 5, ATH_CHANCTX_EVENT_ASSIGN = 6, ATH_CHANCTX_EVENT_UNASSIGN = 7, ATH_CHANCTX_EVENT_CHANGE = 8, ATH_CHANCTX_EVENT_ENABLE_MULTICHANNEL = 9 } ; enum ath_chanctx_state { ATH_CHANCTX_STATE_IDLE = 0, ATH_CHANCTX_STATE_WAIT_FOR_BEACON = 1, ATH_CHANCTX_STATE_WAIT_FOR_TIMER = 2, ATH_CHANCTX_STATE_SWITCH = 3, ATH_CHANCTX_STATE_FORCE_ACTIVE = 4 } ; struct ath_chanctx_sched { bool beacon_pending ; bool beacon_adjust ; bool offchannel_pending ; bool wait_switch ; bool force_noa_update ; bool extend_absence ; bool mgd_prepare_tx ; enum ath_chanctx_state state ; u8 beacon_miss ; u32 next_tbtt ; u32 switch_start_time ; unsigned int offchannel_duration ; unsigned int channel_switch_time ; struct timer_list timer ; }; enum ath_offchannel_state { ATH_OFFCHANNEL_IDLE = 0, ATH_OFFCHANNEL_PROBE_SEND = 1, ATH_OFFCHANNEL_PROBE_WAIT = 2, ATH_OFFCHANNEL_SUSPEND = 3, ATH_OFFCHANNEL_ROC_START = 4, ATH_OFFCHANNEL_ROC_WAIT = 5, ATH_OFFCHANNEL_ROC_DONE = 6 } ; struct ath_offchannel { struct ath_chanctx chan ; struct timer_list timer ; struct cfg80211_scan_request *scan_req ; struct ieee80211_vif *scan_vif ; int scan_idx ; enum ath_offchannel_state state ; struct ieee80211_channel *roc_chan ; struct ieee80211_vif *roc_vif ; int roc_duration ; int duration ; }; struct ath_vif { struct list_head list ; u16 seq_no ; u8 bssid[6U] ; u16 aid ; bool assoc ; struct ieee80211_vif *vif ; struct ath_node mcast_node ; int av_bslot ; __le64 tsf_adjust ; struct ath_buf *av_bcbuf ; struct ath_chanctx *chanctx ; struct ieee80211_noa_data noa ; u8 noa_index ; u32 offchannel_start ; u32 offchannel_duration ; u32 noa_start ; u32 noa_duration ; bool periodic_noa ; bool oneshot_noa ; }; enum ldv_35090 { OK = 0, UPDATE = 1, COMMIT = 2 } ; struct ath_beacon { enum ldv_35090 updateslot ; u32 beaconq ; u32 bmisscnt ; struct ieee80211_vif *bslot[8U] ; int slottime ; int slotupdate ; struct ath_descdma bdma ; struct ath_txq *cabq ; struct list_head bbuf ; bool tx_processed ; bool tx_last ; }; struct ath_btcoex { spinlock_t btcoex_lock ; struct timer_list period_timer ; struct timer_list no_stomp_timer ; u32 bt_priority_cnt ; unsigned long bt_priority_time ; unsigned long op_flags ; int bt_stomp_type ; u32 btcoex_no_stomp ; u32 btcoex_period ; u32 btscan_no_stomp ; u32 duty_cycle ; u32 bt_wait_time ; int rssi_count ; struct ath_mci_profile mci ; u8 stomp_audio ; }; struct ath_ant_comb { u16 count ; u16 total_pkt_count ; bool scan ; bool scan_not_start ; int main_total_rssi ; int alt_total_rssi ; int alt_recv_cnt ; int main_recv_cnt ; int rssi_lna1 ; int rssi_lna2 ; int rssi_add ; int rssi_sub ; int rssi_first ; int rssi_second ; int rssi_third ; int ant_ratio ; int ant_ratio2 ; bool alt_good ; int quick_scan_cnt ; enum ath9k_ant_div_comb_lna_conf main_conf ; enum ath9k_ant_div_comb_lna_conf first_quick_scan_conf ; enum ath9k_ant_div_comb_lna_conf second_quick_scan_conf ; bool first_ratio ; bool second_ratio ; unsigned long scan_start_time ; int low_rssi_thresh ; int fast_div_bias ; }; struct ath_softc { struct ieee80211_hw *hw ; struct device *dev ; struct survey_info *cur_survey ; struct survey_info survey[38U] ; struct tasklet_struct intr_tq ; struct tasklet_struct bcon_tasklet ; struct ath_hw *sc_ah ; void *mem ; int irq ; spinlock_t sc_serial_rw ; spinlock_t sc_pm_lock ; spinlock_t sc_pcu_lock ; struct mutex mutex ; struct work_struct paprd_work ; struct work_struct hw_reset_work ; struct completion paprd_complete ; wait_queue_head_t tx_wait ; struct work_struct chanctx_work ; struct ath_gen_timer *p2p_ps_timer ; struct ath_vif *p2p_ps_vif ; struct ath_chanctx_sched sched ; struct ath_offchannel offchannel ; struct ath_chanctx *next_chan ; struct completion go_beacon ; unsigned long driver_data ; u8 gtt_cnt ; u32 intrstatus ; u16 ps_flags ; bool ps_enabled ; bool ps_idle ; short nbcnvifs ; unsigned long ps_usecount ; struct ath_rx rx ; struct ath_tx tx ; struct ath_beacon beacon ; struct cfg80211_chan_def cur_chandef ; struct ath_chanctx chanctx[2U] ; struct ath_chanctx *cur_chan ; spinlock_t chan_lock ; bool led_registered ; char led_name[32U] ; struct led_classdev led_cdev ; struct ath9k_debug debug ; struct delayed_work tx_complete_work ; struct delayed_work hw_pll_work ; struct timer_list sleep_timer ; struct ath_btcoex btcoex ; struct ath_mci_coex mci_coex ; struct work_struct mci_work ; struct ath_descdma txsdma ; struct ath_ant_comb ant_comb ; u8 ant_tx ; u8 ant_rx ; struct dfs_pattern_detector *dfs_detector ; u64 dfs_prev_pulse_ts ; u32 wow_enabled ; struct ath_spec_scan_priv spec_priv ; struct ieee80211_vif *tx99_vif ; struct sk_buff *tx99_skb ; bool tx99_state ; s16 tx99_power ; u32 wow_intr_before_sleep ; bool force_wow ; }; typedef bool ldv_func_ret_type; typedef bool ldv_func_ret_type___0; typedef bool ldv_func_ret_type___1; typedef bool ldv_func_ret_type___2; enum hrtimer_restart; enum ath9k_int; enum ath9k_int; enum ath_stomp_type { ATH_BTCOEX_STOMP_ALL = 0, ATH_BTCOEX_STOMP_LOW = 1, ATH_BTCOEX_STOMP_NONE = 2, ATH_BTCOEX_STOMP_LOW_FTP = 3, ATH_BTCOEX_STOMP_AUDIO = 4, ATH_BTCOEX_STOMP_MAX = 5 } ; typedef int ldv_func_ret_type___3; typedef int ldv_func_ret_type___4; typedef int ldv_func_ret_type___5; typedef int ldv_func_ret_type___6; typedef int ldv_func_ret_type___7; typedef int ldv_func_ret_type___8; typedef int ldv_func_ret_type___9; enum hrtimer_restart; struct pci_dev; struct platform_device; struct ath9k_platform_data { char const *eeprom_name ; u16 eeprom_data[2048U] ; u8 *macaddr ; int led_pin ; u32 gpio_mask ; u32 gpio_val ; bool endian_check ; bool is_clk_25mhz ; bool tx_gain_buffalo ; bool disable_2ghz ; bool disable_5ghz ; int (*get_mac_revision)(void) ; int (*external_reset)(void) ; bool use_eeprom ; }; struct pollfd { int fd ; short events ; short revents ; }; struct poll_table_struct { void (*_qproc)(struct file * , wait_queue_head_t * , struct poll_table_struct * ) ; unsigned long _key ; }; struct rchan_buf { void *start ; void *data ; size_t offset ; size_t subbufs_produced ; size_t subbufs_consumed ; struct rchan *chan ; wait_queue_head_t read_wait ; struct timer_list timer ; struct dentry *dentry ; struct kref kref ; struct page **page_array ; unsigned int page_count ; unsigned int finalized ; size_t *padding ; size_t prev_padding ; size_t bytes_consumed ; size_t early_bytes ; unsigned int cpu ; }; struct rchan_callbacks; struct rchan { u32 version ; size_t subbuf_size ; size_t n_subbufs ; size_t alloc_size ; struct rchan_callbacks *cb ; struct kref kref ; void *private_data ; size_t last_toobig ; struct rchan_buf *buf[8192U] ; int is_global ; struct list_head list ; struct dentry *parent ; int has_base_filename ; char base_filename[255U] ; }; struct rchan_callbacks { int (*subbuf_start)(struct rchan_buf * , void * , void * , size_t ) ; void (*buf_mapped)(struct rchan_buf * , struct file * ) ; void (*buf_unmapped)(struct rchan_buf * , struct file * ) ; struct dentry *(*create_buf_file)(char const * , struct dentry * , umode_t , struct rchan_buf * , int * ) ; int (*remove_buf_file)(struct dentry * ) ; }; enum nl80211_channel_type { NL80211_CHAN_NO_HT = 0, NL80211_CHAN_HT20 = 1, NL80211_CHAN_HT40MINUS = 2, NL80211_CHAN_HT40PLUS = 3 } ; enum ieee80211_hw_flags { IEEE80211_HW_HAS_RATE_CONTROL = 0, IEEE80211_HW_RX_INCLUDES_FCS = 1, IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING = 2, IEEE80211_HW_SIGNAL_UNSPEC = 3, IEEE80211_HW_SIGNAL_DBM = 4, IEEE80211_HW_NEED_DTIM_BEFORE_ASSOC = 5, IEEE80211_HW_SPECTRUM_MGMT = 6, IEEE80211_HW_AMPDU_AGGREGATION = 7, IEEE80211_HW_SUPPORTS_PS = 8, IEEE80211_HW_PS_NULLFUNC_STACK = 9, IEEE80211_HW_SUPPORTS_DYNAMIC_PS = 10, IEEE80211_HW_MFP_CAPABLE = 11, IEEE80211_HW_WANT_MONITOR_VIF = 12, IEEE80211_HW_NO_AUTO_VIF = 13, IEEE80211_HW_SW_CRYPTO_CONTROL = 14, IEEE80211_HW_SUPPORT_FAST_XMIT = 15, IEEE80211_HW_REPORTS_TX_ACK_STATUS = 16, IEEE80211_HW_CONNECTION_MONITOR = 17, IEEE80211_HW_QUEUE_CONTROL = 18, IEEE80211_HW_SUPPORTS_PER_STA_GTK = 19, IEEE80211_HW_AP_LINK_PS = 20, IEEE80211_HW_TX_AMPDU_SETUP_IN_HW = 21, IEEE80211_HW_SUPPORTS_RC_TABLE = 22, IEEE80211_HW_P2P_DEV_ADDR_FOR_INTF = 23, IEEE80211_HW_TIMING_BEACON_ONLY = 24, IEEE80211_HW_SUPPORTS_HT_CCK_RATES = 25, IEEE80211_HW_CHANCTX_STA_CSA = 26, IEEE80211_HW_SUPPORTS_CLONED_SKBS = 27, IEEE80211_HW_SINGLE_SCAN_ON_ALL_BANDS = 28, NUM_IEEE80211_HW_FLAGS = 29 } ; struct ieee80211_tpt_blink { int throughput ; int blink_time ; }; enum ath9k_int; enum ath9k_int; struct ath9k_eeprom_ctx { struct completion complete ; struct ath_hw *ah ; }; struct __wait_queue; typedef struct __wait_queue wait_queue_t; struct __wait_queue { unsigned int flags ; void *private ; int (*func)(wait_queue_t * , unsigned int , int , void * ) ; struct list_head task_list ; }; enum hrtimer_restart; enum irqreturn { IRQ_NONE = 0, IRQ_HANDLED = 1, IRQ_WAKE_THREAD = 2 } ; typedef enum irqreturn irqreturn_t; struct nl80211_sta_flag_update { __u32 mask ; __u32 set ; }; enum nl80211_mesh_power_mode { NL80211_MESH_POWER_UNKNOWN = 0, NL80211_MESH_POWER_ACTIVE = 1, NL80211_MESH_POWER_LIGHT_SLEEP = 2, NL80211_MESH_POWER_DEEP_SLEEP = 3, __NL80211_MESH_POWER_AFTER_LAST = 4, NL80211_MESH_POWER_MAX = 3 } ; enum nl80211_txrate_gi { NL80211_TXRATE_DEFAULT_GI = 0, NL80211_TXRATE_FORCE_SGI = 1, NL80211_TXRATE_FORCE_LGI = 2 } ; 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 rate_info { u8 flags ; u8 mcs ; u16 legacy ; u8 nss ; u8 bw ; }; struct sta_bss_parameters { u8 flags ; u8 dtim_period ; u16 beacon_interval ; }; struct cfg80211_tid_stats { u32 filled ; u64 rx_msdu ; u64 tx_msdu ; u64 tx_msdu_retries ; u64 tx_msdu_failed ; }; struct station_info { u32 filled ; u32 connected_time ; u32 inactive_time ; u64 rx_bytes ; u64 tx_bytes ; u16 llid ; u16 plid ; u8 plink_state ; s8 signal ; s8 signal_avg ; u8 chains ; s8 chain_signal[4U] ; s8 chain_signal_avg[4U] ; struct rate_info txrate ; struct rate_info rxrate ; u32 rx_packets ; u32 tx_packets ; u32 tx_retries ; u32 tx_failed ; u32 rx_dropped_misc ; struct sta_bss_parameters bss_param ; struct nl80211_sta_flag_update sta_flags ; int generation ; u8 const *assoc_req_ies ; size_t assoc_req_ies_len ; u32 beacon_loss_count ; s64 t_offset ; enum nl80211_mesh_power_mode local_pm ; enum nl80211_mesh_power_mode peer_pm ; enum nl80211_mesh_power_mode nonpeer_pm ; u32 expected_throughput ; u64 rx_beacon ; u8 rx_beacon_signal_avg ; struct cfg80211_tid_stats pertid[17U] ; }; struct __anonstruct_control_365 { u32 legacy ; u8 ht_mcs[10U] ; u16 vht_mcs[8U] ; enum nl80211_txrate_gi gi ; }; struct cfg80211_bitrate_mask { struct __anonstruct_control_365 control[3U] ; }; struct cfg80211_gtk_rekey_data { u8 const *kek ; u8 const *kck ; u8 const *replay_ctr ; }; struct ieee80211_tx_queue_params { u16 txop ; u16 cw_min ; u16 cw_max ; u8 aifs ; bool acm ; bool uapsd ; }; struct ieee80211_low_level_stats { unsigned int dot11ACKFailureCount ; unsigned int dot11RTSFailureCount ; unsigned int dot11FCSErrorCount ; unsigned int dot11RTSSuccessCount ; }; enum ieee80211_chanctx_switch_mode { CHANCTX_SWMODE_REASSIGN_VIF = 0, CHANCTX_SWMODE_SWAP_CONTEXTS = 1 } ; struct ieee80211_vif_chanctx_switch { struct ieee80211_vif *vif ; struct ieee80211_chanctx_conf *old_ctx ; struct ieee80211_chanctx_conf *new_ctx ; }; enum ieee80211_event_type { RSSI_EVENT = 0, MLME_EVENT = 1, BAR_RX_EVENT = 2, BA_FRAME_TIMEOUT = 3 } ; enum ieee80211_rssi_event_data { RSSI_EVENT_HIGH = 0, RSSI_EVENT_LOW = 1 } ; struct ieee80211_rssi_event { enum ieee80211_rssi_event_data data ; }; enum ieee80211_mlme_event_data { AUTH_EVENT = 0, ASSOC_EVENT = 1, DEAUTH_RX_EVENT = 2, DEAUTH_TX_EVENT = 3 } ; enum ieee80211_mlme_event_status { MLME_SUCCESS = 0, MLME_DENIED = 1, MLME_TIMEOUT = 2 } ; struct ieee80211_mlme_event { enum ieee80211_mlme_event_data data ; enum ieee80211_mlme_event_status status ; u16 reason ; }; struct ieee80211_ba_event { struct ieee80211_sta *sta ; u16 tid ; u16 ssn ; }; union __anonunion_u_367 { struct ieee80211_rssi_event rssi ; struct ieee80211_mlme_event mlme ; struct ieee80211_ba_event ba ; }; struct ieee80211_event { enum ieee80211_event_type type ; union __anonunion_u_367 u ; }; struct ieee80211_scan_ies { u8 const *ies[3U] ; size_t len[3U] ; u8 const *common_ies ; size_t common_ie_len ; }; struct ieee80211_channel_switch { u64 timestamp ; u32 device_timestamp ; bool block_tx ; struct cfg80211_chan_def chandef ; u8 count ; }; struct __anonstruct_tkip_376 { u32 iv32 ; u16 iv16 ; }; struct __anonstruct_ccmp_377 { u8 pn[6U] ; }; struct __anonstruct_aes_cmac_378 { u8 pn[6U] ; }; struct __anonstruct_aes_gmac_379 { u8 pn[6U] ; }; struct __anonstruct_gcmp_380 { u8 pn[6U] ; }; struct __anonstruct_hw_381 { u8 seq[16U] ; u8 seq_len ; }; union __anonunion____missing_field_name_375 { struct __anonstruct_tkip_376 tkip ; struct __anonstruct_ccmp_377 ccmp ; struct __anonstruct_aes_cmac_378 aes_cmac ; struct __anonstruct_aes_gmac_379 aes_gmac ; struct __anonstruct_gcmp_380 gcmp ; struct __anonstruct_hw_381 hw ; }; struct ieee80211_key_seq { union __anonunion____missing_field_name_375 __annonCompField100 ; }; enum set_key_cmd { SET_KEY = 0, DISABLE_KEY = 1 } ; enum ieee80211_sta_state { IEEE80211_STA_NOTEXIST = 0, IEEE80211_STA_NONE = 1, IEEE80211_STA_AUTH = 2, IEEE80211_STA_ASSOC = 3, IEEE80211_STA_AUTHORIZED = 4 } ; enum sta_notify_cmd { STA_NOTIFY_SLEEP = 0, STA_NOTIFY_AWAKE = 1 } ; struct ieee80211_tx_control { struct ieee80211_sta *sta ; }; struct ieee80211_scan_request { struct ieee80211_scan_ies ies ; struct cfg80211_scan_request req ; }; struct ieee80211_tdls_ch_sw_params { struct ieee80211_sta *sta ; struct cfg80211_chan_def *chandef ; u8 action_code ; u32 status ; u32 timestamp ; u16 switch_time ; u16 switch_timeout ; struct sk_buff *tmpl_skb ; u32 ch_sw_tm_ie ; }; enum ieee80211_ampdu_mlme_action { IEEE80211_AMPDU_RX_START = 0, IEEE80211_AMPDU_RX_STOP = 1, IEEE80211_AMPDU_TX_START = 2, IEEE80211_AMPDU_TX_STOP_CONT = 3, IEEE80211_AMPDU_TX_STOP_FLUSH = 4, IEEE80211_AMPDU_TX_STOP_FLUSH_CONT = 5, IEEE80211_AMPDU_TX_OPERATIONAL = 6 } ; enum ieee80211_frame_release_type { IEEE80211_FRAME_RELEASE_PSPOLL = 0, IEEE80211_FRAME_RELEASE_UAPSD = 1 } ; enum ieee80211_roc_type { IEEE80211_ROC_TYPE_NORMAL = 0, IEEE80211_ROC_TYPE_MGMT_TX = 1 } ; enum ieee80211_reconfig_type { IEEE80211_RECONFIG_TYPE_RESTART = 0, IEEE80211_RECONFIG_TYPE_SUSPEND = 1 } ; struct ieee80211_ops { void (*tx)(struct ieee80211_hw * , struct ieee80211_tx_control * , struct sk_buff * ) ; int (*start)(struct ieee80211_hw * ) ; void (*stop)(struct ieee80211_hw * ) ; int (*suspend)(struct ieee80211_hw * , struct cfg80211_wowlan * ) ; int (*resume)(struct ieee80211_hw * ) ; void (*set_wakeup)(struct ieee80211_hw * , bool ) ; int (*add_interface)(struct ieee80211_hw * , struct ieee80211_vif * ) ; int (*change_interface)(struct ieee80211_hw * , struct ieee80211_vif * , enum nl80211_iftype , bool ) ; 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 ) ; int (*start_ap)(struct ieee80211_hw * , struct ieee80211_vif * ) ; void (*stop_ap)(struct ieee80211_hw * , struct ieee80211_vif * ) ; 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 * ) ; void (*set_rekey_data)(struct ieee80211_hw * , struct ieee80211_vif * , struct cfg80211_gtk_rekey_data * ) ; void (*set_default_unicast_key)(struct ieee80211_hw * , struct ieee80211_vif * , int ) ; int (*hw_scan)(struct ieee80211_hw * , struct ieee80211_vif * , struct ieee80211_scan_request * ) ; void (*cancel_hw_scan)(struct ieee80211_hw * , struct ieee80211_vif * ) ; int (*sched_scan_start)(struct ieee80211_hw * , struct ieee80211_vif * , struct cfg80211_sched_scan_request * , struct ieee80211_scan_ies * ) ; int (*sched_scan_stop)(struct ieee80211_hw * , struct ieee80211_vif * ) ; void (*sw_scan_start)(struct ieee80211_hw * , struct ieee80211_vif * , u8 const * ) ; void (*sw_scan_complete)(struct ieee80211_hw * , struct ieee80211_vif * ) ; int (*get_stats)(struct ieee80211_hw * , struct ieee80211_low_level_stats * ) ; void (*get_key_seq)(struct ieee80211_hw * , struct ieee80211_key_conf * , struct ieee80211_key_seq * ) ; int (*set_frag_threshold)(struct ieee80211_hw * , u32 ) ; 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_add_debugfs)(struct ieee80211_hw * , struct ieee80211_vif * , struct ieee80211_sta * , struct dentry * ) ; void (*sta_remove_debugfs)(struct ieee80211_hw * , struct ieee80211_vif * , struct ieee80211_sta * , struct dentry * ) ; void (*sta_notify)(struct ieee80211_hw * , struct ieee80211_vif * , enum sta_notify_cmd , struct ieee80211_sta * ) ; int (*sta_state)(struct ieee80211_hw * , struct ieee80211_vif * , struct ieee80211_sta * , enum ieee80211_sta_state , enum ieee80211_sta_state ) ; void (*sta_pre_rcu_remove)(struct ieee80211_hw * , struct ieee80211_vif * , struct ieee80211_sta * ) ; void (*sta_rc_update)(struct ieee80211_hw * , struct ieee80211_vif * , struct ieee80211_sta * , u32 ) ; void (*sta_rate_tbl_update)(struct ieee80211_hw * , struct ieee80211_vif * , struct ieee80211_sta * ) ; void (*sta_statistics)(struct ieee80211_hw * , struct ieee80211_vif * , struct ieee80211_sta * , struct station_info * ) ; int (*conf_tx)(struct ieee80211_hw * , struct ieee80211_vif * , u16 , struct ieee80211_tx_queue_params const * ) ; u64 (*get_tsf)(struct ieee80211_hw * , struct ieee80211_vif * ) ; void (*set_tsf)(struct ieee80211_hw * , struct ieee80211_vif * , u64 ) ; void (*reset_tsf)(struct ieee80211_hw * , struct ieee80211_vif * ) ; 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 * , u8 ) ; int (*get_survey)(struct ieee80211_hw * , int , struct survey_info * ) ; void (*rfkill_poll)(struct ieee80211_hw * ) ; void (*set_coverage_class)(struct ieee80211_hw * , s16 ) ; int (*testmode_cmd)(struct ieee80211_hw * , struct ieee80211_vif * , void * , int ) ; int (*testmode_dump)(struct ieee80211_hw * , struct sk_buff * , struct netlink_callback * , void * , int ) ; void (*flush)(struct ieee80211_hw * , struct ieee80211_vif * , u32 , bool ) ; void (*channel_switch)(struct ieee80211_hw * , struct ieee80211_vif * , struct ieee80211_channel_switch * ) ; int (*set_antenna)(struct ieee80211_hw * , u32 , u32 ) ; int (*get_antenna)(struct ieee80211_hw * , u32 * , u32 * ) ; int (*remain_on_channel)(struct ieee80211_hw * , struct ieee80211_vif * , struct ieee80211_channel * , int , enum ieee80211_roc_type ) ; int (*cancel_remain_on_channel)(struct ieee80211_hw * ) ; int (*set_ringparam)(struct ieee80211_hw * , u32 , u32 ) ; void (*get_ringparam)(struct ieee80211_hw * , u32 * , u32 * , u32 * , u32 * ) ; bool (*tx_frames_pending)(struct ieee80211_hw * ) ; int (*set_bitrate_mask)(struct ieee80211_hw * , struct ieee80211_vif * , struct cfg80211_bitrate_mask const * ) ; void (*event_callback)(struct ieee80211_hw * , struct ieee80211_vif * , struct ieee80211_event const * ) ; void (*allow_buffered_frames)(struct ieee80211_hw * , struct ieee80211_sta * , u16 , int , enum ieee80211_frame_release_type , bool ) ; void (*release_buffered_frames)(struct ieee80211_hw * , struct ieee80211_sta * , u16 , int , enum ieee80211_frame_release_type , bool ) ; int (*get_et_sset_count)(struct ieee80211_hw * , struct ieee80211_vif * , int ) ; void (*get_et_stats)(struct ieee80211_hw * , struct ieee80211_vif * , struct ethtool_stats * , u64 * ) ; void (*get_et_strings)(struct ieee80211_hw * , struct ieee80211_vif * , u32 , u8 * ) ; void (*mgd_prepare_tx)(struct ieee80211_hw * , struct ieee80211_vif * ) ; void (*mgd_protect_tdls_discover)(struct ieee80211_hw * , struct ieee80211_vif * ) ; int (*add_chanctx)(struct ieee80211_hw * , struct ieee80211_chanctx_conf * ) ; void (*remove_chanctx)(struct ieee80211_hw * , struct ieee80211_chanctx_conf * ) ; void (*change_chanctx)(struct ieee80211_hw * , struct ieee80211_chanctx_conf * , u32 ) ; int (*assign_vif_chanctx)(struct ieee80211_hw * , struct ieee80211_vif * , struct ieee80211_chanctx_conf * ) ; void (*unassign_vif_chanctx)(struct ieee80211_hw * , struct ieee80211_vif * , struct ieee80211_chanctx_conf * ) ; int (*switch_vif_chanctx)(struct ieee80211_hw * , struct ieee80211_vif_chanctx_switch * , int , enum ieee80211_chanctx_switch_mode ) ; void (*reconfig_complete)(struct ieee80211_hw * , enum ieee80211_reconfig_type ) ; void (*ipv6_addr_change)(struct ieee80211_hw * , struct ieee80211_vif * , struct inet6_dev * ) ; void (*channel_switch_beacon)(struct ieee80211_hw * , struct ieee80211_vif * , struct cfg80211_chan_def * ) ; int (*pre_channel_switch)(struct ieee80211_hw * , struct ieee80211_vif * , struct ieee80211_channel_switch * ) ; int (*post_channel_switch)(struct ieee80211_hw * , struct ieee80211_vif * ) ; int (*join_ibss)(struct ieee80211_hw * , struct ieee80211_vif * ) ; void (*leave_ibss)(struct ieee80211_hw * , struct ieee80211_vif * ) ; u32 (*get_expected_throughput)(struct ieee80211_sta * ) ; int (*get_txpower)(struct ieee80211_hw * , struct ieee80211_vif * , int * ) ; int (*tdls_channel_switch)(struct ieee80211_hw * , struct ieee80211_vif * , struct ieee80211_sta * , u8 , struct cfg80211_chan_def * , struct sk_buff * , u32 ) ; void (*tdls_cancel_channel_switch)(struct ieee80211_hw * , struct ieee80211_vif * , struct ieee80211_sta * ) ; void (*tdls_recv_channel_switch)(struct ieee80211_hw * , struct ieee80211_vif * , struct ieee80211_tdls_ch_sw_params * ) ; void (*wake_tx_queue)(struct ieee80211_hw * , struct ieee80211_txq * ) ; }; enum ath9k_int; enum ath9k_int; struct ath_tx_control { struct ath_txq *txq ; struct ath_node *an ; struct ieee80211_sta *sta ; u8 paprd ; bool force_channel ; }; struct ath9k_vif_iter_data { u8 hw_macaddr[6U] ; u8 mask[6U] ; bool has_hw_macaddr ; u8 slottime ; bool beacons ; int naps ; int nmeshes ; int nstations ; int nwds ; int nadhocs ; struct ieee80211_vif *primary_sta ; }; typedef bool ldv_func_ret_type___10; typedef bool ldv_func_ret_type___11; typedef bool ldv_func_ret_type___12; typedef bool ldv_func_ret_type___13; typedef bool ldv_func_ret_type___14; typedef bool ldv_func_ret_type___15; typedef int ldv_func_ret_type___16; typedef int ldv_func_ret_type___17; typedef int ldv_func_ret_type___18; typedef int ldv_func_ret_type___19; enum hrtimer_restart; struct ieee80211_tim_ie { u8 dtim_count ; u8 dtim_period ; u8 bitmap_ctrl ; u8 virtual_map[1U] ; }; struct ieee80211_rx_status; struct ieee80211_rx_status { u64 mactime ; u32 device_timestamp ; u32 ampdu_reference ; u32 flag ; u16 freq ; u8 vht_flag ; u8 rate_idx ; u8 vht_nss ; u8 rx_flags ; u8 band ; u8 antenna ; s8 signal ; u8 chains ; s8 chain_signal[4U] ; u8 ampdu_delimiter_crc ; }; struct ath_rx_status { u32 rs_tstamp ; u16 rs_datalen ; u8 rs_status ; u8 rs_phyerr ; int8_t rs_rssi ; u8 rs_keyix ; u8 rs_rate ; u8 rs_antenna ; u8 rs_more ; int8_t rs_rssi_ctl[3U] ; int8_t rs_rssi_ext[3U] ; u8 rs_isaggr ; u8 rs_firstaggr ; u8 rs_moreaggr ; u8 rs_num_delims ; u8 rs_flags ; bool is_mybeacon ; u32 evm0 ; u32 evm1 ; u32 evm2 ; u32 evm3 ; u32 evm4 ; u32 flag ; }; struct ath_desc { u32 ds_link ; u32 ds_data ; u32 ds_ctl0 ; u32 ds_ctl1 ; u32 ds_hw[20U] ; void *ds_vdata ; }; enum ath9k_int; enum ath9k_int; enum ath9k_rx_qtype { ATH9K_RX_QUEUE_HP = 0, ATH9K_RX_QUEUE_LP = 1, ATH9K_RX_QUEUE_MAX = 2 } ; struct ar9003_txs { u32 ds_info ; u32 status1 ; u32 status2 ; u32 status3 ; u32 status4 ; u32 status5 ; u32 status6 ; u32 status7 ; u32 status8 ; }; typedef int pao_T__; typedef int pao_T_____0; enum hrtimer_restart; enum ath9k_int; enum ath9k_int; struct ath_frame_info { struct ath_buf *bf ; u16 framelen ; s8 txq ; u8 keyix ; u8 rtscts_rate ; unsigned char retries : 7 ; unsigned char baw_tracked : 1 ; u8 tx_power ; unsigned char keytype : 2 ; }; enum hrtimer_restart; enum ath9k_int; enum ath9k_int; enum hrtimer_restart; enum ath9k_int; enum ath9k_int; enum hrtimer_restart; struct ieee80211_hdr_3addr { __le16 frame_control ; __le16 duration_id ; u8 addr1[6U] ; u8 addr2[6U] ; u8 addr3[6U] ; __le16 seq_ctrl ; }; enum ath9k_int; enum ath9k_int; enum hrtimer_restart; enum ath9k_int; enum ath9k_int; struct ath_mci_profile_info { u8 type ; u8 conn_handle ; bool start ; bool master ; bool edr ; u8 voice_type ; u16 T ; u8 W ; u8 A ; struct list_head list ; }; struct ath_mci_profile_status { bool is_critical ; bool is_link ; u8 conn_handle ; }; typedef u64 phys_addr_t; typedef phys_addr_t resource_size_t; enum hrtimer_restart; 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_bus; struct pci_device_id { __u32 vendor ; __u32 device ; __u32 subvendor ; __u32 subdevice ; __u32 class ; __u32 class_mask ; kernel_ulong_t driver_data ; }; struct hotplug_slot; struct pci_slot { struct pci_bus *bus ; struct list_head list ; struct hotplug_slot *hotplug ; unsigned char number ; struct kobject kobj ; }; typedef int pci_power_t; typedef unsigned int pci_channel_state_t; enum pci_channel_state { pci_channel_io_normal = 1, pci_channel_io_frozen = 2, pci_channel_io_perm_failure = 3 } ; typedef unsigned short pci_dev_flags_t; typedef unsigned short pci_bus_flags_t; struct pcie_link_state; struct pci_vpd; struct pci_sriov; struct pci_ats; struct pci_driver; union __anonunion____missing_field_name_220 { struct pci_sriov *sriov ; struct pci_dev *physfn ; }; struct pci_dev { struct list_head bus_list ; struct pci_bus *bus ; struct pci_bus *subordinate ; void *sysdata ; struct proc_dir_entry *procent ; struct pci_slot *slot ; unsigned int devfn ; unsigned short vendor ; unsigned short device ; unsigned short subsystem_vendor ; unsigned short subsystem_device ; unsigned int class ; u8 revision ; u8 hdr_type ; u8 pcie_cap ; u8 msi_cap ; u8 msix_cap ; unsigned char pcie_mpss : 3 ; u8 rom_base_reg ; u8 pin ; u16 pcie_flags_reg ; u8 dma_alias_devfn ; struct pci_driver *driver ; u64 dma_mask ; struct device_dma_parameters dma_parms ; pci_power_t current_state ; u8 pm_cap ; unsigned char pme_support : 5 ; unsigned char pme_interrupt : 1 ; unsigned char pme_poll : 1 ; unsigned char d1_support : 1 ; unsigned char d2_support : 1 ; unsigned char no_d1d2 : 1 ; unsigned char no_d3cold : 1 ; unsigned char d3cold_allowed : 1 ; unsigned char mmio_always_on : 1 ; unsigned char wakeup_prepared : 1 ; unsigned char runtime_d3cold : 1 ; unsigned char ignore_hotplug : 1 ; unsigned int d3_delay ; unsigned int d3cold_delay ; struct pcie_link_state *link_state ; pci_channel_state_t error_state ; struct device dev ; int cfg_size ; unsigned int irq ; struct resource resource[17U] ; bool match_driver ; unsigned char transparent : 1 ; unsigned char multifunction : 1 ; unsigned char is_added : 1 ; unsigned char is_busmaster : 1 ; unsigned char no_msi : 1 ; unsigned char no_64bit_msi : 1 ; unsigned char block_cfg_access : 1 ; unsigned char broken_parity_status : 1 ; unsigned char irq_reroute_variant : 2 ; unsigned char msi_enabled : 1 ; unsigned char msix_enabled : 1 ; unsigned char ari_enabled : 1 ; unsigned char is_managed : 1 ; unsigned char needs_freset : 1 ; unsigned char state_saved : 1 ; unsigned char is_physfn : 1 ; unsigned char is_virtfn : 1 ; unsigned char reset_fn : 1 ; unsigned char is_hotplug_bridge : 1 ; unsigned char __aer_firmware_first_valid : 1 ; unsigned char __aer_firmware_first : 1 ; unsigned char broken_intx_masking : 1 ; unsigned char io_window_1k : 1 ; unsigned char irq_managed : 1 ; unsigned char has_secondary_link : 1 ; pci_dev_flags_t dev_flags ; atomic_t enable_cnt ; u32 saved_config_space[16U] ; struct hlist_head saved_cap_space ; struct bin_attribute *rom_attr ; int rom_attr_enabled ; struct bin_attribute *res_attr[17U] ; struct bin_attribute *res_attr_wc[17U] ; struct list_head msi_list ; struct attribute_group const **msi_irq_groups ; struct pci_vpd *vpd ; union __anonunion____missing_field_name_220 __annonCompField58 ; struct pci_ats *ats ; phys_addr_t rom ; size_t romlen ; char *driver_override ; }; struct pci_ops; struct msi_controller; struct pci_bus { struct list_head node ; struct pci_bus *parent ; struct list_head children ; struct list_head devices ; struct pci_dev *self ; struct list_head slots ; struct resource *resource[4U] ; struct list_head resources ; struct resource busn_res ; struct pci_ops *ops ; struct msi_controller *msi ; void *sysdata ; struct proc_dir_entry *procdir ; unsigned char number ; unsigned char primary ; unsigned char max_bus_speed ; unsigned char cur_bus_speed ; char name[48U] ; unsigned short bridge_ctl ; pci_bus_flags_t bus_flags ; struct device *bridge ; struct device dev ; struct bin_attribute *legacy_io ; struct bin_attribute *legacy_mem ; unsigned char is_added : 1 ; }; struct pci_ops { void *(*map_bus)(struct pci_bus * , unsigned int , int ) ; int (*read)(struct pci_bus * , unsigned int , int , int , u32 * ) ; int (*write)(struct pci_bus * , unsigned int , int , int , u32 ) ; }; struct pci_dynids { spinlock_t lock ; struct list_head list ; }; typedef unsigned int pci_ers_result_t; struct pci_error_handlers { pci_ers_result_t (*error_detected)(struct pci_dev * , enum pci_channel_state ) ; pci_ers_result_t (*mmio_enabled)(struct pci_dev * ) ; pci_ers_result_t (*link_reset)(struct pci_dev * ) ; pci_ers_result_t (*slot_reset)(struct pci_dev * ) ; void (*reset_notify)(struct pci_dev * , bool ) ; void (*resume)(struct pci_dev * ) ; }; struct pci_driver { struct list_head node ; char const *name ; struct pci_device_id const *id_table ; int (*probe)(struct pci_dev * , struct pci_device_id const * ) ; void (*remove)(struct pci_dev * ) ; int (*suspend)(struct pci_dev * , pm_message_t ) ; int (*suspend_late)(struct pci_dev * , pm_message_t ) ; int (*resume_early)(struct pci_dev * ) ; int (*resume)(struct pci_dev * ) ; void (*shutdown)(struct pci_dev * ) ; int (*sriov_configure)(struct pci_dev * , int ) ; struct pci_error_handlers const *err_handler ; struct device_driver driver ; struct pci_dynids dynids ; }; enum ath9k_int; enum ath9k_int; typedef struct ieee80211_hw *ldv_func_ret_type___20; enum hrtimer_restart; struct pdev_archdata { }; struct platform_device_id { char name[20U] ; kernel_ulong_t driver_data ; }; struct mfd_cell; struct platform_device { char const *name ; int id ; bool id_auto ; struct device dev ; u32 num_resources ; struct resource *resource ; struct platform_device_id const *id_entry ; char *driver_override ; struct mfd_cell *mfd_cell ; struct pdev_archdata archdata ; }; struct platform_driver { int (*probe)(struct platform_device * ) ; int (*remove)(struct platform_device * ) ; void (*shutdown)(struct platform_device * ) ; int (*suspend)(struct platform_device * , pm_message_t ) ; int (*resume)(struct platform_device * ) ; struct device_driver driver ; struct platform_device_id const *id_table ; bool prevent_deferred_probe ; }; enum ath9k_int; enum ath9k_int; enum hrtimer_restart; enum ath9k_int; enum ath9k_int; enum hrtimer_restart; enum ath9k_int; enum ath9k_int; struct ath_radar_data { u8 pulse_bw_info ; u8 rssi ; u8 ext_rssi ; u8 pulse_length_ext ; u8 pulse_length_pri ; }; enum hrtimer_restart; enum ath9k_int; enum ath9k_int; enum hrtimer_restart; enum ath9k_int; enum ath9k_int; enum hrtimer_restart; enum ath9k_int; enum ath9k_int; struct __anonstruct_ani_info_396 { char const *name ; unsigned int val ; }; enum hrtimer_restart; enum ath9k_int; enum ath9k_int; __inline static long ldv__builtin_expect(long exp , long c ) ; __inline static void set_bit(long nr , unsigned long volatile *addr ) { { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; bts %1,%0": "+m" (*((long volatile *)addr)): "Ir" (nr): "memory"); return; } } __inline static void clear_bit(long nr , unsigned long volatile *addr ) { { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; btr %1,%0": "+m" (*((long volatile *)addr)): "Ir" (nr)); return; } } __inline static int constant_test_bit(long nr , unsigned long const volatile *addr ) { { return ((int )((unsigned long )*(addr + (unsigned long )(nr >> 6)) >> ((int )nr & 63)) & 1); } } extern void __list_add(struct list_head * , struct list_head * , struct list_head * ) ; __inline static void list_add_tail(struct list_head *new , struct list_head *head ) { { __list_add(new, head->prev, head); return; } } extern void list_del(struct list_head * ) ; extern unsigned long __phys_addr(unsigned long ) ; extern void *memset(void * , int , size_t ) ; __inline static void atomic_inc(atomic_t *v ) { { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; incl %0": "+m" (v->counter)); return; } } __inline static void atomic_dec(atomic_t *v ) { { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; decl %0": "+m" (v->counter)); return; } } extern void _raw_spin_lock_bh(raw_spinlock_t * ) ; extern unsigned long _raw_spin_lock_irqsave(raw_spinlock_t * ) ; extern void _raw_spin_unlock_bh(raw_spinlock_t * ) ; extern void _raw_spin_unlock_irqrestore(raw_spinlock_t * , unsigned long ) ; __inline static raw_spinlock_t *spinlock_check(spinlock_t *lock ) { { return (& lock->__annonCompField18.rlock); } } __inline static void spin_lock_bh(spinlock_t *lock ) { { _raw_spin_lock_bh(& lock->__annonCompField18.rlock); return; } } __inline static void spin_unlock_bh(spinlock_t *lock ) { { _raw_spin_unlock_bh(& lock->__annonCompField18.rlock); return; } } __inline static void spin_unlock_irqrestore(spinlock_t *lock , unsigned long flags ) { { _raw_spin_unlock_irqrestore(& lock->__annonCompField18.rlock, flags); return; } } extern bool queue_work_on(int , struct workqueue_struct * , struct work_struct * ) ; bool ldv_queue_work_on_5(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_7(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; extern bool queue_delayed_work_on(int , struct workqueue_struct * , struct delayed_work * , unsigned long ) ; bool ldv_queue_delayed_work_on_6(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; bool ldv_queue_delayed_work_on_9(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; extern void flush_workqueue(struct workqueue_struct * ) ; void ldv_flush_workqueue_8(struct workqueue_struct *ldv_func_arg1 ) ; extern 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 long ldv__builtin_expect(long exp , long c ) { { return (exp); } } int ldv_irq_1_3 = 0; int LDV_IN_INTERRUPT = 1; int ldv_irq_1_1 = 0; int ldv_irq_2_2 = 0; int ldv_irq_1_0 = 0; int ldv_irq_1_2 = 0; int ldv_irq_2_0 = 0; int ldv_irq_2_1 = 0; int probed_33 = 0; int ldv_irq_2_3 = 0; void call_and_disable_all_7(int state ) ; void activate_work_7(struct work_struct *work , int state ) ; __inline static int valid_dma_direction(int dma_direction ) { { return ((dma_direction == 0 || dma_direction == 1) || dma_direction == 2); } } __inline static void kmemcheck_mark_initialized(void *address , unsigned int n ) { { return; } } extern void debug_dma_map_page(struct device * , struct page * , size_t , size_t , int , dma_addr_t , bool ) ; extern void debug_dma_mapping_error(struct device * , dma_addr_t ) ; extern void debug_dma_unmap_page(struct device * , dma_addr_t , size_t , int , bool ) ; extern struct dma_map_ops *dma_ops ; __inline static struct dma_map_ops *get_dma_ops(struct device *dev ) { long tmp ; { tmp = ldv__builtin_expect((unsigned long )dev == (unsigned long )((struct device *)0), 0L); if (tmp != 0L || (unsigned long )dev->archdata.dma_ops == (unsigned long )((struct dma_map_ops *)0)) { return (dma_ops); } else { return (dev->archdata.dma_ops); } } } __inline static dma_addr_t dma_map_single_attrs(struct device *dev , void *ptr , size_t size , enum dma_data_direction dir , struct dma_attrs *attrs ) { struct dma_map_ops *ops ; struct dma_map_ops *tmp ; dma_addr_t addr ; int tmp___0 ; long tmp___1 ; unsigned long tmp___2 ; unsigned long tmp___3 ; { tmp = get_dma_ops(dev); ops = tmp; kmemcheck_mark_initialized(ptr, (unsigned int )size); tmp___0 = valid_dma_direction((int )dir); tmp___1 = ldv__builtin_expect(tmp___0 == 0, 0L); if (tmp___1 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"include/asm-generic/dma-mapping-common.h"), "i" (19), "i" (12UL)); ldv_25160: ; goto ldv_25160; } 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" (36), "i" (12UL)); ldv_25169: ; goto ldv_25169; } else { } if ((unsigned long )ops->unmap_page != (unsigned long )((void (*)(struct device * , dma_addr_t , size_t , enum dma_data_direction , struct dma_attrs * ))0)) { (*(ops->unmap_page))(dev, addr, size, dir, attrs); } else { } debug_dma_unmap_page(dev, addr, size, (int )dir, 1); return; } } __inline static int dma_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; debug_dma_mapping_error(dev, dma_addr); if ((unsigned long )ops->mapping_error != (unsigned long )((int (*)(struct device * , dma_addr_t ))0)) { tmp___0 = (*(ops->mapping_error))(dev, dma_addr); return (tmp___0); } else { } return (dma_addr == 0ULL); } } __inline static void tasklet_unlock_wait(struct tasklet_struct *t ) { int tmp ; { goto ldv_37275; ldv_37274: __asm__ volatile ("": : : "memory"); ldv_37275: tmp = constant_test_bit(1L, (unsigned long const volatile *)(& t->state)); if (tmp != 0) { goto ldv_37274; } else { } return; } } __inline static void tasklet_disable_nosync(struct tasklet_struct *t ) { { atomic_inc(& t->count); __asm__ volatile ("": : : "memory"); return; } } __inline static void tasklet_disable(struct tasklet_struct *t ) { { tasklet_disable_nosync(t); tasklet_unlock_wait(t); __asm__ volatile ("mfence": : : "memory"); return; } } __inline static void tasklet_enable(struct tasklet_struct *t ) { { __asm__ volatile ("": : : "memory"); atomic_dec(& t->count); return; } } extern void __dev_kfree_skb_any(struct sk_buff * , enum skb_free_reason ) ; __inline static void dev_kfree_skb_any(struct sk_buff *skb ) { { __dev_kfree_skb_any(skb, 1); return; } } __inline static struct ieee80211_tx_info *IEEE80211_SKB_CB(struct sk_buff *skb ) { { return ((struct ieee80211_tx_info *)(& skb->cb)); } } 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_csa_finish(struct ieee80211_vif * ) ; extern bool ieee80211_csa_is_complete(struct ieee80211_vif * ) ; extern struct sk_buff *ieee80211_get_buffered_bc(struct ieee80211_hw * , struct ieee80211_vif * ) ; extern void ieee80211_iterate_active_interfaces_atomic(struct ieee80211_hw * , u32 , void (*)(void * , u8 * , struct ieee80211_vif * ) , void * ) ; extern void ath_printk(char const * , struct ath_common const * , char const * , ...) ; extern void ath9k_hw_puttxbuf(struct ath_hw * , u32 , u32 ) ; extern void ath9k_hw_txstart(struct ath_hw * , u32 ) ; extern u32 ath9k_hw_numtxpending(struct ath_hw * , u32 ) ; extern bool ath9k_hw_stop_dma_queue(struct ath_hw * , u32 ) ; extern bool ath9k_hw_set_txq_props(struct ath_hw * , int , struct ath9k_tx_queue_info const * ) ; extern bool ath9k_hw_get_txq_props(struct ath_hw * , int , struct ath9k_tx_queue_info * ) ; extern bool ath9k_hw_resettxqueue(struct ath_hw * , u32 ) ; extern void ath9k_hw_set_interrupts(struct ath_hw * ) ; extern void ath9k_hw_enable_interrupts(struct ath_hw * ) ; extern void ath9k_hw_disable_interrupts(struct ath_hw * ) ; extern void ath9k_hw_bstuck_nfcal(struct ath_hw * ) ; __inline static struct ath_common *ath9k_hw_common(struct ath_hw *ah ) { { return (& ah->common); } } __inline static struct ath_hw_ops *ath9k_hw_ops(struct ath_hw *ah ) { { return (& ah->ops); } } extern u64 ath9k_hw_gettsf64(struct ath_hw * ) ; extern void ath9k_hw_reset_tsf(struct ath_hw * ) ; extern void ath9k_hw_init_global_settings(struct ath_hw * ) ; extern void ath9k_hw_beaconinit(struct ath_hw * , u32 , u32 ) ; extern void ath9k_hw_set_sta_beacon_timers(struct ath_hw * , struct ath9k_beacon_state const * ) ; extern void ath9k_hw_check_nav(struct ath_hw * ) ; __inline static void ath9k_hw_set_txdesc(struct ath_hw *ah , void *ds , struct ath_tx_info *i ) { struct ath_hw_ops *tmp ; { tmp = ath9k_hw_ops(ah); return; } } extern int ath9k_cmn_beacon_config_sta(struct ath_hw * , struct ath_beacon_config * , struct ath9k_beacon_state * ) ; extern void ath9k_cmn_beacon_config_adhoc(struct ath_hw * , struct ath_beacon_config * ) ; extern void ath9k_cmn_beacon_config_ap(struct ath_hw * , struct ath_beacon_config * , unsigned int ) ; bool ath9k_is_chanctx_enabled(void) ; void ath9k_beacon_add_noa(struct ath_softc *sc , struct ath_vif *avp , struct sk_buff *skb ) ; void ath_chanctx_beacon_sent_ev(struct ath_softc *sc , enum ath_chanctx_event ev ) ; void ath_chanctx_event(struct ath_softc *sc , struct ieee80211_vif *vif , enum ath_chanctx_event ev ) ; void ath_draintxq(struct ath_softc *sc , struct ath_txq *txq ) ; void ath_assign_seq(struct ath_common *common , struct sk_buff *skb ) ; void ath_tx_cabq(struct ieee80211_hw *hw , struct ieee80211_vif *vif , struct sk_buff *skb ) ; void ath9k_beacon_tasklet(unsigned long data ) ; void ath9k_beacon_config(struct ath_softc *sc , struct ieee80211_vif *vif , u32 changed ) ; void ath9k_beacon_assign_slot(struct ath_softc *sc , struct ieee80211_vif *vif ) ; void ath9k_beacon_remove_slot(struct ath_softc *sc , struct ieee80211_vif *vif ) ; void ath9k_set_beacon(struct ath_softc *sc ) ; bool ath9k_csa_is_finished(struct ath_softc *sc , struct ieee80211_vif *vif ) ; void ath9k_csa_update(struct ath_softc *sc ) ; bool ath_hw_check(struct ath_softc *sc ) ; void ath9k_queue_reset(struct ath_softc *sc , enum ath_reset_type type ) ; u8 ath_txchainmask_reduction(struct ath_softc *sc , u8 chainmask , u32 rate ) ; static void ath9k_reset_beacon_status(struct ath_softc *sc ) { { sc->beacon.tx_processed = 0; sc->beacon.tx_last = 0; return; } } static void ath9k_beaconq_config(struct ath_softc *sc ) { struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; struct ath9k_tx_queue_info qi ; struct ath9k_tx_queue_info qi_be ; struct ath_txq *txq ; bool tmp___0 ; int tmp___1 ; { ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; ath9k_hw_get_txq_props(ah, (int )sc->beacon.beaconq, & qi); if ((unsigned int )(sc->sc_ah)->opmode == 3U || (unsigned int )(sc->sc_ah)->opmode == 7U) { qi.tqi_aifs = 1U; qi.tqi_cwmin = 0U; qi.tqi_cwmax = 0U; } else { txq = sc->tx.txq_map[2]; ath9k_hw_get_txq_props(ah, (int )txq->axq_qnum, & qi_be); qi.tqi_aifs = qi_be.tqi_aifs; if (ah->slottime == 20U) { qi.tqi_cwmin = qi_be.tqi_cwmin * 2U; } else { qi.tqi_cwmin = qi_be.tqi_cwmin * 4U; } qi.tqi_cwmax = qi_be.tqi_cwmax; } tmp___0 = ath9k_hw_set_txq_props(ah, (int )sc->beacon.beaconq, (struct ath9k_tx_queue_info const *)(& qi)); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { ath_printk("\v", (struct ath_common const *)common, "Unable to update h/w beacon queue parameters\n"); } else { ath9k_hw_resettxqueue(ah, sc->beacon.beaconq); } return; } } static void ath9k_beacon_setup(struct ath_softc *sc , struct ieee80211_vif *vif , struct ath_buf *bf , int rateidx ) { struct sk_buff *skb ; struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; struct ath_tx_info info ; struct ieee80211_supported_band *sband ; u8 chainmask ; u8 i ; u8 rate ; int __y ; u8 tmp___0 ; { skb = bf->bf_mpdu; ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; chainmask = ah->txchainmask; rate = 0U; sband = (struct ieee80211_supported_band *)(& common->sbands) + (unsigned long )(sc->cur_chandef.chan)->band; rate = (u8 )(sband->bitrates + (unsigned long )rateidx)->hw_value; if ((int )vif->bss_conf.use_short_preamble) { rate = (int )((u8 )(sband->bitrates + (unsigned long )rateidx)->hw_value_short) | (int )rate; } else { } memset((void *)(& info), 0, 184UL); info.pkt_len = (int )(skb->len + 4U); info.type = 3; i = 0U; goto ldv_54021; ldv_54020: info.txpower[(int )i] = 63U; i = (u8 )((int )i + 1); ldv_54021: ; if ((unsigned int )i <= 3U) { goto ldv_54020; } else { } info.keyix = 255U; info.keytype = 0; info.flags = 4098U; info.buf_addr[0] = bf->bf_buf_addr; __y = 4; info.buf_len[0] = (int )((((skb->len + (unsigned int )__y) + 4294967295U) / (unsigned int )__y) * (unsigned int )__y); info.is_first = 1; info.is_last = 1; info.qcu = (u8 )sc->beacon.beaconq; info.rates[0].Tries = 1U; info.rates[0].Rate = (u32 )rate; tmp___0 = ath_txchainmask_reduction(sc, (int )chainmask, (u32 )rate); info.rates[0].ChSel = (u32 )tmp___0; ath9k_hw_set_txdesc(ah, bf->bf_desc, & info); return; } } static struct ath_buf *ath9k_beacon_generate(struct ieee80211_hw *hw , struct ieee80211_vif *vif ) { struct ath_softc *sc ; struct ath_common *common ; struct ath_common *tmp ; struct ath_buf *bf ; struct ath_vif *avp ; struct sk_buff *skb ; struct ath_txq *cabq ; struct ieee80211_tx_info *info ; struct ieee80211_mgmt *mgmt_hdr ; int cabq_depth ; int tmp___0 ; long tmp___1 ; { sc = (struct ath_softc *)hw->priv; tmp = ath9k_hw_common(sc->sc_ah); common = tmp; avp = (struct ath_vif *)(& vif->drv_priv); cabq = sc->beacon.cabq; if ((unsigned long )avp->av_bcbuf == (unsigned long )((struct ath_buf *)0)) { return ((struct ath_buf *)0); } else { } bf = avp->av_bcbuf; skb = bf->bf_mpdu; if ((unsigned long )skb != (unsigned long )((struct sk_buff *)0)) { dma_unmap_single_attrs(sc->dev, bf->bf_buf_addr, (size_t )skb->len, 1, (struct dma_attrs *)0); dev_kfree_skb_any(skb); bf->bf_buf_addr = 0ULL; bf->bf_mpdu = (struct sk_buff *)0; } else { } skb = ieee80211_beacon_get(hw, vif); if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { return ((struct ath_buf *)0); } else { } bf->bf_mpdu = skb; mgmt_hdr = (struct ieee80211_mgmt *)skb->data; mgmt_hdr->u.beacon.timestamp = avp->tsf_adjust; info = IEEE80211_SKB_CB(skb); ath_assign_seq(common, skb); if ((int )vif->p2p) { ath9k_beacon_add_noa(sc, avp, skb); } else { } bf->bf_buf_addr = dma_map_single_attrs(sc->dev, (void *)skb->data, (size_t )skb->len, 1, (struct dma_attrs *)0); tmp___0 = dma_mapping_error(sc->dev, bf->bf_buf_addr); tmp___1 = ldv__builtin_expect(tmp___0 != 0, 0L); if (tmp___1 != 0L) { dev_kfree_skb_any(skb); bf->bf_mpdu = (struct sk_buff *)0; bf->bf_buf_addr = 0ULL; ath_printk("\v", (struct ath_common const *)common, "dma_mapping_error on beaconing\n"); return ((struct ath_buf *)0); } else { } skb = ieee80211_get_buffered_bc(hw, vif); spin_lock_bh(& cabq->axq_lock); cabq_depth = (int )cabq->axq_depth; spin_unlock_bh(& cabq->axq_lock); if ((unsigned long )skb != (unsigned long )((struct sk_buff *)0) && cabq_depth != 0) { if ((int )(sc->cur_chan)->nvifs > 1) { if ((common->debug_mask & 256) != 0) { ath_printk("\017", (struct ath_common const *)common, "Flushing previous cabq traffic\n"); } else { } ath_draintxq(sc, cabq); } else { } } else { } ath9k_beacon_setup(sc, vif, bf, (int )info->__annonCompField99.control.__annonCompField97.__annonCompField96.rates[0].idx); if ((unsigned long )skb != (unsigned long )((struct sk_buff *)0)) { ath_tx_cabq(hw, vif, skb); } else { } return (bf); } } void ath9k_beacon_assign_slot(struct ath_softc *sc , struct ieee80211_vif *vif ) { struct ath_common *common ; struct ath_common *tmp ; struct ath_vif *avp ; int slot ; struct list_head const *__mptr ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; avp = (struct ath_vif *)(& vif->drv_priv); __mptr = (struct list_head const *)sc->beacon.bbuf.next; avp->av_bcbuf = (struct ath_buf *)__mptr; list_del(& (avp->av_bcbuf)->list); slot = 0; goto ldv_54049; ldv_54048: ; if ((unsigned long )sc->beacon.bslot[slot] == (unsigned long )((struct ieee80211_vif *)0)) { avp->av_bslot = slot; goto ldv_54047; } else { } slot = slot + 1; ldv_54049: ; if (slot <= 7) { goto ldv_54048; } else { } ldv_54047: sc->beacon.bslot[avp->av_bslot] = vif; sc->nbcnvifs = (short )((int )sc->nbcnvifs + 1); if ((common->debug_mask & 512) != 0) { ath_printk("\017", (struct ath_common const *)common, "Added interface at beacon slot: %d\n", avp->av_bslot); } else { } return; } } void ath9k_beacon_remove_slot(struct ath_softc *sc , struct ieee80211_vif *vif ) { struct ath_common *common ; struct ath_common *tmp ; struct ath_vif *avp ; struct ath_buf *bf ; struct ath_beacon_config *cur_conf ; struct sk_buff *skb ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; avp = (struct ath_vif *)(& vif->drv_priv); bf = avp->av_bcbuf; cur_conf = & (sc->cur_chan)->beacon; if ((common->debug_mask & 512) != 0) { ath_printk("\017", (struct ath_common const *)common, "Removing interface at beacon slot: %d\n", avp->av_bslot); } else { } tasklet_disable(& sc->bcon_tasklet); cur_conf->enable_beacon = (int )cur_conf->enable_beacon & ~ ((int )((u8 )(1UL << avp->av_bslot))); if ((unsigned long )bf != (unsigned long )((struct ath_buf *)0) && (unsigned long )bf->bf_mpdu != (unsigned long )((struct sk_buff *)0)) { skb = bf->bf_mpdu; dma_unmap_single_attrs(sc->dev, bf->bf_buf_addr, (size_t )skb->len, 1, (struct dma_attrs *)0); dev_kfree_skb_any(skb); bf->bf_mpdu = (struct sk_buff *)0; bf->bf_buf_addr = 0ULL; } else { } avp->av_bcbuf = (struct ath_buf *)0; sc->beacon.bslot[avp->av_bslot] = (struct ieee80211_vif *)0; sc->nbcnvifs = (short )((int )sc->nbcnvifs - 1); list_add_tail(& bf->list, & sc->beacon.bbuf); tasklet_enable(& sc->bcon_tasklet); return; } } static int ath9k_beacon_choose_slot(struct ath_softc *sc ) { struct ath_common *common ; struct ath_common *tmp ; struct ath_beacon_config *cur_conf ; u16 intval ; u32 tsftu ; u64 tsf ; int slot ; u64 tmp___0 ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; cur_conf = & (sc->cur_chan)->beacon; if ((unsigned int )(sc->sc_ah)->opmode != 3U && (unsigned int )(sc->sc_ah)->opmode != 7U) { if ((common->debug_mask & 256) != 0) { tmp___0 = ath9k_hw_gettsf64(sc->sc_ah); ath_printk("\017", (struct ath_common const *)common, "slot 0, tsf: %llu\n", tmp___0); } else { } return (0); } else { } intval = cur_conf->beacon_interval != 0 ? (u16 )cur_conf->beacon_interval : 100U; tsf = ath9k_hw_gettsf64(sc->sc_ah); tsf = (u64 )((sc->sc_ah)->config.sw_beacon_response_time << 10) + tsf; tsftu = ((unsigned int )(tsf * 8ULL >> 32) << 22) | ((unsigned int )tsf * 8U >> 10); slot = (int )((tsftu % (u32 )((int )intval * 8)) / (u32 )intval); if ((common->debug_mask & 256) != 0) { ath_printk("\017", (struct ath_common const *)common, "slot: %d tsf: %llu tsftu: %u\n", slot, tsf, tsftu / 8U); } else { } return (slot); } } static void ath9k_set_tsfadjust(struct ath_softc *sc , struct ieee80211_vif *vif ) { struct ath_common *common ; struct ath_common *tmp ; struct ath_vif *avp ; struct ath_beacon_config *cur_conf ; u32 tsfadjust ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; avp = (struct ath_vif *)(& vif->drv_priv); cur_conf = & (avp->chanctx)->beacon; if (avp->av_bslot == 0) { return; } else { } tsfadjust = (u32 )(cur_conf->beacon_interval * avp->av_bslot); tsfadjust = (tsfadjust << 10) / 8U; avp->tsf_adjust = (unsigned long long )tsfadjust; if ((common->debug_mask & 512) != 0) { ath_printk("\017", (struct ath_common const *)common, "tsfadjust is: %llu for bslot: %d\n", (unsigned long long )tsfadjust, avp->av_bslot); } else { } return; } } bool ath9k_csa_is_finished(struct ath_softc *sc , struct ieee80211_vif *vif ) { bool tmp ; int tmp___0 ; { if ((unsigned long )vif == (unsigned long )((struct ieee80211_vif *)0) || ! vif->csa_active) { return (0); } else { } tmp = ieee80211_csa_is_complete(vif); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { return (0); } else { } ieee80211_csa_finish(vif); return (1); } } static void ath9k_csa_update_vif(void *data , u8 *mac , struct ieee80211_vif *vif ) { struct ath_softc *sc ; { sc = (struct ath_softc *)data; ath9k_csa_is_finished(sc, vif); return; } } void ath9k_csa_update(struct ath_softc *sc ) { { ieee80211_iterate_active_interfaces_atomic(sc->hw, 0U, & ath9k_csa_update_vif, (void *)sc); return; } } void ath9k_beacon_tasklet(unsigned long data ) { struct ath_softc *sc ; struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; struct ath_buf *bf ; struct ieee80211_vif *vif ; bool edma ; int slot ; int tmp___0 ; bool tmp___1 ; int tmp___2 ; u32 tmp___3 ; bool tmp___4 ; bool tmp___5 ; bool tmp___6 ; { sc = (struct ath_softc *)data; ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; bf = (struct ath_buf *)0; edma = (ah->caps.hw_caps & 16U) != 0U; tmp___0 = constant_test_bit(4L, (unsigned long const volatile *)(& common->op_flags)); if (tmp___0 != 0) { if (common->debug_mask & 1) { ath_printk("\017", (struct ath_common const *)common, "reset work is pending, skip beaconing now\n"); } else { } return; } else { } tmp___3 = ath9k_hw_numtxpending(ah, sc->beacon.beaconq); if (tmp___3 != 0U) { sc->beacon.bmisscnt = sc->beacon.bmisscnt + 1U; ath9k_hw_check_nav(ah); tmp___1 = ath_hw_check(sc); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { return; } else { } if (sc->beacon.bmisscnt < (u32 )((int )sc->nbcnvifs * 9)) { if ((common->debug_mask & 16384) != 0) { ath_printk("\017", (struct ath_common const *)common, "missed %u consecutive beacons\n", sc->beacon.bmisscnt); } else { } ath9k_hw_stop_dma_queue(ah, sc->beacon.beaconq); if (sc->beacon.bmisscnt > 3U) { ath9k_hw_bstuck_nfcal(ah); } else { } } else if (sc->beacon.bmisscnt > 8U) { if ((common->debug_mask & 16384) != 0) { ath_printk("\017", (struct ath_common const *)common, "beacon is officially stuck\n"); } else { } sc->beacon.bmisscnt = 0U; ath9k_queue_reset(sc, 8); } else { } return; } else { } slot = ath9k_beacon_choose_slot(sc); vif = sc->beacon.bslot[slot]; if (! edma) { tmp___4 = ath9k_is_chanctx_enabled(); if ((int )tmp___4) { ath_chanctx_beacon_sent_ev(sc, 1); } else { } tmp___5 = ath9k_csa_is_finished(sc, vif); if ((int )tmp___5) { return; } else { } } else { } if ((unsigned long )vif == (unsigned long )((struct ieee80211_vif *)0) || ! vif->bss_conf.enable_beacon) { return; } else { } tmp___6 = ath9k_is_chanctx_enabled(); if ((int )tmp___6) { ath_chanctx_event(sc, vif, 0); } else { } bf = ath9k_beacon_generate(sc->hw, vif); if (sc->beacon.bmisscnt != 0U) { if ((common->debug_mask & 16384) != 0) { ath_printk("\017", (struct ath_common const *)common, "resume beacon xmit after %u misses\n", sc->beacon.bmisscnt); } else { } sc->beacon.bmisscnt = 0U; } else { } if ((unsigned int )sc->beacon.updateslot == 1U) { sc->beacon.updateslot = 2; sc->beacon.slotupdate = slot; } else if ((unsigned int )sc->beacon.updateslot == 2U && sc->beacon.slotupdate == slot) { ah->slottime = (u32 )sc->beacon.slottime; ath9k_hw_init_global_settings(ah); sc->beacon.updateslot = 0; } else { } if ((unsigned long )bf != (unsigned long )((struct ath_buf *)0)) { ath9k_reset_beacon_status(sc); if ((common->debug_mask & 256) != 0) { ath_printk("\017", (struct ath_common const *)common, "Transmitting beacon for slot: %d\n", slot); } else { } ath9k_hw_puttxbuf(ah, sc->beacon.beaconq, (u32 )bf->bf_daddr); if (! edma) { ath9k_hw_txstart(ah, sc->beacon.beaconq); } else { } } else { } return; } } static void ath9k_beacon_init(struct ath_softc *sc , u32 nexttbtt , u32 intval , bool reset_tsf ) { struct ath_hw *ah ; { ah = sc->sc_ah; ath9k_hw_disable_interrupts(ah); if ((int )reset_tsf) { ath9k_hw_reset_tsf(ah); } else { } ath9k_beaconq_config(sc); ath9k_hw_beaconinit(ah, nexttbtt, intval); sc->beacon.bmisscnt = 0U; ath9k_hw_set_interrupts(ah); ath9k_hw_enable_interrupts(ah); return; } } static void ath9k_beacon_config_ap(struct ath_softc *sc , struct ath_beacon_config *conf ) { struct ath_hw *ah ; { ah = sc->sc_ah; ath9k_cmn_beacon_config_ap(ah, conf, 8U); ath9k_beacon_init(sc, conf->nexttbtt, conf->intval, 0); return; } } static void ath9k_beacon_config_sta(struct ath_hw *ah , struct ath_beacon_config *conf ) { struct ath9k_beacon_state bs ; int tmp ; { tmp = ath9k_cmn_beacon_config_sta(ah, conf, & bs); if (tmp == -1) { return; } else { } ath9k_hw_disable_interrupts(ah); ath9k_hw_set_sta_beacon_timers(ah, (struct ath9k_beacon_state const *)(& bs)); ah->imask = (enum ath9k_int )((unsigned int )ah->imask | 262144U); ath9k_hw_set_interrupts(ah); ath9k_hw_enable_interrupts(ah); return; } } static void ath9k_beacon_config_adhoc(struct ath_softc *sc , struct ath_beacon_config *conf ) { struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; { ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; ath9k_reset_beacon_status(sc); ath9k_cmn_beacon_config_adhoc(ah, conf); ath9k_beacon_init(sc, conf->nexttbtt, conf->intval, (int )conf->ibss_creator); if (! conf->ibss_creator && (unsigned int )conf->enable_beacon != 0U) { set_bit(1L, (unsigned long volatile *)(& common->op_flags)); } else { } return; } } static bool ath9k_allow_beacon_config(struct ath_softc *sc , struct ieee80211_vif *vif ) { struct ath_common *common ; struct ath_common *tmp ; struct ath_vif *avp ; bool tmp___0 ; int tmp___1 ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; avp = (struct ath_vif *)(& vif->drv_priv); tmp___0 = ath9k_is_chanctx_enabled(); if ((int )tmp___0) { if ((unsigned long )sc->cur_chan != (unsigned long )avp->chanctx) { return (1); } else { } } else { } if ((unsigned int )(sc->sc_ah)->opmode == 3U) { if ((unsigned int )vif->type != 3U) { if ((common->debug_mask & 512) != 0) { ath_printk("\017", (struct ath_common const *)common, "An AP interface is already present !\n"); } else { } return (0); } else { } } else { } if ((unsigned int )(sc->sc_ah)->opmode == 2U) { if ((unsigned int )vif->type == 2U) { tmp___1 = constant_test_bit(1L, (unsigned long const volatile *)(& common->op_flags)); if (tmp___1 != 0) { if ((unsigned long )(sc->cur_chan)->primary_sta != (unsigned long )vif) { if ((common->debug_mask & 512) != 0) { ath_printk("\017", (struct ath_common const *)common, "Beacon already configured for a station interface\n"); } else { } return (0); } else { } } else { } } else { } } else { } return (1); } } static void ath9k_cache_beacon_config(struct ath_softc *sc , struct ath_chanctx *ctx , struct ieee80211_bss_conf *bss_conf ) { struct ath_common *common ; struct ath_common *tmp ; struct ath_beacon_config *cur_conf ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; cur_conf = & ctx->beacon; if ((common->debug_mask & 256) != 0) { ath_printk("\017", (struct ath_common const *)common, "Caching beacon data for BSS: %pM\n", bss_conf->bssid); } else { } cur_conf->beacon_interval = (int )bss_conf->beacon_int; cur_conf->dtim_period = (u16 )bss_conf->dtim_period; cur_conf->dtim_count = 1U; cur_conf->ibss_creator = bss_conf->ibss_creator; if (cur_conf->beacon_interval == 0) { cur_conf->beacon_interval = 100; } else { } cur_conf->bmiss_timeout = (unsigned int )((u16 )cur_conf->beacon_interval) * 10U; if ((unsigned int )cur_conf->dtim_period == 0U) { cur_conf->dtim_period = 1U; } else { } return; } } void ath9k_beacon_config(struct ath_softc *sc , struct ieee80211_vif *vif , u32 changed ) { struct ieee80211_bss_conf *bss_conf ; struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; struct ath_vif *avp ; struct ath_chanctx *ctx ; struct ath_beacon_config *cur_conf ; unsigned long flags ; bool skip_beacon ; bool tmp___0 ; int tmp___1 ; bool enabled ; raw_spinlock_t *tmp___2 ; { bss_conf = & vif->bss_conf; ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; avp = (struct ath_vif *)(& vif->drv_priv); ctx = avp->chanctx; skip_beacon = 0; if ((unsigned long )ctx == (unsigned long )((struct ath_chanctx *)0)) { return; } else { } cur_conf = & (avp->chanctx)->beacon; if ((unsigned int )vif->type == 3U) { ath9k_set_tsfadjust(sc, vif); } else { } tmp___0 = ath9k_allow_beacon_config(sc, vif); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { return; } else { } if ((unsigned int )vif->type == 2U) { ath9k_cache_beacon_config(sc, ctx, bss_conf); if ((unsigned long )sc->cur_chan != (unsigned long )ctx) { return; } else { } ath9k_set_beacon(sc); set_bit(1L, (unsigned long volatile *)(& common->op_flags)); return; } else { } if ((changed & 512U) != 0U) { enabled = (unsigned int )cur_conf->enable_beacon != 0U; if (! bss_conf->enable_beacon) { cur_conf->enable_beacon = (int )cur_conf->enable_beacon & ~ ((int )((u8 )(1UL << avp->av_bslot))); } else { cur_conf->enable_beacon = (int )cur_conf->enable_beacon | (int )((u8 )(1UL << avp->av_bslot)); if (! enabled) { ath9k_cache_beacon_config(sc, ctx, bss_conf); } else { } } } else { } if ((unsigned long )sc->cur_chan != (unsigned long )ctx) { return; } else { } if (cur_conf->beacon_interval != 0) { if (((changed & 2048U) != 0U && ! bss_conf->ibss_creator) && (int )bss_conf->enable_beacon) { tmp___2 = spinlock_check(& sc->sc_pm_lock); flags = _raw_spin_lock_irqsave(tmp___2); sc->ps_flags = (u16 )((unsigned int )sc->ps_flags | 17U); spin_unlock_irqrestore(& sc->sc_pm_lock, flags); skip_beacon = 1; } else { ath9k_set_beacon(sc); } if ((unsigned int )cur_conf->enable_beacon != 0U && ! skip_beacon) { set_bit(1L, (unsigned long volatile *)(& common->op_flags)); } else { clear_bit(1L, (unsigned long volatile *)(& common->op_flags)); } } else { } return; } } void ath9k_set_beacon(struct ath_softc *sc ) { struct ath_common *common ; struct ath_common *tmp ; struct ath_beacon_config *cur_conf ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; cur_conf = & (sc->cur_chan)->beacon; switch ((unsigned int )(sc->sc_ah)->opmode) { case 3U: ; case 7U: ath9k_beacon_config_ap(sc, cur_conf); goto ldv_54159; case 1U: ath9k_beacon_config_adhoc(sc, cur_conf); goto ldv_54159; case 2U: ath9k_beacon_config_sta(sc->sc_ah, cur_conf); goto ldv_54159; default: ; if ((common->debug_mask & 512) != 0) { ath_printk("\017", (struct ath_common const *)common, "Unsupported beaconing mode\n"); } else { } return; } ldv_54159: ; return; } } bool ldv_queue_work_on_5(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_6(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_7(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_8(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_7(2); return; } } bool ldv_queue_delayed_work_on_9(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; extern int snprintf(char * , size_t , char const * , ...) ; extern int scnprintf(char * , size_t , char const * , ...) ; __inline static void INIT_LIST_HEAD(struct list_head *list ) { { list->next = list; list->prev = list; return; } } extern void warn_slowpath_null(char const * , int const ) ; extern void __raw_spin_lock_init(raw_spinlock_t * , char const * , struct lock_class_key * ) ; extern unsigned long volatile jiffies ; extern unsigned long __msecs_to_jiffies(unsigned int const ) ; __inline static unsigned long msecs_to_jiffies(unsigned int const m ) { unsigned long tmp___0 ; { tmp___0 = __msecs_to_jiffies(m); return (tmp___0); } } extern int mod_timer(struct timer_list * , unsigned long ) ; int ldv_mod_timer_24(struct timer_list *ldv_func_arg1 , unsigned long ldv_func_arg2 ) ; int ldv_mod_timer_25(struct timer_list *ldv_func_arg1 , unsigned long ldv_func_arg2 ) ; int ldv_mod_timer_27(struct timer_list *ldv_func_arg1 , unsigned long ldv_func_arg2 ) ; extern int del_timer_sync(struct timer_list * ) ; int ldv_del_timer_sync_26(struct timer_list *ldv_func_arg1 ) ; int ldv_del_timer_sync_28(struct timer_list *ldv_func_arg1 ) ; int ldv_del_timer_sync_29(struct timer_list *ldv_func_arg1 ) ; int ldv_del_timer_sync_30(struct timer_list *ldv_func_arg1 ) ; bool ldv_queue_work_on_19(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_21(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_20(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; bool ldv_queue_delayed_work_on_23(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; void ldv_flush_workqueue_22(struct workqueue_struct *ldv_func_arg1 ) ; __inline static char const *kobject_name(struct kobject const *kobj ) { { return ((char const *)kobj->name); } } __inline static void ldv_stop(void) { { LDV_STOP: ; goto LDV_STOP; } } struct timer_list *ldv_timer_list_10_2 ; int ldv_timer_9_3 ; struct timer_list *ldv_timer_list_9_2 ; int ldv_timer_9_2 ; int ldv_timer_10_2 ; int ldv_timer_10_0 ; int ldv_timer_10_1 ; struct timer_list *ldv_timer_list_10_3 ; struct timer_list *ldv_timer_list_9_1 ; struct timer_list *ldv_timer_list_9_3 ; int ldv_timer_9_1 ; int ldv_timer_9_0 ; struct timer_list *ldv_timer_list_10_0 ; struct timer_list *ldv_timer_list_10_1 ; struct timer_list *ldv_timer_list_9_0 ; int ldv_timer_10_3 ; void activate_pending_timer_9(struct timer_list *timer , unsigned long data , int pending_flag ) ; int reg_timer_10(struct timer_list *timer , void (*function)(unsigned long ) , unsigned long data ) ; void ldv_timer_10(int state , struct timer_list *timer ) ; void activate_suitable_timer_9(struct timer_list *timer , unsigned long data ) ; int reg_timer_9(struct timer_list *timer , void (*function)(unsigned long ) , unsigned long data ) ; void activate_suitable_timer_10(struct timer_list *timer , unsigned long data ) ; void choose_timer_9(void) ; void activate_pending_timer_14(struct timer_list *timer , unsigned long data , int pending_flag ) ; void activate_pending_timer_10(struct timer_list *timer , unsigned long data , int pending_flag ) ; void ldv_timer_9(int state , struct timer_list *timer ) ; void timer_init_9(void) ; int reg_timer_14(struct timer_list *timer , void (*function)(unsigned long ) , unsigned long data ) ; void disable_suitable_timer_10(struct timer_list *timer ) ; void disable_suitable_timer_14(struct timer_list *timer ) ; void disable_suitable_timer_9(struct timer_list *timer ) ; void timer_init_10(void) ; void choose_timer_10(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 int led_classdev_register(struct device * , struct led_classdev * ) ; extern void led_classdev_unregister(struct led_classdev * ) ; __inline static struct device *wiphy_dev(struct wiphy *wiphy ) { { return (wiphy->dev.parent); } } __inline static char const *wiphy_name(struct wiphy const *wiphy ) { char const *tmp ; { tmp = dev_name(& wiphy->dev); return (tmp); } } extern void wiphy_rfkill_set_hw_state(struct wiphy * , bool ) ; extern void wiphy_rfkill_start_polling(struct wiphy * ) ; extern char const *__ieee80211_get_radio_led_name(struct ieee80211_hw * ) ; __inline static char const *ieee80211_get_radio_led_name(struct ieee80211_hw *hw ) { char const *tmp ; { tmp = __ieee80211_get_radio_led_name(hw); return (tmp); } } extern void ath9k_hw_btcoex_init_scheme(struct ath_hw * ) ; extern void ath9k_hw_btcoex_init_2wire(struct ath_hw * ) ; extern void ath9k_hw_btcoex_init_3wire(struct ath_hw * ) ; extern void ath9k_hw_btcoex_init_mci(struct ath_hw * ) ; extern void ath9k_hw_init_btcoex_hw(struct ath_hw * , int ) ; extern void ath9k_hw_btcoex_set_weight(struct ath_hw * , u32 , u32 , enum ath_stomp_type ) ; extern void ath9k_hw_btcoex_disable(struct ath_hw * ) ; extern void ath9k_hw_btcoex_bt_stomp(struct ath_hw * , enum ath_stomp_type ) ; extern u32 ath9k_hw_gpio_get(struct ath_hw * , u32 ) ; extern void ath9k_hw_cfg_output(struct ath_hw * , u32 , u32 ) ; extern void ath9k_hw_set_gpio(struct ath_hw * , u32 , u32 ) ; extern void ath9k_hw_request_gpio(struct ath_hw * , u32 , char const * ) ; __inline static bool ath9k_hw_mci_is_enabled(struct ath_hw *ah ) { { return ((bool )((int )ah->common.btcoex_enabled && (ah->caps.hw_caps & 32768U) != 0U)); } } extern void ath9k_hw_btcoex_enable(struct ath_hw * ) ; __inline static enum ath_btcoex_scheme ath9k_hw_get_btcoex_scheme(struct ath_hw *ah ) { { return (ah->btcoex_hw.scheme); } } extern u32 ar9003_mci_state(struct ath_hw * , u32 ) ; void ath_mci_flush_profile(struct ath_mci_profile *mci ) ; int ath_mci_setup(struct ath_softc *sc ) ; void ath_mci_cleanup(struct ath_softc *sc ) ; void ath_mci_intr(struct ath_softc *sc ) ; void ath9k_mci_update_rssi(struct ath_softc *sc ) ; int ath9k_led_blink ; int ath9k_init_btcoex(struct ath_softc *sc ) ; void ath9k_deinit_btcoex(struct ath_softc *sc ) ; void ath9k_start_btcoex(struct ath_softc *sc ) ; void ath9k_stop_btcoex(struct ath_softc *sc ) ; void ath9k_btcoex_timer_resume(struct ath_softc *sc ) ; void ath9k_btcoex_timer_pause(struct ath_softc *sc ) ; void ath9k_btcoex_handle_interrupt(struct ath_softc *sc , u32 status ) ; u16 ath9k_btcoex_aggr_limit(struct ath_softc *sc , u32 max_4ms_framelen ) ; void ath9k_btcoex_stop_gen_timer(struct ath_softc *sc ) ; int ath9k_dump_btcoex(struct ath_softc *sc , u8 *buf , u32 size ) ; void ath_init_leds(struct ath_softc *sc ) ; void ath_deinit_leds(struct ath_softc *sc ) ; void ath_fill_led_pin(struct ath_softc *sc ) ; void ath_start_rfkill_poll(struct ath_softc *sc ) ; void ath9k_rfkill_poll_state(struct ieee80211_hw *hw ) ; void ath9k_ps_wakeup(struct ath_softc *sc ) ; void ath9k_ps_restore(struct ath_softc *sc ) ; static void ath_led_brightness(struct led_classdev *led_cdev , enum led_brightness brightness ) { struct ath_softc *sc ; struct led_classdev const *__mptr ; u32 val ; { __mptr = (struct led_classdev const *)led_cdev; sc = (struct ath_softc *)__mptr + 0xffffffffffffd0a0UL; val = (unsigned int )brightness == 0U; if ((int )(sc->sc_ah)->config.led_active_high) { val = val == 0U; } else { } ath9k_hw_set_gpio(sc->sc_ah, (u32 )(sc->sc_ah)->led_pin, val); return; } } void ath_deinit_leds(struct ath_softc *sc ) { { if (! sc->led_registered) { return; } else { } ath_led_brightness(& sc->led_cdev, 0); led_classdev_unregister(& sc->led_cdev); return; } } void ath_init_leds(struct ath_softc *sc ) { int ret ; char const *tmp ; struct device *tmp___0 ; { if ((sc->sc_ah)->hw_version.macVersion == 20U) { return; } else { } if (ath9k_led_blink == 0) { sc->led_cdev.default_trigger = ieee80211_get_radio_led_name(sc->hw); } else { } tmp = wiphy_name((struct wiphy const *)(sc->hw)->wiphy); snprintf((char *)(& sc->led_name), 32UL, "ath9k-%s", tmp); sc->led_cdev.name = (char const *)(& sc->led_name); sc->led_cdev.brightness_set = & ath_led_brightness; tmp___0 = wiphy_dev((sc->hw)->wiphy); ret = led_classdev_register(tmp___0, & sc->led_cdev); if (ret < 0) { return; } else { } sc->led_registered = 1; return; } } void ath_fill_led_pin(struct ath_softc *sc ) { struct ath_hw *ah ; { ah = sc->sc_ah; if (ah->hw_version.macVersion == 20U) { return; } else { } if (ah->led_pin >= 0) { if (((unsigned int )(1 << ah->led_pin) & (ah->hw_version.macVersion > 1023U ? 15U : 4294967295U)) == 0U) { ath9k_hw_request_gpio(ah, (u32 )ah->led_pin, "ath9k-led"); } else { } return; } else { } if (ah->hw_version.macVersion == 384U) { ah->led_pin = 8; } else if ((sc->sc_ah)->hw_version.macVersion == 576U) { ah->led_pin = 6; } else if ((sc->sc_ah)->hw_version.macVersion == 448U) { ah->led_pin = 10; } else if ((sc->sc_ah)->hw_version.macVersion == 640U || (sc->sc_ah)->hw_version.macVersion == 704U) { ah->led_pin = 4; } else { ah->led_pin = 1; } ath9k_hw_cfg_output(ah, (u32 )ah->led_pin, 0U); ath9k_hw_set_gpio(ah, (u32 )ah->led_pin, (int )ah->config.led_active_high ? 0U : 1U); return; } } static bool ath_is_rfkill_set(struct ath_softc *sc ) { struct ath_hw *ah ; bool is_blocked ; u32 tmp ; { ah = sc->sc_ah; ath9k_ps_wakeup(sc); tmp = ath9k_hw_gpio_get(ah, ah->rfkill_gpio); is_blocked = tmp == ah->rfkill_polarity; ath9k_ps_restore(sc); return (is_blocked); } } void ath9k_rfkill_poll_state(struct ieee80211_hw *hw ) { struct ath_softc *sc ; bool blocked ; bool tmp ; { sc = (struct ath_softc *)hw->priv; tmp = ath_is_rfkill_set(sc); blocked = (int )tmp != 0; wiphy_rfkill_set_hw_state(hw->wiphy, (int )blocked); return; } } void ath_start_rfkill_poll(struct ath_softc *sc ) { struct ath_hw *ah ; { ah = sc->sc_ah; if ((ah->caps.hw_caps & 2U) != 0U) { wiphy_rfkill_start_polling((sc->hw)->wiphy); } else { } return; } } static void ath_detect_bt_priority(struct ath_softc *sc ) { struct ath_btcoex *btcoex ; struct ath_hw *ah ; u32 tmp ; struct ath_common *tmp___0 ; struct ath_common *tmp___1 ; struct ath_common *tmp___2 ; struct ath_common *tmp___3 ; unsigned long tmp___4 ; { btcoex = & sc->btcoex; ah = sc->sc_ah; tmp = ath9k_hw_gpio_get(sc->sc_ah, (u32 )ah->btcoex_hw.btpriority_gpio); if (tmp != 0U) { btcoex->bt_priority_cnt = btcoex->bt_priority_cnt + 1U; } else { } tmp___4 = msecs_to_jiffies(1000U); if ((long )((btcoex->bt_priority_time + tmp___4) - (unsigned long )jiffies) < 0L) { clear_bit(0L, (unsigned long volatile *)(& btcoex->op_flags)); clear_bit(1L, (unsigned long volatile *)(& btcoex->op_flags)); if (btcoex->bt_priority_cnt > 14U) { tmp___1 = ath9k_hw_common(sc->sc_ah); if ((tmp___1->debug_mask & 4096) != 0) { tmp___0 = ath9k_hw_common(sc->sc_ah); ath_printk("\017", (struct ath_common const *)tmp___0, "BT scan detected\n"); } else { } set_bit(0L, (unsigned long volatile *)(& btcoex->op_flags)); set_bit(1L, (unsigned long volatile *)(& btcoex->op_flags)); } else if (btcoex->bt_priority_cnt > 2U) { tmp___3 = ath9k_hw_common(sc->sc_ah); if ((tmp___3->debug_mask & 4096) != 0) { tmp___2 = ath9k_hw_common(sc->sc_ah); ath_printk("\017", (struct ath_common const *)tmp___2, "BT priority traffic detected\n"); } else { } set_bit(0L, (unsigned long volatile *)(& btcoex->op_flags)); } else { } btcoex->bt_priority_cnt = 0U; btcoex->bt_priority_time = jiffies; } else { } return; } } static void ath_mci_ftp_adjust(struct ath_softc *sc ) { struct ath_btcoex *btcoex ; struct ath_mci_profile *mci ; struct ath_hw *ah ; u32 tmp ; { btcoex = & sc->btcoex; mci = & btcoex->mci; ah = sc->sc_ah; if (btcoex->bt_wait_time > 100U) { tmp = ar9003_mci_state(ah, 22U); if (tmp != 0U && ((unsigned int )mci->num_pan != 0U || (unsigned int )mci->num_other_acl != 0U)) { ah->btcoex_hw.mci.stomp_ftp = sc->rx.num_pkts <= 4U; } else { ah->btcoex_hw.mci.stomp_ftp = 0U; } btcoex->bt_wait_time = 0U; sc->rx.num_pkts = 0U; } else { } return; } } static void ath_btcoex_period_timer(unsigned long data ) { struct ath_softc *sc ; struct ath_hw *ah ; struct ath_btcoex *btcoex ; enum ath_stomp_type stomp_type ; u32 timer_period ; unsigned long flags ; raw_spinlock_t *tmp ; int tmp___0 ; unsigned long tmp___1 ; unsigned long tmp___2 ; { sc = (struct ath_softc *)data; ah = sc->sc_ah; btcoex = & sc->btcoex; tmp = spinlock_check(& sc->sc_pm_lock); flags = _raw_spin_lock_irqsave(tmp); if ((unsigned int )(sc->sc_ah)->power_mode == 2U) { btcoex->bt_wait_time = btcoex->bt_wait_time + btcoex->btcoex_period; spin_unlock_irqrestore(& sc->sc_pm_lock, flags); goto skip_hw_wakeup; } else { } spin_unlock_irqrestore(& sc->sc_pm_lock, flags); ath9k_ps_wakeup(sc); spin_lock_bh(& btcoex->btcoex_lock); if ((ah->caps.hw_caps & 32768U) != 0U) { ath9k_mci_update_rssi(sc); ath_mci_ftp_adjust(sc); } else { } if ((ah->caps.hw_caps & 32768U) == 0U) { ath_detect_bt_priority(sc); } else { } stomp_type = (enum ath_stomp_type )btcoex->bt_stomp_type; timer_period = btcoex->btcoex_no_stomp; if ((ah->caps.hw_caps & 32768U) == 0U) { tmp___0 = constant_test_bit(1L, (unsigned long const volatile *)(& btcoex->op_flags)); if (tmp___0 != 0) { stomp_type = 0; timer_period = btcoex->btscan_no_stomp; } else { } } else if ((unsigned int )btcoex->stomp_audio > 4U) { stomp_type = 4; btcoex->stomp_audio = 0U; } else { } ath9k_hw_btcoex_bt_stomp(ah, stomp_type); ath9k_hw_btcoex_enable(ah); spin_unlock_bh(& btcoex->btcoex_lock); if (btcoex->btcoex_period != btcoex->btcoex_no_stomp) { tmp___1 = msecs_to_jiffies(timer_period); ldv_mod_timer_24(& btcoex->no_stomp_timer, tmp___1 + (unsigned long )jiffies); } else { } ath9k_ps_restore(sc); skip_hw_wakeup: tmp___2 = msecs_to_jiffies(btcoex->btcoex_period); ldv_mod_timer_25(& btcoex->period_timer, tmp___2 + (unsigned long )jiffies); return; } } static void ath_btcoex_no_stomp_timer(unsigned long arg ) { struct ath_softc *sc ; struct ath_hw *ah ; struct ath_btcoex *btcoex ; int tmp ; { sc = (struct ath_softc *)arg; ah = sc->sc_ah; btcoex = & sc->btcoex; ath9k_ps_wakeup(sc); spin_lock_bh(& btcoex->btcoex_lock); if (btcoex->bt_stomp_type == 1) { ath9k_hw_btcoex_bt_stomp(ah, 2); } else if ((ah->caps.hw_caps & 32768U) == 0U) { tmp = constant_test_bit(1L, (unsigned long const volatile *)(& btcoex->op_flags)); if (tmp != 0) { ath9k_hw_btcoex_bt_stomp(ah, 2); } else { goto _L; } } else _L: /* CIL Label */ if (btcoex->bt_stomp_type == 0) { ath9k_hw_btcoex_bt_stomp(ah, 1); } else { } ath9k_hw_btcoex_enable(ah); spin_unlock_bh(& btcoex->btcoex_lock); ath9k_ps_restore(sc); return; } } static void ath_init_btcoex_timer(struct ath_softc *sc ) { struct ath_btcoex *btcoex ; struct lock_class_key __key ; { btcoex = & sc->btcoex; btcoex->btcoex_period = 45U; btcoex->btcoex_no_stomp = (btcoex->btcoex_period * 45U) / 100U; btcoex->btscan_no_stomp = (btcoex->btcoex_period * 10U) / 100U; btcoex->bt_stomp_type = 1; reg_timer_14(& btcoex->period_timer, & ath_btcoex_period_timer, (unsigned long )sc); reg_timer_14(& btcoex->no_stomp_timer, & ath_btcoex_no_stomp_timer, (unsigned long )sc); spinlock_check(& btcoex->btcoex_lock); __raw_spin_lock_init(& btcoex->btcoex_lock.__annonCompField18.rlock, "&(&btcoex->btcoex_lock)->rlock", & __key); return; } } void ath9k_btcoex_timer_resume(struct ath_softc *sc ) { struct ath_btcoex *btcoex ; struct ath_hw *ah ; enum ath_btcoex_scheme tmp ; enum ath_btcoex_scheme tmp___0 ; struct ath_common *tmp___1 ; struct ath_common *tmp___2 ; { btcoex = & sc->btcoex; ah = sc->sc_ah; tmp = ath9k_hw_get_btcoex_scheme(ah); if ((unsigned int )tmp != 2U) { tmp___0 = ath9k_hw_get_btcoex_scheme(ah); if ((unsigned int )tmp___0 != 3U) { return; } else { } } else { } tmp___2 = ath9k_hw_common(ah); if ((tmp___2->debug_mask & 4096) != 0) { tmp___1 = ath9k_hw_common(ah); ath_printk("\017", (struct ath_common const *)tmp___1, "Starting btcoex timers\n"); } else { } ldv_del_timer_sync_26(& btcoex->no_stomp_timer); btcoex->bt_priority_cnt = 0U; btcoex->bt_priority_time = jiffies; clear_bit(0L, (unsigned long volatile *)(& btcoex->op_flags)); clear_bit(1L, (unsigned long volatile *)(& btcoex->op_flags)); ldv_mod_timer_27(& btcoex->period_timer, jiffies); return; } } void ath9k_btcoex_timer_pause(struct ath_softc *sc ) { struct ath_btcoex *btcoex ; struct ath_hw *ah ; enum ath_btcoex_scheme tmp ; enum ath_btcoex_scheme tmp___0 ; struct ath_common *tmp___1 ; struct ath_common *tmp___2 ; { btcoex = & sc->btcoex; ah = sc->sc_ah; tmp = ath9k_hw_get_btcoex_scheme(ah); if ((unsigned int )tmp != 2U) { tmp___0 = ath9k_hw_get_btcoex_scheme(ah); if ((unsigned int )tmp___0 != 3U) { return; } else { } } else { } tmp___2 = ath9k_hw_common(ah); if ((tmp___2->debug_mask & 4096) != 0) { tmp___1 = ath9k_hw_common(ah); ath_printk("\017", (struct ath_common const *)tmp___1, "Stopping btcoex timers\n"); } else { } ldv_del_timer_sync_28(& btcoex->period_timer); ldv_del_timer_sync_29(& btcoex->no_stomp_timer); return; } } void ath9k_btcoex_stop_gen_timer(struct ath_softc *sc ) { struct ath_btcoex *btcoex ; { btcoex = & sc->btcoex; ldv_del_timer_sync_30(& btcoex->no_stomp_timer); return; } } u16 ath9k_btcoex_aggr_limit(struct ath_softc *sc , u32 max_4ms_framelen ) { struct ath_btcoex *btcoex ; struct ath_mci_profile *mci ; u16 aggr_limit ; u32 _min1 ; unsigned int _min2 ; int tmp ; { btcoex = & sc->btcoex; mci = & sc->btcoex.mci; aggr_limit = 0U; if (((sc->sc_ah)->caps.hw_caps & 32768U) != 0U && (unsigned int )mci->aggr_limit != 0U) { aggr_limit = (u16 )((u32 )mci->aggr_limit * max_4ms_framelen >> 4); } else { tmp = constant_test_bit(0L, (unsigned long const volatile *)(& btcoex->op_flags)); if (tmp != 0) { _min1 = (max_4ms_framelen * 3U) / 8U; _min2 = 65535U; aggr_limit = (u16 )(_min1 < _min2 ? _min1 : _min2); } else { } } return (aggr_limit); } } void ath9k_btcoex_handle_interrupt(struct ath_softc *sc , u32 status ) { { if ((status & 512U) != 0U) { ath_mci_intr(sc); } else { } return; } } void ath9k_start_btcoex(struct ath_softc *sc ) { struct ath_hw *ah ; enum ath_btcoex_scheme tmp ; { ah = sc->sc_ah; if ((int )ah->btcoex_hw.enabled) { return; } else { tmp = ath9k_hw_get_btcoex_scheme(ah); if ((unsigned int )tmp == 0U) { return; } else { } } if ((ah->caps.hw_caps & 32768U) == 0U) { ath9k_hw_btcoex_set_weight(ah, 65365U, 43176U, 0); } else { ath9k_hw_btcoex_set_weight(ah, 0U, 0U, 2); } ath9k_hw_btcoex_enable(ah); ath9k_btcoex_timer_resume(sc); return; } } void ath9k_stop_btcoex(struct ath_softc *sc ) { struct ath_hw *ah ; enum ath_btcoex_scheme tmp ; { ah = sc->sc_ah; if (! ah->btcoex_hw.enabled) { return; } else { tmp = ath9k_hw_get_btcoex_scheme(ah); if ((unsigned int )tmp == 0U) { return; } else { } } ath9k_btcoex_timer_pause(sc); ath9k_hw_btcoex_disable(ah); if ((ah->caps.hw_caps & 32768U) != 0U) { ath_mci_flush_profile(& sc->btcoex.mci); } else { } return; } } void ath9k_deinit_btcoex(struct ath_softc *sc ) { struct ath_hw *ah ; bool tmp ; { ah = sc->sc_ah; tmp = ath9k_hw_mci_is_enabled(ah); if ((int )tmp) { ath_mci_cleanup(sc); } else { } return; } } int ath9k_init_btcoex(struct ath_softc *sc ) { struct ath_txq *txq ; struct ath_hw *ah ; int r ; enum ath_btcoex_scheme tmp ; int __ret_warn_on ; long tmp___0 ; { ah = sc->sc_ah; ath9k_hw_btcoex_init_scheme(ah); tmp = ath9k_hw_get_btcoex_scheme(sc->sc_ah); switch ((unsigned int )tmp) { case 0U: ; goto ldv_54150; case 1U: ath9k_hw_btcoex_init_2wire(sc->sc_ah); goto ldv_54150; case 2U: ath9k_hw_btcoex_init_3wire(sc->sc_ah); ath_init_btcoex_timer(sc); txq = sc->tx.txq_map[2]; ath9k_hw_init_btcoex_hw(sc->sc_ah, (int )txq->axq_qnum); goto ldv_54150; case 3U: ath_init_btcoex_timer(sc); sc->btcoex.duty_cycle = 55U; INIT_LIST_HEAD(& sc->btcoex.mci.info); ath9k_hw_btcoex_init_mci(ah); r = ath_mci_setup(sc); if (r != 0) { return (r); } else { } goto ldv_54150; default: __ret_warn_on = 1; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/12119/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/ath/ath9k/gpio.c", 440); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); goto ldv_54150; } ldv_54150: ; return (0); } } static int ath9k_dump_mci_btcoex(struct ath_softc *sc , u8 *buf , u32 size ) { struct ath_btcoex *btcoex ; struct ath_mci_profile *mci ; struct ath_hw *ah ; struct ath_btcoex_hw *btcoex_hw ; u32 len ; int i ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; int tmp___6 ; int tmp___7 ; int tmp___8 ; int tmp___9 ; int tmp___10 ; int tmp___11 ; int tmp___12 ; int tmp___13 ; int tmp___14 ; int tmp___15 ; int tmp___16 ; int tmp___17 ; int tmp___18 ; int tmp___19 ; int tmp___20 ; int tmp___21 ; int tmp___22 ; { btcoex = & sc->btcoex; mci = & btcoex->mci; ah = sc->sc_ah; btcoex_hw = & ah->btcoex_hw; len = 0U; tmp = scnprintf((char *)buf + (unsigned long )len, (size_t )(size - len), "%20s : %10d\n", (char *)"Total BT profiles", ((((int )mci->num_other_acl + (int )mci->num_a2dp) + (int )mci->num_hid) + (int )mci->num_pan) + (int )mci->num_sco); len = (u32 )tmp + len; tmp___0 = scnprintf((char *)buf + (unsigned long )len, (size_t )(size - len), "%20s : %10d\n", (char *)"MGMT", (int )mci->num_mgmt); len = (u32 )tmp___0 + len; tmp___1 = scnprintf((char *)buf + (unsigned long )len, (size_t )(size - len), "%20s : %10d\n", (char *)"SCO", (int )mci->num_sco); len = (u32 )tmp___1 + len; tmp___2 = scnprintf((char *)buf + (unsigned long )len, (size_t )(size - len), "%20s : %10d\n", (char *)"A2DP", (int )mci->num_a2dp); len = (u32 )tmp___2 + len; tmp___3 = scnprintf((char *)buf + (unsigned long )len, (size_t )(size - len), "%20s : %10d\n", (char *)"HID", (int )mci->num_hid); len = (u32 )tmp___3 + len; tmp___4 = scnprintf((char *)buf + (unsigned long )len, (size_t )(size - len), "%20s : %10d\n", (char *)"PAN", (int )mci->num_pan); len = (u32 )tmp___4 + len; tmp___5 = scnprintf((char *)buf + (unsigned long )len, (size_t )(size - len), "%20s : %10d\n", (char *)"ACL", (int )mci->num_other_acl); len = (u32 )tmp___5 + len; tmp___6 = scnprintf((char *)buf + (unsigned long )len, (size_t )(size - len), "%20s : %10d\n", (char *)"BDR", (int )mci->num_bdr); len = (u32 )tmp___6 + len; tmp___7 = scnprintf((char *)buf + (unsigned long )len, (size_t )(size - len), "%20s : %10d\n", (char *)"Aggr. Limit", (int )mci->aggr_limit); len = (u32 )tmp___7 + len; tmp___8 = scnprintf((char *)buf + (unsigned long )len, (size_t )(size - len), "%20s : %10d\n", (char *)"Stomp Type", btcoex->bt_stomp_type); len = (u32 )tmp___8 + len; tmp___9 = scnprintf((char *)buf + (unsigned long )len, (size_t )(size - len), "%20s : %10d\n", (char *)"BTCoex Period (msec)", btcoex->btcoex_period); len = (u32 )tmp___9 + len; tmp___10 = scnprintf((char *)buf + (unsigned long )len, (size_t )(size - len), "%20s : %10d\n", (char *)"Duty Cycle", btcoex->duty_cycle); len = (u32 )tmp___10 + len; tmp___11 = scnprintf((char *)buf + (unsigned long )len, (size_t )(size - len), "%20s : %10d\n", (char *)"BT Wait time", btcoex->bt_wait_time); len = (u32 )tmp___11 + len; tmp___12 = scnprintf((char *)buf + (unsigned long )len, (size_t )(size - len), "%20s : %10d\n", (char *)"Concurrent Tx", (int )btcoex_hw->mci.concur_tx); len = (u32 )tmp___12 + len; tmp___13 = scnprintf((char *)buf + (unsigned long )len, (size_t )(size - len), "%20s : %10d\n", (char *)"Concurrent RSSI cnt", btcoex->rssi_count); len = (u32 )tmp___13 + len; tmp___14 = scnprintf((char *)buf + (unsigned long )len, (size_t )(size - len), "BT Weights: "); len = (u32 )tmp___14 + len; i = 0; goto ldv_54169; ldv_54168: tmp___15 = scnprintf((char *)buf + (unsigned long )len, (size_t )(size - len), "%08x ", btcoex_hw->bt_weight[i]); len = (u32 )tmp___15 + len; i = i + 1; ldv_54169: ; if (i <= 3) { goto ldv_54168; } else { } tmp___16 = scnprintf((char *)buf + (unsigned long )len, (size_t )(size - len), "\n"); len = (u32 )tmp___16 + len; tmp___17 = scnprintf((char *)buf + (unsigned long )len, (size_t )(size - len), "WLAN Weights: "); len = (u32 )tmp___17 + len; i = 0; goto ldv_54172; ldv_54171: tmp___18 = scnprintf((char *)buf + (unsigned long )len, (size_t )(size - len), "%08x ", btcoex_hw->wlan_weight[i]); len = (u32 )tmp___18 + len; i = i + 1; ldv_54172: ; if (i <= 3) { goto ldv_54171; } else { } tmp___19 = scnprintf((char *)buf + (unsigned long )len, (size_t )(size - len), "\n"); len = (u32 )tmp___19 + len; tmp___20 = scnprintf((char *)buf + (unsigned long )len, (size_t )(size - len), "Tx Priorities: "); len = (u32 )tmp___20 + len; i = 0; goto ldv_54175; ldv_54174: tmp___21 = scnprintf((char *)buf + (unsigned long )len, (size_t )(size - len), "%08x ", (int )btcoex_hw->tx_prio[i]); len = (u32 )tmp___21 + len; i = i + 1; ldv_54175: ; if (i <= 4) { goto ldv_54174; } else { } tmp___22 = scnprintf((char *)buf + (unsigned long )len, (size_t )(size - len), "\n"); len = (u32 )tmp___22 + len; return ((int )len); } } static int ath9k_dump_legacy_btcoex(struct ath_softc *sc , u8 *buf , u32 size ) { struct ath_btcoex *btcoex ; u32 len ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; { btcoex = & sc->btcoex; len = 0U; tmp = scnprintf((char *)buf + (unsigned long )len, (size_t )(size - len), "%20s : %10d\n", (char *)"Stomp Type", btcoex->bt_stomp_type); len = (u32 )tmp + len; tmp___0 = scnprintf((char *)buf + (unsigned long )len, (size_t )(size - len), "%20s : %10d\n", (char *)"BTCoex Period (msec)", btcoex->btcoex_period); len = (u32 )tmp___0 + len; tmp___1 = scnprintf((char *)buf + (unsigned long )len, (size_t )(size - len), "%20s : %10d\n", (char *)"Duty Cycle", btcoex->duty_cycle); len = (u32 )tmp___1 + len; tmp___2 = scnprintf((char *)buf + (unsigned long )len, (size_t )(size - len), "%20s : %10d\n", (char *)"BT Wait time", btcoex->bt_wait_time); len = (u32 )tmp___2 + len; return ((int )len); } } int ath9k_dump_btcoex(struct ath_softc *sc , u8 *buf , u32 size ) { int tmp ; int tmp___0 ; bool tmp___1 ; { tmp___1 = ath9k_hw_mci_is_enabled(sc->sc_ah); if ((int )tmp___1) { tmp = ath9k_dump_mci_btcoex(sc, buf, size); return (tmp); } else { tmp___0 = ath9k_dump_legacy_btcoex(sc, buf, size); return (tmp___0); } } } void activate_pending_timer_9(struct timer_list *timer , unsigned long data , int pending_flag ) { { if ((unsigned long )ldv_timer_list_9_0 == (unsigned long )timer) { if (ldv_timer_9_0 == 2 || pending_flag != 0) { ldv_timer_list_9_0 = timer; ldv_timer_list_9_0->data = data; ldv_timer_9_0 = 1; } else { } return; } else { } if ((unsigned long )ldv_timer_list_9_1 == (unsigned long )timer) { if (ldv_timer_9_1 == 2 || pending_flag != 0) { ldv_timer_list_9_1 = timer; ldv_timer_list_9_1->data = data; ldv_timer_9_1 = 1; } else { } return; } else { } if ((unsigned long )ldv_timer_list_9_2 == (unsigned long )timer) { if (ldv_timer_9_2 == 2 || pending_flag != 0) { ldv_timer_list_9_2 = timer; ldv_timer_list_9_2->data = data; ldv_timer_9_2 = 1; } else { } return; } else { } if ((unsigned long )ldv_timer_list_9_3 == (unsigned long )timer) { if (ldv_timer_9_3 == 2 || pending_flag != 0) { ldv_timer_list_9_3 = timer; ldv_timer_list_9_3->data = data; ldv_timer_9_3 = 1; } else { } return; } else { } activate_suitable_timer_9(timer, data); return; } } int reg_timer_10(struct timer_list *timer , void (*function)(unsigned long ) , unsigned long data ) { { if ((unsigned long )function == (unsigned long )(& ath_btcoex_no_stomp_timer)) { activate_suitable_timer_10(timer, data); } else { } return (0); } } void ldv_timer_10(int state , struct timer_list *timer ) { { LDV_IN_INTERRUPT = 2; ath_btcoex_no_stomp_timer(timer->data); LDV_IN_INTERRUPT = 1; return; } } void activate_suitable_timer_9(struct timer_list *timer , unsigned long data ) { { if (ldv_timer_9_0 == 0 || ldv_timer_9_0 == 2) { ldv_timer_list_9_0 = timer; ldv_timer_list_9_0->data = data; ldv_timer_9_0 = 1; return; } else { } if (ldv_timer_9_1 == 0 || ldv_timer_9_1 == 2) { ldv_timer_list_9_1 = timer; ldv_timer_list_9_1->data = data; ldv_timer_9_1 = 1; return; } else { } if (ldv_timer_9_2 == 0 || ldv_timer_9_2 == 2) { ldv_timer_list_9_2 = timer; ldv_timer_list_9_2->data = data; ldv_timer_9_2 = 1; return; } else { } if (ldv_timer_9_3 == 0 || ldv_timer_9_3 == 2) { ldv_timer_list_9_3 = timer; ldv_timer_list_9_3->data = data; ldv_timer_9_3 = 1; return; } else { } return; } } int reg_timer_9(struct timer_list *timer , void (*function)(unsigned long ) , unsigned long data ) { { if ((unsigned long )function == (unsigned long )(& ath_btcoex_period_timer)) { activate_suitable_timer_9(timer, data); } else { } return (0); } } void activate_suitable_timer_10(struct timer_list *timer , unsigned long data ) { { if (ldv_timer_10_0 == 0 || ldv_timer_10_0 == 2) { ldv_timer_list_10_0 = timer; ldv_timer_list_10_0->data = data; ldv_timer_10_0 = 1; return; } else { } if (ldv_timer_10_1 == 0 || ldv_timer_10_1 == 2) { ldv_timer_list_10_1 = timer; ldv_timer_list_10_1->data = data; ldv_timer_10_1 = 1; return; } else { } if (ldv_timer_10_2 == 0 || ldv_timer_10_2 == 2) { ldv_timer_list_10_2 = timer; ldv_timer_list_10_2->data = data; ldv_timer_10_2 = 1; return; } else { } if (ldv_timer_10_3 == 0 || ldv_timer_10_3 == 2) { ldv_timer_list_10_3 = timer; ldv_timer_list_10_3->data = data; ldv_timer_10_3 = 1; return; } else { } return; } } void choose_timer_9(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_timer_9_0 == 1) { ldv_timer_9_0 = 2; ldv_timer_9(ldv_timer_9_0, ldv_timer_list_9_0); } else { } goto ldv_54222; case 1: ; if (ldv_timer_9_1 == 1) { ldv_timer_9_1 = 2; ldv_timer_9(ldv_timer_9_1, ldv_timer_list_9_1); } else { } goto ldv_54222; case 2: ; if (ldv_timer_9_2 == 1) { ldv_timer_9_2 = 2; ldv_timer_9(ldv_timer_9_2, ldv_timer_list_9_2); } else { } goto ldv_54222; case 3: ; if (ldv_timer_9_3 == 1) { ldv_timer_9_3 = 2; ldv_timer_9(ldv_timer_9_3, ldv_timer_list_9_3); } else { } goto ldv_54222; default: ldv_stop(); } ldv_54222: ; return; } } void activate_pending_timer_10(struct timer_list *timer , unsigned long data , int pending_flag ) { { if ((unsigned long )ldv_timer_list_10_0 == (unsigned long )timer) { if (ldv_timer_10_0 == 2 || pending_flag != 0) { ldv_timer_list_10_0 = timer; ldv_timer_list_10_0->data = data; ldv_timer_10_0 = 1; } else { } return; } else { } if ((unsigned long )ldv_timer_list_10_1 == (unsigned long )timer) { if (ldv_timer_10_1 == 2 || pending_flag != 0) { ldv_timer_list_10_1 = timer; ldv_timer_list_10_1->data = data; ldv_timer_10_1 = 1; } else { } return; } else { } if ((unsigned long )ldv_timer_list_10_2 == (unsigned long )timer) { if (ldv_timer_10_2 == 2 || pending_flag != 0) { ldv_timer_list_10_2 = timer; ldv_timer_list_10_2->data = data; ldv_timer_10_2 = 1; } else { } return; } else { } if ((unsigned long )ldv_timer_list_10_3 == (unsigned long )timer) { if (ldv_timer_10_3 == 2 || pending_flag != 0) { ldv_timer_list_10_3 = timer; ldv_timer_list_10_3->data = data; ldv_timer_10_3 = 1; } else { } return; } else { } activate_suitable_timer_10(timer, data); return; } } void ldv_timer_9(int state , struct timer_list *timer ) { { LDV_IN_INTERRUPT = 2; ath_btcoex_period_timer(timer->data); LDV_IN_INTERRUPT = 1; return; } } void timer_init_9(void) { { ldv_timer_9_0 = 0; ldv_timer_9_1 = 0; ldv_timer_9_2 = 0; ldv_timer_9_3 = 0; return; } } void disable_suitable_timer_10(struct timer_list *timer ) { { if (ldv_timer_10_0 != 0 && (unsigned long )timer == (unsigned long )ldv_timer_list_10_0) { ldv_timer_10_0 = 0; return; } else { } if (ldv_timer_10_1 != 0 && (unsigned long )timer == (unsigned long )ldv_timer_list_10_1) { ldv_timer_10_1 = 0; return; } else { } if (ldv_timer_10_2 != 0 && (unsigned long )timer == (unsigned long )ldv_timer_list_10_2) { ldv_timer_10_2 = 0; return; } else { } if (ldv_timer_10_3 != 0 && (unsigned long )timer == (unsigned long )ldv_timer_list_10_3) { ldv_timer_10_3 = 0; return; } else { } return; } } void disable_suitable_timer_9(struct timer_list *timer ) { { if (ldv_timer_9_0 != 0 && (unsigned long )timer == (unsigned long )ldv_timer_list_9_0) { ldv_timer_9_0 = 0; return; } else { } if (ldv_timer_9_1 != 0 && (unsigned long )timer == (unsigned long )ldv_timer_list_9_1) { ldv_timer_9_1 = 0; return; } else { } if (ldv_timer_9_2 != 0 && (unsigned long )timer == (unsigned long )ldv_timer_list_9_2) { ldv_timer_9_2 = 0; return; } else { } if (ldv_timer_9_3 != 0 && (unsigned long )timer == (unsigned long )ldv_timer_list_9_3) { ldv_timer_9_3 = 0; return; } else { } return; } } void timer_init_10(void) { { ldv_timer_10_0 = 0; ldv_timer_10_1 = 0; ldv_timer_10_2 = 0; ldv_timer_10_3 = 0; return; } } void choose_timer_10(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_timer_10_0 == 1) { ldv_timer_10_0 = 2; ldv_timer_10(ldv_timer_10_0, ldv_timer_list_10_0); } else { } goto ldv_54252; case 1: ; if (ldv_timer_10_1 == 1) { ldv_timer_10_1 = 2; ldv_timer_10(ldv_timer_10_1, ldv_timer_list_10_1); } else { } goto ldv_54252; case 2: ; if (ldv_timer_10_2 == 1) { ldv_timer_10_2 = 2; ldv_timer_10(ldv_timer_10_2, ldv_timer_list_10_2); } else { } goto ldv_54252; case 3: ; if (ldv_timer_10_3 == 1) { ldv_timer_10_3 = 2; ldv_timer_10(ldv_timer_10_3, ldv_timer_list_10_3); } else { } goto ldv_54252; default: ldv_stop(); } ldv_54252: ; return; } } bool ldv_queue_work_on_19(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_20(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_21(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_22(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_7(2); return; } } bool ldv_queue_delayed_work_on_23(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } int ldv_mod_timer_24(struct timer_list *ldv_func_arg1 , unsigned long ldv_func_arg2 ) { ldv_func_ret_type___3 ldv_func_res ; int tmp ; { tmp = mod_timer(ldv_func_arg1, ldv_func_arg2); ldv_func_res = tmp; activate_pending_timer_14(ldv_func_arg1, ldv_func_arg2, 1); return (ldv_func_res); } } int ldv_mod_timer_25(struct timer_list *ldv_func_arg1 , unsigned long ldv_func_arg2 ) { ldv_func_ret_type___4 ldv_func_res ; int tmp ; { tmp = mod_timer(ldv_func_arg1, ldv_func_arg2); ldv_func_res = tmp; activate_pending_timer_14(ldv_func_arg1, ldv_func_arg2, 1); return (ldv_func_res); } } int ldv_del_timer_sync_26(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___5 ldv_func_res ; int tmp ; { tmp = del_timer_sync(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_14(ldv_func_arg1); return (ldv_func_res); } } int ldv_mod_timer_27(struct timer_list *ldv_func_arg1 , unsigned long ldv_func_arg2 ) { ldv_func_ret_type___6 ldv_func_res ; int tmp ; { tmp = mod_timer(ldv_func_arg1, ldv_func_arg2); ldv_func_res = tmp; activate_pending_timer_14(ldv_func_arg1, ldv_func_arg2, 1); return (ldv_func_res); } } int ldv_del_timer_sync_28(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___7 ldv_func_res ; int tmp ; { tmp = del_timer_sync(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_14(ldv_func_arg1); return (ldv_func_res); } } int ldv_del_timer_sync_29(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___8 ldv_func_res ; int tmp ; { tmp = del_timer_sync(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_14(ldv_func_arg1); return (ldv_func_res); } } int ldv_del_timer_sync_30(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___9 ldv_func_res ; int tmp ; { tmp = del_timer_sync(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_14(ldv_func_arg1); return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; extern struct module __this_module ; extern int printk(char const * , ...) ; extern void *memcpy(void * , void const * , size_t ) ; extern void lockdep_init_map(struct lockdep_map * , char const * , struct lock_class_key * , int ) ; extern void __init_waitqueue_head(wait_queue_head_t * , char const * , struct lock_class_key * ) ; extern void __mutex_init(struct mutex * , char const * , struct lock_class_key * ) ; __inline static void init_completion(struct completion *x ) { struct lock_class_key __key ; { x->done = 0U; __init_waitqueue_head(& x->wait, "&x->wait", & __key); return; } } extern void wait_for_completion(struct completion * ) ; extern void complete(struct completion * ) ; extern void init_timer_key(struct timer_list * , unsigned int , char const * , struct lock_class_key * ) ; int ldv_del_timer_sync_52(struct timer_list *ldv_func_arg1 ) ; extern void delayed_work_timer_fn(unsigned long ) ; extern void __init_work(struct work_struct * , int ) ; bool ldv_queue_work_on_47(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_49(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_48(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; bool ldv_queue_delayed_work_on_51(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; void ldv_flush_workqueue_50(struct workqueue_struct *ldv_func_arg1 ) ; extern unsigned int ioread32(void * ) ; extern void iowrite32(u32 , void * ) ; int ldv_timer_11_0 ; int ldv_state_variable_20 ; struct work_struct *ldv_work_struct_3_1 ; struct timer_list *ldv_timer_list_10_2 ; struct inode *fops_regval_group1 ; struct timer_list *ldv_timer_list_14_3 ; int ldv_state_variable_14 ; int ldv_state_variable_37 ; int ldv_state_variable_17 ; int ldv_timer_9_3 ; void *ldv_irq_data_2_3 ; int ldv_work_7_2 ; 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 ; struct ieee80211_hw *ath9k_ops_group0 ; struct file *fops_dfs_stats_group2 ; struct inode *fops_node_recv_group1 ; struct pci_dev *ath_pci_driver_group1 ; struct timer_list *ldv_timer_list_11_1 ; struct file *fops_debug_group2 ; struct file *fops_bt_ant_diversity_group2 ; void *ldv_irq_data_2_2 ; int ldv_work_3_3 ; struct work_struct *ldv_work_struct_4_0 ; int ldv_state_variable_7 ; struct file *fops_node_recv_group2 ; int ldv_timer_12_3 ; struct timer_list *ldv_timer_list_9_2 ; int ldv_irq_line_2_2 ; int ldv_timer_9_2 ; int ldv_work_4_0 ; struct work_struct *ldv_work_struct_3_2 ; void *ldv_irq_data_1_0 ; struct work_struct *ldv_work_struct_7_2 ; int ldv_state_variable_26 ; int ldv_state_variable_28 ; struct work_struct *ldv_work_struct_7_0 ; int ldv_timer_10_2 ; struct work_struct *ldv_work_struct_6_0 ; struct inode *fops_ani_group1 ; int ldv_work_8_3 ; int ldv_work_5_2 ; int ldv_work_7_1 ; int ldv_state_variable_31 ; int ldv_work_6_2 ; int ldv_timer_13_3 ; int ldv_state_variable_8 ; int ldv_state_variable_15 ; int ldv_work_8_0 ; int ldv_state_variable_21 ; int ldv_state_variable_33 ; struct timer_list *ldv_timer_list_12_0 ; struct timer_list *ldv_timer_list_11_2 ; struct work_struct *ldv_work_struct_8_0 ; struct ath_common *ath9k_ps_ops_group0 ; int ldv_timer_12_2 ; int ldv_work_3_0 ; struct file *fops_tx99_power_group2 ; struct file *fops_btcoex_group2 ; struct timer_list *ldv_timer_list_11_0 ; struct inode *fops_tx99_group1 ; int ldv_irq_line_2_0 ; struct inode *fops_simulate_radar_group1 ; int ldv_work_5_3 ; struct inode *fops_node_aggr_group1 ; int ldv_timer_10_0 ; int ldv_work_6_1 ; int ldv_timer_12_1 ; int ldv_state_variable_10 ; int ldv_work_7_0 ; struct inode *fops_bt_ant_diversity_group1 ; struct timer_list *ldv_timer_list_14_2 ; int ldv_timer_11_3 ; int ldv_work_4_1 ; struct inode *fops_regdump_group1 ; struct inode *fops_tpc_group1 ; int ldv_timer_13_2 ; int ldv_irq_line_2_1 ; struct work_struct *ldv_work_struct_7_3 ; int ldv_state_variable_2 ; int ldv_state_variable_25 ; struct file *fops_regdump_group2 ; struct timer_list *ldv_timer_list_14_1 ; int ldv_timer_10_1 ; struct timer_list *ldv_timer_list_13_0 ; void *ldv_irq_data_2_0 ; int ldv_work_4_2 ; int ldv_state_variable_11 ; int ldv_timer_14_1 ; int ldv_state_variable_18 ; struct work_struct *ldv_work_struct_5_0 ; struct timer_list *ldv_timer_list_10_3 ; int ldv_state_variable_32 ; struct file *fops_regval_group2 ; struct timer_list *ldv_timer_list_9_1 ; struct file *fops_antenna_diversity_group2 ; int pci_counter ; struct inode *fops_debug_group1 ; struct file *fops_tpc_group2 ; int ldv_state_variable_30 ; int ldv_work_8_1 ; int ldv_state_variable_0 ; struct timer_list *ldv_timer_list_9_3 ; int ldv_state_variable_12 ; struct timer_list *ldv_timer_list_12_1 ; int ldv_state_variable_22 ; int ldv_timer_9_1 ; int ldv_timer_9_0 ; int ldv_state_variable_29 ; struct work_struct *ldv_work_struct_8_1 ; struct file *fops_dump_nfcal_group2 ; int ldv_work_6_0 ; struct work_struct *ldv_work_struct_6_1 ; int ref_cnt ; struct inode *fops_btcoex_group1 ; int ldv_irq_line_1_1 ; struct work_struct *ldv_work_struct_8_3 ; struct work_struct *ldv_work_struct_3_3 ; int ldv_state_variable_23 ; struct timer_list *ldv_timer_list_10_0 ; void *ldv_irq_data_2_1 ; struct platform_device *ath_ahb_driver_group1 ; int ldv_timer_11_2 ; int ldv_state_variable_6 ; struct inode *fops_dfs_stats_group1 ; void *ldv_irq_data_1_3 ; int ldv_work_5_0 ; struct inode *fops_tx99_power_group1 ; struct work_struct *ldv_work_struct_4_2 ; struct timer_list *ldv_timer_list_13_3 ; int ldv_state_variable_38 ; int ldv_state_variable_39 ; struct work_struct *ldv_work_struct_5_1 ; struct timer_list *ldv_timer_list_10_1 ; struct file *fops_simulate_radar_group2 ; struct device *ath9k_pm_ops_group1 ; int ldv_state_variable_3 ; int ldv_irq_line_1_0 ; struct inode *fops_wow_group1 ; int ldv_state_variable_4 ; struct timer_list *ldv_timer_list_9_0 ; int ldv_timer_14_2 ; int ldv_state_variable_36 ; struct work_struct *ldv_work_struct_6_3 ; int ldv_timer_14_3 ; struct work_struct *ldv_work_struct_5_2 ; int ldv_state_variable_5 ; struct work_struct *ldv_work_struct_5_3 ; int ldv_timer_11_1 ; int ldv_timer_12_0 ; int ldv_state_variable_13 ; struct file *fops_regidx_group2 ; int ldv_work_3_2 ; struct inode *fops_dump_nfcal_group1 ; struct file *fops_ackto_group2 ; int ldv_work_7_3 ; struct timer_list *ldv_timer_list_12_3 ; int ldv_state_variable_24 ; struct inode *fops_ackto_group1 ; struct inode *fops_regidx_group1 ; struct file *fops_tx99_group2 ; struct timer_list *ldv_timer_list_13_1 ; int ldv_timer_13_0 ; int ldv_state_variable_1 ; struct ath_common *ath_ahb_bus_ops_group0 ; int ldv_irq_line_1_2 ; int ldv_timer_14_0 ; int ldv_irq_line_2_3 ; struct timer_list *ldv_timer_list_14_0 ; void *ldv_irq_data_1_1 ; struct work_struct *ldv_work_struct_6_2 ; struct file *fops_wow_group2 ; struct work_struct *ldv_work_struct_8_2 ; int ldv_work_4_3 ; int ldv_work_3_1 ; int ldv_state_variable_16 ; struct file *fops_node_aggr_group2 ; int ldv_work_5_1 ; int ldv_work_6_3 ; void *ldv_irq_data_1_2 ; struct timer_list *ldv_timer_list_12_2 ; struct work_struct *ldv_work_struct_3_0 ; struct inode *fops_antenna_diversity_group1 ; int ldv_irq_line_1_3 ; struct timer_list *ldv_timer_list_11_3 ; struct file *fops_ani_group2 ; int ldv_work_8_2 ; struct timer_list *ldv_timer_list_13_2 ; struct work_struct *ldv_work_struct_4_1 ; int ldv_state_variable_34 ; struct ath_common *ath_pci_bus_ops_group0 ; int ldv_timer_10_3 ; int ldv_timer_13_1 ; int ldv_state_variable_35 ; void ldv_file_operations_20(void) ; void activate_work_5(struct work_struct *work , int state ) ; void ldv_file_operations_26(void) ; void timer_init_12(void) ; int reg_timer_12(struct timer_list *timer , void (*function)(unsigned long ) , unsigned long data ) ; void work_init_5(void) ; void call_and_disable_all_4(int state ) ; void call_and_disable_work_3(struct work_struct *work ) ; void ldv_file_operations_16(void) ; void disable_work_3(struct work_struct *work ) ; void ldv_file_operations_24(void) ; void disable_suitable_timer_11(struct timer_list *timer ) ; void invoke_work_4(void) ; void ldv_file_operations_17(void) ; void ldv_dev_pm_ops_36(void) ; void ldv_initialize_ath_bus_ops_37(void) ; void ldv_initialize_ath_ps_ops_39(void) ; void work_init_8(void) ; void choose_timer_11(void) ; void ldv_file_operations_31(void) ; void timer_init_11(void) ; void invoke_work_5(void) ; void choose_timer_12(void) ; void ldv_file_operations_29(void) ; void disable_work_4(struct work_struct *work ) ; void work_init_4(void) ; int reg_timer_11(struct timer_list *timer , void (*function)(unsigned long ) , unsigned long data ) ; void activate_suitable_timer_11(struct timer_list *timer , unsigned long data ) ; void call_and_disable_all_3(int state ) ; void disable_suitable_timer_12(struct timer_list *timer ) ; void call_and_disable_work_4(struct work_struct *work ) ; void ldv_file_operations_30(void) ; void ldv_file_operations_23(void) ; void ldv_file_operations_19(void) ; void work_init_3(void) ; void ldv_file_operations_32(void) ; void ldv_initialize_ath_bus_ops_34(void) ; void activate_work_3(struct work_struct *work , int state ) ; void ldv_file_operations_15(void) ; void ldv_file_operations_25(void) ; void ldv_file_operations_28(void) ; void work_init_7(void) ; void disable_work_5(struct work_struct *work ) ; void activate_pending_timer_12(struct timer_list *timer , unsigned long data , int pending_flag ) ; void ldv_file_operations_22(void) ; void ldv_timer_12(int state , struct timer_list *timer ) ; void call_and_disable_work_5(struct work_struct *work ) ; void activate_suitable_timer_12(struct timer_list *timer , unsigned long data ) ; void timer_init_13(void) ; void activate_work_4(struct work_struct *work , int state ) ; void call_and_disable_all_5(int state ) ; void ldv_timer_11(int state , struct timer_list *timer ) ; void work_init_6(void) ; void ldv_file_operations_21(void) ; void timer_init_14(void) ; void ldv_file_operations_18(void) ; void ldv_file_operations_27(void) ; void invoke_work_3(void) ; void activate_pending_timer_11(struct timer_list *timer , unsigned long data , int pending_flag ) ; extern void *devm_kmalloc(struct device * , size_t , gfp_t ) ; __inline static void *devm_kzalloc(struct device *dev , size_t size , gfp_t gfp ) { void *tmp ; { tmp = devm_kmalloc(dev, size, gfp | 32768U); return (tmp); } } extern void *dmam_alloc_coherent(struct device * , size_t , dma_addr_t * , gfp_t ) ; extern void tasklet_init(struct tasklet_struct * , void (*)(unsigned long ) , unsigned long ) ; extern void cfg80211_chandef_create(struct cfg80211_chan_def * , struct ieee80211_channel * , enum nl80211_channel_type ) ; extern int regulatory_hint(struct wiphy * , char const * ) ; extern void wiphy_rfkill_stop_polling(struct wiphy * ) ; __inline static void _ieee80211_hw_set(struct ieee80211_hw *hw , enum ieee80211_hw_flags flg ) { { return; } } extern struct ieee80211_hw *wiphy_to_ieee80211_hw(struct wiphy * ) ; __inline static void SET_IEEE80211_PERM_ADDR(struct ieee80211_hw *hw , u8 *addr ) { { memcpy((void *)(& (hw->wiphy)->perm_addr), (void const *)addr, 6UL); return; } } extern int ieee80211_register_hw(struct ieee80211_hw * ) ; extern char const *__ieee80211_create_tpt_led_trigger(struct ieee80211_hw * , unsigned int , struct ieee80211_tpt_blink const * , unsigned int ) ; __inline static char const *ieee80211_create_tpt_led_trigger(struct ieee80211_hw *hw , unsigned int flags , struct ieee80211_tpt_blink const *blink_table , unsigned int blink_table_len ) { char const *tmp ; { tmp = __ieee80211_create_tpt_led_trigger(hw, flags, blink_table, blink_table_len); return (tmp); } } extern void ieee80211_unregister_hw(struct ieee80211_hw * ) ; static u8 const ath_bcast_mac[6U] = { 255U, 255U, 255U, 255U, 255U, 255U}; extern int request_firmware_nowait(struct module * , bool , char const * , struct device * , gfp_t , void * , void (*)(struct firmware const * , void * ) ) ; extern void release_firmware(struct firmware const * ) ; extern int ath9k_hw_beaconq_setup(struct ath_hw * ) ; extern bool ath_is_world_regd(struct ath_regulatory * ) ; extern int ath_regd_init(struct ath_regulatory * , struct wiphy * , void (*)(struct wiphy * , struct regulatory_request * ) ) ; extern void ath_reg_notifier_apply(struct wiphy * , struct regulatory_request * , struct ath_regulatory * ) ; __inline static struct ath_regulatory *ath9k_hw_regulatory(struct ath_hw *ah ) { struct ath_common *tmp ; { tmp = ath9k_hw_common(ah); return (& tmp->regulatory); } } extern void ath9k_hw_deinit(struct ath_hw * ) ; extern int ath9k_hw_init(struct ath_hw * ) ; extern void ath9k_hw_set_txpowerlimit(struct ath_hw * , u32 , bool ) ; extern int ath9k_cmn_init_channels_rates(struct ath_common * ) ; extern void ath9k_cmn_reload_chainmask(struct ath_hw * ) ; extern struct ath9k_channel *ath9k_cmn_get_channel(struct ieee80211_hw * , struct ath_hw * , struct cfg80211_chan_def * ) ; extern void ath9k_cmn_update_txpow(struct ath_hw * , u16 , u16 , u16 * ) ; extern void ath9k_cmn_init_crypto(struct ath_hw * ) ; int ath9k_init_debug(struct ath_hw *ah ) ; void ath9k_deinit_debug(struct ath_softc *sc ) ; extern struct dfs_pattern_detector *dfs_pattern_detector_init(struct ath_common * , enum nl80211_dfs_regions ) ; int ath9k_modparam_nohwcrypt ; int ath9k_led_blink ; bool is_ath9k_unloaded ; int ath9k_use_chanctx ; int ath_descdma_setup(struct ath_softc *sc , struct ath_descdma *dd , struct list_head *head , char const *name , int nbuf , int ndesc , bool is_tx ) ; void ath_chanctx_init(struct ath_softc *sc ) ; void ath9k_init_channel_context(struct ath_softc *sc ) ; void ath9k_offchannel_init(struct ath_softc *sc ) ; int ath9k_init_p2p(struct ath_softc *sc ) ; void ath9k_deinit_p2p(struct ath_softc *sc ) ; int ath_rx_init(struct ath_softc *sc , int nbufs ) ; void ath_rx_cleanup(struct ath_softc *sc ) ; struct ath_txq *ath_txq_setup(struct ath_softc *sc , int qtype , int subtype ) ; void ath_tx_cleanupq(struct ath_softc *sc , struct ath_txq *txq ) ; int ath_tx_init(struct ath_softc *sc , int nbufs ) ; void ath_reset_work(struct work_struct *work ) ; void ath_hw_pll_work(struct work_struct *work ) ; void ath_paprd_calibrate(struct work_struct *work ) ; void ath_ani_calibrate(unsigned long data ) ; void ath_ps_full_sleep(unsigned long data ) ; void ath9k_init_wow(struct ieee80211_hw *hw ) ; void ath9k_deinit_wow(struct ieee80211_hw *hw ) ; __inline static void ath_read_cachesize(struct ath_common *common , int *csz ) { { (*((common->bus_ops)->read_cachesize))(common, csz); return; } } void ath9k_tasklet(unsigned long data ) ; int ath_cabq_update(struct ath_softc *sc ) ; int ath9k_init_device(u16 devid , struct ath_softc *sc , struct ath_bus_ops const *bus_ops ) ; void ath9k_deinit_device(struct ath_softc *sc ) ; int ath_pci_init(void) ; void ath_pci_exit(void) ; int ath_ahb_init(void) ; void ath_ahb_exit(void) ; static char *dev_info = (char *)"ath9k"; static unsigned int ath9k_debug = 1024U; static int ath9k_btcoex_enable ; static int ath9k_bt_ant_diversity ; static int ath9k_ps_enable ; static struct ieee80211_tpt_blink const ath9k_tpt_blink[10U] = { {0, 334}, {1024, 260}, {5120, 220}, {10240, 190}, {20480, 170}, {51200, 150}, {71680, 130}, {102400, 110}, {204800, 80}, {307200, 50}}; static void ath9k_deinit_softc(struct ath_softc *sc ) ; static void ath9k_op_ps_wakeup(struct ath_common *common ) { { ath9k_ps_wakeup((struct ath_softc *)common->priv); return; } } static void ath9k_op_ps_restore(struct ath_common *common ) { { ath9k_ps_restore((struct ath_softc *)common->priv); return; } } static struct ath_ps_ops ath9k_ps_ops = {& ath9k_op_ps_wakeup, & ath9k_op_ps_restore}; static void ath9k_iowrite32(void *hw_priv , u32 val , u32 reg_offset ) { struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; struct ath_softc *sc ; unsigned long flags ; raw_spinlock_t *tmp___0 ; { ah = (struct ath_hw *)hw_priv; tmp = ath9k_hw_common(ah); common = tmp; sc = (struct ath_softc *)common->priv; if (ah->config.serialize_regmode == 1) { tmp___0 = spinlock_check(& sc->sc_serial_rw); flags = _raw_spin_lock_irqsave(tmp___0); iowrite32(val, sc->mem + (unsigned long )reg_offset); spin_unlock_irqrestore(& sc->sc_serial_rw, flags); } else { iowrite32(val, sc->mem + (unsigned long )reg_offset); } return; } } static unsigned int ath9k_ioread32(void *hw_priv , u32 reg_offset ) { struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; struct ath_softc *sc ; u32 val ; unsigned long flags ; raw_spinlock_t *tmp___0 ; { ah = (struct ath_hw *)hw_priv; tmp = ath9k_hw_common(ah); common = tmp; sc = (struct ath_softc *)common->priv; if (ah->config.serialize_regmode == 1) { tmp___0 = spinlock_check(& sc->sc_serial_rw); flags = _raw_spin_lock_irqsave(tmp___0); val = ioread32(sc->mem + (unsigned long )reg_offset); spin_unlock_irqrestore(& sc->sc_serial_rw, flags); } else { val = ioread32(sc->mem + (unsigned long )reg_offset); } return (val); } } static void ath9k_multi_ioread32(void *hw_priv , u32 *addr , u32 *val , u16 count ) { int i ; { i = 0; goto ldv_54577; ldv_54576: *(val + (unsigned long )i) = ath9k_ioread32(hw_priv, *(addr + (unsigned long )i)); i = i + 1; ldv_54577: ; if ((int )count > i) { goto ldv_54576; } else { } return; } } static unsigned int __ath9k_reg_rmw(struct ath_softc *sc , u32 reg_offset , u32 set , u32 clr ) { u32 val ; { val = ioread32(sc->mem + (unsigned long )reg_offset); val = ~ clr & val; val = val | set; iowrite32(val, sc->mem + (unsigned long )reg_offset); return (val); } } static unsigned int ath9k_reg_rmw(void *hw_priv , u32 reg_offset , u32 set , u32 clr ) { struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; struct ath_softc *sc ; unsigned long flags ; u32 val ; raw_spinlock_t *tmp___0 ; { ah = (struct ath_hw *)hw_priv; tmp = ath9k_hw_common(ah); common = tmp; sc = (struct ath_softc *)common->priv; flags = flags; if (ah->config.serialize_regmode == 1) { tmp___0 = spinlock_check(& sc->sc_serial_rw); flags = _raw_spin_lock_irqsave(tmp___0); val = __ath9k_reg_rmw(sc, reg_offset, set, clr); spin_unlock_irqrestore(& sc->sc_serial_rw, flags); } else { val = __ath9k_reg_rmw(sc, reg_offset, set, clr); } return (val); } } static void ath9k_reg_notifier(struct wiphy *wiphy , struct regulatory_request *request ) { struct ieee80211_hw *hw ; struct ieee80211_hw *tmp ; struct ath_softc *sc ; struct ath_hw *ah ; struct ath_regulatory *reg ; struct ath_regulatory *tmp___0 ; { tmp = wiphy_to_ieee80211_hw(wiphy); hw = tmp; sc = (struct ath_softc *)hw->priv; ah = sc->sc_ah; tmp___0 = ath9k_hw_regulatory(ah); reg = tmp___0; ath_reg_notifier_apply(wiphy, request, reg); if ((unsigned long )ah->curchan == (unsigned long )((struct ath9k_channel *)0)) { return; } else { } (sc->cur_chan)->txpower = (unsigned int )((u16 )((ah->curchan)->chan)->max_power) * 2U; ath9k_ps_wakeup(sc); ath9k_hw_set_txpowerlimit(ah, (u32 )(sc->cur_chan)->txpower, 0); ath9k_cmn_update_txpow(ah, (int )(sc->cur_chan)->cur_txpower, (int )(sc->cur_chan)->txpower, & (sc->cur_chan)->cur_txpower); if ((unsigned long )sc->dfs_detector != (unsigned long )((struct dfs_pattern_detector *)0)) { (*((sc->dfs_detector)->set_dfs_domain))(sc->dfs_detector, request->dfs_region); } else { } ath9k_ps_restore(sc); return; } } int ath_descdma_setup(struct ath_softc *sc , struct ath_descdma *dd , struct list_head *head , char const *name , int nbuf , int ndesc , bool is_tx ) { struct ath_common *common ; struct ath_common *tmp ; u8 *ds ; int i ; int bsize ; int desc_len ; long tmp___0 ; u32 ndesc_skipped ; u32 dma_len ; struct ath_buf *bf ; void *tmp___1 ; long tmp___2 ; struct ath_rxbuf *bf___0 ; void *tmp___3 ; long tmp___4 ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; if ((common->debug_mask & 512) != 0) { ath_printk("\017", (struct ath_common const *)common, "%s DMA: %u buffers %u desc/buf\n", name, nbuf, ndesc); } else { } INIT_LIST_HEAD(head); if ((int )is_tx) { desc_len = (int )(sc->sc_ah)->caps.tx_desc_len; } else { desc_len = 104; } if (((unsigned int )desc_len & 3U) != 0U) { ath_printk("\v", (struct ath_common const *)common, "ath_desc not DWORD aligned\n"); tmp___0 = ldv__builtin_expect(((unsigned int )desc_len & 3U) != 0U, 0L); if (tmp___0 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/12119/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/ath/ath9k/init.c"), "i" (242), "i" (12UL)); ldv_54622: ; goto ldv_54622; } else { } return (-12); } else { } dd->dd_desc_len = (u32 )((desc_len * nbuf) * ndesc); if (((sc->sc_ah)->caps.hw_caps & 8U) == 0U) { ndesc_skipped = dd->dd_desc_len / 4096U; goto ldv_54626; ldv_54625: dma_len = ndesc_skipped * (u32 )desc_len; dd->dd_desc_len = dd->dd_desc_len + dma_len; ndesc_skipped = dma_len / 4096U; ldv_54626: ; if (ndesc_skipped != 0U) { goto ldv_54625; } else { } } else { } dd->dd_desc = dmam_alloc_coherent(sc->dev, (size_t )dd->dd_desc_len, & dd->dd_desc_paddr, 208U); if ((unsigned long )dd->dd_desc == (unsigned long )((void *)0)) { return (-12); } else { } ds = (u8 *)dd->dd_desc; if ((common->debug_mask & 512) != 0) { ath_printk("\017", (struct ath_common const *)common, "%s DMA map: %p (%u) -> %llx (%u)\n", name, ds, dd->dd_desc_len, dd->dd_desc_paddr, dd->dd_desc_len); } else { } if ((int )is_tx) { bsize = (int )((unsigned int )nbuf * 96U); tmp___1 = devm_kzalloc(sc->dev, (size_t )bsize, 208U); bf = (struct ath_buf *)tmp___1; if ((unsigned long )bf == (unsigned long )((struct ath_buf *)0)) { return (-12); } else { } i = 0; goto ldv_54634; ldv_54633: bf->bf_desc = (void *)ds; bf->bf_daddr = dd->dd_desc_paddr + (unsigned long long )((long )ds - (long )dd->dd_desc); if (((sc->sc_ah)->caps.hw_caps & 8U) == 0U) { goto ldv_54631; ldv_54630: tmp___2 = ldv__builtin_expect((unsigned long )((char *)bf->bf_desc) >= (unsigned long )((char *)dd->dd_desc + (unsigned long )dd->dd_desc_len), 0L); if (tmp___2 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/12119/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/ath/ath9k/init.c"), "i" (300), "i" (12UL)); ldv_54629: ; goto ldv_54629; } else { } ds = ds + (unsigned long )(desc_len * ndesc); bf->bf_desc = (void *)ds; bf->bf_daddr = dd->dd_desc_paddr + (unsigned long long )((long )ds - (long )dd->dd_desc); ldv_54631: ; if ((bf->bf_daddr & 4095ULL) > 3967ULL) { goto ldv_54630; } else { } } else { } list_add_tail(& bf->list, head); i = i + 1; bf = bf + 1; ds = ds + (unsigned long )(desc_len * ndesc); ldv_54634: ; if (i < nbuf) { goto ldv_54633; } else { } } else { bsize = (int )((unsigned int )nbuf * 48U); tmp___3 = devm_kzalloc(sc->dev, (size_t )bsize, 208U); bf___0 = (struct ath_rxbuf *)tmp___3; if ((unsigned long )bf___0 == (unsigned long )((struct ath_rxbuf *)0)) { return (-12); } else { } i = 0; goto ldv_54642; ldv_54641: bf___0->bf_desc = (void *)ds; bf___0->bf_daddr = dd->dd_desc_paddr + (unsigned long long )((long )ds - (long )dd->dd_desc); if (((sc->sc_ah)->caps.hw_caps & 8U) == 0U) { goto ldv_54639; ldv_54638: tmp___4 = ldv__builtin_expect((unsigned long )((char *)bf___0->bf_desc) >= (unsigned long )((char *)dd->dd_desc + (unsigned long )dd->dd_desc_len), 0L); if (tmp___4 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/12119/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/ath/ath9k/init.c"), "i" (331), "i" (12UL)); ldv_54637: ; goto ldv_54637; } else { } ds = ds + (unsigned long )(desc_len * ndesc); bf___0->bf_desc = (void *)ds; bf___0->bf_daddr = dd->dd_desc_paddr + (unsigned long long )((long )ds - (long )dd->dd_desc); ldv_54639: ; if ((bf___0->bf_daddr & 4095ULL) > 3967ULL) { goto ldv_54638; } else { } } else { } list_add_tail(& bf___0->list, head); i = i + 1; bf___0 = bf___0 + 1; ds = ds + (unsigned long )(desc_len * ndesc); ldv_54642: ; if (i < nbuf) { goto ldv_54641; } else { } } return (0); } } static int ath9k_init_queues(struct ath_softc *sc ) { int i ; int tmp ; { i = 0; tmp = ath9k_hw_beaconq_setup(sc->sc_ah); sc->beacon.beaconq = (u32 )tmp; sc->beacon.cabq = ath_txq_setup(sc, 3, 0); ath_cabq_update(sc); sc->tx.uapsdq = ath_txq_setup(sc, 4, 0); i = 0; goto ldv_54649; ldv_54648: sc->tx.txq_map[i] = ath_txq_setup(sc, 1, i); (sc->tx.txq_map[i])->mac80211_qnum = i; sc->tx.txq_max_pending[i] = 123U; i = i + 1; ldv_54649: ; if (i <= 3) { goto ldv_54648; } else { } return (0); } } static void ath9k_init_misc(struct ath_softc *sc ) { struct ath_common *common ; struct ath_common *tmp ; int i ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; i = 0; reg_timer_14(& common->ani.timer, & ath_ani_calibrate, (unsigned long )sc); common->last_rssi = 127; memcpy((void *)(& common->bssidmask), (void const *)(& ath_bcast_mac), 6UL); sc->beacon.slottime = 9; i = 0; goto ldv_54659; ldv_54658: sc->beacon.bslot[i] = (struct ieee80211_vif *)0; i = i + 1; ldv_54659: ; if ((unsigned int )i <= 7U) { goto ldv_54658; } else { } if (((sc->sc_ah)->caps.hw_caps & 1024U) != 0U) { sc->ant_comb.count = 95U; } else { } sc->spec_priv.ah = sc->sc_ah; sc->spec_priv.spec_config.enabled = 0; sc->spec_priv.spec_config.short_repeat = 1; sc->spec_priv.spec_config.count = 8U; sc->spec_priv.spec_config.endless = 0; sc->spec_priv.spec_config.period = 255U; sc->spec_priv.spec_config.fft_period = 15U; return; } } static void ath9k_init_pcoem_platform(struct ath_softc *sc ) { struct ath_hw *ah ; struct ath9k_hw_capabilities *pCap ; struct ath_common *common ; struct ath_common *tmp ; { ah = sc->sc_ah; pCap = & ah->caps; tmp = ath9k_hw_common(ah); common = tmp; if ((unsigned int )(common->bus_ops)->ath_bus_type != 0U) { return; } else { } if ((sc->driver_data & 3UL) != 0UL) { ah->config.xlna_gpio = 9U; ah->config.xatten_margin_cfg = 1; ah->config.alt_mingainidx = 1; ah->config.ant_ctrl_comm2g_switch_enable = 768904U; sc->ant_comb.low_rssi_thresh = 20; sc->ant_comb.fast_div_bias = 3; ath_printk("\016", (struct ath_common const *)common, "Set parameters for %s\n", (int )sc->driver_data & 1 ? (char *)"CUS198" : (char *)"CUS230"); } else { } if ((sc->driver_data & 4UL) != 0UL) { ath_printk("\016", (struct ath_common const *)common, "CUS217 card detected\n"); } else { } if ((sc->driver_data & 8UL) != 0UL) { ath_printk("\016", (struct ath_common const *)common, "CUS252 card detected\n"); } else { } if ((sc->driver_data & 128UL) != 0UL) { ath_printk("\016", (struct ath_common const *)common, "WB335 1-ANT card detected\n"); } else { } if ((sc->driver_data & 256UL) != 0UL) { ath_printk("\016", (struct ath_common const *)common, "WB335 2-ANT card detected\n"); } else { } if ((sc->driver_data & 1024UL) != 0UL) { ath_printk("\016", (struct ath_common const *)common, "Killer Wireless card detected\n"); } else { } if ((sc->driver_data & 384UL) != 0UL) { if ((sc->driver_data & 32UL) == 0UL) { pCap->hw_caps = pCap->hw_caps & 4294966271U; } else { } } else { } if ((sc->driver_data & 32UL) != 0UL) { pCap->hw_caps = pCap->hw_caps | 131072U; ath_printk("\016", (struct ath_common const *)common, "Set BT/WLAN RX diversity capability\n"); } else { } if ((sc->driver_data & 64UL) != 0UL) { ah->config.pcie_waen = 4212539U; ath_printk("\016", (struct ath_common const *)common, "Enable WAR for ASPM D3/L1\n"); } else { } ah->config.pll_pwrsave = 1U; if ((sc->driver_data & 512UL) != 0UL) { ah->config.pll_pwrsave = 0U; ath_printk("\016", (struct ath_common const *)common, "Disable PLL PowerSave\n"); } else { } if ((sc->driver_data & 2048UL) != 0UL) { ah->config.led_active_high = 1; } else { } return; } } static void ath9k_eeprom_request_cb(struct firmware const *eeprom_blob , void *ctx ) { struct ath9k_eeprom_ctx *ec ; { ec = (struct ath9k_eeprom_ctx *)ctx; if ((unsigned long )eeprom_blob != (unsigned long )((struct firmware const *)0)) { (ec->ah)->eeprom_blob = eeprom_blob; } else { } complete(& ec->complete); return; } } static int ath9k_eeprom_request(struct ath_softc *sc , char const *name ) { struct ath9k_eeprom_ctx ec ; struct ath_hw *ah ; int err ; struct ath_common *tmp ; struct ath_common *tmp___0 ; { ah = sc->sc_ah; ah = ah; init_completion(& ec.complete); ec.ah = sc->sc_ah; err = request_firmware_nowait(& __this_module, 1, name, sc->dev, 208U, (void *)(& ec), & ath9k_eeprom_request_cb); if (err < 0) { tmp = ath9k_hw_common(ah); ath_printk("\v", (struct ath_common const *)tmp, "EEPROM request failed\n"); return (err); } else { } wait_for_completion(& ec.complete); if ((unsigned long )ah->eeprom_blob == (unsigned long )((struct firmware const *)0)) { tmp___0 = ath9k_hw_common(ah); ath_printk("\v", (struct ath_common const *)tmp___0, "Unable to load EEPROM file %s\n", name); return (-22); } else { } return (0); } } static void ath9k_eeprom_release(struct ath_softc *sc ) { { release_firmware((sc->sc_ah)->eeprom_blob); return; } } static int ath9k_init_soc_platform(struct ath_softc *sc ) { struct ath9k_platform_data *pdata ; struct ath_hw *ah ; int ret ; { pdata = (struct ath9k_platform_data *)(sc->dev)->platform_data; ah = sc->sc_ah; ret = 0; if ((unsigned long )pdata == (unsigned long )((struct ath9k_platform_data *)0)) { return (0); } else { } if ((unsigned long )pdata->eeprom_name != (unsigned long )((char const *)0)) { ret = ath9k_eeprom_request(sc, pdata->eeprom_name); if (ret != 0) { return (ret); } else { } } else { } if ((int )pdata->tx_gain_buffalo) { ah->config.tx_gain_buffalo = 1; } else { } return (ret); } } static int ath9k_init_softc(u16 devid , struct ath_softc *sc , struct ath_bus_ops const *bus_ops ) { struct ath9k_platform_data *pdata ; struct ath_hw *ah ; struct ath9k_hw_capabilities *pCap ; struct ath_common *common ; int ret ; int i ; int csz ; void *tmp ; struct lock_class_key __key ; bool tmp___0 ; int tmp___1 ; struct lock_class_key __key___0 ; struct lock_class_key __key___1 ; struct lock_class_key __key___2 ; struct lock_class_key __key___3 ; struct lock_class_key __key___4 ; struct lock_class_key __key___5 ; atomic_long_t __constr_expr_0 ; struct lock_class_key __key___6 ; atomic_long_t __constr_expr_1 ; struct lock_class_key __key___7 ; atomic_long_t __constr_expr_2 ; struct lock_class_key __key___8 ; { pdata = (struct ath9k_platform_data *)(sc->dev)->platform_data; ah = (struct ath_hw *)0; ret = 0; csz = 0; tmp = devm_kzalloc(sc->dev, 9456UL, 208U); ah = (struct ath_hw *)tmp; if ((unsigned long )ah == (unsigned long )((struct ath_hw *)0)) { return (-12); } else { } ah->dev = sc->dev; ah->hw = sc->hw; ah->hw_version.devid = devid; ah->reg_ops.read = & ath9k_ioread32; ah->reg_ops.multi_read = & ath9k_multi_ioread32; ah->reg_ops.write = & ath9k_iowrite32; ah->reg_ops.rmw = & ath9k_reg_rmw; pCap = & ah->caps; common = ath9k_hw_common(ah); set_bit(0L, (unsigned long volatile *)(& common->op_flags)); sc->sc_ah = ah; sc->dfs_detector = dfs_pattern_detector_init(common, 0); sc->tx99_power = 64; __init_waitqueue_head(& sc->tx_wait, "&sc->tx_wait", & __key); sc->cur_chan = (struct ath_chanctx *)(& sc->chanctx); tmp___0 = ath9k_is_chanctx_enabled(); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { (sc->cur_chan)->hw_queue_base = 0; } else { } if ((unsigned long )pdata == (unsigned long )((struct ath9k_platform_data *)0) || (int )pdata->use_eeprom) { ah->ah_flags = ah->ah_flags | 1U; (sc->sc_ah)->led_pin = -1; } else { (sc->sc_ah)->gpio_mask = pdata->gpio_mask; (sc->sc_ah)->gpio_val = pdata->gpio_val; (sc->sc_ah)->led_pin = pdata->led_pin; ah->is_clk_25mhz = pdata->is_clk_25mhz; ah->get_mac_revision = pdata->get_mac_revision; ah->external_reset = pdata->external_reset; ah->disable_2ghz = pdata->disable_2ghz; ah->disable_5ghz = pdata->disable_5ghz; if (! pdata->endian_check) { ah->ah_flags = ah->ah_flags | 8U; } else { } } common->ops = (struct ath_ops const *)(& ah->reg_ops); common->bus_ops = bus_ops; common->ps_ops = (struct ath_ps_ops const *)(& ath9k_ps_ops); common->ah = (void *)ah; common->hw = sc->hw; common->priv = (void *)sc; common->debug_mask = (int )ath9k_debug; common->btcoex_enabled = ath9k_btcoex_enable == 1; common->disable_ani = 0; ath9k_init_pcoem_platform(sc); ret = ath9k_init_soc_platform(sc); if (ret != 0) { return (ret); } else { } if ((! common->btcoex_enabled && ath9k_bt_ant_diversity != 0) && (pCap->hw_caps & 131072U) != 0U) { common->bt_ant_diversity = 1; } else { } spinlock_check(& common->cc_lock); __raw_spin_lock_init(& common->cc_lock.__annonCompField18.rlock, "&(&common->cc_lock)->rlock", & __key___0); spinlock_check(& sc->sc_serial_rw); __raw_spin_lock_init(& sc->sc_serial_rw.__annonCompField18.rlock, "&(&sc->sc_serial_rw)->rlock", & __key___1); spinlock_check(& sc->sc_pm_lock); __raw_spin_lock_init(& sc->sc_pm_lock.__annonCompField18.rlock, "&(&sc->sc_pm_lock)->rlock", & __key___2); spinlock_check(& sc->chan_lock); __raw_spin_lock_init(& sc->chan_lock.__annonCompField18.rlock, "&(&sc->chan_lock)->rlock", & __key___3); __mutex_init(& sc->mutex, "&sc->mutex", & __key___4); tasklet_init(& sc->intr_tq, & ath9k_tasklet, (unsigned long )sc); tasklet_init(& sc->bcon_tasklet, & ath9k_beacon_tasklet, (unsigned long )sc); reg_timer_14(& sc->sleep_timer, & ath_ps_full_sleep, (unsigned long )sc); __init_work(& sc->hw_reset_work, 0); __constr_expr_0.counter = 137438953408L; sc->hw_reset_work.data = __constr_expr_0; lockdep_init_map(& sc->hw_reset_work.lockdep_map, "(&sc->hw_reset_work)", & __key___5, 0); INIT_LIST_HEAD(& sc->hw_reset_work.entry); sc->hw_reset_work.func = & ath_reset_work; __init_work(& sc->paprd_work, 0); __constr_expr_1.counter = 137438953408L; sc->paprd_work.data = __constr_expr_1; lockdep_init_map(& sc->paprd_work.lockdep_map, "(&sc->paprd_work)", & __key___6, 0); INIT_LIST_HEAD(& sc->paprd_work.entry); sc->paprd_work.func = & ath_paprd_calibrate; __init_work(& sc->hw_pll_work.work, 0); __constr_expr_2.counter = 137438953408L; sc->hw_pll_work.work.data = __constr_expr_2; lockdep_init_map(& sc->hw_pll_work.work.lockdep_map, "(&(&sc->hw_pll_work)->work)", & __key___7, 0); INIT_LIST_HEAD(& sc->hw_pll_work.work.entry); sc->hw_pll_work.work.func = & ath_hw_pll_work; init_timer_key(& sc->hw_pll_work.timer, 2097152U, "(&(&sc->hw_pll_work)->timer)", & __key___8); sc->hw_pll_work.timer.function = & delayed_work_timer_fn; sc->hw_pll_work.timer.data = (unsigned long )(& sc->hw_pll_work); ath9k_init_channel_context(sc); ath_read_cachesize(common, & csz); common->cachelsz = (int )((u16 )csz) << 2U; ret = ath9k_hw_init(ah); if (ret != 0) { goto err_hw; } else { } if ((unsigned long )pdata != (unsigned long )((struct ath9k_platform_data *)0) && (unsigned long )pdata->macaddr != (unsigned long )((u8 *)0U)) { memcpy((void *)(& common->macaddr), (void const *)pdata->macaddr, 6UL); } else { } ret = ath9k_init_queues(sc); if (ret != 0) { goto err_queues; } else { } ret = ath9k_init_btcoex(sc); if (ret != 0) { goto err_btcoex; } else { } ret = ath9k_cmn_init_channels_rates(common); if (ret != 0) { goto err_btcoex; } else { } ret = ath9k_init_p2p(sc); if (ret != 0) { goto err_btcoex; } else { } ath9k_cmn_init_crypto(sc->sc_ah); ath9k_init_misc(sc); ath_fill_led_pin(sc); ath_chanctx_init(sc); ath9k_offchannel_init(sc); if ((unsigned long )(common->bus_ops)->aspm_init != (unsigned long )((void (*/* const */)(struct ath_common * ))0)) { (*((common->bus_ops)->aspm_init))(common); } else { } return (0); err_btcoex: i = 0; goto ldv_54717; ldv_54716: ; if ((sc->tx.txqsetup & (u32 )(1 << i)) != 0U) { ath_tx_cleanupq(sc, (struct ath_txq *)(& sc->tx.txq) + (unsigned long )i); } else { } i = i + 1; ldv_54717: ; if (i <= 9) { goto ldv_54716; } else { } err_queues: ath9k_hw_deinit(ah); err_hw: ath9k_eeprom_release(sc); dev_kfree_skb_any(sc->tx99_skb); return (ret); } } static void ath9k_init_band_txpower(struct ath_softc *sc , int band ) { struct ieee80211_supported_band *sband ; struct ieee80211_channel *chan ; struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; struct cfg80211_chan_def chandef ; int i ; { ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; sband = (struct ieee80211_supported_band *)(& common->sbands) + (unsigned long )band; i = 0; goto ldv_54730; ldv_54729: chan = sband->channels + (unsigned long )i; ah->curchan = (struct ath9k_channel *)(& ah->channels) + (unsigned long )chan->hw_value; cfg80211_chandef_create(& chandef, chan, 1); ath9k_cmn_get_channel(sc->hw, ah, & chandef); ath9k_hw_set_txpowerlimit(ah, 63U, 1); i = i + 1; ldv_54730: ; if (sband->n_channels > i) { goto ldv_54729; } else { } return; } } static void ath9k_init_txpower_limits(struct ath_softc *sc ) { struct ath_hw *ah ; struct ath9k_channel *curchan ; { ah = sc->sc_ah; curchan = ah->curchan; if ((ah->caps.hw_caps & 2048U) != 0U) { ath9k_init_band_txpower(sc, 0); } else { } if ((ah->caps.hw_caps & 4096U) != 0U) { ath9k_init_band_txpower(sc, 1); } else { } ah->curchan = curchan; return; } } static struct ieee80211_iface_limit const if_limits_multi[2U] = { {2U, 780U}, {1U, 2U}}; static struct ieee80211_iface_combination const if_comb_multi[1U] = { {(struct ieee80211_iface_limit const *)(& if_limits_multi), 2U, 2U, 2U, 1, (unsigned char)0, (unsigned char)0}}; static void ath9k_set_mcc_capab(struct ath_softc *sc , struct ieee80211_hw *hw ) { struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; bool tmp___0 ; int tmp___1 ; { ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; tmp___0 = ath9k_is_chanctx_enabled(); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { return; } else { } _ieee80211_hw_set(hw, 18); hw->queues = 10U; hw->offchannel_tx_hw_queue = (unsigned int )((u8 )hw->queues) + 255U; (hw->wiphy)->interface_modes = (unsigned int )(hw->wiphy)->interface_modes & 65503U; (hw->wiphy)->iface_combinations = (struct ieee80211_iface_combination const *)(& if_comb_multi); (hw->wiphy)->n_iface_combinations = 1; (hw->wiphy)->max_scan_ssids = 255U; (hw->wiphy)->max_scan_ie_len = 2304U; (hw->wiphy)->max_remain_on_channel_duration = 10000U; hw->chanctx_data_size = 8; hw->extra_beacon_tailroom = 63U; if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "Use channel contexts\n"); } else { } return; } } static void ath9k_set_hw_capab(struct ath_softc *sc , struct ieee80211_hw *hw ) { struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; { ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; _ieee80211_hw_set(hw, 25); _ieee80211_hw_set(hw, 22); _ieee80211_hw_set(hw, 16); _ieee80211_hw_set(hw, 6); _ieee80211_hw_set(hw, 9); _ieee80211_hw_set(hw, 4); _ieee80211_hw_set(hw, 1); _ieee80211_hw_set(hw, 2); if (ath9k_ps_enable != 0) { _ieee80211_hw_set(hw, 8); } else { } if ((int )(sc->sc_ah)->caps.hw_caps & 1) { _ieee80211_hw_set(hw, 7); if (ah->hw_version.macVersion > 127U) { hw->radiotap_mcs_details = (u8 )((unsigned int )hw->radiotap_mcs_details | 32U); } else { } } else { } if ((sc->sc_ah)->hw_version.macVersion > 63U || ath9k_modparam_nohwcrypt != 0) { _ieee80211_hw_set(hw, 11); } else { } (hw->wiphy)->features = (hw->wiphy)->features | 395264U; (hw->wiphy)->flags = (hw->wiphy)->flags & 4294967279U; (hw->wiphy)->flags = (hw->wiphy)->flags | 256U; (hw->wiphy)->flags = (hw->wiphy)->flags | 32768U; (hw->wiphy)->flags = (hw->wiphy)->flags | 2097152U; (hw->wiphy)->flags = (hw->wiphy)->flags | 4194304U; (hw->wiphy)->flags = (hw->wiphy)->flags | 8388608U; (hw->wiphy)->flags = (hw->wiphy)->flags | 16384U; hw->queues = 4U; hw->max_rates = 4U; hw->max_listen_interval = 10U; hw->max_rate_tries = 10U; hw->sta_data_size = 4920; hw->vif_data_size = 5080; (hw->wiphy)->available_antennas_rx = (u32 )(1UL << (int )ah->caps.max_rxchains) - 1U; (hw->wiphy)->available_antennas_tx = (u32 )(1UL << (int )ah->caps.max_txchains) - 1U; if ((ah->caps.hw_caps & 1024U) != 0U) { (hw->wiphy)->available_antennas_rx = 3U; } else { } sc->ant_rx = (u8 )(hw->wiphy)->available_antennas_rx; sc->ant_tx = (u8 )(hw->wiphy)->available_antennas_tx; if (((sc->sc_ah)->caps.hw_caps & 2048U) != 0U) { (hw->wiphy)->bands[0] = (struct ieee80211_supported_band *)(& common->sbands); } else { } if (((sc->sc_ah)->caps.hw_caps & 4096U) != 0U) { (hw->wiphy)->bands[1] = (struct ieee80211_supported_band *)(& common->sbands) + 1UL; } else { } ath9k_set_mcc_capab(sc, hw); ath9k_init_wow(hw); ath9k_cmn_reload_chainmask(ah); SET_IEEE80211_PERM_ADDR(hw, (u8 *)(& common->macaddr)); return; } } int ath9k_init_device(u16 devid , struct ath_softc *sc , struct ath_bus_ops const *bus_ops ) { struct ieee80211_hw *hw ; struct ath_common *common ; struct ath_hw *ah ; int error ; struct ath_regulatory *reg ; bool tmp ; int tmp___0 ; { hw = sc->hw; error = 0; error = ath9k_init_softc((int )devid, sc, bus_ops); if (error != 0) { return (error); } else { } ah = sc->sc_ah; common = ath9k_hw_common(ah); ath9k_set_hw_capab(sc, hw); error = ath_regd_init(& common->regulatory, (sc->hw)->wiphy, & ath9k_reg_notifier); if (error != 0) { goto deinit; } else { } reg = & common->regulatory; error = ath_tx_init(sc, 512); if (error != 0) { goto deinit; } else { } error = ath_rx_init(sc, 512); if (error != 0) { goto deinit; } else { } ath9k_init_txpower_limits(sc); sc->led_cdev.default_trigger = ieee80211_create_tpt_led_trigger(sc->hw, 1U, (struct ieee80211_tpt_blink const *)(& ath9k_tpt_blink), 10U); error = ieee80211_register_hw(hw); if (error != 0) { goto rx_cleanup; } else { } error = ath9k_init_debug(ah); if (error != 0) { ath_printk("\v", (struct ath_common const *)common, "Unable to create debugfs files\n"); goto unregister; } else { } tmp = ath_is_world_regd(reg); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { error = regulatory_hint(hw->wiphy, (char const *)(& reg->alpha2)); if (error != 0) { goto debug_cleanup; } else { } } else { } ath_init_leds(sc); ath_start_rfkill_poll(sc); return (0); debug_cleanup: ath9k_deinit_debug(sc); unregister: ieee80211_unregister_hw(hw); rx_cleanup: ath_rx_cleanup(sc); deinit: ath9k_deinit_softc(sc); return (error); } } static void ath9k_deinit_softc(struct ath_softc *sc ) { int i ; { i = 0; ath9k_deinit_p2p(sc); ath9k_deinit_btcoex(sc); i = 0; goto ldv_54788; ldv_54787: ; if ((sc->tx.txqsetup & (u32 )(1 << i)) != 0U) { ath_tx_cleanupq(sc, (struct ath_txq *)(& sc->tx.txq) + (unsigned long )i); } else { } i = i + 1; ldv_54788: ; if (i <= 9) { goto ldv_54787; } else { } ldv_del_timer_sync_52(& sc->sleep_timer); ath9k_hw_deinit(sc->sc_ah); if ((unsigned long )sc->dfs_detector != (unsigned long )((struct dfs_pattern_detector *)0)) { (*((sc->dfs_detector)->exit))(sc->dfs_detector); } else { } ath9k_eeprom_release(sc); return; } } void ath9k_deinit_device(struct ath_softc *sc ) { struct ieee80211_hw *hw ; { hw = sc->hw; ath9k_ps_wakeup(sc); wiphy_rfkill_stop_polling((sc->hw)->wiphy); ath_deinit_leds(sc); ath9k_ps_restore(sc); ath9k_deinit_debug(sc); ath9k_deinit_wow(hw); ieee80211_unregister_hw(hw); ath_rx_cleanup(sc); ath9k_deinit_softc(sc); return; } } static int ath9k_init(void) { int error ; { error = ath_pci_init(); if (error < 0) { printk("\vath9k: No PCI devices found, driver not installed\n"); error = -19; goto err_out; } else { } error = ath_ahb_init(); if (error < 0) { error = -19; goto err_pci_exit; } else { } return (0); err_pci_exit: ath_pci_exit(); err_out: ; return (error); } } static void ath9k_exit(void) { { is_ath9k_unloaded = 1; ath_ahb_exit(); ath_pci_exit(); printk("\016ath9k: %s: Driver unloaded\n", dev_info); return; } } extern void ldv_initialize(void) ; void ldv_check_final_state(void) ; int ldv_retval_17 ; 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 timer_init_12(void) { { ldv_timer_12_0 = 0; ldv_timer_12_1 = 0; ldv_timer_12_2 = 0; ldv_timer_12_3 = 0; return; } } int reg_timer_12(struct timer_list *timer , void (*function)(unsigned long ) , unsigned long data ) { { if ((unsigned long )function == (unsigned long )(& ath_ps_full_sleep)) { activate_suitable_timer_12(timer, data); } else { } return (0); } } 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 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) { ath_reset_work(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) { ath_reset_work(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) { ath_reset_work(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) { ath_reset_work(work); ldv_work_3_3 = 1; return; } else { } return; } } void disable_work_3(struct work_struct *work ) { { if ((ldv_work_3_0 == 3 || ldv_work_3_0 == 2) && (unsigned long )ldv_work_struct_3_0 == (unsigned long )work) { ldv_work_3_0 = 1; } else { } if ((ldv_work_3_1 == 3 || ldv_work_3_1 == 2) && (unsigned long )ldv_work_struct_3_1 == (unsigned long )work) { ldv_work_3_1 = 1; } else { } if ((ldv_work_3_2 == 3 || ldv_work_3_2 == 2) && (unsigned long )ldv_work_struct_3_2 == (unsigned long )work) { ldv_work_3_2 = 1; } else { } if ((ldv_work_3_3 == 3 || ldv_work_3_3 == 2) && (unsigned long )ldv_work_struct_3_3 == (unsigned long )work) { ldv_work_3_3 = 1; } else { } return; } } void disable_suitable_timer_11(struct timer_list *timer ) { { if (ldv_timer_11_0 != 0 && (unsigned long )timer == (unsigned long )ldv_timer_list_11_0) { ldv_timer_11_0 = 0; return; } else { } if (ldv_timer_11_1 != 0 && (unsigned long )timer == (unsigned long )ldv_timer_list_11_1) { ldv_timer_11_1 = 0; return; } else { } if (ldv_timer_11_2 != 0 && (unsigned long )timer == (unsigned long )ldv_timer_list_11_2) { ldv_timer_11_2 = 0; return; } else { } if (ldv_timer_11_3 != 0 && (unsigned long )timer == (unsigned long )ldv_timer_list_11_3) { ldv_timer_11_3 = 0; 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; ath_paprd_calibrate(ldv_work_struct_4_0); ldv_work_4_0 = 1; } else { } goto ldv_54854; case 1: ; if (ldv_work_4_1 == 2 || ldv_work_4_1 == 3) { ldv_work_4_1 = 4; ath_paprd_calibrate(ldv_work_struct_4_0); ldv_work_4_1 = 1; } else { } goto ldv_54854; case 2: ; if (ldv_work_4_2 == 2 || ldv_work_4_2 == 3) { ldv_work_4_2 = 4; ath_paprd_calibrate(ldv_work_struct_4_0); ldv_work_4_2 = 1; } else { } goto ldv_54854; case 3: ; if (ldv_work_4_3 == 2 || ldv_work_4_3 == 3) { ldv_work_4_3 = 4; ath_paprd_calibrate(ldv_work_struct_4_0); ldv_work_4_3 = 1; } else { } goto ldv_54854; default: ldv_stop(); } ldv_54854: ; return; } } void ldv_initialize_ath_ps_ops_39(void) { void *tmp ; { tmp = ldv_init_zalloc(680UL); ath9k_ps_ops_group0 = (struct ath_common *)tmp; return; } } void choose_timer_11(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_timer_11_0 == 1) { ldv_timer_11_0 = 2; ldv_timer_11(ldv_timer_11_0, ldv_timer_list_11_0); } else { } goto ldv_54866; case 1: ; if (ldv_timer_11_1 == 1) { ldv_timer_11_1 = 2; ldv_timer_11(ldv_timer_11_1, ldv_timer_list_11_1); } else { } goto ldv_54866; case 2: ; if (ldv_timer_11_2 == 1) { ldv_timer_11_2 = 2; ldv_timer_11(ldv_timer_11_2, ldv_timer_list_11_2); } else { } goto ldv_54866; case 3: ; if (ldv_timer_11_3 == 1) { ldv_timer_11_3 = 2; ldv_timer_11(ldv_timer_11_3, ldv_timer_list_11_3); } else { } goto ldv_54866; default: ldv_stop(); } ldv_54866: ; return; } } void timer_init_11(void) { { ldv_timer_11_0 = 0; ldv_timer_11_1 = 0; ldv_timer_11_2 = 0; ldv_timer_11_3 = 0; 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; ath_hw_pll_work(ldv_work_struct_5_0); ldv_work_5_0 = 1; } else { } goto ldv_54880; case 1: ; if (ldv_work_5_1 == 2 || ldv_work_5_1 == 3) { ldv_work_5_1 = 4; ath_hw_pll_work(ldv_work_struct_5_0); ldv_work_5_1 = 1; } else { } goto ldv_54880; case 2: ; if (ldv_work_5_2 == 2 || ldv_work_5_2 == 3) { ldv_work_5_2 = 4; ath_hw_pll_work(ldv_work_struct_5_0); ldv_work_5_2 = 1; } else { } goto ldv_54880; case 3: ; if (ldv_work_5_3 == 2 || ldv_work_5_3 == 3) { ldv_work_5_3 = 4; ath_hw_pll_work(ldv_work_struct_5_0); ldv_work_5_3 = 1; } else { } goto ldv_54880; default: ldv_stop(); } ldv_54880: ; return; } } void choose_timer_12(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_timer_12_0 == 1) { ldv_timer_12_0 = 2; ldv_timer_12(ldv_timer_12_0, ldv_timer_list_12_0); } else { } goto ldv_54889; case 1: ; if (ldv_timer_12_1 == 1) { ldv_timer_12_1 = 2; ldv_timer_12(ldv_timer_12_1, ldv_timer_list_12_1); } else { } goto ldv_54889; case 2: ; if (ldv_timer_12_2 == 1) { ldv_timer_12_2 = 2; ldv_timer_12(ldv_timer_12_2, ldv_timer_list_12_2); } else { } goto ldv_54889; case 3: ; if (ldv_timer_12_3 == 1) { ldv_timer_12_3 = 2; ldv_timer_12(ldv_timer_12_3, ldv_timer_list_12_3); } else { } goto ldv_54889; default: ldv_stop(); } ldv_54889: ; 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; } } int reg_timer_11(struct timer_list *timer , void (*function)(unsigned long ) , unsigned long data ) { { if ((unsigned long )function == (unsigned long )(& ath_ani_calibrate)) { activate_suitable_timer_11(timer, data); } else { } return (0); } } void activate_suitable_timer_11(struct timer_list *timer , unsigned long data ) { { if (ldv_timer_11_0 == 0 || ldv_timer_11_0 == 2) { ldv_timer_list_11_0 = timer; ldv_timer_list_11_0->data = data; ldv_timer_11_0 = 1; return; } else { } if (ldv_timer_11_1 == 0 || ldv_timer_11_1 == 2) { ldv_timer_list_11_1 = timer; ldv_timer_list_11_1->data = data; ldv_timer_11_1 = 1; return; } else { } if (ldv_timer_11_2 == 0 || ldv_timer_11_2 == 2) { ldv_timer_list_11_2 = timer; ldv_timer_list_11_2->data = data; ldv_timer_11_2 = 1; return; } else { } if (ldv_timer_11_3 == 0 || ldv_timer_11_3 == 2) { ldv_timer_list_11_3 = timer; ldv_timer_list_11_3->data = data; ldv_timer_11_3 = 1; return; } else { } return; } } void call_and_disable_all_3(int state ) { { if (ldv_work_3_0 == state) { call_and_disable_work_3(ldv_work_struct_3_0); } else { } if (ldv_work_3_1 == state) { call_and_disable_work_3(ldv_work_struct_3_1); } else { } if (ldv_work_3_2 == state) { call_and_disable_work_3(ldv_work_struct_3_2); } else { } if (ldv_work_3_3 == state) { call_and_disable_work_3(ldv_work_struct_3_3); } else { } return; } } void disable_suitable_timer_12(struct timer_list *timer ) { { if (ldv_timer_12_0 != 0 && (unsigned long )timer == (unsigned long )ldv_timer_list_12_0) { ldv_timer_12_0 = 0; return; } else { } if (ldv_timer_12_1 != 0 && (unsigned long )timer == (unsigned long )ldv_timer_list_12_1) { ldv_timer_12_1 = 0; return; } else { } if (ldv_timer_12_2 != 0 && (unsigned long )timer == (unsigned long )ldv_timer_list_12_2) { ldv_timer_12_2 = 0; return; } else { } if (ldv_timer_12_3 != 0 && (unsigned long )timer == (unsigned long )ldv_timer_list_12_3) { ldv_timer_12_3 = 0; 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) { ath_paprd_calibrate(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) { ath_paprd_calibrate(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) { ath_paprd_calibrate(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) { ath_paprd_calibrate(work); ldv_work_4_3 = 1; 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 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 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 activate_pending_timer_12(struct timer_list *timer , unsigned long data , int pending_flag ) { { if ((unsigned long )ldv_timer_list_12_0 == (unsigned long )timer) { if (ldv_timer_12_0 == 2 || pending_flag != 0) { ldv_timer_list_12_0 = timer; ldv_timer_list_12_0->data = data; ldv_timer_12_0 = 1; } else { } return; } else { } if ((unsigned long )ldv_timer_list_12_1 == (unsigned long )timer) { if (ldv_timer_12_1 == 2 || pending_flag != 0) { ldv_timer_list_12_1 = timer; ldv_timer_list_12_1->data = data; ldv_timer_12_1 = 1; } else { } return; } else { } if ((unsigned long )ldv_timer_list_12_2 == (unsigned long )timer) { if (ldv_timer_12_2 == 2 || pending_flag != 0) { ldv_timer_list_12_2 = timer; ldv_timer_list_12_2->data = data; ldv_timer_12_2 = 1; } else { } return; } else { } if ((unsigned long )ldv_timer_list_12_3 == (unsigned long )timer) { if (ldv_timer_12_3 == 2 || pending_flag != 0) { ldv_timer_list_12_3 = timer; ldv_timer_list_12_3->data = data; ldv_timer_12_3 = 1; } else { } return; } else { } activate_suitable_timer_12(timer, data); return; } } void ldv_timer_12(int state , struct timer_list *timer ) { { LDV_IN_INTERRUPT = 2; ath_ps_full_sleep(timer->data); LDV_IN_INTERRUPT = 1; 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) { ath_hw_pll_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) { ath_hw_pll_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) { ath_hw_pll_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) { ath_hw_pll_work(work); ldv_work_5_3 = 1; return; } else { } return; } } void activate_suitable_timer_12(struct timer_list *timer , unsigned long data ) { { if (ldv_timer_12_0 == 0 || ldv_timer_12_0 == 2) { ldv_timer_list_12_0 = timer; ldv_timer_list_12_0->data = data; ldv_timer_12_0 = 1; return; } else { } if (ldv_timer_12_1 == 0 || ldv_timer_12_1 == 2) { ldv_timer_list_12_1 = timer; ldv_timer_list_12_1->data = data; ldv_timer_12_1 = 1; return; } else { } if (ldv_timer_12_2 == 0 || ldv_timer_12_2 == 2) { ldv_timer_list_12_2 = timer; ldv_timer_list_12_2->data = data; ldv_timer_12_2 = 1; return; } else { } if (ldv_timer_12_3 == 0 || ldv_timer_12_3 == 2) { ldv_timer_list_12_3 = timer; ldv_timer_list_12_3->data = data; ldv_timer_12_3 = 1; return; } else { } 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_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; } } void ldv_timer_11(int state , struct timer_list *timer ) { { LDV_IN_INTERRUPT = 2; ath_ani_calibrate(timer->data); LDV_IN_INTERRUPT = 1; 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; ath_reset_work(ldv_work_struct_3_0); ldv_work_3_0 = 1; } else { } goto ldv_54966; case 1: ; if (ldv_work_3_1 == 2 || ldv_work_3_1 == 3) { ldv_work_3_1 = 4; ath_reset_work(ldv_work_struct_3_0); ldv_work_3_1 = 1; } else { } goto ldv_54966; case 2: ; if (ldv_work_3_2 == 2 || ldv_work_3_2 == 3) { ldv_work_3_2 = 4; ath_reset_work(ldv_work_struct_3_0); ldv_work_3_2 = 1; } else { } goto ldv_54966; case 3: ; if (ldv_work_3_3 == 2 || ldv_work_3_3 == 3) { ldv_work_3_3 = 4; ath_reset_work(ldv_work_struct_3_0); ldv_work_3_3 = 1; } else { } goto ldv_54966; default: ldv_stop(); } ldv_54966: ; return; } } void activate_pending_timer_11(struct timer_list *timer , unsigned long data , int pending_flag ) { { if ((unsigned long )ldv_timer_list_11_0 == (unsigned long )timer) { if (ldv_timer_11_0 == 2 || pending_flag != 0) { ldv_timer_list_11_0 = timer; ldv_timer_list_11_0->data = data; ldv_timer_11_0 = 1; } else { } return; } else { } if ((unsigned long )ldv_timer_list_11_1 == (unsigned long )timer) { if (ldv_timer_11_1 == 2 || pending_flag != 0) { ldv_timer_list_11_1 = timer; ldv_timer_list_11_1->data = data; ldv_timer_11_1 = 1; } else { } return; } else { } if ((unsigned long )ldv_timer_list_11_2 == (unsigned long )timer) { if (ldv_timer_11_2 == 2 || pending_flag != 0) { ldv_timer_list_11_2 = timer; ldv_timer_list_11_2->data = data; ldv_timer_11_2 = 1; } else { } return; } else { } if ((unsigned long )ldv_timer_list_11_3 == (unsigned long )timer) { if (ldv_timer_11_3 == 2 || pending_flag != 0) { ldv_timer_list_11_3 = timer; ldv_timer_list_11_3->data = data; ldv_timer_11_3 = 1; } else { } return; } else { } activate_suitable_timer_11(timer, data); return; } } void ldv_main_exported_27(void) ; void ldv_main_exported_25(void) ; void ldv_main_exported_28(void) ; void ldv_main_exported_21(void) ; void ldv_main_exported_26(void) ; void ldv_main_exported_17(void) ; void ldv_main_exported_20(void) ; void ldv_main_exported_22(void) ; void ldv_main_exported_18(void) ; void ldv_main_exported_24(void) ; void ldv_main_exported_19(void) ; void ldv_main_exported_23(void) ; void ldv_main_exported_38(void) ; void ldv_main_exported_35(void) ; void ldv_main_exported_36(void) ; void ldv_main_exported_37(void) ; void ldv_main_exported_33(void) ; void ldv_main_exported_34(void) ; void ldv_main_exported_30(void) ; void ldv_main_exported_29(void) ; void ldv_main_exported_16(void) ; void ldv_main_exported_15(void) ; void ldv_main_exported_32(void) ; void ldv_main_exported_31(void) ; int main(void) { int tmp ; int tmp___0 ; int tmp___1 ; { ldv_initialize(); ldv_state_variable_33 = 0; ldv_state_variable_32 = 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_1 = 1; ldv_state_variable_18 = 0; ldv_state_variable_30 = 0; ldv_state_variable_16 = 0; ldv_state_variable_27 = 0; ldv_state_variable_25 = 0; ldv_state_variable_28 = 0; ldv_state_variable_20 = 0; timer_init_14(); ldv_state_variable_14 = 1; ldv_state_variable_24 = 0; timer_init_10(); ldv_state_variable_10 = 1; ldv_state_variable_31 = 0; ldv_state_variable_35 = 0; timer_init_11(); ldv_state_variable_11 = 1; ldv_state_variable_22 = 0; ref_cnt = 0; ldv_state_variable_0 = 1; timer_init_13(); ldv_state_variable_13 = 1; ldv_state_variable_23 = 0; ldv_state_variable_29 = 0; work_init_6(); ldv_state_variable_6 = 1; ldv_state_variable_39 = 0; ldv_state_variable_36 = 0; work_init_3(); ldv_state_variable_3 = 1; timer_init_9(); ldv_state_variable_9 = 1; timer_init_12(); ldv_state_variable_12 = 1; ldv_state_variable_15 = 0; ldv_state_variable_38 = 0; work_init_8(); ldv_state_variable_8 = 1; work_init_4(); ldv_state_variable_4 = 1; ldv_state_variable_34 = 0; ldv_state_variable_37 = 0; ldv_state_variable_19 = 0; work_init_5(); ldv_state_variable_5 = 1; ldv_55084: tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_state_variable_33 != 0) { ldv_main_exported_33(); } else { } goto ldv_55034; case 1: ; if (ldv_state_variable_32 != 0) { ldv_main_exported_32(); } else { } goto ldv_55034; case 2: ; if (ldv_state_variable_21 != 0) { ldv_main_exported_21(); } else { } goto ldv_55034; case 3: ; goto ldv_55034; case 4: ; if (ldv_state_variable_26 != 0) { ldv_main_exported_26(); } else { } goto ldv_55034; case 5: ; if (ldv_state_variable_17 != 0) { ldv_main_exported_17(); } else { } goto ldv_55034; case 6: ; goto ldv_55034; case 7: ; goto ldv_55034; case 8: ; if (ldv_state_variable_18 != 0) { ldv_main_exported_18(); } else { } goto ldv_55034; case 9: ; if (ldv_state_variable_30 != 0) { ldv_main_exported_30(); } else { } goto ldv_55034; case 10: ; if (ldv_state_variable_16 != 0) { ldv_main_exported_16(); } else { } goto ldv_55034; case 11: ; if (ldv_state_variable_27 != 0) { ldv_main_exported_27(); } else { } goto ldv_55034; case 12: ; if (ldv_state_variable_25 != 0) { ldv_main_exported_25(); } else { } goto ldv_55034; case 13: ; if (ldv_state_variable_28 != 0) { ldv_main_exported_28(); } else { } goto ldv_55034; case 14: ; if (ldv_state_variable_20 != 0) { ldv_main_exported_20(); } else { } goto ldv_55034; case 15: ; goto ldv_55034; case 16: ; if (ldv_state_variable_24 != 0) { ldv_main_exported_24(); } else { } goto ldv_55034; case 17: ; goto ldv_55034; case 18: ; if (ldv_state_variable_31 != 0) { ldv_main_exported_31(); } else { } goto ldv_55034; case 19: ; if (ldv_state_variable_35 != 0) { ldv_main_exported_35(); } else { } goto ldv_55034; case 20: ; if (ldv_state_variable_11 != 0) { choose_timer_11(); } else { } goto ldv_55034; case 21: ; if (ldv_state_variable_22 != 0) { ldv_main_exported_22(); } else { } goto ldv_55034; case 22: ; if (ldv_state_variable_0 != 0) { tmp___0 = __VERIFIER_nondet_int(); switch (tmp___0) { case 0: ; if (ldv_state_variable_0 == 2 && ref_cnt == 0) { ath9k_exit(); ldv_state_variable_0 = 3; goto ldv_final; } else { } goto ldv_55059; case 1: ; if (ldv_state_variable_0 == 1) { ldv_retval_17 = ath9k_init(); if (ldv_retval_17 != 0) { ldv_state_variable_0 = 3; goto ldv_final; } else { } if (ldv_retval_17 == 0) { ldv_state_variable_0 = 2; ldv_state_variable_31 = 1; ldv_file_operations_31(); ldv_state_variable_19 = 1; ldv_file_operations_19(); ldv_state_variable_24 = 1; ldv_file_operations_24(); ldv_state_variable_37 = 1; ldv_initialize_ath_bus_ops_37(); ldv_state_variable_34 = 1; ldv_initialize_ath_bus_ops_34(); ldv_state_variable_20 = 1; ldv_file_operations_20(); ldv_state_variable_15 = 1; ldv_file_operations_15(); ldv_state_variable_36 = 1; ldv_dev_pm_ops_36(); ldv_state_variable_28 = 1; ldv_file_operations_28(); ldv_state_variable_39 = 1; ldv_initialize_ath_ps_ops_39(); ldv_state_variable_27 = 1; ldv_file_operations_27(); ldv_state_variable_25 = 1; ldv_file_operations_25(); ldv_state_variable_29 = 1; ldv_file_operations_29(); ldv_state_variable_16 = 1; ldv_file_operations_16(); ldv_state_variable_23 = 1; ldv_file_operations_23(); ldv_state_variable_30 = 1; ldv_file_operations_30(); ldv_state_variable_18 = 1; ldv_file_operations_18(); ldv_state_variable_22 = 1; ldv_file_operations_22(); ldv_state_variable_17 = 1; ldv_file_operations_17(); ldv_state_variable_26 = 1; ldv_file_operations_26(); ldv_state_variable_21 = 1; ldv_file_operations_21(); ldv_state_variable_32 = 1; ldv_file_operations_32(); } else { } } else { } goto ldv_55059; default: ldv_stop(); } ldv_55059: ; } else { } goto ldv_55034; case 23: ; goto ldv_55034; case 24: ; if (ldv_state_variable_23 != 0) { ldv_main_exported_23(); } else { } goto ldv_55034; case 25: ; if (ldv_state_variable_29 != 0) { ldv_main_exported_29(); } else { } goto ldv_55034; case 26: ; goto ldv_55034; case 27: ; if (ldv_state_variable_39 != 0) { tmp___1 = __VERIFIER_nondet_int(); switch (tmp___1) { case 0: ; if (ldv_state_variable_39 == 1) { ath9k_op_ps_restore(ath9k_ps_ops_group0); ldv_state_variable_39 = 1; } else { } goto ldv_55068; case 1: ; if (ldv_state_variable_39 == 1) { ath9k_op_ps_wakeup(ath9k_ps_ops_group0); ldv_state_variable_39 = 1; } else { } goto ldv_55068; default: ldv_stop(); } ldv_55068: ; } else { } goto ldv_55034; case 28: ; if (ldv_state_variable_36 != 0) { ldv_main_exported_36(); } else { } goto ldv_55034; case 29: ; if (ldv_state_variable_3 != 0) { invoke_work_3(); } else { } goto ldv_55034; case 30: ; goto ldv_55034; case 31: ; if (ldv_state_variable_12 != 0) { choose_timer_12(); } else { } goto ldv_55034; case 32: ; if (ldv_state_variable_15 != 0) { ldv_main_exported_15(); } else { } goto ldv_55034; case 33: ; if (ldv_state_variable_38 != 0) { ldv_main_exported_38(); } else { } goto ldv_55034; case 34: ; goto ldv_55034; case 35: ; if (ldv_state_variable_4 != 0) { invoke_work_4(); } else { } goto ldv_55034; case 36: ; if (ldv_state_variable_34 != 0) { ldv_main_exported_34(); } else { } goto ldv_55034; case 37: ; if (ldv_state_variable_37 != 0) { ldv_main_exported_37(); } else { } goto ldv_55034; case 38: ; if (ldv_state_variable_19 != 0) { ldv_main_exported_19(); } else { } goto ldv_55034; case 39: ; if (ldv_state_variable_5 != 0) { invoke_work_5(); } else { } goto ldv_55034; default: ldv_stop(); } ldv_55034: ; goto ldv_55084; ldv_final: ldv_check_final_state(); return 0; } } bool ldv_queue_work_on_47(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_48(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_49(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_50(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_7(2); return; } } bool ldv_queue_delayed_work_on_51(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } int ldv_del_timer_sync_52(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___3 ldv_func_res ; int tmp ; { tmp = del_timer_sync(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_14(ldv_func_arg1); return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; __inline static int test_and_set_bit(long nr , unsigned long volatile *addr ) { char c ; { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; bts %2, %0; setc %1": "+m" (*addr), "=qm" (c): "Ir" (nr): "memory"); return ((int )((signed char )c) != 0); } } extern void __might_sleep(char const * , int , int ) ; __inline static int list_empty(struct list_head const *head ) { { return ((unsigned long )((struct list_head const *)head->next) == (unsigned long )head); } } __inline static void atomic_set(atomic_t *v , int i ) { { v->counter = i; return; } } extern void _raw_spin_lock(raw_spinlock_t * ) ; extern void _raw_spin_unlock(raw_spinlock_t * ) ; __inline static void spin_lock(spinlock_t *lock ) { { _raw_spin_lock(& lock->__annonCompField18.rlock); return; } } __inline static void spin_unlock(spinlock_t *lock ) { { _raw_spin_unlock(& lock->__annonCompField18.rlock); return; } } extern void __wake_up(wait_queue_head_t * , unsigned int , int , void * ) ; extern long prepare_to_wait_event(wait_queue_head_t * , wait_queue_t * , int ) ; extern void finish_wait(wait_queue_head_t * , wait_queue_t * ) ; extern void mutex_lock_nested(struct mutex * , unsigned int ) ; extern void mutex_unlock(struct mutex * ) ; extern unsigned long wait_for_completion_timeout(struct completion * , unsigned long ) ; extern unsigned int jiffies_to_msecs(unsigned long const ) ; extern unsigned long __usecs_to_jiffies(unsigned int const ) ; __inline static unsigned long usecs_to_jiffies(unsigned int const u ) { unsigned long tmp___1 ; { tmp___1 = __usecs_to_jiffies(u); return (tmp___1); } } int ldv_mod_timer_69(struct timer_list *ldv_func_arg1 , unsigned long ldv_func_arg2 ) ; int ldv_del_timer_sync_68(struct timer_list *ldv_func_arg1 ) ; int ldv_del_timer_sync_76(struct timer_list *ldv_func_arg1 ) ; int ldv_del_timer_sync_77(struct timer_list *ldv_func_arg1 ) ; int ldv_del_timer_sync_78(struct timer_list *ldv_func_arg1 ) ; int ldv_del_timer_sync_79(struct timer_list *ldv_func_arg1 ) ; bool ldv_queue_work_on_63(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_65(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_64(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; bool ldv_queue_delayed_work_on_67(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; void ldv_flush_workqueue_66(struct workqueue_struct *ldv_func_arg1 ) ; extern bool cancel_work_sync(struct work_struct * ) ; bool ldv_cancel_work_sync_70(struct work_struct *ldv_func_arg1 ) ; bool ldv_cancel_work_sync_73(struct work_struct *ldv_func_arg1 ) ; bool ldv_cancel_work_sync_74(struct work_struct *ldv_func_arg1 ) ; extern bool cancel_delayed_work_sync(struct delayed_work * ) ; bool ldv_cancel_delayed_work_sync_71(struct delayed_work *ldv_func_arg1 ) ; bool ldv_cancel_delayed_work_sync_72(struct delayed_work *ldv_func_arg1 ) ; bool ldv_cancel_delayed_work_sync_75(struct delayed_work *ldv_func_arg1 ) ; extern long schedule_timeout(long ) ; void ldv_initialize_ieee80211_ops_38(void) ; void disable_work_7(struct work_struct *work ) ; __inline static u16 skb_get_queue_mapping(struct sk_buff const *skb ) { { return ((u16 )skb->queue_mapping); } } extern void synchronize_irq(unsigned int ) ; extern void disable_irq(unsigned int ) ; extern void enable_irq(unsigned int ) ; __inline static void tasklet_unlock_wait___0(struct tasklet_struct *t ) { int tmp ; { goto ldv_38306; ldv_38305: __asm__ volatile ("": : : "memory"); ldv_38306: tmp = constant_test_bit(1L, (unsigned long const volatile *)(& t->state)); if (tmp != 0) { goto ldv_38305; } else { } return; } } extern void __tasklet_schedule(struct tasklet_struct * ) ; __inline static void tasklet_schedule(struct tasklet_struct *t ) { int tmp ; { tmp = test_and_set_bit(0L, (unsigned long volatile *)(& t->state)); if (tmp == 0) { __tasklet_schedule(t); } else { } return; } } __inline static void tasklet_disable___0(struct tasklet_struct *t ) { { tasklet_disable_nosync(t); tasklet_unlock_wait___0(t); __asm__ volatile ("mfence": : : "memory"); return; } } extern void tasklet_kill(struct tasklet_struct * ) ; __inline static void eth_broadcast_addr(u8 *addr ) { { memset((void *)addr, 255, 6UL); return; } } __inline static void eth_zero_addr(u8 *addr ) { { memset((void *)addr, 0, 6UL); return; } } __inline static void ether_addr_copy(u8 *dst , u8 const *src ) { { *((u32 *)dst) = *((u32 const *)src); *((u16 *)dst + 4U) = *((u16 const *)src + 4U); return; } } __inline static int ieee80211_has_pm(__le16 fc ) { { return (((int )fc & 4096) != 0); } } __inline static int ieee80211_is_data(__le16 fc ) { { return (((int )fc & 12) == 8); } } __inline static int ieee80211_is_pspoll(__le16 fc ) { { return (((int )fc & 252) == 164); } } __inline static int ieee80211_is_nullfunc(__le16 fc ) { { return (((int )fc & 252) == 72); } } extern void ieee80211_free_txskb(struct ieee80211_hw * , struct sk_buff * ) ; extern void ieee80211_stop_queues(struct ieee80211_hw * ) ; 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 ) ; extern void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_vif * , u8 const * , u16 ) ; extern void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_vif * , u8 const * , u16 ) ; extern void ath_hw_setbssidmask(struct ath_common * ) ; extern void ath_key_delete(struct ath_common * , struct ieee80211_key_conf * ) ; extern int ath_key_config(struct ath_common * , struct ieee80211_vif * , struct ieee80211_sta * , struct ieee80211_key_conf * ) ; extern void ath_hw_cycle_counters_update(struct ath_common * ) ; extern bool ath9k_hw_updatetxtriglevel(struct ath_hw * , bool ) ; extern bool ath9k_hw_setrxabort(struct ath_hw * , bool ) ; extern bool ath9k_hw_stopdmarecv(struct ath_hw * , bool * ) ; extern void ath9k_hw_set_tx_filter(struct ath_hw * , u8 , bool ) ; extern bool ath9k_hw_intrpend(struct ath_hw * ) ; extern void ath9k_hw_kill_interrupts(struct ath_hw * ) ; extern void ath_dynack_reset(struct ath_hw * ) ; extern void ath_dynack_node_init(struct ath_hw * , struct ath_node * ) ; extern void ath_dynack_node_deinit(struct ath_hw * , struct ath_node * ) ; extern int ath9k_hw_reset(struct ath_hw * , struct ath9k_channel * , struct ath9k_hw_cal_data * , bool ) ; extern void ath9k_hw_cfg_gpio_input(struct ath_hw * , u32 ) ; extern void ath9k_hw_setrxfilter(struct ath_hw * , u32 ) ; extern bool ath9k_hw_phy_disable(struct ath_hw * ) ; extern void ath9k_hw_setopmode(struct ath_hw * ) ; extern void ath9k_hw_write_associd(struct ath_hw * ) ; extern void ath9k_hw_settsf64(struct ath_hw * , u64 ) ; extern u32 ath9k_hw_get_tsf_offset(struct timespec * , struct timespec * ) ; extern void ath9k_hw_set_tsfadjust(struct ath_hw * , bool ) ; extern bool ath9k_hw_check_alive(struct ath_hw * ) ; extern bool ath9k_hw_setpower(struct ath_hw * , enum ath9k_power_mode ) ; extern void ath_gen_timer_isr(struct ath_hw * ) ; extern bool ar9003_hw_bb_watchdog_check(struct ath_hw * ) ; extern void ar9003_hw_bb_watchdog_dbg_info(struct ath_hw * ) ; __inline static bool ath9k_hw_btcoex_is_enabled(struct ath_hw *ah ) { { return (ah->btcoex_hw.enabled); } } __inline static void ath9k_hw_configpcipowersave(struct ath_hw *ah , bool power_off ) { struct ath_hw_ops *tmp ; { if (! ah->aspm_enabled) { return; } else { } tmp = ath9k_hw_ops(ah); (*(tmp->config_pci_powersave))(ah, (int )power_off); return; } } __inline static bool ath9k_hw_getisr(struct ath_hw *ah , enum ath9k_int *masked , u32 *sync_cause_p ) { struct ath_hw_ops *tmp ; bool tmp___0 ; { tmp = ath9k_hw_ops(ah); tmp___0 = (*(tmp->get_isr))(ah, masked, sync_cause_p); return (tmp___0); } } __inline static int ath9k_hw_txprocdesc(struct ath_hw *ah , void *ds , struct ath_tx_status *ts ) { struct ath_hw_ops *tmp ; int tmp___0 ; { tmp = ath9k_hw_ops(ah); tmp___0 = (*(tmp->proc_txdesc))(ah, ds, ts); return (tmp___0); } } void ath_debug_stat_interrupt(struct ath_softc *sc , enum ath9k_int status ) ; int ath9k_get_et_sset_count(struct ieee80211_hw *hw , struct ieee80211_vif *vif , int sset ) ; void ath9k_get_et_stats(struct ieee80211_hw *hw , struct ieee80211_vif *vif , struct ethtool_stats *stats , u64 *data ) ; void ath9k_get_et_strings(struct ieee80211_hw *hw , struct ieee80211_vif *vif , u32 sset , u8 *data ) ; void ath9k_sta_add_debugfs(struct ieee80211_hw *hw , struct ieee80211_vif *vif , struct ieee80211_sta *sta , struct dentry *dir ) ; void ath9k_debug_sync_cause(struct ath_softc *sc , u32 sync_cause ) ; void ath_mci_enable(struct ath_softc *sc ) ; void ath9k_mci_update_wlan_channels(struct ath_softc *sc , bool allow_all ) ; void ath9k_mci_set_txpower(struct ath_softc *sc , bool setchannel , bool concur_tx ) ; struct ieee80211_ops ath9k_ops ; void ath_chanctx_set_channel(struct ath_softc *sc , struct ath_chanctx *ctx , struct cfg80211_chan_def *chandef ) ; __inline static struct ath_chanctx *ath_chanctx_get(struct ieee80211_chanctx_conf *ctx ) { struct ath_chanctx **ptr ; { ptr = (struct ath_chanctx **)(& ctx->drv_priv); return (*ptr); } } void ath9k_fill_chanctx_ops(void) ; void ath9k_deinit_channel_context(struct ath_softc *sc ) ; void ath9k_p2p_remove_vif(struct ath_softc *sc , struct ieee80211_vif *vif ) ; void ath9k_p2p_bss_info_changed(struct ath_softc *sc , struct ieee80211_vif *vif ) ; void ath9k_p2p_ps_timer(void *priv ) ; void ath_chanctx_check_active(struct ath_softc *sc , struct ath_chanctx *ctx ) ; void ath_chanctx_set_next(struct ath_softc *sc , bool force ) ; void ath_offchannel_next(struct ath_softc *sc ) ; void ath_scan_complete(struct ath_softc *sc , bool abort ) ; void ath_roc_complete(struct ath_softc *sc , bool abort ) ; struct ath_chanctx *ath_is_go_chanctx_present(struct ath_softc *sc ) ; void ath_startrecv(struct ath_softc *sc ) ; bool ath_stoprecv(struct ath_softc *sc ) ; u32 ath_calcrxfilter(struct ath_softc *sc ) ; int ath_rx_tasklet(struct ath_softc *sc , int flush , bool hp ) ; bool ath_drain_all_txq(struct ath_softc *sc ) ; void ath_tx_node_init(struct ath_softc *sc , struct ath_node *an ) ; void ath_tx_node_cleanup(struct ath_softc *sc , struct ath_node *an ) ; void ath_txq_schedule_all(struct ath_softc *sc ) ; int ath_txq_update(struct ath_softc *sc , int qnum , struct ath9k_tx_queue_info *qinfo ) ; void ath_update_max_aggr_framelen(struct ath_softc *sc , int queue , int txop ) ; int ath_tx_start(struct ieee80211_hw *hw , struct sk_buff *skb , struct ath_tx_control *txctl ) ; void ath_tx_tasklet(struct ath_softc *sc ) ; void ath_tx_edma_tasklet(struct ath_softc *sc ) ; int ath_tx_aggr_start(struct ath_softc *sc , struct ieee80211_sta *sta , u16 tid , u16 *ssn ) ; void ath_tx_aggr_stop(struct ath_softc *sc , struct ieee80211_sta *sta , u16 tid ) ; void ath_tx_aggr_resume(struct ath_softc *sc , struct ieee80211_sta *sta , u16 tidno ) ; void ath_tx_aggr_wakeup(struct ath_softc *sc , struct ath_node *an ) ; void ath_tx_aggr_sleep(struct ieee80211_sta *sta , struct ath_softc *sc , struct ath_node *an ) ; void ath9k_release_buffered_frames(struct ieee80211_hw *hw , struct ieee80211_sta *sta , u16 tids , int nframes , enum ieee80211_frame_release_type reason , bool more_data ) ; void ath9k_calculate_iter_data(struct ath_softc *sc , struct ath_chanctx *ctx , struct ath9k_vif_iter_data *iter_data ) ; void ath9k_calculate_summary_state(struct ath_softc *sc , struct ath_chanctx *ctx ) ; void ath9k_set_txpower(struct ath_softc *sc , struct ieee80211_vif *vif ) ; void ath_start_ani(struct ath_softc *sc ) ; void ath_stop_ani(struct ath_softc *sc ) ; void ath_check_ani(struct ath_softc *sc ) ; int ath_update_survey_stats(struct ath_softc *sc ) ; void __ath9k_flush(struct ieee80211_hw *hw , u32 queues , bool drop , bool sw_pending , bool timeout_override ) ; int ath9k_suspend(struct ieee80211_hw *hw , struct cfg80211_wowlan *wowlan ) ; int ath9k_resume(struct ieee80211_hw *hw ) ; void ath9k_set_wakeup(struct ieee80211_hw *hw , bool enabled ) ; u8 ath9k_parse_mpdudensity(u8 mpdudensity ) ; irqreturn_t ath_isr(int irq , void *dev ) ; int ath_reset(struct ath_softc *sc , struct ath9k_channel *hchan ) ; void ath_cancel_work(struct ath_softc *sc ) ; void ath_restart_work(struct ath_softc *sc ) ; u8 ath9k_parse_mpdudensity(u8 mpdudensity ) { { switch ((int )mpdudensity) { case 0: ; return (0U); case 1: ; case 2: ; case 3: ; return (1U); case 4: ; return (2U); case 5: ; return (4U); case 6: ; return (8U); case 7: ; return (16U); default: ; return (0U); } } } static bool ath9k_has_pending_frames(struct ath_softc *sc , struct ath_txq *txq , bool sw_pending ) { bool pending ; struct list_head *list ; int tmp ; { pending = 0; spin_lock_bh(& txq->axq_lock); if (txq->axq_depth != 0U) { pending = 1; goto out; } else { } if (! sw_pending) { goto out; } else { } if (txq->mac80211_qnum >= 0) { list = (struct list_head *)(& (sc->cur_chan)->acq) + (unsigned long )txq->mac80211_qnum; tmp = list_empty((struct list_head const *)list); if (tmp == 0) { pending = 1; } else { } } else { } out: spin_unlock_bh(& txq->axq_lock); return (pending); } } static bool ath9k_setpower(struct ath_softc *sc , enum ath9k_power_mode mode ) { unsigned long flags ; bool ret ; raw_spinlock_t *tmp ; { tmp = spinlock_check(& sc->sc_pm_lock); flags = _raw_spin_lock_irqsave(tmp); ret = ath9k_hw_setpower(sc->sc_ah, mode); spin_unlock_irqrestore(& sc->sc_pm_lock, flags); return (ret); } } void ath_ps_full_sleep(unsigned long data ) { struct ath_softc *sc ; struct ath_common *common ; struct ath_common *tmp ; bool reset ; { sc = (struct ath_softc *)data; tmp = ath9k_hw_common(sc->sc_ah); common = tmp; spin_lock(& common->cc_lock); ath_hw_cycle_counters_update(common); spin_unlock(& common->cc_lock); ath9k_hw_setrxabort(sc->sc_ah, 1); ath9k_hw_stopdmarecv(sc->sc_ah, & reset); ath9k_hw_setpower(sc->sc_ah, 1); return; } } void ath9k_ps_wakeup(struct ath_softc *sc ) { struct ath_common *common ; struct ath_common *tmp ; unsigned long flags ; enum ath9k_power_mode power_mode ; raw_spinlock_t *tmp___0 ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; tmp___0 = spinlock_check(& sc->sc_pm_lock); flags = _raw_spin_lock_irqsave(tmp___0); sc->ps_usecount = sc->ps_usecount + 1UL; if (sc->ps_usecount != 1UL) { goto unlock; } else { } ldv_del_timer_sync_68(& sc->sleep_timer); power_mode = (sc->sc_ah)->power_mode; ath9k_hw_setpower(sc->sc_ah, 0); if ((unsigned int )power_mode != 0U) { spin_lock(& common->cc_lock); ath_hw_cycle_counters_update(common); memset((void *)(& common->cc_survey), 0, 16UL); memset((void *)(& common->cc_ani), 0, 16UL); spin_unlock(& common->cc_lock); } else { } unlock: spin_unlock_irqrestore(& sc->sc_pm_lock, flags); return; } } void ath9k_ps_restore(struct ath_softc *sc ) { struct ath_common *common ; struct ath_common *tmp ; enum ath9k_power_mode mode ; unsigned long flags ; raw_spinlock_t *tmp___0 ; bool tmp___1 ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; tmp___0 = spinlock_check(& sc->sc_pm_lock); flags = _raw_spin_lock_irqsave(tmp___0); sc->ps_usecount = sc->ps_usecount - 1UL; if (sc->ps_usecount != 0UL) { goto unlock; } else { } if ((int )sc->ps_idle) { ldv_mod_timer_69(& sc->sleep_timer, (unsigned long )jiffies + 25UL); goto unlock; } else { } if ((int )sc->ps_enabled && ((unsigned long )sc->ps_flags & 47UL) == 0UL) { mode = 2; tmp___1 = ath9k_hw_btcoex_is_enabled(sc->sc_ah); if ((int )tmp___1) { ath9k_btcoex_stop_gen_timer(sc); } else { } } else { goto unlock; } spin_lock(& common->cc_lock); ath_hw_cycle_counters_update(common); spin_unlock(& common->cc_lock); ath9k_hw_setpower(sc->sc_ah, mode); unlock: spin_unlock_irqrestore(& sc->sc_pm_lock, flags); return; } } static void __ath_cancel_work(struct ath_softc *sc ) { bool tmp ; { ldv_cancel_work_sync_70(& sc->paprd_work); ldv_cancel_delayed_work_sync_71(& sc->tx_complete_work); ldv_cancel_delayed_work_sync_72(& sc->hw_pll_work); tmp = ath9k_hw_mci_is_enabled(sc->sc_ah); if ((int )tmp) { ldv_cancel_work_sync_73(& sc->mci_work); } else { } return; } } void ath_cancel_work(struct ath_softc *sc ) { { __ath_cancel_work(sc); ldv_cancel_work_sync_74(& sc->hw_reset_work); return; } } void ath_restart_work(struct ath_softc *sc ) { unsigned long tmp ; { ieee80211_queue_delayed_work(sc->hw, & sc->tx_complete_work, 0UL); if ((sc->sc_ah)->hw_version.macVersion == 768U || (sc->sc_ah)->hw_version.macVersion == 512U) { tmp = msecs_to_jiffies(100U); ieee80211_queue_delayed_work(sc->hw, & sc->hw_pll_work, tmp); } else { } ath_start_ani(sc); return; } } static bool ath_prepare_reset(struct ath_softc *sc ) { struct ath_hw *ah ; bool ret ; bool tmp ; bool tmp___0 ; bool tmp___1 ; bool tmp___2 ; { ah = sc->sc_ah; ret = 1; ieee80211_stop_queues(sc->hw); ath_stop_ani(sc); ath9k_hw_disable_interrupts(ah); if (ah->hw_version.macVersion > 447U) { tmp = ath_stoprecv(sc); ret = ((int )ret & (int )tmp) != 0; tmp___0 = ath_drain_all_txq(sc); ret = ((int )ret & (int )tmp___0) != 0; } else { tmp___1 = ath_drain_all_txq(sc); ret = ((int )ret & (int )tmp___1) != 0; tmp___2 = ath_stoprecv(sc); ret = ((int )ret & (int )tmp___2) != 0; } return (ret); } } static bool ath_complete_reset(struct ath_softc *sc , bool start ) { struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; unsigned long flags ; u32 offset ; int tmp___0 ; raw_spinlock_t *tmp___1 ; int tmp___2 ; { ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; ath9k_calculate_summary_state(sc, sc->cur_chan); ath_startrecv(sc); ath9k_cmn_update_txpow(ah, (int )(sc->cur_chan)->cur_txpower, (int )(sc->cur_chan)->txpower, & (sc->cur_chan)->cur_txpower); clear_bit(4L, (unsigned long volatile *)(& common->op_flags)); if (! (sc->cur_chan)->offchannel && (int )start) { if ((sc->cur_chan)->tsf_val != 0ULL) { offset = ath9k_hw_get_tsf_offset(& (sc->cur_chan)->tsf_ts, (struct timespec *)0); ath9k_hw_settsf64(ah, (sc->cur_chan)->tsf_val + (u64 )offset); } else { } tmp___0 = constant_test_bit(1L, (unsigned long const volatile *)(& common->op_flags)); if (tmp___0 == 0) { goto work; } else { } if ((unsigned int )ah->opmode == 2U) { tmp___2 = constant_test_bit(3L, (unsigned long const volatile *)(& common->op_flags)); if (tmp___2 != 0) { tmp___1 = spinlock_check(& sc->sc_pm_lock); flags = _raw_spin_lock_irqsave(tmp___1); sc->ps_flags = (u16 )((unsigned int )sc->ps_flags | 17U); spin_unlock_irqrestore(& sc->sc_pm_lock, flags); } else { ath9k_set_beacon(sc); } } else { ath9k_set_beacon(sc); } work: ath_restart_work(sc); ath_txq_schedule_all(sc); } else { } sc->gtt_cnt = 0U; ath9k_hw_set_interrupts(ah); ath9k_hw_enable_interrupts(ah); ieee80211_wake_queues(sc->hw); ath9k_p2p_ps_timer((void *)sc); return (1); } } static int ath_reset_internal(struct ath_softc *sc , struct ath9k_channel *hchan ) { struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; struct ath9k_hw_cal_data *caldata ; bool fastcc ; int r ; bool tmp___0 ; int tmp___1 ; bool tmp___2 ; bool tmp___3 ; bool tmp___4 ; int tmp___5 ; { ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; caldata = (struct ath9k_hw_cal_data *)0; fastcc = 1; __ath_cancel_work(sc); disable_irq((unsigned int )sc->irq); tasklet_disable___0(& sc->intr_tq); tasklet_disable___0(& sc->bcon_tasklet); spin_lock_bh(& sc->sc_pcu_lock); if (! (sc->cur_chan)->offchannel) { fastcc = 0; caldata = & (sc->cur_chan)->caldata; } else { } if ((unsigned long )hchan == (unsigned long )((struct ath9k_channel *)0)) { fastcc = 0; hchan = ah->curchan; } else { } tmp___0 = ath_prepare_reset(sc); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { fastcc = 0; } else { } tmp___2 = ath9k_is_chanctx_enabled(); if ((int )tmp___2) { fastcc = 0; } else { } spin_lock_bh(& sc->chan_lock); sc->cur_chandef = (sc->cur_chan)->chandef; spin_unlock_bh(& sc->chan_lock); if ((common->debug_mask & 512) != 0) { ath_printk("\017", (struct ath_common const *)common, "Reset to %u MHz, HT40: %d fastcc: %d\n", (int )hchan->channel, ((unsigned long )hchan->channelFlags & 48UL) != 0UL, (int )fastcc); } else { } r = ath9k_hw_reset(ah, hchan, caldata, (int )fastcc); if (r != 0) { ath_printk("\v", (struct ath_common const *)common, "Unable to reset channel, reset status %d\n", r); ath9k_hw_enable_interrupts(ah); ath9k_queue_reset(sc, 0); goto out; } else { } tmp___3 = ath9k_hw_mci_is_enabled(sc->sc_ah); if ((int )tmp___3 && (int )(sc->cur_chan)->offchannel) { ath9k_mci_set_txpower(sc, 1, 0); } else { } tmp___4 = ath_complete_reset(sc, 1); if (tmp___4) { tmp___5 = 0; } else { tmp___5 = 1; } if (tmp___5) { r = -5; } else { } out: enable_irq((unsigned int )sc->irq); spin_unlock_bh(& sc->sc_pcu_lock); tasklet_enable(& sc->bcon_tasklet); tasklet_enable(& sc->intr_tq); return (r); } } static void ath_node_attach(struct ath_softc *sc , struct ieee80211_sta *sta , struct ieee80211_vif *vif ) { struct ath_node *an ; { an = (struct ath_node *)(& sta->drv_priv); an->sc = sc; an->sta = sta; an->vif = vif; memset((void *)(& an->key_idx), 0, 4UL); ath_tx_node_init(sc, an); ath_dynack_node_init(sc->sc_ah, an); return; } } static void ath_node_detach(struct ath_softc *sc , struct ieee80211_sta *sta ) { struct ath_node *an ; { an = (struct ath_node *)(& sta->drv_priv); ath_tx_node_cleanup(sc, an); ath_dynack_node_deinit(sc->sc_ah, an); return; } } void ath9k_tasklet(unsigned long data ) { struct ath_softc *sc ; struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; enum ath_reset_type type ; unsigned long flags ; u32 status ; u32 rxmask ; bool tmp___0 ; bool tmp___1 ; int tmp___2 ; raw_spinlock_t *tmp___3 ; { sc = (struct ath_softc *)data; ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; status = sc->intrstatus; ath9k_ps_wakeup(sc); spin_lock(& sc->sc_pcu_lock); if ((status & 1073741824U) != 0U) { type = 2; ath9k_queue_reset(sc, type); atomic_inc(& ah->intr_ref_cnt); if (common->debug_mask & 1) { ath_printk("\017", (struct ath_common const *)common, "FATAL: Skipping interrupts\n"); } else { } goto out; } else { } if ((int )ah->config.hw_hang_checks & 1 && (status & 1024U) != 0U) { spin_lock(& common->cc_lock); ath_hw_cycle_counters_update(common); ar9003_hw_bb_watchdog_dbg_info(ah); spin_unlock(& common->cc_lock); tmp___0 = ar9003_hw_bb_watchdog_check(ah); if ((int )tmp___0) { type = 1; ath9k_queue_reset(sc, type); atomic_inc(& ah->intr_ref_cnt); if (common->debug_mask & 1) { ath_printk("\017", (struct ath_common const *)common, "BB_WATCHDOG: Skipping interrupts\n"); } else { } goto out; } else { } } else { } if ((status & 536870912U) != 0U) { sc->gtt_cnt = (u8 )((int )sc->gtt_cnt + 1); if ((unsigned int )sc->gtt_cnt > 4U) { tmp___1 = ath9k_hw_check_alive(ah); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { type = 4; ath9k_queue_reset(sc, type); atomic_inc(& ah->intr_ref_cnt); if (common->debug_mask & 1) { ath_printk("\017", (struct ath_common const *)common, "GTT: Skipping interrupts\n"); } else { } goto out; } else { } } else { } } else { } tmp___3 = spinlock_check(& sc->sc_pm_lock); flags = _raw_spin_lock_irqsave(tmp___3); if ((status & 67108864U) != 0U && (int )sc->ps_enabled) { if ((common->debug_mask & 2048) != 0) { ath_printk("\017", (struct ath_common const *)common, "TSFOOR - Sync with next Beacon\n"); } else { } sc->ps_flags = (u16 )((unsigned int )sc->ps_flags | 17U); } else { } spin_unlock_irqrestore(& sc->sc_pm_lock, flags); if ((ah->caps.hw_caps & 16U) != 0U) { rxmask = 51U; } else { rxmask = 49U; } if ((status & rxmask) != 0U) { if ((ah->caps.hw_caps & 16U) != 0U && (int )status & 1) { ath_rx_tasklet(sc, 0, 1); } else { } ath_rx_tasklet(sc, 0, 0); } else { } if ((status & 64U) != 0U) { if ((ah->caps.hw_caps & 16U) != 0U) { sc->gtt_cnt = 0U; ath_tx_edma_tasklet(sc); } else { ath_tx_tasklet(sc); } __wake_up(& sc->tx_wait, 3U, 1, (void *)0); } else { } if ((status & 134217728U) != 0U) { ath_gen_timer_isr(sc->sc_ah); } else { } ath9k_btcoex_handle_interrupt(sc, status); ath9k_hw_enable_interrupts(ah); out: spin_unlock(& sc->sc_pcu_lock); ath9k_ps_restore(sc); return; } } irqreturn_t ath_isr(int irq , void *dev ) { struct ath_softc *sc ; struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; enum ath9k_int status ; u32 sync_cause ; bool sched ; int tmp___0 ; bool tmp___1 ; int tmp___2 ; int tmp___3 ; bool __warned ; int __ret_warn_once ; int __ret_warn_on ; long tmp___4 ; long tmp___5 ; long tmp___6 ; long tmp___7 ; { sc = (struct ath_softc *)dev; ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; sync_cause = 0U; sched = 0; if ((unsigned long )ah == (unsigned long )((struct ath_hw *)0)) { return (0); } else { tmp___0 = constant_test_bit(0L, (unsigned long const volatile *)(& common->op_flags)); if (tmp___0 != 0) { return (0); } else { } } tmp___1 = ath9k_hw_intrpend(ah); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { return (0); } else { } ath9k_hw_getisr(ah, & status, & sync_cause); ath9k_debug_sync_cause(sc, sync_cause); status = (enum ath9k_int )((unsigned int )ah->imask & (unsigned int )status); tmp___3 = constant_test_bit(4L, (unsigned long const volatile *)(& common->op_flags)); if (tmp___3 != 0) { return (1); } else { } if ((unsigned int )status == 0U) { return (0); } else { } sc->intrstatus = (u32 )status; if (((unsigned int )status & 2080638579U) != 0U) { sched = 1; } else { } if (((unsigned int )status & 1073741824U) != 0U) { goto chip_reset; } else { } if ((int )ah->config.hw_hang_checks & 1 && ((unsigned int )status & 1024U) != 0U) { goto chip_reset; } else { } if (((unsigned int )status & 65536U) != 0U) { tasklet_schedule(& sc->bcon_tasklet); } else { } if (((unsigned int )status & 2048U) != 0U) { ath9k_hw_updatetxtriglevel(ah, 1); } else { } if (((unsigned int )status & 16U) != 0U) { ah->imask = (enum ath9k_int )((unsigned int )ah->imask & 4294967247U); ath9k_hw_set_interrupts(ah); } else { } if ((ah->caps.hw_caps & 4U) == 0U) { if (((unsigned int )status & 256U) != 0U) { __ret_warn_once = (int )sc->ps_idle; tmp___6 = ldv__builtin_expect(__ret_warn_once != 0, 0L); if (tmp___6 != 0L) { __ret_warn_on = ! __warned; tmp___4 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___4 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/12119/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/ath/ath9k/main.c", 573); } else { } tmp___5 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___5 != 0L) { __warned = 1; } else { } } else { } tmp___7 = ldv__builtin_expect(__ret_warn_once != 0, 0L); if (tmp___7 != 0L) { goto chip_reset; } else { } ath9k_setpower(sc, 0); spin_lock(& sc->sc_pm_lock); ath9k_hw_setrxabort(sc->sc_ah, 0); sc->ps_flags = (u16 )((unsigned int )sc->ps_flags | 1U); spin_unlock(& sc->sc_pm_lock); } else { } } else { } chip_reset: ath_debug_stat_interrupt(sc, status); if ((int )sched) { ath9k_hw_disable_interrupts(ah); tasklet_schedule(& sc->intr_tq); } else { } return (1); } } int ath_reset(struct ath_softc *sc , struct ath9k_channel *hchan ) { struct ath_common *common ; struct ath_common *tmp ; int r ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; ath9k_hw_kill_interrupts(sc->sc_ah); set_bit(4L, (unsigned long volatile *)(& common->op_flags)); ath9k_ps_wakeup(sc); r = ath_reset_internal(sc, hchan); ath9k_ps_restore(sc); return (r); } } void ath9k_queue_reset(struct ath_softc *sc , enum ath_reset_type type ) { struct ath_common *common ; struct ath_common *tmp ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; sc->debug.stats.reset[(unsigned int )type] = sc->debug.stats.reset[(unsigned int )type] + 1U; ath9k_hw_kill_interrupts(sc->sc_ah); set_bit(4L, (unsigned long volatile *)(& common->op_flags)); ieee80211_queue_work(sc->hw, & sc->hw_reset_work); return; } } void ath_reset_work(struct work_struct *work ) { struct ath_softc *sc ; struct work_struct const *__mptr ; { __mptr = (struct work_struct const *)work; sc = (struct ath_softc *)__mptr + 0xfffffffffffff438UL; ath9k_ps_wakeup(sc); ath_reset_internal(sc, (struct ath9k_channel *)0); ath9k_ps_restore(sc); return; } } static int ath9k_start(struct ieee80211_hw *hw ) { struct ath_softc *sc ; struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; struct ieee80211_channel *curchan ; struct ath_chanctx *ctx ; struct ath9k_channel *init_channel ; int r ; bool tmp___0 ; int tmp___1 ; { sc = (struct ath_softc *)hw->priv; ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; curchan = (sc->cur_chan)->chandef.chan; ctx = sc->cur_chan; if ((common->debug_mask & 512) != 0) { ath_printk("\017", (struct ath_common const *)common, "Starting driver with initial channel: %d MHz\n", (int )curchan->center_freq); } else { } ath9k_ps_wakeup(sc); mutex_lock_nested(& sc->mutex, 0U); init_channel = ath9k_cmn_get_channel(hw, ah, & ctx->chandef); sc->cur_chandef = hw->conf.chandef; ath9k_hw_configpcipowersave(ah, 0); spin_lock_bh(& sc->sc_pcu_lock); atomic_set(& ah->intr_ref_cnt, -1); r = ath9k_hw_reset(ah, init_channel, ah->caldata, 0); if (r != 0) { ath_printk("\v", (struct ath_common const *)common, "Unable to reset hardware; reset status %d (freq %u MHz)\n", r, (int )curchan->center_freq); ah->reset_power_on = 0; } else { } ah->imask = 3221225584L; if ((ah->caps.hw_caps & 16U) != 0U) { ah->imask = (enum ath9k_int )((unsigned int )ah->imask | 3U); } else { ah->imask = (enum ath9k_int )((unsigned int )ah->imask | 1U); } if ((int )ah->config.hw_hang_checks & 1) { ah->imask = (enum ath9k_int )((unsigned int )ah->imask | 1024U); } else { } if (ah->hw_version.macVersion > 447U) { ah->imask = (enum ath9k_int )((unsigned int )ah->imask | 536870912U); } else { } if ((int )ah->caps.hw_caps & 1) { ah->imask = (enum ath9k_int )((unsigned int )ah->imask | 268435456U); } else { } ath_mci_enable(sc); clear_bit(0L, (unsigned long volatile *)(& common->op_flags)); (sc->sc_ah)->is_monitoring = 0; tmp___0 = ath_complete_reset(sc, 0); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { ah->reset_power_on = 0; } else { } if (ah->led_pin >= 0) { ath9k_hw_cfg_output(ah, (u32 )ah->led_pin, 0U); ath9k_hw_set_gpio(ah, (u32 )ah->led_pin, (u32 )ah->config.led_active_high); } else { } ath9k_cmn_init_crypto(sc->sc_ah); ath9k_hw_reset_tsf(ah); spin_unlock_bh(& sc->sc_pcu_lock); mutex_unlock(& sc->mutex); ath9k_ps_restore(sc); return (0); } } static void ath9k_tx(struct ieee80211_hw *hw , struct ieee80211_tx_control *control , struct sk_buff *skb ) { struct ath_softc *sc ; struct ath_common *common ; struct ath_common *tmp ; struct ath_tx_control txctl ; struct ieee80211_hdr *hdr ; unsigned long flags ; int tmp___0 ; int tmp___1 ; int tmp___2 ; raw_spinlock_t *tmp___3 ; int tmp___4 ; long tmp___5 ; long tmp___6 ; u16 tmp___7 ; int tmp___8 ; { sc = (struct ath_softc *)hw->priv; tmp = ath9k_hw_common(sc->sc_ah); common = tmp; hdr = (struct ieee80211_hdr *)skb->data; if ((int )sc->ps_enabled) { tmp___0 = ieee80211_is_data((int )hdr->frame_control); if (tmp___0 != 0) { tmp___1 = ieee80211_is_nullfunc((int )hdr->frame_control); if (tmp___1 == 0) { tmp___2 = ieee80211_has_pm((int )hdr->frame_control); if (tmp___2 == 0) { if ((common->debug_mask & 2048) != 0) { ath_printk("\017", (struct ath_common const *)common, "Add PM=1 for a TX frame while in PS mode\n"); } else { } hdr->frame_control = (__le16 )((unsigned int )hdr->frame_control | 4096U); } else { } } else { } } else { } } else { } tmp___5 = ldv__builtin_expect((unsigned int )(sc->sc_ah)->power_mode == 2U, 0L); if (tmp___5 != 0L) { ath9k_ps_wakeup(sc); tmp___3 = spinlock_check(& sc->sc_pm_lock); flags = _raw_spin_lock_irqsave(tmp___3); if (((sc->sc_ah)->caps.hw_caps & 4U) == 0U) { ath9k_hw_setrxabort(sc->sc_ah, 0); } else { } tmp___4 = ieee80211_is_pspoll((int )hdr->frame_control); if (tmp___4 != 0) { if ((common->debug_mask & 2048) != 0) { ath_printk("\017", (struct ath_common const *)common, "Sending PS-Poll to pick a buffered frame\n"); } else { } sc->ps_flags = (u16 )((unsigned int )sc->ps_flags | 4U); } else { if ((common->debug_mask & 2048) != 0) { ath_printk("\017", (struct ath_common const *)common, "Wake up to complete TX\n"); } else { } sc->ps_flags = (u16 )((unsigned int )sc->ps_flags | 8U); } spin_unlock_irqrestore(& sc->sc_pm_lock, flags); ath9k_ps_restore(sc); } else { } tmp___6 = ldv__builtin_expect((unsigned int )(sc->sc_ah)->power_mode == 1U, 0L); if (tmp___6 != 0L) { ath_printk("\v", (struct ath_common const *)common, "TX while HW is in FULL_SLEEP mode\n"); goto exit; } else { } memset((void *)(& txctl), 0, 32UL); tmp___7 = skb_get_queue_mapping((struct sk_buff const *)skb); txctl.txq = sc->tx.txq_map[(int )tmp___7]; txctl.sta = control->sta; if ((common->debug_mask & 128) != 0) { ath_printk("\017", (struct ath_common const *)common, "transmitting packet, skb: %p\n", skb); } else { } tmp___8 = ath_tx_start(hw, skb, & txctl); if (tmp___8 != 0) { if ((common->debug_mask & 128) != 0) { ath_printk("\017", (struct ath_common const *)common, "TX failed\n"); } else { } sc->debug.stats.txstats[(txctl.txq)->axq_qnum].txfailed = sc->debug.stats.txstats[(txctl.txq)->axq_qnum].txfailed + 1U; goto exit; } else { } return; exit: ieee80211_free_txskb(hw, skb); return; } } static void ath9k_stop(struct ieee80211_hw *hw ) { struct ath_softc *sc ; struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; bool prev_idle ; int tmp___0 ; { sc = (struct ath_softc *)hw->priv; ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; ath9k_deinit_channel_context(sc); mutex_lock_nested(& sc->mutex, 0U); ath_cancel_work(sc); tmp___0 = constant_test_bit(0L, (unsigned long const volatile *)(& common->op_flags)); if (tmp___0 != 0) { if (common->debug_mask != 0) { ath_printk("\017", (struct ath_common const *)common, "Device not present\n"); } else { } mutex_unlock(& sc->mutex); return; } else { } ath9k_ps_wakeup(sc); spin_lock_bh(& sc->sc_pcu_lock); ah->imask = (enum ath9k_int )((unsigned int )ah->imask & 2147483647U); ath9k_hw_disable_interrupts(ah); spin_unlock_bh(& sc->sc_pcu_lock); synchronize_irq((unsigned int )sc->irq); tasklet_kill(& sc->intr_tq); tasklet_kill(& sc->bcon_tasklet); prev_idle = sc->ps_idle; sc->ps_idle = 1; spin_lock_bh(& sc->sc_pcu_lock); if (ah->led_pin >= 0) { ath9k_hw_set_gpio(ah, (u32 )ah->led_pin, (int )ah->config.led_active_high ? 0U : 1U); ath9k_hw_cfg_gpio_input(ah, (u32 )ah->led_pin); } else { } ath_prepare_reset(sc); if ((unsigned long )sc->rx.frag != (unsigned long )((struct sk_buff *)0)) { dev_kfree_skb_any(sc->rx.frag); sc->rx.frag = (struct sk_buff *)0; } else { } if ((unsigned long )ah->curchan == (unsigned long )((struct ath9k_channel *)0)) { ah->curchan = ath9k_cmn_get_channel(hw, ah, & (sc->cur_chan)->chandef); } else { } ath9k_hw_reset(ah, ah->curchan, ah->caldata, 0); set_bit(0L, (unsigned long volatile *)(& common->op_flags)); ath9k_hw_phy_disable(ah); ath9k_hw_configpcipowersave(ah, 1); spin_unlock_bh(& sc->sc_pcu_lock); ath9k_ps_restore(sc); sc->ps_idle = prev_idle; mutex_unlock(& sc->mutex); if ((common->debug_mask & 512) != 0) { ath_printk("\017", (struct ath_common const *)common, "Driver halt\n"); } else { } return; } } static bool ath9k_uses_beacons(int type ) { { switch (type) { case 3: ; case 1: ; case 7: ; return (1); default: ; return (0); } } } static void ath9k_vif_iter(struct ath9k_vif_iter_data *iter_data , u8 *mac , struct ieee80211_vif *vif ) { struct ath_vif *avp ; int i ; { avp = (struct ath_vif *)(& vif->drv_priv); if ((int )iter_data->has_hw_macaddr) { i = 0; goto ldv_54240; ldv_54239: iter_data->mask[i] = (u8 )((int )((signed char )iter_data->mask[i]) & (int )((signed char )(~ ((int )iter_data->hw_macaddr[i] ^ (int )*(mac + (unsigned long )i))))); i = i + 1; ldv_54240: ; if (i <= 5) { goto ldv_54239; } else { } } else { memcpy((void *)(& iter_data->hw_macaddr), (void const *)mac, 6UL); iter_data->has_hw_macaddr = 1; } if (! vif->bss_conf.use_short_slot) { iter_data->slottime = 20U; } else { } switch ((unsigned int )vif->type) { case 3U: iter_data->naps = iter_data->naps + 1; goto ldv_54243; case 2U: iter_data->nstations = iter_data->nstations + 1; if ((int )avp->assoc && (unsigned long )iter_data->primary_sta == (unsigned long )((struct ieee80211_vif *)0)) { iter_data->primary_sta = vif; } else { } goto ldv_54243; case 1U: iter_data->nadhocs = iter_data->nadhocs + 1; if ((int )vif->bss_conf.enable_beacon) { iter_data->beacons = 1; } else { } goto ldv_54243; case 7U: iter_data->nmeshes = iter_data->nmeshes + 1; if ((int )vif->bss_conf.enable_beacon) { iter_data->beacons = 1; } else { } goto ldv_54243; case 5U: iter_data->nwds = iter_data->nwds + 1; goto ldv_54243; default: ; goto ldv_54243; } ldv_54243: ; return; } } static void ath9k_update_bssid_mask(struct ath_softc *sc , struct ath_chanctx *ctx , struct ath9k_vif_iter_data *iter_data ) { struct ath_common *common ; struct ath_common *tmp ; struct ath_vif *avp ; int i ; bool tmp___0 ; int tmp___1 ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; tmp___0 = ath9k_is_chanctx_enabled(); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { return; } else { } __mptr = (struct list_head const *)ctx->vifs.next; avp = (struct ath_vif *)__mptr; goto ldv_54266; ldv_54265: ; if ((int )ctx->nvifs_assigned != 1) { goto ldv_54261; } else { } if (! (avp->vif)->p2p || ! iter_data->has_hw_macaddr) { goto ldv_54261; } else { } ether_addr_copy((u8 *)(& common->curbssid), (u8 const *)(& avp->bssid)); i = 0; goto ldv_54263; ldv_54262: iter_data->mask[i] = (u8 )((int )((signed char )iter_data->mask[i]) & (int )((signed char )(~ ((int )iter_data->hw_macaddr[i] ^ (int )((sc->hw)->wiphy)->perm_addr[i])))); i = i + 1; ldv_54263: ; if (i <= 5) { goto ldv_54262; } else { } ldv_54261: __mptr___0 = (struct list_head const *)avp->list.next; avp = (struct ath_vif *)__mptr___0; ldv_54266: ; if ((unsigned long )(& avp->list) != (unsigned long )(& ctx->vifs)) { goto ldv_54265; } else { } return; } } void ath9k_calculate_iter_data(struct ath_softc *sc , struct ath_chanctx *ctx , struct ath9k_vif_iter_data *iter_data ) { struct ath_vif *avp ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; { memset((void *)iter_data, 0, 48UL); eth_broadcast_addr((u8 *)(& iter_data->mask)); iter_data->slottime = 9U; __mptr = (struct list_head const *)ctx->vifs.next; avp = (struct ath_vif *)__mptr; goto ldv_54279; ldv_54278: ath9k_vif_iter(iter_data, (u8 *)(& (avp->vif)->addr), avp->vif); __mptr___0 = (struct list_head const *)avp->list.next; avp = (struct ath_vif *)__mptr___0; ldv_54279: ; if ((unsigned long )(& avp->list) != (unsigned long )(& ctx->vifs)) { goto ldv_54278; } else { } ath9k_update_bssid_mask(sc, ctx, iter_data); return; } } static void ath9k_set_assoc_state(struct ath_softc *sc , struct ieee80211_vif *vif , bool changed ) { struct ath_common *common ; struct ath_common *tmp ; struct ath_vif *avp ; unsigned long flags ; raw_spinlock_t *tmp___0 ; bool tmp___1 ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; avp = (struct ath_vif *)(& vif->drv_priv); set_bit(3L, (unsigned long volatile *)(& common->op_flags)); ether_addr_copy((u8 *)(& common->curbssid), (u8 const *)(& avp->bssid)); common->curaid = avp->aid; ath9k_hw_write_associd(sc->sc_ah); if ((int )changed) { common->last_rssi = 127; (sc->sc_ah)->stats.avgbrssi = 127U; tmp___0 = spinlock_check(& sc->sc_pm_lock); flags = _raw_spin_lock_irqsave(tmp___0); sc->ps_flags = (u16 )((unsigned int )sc->ps_flags | 17U); spin_unlock_irqrestore(& sc->sc_pm_lock, flags); } else { } tmp___1 = ath9k_hw_mci_is_enabled(sc->sc_ah); if ((int )tmp___1) { ath9k_mci_update_wlan_channels(sc, 0); } else { } if ((common->debug_mask & 512) != 0) { ath_printk("\017", (struct ath_common const *)common, "Primary Station interface: %pM, BSSID: %pM\n", (u8 *)(& vif->addr), (u8 *)(& common->curbssid)); } else { } return; } } void ath9k_calculate_summary_state(struct ath_softc *sc , struct ath_chanctx *ctx ) { struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; struct ath9k_vif_iter_data iter_data ; struct ath_beacon_config *cur_conf ; bool changed ; bool tmp___0 ; { ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; ath_chanctx_check_active(sc, ctx); if ((unsigned long )sc->cur_chan != (unsigned long )ctx) { return; } else { } if ((unsigned long )(& sc->offchannel.chan) == (unsigned long )ctx) { return; } else { } ath9k_ps_wakeup(sc); ath9k_calculate_iter_data(sc, ctx, & iter_data); if ((int )iter_data.has_hw_macaddr) { memcpy((void *)(& common->macaddr), (void const *)(& iter_data.hw_macaddr), 6UL); } else { } memcpy((void *)(& common->bssidmask), (void const *)(& iter_data.mask), 6UL); ath_hw_setbssidmask(common); if (iter_data.naps > 0) { cur_conf = & ctx->beacon; ath9k_hw_set_tsfadjust(ah, 1); ah->opmode = 3; if ((unsigned int )cur_conf->enable_beacon != 0U) { iter_data.beacons = 1; } else { } } else { ath9k_hw_set_tsfadjust(ah, 0); if (iter_data.nmeshes != 0) { ah->opmode = 7; } else if (iter_data.nwds != 0) { ah->opmode = 3; } else if (iter_data.nadhocs != 0) { ah->opmode = 1; } else { ah->opmode = 2; } } ath9k_hw_setopmode(ah); ctx->switch_after_beacon = 0; if ((iter_data.nstations + iter_data.nadhocs) + iter_data.nmeshes > 0) { ah->imask = (enum ath9k_int )((unsigned int )ah->imask | 67108864U); } else { ah->imask = (enum ath9k_int )((unsigned int )ah->imask & 4227858431U); if (iter_data.naps == 1 && (int )iter_data.beacons) { ctx->switch_after_beacon = 1; } else { } } ah->imask = (enum ath9k_int )((unsigned int )ah->imask & 4294901759U); if ((unsigned int )ah->opmode == 2U) { changed = (unsigned long )iter_data.primary_sta != (unsigned long )ctx->primary_sta; if ((unsigned long )iter_data.primary_sta != (unsigned long )((struct ieee80211_vif *)0)) { iter_data.beacons = 1; ath9k_set_assoc_state(sc, iter_data.primary_sta, (int )changed); ctx->primary_sta = iter_data.primary_sta; } else { ctx->primary_sta = (struct ieee80211_vif *)0; eth_zero_addr((u8 *)(& common->curbssid)); common->curaid = 0U; ath9k_hw_write_associd(sc->sc_ah); tmp___0 = ath9k_hw_mci_is_enabled(sc->sc_ah); if ((int )tmp___0) { ath9k_mci_update_wlan_channels(sc, 1); } else { } } } else if ((int )iter_data.beacons) { ah->imask = (enum ath9k_int )((unsigned int )ah->imask | 65536U); } else { } ath9k_hw_set_interrupts(ah); if ((int )iter_data.beacons) { set_bit(1L, (unsigned long volatile *)(& common->op_flags)); } else { clear_bit(1L, (unsigned long volatile *)(& common->op_flags)); } if (ah->slottime != (u32 )iter_data.slottime) { ah->slottime = (u32 )iter_data.slottime; ath9k_hw_init_global_settings(ah); } else { } if ((unsigned long )iter_data.primary_sta != (unsigned long )((struct ieee80211_vif *)0)) { set_bit(3L, (unsigned long volatile *)(& common->op_flags)); } else { clear_bit(3L, (unsigned long volatile *)(& common->op_flags)); } if ((common->debug_mask & 512) != 0) { ath_printk("\017", (struct ath_common const *)common, "macaddr: %pM, bssid: %pM, bssidmask: %pM\n", (u8 *)(& common->macaddr), (u8 *)(& common->curbssid), (u8 *)(& common->bssidmask)); } else { } ath9k_ps_restore(sc); return; } } static void ath9k_tpc_vif_iter(void *data , u8 *mac , struct ieee80211_vif *vif ) { int *power ; { power = (int *)data; if (*power < vif->bss_conf.txpower) { *power = vif->bss_conf.txpower; } else { } return; } } void ath9k_set_txpower(struct ath_softc *sc , struct ieee80211_vif *vif ) { int power ; struct ath_hw *ah ; struct ath_regulatory *reg ; struct ath_regulatory *tmp ; { ah = sc->sc_ah; tmp = ath9k_hw_regulatory(ah); reg = tmp; ath9k_ps_wakeup(sc); if ((int )ah->tpc_enabled) { power = (unsigned long )vif != (unsigned long )((struct ieee80211_vif *)0) ? vif->bss_conf.txpower : -1; ieee80211_iterate_active_interfaces_atomic(sc->hw, 1U, & ath9k_tpc_vif_iter, (void *)(& power)); if (power == -1) { power = (sc->hw)->conf.power_level; } else { } } else { power = (sc->hw)->conf.power_level; } (sc->cur_chan)->txpower = (unsigned int )((u16 )power) * 2U; ath9k_hw_set_txpowerlimit(ah, (u32 )(sc->cur_chan)->txpower, 0); (sc->cur_chan)->cur_txpower = reg->max_power_level; ath9k_ps_restore(sc); return; } } static void ath9k_assign_hw_queues(struct ieee80211_hw *hw , struct ieee80211_vif *vif ) { int i ; bool tmp ; int tmp___0 ; { tmp = ath9k_is_chanctx_enabled(); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { return; } else { } i = 0; goto ldv_54329; ldv_54328: vif->hw_queue[i] = (u8 )i; i = i + 1; ldv_54329: ; if (i <= 3) { goto ldv_54328; } else { } if ((unsigned int )vif->type == 3U || (unsigned int )vif->type == 7U) { vif->cab_queue = (unsigned int )((u8 )hw->queues) + 254U; } else { vif->cab_queue = 255U; } return; } } static int ath9k_add_interface(struct ieee80211_hw *hw , struct ieee80211_vif *vif ) { struct ath_softc *sc ; struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; struct ath_vif *avp ; struct ath_node *an ; bool tmp___0 ; bool tmp___1 ; int tmp___2 ; { sc = (struct ath_softc *)hw->priv; ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; avp = (struct ath_vif *)(& vif->drv_priv); an = & avp->mcast_node; mutex_lock_nested(& sc->mutex, 0U); if ((int )(sc->cur_chan)->nvifs > 0) { mutex_unlock(& sc->mutex); return (-95); } else { } sc->tx99_vif = vif; if ((common->debug_mask & 512) != 0) { ath_printk("\017", (struct ath_common const *)common, "Attach a VIF of type: %d\n", (unsigned int )vif->type); } else { } (sc->cur_chan)->nvifs = (short )((int )(sc->cur_chan)->nvifs + 1); tmp___0 = ath9k_uses_beacons((int )vif->type); if ((int )tmp___0) { ath9k_beacon_assign_slot(sc, vif); } else { } avp->vif = vif; tmp___1 = ath9k_is_chanctx_enabled(); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { avp->chanctx = sc->cur_chan; list_add_tail(& avp->list, & (avp->chanctx)->vifs); } else { } ath9k_calculate_summary_state(sc, avp->chanctx); ath9k_assign_hw_queues(hw, vif); ath9k_set_txpower(sc, vif); an->sc = sc; an->sta = (struct ieee80211_sta *)0; an->vif = vif; an->no_ps_filter = 1; ath_tx_node_init(sc, an); mutex_unlock(& sc->mutex); return (0); } } static int ath9k_change_interface(struct ieee80211_hw *hw , struct ieee80211_vif *vif , enum nl80211_iftype new_type , bool p2p ) { struct ath_softc *sc ; struct ath_common *common ; struct ath_common *tmp ; struct ath_vif *avp ; bool tmp___0 ; bool tmp___1 ; { sc = (struct ath_softc *)hw->priv; tmp = ath9k_hw_common(sc->sc_ah); common = tmp; avp = (struct ath_vif *)(& vif->drv_priv); mutex_lock_nested(& sc->mutex, 0U); mutex_unlock(& sc->mutex); return (-95); if ((common->debug_mask & 512) != 0) { ath_printk("\017", (struct ath_common const *)common, "Change Interface\n"); } else { } tmp___0 = ath9k_uses_beacons((int )vif->type); if ((int )tmp___0) { ath9k_beacon_remove_slot(sc, vif); } else { } vif->type = new_type; vif->p2p = p2p; tmp___1 = ath9k_uses_beacons((int )vif->type); if ((int )tmp___1) { ath9k_beacon_assign_slot(sc, vif); } else { } ath9k_assign_hw_queues(hw, vif); ath9k_calculate_summary_state(sc, avp->chanctx); ath9k_set_txpower(sc, vif); mutex_unlock(& sc->mutex); return (0); } } static void ath9k_remove_interface(struct ieee80211_hw *hw , struct ieee80211_vif *vif ) { struct ath_softc *sc ; struct ath_common *common ; struct ath_common *tmp ; struct ath_vif *avp ; bool tmp___0 ; int tmp___1 ; bool tmp___2 ; { sc = (struct ath_softc *)hw->priv; tmp = ath9k_hw_common(sc->sc_ah); common = tmp; avp = (struct ath_vif *)(& vif->drv_priv); if ((common->debug_mask & 512) != 0) { ath_printk("\017", (struct ath_common const *)common, "Detach Interface\n"); } else { } mutex_lock_nested(& sc->mutex, 0U); ath9k_p2p_remove_vif(sc, vif); (sc->cur_chan)->nvifs = (short )((int )(sc->cur_chan)->nvifs - 1); sc->tx99_vif = (struct ieee80211_vif *)0; tmp___0 = ath9k_is_chanctx_enabled(); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { list_del(& avp->list); } else { } tmp___2 = ath9k_uses_beacons((int )vif->type); if ((int )tmp___2) { ath9k_beacon_remove_slot(sc, vif); } else { } ath_tx_node_cleanup(sc, & avp->mcast_node); ath9k_calculate_summary_state(sc, avp->chanctx); ath9k_set_txpower(sc, (struct ieee80211_vif *)0); mutex_unlock(& sc->mutex); return; } } static void ath9k_enable_ps(struct ath_softc *sc ) { struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; { ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; return; sc->ps_enabled = 1; if ((ah->caps.hw_caps & 4U) == 0U) { if (((unsigned int )ah->imask & 256U) == 0U) { ah->imask = (enum ath9k_int )((unsigned int )ah->imask | 256U); ath9k_hw_set_interrupts(ah); } else { } ath9k_hw_setrxabort(ah, 1); } else { } if ((common->debug_mask & 2048) != 0) { ath_printk("\017", (struct ath_common const *)common, "PowerSave enabled\n"); } else { } } } static void ath9k_disable_ps(struct ath_softc *sc ) { struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; { ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; return; sc->ps_enabled = 0; ath9k_hw_setpower(ah, 0); if ((ah->caps.hw_caps & 4U) == 0U) { ath9k_hw_setrxabort(ah, 0); sc->ps_flags = (unsigned int )sc->ps_flags & 65520U; if (((unsigned int )ah->imask & 256U) != 0U) { ah->imask = (enum ath9k_int )((unsigned int )ah->imask & 4294967039U); ath9k_hw_set_interrupts(ah); } else { } } else { } if ((common->debug_mask & 2048) != 0) { ath_printk("\017", (struct ath_common const *)common, "PowerSave disabled\n"); } else { } } } static int ath9k_config(struct ieee80211_hw *hw , u32 changed ) { struct ath_softc *sc ; struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; struct ieee80211_conf *conf ; struct ath_chanctx *ctx ; unsigned long flags ; raw_spinlock_t *tmp___0 ; bool tmp___1 ; int tmp___2 ; { sc = (struct ath_softc *)hw->priv; ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; conf = & hw->conf; ctx = sc->cur_chan; ath9k_ps_wakeup(sc); mutex_lock_nested(& sc->mutex, 0U); if ((changed & 256U) != 0U) { sc->ps_idle = (conf->flags & 4U) != 0U; if ((int )sc->ps_idle) { ath_cancel_work(sc); ath9k_stop_btcoex(sc); } else { ath9k_start_btcoex(sc); ath_chanctx_set_channel(sc, ctx, & ctx->chandef); } } else { } if ((changed & 16U) != 0U) { tmp___0 = spinlock_check(& sc->sc_pm_lock); flags = _raw_spin_lock_irqsave(tmp___0); if ((conf->flags & 2U) != 0U) { ath9k_enable_ps(sc); } else { ath9k_disable_ps(sc); } spin_unlock_irqrestore(& sc->sc_pm_lock, flags); } else { } if ((changed & 8U) != 0U) { if ((int )conf->flags & 1) { if ((common->debug_mask & 512) != 0) { ath_printk("\017", (struct ath_common const *)common, "Monitor mode is enabled\n"); } else { } (sc->sc_ah)->is_monitoring = 1; } else { if ((common->debug_mask & 512) != 0) { ath_printk("\017", (struct ath_common const *)common, "Monitor mode is disabled\n"); } else { } (sc->sc_ah)->is_monitoring = 0; } } else { } tmp___1 = ath9k_is_chanctx_enabled(); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2 && (changed & 64U) != 0U) { ctx->offchannel = (conf->flags & 8U) != 0U; ath_chanctx_set_channel(sc, ctx, & hw->conf.chandef); } else { } mutex_unlock(& sc->mutex); ath9k_ps_restore(sc); return (0); } } static void ath9k_configure_filter(struct ieee80211_hw *hw , unsigned int changed_flags , unsigned int *total_flags , u64 multicast ) { struct ath_softc *sc ; u32 rfilt ; struct ath_common *tmp ; struct ath_common *tmp___0 ; { sc = (struct ath_softc *)hw->priv; changed_flags = changed_flags & 502U; *total_flags = *total_flags & 502U; spin_lock_bh(& sc->chan_lock); (sc->cur_chan)->rxfilter = *total_flags; spin_unlock_bh(& sc->chan_lock); ath9k_ps_wakeup(sc); rfilt = ath_calcrxfilter(sc); ath9k_hw_setrxfilter(sc->sc_ah, rfilt); ath9k_ps_restore(sc); tmp___0 = ath9k_hw_common(sc->sc_ah); if ((tmp___0->debug_mask & 512) != 0) { tmp = ath9k_hw_common(sc->sc_ah); ath_printk("\017", (struct ath_common const *)tmp, "Set HW RX filter: 0x%x\n", rfilt); } else { } return; } } static int ath9k_sta_add(struct ieee80211_hw *hw , struct ieee80211_vif *vif , struct ieee80211_sta *sta ) { struct ath_softc *sc ; struct ath_common *common ; struct ath_common *tmp ; struct ath_node *an ; struct ieee80211_key_conf ps_key ; int key ; { sc = (struct ath_softc *)hw->priv; tmp = ath9k_hw_common(sc->sc_ah); common = tmp; an = (struct ath_node *)(& sta->drv_priv); ps_key.tx_pn.counter = 0L; ps_key.cipher = 0U; ps_key.icv_len = (unsigned char)0; ps_key.iv_len = (unsigned char)0; ps_key.hw_key_idx = (unsigned char)0; ps_key.flags = (unsigned char)0; ps_key.keyidx = (signed char)0; ps_key.keylen = (unsigned char)0; ath_node_attach(sc, sta, vif); if ((unsigned int )vif->type != 3U && (unsigned int )vif->type != 4U) { return (0); } else { } key = ath_key_config(common, vif, sta, & ps_key); if (key > 0) { an->ps_key = (s8 )key; an->key_idx[0] = (u8 )key; } else { } return (0); } } static void ath9k_del_ps_key(struct ath_softc *sc , struct ieee80211_vif *vif , struct ieee80211_sta *sta ) { struct ath_common *common ; struct ath_common *tmp ; struct ath_node *an ; struct ieee80211_key_conf ps_key ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; an = (struct ath_node *)(& sta->drv_priv); ps_key.tx_pn.counter = 0L; ps_key.cipher = 0U; ps_key.icv_len = (unsigned char)0; ps_key.iv_len = (unsigned char)0; ps_key.hw_key_idx = (unsigned char )an->ps_key; ps_key.flags = (unsigned char)0; ps_key.keyidx = (signed char)0; ps_key.keylen = (unsigned char)0; if ((int )an->ps_key == 0) { return; } else { } ath_key_delete(common, & ps_key); an->ps_key = 0; an->key_idx[0] = 0U; return; } } static int ath9k_sta_remove(struct ieee80211_hw *hw , struct ieee80211_vif *vif , struct ieee80211_sta *sta ) { struct ath_softc *sc ; { sc = (struct ath_softc *)hw->priv; ath9k_del_ps_key(sc, vif, sta); ath_node_detach(sc, sta); return (0); } } static int ath9k_sta_state(struct ieee80211_hw *hw , struct ieee80211_vif *vif , struct ieee80211_sta *sta , enum ieee80211_sta_state old_state , enum ieee80211_sta_state new_state ) { struct ath_softc *sc ; struct ath_common *common ; struct ath_common *tmp ; int ret ; bool tmp___0 ; { sc = (struct ath_softc *)hw->priv; tmp = ath9k_hw_common(sc->sc_ah); common = tmp; ret = 0; if ((unsigned int )old_state == 2U && (unsigned int )new_state == 3U) { ret = ath9k_sta_add(hw, vif, sta); if ((common->debug_mask & 512) != 0) { ath_printk("\017", (struct ath_common const *)common, "Add station: %pM\n", (u8 *)(& sta->addr)); } else { } } else if ((unsigned int )old_state == 3U && (unsigned int )new_state == 2U) { ret = ath9k_sta_remove(hw, vif, sta); if ((common->debug_mask & 512) != 0) { ath_printk("\017", (struct ath_common const *)common, "Remove station: %pM\n", (u8 *)(& sta->addr)); } else { } } else { } tmp___0 = ath9k_is_chanctx_enabled(); if ((int )tmp___0) { if ((unsigned int )vif->type == 2U) { if ((unsigned int )old_state == 3U && (unsigned int )new_state == 4U) { ath_chanctx_event(sc, vif, 4); } else { } } else { } } else { } return (ret); } } static void ath9k_sta_set_tx_filter(struct ath_hw *ah , struct ath_node *an , bool set ) { int i ; { i = 0; goto ldv_54431; ldv_54430: ; if ((unsigned int )an->key_idx[i] == 0U) { goto ldv_54429; } else { } ath9k_hw_set_tx_filter(ah, (int )an->key_idx[i], (int )set); ldv_54429: i = i + 1; ldv_54431: ; if ((unsigned int )i <= 3U) { goto ldv_54430; } else { } return; } } static void ath9k_sta_notify(struct ieee80211_hw *hw , struct ieee80211_vif *vif , enum sta_notify_cmd cmd , struct ieee80211_sta *sta ) { struct ath_softc *sc ; struct ath_node *an ; { sc = (struct ath_softc *)hw->priv; an = (struct ath_node *)(& sta->drv_priv); switch ((unsigned int )cmd) { case 0U: an->sleeping = 1; ath_tx_aggr_sleep(sta, sc, an); ath9k_sta_set_tx_filter(sc->sc_ah, an, 1); goto ldv_54442; case 1U: ath9k_sta_set_tx_filter(sc->sc_ah, an, 0); an->sleeping = 0; ath_tx_aggr_wakeup(sc, an); goto ldv_54442; } ldv_54442: ; return; } } static int ath9k_conf_tx(struct ieee80211_hw *hw , struct ieee80211_vif *vif , u16 queue , struct ieee80211_tx_queue_params const *params ) { struct ath_softc *sc ; struct ath_common *common ; struct ath_common *tmp ; struct ath_txq *txq ; struct ath9k_tx_queue_info qi ; int ret ; { sc = (struct ath_softc *)hw->priv; tmp = ath9k_hw_common(sc->sc_ah); common = tmp; ret = 0; if ((unsigned int )queue > 3U) { return (0); } else { } txq = sc->tx.txq_map[(int )queue]; ath9k_ps_wakeup(sc); mutex_lock_nested(& sc->mutex, 0U); memset((void *)(& qi), 0, 60UL); qi.tqi_aifs = (u32 )params->aifs; qi.tqi_cwmin = (u32 )params->cw_min; qi.tqi_cwmax = (u32 )params->cw_max; qi.tqi_burstTime = (u32 )((int )params->txop * 32); if ((common->debug_mask & 512) != 0) { ath_printk("\017", (struct ath_common const *)common, "Configure tx [queue/halq] [%d/%d], aifs: %d, cw_min: %d, cw_max: %d, txop: %d\n", (int )queue, txq->axq_qnum, (int )params->aifs, (int )params->cw_min, (int )params->cw_max, (int )params->txop); } else { } ath_update_max_aggr_framelen(sc, (int )queue, (int )qi.tqi_burstTime); ret = ath_txq_update(sc, (int )txq->axq_qnum, & qi); if (ret != 0) { ath_printk("\v", (struct ath_common const *)common, "TXQ Update failed\n"); } else { } mutex_unlock(& sc->mutex); ath9k_ps_restore(sc); return (ret); } } static int ath9k_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 ath_softc *sc ; struct ath_common *common ; struct ath_common *tmp ; struct ath_node *an ; int ret ; int i ; int __ret_warn_on ; long tmp___0 ; { sc = (struct ath_softc *)hw->priv; tmp = ath9k_hw_common(sc->sc_ah); common = tmp; an = (struct ath_node *)0; ret = 0; if (ath9k_modparam_nohwcrypt != 0) { return (-28); } else { } if ((((unsigned int )vif->type == 1U || (unsigned int )vif->type == 7U) && (key->cipher == 1027074U || key->cipher == 1027076U)) && ((int )key->flags & 8) == 0) { return (-95); } else { } mutex_lock_nested(& sc->mutex, 0U); ath9k_ps_wakeup(sc); if ((common->debug_mask & 512) != 0) { ath_printk("\017", (struct ath_common const *)common, "Set HW Key %d\n", (unsigned int )cmd); } else { } if ((unsigned long )sta != (unsigned long )((struct ieee80211_sta *)0)) { an = (struct ath_node *)(& sta->drv_priv); } else { } switch ((unsigned int )cmd) { case 0U: ; if ((unsigned long )sta != (unsigned long )((struct ieee80211_sta *)0)) { ath9k_del_ps_key(sc, vif, sta); } else { } key->hw_key_idx = 0U; ret = ath_key_config(common, vif, sta, key); if (ret >= 0) { key->hw_key_idx = (u8 )ret; key->flags = (u8 )((unsigned int )key->flags | 2U); if (key->cipher == 1027074U) { key->flags = (u8 )((unsigned int )key->flags | 4U); } else { } if ((int )(sc->sc_ah)->sw_mgmt_crypto_tx && key->cipher == 1027076U) { key->flags = (u8 )((unsigned int )key->flags | 16U); } else { } ret = 0; } else { } if ((unsigned long )an != (unsigned long )((struct ath_node *)0) && (unsigned int )key->hw_key_idx != 0U) { i = 0; goto ldv_54473; ldv_54472: ; if ((unsigned int )an->key_idx[i] != 0U) { goto ldv_54470; } else { } an->key_idx[i] = key->hw_key_idx; goto ldv_54471; ldv_54470: i = i + 1; ldv_54473: ; if ((unsigned int )i <= 3U) { goto ldv_54472; } else { } ldv_54471: __ret_warn_on = i == 4; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/12119/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/ath/ath9k/main.c", 1703); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); } else { } goto ldv_54478; case 1U: ath_key_delete(common, key); if ((unsigned long )an != (unsigned long )((struct ath_node *)0)) { i = 0; goto ldv_54485; ldv_54484: ; if ((int )an->key_idx[i] != (int )key->hw_key_idx) { goto ldv_54482; } else { } an->key_idx[i] = 0U; goto ldv_54483; ldv_54482: i = i + 1; ldv_54485: ; if ((unsigned int )i <= 3U) { goto ldv_54484; } else { } ldv_54483: ; } else { } key->hw_key_idx = 0U; goto ldv_54478; default: ret = -22; } ldv_54478: ath9k_ps_restore(sc); mutex_unlock(& sc->mutex); return (ret); } } static void ath9k_bss_info_changed(struct ieee80211_hw *hw , struct ieee80211_vif *vif , struct ieee80211_bss_conf *bss_conf , u32 changed ) { struct ath_softc *sc ; struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; struct ath_vif *avp ; int slottime ; { sc = (struct ath_softc *)hw->priv; ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; avp = (struct ath_vif *)(& vif->drv_priv); ath9k_ps_wakeup(sc); mutex_lock_nested(& sc->mutex, 0U); if ((int )changed & 1) { if ((common->debug_mask & 512) != 0) { ath_printk("\017", (struct ath_common const *)common, "BSSID %pM Changed ASSOC %d\n", bss_conf->bssid, (int )bss_conf->assoc); } else { } memcpy((void *)(& avp->bssid), (void const *)bss_conf->bssid, 6UL); avp->aid = bss_conf->aid; avp->assoc = bss_conf->assoc; ath9k_calculate_summary_state(sc, avp->chanctx); } else { } if ((changed & 2048U) != 0U) { memcpy((void *)(& common->curbssid), (void const *)bss_conf->bssid, 6UL); common->curaid = bss_conf->aid; ath9k_hw_write_associd(sc->sc_ah); } else { } if (((changed & 512U) != 0U || (changed & 64U) != 0U) || (changed & 1048576U) != 0U) { ath9k_beacon_config(sc, vif, changed); if ((changed & 512U) != 0U) { ath9k_calculate_summary_state(sc, avp->chanctx); } else { } } else { } if ((unsigned long )avp->chanctx == (unsigned long )sc->cur_chan && (changed & 8U) != 0U) { if ((int )bss_conf->use_short_slot) { slottime = 9; } else { slottime = 20; } if ((unsigned int )vif->type == 3U) { sc->beacon.slottime = slottime; sc->beacon.updateslot = 1; } else { ah->slottime = (u32 )slottime; ath9k_hw_init_global_settings(ah); } } else { } if ((changed & 524288U) != 0U) { ath9k_p2p_bss_info_changed(sc, vif); } else { } if ((changed & 2561U) != 0U) { ath_check_ani(sc); } else { } if ((changed & 262144U) != 0U) { if ((common->debug_mask & 512) != 0) { ath_printk("\017", (struct ath_common const *)common, "vif %pM power %d dbm power_type %d\n", (u8 *)(& vif->addr), bss_conf->txpower, (unsigned int )bss_conf->txpower_type); } else { } ath9k_set_txpower(sc, vif); } else { } mutex_unlock(& sc->mutex); ath9k_ps_restore(sc); return; } } static u64 ath9k_get_tsf(struct ieee80211_hw *hw , struct ieee80211_vif *vif ) { struct ath_softc *sc ; u64 tsf ; { sc = (struct ath_softc *)hw->priv; mutex_lock_nested(& sc->mutex, 0U); ath9k_ps_wakeup(sc); tsf = ath9k_hw_gettsf64(sc->sc_ah); ath9k_ps_restore(sc); mutex_unlock(& sc->mutex); return (tsf); } } static void ath9k_set_tsf(struct ieee80211_hw *hw , struct ieee80211_vif *vif , u64 tsf ) { struct ath_softc *sc ; { sc = (struct ath_softc *)hw->priv; mutex_lock_nested(& sc->mutex, 0U); ath9k_ps_wakeup(sc); ath9k_hw_settsf64(sc->sc_ah, tsf); ath9k_ps_restore(sc); mutex_unlock(& sc->mutex); return; } } static void ath9k_reset_tsf(struct ieee80211_hw *hw , struct ieee80211_vif *vif ) { struct ath_softc *sc ; { sc = (struct ath_softc *)hw->priv; mutex_lock_nested(& sc->mutex, 0U); ath9k_ps_wakeup(sc); ath9k_hw_reset_tsf(sc->sc_ah); ath9k_ps_restore(sc); mutex_unlock(& sc->mutex); return; } } static int ath9k_ampdu_action(struct ieee80211_hw *hw , struct ieee80211_vif *vif , enum ieee80211_ampdu_mlme_action action , struct ieee80211_sta *sta , u16 tid , u16 *ssn , u8 buf_size ) { struct ath_softc *sc ; struct ath_common *common ; struct ath_common *tmp ; bool flush ; int ret ; int tmp___0 ; bool tmp___1 ; struct ath_common *tmp___2 ; { sc = (struct ath_softc *)hw->priv; tmp = ath9k_hw_common(sc->sc_ah); common = tmp; flush = 0; ret = 0; mutex_lock_nested(& sc->mutex, 0U); switch ((unsigned int )action) { case 0U: ; goto ldv_54529; case 1U: ; goto ldv_54529; case 2U: tmp___1 = ath9k_is_chanctx_enabled(); if ((int )tmp___1) { tmp___0 = constant_test_bit(5L, (unsigned long const volatile *)(& common->op_flags)); if (tmp___0 != 0) { ret = -16; goto ldv_54529; } else { } } else { } ath9k_ps_wakeup(sc); ret = ath_tx_aggr_start(sc, sta, (int )tid, ssn); if (ret == 0) { ieee80211_start_tx_ba_cb_irqsafe(vif, (u8 const *)(& sta->addr), (int )tid); } else { } ath9k_ps_restore(sc); goto ldv_54529; case 4U: ; case 5U: flush = 1; case 3U: ath9k_ps_wakeup(sc); ath_tx_aggr_stop(sc, sta, (int )tid); if (! flush) { ieee80211_stop_tx_ba_cb_irqsafe(vif, (u8 const *)(& sta->addr), (int )tid); } else { } ath9k_ps_restore(sc); goto ldv_54529; case 6U: ath9k_ps_wakeup(sc); ath_tx_aggr_resume(sc, sta, (int )tid); ath9k_ps_restore(sc); goto ldv_54529; default: tmp___2 = ath9k_hw_common(sc->sc_ah); ath_printk("\v", (struct ath_common const *)tmp___2, "Unknown AMPDU action\n"); } ldv_54529: mutex_unlock(& sc->mutex); return (ret); } } static int ath9k_get_survey(struct ieee80211_hw *hw , int idx , struct survey_info *survey ) { struct ath_softc *sc ; struct ath_common *common ; struct ath_common *tmp ; struct ieee80211_supported_band *sband ; struct ieee80211_channel *chan ; int pos ; { sc = (struct ath_softc *)hw->priv; tmp = ath9k_hw_common(sc->sc_ah); common = tmp; return (-95); spin_lock_bh(& common->cc_lock); if (idx == 0) { ath_update_survey_stats(sc); } else { } sband = (hw->wiphy)->bands[0]; if ((unsigned long )sband != (unsigned long )((struct ieee80211_supported_band *)0) && sband->n_channels <= idx) { idx = idx - sband->n_channels; sband = (struct ieee80211_supported_band *)0; } else { } if ((unsigned long )sband == (unsigned long )((struct ieee80211_supported_band *)0)) { sband = (hw->wiphy)->bands[1]; } else { } if ((unsigned long )sband == (unsigned long )((struct ieee80211_supported_band *)0) || sband->n_channels <= idx) { spin_unlock_bh(& common->cc_lock); return (-2); } else { } chan = sband->channels + (unsigned long )idx; pos = (int )chan->hw_value; memcpy((void *)survey, (void const *)(& sc->survey) + (unsigned long )pos, 64UL); survey->channel = chan; spin_unlock_bh(& common->cc_lock); return (0); } } static void ath9k_enable_dynack(struct ath_softc *sc ) { u32 rfilt ; struct ath_hw *ah ; { ah = sc->sc_ah; ath_dynack_reset(ah); ah->dynack.enabled = 1; rfilt = ath_calcrxfilter(sc); ath9k_hw_setrxfilter(ah, rfilt); return; } } static void ath9k_set_coverage_class(struct ieee80211_hw *hw , s16 coverage_class ) { struct ath_softc *sc ; struct ath_hw *ah ; u32 rfilt ; { sc = (struct ath_softc *)hw->priv; ah = sc->sc_ah; return; mutex_lock_nested(& sc->mutex, 0U); if ((int )coverage_class >= 0) { ah->coverage_class = (int )coverage_class; if ((int )ah->dynack.enabled) { ah->dynack.enabled = 0; rfilt = ath_calcrxfilter(sc); ath9k_hw_setrxfilter(ah, rfilt); } else { } ath9k_ps_wakeup(sc); ath9k_hw_init_global_settings(ah); ath9k_ps_restore(sc); } else if (! ah->dynack.enabled) { ath9k_enable_dynack(sc); } else { } mutex_unlock(& sc->mutex); } } static bool ath9k_has_tx_pending(struct ath_softc *sc , bool sw_pending ) { int i ; int npend ; bool tmp ; { npend = 0; i = 0; goto ldv_54568; ldv_54567: ; if ((sc->tx.txqsetup & (u32 )(1 << i)) == 0U) { goto ldv_54565; } else { } tmp = ath9k_has_pending_frames(sc, (struct ath_txq *)(& sc->tx.txq) + (unsigned long )i, (int )sw_pending); npend = (int )tmp; if (npend != 0) { goto ldv_54566; } else { } ldv_54565: i = i + 1; ldv_54568: ; if (i <= 9) { goto ldv_54567; } else { } ldv_54566: ; return (npend != 0); } } static void ath9k_flush(struct ieee80211_hw *hw , struct ieee80211_vif *vif , u32 queues , bool drop ) { struct ath_softc *sc ; struct ath_common *common ; struct ath_common *tmp ; int tmp___0 ; bool tmp___1 ; { sc = (struct ath_softc *)hw->priv; tmp = ath9k_hw_common(sc->sc_ah); common = tmp; tmp___1 = ath9k_is_chanctx_enabled(); if ((int )tmp___1) { tmp___0 = constant_test_bit(6L, (unsigned long const volatile *)(& common->op_flags)); if (tmp___0 == 0) { goto flush; } else { } __ath9k_flush(hw, queues, (int )drop, 1, 1); return; } else { } flush: mutex_lock_nested(& sc->mutex, 0U); __ath9k_flush(hw, queues, (int )drop, 1, 0); mutex_unlock(& sc->mutex); return; } } void __ath9k_flush(struct ieee80211_hw *hw , u32 queues , bool drop , bool sw_pending , bool timeout_override ) { struct ath_softc *sc ; struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; int timeout ; bool drain_txq ; int tmp___0 ; unsigned int tmp___1 ; long __ret ; wait_queue_t __wait ; long __ret___0 ; long __int ; long tmp___2 ; bool __cond ; bool tmp___3 ; int tmp___4 ; bool __cond___0 ; bool tmp___5 ; int tmp___6 ; { sc = (struct ath_softc *)hw->priv; ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; ldv_cancel_delayed_work_sync_75(& sc->tx_complete_work); if ((ah->ah_flags & 2U) != 0U) { if (common->debug_mask != 0) { ath_printk("\017", (struct ath_common const *)common, "Device has been unplugged!\n"); } else { } return; } else { } tmp___0 = constant_test_bit(0L, (unsigned long const volatile *)(& common->op_flags)); if (tmp___0 != 0) { if (common->debug_mask != 0) { ath_printk("\017", (struct ath_common const *)common, "Device not present\n"); } else { } return; } else { } spin_lock_bh(& sc->chan_lock); if ((int )timeout_override) { timeout = 50; } else { timeout = (sc->cur_chan)->flush_timeout; } spin_unlock_bh(& sc->chan_lock); if ((common->debug_mask & 262144) != 0) { tmp___1 = jiffies_to_msecs((unsigned long const )timeout); ath_printk("\017", (struct ath_common const *)common, "Flush timeout: %d\n", tmp___1); } else { } __ret = (long )timeout; __might_sleep("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/12119/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/ath/ath9k/main.c", 2067, 0); tmp___5 = ath9k_has_tx_pending(sc, (int )sw_pending); if ((int )tmp___5 != 0) { tmp___6 = 0; } else { tmp___6 = 1; } __cond___0 = (bool )tmp___6; if ((int )__cond___0 && __ret == 0L) { __ret = 1L; } else { } if (((int )__cond___0 || __ret == 0L) == 0) { __ret___0 = (long )timeout; INIT_LIST_HEAD(& __wait.task_list); __wait.flags = 0U; ldv_54600: tmp___2 = prepare_to_wait_event(& sc->tx_wait, & __wait, 2); __int = tmp___2; tmp___3 = ath9k_has_tx_pending(sc, (int )sw_pending); if ((int )tmp___3 != 0) { tmp___4 = 0; } else { tmp___4 = 1; } __cond = (bool )tmp___4; if ((int )__cond && __ret___0 == 0L) { __ret___0 = 1L; } else { } if (((int )__cond || __ret___0 == 0L) != 0) { goto ldv_54599; } else { } __ret___0 = schedule_timeout(__ret___0); goto ldv_54600; ldv_54599: finish_wait(& sc->tx_wait, & __wait); __ret = __ret___0; } else { } if (__ret > 0L) { drop = 0; } else { } if ((int )drop) { ath9k_ps_wakeup(sc); spin_lock_bh(& sc->sc_pcu_lock); drain_txq = ath_drain_all_txq(sc); spin_unlock_bh(& sc->sc_pcu_lock); if (! drain_txq) { ath_reset(sc, (struct ath9k_channel *)0); } else { } ath9k_ps_restore(sc); } else { } ieee80211_queue_delayed_work(hw, & sc->tx_complete_work, 0UL); return; } } static bool ath9k_tx_frames_pending(struct ieee80211_hw *hw ) { struct ath_softc *sc ; bool tmp ; { sc = (struct ath_softc *)hw->priv; tmp = ath9k_has_tx_pending(sc, 1); return (tmp); } } static int ath9k_tx_last_beacon(struct ieee80211_hw *hw ) { struct ath_softc *sc ; struct ath_hw *ah ; struct ieee80211_vif *vif ; struct ath_vif *avp ; struct ath_buf *bf ; struct ath_tx_status ts ; bool edma ; int status ; { sc = (struct ath_softc *)hw->priv; ah = sc->sc_ah; edma = (ah->caps.hw_caps & 16U) != 0U; vif = sc->beacon.bslot[0]; if ((unsigned long )vif == (unsigned long )((struct ieee80211_vif *)0)) { return (0); } else { } if (! vif->bss_conf.enable_beacon) { return (0); } else { } avp = (struct ath_vif *)(& vif->drv_priv); if (! sc->beacon.tx_processed && ! edma) { tasklet_disable___0(& sc->bcon_tasklet); bf = avp->av_bcbuf; if ((unsigned long )bf == (unsigned long )((struct ath_buf *)0) || (unsigned long )bf->bf_mpdu == (unsigned long )((struct sk_buff *)0)) { goto skip; } else { } status = ath9k_hw_txprocdesc(ah, bf->bf_desc, & ts); if (status == -115) { goto skip; } else { } sc->beacon.tx_processed = 1; sc->beacon.tx_last = ((int )ts.ts_status & 95) == 0; skip: tasklet_enable(& sc->bcon_tasklet); } else { } return ((int )sc->beacon.tx_last); } } static int ath9k_get_stats(struct ieee80211_hw *hw , struct ieee80211_low_level_stats *stats ) { struct ath_softc *sc ; struct ath_hw *ah ; struct ath9k_mib_stats *mib_stats ; { sc = (struct ath_softc *)hw->priv; ah = sc->sc_ah; mib_stats = & ah->stats.ast_mibstats; stats->dot11ACKFailureCount = mib_stats->ackrcv_bad; stats->dot11RTSFailureCount = mib_stats->rts_bad; stats->dot11FCSErrorCount = mib_stats->fcs_bad; stats->dot11RTSSuccessCount = mib_stats->rts_good; return (0); } } static u32 fill_chainmask(u32 cap , u32 new ) { u32 filled ; int i ; { filled = 0U; i = 0; goto ldv_54634; ldv_54633: ; if (((unsigned long )cap & 1UL) == 0UL) { goto ldv_54632; } else { } if ((int )new & 1) { filled = (u32 )(1UL << i) | filled; } else { } new = new >> 1; ldv_54632: i = i + 1; cap = cap >> 1; ldv_54634: ; if (cap != 0U && new != 0U) { goto ldv_54633; } else { } return (filled); } } static bool validate_antenna_mask(struct ath_hw *ah , u32 val ) { { if (ah->hw_version.macVersion > 447U) { return (1); } else { } switch (val & 7U) { case 1U: ; case 3U: ; case 7U: ; return (1); case 2U: ; return ((unsigned int )ah->caps.rx_chainmask == 1U); default: ; return (0); } } } static int ath9k_set_antenna(struct ieee80211_hw *hw , u32 tx_ant , u32 rx_ant ) { struct ath_softc *sc ; struct ath_hw *ah ; bool tmp ; int tmp___0 ; u32 tmp___1 ; u32 tmp___2 ; { sc = (struct ath_softc *)hw->priv; ah = sc->sc_ah; if ((unsigned int )ah->caps.rx_chainmask != 1U) { rx_ant = rx_ant | tx_ant; } else { } tmp = validate_antenna_mask(ah, rx_ant); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0 || tx_ant == 0U) { return (-22); } else { } sc->ant_rx = (u8 )rx_ant; sc->ant_tx = (u8 )tx_ant; if ((unsigned int )ah->caps.rx_chainmask == 1U) { return (0); } else { } if (ah->hw_version.macVersion == 20U) { ah->rxchainmask = 7U; } else { tmp___1 = fill_chainmask((u32 )ah->caps.rx_chainmask, rx_ant); ah->rxchainmask = (u8 )tmp___1; } tmp___2 = fill_chainmask((u32 )ah->caps.tx_chainmask, tx_ant); ah->txchainmask = (u8 )tmp___2; ath9k_cmn_reload_chainmask(ah); return (0); } } static int ath9k_get_antenna(struct ieee80211_hw *hw , u32 *tx_ant , u32 *rx_ant ) { struct ath_softc *sc ; { sc = (struct ath_softc *)hw->priv; *tx_ant = (u32 )sc->ant_tx; *rx_ant = (u32 )sc->ant_rx; return (0); } } static void ath9k_sw_scan_start(struct ieee80211_hw *hw , struct ieee80211_vif *vif , u8 const *mac_addr ) { struct ath_softc *sc ; struct ath_common *common ; struct ath_common *tmp ; { sc = (struct ath_softc *)hw->priv; tmp = ath9k_hw_common(sc->sc_ah); common = tmp; set_bit(5L, (unsigned long volatile *)(& common->op_flags)); return; } } static void ath9k_sw_scan_complete(struct ieee80211_hw *hw , struct ieee80211_vif *vif ) { struct ath_softc *sc ; struct ath_common *common ; struct ath_common *tmp ; { sc = (struct ath_softc *)hw->priv; tmp = ath9k_hw_common(sc->sc_ah); common = tmp; clear_bit(5L, (unsigned long volatile *)(& common->op_flags)); return; } } static void ath9k_cancel_pending_offchannel(struct ath_softc *sc ) { struct ath_common *common ; struct ath_common *tmp ; int tmp___0 ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; if ((unsigned long )sc->offchannel.roc_vif != (unsigned long )((struct ieee80211_vif *)0)) { if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "%s: Aborting RoC\n", "ath9k_cancel_pending_offchannel"); } else { } ldv_del_timer_sync_76(& sc->offchannel.timer); if ((unsigned int )sc->offchannel.state > 3U) { ath_roc_complete(sc, 1); } else { } } else { } tmp___0 = constant_test_bit(5L, (unsigned long const volatile *)(& common->op_flags)); if (tmp___0 != 0) { if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "%s: Aborting HW scan\n", "ath9k_cancel_pending_offchannel"); } else { } ldv_del_timer_sync_77(& sc->offchannel.timer); ath_scan_complete(sc, 1); } else { } return; } } static int ath9k_hw_scan(struct ieee80211_hw *hw , struct ieee80211_vif *vif , struct ieee80211_scan_request *hw_req ) { struct cfg80211_scan_request *req ; struct ath_softc *sc ; struct ath_common *common ; struct ath_common *tmp ; int ret ; int __ret_warn_on ; long tmp___0 ; long tmp___1 ; { req = & hw_req->req; sc = (struct ath_softc *)hw->priv; tmp = ath9k_hw_common(sc->sc_ah); common = tmp; ret = 0; mutex_lock_nested(& sc->mutex, 0U); __ret_warn_on = (unsigned long )sc->offchannel.scan_req != (unsigned long )((struct cfg80211_scan_request *)0); tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/12119/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/ath/ath9k/main.c", 2271); } else { } tmp___1 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___1 != 0L) { ret = -16; goto out; } else { } ath9k_ps_wakeup(sc); set_bit(5L, (unsigned long volatile *)(& common->op_flags)); sc->offchannel.scan_vif = vif; sc->offchannel.scan_req = req; sc->offchannel.scan_idx = 0; if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "HW scan request received on vif: %pM\n", (u8 *)(& vif->addr)); } else { } if ((unsigned int )sc->offchannel.state == 0U) { if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "Starting HW scan\n"); } else { } ath_offchannel_next(sc); } else { } out: mutex_unlock(& sc->mutex); return (ret); } } static void ath9k_cancel_hw_scan(struct ieee80211_hw *hw , struct ieee80211_vif *vif ) { struct ath_softc *sc ; struct ath_common *common ; struct ath_common *tmp ; { sc = (struct ath_softc *)hw->priv; tmp = ath9k_hw_common(sc->sc_ah); common = tmp; if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "Cancel HW scan on vif: %pM\n", (u8 *)(& vif->addr)); } else { } mutex_lock_nested(& sc->mutex, 0U); ldv_del_timer_sync_78(& sc->offchannel.timer); ath_scan_complete(sc, 1); mutex_unlock(& sc->mutex); return; } } static int ath9k_remain_on_channel(struct ieee80211_hw *hw , struct ieee80211_vif *vif , struct ieee80211_channel *chan , int duration , enum ieee80211_roc_type type ) { struct ath_softc *sc ; struct ath_common *common ; struct ath_common *tmp ; int ret ; int __ret_warn_on ; long tmp___0 ; long tmp___1 ; { sc = (struct ath_softc *)hw->priv; tmp = ath9k_hw_common(sc->sc_ah); common = tmp; ret = 0; mutex_lock_nested(& sc->mutex, 0U); __ret_warn_on = (unsigned long )sc->offchannel.roc_vif != (unsigned long )((struct ieee80211_vif *)0); tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/12119/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/ath/ath9k/main.c", 2321); } else { } tmp___1 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___1 != 0L) { ret = -16; goto out; } else { } ath9k_ps_wakeup(sc); sc->offchannel.roc_vif = vif; sc->offchannel.roc_chan = chan; sc->offchannel.roc_duration = duration; if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "RoC request on vif: %pM, type: %d duration: %d\n", (u8 *)(& vif->addr), (unsigned int )type, duration); } else { } if ((unsigned int )sc->offchannel.state == 0U) { if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "Starting RoC period\n"); } else { } ath_offchannel_next(sc); } else { } out: mutex_unlock(& sc->mutex); return (ret); } } static int ath9k_cancel_remain_on_channel(struct ieee80211_hw *hw ) { struct ath_softc *sc ; struct ath_common *common ; struct ath_common *tmp ; { sc = (struct ath_softc *)hw->priv; tmp = ath9k_hw_common(sc->sc_ah); common = tmp; mutex_lock_nested(& sc->mutex, 0U); if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "Cancel RoC\n"); } else { } ldv_del_timer_sync_79(& sc->offchannel.timer); if ((unsigned long )sc->offchannel.roc_vif != (unsigned long )((struct ieee80211_vif *)0)) { if ((unsigned int )sc->offchannel.state > 3U) { ath_roc_complete(sc, 1); } else { } } else { } mutex_unlock(& sc->mutex); return (0); } } static int ath9k_add_chanctx(struct ieee80211_hw *hw , struct ieee80211_chanctx_conf *conf ) { struct ath_softc *sc ; struct ath_common *common ; struct ath_common *tmp ; struct ath_chanctx *ctx ; struct ath_chanctx **ptr ; int pos ; { sc = (struct ath_softc *)hw->priv; tmp = ath9k_hw_common(sc->sc_ah); common = tmp; mutex_lock_nested(& sc->mutex, 0U); ctx = (struct ath_chanctx *)(& sc->chanctx); goto ldv_54725; ldv_54724: ; if ((int )ctx->assigned) { goto ldv_54723; } else { } ptr = (struct ath_chanctx **)(& conf->drv_priv); *ptr = ctx; ctx->assigned = 1; pos = (int )(((long )ctx - (long )(& sc->chanctx)) / 992L); ctx->hw_queue_base = pos * 4; if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "Add channel context: %d MHz\n", (int )(conf->def.chan)->center_freq); } else { } ath_chanctx_set_channel(sc, ctx, & conf->def); mutex_unlock(& sc->mutex); return (0); ldv_54723: ctx = ctx + 1; ldv_54725: ; if ((unsigned long )((struct ath_chanctx *)(& sc->chanctx) + 1UL) >= (unsigned long )ctx) { goto ldv_54724; } else { } mutex_unlock(& sc->mutex); return (-28); } } static void ath9k_remove_chanctx(struct ieee80211_hw *hw , struct ieee80211_chanctx_conf *conf ) { struct ath_softc *sc ; struct ath_common *common ; struct ath_common *tmp ; struct ath_chanctx *ctx ; struct ath_chanctx *tmp___0 ; { sc = (struct ath_softc *)hw->priv; tmp = ath9k_hw_common(sc->sc_ah); common = tmp; tmp___0 = ath_chanctx_get(conf); ctx = tmp___0; mutex_lock_nested(& sc->mutex, 0U); if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "Remove channel context: %d MHz\n", (int )(conf->def.chan)->center_freq); } else { } ctx->assigned = 0; ctx->hw_queue_base = 0; ath_chanctx_event(sc, (struct ieee80211_vif *)0, 7); mutex_unlock(& sc->mutex); return; } } static void ath9k_change_chanctx(struct ieee80211_hw *hw , struct ieee80211_chanctx_conf *conf , u32 changed ) { struct ath_softc *sc ; struct ath_common *common ; struct ath_common *tmp ; struct ath_chanctx *ctx ; struct ath_chanctx *tmp___0 ; { sc = (struct ath_softc *)hw->priv; tmp = ath9k_hw_common(sc->sc_ah); common = tmp; tmp___0 = ath_chanctx_get(conf); ctx = tmp___0; mutex_lock_nested(& sc->mutex, 0U); if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "Change channel context: %d MHz\n", (int )(conf->def.chan)->center_freq); } else { } ath_chanctx_set_channel(sc, ctx, & conf->def); mutex_unlock(& sc->mutex); return; } } static int ath9k_assign_vif_chanctx(struct ieee80211_hw *hw , struct ieee80211_vif *vif , struct ieee80211_chanctx_conf *conf ) { struct ath_softc *sc ; struct ath_common *common ; struct ath_common *tmp ; struct ath_vif *avp ; struct ath_chanctx *ctx ; struct ath_chanctx *tmp___0 ; int i ; { sc = (struct ath_softc *)hw->priv; tmp = ath9k_hw_common(sc->sc_ah); common = tmp; avp = (struct ath_vif *)(& vif->drv_priv); tmp___0 = ath_chanctx_get(conf); ctx = tmp___0; ath9k_cancel_pending_offchannel(sc); mutex_lock_nested(& sc->mutex, 0U); if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "Assign VIF (addr: %pM, type: %d, p2p: %d) to channel context: %d MHz\n", (u8 *)(& vif->addr), (unsigned int )vif->type, (int )vif->p2p, (int )(conf->def.chan)->center_freq); } else { } avp->chanctx = ctx; ctx->nvifs_assigned = (short )((int )ctx->nvifs_assigned + 1); list_add_tail(& avp->list, & ctx->vifs); ath9k_calculate_summary_state(sc, ctx); i = 0; goto ldv_54753; ldv_54752: vif->hw_queue[i] = (int )((u8 )ctx->hw_queue_base) + (int )((u8 )i); i = i + 1; ldv_54753: ; if (i <= 3) { goto ldv_54752; } else { } mutex_unlock(& sc->mutex); return (0); } } static void ath9k_unassign_vif_chanctx(struct ieee80211_hw *hw , struct ieee80211_vif *vif , struct ieee80211_chanctx_conf *conf ) { struct ath_softc *sc ; struct ath_common *common ; struct ath_common *tmp ; struct ath_vif *avp ; struct ath_chanctx *ctx ; struct ath_chanctx *tmp___0 ; int ac ; { sc = (struct ath_softc *)hw->priv; tmp = ath9k_hw_common(sc->sc_ah); common = tmp; avp = (struct ath_vif *)(& vif->drv_priv); tmp___0 = ath_chanctx_get(conf); ctx = tmp___0; ath9k_cancel_pending_offchannel(sc); mutex_lock_nested(& sc->mutex, 0U); if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "Remove VIF (addr: %pM, type: %d, p2p: %d) from channel context: %d MHz\n", (u8 *)(& vif->addr), (unsigned int )vif->type, (int )vif->p2p, (int )(conf->def.chan)->center_freq); } else { } avp->chanctx = (struct ath_chanctx *)0; ctx->nvifs_assigned = (short )((int )ctx->nvifs_assigned - 1); list_del(& avp->list); ath9k_calculate_summary_state(sc, ctx); ac = 0; goto ldv_54766; ldv_54765: vif->hw_queue[ac] = 255U; ac = ac + 1; ldv_54766: ; if (ac <= 3) { goto ldv_54765; } else { } mutex_unlock(& sc->mutex); return; } } static void ath9k_mgd_prepare_tx(struct ieee80211_hw *hw , struct ieee80211_vif *vif ) { struct ath_softc *sc ; struct ath_common *common ; struct ath_common *tmp ; struct ath_vif *avp ; struct ath_beacon_config *cur_conf ; struct ath_chanctx *go_ctx ; unsigned long timeout ; bool changed ; u32 beacon_int ; int tmp___0 ; unsigned long tmp___1 ; { sc = (struct ath_softc *)hw->priv; tmp = ath9k_hw_common(sc->sc_ah); common = tmp; avp = (struct ath_vif *)(& vif->drv_priv); changed = 0; tmp___0 = constant_test_bit(6L, (unsigned long const volatile *)(& common->op_flags)); if (tmp___0 == 0) { return; } else { } if ((unsigned long )avp->chanctx == (unsigned long )((struct ath_chanctx *)0)) { return; } else { } mutex_lock_nested(& sc->mutex, 0U); spin_lock_bh(& sc->chan_lock); if ((unsigned long )sc->next_chan != (unsigned long )((struct ath_chanctx *)0) || (unsigned long )sc->cur_chan != (unsigned long )avp->chanctx) { changed = 1; } else { } spin_unlock_bh(& sc->chan_lock); if (! changed) { goto out; } else { } ath9k_cancel_pending_offchannel(sc); go_ctx = ath_is_go_chanctx_present(sc); if ((unsigned long )go_ctx != (unsigned long )((struct ath_chanctx *)0)) { spin_lock_bh(& sc->chan_lock); sc->sched.mgd_prepare_tx = 1; cur_conf = & go_ctx->beacon; beacon_int = (u32 )(cur_conf->beacon_interval << 10); spin_unlock_bh(& sc->chan_lock); timeout = usecs_to_jiffies(beacon_int * 2U); init_completion(& sc->go_beacon); mutex_unlock(& sc->mutex); tmp___1 = wait_for_completion_timeout(& sc->go_beacon, timeout); if (tmp___1 == 0UL) { if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "Failed to send new NoA\n"); } else { } spin_lock_bh(& sc->chan_lock); sc->sched.mgd_prepare_tx = 0; spin_unlock_bh(& sc->chan_lock); } else { } mutex_lock_nested(& sc->mutex, 0U); } else { } if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "%s: Set chanctx state to FORCE_ACTIVE for vif: %pM\n", "ath9k_mgd_prepare_tx", (u8 *)(& vif->addr)); } else { } spin_lock_bh(& sc->chan_lock); sc->next_chan = avp->chanctx; sc->sched.state = 4; spin_unlock_bh(& sc->chan_lock); ath_chanctx_set_next(sc, 1); out: mutex_unlock(& sc->mutex); return; } } void ath9k_fill_chanctx_ops(void) { bool tmp ; int tmp___0 ; { tmp = ath9k_is_chanctx_enabled(); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { return; } else { } ath9k_ops.hw_scan = & ath9k_hw_scan; ath9k_ops.cancel_hw_scan = & ath9k_cancel_hw_scan; ath9k_ops.remain_on_channel = & ath9k_remain_on_channel; ath9k_ops.cancel_remain_on_channel = & ath9k_cancel_remain_on_channel; ath9k_ops.add_chanctx = & ath9k_add_chanctx; ath9k_ops.remove_chanctx = & ath9k_remove_chanctx; ath9k_ops.change_chanctx = & ath9k_change_chanctx; ath9k_ops.assign_vif_chanctx = & ath9k_assign_vif_chanctx; ath9k_ops.unassign_vif_chanctx = & ath9k_unassign_vif_chanctx; ath9k_ops.mgd_prepare_tx = & ath9k_mgd_prepare_tx; return; } } static int ath9k_get_txpower(struct ieee80211_hw *hw , struct ieee80211_vif *vif , int *dbm ) { struct ath_softc *sc ; struct ath_vif *avp ; { sc = (struct ath_softc *)hw->priv; avp = (struct ath_vif *)(& vif->drv_priv); mutex_lock_nested(& sc->mutex, 0U); if ((unsigned long )avp->chanctx != (unsigned long )((struct ath_chanctx *)0)) { *dbm = (int )(avp->chanctx)->cur_txpower; } else { *dbm = (int )(sc->cur_chan)->cur_txpower; } mutex_unlock(& sc->mutex); *dbm = *dbm / 2; return (0); } } struct ieee80211_ops ath9k_ops = {& ath9k_tx, & ath9k_start, & ath9k_stop, & ath9k_suspend, & ath9k_resume, & ath9k_set_wakeup, & ath9k_add_interface, & ath9k_change_interface, & ath9k_remove_interface, & ath9k_config, & ath9k_bss_info_changed, 0, 0, 0, & ath9k_configure_filter, 0, & ath9k_set_key, 0, 0, 0, 0, 0, 0, 0, & ath9k_sw_scan_start, & ath9k_sw_scan_complete, & ath9k_get_stats, 0, 0, 0, 0, 0, & ath9k_sta_add_debugfs, 0, & ath9k_sta_notify, & ath9k_sta_state, 0, 0, 0, 0, & ath9k_conf_tx, & ath9k_get_tsf, & ath9k_set_tsf, & ath9k_reset_tsf, & ath9k_tx_last_beacon, & ath9k_ampdu_action, & ath9k_get_survey, & ath9k_rfkill_poll_state, & ath9k_set_coverage_class, 0, 0, & ath9k_flush, 0, & ath9k_set_antenna, & ath9k_get_antenna, 0, 0, 0, 0, & ath9k_tx_frames_pending, 0, 0, 0, & ath9k_release_buffered_frames, & ath9k_get_et_sset_count, & ath9k_get_et_stats, & ath9k_get_et_strings, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & ath9k_get_txpower, 0, 0, 0, 0}; int ldv_retval_40 ; void ldv_initialize_ieee80211_ops_38(void) { void *tmp ; { tmp = ldv_init_zalloc(160UL); ath9k_ops_group0 = (struct ieee80211_hw *)tmp; return; } } void ldv_main_exported_38(void) { enum ieee80211_sta_state ldvarg117 ; struct survey_info *ldvarg159 ; void *tmp ; u32 *ldvarg143 ; void *tmp___0 ; struct dentry *ldvarg171 ; void *tmp___1 ; enum nl80211_iftype ldvarg127 ; struct ieee80211_vif *ldvarg116 ; void *tmp___2 ; struct ieee80211_sta *ldvarg183 ; void *tmp___3 ; unsigned int ldvarg166 ; enum ieee80211_ampdu_mlme_action ldvarg135 ; bool ldvarg156 ; u8 *ldvarg153 ; void *tmp___4 ; u32 ldvarg177 ; u16 ldvarg123 ; bool ldvarg126 ; struct ieee80211_vif *ldvarg184 ; void *tmp___5 ; struct ieee80211_key_conf *ldvarg186 ; void *tmp___6 ; struct ieee80211_sta *ldvarg172 ; void *tmp___7 ; struct ieee80211_vif *ldvarg128 ; void *tmp___8 ; u32 *ldvarg144 ; void *tmp___9 ; int ldvarg122 ; struct ieee80211_vif *ldvarg137 ; void *tmp___10 ; u32 ldvarg187 ; u32 ldvarg154 ; int ldvarg151 ; int ldvarg160 ; struct ieee80211_vif *ldvarg158 ; void *tmp___11 ; u64 *ldvarg161 ; void *tmp___12 ; struct ieee80211_vif *ldvarg142 ; void *tmp___13 ; struct ieee80211_vif *ldvarg163 ; void *tmp___14 ; struct ieee80211_vif *ldvarg170 ; void *tmp___15 ; struct ieee80211_low_level_stats *ldvarg132 ; void *tmp___16 ; struct ieee80211_vif *ldvarg152 ; void *tmp___17 ; u16 ldvarg140 ; struct sk_buff *ldvarg167 ; void *tmp___18 ; struct ieee80211_tx_control *ldvarg168 ; void *tmp___19 ; unsigned int *ldvarg165 ; void *tmp___20 ; struct ieee80211_bss_conf *ldvarg181 ; void *tmp___21 ; u8 ldvarg136 ; struct ieee80211_sta *ldvarg118 ; void *tmp___22 ; struct ieee80211_vif *ldvarg141 ; void *tmp___23 ; struct ieee80211_vif *ldvarg148 ; void *tmp___24 ; struct ieee80211_tx_queue_params *ldvarg139 ; void *tmp___25 ; struct ethtool_stats *ldvarg162 ; void *tmp___26 ; u8 *ldvarg130 ; void *tmp___27 ; struct ieee80211_vif *ldvarg150 ; void *tmp___28 ; u32 ldvarg180 ; struct cfg80211_wowlan *ldvarg179 ; void *tmp___29 ; struct ieee80211_vif *ldvarg173 ; void *tmp___30 ; u16 *ldvarg133 ; void *tmp___31 ; struct ieee80211_vif *ldvarg176 ; void *tmp___32 ; struct ieee80211_sta *ldvarg124 ; void *tmp___33 ; u64 ldvarg164 ; struct ieee80211_vif *ldvarg147 ; void *tmp___34 ; struct ieee80211_vif *ldvarg119 ; void *tmp___35 ; enum ieee80211_sta_state ldvarg120 ; enum sta_notify_cmd ldvarg175 ; bool ldvarg121 ; s16 ldvarg149 ; u64 ldvarg169 ; struct ieee80211_vif *ldvarg129 ; void *tmp___36 ; u16 ldvarg138 ; struct ieee80211_vif *ldvarg182 ; void *tmp___37 ; bool ldvarg145 ; struct ieee80211_vif *ldvarg155 ; void *tmp___38 ; enum ieee80211_frame_release_type ldvarg125 ; enum set_key_cmd ldvarg185 ; struct ieee80211_sta *ldvarg174 ; void *tmp___39 ; int *ldvarg157 ; void *tmp___40 ; u32 ldvarg178 ; u32 ldvarg146 ; struct ieee80211_sta *ldvarg134 ; void *tmp___41 ; struct ieee80211_vif *ldvarg131 ; void *tmp___42 ; int tmp___43 ; { tmp = ldv_init_zalloc(64UL); ldvarg159 = (struct survey_info *)tmp; tmp___0 = ldv_init_zalloc(4UL); ldvarg143 = (u32 *)tmp___0; tmp___1 = ldv_init_zalloc(320UL); ldvarg171 = (struct dentry *)tmp___1; tmp___2 = ldv_init_zalloc(296UL); ldvarg116 = (struct ieee80211_vif *)tmp___2; tmp___3 = ldv_init_zalloc(216UL); ldvarg183 = (struct ieee80211_sta *)tmp___3; tmp___4 = ldv_init_zalloc(1UL); ldvarg153 = (u8 *)tmp___4; tmp___5 = ldv_init_zalloc(296UL); ldvarg184 = (struct ieee80211_vif *)tmp___5; tmp___6 = ldv_init_zalloc(24UL); ldvarg186 = (struct ieee80211_key_conf *)tmp___6; tmp___7 = ldv_init_zalloc(216UL); ldvarg172 = (struct ieee80211_sta *)tmp___7; tmp___8 = ldv_init_zalloc(296UL); ldvarg128 = (struct ieee80211_vif *)tmp___8; tmp___9 = ldv_init_zalloc(4UL); ldvarg144 = (u32 *)tmp___9; tmp___10 = ldv_init_zalloc(296UL); ldvarg137 = (struct ieee80211_vif *)tmp___10; tmp___11 = ldv_init_zalloc(296UL); ldvarg158 = (struct ieee80211_vif *)tmp___11; tmp___12 = ldv_init_zalloc(8UL); ldvarg161 = (u64 *)tmp___12; tmp___13 = ldv_init_zalloc(296UL); ldvarg142 = (struct ieee80211_vif *)tmp___13; tmp___14 = ldv_init_zalloc(296UL); ldvarg163 = (struct ieee80211_vif *)tmp___14; tmp___15 = ldv_init_zalloc(296UL); ldvarg170 = (struct ieee80211_vif *)tmp___15; tmp___16 = ldv_init_zalloc(16UL); ldvarg132 = (struct ieee80211_low_level_stats *)tmp___16; tmp___17 = ldv_init_zalloc(296UL); ldvarg152 = (struct ieee80211_vif *)tmp___17; tmp___18 = ldv_init_zalloc(232UL); ldvarg167 = (struct sk_buff *)tmp___18; tmp___19 = ldv_init_zalloc(8UL); ldvarg168 = (struct ieee80211_tx_control *)tmp___19; tmp___20 = ldv_init_zalloc(4UL); ldvarg165 = (unsigned int *)tmp___20; tmp___21 = ldv_init_zalloc(240UL); ldvarg181 = (struct ieee80211_bss_conf *)tmp___21; tmp___22 = ldv_init_zalloc(216UL); ldvarg118 = (struct ieee80211_sta *)tmp___22; tmp___23 = ldv_init_zalloc(296UL); ldvarg141 = (struct ieee80211_vif *)tmp___23; tmp___24 = ldv_init_zalloc(296UL); ldvarg148 = (struct ieee80211_vif *)tmp___24; tmp___25 = ldv_init_zalloc(10UL); ldvarg139 = (struct ieee80211_tx_queue_params *)tmp___25; tmp___26 = ldv_init_zalloc(8UL); ldvarg162 = (struct ethtool_stats *)tmp___26; tmp___27 = ldv_init_zalloc(1UL); ldvarg130 = (u8 *)tmp___27; tmp___28 = ldv_init_zalloc(296UL); ldvarg150 = (struct ieee80211_vif *)tmp___28; tmp___29 = ldv_init_zalloc(40UL); ldvarg179 = (struct cfg80211_wowlan *)tmp___29; tmp___30 = ldv_init_zalloc(296UL); ldvarg173 = (struct ieee80211_vif *)tmp___30; tmp___31 = ldv_init_zalloc(2UL); ldvarg133 = (u16 *)tmp___31; tmp___32 = ldv_init_zalloc(296UL); ldvarg176 = (struct ieee80211_vif *)tmp___32; tmp___33 = ldv_init_zalloc(216UL); ldvarg124 = (struct ieee80211_sta *)tmp___33; tmp___34 = ldv_init_zalloc(296UL); ldvarg147 = (struct ieee80211_vif *)tmp___34; tmp___35 = ldv_init_zalloc(296UL); ldvarg119 = (struct ieee80211_vif *)tmp___35; tmp___36 = ldv_init_zalloc(296UL); ldvarg129 = (struct ieee80211_vif *)tmp___36; tmp___37 = ldv_init_zalloc(296UL); ldvarg182 = (struct ieee80211_vif *)tmp___37; tmp___38 = ldv_init_zalloc(296UL); ldvarg155 = (struct ieee80211_vif *)tmp___38; tmp___39 = ldv_init_zalloc(216UL); ldvarg174 = (struct ieee80211_sta *)tmp___39; tmp___40 = ldv_init_zalloc(4UL); ldvarg157 = (int *)tmp___40; tmp___41 = ldv_init_zalloc(216UL); ldvarg134 = (struct ieee80211_sta *)tmp___41; tmp___42 = ldv_init_zalloc(296UL); ldvarg131 = (struct ieee80211_vif *)tmp___42; ldv_memset((void *)(& ldvarg117), 0, 4UL); ldv_memset((void *)(& ldvarg127), 0, 4UL); ldv_memset((void *)(& ldvarg166), 0, 4UL); ldv_memset((void *)(& ldvarg135), 0, 4UL); ldv_memset((void *)(& ldvarg156), 0, 1UL); ldv_memset((void *)(& ldvarg177), 0, 4UL); ldv_memset((void *)(& ldvarg123), 0, 2UL); ldv_memset((void *)(& ldvarg126), 0, 1UL); ldv_memset((void *)(& ldvarg122), 0, 4UL); ldv_memset((void *)(& ldvarg187), 0, 4UL); ldv_memset((void *)(& ldvarg154), 0, 4UL); ldv_memset((void *)(& ldvarg151), 0, 4UL); ldv_memset((void *)(& ldvarg160), 0, 4UL); ldv_memset((void *)(& ldvarg140), 0, 2UL); ldv_memset((void *)(& ldvarg136), 0, 1UL); ldv_memset((void *)(& ldvarg180), 0, 4UL); ldv_memset((void *)(& ldvarg164), 0, 8UL); ldv_memset((void *)(& ldvarg120), 0, 4UL); ldv_memset((void *)(& ldvarg175), 0, 4UL); ldv_memset((void *)(& ldvarg121), 0, 1UL); ldv_memset((void *)(& ldvarg149), 0, 2UL); ldv_memset((void *)(& ldvarg169), 0, 8UL); ldv_memset((void *)(& ldvarg138), 0, 2UL); ldv_memset((void *)(& ldvarg145), 0, 1UL); ldv_memset((void *)(& ldvarg125), 0, 4UL); ldv_memset((void *)(& ldvarg185), 0, 4UL); ldv_memset((void *)(& ldvarg178), 0, 4UL); ldv_memset((void *)(& ldvarg146), 0, 4UL); tmp___43 = __VERIFIER_nondet_int(); switch (tmp___43) { case 0: ; if (ldv_state_variable_38 == 2) { ath9k_config(ath9k_ops_group0, ldvarg187); ldv_state_variable_38 = 2; } else { } if (ldv_state_variable_38 == 1) { ath9k_config(ath9k_ops_group0, ldvarg187); ldv_state_variable_38 = 1; } else { } goto ldv_54873; case 1: ; if (ldv_state_variable_38 == 2) { ath9k_set_key(ath9k_ops_group0, ldvarg185, ldvarg184, ldvarg183, ldvarg186); ldv_state_variable_38 = 2; } else { } if (ldv_state_variable_38 == 1) { ath9k_set_key(ath9k_ops_group0, ldvarg185, ldvarg184, ldvarg183, ldvarg186); ldv_state_variable_38 = 1; } else { } goto ldv_54873; case 2: ; if (ldv_state_variable_38 == 2) { ath9k_bss_info_changed(ath9k_ops_group0, ldvarg182, ldvarg181, ldvarg180); ldv_state_variable_38 = 2; } else { } if (ldv_state_variable_38 == 1) { ath9k_bss_info_changed(ath9k_ops_group0, ldvarg182, ldvarg181, ldvarg180); ldv_state_variable_38 = 1; } else { } goto ldv_54873; case 3: ; if (ldv_state_variable_38 == 2) { ath9k_suspend(ath9k_ops_group0, ldvarg179); ldv_state_variable_38 = 2; } else { } if (ldv_state_variable_38 == 1) { ath9k_suspend(ath9k_ops_group0, ldvarg179); ldv_state_variable_38 = 1; } else { } goto ldv_54873; case 4: ; if (ldv_state_variable_38 == 2) { ath9k_set_antenna(ath9k_ops_group0, ldvarg178, ldvarg177); ldv_state_variable_38 = 2; } else { } if (ldv_state_variable_38 == 1) { ath9k_set_antenna(ath9k_ops_group0, ldvarg178, ldvarg177); ldv_state_variable_38 = 1; } else { } goto ldv_54873; case 5: ; if (ldv_state_variable_38 == 2) { ath9k_sta_notify(ath9k_ops_group0, ldvarg176, ldvarg175, ldvarg174); ldv_state_variable_38 = 2; } else { } if (ldv_state_variable_38 == 1) { ath9k_sta_notify(ath9k_ops_group0, ldvarg176, ldvarg175, ldvarg174); ldv_state_variable_38 = 1; } else { } goto ldv_54873; case 6: ; if (ldv_state_variable_38 == 2) { ath9k_sta_add_debugfs(ath9k_ops_group0, ldvarg173, ldvarg172, ldvarg171); ldv_state_variable_38 = 2; } else { } if (ldv_state_variable_38 == 1) { ath9k_sta_add_debugfs(ath9k_ops_group0, ldvarg173, ldvarg172, ldvarg171); ldv_state_variable_38 = 1; } else { } goto ldv_54873; case 7: ; if (ldv_state_variable_38 == 2) { ath9k_stop(ath9k_ops_group0); ldv_state_variable_38 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_54873; case 8: ; if (ldv_state_variable_38 == 2) { ath9k_set_tsf(ath9k_ops_group0, ldvarg170, ldvarg169); ldv_state_variable_38 = 2; } else { } if (ldv_state_variable_38 == 1) { ath9k_set_tsf(ath9k_ops_group0, ldvarg170, ldvarg169); ldv_state_variable_38 = 1; } else { } goto ldv_54873; case 9: ; if (ldv_state_variable_38 == 2) { ath9k_tx(ath9k_ops_group0, ldvarg168, ldvarg167); ldv_state_variable_38 = 2; } else { } if (ldv_state_variable_38 == 1) { ath9k_tx(ath9k_ops_group0, ldvarg168, ldvarg167); ldv_state_variable_38 = 1; } else { } goto ldv_54873; case 10: ; if (ldv_state_variable_38 == 2) { ath9k_resume(ath9k_ops_group0); ldv_state_variable_38 = 2; } else { } if (ldv_state_variable_38 == 1) { ath9k_resume(ath9k_ops_group0); ldv_state_variable_38 = 1; } else { } goto ldv_54873; case 11: ; if (ldv_state_variable_38 == 2) { ath9k_configure_filter(ath9k_ops_group0, ldvarg166, ldvarg165, ldvarg164); ldv_state_variable_38 = 2; } else { } if (ldv_state_variable_38 == 1) { ath9k_configure_filter(ath9k_ops_group0, ldvarg166, ldvarg165, ldvarg164); ldv_state_variable_38 = 1; } else { } goto ldv_54873; case 12: ; if (ldv_state_variable_38 == 2) { ath9k_get_et_stats(ath9k_ops_group0, ldvarg163, ldvarg162, ldvarg161); ldv_state_variable_38 = 2; } else { } if (ldv_state_variable_38 == 1) { ath9k_get_et_stats(ath9k_ops_group0, ldvarg163, ldvarg162, ldvarg161); ldv_state_variable_38 = 1; } else { } goto ldv_54873; case 13: ; if (ldv_state_variable_38 == 2) { ath9k_get_survey(ath9k_ops_group0, ldvarg160, ldvarg159); ldv_state_variable_38 = 2; } else { } if (ldv_state_variable_38 == 1) { ath9k_get_survey(ath9k_ops_group0, ldvarg160, ldvarg159); ldv_state_variable_38 = 1; } else { } goto ldv_54873; case 14: ; if (ldv_state_variable_38 == 2) { ath9k_get_txpower(ath9k_ops_group0, ldvarg158, ldvarg157); ldv_state_variable_38 = 2; } else { } if (ldv_state_variable_38 == 1) { ath9k_get_txpower(ath9k_ops_group0, ldvarg158, ldvarg157); ldv_state_variable_38 = 1; } else { } goto ldv_54873; case 15: ; if (ldv_state_variable_38 == 2) { ath9k_set_wakeup(ath9k_ops_group0, (int )ldvarg156); ldv_state_variable_38 = 2; } else { } if (ldv_state_variable_38 == 1) { ath9k_set_wakeup(ath9k_ops_group0, (int )ldvarg156); ldv_state_variable_38 = 1; } else { } goto ldv_54873; case 16: ; if (ldv_state_variable_38 == 2) { ath9k_get_et_strings(ath9k_ops_group0, ldvarg155, ldvarg154, ldvarg153); ldv_state_variable_38 = 2; } else { } if (ldv_state_variable_38 == 1) { ath9k_get_et_strings(ath9k_ops_group0, ldvarg155, ldvarg154, ldvarg153); ldv_state_variable_38 = 1; } else { } goto ldv_54873; case 17: ; if (ldv_state_variable_38 == 2) { ath9k_get_et_sset_count(ath9k_ops_group0, ldvarg152, ldvarg151); ldv_state_variable_38 = 2; } else { } if (ldv_state_variable_38 == 1) { ath9k_get_et_sset_count(ath9k_ops_group0, ldvarg152, ldvarg151); ldv_state_variable_38 = 1; } else { } goto ldv_54873; case 18: ; if (ldv_state_variable_38 == 2) { ath9k_reset_tsf(ath9k_ops_group0, ldvarg150); ldv_state_variable_38 = 2; } else { } if (ldv_state_variable_38 == 1) { ath9k_reset_tsf(ath9k_ops_group0, ldvarg150); ldv_state_variable_38 = 1; } else { } goto ldv_54873; case 19: ; if (ldv_state_variable_38 == 1) { ldv_retval_40 = ath9k_start(ath9k_ops_group0); if (ldv_retval_40 == 0) { ldv_state_variable_38 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_54873; case 20: ; if (ldv_state_variable_38 == 2) { ath9k_set_coverage_class(ath9k_ops_group0, (int )ldvarg149); ldv_state_variable_38 = 2; } else { } if (ldv_state_variable_38 == 1) { ath9k_set_coverage_class(ath9k_ops_group0, (int )ldvarg149); ldv_state_variable_38 = 1; } else { } goto ldv_54873; case 21: ; if (ldv_state_variable_38 == 2) { ath9k_get_tsf(ath9k_ops_group0, ldvarg148); ldv_state_variable_38 = 2; } else { } if (ldv_state_variable_38 == 1) { ath9k_get_tsf(ath9k_ops_group0, ldvarg148); ldv_state_variable_38 = 1; } else { } goto ldv_54873; case 22: ; if (ldv_state_variable_38 == 2) { ath9k_flush(ath9k_ops_group0, ldvarg147, ldvarg146, (int )ldvarg145); ldv_state_variable_38 = 2; } else { } if (ldv_state_variable_38 == 1) { ath9k_flush(ath9k_ops_group0, ldvarg147, ldvarg146, (int )ldvarg145); ldv_state_variable_38 = 1; } else { } goto ldv_54873; case 23: ; if (ldv_state_variable_38 == 2) { ath9k_tx_frames_pending(ath9k_ops_group0); ldv_state_variable_38 = 2; } else { } if (ldv_state_variable_38 == 1) { ath9k_tx_frames_pending(ath9k_ops_group0); ldv_state_variable_38 = 1; } else { } goto ldv_54873; case 24: ; if (ldv_state_variable_38 == 2) { ath9k_get_antenna(ath9k_ops_group0, ldvarg144, ldvarg143); ldv_state_variable_38 = 2; } else { } if (ldv_state_variable_38 == 1) { ath9k_get_antenna(ath9k_ops_group0, ldvarg144, ldvarg143); ldv_state_variable_38 = 1; } else { } goto ldv_54873; case 25: ; if (ldv_state_variable_38 == 2) { ath9k_sw_scan_complete(ath9k_ops_group0, ldvarg142); ldv_state_variable_38 = 2; } else { } if (ldv_state_variable_38 == 1) { ath9k_sw_scan_complete(ath9k_ops_group0, ldvarg142); ldv_state_variable_38 = 1; } else { } goto ldv_54873; case 26: ; if (ldv_state_variable_38 == 2) { ath9k_conf_tx(ath9k_ops_group0, ldvarg141, (int )ldvarg140, (struct ieee80211_tx_queue_params const *)ldvarg139); ldv_state_variable_38 = 2; } else { } if (ldv_state_variable_38 == 1) { ath9k_conf_tx(ath9k_ops_group0, ldvarg141, (int )ldvarg140, (struct ieee80211_tx_queue_params const *)ldvarg139); ldv_state_variable_38 = 1; } else { } goto ldv_54873; case 27: ; if (ldv_state_variable_38 == 2) { ath9k_ampdu_action(ath9k_ops_group0, ldvarg137, ldvarg135, ldvarg134, (int )ldvarg138, ldvarg133, (int )ldvarg136); ldv_state_variable_38 = 2; } else { } if (ldv_state_variable_38 == 1) { ath9k_ampdu_action(ath9k_ops_group0, ldvarg137, ldvarg135, ldvarg134, (int )ldvarg138, ldvarg133, (int )ldvarg136); ldv_state_variable_38 = 1; } else { } goto ldv_54873; case 28: ; if (ldv_state_variable_38 == 2) { ath9k_tx_last_beacon(ath9k_ops_group0); ldv_state_variable_38 = 2; } else { } if (ldv_state_variable_38 == 1) { ath9k_tx_last_beacon(ath9k_ops_group0); ldv_state_variable_38 = 1; } else { } goto ldv_54873; case 29: ; if (ldv_state_variable_38 == 2) { ath9k_get_stats(ath9k_ops_group0, ldvarg132); ldv_state_variable_38 = 2; } else { } if (ldv_state_variable_38 == 1) { ath9k_get_stats(ath9k_ops_group0, ldvarg132); ldv_state_variable_38 = 1; } else { } goto ldv_54873; case 30: ; if (ldv_state_variable_38 == 2) { ath9k_rfkill_poll_state(ath9k_ops_group0); ldv_state_variable_38 = 2; } else { } if (ldv_state_variable_38 == 1) { ath9k_rfkill_poll_state(ath9k_ops_group0); ldv_state_variable_38 = 1; } else { } goto ldv_54873; case 31: ; if (ldv_state_variable_38 == 2) { ath9k_sw_scan_start(ath9k_ops_group0, ldvarg131, (u8 const *)ldvarg130); ldv_state_variable_38 = 2; } else { } if (ldv_state_variable_38 == 1) { ath9k_sw_scan_start(ath9k_ops_group0, ldvarg131, (u8 const *)ldvarg130); ldv_state_variable_38 = 1; } else { } goto ldv_54873; case 32: ; if (ldv_state_variable_38 == 2) { ath9k_add_interface(ath9k_ops_group0, ldvarg129); ldv_state_variable_38 = 2; } else { } if (ldv_state_variable_38 == 1) { ath9k_add_interface(ath9k_ops_group0, ldvarg129); ldv_state_variable_38 = 1; } else { } goto ldv_54873; case 33: ; if (ldv_state_variable_38 == 2) { ath9k_change_interface(ath9k_ops_group0, ldvarg128, ldvarg127, (int )ldvarg126); ldv_state_variable_38 = 2; } else { } if (ldv_state_variable_38 == 1) { ath9k_change_interface(ath9k_ops_group0, ldvarg128, ldvarg127, (int )ldvarg126); ldv_state_variable_38 = 1; } else { } goto ldv_54873; case 34: ; if (ldv_state_variable_38 == 2) { ath9k_release_buffered_frames(ath9k_ops_group0, ldvarg124, (int )ldvarg123, ldvarg122, ldvarg125, (int )ldvarg121); ldv_state_variable_38 = 2; } else { } if (ldv_state_variable_38 == 1) { ath9k_release_buffered_frames(ath9k_ops_group0, ldvarg124, (int )ldvarg123, ldvarg122, ldvarg125, (int )ldvarg121); ldv_state_variable_38 = 1; } else { } goto ldv_54873; case 35: ; if (ldv_state_variable_38 == 2) { ath9k_sta_state(ath9k_ops_group0, ldvarg119, ldvarg118, ldvarg117, ldvarg120); ldv_state_variable_38 = 2; } else { } if (ldv_state_variable_38 == 1) { ath9k_sta_state(ath9k_ops_group0, ldvarg119, ldvarg118, ldvarg117, ldvarg120); ldv_state_variable_38 = 1; } else { } goto ldv_54873; case 36: ; if (ldv_state_variable_38 == 2) { ath9k_remove_interface(ath9k_ops_group0, ldvarg116); ldv_state_variable_38 = 2; } else { } if (ldv_state_variable_38 == 1) { ath9k_remove_interface(ath9k_ops_group0, ldvarg116); ldv_state_variable_38 = 1; } else { } goto ldv_54873; default: ldv_stop(); } ldv_54873: ; return; } } bool ldv_queue_work_on_63(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_64(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_65(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_66(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_7(2); return; } } bool ldv_queue_delayed_work_on_67(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } int ldv_del_timer_sync_68(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___3 ldv_func_res ; int tmp ; { tmp = del_timer_sync(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_14(ldv_func_arg1); return (ldv_func_res); } } int ldv_mod_timer_69(struct timer_list *ldv_func_arg1 , unsigned long ldv_func_arg2 ) { ldv_func_ret_type___4 ldv_func_res ; int tmp ; { tmp = mod_timer(ldv_func_arg1, ldv_func_arg2); ldv_func_res = tmp; activate_pending_timer_14(ldv_func_arg1, ldv_func_arg2, 1); return (ldv_func_res); } } bool ldv_cancel_work_sync_70(struct work_struct *ldv_func_arg1 ) { ldv_func_ret_type___10 ldv_func_res ; bool tmp ; { tmp = cancel_work_sync(ldv_func_arg1); ldv_func_res = tmp; disable_work_7(ldv_func_arg1); return (ldv_func_res); } } bool ldv_cancel_delayed_work_sync_71(struct delayed_work *ldv_func_arg1 ) { ldv_func_ret_type___11 ldv_func_res ; bool tmp ; { tmp = cancel_delayed_work_sync(ldv_func_arg1); ldv_func_res = tmp; disable_work_7(& ldv_func_arg1->work); return (ldv_func_res); } } bool ldv_cancel_delayed_work_sync_72(struct delayed_work *ldv_func_arg1 ) { ldv_func_ret_type___12 ldv_func_res ; bool tmp ; { tmp = cancel_delayed_work_sync(ldv_func_arg1); ldv_func_res = tmp; disable_work_7(& ldv_func_arg1->work); return (ldv_func_res); } } bool ldv_cancel_work_sync_73(struct work_struct *ldv_func_arg1 ) { ldv_func_ret_type___13 ldv_func_res ; bool tmp ; { tmp = cancel_work_sync(ldv_func_arg1); ldv_func_res = tmp; disable_work_7(ldv_func_arg1); return (ldv_func_res); } } bool ldv_cancel_work_sync_74(struct work_struct *ldv_func_arg1 ) { ldv_func_ret_type___14 ldv_func_res ; bool tmp ; { tmp = cancel_work_sync(ldv_func_arg1); ldv_func_res = tmp; disable_work_7(ldv_func_arg1); return (ldv_func_res); } } bool ldv_cancel_delayed_work_sync_75(struct delayed_work *ldv_func_arg1 ) { ldv_func_ret_type___15 ldv_func_res ; bool tmp ; { tmp = cancel_delayed_work_sync(ldv_func_arg1); ldv_func_res = tmp; disable_work_7(& ldv_func_arg1->work); return (ldv_func_res); } } int ldv_del_timer_sync_76(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___16 ldv_func_res ; int tmp ; { tmp = del_timer_sync(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_14(ldv_func_arg1); return (ldv_func_res); } } int ldv_del_timer_sync_77(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___17 ldv_func_res ; int tmp ; { tmp = del_timer_sync(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_14(ldv_func_arg1); return (ldv_func_res); } } int ldv_del_timer_sync_78(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___18 ldv_func_res ; int tmp ; { tmp = del_timer_sync(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_14(ldv_func_arg1); return (ldv_func_res); } } int ldv_del_timer_sync_79(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___19 ldv_func_res ; int tmp ; { tmp = del_timer_sync(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_14(ldv_func_arg1); return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; extern void __list_del_entry(struct list_head * ) ; __inline static void list_del_init(struct list_head *entry ) { { __list_del_entry(entry); INIT_LIST_HEAD(entry); return; } } __inline static int list_is_last(struct list_head const *list , struct list_head const *head ) { { return ((unsigned long )((struct list_head const *)list->next) == (unsigned long )head); } } bool ldv_queue_work_on_101(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_103(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_102(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; bool ldv_queue_delayed_work_on_105(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; void ldv_flush_workqueue_104(struct workqueue_struct *ldv_func_arg1 ) ; 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 ) ; __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" (108), "i" (12UL)); ldv_25220: ; goto ldv_25220; } 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" (120), "i" (12UL)); ldv_25228: ; goto ldv_25228; } 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; } } extern void consume_skb(struct sk_buff * ) ; extern int pskb_expand_head(struct sk_buff * , int , int , gfp_t ) ; __inline static struct sk_buff *skb_peek(struct sk_buff_head const *list_ ) { struct sk_buff *skb ; { skb = list_->next; if ((unsigned long )skb == (unsigned long )((struct sk_buff *)list_)) { skb = (struct sk_buff *)0; } else { } return (skb); } } __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_insert(struct sk_buff *newsk , struct sk_buff *prev , struct sk_buff *next , struct sk_buff_head *list ) { struct sk_buff *tmp ; { newsk->__annonCompField68.__annonCompField67.next = next; newsk->__annonCompField68.__annonCompField67.prev = prev; tmp = newsk; prev->__annonCompField68.__annonCompField67.next = tmp; next->__annonCompField68.__annonCompField67.prev = tmp; list->qlen = list->qlen + 1U; return; } } __inline static void __skb_queue_before(struct sk_buff_head *list , struct sk_buff *next , struct sk_buff *newsk ) { { __skb_insert(newsk, next->__annonCompField68.__annonCompField67.prev, next, list); return; } } __inline static void __skb_queue_tail(struct sk_buff_head *list , struct sk_buff *newsk ) { { __skb_queue_before(list, (struct sk_buff *)list, newsk); return; } } __inline static void __skb_unlink(struct sk_buff *skb , struct sk_buff_head *list ) { struct sk_buff *next ; struct sk_buff *prev ; struct sk_buff *tmp ; { list->qlen = list->qlen - 1U; next = skb->__annonCompField68.__annonCompField67.next; prev = skb->__annonCompField68.__annonCompField67.prev; tmp = (struct sk_buff *)0; skb->__annonCompField68.__annonCompField67.prev = tmp; skb->__annonCompField68.__annonCompField67.next = tmp; next->__annonCompField68.__annonCompField67.prev = prev; prev->__annonCompField68.__annonCompField67.next = next; return; } } __inline static struct sk_buff *__skb_dequeue(struct sk_buff_head *list ) { struct sk_buff *skb ; struct sk_buff *tmp ; { tmp = skb_peek((struct sk_buff_head const *)list); skb = tmp; if ((unsigned long )skb != (unsigned long )((struct sk_buff *)0)) { __skb_unlink(skb, list); } else { } return (skb); } } __inline static bool skb_is_nonlinear(struct sk_buff const *skb ) { { return ((unsigned int )skb->data_len != 0U); } } extern unsigned char *skb_put(struct sk_buff * , unsigned int ) ; extern unsigned char *skb_pull(struct sk_buff * , unsigned int ) ; __inline static int skb_tailroom(struct sk_buff const *skb ) { bool tmp ; { tmp = skb_is_nonlinear(skb); return ((int )tmp ? 0 : (int )((unsigned int )skb->end - (unsigned int )skb->tail)); } } extern void skb_trim(struct sk_buff * , unsigned int ) ; __inline static void skb_copy_from_linear_data(struct sk_buff const *skb , void *to , unsigned int const len ) { { memcpy(to, (void const *)skb->data, (size_t )len); return; } } __inline static bool is_multicast_ether_addr(u8 const *addr ) { u32 a ; { a = *((u32 const *)addr); return ((a & 1U) != 0U); } } __inline static int ieee80211_has_morefrags(__le16 fc ) { { return (((int )fc & 1024) != 0); } } __inline static int ieee80211_has_moredata(__le16 fc ) { { return (((int )fc & 8192) != 0); } } __inline static int ieee80211_is_data_present(__le16 fc ) { { return (((int )fc & 76) == 8); } } __inline static int ieee80211_is_action(__le16 fc ) { { return (((int )fc & 252) == 208); } } __inline static int ieee80211_is_ack(__le16 fc ) { { return (((int )fc & 252) == 212); } } __inline static int ieee80211_is_qos_nullfunc(__le16 fc ) { { return (((int )fc & 252) == 200); } } __inline static struct ieee80211_rx_status *IEEE80211_SKB_RXCB(struct sk_buff *skb ) { { return ((struct ieee80211_rx_status *)(& skb->cb)); } } extern void ieee80211_rx(struct ieee80211_hw * , struct sk_buff * ) ; extern struct sk_buff *ath_rxbuf_alloc(struct ath_common * , u32 , gfp_t ) ; extern bool ath_is_mybeacon(struct ath_common * , struct ieee80211_hdr * ) ; extern int ath9k_hw_rxprocdesc(struct ath_hw * , struct ath_desc * , struct ath_rx_status * ) ; extern void ath9k_hw_setuprxdesc(struct ath_hw * , struct ath_desc * , u32 , u32 ) ; extern void ath9k_hw_putrxbuf(struct ath_hw * , u32 ) ; extern void ath9k_hw_startpcureceive(struct ath_hw * , bool ) ; extern void ath9k_hw_abortpcurecv(struct ath_hw * ) ; extern void ath_dynack_sample_ack_ts(struct ath_hw * , struct sk_buff * , u32 ) ; extern void ath9k_hw_setantenna(struct ath_hw * , u32 ) ; extern void ath9k_hw_setmcastfilter(struct ath_hw * , u32 , u32 ) ; __inline static void ath9k_hw_rxena(struct ath_hw *ah ) { struct ath_hw_ops *tmp ; { tmp = ath9k_hw_ops(ah); (*(tmp->rx_enable))(ah); return; } } extern int ath_cmn_process_fft(struct ath_spec_scan_priv * , struct ieee80211_hdr * , struct ath_rx_status * , u64 ) ; extern bool ath9k_cmn_rx_accept(struct ath_common * , struct ieee80211_hdr * , struct ieee80211_rx_status * , struct ath_rx_status * , bool * , unsigned int ) ; extern void ath9k_cmn_rx_skb_postprocess(struct ath_common * , struct sk_buff * , struct ath_rx_status * , struct ieee80211_rx_status * , bool ) ; extern int ath9k_cmn_process_rate(struct ath_common * , struct ieee80211_hw * , struct ath_rx_status * , struct ieee80211_rx_status * ) ; extern void ath9k_cmn_process_rssi(struct ath_common * , struct ieee80211_hw * , struct ath_rx_status * , struct ieee80211_rx_status * ) ; void ath_debug_stat_rx(struct ath_softc *sc , struct ath_rx_status *rs ) ; void ath_debug_rate_stats(struct ath_softc *sc , struct ath_rx_status *rs , struct sk_buff *skb ) ; void ath9k_dfs_process_phyerr(struct ath_softc *sc , void *data , struct ath_rx_status *rs , u64 mactime ) ; void ath9k_p2p_beacon_sync(struct ath_softc *sc ) ; void ath_chanctx_beacon_recv_ev(struct ath_softc *sc , enum ath_chanctx_event ev ) ; void ath_ant_comb_scan(struct ath_softc *sc , struct ath_rx_status *rs ) ; extern void ath9k_hw_set_rx_bufsize(struct ath_hw * , u16 ) ; extern void ath9k_hw_addrxbuf_edma(struct ath_hw * , u32 , enum ath9k_rx_qtype ) ; extern int ath9k_hw_process_rxdesc_edma(struct ath_hw * , struct ath_rx_status * , void * ) ; __inline static bool ath9k_check_auto_sleep(struct ath_softc *sc ) { { return ((bool )((int )sc->ps_enabled && ((sc->sc_ah)->caps.hw_caps & 4U) != 0U)); } } static void ath_rx_buf_link(struct ath_softc *sc , struct ath_rxbuf *bf , bool flush ) { struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; struct ath_desc *ds ; struct sk_buff *skb ; long tmp___0 ; { ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; ds = (struct ath_desc *)bf->bf_desc; ds->ds_link = 0U; ds->ds_data = (u32 )bf->bf_buf_addr; skb = bf->bf_mpdu; tmp___0 = ldv__builtin_expect((unsigned long )skb == (unsigned long )((struct sk_buff *)0), 0L); if (tmp___0 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/12119/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/ath/ath9k/recv.c"), "i" (51), "i" (12UL)); ldv_54075: ; goto ldv_54075; } else { } ds->ds_vdata = (void *)skb->data; ath9k_hw_setuprxdesc(ah, ds, common->rx_bufsize, 0U); if ((unsigned long )sc->rx.rxlink != (unsigned long )((u32 *)0U)) { *(sc->rx.rxlink) = (u32 )bf->bf_daddr; } else if (! flush) { ath9k_hw_putrxbuf(ah, (u32 )bf->bf_daddr); } else { } sc->rx.rxlink = & ds->ds_link; return; } } static void ath_rx_buf_relink(struct ath_softc *sc , struct ath_rxbuf *bf , bool flush ) { { if ((unsigned long )sc->rx.buf_hold != (unsigned long )((struct ath_rxbuf *)0)) { ath_rx_buf_link(sc, sc->rx.buf_hold, (int )flush); } else { } sc->rx.buf_hold = bf; return; } } static void ath_setdefantenna(struct ath_softc *sc , u32 antenna ) { { ath9k_hw_setantenna(sc->sc_ah, antenna); sc->rx.defant = (u8 )antenna; sc->rx.rxotherant = 0U; return; } } static void ath_opmode_init(struct ath_softc *sc ) { struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; u32 rfilt ; u32 mfilt[2U] ; { ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; rfilt = ath_calcrxfilter(sc); ath9k_hw_setrxfilter(ah, rfilt); ath_hw_setbssidmask(common); ath9k_hw_setopmode(ah); mfilt[1] = 4294967295U; mfilt[0] = mfilt[1]; ath9k_hw_setmcastfilter(ah, mfilt[0], mfilt[1]); return; } } static bool ath_rx_edma_buf_link(struct ath_softc *sc , enum ath9k_rx_qtype qtype ) { struct ath_hw *ah ; struct ath_rx_edma *rx_edma ; struct sk_buff *skb ; struct ath_rxbuf *bf ; __u32 tmp ; struct list_head const *__mptr ; { ah = sc->sc_ah; rx_edma = (struct ath_rx_edma *)(& sc->rx.rx_edma) + (unsigned long )qtype; tmp = skb_queue_len((struct sk_buff_head const *)(& rx_edma->rx_fifo)); if (tmp >= rx_edma->rx_fifo_hwsize) { return (0); } else { } __mptr = (struct list_head const *)sc->rx.rxbuf.next; bf = (struct ath_rxbuf *)__mptr; list_del_init(& bf->list); skb = bf->bf_mpdu; memset((void *)skb->data, 0, (size_t )ah->caps.rx_status_len); dma_sync_single_for_device(sc->dev, bf->bf_buf_addr, (size_t )ah->caps.rx_status_len, 1); *((struct ath_rxbuf **)(& skb->cb)) = bf; ath9k_hw_addrxbuf_edma(ah, (u32 )bf->bf_buf_addr, qtype); __skb_queue_tail(& rx_edma->rx_fifo, skb); return (1); } } static void ath_rx_addbuffer_edma(struct ath_softc *sc , enum ath9k_rx_qtype qtype ) { struct ath_common *common ; struct ath_common *tmp ; struct ath_rxbuf *bf ; struct ath_rxbuf *tbf ; int tmp___0 ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; bool tmp___1 ; int tmp___2 ; struct list_head const *__mptr___1 ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; tmp___0 = list_empty((struct list_head const *)(& sc->rx.rxbuf)); if (tmp___0 != 0) { if ((common->debug_mask & 2) != 0) { ath_printk("\017", (struct ath_common const *)common, "No free rx buf available\n"); } else { } return; } else { } __mptr = (struct list_head const *)sc->rx.rxbuf.next; bf = (struct ath_rxbuf *)__mptr; __mptr___0 = (struct list_head const *)bf->list.next; tbf = (struct ath_rxbuf *)__mptr___0; goto ldv_54117; ldv_54116: tmp___1 = ath_rx_edma_buf_link(sc, qtype); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { goto ldv_54115; } else { } bf = tbf; __mptr___1 = (struct list_head const *)tbf->list.next; tbf = (struct ath_rxbuf *)__mptr___1; ldv_54117: ; if ((unsigned long )(& bf->list) != (unsigned long )(& sc->rx.rxbuf)) { goto ldv_54116; } else { } ldv_54115: ; return; } } static void ath_rx_remove_buffer(struct ath_softc *sc , enum ath9k_rx_qtype qtype ) { struct ath_rxbuf *bf ; struct ath_rx_edma *rx_edma ; struct sk_buff *skb ; long tmp ; { rx_edma = (struct ath_rx_edma *)(& sc->rx.rx_edma) + (unsigned long )qtype; goto ldv_54127; ldv_54126: bf = *((struct ath_rxbuf **)(& skb->cb)); tmp = ldv__builtin_expect((unsigned long )bf == (unsigned long )((struct ath_rxbuf *)0), 0L); if (tmp != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/12119/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/ath/ath9k/recv.c"), "i" (166), "i" (12UL)); ldv_54125: ; goto ldv_54125; } else { } list_add_tail(& bf->list, & sc->rx.rxbuf); ldv_54127: skb = __skb_dequeue(& rx_edma->rx_fifo); if ((unsigned long )skb != (unsigned long )((struct sk_buff *)0)) { goto ldv_54126; } else { } return; } } static void ath_rx_edma_cleanup(struct ath_softc *sc ) { struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; struct ath_rxbuf *bf ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; { ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; ath_rx_remove_buffer(sc, 1); ath_rx_remove_buffer(sc, 0); __mptr = (struct list_head const *)sc->rx.rxbuf.next; bf = (struct ath_rxbuf *)__mptr; goto ldv_54140; ldv_54139: ; if ((unsigned long )bf->bf_mpdu != (unsigned long )((struct sk_buff *)0)) { dma_unmap_single_attrs(sc->dev, bf->bf_buf_addr, (size_t )common->rx_bufsize, 0, (struct dma_attrs *)0); dev_kfree_skb_any(bf->bf_mpdu); bf->bf_buf_addr = 0ULL; bf->bf_mpdu = (struct sk_buff *)0; } else { } __mptr___0 = (struct list_head const *)bf->list.next; bf = (struct ath_rxbuf *)__mptr___0; ldv_54140: ; if ((unsigned long )(& bf->list) != (unsigned long )(& sc->rx.rxbuf)) { goto ldv_54139; } else { } return; } } static void ath_rx_edma_init_queue(struct ath_rx_edma *rx_edma , int size ) { { __skb_queue_head_init(& rx_edma->rx_fifo); rx_edma->rx_fifo_hwsize = (u32 )size; return; } } static int ath_rx_edma_init(struct ath_softc *sc , int nbufs ) { struct ath_common *common ; struct ath_common *tmp ; struct ath_hw *ah ; struct sk_buff *skb ; struct ath_rxbuf *bf ; int error ; int i ; u32 size ; void *tmp___0 ; int tmp___1 ; long tmp___2 ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; ah = sc->sc_ah; error = 0; ath9k_hw_set_rx_bufsize(ah, (int )((u16 )common->rx_bufsize) - (int )((u16 )ah->caps.rx_status_len)); ath_rx_edma_init_queue((struct ath_rx_edma *)(& sc->rx.rx_edma) + 1UL, (int )ah->caps.rx_lp_qdepth); ath_rx_edma_init_queue((struct ath_rx_edma *)(& sc->rx.rx_edma), (int )ah->caps.rx_hp_qdepth); size = (u32 )((unsigned long )nbufs) * 48U; tmp___0 = devm_kzalloc(sc->dev, (size_t )size, 208U); bf = (struct ath_rxbuf *)tmp___0; if ((unsigned long )bf == (unsigned long )((struct ath_rxbuf *)0)) { return (-12); } else { } INIT_LIST_HEAD(& sc->rx.rxbuf); i = 0; goto ldv_54159; ldv_54158: skb = ath_rxbuf_alloc(common, common->rx_bufsize, 208U); if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { error = -12; goto rx_init_fail; } else { } memset((void *)skb->data, 0, (size_t )common->rx_bufsize); bf->bf_mpdu = skb; bf->bf_buf_addr = dma_map_single_attrs(sc->dev, (void *)skb->data, (size_t )common->rx_bufsize, 0, (struct dma_attrs *)0); tmp___1 = dma_mapping_error(sc->dev, bf->bf_buf_addr); tmp___2 = ldv__builtin_expect(tmp___1 != 0, 0L); if (tmp___2 != 0L) { dev_kfree_skb_any(skb); bf->bf_mpdu = (struct sk_buff *)0; bf->bf_buf_addr = 0ULL; ath_printk("\v", (struct ath_common const *)common, "dma_mapping_error() on RX init\n"); error = -12; goto rx_init_fail; } else { } list_add_tail(& bf->list, & sc->rx.rxbuf); i = i + 1; bf = bf + 1; ldv_54159: ; if (i < nbufs) { goto ldv_54158; } else { } return (0); rx_init_fail: ath_rx_edma_cleanup(sc); return (error); } } static void ath_edma_start_recv(struct ath_softc *sc ) { { ath9k_hw_rxena(sc->sc_ah); ath_rx_addbuffer_edma(sc, 0); ath_rx_addbuffer_edma(sc, 1); ath_opmode_init(sc); ath9k_hw_startpcureceive(sc->sc_ah, (int )(sc->cur_chan)->offchannel); return; } } static void ath_edma_stop_recv(struct ath_softc *sc ) { { ath_rx_remove_buffer(sc, 0); ath_rx_remove_buffer(sc, 1); return; } } int ath_rx_init(struct ath_softc *sc , int nbufs ) { struct ath_common *common ; struct ath_common *tmp ; struct sk_buff *skb ; struct ath_rxbuf *bf ; int error ; struct lock_class_key __key ; int tmp___0 ; struct list_head const *__mptr ; int tmp___1 ; long tmp___2 ; struct list_head const *__mptr___0 ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; error = 0; spinlock_check(& sc->sc_pcu_lock); __raw_spin_lock_init(& sc->sc_pcu_lock.__annonCompField18.rlock, "&(&sc->sc_pcu_lock)->rlock", & __key); common->rx_bufsize = (u32 )((int )(sc->sc_ah)->caps.rx_status_len + 1926); if (((sc->sc_ah)->caps.hw_caps & 16U) != 0U) { tmp___0 = ath_rx_edma_init(sc, nbufs); return (tmp___0); } else { } if ((common->debug_mask & 512) != 0) { ath_printk("\017", (struct ath_common const *)common, "cachelsz %u rxbufsize %u\n", (int )common->cachelsz, common->rx_bufsize); } else { } error = ath_descdma_setup(sc, & sc->rx.rxdma, & sc->rx.rxbuf, "rx", nbufs, 1, 0); if (error != 0) { ath_printk("\v", (struct ath_common const *)common, "failed to allocate rx descriptors: %d\n", error); goto err; } else { } __mptr = (struct list_head const *)sc->rx.rxbuf.next; bf = (struct ath_rxbuf *)__mptr; goto ldv_54182; ldv_54181: skb = ath_rxbuf_alloc(common, common->rx_bufsize, 208U); if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { error = -12; goto err; } else { } bf->bf_mpdu = skb; bf->bf_buf_addr = dma_map_single_attrs(sc->dev, (void *)skb->data, (size_t )common->rx_bufsize, 2, (struct dma_attrs *)0); tmp___1 = dma_mapping_error(sc->dev, bf->bf_buf_addr); tmp___2 = ldv__builtin_expect(tmp___1 != 0, 0L); if (tmp___2 != 0L) { dev_kfree_skb_any(skb); bf->bf_mpdu = (struct sk_buff *)0; bf->bf_buf_addr = 0ULL; ath_printk("\v", (struct ath_common const *)common, "dma_mapping_error() on RX init\n"); error = -12; goto err; } else { } __mptr___0 = (struct list_head const *)bf->list.next; bf = (struct ath_rxbuf *)__mptr___0; ldv_54182: ; if ((unsigned long )(& bf->list) != (unsigned long )(& sc->rx.rxbuf)) { goto ldv_54181; } else { } sc->rx.rxlink = (u32 *)0U; err: ; if (error != 0) { ath_rx_cleanup(sc); } else { } return (error); } } void ath_rx_cleanup(struct ath_softc *sc ) { struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; struct sk_buff *skb ; struct ath_rxbuf *bf ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; { ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; if (((sc->sc_ah)->caps.hw_caps & 16U) != 0U) { ath_rx_edma_cleanup(sc); return; } else { } __mptr = (struct list_head const *)sc->rx.rxbuf.next; bf = (struct ath_rxbuf *)__mptr; goto ldv_54196; ldv_54195: skb = bf->bf_mpdu; if ((unsigned long )skb != (unsigned long )((struct sk_buff *)0)) { dma_unmap_single_attrs(sc->dev, bf->bf_buf_addr, (size_t )common->rx_bufsize, 2, (struct dma_attrs *)0); consume_skb(skb); bf->bf_buf_addr = 0ULL; bf->bf_mpdu = (struct sk_buff *)0; } else { } __mptr___0 = (struct list_head const *)bf->list.next; bf = (struct ath_rxbuf *)__mptr___0; ldv_54196: ; if ((unsigned long )(& bf->list) != (unsigned long )(& sc->rx.rxbuf)) { goto ldv_54195; } else { } return; } } u32 ath_calcrxfilter(struct ath_softc *sc ) { struct ath_common *common ; struct ath_common *tmp ; u32 rfilt ; bool tmp___0 ; int tmp___1 ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; return (0U); rfilt = 7U; if ((int )(sc->hw)->conf.radar_enabled) { rfilt = rfilt | 8448U; } else { } spin_lock_bh(& sc->chan_lock); if (((sc->cur_chan)->rxfilter & 256U) != 0U) { rfilt = rfilt | 128U; } else { } if ((int )(sc->sc_ah)->is_monitoring) { rfilt = rfilt | 32U; } else { } if (((sc->cur_chan)->rxfilter & 32U) != 0U || (int )(sc->sc_ah)->dynack.enabled) { rfilt = rfilt | 8U; } else { } if (((unsigned int )(sc->sc_ah)->opmode == 2U && (int )(sc->cur_chan)->nvifs <= 1) && ((sc->cur_chan)->rxfilter & 16U) == 0U) { rfilt = rfilt | 512U; } else { rfilt = rfilt | 16U; } if ((unsigned int )(sc->sc_ah)->opmode == 3U || ((sc->cur_chan)->rxfilter & 128U) != 0U) { rfilt = rfilt | 16384U; } else { } if ((unsigned int )sc->cur_chandef.width != 0U) { rfilt = rfilt | 1024U; } else { } if ((int )(sc->cur_chan)->nvifs > 1 || ((sc->cur_chan)->rxfilter & 64U) != 0U) { if ((sc->sc_ah)->hw_version.macVersion <= 64U) { rfilt = rfilt | 32U; } else { } rfilt = rfilt | 32768U; } else { } if (((sc->sc_ah)->hw_version.macVersion == 1024U || (sc->sc_ah)->hw_version.macVersion == 1280U) || (sc->sc_ah)->hw_version.macVersion == 1536U) { rfilt = rfilt | 1048576U; } else { } tmp___0 = ath9k_is_chanctx_enabled(); if ((int )tmp___0) { tmp___1 = constant_test_bit(5L, (unsigned long const volatile *)(& common->op_flags)); if (tmp___1 != 0) { rfilt = rfilt | 16U; } else { } } else { } spin_unlock_bh(& sc->chan_lock); return (rfilt); } } void ath_startrecv(struct ath_softc *sc ) { struct ath_hw *ah ; struct ath_rxbuf *bf ; struct ath_rxbuf *tbf ; int tmp ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; int tmp___0 ; struct list_head const *__mptr___2 ; { ah = sc->sc_ah; if ((ah->caps.hw_caps & 16U) != 0U) { ath_edma_start_recv(sc); return; } else { } tmp = list_empty((struct list_head const *)(& sc->rx.rxbuf)); if (tmp != 0) { goto start_recv; } else { } sc->rx.buf_hold = (struct ath_rxbuf *)0; sc->rx.rxlink = (u32 *)0U; __mptr = (struct list_head const *)sc->rx.rxbuf.next; bf = (struct ath_rxbuf *)__mptr; __mptr___0 = (struct list_head const *)bf->list.next; tbf = (struct ath_rxbuf *)__mptr___0; goto ldv_54217; ldv_54216: ath_rx_buf_link(sc, bf, 0); bf = tbf; __mptr___1 = (struct list_head const *)tbf->list.next; tbf = (struct ath_rxbuf *)__mptr___1; ldv_54217: ; if ((unsigned long )(& bf->list) != (unsigned long )(& sc->rx.rxbuf)) { goto ldv_54216; } else { } tmp___0 = list_empty((struct list_head const *)(& sc->rx.rxbuf)); if (tmp___0 != 0) { goto start_recv; } else { } __mptr___2 = (struct list_head const *)sc->rx.rxbuf.next; bf = (struct ath_rxbuf *)__mptr___2; ath9k_hw_putrxbuf(ah, (u32 )bf->bf_daddr); ath9k_hw_rxena(ah); start_recv: ath_opmode_init(sc); ath9k_hw_startpcureceive(ah, (int )(sc->cur_chan)->offchannel); return; } } static void ath_flushrecv(struct ath_softc *sc ) { { if (((sc->sc_ah)->caps.hw_caps & 16U) != 0U) { ath_rx_tasklet(sc, 1, 1); } else { } ath_rx_tasklet(sc, 1, 0); return; } } bool ath_stoprecv(struct ath_softc *sc ) { struct ath_hw *ah ; bool stopped ; bool reset ; struct ath_common *tmp ; bool __warned ; int __ret_warn_once ; int __ret_warn_on ; long tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; { ah = sc->sc_ah; reset = 0; ath9k_hw_abortpcurecv(ah); ath9k_hw_setrxfilter(ah, 0U); stopped = ath9k_hw_stopdmarecv(ah, & reset); ath_flushrecv(sc); if (((sc->sc_ah)->caps.hw_caps & 16U) != 0U) { ath_edma_stop_recv(sc); } else { sc->rx.rxlink = (u32 *)0U; } if ((ah->ah_flags & 2U) == 0U) { tmp___3 = ldv__builtin_expect((long )(! stopped), 0L); if (tmp___3 != 0L) { tmp = ath9k_hw_common(sc->sc_ah); ath_printk("\v", (struct ath_common const *)tmp, "Could not stop RX, we could be confusing the DMA engine when we start RX up\n"); __ret_warn_once = ! stopped; tmp___2 = ldv__builtin_expect(__ret_warn_once != 0, 0L); if (tmp___2 != 0L) { __ret_warn_on = ! __warned; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/12119/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/ath/ath9k/recv.c", 497); } else { } tmp___1 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___1 != 0L) { __warned = 1; } else { } } else { } ldv__builtin_expect(__ret_warn_once != 0, 0L); } else { } } else { } return ((bool )((int )stopped && ! reset)); } } static bool ath_beacon_dtim_pending_cab(struct sk_buff *skb ) { struct ieee80211_mgmt *mgmt ; u8 *pos ; u8 *end ; u8 id ; u8 elen ; struct ieee80211_tim_ie *tim ; u8 *tmp ; u8 *tmp___0 ; { mgmt = (struct ieee80211_mgmt *)skb->data; pos = (u8 *)(& mgmt->u.beacon.variable); end = skb->data + (unsigned long )skb->len; goto ldv_54246; ldv_54245: tmp = pos; pos = pos + 1; id = *tmp; tmp___0 = pos; pos = pos + 1; elen = *tmp___0; if ((unsigned long )(pos + (unsigned long )elen) > (unsigned long )end) { goto ldv_54244; } else { } if ((unsigned int )id == 5U) { if ((unsigned int )elen <= 3U) { goto ldv_54244; } else { } tim = (struct ieee80211_tim_ie *)pos; if ((unsigned int )tim->dtim_count != 0U) { goto ldv_54244; } else { } return (((int )tim->bitmap_ctrl & 1) != 0); } else { } pos = pos + (unsigned long )elen; ldv_54246: ; if ((unsigned long )(pos + 2UL) < (unsigned long )end) { goto ldv_54245; } else { } ldv_54244: ; return (0); } } static void ath_rx_ps_beacon(struct ath_softc *sc , struct sk_buff *skb ) { struct ath_common *common ; struct ath_common *tmp ; bool skip_beacon ; bool tmp___0 ; bool __warned ; int __ret_warn_once ; int __ret_warn_on ; long tmp___1 ; long tmp___2 ; long tmp___3 ; long tmp___4 ; bool tmp___5 ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; skip_beacon = 0; if (skb->len <= 35U) { return; } else { } sc->ps_flags = (unsigned int )sc->ps_flags & 65534U; if (((unsigned long )sc->ps_flags & 16UL) != 0UL) { sc->ps_flags = (unsigned int )sc->ps_flags & 65519U; if ((common->debug_mask & 2048) != 0) { ath_printk("\017", (struct ath_common const *)common, "Reconfigure beacon timers based on synchronized timestamp\n"); } else { } tmp___0 = ath9k_is_chanctx_enabled(); if ((int )tmp___0) { if ((unsigned long )sc->cur_chan == (unsigned long )(& sc->offchannel.chan)) { skip_beacon = 1; } else { } } else { } if (! skip_beacon) { __ret_warn_once = (sc->cur_chan)->beacon.beacon_interval == 0; tmp___3 = ldv__builtin_expect(__ret_warn_once != 0, 0L); if (tmp___3 != 0L) { __ret_warn_on = ! __warned; tmp___1 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/12119/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/ath/ath9k/recv.c", 557); } 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) { ath9k_set_beacon(sc); } else { } } else { } ath9k_p2p_beacon_sync(sc); } else { } tmp___5 = ath_beacon_dtim_pending_cab(skb); if ((int )tmp___5) { if ((common->debug_mask & 2048) != 0) { ath_printk("\017", (struct ath_common const *)common, "Received DTIM beacon indicating buffered broadcast/multicast frame(s)\n"); } else { } sc->ps_flags = (u16 )((unsigned int )sc->ps_flags | 3U); return; } else { } if (((unsigned long )sc->ps_flags & 2UL) != 0UL) { sc->ps_flags = (unsigned int )sc->ps_flags & 65533U; if ((common->debug_mask & 2048) != 0) { ath_printk("\017", (struct ath_common const *)common, "PS wait for CAB frames timed out\n"); } else { } } else { } return; } } static void ath_rx_ps(struct ath_softc *sc , struct sk_buff *skb , bool mybeacon ) { struct ieee80211_hdr *hdr ; struct ath_common *common ; struct ath_common *tmp ; bool tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; bool tmp___5 ; int tmp___6 ; bool tmp___7 ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; hdr = (struct ieee80211_hdr *)skb->data; if ((int )sc->ps_flags & 1) { goto _L___4; } else { tmp___7 = ath9k_check_auto_sleep(sc); if ((int )tmp___7) { _L___4: /* CIL Label */ if ((int )mybeacon) { ath_rx_ps_beacon(sc, skb); } else { goto _L___3; } } else _L___3: /* CIL Label */ if (((unsigned long )sc->ps_flags & 2UL) != 0UL) { tmp___3 = ieee80211_is_data((int )hdr->frame_control); if (tmp___3 != 0) { goto _L___2; } else { tmp___4 = ieee80211_is_action((int )hdr->frame_control); if (tmp___4 != 0) { _L___2: /* CIL Label */ tmp___5 = is_multicast_ether_addr((u8 const *)(& hdr->addr1)); if ((int )tmp___5) { tmp___6 = ieee80211_has_moredata((int )hdr->frame_control); if (tmp___6 == 0) { sc->ps_flags = (unsigned int )sc->ps_flags & 65532U; if ((common->debug_mask & 2048) != 0) { ath_printk("\017", (struct ath_common const *)common, "All PS CAB frames received, back to sleep\n"); } else { } } else { goto _L___1; } } else { goto _L___1; } } else { goto _L___1; } } } else _L___1: /* CIL Label */ if (((unsigned long )sc->ps_flags & 4UL) != 0UL) { tmp___0 = is_multicast_ether_addr((u8 const *)(& hdr->addr1)); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { tmp___2 = ieee80211_has_morefrags((int )hdr->frame_control); if (tmp___2 == 0) { sc->ps_flags = (unsigned int )sc->ps_flags & 65531U; if ((common->debug_mask & 2048) != 0) { ath_printk("\017", (struct ath_common const *)common, "Going back to sleep after having received PS-Poll data (0x%lx)\n", (unsigned long )sc->ps_flags & 15UL); } else { } } else { } } else { } } else { } } return; } } static bool ath_edma_get_buffers(struct ath_softc *sc , enum ath9k_rx_qtype qtype , struct ath_rx_status *rs , struct ath_rxbuf **dest ) { struct ath_rx_edma *rx_edma ; struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; struct sk_buff *skb ; struct ath_rxbuf *bf ; int ret ; long tmp___0 ; long tmp___1 ; { rx_edma = (struct ath_rx_edma *)(& sc->rx.rx_edma) + (unsigned long )qtype; ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; skb = skb_peek((struct sk_buff_head const *)(& rx_edma->rx_fifo)); if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { return (0); } else { } bf = *((struct ath_rxbuf **)(& skb->cb)); tmp___0 = ldv__builtin_expect((unsigned long )bf == (unsigned long )((struct ath_rxbuf *)0), 0L); if (tmp___0 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/12119/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/ath/ath9k/recv.c"), "i" (641), "i" (12UL)); ldv_54277: ; goto ldv_54277; } else { } dma_sync_single_for_cpu(sc->dev, bf->bf_buf_addr, (size_t )common->rx_bufsize, 2); ret = ath9k_hw_process_rxdesc_edma(ah, rs, (void *)skb->data); if (ret == -115) { dma_sync_single_for_device(sc->dev, bf->bf_buf_addr, (size_t )common->rx_bufsize, 2); return (0); } else { } __skb_unlink(skb, & rx_edma->rx_fifo); if (ret == -22) { list_add_tail(& bf->list, & sc->rx.rxbuf); ath_rx_edma_buf_link(sc, qtype); skb = skb_peek((struct sk_buff_head const *)(& rx_edma->rx_fifo)); if ((unsigned long )skb != (unsigned long )((struct sk_buff *)0)) { bf = *((struct ath_rxbuf **)(& skb->cb)); tmp___1 = ldv__builtin_expect((unsigned long )bf == (unsigned long )((struct ath_rxbuf *)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 *)"/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/12119/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/ath/ath9k/recv.c"), "i" (663), "i" (12UL)); ldv_54278: ; goto ldv_54278; } else { } __skb_unlink(skb, & rx_edma->rx_fifo); list_add_tail(& bf->list, & sc->rx.rxbuf); ath_rx_edma_buf_link(sc, qtype); } else { } bf = (struct ath_rxbuf *)0; } else { } *dest = bf; return (1); } } static struct ath_rxbuf *ath_edma_get_next_rx_buf(struct ath_softc *sc , struct ath_rx_status *rs , enum ath9k_rx_qtype qtype ) { struct ath_rxbuf *bf ; bool tmp ; { bf = (struct ath_rxbuf *)0; goto ldv_54285; ldv_54286: ; if ((unsigned long )bf == (unsigned long )((struct ath_rxbuf *)0)) { goto ldv_54285; } else { } return (bf); ldv_54285: tmp = ath_edma_get_buffers(sc, qtype, rs, & bf); if ((int )tmp) { goto ldv_54286; } else { } return ((struct ath_rxbuf *)0); } } static struct ath_rxbuf *ath_get_next_rx_buf(struct ath_softc *sc , struct ath_rx_status *rs ) { struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; struct ath_desc *ds ; struct ath_rxbuf *bf ; int ret ; int tmp___0 ; struct list_head const *__mptr ; struct ath_rx_status trs ; struct ath_rxbuf *tbf ; struct ath_desc *tds ; int tmp___1 ; struct list_head const *__mptr___0 ; { ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; tmp___0 = list_empty((struct list_head const *)(& sc->rx.rxbuf)); if (tmp___0 != 0) { sc->rx.rxlink = (u32 *)0U; return ((struct ath_rxbuf *)0); } else { } __mptr = (struct list_head const *)sc->rx.rxbuf.next; bf = (struct ath_rxbuf *)__mptr; if ((unsigned long )sc->rx.buf_hold == (unsigned long )bf) { return ((struct ath_rxbuf *)0); } else { } ds = (struct ath_desc *)bf->bf_desc; ret = ath9k_hw_rxprocdesc(ah, ds, rs); if (ret == -115) { memset((void *)(& trs), 0, 52UL); tmp___1 = list_is_last((struct list_head const *)(& bf->list), (struct list_head const *)(& sc->rx.rxbuf)); if (tmp___1 != 0) { sc->rx.rxlink = (u32 *)0U; return ((struct ath_rxbuf *)0); } else { } __mptr___0 = (struct list_head const *)bf->list.next; tbf = (struct ath_rxbuf *)__mptr___0; tds = (struct ath_desc *)tbf->bf_desc; ret = ath9k_hw_rxprocdesc(ah, tds, & trs); if (ret == -115) { return ((struct ath_rxbuf *)0); } else { } ret = ath9k_hw_rxprocdesc(ah, ds, rs); if (ret == -115) { rs->rs_datalen = 0U; rs->rs_more = 1U; } else { } } else { } list_del(& bf->list); if ((unsigned long )bf->bf_mpdu == (unsigned long )((struct sk_buff *)0)) { return (bf); } else { } dma_sync_single_for_cpu(sc->dev, bf->bf_buf_addr, (size_t )common->rx_bufsize, 2); return (bf); } } static void ath9k_process_tsf(struct ath_rx_status *rs , struct ieee80211_rx_status *rxs , u64 tsf ) { u32 tsf_lower ; long tmp ; long tmp___0 ; { tsf_lower = (u32 )tsf; rxs->mactime = (tsf & 0xffffffff00000000ULL) | (unsigned long long )rs->rs_tstamp; if (rs->rs_tstamp > tsf_lower) { tmp = ldv__builtin_expect(rs->rs_tstamp - tsf_lower > 268435456U, 0L); if (tmp != 0L) { rxs->mactime = rxs->mactime - 4294967296ULL; } else { } } else { } if (rs->rs_tstamp < tsf_lower) { tmp___0 = ldv__builtin_expect(tsf_lower - rs->rs_tstamp > 268435456U, 0L); if (tmp___0 != 0L) { rxs->mactime = rxs->mactime + 4294967296ULL; } else { } } else { } return; } } static int ath9k_rx_skb_preprocess(struct ath_softc *sc , struct sk_buff *skb , struct ath_rx_status *rx_stats , struct ieee80211_rx_status *rx_status , bool *decrypt_error , u64 tsf ) { struct ieee80211_hw *hw ; struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; struct ieee80211_hdr *hdr ; bool discard_current ; int tmp___0 ; bool tmp___1 ; int tmp___2 ; bool tmp___3 ; int __ret_warn_on ; long tmp___4 ; long tmp___5 ; int tmp___6 ; bool tmp___7 ; int tmp___8 ; int tmp___9 ; { hw = sc->hw; ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; discard_current = sc->rx.discard_next; if ((int )discard_current) { goto corrupt; } else { } sc->rx.discard_next = 0; if ((unsigned int )rx_stats->rs_datalen == 0U) { sc->debug.stats.rxstats.rx_len_err = sc->debug.stats.rxstats.rx_len_err + 1U; goto corrupt; } else { } if ((u32 )rx_stats->rs_datalen > common->rx_bufsize - (u32 )ah->caps.rx_status_len) { sc->debug.stats.rxstats.rx_len_err = sc->debug.stats.rxstats.rx_len_err + 1U; goto corrupt; } else { } if ((unsigned int )rx_stats->rs_more != 0U) { return (0); } else { } if (((int )rx_stats->rs_status & 64) != 0) { goto corrupt; } else { } hdr = (struct ieee80211_hdr *)skb->data + (unsigned long )ah->caps.rx_status_len; ath9k_process_tsf(rx_stats, rx_status, tsf); ath_debug_stat_rx(sc, rx_stats); if (((int )rx_stats->rs_status & 2) != 0) { ath9k_dfs_process_phyerr(sc, (void *)hdr, rx_stats, rx_status->mactime); tmp___0 = ath_cmn_process_fft(& sc->spec_priv, hdr, rx_stats, rx_status->mactime); if (tmp___0 != 0) { sc->debug.stats.rxstats.rx_spectral = sc->debug.stats.rxstats.rx_spectral + 1U; } else { } return (-22); } else { } spin_lock_bh(& sc->chan_lock); tmp___1 = ath9k_cmn_rx_accept(common, hdr, rx_status, rx_stats, decrypt_error, (sc->cur_chan)->rxfilter); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { spin_unlock_bh(& sc->chan_lock); return (-22); } else { } spin_unlock_bh(& sc->chan_lock); tmp___3 = ath_is_mybeacon(common, hdr); if ((int )tmp___3) { sc->debug.stats.rxstats.rx_beacons = sc->debug.stats.rxstats.rx_beacons + 1U; rx_stats->is_mybeacon = 1; } else { } __ret_warn_on = (unsigned long )ah->curchan == (unsigned long )((struct ath9k_channel *)0); tmp___4 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___4 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/12119/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/ath/ath9k/recv.c", 895); } else { } tmp___5 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___5 != 0L) { return (-22); } else { } tmp___6 = ath9k_cmn_process_rate(common, hw, rx_stats, rx_status); if (tmp___6 != 0) { if (common->debug_mask != 0) { ath_printk("\017", (struct ath_common const *)common, "unsupported hw bitrate detected 0x%02x using 1 Mbit\n", (int )rx_stats->rs_rate); } else { } sc->debug.stats.rxstats.rx_rate_err = sc->debug.stats.rxstats.rx_rate_err + 1U; return (-22); } else { } tmp___7 = ath9k_is_chanctx_enabled(); if ((int )tmp___7) { if ((int )rx_stats->is_mybeacon) { ath_chanctx_beacon_recv_ev(sc, 3); } else { } } else { } ath9k_cmn_process_rssi(common, hw, rx_stats, rx_status); rx_status->band = (u8 )((ah->curchan)->chan)->band; rx_status->freq = ((ah->curchan)->chan)->center_freq; rx_status->antenna = rx_stats->rs_antenna; rx_status->flag = rx_status->flag | 2097152U; tmp___8 = ieee80211_is_data_present((int )hdr->frame_control); if (tmp___8 != 0) { tmp___9 = ieee80211_is_qos_nullfunc((int )hdr->frame_control); if (tmp___9 == 0) { sc->rx.num_pkts = sc->rx.num_pkts + 1U; } else { } } else { } return (0); corrupt: sc->rx.discard_next = (unsigned int )rx_stats->rs_more != 0U; return (-22); } } static void ath9k_antenna_check(struct ath_softc *sc , struct ath_rx_status *rs ) { struct ath_hw *ah ; struct ath9k_hw_capabilities *pCap ; struct ath_common *common ; struct ath_common *tmp ; { ah = sc->sc_ah; pCap = & ah->caps; tmp = ath9k_hw_common(ah); common = tmp; if ((ah->caps.hw_caps & 1024U) == 0U) { return; } else { } if ((int )sc->rx.defant != (int )rs->rs_antenna) { sc->rx.rxotherant = (u8 )((int )sc->rx.rxotherant + 1); if ((unsigned int )sc->rx.rxotherant > 2U) { ath_setdefantenna(sc, (u32 )rs->rs_antenna); } else { } } else { sc->rx.rxotherant = 0U; } if ((pCap->hw_caps & 131072U) != 0U) { if ((int )common->bt_ant_diversity) { ath_ant_comb_scan(sc, rs); } else { } } else { ath_ant_comb_scan(sc, rs); } return; } } static void ath9k_apply_ampdu_details(struct ath_softc *sc , struct ath_rx_status *rs , struct ieee80211_rx_status *rxs ) { { if ((unsigned int )rs->rs_isaggr != 0U) { rxs->flag = rxs->flag | 147456U; rxs->ampdu_reference = sc->rx.ampdu_ref; if ((unsigned int )rs->rs_moreaggr == 0U) { rxs->flag = rxs->flag | 262144U; sc->rx.ampdu_ref = sc->rx.ampdu_ref + 1U; } else { } if (((int )rs->rs_flags & 16) != 0) { rxs->flag = rxs->flag | 524288U; } else { } } else { } return; } } int ath_rx_tasklet(struct ath_softc *sc , int flush , bool hp ) { struct ath_rxbuf *bf ; struct sk_buff *skb ; struct sk_buff *requeue_skb ; struct sk_buff *hdr_skb ; struct ieee80211_rx_status *rxs ; struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; struct ieee80211_hw *hw ; int retval ; struct ath_rx_status rs ; enum ath9k_rx_qtype qtype ; bool edma ; int dma_type ; u64 tsf ; unsigned long flags ; dma_addr_t new_buf_addr ; unsigned int budget ; struct ieee80211_hdr *hdr ; bool decrypt_error ; int tmp___0 ; long tmp___1 ; int space ; int tmp___2 ; int tmp___3 ; unsigned char *tmp___4 ; raw_spinlock_t *tmp___5 ; bool tmp___6 ; int tmp___7 ; unsigned int tmp___8 ; { skb = (struct sk_buff *)0; ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; hw = sc->hw; edma = (ah->caps.hw_caps & 16U) != 0U; tsf = 0ULL; budget = 512U; if ((int )edma) { dma_type = 0; } else { dma_type = 2; } qtype = (int )hp ? 0 : 1; tsf = ath9k_hw_gettsf64(ah); ldv_54370: decrypt_error = 0; memset((void *)(& rs), 0, 52UL); if ((int )edma) { bf = ath_edma_get_next_rx_buf(sc, & rs, qtype); } else { bf = ath_get_next_rx_buf(sc, & rs); } if ((unsigned long )bf == (unsigned long )((struct ath_rxbuf *)0)) { goto ldv_54362; } else { } skb = bf->bf_mpdu; if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { goto ldv_54363; } else { } if ((unsigned long )sc->rx.frag != (unsigned long )((struct sk_buff *)0)) { hdr_skb = sc->rx.frag; } else { hdr_skb = skb; } rxs = IEEE80211_SKB_RXCB(hdr_skb); memset((void *)rxs, 0, 40UL); retval = ath9k_rx_skb_preprocess(sc, hdr_skb, & rs, rxs, & decrypt_error, tsf); if (retval != 0) { goto requeue_drop_frag; } else { } requeue_skb = ath_rxbuf_alloc(common, common->rx_bufsize, 32U); if ((unsigned long )requeue_skb == (unsigned long )((struct sk_buff *)0)) { sc->debug.stats.rxstats.rx_oom_err = sc->debug.stats.rxstats.rx_oom_err + 1U; goto requeue_drop_frag; } else { } new_buf_addr = dma_map_single_attrs(sc->dev, (void *)requeue_skb->data, (size_t )common->rx_bufsize, (enum dma_data_direction )dma_type, (struct dma_attrs *)0); tmp___0 = dma_mapping_error(sc->dev, new_buf_addr); tmp___1 = ldv__builtin_expect(tmp___0 != 0, 0L); if (tmp___1 != 0L) { dev_kfree_skb_any(requeue_skb); goto requeue_drop_frag; } else { } dma_unmap_single_attrs(sc->dev, bf->bf_buf_addr, (size_t )common->rx_bufsize, (enum dma_data_direction )dma_type, (struct dma_attrs *)0); bf->bf_mpdu = requeue_skb; bf->bf_buf_addr = new_buf_addr; skb_put(skb, (unsigned int )((int )rs.rs_datalen + (int )ah->caps.rx_status_len)); if ((unsigned int )ah->caps.rx_status_len != 0U) { skb_pull(skb, (unsigned int )ah->caps.rx_status_len); } else { } if ((unsigned int )rs.rs_more == 0U) { ath9k_cmn_rx_skb_postprocess(common, hdr_skb, & rs, rxs, (int )decrypt_error); } else { } if ((unsigned int )rs.rs_more != 0U) { sc->debug.stats.rxstats.rx_frags = sc->debug.stats.rxstats.rx_frags + 1U; if ((unsigned long )sc->rx.frag != (unsigned long )((struct sk_buff *)0)) { dev_kfree_skb_any(sc->rx.frag); dev_kfree_skb_any(skb); sc->debug.stats.rxstats.rx_too_many_frags_err = sc->debug.stats.rxstats.rx_too_many_frags_err + 1U; skb = (struct sk_buff *)0; } else { } sc->rx.frag = skb; goto requeue; } else { } if ((unsigned long )sc->rx.frag != (unsigned long )((struct sk_buff *)0)) { tmp___2 = skb_tailroom((struct sk_buff const *)hdr_skb); space = (int )(skb->len - (unsigned int )tmp___2); tmp___3 = pskb_expand_head(hdr_skb, 0, space, 32U); if (tmp___3 < 0) { consume_skb(skb); sc->debug.stats.rxstats.rx_oom_err = sc->debug.stats.rxstats.rx_oom_err + 1U; goto requeue_drop_frag; } else { } sc->rx.frag = (struct sk_buff *)0; tmp___4 = skb_put(hdr_skb, skb->len); skb_copy_from_linear_data((struct sk_buff const *)skb, (void *)tmp___4, skb->len); dev_kfree_skb_any(skb); skb = hdr_skb; } else { } if ((rxs->flag & 8U) != 0U) { skb_trim(skb, skb->len - 8U); } else { } tmp___5 = spinlock_check(& sc->sc_pm_lock); flags = _raw_spin_lock_irqsave(tmp___5); if (((unsigned long )sc->ps_flags & 7UL) != 0UL) { ath_rx_ps(sc, skb, (int )rs.is_mybeacon); } else { tmp___6 = ath9k_check_auto_sleep(sc); if ((int )tmp___6) { ath_rx_ps(sc, skb, (int )rs.is_mybeacon); } else { } } spin_unlock_irqrestore(& sc->sc_pm_lock, flags); ath9k_antenna_check(sc, & rs); ath9k_apply_ampdu_details(sc, & rs, rxs); ath_debug_rate_stats(sc, & rs, skb); hdr = (struct ieee80211_hdr *)skb->data; tmp___7 = ieee80211_is_ack((int )hdr->frame_control); if (tmp___7 != 0) { ath_dynack_sample_ack_ts(sc->sc_ah, skb, rs.rs_tstamp); } else { } ieee80211_rx(hw, skb); requeue_drop_frag: ; if ((unsigned long )sc->rx.frag != (unsigned long )((struct sk_buff *)0)) { dev_kfree_skb_any(sc->rx.frag); sc->rx.frag = (struct sk_buff *)0; } else { } requeue: list_add_tail(& bf->list, & sc->rx.rxbuf); if (! edma) { ath_rx_buf_relink(sc, bf, flush != 0); if (flush == 0) { ath9k_hw_rxena(ah); } else { } } else if (flush == 0) { ath_rx_edma_buf_link(sc, qtype); } else { } tmp___8 = budget; budget = budget - 1U; if (tmp___8 == 0U) { goto ldv_54362; } else { } ldv_54363: ; goto ldv_54370; ldv_54362: ; if (((unsigned int )ah->imask & 16U) == 0U) { ah->imask = (enum ath9k_int )((unsigned int )ah->imask | 48U); ath9k_hw_set_interrupts(ah); } else { } return (0); } } bool ldv_queue_work_on_101(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_102(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_103(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_104(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_7(2); return; } } bool ldv_queue_delayed_work_on_105(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; __inline static void __set_bit(long nr , unsigned long volatile *addr ) { { __asm__ volatile ("bts %1,%0": "+m" (*((long volatile *)addr)): "Ir" (nr): "memory"); return; } } __inline static void __clear_bit(long nr , unsigned long volatile *addr ) { { __asm__ volatile ("btr %1,%0": "+m" (*((long volatile *)addr)): "Ir" (nr)); return; } } __inline static int variable_test_bit(long nr , unsigned long const volatile *addr ) { int oldbit ; { __asm__ volatile ("bt %2,%1\n\tsbb %0,%0": "=r" (oldbit): "m" (*((unsigned long *)addr)), "Ir" (nr)); return (oldbit); } } __inline static void list_add(struct list_head *new , struct list_head *head ) { { __list_add(new, head, head->next); return; } } __inline static void list_move_tail(struct list_head *list , struct list_head *head ) { { __list_del_entry(list); list_add_tail(list, head); return; } } __inline static int list_is_singular(struct list_head const *head ) { int tmp ; { tmp = list_empty(head); return (tmp == 0 && (unsigned long )head->next == (unsigned long )head->prev); } } __inline static void __list_cut_position(struct list_head *list , struct list_head *head , struct list_head *entry ) { struct list_head *new_first ; { new_first = entry->next; list->next = head->next; (list->next)->prev = list; list->prev = entry; entry->next = list; head->next = new_first; new_first->prev = head; return; } } __inline static void list_cut_position(struct list_head *list , struct list_head *head , struct list_head *entry ) { int tmp ; int tmp___0 ; { tmp = list_empty((struct list_head const *)head); if (tmp != 0) { return; } else { } tmp___0 = list_is_singular((struct list_head const *)head); if (tmp___0 != 0 && ((unsigned long )head->next != (unsigned long )entry && (unsigned long )head != (unsigned long )entry)) { return; } else { } if ((unsigned long )entry == (unsigned long )head) { INIT_LIST_HEAD(list); } else { __list_cut_position(list, head, entry); } return; } } __inline static void __list_splice(struct list_head const *list , struct list_head *prev , struct list_head *next ) { struct list_head *first ; struct list_head *last ; { first = list->next; last = list->prev; first->prev = prev; prev->next = first; last->next = next; next->prev = last; return; } } __inline static void list_splice_tail_init(struct list_head *list , struct list_head *head ) { int tmp ; { tmp = list_empty((struct list_head const *)list); if (tmp == 0) { __list_splice((struct list_head const *)list, head->prev, head); INIT_LIST_HEAD(list); } else { } return; } } extern void __bad_percpu_size(void) ; extern void *__memmove(void * , void const * , size_t ) ; extern int __preempt_count ; __inline static void __preempt_count_add(int val ) { int pao_ID__ ; { pao_ID__ = 0; switch (4UL) { case 1UL: ; if (pao_ID__ == 1) { __asm__ ("incb %%gs:%0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decb %%gs:%0": "+m" (__preempt_count)); } else { __asm__ ("addb %1, %%gs:%0": "+m" (__preempt_count): "qi" (val)); } goto ldv_6059; case 2UL: ; if (pao_ID__ == 1) { __asm__ ("incw %%gs:%0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decw %%gs:%0": "+m" (__preempt_count)); } else { __asm__ ("addw %1, %%gs:%0": "+m" (__preempt_count): "ri" (val)); } goto ldv_6059; case 4UL: ; if (pao_ID__ == 1) { __asm__ ("incl %%gs:%0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decl %%gs:%0": "+m" (__preempt_count)); } else { __asm__ ("addl %1, %%gs:%0": "+m" (__preempt_count): "ri" (val)); } goto ldv_6059; case 8UL: ; if (pao_ID__ == 1) { __asm__ ("incq %%gs:%0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decq %%gs:%0": "+m" (__preempt_count)); } else { __asm__ ("addq %1, %%gs:%0": "+m" (__preempt_count): "re" (val)); } goto ldv_6059; default: __bad_percpu_size(); } ldv_6059: ; return; } } __inline static void __preempt_count_sub(int val ) { int pao_ID__ ; { pao_ID__ = 0; switch (4UL) { case 1UL: ; if (pao_ID__ == 1) { __asm__ ("incb %%gs:%0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decb %%gs:%0": "+m" (__preempt_count)); } else { __asm__ ("addb %1, %%gs:%0": "+m" (__preempt_count): "qi" (- val)); } goto ldv_6071; case 2UL: ; if (pao_ID__ == 1) { __asm__ ("incw %%gs:%0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decw %%gs:%0": "+m" (__preempt_count)); } else { __asm__ ("addw %1, %%gs:%0": "+m" (__preempt_count): "ri" (- val)); } goto ldv_6071; case 4UL: ; if (pao_ID__ == 1) { __asm__ ("incl %%gs:%0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decl %%gs:%0": "+m" (__preempt_count)); } else { __asm__ ("addl %1, %%gs:%0": "+m" (__preempt_count): "ri" (- val)); } goto ldv_6071; case 8UL: ; if (pao_ID__ == 1) { __asm__ ("incq %%gs:%0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decq %%gs:%0": "+m" (__preempt_count)); } else { __asm__ ("addq %1, %%gs:%0": "+m" (__preempt_count): "re" (- val)); } goto ldv_6071; default: __bad_percpu_size(); } ldv_6071: ; return; } } extern void lock_acquire(struct lockdep_map * , unsigned int , int , int , int , struct lockdep_map * , unsigned long ) ; extern void lock_release(struct lockdep_map * , int , unsigned long ) ; extern void lockdep_rcu_suspicious(char const * , int const , char const * ) ; __inline static void __rcu_read_lock(void) { { __preempt_count_add(1); __asm__ volatile ("": : : "memory"); return; } } __inline static void __rcu_read_unlock(void) { { __asm__ volatile ("": : : "memory"); __preempt_count_sub(1); return; } } extern bool rcu_is_watching(void) ; __inline static void rcu_lock_acquire(struct lockdep_map *map ) { { lock_acquire(map, 0U, 0, 2, 0, (struct lockdep_map *)0, 0UL); return; } } __inline static void rcu_lock_release(struct lockdep_map *map ) { { lock_release(map, 1, 0UL); return; } } extern struct lockdep_map rcu_lock_map ; extern int debug_lockdep_rcu_enabled(void) ; __inline static void rcu_read_lock(void) { bool __warned ; int tmp ; bool tmp___0 ; int tmp___1 ; { __rcu_read_lock(); rcu_lock_acquire(& rcu_lock_map); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { tmp___0 = rcu_is_watching(); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { __warned = 1; lockdep_rcu_suspicious("include/linux/rcupdate.h", 849, "rcu_read_lock() used illegally while idle"); } else { } } else { } return; } } __inline static void rcu_read_unlock(void) { bool __warned ; int tmp ; bool tmp___0 ; int tmp___1 ; { tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { tmp___0 = rcu_is_watching(); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { __warned = 1; lockdep_rcu_suspicious("include/linux/rcupdate.h", 900, "rcu_read_unlock() used illegally while idle"); } else { } } else { } __rcu_read_unlock(); rcu_lock_release(& rcu_lock_map); return; } } bool ldv_queue_work_on_115(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_117(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_116(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; bool ldv_queue_delayed_work_on_119(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; void ldv_flush_workqueue_118(struct workqueue_struct *ldv_func_arg1 ) ; void activate_work_6(struct work_struct *work , int state ) ; void invoke_work_6(void) ; void call_and_disable_all_6(int state ) ; void disable_work_6(struct work_struct *work ) ; void call_and_disable_work_6(struct work_struct *work ) ; __inline static int skb_queue_empty(struct sk_buff_head const *list ) { { return ((unsigned long )((struct sk_buff const *)list->next) == (unsigned long )((struct sk_buff const *)list)); } } __inline static void __skb_queue_splice(struct sk_buff_head const *list , struct sk_buff *prev , struct sk_buff *next ) { struct sk_buff *first ; struct sk_buff *last ; { first = list->next; last = list->prev; first->__annonCompField68.__annonCompField67.prev = prev; prev->__annonCompField68.__annonCompField67.next = first; last->__annonCompField68.__annonCompField67.next = next; next->__annonCompField68.__annonCompField67.prev = last; return; } } __inline static void skb_queue_splice_init(struct sk_buff_head *list , struct sk_buff_head *head ) { int tmp ; { tmp = skb_queue_empty((struct sk_buff_head const *)list); if (tmp == 0) { __skb_queue_splice((struct sk_buff_head const *)list, (struct sk_buff *)head, head->next); head->qlen = head->qlen + list->qlen; __skb_queue_head_init(list); } else { } return; } } __inline static void skb_queue_splice_tail(struct sk_buff_head const *list , struct sk_buff_head *head ) { int tmp ; { tmp = skb_queue_empty(list); if (tmp == 0) { __skb_queue_splice(list, head->prev, (struct sk_buff *)head); head->qlen = head->qlen + (__u32 )list->qlen; } else { } return; } } extern unsigned char *skb_push(struct sk_buff * , unsigned int ) ; __inline static unsigned int skb_headroom(struct sk_buff const *skb ) { { return ((unsigned int )((long )skb->data) - (unsigned int )((long )skb->head)); } } __inline static int ieee80211_is_probe_resp(__le16 fc ) { { return (((int )fc & 252) == 80); } } __inline static int ieee80211_is_beacon(__le16 fc ) { { return (((int )fc & 252) == 128); } } __inline static int ieee80211_is_atim(__le16 fc ) { { return (((int )fc & 252) == 144); } } extern unsigned int ieee80211_hdrlen(__le16 ) ; __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->__annonCompField99.control.__annonCompField97.__annonCompField96.rts_cts_rate_idx) < 0) { return ((struct ieee80211_rate *)0); } else { } return (((hw->wiphy)->bands[(int )c->band])->bitrates + (unsigned long )c->__annonCompField99.control.__annonCompField97.__annonCompField96.rts_cts_rate_idx); } } extern void ieee80211_sta_set_buffered(struct ieee80211_sta * , u8 , bool ) ; extern void ieee80211_get_tx_rates(struct ieee80211_vif * , struct ieee80211_sta * , struct sk_buff * , struct ieee80211_tx_rate * , int ) ; 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 ) ; extern struct ieee80211_sta *ieee80211_find_sta_by_ifaddr(struct ieee80211_hw * , u8 const * , u8 const * ) ; extern void ieee80211_sta_eosp(struct ieee80211_sta * ) ; extern void ieee80211_send_bar(struct ieee80211_vif * , u8 * , u16 , u16 ) ; extern u32 ath9k_hw_gettxbuf(struct ath_hw * , u32 ) ; extern void ath9k_hw_abort_tx_dma(struct ath_hw * ) ; extern int ath9k_hw_setuptxqueue(struct ath_hw * , enum ath9k_tx_queue , struct ath9k_tx_queue_info const * ) ; extern bool ath9k_hw_releasetxqueue(struct ath_hw * , u32 ) ; extern void ath_dynack_sample_tx_ts(struct ath_hw * , struct sk_buff * , struct ath_tx_status * ) ; extern u16 ath9k_hw_computetxtime(struct ath_hw * , u8 , int , u32 , u16 , bool ) ; __inline static void ath9k_hw_set_desc_link(struct ath_hw *ah , void *ds , u32 link ) { struct ath_hw_ops *tmp ; { tmp = ath9k_hw_ops(ah); (*(tmp->set_desc_link))(ds, link); return; } } __inline static int ath9k_hw_get_duration(struct ath_hw *ah , void const *ds , int index ) { struct ath_hw_ops *tmp ; int tmp___0 ; { tmp = ath9k_hw_ops(ah); tmp___0 = (*(tmp->get_duration))(ah, ds, index); return (tmp___0); } } __inline static void ath9k_hw_tx99_start(struct ath_hw *ah , u32 qnum ) { struct ath_hw_ops *tmp ; { tmp = ath9k_hw_ops(ah); (*(tmp->tx99_start))(ah, qnum); return; } } extern int ath9k_cmn_get_hw_crypto_keytype(struct sk_buff * ) ; void ath_debug_stat_tx(struct ath_softc *sc , struct ath_buf *bf , struct ath_tx_status *ts , struct ath_txq *txq , unsigned int flags ) ; void ath_txq_lock(struct ath_softc *sc , struct ath_txq *txq ) ; void ath_txq_unlock(struct ath_softc *sc , struct ath_txq *txq ) ; void ath_txq_unlock_complete(struct ath_softc *sc , struct ath_txq *txq ) ; void ath_txq_schedule(struct ath_softc *sc , struct ath_txq *txq ) ; void ath_tx_complete_poll_work(struct work_struct *work ) ; int ath9k_tx99_send(struct ath_softc *sc , struct sk_buff *skb , struct ath_tx_control *txctl ) ; extern void ath9k_hw_setup_statusring(struct ath_hw * , void * , u32 , u16 ) ; static u16 bits_per_symbol[8U][2U] = { { 26U, 54U}, { 52U, 108U}, { 78U, 162U}, { 104U, 216U}, { 156U, 324U}, { 208U, 432U}, { 234U, 486U}, { 260U, 540U}}; static void ath_tx_send_normal(struct ath_softc *sc , struct ath_txq *txq , struct ath_atx_tid *tid , struct sk_buff *skb ) ; static void ath_tx_complete(struct ath_softc *sc , struct sk_buff *skb , int tx_flags , struct ath_txq *txq ) ; static void ath_tx_complete_buf(struct ath_softc *sc , struct ath_buf *bf , struct ath_txq *txq , struct list_head *bf_q , struct ath_tx_status *ts , int txok ) ; static void ath_tx_txqaddbuf(struct ath_softc *sc , struct ath_txq *txq , struct list_head *head , bool internal ) ; static void ath_tx_rc_status(struct ath_softc *sc , struct ath_buf *bf , struct ath_tx_status *ts , int nframes , int nbad , int txok ) ; static void ath_tx_update_baw(struct ath_softc *sc , struct ath_atx_tid *tid , int seqno ) ; static struct ath_buf *ath_tx_setup_buffer(struct ath_softc *sc , struct ath_txq *txq , struct ath_atx_tid *tid , struct sk_buff *skb ) ; void ath_txq_lock(struct ath_softc *sc , struct ath_txq *txq ) { { spin_lock_bh(& txq->axq_lock); return; } } void ath_txq_unlock(struct ath_softc *sc , struct ath_txq *txq ) { { spin_unlock_bh(& txq->axq_lock); return; } } void ath_txq_unlock_complete(struct ath_softc *sc , struct ath_txq *txq ) { struct sk_buff_head q ; struct sk_buff *skb ; { __skb_queue_head_init(& q); skb_queue_splice_init(& txq->complete_q, & q); spin_unlock_bh(& txq->axq_lock); goto ldv_54122; ldv_54121: ieee80211_tx_status(sc->hw, skb); ldv_54122: skb = __skb_dequeue(& q); if ((unsigned long )skb != (unsigned long )((struct sk_buff *)0)) { goto ldv_54121; } else { } return; } } static void ath_tx_queue_tid(struct ath_softc *sc , struct ath_txq *txq , struct ath_atx_tid *tid ) { struct ath_atx_ac *ac ; struct list_head *list ; struct ath_vif *avp ; struct ath_chanctx *ctx ; { ac = tid->ac; avp = (struct ath_vif *)(& ((tid->an)->vif)->drv_priv); ctx = avp->chanctx; if ((unsigned long )ctx == (unsigned long )((struct ath_chanctx *)0)) { return; } else { } if ((int )tid->sched) { return; } else { } tid->sched = 1; list_add_tail(& tid->list, & ac->tid_q); if ((int )ac->sched) { return; } else { } ac->sched = 1; list = (struct list_head *)(& ctx->acq) + ((unsigned int )tid->tidno != 0U && (unsigned int )tid->tidno != 3U ? ((unsigned int )tid->tidno != 1U && (unsigned int )tid->tidno != 2U ? ((unsigned int )tid->tidno == 4U || (unsigned int )tid->tidno == 5U ? 1UL : 0UL) : 3UL) : 2UL); list_add_tail(& ac->list, list); return; } } static struct ath_frame_info *get_frame_info(struct sk_buff *skb ) { struct ieee80211_tx_info *tx_info ; struct ieee80211_tx_info *tmp ; { tmp = IEEE80211_SKB_CB(skb); tx_info = tmp; return ((struct ath_frame_info *)(& tx_info->__annonCompField99.__annonCompField98.rate_driver_data)); } } static void ath_send_bar(struct ath_atx_tid *tid , u16 seqno ) { { if ((unsigned long )(tid->an)->sta == (unsigned long )((struct ieee80211_sta *)0)) { return; } else { } ieee80211_send_bar((tid->an)->vif, (u8 *)(& ((tid->an)->sta)->addr), (int )tid->tidno, (int )seqno << 4U); return; } } static void ath_set_rates(struct ieee80211_vif *vif , struct ieee80211_sta *sta , struct ath_buf *bf ) { { ieee80211_get_tx_rates(vif, sta, bf->bf_mpdu, (struct ieee80211_tx_rate *)(& bf->rates), 4); return; } } static void ath_txq_skb_done(struct ath_softc *sc , struct ath_txq *txq , struct sk_buff *skb ) { struct ieee80211_tx_info *info ; struct ieee80211_tx_info *tmp ; struct ath_frame_info *fi ; struct ath_frame_info *tmp___0 ; int q ; int __ret_warn_on ; long tmp___1 ; long tmp___2 ; bool tmp___3 ; { tmp = IEEE80211_SKB_CB(skb); info = tmp; tmp___0 = get_frame_info(skb); fi = tmp___0; q = (int )fi->txq; if (q < 0) { return; } else { } txq = sc->tx.txq_map[q]; txq->pending_frames = txq->pending_frames - 1; __ret_warn_on = txq->pending_frames < 0; tmp___1 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/12119/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/ath/ath9k/xmit.c", 167); } else { } tmp___2 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___2 != 0L) { txq->pending_frames = 0; } else { } if ((int )txq->stopped && (u32 )txq->pending_frames < sc->tx.txq_max_pending[q]) { tmp___3 = ath9k_is_chanctx_enabled(); if ((int )tmp___3) { ieee80211_wake_queue(sc->hw, (int )info->hw_queue); } else { ieee80211_wake_queue(sc->hw, q); } txq->stopped = 0; } else { } return; } } static struct ath_atx_tid *ath_get_skb_tid(struct ath_softc *sc , struct ath_node *an , struct sk_buff *skb ) { u8 tidno ; { tidno = (unsigned int )((u8 )skb->priority) & 15U; return ((struct ath_atx_tid *)(& an->tid) + (unsigned long )tidno); } } static bool ath_tid_has_buffered(struct ath_atx_tid *tid ) { int tmp ; int tmp___0 ; int tmp___1 ; { tmp = skb_queue_empty((struct sk_buff_head const *)(& tid->buf_q)); if (tmp == 0) { tmp___1 = 1; } else { tmp___0 = skb_queue_empty((struct sk_buff_head const *)(& tid->retry_q)); if (tmp___0 == 0) { tmp___1 = 1; } else { tmp___1 = 0; } } return ((bool )tmp___1); } } static struct sk_buff *ath_tid_dequeue(struct ath_atx_tid *tid ) { struct sk_buff *skb ; { skb = __skb_dequeue(& tid->retry_q); if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { skb = __skb_dequeue(& tid->buf_q); } else { } return (skb); } } static void ath_tx_tid_change_state(struct ath_softc *sc , struct ath_atx_tid *tid ) { struct ath_txq *txq ; struct ieee80211_tx_info *tx_info ; struct sk_buff *skb ; struct sk_buff *tskb ; struct ath_buf *bf ; struct ath_frame_info *fi ; { txq = (tid->ac)->txq; skb = tid->buf_q.next; tskb = skb->__annonCompField68.__annonCompField67.next; goto ldv_54183; ldv_54182: fi = get_frame_info(skb); bf = fi->bf; tx_info = IEEE80211_SKB_CB(skb); tx_info->flags = tx_info->flags & 4294967231U; if ((unsigned long )bf != (unsigned long )((struct ath_buf *)0)) { goto ldv_54181; } else { } bf = ath_tx_setup_buffer(sc, txq, tid, skb); if ((unsigned long )bf == (unsigned long )((struct ath_buf *)0)) { __skb_unlink(skb, & tid->buf_q); ath_txq_skb_done(sc, txq, skb); ieee80211_free_txskb(sc->hw, skb); goto ldv_54181; } else { } ldv_54181: skb = tskb; tskb = skb->__annonCompField68.__annonCompField67.next; ldv_54183: ; if ((unsigned long )((struct sk_buff *)(& tid->buf_q)) != (unsigned long )skb) { goto ldv_54182; } else { } return; } } static void ath_tx_flush_tid(struct ath_softc *sc , struct ath_atx_tid *tid ) { struct ath_txq *txq ; struct sk_buff *skb ; struct ath_buf *bf ; struct list_head bf_head ; struct ath_tx_status ts ; struct ath_frame_info *fi ; bool sendbar ; { txq = (tid->ac)->txq; sendbar = 0; INIT_LIST_HEAD(& bf_head); memset((void *)(& ts), 0, 48UL); goto ldv_54196; ldv_54197: fi = get_frame_info(skb); bf = fi->bf; if ((unsigned long )bf == (unsigned long )((struct ath_buf *)0)) { ath_txq_skb_done(sc, txq, skb); ieee80211_free_txskb(sc->hw, skb); goto ldv_54196; } else { } if ((unsigned int )*((unsigned char *)fi + 13UL) != 0U) { ath_tx_update_baw(sc, tid, (int )bf->bf_state.seqno); sendbar = 1; } else { } list_add_tail(& bf->list, & bf_head); ath_tx_complete_buf(sc, bf, txq, & bf_head, & ts, 0); ldv_54196: skb = __skb_dequeue(& tid->retry_q); if ((unsigned long )skb != (unsigned long )((struct sk_buff *)0)) { goto ldv_54197; } else { } if ((int )sendbar) { ath_txq_unlock(sc, txq); ath_send_bar(tid, (int )tid->seq_start); ath_txq_lock(sc, txq); } else { } return; } } static void ath_tx_update_baw(struct ath_softc *sc , struct ath_atx_tid *tid , int seqno ) { int index ; int cindex ; int tmp ; { index = (seqno - (int )tid->seq_start) & 4095; cindex = (tid->baw_head + index) & 127; __clear_bit((long )cindex, (unsigned long volatile *)(& tid->tx_buf)); goto ldv_54207; ldv_54206: tid->seq_start = (u16 )((int )tid->seq_start + 1); tid->seq_start = (unsigned int )tid->seq_start & 4095U; tid->baw_head = tid->baw_head + 1; tid->baw_head = tid->baw_head & 127; if ((int )tid->bar_index >= 0) { tid->bar_index = (s8 )((int )tid->bar_index - 1); } else { } ldv_54207: ; if (tid->baw_head != tid->baw_tail) { tmp = variable_test_bit((long )tid->baw_head, (unsigned long const volatile *)(& tid->tx_buf)); if (tmp == 0) { goto ldv_54206; } else { goto ldv_54208; } } else { } ldv_54208: ; return; } } static void ath_tx_addto_baw(struct ath_softc *sc , struct ath_atx_tid *tid , struct ath_buf *bf ) { struct ath_frame_info *fi ; struct ath_frame_info *tmp ; u16 seqno ; int index ; int cindex ; { tmp = get_frame_info(bf->bf_mpdu); fi = tmp; seqno = bf->bf_state.seqno; index = ((int )seqno - (int )tid->seq_start) & 4095; cindex = (tid->baw_head + index) & 127; __set_bit((long )cindex, (unsigned long volatile *)(& tid->tx_buf)); fi->baw_tracked = 1U; if (((tid->baw_tail - tid->baw_head) & 127) <= index) { tid->baw_tail = cindex; tid->baw_tail = tid->baw_tail + 1; tid->baw_tail = tid->baw_tail & 127; } else { } return; } } static void ath_tid_drain(struct ath_softc *sc , struct ath_txq *txq , struct ath_atx_tid *tid ) { struct sk_buff *skb ; struct ath_buf *bf ; struct list_head bf_head ; struct ath_tx_status ts ; struct ath_frame_info *fi ; { memset((void *)(& ts), 0, 48UL); INIT_LIST_HEAD(& bf_head); goto ldv_54228; ldv_54229: fi = get_frame_info(skb); bf = fi->bf; if ((unsigned long )bf == (unsigned long )((struct ath_buf *)0)) { ath_tx_complete(sc, skb, 1, txq); goto ldv_54228; } else { } list_add_tail(& bf->list, & bf_head); ath_tx_complete_buf(sc, bf, txq, & bf_head, & ts, 0); ldv_54228: skb = ath_tid_dequeue(tid); if ((unsigned long )skb != (unsigned long )((struct sk_buff *)0)) { goto ldv_54229; } else { } return; } } static void ath_tx_set_retry(struct ath_softc *sc , struct ath_txq *txq , struct sk_buff *skb , int count ) { struct ath_frame_info *fi ; struct ath_frame_info *tmp ; struct ath_buf *bf ; struct ieee80211_hdr *hdr ; int prev ; { tmp = get_frame_info(skb); fi = tmp; bf = fi->bf; prev = (int )fi->retries; sc->debug.stats.txstats[txq->axq_qnum].a_retries = sc->debug.stats.txstats[txq->axq_qnum].a_retries + 1U; fi->retries = (unsigned char )((int )fi->retries + (int )((unsigned char )count)); if (prev > 0) { return; } else { } hdr = (struct ieee80211_hdr *)skb->data; hdr->frame_control = (__le16 )((unsigned int )hdr->frame_control | 2048U); dma_sync_single_for_device(sc->dev, bf->bf_buf_addr, 30UL, 1); return; } } static struct ath_buf *ath_tx_get_buffer(struct ath_softc *sc ) { struct ath_buf *bf ; int tmp ; long tmp___0 ; struct list_head const *__mptr ; { bf = (struct ath_buf *)0; spin_lock_bh(& sc->tx.txbuflock); tmp = list_empty((struct list_head const *)(& sc->tx.txbuf)); tmp___0 = ldv__builtin_expect(tmp != 0, 0L); if (tmp___0 != 0L) { spin_unlock_bh(& sc->tx.txbuflock); return ((struct ath_buf *)0); } else { } __mptr = (struct list_head const *)sc->tx.txbuf.next; bf = (struct ath_buf *)__mptr; list_del(& bf->list); spin_unlock_bh(& sc->tx.txbuflock); return (bf); } } static void ath_tx_return_buffer(struct ath_softc *sc , struct ath_buf *bf ) { { spin_lock_bh(& sc->tx.txbuflock); list_add_tail(& bf->list, & sc->tx.txbuf); spin_unlock_bh(& sc->tx.txbuflock); return; } } static struct ath_buf *ath_clone_txbuf(struct ath_softc *sc , struct ath_buf *bf ) { struct ath_buf *tbf ; int __ret_warn_on ; long tmp ; long tmp___0 ; { tbf = ath_tx_get_buffer(sc); __ret_warn_on = (unsigned long )tbf == (unsigned long )((struct ath_buf *)0); tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/12119/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/ath/ath9k/xmit.c", 392); } else { } tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { return ((struct ath_buf *)0); } else { } tbf->bf_lastbf = (struct ath_buf *)0; tbf->bf_next = (struct ath_buf *)0; memset((void *)(& tbf->bf_state), 0, 16UL); tbf->bf_mpdu = bf->bf_mpdu; tbf->bf_buf_addr = bf->bf_buf_addr; memcpy(tbf->bf_desc, (void const *)bf->bf_desc, (size_t )(sc->sc_ah)->caps.tx_desc_len); tbf->bf_state = bf->bf_state; tbf->bf_state.stale = 0; return (tbf); } } static void ath_tx_count_frames(struct ath_softc *sc , struct ath_buf *bf , struct ath_tx_status *ts , int txok , int *nframes , int *nbad ) { struct ath_frame_info *fi ; u16 seq_st ; u32 ba[2U] ; int ba_index ; int isaggr ; { seq_st = 0U; isaggr = 0; *nbad = 0; *nframes = 0; isaggr = (int )bf->bf_state.bf_type & 2; if (isaggr != 0) { seq_st = ts->ts_seqnum; memcpy((void *)(& ba), (void const *)(& ts->ba_low), 8UL); } else { } goto ldv_54272; ldv_54271: fi = get_frame_info(bf->bf_mpdu); ba_index = ((int )bf->bf_state.seqno - (int )seq_st) & 4095; *nframes = *nframes + 1; if (txok == 0 || (isaggr != 0 && (ba_index > 63 || (ba[ba_index >> 5] & (u32 )(1 << (ba_index & 31))) == 0U))) { *nbad = *nbad + 1; } else { } bf = bf->bf_next; ldv_54272: ; if ((unsigned long )bf != (unsigned long )((struct ath_buf *)0)) { goto ldv_54271; } else { } return; } } static void ath_tx_complete_aggr(struct ath_softc *sc , struct ath_txq *txq , struct ath_buf *bf , struct list_head *bf_q , struct ath_tx_status *ts , int txok ) { struct ath_node *an ; struct sk_buff *skb ; struct ieee80211_sta *sta ; struct ieee80211_hw *hw ; struct ieee80211_hdr *hdr ; struct ieee80211_tx_info *tx_info ; struct ath_atx_tid *tid ; struct ath_buf *bf_next ; struct ath_buf *bf_last ; struct list_head bf_head ; struct sk_buff_head bf_pending ; u16 seq_st ; u16 acked_cnt ; u16 txfail_cnt ; u16 seq_first ; u32 ba[2U] ; int isaggr ; int txfail ; int txpending ; int sendbar ; int needreset ; int nbad ; bool rc_update ; bool isba ; struct ieee80211_tx_rate rates[4U] ; struct ath_frame_info *fi ; int nframes ; bool flush ; int i ; int retries ; int bar_index ; u16 seqno ; int __max1 ; int __max2 ; struct ath_buf *tbf ; int __max1___0 ; int __max2___0 ; int tmp ; u16 bar_seq ; { an = (struct ath_node *)0; hw = sc->hw; tid = (struct ath_atx_tid *)0; bf_last = bf->bf_lastbf; seq_st = 0U; acked_cnt = 0U; txfail_cnt = 0U; sendbar = 0; needreset = 0; nbad = 0; rc_update = 1; flush = ((int )ts->ts_status & 64) != 0; bar_index = -1; skb = bf->bf_mpdu; hdr = (struct ieee80211_hdr *)skb->data; tx_info = IEEE80211_SKB_CB(skb); memcpy((void *)(& rates), (void const *)(& bf->rates), 12UL); retries = (int )ts->ts_longretry + 1; i = 0; goto ldv_54314; ldv_54313: retries = (int )rates[i].count + retries; i = i + 1; ldv_54314: ; if ((int )ts->ts_rateindex > i) { goto ldv_54313; } else { } rcu_read_lock(); sta = ieee80211_find_sta_by_ifaddr(hw, (u8 const *)(& hdr->addr1), (u8 const *)(& hdr->addr2)); if ((unsigned long )sta == (unsigned long )((struct ieee80211_sta *)0)) { rcu_read_unlock(); INIT_LIST_HEAD(& bf_head); goto ldv_54317; ldv_54316: bf_next = bf->bf_next; if (! bf->bf_state.stale || (unsigned long )bf_next != (unsigned long )((struct ath_buf *)0)) { list_move_tail(& bf->list, & bf_head); } else { } ath_tx_complete_buf(sc, bf, txq, & bf_head, ts, 0); bf = bf_next; ldv_54317: ; if ((unsigned long )bf != (unsigned long )((struct ath_buf *)0)) { goto ldv_54316; } else { } return; } else { } an = (struct ath_node *)(& sta->drv_priv); tid = ath_get_skb_tid(sc, an, skb); seq_first = tid->seq_start; isba = ((int )ts->ts_flags & 1) != 0; if ((int )isba && (int )tid->tidno != (int )ts->tid) { txok = 0; } else { } isaggr = (int )bf->bf_state.bf_type & 2; memset((void *)(& ba), 0, 8UL); if (isaggr != 0 && txok != 0) { if ((int )ts->ts_flags & 1) { seq_st = ts->ts_seqnum; memcpy((void *)(& ba), (void const *)(& ts->ba_low), 8UL); } else if ((unsigned int )(sc->sc_ah)->opmode == 2U) { needreset = 1; } else { } } else { } __skb_queue_head_init(& bf_pending); ath_tx_count_frames(sc, bf, ts, txok, & nframes, & nbad); goto ldv_54329; ldv_54328: seqno = bf->bf_state.seqno; sendbar = 0; txpending = sendbar; txfail = txpending; bf_next = bf->bf_next; skb = bf->bf_mpdu; tx_info = IEEE80211_SKB_CB(skb); fi = get_frame_info(skb); if ((((int )seqno - (int )tid->seq_start) & 4095) >= (int )tid->baw_size || ! tid->active) { txfail = 1; } else if ((((int )seqno - (int )seq_st) & 4095) <= 63 && (ba[(((int )seqno - (int )seq_st) & 4095) >> 5] & (u32 )(1 << (((int )seqno - (int )seq_st) & 31))) != 0U) { acked_cnt = (u16 )((int )acked_cnt + 1); } else if (isaggr == 0 && txok != 0) { acked_cnt = (u16 )((int )acked_cnt + 1); } else if ((int )flush) { txpending = 1; } else if ((int )fi->retries <= 29) { if (txok != 0 || ! an->sleeping) { ath_tx_set_retry(sc, txq, bf->bf_mpdu, retries); } else { } txpending = 1; } else { txfail = 1; txfail_cnt = (u16 )((int )txfail_cnt + 1); __max1 = bar_index; __max2 = ((int )seqno - (int )seq_first) & 4095; bar_index = __max1 > __max2 ? __max1 : __max2; } INIT_LIST_HEAD(& bf_head); if ((unsigned long )bf_next != (unsigned long )((struct ath_buf *)0) || ! bf_last->bf_state.stale) { list_move_tail(& bf->list, & bf_head); } else { } if (txpending == 0) { ath_tx_update_baw(sc, tid, (int )seqno); if ((int )rc_update && ((unsigned int )acked_cnt == 1U || (unsigned int )txfail_cnt == 1U)) { memcpy((void *)(& tx_info->__annonCompField99.control.__annonCompField97.__annonCompField96.rates), (void const *)(& rates), 12UL); ath_tx_rc_status(sc, bf, ts, nframes, nbad, txok); rc_update = 0; if ((unsigned long )bf->bf_lastbf == (unsigned long )bf) { ath_dynack_sample_tx_ts(sc->sc_ah, bf->bf_mpdu, ts); } else { } } else { } ath_tx_complete_buf(sc, bf, txq, & bf_head, ts, txfail == 0); } else { if ((tx_info->flags & 268435456U) != 0U) { tx_info->flags = tx_info->flags & 4026531839U; ieee80211_sta_eosp(sta); } else { } if ((unsigned long )bf->bf_next == (unsigned long )((struct ath_buf *)0) && (int )bf_last->bf_state.stale) { tbf = ath_clone_txbuf(sc, bf_last); if ((unsigned long )tbf == (unsigned long )((struct ath_buf *)0)) { ath_tx_update_baw(sc, tid, (int )seqno); ath_tx_complete_buf(sc, bf, txq, & bf_head, ts, 0); __max1___0 = bar_index; __max2___0 = ((int )seqno - (int )seq_first) & 4095; bar_index = __max1___0 > __max2___0 ? __max1___0 : __max2___0; goto ldv_54327; } else { } fi->bf = tbf; } else { } __skb_queue_tail(& bf_pending, skb); } bf = bf_next; ldv_54329: ; if ((unsigned long )bf != (unsigned long )((struct ath_buf *)0)) { goto ldv_54328; } else { } ldv_54327: tmp = skb_queue_empty((struct sk_buff_head const *)(& bf_pending)); if (tmp == 0) { if ((int )an->sleeping) { ieee80211_sta_set_buffered(sta, (int )tid->tidno, 1); } else { } skb_queue_splice_tail((struct sk_buff_head const *)(& bf_pending), & tid->retry_q); if (! an->sleeping) { ath_tx_queue_tid(sc, txq, tid); if (((int )ts->ts_status & 3) != 0) { (tid->ac)->clear_ps_filter = 1; } else { } } else { } } else { } if (bar_index >= 0) { bar_seq = (unsigned int )((u16 )((int )((unsigned short )bar_index) + (int )seq_first)) & 4095U; if ((((int )bar_seq - (int )tid->seq_start) & 4095) < (int )tid->baw_size) { tid->bar_index = (s8 )((int )((unsigned char )bar_seq) - (int )((unsigned char )tid->seq_start)); } else { } ath_txq_unlock(sc, txq); ath_send_bar(tid, (int )((unsigned int )((int )((unsigned short )bar_index) + (int )seq_first) + 1U) & 4095); ath_txq_lock(sc, txq); } else { } rcu_read_unlock(); if (needreset != 0) { ath9k_queue_reset(sc, 3); } else { } return; } } static bool bf_is_ampdu_not_probing(struct ath_buf *bf ) { struct ieee80211_tx_info *info ; struct ieee80211_tx_info *tmp ; { tmp = IEEE80211_SKB_CB(bf->bf_mpdu); info = tmp; return ((bool )((int )bf->bf_state.bf_type & 1 && (info->flags & 4096U) == 0U)); } } static void ath_tx_process_buffer(struct ath_softc *sc , struct ath_txq *txq , struct ath_tx_status *ts , struct ath_buf *bf , struct list_head *bf_head ) { struct ieee80211_tx_info *info ; bool txok ; bool flush ; bool tmp ; int tmp___0 ; { txok = ((int )ts->ts_status & 95) == 0; flush = ((int )ts->ts_status & 64) != 0; txq->axq_tx_inprogress = 0; txq->axq_depth = txq->axq_depth - 1U; tmp = bf_is_ampdu_not_probing(bf); if ((int )tmp) { txq->axq_ampdu_depth = txq->axq_ampdu_depth - 1U; } else { } tmp___0 = ath9k_hw_get_duration(sc->sc_ah, (void const *)bf->bf_desc, (int )ts->ts_rateindex); ts->duration = (u32 )tmp___0; if (((int )bf->bf_state.bf_type & 1) == 0) { if (! flush) { info = IEEE80211_SKB_CB(bf->bf_mpdu); memcpy((void *)(& info->__annonCompField99.control.__annonCompField97.__annonCompField96.rates), (void const *)(& bf->rates), 12UL); ath_tx_rc_status(sc, bf, ts, 1, (int )txok ? 0 : 1, (int )txok); ath_dynack_sample_tx_ts(sc->sc_ah, bf->bf_mpdu, ts); } else { } ath_tx_complete_buf(sc, bf, txq, bf_head, ts, (int )txok); } else { ath_tx_complete_aggr(sc, txq, bf, bf_head, ts, (int )txok); } if (! flush) { ath_txq_schedule(sc, txq); } else { } return; } } static bool ath_lookup_legacy(struct ath_buf *bf ) { struct sk_buff *skb ; struct ieee80211_tx_info *tx_info ; struct ieee80211_tx_rate *rates ; int i ; { skb = bf->bf_mpdu; tx_info = IEEE80211_SKB_CB(skb); rates = (struct ieee80211_tx_rate *)(& tx_info->__annonCompField99.control.__annonCompField97.__annonCompField96.rates); i = 0; goto ldv_54354; ldv_54353: ; if ((unsigned int )*((unsigned char *)(rates + (unsigned long )i) + 1UL) == 0U || (int )(rates + (unsigned long )i)->idx < 0) { goto ldv_54352; } else { } if (((int )(rates + (unsigned long )i)->flags & 8) == 0) { return (1); } else { } i = i + 1; ldv_54354: ; if (i <= 3) { goto ldv_54353; } else { } ldv_54352: ; return (0); } } static u32 ath_lookup_rate(struct ath_softc *sc , struct ath_buf *bf , struct ath_atx_tid *tid ) { struct sk_buff *skb ; struct ieee80211_tx_info *tx_info ; struct ieee80211_tx_rate *rates ; u32 max_4ms_framelen ; u32 frmlen ; u16 aggr_limit ; u16 bt_aggr_limit ; u16 legacy ; int q ; int i ; int modeidx ; u32 _min1 ; u32 _min2 ; u32 _min1___0 ; unsigned int _min2___0 ; u16 _min1___1 ; u16 _min2___1 ; { legacy = 0U; q = ((tid->ac)->txq)->mac80211_qnum; skb = bf->bf_mpdu; tx_info = IEEE80211_SKB_CB(skb); rates = (struct ieee80211_tx_rate *)(& bf->rates); max_4ms_framelen = 65535U; i = 0; goto ldv_54377; ldv_54376: ; if ((unsigned int )*((unsigned char *)(rates + (unsigned long )i) + 1UL) == 0U) { goto ldv_54371; } else { } if (((int )(rates + (unsigned long )i)->flags & 8) == 0) { legacy = 1U; goto ldv_54372; } else { } if (((int )(rates + (unsigned long )i)->flags & 32) != 0) { modeidx = 2; } else { modeidx = 0; } if (((int )(rates + (unsigned long )i)->flags & 128) != 0) { modeidx = modeidx + 1; } else { } frmlen = (u32 )sc->tx.max_aggr_framelen[q][modeidx][(int )(rates + (unsigned long )i)->idx]; _min1 = max_4ms_framelen; _min2 = frmlen; max_4ms_framelen = _min1 < _min2 ? _min1 : _min2; ldv_54371: i = i + 1; ldv_54377: ; if (i <= 3) { goto ldv_54376; } else { } ldv_54372: ; if ((tx_info->flags & 4096U) != 0U || (unsigned int )legacy != 0U) { return (0U); } else { } _min1___0 = max_4ms_framelen; _min2___0 = 65535U; aggr_limit = (u16 )(_min1___0 < _min2___0 ? _min1___0 : _min2___0); bt_aggr_limit = ath9k_btcoex_aggr_limit(sc, max_4ms_framelen); if ((unsigned int )bt_aggr_limit != 0U) { aggr_limit = bt_aggr_limit; } else { } if ((unsigned int )(tid->an)->maxampdu != 0U) { _min1___1 = aggr_limit; _min2___1 = (tid->an)->maxampdu; aggr_limit = (u16 )((int )_min1___1 < (int )_min2___1 ? _min1___1 : _min2___1); } else { } return ((u32 )aggr_limit); } } static int ath_compute_num_delims(struct ath_softc *sc , struct ath_atx_tid *tid , struct ath_buf *bf , u16 frmlen , bool first_subfrm ) { u32 nsymbits ; u32 nsymbols ; u16 minlen ; u8 flags ; u8 rix ; int width ; int streams ; int half_gi ; int ndelim ; int mindelim ; struct ath_frame_info *fi ; struct ath_frame_info *tmp ; int _max1 ; int _max2 ; int _max1___0 ; int _max2___0 ; { tmp = get_frame_info(bf->bf_mpdu); fi = tmp; ndelim = (unsigned int )frmlen <= 255U ? (259 - (int )frmlen) / 4 : 0; if ((unsigned int )fi->keyix != 255U && ((sc->sc_ah)->caps.hw_caps & 16U) == 0U) { ndelim = ndelim + 10; } else { } if (((int )first_subfrm && ((sc->sc_ah)->hw_version.macVersion != 448U || (unsigned int )(sc->sc_ah)->hw_version.macRev <= 3U)) && ((sc->sc_ah)->ent_mode & 8388608U) != 0U) { _max1 = ndelim; _max2 = 60; ndelim = _max1 > _max2 ? _max1 : _max2; } else { } if ((unsigned int )(tid->an)->mpdudensity == 0U) { return (ndelim); } else { } rix = (u8 )bf->rates[0].idx; flags = (u8 )bf->rates[0].flags; width = ((int )flags & 32) != 0; half_gi = (int )((signed char )flags) < 0; if (half_gi != 0) { nsymbols = (u32 )(((int )(tid->an)->mpdudensity * 5 + -4) / 18); } else { nsymbols = (u32 )((int )(tid->an)->mpdudensity >> 2); } if (nsymbols == 0U) { nsymbols = 1U; } else { } streams = (((int )rix & 120) >> 3) + 1; nsymbits = (u32 )((int )bits_per_symbol[(int )rix & 7][width] * streams); minlen = (u16 )((nsymbols * nsymbits) / 8U); if ((int )frmlen < (int )minlen) { mindelim = ((int )minlen - (int )frmlen) / 4; _max1___0 = mindelim; _max2___0 = ndelim; ndelim = _max1___0 > _max2___0 ? _max1___0 : _max2___0; } else { } return (ndelim); } } static struct ath_buf *ath_tx_get_tid_subframe(struct ath_softc *sc , struct ath_txq *txq , struct ath_atx_tid *tid , struct sk_buff_head **q ) { struct ieee80211_tx_info *tx_info ; struct ath_frame_info *fi ; struct sk_buff *skb ; struct ath_buf *bf ; u16 seqno ; int tmp ; struct ath_tx_status ts ; struct list_head bf_head ; { ldv_54423: *q = & tid->retry_q; tmp = skb_queue_empty((struct sk_buff_head const *)*q); if (tmp != 0) { *q = & tid->buf_q; } else { } skb = skb_peek((struct sk_buff_head const *)*q); if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { goto ldv_54419; } else { } fi = get_frame_info(skb); bf = fi->bf; if ((unsigned long )fi->bf == (unsigned long )((struct ath_buf *)0)) { bf = ath_tx_setup_buffer(sc, txq, tid, skb); } else { bf->bf_state.stale = 0; } if ((unsigned long )bf == (unsigned long )((struct ath_buf *)0)) { __skb_unlink(skb, *q); ath_txq_skb_done(sc, txq, skb); ieee80211_free_txskb(sc->hw, skb); goto ldv_54420; } else { } bf->bf_next = (struct ath_buf *)0; bf->bf_lastbf = bf; tx_info = IEEE80211_SKB_CB(skb); tx_info->flags = tx_info->flags & 4294967287U; if (! tid->active) { tx_info->flags = tx_info->flags & 4294967231U; } else { } if ((tx_info->flags & 64U) == 0U) { bf->bf_state.bf_type = 0U; return (bf); } else { } bf->bf_state.bf_type = 3U; seqno = bf->bf_state.seqno; if ((((int )seqno - (int )tid->seq_start) & 4095) >= (int )tid->baw_size) { goto ldv_54419; } else { } if ((int )tid->bar_index > (((int )seqno - (int )tid->seq_start) & 4095)) { ts.ts_tstamp = 0U; ts.ts_seqnum = (unsigned short)0; ts.ts_status = (unsigned char)0; ts.ts_rateindex = (unsigned char)0; ts.ts_rssi = (signed char)0; ts.ts_shortretry = (unsigned char)0; ts.ts_longretry = (unsigned char)0; ts.ts_virtcol = (unsigned char)0; ts.ts_flags = (unsigned char)0; ts.ts_rssi_ctl0 = (signed char)0; ts.ts_rssi_ctl1 = (signed char)0; ts.ts_rssi_ctl2 = (signed char)0; ts.ts_rssi_ext0 = (signed char)0; ts.ts_rssi_ext1 = (signed char)0; ts.ts_rssi_ext2 = (signed char)0; ts.qid = (unsigned char)0; ts.desc_id = (unsigned short)0; ts.tid = (unsigned char)0; ts.ba_low = 0U; ts.ba_high = 0U; ts.evm0 = 0U; ts.evm1 = 0U; ts.evm2 = 0U; ts.duration = 0U; INIT_LIST_HEAD(& bf_head); list_add(& bf->list, & bf_head); __skb_unlink(skb, *q); ath_tx_update_baw(sc, tid, (int )seqno); ath_tx_complete_buf(sc, bf, txq, & bf_head, & ts, 0); goto ldv_54420; } else { } return (bf); ldv_54420: ; goto ldv_54423; ldv_54419: ; return ((struct ath_buf *)0); } } static bool ath_tx_form_aggr(struct ath_softc *sc , struct ath_txq *txq , struct ath_atx_tid *tid , struct list_head *bf_q , struct ath_buf *bf_first , struct sk_buff_head *tid_q , int *aggr_len ) { struct ath_buf *bf ; struct ath_buf *bf_prev ; int nframes ; int ndelim ; u16 aggr_limit ; u16 al ; u16 bpad ; u16 al_delta ; u16 h_baw ; struct ieee80211_tx_info *tx_info ; struct ath_frame_info *fi ; struct sk_buff *skb ; bool closed ; u32 tmp ; bool tmp___0 ; bool tmp___1 ; struct ath_frame_info *tmp___2 ; { bf = bf_first; bf_prev = (struct ath_buf *)0; nframes = 0; aggr_limit = 0U; al = 0U; bpad = 0U; h_baw = (u16 )((unsigned int )tid->baw_size / 2U); closed = 0; bf = bf_first; tmp = ath_lookup_rate(sc, bf, tid); aggr_limit = (u16 )tmp; ldv_54447: skb = bf->bf_mpdu; fi = get_frame_info(skb); al_delta = (unsigned int )fi->framelen + 4U; if (nframes != 0) { if ((int )aggr_limit < ((int )al + (int )bpad) + (int )al_delta) { goto ldv_54446; } else { tmp___0 = ath_lookup_legacy(bf); if ((int )tmp___0) { goto ldv_54446; } else if ((int )h_baw <= nframes) { goto ldv_54446; } else { } } tx_info = IEEE80211_SKB_CB(bf->bf_mpdu); if ((tx_info->flags & 4096U) != 0U || (tx_info->flags & 64U) == 0U) { goto ldv_54446; } else { } } else { } al = ((int )bpad + (int )al_delta) + (int )al; ndelim = ath_compute_num_delims(sc, tid, bf_first, (int )fi->framelen, nframes == 0); bpad = (int )((u16 )((4 - ((int )al_delta & 3)) % 4)) + ((int )((u16 )ndelim) << 2U); nframes = nframes + 1; bf->bf_next = (struct ath_buf *)0; if ((unsigned int )*((unsigned char *)fi + 13UL) == 0U) { ath_tx_addto_baw(sc, tid, bf); } else { } bf->bf_state.ndelim = (u8 )ndelim; __skb_unlink(skb, tid_q); list_add_tail(& bf->list, bf_q); if ((unsigned long )bf_prev != (unsigned long )((struct ath_buf *)0)) { bf_prev->bf_next = bf; } else { } bf_prev = bf; bf = ath_tx_get_tid_subframe(sc, txq, tid, & tid_q); if ((unsigned long )bf == (unsigned long )((struct ath_buf *)0)) { closed = 1; goto ldv_54446; } else { } tmp___1 = ath_tid_has_buffered(tid); if ((int )tmp___1) { goto ldv_54447; } else { } ldv_54446: bf = bf_first; bf->bf_lastbf = bf_prev; if ((unsigned long )bf == (unsigned long )bf_prev) { tmp___2 = get_frame_info(bf->bf_mpdu); al = tmp___2->framelen; bf->bf_state.bf_type = 1U; } else { sc->debug.stats.txstats[txq->axq_qnum].a_aggr = sc->debug.stats.txstats[txq->axq_qnum].a_aggr + 1U; } *aggr_len = (int )al; return (closed); } } static u32 ath_pkt_duration(struct ath_softc *sc , u8 rix , int pktlen , int width , int half_gi , bool shortPreamble ) { u32 nbits ; u32 nsymbits ; u32 duration ; u32 nsymbols ; int streams ; { streams = (((int )rix & 120) >> 3) + 1; nbits = (u32 )((pktlen << 3) + 22); nsymbits = (u32 )((int )bits_per_symbol[(int )rix & 7][width] * streams); nsymbols = ((nbits + nsymbits) - 1U) / nsymbits; if (half_gi == 0) { duration = nsymbols << 2; } else { duration = (nsymbols * 18U + 4U) / 5U; } duration = (u32 )((streams + 8) * 4) + duration; return (duration); } } static int ath_max_framelen(int usec , int mcs , bool ht40 , bool sgi ) { int streams ; int symbols ; int bits ; int bytes ; { streams = ((mcs & 120) >> 3) + 1; bytes = 0; usec = (-8 - streams) * 4 + usec; symbols = (int )sgi ? (usec * 5 + -4) / 18 : usec >> 2; bits = ((int )bits_per_symbol[mcs % 8][(int )ht40] * symbols) * streams; bits = bits + -22; bytes = bits / 8; if (bytes > 65532) { bytes = 65532; } else { } return (bytes); } } void ath_update_max_aggr_framelen(struct ath_softc *sc , int queue , int txop ) { u16 *cur_ht20 ; u16 *cur_ht20_sgi ; u16 *cur_ht40 ; u16 *cur_ht40_sgi ; int mcs ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; { if (txop == 0 || txop > 4096) { txop = 4096; } else { } cur_ht20 = (u16 *)(& sc->tx.max_aggr_framelen) + (unsigned long )queue; cur_ht20_sgi = (u16 *)(& sc->tx.max_aggr_framelen) + ((unsigned long )queue + 1UL); cur_ht40 = (u16 *)(& sc->tx.max_aggr_framelen) + ((unsigned long )queue + 2UL); cur_ht40_sgi = (u16 *)(& sc->tx.max_aggr_framelen) + ((unsigned long )queue + 3UL); mcs = 0; goto ldv_54482; ldv_54481: tmp = ath_max_framelen(txop, mcs, 0, 0); *(cur_ht20 + (unsigned long )mcs) = (u16 )tmp; tmp___0 = ath_max_framelen(txop, mcs, 0, 1); *(cur_ht20_sgi + (unsigned long )mcs) = (u16 )tmp___0; tmp___1 = ath_max_framelen(txop, mcs, 1, 0); *(cur_ht40 + (unsigned long )mcs) = (u16 )tmp___1; tmp___2 = ath_max_framelen(txop, mcs, 1, 1); *(cur_ht40_sgi + (unsigned long )mcs) = (u16 )tmp___2; mcs = mcs + 1; ldv_54482: ; if (mcs <= 31) { goto ldv_54481; } else { } return; } } static u8 ath_get_rate_txpower(struct ath_softc *sc , struct ath_buf *bf , u8 rateidx , bool is_40 , bool is_cck ) { u8 max_power ; struct sk_buff *skb ; struct ath_frame_info *fi ; struct ieee80211_tx_info *info ; struct ath_hw *ah ; int txpower ; u8 power_ht40delta ; struct ar5416_eeprom_def *eep ; bool is_2ghz ; struct modal_eep_header *pmodal ; s8 power_offset ; u32 tmp ; u32 tmp___0 ; int _max1 ; int _max2 ; u8 __min1 ; u8 __min2 ; u8 __min1___0 ; u8 __min2___0 ; u8 __min1___1 ; u8 __min2___1 ; { ah = sc->sc_ah; if ((int )sc->tx99_state || ! ah->tpc_enabled) { return (63U); } else { } skb = bf->bf_mpdu; fi = get_frame_info(skb); info = IEEE80211_SKB_CB(skb); if (ah->hw_version.macVersion <= 447U) { txpower = (int )fi->tx_power; if ((int )is_40) { eep = & ah->eeprom.def; if (((int )eep->baseEepHeader.version & 4095) > 1) { is_2ghz = (unsigned int )info->band == 0U; pmodal = (struct modal_eep_header *)(& eep->modalHeader) + (unsigned long )is_2ghz; power_ht40delta = pmodal->ht40PowerIncForPdadc; } else { power_ht40delta = 2U; } txpower = (int )power_ht40delta + txpower; } else { } if ((ah->hw_version.macVersion == 384U || ah->hw_version.macVersion == 192U) || ah->hw_version.macVersion == 320U) { txpower = txpower + 10; } else if (ah->hw_version.macVersion > 127U) { tmp = (*((ah->eep_ops)->get_eeprom))(ah, 26); power_offset = (s8 )tmp; txpower = (int )power_offset * -2 + txpower; } else { } if (ah->hw_version.macVersion > 127U) { tmp___0 = (*((ah->eep_ops)->get_eeprom))(ah, 18); if (tmp___0 != 0U) { if ((int )is_cck) { txpower = txpower + -2; } else { } } else { } } else { } _max1 = txpower; _max2 = 0; txpower = _max1 > _max2 ? _max1 : _max2; __min1 = ah->tx_power[(int )rateidx]; __min2 = (u8 )txpower; max_power = (u8 )((int )__min1 < (int )__min2 ? __min1 : __min2); if ((unsigned int )max_power == 0U && ah->hw_version.macVersion <= 127U) { max_power = 1U; } else { } } else if ((unsigned int )bf->bf_state.bfs_paprd == 0U) { if ((unsigned int )rateidx <= 7U && (info->flags & 25165824U) != 0U) { __min1___0 = ah->tx_power_stbc[(int )rateidx]; __min2___0 = fi->tx_power; max_power = (u8 )((int )__min1___0 < (int )__min2___0 ? __min1___0 : __min2___0); } else { __min1___1 = ah->tx_power[(int )rateidx]; __min2___1 = fi->tx_power; max_power = (u8 )((int )__min1___1 < (int )__min2___1 ? __min1___1 : __min2___1); } } else { max_power = (u8 )ah->paprd_training_power; } return (max_power); } } static void ath_buf_set_rate(struct ath_softc *sc , struct ath_buf *bf , struct ath_tx_info *info , int len , bool rts ) { struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; struct sk_buff *skb ; struct ieee80211_tx_info *tx_info ; struct ieee80211_tx_rate *rates ; struct ieee80211_rate const *rate ; struct ieee80211_hdr *hdr ; struct ath_frame_info *fi ; struct ath_frame_info *tmp___0 ; u32 rts_thresh ; int i ; u8 rix ; int tmp___1 ; bool is_40 ; bool is_sgi ; bool is_sp ; bool is_cck ; int phy ; long tmp___2 ; u8 tmp___3 ; u8 tmp___4 ; u16 tmp___5 ; { ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; tmp___0 = get_frame_info(bf->bf_mpdu); fi = tmp___0; rts_thresh = ((sc->hw)->wiphy)->rts_threshold; rix = 0U; skb = bf->bf_mpdu; tx_info = IEEE80211_SKB_CB(skb); rates = (struct ieee80211_tx_rate *)(& bf->rates); hdr = (struct ieee80211_hdr *)skb->data; tmp___1 = ieee80211_is_pspoll((int )hdr->frame_control); info->dur_update = tmp___1 == 0; info->rtscts_rate = fi->rtscts_rate; i = 0; goto ldv_54541; ldv_54540: ; if ((unsigned int )*((unsigned char *)(rates + (unsigned long )i) + 1UL) == 0U || (int )(rates + (unsigned long )i)->idx < 0) { goto ldv_54539; } else { } rix = (u8 )(rates + (unsigned long )i)->idx; info->rates[i].Tries = (u32 )(rates + (unsigned long )i)->count; if (((int )bf->bf_state.bf_type & 1 && ((int )bf->bf_state.bf_type & 2) == 0) && ((int )(rates + (unsigned long )i)->flags & 8) != 0) { tmp___2 = ldv__builtin_expect(rts_thresh != 4294967295U, 0L); if (tmp___2 != 0L) { if (rts_thresh == 0U || (u32 )len > rts_thresh) { rts = 1; } else { } } else { } } else { } if ((int )rts || (int )(rates + (unsigned long )i)->flags & 1) { info->rates[i].RateFlags = info->rates[i].RateFlags | 1U; info->flags = info->flags | 4U; } else if (((int )(rates + (unsigned long )i)->flags & 2) != 0) { info->rates[i].RateFlags = info->rates[i].RateFlags | 1U; info->flags = info->flags | 8U; } else { } if (((int )(rates + (unsigned long )i)->flags & 32) != 0) { info->rates[i].RateFlags = info->rates[i].RateFlags | 2U; } else { } if (((int )(rates + (unsigned long )i)->flags & 128) != 0) { info->rates[i].RateFlags = info->rates[i].RateFlags | 4U; } else { } is_sgi = ((int )(rates + (unsigned long )i)->flags & 128) != 0; is_40 = ((int )(rates + (unsigned long )i)->flags & 32) != 0; is_sp = ((int )(rates + (unsigned long )i)->flags & 4) != 0; if (((int )(rates + (unsigned long )i)->flags & 8) != 0) { info->rates[i].Rate = (unsigned int )rix | 128U; tmp___3 = ath_txchainmask_reduction(sc, (int )ah->txchainmask, info->rates[i].Rate); info->rates[i].ChSel = (u32 )tmp___3; info->rates[i].PktDuration = ath_pkt_duration(sc, (int )rix, len, (int )is_40, (int )is_sgi, (int )is_sp); if ((unsigned int )rix <= 7U && (tx_info->flags & 25165824U) != 0U) { info->rates[i].RateFlags = info->rates[i].RateFlags | 8U; } else { } info->txpower[i] = ath_get_rate_txpower(sc, bf, (int )rix, (int )is_40, 0); goto ldv_54539; } else { } rate = (struct ieee80211_rate const *)common->sbands[(int )tx_info->band].bitrates + (unsigned long )(rates + (unsigned long )i)->idx; if ((unsigned int )tx_info->band == 0U && ((unsigned int )rate->flags & 16U) == 0U) { phy = 1; } else { phy = 0; } info->rates[i].Rate = (u32 )rate->hw_value; if ((unsigned int )((unsigned short )rate->hw_value_short) != 0U) { if (((int )(rates + (unsigned long )i)->flags & 4) != 0) { info->rates[i].Rate = info->rates[i].Rate | (u32 )rate->hw_value_short; } else { } } else { is_sp = 0; } if ((unsigned int )bf->bf_state.bfs_paprd != 0U) { info->rates[i].ChSel = (u32 )ah->txchainmask; } else { tmp___4 = ath_txchainmask_reduction(sc, (int )ah->txchainmask, info->rates[i].Rate); info->rates[i].ChSel = (u32 )tmp___4; } tmp___5 = ath9k_hw_computetxtime(sc->sc_ah, (int )((u8 )phy), (int )rate->bitrate * 100, (u32 )len, (int )rix, (int )is_sp); info->rates[i].PktDuration = (u32 )tmp___5; is_cck = (bool )(info->rates[i].Rate > 23U && info->rates[i].Rate <= 30U); info->txpower[i] = ath_get_rate_txpower(sc, bf, (int )rix, 0, (int )is_cck); ldv_54539: i = i + 1; ldv_54541: ; if ((unsigned int )i <= 3U) { goto ldv_54540; } else { } if (((int )bf->bf_state.bf_type & 2) != 0 && (int )(sc->sc_ah)->caps.rts_aggr_limit < len) { info->flags = info->flags & 4294967291U; } else { } if ((info->flags & 4U) != 0U) { info->flags = info->flags & 4294967287U; } else { } return; } } static enum ath9k_pkt_type get_hw_packet_type(struct sk_buff *skb ) { struct ieee80211_hdr *hdr ; enum ath9k_pkt_type htype ; __le16 fc ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; { hdr = (struct ieee80211_hdr *)skb->data; fc = hdr->frame_control; tmp___2 = ieee80211_is_beacon((int )fc); if (tmp___2 != 0) { htype = 3; } else { tmp___1 = ieee80211_is_probe_resp((int )fc); if (tmp___1 != 0) { htype = 4; } else { tmp___0 = ieee80211_is_atim((int )fc); if (tmp___0 != 0) { htype = 1; } else { tmp = ieee80211_is_pspoll((int )fc); if (tmp != 0) { htype = 2; } else { htype = 0; } } } } return (htype); } } static void ath_tx_fill_desc(struct ath_softc *sc , struct ath_buf *bf , struct ath_txq *txq , int len ) { struct ath_hw *ah ; struct ath_buf *bf_first ; struct ath_tx_info info ; u32 rts_thresh ; bool rts ; struct sk_buff *skb ; struct ieee80211_tx_info *tx_info ; struct ieee80211_tx_info *tmp ; struct ath_frame_info *fi ; struct ath_frame_info *tmp___0 ; bool aggr ; long tmp___1 ; { ah = sc->sc_ah; bf_first = (struct ath_buf *)0; rts_thresh = ((sc->hw)->wiphy)->rts_threshold; rts = 0; memset((void *)(& info), 0, 184UL); info.is_first = 1; info.is_last = 1; info.qcu = (u8 )txq->axq_qnum; goto ldv_54565; ldv_54564: skb = bf->bf_mpdu; tmp = IEEE80211_SKB_CB(skb); tx_info = tmp; tmp___0 = get_frame_info(skb); fi = tmp___0; aggr = ((int )bf->bf_state.bf_type & 2) != 0; info.type = get_hw_packet_type(skb); if ((unsigned long )bf->bf_next != (unsigned long )((struct ath_buf *)0)) { info.link = (bf->bf_next)->bf_daddr; } else { info.link = (int )sc->tx99_state ? bf->bf_daddr : 0ULL; } if ((unsigned long )bf_first == (unsigned long )((struct ath_buf *)0)) { bf_first = bf; if (! sc->tx99_state) { info.flags = 16U; } else { } if ((tx_info->flags & 8U) != 0U || (unsigned long )sc->tx.uapsdq == (unsigned long )txq) { info.flags = info.flags | 4096U; } else { } if ((tx_info->flags & 4U) != 0U) { info.flags = info.flags | 2U; } else { } if ((tx_info->flags & 4194304U) != 0U) { info.flags = info.flags | 2048U; } else { } if ((unsigned int )bf->bf_state.bfs_paprd != 0U) { info.flags = info.flags | ((unsigned int )bf->bf_state.bfs_paprd << 16); } else { } if ((int )aggr && (unsigned long )bf == (unsigned long )bf_first) { tmp___1 = ldv__builtin_expect(rts_thresh != 4294967295U, 0L); if (tmp___1 != 0L) { if (rts_thresh == 0U || (u32 )len > rts_thresh) { rts = 1; } else { } } else { } } else { } if (! aggr) { len = (int )fi->framelen; } else { } ath_buf_set_rate(sc, bf, & info, len, (int )rts); } else { } info.buf_addr[0] = bf->bf_buf_addr; info.buf_len[0] = (int )skb->len; info.pkt_len = (int )fi->framelen; info.keyix = fi->keyix; info.keytype = (enum ath9k_key_type )fi->keytype; if ((int )aggr) { if ((unsigned long )bf == (unsigned long )bf_first) { info.aggr = 1; } else if ((unsigned long )bf_first->bf_lastbf == (unsigned long )bf) { info.aggr = 3; } else { info.aggr = 2; } info.ndelim = bf->bf_state.ndelim; info.aggr_len = (u16 )len; } else { } if ((unsigned long )bf_first->bf_lastbf == (unsigned long )bf) { bf_first = (struct ath_buf *)0; } else { } ath9k_hw_set_txdesc(ah, bf->bf_desc, & info); bf = bf->bf_next; ldv_54565: ; if ((unsigned long )bf != (unsigned long )((struct ath_buf *)0)) { goto ldv_54564; } else { } return; } } static void ath_tx_form_burst(struct ath_softc *sc , struct ath_txq *txq , struct ath_atx_tid *tid , struct list_head *bf_q , struct ath_buf *bf_first , struct sk_buff_head *tid_q ) { struct ath_buf *bf ; struct ath_buf *bf_prev ; struct sk_buff *skb ; int nframes ; struct ieee80211_tx_info *tx_info ; { bf = bf_first; bf_prev = (struct ath_buf *)0; nframes = 0; ldv_54581: skb = bf->bf_mpdu; nframes = nframes + 1; __skb_unlink(skb, tid_q); list_add_tail(& bf->list, bf_q); if ((unsigned long )bf_prev != (unsigned long )((struct ath_buf *)0)) { bf_prev->bf_next = bf; } else { } bf_prev = bf; if (nframes > 1) { goto ldv_54580; } else { } bf = ath_tx_get_tid_subframe(sc, txq, tid, & tid_q); if ((unsigned long )bf == (unsigned long )((struct ath_buf *)0)) { goto ldv_54580; } else { } tx_info = IEEE80211_SKB_CB(bf->bf_mpdu); if ((tx_info->flags & 64U) != 0U) { goto ldv_54580; } else { } ath_set_rates((tid->an)->vif, (tid->an)->sta, bf); goto ldv_54581; ldv_54580: ; return; } } static bool ath_tx_sched_aggr(struct ath_softc *sc , struct ath_txq *txq , struct ath_atx_tid *tid , bool *stop ) { struct ath_buf *bf ; struct ieee80211_tx_info *tx_info ; struct sk_buff_head *tid_q ; struct list_head bf_q ; int aggr_len ; bool aggr ; bool last ; bool tmp ; int tmp___0 ; int tmp___1 ; { aggr_len = 0; last = 1; tmp = ath_tid_has_buffered(tid); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { return (0); } else { } INIT_LIST_HEAD(& bf_q); bf = ath_tx_get_tid_subframe(sc, txq, tid, & tid_q); if ((unsigned long )bf == (unsigned long )((struct ath_buf *)0)) { return (0); } else { } tx_info = IEEE80211_SKB_CB(bf->bf_mpdu); aggr = (tx_info->flags & 64U) != 0U; if (((int )aggr && txq->axq_ampdu_depth > 1U) || (! aggr && txq->axq_depth > 7U)) { *stop = 1; return (0); } else { } ath_set_rates((tid->an)->vif, (tid->an)->sta, bf); if ((int )aggr) { last = ath_tx_form_aggr(sc, txq, tid, & bf_q, bf, tid_q, & aggr_len); } else { ath_tx_form_burst(sc, txq, tid, & bf_q, bf, tid_q); } tmp___1 = list_empty((struct list_head const *)(& bf_q)); if (tmp___1 != 0) { return (0); } else { } if ((int )(tid->ac)->clear_ps_filter || (int )(tid->an)->no_ps_filter) { (tid->ac)->clear_ps_filter = 0; tx_info->flags = tx_info->flags | 8U; } else { } ath_tx_fill_desc(sc, bf, txq, aggr_len); ath_tx_txqaddbuf(sc, txq, & bf_q, 0); return (1); } } int ath_tx_aggr_start(struct ath_softc *sc , struct ieee80211_sta *sta , u16 tid , u16 *ssn ) { struct ath_atx_tid *txtid ; struct ath_txq *txq ; struct ath_node *an ; u8 density ; u16 tmp ; int tmp___0 ; { an = (struct ath_node *)(& sta->drv_priv); txtid = (struct ath_atx_tid *)(& an->tid) + (unsigned long )tid; txq = (txtid->ac)->txq; ath_txq_lock(sc, txq); if ((int )sta->ht_cap.ht_supported) { an->maxampdu = (unsigned int )((u16 )(1 << ((int )sta->ht_cap.ampdu_factor + 13))) + 65535U; density = ath9k_parse_mpdudensity((int )sta->ht_cap.ampdu_density); an->mpdudensity = density; } else { } ath_tx_tid_change_state(sc, txtid); txtid->active = 1; tmp = txtid->seq_next; txtid->seq_start = tmp; *ssn = tmp; txtid->bar_index = -1; memset((void *)(& txtid->tx_buf), 0, 16UL); tmp___0 = 0; txtid->baw_tail = tmp___0; txtid->baw_head = tmp___0; ath_txq_unlock_complete(sc, txq); return (0); } } void ath_tx_aggr_stop(struct ath_softc *sc , struct ieee80211_sta *sta , u16 tid ) { struct ath_node *an ; struct ath_atx_tid *txtid ; struct ath_txq *txq ; { an = (struct ath_node *)(& sta->drv_priv); txtid = (struct ath_atx_tid *)(& an->tid) + (unsigned long )tid; txq = (txtid->ac)->txq; ath_txq_lock(sc, txq); txtid->active = 0; ath_tx_flush_tid(sc, txtid); ath_tx_tid_change_state(sc, txtid); ath_txq_unlock_complete(sc, txq); return; } } void ath_tx_aggr_sleep(struct ieee80211_sta *sta , struct ath_softc *sc , struct ath_node *an ) { struct ath_atx_tid *tid ; struct ath_atx_ac *ac ; struct ath_txq *txq ; bool buffered ; int tidno ; { tidno = 0; tid = (struct ath_atx_tid *)(& an->tid) + (unsigned long )tidno; goto ldv_54625; ldv_54624: ac = tid->ac; txq = ac->txq; ath_txq_lock(sc, txq); if (! tid->sched) { ath_txq_unlock(sc, txq); goto ldv_54623; } else { } buffered = ath_tid_has_buffered(tid); tid->sched = 0; list_del(& tid->list); if ((int )ac->sched) { ac->sched = 0; list_del(& ac->list); } else { } ath_txq_unlock(sc, txq); ieee80211_sta_set_buffered(sta, (int )((u8 )tidno), (int )buffered); ldv_54623: tidno = tidno + 1; tid = tid + 1; ldv_54625: ; if (tidno <= 15) { goto ldv_54624; } else { } return; } } void ath_tx_aggr_wakeup(struct ath_softc *sc , struct ath_node *an ) { struct ath_atx_tid *tid ; struct ath_atx_ac *ac ; struct ath_txq *txq ; int tidno ; bool tmp ; { tidno = 0; tid = (struct ath_atx_tid *)(& an->tid) + (unsigned long )tidno; goto ldv_54636; ldv_54635: ac = tid->ac; txq = ac->txq; ath_txq_lock(sc, txq); ac->clear_ps_filter = 1; tmp = ath_tid_has_buffered(tid); if ((int )tmp) { ath_tx_queue_tid(sc, txq, tid); ath_txq_schedule(sc, txq); } else { } ath_txq_unlock_complete(sc, txq); tidno = tidno + 1; tid = tid + 1; ldv_54636: ; if (tidno <= 15) { goto ldv_54635; } else { } return; } } void ath_tx_aggr_resume(struct ath_softc *sc , struct ieee80211_sta *sta , u16 tidno ) { struct ath_atx_tid *tid ; struct ath_node *an ; struct ath_txq *txq ; bool tmp ; { an = (struct ath_node *)(& sta->drv_priv); tid = (struct ath_atx_tid *)(& an->tid) + (unsigned long )tidno; txq = (tid->ac)->txq; ath_txq_lock(sc, txq); tid->baw_size = (u16 )(8 << (int )sta->ht_cap.ampdu_factor); tmp = ath_tid_has_buffered(tid); if ((int )tmp) { ath_tx_queue_tid(sc, txq, tid); ath_txq_schedule(sc, txq); } else { } ath_txq_unlock_complete(sc, txq); return; } } void ath9k_release_buffered_frames(struct ieee80211_hw *hw , struct ieee80211_sta *sta , u16 tids , int nframes , enum ieee80211_frame_release_type reason , bool more_data ) { struct ath_softc *sc ; struct ath_node *an ; struct ath_txq *txq ; struct ieee80211_tx_info *info ; struct list_head bf_q ; struct ath_buf *bf_tail ; struct ath_buf *bf ; struct sk_buff_head *tid_q ; int sent ; int i ; struct ath_atx_tid *tid ; bool tmp ; int tmp___0 ; int tmp___1 ; struct list_head const *__mptr ; { sc = (struct ath_softc *)hw->priv; an = (struct ath_node *)(& sta->drv_priv); txq = sc->tx.uapsdq; bf_tail = (struct ath_buf *)0; sent = 0; INIT_LIST_HEAD(& bf_q); i = 0; goto ldv_54670; ldv_54669: ; if (((int )tids & 1) == 0) { goto ldv_54665; } else { } tid = (struct ath_atx_tid *)(& an->tid) + (unsigned long )i; ath_txq_lock(sc, (tid->ac)->txq); goto ldv_54668; ldv_54667: bf = ath_tx_get_tid_subframe(sc, sc->tx.uapsdq, tid, & tid_q); if ((unsigned long )bf == (unsigned long )((struct ath_buf *)0)) { goto ldv_54666; } else { } __skb_unlink(bf->bf_mpdu, tid_q); list_add_tail(& bf->list, & bf_q); ath_set_rates((tid->an)->vif, (tid->an)->sta, bf); if ((int )bf->bf_state.bf_type & 1) { ath_tx_addto_baw(sc, tid, bf); bf->bf_state.bf_type = (unsigned int )bf->bf_state.bf_type & 253U; } else { } if ((unsigned long )bf_tail != (unsigned long )((struct ath_buf *)0)) { bf_tail->bf_next = bf; } else { } bf_tail = bf; nframes = nframes - 1; sent = sent + 1; sc->debug.stats.txstats[txq->axq_qnum].a_queued_hw = sc->debug.stats.txstats[txq->axq_qnum].a_queued_hw + 1U; if ((unsigned long )an->sta != (unsigned long )((struct ieee80211_sta *)0)) { tmp = ath_tid_has_buffered(tid); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { ieee80211_sta_set_buffered(an->sta, (int )((u8 )i), 0); } else { } } else { } ldv_54668: ; if (nframes > 0) { goto ldv_54667; } else { } ldv_54666: ath_txq_unlock_complete(sc, (tid->ac)->txq); ldv_54665: i = i + 1; tids = (u16 )((int )tids >> 1); ldv_54670: ; if ((unsigned int )tids != 0U && nframes != 0) { goto ldv_54669; } else { } tmp___1 = list_empty((struct list_head const *)(& bf_q)); if (tmp___1 != 0) { return; } else { } info = IEEE80211_SKB_CB(bf_tail->bf_mpdu); info->flags = info->flags | 268435456U; __mptr = (struct list_head const *)bf_q.next; bf = (struct ath_buf *)__mptr; ath_txq_lock(sc, txq); ath_tx_fill_desc(sc, bf, txq, 0); ath_tx_txqaddbuf(sc, txq, & bf_q, 0); ath_txq_unlock(sc, txq); return; } } struct ath_txq *ath_txq_setup(struct ath_softc *sc , int qtype , int subtype ) { struct ath_hw *ah ; struct ath9k_tx_queue_info qi ; int subtype_txq_to_hwq[4U] ; int axq_qnum ; int i ; struct ath_txq *txq ; struct lock_class_key __key ; u8 tmp ; { ah = sc->sc_ah; subtype_txq_to_hwq[0] = 3; subtype_txq_to_hwq[1] = 2; subtype_txq_to_hwq[2] = 1; subtype_txq_to_hwq[3] = 0; memset((void *)(& qi), 0, 60UL); qi.tqi_subtype = subtype_txq_to_hwq[subtype]; qi.tqi_aifs = 4294967295U; qi.tqi_cwmin = 4294967295U; qi.tqi_cwmax = 4294967295U; qi.tqi_physCompBuf = 0U; if ((ah->caps.hw_caps & 16U) != 0U) { qi.tqi_qflags = 1; } else if (qtype == 4) { qi.tqi_qflags = 2; } else { qi.tqi_qflags = 6; } axq_qnum = ath9k_hw_setuptxqueue(ah, (enum ath9k_tx_queue )qtype, (struct ath9k_tx_queue_info const *)(& qi)); if (axq_qnum == -1) { return ((struct ath_txq *)0); } else { } if ((sc->tx.txqsetup & (u32 )(1 << axq_qnum)) == 0U) { txq = (struct ath_txq *)(& sc->tx.txq) + (unsigned long )axq_qnum; txq->axq_qnum = (u32 )axq_qnum; txq->mac80211_qnum = -1; txq->axq_link = (void *)0; __skb_queue_head_init(& txq->complete_q); INIT_LIST_HEAD(& txq->axq_q); spinlock_check(& txq->axq_lock); __raw_spin_lock_init(& txq->axq_lock.__annonCompField18.rlock, "&(&txq->axq_lock)->rlock", & __key); txq->axq_depth = 0U; txq->axq_ampdu_depth = 0U; txq->axq_tx_inprogress = 0; sc->tx.txqsetup = sc->tx.txqsetup | (u32 )(1 << axq_qnum); tmp = 0U; txq->txq_tailidx = tmp; txq->txq_headidx = tmp; i = 0; goto ldv_54687; ldv_54686: INIT_LIST_HEAD((struct list_head *)(& txq->txq_fifo) + (unsigned long )i); i = i + 1; ldv_54687: ; if (i <= 7) { goto ldv_54686; } else { } } else { } return ((struct ath_txq *)(& sc->tx.txq) + (unsigned long )axq_qnum); } } int ath_txq_update(struct ath_softc *sc , int qnum , struct ath9k_tx_queue_info *qinfo ) { struct ath_hw *ah ; int error ; struct ath9k_tx_queue_info qi ; long tmp ; struct ath_common *tmp___0 ; bool tmp___1 ; int tmp___2 ; { ah = sc->sc_ah; error = 0; tmp = ldv__builtin_expect(sc->tx.txq[qnum].axq_qnum != (u32 )qnum, 0L); if (tmp != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/12119/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/ath/ath9k/xmit.c"), "i" (1771), "i" (12UL)); ldv_54697: ; goto ldv_54697; } else { } ath9k_hw_get_txq_props(ah, qnum, & qi); qi.tqi_aifs = qinfo->tqi_aifs; qi.tqi_cwmin = qinfo->tqi_cwmin; qi.tqi_cwmax = qinfo->tqi_cwmax; qi.tqi_burstTime = qinfo->tqi_burstTime; qi.tqi_readyTime = qinfo->tqi_readyTime; tmp___1 = ath9k_hw_set_txq_props(ah, qnum, (struct ath9k_tx_queue_info const *)(& qi)); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { tmp___0 = ath9k_hw_common(sc->sc_ah); ath_printk("\v", (struct ath_common const *)tmp___0, "Unable to update hardware queue %u!\n", qnum); error = -5; } else { ath9k_hw_resettxqueue(ah, (u32 )qnum); } return (error); } } int ath_cabq_update(struct ath_softc *sc ) { struct ath9k_tx_queue_info qi ; struct ath_beacon_config *cur_conf ; int qnum ; { cur_conf = & (sc->cur_chan)->beacon; qnum = (int )(sc->beacon.cabq)->axq_qnum; ath9k_hw_get_txq_props(sc->sc_ah, qnum, & qi); qi.tqi_readyTime = (u32 )(((cur_conf->beacon_interval << 10) * 80) / 100); ath_txq_update(sc, qnum, & qi); return (0); } } static void ath_drain_txq_list(struct ath_softc *sc , struct ath_txq *txq , struct list_head *list ) { struct ath_buf *bf ; struct ath_buf *lastbf ; struct list_head bf_head ; struct ath_tx_status ts ; struct list_head const *__mptr ; int tmp ; { memset((void *)(& ts), 0, 48UL); ts.ts_status = 64U; INIT_LIST_HEAD(& bf_head); goto ldv_54715; ldv_54716: __mptr = (struct list_head const *)list->next; bf = (struct ath_buf *)__mptr; if ((int )bf->bf_state.stale) { list_del(& bf->list); ath_tx_return_buffer(sc, bf); goto ldv_54715; } else { } lastbf = bf->bf_lastbf; list_cut_position(& bf_head, list, & lastbf->list); ath_tx_process_buffer(sc, txq, & ts, bf, & bf_head); ldv_54715: tmp = list_empty((struct list_head const *)list); if (tmp == 0) { goto ldv_54716; } else { } return; } } void ath_draintxq(struct ath_softc *sc , struct ath_txq *txq ) { int idx ; int tmp ; { ath_txq_lock(sc, txq); if (((sc->sc_ah)->caps.hw_caps & 16U) != 0U) { idx = (int )txq->txq_tailidx; goto ldv_54724; ldv_54723: ath_drain_txq_list(sc, txq, (struct list_head *)(& txq->txq_fifo) + (unsigned long )idx); idx = idx + 1; idx = idx & 7; ldv_54724: tmp = list_empty((struct list_head const *)(& txq->txq_fifo) + (unsigned long )idx); if (tmp == 0) { goto ldv_54723; } else { } txq->txq_tailidx = (u8 )idx; } else { } txq->axq_link = (void *)0; txq->axq_tx_inprogress = 0; ath_drain_txq_list(sc, txq, & txq->axq_q); ath_txq_unlock_complete(sc, txq); return; } } bool ath_drain_all_txq(struct ath_softc *sc ) { struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; struct ath_txq *txq ; int i ; u32 npend ; int tmp___0 ; u32 tmp___1 ; { ah = sc->sc_ah; tmp = ath9k_hw_common(sc->sc_ah); common = tmp; npend = 0U; tmp___0 = constant_test_bit(0L, (unsigned long const volatile *)(& common->op_flags)); if (tmp___0 != 0) { return (1); } else { } ath9k_hw_abort_tx_dma(ah); i = 0; goto ldv_54736; ldv_54735: ; if ((sc->tx.txqsetup & (u32 )(1 << i)) == 0U) { goto ldv_54734; } else { } if (sc->tx.txq[i].axq_depth == 0U) { goto ldv_54734; } else { } tmp___1 = ath9k_hw_numtxpending(ah, sc->tx.txq[i].axq_qnum); if (tmp___1 != 0U) { npend = (u32 )(1UL << i) | npend; } else { } ldv_54734: i = i + 1; ldv_54736: ; if (i <= 9) { goto ldv_54735; } else { } if (npend != 0U) { ath_printk("\v", (struct ath_common const *)common, "Failed to stop TX DMA, queues=0x%03x!\n", npend); } else { } i = 0; goto ldv_54740; ldv_54739: ; if ((sc->tx.txqsetup & (u32 )(1 << i)) == 0U) { goto ldv_54738; } else { } txq = (struct ath_txq *)(& sc->tx.txq) + (unsigned long )i; txq->stopped = 0; ath_draintxq(sc, txq); ldv_54738: i = i + 1; ldv_54740: ; if (i <= 9) { goto ldv_54739; } else { } return (npend == 0U); } } void ath_tx_cleanupq(struct ath_softc *sc , struct ath_txq *txq ) { { ath9k_hw_releasetxqueue(sc->sc_ah, txq->axq_qnum); sc->tx.txqsetup = sc->tx.txqsetup & (u32 )(~ (1 << (int )txq->axq_qnum)); return; } } void ath_txq_schedule(struct ath_softc *sc , struct ath_txq *txq ) { struct ath_common *common ; struct ath_common *tmp ; struct ath_atx_ac *ac ; struct ath_atx_ac *last_ac ; struct ath_atx_tid *tid ; struct ath_atx_tid *last_tid ; struct list_head *ac_list ; bool sent ; int tmp___0 ; int tmp___1 ; struct list_head const *__mptr ; bool stop ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; struct list_head const *__mptr___2 ; bool tmp___2 ; bool tmp___3 ; int tmp___4 ; int tmp___5 ; struct list_head const *__mptr___3 ; int tmp___6 ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; sent = 0; if (txq->mac80211_qnum < 0) { return; } else { } tmp___0 = constant_test_bit(4L, (unsigned long const volatile *)(& common->op_flags)); if (tmp___0 != 0) { return; } else { } spin_lock_bh(& sc->chan_lock); ac_list = (struct list_head *)(& (sc->cur_chan)->acq) + (unsigned long )txq->mac80211_qnum; tmp___1 = list_empty((struct list_head const *)ac_list); if (tmp___1 != 0) { spin_unlock_bh(& sc->chan_lock); return; } else { } rcu_read_lock(); __mptr = (struct list_head const *)ac_list->prev; last_ac = (struct ath_atx_ac *)__mptr + 0xfffffffffffffff8UL; goto ldv_54773; ldv_54772: stop = 0; if ((int )(sc->cur_chan)->stopped) { goto ldv_54760; } else { } __mptr___0 = (struct list_head const *)ac_list->next; ac = (struct ath_atx_ac *)__mptr___0 + 0xfffffffffffffff8UL; __mptr___1 = (struct list_head const *)ac->tid_q.prev; last_tid = (struct ath_atx_tid *)__mptr___1; list_del(& ac->list); ac->sched = 0; goto ldv_54769; ldv_54768: __mptr___2 = (struct list_head const *)ac->tid_q.next; tid = (struct ath_atx_tid *)__mptr___2; list_del(& tid->list); tid->sched = 0; tmp___2 = ath_tx_sched_aggr(sc, txq, tid, & stop); if ((int )tmp___2) { sent = 1; } else { } tmp___3 = ath_tid_has_buffered(tid); if ((int )tmp___3) { ath_tx_queue_tid(sc, txq, tid); } else { } if ((int )stop || (unsigned long )tid == (unsigned long )last_tid) { goto ldv_54767; } else { } ldv_54769: tmp___4 = list_empty((struct list_head const *)(& ac->tid_q)); if (tmp___4 == 0) { goto ldv_54768; } else { } ldv_54767: tmp___5 = list_empty((struct list_head const *)(& ac->tid_q)); if (tmp___5 == 0 && ! ac->sched) { ac->sched = 1; list_add_tail(& ac->list, ac_list); } else { } if ((int )stop) { goto ldv_54760; } else { } if ((unsigned long )ac == (unsigned long )last_ac) { if (! sent) { goto ldv_54760; } else { } sent = 0; __mptr___3 = (struct list_head const *)ac_list->prev; last_ac = (struct ath_atx_ac *)__mptr___3 + 0xfffffffffffffff8UL; } else { } ldv_54773: tmp___6 = list_empty((struct list_head const *)ac_list); if (tmp___6 == 0) { goto ldv_54772; } else { } ldv_54760: rcu_read_unlock(); spin_unlock_bh(& sc->chan_lock); return; } } void ath_txq_schedule_all(struct ath_softc *sc ) { struct ath_txq *txq ; int i ; { i = 0; goto ldv_54780; ldv_54779: txq = sc->tx.txq_map[i]; spin_lock_bh(& txq->axq_lock); ath_txq_schedule(sc, txq); spin_unlock_bh(& txq->axq_lock); i = i + 1; ldv_54780: ; if (i <= 3) { goto ldv_54779; } else { } return; } } static void ath_tx_txqaddbuf(struct ath_softc *sc , struct ath_txq *txq , struct list_head *head , bool internal ) { struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; struct ath_buf *bf ; struct ath_buf *bf_last ; bool puttxbuf ; bool edma ; int tmp___0 ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; int tmp___1 ; bool tmp___2 ; { ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; puttxbuf = 0; tmp___0 = list_empty((struct list_head const *)head); if (tmp___0 != 0) { return; } else { } edma = (ah->caps.hw_caps & 16U) != 0U; __mptr = (struct list_head const *)head->next; bf = (struct ath_buf *)__mptr; __mptr___0 = (struct list_head const *)head->prev; bf_last = (struct ath_buf *)__mptr___0; if ((common->debug_mask & 2) != 0) { ath_printk("\017", (struct ath_common const *)common, "qnum: %d, txq depth: %d\n", txq->axq_qnum, txq->axq_depth); } else { } if ((int )edma) { tmp___1 = list_empty((struct list_head const *)(& txq->txq_fifo) + (unsigned long )txq->txq_headidx); if (tmp___1 != 0) { list_splice_tail_init(head, (struct list_head *)(& txq->txq_fifo) + (unsigned long )txq->txq_headidx); txq->txq_headidx = (u8 )((int )txq->txq_headidx + 1); txq->txq_headidx = (unsigned int )txq->txq_headidx & 7U; puttxbuf = 1; } else { goto _L; } } else { _L: /* CIL Label */ list_splice_tail_init(head, & txq->axq_q); if ((unsigned long )txq->axq_link != (unsigned long )((void *)0)) { ath9k_hw_set_desc_link(ah, txq->axq_link, (u32 )bf->bf_daddr); if ((common->debug_mask & 128) != 0) { ath_printk("\017", (struct ath_common const *)common, "link[%u] (%p)=%llx (%p)\n", txq->axq_qnum, txq->axq_link, bf->bf_daddr, bf->bf_desc); } else { } } else if (! edma) { puttxbuf = 1; } else { } txq->axq_link = bf_last->bf_desc; } if ((int )puttxbuf) { sc->debug.stats.txstats[txq->axq_qnum].puttxbuf = sc->debug.stats.txstats[txq->axq_qnum].puttxbuf + 1U; ath9k_hw_puttxbuf(ah, txq->axq_qnum, (u32 )bf->bf_daddr); if ((common->debug_mask & 128) != 0) { ath_printk("\017", (struct ath_common const *)common, "TXDP[%u] = %llx (%p)\n", txq->axq_qnum, bf->bf_daddr, bf->bf_desc); } else { } } else { } if (! edma || (int )sc->tx99_state) { sc->debug.stats.txstats[txq->axq_qnum].txstart = sc->debug.stats.txstats[txq->axq_qnum].txstart + 1U; ath9k_hw_txstart(ah, txq->axq_qnum); } else { } if (! internal) { goto ldv_54799; ldv_54798: txq->axq_depth = txq->axq_depth + 1U; tmp___2 = bf_is_ampdu_not_probing(bf); if ((int )tmp___2) { txq->axq_ampdu_depth = txq->axq_ampdu_depth + 1U; } else { } bf_last = bf->bf_lastbf; bf = bf_last->bf_next; bf_last->bf_next = (struct ath_buf *)0; ldv_54799: ; if ((unsigned long )bf != (unsigned long )((struct ath_buf *)0)) { goto ldv_54798; } else { } } else { } return; } } static void ath_tx_send_normal(struct ath_softc *sc , struct ath_txq *txq , struct ath_atx_tid *tid , struct sk_buff *skb ) { struct ieee80211_tx_info *tx_info ; struct ieee80211_tx_info *tmp ; struct ath_frame_info *fi ; struct ath_frame_info *tmp___0 ; struct list_head bf_head ; struct ath_buf *bf ; { tmp = IEEE80211_SKB_CB(skb); tx_info = tmp; tmp___0 = get_frame_info(skb); fi = tmp___0; bf = fi->bf; INIT_LIST_HEAD(& bf_head); list_add_tail(& bf->list, & bf_head); bf->bf_state.bf_type = 0U; if ((unsigned long )tid != (unsigned long )((struct ath_atx_tid *)0) && (tx_info->flags & 64U) != 0U) { bf->bf_state.bf_type = 1U; ath_tx_addto_baw(sc, tid, bf); } else { } bf->bf_next = (struct ath_buf *)0; bf->bf_lastbf = bf; ath_tx_fill_desc(sc, bf, txq, (int )fi->framelen); ath_tx_txqaddbuf(sc, txq, & bf_head, 0); sc->debug.stats.txstats[txq->axq_qnum].queued = sc->debug.stats.txstats[txq->axq_qnum].queued + 1U; return; } } static void setup_frame_info(struct ieee80211_hw *hw , struct ieee80211_sta *sta , struct sk_buff *skb , int framelen ) { struct ieee80211_tx_info *tx_info ; struct ieee80211_tx_info *tmp ; struct ieee80211_key_conf *hw_key ; struct ieee80211_hdr *hdr ; struct ieee80211_rate const *rate ; struct ath_frame_info *fi ; struct ath_frame_info *tmp___0 ; struct ath_node *an ; enum ath9k_key_type keytype ; bool short_preamble ; u8 txpower ; struct ieee80211_rate *tmp___1 ; int tmp___2 ; struct ieee80211_vif *vif ; struct ath_softc *sc ; int tmp___3 ; { tmp = IEEE80211_SKB_CB(skb); tx_info = tmp; hw_key = tx_info->__annonCompField99.control.hw_key; hdr = (struct ieee80211_hdr *)skb->data; tmp___0 = get_frame_info(skb); fi = tmp___0; an = (struct ath_node *)0; short_preamble = 0; if ((unsigned long )tx_info->__annonCompField99.control.vif != (unsigned long )((struct ieee80211_vif *)0) && (int )(tx_info->__annonCompField99.control.vif)->bss_conf.use_short_preamble) { short_preamble = 1; } else { } tmp___1 = ieee80211_get_rts_cts_rate((struct ieee80211_hw const *)hw, (struct ieee80211_tx_info const *)tx_info); rate = (struct ieee80211_rate const *)tmp___1; tmp___2 = ath9k_cmn_get_hw_crypto_keytype(skb); keytype = (enum ath9k_key_type )tmp___2; if ((unsigned long )sta != (unsigned long )((struct ieee80211_sta *)0)) { an = (struct ath_node *)(& sta->drv_priv); } else { } if ((unsigned long )tx_info->__annonCompField99.control.vif != (unsigned long )((struct ieee80211_vif *)0)) { vif = tx_info->__annonCompField99.control.vif; txpower = (unsigned int )((u8 )vif->bss_conf.txpower) * 2U; } else { sc = (struct ath_softc *)hw->priv; txpower = (u8 )(sc->cur_chan)->cur_txpower; } memset((void *)fi, 0, 16UL); fi->txq = -1; if ((unsigned long )hw_key != (unsigned long )((struct ieee80211_key_conf *)0)) { fi->keyix = hw_key->hw_key_idx; } else if ((unsigned long )an != (unsigned long )((struct ath_node *)0)) { tmp___3 = ieee80211_is_data((int )hdr->frame_control); if (tmp___3 != 0) { if ((int )an->ps_key > 0) { fi->keyix = (u8 )an->ps_key; } else { fi->keyix = 255U; } } else { fi->keyix = 255U; } } else { fi->keyix = 255U; } fi->keytype = (unsigned char )keytype; fi->framelen = (u16 )framelen; fi->tx_power = txpower; if ((unsigned long )rate == (unsigned long )((struct ieee80211_rate const *)0)) { return; } else { } fi->rtscts_rate = (u8 )rate->hw_value; if ((int )short_preamble) { fi->rtscts_rate = (int )fi->rtscts_rate | (int )((u8 )rate->hw_value_short); } else { } return; } } u8 ath_txchainmask_reduction(struct ath_softc *sc , u8 chainmask , u32 rate ) { struct ath_hw *ah ; struct ath9k_channel *curchan ; bool tmp ; { ah = sc->sc_ah; curchan = ah->curchan; if ((((ah->caps.hw_caps & 8192U) != 0U && (int )curchan->channelFlags & 1) && (unsigned int )chainmask == 7U) && rate <= 143U) { return (3U); } else if (ah->hw_version.macVersion == 640U) { tmp = ath9k_hw_btcoex_is_enabled(ah); if ((int )tmp) { if (rate > 23U && rate <= 30U) { return (2U); } else { return (chainmask); } } else { return (chainmask); } } else { return (chainmask); } } } static struct ath_buf *ath_tx_setup_buffer(struct ath_softc *sc , struct ath_txq *txq , struct ath_atx_tid *tid , struct sk_buff *skb ) { struct ath_common *common ; struct ath_common *tmp ; struct ath_frame_info *fi ; struct ath_frame_info *tmp___0 ; struct ieee80211_hdr *hdr ; struct ath_buf *bf ; int fragno ; u16 seqno ; int tmp___1 ; int tmp___2 ; struct ath_common *tmp___3 ; int tmp___4 ; long tmp___5 ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; tmp___0 = get_frame_info(skb); fi = tmp___0; hdr = (struct ieee80211_hdr *)skb->data; bf = ath_tx_get_buffer(sc); if ((unsigned long )bf == (unsigned long )((struct ath_buf *)0)) { if ((common->debug_mask & 128) != 0) { ath_printk("\017", (struct ath_common const *)common, "TX buffers are full\n"); } else { } return ((struct ath_buf *)0); } else { } bf->bf_lastbf = (struct ath_buf *)0; bf->bf_next = (struct ath_buf *)0; memset((void *)(& bf->bf_state), 0, 16UL); if ((unsigned long )tid != (unsigned long )((struct ath_atx_tid *)0)) { tmp___2 = ieee80211_is_data_present((int )hdr->frame_control); if (tmp___2 != 0) { fragno = (int )hdr->seq_ctrl & 15; seqno = tid->seq_next; hdr->seq_ctrl = (int )tid->seq_next << 4U; if (fragno != 0) { hdr->seq_ctrl = (__le16 )((int )hdr->seq_ctrl | (int )((unsigned short )fragno)); } else { } tmp___1 = ieee80211_has_morefrags((int )hdr->frame_control); if (tmp___1 == 0) { tid->seq_next = (u16 )((int )tid->seq_next + 1); tid->seq_next = (unsigned int )tid->seq_next & 4095U; } else { } bf->bf_state.seqno = seqno; } else { } } else { } bf->bf_mpdu = skb; bf->bf_buf_addr = dma_map_single_attrs(sc->dev, (void *)skb->data, (size_t )skb->len, 1, (struct dma_attrs *)0); tmp___4 = dma_mapping_error(sc->dev, bf->bf_buf_addr); tmp___5 = ldv__builtin_expect(tmp___4 != 0, 0L); if (tmp___5 != 0L) { bf->bf_mpdu = (struct sk_buff *)0; bf->bf_buf_addr = 0ULL; tmp___3 = ath9k_hw_common(sc->sc_ah); ath_printk("\v", (struct ath_common const *)tmp___3, "dma_mapping_error() on TX\n"); ath_tx_return_buffer(sc, bf); return ((struct ath_buf *)0); } else { } fi->bf = bf; return (bf); } } void ath_assign_seq(struct ath_common *common , struct sk_buff *skb ) { struct ieee80211_hdr *hdr ; struct ieee80211_tx_info *info ; struct ieee80211_tx_info *tmp ; struct ieee80211_vif *vif ; struct ath_vif *avp ; { hdr = (struct ieee80211_hdr *)skb->data; tmp = IEEE80211_SKB_CB(skb); info = tmp; vif = info->__annonCompField99.control.vif; if ((info->flags & 2U) == 0U) { return; } else { } if ((unsigned long )vif == (unsigned long )((struct ieee80211_vif *)0)) { return; } else { } avp = (struct ath_vif *)(& vif->drv_priv); if ((info->flags & 16U) != 0U) { avp->seq_no = (unsigned int )avp->seq_no + 16U; } else { } hdr->seq_ctrl = (unsigned int )hdr->seq_ctrl & 15U; hdr->seq_ctrl = (__le16 )((int )hdr->seq_ctrl | (int )avp->seq_no); return; } } static int ath_tx_prepare(struct ieee80211_hw *hw , struct sk_buff *skb , struct ath_tx_control *txctl ) { struct ieee80211_hdr *hdr ; struct ieee80211_tx_info *info ; struct ieee80211_tx_info *tmp ; struct ieee80211_sta *sta ; struct ieee80211_vif *vif ; struct ath_vif *avp ; struct ath_softc *sc ; int frmlen ; int padpos ; int padsize ; int tmp___0 ; struct ath_common *tmp___1 ; int tmp___2 ; unsigned int tmp___3 ; unsigned int tmp___4 ; { hdr = (struct ieee80211_hdr *)skb->data; tmp = IEEE80211_SKB_CB(skb); info = tmp; sta = txctl->sta; vif = info->__annonCompField99.control.vif; sc = (struct ath_softc *)hw->priv; frmlen = (int )(skb->len + 4U); if ((unsigned long )sta != (unsigned long )((struct ieee80211_sta *)0)) { txctl->an = (struct ath_node *)(& sta->drv_priv); } else if ((unsigned long )vif != (unsigned long )((struct ieee80211_vif *)0)) { tmp___0 = ieee80211_is_data((int )hdr->frame_control); if (tmp___0 != 0) { avp = (struct ath_vif *)(& vif->drv_priv); txctl->an = & avp->mcast_node; } else { } } else { } if ((unsigned long )info->__annonCompField99.control.hw_key != (unsigned long )((struct ieee80211_key_conf *)0)) { frmlen = (int )(info->__annonCompField99.control.hw_key)->icv_len + frmlen; } else { } tmp___1 = ath9k_hw_common(sc->sc_ah); ath_assign_seq(tmp___1, skb); if (((unsigned long )vif != (unsigned long )((struct ieee80211_vif *)0) && (unsigned int )vif->type != 3U) && (unsigned int )vif->type != 4U) { info->flags = info->flags | 8U; } else { tmp___2 = ieee80211_is_data((int )hdr->frame_control); if (tmp___2 == 0) { info->flags = info->flags | 8U; } else { } } tmp___3 = ieee80211_hdrlen((int )hdr->frame_control); padpos = (int )tmp___3; padsize = padpos & 3; if (padsize != 0 && skb->len > (unsigned int )padpos) { tmp___4 = skb_headroom((struct sk_buff const *)skb); if (tmp___4 < (unsigned int )padsize) { return (-12); } else { } skb_push(skb, (unsigned int )padsize); __memmove((void *)skb->data, (void const *)skb->data + (unsigned long )padsize, (size_t )padpos); } else { } setup_frame_info(hw, sta, skb, frmlen); return (0); } } int ath_tx_start(struct ieee80211_hw *hw , struct sk_buff *skb , struct ath_tx_control *txctl ) { struct ieee80211_hdr *hdr ; struct ieee80211_tx_info *info ; struct ieee80211_tx_info *tmp ; struct ieee80211_sta *sta ; struct ieee80211_vif *vif ; struct ath_frame_info *fi ; struct ath_frame_info *tmp___0 ; struct ath_vif *avp ; struct ath_softc *sc ; struct ath_txq *txq ; struct ath_atx_tid *tid ; struct ath_buf *bf ; bool queue ; bool skip_uapsd ; bool ps_resp ; int q ; int ret ; u16 tmp___1 ; bool tmp___2 ; int tmp___3 ; int __ret_warn_on ; long tmp___4 ; { tmp = IEEE80211_SKB_CB(skb); info = tmp; sta = txctl->sta; vif = info->__annonCompField99.control.vif; tmp___0 = get_frame_info(skb); fi = tmp___0; avp = (struct ath_vif *)0; sc = (struct ath_softc *)hw->priv; txq = txctl->txq; tid = (struct ath_atx_tid *)0; skip_uapsd = 0; if ((unsigned long )vif != (unsigned long )((struct ieee80211_vif *)0)) { avp = (struct ath_vif *)(& vif->drv_priv); } else { } if ((info->flags & 33554432U) != 0U) { txctl->force_channel = 1; } else { } ps_resp = (info->__annonCompField99.control.flags & 2U) != 0U; ret = ath_tx_prepare(hw, skb, txctl); if (ret != 0) { return (ret); } else { } hdr = (struct ieee80211_hdr *)skb->data; tmp___1 = skb_get_queue_mapping((struct sk_buff const *)skb); q = (int )tmp___1; ath_txq_lock(sc, txq); if ((unsigned long )sc->tx.txq_map[q] == (unsigned long )txq) { fi->txq = (s8 )q; txq->pending_frames = txq->pending_frames + 1; if ((u32 )txq->pending_frames > sc->tx.txq_max_pending[q] && ! txq->stopped) { tmp___2 = ath9k_is_chanctx_enabled(); if ((int )tmp___2) { ieee80211_stop_queue(sc->hw, (int )info->hw_queue); } else { ieee80211_stop_queue(sc->hw, q); } txq->stopped = 1; } else { } } else { } tmp___3 = ieee80211_is_data_present((int )hdr->frame_control); queue = tmp___3 != 0; if ((((unsigned long )avp != (unsigned long )((struct ath_vif *)0) && (unsigned long )avp->chanctx != (unsigned long )sc->cur_chan) || (int )(sc->cur_chan)->stopped) && ! txctl->force_channel) { if ((unsigned long )txctl->an == (unsigned long )((struct ath_node *)0)) { txctl->an = & avp->mcast_node; } else { } queue = 1; skip_uapsd = 1; } else { } if ((unsigned long )txctl->an != (unsigned long )((struct ath_node *)0) && (int )queue) { tid = ath_get_skb_tid(sc, txctl->an, skb); } else { } if (! skip_uapsd && (int )ps_resp) { ath_txq_unlock(sc, txq); txq = sc->tx.uapsdq; ath_txq_lock(sc, txq); } else if ((unsigned long )txctl->an != (unsigned long )((struct ath_node *)0) && (int )queue) { __ret_warn_on = (unsigned long )(tid->ac)->txq != (unsigned long )txctl->txq; tmp___4 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___4 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/12119/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/ath/ath9k/xmit.c", 2376); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); if ((info->flags & 8U) != 0U) { (tid->ac)->clear_ps_filter = 1; } else { } sc->debug.stats.txstats[txq->axq_qnum].a_queued_sw = sc->debug.stats.txstats[txq->axq_qnum].a_queued_sw + 1U; __skb_queue_tail(& tid->buf_q, skb); if (! (txctl->an)->sleeping) { ath_tx_queue_tid(sc, txq, tid); } else { } ath_txq_schedule(sc, txq); goto out; } else { } bf = ath_tx_setup_buffer(sc, txq, tid, skb); if ((unsigned long )bf == (unsigned long )((struct ath_buf *)0)) { ath_txq_skb_done(sc, txq, skb); if ((unsigned int )txctl->paprd != 0U) { dev_kfree_skb_any(skb); } else { ieee80211_free_txskb(sc->hw, skb); } goto out; } else { } bf->bf_state.bfs_paprd = txctl->paprd; if ((unsigned int )txctl->paprd != 0U) { bf->bf_state.bfs_paprd_timestamp = jiffies; } else { } ath_set_rates(vif, sta, bf); ath_tx_send_normal(sc, txq, tid, skb); out: ath_txq_unlock(sc, txq); return (0); } } void ath_tx_cabq(struct ieee80211_hw *hw , struct ieee80211_vif *vif , struct sk_buff *skb ) { struct ath_softc *sc ; struct ath_tx_control txctl ; struct ath_tx_info info ; struct ieee80211_hdr *hdr ; struct ath_buf *bf_tail ; struct ath_buf *bf ; struct list_head bf_q ; int duration ; int max_duration ; struct ath_frame_info *fi ; struct ath_frame_info *tmp ; int tmp___0 ; int tmp___1 ; struct list_head const *__mptr ; { sc = (struct ath_softc *)hw->priv; txctl.txq = sc->beacon.cabq; txctl.an = 0; txctl.sta = 0; txctl.paprd = (unsigned char)0; txctl.force_channel = (_Bool)0; info.qcu = (unsigned char)0; info.is_first = (_Bool)0; info.is_last = (_Bool)0; info.aggr = 0; info.ndelim = (unsigned char)0; info.aggr_len = (unsigned short)0; info.link = 0ULL; info.pkt_len = 0; info.flags = 0U; info.buf_addr[0] = 0ULL; info.buf_addr[1] = 0ULL; info.buf_addr[2] = 0ULL; info.buf_addr[3] = 0ULL; info.buf_len[0] = 0; info.buf_len[1] = 0; info.buf_len[2] = 0; info.buf_len[3] = 0; info.rates[0].Tries = 0U; info.rates[0].Rate = 0U; info.rates[0].PktDuration = 0U; info.rates[0].ChSel = 0U; info.rates[0].RateFlags = 0U; info.rates[1].Tries = 0U; info.rates[1].Rate = 0U; info.rates[1].PktDuration = 0U; info.rates[1].ChSel = 0U; info.rates[1].RateFlags = 0U; info.rates[2].Tries = 0U; info.rates[2].Rate = 0U; info.rates[2].PktDuration = 0U; info.rates[2].ChSel = 0U; info.rates[2].RateFlags = 0U; info.rates[3].Tries = 0U; info.rates[3].Rate = 0U; info.rates[3].PktDuration = 0U; info.rates[3].ChSel = 0U; info.rates[3].RateFlags = 0U; info.rtscts_rate = (unsigned char)0; info.dur_update = (_Bool)0; info.type = 0; info.keytype = 0; info.keyix = (unsigned char)0; info.txpower[0] = (unsigned char)0; info.txpower[1] = (unsigned char)0; info.txpower[2] = (unsigned char)0; info.txpower[3] = (unsigned char)0; bf_tail = (struct ath_buf *)0; bf_q.next = & bf_q; bf_q.prev = & bf_q; duration = 0; max_duration = (((sc->cur_chan)->beacon.beacon_interval * 1000) * (int )(sc->cur_chan)->beacon.dtim_period) / 8; ldv_54908: tmp = get_frame_info(skb); fi = tmp; tmp___0 = ath_tx_prepare(hw, skb, & txctl); if (tmp___0 != 0) { goto ldv_54907; } else { } bf = ath_tx_setup_buffer(sc, txctl.txq, (struct ath_atx_tid *)0, skb); if ((unsigned long )bf == (unsigned long )((struct ath_buf *)0)) { goto ldv_54907; } else { } bf->bf_lastbf = bf; ath_set_rates(vif, (struct ieee80211_sta *)0, bf); ath_buf_set_rate(sc, bf, & info, (int )fi->framelen, 0); duration = (int )(info.rates[0].PktDuration + (u32 )duration); if ((unsigned long )bf_tail != (unsigned long )((struct ath_buf *)0)) { bf_tail->bf_next = bf; } else { } list_add_tail(& bf->list, & bf_q); bf_tail = bf; skb = (struct sk_buff *)0; if (duration > max_duration) { goto ldv_54907; } else { } skb = ieee80211_get_buffered_bc(hw, vif); if ((unsigned long )skb != (unsigned long )((struct sk_buff *)0)) { goto ldv_54908; } else { } ldv_54907: ; if ((unsigned long )skb != (unsigned long )((struct sk_buff *)0)) { ieee80211_free_txskb(hw, skb); } else { } tmp___1 = list_empty((struct list_head const *)(& bf_q)); if (tmp___1 != 0) { return; } else { } __mptr = (struct list_head const *)bf_q.next; bf = (struct ath_buf *)__mptr; hdr = (struct ieee80211_hdr *)(bf->bf_mpdu)->data; if (((int )hdr->frame_control & 8192) != 0) { hdr->frame_control = (unsigned int )hdr->frame_control & 57343U; dma_sync_single_for_device(sc->dev, bf->bf_buf_addr, 30UL, 1); } else { } ath_txq_lock(sc, txctl.txq); ath_tx_fill_desc(sc, bf, txctl.txq, 0); ath_tx_txqaddbuf(sc, txctl.txq, & bf_q, 0); sc->debug.stats.txstats[(txctl.txq)->axq_qnum].queued = sc->debug.stats.txstats[(txctl.txq)->axq_qnum].queued + 1U; ath_txq_unlock(sc, txctl.txq); return; } } static void ath_tx_complete(struct ath_softc *sc , struct sk_buff *skb , int tx_flags , struct ath_txq *txq ) { struct ieee80211_tx_info *tx_info ; struct ieee80211_tx_info *tmp ; struct ath_common *common ; struct ath_common *tmp___0 ; struct ieee80211_hdr *hdr ; int padpos ; int padsize ; unsigned long flags ; unsigned int tmp___1 ; raw_spinlock_t *tmp___2 ; { tmp = IEEE80211_SKB_CB(skb); tx_info = tmp; tmp___0 = ath9k_hw_common(sc->sc_ah); common = tmp___0; hdr = (struct ieee80211_hdr *)skb->data; if ((common->debug_mask & 128) != 0) { ath_printk("\017", (struct ath_common const *)common, "TX complete: skb: %p\n", skb); } else { } if ((unsigned long )(sc->sc_ah)->caldata != (unsigned long )((struct ath9k_hw_cal_data *)0)) { set_bit(1L, (unsigned long volatile *)(& ((sc->sc_ah)->caldata)->cal_flags)); } else { } if ((tx_flags & 1) == 0) { if ((tx_info->flags & 4U) != 0U) { tx_info->flags = tx_info->flags | 2147483648U; } else { tx_info->flags = tx_info->flags | 512U; } } else { } tmp___1 = ieee80211_hdrlen((int )hdr->frame_control); padpos = (int )tmp___1; padsize = padpos & 3; if (padsize != 0 && skb->len > (unsigned int )(padpos + padsize)) { __memmove((void *)skb->data + (unsigned long )padsize, (void const *)skb->data, (size_t )padpos); skb_pull(skb, (unsigned int )padsize); } else { } tmp___2 = spinlock_check(& sc->sc_pm_lock); flags = _raw_spin_lock_irqsave(tmp___2); if (((unsigned long )sc->ps_flags & 8UL) != 0UL && txq->axq_depth == 0U) { sc->ps_flags = (unsigned int )sc->ps_flags & 65527U; if ((common->debug_mask & 2048) != 0) { ath_printk("\017", (struct ath_common const *)common, "Going back to sleep after having received TX status (0x%lx)\n", (unsigned long )sc->ps_flags & 15UL); } else { } } else { } spin_unlock_irqrestore(& sc->sc_pm_lock, flags); __skb_queue_tail(& txq->complete_q, skb); ath_txq_skb_done(sc, txq, skb); return; } } static void ath_tx_complete_buf(struct ath_softc *sc , struct ath_buf *bf , struct ath_txq *txq , struct list_head *bf_q , struct ath_tx_status *ts , int txok ) { struct sk_buff *skb ; struct ieee80211_tx_info *tx_info ; struct ieee80211_tx_info *tmp ; unsigned long flags ; int tx_flags ; unsigned long tmp___0 ; raw_spinlock_t *tmp___1 ; { skb = bf->bf_mpdu; tmp = IEEE80211_SKB_CB(skb); tx_info = tmp; tx_flags = 0; if (txok == 0) { tx_flags = tx_flags | 1; } else { } if (((int )ts->ts_status & 2) != 0) { tx_info->flags = tx_info->flags | 256U; } else { } dma_unmap_single_attrs(sc->dev, bf->bf_buf_addr, (size_t )skb->len, 1, (struct dma_attrs *)0); bf->bf_buf_addr = 0ULL; if ((int )sc->tx99_state) { goto skip_tx_complete; } else { } if ((unsigned int )bf->bf_state.bfs_paprd != 0U) { tmp___0 = msecs_to_jiffies(100U); if ((long )((bf->bf_state.bfs_paprd_timestamp + tmp___0) - (unsigned long )jiffies) < 0L) { dev_kfree_skb_any(skb); } else { complete(& sc->paprd_complete); } } else { ath_debug_stat_tx(sc, bf, ts, txq, (unsigned int )tx_flags); ath_tx_complete(sc, skb, tx_flags, txq); } skip_tx_complete: bf->bf_mpdu = (struct sk_buff *)0; tmp___1 = spinlock_check(& sc->tx.txbuflock); flags = _raw_spin_lock_irqsave(tmp___1); list_splice_tail_init(bf_q, & sc->tx.txbuf); spin_unlock_irqrestore(& sc->tx.txbuflock, flags); return; } } static void ath_tx_rc_status(struct ath_softc *sc , struct ath_buf *bf , struct ath_tx_status *ts , int nframes , int nbad , int txok ) { struct sk_buff *skb ; struct ieee80211_hdr *hdr ; struct ieee80211_tx_info *tx_info ; struct ieee80211_tx_info *tmp ; struct ieee80211_hw *hw ; struct ath_hw *ah ; u8 i ; u8 tx_rateindex ; int __ret_warn_on ; long tmp___0 ; long tmp___1 ; long tmp___2 ; int tmp___3 ; { skb = bf->bf_mpdu; hdr = (struct ieee80211_hdr *)skb->data; tmp = IEEE80211_SKB_CB(skb); tx_info = tmp; hw = sc->hw; ah = sc->sc_ah; if (txok != 0) { tx_info->__annonCompField99.status.ack_signal = (s32 )ts->ts_rssi; } else { } tx_rateindex = ts->ts_rateindex; __ret_warn_on = (int )hw->max_rates <= (int )tx_rateindex; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/12119/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/ath/ath9k/xmit.c", 2598); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); if ((tx_info->flags & 64U) != 0U) { tx_info->flags = tx_info->flags | 1024U; tmp___1 = ldv__builtin_expect(nbad > nframes, 0L); if (tmp___1 != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/12119/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/ath/ath9k/xmit.c"), "i" (2603), "i" (12UL)); ldv_54965: ; goto ldv_54965; } else { } } else { } tx_info->__annonCompField99.status.ampdu_len = (u8 )nframes; tx_info->__annonCompField99.status.ampdu_ack_len = (int )((u8 )nframes) - (int )((u8 )nbad); if (((int )ts->ts_status & 2) == 0 && (tx_info->flags & 4U) == 0U) { tmp___2 = ldv__builtin_expect(((int )ts->ts_flags & 24) != 0, 0L); if (tmp___2 != 0L) { tmp___3 = ieee80211_is_data((int )hdr->frame_control); if (tmp___3 != 0) { if ((int )ah->tx_trig_level >= (int )((unsigned short )(sc->sc_ah)->config.max_txtrig_level)) { tx_info->__annonCompField99.status.rates[(int )tx_rateindex].count = hw->max_rate_tries; } else { } } else { } } else { } } else { } i = (unsigned int )tx_rateindex + 1U; goto ldv_54967; ldv_54966: tx_info->__annonCompField99.status.rates[(int )i].count = 0U; tx_info->__annonCompField99.status.rates[(int )i].idx = -1; i = (u8 )((int )i + 1); ldv_54967: ; if ((int )hw->max_rates > (int )i) { goto ldv_54966; } else { } tx_info->__annonCompField99.status.rates[(int )tx_rateindex].count = (unsigned char )((unsigned int )ts->ts_longretry + 1U); return; } } static void ath_tx_processq(struct ath_softc *sc , struct ath_txq *txq ) { struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; struct ath_buf *bf ; struct ath_buf *lastbf ; struct ath_buf *bf_held ; struct list_head bf_head ; struct ath_desc *ds ; struct ath_tx_status ts ; int status ; u32 tmp___0 ; int tmp___1 ; int tmp___2 ; struct list_head const *__mptr ; int tmp___3 ; struct list_head const *__mptr___0 ; int tmp___4 ; { ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; bf_held = (struct ath_buf *)0; if ((common->debug_mask & 2) != 0) { tmp___0 = ath9k_hw_gettxbuf(sc->sc_ah, txq->axq_qnum); ath_printk("\017", (struct ath_common const *)common, "tx queue %d (%x), link %p\n", txq->axq_qnum, tmp___0, txq->axq_link); } else { } ath_txq_lock(sc, txq); ldv_54987: tmp___1 = constant_test_bit(4L, (unsigned long const volatile *)(& common->op_flags)); if (tmp___1 != 0) { goto ldv_54982; } else { } tmp___2 = list_empty((struct list_head const *)(& txq->axq_q)); if (tmp___2 != 0) { txq->axq_link = (void *)0; ath_txq_schedule(sc, txq); goto ldv_54982; } else { } __mptr = (struct list_head const *)txq->axq_q.next; bf = (struct ath_buf *)__mptr; bf_held = (struct ath_buf *)0; if ((int )bf->bf_state.stale) { bf_held = bf; tmp___3 = list_is_last((struct list_head const *)(& bf_held->list), (struct list_head const *)(& txq->axq_q)); if (tmp___3 != 0) { goto ldv_54982; } else { } __mptr___0 = (struct list_head const *)bf_held->list.next; bf = (struct ath_buf *)__mptr___0; } else { } lastbf = bf->bf_lastbf; ds = (struct ath_desc *)lastbf->bf_desc; memset((void *)(& ts), 0, 48UL); status = ath9k_hw_txprocdesc(ah, (void *)ds, & ts); if (status == -115) { goto ldv_54982; } else { } sc->debug.stats.txstats[txq->axq_qnum].txprocdesc = sc->debug.stats.txstats[txq->axq_qnum].txprocdesc + 1U; lastbf->bf_state.stale = 1; INIT_LIST_HEAD(& bf_head); tmp___4 = list_is_singular((struct list_head const *)(& lastbf->list)); if (tmp___4 == 0) { list_cut_position(& bf_head, & txq->axq_q, lastbf->list.prev); } else { } if ((unsigned long )bf_held != (unsigned long )((struct ath_buf *)0)) { list_del(& bf_held->list); ath_tx_return_buffer(sc, bf_held); } else { } ath_tx_process_buffer(sc, txq, & ts, bf, & bf_head); goto ldv_54987; ldv_54982: ath_txq_unlock_complete(sc, txq); return; } } void ath_tx_tasklet(struct ath_softc *sc ) { struct ath_hw *ah ; u32 qcumask ; int i ; { ah = sc->sc_ah; qcumask = ah->intr_txqs & 1023U; i = 0; goto ldv_54995; ldv_54994: ; if ((sc->tx.txqsetup & (u32 )(1 << i)) != 0U && ((u32 )(1 << i) & qcumask) != 0U) { ath_tx_processq(sc, (struct ath_txq *)(& sc->tx.txq) + (unsigned long )i); } else { } i = i + 1; ldv_54995: ; if (i <= 9) { goto ldv_54994; } else { } return; } } void ath_tx_edma_tasklet(struct ath_softc *sc ) { struct ath_tx_status ts ; struct ath_common *common ; struct ath_common *tmp ; struct ath_hw *ah ; struct ath_txq *txq ; struct ath_buf *bf ; struct ath_buf *lastbf ; struct list_head bf_head ; struct list_head *fifo_list ; int status ; int tmp___0 ; bool tmp___1 ; int tmp___2 ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct list_head bf_q ; int tmp___3 ; int tmp___4 ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; ah = sc->sc_ah; ldv_55016: tmp___0 = constant_test_bit(4L, (unsigned long const volatile *)(& common->op_flags)); if (tmp___0 != 0) { goto ldv_55009; } else { } status = ath9k_hw_txprocdesc(ah, (void *)0, & ts); if (status == -115) { goto ldv_55009; } else { } if (status == -5) { if ((common->debug_mask & 128) != 0) { ath_printk("\017", (struct ath_common const *)common, "Error processing tx status\n"); } else { } goto ldv_55009; } else { } if ((u32 )ts.qid == sc->beacon.beaconq) { sc->beacon.tx_processed = 1; sc->beacon.tx_last = ((int )ts.ts_status & 95) == 0; tmp___1 = ath9k_is_chanctx_enabled(); if ((int )tmp___1) { ath_chanctx_event(sc, (struct ieee80211_vif *)0, 1); } else { } ath9k_csa_update(sc); goto ldv_55010; } else { } txq = (struct ath_txq *)(& sc->tx.txq) + (unsigned long )ts.qid; ath_txq_lock(sc, txq); sc->debug.stats.txstats[txq->axq_qnum].txprocdesc = sc->debug.stats.txstats[txq->axq_qnum].txprocdesc + 1U; fifo_list = (struct list_head *)(& txq->txq_fifo) + (unsigned long )txq->txq_tailidx; tmp___2 = list_empty((struct list_head const *)fifo_list); if (tmp___2 != 0) { ath_txq_unlock(sc, txq); return; } else { } __mptr = (struct list_head const *)fifo_list->next; bf = (struct ath_buf *)__mptr; if ((int )bf->bf_state.stale) { list_del(& bf->list); ath_tx_return_buffer(sc, bf); __mptr___0 = (struct list_head const *)fifo_list->next; bf = (struct ath_buf *)__mptr___0; } else { } lastbf = bf->bf_lastbf; INIT_LIST_HEAD(& bf_head); tmp___4 = list_is_last((struct list_head const *)(& lastbf->list), (struct list_head const *)fifo_list); if (tmp___4 != 0) { list_splice_tail_init(fifo_list, & bf_head); txq->txq_tailidx = (u8 )((int )txq->txq_tailidx + 1); txq->txq_tailidx = (unsigned int )txq->txq_tailidx & 7U; tmp___3 = list_empty((struct list_head const *)(& txq->axq_q)); if (tmp___3 == 0) { INIT_LIST_HEAD(& bf_q); txq->axq_link = (void *)0; list_splice_tail_init(& txq->axq_q, & bf_q); ath_tx_txqaddbuf(sc, txq, & bf_q, 1); } else { } } else { lastbf->bf_state.stale = 1; if ((unsigned long )bf != (unsigned long )lastbf) { list_cut_position(& bf_head, fifo_list, lastbf->list.prev); } else { } } ath_tx_process_buffer(sc, txq, & ts, bf, & bf_head); ath_txq_unlock_complete(sc, txq); ldv_55010: ; goto ldv_55016; ldv_55009: ; return; } } static int ath_txstatus_setup(struct ath_softc *sc , int size ) { struct ath_descdma *dd ; u8 txs_len ; { dd = & sc->txsdma; txs_len = (sc->sc_ah)->caps.txs_len; dd->dd_desc_len = (u32 )((int )txs_len * size); dd->dd_desc = dmam_alloc_coherent(sc->dev, (size_t )dd->dd_desc_len, & dd->dd_desc_paddr, 208U); if ((unsigned long )dd->dd_desc == (unsigned long )((void *)0)) { return (-12); } else { } return (0); } } static int ath_tx_edma_init(struct ath_softc *sc ) { int err ; { err = ath_txstatus_setup(sc, 512); if (err == 0) { ath9k_hw_setup_statusring(sc->sc_ah, sc->txsdma.dd_desc, (u32 )sc->txsdma.dd_desc_paddr, 512); } else { } return (err); } } int ath_tx_init(struct ath_softc *sc , int nbufs ) { struct ath_common *common ; struct ath_common *tmp ; int error ; struct lock_class_key __key ; struct lock_class_key __key___0 ; atomic_long_t __constr_expr_0 ; struct lock_class_key __key___1 ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; error = 0; spinlock_check(& sc->tx.txbuflock); __raw_spin_lock_init(& sc->tx.txbuflock.__annonCompField18.rlock, "&(&sc->tx.txbuflock)->rlock", & __key); error = ath_descdma_setup(sc, & sc->tx.txdma, & sc->tx.txbuf, "tx", nbufs, 1, 1); if (error != 0) { ath_printk("\v", (struct ath_common const *)common, "Failed to allocate tx descriptors: %d\n", error); return (error); } else { } error = ath_descdma_setup(sc, & sc->beacon.bdma, & sc->beacon.bbuf, "beacon", 8, 1, 1); if (error != 0) { ath_printk("\v", (struct ath_common const *)common, "Failed to allocate beacon descriptors: %d\n", error); return (error); } else { } __init_work(& sc->tx_complete_work.work, 0); __constr_expr_0.counter = 137438953408L; sc->tx_complete_work.work.data = __constr_expr_0; lockdep_init_map(& sc->tx_complete_work.work.lockdep_map, "(&(&sc->tx_complete_work)->work)", & __key___0, 0); INIT_LIST_HEAD(& sc->tx_complete_work.work.entry); sc->tx_complete_work.work.func = & ath_tx_complete_poll_work; init_timer_key(& sc->tx_complete_work.timer, 2097152U, "(&(&sc->tx_complete_work)->timer)", & __key___1); sc->tx_complete_work.timer.function = & delayed_work_timer_fn; sc->tx_complete_work.timer.data = (unsigned long )(& sc->tx_complete_work); if (((sc->sc_ah)->caps.hw_caps & 16U) != 0U) { error = ath_tx_edma_init(sc); } else { } return (error); } } void ath_tx_node_init(struct ath_softc *sc , struct ath_node *an ) { struct ath_atx_tid *tid ; struct ath_atx_ac *ac ; int tidno ; int acno ; u16 tmp ; int tmp___0 ; { tidno = 0; tid = (struct ath_atx_tid *)(& an->tid) + (unsigned long )tidno; goto ldv_55046; ldv_55045: tid->an = an; tid->tidno = (u8 )tidno; tmp = 0U; tid->seq_next = tmp; tid->seq_start = tmp; tid->baw_size = 64U; tmp___0 = 0; tid->baw_tail = tmp___0; tid->baw_head = tmp___0; tid->sched = 0; tid->active = 0; __skb_queue_head_init(& tid->buf_q); __skb_queue_head_init(& tid->retry_q); acno = tidno != 0 && tidno != 3 ? (tidno != 1 && tidno != 2 ? tidno == 4 || tidno == 5 : 3) : 2; tid->ac = (struct ath_atx_ac *)(& an->ac) + (unsigned long )acno; tidno = tidno + 1; tid = tid + 1; ldv_55046: ; if (tidno <= 15) { goto ldv_55045; } else { } acno = 0; ac = (struct ath_atx_ac *)(& an->ac) + (unsigned long )acno; goto ldv_55049; ldv_55048: ac->sched = 0; ac->clear_ps_filter = 1; ac->txq = sc->tx.txq_map[acno]; INIT_LIST_HEAD(& ac->tid_q); acno = acno + 1; ac = ac + 1; ldv_55049: ; if (acno <= 3) { goto ldv_55048; } else { } return; } } void ath_tx_node_cleanup(struct ath_softc *sc , struct ath_node *an ) { struct ath_atx_ac *ac ; struct ath_atx_tid *tid ; struct ath_txq *txq ; int tidno ; { tidno = 0; tid = (struct ath_atx_tid *)(& an->tid) + (unsigned long )tidno; goto ldv_55060; ldv_55059: ac = tid->ac; txq = ac->txq; ath_txq_lock(sc, txq); if ((int )tid->sched) { list_del(& tid->list); tid->sched = 0; } else { } if ((int )ac->sched) { list_del(& ac->list); (tid->ac)->sched = 0; } else { } ath_tid_drain(sc, txq, tid); tid->active = 0; ath_txq_unlock(sc, txq); tidno = tidno + 1; tid = tid + 1; ldv_55060: ; if (tidno <= 15) { goto ldv_55059; } else { } return; } } int ath9k_tx99_send(struct ath_softc *sc , struct sk_buff *skb , struct ath_tx_control *txctl ) { struct ieee80211_hdr *hdr ; struct ath_frame_info *fi ; struct ath_frame_info *tmp ; struct ath_common *common ; struct ath_common *tmp___0 ; struct ath_buf *bf ; int padpos ; int padsize ; unsigned int tmp___1 ; unsigned int tmp___2 ; { hdr = (struct ieee80211_hdr *)skb->data; tmp = get_frame_info(skb); fi = tmp; tmp___0 = ath9k_hw_common(sc->sc_ah); common = tmp___0; tmp___1 = ieee80211_hdrlen((int )hdr->frame_control); padpos = (int )tmp___1; padsize = padpos & 3; if (padsize != 0 && skb->len > (unsigned int )padpos) { tmp___2 = skb_headroom((struct sk_buff const *)skb); if (tmp___2 < (unsigned int )padsize) { if ((common->debug_mask & 128) != 0) { ath_printk("\017", (struct ath_common const *)common, "tx99 padding failed\n"); } else { } return (-22); } else { } skb_push(skb, (unsigned int )padsize); __memmove((void *)skb->data, (void const *)skb->data + (unsigned long )padsize, (size_t )padpos); } else { } fi->keyix = 255U; fi->framelen = (unsigned int )((u16 )skb->len) + 4U; fi->keytype = 0U; bf = ath_tx_setup_buffer(sc, txctl->txq, (struct ath_atx_tid *)0, skb); if ((unsigned long )bf == (unsigned long )((struct ath_buf *)0)) { if ((common->debug_mask & 128) != 0) { ath_printk("\017", (struct ath_common const *)common, "tx99 buffer setup failed\n"); } else { } return (-22); } else { } ath_set_rates(sc->tx99_vif, (struct ieee80211_sta *)0, bf); ath9k_hw_set_desc_link(sc->sc_ah, bf->bf_desc, (u32 )bf->bf_daddr); ath9k_hw_tx99_start(sc->sc_ah, (txctl->txq)->axq_qnum); ath_tx_send_normal(sc, txctl->txq, (struct ath_atx_tid *)0, skb); return (0); } } 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 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; ath_tx_complete_poll_work(ldv_work_struct_6_0); ldv_work_6_0 = 1; } else { } goto ldv_55083; case 1: ; if (ldv_work_6_1 == 2 || ldv_work_6_1 == 3) { ldv_work_6_1 = 4; ath_tx_complete_poll_work(ldv_work_struct_6_0); ldv_work_6_1 = 1; } else { } goto ldv_55083; case 2: ; if (ldv_work_6_2 == 2 || ldv_work_6_2 == 3) { ldv_work_6_2 = 4; ath_tx_complete_poll_work(ldv_work_struct_6_0); ldv_work_6_2 = 1; } else { } goto ldv_55083; case 3: ; if (ldv_work_6_3 == 2 || ldv_work_6_3 == 3) { ldv_work_6_3 = 4; ath_tx_complete_poll_work(ldv_work_struct_6_0); ldv_work_6_3 = 1; } else { } goto ldv_55083; default: ldv_stop(); } ldv_55083: ; 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_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 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 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) { ath_tx_complete_poll_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) { ath_tx_complete_poll_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) { ath_tx_complete_poll_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) { ath_tx_complete_poll_work(work); ldv_work_6_3 = 1; return; } else { } return; } } bool ldv_queue_work_on_115(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_116(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_117(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_118(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_7(2); return; } } bool ldv_queue_delayed_work_on_119(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } int ldv_mod_timer_134(struct timer_list *ldv_func_arg1 , unsigned long ldv_func_arg2 ) ; int ldv_mod_timer_135(struct timer_list *ldv_func_arg1 , unsigned long ldv_func_arg2 ) ; int ldv_del_timer_sync_136(struct timer_list *ldv_func_arg1 ) ; bool ldv_queue_work_on_129(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_131(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_130(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; bool ldv_queue_delayed_work_on_133(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; void ldv_flush_workqueue_132(struct workqueue_struct *ldv_func_arg1 ) ; extern void kfree_skb(struct sk_buff * ) ; 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 bool ath9k_hw_reset_calvalid(struct ath_hw * ) ; extern s16 ath9k_hw_getchan_noise(struct ath_hw * , struct ath9k_channel * , s16 ) ; extern u32 ar9003_get_pll_sqsum_dvc(struct ath_hw * ) ; extern void ar9003_paprd_enable(struct ath_hw * , bool ) ; extern void ar9003_paprd_populate_single_table(struct ath_hw * , struct ath9k_hw_cal_data * , int ) ; extern int ar9003_paprd_create_curve(struct ath_hw * , struct ath9k_hw_cal_data * , int ) ; extern void ar9003_paprd_setup_gain_table(struct ath_hw * , int ) ; extern int ar9003_paprd_init_table(struct ath_hw * ) ; extern bool ar9003_paprd_is_done(struct ath_hw * ) ; extern bool ar9003_is_paprd_enabled(struct ath_hw * ) ; extern void ath9k_hw_ani_monitor(struct ath_hw * , struct ath9k_channel * ) ; __inline static int ath9k_hw_calibrate(struct ath_hw *ah , struct ath9k_channel *chan , u8 rxchainmask , bool longcal ) { struct ath_hw_ops *tmp ; int tmp___0 ; { tmp = ath9k_hw_ops(ah); tmp___0 = (*(tmp->calibrate))(ah, chan, (int )rxchainmask, (int )longcal); return (tmp___0); } } void ath_update_survey_nf(struct ath_softc *sc , int channel ) ; void ath_tx_complete_poll_work(struct work_struct *work ) { struct ath_softc *sc ; struct work_struct const *__mptr ; struct ath_txq *txq ; int i ; bool needreset ; struct ath_common *tmp ; struct ath_common *tmp___0 ; struct ath_common *tmp___1 ; struct ath_common *tmp___2 ; unsigned long tmp___3 ; { __mptr = (struct work_struct const *)work; sc = (struct ath_softc *)__mptr + 0xffffffffffffc830UL; needreset = 0; if ((int )sc->tx99_state) { tmp___0 = ath9k_hw_common(sc->sc_ah); if (tmp___0->debug_mask & 1) { tmp = ath9k_hw_common(sc->sc_ah); ath_printk("\017", (struct ath_common const *)tmp, "skip tx hung detection on tx99\n"); } else { } return; } else { } i = 0; goto ldv_54022; ldv_54021: txq = sc->tx.txq_map[i]; ath_txq_lock(sc, txq); if (txq->axq_depth != 0U) { if ((int )txq->axq_tx_inprogress) { needreset = 1; ath_txq_unlock(sc, txq); goto ldv_54020; } else { txq->axq_tx_inprogress = 1; } } else { } ath_txq_unlock(sc, txq); i = i + 1; ldv_54022: ; if (i <= 3) { goto ldv_54021; } else { } ldv_54020: ; if ((int )needreset) { tmp___2 = ath9k_hw_common(sc->sc_ah); if (tmp___2->debug_mask & 1) { tmp___1 = ath9k_hw_common(sc->sc_ah); ath_printk("\017", (struct ath_common const *)tmp___1, "tx hung, resetting the chip\n"); } else { } ath9k_queue_reset(sc, 5); return; } else { } tmp___3 = msecs_to_jiffies(1000U); ieee80211_queue_delayed_work(sc->hw, & sc->tx_complete_work, tmp___3); return; } } bool ath_hw_check(struct ath_softc *sc ) { struct ath_common *common ; struct ath_common *tmp ; enum ath_reset_type type ; bool is_alive ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; ath9k_ps_wakeup(sc); is_alive = ath9k_hw_check_alive(sc->sc_ah); if (! is_alive) { if (common->debug_mask & 1) { ath_printk("\017", (struct ath_common const *)common, "HW hang detected, schedule chip reset\n"); } else { } type = 7; ath9k_queue_reset(sc, type); } else { } ath9k_ps_restore(sc); return (is_alive); } } static bool ath_hw_pll_rx_hang_check(struct ath_softc *sc , u32 pll_sqsum ) { int count ; struct ath_common *common ; struct ath_common *tmp ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; if (pll_sqsum > 262143U) { count = count + 1; if (count == 3) { if (common->debug_mask & 1) { ath_printk("\017", (struct ath_common const *)common, "PLL WAR, resetting the chip\n"); } else { } ath9k_queue_reset(sc, 6); count = 0; return (1); } else { } } else { count = 0; } return (0); } } void ath_hw_pll_work(struct work_struct *work ) { u32 pll_sqsum ; struct ath_softc *sc ; struct work_struct const *__mptr ; struct ath_common *common ; struct ath_common *tmp ; int tmp___0 ; bool tmp___1 ; unsigned long tmp___2 ; { __mptr = (struct work_struct const *)work; sc = (struct ath_softc *)__mptr + 0xffffffffffffc750UL; tmp = ath9k_hw_common(sc->sc_ah); common = tmp; tmp___0 = constant_test_bit(1L, (unsigned long const volatile *)(& common->op_flags)); if (tmp___0 == 0) { return; } else { } if ((int )sc->tx99_state) { return; } else { } ath9k_ps_wakeup(sc); pll_sqsum = ar9003_get_pll_sqsum_dvc(sc->sc_ah); ath9k_ps_restore(sc); tmp___1 = ath_hw_pll_rx_hang_check(sc, pll_sqsum); if ((int )tmp___1) { return; } else { } tmp___2 = msecs_to_jiffies(100U); ieee80211_queue_delayed_work(sc->hw, & sc->hw_pll_work, tmp___2); return; } } static void ath_paprd_activate(struct ath_softc *sc ) { struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; struct ath9k_hw_cal_data *caldata ; int chain ; int tmp___0 ; { ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; caldata = ah->caldata; if ((unsigned long )caldata == (unsigned long )((struct ath9k_hw_cal_data *)0)) { goto _L; } else { tmp___0 = constant_test_bit(2L, (unsigned long const volatile *)(& caldata->cal_flags)); if (tmp___0 == 0) { _L: /* CIL Label */ if ((common->debug_mask & 8) != 0) { ath_printk("\017", (struct ath_common const *)common, "Failed to activate PAPRD\n"); } else { } return; } else { } } ar9003_paprd_enable(ah, 0); chain = 0; goto ldv_54052; ldv_54051: ; if ((((unsigned long )ah->txchainmask >> chain) & 1UL) == 0UL) { goto ldv_54050; } else { } ar9003_paprd_populate_single_table(ah, caldata, chain); ldv_54050: chain = chain + 1; ldv_54052: ; if (chain <= 2) { goto ldv_54051; } else { } if ((common->debug_mask & 8) != 0) { ath_printk("\017", (struct ath_common const *)common, "Activating PAPRD\n"); } else { } ar9003_paprd_enable(ah, 1); return; } } static bool ath_paprd_send_frame(struct ath_softc *sc , struct sk_buff *skb , int chain ) { struct ieee80211_hw *hw ; struct ieee80211_tx_info *tx_info ; struct ieee80211_tx_info *tmp ; struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp___0 ; struct ath_tx_control txctl ; int time_left ; int tmp___1 ; unsigned long tmp___2 ; unsigned long tmp___3 ; { hw = sc->hw; tmp = IEEE80211_SKB_CB(skb); tx_info = tmp; ah = sc->sc_ah; tmp___0 = ath9k_hw_common(ah); common = tmp___0; memset((void *)(& txctl), 0, 32UL); txctl.txq = sc->tx.txq_map[2]; memset((void *)tx_info, 0, 48UL); tx_info->band = (u8 )(sc->cur_chandef.chan)->band; tx_info->flags = tx_info->flags | 4U; tx_info->__annonCompField99.control.__annonCompField97.__annonCompField96.rates[0].idx = 0; tx_info->__annonCompField99.control.__annonCompField97.__annonCompField96.rates[0].count = 1U; tx_info->__annonCompField99.control.__annonCompField97.__annonCompField96.rates[0].flags = 8U; tx_info->__annonCompField99.control.__annonCompField97.__annonCompField96.rates[1].idx = -1; init_completion(& sc->paprd_complete); txctl.paprd = (u8 )(1UL << chain); tmp___1 = ath_tx_start(hw, skb, & txctl); if (tmp___1 != 0) { if ((common->debug_mask & 8) != 0) { ath_printk("\017", (struct ath_common const *)common, "PAPRD TX failed\n"); } else { } dev_kfree_skb_any(skb); return (0); } else { } tmp___2 = msecs_to_jiffies(100U); tmp___3 = wait_for_completion_timeout(& sc->paprd_complete, tmp___2); time_left = (int )tmp___3; if (time_left == 0) { if ((common->debug_mask & 8) != 0) { ath_printk("\017", (struct ath_common const *)common, "Timeout waiting for paprd training on TX chain %d\n", chain); } else { } } else { } return (time_left != 0); } } void ath_paprd_calibrate(struct work_struct *work ) { struct ath_softc *sc ; struct work_struct const *__mptr ; struct ieee80211_hw *hw ; struct ath_hw *ah ; struct ieee80211_hdr *hdr ; struct sk_buff *skb ; struct ath9k_hw_cal_data *caldata ; struct ath_common *common ; struct ath_common *tmp ; int ftype ; int chain_ok ; int chain ; int len ; int ret ; int tmp___0 ; int tmp___1 ; int tmp___2 ; bool tmp___3 ; int tmp___4 ; bool tmp___5 ; int tmp___6 ; { __mptr = (struct work_struct const *)work; sc = (struct ath_softc *)__mptr + 0xfffffffffffff488UL; hw = sc->hw; ah = sc->sc_ah; skb = (struct sk_buff *)0; caldata = ah->caldata; tmp = ath9k_hw_common(ah); common = tmp; chain_ok = 0; len = 1800; if ((unsigned long )caldata == (unsigned long )((struct ath9k_hw_cal_data *)0)) { goto _L; } else { tmp___0 = constant_test_bit(1L, (unsigned long const volatile *)(& caldata->cal_flags)); if (tmp___0 == 0) { goto _L; } else { tmp___1 = constant_test_bit(2L, (unsigned long const volatile *)(& caldata->cal_flags)); if (tmp___1 != 0) { _L: /* CIL Label */ if ((common->debug_mask & 8) != 0) { ath_printk("\017", (struct ath_common const *)common, "Skipping PAPRD calibration\n"); } else { } return; } else { } } } ath9k_ps_wakeup(sc); tmp___2 = ar9003_paprd_init_table(ah); if (tmp___2 < 0) { goto fail_paprd; } else { } skb = alloc_skb((unsigned int )len, 208U); if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { goto fail_paprd; } else { } skb_put(skb, (unsigned int )len); memset((void *)skb->data, 0, (size_t )len); hdr = (struct ieee80211_hdr *)skb->data; ftype = 72; hdr->frame_control = (unsigned short )ftype; hdr->duration_id = 10U; memcpy((void *)(& hdr->addr1), (void const *)(& (hw->wiphy)->perm_addr), 6UL); memcpy((void *)(& hdr->addr2), (void const *)(& (hw->wiphy)->perm_addr), 6UL); memcpy((void *)(& hdr->addr3), (void const *)(& (hw->wiphy)->perm_addr), 6UL); chain = 0; goto ldv_54086; ldv_54085: ; if ((((unsigned long )ah->txchainmask >> chain) & 1UL) == 0UL) { goto ldv_54083; } else { } chain_ok = 0; ar9003_paprd_setup_gain_table(ah, chain); if ((common->debug_mask & 8) != 0) { ath_printk("\017", (struct ath_common const *)common, "Sending PAPRD training frame on chain %d\n", chain); } else { } tmp___3 = ath_paprd_send_frame(sc, skb, chain); if (tmp___3) { tmp___4 = 0; } else { tmp___4 = 1; } if (tmp___4) { goto fail_paprd; } else { } tmp___5 = ar9003_paprd_is_done(ah); if (tmp___5) { tmp___6 = 0; } else { tmp___6 = 1; } if (tmp___6) { if ((common->debug_mask & 8) != 0) { ath_printk("\017", (struct ath_common const *)common, "PAPRD not yet done on chain %d\n", chain); } else { } goto ldv_54084; } else { } ret = ar9003_paprd_create_curve(ah, caldata, chain); if (ret == -115) { if ((common->debug_mask & 8) != 0) { ath_printk("\017", (struct ath_common const *)common, "PAPRD curve on chain %d needs to be re-trained\n", chain); } else { } goto ldv_54084; } else if (ret != 0) { if ((common->debug_mask & 8) != 0) { ath_printk("\017", (struct ath_common const *)common, "PAPRD create curve failed on chain %d\n", chain); } else { } goto ldv_54084; } else { } chain_ok = 1; ldv_54083: chain = chain + 1; ldv_54086: ; if (chain <= 2) { goto ldv_54085; } else { } ldv_54084: kfree_skb(skb); if (chain_ok != 0) { set_bit(2L, (unsigned long volatile *)(& caldata->cal_flags)); ath_paprd_activate(sc); } else { } fail_paprd: ath9k_ps_restore(sc); return; } } void ath_ani_calibrate(unsigned long data ) { struct ath_softc *sc ; struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; bool longcal ; bool shortcal ; bool aniflag ; unsigned int timestamp ; unsigned int tmp___0 ; u32 cal_interval ; u32 short_cal_interval ; u32 long_cal_interval ; unsigned long flags ; int tmp___1 ; raw_spinlock_t *tmp___2 ; raw_spinlock_t *tmp___3 ; int ret ; int tmp___4 ; u32 _min1 ; unsigned int _min2 ; u32 _min1___0 ; u32 _min2___0 ; unsigned long tmp___5 ; int tmp___6 ; bool tmp___7 ; { sc = (struct ath_softc *)data; ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; longcal = 0; shortcal = 0; aniflag = 0; tmp___0 = jiffies_to_msecs(jiffies); timestamp = tmp___0; if ((unsigned long )ah->caldata != (unsigned long )((struct ath9k_hw_cal_data *)0)) { tmp___1 = constant_test_bit(4L, (unsigned long const volatile *)(& (ah->caldata)->cal_flags)); if (tmp___1 != 0) { long_cal_interval = 1000U; } else { long_cal_interval = 30000U; } } else { long_cal_interval = 30000U; } short_cal_interval = (unsigned int )ah->opmode == 3U ? 100U : 1000U; if ((unsigned int )(sc->sc_ah)->power_mode != 0U) { ah->ani_skip_count = ah->ani_skip_count + 1U; if (ah->ani_skip_count > 9U) { tmp___2 = spinlock_check(& sc->sc_pm_lock); flags = _raw_spin_lock_irqsave(tmp___2); sc->ps_flags = (u16 )((unsigned int )sc->ps_flags | 32U); spin_unlock_irqrestore(& sc->sc_pm_lock, flags); } else { } goto set_timer; } else { } ah->ani_skip_count = 0U; tmp___3 = spinlock_check(& sc->sc_pm_lock); flags = _raw_spin_lock_irqsave(tmp___3); sc->ps_flags = (unsigned int )sc->ps_flags & 65503U; spin_unlock_irqrestore(& sc->sc_pm_lock, flags); ath9k_ps_wakeup(sc); if (timestamp - common->ani.longcal_timer >= long_cal_interval) { longcal = 1; common->ani.longcal_timer = timestamp; } else { } if (! common->ani.caldone) { if (timestamp - common->ani.shortcal_timer >= short_cal_interval) { shortcal = 1; common->ani.shortcal_timer = timestamp; common->ani.resetcal_timer = timestamp; } else { } } else if (timestamp - common->ani.resetcal_timer > 1199999U) { common->ani.caldone = ath9k_hw_reset_calvalid(ah); if ((int )common->ani.caldone) { common->ani.resetcal_timer = timestamp; } else { } } else { } if (timestamp - common->ani.checkani_timer >= (unsigned int )ah->config.ani_poll_interval) { aniflag = 1; common->ani.checkani_timer = timestamp; } else { } if ((int )aniflag) { spin_lock(& common->cc_lock); ath9k_hw_ani_monitor(ah, ah->curchan); ath_update_survey_stats(sc); spin_unlock(& common->cc_lock); } else { } if ((int )longcal || (int )shortcal) { tmp___4 = ath9k_hw_calibrate(ah, ah->curchan, (int )ah->rxchainmask, (int )longcal); ret = tmp___4; if (ret < 0) { common->ani.caldone = 0; ath9k_queue_reset(sc, 10); return; } else { } common->ani.caldone = ret != 0; } else { } if ((common->debug_mask & 64) != 0) { ath_printk("\017", (struct ath_common const *)common, "Calibration @%lu finished: %s %s %s, caldone: %s\n", jiffies, (int )longcal ? (char *)"long" : (char *)"", (int )shortcal ? (char *)"short" : (char *)"", (int )aniflag ? (char *)"ani" : (char *)"", (int )common->ani.caldone ? (char *)"true" : (char *)"false"); } else { } ath9k_ps_restore(sc); set_timer: cal_interval = 30000U; _min1 = cal_interval; _min2 = (unsigned int )ah->config.ani_poll_interval; cal_interval = _min1 < _min2 ? _min1 : _min2; if (! common->ani.caldone) { _min1___0 = cal_interval; _min2___0 = short_cal_interval; cal_interval = _min1___0 < _min2___0 ? _min1___0 : _min2___0; } else { } tmp___5 = msecs_to_jiffies(cal_interval); ldv_mod_timer_134(& common->ani.timer, tmp___5 + (unsigned long )jiffies); tmp___7 = ar9003_is_paprd_enabled(ah); if ((int )tmp___7 && (unsigned long )ah->caldata != (unsigned long )((struct ath9k_hw_cal_data *)0)) { tmp___6 = constant_test_bit(2L, (unsigned long const volatile *)(& (ah->caldata)->cal_flags)); if (tmp___6 == 0) { ieee80211_queue_work(sc->hw, & sc->paprd_work); } else if (! ah->paprd_table_write_done) { ath9k_ps_wakeup(sc); ath_paprd_activate(sc); ath9k_ps_restore(sc); } else { } } else { } return; } } void ath_start_ani(struct ath_softc *sc ) { struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; unsigned long timestamp ; unsigned int tmp___0 ; int tmp___1 ; unsigned long tmp___2 ; { ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; tmp___0 = jiffies_to_msecs(jiffies); timestamp = (unsigned long )tmp___0; if ((int )common->disable_ani) { return; } else { tmp___1 = constant_test_bit(2L, (unsigned long const volatile *)(& common->op_flags)); if (tmp___1 == 0) { return; } else if ((int )(sc->cur_chan)->offchannel) { return; } else { } } common->ani.longcal_timer = (unsigned int )timestamp; common->ani.shortcal_timer = (unsigned int )timestamp; common->ani.checkani_timer = (unsigned int )timestamp; if ((common->debug_mask & 64) != 0) { ath_printk("\017", (struct ath_common const *)common, "Starting ANI\n"); } else { } tmp___2 = msecs_to_jiffies((unsigned int )ah->config.ani_poll_interval); ldv_mod_timer_135(& common->ani.timer, tmp___2 + (unsigned long )jiffies); return; } } void ath_stop_ani(struct ath_softc *sc ) { struct ath_common *common ; struct ath_common *tmp ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; if ((common->debug_mask & 64) != 0) { ath_printk("\017", (struct ath_common const *)common, "Stopping ANI\n"); } else { } ldv_del_timer_sync_136(& common->ani.timer); return; } } void ath_check_ani(struct ath_softc *sc ) { struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; struct ath_beacon_config *cur_conf ; int tmp___0 ; int tmp___1 ; int tmp___2 ; { ah = sc->sc_ah; tmp = ath9k_hw_common(sc->sc_ah); common = tmp; cur_conf = & (sc->cur_chan)->beacon; if ((unsigned int )ah->opmode == 1U) { if ((unsigned int )cur_conf->enable_beacon == 0U) { goto stop_ani; } else { } } else if ((unsigned int )ah->opmode == 3U) { if ((unsigned int )cur_conf->enable_beacon == 0U) { tmp___0 = constant_test_bit(3L, (unsigned long const volatile *)(& common->op_flags)); if (tmp___0 == 0) { goto stop_ani; } else { } } else { } } else if ((unsigned int )ah->opmode == 2U) { tmp___1 = constant_test_bit(3L, (unsigned long const volatile *)(& common->op_flags)); if (tmp___1 == 0) { goto stop_ani; } else { } } else { } tmp___2 = constant_test_bit(2L, (unsigned long const volatile *)(& common->op_flags)); if (tmp___2 == 0) { set_bit(2L, (unsigned long volatile *)(& common->op_flags)); ath_start_ani(sc); } else { } return; stop_ani: clear_bit(2L, (unsigned long volatile *)(& common->op_flags)); ath_stop_ani(sc); return; } } void ath_update_survey_nf(struct ath_softc *sc , int channel ) { struct ath_hw *ah ; struct ath9k_channel *chan ; struct survey_info *survey ; s16 tmp ; { ah = sc->sc_ah; chan = (struct ath9k_channel *)(& ah->channels) + (unsigned long )channel; survey = (struct survey_info *)(& sc->survey) + (unsigned long )channel; if ((int )chan->noisefloor != 0) { survey->filled = survey->filled | 1U; tmp = ath9k_hw_getchan_noise(ah, chan, (int )chan->noisefloor); survey->noise = (s8 )tmp; } else { } return; } } int ath_update_survey_stats(struct ath_softc *sc ) { struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; int pos ; struct survey_info *survey ; struct ath_cycle_counters *cc ; unsigned int div ; int ret ; { ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; pos = (int )(((long )ah->curchan - (long )(& ah->channels)) / 16L); survey = (struct survey_info *)(& sc->survey) + (unsigned long )pos; cc = & common->cc_survey; div = common->clockrate * 1000U; ret = 0; if ((unsigned long )ah->curchan == (unsigned long )((struct ath9k_channel *)0)) { return (-1); } else { } if ((unsigned int )ah->power_mode == 0U) { ath_hw_cycle_counters_update(common); } else { } if (cc->cycles != 0U) { survey->filled = survey->filled | 108U; survey->time = survey->time + (u64 )(cc->cycles / div); survey->time_busy = survey->time_busy + (u64 )(cc->rx_busy / div); survey->time_rx = survey->time_rx + (u64 )(cc->rx_frame / div); survey->time_tx = survey->time_tx + (u64 )(cc->tx_frame / div); } else { } if (cc->cycles < div) { return (-1); } else { } if (cc->cycles != 0U) { ret = (int )((cc->rx_busy * 100U) / cc->cycles); } else { } memset((void *)cc, 0, 16UL); ath_update_survey_nf(sc, pos); return (ret); } } bool ldv_queue_work_on_129(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_130(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_131(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_132(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_7(2); return; } } bool ldv_queue_delayed_work_on_133(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } int ldv_mod_timer_134(struct timer_list *ldv_func_arg1 , unsigned long ldv_func_arg2 ) { ldv_func_ret_type___3 ldv_func_res ; int tmp ; { tmp = mod_timer(ldv_func_arg1, ldv_func_arg2); ldv_func_res = tmp; activate_pending_timer_14(ldv_func_arg1, ldv_func_arg2, 1); return (ldv_func_res); } } int ldv_mod_timer_135(struct timer_list *ldv_func_arg1 , unsigned long ldv_func_arg2 ) { ldv_func_ret_type___4 ldv_func_res ; int tmp ; { tmp = mod_timer(ldv_func_arg1, ldv_func_arg2); ldv_func_res = tmp; activate_pending_timer_14(ldv_func_arg1, ldv_func_arg2, 1); return (ldv_func_res); } } int ldv_del_timer_sync_136(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___5 ldv_func_res ; int tmp ; { tmp = del_timer_sync(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_14(ldv_func_arg1); return (ldv_func_res); } } bool ldv_queue_work_on_149(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_151(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_150(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; bool ldv_queue_delayed_work_on_153(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; void ldv_flush_workqueue_152(struct workqueue_struct *ldv_func_arg1 ) ; __inline static void ath9k_hw_antdiv_comb_conf_get(struct ath_hw *ah , struct ath_hw_antcomb_conf *antconf ) { struct ath_hw_ops *tmp ; { tmp = ath9k_hw_ops(ah); (*(tmp->antdiv_comb_conf_get))(ah, antconf); return; } } __inline static void ath9k_hw_antdiv_comb_conf_set(struct ath_hw *ah , struct ath_hw_antcomb_conf *antconf ) { struct ath_hw_ops *tmp ; { tmp = ath9k_hw_ops(ah); (*(tmp->antdiv_comb_conf_set))(ah, antconf); return; } } void ath9k_debug_stat_ant(struct ath_softc *sc , struct ath_hw_antcomb_conf *div_ant_conf , int main_rssi_avg , int alt_rssi_avg ) ; __inline static bool ath_is_alt_ant_ratio_better(struct ath_ant_comb *antcomb , int alt_ratio , int maxdelta , int mindelta , int main_rssi_avg , int alt_rssi_avg , int pkt_count ) { { if (pkt_count <= 50) { return (0); } else { } if (main_rssi_avg + mindelta < alt_rssi_avg) { return (1); } else { } if ((antcomb->ant_ratio2 <= alt_ratio && antcomb->low_rssi_thresh <= alt_rssi_avg) && main_rssi_avg + maxdelta < alt_rssi_avg) { return (1); } else { } return (0); } } __inline static bool ath_ant_div_comb_alt_check(struct ath_hw_antcomb_conf *conf , struct ath_ant_comb *antcomb , int alt_ratio , int alt_rssi_avg , int main_rssi_avg ) { bool result ; bool set1 ; bool set2 ; { set2 = 0; set1 = set2; result = set1; if ((unsigned int )conf->main_lna_conf == 1U && (unsigned int )conf->alt_lna_conf == 2U) { set1 = 1; } else { } if ((unsigned int )conf->main_lna_conf == 2U && (unsigned int )conf->alt_lna_conf == 1U) { set2 = 1; } else { } switch ((int )conf->div_group) { case 0: ; if (alt_ratio > 30) { result = 1; } else { } goto ldv_54015; case 1: ; case 2: ; if (alt_rssi_avg <= 3 || antcomb->low_rssi_thresh > alt_rssi_avg) { goto ldv_54015; } else { } if ((((int )set1 && main_rssi_avg + -5 <= alt_rssi_avg) || ((int )set2 && main_rssi_avg + -2 <= alt_rssi_avg)) || antcomb->ant_ratio < alt_ratio) { result = 1; } else { } goto ldv_54015; case 3: ; if (alt_rssi_avg <= 3 || antcomb->low_rssi_thresh > alt_rssi_avg) { goto ldv_54015; } else { } if ((((int )set1 && main_rssi_avg + -3 <= alt_rssi_avg) || ((int )set2 && main_rssi_avg + 3 <= alt_rssi_avg)) || antcomb->ant_ratio < alt_ratio) { result = 1; } else { } goto ldv_54015; } ldv_54015: ; return (result); } } static void ath_lnaconf_alt_good_scan(struct ath_ant_comb *antcomb , struct ath_hw_antcomb_conf ant_conf , int main_rssi_avg ) { { antcomb->quick_scan_cnt = 0; if ((unsigned int )ant_conf.main_lna_conf == 1U) { antcomb->rssi_lna2 = main_rssi_avg; } else if ((unsigned int )ant_conf.main_lna_conf == 2U) { antcomb->rssi_lna1 = main_rssi_avg; } else { } switch (((int )ant_conf.main_lna_conf << 4) | (int )ant_conf.alt_lna_conf) { case 16: antcomb->main_conf = 0; antcomb->first_quick_scan_conf = 3; antcomb->second_quick_scan_conf = 2; goto ldv_54025; case 32: antcomb->main_conf = 0; antcomb->first_quick_scan_conf = 3; antcomb->second_quick_scan_conf = 1; goto ldv_54025; case 33: antcomb->main_conf = 1; antcomb->first_quick_scan_conf = 0; antcomb->second_quick_scan_conf = 3; goto ldv_54025; case 18: antcomb->main_conf = 2; antcomb->first_quick_scan_conf = 0; antcomb->second_quick_scan_conf = 3; goto ldv_54025; case 19: antcomb->main_conf = 3; antcomb->first_quick_scan_conf = 0; antcomb->second_quick_scan_conf = 2; goto ldv_54025; case 35: antcomb->main_conf = 3; antcomb->first_quick_scan_conf = 0; antcomb->second_quick_scan_conf = 1; goto ldv_54025; default: ; goto ldv_54025; } ldv_54025: ; return; } } static void ath_ant_set_alt_ratio(struct ath_ant_comb *antcomb , struct ath_hw_antcomb_conf *conf ) { { if ((int )antcomb->first_ratio && (int )antcomb->second_ratio) { if (antcomb->rssi_second > antcomb->rssi_third) { if ((unsigned int )antcomb->first_quick_scan_conf == 2U || (unsigned int )antcomb->first_quick_scan_conf == 1U) { if ((unsigned int )conf->main_lna_conf == 1U) { conf->alt_lna_conf = 2U; } else { conf->alt_lna_conf = 1U; } } else { conf->alt_lna_conf = (u8 )antcomb->first_quick_scan_conf; } } else if ((unsigned int )antcomb->second_quick_scan_conf == 2U || (unsigned int )antcomb->second_quick_scan_conf == 1U) { if ((unsigned int )conf->main_lna_conf == 1U) { conf->alt_lna_conf = 2U; } else { conf->alt_lna_conf = 1U; } } else { conf->alt_lna_conf = (u8 )antcomb->second_quick_scan_conf; } } else if ((int )antcomb->first_ratio) { if ((unsigned int )antcomb->first_quick_scan_conf == 2U || (unsigned int )antcomb->first_quick_scan_conf == 1U) { if ((unsigned int )conf->main_lna_conf == 1U) { conf->alt_lna_conf = 2U; } else { conf->alt_lna_conf = 1U; } } else { conf->alt_lna_conf = (u8 )antcomb->first_quick_scan_conf; } } else if ((int )antcomb->second_ratio) { if ((unsigned int )antcomb->second_quick_scan_conf == 2U || (unsigned int )antcomb->second_quick_scan_conf == 1U) { if ((unsigned int )conf->main_lna_conf == 1U) { conf->alt_lna_conf = 2U; } else { conf->alt_lna_conf = 1U; } } else { conf->alt_lna_conf = (u8 )antcomb->second_quick_scan_conf; } } else if ((unsigned int )antcomb->main_conf == 2U || (unsigned int )antcomb->main_conf == 1U) { if ((unsigned int )conf->main_lna_conf == 1U) { conf->alt_lna_conf = 2U; } else { conf->alt_lna_conf = 1U; } } else { conf->alt_lna_conf = (u8 )antcomb->main_conf; } return; } } static void ath_select_ant_div_from_quick_scan(struct ath_ant_comb *antcomb , struct ath_hw_antcomb_conf *div_ant_conf , int main_rssi_avg , int alt_rssi_avg , int alt_ratio ) { bool tmp ; bool tmp___0 ; bool tmp___1 ; bool tmp___2 ; bool tmp___3 ; bool tmp___4 ; { switch (antcomb->quick_scan_cnt) { case 0: div_ant_conf->main_lna_conf = (u8 )antcomb->main_conf; div_ant_conf->alt_lna_conf = (u8 )antcomb->first_quick_scan_conf; goto ldv_54044; case 1: div_ant_conf->main_lna_conf = (u8 )antcomb->main_conf; div_ant_conf->alt_lna_conf = (u8 )antcomb->second_quick_scan_conf; antcomb->rssi_first = main_rssi_avg; antcomb->rssi_second = alt_rssi_avg; if ((unsigned int )antcomb->main_conf == 2U) { tmp = ath_is_alt_ant_ratio_better(antcomb, alt_ratio, -4, 2, main_rssi_avg, alt_rssi_avg, (int )antcomb->total_pkt_count); if ((int )tmp) { antcomb->first_ratio = 1; } else { antcomb->first_ratio = 0; } } else if ((unsigned int )antcomb->main_conf == 1U) { tmp___0 = ath_is_alt_ant_ratio_better(antcomb, alt_ratio, -2, 2, main_rssi_avg, alt_rssi_avg, (int )antcomb->total_pkt_count); if ((int )tmp___0) { antcomb->first_ratio = 1; } else { antcomb->first_ratio = 0; } } else { tmp___1 = ath_is_alt_ant_ratio_better(antcomb, alt_ratio, -4, 0, main_rssi_avg, alt_rssi_avg, (int )antcomb->total_pkt_count); if ((int )tmp___1) { antcomb->first_ratio = 1; } else { antcomb->first_ratio = 0; } } goto ldv_54044; case 2: antcomb->alt_good = 0; antcomb->scan_not_start = 0; antcomb->scan = 0; antcomb->rssi_first = main_rssi_avg; antcomb->rssi_third = alt_rssi_avg; switch ((unsigned int )antcomb->second_quick_scan_conf) { case 2U: antcomb->rssi_lna1 = alt_rssi_avg; goto ldv_54048; case 1U: antcomb->rssi_lna2 = alt_rssi_avg; goto ldv_54048; case 3U: ; if ((unsigned int )antcomb->main_conf == 1U) { antcomb->rssi_lna2 = main_rssi_avg; } else if ((unsigned int )antcomb->main_conf == 2U) { antcomb->rssi_lna1 = main_rssi_avg; } else { } goto ldv_54048; default: ; goto ldv_54048; } ldv_54048: ; if (antcomb->rssi_lna2 > antcomb->rssi_lna1 + div_ant_conf->lna1_lna2_switch_delta) { div_ant_conf->main_lna_conf = 1U; } else { div_ant_conf->main_lna_conf = 2U; } if ((unsigned int )antcomb->main_conf == 2U) { tmp___2 = ath_is_alt_ant_ratio_better(antcomb, alt_ratio, -4, 2, main_rssi_avg, alt_rssi_avg, (int )antcomb->total_pkt_count); if ((int )tmp___2) { antcomb->second_ratio = 1; } else { antcomb->second_ratio = 0; } } else if ((unsigned int )antcomb->main_conf == 1U) { tmp___3 = ath_is_alt_ant_ratio_better(antcomb, alt_ratio, -2, 2, main_rssi_avg, alt_rssi_avg, (int )antcomb->total_pkt_count); if ((int )tmp___3) { antcomb->second_ratio = 1; } else { antcomb->second_ratio = 0; } } else { tmp___4 = ath_is_alt_ant_ratio_better(antcomb, alt_ratio, -4, 0, main_rssi_avg, alt_rssi_avg, (int )antcomb->total_pkt_count); if ((int )tmp___4) { antcomb->second_ratio = 1; } else { antcomb->second_ratio = 0; } } ath_ant_set_alt_ratio(antcomb, div_ant_conf); goto ldv_54044; default: ; goto ldv_54044; } ldv_54044: ; return; } } static void ath_ant_div_conf_fast_divbias(struct ath_hw_antcomb_conf *ant_conf , struct ath_ant_comb *antcomb , int alt_ratio ) { { ant_conf->main_gaintb = 0U; ant_conf->alt_gaintb = 0U; if ((unsigned int )ant_conf->div_group == 0U) { switch (((int )ant_conf->main_lna_conf << 4) | (int )ant_conf->alt_lna_conf) { case 1: ant_conf->fast_div_bias = 59U; goto ldv_54059; case 2: ant_conf->fast_div_bias = 61U; goto ldv_54059; case 3: ant_conf->fast_div_bias = 1U; goto ldv_54059; case 16: ant_conf->fast_div_bias = 7U; goto ldv_54059; case 18: ant_conf->fast_div_bias = 2U; goto ldv_54059; case 19: ant_conf->fast_div_bias = 7U; goto ldv_54059; case 32: ant_conf->fast_div_bias = 6U; goto ldv_54059; case 33: ant_conf->fast_div_bias = 0U; goto ldv_54059; case 35: ant_conf->fast_div_bias = 6U; goto ldv_54059; case 48: ant_conf->fast_div_bias = 1U; goto ldv_54059; case 49: ant_conf->fast_div_bias = 59U; goto ldv_54059; case 50: ant_conf->fast_div_bias = 61U; goto ldv_54059; default: ; goto ldv_54059; } ldv_54059: ; } else if ((unsigned int )ant_conf->div_group == 1U) { switch (((int )ant_conf->main_lna_conf << 4) | (int )ant_conf->alt_lna_conf) { case 1: ant_conf->fast_div_bias = 1U; goto ldv_54073; case 2: ant_conf->fast_div_bias = 1U; goto ldv_54073; case 3: ant_conf->fast_div_bias = 1U; goto ldv_54073; case 16: ; if (! antcomb->scan && alt_ratio > 30) { ant_conf->fast_div_bias = 63U; } else { ant_conf->fast_div_bias = 1U; } goto ldv_54073; case 18: ant_conf->fast_div_bias = 1U; goto ldv_54073; case 19: ; if (! antcomb->scan && alt_ratio > 30) { ant_conf->fast_div_bias = 63U; } else { ant_conf->fast_div_bias = 1U; } goto ldv_54073; case 32: ; if (! antcomb->scan && alt_ratio > 30) { ant_conf->fast_div_bias = 63U; } else { ant_conf->fast_div_bias = 1U; } goto ldv_54073; case 33: ant_conf->fast_div_bias = 1U; goto ldv_54073; case 35: ; if (! antcomb->scan && alt_ratio > 30) { ant_conf->fast_div_bias = 63U; } else { ant_conf->fast_div_bias = 1U; } goto ldv_54073; case 48: ant_conf->fast_div_bias = 1U; goto ldv_54073; case 49: ant_conf->fast_div_bias = 1U; goto ldv_54073; case 50: ant_conf->fast_div_bias = 1U; goto ldv_54073; default: ; goto ldv_54073; } ldv_54073: ; } else if ((unsigned int )ant_conf->div_group == 2U) { switch (((int )ant_conf->main_lna_conf << 4) | (int )ant_conf->alt_lna_conf) { case 1: ant_conf->fast_div_bias = 1U; goto ldv_54087; case 2: ant_conf->fast_div_bias = 1U; goto ldv_54087; case 3: ant_conf->fast_div_bias = 1U; goto ldv_54087; case 16: ; if (! antcomb->scan && antcomb->ant_ratio < alt_ratio) { ant_conf->fast_div_bias = 1U; } else { ant_conf->fast_div_bias = 2U; } goto ldv_54087; case 18: ant_conf->fast_div_bias = 1U; goto ldv_54087; case 19: ; if (! antcomb->scan && antcomb->ant_ratio < alt_ratio) { ant_conf->fast_div_bias = 1U; } else { ant_conf->fast_div_bias = 2U; } goto ldv_54087; case 32: ; if (! antcomb->scan && antcomb->ant_ratio < alt_ratio) { ant_conf->fast_div_bias = 1U; } else { ant_conf->fast_div_bias = 2U; } goto ldv_54087; case 33: ant_conf->fast_div_bias = 1U; goto ldv_54087; case 35: ; if (! antcomb->scan && antcomb->ant_ratio < alt_ratio) { ant_conf->fast_div_bias = 1U; } else { ant_conf->fast_div_bias = 2U; } goto ldv_54087; case 48: ant_conf->fast_div_bias = 1U; goto ldv_54087; case 49: ant_conf->fast_div_bias = 1U; goto ldv_54087; case 50: ant_conf->fast_div_bias = 1U; goto ldv_54087; default: ; goto ldv_54087; } ldv_54087: ; if (antcomb->fast_div_bias != 0) { ant_conf->fast_div_bias = (u8 )antcomb->fast_div_bias; } else { } } else if ((unsigned int )ant_conf->div_group == 3U) { switch (((int )ant_conf->main_lna_conf << 4) | (int )ant_conf->alt_lna_conf) { case 1: ant_conf->fast_div_bias = 1U; goto ldv_54101; case 2: ant_conf->fast_div_bias = 57U; goto ldv_54101; case 3: ant_conf->fast_div_bias = 1U; goto ldv_54101; case 16: ant_conf->fast_div_bias = 2U; goto ldv_54101; case 18: ant_conf->fast_div_bias = 63U; goto ldv_54101; case 19: ant_conf->fast_div_bias = 2U; goto ldv_54101; case 32: ant_conf->fast_div_bias = 3U; goto ldv_54101; case 33: ant_conf->fast_div_bias = 3U; goto ldv_54101; case 35: ant_conf->fast_div_bias = 3U; goto ldv_54101; case 48: ant_conf->fast_div_bias = 1U; goto ldv_54101; case 49: ant_conf->fast_div_bias = 6U; goto ldv_54101; case 50: ant_conf->fast_div_bias = 1U; goto ldv_54101; default: ; goto ldv_54101; } ldv_54101: ; } else { } return; } } static void ath_ant_try_scan(struct ath_ant_comb *antcomb , struct ath_hw_antcomb_conf *conf , int curr_alt_set , int alt_rssi_avg , int main_rssi_avg ) { { switch (curr_alt_set) { case 1: antcomb->rssi_lna2 = alt_rssi_avg; antcomb->rssi_lna1 = main_rssi_avg; antcomb->scan = 1; conf->main_lna_conf = 2U; conf->alt_lna_conf = 3U; goto ldv_54122; case 2: antcomb->rssi_lna1 = alt_rssi_avg; antcomb->rssi_lna2 = main_rssi_avg; antcomb->scan = 1; conf->main_lna_conf = 1U; conf->alt_lna_conf = 3U; goto ldv_54122; case 3: antcomb->rssi_add = alt_rssi_avg; antcomb->scan = 1; conf->alt_lna_conf = 0U; goto ldv_54122; case 0: antcomb->rssi_sub = alt_rssi_avg; antcomb->scan = 0; if (antcomb->rssi_lna2 > antcomb->rssi_lna1 + conf->lna1_lna2_switch_delta) { if (antcomb->rssi_add > antcomb->rssi_lna1 && antcomb->rssi_add > antcomb->rssi_sub) { conf->main_lna_conf = 1U; conf->alt_lna_conf = 3U; } else if (antcomb->rssi_sub > antcomb->rssi_lna1) { conf->main_lna_conf = 1U; conf->alt_lna_conf = 0U; } else { conf->main_lna_conf = 1U; conf->alt_lna_conf = 2U; } } else if (antcomb->rssi_add > antcomb->rssi_lna2 && antcomb->rssi_add > antcomb->rssi_sub) { conf->main_lna_conf = 2U; conf->alt_lna_conf = 3U; } else if (antcomb->rssi_sub > antcomb->rssi_lna1) { conf->main_lna_conf = 2U; conf->alt_lna_conf = 0U; } else { conf->main_lna_conf = 2U; conf->alt_lna_conf = 1U; } goto ldv_54122; default: ; goto ldv_54122; } ldv_54122: ; return; } } static bool ath_ant_try_switch(struct ath_hw_antcomb_conf *div_ant_conf , struct ath_ant_comb *antcomb , int alt_ratio , int alt_rssi_avg , int main_rssi_avg , int curr_main_set , int curr_alt_set ) { bool ret ; bool tmp ; { ret = 0; tmp = ath_ant_div_comb_alt_check(div_ant_conf, antcomb, alt_ratio, alt_rssi_avg, main_rssi_avg); if ((int )tmp) { if (curr_alt_set == 1) { div_ant_conf->main_lna_conf = 1U; div_ant_conf->alt_lna_conf = 2U; } else if (curr_alt_set == 2) { div_ant_conf->main_lna_conf = 2U; div_ant_conf->alt_lna_conf = 1U; } else { } ret = 1; } else if (curr_alt_set != 2 && curr_alt_set != 1) { if (curr_main_set == 1) { div_ant_conf->alt_lna_conf = 2U; } else if (curr_main_set == 2) { div_ant_conf->alt_lna_conf = 1U; } else { } ret = 1; } else { } return (ret); } } static bool ath_ant_short_scan_check(struct ath_ant_comb *antcomb ) { int alt_ratio ; unsigned long tmp ; { if (! antcomb->scan || ! antcomb->alt_good) { return (0); } else { } tmp = msecs_to_jiffies(50U); if ((long )((antcomb->scan_start_time + tmp) - (unsigned long )jiffies) < 0L) { return (1); } else { } if ((unsigned int )antcomb->total_pkt_count == 256U) { alt_ratio = (antcomb->alt_recv_cnt * 100) / (int )antcomb->total_pkt_count; if (antcomb->ant_ratio > alt_ratio) { return (1); } else { } } else { } return (0); } } void ath_ant_comb_scan(struct ath_softc *sc , struct ath_rx_status *rs ) { struct ath_hw_antcomb_conf div_ant_conf ; struct ath_ant_comb *antcomb ; int alt_ratio ; int alt_rssi_avg ; int main_rssi_avg ; int curr_alt_set ; int curr_main_set ; int main_rssi ; int alt_rssi ; int rx_ant_conf ; int main_ant_conf ; bool short_scan ; bool ret ; { antcomb = & sc->ant_comb; alt_ratio = 0; alt_rssi_avg = 0; main_rssi_avg = 0; main_rssi = (int )rs->rs_rssi_ctl[0]; alt_rssi = (int )rs->rs_rssi_ctl[1]; short_scan = 0; rx_ant_conf = ((int )rs->rs_rssi_ctl[2] >> 4) & 3; main_ant_conf = ((int )rs->rs_rssi_ctl[2] >> 2) & 3; if (antcomb->low_rssi_thresh <= alt_rssi) { antcomb->ant_ratio = 30; antcomb->ant_ratio2 = 20; } else { antcomb->ant_ratio = 50; antcomb->ant_ratio2 = 50; } if (main_rssi > 0 && alt_rssi > 0) { antcomb->total_pkt_count = (u16 )((int )antcomb->total_pkt_count + 1); antcomb->main_total_rssi = antcomb->main_total_rssi + main_rssi; antcomb->alt_total_rssi = antcomb->alt_total_rssi + alt_rssi; if (main_ant_conf == rx_ant_conf) { antcomb->main_recv_cnt = antcomb->main_recv_cnt + 1; } else { antcomb->alt_recv_cnt = antcomb->alt_recv_cnt + 1; } } else { } if (main_ant_conf == rx_ant_conf) { sc->debug.stats.ant_stats[0].recv_cnt = sc->debug.stats.ant_stats[0].recv_cnt + 1U; sc->debug.stats.ant_stats[0].lna_recv_cnt[rx_ant_conf] = sc->debug.stats.ant_stats[0].lna_recv_cnt[rx_ant_conf] + 1U; } else { sc->debug.stats.ant_stats[1].recv_cnt = sc->debug.stats.ant_stats[1].recv_cnt + 1U; sc->debug.stats.ant_stats[1].lna_recv_cnt[rx_ant_conf] = sc->debug.stats.ant_stats[1].lna_recv_cnt[rx_ant_conf] + 1U; } short_scan = ath_ant_short_scan_check(antcomb); if (((unsigned int )antcomb->total_pkt_count <= 511U || (unsigned int )rs->rs_moreaggr != 0U) && ! short_scan) { return; } else { } if ((unsigned int )antcomb->total_pkt_count != 0U) { alt_ratio = (antcomb->alt_recv_cnt * 100) / (int )antcomb->total_pkt_count; main_rssi_avg = antcomb->main_total_rssi / (int )antcomb->total_pkt_count; alt_rssi_avg = antcomb->alt_total_rssi / (int )antcomb->total_pkt_count; } else { } ath9k_hw_antdiv_comb_conf_get(sc->sc_ah, & div_ant_conf); curr_alt_set = (int )div_ant_conf.alt_lna_conf; curr_main_set = (int )div_ant_conf.main_lna_conf; antcomb->count = (u16 )((int )antcomb->count + 1); if ((unsigned int )antcomb->count == 100U) { if (antcomb->ant_ratio < alt_ratio) { ath_lnaconf_alt_good_scan(antcomb, div_ant_conf, main_rssi_avg); antcomb->alt_good = 1; } else { antcomb->alt_good = 0; } antcomb->count = 0U; antcomb->scan = 1; antcomb->scan_not_start = 1; } else { } if (! antcomb->scan) { ret = ath_ant_try_switch(& div_ant_conf, antcomb, alt_ratio, alt_rssi_avg, main_rssi_avg, curr_main_set, curr_alt_set); if ((int )ret) { goto div_comb_done; } else { } } else { } if (! antcomb->scan && div_ant_conf.lna1_lna2_delta + main_rssi_avg > alt_rssi_avg) { goto div_comb_done; } else { } if (! antcomb->scan_not_start) { ath_ant_try_scan(antcomb, & div_ant_conf, curr_alt_set, alt_rssi_avg, main_rssi_avg); } else { if (! antcomb->alt_good) { antcomb->scan_not_start = 0; if (curr_main_set == 1) { div_ant_conf.main_lna_conf = 1U; div_ant_conf.alt_lna_conf = 2U; } else if (curr_main_set == 2) { div_ant_conf.main_lna_conf = 2U; div_ant_conf.alt_lna_conf = 1U; } else { } goto div_comb_done; } else { } ath_select_ant_div_from_quick_scan(antcomb, & div_ant_conf, main_rssi_avg, alt_rssi_avg, alt_ratio); antcomb->quick_scan_cnt = antcomb->quick_scan_cnt + 1; } div_comb_done: ath_ant_div_conf_fast_divbias(& div_ant_conf, antcomb, alt_ratio); ath9k_hw_antdiv_comb_conf_set(sc->sc_ah, & div_ant_conf); ath9k_debug_stat_ant(sc, & div_ant_conf, main_rssi_avg, alt_rssi_avg); antcomb->scan_start_time = jiffies; antcomb->total_pkt_count = 0U; antcomb->main_total_rssi = 0; antcomb->alt_total_rssi = 0; antcomb->main_recv_cnt = 0; antcomb->alt_recv_cnt = 0; return; } } bool ldv_queue_work_on_149(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_150(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_151(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_152(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_7(2); return; } } bool ldv_queue_delayed_work_on_153(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; extern int memcmp(void const * , void const * , size_t ) ; extern unsigned int jiffies_to_usecs(unsigned long const ) ; extern void getrawmonotonic64(struct timespec * ) ; __inline static void getrawmonotonic(struct timespec *ts ) { { getrawmonotonic64(ts); return; } } int ldv_mod_timer_168(struct timer_list *ldv_func_arg1 , unsigned long ldv_func_arg2 ) ; int ldv_mod_timer_169(struct timer_list *ldv_func_arg1 , unsigned long ldv_func_arg2 ) ; int ldv_mod_timer_170(struct timer_list *ldv_func_arg1 , unsigned long ldv_func_arg2 ) ; int ldv_mod_timer_171(struct timer_list *ldv_func_arg1 , unsigned long ldv_func_arg2 ) ; int ldv_del_timer_sync_173(struct timer_list *ldv_func_arg1 ) ; bool ldv_queue_work_on_163(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_165(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_164(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; bool ldv_queue_delayed_work_on_167(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; void ldv_flush_workqueue_166(struct workqueue_struct *ldv_func_arg1 ) ; bool ldv_cancel_work_sync_172(struct work_struct *ldv_func_arg1 ) ; void choose_timer_13(void) ; void activate_pending_timer_13(struct timer_list *timer , unsigned long data , int pending_flag ) ; void call_and_disable_work_7(struct work_struct *work ) ; void ldv_timer_14(int state , struct timer_list *timer ) ; void activate_suitable_timer_13(struct timer_list *timer , unsigned long data ) ; void ldv_timer_13(int state , struct timer_list *timer ) ; void disable_suitable_timer_13(struct timer_list *timer ) ; void invoke_work_7(void) ; void activate_suitable_timer_14(struct timer_list *timer , unsigned long data ) ; int reg_timer_13(struct timer_list *timer , void (*function)(unsigned long ) , unsigned long data ) ; void choose_timer_14(void) ; __inline static void skb_set_queue_mapping(struct sk_buff *skb , u16 queue_mapping ) { { skb->queue_mapping = queue_mapping; return; } } extern struct sk_buff *ieee80211_nullfunc_get(struct ieee80211_hw * , struct ieee80211_vif * ) ; extern struct sk_buff *ieee80211_probereq_get(struct ieee80211_hw * , u8 const * , u8 const * , size_t , size_t ) ; extern void ieee80211_scan_completed(struct ieee80211_hw * , bool ) ; extern struct ieee80211_sta *ieee80211_find_sta(struct ieee80211_vif * , u8 const * ) ; extern void ieee80211_ready_on_channel(struct ieee80211_hw * ) ; extern void ieee80211_remain_on_channel_expired(struct ieee80211_hw * ) ; __inline static enum nl80211_iftype ieee80211_iftype_p2p(enum nl80211_iftype type , bool p2p ) { { if ((int )p2p) { switch ((unsigned int )type) { case 2U: ; return (8); case 3U: ; return (9); default: ; goto ldv_49904; } ldv_49904: ; } else { } return (type); } } __inline static enum nl80211_iftype ieee80211_vif_type_p2p(struct ieee80211_vif *vif ) { enum nl80211_iftype tmp ; { tmp = ieee80211_iftype_p2p(vif->type, (int )vif->p2p); return (tmp); } } extern bool ieee80211_tx_prepare_skb(struct ieee80211_hw * , struct ieee80211_vif * , struct sk_buff * , int , struct ieee80211_sta ** ) ; extern int ieee80211_parse_p2p_noa(struct ieee80211_p2p_noa_attr const * , struct ieee80211_noa_data * , u32 ) ; extern void ieee80211_update_p2p_noa(struct ieee80211_noa_data * , u32 ) ; extern u32 ath9k_hw_getrxfilter(struct ath_hw * ) ; extern u32 ath9k_hw_gettsf32(struct ath_hw * ) ; extern struct ath_gen_timer *ath_gen_timer_alloc(struct ath_hw * , void (*)(void * ) , void (*)(void * ) , void * , u8 ) ; extern void ath9k_hw_gen_timer_start(struct ath_hw * , struct ath_gen_timer * , u32 , u32 ) ; extern void ath9k_hw_gen_timer_stop(struct ath_hw * , struct ath_gen_timer * ) ; extern void ath_gen_timer_free(struct ath_hw * , struct ath_gen_timer * ) ; extern void ath9k_cmn_spectral_scan_trigger(struct ath_common * , struct ath_spec_scan_priv * ) ; void ath9k_chanctx_wake_queues(struct ath_softc *sc , struct ath_chanctx *ctx ) ; void ath9k_chanctx_stop_queues(struct ath_softc *sc , struct ath_chanctx *ctx ) ; static int ath_set_channel(struct ath_softc *sc ) { struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; struct ieee80211_hw *hw ; struct ath9k_channel *hchan ; struct cfg80211_chan_def *chandef ; struct ieee80211_channel *chan ; int pos ; int old_pos ; int r ; int tmp___0 ; u32 rxfilter ; int tmp___1 ; { ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; hw = sc->hw; chandef = & (sc->cur_chan)->chandef; chan = chandef->chan; pos = (int )chan->hw_value; old_pos = -1; tmp___0 = constant_test_bit(0L, (unsigned long const volatile *)(& common->op_flags)); if (tmp___0 != 0) { return (-5); } else { } if ((unsigned long )ah->curchan != (unsigned long )((struct ath9k_channel *)0)) { old_pos = (int )(((long )ah->curchan - (long )(& ah->channels)) / 16L); } else { } if ((common->debug_mask & 512) != 0) { ath_printk("\017", (struct ath_common const *)common, "Set channel: %d MHz width: %d\n", (int )chan->center_freq, (unsigned int )chandef->width); } else { } spin_lock_bh(& common->cc_lock); ath_update_survey_stats(sc); spin_unlock_bh(& common->cc_lock); ath9k_cmn_get_channel(hw, ah, chandef); if (! (sc->cur_chan)->offchannel && (unsigned long )sc->cur_survey != (unsigned long )((struct survey_info *)(& sc->survey) + (unsigned long )pos)) { if ((unsigned long )sc->cur_survey != (unsigned long )((struct survey_info *)0)) { (sc->cur_survey)->filled = (sc->cur_survey)->filled & 4294967293U; } else { } sc->cur_survey = (struct survey_info *)(& sc->survey) + (unsigned long )pos; memset((void *)sc->cur_survey, 0, 64UL); (sc->cur_survey)->filled = (sc->cur_survey)->filled | 2U; } else if ((sc->survey[pos].filled & 2U) == 0U) { memset((void *)(& sc->survey) + (unsigned long )pos, 0, 64UL); } else { } hchan = (struct ath9k_channel *)(& (sc->sc_ah)->channels) + (unsigned long )pos; r = ath_reset(sc, hchan); if (r != 0) { return (r); } else { } if (old_pos >= 0) { ath_update_survey_nf(sc, old_pos); } else { } if ((int )hw->conf.radar_enabled) { rxfilter = ath9k_hw_getrxfilter(ah); rxfilter = rxfilter | 8448U; ath9k_hw_setrxfilter(ah, rxfilter); if ((common->debug_mask & 65536) != 0) { ath_printk("\017", (struct ath_common const *)common, "DFS enabled at freq %d\n", (int )chan->center_freq); } else { } } else { tmp___1 = constant_test_bit(5L, (unsigned long const volatile *)(& common->op_flags)); if (tmp___1 != 0 && (unsigned int )sc->spec_priv.spectral_mode == 3U) { ath9k_cmn_spectral_scan_trigger(common, & sc->spec_priv); } else { } } return (0); } } void ath_chanctx_init(struct ath_softc *sc ) { struct ath_chanctx *ctx ; struct ath_common *common ; struct ath_common *tmp ; struct ieee80211_supported_band *sband ; struct ieee80211_channel *chan ; int i ; int j ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; sband = (struct ieee80211_supported_band *)(& common->sbands); if (sband->n_channels == 0) { sband = (struct ieee80211_supported_band *)(& common->sbands) + 1UL; } else { } chan = sband->channels; i = 0; goto ldv_54055; ldv_54054: ctx = (struct ath_chanctx *)(& sc->chanctx) + (unsigned long )i; cfg80211_chandef_create(& ctx->chandef, chan, 1); INIT_LIST_HEAD(& ctx->vifs); ctx->txpower = 100U; ctx->flush_timeout = 50; j = 0; goto ldv_54052; ldv_54051: INIT_LIST_HEAD((struct list_head *)(& ctx->acq) + (unsigned long )j); j = j + 1; ldv_54052: ; if ((unsigned int )j <= 3U) { goto ldv_54051; } else { } i = i + 1; ldv_54055: ; if (i <= 1) { goto ldv_54054; } else { } return; } } void ath_chanctx_set_channel(struct ath_softc *sc , struct ath_chanctx *ctx , struct cfg80211_chan_def *chandef ) { struct ath_common *common ; struct ath_common *tmp ; bool cur_chan ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; spin_lock_bh(& sc->chan_lock); if ((unsigned long )chandef != (unsigned long )((struct cfg80211_chan_def *)0)) { memcpy((void *)(& ctx->chandef), (void const *)chandef, 24UL); } else { } cur_chan = (unsigned long )sc->cur_chan == (unsigned long )ctx; spin_unlock_bh(& sc->chan_lock); if (! cur_chan) { if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "Current context differs from the new context\n"); } else { } return; } else { } ath_set_channel(sc); return; } } struct ath_chanctx *ath_is_go_chanctx_present(struct ath_softc *sc ) { struct ath_chanctx *ctx ; struct ath_vif *avp ; struct ieee80211_vif *vif ; struct list_head const *__mptr ; enum nl80211_iftype tmp ; struct list_head const *__mptr___0 ; { spin_lock_bh(& sc->chan_lock); ctx = (struct ath_chanctx *)(& sc->chanctx); goto ldv_54081; ldv_54080: ; if (! ctx->active) { goto ldv_54072; } else { } __mptr = (struct list_head const *)ctx->vifs.next; avp = (struct ath_vif *)__mptr; goto ldv_54078; ldv_54077: vif = avp->vif; tmp = ieee80211_vif_type_p2p(vif); if ((unsigned int )tmp == 9U) { spin_unlock_bh(& sc->chan_lock); return (ctx); } else { } __mptr___0 = (struct list_head const *)avp->list.next; avp = (struct ath_vif *)__mptr___0; ldv_54078: ; if ((unsigned long )(& avp->list) != (unsigned long )(& ctx->vifs)) { goto ldv_54077; } else { } ldv_54072: ctx = ctx + 1; ldv_54081: ; if ((unsigned long )((struct ath_chanctx *)(& sc->chanctx) + 1UL) >= (unsigned long )ctx) { goto ldv_54080; } else { } spin_unlock_bh(& sc->chan_lock); return ((struct ath_chanctx *)0); } } static char const *offchannel_state_string(enum ath_offchannel_state state ) { { switch ((unsigned int )state) { case 0U: ; return ("ATH_OFFCHANNEL_IDLE"); case 1U: ; return ("ATH_OFFCHANNEL_PROBE_SEND"); case 2U: ; return ("ATH_OFFCHANNEL_PROBE_WAIT"); case 3U: ; return ("ATH_OFFCHANNEL_SUSPEND"); case 4U: ; return ("ATH_OFFCHANNEL_ROC_START"); case 5U: ; return ("ATH_OFFCHANNEL_ROC_WAIT"); case 6U: ; return ("ATH_OFFCHANNEL_ROC_DONE"); default: ; return ("unknown"); } } } static char const *chanctx_event_string(enum ath_chanctx_event ev ) { { switch ((unsigned int )ev) { case 0U: ; return ("ATH_CHANCTX_EVENT_BEACON_PREPARE"); case 1U: ; return ("ATH_CHANCTX_EVENT_BEACON_SENT"); case 2U: ; return ("ATH_CHANCTX_EVENT_TSF_TIMER"); case 3U: ; return ("ATH_CHANCTX_EVENT_BEACON_RECEIVED"); case 4U: ; return ("ATH_CHANCTX_EVENT_AUTHORIZED"); case 5U: ; return ("ATH_CHANCTX_EVENT_SWITCH"); case 6U: ; return ("ATH_CHANCTX_EVENT_ASSIGN"); case 7U: ; return ("ATH_CHANCTX_EVENT_UNASSIGN"); case 8U: ; return ("ATH_CHANCTX_EVENT_CHANGE"); case 9U: ; return ("ATH_CHANCTX_EVENT_ENABLE_MULTICHANNEL"); default: ; return ("unknown"); } } } static char const *chanctx_state_string(enum ath_chanctx_state state ) { { switch ((unsigned int )state) { case 0U: ; return ("ATH_CHANCTX_STATE_IDLE"); case 1U: ; return ("ATH_CHANCTX_STATE_WAIT_FOR_BEACON"); case 2U: ; return ("ATH_CHANCTX_STATE_WAIT_FOR_TIMER"); case 3U: ; return ("ATH_CHANCTX_STATE_SWITCH"); case 4U: ; return ("ATH_CHANCTX_STATE_FORCE_ACTIVE"); default: ; return ("unknown"); } } } void ath_chanctx_check_active(struct ath_softc *sc , struct ath_chanctx *ctx ) { struct ath_common *common ; struct ath_common *tmp ; struct ath_chanctx *ictx ; struct ath_vif *avp ; bool active ; u8 n_active ; unsigned long tmp___0 ; unsigned long tmp___1 ; long tmp___2 ; struct list_head const *__mptr ; struct ieee80211_vif *vif ; struct list_head const *__mptr___0 ; int tmp___3 ; unsigned long tmp___4 ; int tmp___5 ; bool tmp___6 ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; active = 0; n_active = 0U; if ((unsigned long )ctx == (unsigned long )((struct ath_chanctx *)0)) { return; } else { } if ((unsigned long )(& sc->offchannel.chan) == (unsigned long )ctx) { spin_lock_bh(& sc->chan_lock); tmp___2 = ldv__builtin_expect(sc->sched.channel_switch_time != 0U, 1L); if (tmp___2 != 0L) { tmp___0 = usecs_to_jiffies(sc->sched.channel_switch_time); ctx->flush_timeout = (int )tmp___0; } else { tmp___1 = msecs_to_jiffies(10U); ctx->flush_timeout = (int )tmp___1; } spin_unlock_bh(& sc->chan_lock); return; } else { } ictx = ctx; __mptr = (struct list_head const *)ctx->vifs.next; avp = (struct ath_vif *)__mptr; goto ldv_54136; ldv_54135: vif = avp->vif; switch ((unsigned int )vif->type) { case 8U: ; case 2U: ; if ((int )avp->assoc) { active = 1; } else { } goto ldv_54133; default: active = 1; goto ldv_54133; } ldv_54133: __mptr___0 = (struct list_head const *)avp->list.next; avp = (struct ath_vif *)__mptr___0; ldv_54136: ; if ((unsigned long )(& avp->list) != (unsigned long )(& ctx->vifs)) { goto ldv_54135; } else { } ctx->active = active; ctx = (struct ath_chanctx *)(& sc->chanctx); goto ldv_54142; ldv_54141: ; if (! ctx->assigned) { goto ldv_54140; } else { tmp___3 = list_empty((struct list_head const *)(& ctx->vifs)); if (tmp___3 != 0) { goto ldv_54140; } else { } } n_active = (u8 )((int )n_active + 1); ldv_54140: ctx = ctx + 1; ldv_54142: ; if ((unsigned long )((struct ath_chanctx *)(& sc->chanctx) + 1UL) >= (unsigned long )ctx) { goto ldv_54141; } else { } spin_lock_bh(& sc->chan_lock); if ((unsigned int )n_active <= 1U) { ictx->flush_timeout = 50; clear_bit(6L, (unsigned long volatile *)(& common->op_flags)); spin_unlock_bh(& sc->chan_lock); return; } else { } tmp___4 = usecs_to_jiffies(sc->sched.channel_switch_time); ictx->flush_timeout = (int )tmp___4; tmp___5 = test_and_set_bit(6L, (unsigned long volatile *)(& common->op_flags)); if (tmp___5 != 0) { spin_unlock_bh(& sc->chan_lock); return; } else { } spin_unlock_bh(& sc->chan_lock); tmp___6 = ath9k_is_chanctx_enabled(); if ((int )tmp___6) { ath_chanctx_event(sc, (struct ieee80211_vif *)0, 9); } else { } return; } } static struct ath_chanctx *ath_chanctx_get_next(struct ath_softc *sc , struct ath_chanctx *ctx ) { int idx ; { idx = (int )(((long )ctx - (long )(& sc->chanctx)) / 992L); return ((struct ath_chanctx *)(& sc->chanctx) + (idx == 0)); } } static void ath_chanctx_adjust_tbtt_delta(struct ath_softc *sc ) { struct ath_chanctx *prev ; struct ath_chanctx *cur ; struct timespec ts ; u32 cur_tsf ; u32 prev_tsf ; u32 beacon_int ; s32 offset ; u32 tmp ; u32 tmp___0 ; { beacon_int = (u32 )((sc->cur_chan)->beacon.beacon_interval << 10); cur = sc->cur_chan; prev = ath_chanctx_get_next(sc, cur); if (! prev->switch_after_beacon) { return; } else { } getrawmonotonic(& ts); tmp = ath9k_hw_get_tsf_offset(& cur->tsf_ts, & ts); cur_tsf = (unsigned int )cur->tsf_val + tmp; prev_tsf = (prev->last_beacon - (u32 )prev->tsf_val) + cur_tsf; tmp___0 = ath9k_hw_get_tsf_offset(& prev->tsf_ts, & ts); prev_tsf = prev_tsf - tmp___0; offset = (s32 )(cur_tsf - prev_tsf); if (offset < 0 || (u32 )offset > beacon_int * 3U) { return; } else { } offset = (s32 )(beacon_int / 2U - (u32 )offset % beacon_int); prev->tsf_val = prev->tsf_val + (u64 )offset; return; } } static void ath_chanctx_setup_timer(struct ath_softc *sc , u32 tsf_time ) { struct ath_common *common ; struct ath_common *tmp ; struct ath_hw *ah ; u32 tmp___0 ; unsigned long tmp___1 ; unsigned int tmp___2 ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; ah = sc->sc_ah; ath9k_hw_gen_timer_start(ah, sc->p2p_ps_timer, tsf_time, 1000000U); tmp___0 = ath9k_hw_gettsf32(ah); tsf_time = tsf_time - tmp___0; tmp___1 = msecs_to_jiffies(tsf_time / 1000U); tsf_time = (u32 )tmp___1 + 1U; ldv_mod_timer_168(& sc->sched.timer, (unsigned long )tsf_time + (unsigned long )jiffies); if ((common->debug_mask & 262144) != 0) { tmp___2 = jiffies_to_msecs((unsigned long const )tsf_time); ath_printk("\017", (struct ath_common const *)common, "Setup chanctx timer with timeout: %d ms\n", tmp___2); } else { } return; } } static void ath_chanctx_handle_bmiss(struct ath_softc *sc , struct ath_chanctx *ctx , struct ath_vif *avp ) { { if ((int )ctx->active && (int )sc->sched.extend_absence) { avp->noa_duration = 0U; sc->sched.extend_absence = 0; } else { } if ((int )ctx->active && (unsigned int )sc->sched.beacon_miss > 1U) { avp->noa_duration = 0U; sc->sched.extend_absence = 1; } else { } return; } } static void ath_chanctx_offchannel_noa(struct ath_softc *sc , struct ath_chanctx *ctx , struct ath_vif *avp , u32 tsf_time ) { struct ath_common *common ; struct ath_common *tmp ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; avp->noa_index = (u8 )((int )avp->noa_index + 1); avp->offchannel_start = tsf_time; avp->offchannel_duration = sc->sched.offchannel_duration; if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "offchannel noa_duration: %d, noa_start: %d, noa_index: %d\n", avp->offchannel_duration, avp->offchannel_start, (int )avp->noa_index); } else { } if ((int )ctx->active && avp->noa_duration != 0U) { avp->noa_duration = 0U; } else { } return; } } static void ath_chanctx_set_periodic_noa(struct ath_softc *sc , struct ath_vif *avp , struct ath_beacon_config *cur_conf , u32 tsf_time , u32 beacon_int ) { struct ath_common *common ; struct ath_common *tmp ; int tmp___0 ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; avp->noa_index = (u8 )((int )avp->noa_index + 1); avp->noa_start = tsf_time; if ((int )sc->sched.extend_absence) { avp->noa_duration = (beacon_int * 3U) / 2U + sc->sched.channel_switch_time; } else { avp->noa_duration = (unsigned int )((cur_conf->beacon_interval << 10) / 2) + sc->sched.channel_switch_time; } tmp___0 = constant_test_bit(5L, (unsigned long const volatile *)(& common->op_flags)); if (tmp___0 != 0 || (int )sc->sched.extend_absence) { avp->periodic_noa = 0; } else { avp->periodic_noa = 1; } if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "noa_duration: %d, noa_start: %d, noa_index: %d, periodic: %d\n", avp->noa_duration, avp->noa_start, (int )avp->noa_index, (int )avp->periodic_noa); } else { } return; } } static void ath_chanctx_set_oneshot_noa(struct ath_softc *sc , struct ath_vif *avp , u32 tsf_time , u32 duration ) { struct ath_common *common ; struct ath_common *tmp ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; avp->noa_index = (u8 )((int )avp->noa_index + 1); avp->noa_start = tsf_time; avp->periodic_noa = 0; avp->oneshot_noa = 1; avp->noa_duration = sc->sched.channel_switch_time + duration; if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "oneshot noa_duration: %d, noa_start: %d, noa_index: %d, periodic: %d\n", avp->noa_duration, avp->noa_start, (int )avp->noa_index, (int )avp->periodic_noa); } else { } return; } } void ath_chanctx_event(struct ath_softc *sc , struct ieee80211_vif *vif , enum ath_chanctx_event ev ) { struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; struct ath_beacon_config *cur_conf ; struct ath_vif *avp ; struct ath_chanctx *ctx ; u32 tsf_time ; u32 beacon_int ; char const *tmp___0 ; char const *tmp___1 ; unsigned int tmp___2 ; int tmp___3 ; u32 tmp___4 ; u32 tmp___5 ; int tmp___6 ; u32 tmp___7 ; { ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; avp = (struct ath_vif *)0; if ((unsigned long )vif != (unsigned long )((struct ieee80211_vif *)0)) { avp = (struct ath_vif *)(& vif->drv_priv); } else { } spin_lock_bh(& sc->chan_lock); if ((common->debug_mask & 262144) != 0) { tmp___0 = chanctx_state_string(sc->sched.state); tmp___1 = chanctx_event_string(ev); ath_printk("\017", (struct ath_common const *)common, "cur_chan: %d MHz, event: %s, state: %s\n", (sc->cur_chan)->chandef.center_freq1, tmp___1, tmp___0); } else { } switch ((unsigned int )ev) { case 0U: ; if (avp->offchannel_duration != 0U) { avp->offchannel_duration = 0U; } else { } if ((int )avp->oneshot_noa) { avp->noa_duration = 0U; avp->oneshot_noa = 0; if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "Clearing oneshot NoA\n"); } else { } } else { } if ((unsigned long )avp->chanctx != (unsigned long )sc->cur_chan) { if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "Contexts differ, not preparing beacon\n"); } else { } goto ldv_54205; } else { } if ((int )sc->sched.offchannel_pending && ! sc->sched.wait_switch) { sc->sched.offchannel_pending = 0; sc->next_chan = & sc->offchannel.chan; sc->sched.state = 1; if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "Setting offchannel_pending to false\n"); } else { } } else { } ctx = ath_chanctx_get_next(sc, sc->cur_chan); if ((int )ctx->active && (unsigned int )sc->sched.state == 0U) { sc->next_chan = ctx; sc->sched.state = 1; if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "Set next context, move chanctx state to WAIT_FOR_BEACON\n"); } else { } } else { } if ((unsigned int )sc->sched.state == 2U) { sc->sched.state = 1; if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "Move chanctx state from WAIT_FOR_TIMER to WAIT_FOR_BEACON\n"); } else { } } else { } if ((int )sc->sched.mgd_prepare_tx) { sc->sched.state = 1; } else { } if ((! ctx->active && avp->noa_duration != 0U) && (unsigned int )sc->sched.state != 1U) { avp->noa_duration = 0U; avp->periodic_noa = 0; if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "Clearing NoA schedule\n"); } else { } } else { } if ((unsigned int )sc->sched.state != 1U) { goto ldv_54205; } else { } if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "Preparing beacon for vif: %pM\n", (u8 *)(& vif->addr)); } else { } sc->sched.beacon_pending = 1; sc->sched.next_tbtt = (*(ah->reg_ops.read))((void *)ah, 33280U); cur_conf = & (sc->cur_chan)->beacon; beacon_int = (u32 )(cur_conf->beacon_interval << 10); tsf_time = sc->sched.next_tbtt + beacon_int / 4U; sc->sched.switch_start_time = tsf_time; (sc->cur_chan)->last_beacon = sc->sched.next_tbtt; if ((unsigned long )sc->next_chan == (unsigned long )(& sc->offchannel.chan)) { ath_chanctx_offchannel_noa(sc, ctx, avp, tsf_time); goto ldv_54205; } else { } ath_chanctx_handle_bmiss(sc, ctx, avp); if ((int )sc->sched.mgd_prepare_tx) { tmp___2 = jiffies_to_usecs(50UL); ath_chanctx_set_oneshot_noa(sc, avp, tsf_time, tmp___2); goto ldv_54205; } else { } if (avp->noa_duration != 0U && tsf_time - avp->noa_start > 1073741824U) { avp->noa_duration = 0U; } else { } if ((int )ctx->active && (avp->noa_duration == 0U || (int )sc->sched.force_noa_update)) { ath_chanctx_set_periodic_noa(sc, avp, cur_conf, tsf_time, beacon_int); } else { } if ((int )ctx->active && (int )sc->sched.force_noa_update) { sc->sched.force_noa_update = 0; } else { } goto ldv_54205; case 1U: ; if (! sc->sched.beacon_pending) { if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "No pending beacon\n"); } else { } goto ldv_54205; } else { } sc->sched.beacon_pending = 0; if ((int )sc->sched.mgd_prepare_tx) { sc->sched.mgd_prepare_tx = 0; complete(& sc->go_beacon); if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "Beacon sent, complete go_beacon\n"); } else { } goto ldv_54205; } else { } if ((unsigned int )sc->sched.state != 1U) { goto ldv_54205; } else { } if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "Move chanctx state to WAIT_FOR_TIMER\n"); } else { } sc->sched.state = 2; ath_chanctx_setup_timer(sc, sc->sched.switch_start_time); goto ldv_54205; case 2U: ; if ((unsigned int )sc->sched.state != 2U) { goto ldv_54205; } else { } if (! (sc->cur_chan)->switch_after_beacon && (int )sc->sched.beacon_pending) { sc->sched.beacon_miss = (u8 )((int )sc->sched.beacon_miss + 1); } else { } if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "Move chanctx state to SWITCH\n"); } else { } sc->sched.state = 3; ieee80211_queue_work(sc->hw, & sc->chanctx_work); goto ldv_54205; case 3U: tmp___3 = constant_test_bit(6L, (unsigned long const volatile *)(& common->op_flags)); if (tmp___3 == 0 || (unsigned long )sc->cur_chan == (unsigned long )(& sc->offchannel.chan)) { goto ldv_54205; } else { } sc->sched.beacon_pending = 0; sc->sched.beacon_miss = 0U; if (((unsigned int )sc->sched.state == 4U || ! sc->sched.beacon_adjust) || (sc->cur_chan)->tsf_val == 0ULL) { goto ldv_54205; } else { } ath_chanctx_adjust_tbtt_delta(sc); tsf_time = sc->sched.switch_start_time; tmp___4 = ath9k_hw_get_tsf_offset(& (sc->cur_chan)->tsf_ts, (struct timespec *)0); tsf_time = tsf_time - ((unsigned int )(sc->cur_chan)->tsf_val + tmp___4); tmp___5 = ath9k_hw_gettsf32(ah); tsf_time = tmp___5 + tsf_time; sc->sched.beacon_adjust = 0; ath_chanctx_setup_timer(sc, tsf_time); goto ldv_54205; case 4U: ; if ((unsigned int )sc->sched.state != 4U || (unsigned long )avp->chanctx != (unsigned long )sc->cur_chan) { goto ldv_54205; } else { } if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "Move chanctx state from FORCE_ACTIVE to IDLE\n"); } else { } sc->sched.state = 0; case 5U: tmp___6 = constant_test_bit(6L, (unsigned long const volatile *)(& common->op_flags)); if (((tmp___6 == 0 || (unsigned int )sc->sched.state == 4U) || (int )(sc->cur_chan)->switch_after_beacon) || (unsigned long )sc->cur_chan == (unsigned long )(& sc->offchannel.chan)) { goto ldv_54205; } else { } sc->next_chan = ath_chanctx_get_next(sc, sc->cur_chan); cur_conf = & (sc->cur_chan)->beacon; if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "Move chanctx state to WAIT_FOR_TIMER (event SWITCH)\n"); } else { } sc->sched.state = 2; sc->sched.wait_switch = 0; tsf_time = (u32 )((cur_conf->beacon_interval << 10) / 2); if ((int )sc->sched.extend_absence) { sc->sched.beacon_miss = 0U; tsf_time = tsf_time * 3U; } else { } tsf_time = tsf_time - sc->sched.channel_switch_time; tmp___7 = ath9k_hw_gettsf32(sc->sc_ah); tsf_time = tmp___7 + tsf_time; sc->sched.switch_start_time = tsf_time; ath_chanctx_setup_timer(sc, tsf_time); sc->sched.beacon_pending = 1; sc->sched.beacon_adjust = 1; goto ldv_54205; case 9U: ; if ((unsigned long )sc->cur_chan == (unsigned long )(& sc->offchannel.chan) || (int )(sc->cur_chan)->switch_after_beacon) { goto ldv_54205; } else { } sc->next_chan = ath_chanctx_get_next(sc, sc->cur_chan); ieee80211_queue_work(sc->hw, & sc->chanctx_work); goto ldv_54205; case 7U: ; if ((int )(sc->cur_chan)->assigned) { if (((unsigned long )sc->next_chan != (unsigned long )((struct ath_chanctx *)0) && ! (sc->next_chan)->assigned) && (unsigned long )sc->next_chan != (unsigned long )(& sc->offchannel.chan)) { sc->sched.state = 0; } else { } goto ldv_54205; } else { } ctx = ath_chanctx_get_next(sc, sc->cur_chan); sc->sched.state = 0; if (! ctx->assigned) { goto ldv_54205; } else { } sc->next_chan = ctx; ieee80211_queue_work(sc->hw, & sc->chanctx_work); goto ldv_54205; case 6U: ; goto ldv_54205; case 8U: ; goto ldv_54205; } ldv_54205: spin_unlock_bh(& sc->chan_lock); return; } } void ath_chanctx_beacon_sent_ev(struct ath_softc *sc , enum ath_chanctx_event ev ) { { if ((int )sc->sched.beacon_pending) { ath_chanctx_event(sc, (struct ieee80211_vif *)0, ev); } else { } return; } } void ath_chanctx_beacon_recv_ev(struct ath_softc *sc , enum ath_chanctx_event ev ) { { ath_chanctx_event(sc, (struct ieee80211_vif *)0, ev); return; } } static int ath_scan_channel_duration(struct ath_softc *sc , struct ieee80211_channel *chan ) { struct cfg80211_scan_request *req ; { req = sc->offchannel.scan_req; if (req->n_ssids == 0 || (chan->flags & 2U) != 0U) { return (27); } else { } return (15); } } static void ath_chanctx_switch(struct ath_softc *sc , struct ath_chanctx *ctx , struct cfg80211_chan_def *chandef ) { struct ath_common *common ; struct ath_common *tmp ; unsigned int tmp___0 ; int tmp___1 ; unsigned int tmp___2 ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; spin_lock_bh(& sc->chan_lock); tmp___1 = constant_test_bit(6L, (unsigned long const volatile *)(& common->op_flags)); if ((tmp___1 != 0 && (unsigned long )sc->cur_chan != (unsigned long )ctx) && (unsigned long )(& sc->offchannel.chan) == (unsigned long )ctx) { if ((unsigned long )chandef != (unsigned long )((struct cfg80211_chan_def *)0)) { ctx->chandef = *chandef; } else { } sc->sched.offchannel_pending = 1; sc->sched.wait_switch = 1; tmp___0 = jiffies_to_usecs((unsigned long const )sc->offchannel.duration); sc->sched.offchannel_duration = tmp___0 + sc->sched.channel_switch_time; spin_unlock_bh(& sc->chan_lock); if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "Set offchannel_pending to true\n"); } else { } return; } else { } sc->next_chan = ctx; if ((unsigned long )chandef != (unsigned long )((struct cfg80211_chan_def *)0)) { ctx->chandef = *chandef; if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "Assigned next_chan to %d MHz\n", chandef->center_freq1); } else { } } else { } if ((unsigned long )sc->next_chan == (unsigned long )(& sc->offchannel.chan)) { tmp___2 = jiffies_to_usecs((unsigned long const )sc->offchannel.duration); sc->sched.offchannel_duration = tmp___2 + sc->sched.channel_switch_time; if ((unsigned long )chandef != (unsigned long )((struct cfg80211_chan_def *)0)) { if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "Offchannel duration for chan %d MHz : %u\n", chandef->center_freq1, sc->sched.offchannel_duration); } else { } } else { } } else { } spin_unlock_bh(& sc->chan_lock); ieee80211_queue_work(sc->hw, & sc->chanctx_work); return; } } static void ath_chanctx_offchan_switch(struct ath_softc *sc , struct ieee80211_channel *chan ) { struct ath_common *common ; struct ath_common *tmp ; struct cfg80211_chan_def chandef ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; cfg80211_chandef_create(& chandef, chan, 0); if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "Channel definition created: %d MHz\n", chandef.center_freq1); } else { } ath_chanctx_switch(sc, & sc->offchannel.chan, & chandef); return; } } static struct ath_chanctx *ath_chanctx_get_oper_chan(struct ath_softc *sc , bool active ) { struct ath_chanctx *ctx ; int tmp ; { ctx = (struct ath_chanctx *)(& sc->chanctx); goto ldv_54249; ldv_54248: ; if (! ctx->assigned) { goto ldv_54247; } else { tmp = list_empty((struct list_head const *)(& ctx->vifs)); if (tmp != 0) { goto ldv_54247; } else { } } if ((int )active && ! ctx->active) { goto ldv_54247; } else { } if ((int )ctx->switch_after_beacon) { return (ctx); } else { } ldv_54247: ctx = ctx + 1; ldv_54249: ; if ((unsigned long )((struct ath_chanctx *)(& sc->chanctx) + 1UL) >= (unsigned long )ctx) { goto ldv_54248; } else { } return ((struct ath_chanctx *)(& sc->chanctx)); } } static void ath_scan_next_channel(struct ath_softc *sc ) { struct ath_common *common ; struct ath_common *tmp ; struct cfg80211_scan_request *req ; struct ieee80211_channel *chan ; struct ath_chanctx *tmp___0 ; int tmp___1 ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; req = sc->offchannel.scan_req; if ((u32 )sc->offchannel.scan_idx >= req->n_channels) { if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "Moving offchannel state to ATH_OFFCHANNEL_IDLE, scan_idx: %d, n_channels: %d\n", sc->offchannel.scan_idx, req->n_channels); } else { } sc->offchannel.state = 0; tmp___0 = ath_chanctx_get_oper_chan(sc, 0); ath_chanctx_switch(sc, tmp___0, (struct cfg80211_chan_def *)0); return; } else { } if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "Moving offchannel state to ATH_OFFCHANNEL_PROBE_SEND, scan_idx: %d\n", sc->offchannel.scan_idx); } else { } tmp___1 = sc->offchannel.scan_idx; sc->offchannel.scan_idx = sc->offchannel.scan_idx + 1; chan = req->channels[tmp___1]; sc->offchannel.duration = ath_scan_channel_duration(sc, chan); sc->offchannel.state = 1; ath_chanctx_offchan_switch(sc, chan); return; } } void ath_offchannel_next(struct ath_softc *sc ) { struct ieee80211_vif *vif ; unsigned long tmp ; struct ath_chanctx *tmp___0 ; { if ((unsigned long )sc->offchannel.scan_req != (unsigned long )((struct cfg80211_scan_request *)0)) { vif = sc->offchannel.scan_vif; sc->offchannel.chan.txpower = (u16 )vif->bss_conf.txpower; ath_scan_next_channel(sc); } else if ((unsigned long )sc->offchannel.roc_vif != (unsigned long )((struct ieee80211_vif *)0)) { vif = sc->offchannel.roc_vif; sc->offchannel.chan.txpower = (u16 )vif->bss_conf.txpower; tmp = msecs_to_jiffies((unsigned int const )sc->offchannel.roc_duration); sc->offchannel.duration = (int )tmp; sc->offchannel.state = 4; ath_chanctx_offchan_switch(sc, sc->offchannel.roc_chan); } else { spin_lock_bh(& sc->chan_lock); sc->sched.offchannel_pending = 0; sc->sched.wait_switch = 0; spin_unlock_bh(& sc->chan_lock); tmp___0 = ath_chanctx_get_oper_chan(sc, 0); ath_chanctx_switch(sc, tmp___0, (struct cfg80211_chan_def *)0); sc->offchannel.state = 0; if ((int )sc->ps_idle) { ath_cancel_work(sc); } else { } } return; } } void ath_roc_complete(struct ath_softc *sc , bool abort ) { struct ath_common *common ; struct ath_common *tmp ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; if ((int )abort) { if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "RoC aborted\n"); } else { } } else if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "RoC expired\n"); } else { } sc->offchannel.roc_vif = (struct ieee80211_vif *)0; sc->offchannel.roc_chan = (struct ieee80211_channel *)0; ieee80211_remain_on_channel_expired(sc->hw); ath_offchannel_next(sc); ath9k_ps_restore(sc); return; } } void ath_scan_complete(struct ath_softc *sc , bool abort ) { struct ath_common *common ; struct ath_common *tmp ; int tmp___0 ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; if ((int )abort) { if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "HW scan aborted\n"); } else { } } else if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "HW scan complete\n"); } else { } sc->offchannel.scan_req = (struct cfg80211_scan_request *)0; sc->offchannel.scan_vif = (struct ieee80211_vif *)0; sc->offchannel.state = 0; ieee80211_scan_completed(sc->hw, (int )abort); clear_bit(5L, (unsigned long volatile *)(& common->op_flags)); spin_lock_bh(& sc->chan_lock); tmp___0 = constant_test_bit(6L, (unsigned long const volatile *)(& common->op_flags)); if (tmp___0 != 0) { sc->sched.force_noa_update = 1; } else { } spin_unlock_bh(& sc->chan_lock); ath_offchannel_next(sc); ath9k_ps_restore(sc); return; } } static void ath_scan_send_probe(struct ath_softc *sc , struct cfg80211_ssid *ssid ) { struct cfg80211_scan_request *req ; struct ieee80211_vif *vif ; struct ath_tx_control txctl ; struct sk_buff *skb ; struct ieee80211_tx_info *info ; int band ; unsigned char *tmp ; bool tmp___0 ; int tmp___1 ; int tmp___2 ; { req = sc->offchannel.scan_req; vif = sc->offchannel.scan_vif; txctl.txq = 0; txctl.an = 0; txctl.sta = 0; txctl.paprd = (unsigned char)0; txctl.force_channel = (_Bool)0; band = (int )(sc->offchannel.chan.chandef.chan)->band; skb = ieee80211_probereq_get(sc->hw, (u8 const *)(& vif->addr), (u8 const *)(& ssid->ssid), (size_t )ssid->ssid_len, req->ie_len); if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { return; } else { } info = IEEE80211_SKB_CB(skb); if ((int )req->no_cck) { info->flags = info->flags | 134217728U; } else { } if (req->ie_len != 0UL) { tmp = skb_put(skb, (unsigned int )req->ie_len); memcpy((void *)tmp, (void const *)req->ie, req->ie_len); } else { } skb_set_queue_mapping(skb, 0); tmp___0 = ieee80211_tx_prepare_skb(sc->hw, vif, skb, band, (struct ieee80211_sta **)0); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { goto error; } else { } txctl.txq = sc->tx.txq_map[0]; txctl.force_channel = 1; tmp___2 = ath_tx_start(sc->hw, skb, & txctl); if (tmp___2 != 0) { goto error; } else { } return; error: ieee80211_free_txskb(sc->hw, skb); return; } } static void ath_scan_channel_start(struct ath_softc *sc ) { struct ath_common *common ; struct ath_common *tmp ; struct cfg80211_scan_request *req ; int i ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; req = sc->offchannel.scan_req; if ((((sc->cur_chan)->chandef.chan)->flags & 2U) == 0U && req->n_ssids != 0) { i = 0; goto ldv_54289; ldv_54288: ath_scan_send_probe(sc, req->ssids + (unsigned long )i); i = i + 1; ldv_54289: ; if (req->n_ssids > i) { goto ldv_54288; } else { } } else { } if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "Moving offchannel state to ATH_OFFCHANNEL_PROBE_WAIT\n"); } else { } sc->offchannel.state = 2; ldv_mod_timer_169(& sc->offchannel.timer, (unsigned long )sc->offchannel.duration + (unsigned long )jiffies); return; } } static void ath_chanctx_timer(unsigned long data ) { struct ath_softc *sc ; struct ath_common *common ; struct ath_common *tmp ; { sc = (struct ath_softc *)data; tmp = ath9k_hw_common(sc->sc_ah); common = tmp; if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "Channel context timer invoked\n"); } else { } ath_chanctx_event(sc, (struct ieee80211_vif *)0, 2); return; } } static void ath_offchannel_timer(unsigned long data ) { struct ath_softc *sc ; struct ath_chanctx *ctx ; struct ath_common *common ; struct ath_common *tmp ; char const *tmp___0 ; { sc = (struct ath_softc *)data; tmp = ath9k_hw_common(sc->sc_ah); common = tmp; if ((common->debug_mask & 262144) != 0) { tmp___0 = offchannel_state_string(sc->offchannel.state); ath_printk("\017", (struct ath_common const *)common, "%s: offchannel state: %s\n", "ath_offchannel_timer", tmp___0); } else { } switch ((unsigned int )sc->offchannel.state) { case 2U: ; if ((unsigned long )sc->offchannel.scan_req == (unsigned long )((struct cfg80211_scan_request *)0)) { return; } else { } ctx = ath_chanctx_get_oper_chan(sc, 1); if ((int )ctx->active) { if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "Switch to oper/active context, move offchannel state to ATH_OFFCHANNEL_SUSPEND\n"); } else { } sc->offchannel.state = 3; ath_chanctx_switch(sc, ctx, (struct cfg80211_chan_def *)0); ldv_mod_timer_170(& sc->offchannel.timer, (unsigned long )jiffies + 25UL); goto ldv_54304; } else { } case 3U: ; if ((unsigned long )sc->offchannel.scan_req == (unsigned long )((struct cfg80211_scan_request *)0)) { return; } else { } ath_scan_next_channel(sc); goto ldv_54304; case 4U: ; case 5U: sc->offchannel.state = 6; ath_roc_complete(sc, 0); goto ldv_54304; default: ; goto ldv_54304; } ldv_54304: ; return; } } static bool ath_chanctx_send_vif_ps_frame(struct ath_softc *sc , struct ath_vif *avp , bool powersave ) { struct ieee80211_vif *vif ; struct ieee80211_sta *sta ; struct ieee80211_hdr_3addr *nullfunc ; struct ath_tx_control txctl ; struct sk_buff *skb ; int band ; bool tmp ; int tmp___0 ; int tmp___1 ; { vif = avp->vif; sta = (struct ieee80211_sta *)0; band = (int )((sc->cur_chan)->chandef.chan)->band; switch ((unsigned int )vif->type) { case 2U: ; if (! avp->assoc) { return (0); } else { } skb = ieee80211_nullfunc_get(sc->hw, vif); if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { return (0); } else { } nullfunc = (struct ieee80211_hdr_3addr *)skb->data; if ((int )powersave) { nullfunc->frame_control = (__le16 )((unsigned int )nullfunc->frame_control | 4096U); } else { } skb_set_queue_mapping(skb, 0); tmp = ieee80211_tx_prepare_skb(sc->hw, vif, skb, band, & sta); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { dev_kfree_skb_any(skb); return (0); } else { } goto ldv_54321; default: ; return (0); } ldv_54321: memset((void *)(& txctl), 0, 32UL); txctl.txq = sc->tx.txq_map[0]; txctl.sta = sta; txctl.force_channel = 1; tmp___1 = ath_tx_start(sc->hw, skb, & txctl); if (tmp___1 != 0) { ieee80211_free_txskb(sc->hw, skb); return (0); } else { } return (1); } } static bool ath_chanctx_send_ps_frame(struct ath_softc *sc , bool powersave ) { struct ath_vif *avp ; bool sent ; struct list_head const *__mptr ; bool tmp ; struct list_head const *__mptr___0 ; { sent = 0; rcu_read_lock(); __mptr = (struct list_head const *)(sc->cur_chan)->vifs.next; avp = (struct ath_vif *)__mptr; goto ldv_54334; ldv_54333: tmp = ath_chanctx_send_vif_ps_frame(sc, avp, (int )powersave); if ((int )tmp) { sent = 1; } else { } __mptr___0 = (struct list_head const *)avp->list.next; avp = (struct ath_vif *)__mptr___0; ldv_54334: ; if ((unsigned long )(& avp->list) != (unsigned long )(& (sc->cur_chan)->vifs)) { goto ldv_54333; } else { } rcu_read_unlock(); return (sent); } } static bool ath_chanctx_defer_switch(struct ath_softc *sc ) { struct ath_common *common ; struct ath_common *tmp ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; if ((unsigned long )sc->cur_chan == (unsigned long )(& sc->offchannel.chan)) { return (0); } else { } switch ((unsigned int )sc->sched.state) { case 3U: ; return (0); case 0U: ; if (! (sc->cur_chan)->switch_after_beacon) { return (0); } else { } if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "Defer switch, set chanctx state to WAIT_FOR_BEACON\n"); } else { } sc->sched.state = 1; goto ldv_54342; default: ; goto ldv_54342; } ldv_54342: ; return (1); } } static void ath_offchannel_channel_change(struct ath_softc *sc ) { struct ath_common *common ; struct ath_common *tmp ; char const *tmp___0 ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; if ((common->debug_mask & 262144) != 0) { tmp___0 = offchannel_state_string(sc->offchannel.state); ath_printk("\017", (struct ath_common const *)common, "%s: offchannel state: %s\n", "ath_offchannel_channel_change", tmp___0); } else { } switch ((unsigned int )sc->offchannel.state) { case 1U: ; if ((unsigned long )sc->offchannel.scan_req == (unsigned long )((struct cfg80211_scan_request *)0)) { return; } else { } if ((unsigned long )(sc->cur_chan)->chandef.chan != (unsigned long )sc->offchannel.chan.chandef.chan) { return; } else { } ath_scan_channel_start(sc); goto ldv_54350; case 0U: ; if ((unsigned long )sc->offchannel.scan_req == (unsigned long )((struct cfg80211_scan_request *)0)) { return; } else { } ath_scan_complete(sc, 0); goto ldv_54350; case 4U: ; if ((unsigned long )sc->cur_chan != (unsigned long )(& sc->offchannel.chan)) { goto ldv_54350; } else { } sc->offchannel.state = 5; ldv_mod_timer_171(& sc->offchannel.timer, (unsigned long )sc->offchannel.duration + (unsigned long )jiffies); ieee80211_ready_on_channel(sc->hw); goto ldv_54350; case 6U: ; goto ldv_54350; default: ; goto ldv_54350; } ldv_54350: ; return; } } void ath_chanctx_set_next(struct ath_softc *sc , bool force ) { struct ath_common *common ; struct ath_common *tmp ; struct ath_chanctx *old_ctx ; struct timespec ts ; bool measure_time ; bool send_ps ; bool queues_stopped ; bool tmp___0 ; bool tmp___1 ; int tmp___2 ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; measure_time = 0; send_ps = 0; queues_stopped = 0; spin_lock_bh(& sc->chan_lock); if ((unsigned long )sc->next_chan == (unsigned long )((struct ath_chanctx *)0)) { spin_unlock_bh(& sc->chan_lock); return; } else { } if (! force) { tmp___0 = ath_chanctx_defer_switch(sc); if ((int )tmp___0) { spin_unlock_bh(& sc->chan_lock); return; } else { } } else { } if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "%s: current: %d MHz, next: %d MHz\n", "ath_chanctx_set_next", (sc->cur_chan)->chandef.center_freq1, (sc->next_chan)->chandef.center_freq1); } else { } if ((unsigned long )sc->cur_chan != (unsigned long )sc->next_chan) { if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "Stopping current chanctx: %d\n", (sc->cur_chan)->chandef.center_freq1); } else { } (sc->cur_chan)->stopped = 1; spin_unlock_bh(& sc->chan_lock); if ((unsigned long )sc->next_chan == (unsigned long )(& sc->offchannel.chan)) { getrawmonotonic(& ts); measure_time = 1; } else { } ath9k_chanctx_stop_queues(sc, sc->cur_chan); queues_stopped = 1; __ath9k_flush(sc->hw, 4294967295U, 1, 0, 0); tmp___1 = ath_chanctx_send_ps_frame(sc, 1); if ((int )tmp___1) { __ath9k_flush(sc->hw, 1U, 0, 0, 0); } else { } send_ps = 1; spin_lock_bh(& sc->chan_lock); if ((unsigned long )sc->cur_chan != (unsigned long )(& sc->offchannel.chan)) { getrawmonotonic(& (sc->cur_chan)->tsf_ts); (sc->cur_chan)->tsf_val = ath9k_hw_gettsf64(sc->sc_ah); } else { } } else { } old_ctx = sc->cur_chan; sc->cur_chan = sc->next_chan; (sc->cur_chan)->stopped = 0; sc->next_chan = (struct ath_chanctx *)0; if (! sc->sched.offchannel_pending) { sc->sched.offchannel_duration = 0U; } else { } if ((unsigned int )sc->sched.state != 4U) { sc->sched.state = 0; } else { } spin_unlock_bh(& sc->chan_lock); if ((int )(sc->sc_ah)->chip_fullsleep) { goto _L; } else { tmp___2 = memcmp((void const *)(& sc->cur_chandef), (void const *)(& (sc->cur_chan)->chandef), 24UL); if (tmp___2 != 0) { _L: /* CIL Label */ if ((common->debug_mask & 262144) != 0) { ath_printk("\017", (struct ath_common const *)common, "%s: Set channel %d MHz\n", "ath_chanctx_set_next", (sc->cur_chan)->chandef.center_freq1); } else { } ath_set_channel(sc); if ((int )measure_time) { sc->sched.channel_switch_time = ath9k_hw_get_tsf_offset(& ts, (struct timespec *)0); } else { } goto out; } else { } } if ((int )queues_stopped) { ath9k_chanctx_wake_queues(sc, old_ctx); } else { } out: ; if ((int )send_ps) { ath_chanctx_send_ps_frame(sc, 0); } else { } ath_offchannel_channel_change(sc); ath_chanctx_event(sc, (struct ieee80211_vif *)0, 5); return; } } static void ath_chanctx_work(struct work_struct *work ) { struct ath_softc *sc ; struct work_struct const *__mptr ; { __mptr = (struct work_struct const *)work; sc = (struct ath_softc *)__mptr + 0xfffffffffffff330UL; mutex_lock_nested(& sc->mutex, 0U); ath_chanctx_set_next(sc, 0); mutex_unlock(& sc->mutex); return; } } void ath9k_offchannel_init(struct ath_softc *sc ) { struct ath_chanctx *ctx ; struct ath_common *common ; struct ath_common *tmp ; struct ieee80211_supported_band *sband ; struct ieee80211_channel *chan ; int i ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; sband = (struct ieee80211_supported_band *)(& common->sbands); if (sband->n_channels == 0) { sband = (struct ieee80211_supported_band *)(& common->sbands) + 1UL; } else { } chan = sband->channels; ctx = & sc->offchannel.chan; INIT_LIST_HEAD(& ctx->vifs); ctx->txpower = 100U; cfg80211_chandef_create(& ctx->chandef, chan, 1); i = 0; goto ldv_54384; ldv_54383: INIT_LIST_HEAD((struct list_head *)(& ctx->acq) + (unsigned long )i); i = i + 1; ldv_54384: ; if ((unsigned int )i <= 3U) { goto ldv_54383; } else { } sc->offchannel.chan.offchannel = 1; return; } } void ath9k_init_channel_context(struct ath_softc *sc ) { struct lock_class_key __key ; atomic_long_t __constr_expr_0 ; { __init_work(& sc->chanctx_work, 0); __constr_expr_0.counter = 137438953408L; sc->chanctx_work.data = __constr_expr_0; lockdep_init_map(& sc->chanctx_work.lockdep_map, "(&sc->chanctx_work)", & __key, 0); INIT_LIST_HEAD(& sc->chanctx_work.entry); sc->chanctx_work.func = & ath_chanctx_work; reg_timer_14(& sc->offchannel.timer, & ath_offchannel_timer, (unsigned long )sc); reg_timer_14(& sc->sched.timer, & ath_chanctx_timer, (unsigned long )sc); init_completion(& sc->go_beacon); return; } } void ath9k_deinit_channel_context(struct ath_softc *sc ) { { ldv_cancel_work_sync_172(& sc->chanctx_work); return; } } bool ath9k_is_chanctx_enabled(void) { { return (ath9k_use_chanctx == 1); } } void ath9k_chanctx_stop_queues(struct ath_softc *sc , struct ath_chanctx *ctx ) { struct ath_hw *ah ; int i ; { ah = sc->sc_ah; if ((unsigned long )(& sc->offchannel.chan) == (unsigned long )ctx) { ieee80211_stop_queue(sc->hw, (int )(sc->hw)->offchannel_tx_hw_queue); } else { i = 0; goto ldv_54404; ldv_54403: ieee80211_stop_queue(sc->hw, ctx->hw_queue_base + i); i = i + 1; ldv_54404: ; if (i <= 3) { goto ldv_54403; } else { } } if ((unsigned int )ah->opmode == 3U) { ieee80211_stop_queue(sc->hw, (int )(sc->hw)->queues + -2); } else { } return; } } void ath9k_chanctx_wake_queues(struct ath_softc *sc , struct ath_chanctx *ctx ) { struct ath_hw *ah ; int i ; { ah = sc->sc_ah; if ((unsigned long )(& sc->offchannel.chan) == (unsigned long )ctx) { ieee80211_wake_queue(sc->hw, (int )(sc->hw)->offchannel_tx_hw_queue); } else { i = 0; goto ldv_54413; ldv_54412: ieee80211_wake_queue(sc->hw, ctx->hw_queue_base + i); i = i + 1; ldv_54413: ; if (i <= 3) { goto ldv_54412; } else { } } if ((unsigned int )ah->opmode == 3U) { ieee80211_wake_queue(sc->hw, (int )(sc->hw)->queues + -2); } else { } return; } } static void ath9k_update_p2p_ps_timer(struct ath_softc *sc , struct ath_vif *avp ) { struct ath_hw *ah ; s32 tsf ; s32 target_tsf ; u32 tmp ; { ah = sc->sc_ah; if ((unsigned long )avp == (unsigned long )((struct ath_vif *)0) || ! avp->noa.has_next_tsf) { return; } else { } ath9k_hw_gen_timer_stop(ah, sc->p2p_ps_timer); tmp = ath9k_hw_gettsf32(sc->sc_ah); tsf = (s32 )tmp; target_tsf = (s32 )avp->noa.next_tsf; if ((unsigned int )avp->noa.absent == 0U) { target_tsf = target_tsf + -1000; } else { } if (target_tsf - tsf <= 999) { target_tsf = tsf + 1000; } else { } ath9k_hw_gen_timer_start(ah, sc->p2p_ps_timer, (unsigned int )target_tsf, 1000000U); return; } } static void ath9k_update_p2p_ps(struct ath_softc *sc , struct ieee80211_vif *vif ) { struct ath_vif *avp ; u32 tsf ; { avp = (struct ath_vif *)(& vif->drv_priv); if ((unsigned long )sc->p2p_ps_timer == (unsigned long )((struct ath_gen_timer *)0)) { return; } else { } if ((unsigned int )vif->type != 2U || ! vif->p2p) { return; } else { } sc->p2p_ps_vif = avp; tsf = ath9k_hw_gettsf32(sc->sc_ah); ieee80211_parse_p2p_noa((struct ieee80211_p2p_noa_attr const *)(& vif->bss_conf.p2p_noa_attr), & avp->noa, tsf); ath9k_update_p2p_ps_timer(sc, avp); return; } } static u8 ath9k_get_ctwin(struct ath_softc *sc , struct ath_vif *avp ) { struct ath_beacon_config *cur_conf ; u8 switch_time ; u8 ctwin ; { cur_conf = & (sc->cur_chan)->beacon; switch_time = (u8 )(cur_conf->beacon_interval / 4); ctwin = (avp->vif)->bss_conf.p2p_noa_attr.oppps_ctwindow; if ((unsigned int )ctwin != 0U && (int )ctwin < (int )switch_time) { return (ctwin); } else { } if ((unsigned int )switch_time <= 9U) { return (0U); } else { } return (10U); } } void ath9k_beacon_add_noa(struct ath_softc *sc , struct ath_vif *avp , struct sk_buff *skb ) { u8 noa_ie_hdr[9U] ; struct ieee80211_p2p_noa_attr *noa ; int noa_len ; int noa_desc ; int i ; u8 *hdr ; unsigned char *tmp ; unsigned char *tmp___0 ; u32 interval ; { noa_ie_hdr[0] = 221U; noa_ie_hdr[1] = 0U; noa_ie_hdr[2] = 80U; noa_ie_hdr[3] = 111U; noa_ie_hdr[4] = 154U; noa_ie_hdr[5] = 9U; noa_ie_hdr[6] = 12U; noa_ie_hdr[7] = 0U; noa_ie_hdr[8] = 0U; i = 0; if (avp->offchannel_duration == 0U && avp->noa_duration == 0U) { return; } else { } noa_desc = (avp->offchannel_duration != 0U) + (avp->noa_duration != 0U); noa_len = (int )((unsigned int )((unsigned long )noa_desc) * 13U + 2U); tmp = skb_put(skb, 9U); hdr = tmp; memcpy((void *)hdr, (void const *)(& noa_ie_hdr), 9UL); *(hdr + 1UL) = (unsigned int )((u8 )noa_len) + 7U; *(hdr + 7UL) = (u8 )noa_len; tmp___0 = skb_put(skb, (unsigned int )noa_len); noa = (struct ieee80211_p2p_noa_attr *)tmp___0; memset((void *)noa, 0, (size_t )noa_len); noa->index = avp->noa_index; noa->oppps_ctwindow = ath9k_get_ctwin(sc, avp); if (avp->noa_duration != 0U) { if ((int )avp->periodic_noa) { interval = (u32 )((sc->cur_chan)->beacon.beacon_interval << 10); noa->desc[i].count = 255U; noa->desc[i].interval = interval; } else { noa->desc[i].count = 1U; } noa->desc[i].start_time = avp->noa_start; noa->desc[i].duration = avp->noa_duration; i = i + 1; } else { } if (avp->offchannel_duration != 0U) { noa->desc[i].count = 1U; noa->desc[i].start_time = avp->offchannel_start; noa->desc[i].duration = avp->offchannel_duration; } else { } return; } } void ath9k_p2p_ps_timer(void *priv ) { struct ath_softc *sc ; struct ath_vif *avp ; struct ieee80211_vif *vif ; struct ieee80211_sta *sta ; struct ath_node *an ; u32 tsf ; { sc = (struct ath_softc *)priv; avp = sc->p2p_ps_vif; ldv_del_timer_sync_173(& sc->sched.timer); ath9k_hw_gen_timer_stop(sc->sc_ah, sc->p2p_ps_timer); ath_chanctx_event(sc, (struct ieee80211_vif *)0, 2); if ((unsigned long )avp == (unsigned long )((struct ath_vif *)0) || (unsigned long )avp->chanctx != (unsigned long )sc->cur_chan) { return; } else { } tsf = ath9k_hw_gettsf32(sc->sc_ah); if ((unsigned int )avp->noa.absent == 0U) { tsf = tsf + 1000U; } else { } if (! avp->noa.has_next_tsf || avp->noa.next_tsf - tsf > 2147483648U) { ieee80211_update_p2p_noa(& avp->noa, tsf); } else { } ath9k_update_p2p_ps_timer(sc, avp); rcu_read_lock(); vif = avp->vif; sta = ieee80211_find_sta(vif, (u8 const *)(& avp->bssid)); if ((unsigned long )sta == (unsigned long )((struct ieee80211_sta *)0)) { goto out; } else { } an = (struct ath_node *)(& sta->drv_priv); if ((int )an->sleeping == ((unsigned int )avp->noa.absent != 0U)) { goto out; } else { } an->sleeping = (unsigned int )avp->noa.absent != 0U; if ((int )an->sleeping) { ath_tx_aggr_sleep(sta, sc, an); } else { ath_tx_aggr_wakeup(sc, an); } out: rcu_read_unlock(); return; } } void ath9k_p2p_bss_info_changed(struct ath_softc *sc , struct ieee80211_vif *vif ) { unsigned long flags ; raw_spinlock_t *tmp ; { spin_lock_bh(& sc->sc_pcu_lock); tmp = spinlock_check(& sc->sc_pm_lock); flags = _raw_spin_lock_irqsave(tmp); if (((unsigned long )sc->ps_flags & 16UL) == 0UL) { ath9k_update_p2p_ps(sc, vif); } else { } spin_unlock_irqrestore(& sc->sc_pm_lock, flags); spin_unlock_bh(& sc->sc_pcu_lock); return; } } void ath9k_p2p_beacon_sync(struct ath_softc *sc ) { { if ((unsigned long )sc->p2p_ps_vif != (unsigned long )((struct ath_vif *)0)) { ath9k_update_p2p_ps(sc, (sc->p2p_ps_vif)->vif); } else { } return; } } void ath9k_p2p_remove_vif(struct ath_softc *sc , struct ieee80211_vif *vif ) { struct ath_vif *avp ; { avp = (struct ath_vif *)(& vif->drv_priv); spin_lock_bh(& sc->sc_pcu_lock); if ((unsigned long )sc->p2p_ps_vif == (unsigned long )avp) { sc->p2p_ps_vif = (struct ath_vif *)0; ath9k_update_p2p_ps_timer(sc, (struct ath_vif *)0); } else { } spin_unlock_bh(& sc->sc_pcu_lock); return; } } int ath9k_init_p2p(struct ath_softc *sc ) { { sc->p2p_ps_timer = ath_gen_timer_alloc(sc->sc_ah, & ath9k_p2p_ps_timer, (void (*)(void * ))0, (void *)sc, 7); if ((unsigned long )sc->p2p_ps_timer == (unsigned long )((struct ath_gen_timer *)0)) { return (-12); } else { } return (0); } } void ath9k_deinit_p2p(struct ath_softc *sc ) { { if ((unsigned long )sc->p2p_ps_timer != (unsigned long )((struct ath_gen_timer *)0)) { ath_gen_timer_free(sc->sc_ah, sc->p2p_ps_timer); } else { } return; } } void choose_timer_13(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_timer_13_0 == 1) { ldv_timer_13_0 = 2; ldv_timer_13(ldv_timer_13_0, ldv_timer_list_13_0); } else { } goto ldv_54483; case 1: ; if (ldv_timer_13_1 == 1) { ldv_timer_13_1 = 2; ldv_timer_13(ldv_timer_13_1, ldv_timer_list_13_1); } else { } goto ldv_54483; case 2: ; if (ldv_timer_13_2 == 1) { ldv_timer_13_2 = 2; ldv_timer_13(ldv_timer_13_2, ldv_timer_list_13_2); } else { } goto ldv_54483; case 3: ; if (ldv_timer_13_3 == 1) { ldv_timer_13_3 = 2; ldv_timer_13(ldv_timer_13_3, ldv_timer_list_13_3); } else { } goto ldv_54483; default: ldv_stop(); } ldv_54483: ; 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 activate_pending_timer_13(struct timer_list *timer , unsigned long data , int pending_flag ) { { if ((unsigned long )ldv_timer_list_13_0 == (unsigned long )timer) { if (ldv_timer_13_0 == 2 || pending_flag != 0) { ldv_timer_list_13_0 = timer; ldv_timer_list_13_0->data = data; ldv_timer_13_0 = 1; } else { } return; } else { } if ((unsigned long )ldv_timer_list_13_1 == (unsigned long )timer) { if (ldv_timer_13_1 == 2 || pending_flag != 0) { ldv_timer_list_13_1 = timer; ldv_timer_list_13_1->data = data; ldv_timer_13_1 = 1; } else { } return; } else { } if ((unsigned long )ldv_timer_list_13_2 == (unsigned long )timer) { if (ldv_timer_13_2 == 2 || pending_flag != 0) { ldv_timer_list_13_2 = timer; ldv_timer_list_13_2->data = data; ldv_timer_13_2 = 1; } else { } return; } else { } if ((unsigned long )ldv_timer_list_13_3 == (unsigned long )timer) { if (ldv_timer_13_3 == 2 || pending_flag != 0) { ldv_timer_list_13_3 = timer; ldv_timer_list_13_3->data = data; ldv_timer_13_3 = 1; } else { } return; } else { } activate_suitable_timer_13(timer, data); 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) { ath_chanctx_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) { ath_chanctx_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) { ath_chanctx_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) { ath_chanctx_work(work); ldv_work_7_3 = 1; return; } else { } return; } } void ldv_timer_14(int state , struct timer_list *timer ) { { LDV_IN_INTERRUPT = 2; ath_chanctx_timer(timer->data); LDV_IN_INTERRUPT = 1; return; } } void activate_pending_timer_14(struct timer_list *timer , unsigned long data , int pending_flag ) { { if ((unsigned long )ldv_timer_list_14_0 == (unsigned long )timer) { if (ldv_timer_14_0 == 2 || pending_flag != 0) { ldv_timer_list_14_0 = timer; ldv_timer_list_14_0->data = data; ldv_timer_14_0 = 1; } else { } return; } else { } if ((unsigned long )ldv_timer_list_14_1 == (unsigned long )timer) { if (ldv_timer_14_1 == 2 || pending_flag != 0) { ldv_timer_list_14_1 = timer; ldv_timer_list_14_1->data = data; ldv_timer_14_1 = 1; } else { } return; } else { } if ((unsigned long )ldv_timer_list_14_2 == (unsigned long )timer) { if (ldv_timer_14_2 == 2 || pending_flag != 0) { ldv_timer_list_14_2 = timer; ldv_timer_list_14_2->data = data; ldv_timer_14_2 = 1; } else { } return; } else { } if ((unsigned long )ldv_timer_list_14_3 == (unsigned long )timer) { if (ldv_timer_14_3 == 2 || pending_flag != 0) { ldv_timer_list_14_3 = timer; ldv_timer_list_14_3->data = data; ldv_timer_14_3 = 1; } else { } return; } else { } activate_suitable_timer_14(timer, data); 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 activate_suitable_timer_13(struct timer_list *timer , unsigned long data ) { { if (ldv_timer_13_0 == 0 || ldv_timer_13_0 == 2) { ldv_timer_list_13_0 = timer; ldv_timer_list_13_0->data = data; ldv_timer_13_0 = 1; return; } else { } if (ldv_timer_13_1 == 0 || ldv_timer_13_1 == 2) { ldv_timer_list_13_1 = timer; ldv_timer_list_13_1->data = data; ldv_timer_13_1 = 1; return; } else { } if (ldv_timer_13_2 == 0 || ldv_timer_13_2 == 2) { ldv_timer_list_13_2 = timer; ldv_timer_list_13_2->data = data; ldv_timer_13_2 = 1; return; } else { } if (ldv_timer_13_3 == 0 || ldv_timer_13_3 == 2) { ldv_timer_list_13_3 = timer; ldv_timer_list_13_3->data = data; ldv_timer_13_3 = 1; return; } else { } return; } } void ldv_timer_13(int state , struct timer_list *timer ) { { LDV_IN_INTERRUPT = 2; ath_offchannel_timer(timer->data); LDV_IN_INTERRUPT = 1; return; } } void disable_suitable_timer_13(struct timer_list *timer ) { { if (ldv_timer_13_0 != 0 && (unsigned long )timer == (unsigned long )ldv_timer_list_13_0) { ldv_timer_13_0 = 0; return; } else { } if (ldv_timer_13_1 != 0 && (unsigned long )timer == (unsigned long )ldv_timer_list_13_1) { ldv_timer_13_1 = 0; return; } else { } if (ldv_timer_13_2 != 0 && (unsigned long )timer == (unsigned long )ldv_timer_list_13_2) { ldv_timer_13_2 = 0; return; } else { } if (ldv_timer_13_3 != 0 && (unsigned long )timer == (unsigned long )ldv_timer_list_13_3) { ldv_timer_13_3 = 0; return; } 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; ath_chanctx_work(ldv_work_struct_7_0); ldv_work_7_0 = 1; } else { } goto ldv_54533; case 1: ; if (ldv_work_7_1 == 2 || ldv_work_7_1 == 3) { ldv_work_7_1 = 4; ath_chanctx_work(ldv_work_struct_7_0); ldv_work_7_1 = 1; } else { } goto ldv_54533; case 2: ; if (ldv_work_7_2 == 2 || ldv_work_7_2 == 3) { ldv_work_7_2 = 4; ath_chanctx_work(ldv_work_struct_7_0); ldv_work_7_2 = 1; } else { } goto ldv_54533; case 3: ; if (ldv_work_7_3 == 2 || ldv_work_7_3 == 3) { ldv_work_7_3 = 4; ath_chanctx_work(ldv_work_struct_7_0); ldv_work_7_3 = 1; } else { } goto ldv_54533; default: ldv_stop(); } ldv_54533: ; return; } } void timer_init_13(void) { { ldv_timer_13_0 = 0; ldv_timer_13_1 = 0; ldv_timer_13_2 = 0; ldv_timer_13_3 = 0; return; } } int reg_timer_14(struct timer_list *timer , void (*function)(unsigned long ) , unsigned long data ) { { if ((unsigned long )function == (unsigned long )(& ath_chanctx_timer)) { activate_suitable_timer_14(timer, data); } else { } return (0); } } void disable_suitable_timer_14(struct timer_list *timer ) { { if (ldv_timer_14_0 != 0 && (unsigned long )timer == (unsigned long )ldv_timer_list_14_0) { ldv_timer_14_0 = 0; return; } else { } if (ldv_timer_14_1 != 0 && (unsigned long )timer == (unsigned long )ldv_timer_list_14_1) { ldv_timer_14_1 = 0; return; } else { } if (ldv_timer_14_2 != 0 && (unsigned long )timer == (unsigned long )ldv_timer_list_14_2) { ldv_timer_14_2 = 0; return; } else { } if (ldv_timer_14_3 != 0 && (unsigned long )timer == (unsigned long )ldv_timer_list_14_3) { ldv_timer_14_3 = 0; return; } else { } return; } } void activate_suitable_timer_14(struct timer_list *timer , unsigned long data ) { { if (ldv_timer_14_0 == 0 || ldv_timer_14_0 == 2) { ldv_timer_list_14_0 = timer; ldv_timer_list_14_0->data = data; ldv_timer_14_0 = 1; return; } else { } if (ldv_timer_14_1 == 0 || ldv_timer_14_1 == 2) { ldv_timer_list_14_1 = timer; ldv_timer_list_14_1->data = data; ldv_timer_14_1 = 1; return; } else { } if (ldv_timer_14_2 == 0 || ldv_timer_14_2 == 2) { ldv_timer_list_14_2 = timer; ldv_timer_list_14_2->data = data; ldv_timer_14_2 = 1; return; } else { } if (ldv_timer_14_3 == 0 || ldv_timer_14_3 == 2) { ldv_timer_list_14_3 = timer; ldv_timer_list_14_3->data = data; ldv_timer_14_3 = 1; return; } else { } return; } } void timer_init_14(void) { { ldv_timer_14_0 = 0; ldv_timer_14_1 = 0; ldv_timer_14_2 = 0; ldv_timer_14_3 = 0; return; } } 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; } } int reg_timer_13(struct timer_list *timer , void (*function)(unsigned long ) , unsigned long data ) { { if ((unsigned long )function == (unsigned long )(& ath_offchannel_timer)) { activate_suitable_timer_13(timer, data); } else { } return (0); } } void choose_timer_14(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_timer_14_0 == 1) { ldv_timer_14_0 = 2; ldv_timer_14(ldv_timer_14_0, ldv_timer_list_14_0); } else { } goto ldv_54571; case 1: ; if (ldv_timer_14_1 == 1) { ldv_timer_14_1 = 2; ldv_timer_14(ldv_timer_14_1, ldv_timer_list_14_1); } else { } goto ldv_54571; case 2: ; if (ldv_timer_14_2 == 1) { ldv_timer_14_2 = 2; ldv_timer_14(ldv_timer_14_2, ldv_timer_list_14_2); } else { } goto ldv_54571; case 3: ; if (ldv_timer_14_3 == 1) { ldv_timer_14_3 = 2; ldv_timer_14(ldv_timer_14_3, ldv_timer_list_14_3); } else { } goto ldv_54571; default: ldv_stop(); } ldv_54571: ; return; } } bool ldv_queue_work_on_163(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_164(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_165(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_166(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_7(2); return; } } bool ldv_queue_delayed_work_on_167(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } int ldv_mod_timer_168(struct timer_list *ldv_func_arg1 , unsigned long ldv_func_arg2 ) { ldv_func_ret_type___3 ldv_func_res ; int tmp ; { tmp = mod_timer(ldv_func_arg1, ldv_func_arg2); ldv_func_res = tmp; activate_pending_timer_14(ldv_func_arg1, ldv_func_arg2, 1); return (ldv_func_res); } } int ldv_mod_timer_169(struct timer_list *ldv_func_arg1 , unsigned long ldv_func_arg2 ) { ldv_func_ret_type___4 ldv_func_res ; int tmp ; { tmp = mod_timer(ldv_func_arg1, ldv_func_arg2); ldv_func_res = tmp; activate_pending_timer_14(ldv_func_arg1, ldv_func_arg2, 1); return (ldv_func_res); } } int ldv_mod_timer_170(struct timer_list *ldv_func_arg1 , unsigned long ldv_func_arg2 ) { ldv_func_ret_type___5 ldv_func_res ; int tmp ; { tmp = mod_timer(ldv_func_arg1, ldv_func_arg2); ldv_func_res = tmp; activate_pending_timer_14(ldv_func_arg1, ldv_func_arg2, 1); return (ldv_func_res); } } int ldv_mod_timer_171(struct timer_list *ldv_func_arg1 , unsigned long ldv_func_arg2 ) { ldv_func_ret_type___6 ldv_func_res ; int tmp ; { tmp = mod_timer(ldv_func_arg1, ldv_func_arg2); ldv_func_res = tmp; activate_pending_timer_14(ldv_func_arg1, ldv_func_arg2, 1); return (ldv_func_res); } } bool ldv_cancel_work_sync_172(struct work_struct *ldv_func_arg1 ) { ldv_func_ret_type___12 ldv_func_res ; bool tmp ; { tmp = cancel_work_sync(ldv_func_arg1); ldv_func_res = tmp; disable_work_7(ldv_func_arg1); return (ldv_func_res); } } int ldv_del_timer_sync_173(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___8 ldv_func_res ; int tmp ; { tmp = del_timer_sync(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_14(ldv_func_arg1); return (ldv_func_res); } } bool ldv_queue_work_on_189(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_191(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_190(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; bool ldv_queue_delayed_work_on_193(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; void ldv_flush_workqueue_192(struct workqueue_struct *ldv_func_arg1 ) ; extern void kfree(void const * ) ; extern void *__kmalloc(size_t , gfp_t ) ; __inline static void *kmalloc(size_t size , gfp_t flags ) { void *tmp___2 ; { tmp___2 = __kmalloc(size, flags); return (tmp___2); } } __inline static void *kzalloc(size_t size , gfp_t flags ) { void *tmp ; { tmp = kmalloc(size, flags | 32768U); return (tmp); } } void invoke_work_8(void) ; void call_and_disable_work_8(struct work_struct *work ) ; void disable_work_8(struct work_struct *work ) ; void call_and_disable_all_8(int state ) ; void activate_work_8(struct work_struct *work , int state ) ; extern void ath9k_hw_btcoex_set_concur_txprio(struct ath_hw * , u8 * ) ; extern bool ar9003_mci_send_message(struct ath_hw * , u8 , u32 , u32 * , u8 , bool , bool ) ; extern int ar9003_mci_setup(struct ath_hw * , u32 , void * , u16 , u32 ) ; extern void ar9003_mci_cleanup(struct ath_hw * ) ; extern void ar9003_mci_get_interrupt(struct ath_hw * , u32 * , u32 * ) ; extern u32 ar9003_mci_get_next_gpm_offset(struct ath_hw * , u32 * ) ; extern void ar9003_mci_set_bt_version(struct ath_hw * , u8 , u8 ) ; extern void ar9003_mci_send_wlan_channels(struct ath_hw * ) ; static u8 const ath_mci_duty_cycle[9U] = { 55U, 50U, 60U, 70U, 80U, 85U, 90U, 95U, 98U}; static struct ath_mci_profile_info *ath_mci_find_profile(struct ath_mci_profile *mci , struct ath_mci_profile_info *info ) { struct ath_mci_profile_info *entry ; int tmp ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; { tmp = list_empty((struct list_head const *)(& mci->info)); if (tmp != 0) { return ((struct ath_mci_profile_info *)0); } else { } __mptr = (struct list_head const *)mci->info.next; entry = (struct ath_mci_profile_info *)__mptr + 0xfffffffffffffff0UL; goto ldv_54006; ldv_54005: ; if ((int )entry->conn_handle == (int )info->conn_handle) { return (entry); } else { } __mptr___0 = (struct list_head const *)entry->list.next; entry = (struct ath_mci_profile_info *)__mptr___0 + 0xfffffffffffffff0UL; ldv_54006: ; if ((unsigned long )(& entry->list) != (unsigned long )(& mci->info)) { goto ldv_54005; } else { } return ((struct ath_mci_profile_info *)0); } } static bool ath_mci_add_profile(struct ath_common *common , struct ath_mci_profile *mci , struct ath_mci_profile_info *info ) { struct ath_mci_profile_info *entry ; u8 voice_priority[9U] ; void *tmp ; { voice_priority[0] = 110U; voice_priority[1] = 110U; voice_priority[2] = 110U; voice_priority[3] = 112U; voice_priority[4] = 110U; voice_priority[5] = 110U; voice_priority[6] = 114U; voice_priority[7] = 116U; voice_priority[8] = 118U; if ((unsigned int )mci->num_sco == 1U && (unsigned int )info->type == 5U) { return (0); } else { } if ((((((int )mci->num_other_acl + (int )mci->num_a2dp) + (int )mci->num_hid) + (int )mci->num_pan) + (int )mci->num_sco) - (int )mci->num_sco == 7 && (unsigned int )info->type != 5U) { return (0); } else { } tmp = kzalloc(32UL, 32U); entry = (struct ath_mci_profile_info *)tmp; if ((unsigned long )entry == (unsigned long )((struct ath_mci_profile_info *)0)) { return (0); } else { } memcpy((void *)entry, (void const *)info, 10UL); switch ((int )info->type) { case 1: mci->num_other_acl = (u8 )((int )mci->num_other_acl + 1); goto ldv_54016; case 2: mci->num_a2dp = (u8 )((int )mci->num_a2dp + 1); if (! info->edr) { mci->num_bdr = (u8 )((int )mci->num_bdr + 1); } else { } goto ldv_54016; case 3: mci->num_hid = (u8 )((int )mci->num_hid + 1); goto ldv_54016; case 4: mci->num_pan = (u8 )((int )mci->num_pan + 1); goto ldv_54016; case 5: ; case 6: mci->num_sco = (u8 )((int )mci->num_sco + 1); goto ldv_54016; default: ; goto ldv_54016; } ldv_54016: list_add_tail(& entry->list, & mci->info); if ((unsigned int )info->type == 5U) { if ((unsigned int )info->voice_type <= 8U) { mci->voice_priority = voice_priority[(int )info->voice_type]; } else { mci->voice_priority = 110U; } } else { } return (1); } } static void ath_mci_del_profile(struct ath_common *common , struct ath_mci_profile *mci , struct ath_mci_profile_info *entry ) { { if ((unsigned long )entry == (unsigned long )((struct ath_mci_profile_info *)0)) { return; } else { } switch ((int )entry->type) { case 1: mci->num_other_acl = (u8 )((int )mci->num_other_acl - 1); goto ldv_54029; case 2: mci->num_a2dp = (u8 )((int )mci->num_a2dp - 1); if (! entry->edr) { mci->num_bdr = (u8 )((int )mci->num_bdr - 1); } else { } goto ldv_54029; case 3: mci->num_hid = (u8 )((int )mci->num_hid - 1); goto ldv_54029; case 4: mci->num_pan = (u8 )((int )mci->num_pan - 1); goto ldv_54029; case 5: ; case 6: mci->num_sco = (u8 )((int )mci->num_sco - 1); goto ldv_54029; default: ; goto ldv_54029; } ldv_54029: list_del(& entry->list); kfree((void const *)entry); return; } } void ath_mci_flush_profile(struct ath_mci_profile *mci ) { struct ath_mci_profile_info *info ; struct ath_mci_profile_info *tinfo ; int tmp ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; { mci->aggr_limit = 0U; mci->num_mgmt = 0U; tmp = list_empty((struct list_head const *)(& mci->info)); if (tmp != 0) { return; } else { } __mptr = (struct list_head const *)mci->info.next; info = (struct ath_mci_profile_info *)__mptr + 0xfffffffffffffff0UL; __mptr___0 = (struct list_head const *)info->list.next; tinfo = (struct ath_mci_profile_info *)__mptr___0 + 0xfffffffffffffff0UL; goto ldv_54056; ldv_54055: list_del(& info->list); switch ((int )info->type) { case 1: mci->num_other_acl = (u8 )((int )mci->num_other_acl - 1); goto ldv_54048; case 2: mci->num_a2dp = (u8 )((int )mci->num_a2dp - 1); if (! info->edr) { mci->num_bdr = (u8 )((int )mci->num_bdr - 1); } else { } goto ldv_54048; case 3: mci->num_hid = (u8 )((int )mci->num_hid - 1); goto ldv_54048; case 4: mci->num_pan = (u8 )((int )mci->num_pan - 1); goto ldv_54048; case 5: ; case 6: mci->num_sco = (u8 )((int )mci->num_sco - 1); goto ldv_54048; default: ; goto ldv_54048; } ldv_54048: kfree((void const *)info); info = tinfo; __mptr___1 = (struct list_head const *)tinfo->list.next; tinfo = (struct ath_mci_profile_info *)__mptr___1 + 0xfffffffffffffff0UL; ldv_54056: ; if ((unsigned long )(& info->list) != (unsigned long )(& mci->info)) { goto ldv_54055; } else { } return; } } static void ath_mci_adjust_aggr_limit(struct ath_btcoex *btcoex ) { struct ath_mci_profile *mci ; u32 wlan_airtime ; { mci = & btcoex->mci; wlan_airtime = (btcoex->btcoex_period * (100U - btcoex->duty_cycle)) / 100U; if (wlan_airtime <= 4U && ((unsigned int )mci->aggr_limit == 0U || (u32 )mci->aggr_limit > wlan_airtime * 2U)) { mci->aggr_limit = (unsigned int )((u16 )wlan_airtime) * 2U; } else { } return; } } static void ath_mci_update_scheme(struct ath_softc *sc ) { struct ath_common *common ; struct ath_common *tmp ; struct ath_btcoex *btcoex ; struct ath_mci_profile *mci ; struct ath9k_hw_mci *mci_hw ; struct ath_mci_profile_info *info ; u32 num_profile ; struct list_head const *__mptr ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; btcoex = & sc->btcoex; mci = & btcoex->mci; mci_hw = & (sc->sc_ah)->btcoex_hw.mci; num_profile = (u32 )(((((int )mci->num_other_acl + (int )mci->num_a2dp) + (int )mci->num_hid) + (int )mci->num_pan) + (int )mci->num_sco); if ((mci_hw->config & 16384U) != 0U) { goto skip_tuning; } else { } mci->aggr_limit = 0U; btcoex->duty_cycle = (u32 )ath_mci_duty_cycle[num_profile]; btcoex->btcoex_period = 40U; if (((((int )mci->num_other_acl + (int )mci->num_a2dp) + (int )mci->num_hid) + (int )mci->num_pan) + (int )mci->num_sco != 0) { btcoex->bt_stomp_type = 1; } else { btcoex->bt_stomp_type = (unsigned int )mci->num_mgmt == 0U; } if (num_profile == 1U) { __mptr = (struct list_head const *)mci->info.next; info = (struct ath_mci_profile_info *)__mptr + 0xfffffffffffffff0UL; if ((unsigned int )mci->num_sco != 0U) { if ((unsigned int )info->T == 12U) { mci->aggr_limit = 8U; } else if ((unsigned int )info->T == 6U) { mci->aggr_limit = 6U; btcoex->duty_cycle = 30U; } else { mci->aggr_limit = 6U; } if ((common->debug_mask & 32768) != 0) { ath_printk("\017", (struct ath_common const *)common, "Single SCO, aggregation limit %d 1/4 ms\n", (int )mci->aggr_limit); } else { } } else if ((unsigned int )mci->num_pan != 0U || (unsigned int )mci->num_other_acl != 0U) { btcoex->duty_cycle = (sc->sc_ah)->hw_version.macVersion == 704U ? 40U : 35U; btcoex->btcoex_period = 53U; if ((common->debug_mask & 32768) != 0) { ath_printk("\017", (struct ath_common const *)common, "Single PAN/FTP bt period %d ms dutycycle %d\n", btcoex->duty_cycle, btcoex->btcoex_period); } else { } } else if ((unsigned int )mci->num_hid != 0U) { btcoex->duty_cycle = 30U; mci->aggr_limit = 6U; if ((common->debug_mask & 32768) != 0) { ath_printk("\017", (struct ath_common const *)common, "Multiple attempt/timeout single HID aggregation limit 1.5 ms dutycycle 30%%\n"); } else { } } else { } } else if (num_profile == 2U) { if ((unsigned int )mci->num_hid == 2U) { btcoex->duty_cycle = 30U; } else { } mci->aggr_limit = 6U; if ((common->debug_mask & 32768) != 0) { ath_printk("\017", (struct ath_common const *)common, "Two BT profiles aggr limit 1.5 ms dutycycle %d%%\n", btcoex->duty_cycle); } else { } } else if (num_profile > 2U) { mci->aggr_limit = 4U; if ((common->debug_mask & 32768) != 0) { ath_printk("\017", (struct ath_common const *)common, "Three or more profiles aggregation limit 1 ms\n"); } else { } } else { } skip_tuning: ; if (((unsigned long )((sc->sc_ah)->curchan)->channelFlags & 1UL) == 0UL) { if (((unsigned long )((sc->sc_ah)->curchan)->channelFlags & 8UL) != 0UL) { ath_mci_adjust_aggr_limit(btcoex); } else { btcoex->btcoex_period = btcoex->btcoex_period >> 1; } } else { } ath9k_btcoex_timer_pause(sc); ath9k_hw_btcoex_disable(sc->sc_ah); if ((int )((sc->sc_ah)->curchan)->channelFlags & 1) { return; } else { } btcoex->duty_cycle = btcoex->duty_cycle + ((unsigned int )mci->num_bdr != 0U ? 20U : 0U); if (btcoex->duty_cycle > 90U) { btcoex->duty_cycle = 90U; } else { } btcoex->btcoex_no_stomp = (btcoex->btcoex_period * (100U - btcoex->duty_cycle)) / 100U; ath9k_hw_btcoex_enable(sc->sc_ah); ath9k_btcoex_timer_resume(sc); return; } } static void ath_mci_cal_msg(struct ath_softc *sc , u8 opcode , u8 *rx_payload ) { struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; struct ath9k_hw_mci *mci_hw ; u32 payload[4U] ; { ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; mci_hw = & ah->btcoex_hw.mci; payload[0] = 0U; payload[1] = 0U; payload[2] = 0U; payload[3] = 0U; switch ((int )opcode) { case 0: ; if ((unsigned int )mci_hw->bt_state == 1U) { mci_hw->bt_state = 2U; ath9k_queue_reset(sc, 9); } else { } if ((common->debug_mask & 32768) != 0) { ath_printk("\017", (struct ath_common const *)common, "MCI State : %d\n", (int )mci_hw->bt_state); } else { } goto ldv_54085; case 1: *((u8 *)(& payload) + 4UL) = 5U; ar9003_mci_send_message(sc->sc_ah, 128, 0U, (u32 *)(& payload), 16, 0, 1); goto ldv_54085; default: ; if ((common->debug_mask & 32768) != 0) { ath_printk("\017", (struct ath_common const *)common, "Unknown GPM CAL message\n"); } else { } goto ldv_54085; } ldv_54085: ; return; } } static void ath9k_mci_work(struct work_struct *work ) { struct ath_softc *sc ; struct work_struct const *__mptr ; { __mptr = (struct work_struct const *)work; sc = (struct ath_softc *)__mptr + 0xffffffffffffc410UL; ath_mci_update_scheme(sc); return; } } static void ath_mci_update_stomp_txprio(u8 cur_txprio , u8 *stomp_prio ) { { if ((int )*(stomp_prio + 2UL) > (int )cur_txprio) { *(stomp_prio + 2UL) = cur_txprio; } else { } if ((int )*stomp_prio < (int )cur_txprio) { *stomp_prio = cur_txprio; } else { } if ((unsigned int )cur_txprio > 60U && (int )*(stomp_prio + 1UL) > (int )cur_txprio) { *(stomp_prio + 1UL) = cur_txprio; } else { } return; } } static void ath_mci_set_concur_txprio(struct ath_softc *sc ) { struct ath_btcoex *btcoex ; struct ath_mci_profile *mci ; u8 stomp_txprio[5U] ; u8 prof_prio[4U] ; { btcoex = & sc->btcoex; mci = & btcoex->mci; memset((void *)(& stomp_txprio), 0, 5UL); if ((unsigned int )mci->num_mgmt != 0U) { stomp_txprio[0] = 62U; if ((unsigned int )mci->num_pan == 0U && (unsigned int )mci->num_other_acl == 0U) { stomp_txprio[2] = 62U; } else { } } else { prof_prio[0] = 50U; prof_prio[1] = 90U; prof_prio[2] = 94U; prof_prio[3] = 52U; stomp_txprio[2] = 255U; stomp_txprio[1] = stomp_txprio[2]; if ((unsigned int )mci->num_sco != 0U) { ath_mci_update_stomp_txprio((int )mci->voice_priority, (u8 *)(& stomp_txprio)); } else { } if ((unsigned int )mci->num_other_acl != 0U) { ath_mci_update_stomp_txprio((int )prof_prio[0], (u8 *)(& stomp_txprio)); } else { } if ((unsigned int )mci->num_a2dp != 0U) { ath_mci_update_stomp_txprio((int )prof_prio[1], (u8 *)(& stomp_txprio)); } else { } if ((unsigned int )mci->num_hid != 0U) { ath_mci_update_stomp_txprio((int )prof_prio[2], (u8 *)(& stomp_txprio)); } else { } if ((unsigned int )mci->num_pan != 0U) { ath_mci_update_stomp_txprio((int )prof_prio[3], (u8 *)(& stomp_txprio)); } else { } if ((unsigned int )stomp_txprio[2] == 255U) { stomp_txprio[2] = 0U; } else { } if ((unsigned int )stomp_txprio[1] == 255U) { stomp_txprio[1] = 0U; } else { } } ath9k_hw_btcoex_set_concur_txprio(sc->sc_ah, (u8 *)(& stomp_txprio)); return; } } static u8 ath_mci_process_profile(struct ath_softc *sc , struct ath_mci_profile_info *info ) { struct ath_common *common ; struct ath_common *tmp ; struct ath_btcoex *btcoex ; struct ath_mci_profile *mci ; struct ath_mci_profile_info *entry ; bool tmp___0 ; int tmp___1 ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; btcoex = & sc->btcoex; mci = & btcoex->mci; entry = (struct ath_mci_profile_info *)0; entry = ath_mci_find_profile(mci, info); if ((unsigned long )entry != (unsigned long )((struct ath_mci_profile_info *)0)) { if ((int )entry->type != (int )info->type) { switch ((int )entry->type) { case 1: mci->num_other_acl = (u8 )((int )mci->num_other_acl - 1); goto ldv_54114; case 2: mci->num_a2dp = (u8 )((int )mci->num_a2dp - 1); if (! entry->edr) { mci->num_bdr = (u8 )((int )mci->num_bdr - 1); } else { } goto ldv_54114; case 3: mci->num_hid = (u8 )((int )mci->num_hid - 1); goto ldv_54114; case 4: mci->num_pan = (u8 )((int )mci->num_pan - 1); goto ldv_54114; case 5: ; case 6: mci->num_sco = (u8 )((int )mci->num_sco - 1); goto ldv_54114; default: ; goto ldv_54114; } ldv_54114: ; switch ((int )info->type) { case 1: mci->num_other_acl = (u8 )((int )mci->num_other_acl + 1); goto ldv_54122; case 2: mci->num_a2dp = (u8 )((int )mci->num_a2dp + 1); if (! info->edr) { mci->num_bdr = (u8 )((int )mci->num_bdr + 1); } else { } goto ldv_54122; case 3: mci->num_hid = (u8 )((int )mci->num_hid + 1); goto ldv_54122; case 4: mci->num_pan = (u8 )((int )mci->num_pan + 1); goto ldv_54122; case 5: ; case 6: mci->num_sco = (u8 )((int )mci->num_sco + 1); goto ldv_54122; default: ; goto ldv_54122; } ldv_54122: ; } else { } memcpy((void *)entry, (void const *)info, 10UL); } else { } if ((int )info->start) { if ((unsigned long )entry == (unsigned long )((struct ath_mci_profile_info *)0)) { tmp___0 = ath_mci_add_profile(common, mci, info); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { return (0U); } else { } } else { } } else { ath_mci_del_profile(common, mci, entry); } ath_mci_set_concur_txprio(sc); return (1U); } } static u8 ath_mci_process_status(struct ath_softc *sc , struct ath_mci_profile_status *status ) { struct ath_btcoex *btcoex ; struct ath_mci_profile *mci ; struct ath_mci_profile_info info ; int i ; int old_num_mgmt ; struct ath_mci_profile_info *tmp ; int tmp___0 ; { btcoex = & sc->btcoex; mci = & btcoex->mci; i = 0; old_num_mgmt = (int )mci->num_mgmt; if ((int )status->is_link) { return (0U); } else { } info.conn_handle = status->conn_handle; tmp = ath_mci_find_profile(mci, & info); if ((unsigned long )tmp != (unsigned long )((struct ath_mci_profile_info *)0)) { return (0U); } else { } if ((unsigned int )status->conn_handle > 7U) { return (0U); } else { } if ((int )status->is_critical) { __set_bit((long )status->conn_handle, (unsigned long volatile *)(& mci->status)); } else { __clear_bit((long )status->conn_handle, (unsigned long volatile *)(& mci->status)); } mci->num_mgmt = 0U; ldv_54138: tmp___0 = variable_test_bit((long )i, (unsigned long const volatile *)(& mci->status)); if (tmp___0 != 0) { mci->num_mgmt = (u8 )((int )mci->num_mgmt + 1); } else { } i = i + 1; if (i <= 7) { goto ldv_54138; } else { } ath_mci_set_concur_txprio(sc); if ((int )mci->num_mgmt != old_num_mgmt) { return (1U); } else { } return (0U); } } static void ath_mci_msg(struct ath_softc *sc , u8 opcode , u8 *rx_payload ) { struct ath_hw *ah ; struct ath_mci_profile_info profile_info ; struct ath_mci_profile_status profile_status ; struct ath_common *common ; struct ath_common *tmp ; u8 major ; u8 minor ; u8 update_scheme ; u32 seq_num ; u32 tmp___0 ; u32 tmp___1 ; u8 tmp___2 ; u8 tmp___3 ; { ah = sc->sc_ah; tmp = ath9k_hw_common(sc->sc_ah); common = tmp; update_scheme = 0U; tmp___0 = ar9003_mci_state(ah, 19U); if (tmp___0 != 0U) { tmp___1 = ar9003_mci_state(ah, 0U); if (tmp___1 != 0U) { if ((common->debug_mask & 32768) != 0) { ath_printk("\017", (struct ath_common const *)common, "(MCI) Need to flush BT profiles\n"); } else { } ath_mci_flush_profile(& sc->btcoex.mci); ar9003_mci_state(ah, 18U); } else { } } else { } switch ((int )opcode) { case 0: ar9003_mci_state(ah, 14U); goto ldv_54154; case 1: major = *(rx_payload + 6UL); minor = *(rx_payload + 7UL); ar9003_mci_set_bt_version(ah, (int )major, (int )minor); goto ldv_54154; case 2: ar9003_mci_send_wlan_channels(ah); goto ldv_54154; case 5: memcpy((void *)(& profile_info), (void const *)rx_payload + 6U, 10UL); if ((unsigned int )profile_info.type == 0U || (unsigned int )profile_info.type > 6U) { if ((common->debug_mask & 32768) != 0) { ath_printk("\017", (struct ath_common const *)common, "Illegal profile type = %d, state = %d\n", (int )profile_info.type, (int )profile_info.start); } else { } goto ldv_54154; } else { } tmp___2 = ath_mci_process_profile(sc, & profile_info); update_scheme = (int )tmp___2 + (int )update_scheme; goto ldv_54154; case 6: profile_status.is_link = (unsigned int )*(rx_payload + 6UL) != 0U; profile_status.conn_handle = *(rx_payload + 7UL); profile_status.is_critical = (unsigned int )*(rx_payload + 8UL) != 0U; seq_num = *((u32 *)rx_payload + 12U); if ((common->debug_mask & 32768) != 0) { ath_printk("\017", (struct ath_common const *)common, "BT_Status_Update: is_link=%d, linkId=%d, state=%d, SEQ=%u\n", (int )profile_status.is_link, (int )profile_status.conn_handle, (int )profile_status.is_critical, seq_num); } else { } tmp___3 = ath_mci_process_status(sc, & profile_status); update_scheme = (int )tmp___3 + (int )update_scheme; goto ldv_54154; default: ; if ((common->debug_mask & 32768) != 0) { ath_printk("\017", (struct ath_common const *)common, "Unknown GPM COEX message = 0x%02x\n", (int )opcode); } else { } goto ldv_54154; } ldv_54154: ; if ((unsigned int )update_scheme != 0U) { ieee80211_queue_work(sc->hw, & sc->mci_work); } else { } return; } } int ath_mci_setup(struct ath_softc *sc ) { struct ath_common *common ; struct ath_common *tmp ; struct ath_mci_coex *mci ; struct ath_mci_buf *buf ; int ret ; struct lock_class_key __key ; atomic_long_t __constr_expr_0 ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; mci = & sc->mci_coex; buf = & mci->sched_buf; buf->bf_addr = dmam_alloc_coherent(sc->dev, 512UL, & buf->bf_paddr, 208U); if ((unsigned long )buf->bf_addr == (unsigned long )((void *)0)) { if ((common->debug_mask & 1024) != 0) { ath_printk("\017", (struct ath_common const *)common, "MCI buffer alloc failed\n"); } else { } return (-12); } else { } memset(buf->bf_addr, 254, 512UL); mci->sched_buf.bf_len = 256U; mci->gpm_buf.bf_len = 256U; mci->gpm_buf.bf_addr = mci->sched_buf.bf_addr + (unsigned long )mci->sched_buf.bf_len; mci->gpm_buf.bf_paddr = mci->sched_buf.bf_paddr + (dma_addr_t )mci->sched_buf.bf_len; ret = ar9003_mci_setup(sc->sc_ah, (u32 )mci->gpm_buf.bf_paddr, mci->gpm_buf.bf_addr, (int )((u16 )(mci->gpm_buf.bf_len >> 4)), (u32 )mci->sched_buf.bf_paddr); if (ret != 0) { ath_printk("\v", (struct ath_common const *)common, "Failed to initialize MCI\n"); return (ret); } else { } __init_work(& sc->mci_work, 0); __constr_expr_0.counter = 137438953408L; sc->mci_work.data = __constr_expr_0; lockdep_init_map(& sc->mci_work.lockdep_map, "(&sc->mci_work)", & __key, 0); INIT_LIST_HEAD(& sc->mci_work.entry); sc->mci_work.func = & ath9k_mci_work; if ((common->debug_mask & 32768) != 0) { ath_printk("\017", (struct ath_common const *)common, "MCI Initialized\n"); } else { } return (0); } } void ath_mci_cleanup(struct ath_softc *sc ) { struct ath_common *common ; struct ath_common *tmp ; struct ath_hw *ah ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; ah = sc->sc_ah; ar9003_mci_cleanup(ah); if ((common->debug_mask & 32768) != 0) { ath_printk("\017", (struct ath_common const *)common, "MCI De-Initialized\n"); } else { } return; } } void ath_mci_intr(struct ath_softc *sc ) { struct ath_mci_coex *mci ; struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; struct ath9k_hw_mci *mci_hw ; u32 mci_int ; u32 mci_int_rxmsg ; u32 offset ; u32 subtype ; u32 opcode ; u32 *pgpm ; u32 more_data ; bool skip_gpm ; u32 tmp___0 ; u32 payload[4U] ; u32 tmp___1 ; u32 tmp___2 ; int tmp___3 ; int value_dbm ; { mci = & sc->mci_coex; ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; mci_hw = & ah->btcoex_hw.mci; more_data = 1U; skip_gpm = 0; ar9003_mci_get_interrupt(sc->sc_ah, & mci_int, & mci_int_rxmsg); tmp___0 = ar9003_mci_state(ah, 0U); if (tmp___0 == 0U) { ar9003_mci_state(ah, 1U); return; } else { } if ((mci_int_rxmsg & 4096U) != 0U) { payload[0] = 4294967295U; payload[1] = 4294967295U; payload[2] = 4294967295U; payload[3] = 4294967040U; ar9003_mci_send_message(ah, 255, 0U, (u32 *)(& payload), 16, 1, 0); ar9003_mci_send_message(ah, 112, 0U, (u32 *)0U, 0, 1, 0); mci_int_rxmsg = mci_int_rxmsg & 4294963199U; ar9003_mci_state(ah, 13U); ar9003_mci_state(ah, 7U); } else { } if ((mci_int_rxmsg & 2048U) != 0U) { mci_int_rxmsg = mci_int_rxmsg & 4294965247U; if ((unsigned int )mci_hw->bt_state == 0U) { tmp___1 = ar9003_mci_state(ah, 11U); if (tmp___1 != 0U) { ar9003_mci_state(ah, 7U); } else { } } else { } } else { } if ((mci_int_rxmsg & 1024U) != 0U) { mci_int_rxmsg = mci_int_rxmsg & 4294966271U; if ((unsigned int )mci_hw->bt_state == 1U) { tmp___2 = ar9003_mci_state(ah, 11U); if (tmp___2 != 1U) { mci_hw->bt_state = 0U; } else { } } else { } } else { } if ((mci_int & 8U) != 0U || (int )mci_int < 0) { ar9003_mci_state(ah, 21U); skip_gpm = 1; } else { } if ((mci_int_rxmsg & 32U) != 0U) { mci_int_rxmsg = mci_int_rxmsg & 4294967263U; offset = ar9003_mci_state(ah, 10U); } else { } if ((mci_int_rxmsg & 256U) != 0U) { mci_int_rxmsg = mci_int_rxmsg & 4294967039U; goto ldv_54196; ldv_54195: tmp___3 = constant_test_bit(4L, (unsigned long const volatile *)(& common->op_flags)); if (tmp___3 != 0) { return; } else { } pgpm = (u32 *)mci->gpm_buf.bf_addr; offset = ar9003_mci_get_next_gpm_offset(ah, & more_data); if (offset == 4294967295U) { goto ldv_54190; } else { } pgpm = pgpm + (unsigned long )(offset >> 2); subtype = (u32 )*((u8 *)pgpm + 4UL); opcode = (u32 )*((u8 *)pgpm + 5UL); if ((int )skip_gpm) { goto recycle; } else { } if (subtype <= 5U) { ath_mci_cal_msg(sc, (int )((u8 )subtype), (u8 *)pgpm); } else { switch (subtype) { case 12U: ath_mci_msg(sc, (int )((u8 )opcode), (u8 *)pgpm); goto ldv_54193; default: ; goto ldv_54193; } ldv_54193: ; } recycle: *(pgpm + 1UL) = 4278124286U; ldv_54196: ; if (more_data == 1U) { goto ldv_54195; } else { } ldv_54190: ; } else { } if ((mci_int_rxmsg & 574U) != 0U) { if ((mci_int_rxmsg & 2U) != 0U) { mci_int_rxmsg = mci_int_rxmsg & 4294967293U; } else { } if ((mci_int_rxmsg & 512U) != 0U) { mci_int_rxmsg = mci_int_rxmsg & 4294966783U; } else { } if ((mci_int_rxmsg & 8U) != 0U) { value_dbm = (int )mci_hw->cont_status & 255; mci_int_rxmsg = mci_int_rxmsg & 4294967287U; if ((common->debug_mask & 32768) != 0) { ath_printk("\017", (struct ath_common const *)common, "MCI CONT_INFO: (%s) pri = %d pwr = %d dBm\n", (mci_hw->cont_status & 65536U) >> 16 != 0U ? (char *)"tx" : (char *)"rx", (mci_hw->cont_status & 65280U) >> 8, value_dbm); } else { } } else { } if ((mci_int_rxmsg & 4U) != 0U) { mci_int_rxmsg = mci_int_rxmsg & 4294967291U; } else { } if ((mci_int_rxmsg & 16U) != 0U) { mci_int_rxmsg = mci_int_rxmsg & 4294967279U; } else { } } else { } if ((mci_int & 8U) != 0U || (int )mci_int < 0) { mci_int = mci_int & 2147483639U; ath_mci_msg(sc, 8, (u8 *)0U); } else { } return; } } void ath_mci_enable(struct ath_softc *sc ) { struct ath_common *common ; struct ath_common *tmp ; { tmp = ath9k_hw_common(sc->sc_ah); common = tmp; if (! common->btcoex_enabled) { return; } else { } if (((sc->sc_ah)->caps.hw_caps & 32768U) != 0U) { (sc->sc_ah)->imask = (enum ath9k_int )((unsigned int )(sc->sc_ah)->imask | 512U); } else { } return; } } void ath9k_mci_update_wlan_channels(struct ath_softc *sc , bool allow_all ) { struct ath_hw *ah ; struct ath9k_hw_mci *mci ; struct ath9k_channel *chan ; u32 channelmap[4U] ; int i ; s16 chan_start ; s16 chan_end ; u16 wlan_chan ; struct ath_common *tmp ; struct ath_common *tmp___0 ; { ah = sc->sc_ah; mci = & ah->btcoex_hw.mci; chan = ah->curchan; channelmap[0] = 0U; channelmap[1] = 4294901760U; channelmap[2] = 4294967295U; channelmap[3] = 2147483647U; if ((unsigned long )chan == (unsigned long )((struct ath9k_channel *)0) || (int )chan->channelFlags & 1) { return; } else { } if ((int )allow_all) { goto send_wlan_chan; } else { } wlan_chan = (unsigned int )chan->channel + 63134U; chan_start = (s16 )((unsigned int )wlan_chan + 65526U); chan_end = (s16 )((unsigned int )wlan_chan + 10U); if (((unsigned long )chan->channelFlags & 16UL) != 0UL) { chan_end = (s16 )((unsigned int )((unsigned short )chan_end) + 20U); } else if (((unsigned long )chan->channelFlags & 32UL) != 0UL) { chan_start = (s16 )((unsigned int )((unsigned short )chan_start) + 65516U); } else { } chan_start = (s16 )((unsigned int )((unsigned short )chan_start) + 65529U); chan_end = (s16 )((unsigned int )((unsigned short )chan_end) + 7U); if ((int )chan_start <= 0) { chan_start = 0; } else { } if ((int )chan_end > 78) { chan_end = 78; } else { } tmp___0 = ath9k_hw_common(ah); if ((tmp___0->debug_mask & 32768) != 0) { tmp = ath9k_hw_common(ah); ath_printk("\017", (struct ath_common const *)tmp, "WLAN current channel %d mask BT channel %d - %d\n", (int )wlan_chan, (int )chan_start, (int )chan_end); } else { } i = (int )chan_start; goto ldv_54216; ldv_54215: ; if (i <= 78) { *((u8 *)(& channelmap) + ((unsigned long )(i / 8) + 6UL)) = (u8 )((int )((signed char )*((u8 *)(& channelmap) + ((unsigned long )(i / 8) + 6UL))) & ~ ((int )((signed char )(1 << (i & 7))))); } else { } i = i + 1; ldv_54216: ; if ((int )chan_end > i) { goto ldv_54215; } else { } send_wlan_chan: i = 0; goto ldv_54219; ldv_54218: mci->wlan_channels[i] = channelmap[i]; i = i + 1; ldv_54219: ; if (i <= 3) { goto ldv_54218; } else { } ar9003_mci_send_wlan_channels(ah); ar9003_mci_state(ah, 17U); return; } } void ath9k_mci_set_txpower(struct ath_softc *sc , bool setchannel , bool concur_tx ) { struct ath_hw *ah ; struct ath9k_hw_mci *mci_hw ; bool old_concur_tx ; struct ath9k_hw_cal_data *caldata ; { ah = sc->sc_ah; mci_hw = & (sc->sc_ah)->btcoex_hw.mci; old_concur_tx = mci_hw->concur_tx; if ((mci_hw->config & 3U) == 0U) { mci_hw->concur_tx = 0; return; } else { } if ((int )(ah->curchan)->channelFlags & 1) { return; } else { } if ((int )setchannel) { caldata = & (sc->cur_chan)->caldata; if ((((unsigned long )(ah->curchan)->channelFlags & 16UL) != 0UL && (int )(ah->curchan)->channel > (int )caldata->channel) && (int )(ah->curchan)->channel <= (int )caldata->channel + 20) { return; } else { } if ((((unsigned long )(ah->curchan)->channelFlags & 32UL) != 0UL && (int )(ah->curchan)->channel < (int )caldata->channel) && (int )(ah->curchan)->channel >= (int )caldata->channel + -20) { return; } else { } mci_hw->concur_tx = 0; } else { mci_hw->concur_tx = concur_tx; } if ((int )mci_hw->concur_tx != (int )old_concur_tx) { ath9k_hw_set_txpowerlimit(ah, (u32 )(sc->cur_chan)->txpower, 0); } else { } return; } } static void ath9k_mci_stomp_audio(struct ath_softc *sc ) { struct ath_hw *ah ; struct ath_btcoex *btcoex ; struct ath_mci_profile *mci ; { ah = sc->sc_ah; btcoex = & sc->btcoex; mci = & btcoex->mci; if ((unsigned int )mci->num_sco == 0U && (unsigned int )mci->num_a2dp == 0U) { return; } else { } if (ah->stats.avgbrssi > 25U) { btcoex->stomp_audio = 0U; return; } else { } btcoex->stomp_audio = (u8 )((int )btcoex->stomp_audio + 1); return; } } void ath9k_mci_update_rssi(struct ath_softc *sc ) { struct ath_hw *ah ; struct ath_btcoex *btcoex ; struct ath9k_hw_mci *mci_hw ; { ah = sc->sc_ah; btcoex = & sc->btcoex; mci_hw = & (sc->sc_ah)->btcoex_hw.mci; ath9k_mci_stomp_audio(sc); if ((mci_hw->config & 3U) == 0U) { return; } else { } if (ah->stats.avgbrssi > 39U) { if (btcoex->rssi_count < 0) { btcoex->rssi_count = 0; } else { } btcoex->rssi_count = btcoex->rssi_count + 1; if (btcoex->rssi_count > 4) { btcoex->rssi_count = 0; ath9k_mci_set_txpower(sc, 0, 1); } else { } } else { if (btcoex->rssi_count > 0) { btcoex->rssi_count = 0; } else { } btcoex->rssi_count = btcoex->rssi_count - 1; if (btcoex->rssi_count < -4) { btcoex->rssi_count = 0; ath9k_mci_set_txpower(sc, 0, 0); } else { } } 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; ath9k_mci_work(ldv_work_struct_8_0); ldv_work_8_0 = 1; } else { } goto ldv_54248; case 1: ; if (ldv_work_8_1 == 2 || ldv_work_8_1 == 3) { ldv_work_8_1 = 4; ath9k_mci_work(ldv_work_struct_8_0); ldv_work_8_1 = 1; } else { } goto ldv_54248; case 2: ; if (ldv_work_8_2 == 2 || ldv_work_8_2 == 3) { ldv_work_8_2 = 4; ath9k_mci_work(ldv_work_struct_8_0); ldv_work_8_2 = 1; } else { } goto ldv_54248; case 3: ; if (ldv_work_8_3 == 2 || ldv_work_8_3 == 3) { ldv_work_8_3 = 4; ath9k_mci_work(ldv_work_struct_8_0); ldv_work_8_3 = 1; } else { } goto ldv_54248; default: ldv_stop(); } ldv_54248: ; 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) { ath9k_mci_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) { ath9k_mci_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) { ath9k_mci_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) { ath9k_mci_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; } } 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; } } bool ldv_queue_work_on_189(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_190(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_191(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_192(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_7(2); return; } } bool ldv_queue_delayed_work_on_193(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } int ldv_del_timer_sync_214(struct timer_list *ldv_func_arg1 ) ; bool ldv_queue_work_on_203(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_205(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_204(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; bool ldv_queue_delayed_work_on_207(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; void ldv_flush_workqueue_206(struct workqueue_struct *ldv_func_arg1 ) ; void disable_suitable_irq_2(int line , void *data ) ; int reg_check_1(irqreturn_t (*handler)(int , void * ) ) ; void activate_suitable_irq_2(int line , void *data ) ; void ldv_pci_driver_35(void) ; void choose_interrupt_1(void) ; int reg_check_2(irqreturn_t (*handler)(int , void * ) ) ; void disable_suitable_irq_1(int line , void *data ) ; void activate_suitable_irq_1(int line , void *data ) ; int ldv_irq_1(int state , int line , void *data ) ; __inline static void *dev_get_drvdata(struct device const *dev ) { { return ((void *)dev->driver_data); } } __inline static void dev_set_drvdata(struct device *dev , void *data ) { { dev->driver_data = data; return; } } extern void dev_err(struct device const * , char const * , ...) ; extern void _dev_info(struct device const * , char const * , ...) ; extern int pci_bus_read_config_byte(struct pci_bus * , unsigned int , int , u8 * ) ; extern int pci_bus_read_config_dword(struct pci_bus * , unsigned int , int , u32 * ) ; extern int pci_bus_write_config_byte(struct pci_bus * , unsigned int , int , u8 ) ; extern int pci_bus_write_config_dword(struct pci_bus * , unsigned int , int , u32 ) ; __inline static int pci_read_config_byte(struct pci_dev const *dev , int where , u8 *val ) { int tmp ; { tmp = pci_bus_read_config_byte(dev->bus, dev->devfn, where, val); return (tmp); } } __inline static int pci_read_config_dword(struct pci_dev const *dev , int where , u32 *val ) { int tmp ; { tmp = pci_bus_read_config_dword(dev->bus, dev->devfn, where, val); return (tmp); } } __inline static int pci_write_config_byte(struct pci_dev const *dev , int where , u8 val ) { int tmp ; { tmp = pci_bus_write_config_byte(dev->bus, dev->devfn, where, (int )val); return (tmp); } } __inline static int pci_write_config_dword(struct pci_dev const *dev , int where , u32 val ) { int tmp ; { tmp = pci_bus_write_config_dword(dev->bus, dev->devfn, where, val); return (tmp); } } extern int pcie_capability_read_word(struct pci_dev * , int , u16 * ) ; extern int pcie_capability_clear_and_set_word(struct pci_dev * , int , u16 , u16 ) ; __inline static int pcie_capability_clear_word(struct pci_dev *dev , int pos , u16 clear ) { int tmp ; { tmp = pcie_capability_clear_and_set_word(dev, pos, (int )clear, 0); return (tmp); } } extern int pcim_enable_device(struct pci_dev * ) ; extern void pci_set_master(struct pci_dev * ) ; extern int __pci_register_driver(struct pci_driver * , struct module * , char const * ) ; int ldv___pci_register_driver_215(struct pci_driver *ldv_func_arg1 , struct module *ldv_func_arg2 , char const *ldv_func_arg3 ) ; extern void pci_unregister_driver(struct pci_driver * ) ; void ldv_pci_unregister_driver_216(struct pci_driver *ldv_func_arg1 ) ; extern int dma_supported(struct device * , u64 ) ; extern int dma_set_mask(struct device * , u64 ) ; __inline static int dma_set_coherent_mask(struct device *dev , u64 mask ) { int tmp ; { tmp = dma_supported(dev, mask); if (tmp == 0) { return (-5); } else { } dev->coherent_dma_mask = mask; return (0); } } __inline static int pci_set_dma_mask(struct pci_dev *dev , u64 mask ) { int tmp ; { tmp = dma_set_mask(& dev->dev, mask); return (tmp); } } __inline static int pci_set_consistent_dma_mask(struct pci_dev *dev , u64 mask ) { int tmp ; { tmp = dma_set_coherent_mask(& dev->dev, mask); return (tmp); } } __inline static void *pci_get_drvdata(struct pci_dev *pdev ) { void *tmp ; { tmp = dev_get_drvdata((struct device const *)(& pdev->dev)); return (tmp); } } __inline static void pci_set_drvdata(struct pci_dev *pdev , void *data ) { { dev_set_drvdata(& pdev->dev, data); return; } } extern void * const *pcim_iomap_table(struct pci_dev * ) ; extern int pcim_iomap_regions(struct pci_dev * , int , char const * ) ; extern int request_threaded_irq(unsigned int , irqreturn_t (*)(int , void * ) , irqreturn_t (*)(int , void * ) , unsigned long , char const * , void * ) ; __inline static int request_irq(unsigned int irq , irqreturn_t (*handler)(int , void * ) , unsigned long flags , char const *name , void *dev ) { int tmp ; { tmp = request_threaded_irq(irq, handler, (irqreturn_t (*)(int , void * ))0, flags, name, dev); return (tmp); } } __inline static int ldv_request_irq_209(unsigned int irq , irqreturn_t (*handler)(int , void * ) , unsigned long flags , char const *name , void *dev ) ; extern void free_irq(unsigned int , void * ) ; void ldv_free_irq_210(unsigned int ldv_func_arg1 , void *ldv_func_arg2 ) ; void ldv_free_irq_212(unsigned int ldv_func_arg1 , void *ldv_func_arg2 ) ; __inline static void set_wiphy_dev(struct wiphy *wiphy , struct device *dev ) { { wiphy->dev.parent = dev; return; } } __inline static void SET_IEEE80211_DEV(struct ieee80211_hw *hw , struct device *dev ) { { set_wiphy_dev(hw->wiphy, dev); return; } } extern struct ieee80211_hw *ieee80211_alloc_hw_nm(size_t , struct ieee80211_ops const * , char const * ) ; __inline static struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len , struct ieee80211_ops const *ops ) { struct ieee80211_hw *tmp ; { tmp = ieee80211_alloc_hw_nm(priv_data_len, ops, (char const *)0); return (tmp); } } __inline static struct ieee80211_hw *ldv_ieee80211_alloc_hw_208(size_t priv_data_len , struct ieee80211_ops const *ops ) ; extern void ieee80211_free_hw(struct ieee80211_hw * ) ; void ldv_ieee80211_free_hw_211(struct ieee80211_hw *ldv_func_arg1 ) ; void ldv_ieee80211_free_hw_213(struct ieee80211_hw *ldv_func_arg1 ) ; extern bool ath9k_hw_wait(struct ath_hw * , u32 , u32 , u32 , u32 ) ; extern bool ath9k_hw_disable(struct ath_hw * ) ; extern void ath9k_hw_name(struct ath_hw * , char * , size_t ) ; static struct pci_device_id const ath_pci_id_table[149U] = { {5772U, 35U, 4294967295U, 4294967295U, 0U, 0U, 0UL}, {5772U, 36U, 4294967295U, 4294967295U, 0U, 0U, 0UL}, {5772U, 39U, 4294967295U, 4294967295U, 0U, 0U, 0UL}, {5772U, 41U, 4294967295U, 4294967295U, 0U, 0U, 0UL}, {5772U, 42U, 4294967295U, 4294967295U, 0U, 0U, 0UL}, {5772U, 42U, 6715U, 7281U, 0U, 0U, 64UL}, {5772U, 42U, 4187U, 57375U, 0U, 0U, 64UL}, {5772U, 42U, 4525U, 26162U, 0U, 0U, 64UL}, {5772U, 42U, 4525U, 26178U, 0U, 0U, 64UL}, {5772U, 42U, 6706U, 774U, 0U, 0U, 64UL}, {5772U, 42U, 6239U, 12445U, 0U, 0U, 64UL}, {5772U, 42U, 4303U, 5244U, 0U, 0U, 64UL}, {5772U, 42U, 4303U, 5245U, 0U, 0U, 64UL}, {5772U, 42U, 4303U, 5430U, 0U, 0U, 64UL}, {5772U, 43U, 6715U, 11319U, 0U, 0U, 32UL}, {5772U, 43U, 4294967295U, 4294967295U, 0U, 0U, 0UL}, {5772U, 44U, 4294967295U, 4294967295U, 0U, 0U, 0UL}, {5772U, 45U, 4294967295U, 4294967295U, 0U, 0U, 0UL}, {5772U, 46U, 4294967295U, 4294967295U, 0U, 0U, 0UL}, {5772U, 48U, 6742U, 8192U, 0U, 0U, 1024UL}, {5772U, 48U, 6742U, 8193U, 0U, 0U, 1024UL}, {5772U, 48U, 4294967295U, 4294967295U, 0U, 0U, 0UL}, {5772U, 50U, 6715U, 8326U, 0U, 0U, 33UL}, {5772U, 50U, 6715U, 4663U, 0U, 0U, 33UL}, {5772U, 50U, 6715U, 8486U, 0U, 0U, 33UL}, {5772U, 50U, 6715U, 4714U, 0U, 0U, 33UL}, {5772U, 50U, 6715U, 8530U, 0U, 0U, 34UL}, {5772U, 50U, 4187U, 57461U, 0U, 0U, 34UL}, {5772U, 50U, 5772U, 12569U, 0U, 0U, 32UL}, {5772U, 50U, 5772U, 12578U, 0U, 0U, 32UL}, {5772U, 50U, 6239U, 12569U, 0U, 0U, 32UL}, {5772U, 50U, 6239U, 12327U, 0U, 0U, 32UL}, {5772U, 50U, 5197U, 16645U, 0U, 0U, 32UL}, {5772U, 50U, 5197U, 16646U, 0U, 0U, 32UL}, {5772U, 50U, 5197U, 16653U, 0U, 0U, 32UL}, {5772U, 50U, 5197U, 16654U, 0U, 0U, 32UL}, {5772U, 50U, 5197U, 16655U, 0U, 0U, 32UL}, {5772U, 50U, 5197U, 50950U, 0U, 0U, 32UL}, {5772U, 50U, 5197U, 50816U, 0U, 0U, 32UL}, {5772U, 50U, 5197U, 50952U, 0U, 0U, 32UL}, {5772U, 50U, 6058U, 12824U, 0U, 0U, 32UL}, {5772U, 50U, 6058U, 12825U, 0U, 0U, 32UL}, {5772U, 50U, 6715U, 11415U, 0U, 0U, 512UL}, {5772U, 50U, 6715U, 8448U, 0U, 0U, 512UL}, {5772U, 50U, 7254U, 16385U, 0U, 0U, 512UL}, {5772U, 50U, 4525U, 26151U, 0U, 0U, 512UL}, {5772U, 50U, 4525U, 26152U, 0U, 0U, 512UL}, {5772U, 50U, 4187U, 57422U, 0U, 0U, 512UL}, {5772U, 50U, 4187U, 57423U, 0U, 0U, 512UL}, {5772U, 50U, 5199U, 29079U, 0U, 0U, 512UL}, {5772U, 50U, 7066U, 8192U, 0U, 0U, 512UL}, {5772U, 50U, 7066U, 8193U, 0U, 0U, 512UL}, {5772U, 50U, 6715U, 4486U, 0U, 0U, 512UL}, {5772U, 50U, 6715U, 8070U, 0U, 0U, 512UL}, {5772U, 50U, 6715U, 4501U, 0U, 0U, 512UL}, {5772U, 50U, 6715U, 8085U, 0U, 0U, 512UL}, {5772U, 50U, 7066U, 7168U, 0U, 0U, 512UL}, {5772U, 50U, 7066U, 7169U, 0U, 0U, 512UL}, {5772U, 50U, 4163U, 34061U, 0U, 0U, 512UL}, {5772U, 50U, 4294967295U, 4294967295U, 0U, 0U, 0UL}, {5772U, 51U, 4294967295U, 4294967295U, 0U, 0U, 0UL}, {5772U, 52U, 6715U, 8470U, 0U, 0U, 4UL}, {5772U, 52U, 4525U, 26209U, 0U, 0U, 4UL}, {5772U, 52U, 5772U, 12567U, 0U, 0U, 16UL}, {5772U, 52U, 6058U, 12820U, 0U, 0U, 16UL}, {5772U, 52U, 6505U, 145U, 0U, 0U, 16UL}, {5772U, 52U, 6715U, 8464U, 0U, 0U, 16UL}, {5772U, 52U, 4163U, 34062U, 0U, 0U, 16UL}, {5772U, 52U, 4525U, 26161U, 0U, 0U, 16UL}, {5772U, 52U, 4525U, 26177U, 0U, 0U, 16UL}, {5772U, 52U, 4156U, 6244U, 0U, 0U, 16UL}, {5772U, 52U, 5325U, 99U, 0U, 0U, 16UL}, {5772U, 52U, 5325U, 100U, 0U, 0U, 16UL}, {5772U, 52U, 4303U, 6019U, 0U, 0U, 16UL}, {5772U, 48U, 6742U, 8195U, 0U, 0U, 1024UL}, {5772U, 52U, 4294967295U, 4294967295U, 0U, 0U, 0UL}, {5772U, 55U, 4294967295U, 4294967295U, 0U, 0U, 0UL}, {5772U, 54U, 5772U, 12328U, 0U, 0U, 296UL}, {5772U, 54U, 6715U, 8566U, 0U, 0U, 296UL}, {5772U, 54U, 4187U, 57448U, 0U, 0U, 128UL}, {5772U, 54U, 6239U, 41241U, 0U, 0U, 128UL}, {5772U, 54U, 4525U, 1586U, 0U, 0U, 128UL}, {5772U, 54U, 4525U, 1714U, 0U, 0U, 128UL}, {5772U, 54U, 4525U, 2114U, 0U, 0U, 128UL}, {5772U, 54U, 4525U, 6210U, 0U, 0U, 128UL}, {5772U, 54U, 4525U, 26225U, 0U, 0U, 128UL}, {5772U, 54U, 7066U, 10257U, 0U, 0U, 128UL}, {5772U, 54U, 7066U, 10258U, 0U, 0U, 128UL}, {5772U, 54U, 7066U, 10401U, 0U, 0U, 128UL}, {5772U, 54U, 7066U, 10403U, 0U, 0U, 128UL}, {5772U, 54U, 6715U, 8586U, 0U, 0U, 128UL}, {5772U, 54U, 6715U, 12170U, 0U, 0U, 128UL}, {5772U, 54U, 5772U, 12325U, 0U, 0U, 160UL}, {5772U, 54U, 5772U, 12326U, 0U, 0U, 160UL}, {5772U, 54U, 5772U, 12331U, 0U, 0U, 160UL}, {5772U, 54U, 4187U, 57449U, 0U, 0U, 160UL}, {5772U, 54U, 6239U, 12328U, 0U, 0U, 160UL}, {5772U, 54U, 4525U, 1570U, 0U, 0U, 160UL}, {5772U, 54U, 4525U, 1650U, 0U, 0U, 160UL}, {5772U, 54U, 4525U, 1634U, 0U, 0U, 160UL}, {5772U, 54U, 4525U, 1698U, 0U, 0U, 160UL}, {5772U, 54U, 4525U, 1666U, 0U, 0U, 160UL}, {5772U, 54U, 6715U, 8506U, 0U, 0U, 160UL}, {5772U, 54U, 6715U, 8508U, 0U, 0U, 160UL}, {5772U, 54U, 4156U, 6371U, 0U, 0U, 160UL}, {5772U, 54U, 4156U, 8575U, 0U, 0U, 160UL}, {5772U, 54U, 4156U, 8197U, 0U, 0U, 160UL}, {5772U, 54U, 4136U, 524U, 0U, 0U, 160UL}, {5772U, 54U, 5197U, 16666U, 0U, 0U, 288UL}, {5772U, 54U, 5197U, 16667U, 0U, 0U, 288UL}, {5772U, 54U, 5197U, 16668U, 0U, 0U, 288UL}, {5772U, 54U, 5197U, 16669U, 0U, 0U, 288UL}, {5772U, 54U, 5197U, 16670U, 0U, 0U, 288UL}, {5772U, 54U, 5197U, 16681U, 0U, 0U, 288UL}, {5772U, 54U, 5197U, 16682U, 0U, 0U, 288UL}, {5772U, 54U, 5772U, 12327U, 0U, 0U, 288UL}, {5772U, 54U, 5772U, 12332U, 0U, 0U, 288UL}, {5772U, 54U, 4525U, 1602U, 0U, 0U, 288UL}, {5772U, 54U, 4525U, 1618U, 0U, 0U, 288UL}, {5772U, 54U, 4525U, 1554U, 0U, 0U, 288UL}, {5772U, 54U, 4525U, 2098U, 0U, 0U, 288UL}, {5772U, 54U, 4525U, 6194U, 0U, 0U, 288UL}, {5772U, 54U, 4525U, 1682U, 0U, 0U, 288UL}, {5772U, 54U, 4525U, 2051U, 0U, 0U, 288UL}, {5772U, 54U, 4525U, 2067U, 0U, 0U, 288UL}, {5772U, 54U, 6715U, 8496U, 0U, 0U, 288UL}, {5772U, 54U, 6715U, 8507U, 0U, 0U, 288UL}, {5772U, 54U, 6715U, 8578U, 0U, 0U, 288UL}, {5772U, 54U, 6715U, 8587U, 0U, 0U, 288UL}, {5772U, 54U, 6715U, 8588U, 0U, 0U, 288UL}, {5772U, 54U, 6715U, 12162U, 0U, 0U, 288UL}, {5772U, 54U, 5199U, 29186U, 0U, 0U, 288UL}, {5772U, 54U, 7066U, 10256U, 0U, 0U, 288UL}, {5772U, 54U, 7066U, 10259U, 0U, 0U, 288UL}, {5772U, 54U, 7066U, 10402U, 0U, 0U, 288UL}, {5772U, 54U, 7066U, 10404U, 0U, 0U, 288UL}, {5772U, 54U, 6239U, 12327U, 0U, 0U, 288UL}, {5772U, 54U, 6239U, 41248U, 0U, 0U, 288UL}, {5772U, 54U, 4187U, 57471U, 0U, 0U, 288UL}, {5772U, 54U, 4187U, 57487U, 0U, 0U, 288UL}, {5772U, 54U, 4187U, 57473U, 0U, 0U, 288UL}, {5772U, 54U, 4187U, 57489U, 0U, 0U, 288UL}, {5772U, 54U, 4187U, 57497U, 0U, 0U, 288UL}, {5772U, 54U, 6058U, 12326U, 0U, 0U, 288UL}, {5772U, 54U, 6058U, 16422U, 0U, 0U, 288UL}, {5772U, 54U, 4163U, 34290U, 0U, 0U, 288UL}, {5772U, 54U, 4136U, 526U, 0U, 0U, 2336UL}, {5772U, 54U, 4294967295U, 4294967295U, 0U, 0U, 32UL}, {0U, 0U, 0U, 0U, 0U, 0U, 0UL}}; static void ath_pci_read_cachesize(struct ath_common *common , int *csz ) { struct ath_softc *sc ; u8 u8tmp ; struct device const *__mptr ; { sc = (struct ath_softc *)common->priv; __mptr = (struct device const *)sc->dev; pci_read_config_byte((struct pci_dev const *)((struct pci_dev *)__mptr + 0xffffffffffffff68UL), 12, & u8tmp); *csz = (int )u8tmp; if (*csz == 0) { *csz = 8; } else { } return; } } static bool ath_pci_eeprom_read(struct ath_common *common , u32 off , u16 *data ) { struct ath_softc *sc ; struct ath9k_platform_data *pdata ; struct ath_hw *ah ; bool tmp ; int tmp___0 ; unsigned int tmp___1 ; { sc = (struct ath_softc *)common->priv; pdata = (struct ath9k_platform_data *)(sc->dev)->platform_data; if ((unsigned long )pdata != (unsigned long )((struct ath9k_platform_data *)0) && ! pdata->use_eeprom) { if (off > 2047U) { ath_printk("\v", (struct ath_common const *)common, "%s: eeprom read failed, offset %08x is out of range\n", "ath_pci_eeprom_read", off); } else { } *data = pdata->eeprom_data[off]; } else { ah = (struct ath_hw *)common->ah; (*((common->ops)->read))((void *)ah, (off << 2) + 8192U); tmp = ath9k_hw_wait(ah, ah->hw_version.macVersion != 768U ? (ah->hw_version.macVersion > 447U ? 16516U : 16508U) : 16584U, 327680U, 0U, 100000U); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { return (0); } else { } tmp___1 = (*((common->ops)->read))((void *)ah, ah->hw_version.macVersion != 768U ? (ah->hw_version.macVersion > 447U ? 16516U : 16508U) : 16584U); *data = (u16 )tmp___1; } return (1); } } static void ath_pci_aspm_init(struct ath_common *common ) { struct ath_softc *sc ; struct ath_hw *ah ; struct pci_dev *pdev ; struct device const *__mptr ; struct pci_dev *parent ; u16 aspm ; enum ath_btcoex_scheme tmp ; { sc = (struct ath_softc *)common->priv; ah = sc->sc_ah; __mptr = (struct device const *)sc->dev; pdev = (struct pci_dev *)__mptr + 0xffffffffffffff68UL; if (! ah->is_pciexpress) { return; } else { } parent = (pdev->bus)->self; if ((unsigned long )parent == (unsigned long )((struct pci_dev *)0)) { return; } else { } tmp = ath9k_hw_get_btcoex_scheme(ah); if ((unsigned int )tmp != 0U && ah->hw_version.macVersion == 192U) { pcie_capability_clear_word(pdev, 16, 3); pcie_capability_clear_word(parent, 16, 3); ath_printk("\016", (struct ath_common const *)common, "Disabling ASPM since BTCOEX is enabled\n"); return; } else { } if (ah->hw_version.macVersion == 640U) { pci_read_config_dword((struct pci_dev const *)pdev, 1804, & ah->config.aspm_l1_fix); } else { } pcie_capability_read_word(parent, 16, & aspm); if (((int )aspm & 3) != 0) { ah->aspm_enabled = 1; ath9k_hw_configpcipowersave(ah, 0); ath_printk("\016", (struct ath_common const *)common, "ASPM enabled: 0x%x\n", (int )aspm); } else { } return; } } static struct ath_bus_ops const ath_pci_bus_ops = {0, & ath_pci_read_cachesize, & ath_pci_eeprom_read, 0, & ath_pci_aspm_init}; static int ath_pci_probe(struct pci_dev *pdev , struct pci_device_id const *id ) { struct ath_softc *sc ; struct ieee80211_hw *hw ; u8 csz ; u32 val ; int ret ; char hw_name[64U] ; int tmp ; void * const *tmp___0 ; { ret = 0; tmp = pcim_enable_device(pdev); if (tmp != 0) { return (-5); } else { } ret = pci_set_dma_mask(pdev, 4294967295ULL); if (ret != 0) { printk("\vath9k: 32-bit DMA not available\n"); return (ret); } else { } ret = pci_set_consistent_dma_mask(pdev, 4294967295ULL); if (ret != 0) { printk("\vath9k: 32-bit DMA consistent DMA enable failed\n"); return (ret); } else { } pci_read_config_byte((struct pci_dev const *)pdev, 12, & csz); if ((unsigned int )csz == 0U) { csz = 16U; pci_write_config_byte((struct pci_dev const *)pdev, 12, (int )csz); } else { } pci_write_config_byte((struct pci_dev const *)pdev, 13, 168); pci_set_master(pdev); pci_read_config_dword((struct pci_dev const *)pdev, 64, & val); if ((val & 65280U) != 0U) { pci_write_config_dword((struct pci_dev const *)pdev, 64, val & 4294902015U); } else { } ret = pcim_iomap_regions(pdev, 1, "ath9k"); if (ret != 0) { dev_err((struct device const *)(& pdev->dev), "PCI memory region reserve error\n"); return (-19); } else { } ath9k_fill_chanctx_ops(); hw = ldv_ieee80211_alloc_hw_208(15648UL, (struct ieee80211_ops const *)(& ath9k_ops)); if ((unsigned long )hw == (unsigned long )((struct ieee80211_hw *)0)) { dev_err((struct device const *)(& pdev->dev), "No memory for ieee80211_hw\n"); return (-12); } else { } SET_IEEE80211_DEV(hw, & pdev->dev); pci_set_drvdata(pdev, (void *)hw); sc = (struct ath_softc *)hw->priv; sc->hw = hw; sc->dev = & pdev->dev; tmp___0 = pcim_iomap_table(pdev); sc->mem = *tmp___0; sc->driver_data = id->driver_data; ret = ldv_request_irq_209(pdev->irq, & ath_isr, 128UL, "ath9k", (void *)sc); if (ret != 0) { dev_err((struct device const *)(& pdev->dev), "request_irq failed\n"); goto err_irq; } else { } sc->irq = (int )pdev->irq; ret = ath9k_init_device((int )((u16 )id->device), sc, & ath_pci_bus_ops); if (ret != 0) { dev_err((struct device const *)(& pdev->dev), "Failed to initialize device\n"); goto err_init; } else { } ath9k_hw_name(sc->sc_ah, (char *)(& hw_name), 64UL); _dev_info((struct device const *)(& (hw->wiphy)->dev), "%s mem=0x%lx, irq=%d\n", (char *)(& hw_name), (unsigned long )sc->mem, pdev->irq); return (0); err_init: ldv_free_irq_210((unsigned int )sc->irq, (void *)sc); err_irq: ldv_ieee80211_free_hw_211(hw); return (ret); } } static void ath_pci_remove(struct pci_dev *pdev ) { struct ieee80211_hw *hw ; void *tmp ; struct ath_softc *sc ; { tmp = pci_get_drvdata(pdev); hw = (struct ieee80211_hw *)tmp; sc = (struct ath_softc *)hw->priv; if (! is_ath9k_unloaded) { (sc->sc_ah)->ah_flags = (sc->sc_ah)->ah_flags | 2U; } else { } ath9k_deinit_device(sc); ldv_free_irq_212((unsigned int )sc->irq, (void *)sc); ldv_ieee80211_free_hw_213(sc->hw); return; } } static int ath_pci_suspend(struct device *device ) { struct pci_dev *pdev ; struct device const *__mptr ; struct ieee80211_hw *hw ; void *tmp ; struct ath_softc *sc ; struct ath_common *common ; struct ath_common *tmp___0 ; int tmp___1 ; { __mptr = (struct device const *)device; pdev = (struct pci_dev *)__mptr + 0xffffffffffffff68UL; tmp = pci_get_drvdata(pdev); hw = (struct ieee80211_hw *)tmp; sc = (struct ath_softc *)hw->priv; tmp___0 = ath9k_hw_common(sc->sc_ah); common = tmp___0; tmp___1 = constant_test_bit(7L, (unsigned long const volatile *)(& common->op_flags)); if (tmp___1 != 0) { _dev_info((struct device const *)(& pdev->dev), "WOW is enabled, bypassing PCI suspend\n"); return (0); } else { } ath9k_stop_btcoex(sc); ath9k_hw_disable(sc->sc_ah); ldv_del_timer_sync_214(& sc->sleep_timer); ath9k_hw_setpower(sc->sc_ah, 1); return (0); } } static int ath_pci_resume(struct device *device ) { struct pci_dev *pdev ; struct device const *__mptr ; struct ieee80211_hw *hw ; void *tmp ; struct ath_softc *sc ; struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp___0 ; u32 val ; { __mptr = (struct device const *)device; pdev = (struct pci_dev *)__mptr + 0xffffffffffffff68UL; tmp = pci_get_drvdata(pdev); hw = (struct ieee80211_hw *)tmp; sc = (struct ath_softc *)hw->priv; ah = sc->sc_ah; tmp___0 = ath9k_hw_common(ah); common = tmp___0; pci_read_config_dword((struct pci_dev const *)pdev, 64, & val); if ((val & 65280U) != 0U) { pci_write_config_dword((struct pci_dev const *)pdev, 64, val & 4294902015U); } else { } ath_pci_aspm_init(common); ah->reset_power_on = 0; return (0); } } static struct dev_pm_ops const ath9k_pm_ops = {0, 0, & ath_pci_suspend, & ath_pci_resume, & ath_pci_suspend, & ath_pci_resume, & ath_pci_suspend, & ath_pci_resume, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; struct pci_device_id const __mod_pci__ath_pci_id_table_device_table[149U] ; static struct pci_driver ath_pci_driver = {{0, 0}, "ath9k", (struct pci_device_id const *)(& ath_pci_id_table), & ath_pci_probe, & ath_pci_remove, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0, (_Bool)0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & ath9k_pm_ops, 0}, {{{{{{0}}, 0U, 0U, 0, {0, {0, 0}, 0, 0, 0UL}}}}, {0, 0}}}; int ath_pci_init(void) { int tmp ; { tmp = ldv___pci_register_driver_215(& ath_pci_driver, & __this_module, "ath9k"); return (tmp); } } void ath_pci_exit(void) { { ldv_pci_unregister_driver_216(& ath_pci_driver); return; } } extern int ldv_resume_noirq_36(void) ; int ldv_retval_20 ; extern int ldv_resume_early_36(void) ; extern int ldv_freeze_late_36(void) ; int ldv_retval_33 ; int ldv_retval_35 ; int ldv_retval_26 ; int ldv_retval_23 ; int ldv_retval_28 ; int ldv_retval_25 ; int ldv_retval_22 ; int ldv_retval_36 ; int ldv_retval_27 ; int ldv_retval_15 ; extern int ldv_freeze_noirq_36(void) ; extern int ldv_probe_37(void) ; int ldv_retval_37 ; extern int ldv_poweroff_noirq_36(void) ; extern int ldv_thaw_noirq_36(void) ; extern int ldv_suspend_noirq_36(void) ; extern int ldv_restore_early_36(void) ; int ldv_retval_29 ; int ldv_retval_24 ; extern int ldv_thaw_early_36(void) ; int ldv_retval_32 ; extern int ldv_suspend_late_36(void) ; int ldv_retval_31 ; int ldv_retval_38 ; extern int ldv_poweroff_late_36(void) ; int ldv_retval_21 ; extern int ldv_complete_36(void) ; int ldv_retval_34 ; extern int ldv_restore_noirq_36(void) ; extern int ldv_prepare_36(void) ; extern int ldv_release_37(void) ; int ldv_retval_30 ; extern int ldv_shutdown_35(void) ; int reg_check_1(irqreturn_t (*handler)(int , void * ) ) { { if ((unsigned long )handler == (unsigned long )(& ath_isr)) { return (1); } else { } return (0); } } void ldv_dev_pm_ops_36(void) { void *tmp ; { tmp = ldv_init_zalloc(1416UL); ath9k_pm_ops_group1 = (struct device *)tmp; return; } } void ldv_initialize_ath_bus_ops_37(void) { void *tmp ; { tmp = ldv_init_zalloc(680UL); ath_pci_bus_ops_group0 = (struct ath_common *)tmp; return; } } void ldv_pci_driver_35(void) { void *tmp ; { tmp = ldv_init_zalloc(2976UL); ath_pci_driver_group1 = (struct pci_dev *)tmp; 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_55864; 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_55864; 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_55864; 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_55864; default: ldv_stop(); } ldv_55864: ; 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; } } 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 = ath_isr(line, data); LDV_IN_INTERRUPT = 1; return (state); } else { } goto ldv_55884; default: ldv_stop(); } ldv_55884: ; } else { } return (state); } } void ldv_main_exported_35(void) { struct pci_device_id *ldvarg89 ; void *tmp ; int tmp___0 ; { tmp = ldv_init_zalloc(32UL); ldvarg89 = (struct pci_device_id *)tmp; tmp___0 = __VERIFIER_nondet_int(); switch (tmp___0) { case 0: ; if (ldv_state_variable_35 == 1) { ldv_retval_15 = ath_pci_probe(ath_pci_driver_group1, (struct pci_device_id const *)ldvarg89); if (ldv_retval_15 == 0) { ldv_state_variable_35 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_55891; case 1: ; if (ldv_state_variable_35 == 2) { ath_pci_remove(ath_pci_driver_group1); ldv_state_variable_35 = 1; } else { } goto ldv_55891; case 2: ; if (ldv_state_variable_35 == 2) { ldv_shutdown_35(); ldv_state_variable_35 = 2; } else { } goto ldv_55891; default: ldv_stop(); } ldv_55891: ; return; } } void ldv_main_exported_36(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_state_variable_36 == 2) { ldv_retval_38 = ath_pci_suspend(ath9k_pm_ops_group1); if (ldv_retval_38 == 0) { ldv_state_variable_36 = 3; } else { } } else { } goto ldv_55899; case 1: ; if (ldv_state_variable_36 == 2) { ldv_retval_37 = ath_pci_suspend(ath9k_pm_ops_group1); if (ldv_retval_37 == 0) { ldv_state_variable_36 = 4; } else { } } else { } goto ldv_55899; case 2: ; if (ldv_state_variable_36 == 12) { ldv_retval_36 = ath_pci_resume(ath9k_pm_ops_group1); if (ldv_retval_36 == 0) { ldv_state_variable_36 = 15; } else { } } else { } goto ldv_55899; case 3: ; if (ldv_state_variable_36 == 14) { ldv_retval_35 = ath_pci_resume(ath9k_pm_ops_group1); if (ldv_retval_35 == 0) { ldv_state_variable_36 = 15; } else { } } else { } goto ldv_55899; case 4: ; if (ldv_state_variable_36 == 2) { ldv_retval_34 = ath_pci_suspend(ath9k_pm_ops_group1); if (ldv_retval_34 == 0) { ldv_state_variable_36 = 5; } else { } } else { } goto ldv_55899; case 5: ; if (ldv_state_variable_36 == 13) { ldv_retval_33 = ath_pci_resume(ath9k_pm_ops_group1); if (ldv_retval_33 == 0) { ldv_state_variable_36 = 15; } else { } } else { } goto ldv_55899; case 6: ; if (ldv_state_variable_36 == 3) { ldv_retval_32 = ldv_suspend_late_36(); if (ldv_retval_32 == 0) { ldv_state_variable_36 = 6; } else { } } else { } goto ldv_55899; case 7: ; if (ldv_state_variable_36 == 9) { ldv_retval_31 = ldv_restore_early_36(); if (ldv_retval_31 == 0) { ldv_state_variable_36 = 13; } else { } } else { } goto ldv_55899; case 8: ; if (ldv_state_variable_36 == 6) { ldv_retval_30 = ldv_resume_early_36(); if (ldv_retval_30 == 0) { ldv_state_variable_36 = 12; } else { } } else { } goto ldv_55899; case 9: ; if (ldv_state_variable_36 == 11) { ldv_retval_29 = ldv_thaw_early_36(); if (ldv_retval_29 == 0) { ldv_state_variable_36 = 14; } else { } } else { } goto ldv_55899; case 10: ; if (ldv_state_variable_36 == 7) { ldv_retval_28 = ldv_resume_noirq_36(); if (ldv_retval_28 == 0) { ldv_state_variable_36 = 12; } else { } } else { } goto ldv_55899; case 11: ; if (ldv_state_variable_36 == 5) { ldv_retval_27 = ldv_freeze_noirq_36(); if (ldv_retval_27 == 0) { ldv_state_variable_36 = 10; } else { } } else { } goto ldv_55899; case 12: ; if (ldv_state_variable_36 == 1) { ldv_retval_26 = ldv_prepare_36(); if (ldv_retval_26 == 0) { ldv_state_variable_36 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_55899; case 13: ; if (ldv_state_variable_36 == 5) { ldv_retval_25 = ldv_freeze_late_36(); if (ldv_retval_25 == 0) { ldv_state_variable_36 = 11; } else { } } else { } goto ldv_55899; case 14: ; if (ldv_state_variable_36 == 10) { ldv_retval_24 = ldv_thaw_noirq_36(); if (ldv_retval_24 == 0) { ldv_state_variable_36 = 14; } else { } } else { } goto ldv_55899; case 15: ; if (ldv_state_variable_36 == 4) { ldv_retval_23 = ldv_poweroff_noirq_36(); if (ldv_retval_23 == 0) { ldv_state_variable_36 = 8; } else { } } else { } goto ldv_55899; case 16: ; if (ldv_state_variable_36 == 4) { ldv_retval_22 = ldv_poweroff_late_36(); if (ldv_retval_22 == 0) { ldv_state_variable_36 = 9; } else { } } else { } goto ldv_55899; case 17: ; if (ldv_state_variable_36 == 8) { ldv_retval_21 = ldv_restore_noirq_36(); if (ldv_retval_21 == 0) { ldv_state_variable_36 = 13; } else { } } else { } goto ldv_55899; case 18: ; if (ldv_state_variable_36 == 3) { ldv_retval_20 = ldv_suspend_noirq_36(); if (ldv_retval_20 == 0) { ldv_state_variable_36 = 7; } else { } } else { } goto ldv_55899; case 19: ; if (ldv_state_variable_36 == 15) { ldv_complete_36(); ldv_state_variable_36 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_55899; default: ldv_stop(); } ldv_55899: ; return; } } void ldv_main_exported_37(void) { u32 ldvarg192 ; int *ldvarg193 ; void *tmp ; u16 *ldvarg191 ; void *tmp___0 ; int tmp___1 ; { tmp = ldv_init_zalloc(4UL); ldvarg193 = (int *)tmp; tmp___0 = ldv_init_zalloc(2UL); ldvarg191 = (u16 *)tmp___0; ldv_memset((void *)(& ldvarg192), 0, 4UL); tmp___1 = __VERIFIER_nondet_int(); switch (tmp___1) { case 0: ; if (ldv_state_variable_37 == 2) { ath_pci_read_cachesize(ath_pci_bus_ops_group0, ldvarg193); ldv_state_variable_37 = 2; } else { } goto ldv_55927; case 1: ; if (ldv_state_variable_37 == 2) { ath_pci_eeprom_read(ath_pci_bus_ops_group0, ldvarg192, ldvarg191); ldv_state_variable_37 = 2; } else { } if (ldv_state_variable_37 == 1) { ath_pci_eeprom_read(ath_pci_bus_ops_group0, ldvarg192, ldvarg191); ldv_state_variable_37 = 1; } else { } goto ldv_55927; case 2: ; if (ldv_state_variable_37 == 2) { ath_pci_aspm_init(ath_pci_bus_ops_group0); ldv_state_variable_37 = 2; } else { } if (ldv_state_variable_37 == 1) { ath_pci_aspm_init(ath_pci_bus_ops_group0); ldv_state_variable_37 = 1; } else { } goto ldv_55927; case 3: ; if (ldv_state_variable_37 == 2) { ldv_release_37(); ldv_state_variable_37 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_55927; case 4: ; if (ldv_state_variable_37 == 1) { ldv_probe_37(); ldv_state_variable_37 = 2; ref_cnt = ref_cnt + 1; } else { } goto ldv_55927; default: ldv_stop(); } ldv_55927: ; return; } } bool ldv_queue_work_on_203(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_204(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_205(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_206(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_7(2); return; } } bool ldv_queue_delayed_work_on_207(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } __inline static struct ieee80211_hw *ldv_ieee80211_alloc_hw_208(size_t priv_data_len , struct ieee80211_ops const *ops ) { ldv_func_ret_type___20 ldv_func_res ; struct ieee80211_hw *tmp ; { tmp = ieee80211_alloc_hw(priv_data_len, ops); ldv_func_res = tmp; if ((unsigned long )ldv_func_res != (unsigned long )((ldv_func_ret_type___20 )0)) { ldv_state_variable_38 = 1; ldv_initialize_ieee80211_ops_38(); ath9k_ops_group0 = ldv_func_res; } else { } return (ldv_func_res); } } __inline static int ldv_request_irq_209(unsigned int irq , irqreturn_t (*handler)(int , void * ) , unsigned long flags , char const *name , void *dev ) { ldv_func_ret_type___4 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = request_irq(irq, handler, flags, name, dev); ldv_func_res = tmp; tmp___0 = reg_check_2(handler); if (tmp___0 != 0 && ldv_func_res == 0) { activate_suitable_irq_2((int )irq, dev); } else { } return (ldv_func_res); } } void ldv_free_irq_210(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; } } void ldv_ieee80211_free_hw_211(struct ieee80211_hw *ldv_func_arg1 ) { { ieee80211_free_hw(ldv_func_arg1); if ((unsigned long )ath9k_ops_group0 == (unsigned long )ldv_func_arg1) { ldv_state_variable_38 = 0; } else { } return; } } void ldv_free_irq_212(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; } } void ldv_ieee80211_free_hw_213(struct ieee80211_hw *ldv_func_arg1 ) { { ieee80211_free_hw(ldv_func_arg1); if ((unsigned long )ath9k_ops_group0 == (unsigned long )ldv_func_arg1) { ldv_state_variable_38 = 0; } else { } return; } } int ldv_del_timer_sync_214(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___5 ldv_func_res ; int tmp ; { tmp = del_timer_sync(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_14(ldv_func_arg1); return (ldv_func_res); } } int ldv___pci_register_driver_215(struct pci_driver *ldv_func_arg1 , struct module *ldv_func_arg2 , char const *ldv_func_arg3 ) { ldv_func_ret_type___6 ldv_func_res ; int tmp ; { tmp = __pci_register_driver(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; ldv_state_variable_35 = 1; ldv_pci_driver_35(); return (ldv_func_res); } } void ldv_pci_unregister_driver_216(struct pci_driver *ldv_func_arg1 ) { { pci_unregister_driver(ldv_func_arg1); ldv_state_variable_35 = 0; return; } } bool ldv_queue_work_on_235(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_237(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_236(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; bool ldv_queue_delayed_work_on_239(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; void ldv_flush_workqueue_238(struct workqueue_struct *ldv_func_arg1 ) ; __inline static resource_size_t resource_size(struct resource const *res ) { { return (((unsigned long long )res->end - (unsigned long long )res->start) + 1ULL); } } void ldv_platform_probe_33(int (*probe)(struct platform_device * ) ) ; void ldv_platform_driver_init_33(void) ; int ldv_irq_2(int state , int line , void *data ) ; void choose_interrupt_2(void) ; __inline static void *dev_get_platdata(struct device const *dev ) { { return ((void *)dev->platform_data); } } extern struct resource *platform_get_resource(struct platform_device * , unsigned int , unsigned int ) ; extern int __platform_driver_register(struct platform_driver * , struct module * ) ; int ldv___platform_driver_register_246(struct platform_driver *ldv_func_arg1 , struct module *ldv_func_arg2 ) ; extern void platform_driver_unregister(struct platform_driver * ) ; void ldv_platform_driver_unregister_247(struct platform_driver *ldv_func_arg1 ) ; __inline static void *platform_get_drvdata(struct platform_device const *pdev ) { void *tmp ; { tmp = dev_get_drvdata(& pdev->dev); return (tmp); } } __inline static void platform_set_drvdata(struct platform_device *pdev , void *data ) { { dev_set_drvdata(& pdev->dev, data); return; } } extern void *devm_ioremap_nocache(struct device * , resource_size_t , resource_size_t ) ; __inline static int ldv_request_irq_209(unsigned int irq , irqreturn_t (*handler)(int , void * ) , unsigned long flags , char const *name , void *dev ) ; void ldv_free_irq_242(unsigned int ldv_func_arg1 , void *ldv_func_arg2 ) ; void ldv_free_irq_244(unsigned int ldv_func_arg1 , void *ldv_func_arg2 ) ; __inline static struct ieee80211_hw *ldv_ieee80211_alloc_hw_208(size_t priv_data_len , struct ieee80211_ops const *ops ) ; void ldv_ieee80211_free_hw_243(struct ieee80211_hw *ldv_func_arg1 ) ; void ldv_ieee80211_free_hw_245(struct ieee80211_hw *ldv_func_arg1 ) ; static struct platform_device_id const ath9k_platform_id_table[7U] = { {{'a', 't', 'h', '9', 'k', '\000'}, 11UL}, {{'a', 'r', '9', '3', '3', 'x', '_', 'w', 'm', 'a', 'c', '\000'}, 53UL}, {{'a', 'r', '9', '3', '4', 'x', '_', 'w', 'm', 'a', 'c', '\000'}, 49UL}, {{'q', 'c', 'a', '9', '5', '5', 'x', '_', 'w', 'm', 'a', 'c', '\000'}, 56UL}, {{'q', 'c', 'a', '9', '5', '3', 'x', '_', 'w', 'm', 'a', 'c', '\000'}, 61UL}, {{'q', 'c', 'a', '9', '5', '6', 'x', '_', 'w', 'm', 'a', 'c', '\000'}, 63UL}}; static void ath_ahb_read_cachesize(struct ath_common *common , int *csz ) { { *csz = 16; return; } } static bool ath_ahb_eeprom_read(struct ath_common *common , u32 off , u16 *data ) { struct ath_softc *sc ; struct platform_device *pdev ; struct device const *__mptr ; struct ath9k_platform_data *pdata ; void *tmp ; { sc = (struct ath_softc *)common->priv; __mptr = (struct device const *)sc->dev; pdev = (struct platform_device *)__mptr + 0xfffffffffffffff0UL; tmp = dev_get_platdata((struct device const *)(& pdev->dev)); pdata = (struct ath9k_platform_data *)tmp; if (off > 2047U) { ath_printk("\v", (struct ath_common const *)common, "%s: flash read failed, offset %08x is out of range\n", "ath_ahb_eeprom_read", off); return (0); } else { } *data = pdata->eeprom_data[off]; return (1); } } static struct ath_bus_ops ath_ahb_bus_ops = {1, & ath_ahb_read_cachesize, & ath_ahb_eeprom_read, 0, 0}; static int ath_ahb_probe(struct platform_device *pdev ) { void *mem ; struct ath_softc *sc ; struct ieee80211_hw *hw ; struct resource *res ; struct platform_device_id const *id ; int irq ; int ret ; struct ath_hw *ah ; char hw_name[64U] ; void *tmp ; resource_size_t tmp___0 ; { id = pdev->id_entry; ret = 0; tmp = dev_get_platdata((struct device const *)(& pdev->dev)); if ((unsigned long )tmp == (unsigned long )((void *)0)) { dev_err((struct device const *)(& pdev->dev), "no platform data specified\n"); return (-22); } else { } res = platform_get_resource(pdev, 512U, 0U); if ((unsigned long )res == (unsigned long )((struct resource *)0)) { dev_err((struct device const *)(& pdev->dev), "no memory resource found\n"); return (-6); } else { } tmp___0 = resource_size((struct resource const *)res); mem = devm_ioremap_nocache(& pdev->dev, res->start, tmp___0); if ((unsigned long )mem == (unsigned long )((void *)0)) { dev_err((struct device const *)(& pdev->dev), "ioremap failed\n"); return (-12); } else { } res = platform_get_resource(pdev, 1024U, 0U); if ((unsigned long )res == (unsigned long )((struct resource *)0)) { dev_err((struct device const *)(& pdev->dev), "no IRQ resource found\n"); return (-6); } else { } irq = (int )res->start; ath9k_fill_chanctx_ops(); hw = ldv_ieee80211_alloc_hw_208(15648UL, (struct ieee80211_ops const *)(& ath9k_ops)); if ((unsigned long )hw == (unsigned long )((struct ieee80211_hw *)0)) { dev_err((struct device const *)(& pdev->dev), "no memory for ieee80211_hw\n"); return (-12); } else { } SET_IEEE80211_DEV(hw, & pdev->dev); platform_set_drvdata(pdev, (void *)hw); sc = (struct ath_softc *)hw->priv; sc->hw = hw; sc->dev = & pdev->dev; sc->mem = mem; sc->irq = irq; ret = ldv_request_irq_209((unsigned int )irq, & ath_isr, 128UL, "ath9k", (void *)sc); if (ret != 0) { dev_err((struct device const *)(& pdev->dev), "request_irq failed\n"); goto err_free_hw; } else { } ret = ath9k_init_device((int )((u16 )id->driver_data), sc, (struct ath_bus_ops const *)(& ath_ahb_bus_ops)); if (ret != 0) { dev_err((struct device const *)(& pdev->dev), "failed to initialize device\n"); goto err_irq; } else { } ah = sc->sc_ah; ath9k_hw_name(ah, (char *)(& hw_name), 64UL); _dev_info((struct device const *)(& (hw->wiphy)->dev), "%s mem=0x%lx, irq=%d\n", (char *)(& hw_name), (unsigned long )mem, irq); return (0); err_irq: ldv_free_irq_242((unsigned int )irq, (void *)sc); err_free_hw: ldv_ieee80211_free_hw_243(hw); return (ret); } } static int ath_ahb_remove(struct platform_device *pdev ) { struct ieee80211_hw *hw ; void *tmp ; struct ath_softc *sc ; { tmp = platform_get_drvdata((struct platform_device const *)pdev); hw = (struct ieee80211_hw *)tmp; if ((unsigned long )hw != (unsigned long )((struct ieee80211_hw *)0)) { sc = (struct ath_softc *)hw->priv; ath9k_deinit_device(sc); ldv_free_irq_244((unsigned int )sc->irq, (void *)sc); ldv_ieee80211_free_hw_245(sc->hw); } else { } return (0); } } static struct platform_driver ath_ahb_driver = {& ath_ahb_probe, & ath_ahb_remove, 0, 0, 0, {"ath9k", 0, 0, 0, (_Bool)0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, (struct platform_device_id const *)(& ath9k_platform_id_table), (_Bool)0}; struct platform_device_id const __mod_platform__ath9k_platform_id_table_device_table[7U] ; int ath_ahb_init(void) { int tmp ; { tmp = ldv___platform_driver_register_246(& ath_ahb_driver, & __this_module); return (tmp); } } void ath_ahb_exit(void) { { ldv_platform_driver_unregister_247(& ath_ahb_driver); return; } } int ldv_retval_0 ; extern int ldv_release_34(void) ; int ldv_retval_1 ; extern int ldv_probe_34(void) ; 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 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 ldv_platform_probe_33(int (*probe)(struct platform_device * ) ) { int err ; { err = (*probe)(ath_ahb_driver_group1); if (err == 0) { probed_33 = 1; ref_cnt = ref_cnt + 1; } else { } return; } } int reg_check_2(irqreturn_t (*handler)(int , void * ) ) { { if ((unsigned long )handler == (unsigned long )(& ath_isr)) { return (1); } else { } return (0); } } void ldv_platform_driver_init_33(void) { void *tmp ; { tmp = ldv_init_zalloc(1472UL); ath_ahb_driver_group1 = (struct platform_device *)tmp; return; } } void ldv_initialize_ath_bus_ops_34(void) { void *tmp ; { tmp = ldv_init_zalloc(680UL); ath_ahb_bus_ops_group0 = (struct ath_common *)tmp; 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 = ath_isr(line, data); LDV_IN_INTERRUPT = 1; return (state); } else { } goto ldv_54319; default: ldv_stop(); } ldv_54319: ; } else { } return (state); } } 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_54325; 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_54325; 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_54325; 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_54325; default: ldv_stop(); } ldv_54325: ; return; } } void ldv_main_exported_33(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_state_variable_33 == 1) { ldv_retval_1 = ath_ahb_probe(ath_ahb_driver_group1); if (ldv_retval_1 == 0) { ldv_state_variable_33 = 2; ref_cnt = ref_cnt + 1; probed_33 = 1; } else { } } else { } goto ldv_54334; case 1: ; if (ldv_state_variable_33 == 1 && probed_33 == 1) { ldv_retval_0 = ath_ahb_remove(ath_ahb_driver_group1); if (ldv_retval_0 == 0) { ldv_state_variable_33 = 1; ref_cnt = ref_cnt - 1; probed_33 = 0; } else { } } else { } if (ldv_state_variable_33 == 2 && probed_33 == 1) { ldv_retval_0 = ath_ahb_remove(ath_ahb_driver_group1); if (ldv_retval_0 == 0) { ldv_state_variable_33 = 1; ref_cnt = ref_cnt - 1; probed_33 = 0; } else { } } else { } goto ldv_54334; default: ldv_stop(); } ldv_54334: ; return; } } void ldv_main_exported_34(void) { u16 *ldvarg188 ; void *tmp ; u32 ldvarg189 ; int *ldvarg190 ; void *tmp___0 ; int tmp___1 ; { tmp = ldv_init_zalloc(2UL); ldvarg188 = (u16 *)tmp; tmp___0 = ldv_init_zalloc(4UL); ldvarg190 = (int *)tmp___0; ldv_memset((void *)(& ldvarg189), 0, 4UL); tmp___1 = __VERIFIER_nondet_int(); switch (tmp___1) { case 0: ; if (ldv_state_variable_34 == 2) { ath_ahb_read_cachesize(ath_ahb_bus_ops_group0, ldvarg190); ldv_state_variable_34 = 2; } else { } goto ldv_54344; case 1: ; if (ldv_state_variable_34 == 2) { ath_ahb_eeprom_read(ath_ahb_bus_ops_group0, ldvarg189, ldvarg188); ldv_state_variable_34 = 2; } else { } if (ldv_state_variable_34 == 1) { ath_ahb_eeprom_read(ath_ahb_bus_ops_group0, ldvarg189, ldvarg188); ldv_state_variable_34 = 1; } else { } goto ldv_54344; case 2: ; if (ldv_state_variable_34 == 2) { ldv_release_34(); ldv_state_variable_34 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_54344; case 3: ; if (ldv_state_variable_34 == 1) { ldv_probe_34(); ldv_state_variable_34 = 2; ref_cnt = ref_cnt + 1; } else { } goto ldv_54344; default: ldv_stop(); } ldv_54344: ; return; } } bool ldv_queue_work_on_235(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_236(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_237(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_238(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_7(2); return; } } bool ldv_queue_delayed_work_on_239(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } void ldv_free_irq_242(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; } } void ldv_ieee80211_free_hw_243(struct ieee80211_hw *ldv_func_arg1 ) { { ieee80211_free_hw(ldv_func_arg1); if ((unsigned long )ath9k_ops_group0 == (unsigned long )ldv_func_arg1) { ldv_state_variable_38 = 0; } else { } return; } } void ldv_free_irq_244(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; } } void ldv_ieee80211_free_hw_245(struct ieee80211_hw *ldv_func_arg1 ) { { ieee80211_free_hw(ldv_func_arg1); if ((unsigned long )ath9k_ops_group0 == (unsigned long )ldv_func_arg1) { ldv_state_variable_38 = 0; } else { } return; } } int ldv___platform_driver_register_246(struct platform_driver *ldv_func_arg1 , struct module *ldv_func_arg2 ) { ldv_func_ret_type___5 ldv_func_res ; int tmp ; { tmp = __platform_driver_register(ldv_func_arg1, ldv_func_arg2); ldv_func_res = tmp; ldv_state_variable_33 = 1; ldv_platform_driver_init_33(); return (ldv_func_res); } } void ldv_platform_driver_unregister_247(struct platform_driver *ldv_func_arg1 ) { { platform_driver_unregister(ldv_func_arg1); ldv_state_variable_33 = 0; return; } } __inline static long ldv__builtin_expect(long exp , long c ) ; extern void __might_fault(char const * , int ) ; extern int kstrtoull(char const * , unsigned int , unsigned long long * ) ; __inline static int kstrtoul(char const *s , unsigned int base , unsigned long *res ) { int tmp ; { tmp = kstrtoull(s, base, (unsigned long long *)res); return (tmp); } } bool ldv_queue_work_on_265(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_267(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_266(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; bool ldv_queue_delayed_work_on_269(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; void ldv_flush_workqueue_268(struct workqueue_struct *ldv_func_arg1 ) ; extern loff_t default_llseek(struct file * , loff_t , int ) ; extern int simple_open(struct inode * , struct file * ) ; extern ssize_t simple_read_from_buffer(void * , size_t , loff_t * , void const * , size_t ) ; extern struct dentry *debugfs_create_file(char const * , umode_t , struct dentry * , void * , struct file_operations const * ) ; extern unsigned long _copy_from_user(void * , void const * , unsigned int ) ; extern void __copy_from_user_overflow(void) ; __inline static unsigned long copy_from_user(void *to , void const *from , unsigned long n ) { int sz ; unsigned long tmp ; long tmp___0 ; { tmp = __builtin_object_size((void const *)to, 0); sz = (int )tmp; __might_fault("./arch/x86/include/asm/uaccess.h", 697); tmp___0 = ldv__builtin_expect((long )(sz < 0 || (unsigned long )sz >= n), 1L); if (tmp___0 != 0L) { n = _copy_from_user(to, from, (unsigned int )n); } else { __copy_from_user_overflow(); } return (n); } } extern void ieee80211_radar_detected(struct ieee80211_hw * ) ; void ath9k_dfs_init_debug(struct ath_softc *sc ) ; static struct ath_dfs_pool_stats dfs_pool_stats = {0U, 0U, 0U, 0U, 0U, 0U, 0U}; static ssize_t read_file_dfs(struct file *file , char *user_buf , size_t count , loff_t *ppos ) { struct ath_softc *sc ; struct ath9k_hw_version *hw_ver ; char *buf ; unsigned int len ; unsigned int size ; ssize_t retval ; void *tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; int tmp___6 ; int tmp___7 ; int tmp___8 ; int tmp___9 ; int tmp___10 ; int tmp___11 ; int tmp___12 ; int tmp___13 ; int tmp___14 ; int tmp___15 ; int tmp___16 ; int tmp___17 ; int tmp___18 ; int tmp___19 ; int tmp___20 ; int tmp___21 ; int tmp___22 ; { sc = (struct ath_softc *)file->private_data; hw_ver = & (sc->sc_ah)->hw_version; len = 0U; size = 8000U; retval = 0L; tmp = kzalloc((size_t )size, 208U); buf = (char *)tmp; if ((unsigned long )buf == (unsigned long )((char *)0)) { return (-12L); } else { } tmp___0 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "DFS support for macVersion = 0x%x, macRev = 0x%x: %s\n", hw_ver->macVersion, (int )hw_ver->macRev, ((sc->sc_ah)->caps.hw_caps & 262144U) != 0U ? (char *)"enabled" : (char *)"disabled"); len = (unsigned int )tmp___0 + len; if ((unsigned long )sc->dfs_detector == (unsigned long )((struct dfs_pattern_detector *)0)) { tmp___1 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "DFS detector not enabled\n"); len = (unsigned int )tmp___1 + len; goto exit; } else { } dfs_pool_stats = (*((sc->dfs_detector)->get_stats))(sc->dfs_detector); tmp___2 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "Pulse detector statistics:\n"); len = (unsigned int )tmp___2 + len; tmp___3 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%28s : %10u\n", (char *)"pulse events reported ", sc->debug.stats.dfs_stats.pulses_total); len = (unsigned int )tmp___3 + len; tmp___4 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%28s : %10u\n", (char *)"invalid pulse events ", sc->debug.stats.dfs_stats.pulses_no_dfs); len = (unsigned int )tmp___4 + len; tmp___5 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%28s : %10u\n", (char *)"DFS pulses detected ", sc->debug.stats.dfs_stats.pulses_detected); len = (unsigned int )tmp___5 + len; tmp___6 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%28s : %10u\n", (char *)"Datalen discards ", sc->debug.stats.dfs_stats.datalen_discards); len = (unsigned int )tmp___6 + len; tmp___7 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%28s : %10u\n", (char *)"RSSI discards ", sc->debug.stats.dfs_stats.rssi_discards); len = (unsigned int )tmp___7 + len; tmp___8 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%28s : %10u\n", (char *)"BW info discards ", sc->debug.stats.dfs_stats.bwinfo_discards); len = (unsigned int )tmp___8 + len; tmp___9 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%28s : %10u\n", (char *)"Primary channel pulses ", sc->debug.stats.dfs_stats.pri_phy_errors); len = (unsigned int )tmp___9 + len; tmp___10 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%28s : %10u\n", (char *)"Secondary channel pulses", sc->debug.stats.dfs_stats.ext_phy_errors); len = (unsigned int )tmp___10 + len; tmp___11 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%28s : %10u\n", (char *)"Dual channel pulses ", sc->debug.stats.dfs_stats.dc_phy_errors); len = (unsigned int )tmp___11 + len; tmp___12 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "Radar detector statistics (current DFS region: %d)\n", (unsigned int )(sc->dfs_detector)->region); len = (unsigned int )tmp___12 + len; tmp___13 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%28s : %10u\n", (char *)"Pulse events processed ", sc->debug.stats.dfs_stats.pulses_processed); len = (unsigned int )tmp___13 + len; tmp___14 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%28s : %10u\n", (char *)"Radars detected ", sc->debug.stats.dfs_stats.radar_detected); len = (unsigned int )tmp___14 + len; tmp___15 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "Global Pool statistics:\n"); len = (unsigned int )tmp___15 + len; tmp___16 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%28s : %10u\n", (char *)"Pool references ", dfs_pool_stats.pool_reference); len = (unsigned int )tmp___16 + len; tmp___17 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%28s : %10u\n", (char *)"Pulses allocated ", dfs_pool_stats.pulse_allocated); len = (unsigned int )tmp___17 + len; tmp___18 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%28s : %10u\n", (char *)"Pulses alloc error ", dfs_pool_stats.pulse_alloc_error); len = (unsigned int )tmp___18 + len; tmp___19 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%28s : %10u\n", (char *)"Pulses in use ", dfs_pool_stats.pulse_used); len = (unsigned int )tmp___19 + len; tmp___20 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%28s : %10u\n", (char *)"Seqs. allocated ", dfs_pool_stats.pseq_allocated); len = (unsigned int )tmp___20 + len; tmp___21 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%28s : %10u\n", (char *)"Seqs. alloc error ", dfs_pool_stats.pseq_alloc_error); len = (unsigned int )tmp___21 + len; tmp___22 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%28s : %10u\n", (char *)"Seqs. in use ", dfs_pool_stats.pseq_used); len = (unsigned int )tmp___22 + len; exit: ; if (len > size) { len = size; } else { } retval = simple_read_from_buffer((void *)user_buf, count, ppos, (void const *)buf, (size_t )len); kfree((void const *)buf); return (retval); } } static ssize_t write_file_dfs(struct file *file , char const *user_buf , size_t count , loff_t *ppos ) { struct ath_softc *sc ; unsigned long val ; char buf[32U] ; ssize_t len ; size_t _min1 ; unsigned long _min2 ; unsigned long tmp ; int tmp___0 ; { sc = (struct ath_softc *)file->private_data; _min1 = count; _min2 = 31UL; len = (ssize_t )(_min1 < _min2 ? _min1 : _min2); tmp = copy_from_user((void *)(& buf), (void const *)user_buf, (unsigned long )len); if (tmp != 0UL) { return (-14L); } else { } buf[len] = 0; tmp___0 = kstrtoul((char const *)(& buf), 0U, & val); if (tmp___0 != 0) { return (-22L); } else { } if (val == 2147483648UL) { memset((void *)(& sc->debug.stats.dfs_stats), 0, 44UL); } else { } return ((ssize_t )count); } } static ssize_t write_file_simulate_radar(struct file *file , char const *user_buf , size_t count , loff_t *ppos ) { struct ath_softc *sc ; { sc = (struct ath_softc *)file->private_data; ieee80211_radar_detected(sc->hw); return ((ssize_t )count); } } static struct file_operations const fops_simulate_radar = {& __this_module, & default_llseek, 0, & write_file_simulate_radar, 0, 0, 0, 0, 0, 0, 0, 0, & simple_open, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; static struct file_operations const fops_dfs_stats = {& __this_module, & default_llseek, & read_file_dfs, & write_file_dfs, 0, 0, 0, 0, 0, 0, 0, 0, & simple_open, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; void ath9k_dfs_init_debug(struct ath_softc *sc ) { { debugfs_create_file("dfs_stats", 256, sc->debug.debugfs_phy, (void *)sc, & fops_dfs_stats); debugfs_create_file("dfs_simulate_radar", 128, sc->debug.debugfs_phy, (void *)sc, & fops_simulate_radar); return; } } extern int ldv_release_31(void) ; int ldv_retval_14 ; extern int ldv_release_32(void) ; int ldv_retval_2 ; void ldv_file_operations_31(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(1000UL); fops_dfs_stats_group1 = (struct inode *)tmp; tmp___0 = ldv_init_zalloc(504UL); fops_dfs_stats_group2 = (struct file *)tmp___0; return; } } void ldv_file_operations_32(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(1000UL); fops_simulate_radar_group1 = (struct inode *)tmp; tmp___0 = ldv_init_zalloc(504UL); fops_simulate_radar_group2 = (struct file *)tmp___0; return; } } void ldv_main_exported_32(void) { loff_t *ldvarg2 ; void *tmp ; int ldvarg0 ; size_t ldvarg3 ; char *ldvarg4 ; void *tmp___0 ; loff_t ldvarg1 ; int tmp___1 ; { tmp = ldv_init_zalloc(8UL); ldvarg2 = (loff_t *)tmp; tmp___0 = ldv_init_zalloc(1UL); ldvarg4 = (char *)tmp___0; ldv_memset((void *)(& ldvarg0), 0, 4UL); ldv_memset((void *)(& ldvarg3), 0, 8UL); ldv_memset((void *)(& ldvarg1), 0, 8UL); tmp___1 = __VERIFIER_nondet_int(); switch (tmp___1) { case 0: ; if (ldv_state_variable_32 == 1) { ldv_retval_2 = simple_open(fops_simulate_radar_group1, fops_simulate_radar_group2); if (ldv_retval_2 == 0) { ldv_state_variable_32 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_54055; case 1: ; if (ldv_state_variable_32 == 1) { write_file_simulate_radar(fops_simulate_radar_group2, (char const *)ldvarg4, ldvarg3, ldvarg2); ldv_state_variable_32 = 1; } else { } if (ldv_state_variable_32 == 2) { write_file_simulate_radar(fops_simulate_radar_group2, (char const *)ldvarg4, ldvarg3, ldvarg2); ldv_state_variable_32 = 2; } else { } goto ldv_54055; case 2: ; if (ldv_state_variable_32 == 2) { default_llseek(fops_simulate_radar_group2, ldvarg1, ldvarg0); ldv_state_variable_32 = 2; } else { } goto ldv_54055; case 3: ; if (ldv_state_variable_32 == 2) { ldv_release_32(); ldv_state_variable_32 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_54055; default: ldv_stop(); } ldv_54055: ; return; } } void ldv_main_exported_31(void) { loff_t *ldvarg83 ; void *tmp ; loff_t ldvarg82 ; loff_t *ldvarg86 ; void *tmp___0 ; size_t ldvarg87 ; char *ldvarg88 ; void *tmp___1 ; size_t ldvarg84 ; char *ldvarg85 ; void *tmp___2 ; int ldvarg81 ; int tmp___3 ; { 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(1UL); ldvarg88 = (char *)tmp___1; tmp___2 = ldv_init_zalloc(1UL); ldvarg85 = (char *)tmp___2; ldv_memset((void *)(& ldvarg82), 0, 8UL); ldv_memset((void *)(& ldvarg87), 0, 8UL); ldv_memset((void *)(& ldvarg84), 0, 8UL); ldv_memset((void *)(& ldvarg81), 0, 4UL); tmp___3 = __VERIFIER_nondet_int(); switch (tmp___3) { case 0: ; if (ldv_state_variable_31 == 1) { ldv_retval_14 = simple_open(fops_dfs_stats_group1, fops_dfs_stats_group2); if (ldv_retval_14 == 0) { ldv_state_variable_31 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_54072; case 1: ; if (ldv_state_variable_31 == 1) { write_file_dfs(fops_dfs_stats_group2, (char const *)ldvarg88, ldvarg87, ldvarg86); ldv_state_variable_31 = 1; } else { } if (ldv_state_variable_31 == 2) { write_file_dfs(fops_dfs_stats_group2, (char const *)ldvarg88, ldvarg87, ldvarg86); ldv_state_variable_31 = 2; } else { } goto ldv_54072; case 2: ; if (ldv_state_variable_31 == 2) { read_file_dfs(fops_dfs_stats_group2, ldvarg85, ldvarg84, ldvarg83); ldv_state_variable_31 = 2; } else { } goto ldv_54072; case 3: ; if (ldv_state_variable_31 == 2) { default_llseek(fops_dfs_stats_group2, ldvarg82, ldvarg81); ldv_state_variable_31 = 2; } else { } goto ldv_54072; case 4: ; if (ldv_state_variable_31 == 2) { ldv_release_31(); ldv_state_variable_31 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_54072; default: ldv_stop(); } ldv_54072: ; return; } } bool ldv_queue_work_on_265(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_266(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_267(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_268(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_7(2); return; } } bool ldv_queue_delayed_work_on_269(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_279(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_281(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_280(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; bool ldv_queue_delayed_work_on_283(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; void ldv_flush_workqueue_282(struct workqueue_struct *ldv_func_arg1 ) ; static u32 dur_to_usecs(struct ath_hw *ah , u32 dur ) { u32 AR93X_NSECS_PER_DUR ; u32 AR93X_NSECS_PER_DUR_FAST ; u32 nsecs ; { AR93X_NSECS_PER_DUR = 800U; AR93X_NSECS_PER_DUR_FAST = 727U; if ((int )(ah->curchan)->channelFlags & 1 && (ah->caps.hw_caps & 128U) != 0U) { nsecs = dur * AR93X_NSECS_PER_DUR_FAST; } else { nsecs = dur * AR93X_NSECS_PER_DUR; } return ((nsecs + 500U) / 1000U); } } static bool ath9k_postprocess_radar_event(struct ath_softc *sc , struct ath_radar_data *ard , struct pulse_event *pe ) { u8 rssi ; u16 dur ; u32 tmp ; { ard->pulse_bw_info = (unsigned int )ard->pulse_bw_info & 3U; switch ((int )ard->pulse_bw_info) { case 1: dur = (u16 )ard->pulse_length_pri; sc->debug.stats.dfs_stats.pri_phy_errors = sc->debug.stats.dfs_stats.pri_phy_errors + 1U; rssi = (int )ard->ext_rssi < (int )ard->rssi + 3 ? ard->rssi : 0U; goto ldv_54016; case 2: dur = (u16 )ard->pulse_length_ext; sc->debug.stats.dfs_stats.ext_phy_errors = sc->debug.stats.dfs_stats.ext_phy_errors + 1U; rssi = (int )ard->rssi < (int )ard->ext_rssi + 12 ? ard->ext_rssi : 0U; goto ldv_54016; case 3: ; if ((int )ard->pulse_length_ext >= (int )ard->pulse_length_pri) { dur = (u16 )ard->pulse_length_ext; } else { dur = (u16 )ard->pulse_length_pri; } sc->debug.stats.dfs_stats.dc_phy_errors = sc->debug.stats.dfs_stats.dc_phy_errors + 1U; rssi = (u8 )((int )ard->ext_rssi > (int )ard->rssi ? ard->ext_rssi : ard->rssi); goto ldv_54016; default: sc->debug.stats.dfs_stats.bwinfo_discards = sc->debug.stats.dfs_stats.bwinfo_discards + 1U; return (0); } ldv_54016: ; if ((unsigned int )rssi == 0U) { sc->debug.stats.dfs_stats.rssi_discards = sc->debug.stats.dfs_stats.rssi_discards + 1U; return (0); } else { } tmp = dur_to_usecs(sc->sc_ah, (u32 )dur); pe->width = (u8 )tmp; pe->rssi = rssi; sc->debug.stats.dfs_stats.pulses_detected = sc->debug.stats.dfs_stats.pulses_detected + 1U; return (1); } } static void ath9k_dfs_process_radar_pulse(struct ath_softc *sc , struct pulse_event *pe ) { struct dfs_pattern_detector *pd ; bool tmp ; int tmp___0 ; { pd = sc->dfs_detector; sc->debug.stats.dfs_stats.pulses_processed = sc->debug.stats.dfs_stats.pulses_processed + 1U; if ((unsigned long )pd == (unsigned long )((struct dfs_pattern_detector *)0)) { return; } else { } tmp = (*(pd->add_pulse))(pd, pe); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { return; } else { } sc->debug.stats.dfs_stats.radar_detected = sc->debug.stats.dfs_stats.radar_detected + 1U; ieee80211_radar_detected(sc->hw); return; } } void ath9k_dfs_process_phyerr(struct ath_softc *sc , void *data , struct ath_rx_status *rs , u64 mactime ) { struct ath_radar_data ard ; u16 datalen ; char *vdata_end ; struct pulse_event pe ; struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; bool tmp___0 ; int tmp___1 ; { ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; sc->debug.stats.dfs_stats.pulses_total = sc->debug.stats.dfs_stats.pulses_total + 1U; if ((unsigned int )rs->rs_phyerr != 5U && (unsigned int )rs->rs_phyerr != 24U) { if ((common->debug_mask & 65536) != 0) { ath_printk("\017", (struct ath_common const *)common, "Error: rs_phyer=0x%x not a radar error\n", (int )rs->rs_phyerr); } else { } sc->debug.stats.dfs_stats.pulses_no_dfs = sc->debug.stats.dfs_stats.pulses_no_dfs + 1U; return; } else { } datalen = rs->rs_datalen; if ((unsigned int )datalen == 0U) { sc->debug.stats.dfs_stats.datalen_discards = sc->debug.stats.dfs_stats.datalen_discards + 1U; return; } else { } ard.rssi = (u8 )rs->rs_rssi_ctl[0]; ard.ext_rssi = (u8 )rs->rs_rssi_ext[0]; if ((int )((signed char )ard.rssi) < 0) { ard.rssi = 0U; } else { } if ((int )((signed char )ard.ext_rssi) < 0) { ard.ext_rssi = 0U; } else { } vdata_end = (char *)data + (unsigned long )datalen; ard.pulse_bw_info = (u8 )*(vdata_end + 0xffffffffffffffffUL); ard.pulse_length_ext = (u8 )*(vdata_end + 0xfffffffffffffffeUL); ard.pulse_length_pri = (u8 )*(vdata_end + 0xfffffffffffffffdUL); pe.freq = (ah->curchan)->channel; pe.ts = mactime; tmp___0 = ath9k_postprocess_radar_event(sc, & ard, & pe); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { return; } else { } if ((common->debug_mask & 65536) != 0) { ath_printk("\017", (struct ath_common const *)common, "ath9k_dfs_process_phyerr: type=%d, freq=%d, ts=%llu, width=%d, rssi=%d, delta_ts=%llu\n", (int )ard.pulse_bw_info, (int )pe.freq, pe.ts, (int )pe.width, (int )pe.rssi, pe.ts - sc->dfs_prev_pulse_ts); } else { } sc->dfs_prev_pulse_ts = pe.ts; if ((int )ard.pulse_bw_info & 1) { ath9k_dfs_process_radar_pulse(sc, & pe); } else { } if (((int )ard.pulse_bw_info & 2) != 0) { pe.freq = (unsigned int )pe.freq + (((unsigned long )(ah->curchan)->channelFlags & 16UL) != 0UL ? 20U : 65516U); ath9k_dfs_process_radar_pulse(sc, & pe); } else { } return; } } bool ldv_queue_work_on_279(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_280(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_281(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_282(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_7(2); return; } } bool ldv_queue_delayed_work_on_283(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; extern int kstrtou8_from_user(char const * , size_t , unsigned int , u8 * ) ; extern int sprintf(char * , char const * , ...) ; extern int strtobool(char const * , bool * ) ; bool ldv_queue_work_on_293(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_295(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_294(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; bool ldv_queue_delayed_work_on_297(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; void ldv_flush_workqueue_296(struct workqueue_struct *ldv_func_arg1 ) ; __inline static void ath9k_hw_tx99_stop(struct ath_hw *ah ) { struct ath_hw_ops *tmp ; { tmp = ath9k_hw_ops(ah); (*(tmp->tx99_stop))(ah); return; } } __inline static void ath9k_hw_tx99_set_txpower(struct ath_hw *ah , u8 power ) { struct ath_hw_ops *tmp ; struct ath_hw_ops *tmp___0 ; { tmp___0 = ath9k_hw_ops(ah); if ((unsigned long )tmp___0->tx99_set_txpower != (unsigned long )((void (*)(struct ath_hw * , u8 ))0)) { tmp = ath9k_hw_ops(ah); (*(tmp->tx99_set_txpower))(ah, (int )power); } else { } return; } } void ath9k_tx99_init_debug(struct ath_softc *sc ) ; static void ath9k_tx99_stop(struct ath_softc *sc ) { struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; { ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; ath_drain_all_txq(sc); ath_startrecv(sc); ath9k_hw_set_interrupts(ah); ath9k_hw_enable_interrupts(ah); ieee80211_wake_queues(sc->hw); kfree_skb(sc->tx99_skb); sc->tx99_skb = (struct sk_buff *)0; sc->tx99_state = 0; ath9k_hw_tx99_stop(sc->sc_ah); if ((common->debug_mask & 128) != 0) { ath_printk("\017", (struct ath_common const *)common, "TX99 stopped\n"); } else { } return; } } static struct sk_buff *ath9k_build_tx99_skb(struct ath_softc *sc ) { u8 PN9Data[64U] ; u32 len ; struct ieee80211_tx_rate *rate ; struct ieee80211_hw *hw ; struct ath_hw *ah ; struct ieee80211_hdr *hdr ; struct ieee80211_tx_info *tx_info ; struct sk_buff *skb ; struct ath_vif *avp ; { PN9Data[0] = 255U; PN9Data[1] = 135U; PN9Data[2] = 184U; PN9Data[3] = 89U; PN9Data[4] = 183U; PN9Data[5] = 161U; PN9Data[6] = 204U; PN9Data[7] = 36U; PN9Data[8] = 87U; PN9Data[9] = 94U; PN9Data[10] = 75U; PN9Data[11] = 156U; PN9Data[12] = 14U; PN9Data[13] = 233U; PN9Data[14] = 234U; PN9Data[15] = 80U; PN9Data[16] = 42U; PN9Data[17] = 190U; PN9Data[18] = 180U; PN9Data[19] = 27U; PN9Data[20] = 182U; PN9Data[21] = 176U; PN9Data[22] = 93U; PN9Data[23] = 241U; PN9Data[24] = 230U; PN9Data[25] = 154U; PN9Data[26] = 227U; PN9Data[27] = 69U; PN9Data[28] = 253U; PN9Data[29] = 44U; PN9Data[30] = 83U; PN9Data[31] = 24U; PN9Data[32] = 12U; PN9Data[33] = 202U; PN9Data[34] = 201U; PN9Data[35] = 251U; PN9Data[36] = 73U; PN9Data[37] = 55U; PN9Data[38] = 229U; PN9Data[39] = 168U; PN9Data[40] = 81U; PN9Data[41] = 59U; PN9Data[42] = 47U; PN9Data[43] = 97U; PN9Data[44] = 170U; PN9Data[45] = 114U; PN9Data[46] = 24U; PN9Data[47] = 132U; PN9Data[48] = 2U; PN9Data[49] = 35U; PN9Data[50] = 35U; PN9Data[51] = 171U; PN9Data[52] = 99U; PN9Data[53] = 137U; PN9Data[54] = 81U; PN9Data[55] = 179U; PN9Data[56] = 231U; PN9Data[57] = 139U; PN9Data[58] = 114U; PN9Data[59] = 144U; PN9Data[60] = 76U; PN9Data[61] = 232U; PN9Data[62] = 251U; PN9Data[63] = 192U; len = 1200U; hw = sc->hw; ah = sc->sc_ah; if ((unsigned long )sc->tx99_vif == (unsigned long )((struct ieee80211_vif *)0)) { return ((struct sk_buff *)0); } else { } avp = (struct ath_vif *)(& (sc->tx99_vif)->drv_priv); skb = alloc_skb(len, 208U); if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { return ((struct sk_buff *)0); } else { } skb_put(skb, len); memset((void *)skb->data, 0, (size_t )len); hdr = (struct ieee80211_hdr *)skb->data; hdr->frame_control = 8U; hdr->duration_id = 0U; memcpy((void *)(& hdr->addr1), (void const *)(& (hw->wiphy)->perm_addr), 6UL); memcpy((void *)(& hdr->addr2), (void const *)(& (hw->wiphy)->perm_addr), 6UL); memcpy((void *)(& hdr->addr3), (void const *)(& (hw->wiphy)->perm_addr), 6UL); hdr->seq_ctrl = (__le16 )((int )hdr->seq_ctrl | (int )avp->seq_no); tx_info = IEEE80211_SKB_CB(skb); memset((void *)tx_info, 0, 48UL); rate = (struct ieee80211_tx_rate *)(& tx_info->__annonCompField99.control.__annonCompField97.__annonCompField96.rates); tx_info->band = (u8 )((sc->cur_chan)->chandef.chan)->band; tx_info->flags = 4U; tx_info->__annonCompField99.control.vif = sc->tx99_vif; rate->count = 1U; if ((unsigned long )ah->curchan != (unsigned long )((struct ath9k_channel *)0) && ((unsigned long )(ah->curchan)->channelFlags & 8UL) != 0UL) { rate->flags = (unsigned short )((unsigned int )rate->flags | 8U); if (((unsigned long )(ah->curchan)->channelFlags & 48UL) != 0UL) { rate->flags = (unsigned short )((unsigned int )rate->flags | 32U); } else { } } else { } memcpy((void *)skb->data + 30U, (void const *)(& PN9Data), 64UL); return (skb); } } static void ath9k_tx99_deinit(struct ath_softc *sc ) { { ath_reset(sc, (struct ath9k_channel *)0); ath9k_ps_wakeup(sc); ath9k_tx99_stop(sc); ath9k_ps_restore(sc); return; } } static int ath9k_tx99_init(struct ath_softc *sc ) { struct ieee80211_hw *hw ; struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; struct ath_tx_control txctl ; int r ; int tmp___0 ; { hw = sc->hw; ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; tmp___0 = constant_test_bit(0L, (unsigned long const volatile *)(& common->op_flags)); if (tmp___0 != 0) { ath_printk("\v", (struct ath_common const *)common, "driver is in invalid state unable to use TX99"); return (-22); } else { } sc->tx99_skb = ath9k_build_tx99_skb(sc); if ((unsigned long )sc->tx99_skb == (unsigned long )((struct sk_buff *)0)) { return (-12); } else { } memset((void *)(& txctl), 0, 32UL); txctl.txq = sc->tx.txq_map[0]; ath_reset(sc, (struct ath9k_channel *)0); ath9k_ps_wakeup(sc); ath9k_hw_disable_interrupts(ah); atomic_set(& ah->intr_ref_cnt, -1); ath_drain_all_txq(sc); ath_stoprecv(sc); sc->tx99_state = 1; ieee80211_stop_queues(hw); if ((int )sc->tx99_power == 64) { sc->tx99_power = 63; } else { } ath9k_hw_tx99_set_txpower(ah, (int )((u8 )sc->tx99_power)); r = ath9k_tx99_send(sc, sc->tx99_skb, & txctl); if (r != 0) { if ((common->debug_mask & 128) != 0) { ath_printk("\017", (struct ath_common const *)common, "Failed to xmit TX99 skb\n"); } else { } return (r); } else { } if ((common->debug_mask & 128) != 0) { ath_printk("\017", (struct ath_common const *)common, "TX99 xmit started using %d ( %ddBm)\n", (int )sc->tx99_power, (int )sc->tx99_power / 2); } else { } return (0); } } static ssize_t read_file_tx99(struct file *file , char *user_buf , size_t count , loff_t *ppos ) { struct ath_softc *sc ; char buf[3U] ; unsigned int len ; int tmp ; ssize_t tmp___0 ; { sc = (struct ath_softc *)file->private_data; tmp = sprintf((char *)(& buf), "%d\n", (int )sc->tx99_state); len = (unsigned int )tmp; tmp___0 = simple_read_from_buffer((void *)user_buf, count, ppos, (void const *)(& buf), (size_t )len); return (tmp___0); } } static ssize_t write_file_tx99(struct file *file , char const *user_buf , size_t count , loff_t *ppos ) { struct ath_softc *sc ; struct ath_common *common ; struct ath_common *tmp ; char buf[32U] ; bool start ; ssize_t len ; int r ; size_t _min1 ; unsigned long _min2 ; unsigned long tmp___0 ; int tmp___1 ; { sc = (struct ath_softc *)file->private_data; tmp = ath9k_hw_common(sc->sc_ah); common = tmp; if ((int )(sc->cur_chan)->nvifs > 1) { return (-95L); } else { } _min1 = count; _min2 = 31UL; len = (ssize_t )(_min1 < _min2 ? _min1 : _min2); tmp___0 = copy_from_user((void *)(& buf), (void const *)user_buf, (unsigned long )len); if (tmp___0 != 0UL) { return (-14L); } else { } tmp___1 = strtobool((char const *)(& buf), & start); if (tmp___1 != 0) { return (-22L); } else { } if ((int )sc->tx99_state == (int )start) { if (! start) { return ((ssize_t )count); } else { } if ((common->debug_mask & 128) != 0) { ath_printk("\017", (struct ath_common const *)common, "Resetting TX99\n"); } else { } ath9k_tx99_deinit(sc); } else { } if (! start) { ath9k_tx99_deinit(sc); return ((ssize_t )count); } else { } r = ath9k_tx99_init(sc); if (r != 0) { return ((ssize_t )r); } else { } return ((ssize_t )count); } } static struct file_operations const fops_tx99 = {& __this_module, & default_llseek, & read_file_tx99, & write_file_tx99, 0, 0, 0, 0, 0, 0, 0, 0, & simple_open, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; static ssize_t read_file_tx99_power(struct file *file , char *user_buf , size_t count , loff_t *ppos ) { struct ath_softc *sc ; char buf[32U] ; unsigned int len ; int tmp ; ssize_t tmp___0 ; { sc = (struct ath_softc *)file->private_data; tmp = sprintf((char *)(& buf), "%d (%d dBm)\n", (int )sc->tx99_power, (int )sc->tx99_power / 2); len = (unsigned int )tmp; tmp___0 = simple_read_from_buffer((void *)user_buf, count, ppos, (void const *)(& buf), (size_t )len); return (tmp___0); } } static ssize_t write_file_tx99_power(struct file *file , char const *user_buf , size_t count , loff_t *ppos ) { struct ath_softc *sc ; int r ; u8 tx_power ; { sc = (struct ath_softc *)file->private_data; r = kstrtou8_from_user(user_buf, count, 0U, & tx_power); if (r != 0) { return ((ssize_t )r); } else { } if ((unsigned int )tx_power > 63U) { return (-22L); } else { } sc->tx99_power = (s16 )tx_power; ath9k_ps_wakeup(sc); ath9k_hw_tx99_set_txpower(sc->sc_ah, (int )((u8 )sc->tx99_power)); ath9k_ps_restore(sc); return ((ssize_t )count); } } static struct file_operations const fops_tx99_power = {& __this_module, & default_llseek, & read_file_tx99_power, & write_file_tx99_power, 0, 0, 0, 0, 0, 0, 0, 0, & simple_open, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; void ath9k_tx99_init_debug(struct ath_softc *sc ) { { if ((sc->sc_ah)->hw_version.macVersion <= 447U) { return; } else { } debugfs_create_file("tx99", 384, sc->debug.debugfs_phy, (void *)sc, & fops_tx99); debugfs_create_file("tx99_power", 384, sc->debug.debugfs_phy, (void *)sc, & fops_tx99_power); return; } } int ldv_retval_19 ; extern int ldv_release_29(void) ; extern int ldv_release_30(void) ; int ldv_retval_7 ; void ldv_file_operations_29(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(1000UL); fops_tx99_power_group1 = (struct inode *)tmp; tmp___0 = ldv_init_zalloc(504UL); fops_tx99_power_group2 = (struct file *)tmp___0; return; } } void ldv_file_operations_30(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(1000UL); fops_tx99_group1 = (struct inode *)tmp; tmp___0 = ldv_init_zalloc(504UL); fops_tx99_group2 = (struct file *)tmp___0; return; } } void ldv_main_exported_30(void) { int ldvarg34 ; size_t ldvarg40 ; loff_t *ldvarg36 ; void *tmp ; size_t ldvarg37 ; char *ldvarg38 ; void *tmp___0 ; char *ldvarg41 ; void *tmp___1 ; loff_t ldvarg35 ; loff_t *ldvarg39 ; void *tmp___2 ; int tmp___3 ; { tmp = ldv_init_zalloc(8UL); ldvarg36 = (loff_t *)tmp; tmp___0 = ldv_init_zalloc(1UL); ldvarg38 = (char *)tmp___0; tmp___1 = ldv_init_zalloc(1UL); ldvarg41 = (char *)tmp___1; tmp___2 = ldv_init_zalloc(8UL); ldvarg39 = (loff_t *)tmp___2; ldv_memset((void *)(& ldvarg34), 0, 4UL); ldv_memset((void *)(& ldvarg40), 0, 8UL); ldv_memset((void *)(& ldvarg37), 0, 8UL); ldv_memset((void *)(& ldvarg35), 0, 8UL); tmp___3 = __VERIFIER_nondet_int(); switch (tmp___3) { case 0: ; if (ldv_state_variable_30 == 1) { ldv_retval_7 = simple_open(fops_tx99_group1, fops_tx99_group2); if (ldv_retval_7 == 0) { ldv_state_variable_30 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_54094; case 1: ; if (ldv_state_variable_30 == 1) { write_file_tx99(fops_tx99_group2, (char const *)ldvarg41, ldvarg40, ldvarg39); ldv_state_variable_30 = 1; } else { } if (ldv_state_variable_30 == 2) { write_file_tx99(fops_tx99_group2, (char const *)ldvarg41, ldvarg40, ldvarg39); ldv_state_variable_30 = 2; } else { } goto ldv_54094; case 2: ; if (ldv_state_variable_30 == 2) { read_file_tx99(fops_tx99_group2, ldvarg38, ldvarg37, ldvarg36); ldv_state_variable_30 = 2; } else { } goto ldv_54094; case 3: ; if (ldv_state_variable_30 == 2) { default_llseek(fops_tx99_group2, ldvarg35, ldvarg34); ldv_state_variable_30 = 2; } else { } goto ldv_54094; case 4: ; if (ldv_state_variable_30 == 2) { ldv_release_30(); ldv_state_variable_30 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_54094; default: ldv_stop(); } ldv_54094: ; return; } } void ldv_main_exported_29(void) { int ldvarg103 ; char *ldvarg107 ; void *tmp ; char *ldvarg110 ; void *tmp___0 ; loff_t *ldvarg108 ; void *tmp___1 ; size_t ldvarg109 ; loff_t *ldvarg105 ; void *tmp___2 ; size_t ldvarg106 ; loff_t ldvarg104 ; int tmp___3 ; { tmp = ldv_init_zalloc(1UL); ldvarg107 = (char *)tmp; tmp___0 = ldv_init_zalloc(1UL); ldvarg110 = (char *)tmp___0; tmp___1 = ldv_init_zalloc(8UL); ldvarg108 = (loff_t *)tmp___1; tmp___2 = ldv_init_zalloc(8UL); ldvarg105 = (loff_t *)tmp___2; ldv_memset((void *)(& ldvarg103), 0, 4UL); ldv_memset((void *)(& ldvarg109), 0, 8UL); ldv_memset((void *)(& ldvarg106), 0, 8UL); ldv_memset((void *)(& ldvarg104), 0, 8UL); tmp___3 = __VERIFIER_nondet_int(); switch (tmp___3) { case 0: ; if (ldv_state_variable_29 == 1) { ldv_retval_19 = simple_open(fops_tx99_power_group1, fops_tx99_power_group2); if (ldv_retval_19 == 0) { ldv_state_variable_29 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_54112; case 1: ; if (ldv_state_variable_29 == 1) { write_file_tx99_power(fops_tx99_power_group2, (char const *)ldvarg110, ldvarg109, ldvarg108); ldv_state_variable_29 = 1; } else { } if (ldv_state_variable_29 == 2) { write_file_tx99_power(fops_tx99_power_group2, (char const *)ldvarg110, ldvarg109, ldvarg108); ldv_state_variable_29 = 2; } else { } goto ldv_54112; case 2: ; if (ldv_state_variable_29 == 2) { read_file_tx99_power(fops_tx99_power_group2, ldvarg107, ldvarg106, ldvarg105); ldv_state_variable_29 = 2; } else { } goto ldv_54112; case 3: ; if (ldv_state_variable_29 == 2) { default_llseek(fops_tx99_power_group2, ldvarg104, ldvarg103); ldv_state_variable_29 = 2; } else { } goto ldv_54112; case 4: ; if (ldv_state_variable_29 == 2) { ldv_release_29(); ldv_state_variable_29 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_54112; default: ldv_stop(); } ldv_54112: ; return; } } bool ldv_queue_work_on_293(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_294(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_295(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_296(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_7(2); return; } } bool ldv_queue_delayed_work_on_297(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; bool ldv_queue_work_on_307(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_309(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_308(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; bool ldv_queue_delayed_work_on_311(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; void ldv_flush_workqueue_310(struct workqueue_struct *ldv_func_arg1 ) ; extern int device_init_wakeup(struct device * , bool ) ; extern int device_set_wakeup_enable(struct device * , bool ) ; extern int ath9k_hw_wow_apply_pattern(struct ath_hw * , u8 * , u8 * , int , int ) ; extern u32 ath9k_hw_wow_wakeup(struct ath_hw * ) ; extern void ath9k_hw_wow_enable(struct ath_hw * , u32 ) ; static struct wiphy_wowlan_support const ath9k_wowlan_support_legacy = {6U, 6, 256, 1, 0, 0, 0}; static struct wiphy_wowlan_support const ath9k_wowlan_support = {6U, 14, 256, 1, 0, 0, 0}; static u8 ath9k_wow_map_triggers(struct ath_softc *sc , struct cfg80211_wowlan *wowlan ) { u8 wow_triggers ; { wow_triggers = 0U; if ((int )wowlan->disconnect) { wow_triggers = (u8 )((unsigned int )wow_triggers | 12U); } else { } if ((int )wowlan->magic_pkt) { wow_triggers = (u8 )((unsigned int )wow_triggers | 2U); } else { } if (wowlan->n_patterns != 0) { wow_triggers = (u8 )((unsigned int )wow_triggers | 1U); } else { } return (wow_triggers); } } static int ath9k_wow_add_disassoc_deauth_pattern(struct ath_softc *sc ) { struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; int pattern_count ; int ret ; int i ; int byte_cnt ; u8 dis_deauth_pattern[256U] ; u8 dis_deauth_mask[256U] ; { ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; pattern_count = 0; byte_cnt = 0; memset((void *)(& dis_deauth_pattern), 0, 256UL); memset((void *)(& dis_deauth_mask), 0, 256UL); i = 0; goto ldv_54014; ldv_54013: dis_deauth_mask[i] = 255U; i = i + 1; ldv_54014: ; if (i <= 31) { goto ldv_54013; } else { } dis_deauth_pattern[byte_cnt] = 160U; byte_cnt = byte_cnt + 1; byte_cnt = byte_cnt + 3; byte_cnt = byte_cnt + 6; memcpy((void *)(& dis_deauth_pattern) + (unsigned long )byte_cnt, (void const *)(& common->curbssid), 6UL); byte_cnt = byte_cnt + 6; memcpy((void *)(& dis_deauth_pattern) + (unsigned long )byte_cnt, (void const *)(& common->curbssid), 6UL); dis_deauth_mask[0] = 254U; dis_deauth_mask[1] = 3U; dis_deauth_mask[2] = 192U; ret = ath9k_hw_wow_apply_pattern(ah, (u8 *)(& dis_deauth_pattern), (u8 *)(& dis_deauth_mask), pattern_count, byte_cnt); if (ret != 0) { goto exit; } else { } pattern_count = pattern_count + 1; dis_deauth_pattern[0] = 192U; ret = ath9k_hw_wow_apply_pattern(ah, (u8 *)(& dis_deauth_pattern), (u8 *)(& dis_deauth_mask), pattern_count, byte_cnt); exit: ; return (ret); } } static int ath9k_wow_add_pattern(struct ath_softc *sc , struct cfg80211_wowlan *wowlan ) { struct ath_hw *ah ; struct cfg80211_pkt_pattern *patterns ; u8 wow_pattern[256U] ; u8 wow_mask[256U] ; int mask_len ; int ret ; s8 i ; { ah = sc->sc_ah; patterns = wowlan->patterns; ret = 0; i = 0; i = 0; goto ldv_54030; ldv_54029: mask_len = ((patterns + (unsigned long )i)->pattern_len + 7) / 8; memset((void *)(& wow_pattern), 0, 256UL); memset((void *)(& wow_mask), 0, 256UL); memcpy((void *)(& wow_pattern), (void const *)(patterns + (unsigned long )i)->pattern, (size_t )(patterns + (unsigned long )i)->pattern_len); memcpy((void *)(& wow_mask), (void const *)(patterns + (unsigned long )i)->mask, (size_t )mask_len); ret = ath9k_hw_wow_apply_pattern(ah, (u8 *)(& wow_pattern), (u8 *)(& wow_mask), (int )i + 2, (patterns + (unsigned long )i)->pattern_len); if (ret != 0) { goto ldv_54028; } else { } i = (s8 )((int )i + 1); ldv_54030: ; if ((int )i < wowlan->n_patterns) { goto ldv_54029; } else { } ldv_54028: ; return (ret); } } int ath9k_suspend(struct ieee80211_hw *hw , struct cfg80211_wowlan *wowlan ) { struct ath_softc *sc ; struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; u8 triggers ; int ret ; int tmp___0 ; int __ret_warn_on ; long tmp___1 ; long tmp___2 ; int tmp___3 ; bool tmp___4 ; int tmp___5 ; { sc = (struct ath_softc *)hw->priv; ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; ret = 0; ath9k_deinit_channel_context(sc); mutex_lock_nested(& sc->mutex, 0U); tmp___0 = constant_test_bit(0L, (unsigned long const volatile *)(& common->op_flags)); if (tmp___0 != 0) { ath_printk("\v", (struct ath_common const *)common, "Device not present\n"); ret = -19; goto fail_wow; } else { } __ret_warn_on = (unsigned long )wowlan == (unsigned long )((struct cfg80211_wowlan *)0); tmp___1 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/12119/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/ath/ath9k/wow.c", 186); } else { } tmp___2 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___2 != 0L) { ath_printk("\v", (struct ath_common const *)common, "None of the WoW triggers enabled\n"); ret = -22; goto fail_wow; } else { } if ((int )(sc->cur_chan)->nvifs > 1) { if ((common->debug_mask & 131072) != 0) { ath_printk("\017", (struct ath_common const *)common, "WoW for multivif is not yet supported\n"); } else { } ret = 1; goto fail_wow; } else { } tmp___4 = ath9k_is_chanctx_enabled(); if ((int )tmp___4) { tmp___3 = constant_test_bit(6L, (unsigned long const volatile *)(& common->op_flags)); if (tmp___3 != 0) { if ((common->debug_mask & 131072) != 0) { ath_printk("\017", (struct ath_common const *)common, "Multi-channel WOW is not supported\n"); } else { } ret = 1; goto fail_wow; } else { } } else { } tmp___5 = constant_test_bit(3L, (unsigned long const volatile *)(& common->op_flags)); if (tmp___5 == 0) { if ((common->debug_mask & 131072) != 0) { ath_printk("\017", (struct ath_common const *)common, "None of the STA vifs are associated\n"); } else { } ret = 1; goto fail_wow; } else { } triggers = ath9k_wow_map_triggers(sc, wowlan); if ((unsigned int )triggers == 0U) { if ((common->debug_mask & 131072) != 0) { ath_printk("\017", (struct ath_common const *)common, "No valid WoW triggers\n"); } else { } ret = 1; goto fail_wow; } else { } ath_cancel_work(sc); ath_stop_ani(sc); ath9k_ps_wakeup(sc); ath9k_stop_btcoex(sc); ret = ath9k_wow_add_disassoc_deauth_pattern(sc); if (ret != 0) { ath_printk("\v", (struct ath_common const *)common, "Unable to add disassoc/deauth pattern: %d\n", ret); goto fail_wow; } else { } if ((int )triggers & 1) { ret = ath9k_wow_add_pattern(sc, wowlan); if (ret != 0) { ath_printk("\v", (struct ath_common const *)common, "Unable to add user pattern: %d\n", ret); goto fail_wow; } else { } } else { } spin_lock_bh(& sc->sc_pcu_lock); sc->wow_intr_before_sleep = (u32 )ah->imask; ah->imask = (enum ath9k_int )((unsigned int )ah->imask & 2147483647U); ath9k_hw_disable_interrupts(ah); ah->imask = 2147745792L; ath9k_hw_set_interrupts(ah); ath9k_hw_enable_interrupts(ah); spin_unlock_bh(& sc->sc_pcu_lock); synchronize_irq((unsigned int )sc->irq); tasklet_kill(& sc->intr_tq); ath9k_hw_wow_enable(ah, (u32 )triggers); ath9k_ps_restore(sc); if ((common->debug_mask & 131072) != 0) { ath_printk("\017", (struct ath_common const *)common, "Suspend with WoW triggers: 0x%x\n", (int )triggers); } else { } set_bit(7L, (unsigned long volatile *)(& common->op_flags)); fail_wow: mutex_unlock(& sc->mutex); return (ret); } } int ath9k_resume(struct ieee80211_hw *hw ) { struct ath_softc *sc ; struct ath_hw *ah ; struct ath_common *common ; struct ath_common *tmp ; u8 status ; u32 tmp___0 ; { sc = (struct ath_softc *)hw->priv; ah = sc->sc_ah; tmp = ath9k_hw_common(ah); common = tmp; mutex_lock_nested(& sc->mutex, 0U); ath9k_ps_wakeup(sc); spin_lock_bh(& sc->sc_pcu_lock); ath9k_hw_disable_interrupts(ah); ah->imask = (enum ath9k_int )sc->wow_intr_before_sleep; ath9k_hw_set_interrupts(ah); ath9k_hw_enable_interrupts(ah); spin_unlock_bh(& sc->sc_pcu_lock); tmp___0 = ath9k_hw_wow_wakeup(ah); status = (u8 )tmp___0; if ((common->debug_mask & 131072) != 0) { ath_printk("\017", (struct ath_common const *)common, "Resume with WoW status: 0x%x\n", (int )status); } else { } ath_restart_work(sc); ath9k_start_btcoex(sc); clear_bit(7L, (unsigned long volatile *)(& common->op_flags)); ath9k_ps_restore(sc); mutex_unlock(& sc->mutex); return (0); } } void ath9k_set_wakeup(struct ieee80211_hw *hw , bool enabled ) { struct ath_softc *sc ; struct ath_common *common ; struct ath_common *tmp ; { sc = (struct ath_softc *)hw->priv; tmp = ath9k_hw_common(sc->sc_ah); common = tmp; mutex_lock_nested(& sc->mutex, 0U); device_set_wakeup_enable(sc->dev, (int )enabled); mutex_unlock(& sc->mutex); if ((common->debug_mask & 131072) != 0) { ath_printk("\017", (struct ath_common const *)common, "WoW wakeup source is %s\n", (int )enabled ? (char *)"enabled" : (char *)"disabled"); } else { } return; } } void ath9k_init_wow(struct ieee80211_hw *hw ) { struct ath_softc *sc ; struct ath_hw *ah ; { sc = (struct ath_softc *)hw->priv; ah = sc->sc_ah; if ((sc->driver_data & 16UL) != 0UL || (int )sc->force_wow) { if ((ah->hw_version.macVersion == 640U && (unsigned int )ah->hw_version.macRev > 1U) || (ah->hw_version.macVersion == 704U && (unsigned int )ah->hw_version.macRev > 1U)) { (hw->wiphy)->wowlan = & ath9k_wowlan_support; } else { (hw->wiphy)->wowlan = & ath9k_wowlan_support_legacy; } device_init_wakeup(sc->dev, 1); } else { } return; } } void ath9k_deinit_wow(struct ieee80211_hw *hw ) { struct ath_softc *sc ; { sc = (struct ath_softc *)hw->priv; if ((sc->driver_data & 16UL) != 0UL || (int )sc->force_wow) { device_init_wakeup(sc->dev, 0); } else { } return; } } bool ldv_queue_work_on_307(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_308(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_309(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_310(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_7(2); return; } } bool ldv_queue_delayed_work_on_311(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; extern size_t strlen(char const * ) ; bool ldv_queue_work_on_321(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_323(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_322(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; bool ldv_queue_delayed_work_on_325(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; void ldv_flush_workqueue_324(struct workqueue_struct *ldv_func_arg1 ) ; extern void *vmalloc(unsigned long ) ; extern void vfree(void const * ) ; extern ssize_t seq_read(struct file * , char * , size_t , loff_t * ) ; extern loff_t seq_lseek(struct file * , loff_t , int ) ; extern int seq_puts(struct seq_file * , char const * ) ; extern int seq_printf(struct seq_file * , char const * , ...) ; extern int single_open(struct file * , int (*)(struct seq_file * , void * ) , void * ) ; extern int single_release(struct inode * , struct file * ) ; extern struct dentry *debugfs_create_dir(char const * , struct dentry * ) ; extern struct dentry *debugfs_create_u8(char const * , umode_t , struct dentry * , u8 * ) ; extern struct dentry *debugfs_create_u32(char const * , umode_t , struct dentry * , u32 * ) ; extern struct dentry *debugfs_create_bool(char const * , umode_t , struct dentry * , u32 * ) ; extern struct dentry *debugfs_create_devm_seqfile(struct device * , char const * , struct dentry * , int (*)(struct seq_file * , void * ) ) ; __inline static bool conf_is_ht40(struct ieee80211_conf *conf ) { { return ((unsigned int )conf->chandef.width == 2U); } } extern char const *ath_opmode_to_string(enum nl80211_iftype ) ; __inline static void ath9k_hw_set_bt_ant_diversity(struct ath_hw *ah , bool enable ) { struct ath_hw_ops *tmp ; struct ath_hw_ops *tmp___0 ; { tmp___0 = ath9k_hw_ops(ah); if ((unsigned long )tmp___0->set_bt_ant_diversity != (unsigned long )((void (*)(struct ath_hw * , bool ))0)) { tmp = ath9k_hw_ops(ah); (*(tmp->set_bt_ant_diversity))(ah, (int )enable); } else { } return; } } extern void ath9k_cmn_debug_modal_eeprom(struct dentry * , struct ath_hw * ) ; extern void ath9k_cmn_debug_base_eeprom(struct dentry * , struct ath_hw * ) ; extern void ath9k_cmn_debug_stat_rx(struct ath_rx_stats * , struct ath_rx_status * ) ; extern void ath9k_cmn_debug_recv(struct dentry * , struct ath_rx_stats * ) ; extern void ath9k_cmn_debug_phy_err(struct dentry * , struct ath_rx_stats * ) ; extern void ath9k_cmn_spectral_init_debug(struct ath_spec_scan_priv * , struct dentry * ) ; extern void ath9k_cmn_spectral_deinit_debug(struct ath_spec_scan_priv * ) ; void ath9k_debug_sync_cause(struct ath_softc *sc , u32 sync_cause ) { { if (sync_cause != 0U) { sc->debug.stats.istats.sync_cause_all = sc->debug.stats.istats.sync_cause_all + 1U; } else { } if ((int )sync_cause & 1) { sc->debug.stats.istats.sync_rtc_irq = sc->debug.stats.istats.sync_rtc_irq + 1U; } else { } if ((sync_cause & 2U) != 0U) { sc->debug.stats.istats.sync_mac_irq = sc->debug.stats.istats.sync_mac_irq + 1U; } else { } if ((sync_cause & 4U) != 0U) { sc->debug.stats.istats.eeprom_illegal_access = sc->debug.stats.istats.eeprom_illegal_access + 1U; } else { } if ((sync_cause & 8U) != 0U) { sc->debug.stats.istats.apb_timeout = sc->debug.stats.istats.apb_timeout + 1U; } else { } if ((sync_cause & 16U) != 0U) { sc->debug.stats.istats.pci_mode_conflict = sc->debug.stats.istats.pci_mode_conflict + 1U; } else { } if ((sync_cause & 32U) != 0U) { sc->debug.stats.istats.host1_fatal = sc->debug.stats.istats.host1_fatal + 1U; } else { } if ((sync_cause & 64U) != 0U) { sc->debug.stats.istats.host1_perr = sc->debug.stats.istats.host1_perr + 1U; } else { } if ((sync_cause & 128U) != 0U) { sc->debug.stats.istats.trcv_fifo_perr = sc->debug.stats.istats.trcv_fifo_perr + 1U; } else { } if ((sync_cause & 256U) != 0U) { sc->debug.stats.istats.radm_cpl_ep = sc->debug.stats.istats.radm_cpl_ep + 1U; } else { } if ((sync_cause & 512U) != 0U) { sc->debug.stats.istats.radm_cpl_dllp_abort = sc->debug.stats.istats.radm_cpl_dllp_abort + 1U; } else { } if ((sync_cause & 1024U) != 0U) { sc->debug.stats.istats.radm_cpl_tlp_abort = sc->debug.stats.istats.radm_cpl_tlp_abort + 1U; } else { } if ((sync_cause & 2048U) != 0U) { sc->debug.stats.istats.radm_cpl_ecrc_err = sc->debug.stats.istats.radm_cpl_ecrc_err + 1U; } else { } if ((sync_cause & 4096U) != 0U) { sc->debug.stats.istats.radm_cpl_timeout = sc->debug.stats.istats.radm_cpl_timeout + 1U; } else { } if ((sync_cause & 8192U) != 0U) { sc->debug.stats.istats.local_timeout = sc->debug.stats.istats.local_timeout + 1U; } else { } if ((sync_cause & 16384U) != 0U) { sc->debug.stats.istats.pm_access = sc->debug.stats.istats.pm_access + 1U; } else { } if ((sync_cause & 32768U) != 0U) { sc->debug.stats.istats.mac_awake = sc->debug.stats.istats.mac_awake + 1U; } else { } if ((sync_cause & 65536U) != 0U) { sc->debug.stats.istats.mac_asleep = sc->debug.stats.istats.mac_asleep + 1U; } else { } if ((sync_cause & 131072U) != 0U) { sc->debug.stats.istats.mac_sleep_access = sc->debug.stats.istats.mac_sleep_access + 1U; } else { } return; } } static ssize_t ath9k_debugfs_read_buf(struct file *file , char *user_buf , size_t count , loff_t *ppos ) { u8 *buf ; size_t tmp ; ssize_t tmp___0 ; { buf = (u8 *)file->private_data; tmp = strlen((char const *)buf); tmp___0 = simple_read_from_buffer((void *)user_buf, count, ppos, (void const *)buf, tmp); return (tmp___0); } } static int ath9k_debugfs_release_buf(struct inode *inode , struct file *file ) { { vfree((void const *)file->private_data); return (0); } } static ssize_t read_file_debug(struct file *file , char *user_buf , size_t count , loff_t *ppos ) { struct ath_softc *sc ; struct ath_common *common ; struct ath_common *tmp ; char buf[32U] ; unsigned int len ; int tmp___0 ; ssize_t tmp___1 ; { sc = (struct ath_softc *)file->private_data; tmp = ath9k_hw_common(sc->sc_ah); common = tmp; tmp___0 = sprintf((char *)(& buf), "0x%08x\n", common->debug_mask); len = (unsigned int )tmp___0; tmp___1 = simple_read_from_buffer((void *)user_buf, count, ppos, (void const *)(& buf), (size_t )len); return (tmp___1); } } static ssize_t write_file_debug(struct file *file , char const *user_buf , size_t count , loff_t *ppos ) { struct ath_softc *sc ; struct ath_common *common ; struct ath_common *tmp ; unsigned long mask ; char buf[32U] ; ssize_t len ; size_t _min1 ; unsigned long _min2 ; unsigned long tmp___0 ; int tmp___1 ; { sc = (struct ath_softc *)file->private_data; tmp = ath9k_hw_common(sc->sc_ah); common = tmp; _min1 = count; _min2 = 31UL; len = (ssize_t )(_min1 < _min2 ? _min1 : _min2); tmp___0 = copy_from_user((void *)(& buf), (void const *)user_buf, (unsigned long )len); if (tmp___0 != 0UL) { return (-14L); } else { } buf[len] = 0; tmp___1 = kstrtoul((char const *)(& buf), 0U, & mask); if (tmp___1 != 0) { return (-22L); } else { } common->debug_mask = (int )mask; return ((ssize_t )count); } } static struct file_operations const fops_debug = {& __this_module, & default_llseek, & read_file_debug, & write_file_debug, 0, 0, 0, 0, 0, 0, 0, 0, & simple_open, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; static ssize_t read_file_ani(struct file *file , char *user_buf , size_t count , loff_t *ppos ) { struct ath_softc *sc ; struct ath_common *common ; struct ath_common *tmp ; struct ath_hw *ah ; unsigned int len ; unsigned int size ; ssize_t retval ; char *buf ; int i ; struct __anonstruct_ani_info_396 ani_info[14U] ; void *tmp___0 ; int tmp___1 ; int tmp___2 ; { sc = (struct ath_softc *)file->private_data; tmp = ath9k_hw_common(sc->sc_ah); common = tmp; ah = sc->sc_ah; len = 0U; size = 1024U; retval = 0L; ani_info[0].name = "ANI RESET"; ani_info[0].val = ah->stats.ast_ani_reset; ani_info[1].name = "OFDM LEVEL"; ani_info[1].val = (unsigned int )ah->ani.ofdmNoiseImmunityLevel; ani_info[2].name = "CCK LEVEL"; ani_info[2].val = (unsigned int )ah->ani.cckNoiseImmunityLevel; ani_info[3].name = "SPUR UP"; ani_info[3].val = ah->stats.ast_ani_spurup; ani_info[4].name = "SPUR DOWN"; ani_info[4].val = ah->stats.ast_ani_spurup; ani_info[5].name = "OFDM WS-DET ON"; ani_info[5].val = ah->stats.ast_ani_ofdmon; ani_info[6].name = "OFDM WS-DET OFF"; ani_info[6].val = ah->stats.ast_ani_ofdmoff; ani_info[7].name = "MRC-CCK ON"; ani_info[7].val = ah->stats.ast_ani_ccklow; ani_info[8].name = "MRC-CCK OFF"; ani_info[8].val = ah->stats.ast_ani_cckhigh; ani_info[9].name = "FIR-STEP UP"; ani_info[9].val = ah->stats.ast_ani_stepup; ani_info[10].name = "FIR-STEP DOWN"; ani_info[10].val = ah->stats.ast_ani_stepdown; ani_info[11].name = "INV LISTENTIME"; ani_info[11].val = ah->stats.ast_ani_lneg_or_lzero; ani_info[12].name = "OFDM ERRORS"; ani_info[12].val = ah->stats.ast_ani_ofdmerrs; ani_info[13].name = "CCK ERRORS"; ani_info[13].val = ah->stats.ast_ani_cckerrs; tmp___0 = kzalloc((size_t )size, 208U); buf = (char *)tmp___0; if ((unsigned long )buf == (unsigned long )((char *)0)) { return (-12L); } else { } tmp___1 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%15s: %s\n", (char *)"ANI", (int )common->disable_ani ? (char *)"DISABLED" : (char *)"ENABLED"); len = (unsigned int )tmp___1 + len; if ((int )common->disable_ani) { goto exit; } else { } i = 0; goto ldv_54210; ldv_54209: tmp___2 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%15s: %u\n", ani_info[i].name, ani_info[i].val); len = (unsigned int )tmp___2 + len; i = i + 1; ldv_54210: ; if ((unsigned int )i <= 13U) { goto ldv_54209; } else { } exit: ; if (len > size) { len = size; } else { } retval = simple_read_from_buffer((void *)user_buf, count, ppos, (void const *)buf, (size_t )len); kfree((void const *)buf); return (retval); } } static ssize_t write_file_ani(struct file *file , char const *user_buf , size_t count , loff_t *ppos ) { struct ath_softc *sc ; struct ath_common *common ; struct ath_common *tmp ; unsigned long ani ; char buf[32U] ; ssize_t len ; size_t _min1 ; unsigned long _min2 ; unsigned long tmp___0 ; int tmp___1 ; { sc = (struct ath_softc *)file->private_data; tmp = ath9k_hw_common(sc->sc_ah); common = tmp; _min1 = count; _min2 = 31UL; len = (ssize_t )(_min1 < _min2 ? _min1 : _min2); tmp___0 = copy_from_user((void *)(& buf), (void const *)user_buf, (unsigned long )len); if (tmp___0 != 0UL) { return (-14L); } else { } buf[len] = 0; tmp___1 = kstrtoul((char const *)(& buf), 0U, & ani); if (tmp___1 != 0) { return (-22L); } else { } if (ani > 1UL) { return (-22L); } else { } common->disable_ani = ani == 0UL; if ((int )common->disable_ani) { clear_bit(2L, (unsigned long volatile *)(& common->op_flags)); ath_stop_ani(sc); } else { ath_check_ani(sc); } return ((ssize_t )count); } } static struct file_operations const fops_ani = {& __this_module, & default_llseek, & read_file_ani, & write_file_ani, 0, 0, 0, 0, 0, 0, 0, 0, & simple_open, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; static ssize_t read_file_bt_ant_diversity(struct file *file , char *user_buf , size_t count , loff_t *ppos ) { struct ath_softc *sc ; struct ath_common *common ; struct ath_common *tmp ; char buf[32U] ; unsigned int len ; int tmp___0 ; ssize_t tmp___1 ; { sc = (struct ath_softc *)file->private_data; tmp = ath9k_hw_common(sc->sc_ah); common = tmp; tmp___0 = sprintf((char *)(& buf), "%d\n", (int )common->bt_ant_diversity); len = (unsigned int )tmp___0; tmp___1 = simple_read_from_buffer((void *)user_buf, count, ppos, (void const *)(& buf), (size_t )len); return (tmp___1); } } static ssize_t write_file_bt_ant_diversity(struct file *file , char const *user_buf , size_t count , loff_t *ppos ) { struct ath_softc *sc ; struct ath_common *common ; struct ath_common *tmp ; struct ath9k_hw_capabilities *pCap ; unsigned long bt_ant_diversity ; char buf[32U] ; ssize_t len ; size_t _min1 ; unsigned long _min2 ; unsigned long tmp___0 ; int tmp___1 ; { sc = (struct ath_softc *)file->private_data; tmp = ath9k_hw_common(sc->sc_ah); common = tmp; pCap = & (sc->sc_ah)->caps; _min1 = count; _min2 = 31UL; len = (ssize_t )(_min1 < _min2 ? _min1 : _min2); tmp___0 = copy_from_user((void *)(& buf), (void const *)user_buf, (unsigned long )len); if (tmp___0 != 0UL) { return (-14L); } else { } if ((pCap->hw_caps & 131072U) == 0U) { goto exit; } else { } buf[len] = 0; tmp___1 = kstrtoul((char const *)(& buf), 0U, & bt_ant_diversity); if (tmp___1 != 0) { return (-22L); } else { } common->bt_ant_diversity = bt_ant_diversity != 0UL; ath9k_ps_wakeup(sc); ath9k_hw_set_bt_ant_diversity(sc->sc_ah, (int )common->bt_ant_diversity); if ((common->debug_mask & 512) != 0) { ath_printk("\017", (struct ath_common const *)common, "Enable WLAN/BT RX Antenna diversity: %d\n", (int )common->bt_ant_diversity); } else { } ath9k_ps_restore(sc); exit: ; return ((ssize_t )count); } } static struct file_operations const fops_bt_ant_diversity = {& __this_module, & default_llseek, & read_file_bt_ant_diversity, & write_file_bt_ant_diversity, 0, 0, 0, 0, 0, 0, 0, 0, & simple_open, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; void ath9k_debug_stat_ant(struct ath_softc *sc , struct ath_hw_antcomb_conf *div_ant_conf , int main_rssi_avg , int alt_rssi_avg ) { struct ath_antenna_stats *as_main ; struct ath_antenna_stats *as_alt ; { as_main = (struct ath_antenna_stats *)(& sc->debug.stats.ant_stats); as_alt = (struct ath_antenna_stats *)(& sc->debug.stats.ant_stats) + 1UL; as_main->lna_attempt_cnt[(int )div_ant_conf->main_lna_conf] = as_main->lna_attempt_cnt[(int )div_ant_conf->main_lna_conf] + 1U; as_alt->lna_attempt_cnt[(int )div_ant_conf->alt_lna_conf] = as_alt->lna_attempt_cnt[(int )div_ant_conf->alt_lna_conf] + 1U; as_main->rssi_avg = (u32 )main_rssi_avg; as_alt->rssi_avg = (u32 )alt_rssi_avg; return; } } static ssize_t read_file_antenna_diversity(struct file *file , char *user_buf , size_t count , loff_t *ppos ) { struct ath_softc *sc ; struct ath_hw *ah ; struct ath9k_hw_capabilities *pCap ; struct ath_antenna_stats *as_main ; struct ath_antenna_stats *as_alt ; struct ath_hw_antcomb_conf div_ant_conf ; unsigned int len ; unsigned int size ; ssize_t retval ; char *buf ; char const *lna_conf_str[4U] ; void *tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; int tmp___6 ; int tmp___7 ; int tmp___8 ; int tmp___9 ; int tmp___10 ; int tmp___11 ; int tmp___12 ; int tmp___13 ; int tmp___14 ; int tmp___15 ; int tmp___16 ; int tmp___17 ; int tmp___18 ; int tmp___19 ; { sc = (struct ath_softc *)file->private_data; ah = sc->sc_ah; pCap = & ah->caps; as_main = (struct ath_antenna_stats *)(& sc->debug.stats.ant_stats); as_alt = (struct ath_antenna_stats *)(& sc->debug.stats.ant_stats) + 1UL; len = 0U; size = 1024U; retval = 0L; lna_conf_str[0] = "LNA1_MINUS_LNA2"; lna_conf_str[1] = "LNA2"; lna_conf_str[2] = "LNA1"; lna_conf_str[3] = "LNA1_PLUS_LNA2"; tmp = kzalloc((size_t )size, 208U); buf = (char *)tmp; if ((unsigned long )buf == (unsigned long )((char *)0)) { return (-12L); } else { } if ((pCap->hw_caps & 1024U) == 0U) { tmp___0 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%s\n", (char *)"Antenna Diversity Combining is disabled"); len = (unsigned int )tmp___0 + len; goto exit; } else { } ath9k_ps_wakeup(sc); ath9k_hw_antdiv_comb_conf_get(ah, & div_ant_conf); tmp___1 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "Current MAIN config : %s\n", lna_conf_str[(int )div_ant_conf.main_lna_conf]); len = (unsigned int )tmp___1 + len; tmp___2 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "Current ALT config : %s\n", lna_conf_str[(int )div_ant_conf.alt_lna_conf]); len = (unsigned int )tmp___2 + len; tmp___3 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "Average MAIN RSSI : %d\n", as_main->rssi_avg); len = (unsigned int )tmp___3 + len; tmp___4 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "Average ALT RSSI : %d\n\n", as_alt->rssi_avg); len = (unsigned int )tmp___4 + len; ath9k_ps_restore(sc); tmp___5 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "Packet Receive Cnt:\n"); len = (unsigned int )tmp___5 + len; tmp___6 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "-------------------\n"); len = (unsigned int )tmp___6 + len; tmp___7 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%30s%15s\n", (char *)"MAIN", (char *)"ALT"); len = (unsigned int )tmp___7 + len; tmp___8 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%-14s:%15d%15d\n", (char *)"TOTAL COUNT", as_main->recv_cnt, as_alt->recv_cnt); len = (unsigned int )tmp___8 + len; tmp___9 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%-14s:%15d%15d\n", (char *)"LNA1", as_main->lna_recv_cnt[2], as_alt->lna_recv_cnt[2]); len = (unsigned int )tmp___9 + len; tmp___10 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%-14s:%15d%15d\n", (char *)"LNA2", as_main->lna_recv_cnt[1], as_alt->lna_recv_cnt[1]); len = (unsigned int )tmp___10 + len; tmp___11 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%-14s:%15d%15d\n", (char *)"LNA1 + LNA2", as_main->lna_recv_cnt[3], as_alt->lna_recv_cnt[3]); len = (unsigned int )tmp___11 + len; tmp___12 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%-14s:%15d%15d\n", (char *)"LNA1 - LNA2", as_main->lna_recv_cnt[0], as_alt->lna_recv_cnt[0]); len = (unsigned int )tmp___12 + len; tmp___13 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "\nLNA Config Attempts:\n"); len = (unsigned int )tmp___13 + len; tmp___14 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "--------------------\n"); len = (unsigned int )tmp___14 + len; tmp___15 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%30s%15s\n", (char *)"MAIN", (char *)"ALT"); len = (unsigned int )tmp___15 + len; tmp___16 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%-14s:%15d%15d\n", (char *)"LNA1", as_main->lna_attempt_cnt[2], as_alt->lna_attempt_cnt[2]); len = (unsigned int )tmp___16 + len; tmp___17 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%-14s:%15d%15d\n", (char *)"LNA2", as_main->lna_attempt_cnt[1], as_alt->lna_attempt_cnt[1]); len = (unsigned int )tmp___17 + len; tmp___18 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%-14s:%15d%15d\n", (char *)"LNA1 + LNA2", as_main->lna_attempt_cnt[3], as_alt->lna_attempt_cnt[3]); len = (unsigned int )tmp___18 + len; tmp___19 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%-14s:%15d%15d\n", (char *)"LNA1 - LNA2", as_main->lna_attempt_cnt[0], as_alt->lna_attempt_cnt[0]); len = (unsigned int )tmp___19 + len; exit: ; if (len > size) { len = size; } else { } retval = simple_read_from_buffer((void *)user_buf, count, ppos, (void const *)buf, (size_t )len); kfree((void const *)buf); return (retval); } } static struct file_operations const fops_antenna_diversity = {& __this_module, & default_llseek, & read_file_antenna_diversity, 0, 0, 0, 0, 0, 0, 0, 0, 0, & simple_open, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; static int read_file_dma(struct seq_file *file , void *data ) { struct ieee80211_hw *hw ; void *tmp ; struct ath_softc *sc ; struct ath_hw *ah ; u32 val[8U] ; int i ; int qcuOffset ; int dcuOffset ; u32 *qcuBase ; u32 *dcuBase ; struct ath_common *tmp___0 ; struct ath_common *tmp___1 ; struct ath_common *tmp___2 ; unsigned int tmp___3 ; struct ath_common *tmp___4 ; unsigned int tmp___5 ; { tmp = dev_get_drvdata((struct device const *)file->private); hw = (struct ieee80211_hw *)tmp; sc = (struct ath_softc *)hw->priv; ah = sc->sc_ah; qcuOffset = 0; dcuOffset = 0; qcuBase = (u32 *)(& val); dcuBase = (u32 *)(& val) + 4UL; ath9k_ps_wakeup(sc); tmp___0 = ath9k_hw_common(ah); (*((tmp___0->ops)->write))((void *)ah, 33024U, 88U); seq_puts(file, "Raw DMA Debug values:\n"); i = 0; goto ldv_54295; ldv_54294: ; if (((unsigned int )i & 3U) == 0U) { seq_puts(file, "\n"); } else { } tmp___1 = ath9k_hw_common(ah); val[i] = (*((tmp___1->ops)->read))((void *)ah, (u32 )((unsigned long )i + 56UL) * 4U); seq_printf(file, "%d: %08x ", i, val[i]); i = i + 1; ldv_54295: ; if (i <= 7) { goto ldv_54294; } else { } seq_puts(file, "\n\n"); seq_puts(file, "Num QCU: chain_st fsp_ok fsp_st DCU: chain_st\n"); i = 0; goto ldv_54298; ldv_54297: ; if (i == 8) { qcuOffset = 0; qcuBase = qcuBase + 1; } else { } if (i == 6) { dcuOffset = 0; dcuBase = dcuBase + 1; } else { } seq_printf(file, "%2d %2x %1x %2x %2x\n", i, (*qcuBase & (u32 )(7 << qcuOffset)) >> qcuOffset, (*qcuBase & (u32 )(8 << qcuOffset)) >> (qcuOffset + 3), (val[2] & (u32 )(7 << i * 3)) >> i * 3, (*dcuBase & (u32 )(31 << dcuOffset)) >> dcuOffset); i = i + 1; qcuOffset = qcuOffset + 4; dcuOffset = dcuOffset + 5; ldv_54298: ; if (i <= 9) { goto ldv_54297; } else { } seq_puts(file, "\n"); seq_printf(file, "qcu_stitch state: %2x qcu_fetch state: %2x\n", (val[3] & 3932160U) >> 18, (val[3] & 62914560U) >> 22); seq_printf(file, "qcu_complete state: %2x dcu_complete state: %2x\n", (val[3] & 469762048U) >> 26, val[6] & 3U); seq_printf(file, "dcu_arb state: %2x dcu_fp state: %2x\n", (val[5] & 100663296U) >> 25, (val[5] & 939524096U) >> 27); seq_printf(file, "chan_idle_dur: %3d chan_idle_dur_valid: %1d\n", (val[6] & 1020U) >> 2, (val[6] & 1024U) >> 10); seq_printf(file, "txfifo_valid_0: %1d txfifo_valid_1: %1d\n", (val[6] & 2048U) >> 11, (val[6] & 4096U) >> 12); seq_printf(file, "txfifo_dcu_num_0: %2d txfifo_dcu_num_1: %2d\n", (val[6] & 122880U) >> 13, (val[6] & 1966080U) >> 17); tmp___2 = ath9k_hw_common(ah); tmp___3 = (*((tmp___2->ops)->read))((void *)ah, 32876U); seq_printf(file, "pcu observe: 0x%x\n", tmp___3); tmp___4 = ath9k_hw_common(ah); tmp___5 = (*((tmp___4->ops)->read))((void *)ah, 8U); seq_printf(file, "AR_CR: 0x%x\n", tmp___5); ath9k_ps_restore(sc); return (0); } } void ath_debug_stat_interrupt(struct ath_softc *sc , enum ath9k_int status ) { { if ((unsigned int )status != 0U) { sc->debug.stats.istats.total = sc->debug.stats.istats.total + 1U; } else { } if (((sc->sc_ah)->caps.hw_caps & 16U) != 0U) { if (((unsigned int )status & 2U) != 0U) { sc->debug.stats.istats.rxlp = sc->debug.stats.istats.rxlp + 1U; } else { } if ((int )status & 1) { sc->debug.stats.istats.rxhp = sc->debug.stats.istats.rxhp + 1U; } else { } if (((unsigned int )status & 1024U) != 0U) { sc->debug.stats.istats.bb_watchdog = sc->debug.stats.istats.bb_watchdog + 1U; } else { } } else if ((int )status & 1) { sc->debug.stats.istats.rxok = sc->debug.stats.istats.rxok + 1U; } else { } if (((unsigned int )status & 16U) != 0U) { sc->debug.stats.istats.rxeol = sc->debug.stats.istats.rxeol + 1U; } else { } if (((unsigned int )status & 32U) != 0U) { sc->debug.stats.istats.rxorn = sc->debug.stats.istats.rxorn + 1U; } else { } if (((unsigned int )status & 64U) != 0U) { sc->debug.stats.istats.txok = sc->debug.stats.istats.txok + 1U; } else { } if (((unsigned int )status & 2048U) != 0U) { sc->debug.stats.istats.txurn = sc->debug.stats.istats.txurn + 1U; } else { } if (((unsigned int )status & 16384U) != 0U) { sc->debug.stats.istats.rxphyerr = sc->debug.stats.istats.rxphyerr + 1U; } else { } if (((unsigned int )status & 32768U) != 0U) { sc->debug.stats.istats.rx_keycache_miss = sc->debug.stats.istats.rx_keycache_miss + 1U; } else { } if (((unsigned int )status & 65536U) != 0U) { sc->debug.stats.istats.swba = sc->debug.stats.istats.swba + 1U; } else { } if (((unsigned int )status & 262144U) != 0U) { sc->debug.stats.istats.bmiss = sc->debug.stats.istats.bmiss + 1U; } else { } if (((unsigned int )status & 1048576U) != 0U) { sc->debug.stats.istats.bnr = sc->debug.stats.istats.bnr + 1U; } else { } if (((unsigned int )status & 268435456U) != 0U) { sc->debug.stats.istats.cst = sc->debug.stats.istats.cst + 1U; } else { } if (((unsigned int )status & 536870912U) != 0U) { sc->debug.stats.istats.gtt = sc->debug.stats.istats.gtt + 1U; } else { } if (((unsigned int )status & 2097152U) != 0U) { sc->debug.stats.istats.tim = sc->debug.stats.istats.tim + 1U; } else { } if (((unsigned int )status & 33554432U) != 0U) { sc->debug.stats.istats.cabend = sc->debug.stats.istats.cabend + 1U; } else { } if (((unsigned int )status & 8388608U) != 0U) { sc->debug.stats.istats.dtimsync = sc->debug.stats.istats.dtimsync + 1U; } else { } if (((unsigned int )status & 4194304U) != 0U) { sc->debug.stats.istats.dtim = sc->debug.stats.istats.dtim + 1U; } else { } if (((unsigned int )status & 67108864U) != 0U) { sc->debug.stats.istats.tsfoor = sc->debug.stats.istats.tsfoor + 1U; } else { } if (((unsigned int )status & 512U) != 0U) { sc->debug.stats.istats.mci = sc->debug.stats.istats.mci + 1U; } else { } if (((unsigned int )status & 134217728U) != 0U) { sc->debug.stats.istats.gen_timer = sc->debug.stats.istats.gen_timer + 1U; } else { } return; } } static int read_file_interrupt(struct seq_file *file , void *data ) { struct ieee80211_hw *hw ; void *tmp ; struct ath_softc *sc ; { tmp = dev_get_drvdata((struct device const *)file->private); hw = (struct ieee80211_hw *)tmp; sc = (struct ath_softc *)hw->priv; if (((sc->sc_ah)->caps.hw_caps & 16U) != 0U) { seq_printf(file, "%21s: %10u\n", (char *)"RXLP", sc->debug.stats.istats.rxlp); seq_printf(file, "%21s: %10u\n", (char *)"RXHP", sc->debug.stats.istats.rxhp); seq_printf(file, "%21s: %10u\n", (char *)"WATHDOG", sc->debug.stats.istats.bb_watchdog); } else { seq_printf(file, "%21s: %10u\n", (char *)"RX", sc->debug.stats.istats.rxok); } seq_printf(file, "%21s: %10u\n", (char *)"RXEOL", sc->debug.stats.istats.rxeol); seq_printf(file, "%21s: %10u\n", (char *)"RXORN", sc->debug.stats.istats.rxorn); seq_printf(file, "%21s: %10u\n", (char *)"TX", sc->debug.stats.istats.txok); seq_printf(file, "%21s: %10u\n", (char *)"TXURN", sc->debug.stats.istats.txurn); seq_printf(file, "%21s: %10u\n", (char *)"MIB", sc->debug.stats.istats.mib); seq_printf(file, "%21s: %10u\n", (char *)"RXPHY", sc->debug.stats.istats.rxphyerr); seq_printf(file, "%21s: %10u\n", (char *)"RXKCM", sc->debug.stats.istats.rx_keycache_miss); seq_printf(file, "%21s: %10u\n", (char *)"SWBA", sc->debug.stats.istats.swba); seq_printf(file, "%21s: %10u\n", (char *)"BMISS", sc->debug.stats.istats.bmiss); seq_printf(file, "%21s: %10u\n", (char *)"BNR", sc->debug.stats.istats.bnr); seq_printf(file, "%21s: %10u\n", (char *)"CST", sc->debug.stats.istats.cst); seq_printf(file, "%21s: %10u\n", (char *)"GTT", sc->debug.stats.istats.gtt); seq_printf(file, "%21s: %10u\n", (char *)"TIM", sc->debug.stats.istats.tim); seq_printf(file, "%21s: %10u\n", (char *)"CABEND", sc->debug.stats.istats.cabend); seq_printf(file, "%21s: %10u\n", (char *)"DTIMSYNC", sc->debug.stats.istats.dtimsync); seq_printf(file, "%21s: %10u\n", (char *)"DTIM", sc->debug.stats.istats.dtim); seq_printf(file, "%21s: %10u\n", (char *)"TSFOOR", sc->debug.stats.istats.tsfoor); seq_printf(file, "%21s: %10u\n", (char *)"MCI", sc->debug.stats.istats.mci); seq_printf(file, "%21s: %10u\n", (char *)"GENTIMER", sc->debug.stats.istats.gen_timer); seq_printf(file, "%21s: %10u\n", (char *)"TOTAL", sc->debug.stats.istats.total); seq_puts(file, "SYNC_CAUSE stats:\n"); seq_printf(file, "%21s: %10u\n", (char *)"Sync-All", sc->debug.stats.istats.sync_cause_all); seq_printf(file, "%21s: %10u\n", (char *)"RTC-IRQ", sc->debug.stats.istats.sync_rtc_irq); seq_printf(file, "%21s: %10u\n", (char *)"MAC-IRQ", sc->debug.stats.istats.sync_mac_irq); seq_printf(file, "%21s: %10u\n", (char *)"EEPROM-Illegal-Access", sc->debug.stats.istats.eeprom_illegal_access); seq_printf(file, "%21s: %10u\n", (char *)"APB-Timeout", sc->debug.stats.istats.apb_timeout); seq_printf(file, "%21s: %10u\n", (char *)"PCI-Mode-Conflict", sc->debug.stats.istats.pci_mode_conflict); seq_printf(file, "%21s: %10u\n", (char *)"HOST1-Fatal", sc->debug.stats.istats.host1_fatal); seq_printf(file, "%21s: %10u\n", (char *)"HOST1-Perr", sc->debug.stats.istats.host1_perr); seq_printf(file, "%21s: %10u\n", (char *)"TRCV-FIFO-Perr", sc->debug.stats.istats.trcv_fifo_perr); seq_printf(file, "%21s: %10u\n", (char *)"RADM-CPL-EP", sc->debug.stats.istats.radm_cpl_ep); seq_printf(file, "%21s: %10u\n", (char *)"RADM-CPL-DLLP-Abort", sc->debug.stats.istats.radm_cpl_dllp_abort); seq_printf(file, "%21s: %10u\n", (char *)"RADM-CPL-TLP-Abort", sc->debug.stats.istats.radm_cpl_tlp_abort); seq_printf(file, "%21s: %10u\n", (char *)"RADM-CPL-ECRC-Err", sc->debug.stats.istats.radm_cpl_ecrc_err); seq_printf(file, "%21s: %10u\n", (char *)"RADM-CPL-Timeout", sc->debug.stats.istats.radm_cpl_timeout); seq_printf(file, "%21s: %10u\n", (char *)"Local-Bus-Timeout", sc->debug.stats.istats.local_timeout); seq_printf(file, "%21s: %10u\n", (char *)"PM-Access", sc->debug.stats.istats.pm_access); seq_printf(file, "%21s: %10u\n", (char *)"MAC-Awake", sc->debug.stats.istats.mac_awake); seq_printf(file, "%21s: %10u\n", (char *)"MAC-Asleep", sc->debug.stats.istats.mac_asleep); seq_printf(file, "%21s: %10u\n", (char *)"MAC-Sleep-Access", sc->debug.stats.istats.mac_sleep_access); return (0); } } static int read_file_xmit(struct seq_file *file , void *data ) { struct ieee80211_hw *hw ; void *tmp ; struct ath_softc *sc ; { tmp = dev_get_drvdata((struct device const *)file->private); hw = (struct ieee80211_hw *)tmp; sc = (struct ath_softc *)hw->priv; seq_printf(file, "%30s %10s%10s%10s\n\n", (char *)"BE", (char *)"BK", (char *)"VI", (char *)"VO"); seq_printf(file, "%s%13u%11u%10u%10u\n", (char *)"MPDUs Queued: ", sc->debug.stats.txstats[(sc->tx.txq_map[2])->axq_qnum].queued, sc->debug.stats.txstats[(sc->tx.txq_map[3])->axq_qnum].queued, sc->debug.stats.txstats[(sc->tx.txq_map[1])->axq_qnum].queued, sc->debug.stats.txstats[(sc->tx.txq_map[0])->axq_qnum].queued); seq_printf(file, "%s%13u%11u%10u%10u\n", (char *)"MPDUs Completed: ", sc->debug.stats.txstats[(sc->tx.txq_map[2])->axq_qnum].completed, sc->debug.stats.txstats[(sc->tx.txq_map[3])->axq_qnum].completed, sc->debug.stats.txstats[(sc->tx.txq_map[1])->axq_qnum].completed, sc->debug.stats.txstats[(sc->tx.txq_map[0])->axq_qnum].completed); seq_printf(file, "%s%13u%11u%10u%10u\n", (char *)"MPDUs XRetried: ", sc->debug.stats.txstats[(sc->tx.txq_map[2])->axq_qnum].xretries, sc->debug.stats.txstats[(sc->tx.txq_map[3])->axq_qnum].xretries, sc->debug.stats.txstats[(sc->tx.txq_map[1])->axq_qnum].xretries, sc->debug.stats.txstats[(sc->tx.txq_map[0])->axq_qnum].xretries); seq_printf(file, "%s%13u%11u%10u%10u\n", (char *)"Aggregates: ", sc->debug.stats.txstats[(sc->tx.txq_map[2])->axq_qnum].a_aggr, sc->debug.stats.txstats[(sc->tx.txq_map[3])->axq_qnum].a_aggr, sc->debug.stats.txstats[(sc->tx.txq_map[1])->axq_qnum].a_aggr, sc->debug.stats.txstats[(sc->tx.txq_map[0])->axq_qnum].a_aggr); seq_printf(file, "%s%13u%11u%10u%10u\n", (char *)"AMPDUs Queued HW:", sc->debug.stats.txstats[(sc->tx.txq_map[2])->axq_qnum].a_queued_hw, sc->debug.stats.txstats[(sc->tx.txq_map[3])->axq_qnum].a_queued_hw, sc->debug.stats.txstats[(sc->tx.txq_map[1])->axq_qnum].a_queued_hw, sc->debug.stats.txstats[(sc->tx.txq_map[0])->axq_qnum].a_queued_hw); seq_printf(file, "%s%13u%11u%10u%10u\n", (char *)"AMPDUs Queued SW:", sc->debug.stats.txstats[(sc->tx.txq_map[2])->axq_qnum].a_queued_sw, sc->debug.stats.txstats[(sc->tx.txq_map[3])->axq_qnum].a_queued_sw, sc->debug.stats.txstats[(sc->tx.txq_map[1])->axq_qnum].a_queued_sw, sc->debug.stats.txstats[(sc->tx.txq_map[0])->axq_qnum].a_queued_sw); seq_printf(file, "%s%13u%11u%10u%10u\n", (char *)"AMPDUs Completed:", sc->debug.stats.txstats[(sc->tx.txq_map[2])->axq_qnum].a_completed, sc->debug.stats.txstats[(sc->tx.txq_map[3])->axq_qnum].a_completed, sc->debug.stats.txstats[(sc->tx.txq_map[1])->axq_qnum].a_completed, sc->debug.stats.txstats[(sc->tx.txq_map[0])->axq_qnum].a_completed); seq_printf(file, "%s%13u%11u%10u%10u\n", (char *)"AMPDUs Retried: ", sc->debug.stats.txstats[(sc->tx.txq_map[2])->axq_qnum].a_retries, sc->debug.stats.txstats[(sc->tx.txq_map[3])->axq_qnum].a_retries, sc->debug.stats.txstats[(sc->tx.txq_map[1])->axq_qnum].a_retries, sc->debug.stats.txstats[(sc->tx.txq_map[0])->axq_qnum].a_retries); seq_printf(file, "%s%13u%11u%10u%10u\n", (char *)"AMPDUs XRetried: ", sc->debug.stats.txstats[(sc->tx.txq_map[2])->axq_qnum].a_xretries, sc->debug.stats.txstats[(sc->tx.txq_map[3])->axq_qnum].a_xretries, sc->debug.stats.txstats[(sc->tx.txq_map[1])->axq_qnum].a_xretries, sc->debug.stats.txstats[(sc->tx.txq_map[0])->axq_qnum].a_xretries); seq_printf(file, "%s%13u%11u%10u%10u\n", (char *)"TXERR Filtered: ", sc->debug.stats.txstats[(sc->tx.txq_map[2])->axq_qnum].txerr_filtered, sc->debug.stats.txstats[(sc->tx.txq_map[3])->axq_qnum].txerr_filtered, sc->debug.stats.txstats[(sc->tx.txq_map[1])->axq_qnum].txerr_filtered, sc->debug.stats.txstats[(sc->tx.txq_map[0])->axq_qnum].txerr_filtered); seq_printf(file, "%s%13u%11u%10u%10u\n", (char *)"FIFO Underrun: ", sc->debug.stats.txstats[(sc->tx.txq_map[2])->axq_qnum].fifo_underrun, sc->debug.stats.txstats[(sc->tx.txq_map[3])->axq_qnum].fifo_underrun, sc->debug.stats.txstats[(sc->tx.txq_map[1])->axq_qnum].fifo_underrun, sc->debug.stats.txstats[(sc->tx.txq_map[0])->axq_qnum].fifo_underrun); seq_printf(file, "%s%13u%11u%10u%10u\n", (char *)"TXOP Exceeded: ", sc->debug.stats.txstats[(sc->tx.txq_map[2])->axq_qnum].xtxop, sc->debug.stats.txstats[(sc->tx.txq_map[3])->axq_qnum].xtxop, sc->debug.stats.txstats[(sc->tx.txq_map[1])->axq_qnum].xtxop, sc->debug.stats.txstats[(sc->tx.txq_map[0])->axq_qnum].xtxop); seq_printf(file, "%s%13u%11u%10u%10u\n", (char *)"TXTIMER Expiry: ", sc->debug.stats.txstats[(sc->tx.txq_map[2])->axq_qnum].timer_exp, sc->debug.stats.txstats[(sc->tx.txq_map[3])->axq_qnum].timer_exp, sc->debug.stats.txstats[(sc->tx.txq_map[1])->axq_qnum].timer_exp, sc->debug.stats.txstats[(sc->tx.txq_map[0])->axq_qnum].timer_exp); seq_printf(file, "%s%13u%11u%10u%10u\n", (char *)"DESC CFG Error: ", sc->debug.stats.txstats[(sc->tx.txq_map[2])->axq_qnum].desc_cfg_err, sc->debug.stats.txstats[(sc->tx.txq_map[3])->axq_qnum].desc_cfg_err, sc->debug.stats.txstats[(sc->tx.txq_map[1])->axq_qnum].desc_cfg_err, sc->debug.stats.txstats[(sc->tx.txq_map[0])->axq_qnum].desc_cfg_err); seq_printf(file, "%s%13u%11u%10u%10u\n", (char *)"DATA Underrun: ", sc->debug.stats.txstats[(sc->tx.txq_map[2])->axq_qnum].data_underrun, sc->debug.stats.txstats[(sc->tx.txq_map[3])->axq_qnum].data_underrun, sc->debug.stats.txstats[(sc->tx.txq_map[1])->axq_qnum].data_underrun, sc->debug.stats.txstats[(sc->tx.txq_map[0])->axq_qnum].data_underrun); seq_printf(file, "%s%13u%11u%10u%10u\n", (char *)"DELIM Underrun: ", sc->debug.stats.txstats[(sc->tx.txq_map[2])->axq_qnum].delim_underrun, sc->debug.stats.txstats[(sc->tx.txq_map[3])->axq_qnum].delim_underrun, sc->debug.stats.txstats[(sc->tx.txq_map[1])->axq_qnum].delim_underrun, sc->debug.stats.txstats[(sc->tx.txq_map[0])->axq_qnum].delim_underrun); seq_printf(file, "%s%13u%11u%10u%10u\n", (char *)"TX-Pkts-All: ", sc->debug.stats.txstats[(sc->tx.txq_map[2])->axq_qnum].tx_pkts_all, sc->debug.stats.txstats[(sc->tx.txq_map[3])->axq_qnum].tx_pkts_all, sc->debug.stats.txstats[(sc->tx.txq_map[1])->axq_qnum].tx_pkts_all, sc->debug.stats.txstats[(sc->tx.txq_map[0])->axq_qnum].tx_pkts_all); seq_printf(file, "%s%13u%11u%10u%10u\n", (char *)"TX-Bytes-All: ", sc->debug.stats.txstats[(sc->tx.txq_map[2])->axq_qnum].tx_bytes_all, sc->debug.stats.txstats[(sc->tx.txq_map[3])->axq_qnum].tx_bytes_all, sc->debug.stats.txstats[(sc->tx.txq_map[1])->axq_qnum].tx_bytes_all, sc->debug.stats.txstats[(sc->tx.txq_map[0])->axq_qnum].tx_bytes_all); seq_printf(file, "%s%13u%11u%10u%10u\n", (char *)"HW-put-tx-buf: ", sc->debug.stats.txstats[(sc->tx.txq_map[2])->axq_qnum].puttxbuf, sc->debug.stats.txstats[(sc->tx.txq_map[3])->axq_qnum].puttxbuf, sc->debug.stats.txstats[(sc->tx.txq_map[1])->axq_qnum].puttxbuf, sc->debug.stats.txstats[(sc->tx.txq_map[0])->axq_qnum].puttxbuf); seq_printf(file, "%s%13u%11u%10u%10u\n", (char *)"HW-tx-start: ", sc->debug.stats.txstats[(sc->tx.txq_map[2])->axq_qnum].txstart, sc->debug.stats.txstats[(sc->tx.txq_map[3])->axq_qnum].txstart, sc->debug.stats.txstats[(sc->tx.txq_map[1])->axq_qnum].txstart, sc->debug.stats.txstats[(sc->tx.txq_map[0])->axq_qnum].txstart); seq_printf(file, "%s%13u%11u%10u%10u\n", (char *)"HW-tx-proc-desc: ", sc->debug.stats.txstats[(sc->tx.txq_map[2])->axq_qnum].txprocdesc, sc->debug.stats.txstats[(sc->tx.txq_map[3])->axq_qnum].txprocdesc, sc->debug.stats.txstats[(sc->tx.txq_map[1])->axq_qnum].txprocdesc, sc->debug.stats.txstats[(sc->tx.txq_map[0])->axq_qnum].txprocdesc); seq_printf(file, "%s%13u%11u%10u%10u\n", (char *)"TX-Failed: ", sc->debug.stats.txstats[(sc->tx.txq_map[2])->axq_qnum].txfailed, sc->debug.stats.txstats[(sc->tx.txq_map[3])->axq_qnum].txfailed, sc->debug.stats.txstats[(sc->tx.txq_map[1])->axq_qnum].txfailed, sc->debug.stats.txstats[(sc->tx.txq_map[0])->axq_qnum].txfailed); return (0); } } static void print_queue(struct ath_softc *sc , struct ath_txq *txq , struct seq_file *file ) { { ath_txq_lock(sc, txq); seq_printf(file, "%s: %d ", (char *)"qnum", txq->axq_qnum); seq_printf(file, "%s: %2d ", (char *)"qdepth", txq->axq_depth); seq_printf(file, "%s: %2d ", (char *)"ampdu-depth", txq->axq_ampdu_depth); seq_printf(file, "%s: %3d ", (char *)"pending", txq->pending_frames); seq_printf(file, "%s: %d\n", (char *)"stopped", (int )txq->stopped); ath_txq_unlock(sc, txq); return; } } static int read_file_queues(struct seq_file *file , void *data ) { struct ieee80211_hw *hw ; void *tmp ; struct ath_softc *sc ; struct ath_txq *txq ; int i ; char const *qname[4U] ; { tmp = dev_get_drvdata((struct device const *)file->private); hw = (struct ieee80211_hw *)tmp; sc = (struct ath_softc *)hw->priv; qname[0] = "VO"; qname[1] = "VI"; qname[2] = "BE"; qname[3] = "BK"; i = 0; goto ldv_54331; ldv_54330: txq = sc->tx.txq_map[i]; seq_printf(file, "(%s): ", qname[i]); print_queue(sc, txq, file); i = i + 1; ldv_54331: ; if (i <= 3) { goto ldv_54330; } else { } seq_puts(file, "(CAB): "); print_queue(sc, sc->beacon.cabq, file); return (0); } } static int read_file_misc(struct seq_file *file , void *data ) { struct ieee80211_hw *hw ; void *tmp ; struct ath_softc *sc ; struct ath_common *common ; struct ath_common *tmp___0 ; struct ath9k_vif_iter_data iter_data ; struct ath_chanctx *ctx ; unsigned int reg ; u32 rxfilter ; u32 i ; char const *tmp___1 ; int tmp___2 ; u32 tmp___3 ; { tmp = dev_get_drvdata((struct device const *)file->private); hw = (struct ieee80211_hw *)tmp; sc = (struct ath_softc *)hw->priv; tmp___0 = ath9k_hw_common(sc->sc_ah); common = tmp___0; seq_printf(file, "BSSID: %pM\n", (u8 *)(& common->curbssid)); seq_printf(file, "BSSID-MASK: %pM\n", (u8 *)(& common->bssidmask)); tmp___1 = ath_opmode_to_string((sc->sc_ah)->opmode); seq_printf(file, "OPMODE: %s\n", tmp___1); ath9k_ps_wakeup(sc); rxfilter = ath9k_hw_getrxfilter(sc->sc_ah); ath9k_ps_restore(sc); seq_printf(file, "RXFILTER: 0x%x", rxfilter); if ((int )rxfilter & 1) { seq_puts(file, " UCAST"); } else { } if ((rxfilter & 2U) != 0U) { seq_puts(file, " MCAST"); } else { } if ((rxfilter & 4U) != 0U) { seq_puts(file, " BCAST"); } else { } if ((rxfilter & 8U) != 0U) { seq_puts(file, " CONTROL"); } else { } if ((rxfilter & 16U) != 0U) { seq_puts(file, " BEACON"); } else { } if ((rxfilter & 32U) != 0U) { seq_puts(file, " PROM"); } else { } if ((rxfilter & 128U) != 0U) { seq_puts(file, " PROBEREQ"); } else { } if ((rxfilter & 256U) != 0U) { seq_puts(file, " PHYERR"); } else { } if ((rxfilter & 512U) != 0U) { seq_puts(file, " MYBEACON"); } else { } if ((rxfilter & 1024U) != 0U) { seq_puts(file, " COMP_BAR"); } else { } if ((rxfilter & 16384U) != 0U) { seq_puts(file, " PSPOLL"); } else { } if ((rxfilter & 8192U) != 0U) { seq_puts(file, " PHYRADAR"); } else { } if ((rxfilter & 32768U) != 0U) { seq_puts(file, " MCAST_BCAST_ALL"); } else { } if ((rxfilter & 524288U) != 0U) { seq_puts(file, " CONTROL_WRAPPER"); } else { } seq_puts(file, "\n"); reg = (unsigned int )(sc->sc_ah)->imask; seq_printf(file, "INTERRUPT-MASK: 0x%x", reg); if ((reg & 65536U) != 0U) { seq_puts(file, " SWBA"); } else { } if ((reg & 262144U) != 0U) { seq_puts(file, " BMISS"); } else { } if ((reg & 268435456U) != 0U) { seq_puts(file, " CST"); } else { } if ((int )reg & 1) { seq_puts(file, " RX"); } else { } if ((int )reg & 1) { seq_puts(file, " RXHP"); } else { } if ((reg & 2U) != 0U) { seq_puts(file, " RXLP"); } else { } if ((reg & 1024U) != 0U) { seq_puts(file, " BB_WATCHDOG"); } else { } seq_puts(file, "\n"); i = 0U; ctx = (struct ath_chanctx *)(& sc->chanctx); goto ldv_54349; ldv_54348: tmp___2 = list_empty((struct list_head const *)(& ctx->vifs)); if (tmp___2 != 0) { goto ldv_54347; } else { } ath9k_calculate_iter_data(sc, ctx, & iter_data); tmp___3 = i; i = i + 1U; seq_printf(file, "VIFS: CTX %i(%i) AP: %i STA: %i MESH: %i WDS: %i", tmp___3, (int )ctx->assigned, iter_data.naps, iter_data.nstations, iter_data.nmeshes, iter_data.nwds); seq_printf(file, " ADHOC: %i TOTAL: %hi BEACON-VIF: %hi\n", iter_data.nadhocs, (int )(sc->cur_chan)->nvifs, (int )sc->nbcnvifs); ldv_54347: ctx = ctx + 1; ldv_54349: ; if ((unsigned long )((struct ath_chanctx *)(& sc->chanctx) + 1UL) >= (unsigned long )ctx) { goto ldv_54348; } else { } return (0); } } static int read_file_reset(struct seq_file *file , void *data ) { struct ieee80211_hw *hw ; void *tmp ; struct ath_softc *sc ; char const *reset_cause[11U] ; int i ; { tmp = dev_get_drvdata((struct device const *)file->private); hw = (struct ieee80211_hw *)tmp; sc = (struct ath_softc *)hw->priv; reset_cause[0] = "Baseband Hang"; reset_cause[1] = "Baseband Watchdog"; reset_cause[2] = "Fatal HW Error"; reset_cause[3] = "TX HW error"; reset_cause[4] = "Transmit timeout"; reset_cause[5] = "TX Path Hang"; reset_cause[6] = "PLL RX Hang"; reset_cause[7] = "MAC Hang"; reset_cause[8] = "Stuck Beacon"; reset_cause[9] = "MCI Reset"; reset_cause[10] = "Calibration error"; i = 0; goto ldv_54363; ldv_54362: ; if ((unsigned long )reset_cause[i] == (unsigned long )((char const */* const */)0)) { goto ldv_54361; } else { } seq_printf(file, "%17s: %2d\n", reset_cause[i], sc->debug.stats.reset[i]); ldv_54361: i = i + 1; ldv_54363: ; if ((unsigned int )i <= 10U) { goto ldv_54362; } else { } return (0); } } void ath_debug_stat_tx(struct ath_softc *sc , struct ath_buf *bf , struct ath_tx_status *ts , struct ath_txq *txq , unsigned int flags ) { int qnum ; { qnum = (int )txq->axq_qnum; sc->debug.stats.txstats[qnum].tx_pkts_all = sc->debug.stats.txstats[qnum].tx_pkts_all + 1U; sc->debug.stats.txstats[qnum].tx_bytes_all = sc->debug.stats.txstats[qnum].tx_bytes_all + (bf->bf_mpdu)->len; if ((int )bf->bf_state.bf_type & 1) { if ((int )flags & 1) { sc->debug.stats.txstats[qnum].a_xretries = sc->debug.stats.txstats[qnum].a_xretries + 1U; } else { sc->debug.stats.txstats[qnum].a_completed = sc->debug.stats.txstats[qnum].a_completed + 1U; } } else if ((int )ts->ts_status & 1) { sc->debug.stats.txstats[qnum].xretries = sc->debug.stats.txstats[qnum].xretries + 1U; } else { sc->debug.stats.txstats[qnum].completed = sc->debug.stats.txstats[qnum].completed + 1U; } if (((int )ts->ts_status & 2) != 0) { sc->debug.stats.txstats[qnum].txerr_filtered = sc->debug.stats.txstats[qnum].txerr_filtered + 1U; } else { } if (((int )ts->ts_status & 4) != 0) { sc->debug.stats.txstats[qnum].fifo_underrun = sc->debug.stats.txstats[qnum].fifo_underrun + 1U; } else { } if (((int )ts->ts_status & 8) != 0) { sc->debug.stats.txstats[qnum].xtxop = sc->debug.stats.txstats[qnum].xtxop + 1U; } else { } if (((int )ts->ts_status & 16) != 0) { sc->debug.stats.txstats[qnum].timer_exp = sc->debug.stats.txstats[qnum].timer_exp + 1U; } else { } if (((int )ts->ts_flags & 4) != 0) { sc->debug.stats.txstats[qnum].desc_cfg_err = sc->debug.stats.txstats[qnum].desc_cfg_err + 1U; } else { } if (((int )ts->ts_flags & 8) != 0) { sc->debug.stats.txstats[qnum].data_underrun = sc->debug.stats.txstats[qnum].data_underrun + 1U; } else { } if (((int )ts->ts_flags & 16) != 0) { sc->debug.stats.txstats[qnum].delim_underrun = sc->debug.stats.txstats[qnum].delim_underrun + 1U; } else { } return; } } void ath_debug_stat_rx(struct ath_softc *sc , struct ath_rx_status *rs ) { { ath9k_cmn_debug_stat_rx(& sc->debug.stats.rxstats, rs); return; } } static ssize_t read_file_regidx(struct file *file , char *user_buf , size_t count , loff_t *ppos ) { struct ath_softc *sc ; char buf[32U] ; unsigned int len ; int tmp ; ssize_t tmp___0 ; { sc = (struct ath_softc *)file->private_data; tmp = sprintf((char *)(& buf), "0x%08x\n", sc->debug.regidx); len = (unsigned int )tmp; tmp___0 = simple_read_from_buffer((void *)user_buf, count, ppos, (void const *)(& buf), (size_t )len); return (tmp___0); } } static ssize_t write_file_regidx(struct file *file , char const *user_buf , size_t count , loff_t *ppos ) { struct ath_softc *sc ; unsigned long regidx ; char buf[32U] ; ssize_t len ; size_t _min1 ; unsigned long _min2 ; unsigned long tmp ; int tmp___0 ; { sc = (struct ath_softc *)file->private_data; _min1 = count; _min2 = 31UL; len = (ssize_t )(_min1 < _min2 ? _min1 : _min2); tmp = copy_from_user((void *)(& buf), (void const *)user_buf, (unsigned long )len); if (tmp != 0UL) { return (-14L); } else { } buf[len] = 0; tmp___0 = kstrtoul((char const *)(& buf), 0U, & regidx); if (tmp___0 != 0) { return (-22L); } else { } sc->debug.regidx = (u32 )regidx; return ((ssize_t )count); } } static struct file_operations const fops_regidx = {& __this_module, & default_llseek, & read_file_regidx, & write_file_regidx, 0, 0, 0, 0, 0, 0, 0, 0, & simple_open, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; static ssize_t read_file_regval(struct file *file , char *user_buf , size_t count , loff_t *ppos ) { struct ath_softc *sc ; struct ath_hw *ah ; char buf[32U] ; unsigned int len ; u32 regval ; struct ath_common *tmp ; int tmp___0 ; ssize_t tmp___1 ; { sc = (struct ath_softc *)file->private_data; ah = sc->sc_ah; ath9k_ps_wakeup(sc); tmp = ath9k_hw_common(ah); regval = (*((tmp->ops)->read))((void *)ah, sc->debug.regidx); ath9k_ps_restore(sc); tmp___0 = sprintf((char *)(& buf), "0x%08x\n", regval); len = (unsigned int )tmp___0; tmp___1 = simple_read_from_buffer((void *)user_buf, count, ppos, (void const *)(& buf), (size_t )len); return (tmp___1); } } static ssize_t write_file_regval(struct file *file , char const *user_buf , size_t count , loff_t *ppos ) { struct ath_softc *sc ; struct ath_hw *ah ; unsigned long regval ; char buf[32U] ; ssize_t len ; size_t _min1 ; unsigned long _min2 ; unsigned long tmp ; int tmp___0 ; struct ath_common *tmp___1 ; { sc = (struct ath_softc *)file->private_data; ah = sc->sc_ah; _min1 = count; _min2 = 31UL; len = (ssize_t )(_min1 < _min2 ? _min1 : _min2); tmp = copy_from_user((void *)(& buf), (void const *)user_buf, (unsigned long )len); if (tmp != 0UL) { return (-14L); } else { } buf[len] = 0; tmp___0 = kstrtoul((char const *)(& buf), 0U, & regval); if (tmp___0 != 0) { return (-22L); } else { } ath9k_ps_wakeup(sc); tmp___1 = ath9k_hw_common(ah); (*((tmp___1->ops)->write))((void *)ah, (u32 )regval, sc->debug.regidx); ath9k_ps_restore(sc); return ((ssize_t )count); } } static struct file_operations const fops_regval = {& __this_module, & default_llseek, & read_file_regval, & write_file_regval, 0, 0, 0, 0, 0, 0, 0, 0, & simple_open, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; static int open_file_regdump(struct inode *inode , struct file *file ) { struct ath_softc *sc ; unsigned int len ; u8 *buf ; int i ; unsigned long num_regs ; unsigned long regdump_len ; unsigned long max_reg_offset ; void *tmp ; unsigned int tmp___0 ; int tmp___1 ; { sc = (struct ath_softc *)inode->i_private; len = 0U; max_reg_offset = (sc->sc_ah)->hw_version.macVersion > 447U ? 93140UL : 46336UL; num_regs = max_reg_offset / 4UL + 1UL; regdump_len = num_regs * 20UL + 1UL; tmp = vmalloc(regdump_len); buf = (u8 *)tmp; if ((unsigned long )buf == (unsigned long )((u8 *)0U)) { return (-12); } else { } ath9k_ps_wakeup(sc); i = 0; goto ldv_54438; ldv_54437: tmp___0 = (*((sc->sc_ah)->reg_ops.read))((void *)sc->sc_ah, (u32 )(i << 2)); tmp___1 = scnprintf((char *)buf + (unsigned long )len, regdump_len - (unsigned long )len, "0x%06x 0x%08x\n", i << 2, tmp___0); len = (unsigned int )tmp___1 + len; i = i + 1; ldv_54438: ; if ((unsigned long )i < num_regs) { goto ldv_54437; } else { } ath9k_ps_restore(sc); file->private_data = (void *)buf; return (0); } } static struct file_operations const fops_regdump = {& __this_module, & default_llseek, & ath9k_debugfs_read_buf, 0, 0, 0, 0, 0, 0, 0, 0, 0, & open_file_regdump, 0, & ath9k_debugfs_release_buf, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; static int read_file_dump_nfcal(struct seq_file *file , void *data ) { struct ieee80211_hw *hw ; void *tmp ; struct ath_softc *sc ; struct ath_hw *ah ; struct ath9k_nfcal_hist *h ; struct ath_common *common ; struct ath_common *tmp___0 ; struct ieee80211_conf *conf ; u32 i ; u32 j ; u8 chainmask ; u8 nread ; bool tmp___1 ; int tmp___2 ; { tmp = dev_get_drvdata((struct device const *)file->private); hw = (struct ieee80211_hw *)tmp; sc = (struct ath_softc *)hw->priv; ah = sc->sc_ah; h = (struct ath9k_nfcal_hist *)(& (sc->cur_chan)->caldata.nfCalHist); tmp___0 = ath9k_hw_common(ah); common = tmp___0; conf = & (common->hw)->conf; chainmask = (u8 )((int )((signed char )((int )ah->rxchainmask << 3)) | (int )((signed char )ah->rxchainmask)); seq_printf(file, "Channel Noise Floor : %d\n", (int )ah->noise); seq_puts(file, "Chain | privNF | # Readings | NF Readings\n"); i = 0U; goto ldv_54460; ldv_54459: ; if ((((int )chainmask >> (int )i) & 1) == 0) { goto ldv_54455; } else if (i > 2U) { tmp___1 = conf_is_ht40(conf); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { goto ldv_54455; } else { } } else { } nread = 5U - (unsigned int )(h + (unsigned long )i)->invalidNFcount; seq_printf(file, " %d\t %d\t %d\t\t", i, (int )(h + (unsigned long )i)->privNF, (int )nread); j = 0U; goto ldv_54457; ldv_54456: seq_printf(file, " %d", (int )(h + (unsigned long )i)->nfCalBuffer[j]); j = j + 1U; ldv_54457: ; if ((u32 )nread > j) { goto ldv_54456; } else { } seq_puts(file, "\n"); ldv_54455: i = i + 1U; ldv_54460: ; if (i <= 5U) { goto ldv_54459; } else { } return (0); } } static int open_file_dump_nfcal(struct inode *inode , struct file *f ) { int tmp ; { tmp = single_open(f, & read_file_dump_nfcal, inode->i_private); return (tmp); } } static ssize_t read_file_btcoex(struct file *file , char *user_buf , size_t count , loff_t *ppos ) { struct ath_softc *sc ; u32 len ; u32 size ; char *buf ; size_t retval ; void *tmp ; int tmp___0 ; int tmp___1 ; ssize_t tmp___2 ; { sc = (struct ath_softc *)file->private_data; len = 0U; size = 1500U; tmp = kzalloc((size_t )size, 208U); buf = (char *)tmp; if ((unsigned long )buf == (unsigned long )((char *)0)) { return (-12L); } else { } if (! (sc->sc_ah)->common.btcoex_enabled) { tmp___0 = scnprintf(buf, (size_t )size, "%s\n", (char *)"BTCOEX is disabled"); len = (u32 )tmp___0; goto exit; } else { } tmp___1 = ath9k_dump_btcoex(sc, (u8 *)buf, size); len = (u32 )tmp___1; exit: tmp___2 = simple_read_from_buffer((void *)user_buf, count, ppos, (void const *)buf, (size_t )len); retval = (size_t )tmp___2; kfree((void const *)buf); return ((ssize_t )retval); } } static struct file_operations const fops_btcoex = {& __this_module, & default_llseek, & read_file_btcoex, 0, 0, 0, 0, 0, 0, 0, 0, 0, & simple_open, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; static ssize_t read_file_ackto(struct file *file , char *user_buf , size_t count , loff_t *ppos ) { struct ath_softc *sc ; struct ath_hw *ah ; char buf[32U] ; unsigned int len ; int tmp ; ssize_t tmp___0 ; { sc = (struct ath_softc *)file->private_data; ah = sc->sc_ah; tmp = sprintf((char *)(& buf), "%u %c\n", ah->dynack.ackto, (int )ah->dynack.enabled ? 65 : 83); len = (unsigned int )tmp; tmp___0 = simple_read_from_buffer((void *)user_buf, count, ppos, (void const *)(& buf), (size_t )len); return (tmp___0); } } static struct file_operations const fops_ackto = {& __this_module, & default_llseek, & read_file_ackto, 0, 0, 0, 0, 0, 0, 0, 0, 0, & simple_open, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; static ssize_t read_file_wow(struct file *file , char *user_buf , size_t count , loff_t *ppos ) { struct ath_softc *sc ; unsigned int len ; unsigned int size ; ssize_t retval ; char *buf ; void *tmp ; int tmp___0 ; { sc = (struct ath_softc *)file->private_data; len = 0U; size = 32U; tmp = kzalloc((size_t )size, 208U); buf = (char *)tmp; if ((unsigned long )buf == (unsigned long )((char *)0)) { return (-12L); } else { } tmp___0 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "WOW: %s\n", (int )sc->force_wow ? (char *)"ENABLED" : (char *)"DISABLED"); len = (unsigned int )tmp___0 + len; if (len > size) { len = size; } else { } retval = simple_read_from_buffer((void *)user_buf, count, ppos, (void const *)buf, (size_t )len); kfree((void const *)buf); return (retval); } } static ssize_t write_file_wow(struct file *file , char const *user_buf , size_t count , loff_t *ppos ) { struct ath_softc *sc ; unsigned long val ; char buf[32U] ; ssize_t len ; size_t _min1 ; unsigned long _min2 ; unsigned long tmp ; int tmp___0 ; { sc = (struct ath_softc *)file->private_data; _min1 = count; _min2 = 31UL; len = (ssize_t )(_min1 < _min2 ? _min1 : _min2); tmp = copy_from_user((void *)(& buf), (void const *)user_buf, (unsigned long )len); if (tmp != 0UL) { return (-14L); } else { } buf[len] = 0; tmp___0 = kstrtoul((char const *)(& buf), 0U, & val); if (tmp___0 != 0) { return (-22L); } else { } if (val != 1UL) { return (-22L); } else { } if (! sc->force_wow) { sc->force_wow = 1; ath9k_init_wow(sc->hw); } else { } return ((ssize_t )count); } } static struct file_operations const fops_wow = {& __this_module, & default_llseek, & read_file_wow, & write_file_wow, 0, 0, 0, 0, 0, 0, 0, 0, & simple_open, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; static ssize_t read_file_tpc(struct file *file , char *user_buf , size_t count , loff_t *ppos ) { struct ath_softc *sc ; struct ath_hw *ah ; unsigned int len ; unsigned int size ; ssize_t retval ; char *buf ; void *tmp ; int tmp___0 ; { sc = (struct ath_softc *)file->private_data; ah = sc->sc_ah; len = 0U; size = 32U; tmp = kzalloc((size_t )size, 208U); buf = (char *)tmp; if ((unsigned long )buf == (unsigned long )((char *)0)) { return (-12L); } else { } tmp___0 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%s\n", (int )ah->tpc_enabled ? (char *)"ENABLED" : (char *)"DISABLED"); len = (unsigned int )tmp___0 + len; if (len > size) { len = size; } else { } retval = simple_read_from_buffer((void *)user_buf, count, ppos, (void const *)buf, (size_t )len); kfree((void const *)buf); return (retval); } } static ssize_t write_file_tpc(struct file *file , char const *user_buf , size_t count , loff_t *ppos ) { struct ath_softc *sc ; struct ath_hw *ah ; unsigned long val ; char buf[32U] ; ssize_t len ; bool tpc_enabled ; size_t _min1 ; unsigned long _min2 ; unsigned long tmp ; int tmp___0 ; { sc = (struct ath_softc *)file->private_data; ah = sc->sc_ah; _min1 = count; _min2 = 31UL; len = (ssize_t )(_min1 < _min2 ? _min1 : _min2); tmp = copy_from_user((void *)(& buf), (void const *)user_buf, (unsigned long )len); if (tmp != 0UL) { return (-14L); } else { } buf[len] = 0; tmp___0 = kstrtoul((char const *)(& buf), 0U, & val); if (tmp___0 != 0) { return (-22L); } else { } if (val > 1UL) { return (-22L); } else { } tpc_enabled = val != 0UL; if ((int )ah->tpc_enabled != (int )tpc_enabled) { ah->tpc_enabled = tpc_enabled; mutex_lock_nested(& sc->mutex, 0U); ath9k_set_txpower(sc, (struct ieee80211_vif *)0); mutex_unlock(& sc->mutex); } else { } return ((ssize_t )count); } } static struct file_operations const fops_tpc = {& __this_module, & default_llseek, & read_file_tpc, & write_file_tpc, 0, 0, 0, 0, 0, 0, 0, 0, & simple_open, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; static char const ath9k_gstrings_stats[82U][32U] = { { 't', 'x', '_', 'p', 'k', 't', 's', '_', 'n', 'i', 'c', '\000'}, { 't', 'x', '_', 'b', 'y', 't', 'e', 's', '_', 'n', 'i', 'c', '\000'}, { 'r', 'x', '_', 'p', 'k', 't', 's', '_', 'n', 'i', 'c', '\000'}, { 'r', 'x', '_', 'b', 'y', 't', 'e', 's', '_', 'n', 'i', 'c', '\000'}, { 'd', '_', 't', 'x', '_', 'p', 'k', 't', 's', '_', 'B', 'E', '\000'}, { 'd', '_', 't', 'x', '_', 'p', 'k', 't', 's', '_', 'B', 'K', '\000'}, { 'd', '_', 't', 'x', '_', 'p', 'k', 't', 's', '_', 'V', 'I', '\000'}, { 'd', '_', 't', 'x', '_', 'p', 'k', 't', 's', '_', 'V', 'O', '\000'}, { 'd', '_', 't', 'x', '_', 'b', 'y', 't', 'e', 's', '_', 'B', 'E', '\000'}, { 'd', '_', 't', 'x', '_', 'b', 'y', 't', 'e', 's', '_', 'B', 'K', '\000'}, { 'd', '_', 't', 'x', '_', 'b', 'y', 't', 'e', 's', '_', 'V', 'I', '\000'}, { 'd', '_', 't', 'x', '_', 'b', 'y', 't', 'e', 's', '_', 'V', 'O', '\000'}, { 'd', '_', 't', 'x', '_', 'm', 'p', 'd', 'u', 's', '_', 'q', 'u', 'e', 'u', 'e', 'd', '_', 'B', 'E', '\000'}, { 'd', '_', 't', 'x', '_', 'm', 'p', 'd', 'u', 's', '_', 'q', 'u', 'e', 'u', 'e', 'd', '_', 'B', 'K', '\000'}, { 'd', '_', 't', 'x', '_', 'm', 'p', 'd', 'u', 's', '_', 'q', 'u', 'e', 'u', 'e', 'd', '_', 'V', 'I', '\000'}, { 'd', '_', 't', 'x', '_', 'm', 'p', 'd', 'u', 's', '_', 'q', 'u', 'e', 'u', 'e', 'd', '_', 'V', 'O', '\000'}, { 'd', '_', 't', 'x', '_', 'm', 'p', 'd', 'u', 's', '_', 'c', 'o', 'm', 'p', 'l', 'e', 't', 'e', 'd', '_', 'B', 'E', '\000'}, { 'd', '_', 't', 'x', '_', 'm', 'p', 'd', 'u', 's', '_', 'c', 'o', 'm', 'p', 'l', 'e', 't', 'e', 'd', '_', 'B', 'K', '\000'}, { 'd', '_', 't', 'x', '_', 'm', 'p', 'd', 'u', 's', '_', 'c', 'o', 'm', 'p', 'l', 'e', 't', 'e', 'd', '_', 'V', 'I', '\000'}, { 'd', '_', 't', 'x', '_', 'm', 'p', 'd', 'u', 's', '_', 'c', 'o', 'm', 'p', 'l', 'e', 't', 'e', 'd', '_', 'V', 'O', '\000'}, { 'd', '_', 't', 'x', '_', 'm', 'p', 'd', 'u', '_', 'x', 'r', 'e', 't', 'r', 'i', 'e', 's', '_', 'B', 'E', '\000'}, { 'd', '_', 't', 'x', '_', 'm', 'p', 'd', 'u', '_', 'x', 'r', 'e', 't', 'r', 'i', 'e', 's', '_', 'B', 'K', '\000'}, { 'd', '_', 't', 'x', '_', 'm', 'p', 'd', 'u', '_', 'x', 'r', 'e', 't', 'r', 'i', 'e', 's', '_', 'V', 'I', '\000'}, { 'd', '_', 't', 'x', '_', 'm', 'p', 'd', 'u', '_', 'x', 'r', 'e', 't', 'r', 'i', 'e', 's', '_', 'V', 'O', '\000'}, { 'd', '_', 't', 'x', '_', 'a', 'g', 'g', 'r', 'e', 'g', 'a', 't', 'e', 's', '_', 'B', 'E', '\000'}, { 'd', '_', 't', 'x', '_', 'a', 'g', 'g', 'r', 'e', 'g', 'a', 't', 'e', 's', '_', 'B', 'K', '\000'}, { 'd', '_', 't', 'x', '_', 'a', 'g', 'g', 'r', 'e', 'g', 'a', 't', 'e', 's', '_', 'V', 'I', '\000'}, { 'd', '_', 't', 'x', '_', 'a', 'g', 'g', 'r', 'e', 'g', 'a', 't', 'e', 's', '_', 'V', 'O', '\000'}, { 'd', '_', 't', 'x', '_', 'a', 'm', 'p', 'd', 'u', 's', '_', 'q', 'u', 'e', 'u', 'e', 'd', '_', 'h', 'w', '_', 'B', 'E', '\000'}, { 'd', '_', 't', 'x', '_', 'a', 'm', 'p', 'd', 'u', 's', '_', 'q', 'u', 'e', 'u', 'e', 'd', '_', 'h', 'w', '_', 'B', 'K', '\000'}, { 'd', '_', 't', 'x', '_', 'a', 'm', 'p', 'd', 'u', 's', '_', 'q', 'u', 'e', 'u', 'e', 'd', '_', 'h', 'w', '_', 'V', 'I', '\000'}, { 'd', '_', 't', 'x', '_', 'a', 'm', 'p', 'd', 'u', 's', '_', 'q', 'u', 'e', 'u', 'e', 'd', '_', 'h', 'w', '_', 'V', 'O', '\000'}, { 'd', '_', 't', 'x', '_', 'a', 'm', 'p', 'd', 'u', 's', '_', 'q', 'u', 'e', 'u', 'e', 'd', '_', 's', 'w', '_', 'B', 'E', '\000'}, { 'd', '_', 't', 'x', '_', 'a', 'm', 'p', 'd', 'u', 's', '_', 'q', 'u', 'e', 'u', 'e', 'd', '_', 's', 'w', '_', 'B', 'K', '\000'}, { 'd', '_', 't', 'x', '_', 'a', 'm', 'p', 'd', 'u', 's', '_', 'q', 'u', 'e', 'u', 'e', 'd', '_', 's', 'w', '_', 'V', 'I', '\000'}, { 'd', '_', 't', 'x', '_', 'a', 'm', 'p', 'd', 'u', 's', '_', 'q', 'u', 'e', 'u', 'e', 'd', '_', 's', 'w', '_', 'V', 'O', '\000'}, { 'd', '_', 't', 'x', '_', 'a', 'm', 'p', 'd', 'u', 's', '_', 'c', 'o', 'm', 'p', 'l', 'e', 't', 'e', 'd', '_', 'B', 'E', '\000'}, { 'd', '_', 't', 'x', '_', 'a', 'm', 'p', 'd', 'u', 's', '_', 'c', 'o', 'm', 'p', 'l', 'e', 't', 'e', 'd', '_', 'B', 'K', '\000'}, { 'd', '_', 't', 'x', '_', 'a', 'm', 'p', 'd', 'u', 's', '_', 'c', 'o', 'm', 'p', 'l', 'e', 't', 'e', 'd', '_', 'V', 'I', '\000'}, { 'd', '_', 't', 'x', '_', 'a', 'm', 'p', 'd', 'u', 's', '_', 'c', 'o', 'm', 'p', 'l', 'e', 't', 'e', 'd', '_', 'V', 'O', '\000'}, { 'd', '_', 't', 'x', '_', 'a', 'm', 'p', 'd', 'u', '_', 'r', 'e', 't', 'r', 'i', 'e', 's', '_', 'B', 'E', '\000'}, { 'd', '_', 't', 'x', '_', 'a', 'm', 'p', 'd', 'u', '_', 'r', 'e', 't', 'r', 'i', 'e', 's', '_', 'B', 'K', '\000'}, { 'd', '_', 't', 'x', '_', 'a', 'm', 'p', 'd', 'u', '_', 'r', 'e', 't', 'r', 'i', 'e', 's', '_', 'V', 'I', '\000'}, { 'd', '_', 't', 'x', '_', 'a', 'm', 'p', 'd', 'u', '_', 'r', 'e', 't', 'r', 'i', 'e', 's', '_', 'V', 'O', '\000'}, { 'd', '_', 't', 'x', '_', 'a', 'm', 'p', 'd', 'u', '_', 'x', 'r', 'e', 't', 'r', 'i', 'e', 's', '_', 'B', 'E', '\000'}, { 'd', '_', 't', 'x', '_', 'a', 'm', 'p', 'd', 'u', '_', 'x', 'r', 'e', 't', 'r', 'i', 'e', 's', '_', 'B', 'K', '\000'}, { 'd', '_', 't', 'x', '_', 'a', 'm', 'p', 'd', 'u', '_', 'x', 'r', 'e', 't', 'r', 'i', 'e', 's', '_', 'V', 'I', '\000'}, { 'd', '_', 't', 'x', '_', 'a', 'm', 'p', 'd', 'u', '_', 'x', 'r', 'e', 't', 'r', 'i', 'e', 's', '_', 'V', 'O', '\000'}, { 'd', '_', 't', 'x', '_', 'f', 'i', 'f', 'o', '_', 'u', 'n', 'd', 'e', 'r', 'r', 'u', 'n', '_', 'B', 'E', '\000'}, { 'd', '_', 't', 'x', '_', 'f', 'i', 'f', 'o', '_', 'u', 'n', 'd', 'e', 'r', 'r', 'u', 'n', '_', 'B', 'K', '\000'}, { 'd', '_', 't', 'x', '_', 'f', 'i', 'f', 'o', '_', 'u', 'n', 'd', 'e', 'r', 'r', 'u', 'n', '_', 'V', 'I', '\000'}, { 'd', '_', 't', 'x', '_', 'f', 'i', 'f', 'o', '_', 'u', 'n', 'd', 'e', 'r', 'r', 'u', 'n', '_', 'V', 'O', '\000'}, { 'd', '_', 't', 'x', '_', 'o', 'p', '_', 'e', 'x', 'c', 'e', 'e', 'd', 'e', 'd', '_', 'B', 'E', '\000'}, { 'd', '_', 't', 'x', '_', 'o', 'p', '_', 'e', 'x', 'c', 'e', 'e', 'd', 'e', 'd', '_', 'B', 'K', '\000'}, { 'd', '_', 't', 'x', '_', 'o', 'p', '_', 'e', 'x', 'c', 'e', 'e', 'd', 'e', 'd', '_', 'V', 'I', '\000'}, { 'd', '_', 't', 'x', '_', 'o', 'p', '_', 'e', 'x', 'c', 'e', 'e', 'd', 'e', 'd', '_', 'V', 'O', '\000'}, { 'd', '_', 't', 'x', '_', 't', 'i', 'm', 'e', 'r', '_', 'e', 'x', 'p', 'i', 'r', 'y', '_', 'B', 'E', '\000'}, { 'd', '_', 't', 'x', '_', 't', 'i', 'm', 'e', 'r', '_', 'e', 'x', 'p', 'i', 'r', 'y', '_', 'B', 'K', '\000'}, { 'd', '_', 't', 'x', '_', 't', 'i', 'm', 'e', 'r', '_', 'e', 'x', 'p', 'i', 'r', 'y', '_', 'V', 'I', '\000'}, { 'd', '_', 't', 'x', '_', 't', 'i', 'm', 'e', 'r', '_', 'e', 'x', 'p', 'i', 'r', 'y', '_', 'V', 'O', '\000'}, { 'd', '_', 't', 'x', '_', 'd', 'e', 's', 'c', '_', 'c', 'f', 'g', '_', 'e', 'r', 'r', '_', 'B', 'E', '\000'}, { 'd', '_', 't', 'x', '_', 'd', 'e', 's', 'c', '_', 'c', 'f', 'g', '_', 'e', 'r', 'r', '_', 'B', 'K', '\000'}, { 'd', '_', 't', 'x', '_', 'd', 'e', 's', 'c', '_', 'c', 'f', 'g', '_', 'e', 'r', 'r', '_', 'V', 'I', '\000'}, { 'd', '_', 't', 'x', '_', 'd', 'e', 's', 'c', '_', 'c', 'f', 'g', '_', 'e', 'r', 'r', '_', 'V', 'O', '\000'}, { 'd', '_', 't', 'x', '_', 'd', 'a', 't', 'a', '_', 'u', 'n', 'd', 'e', 'r', 'r', 'u', 'n', '_', 'B', 'E', '\000'}, { 'd', '_', 't', 'x', '_', 'd', 'a', 't', 'a', '_', 'u', 'n', 'd', 'e', 'r', 'r', 'u', 'n', '_', 'B', 'K', '\000'}, { 'd', '_', 't', 'x', '_', 'd', 'a', 't', 'a', '_', 'u', 'n', 'd', 'e', 'r', 'r', 'u', 'n', '_', 'V', 'I', '\000'}, { 'd', '_', 't', 'x', '_', 'd', 'a', 't', 'a', '_', 'u', 'n', 'd', 'e', 'r', 'r', 'u', 'n', '_', 'V', 'O', '\000'}, { 'd', '_', 't', 'x', '_', 'd', 'e', 'l', 'i', 'm', '_', 'u', 'n', 'd', 'e', 'r', 'r', 'u', 'n', '_', 'B', 'E', '\000'}, { 'd', '_', 't', 'x', '_', 'd', 'e', 'l', 'i', 'm', '_', 'u', 'n', 'd', 'e', 'r', 'r', 'u', 'n', '_', 'B', 'K', '\000'}, { 'd', '_', 't', 'x', '_', 'd', 'e', 'l', 'i', 'm', '_', 'u', 'n', 'd', 'e', 'r', 'r', 'u', 'n', '_', 'V', 'I', '\000'}, { 'd', '_', 't', 'x', '_', 'd', 'e', 'l', 'i', 'm', '_', 'u', 'n', 'd', 'e', 'r', 'r', 'u', 'n', '_', 'V', 'O', '\000'}, { 'd', '_', 'r', 'x', '_', 'c', 'r', 'c', '_', 'e', 'r', 'r', '\000'}, { 'd', '_', 'r', 'x', '_', 'd', 'e', 'c', 'r', 'y', 'p', 't', '_', 'c', 'r', 'c', '_', 'e', 'r', 'r', '\000'}, { 'd', '_', 'r', 'x', '_', 'p', 'h', 'y', '_', 'e', 'r', 'r', '\000'}, { 'd', '_', 'r', 'x', '_', 'm', 'i', 'c', '_', 'e', 'r', 'r', '\000'}, { 'd', '_', 'r', 'x', '_', 'p', 'r', 'e', '_', 'd', 'e', 'l', 'i', 'm', '_', 'c', 'r', 'c', '_', 'e', 'r', 'r', '\000'}, { 'd', '_', 'r', 'x', '_', 'p', 'o', 's', 't', '_', 'd', 'e', 'l', 'i', 'm', '_', 'c', 'r', 'c', '_', 'e', 'r', 'r', '\000'}, { 'd', '_', 'r', 'x', '_', 'd', 'e', 'c', 'r', 'y', 'p', 't', '_', 'b', 'u', 's', 'y', '_', 'e', 'r', 'r', '\000'}, { 'd', '_', 'r', 'x', '_', 'p', 'h', 'y', 'e', 'r', 'r', '_', 'r', 'a', 'd', 'a', 'r', '\000'}, { 'd', '_', 'r', 'x', '_', 'p', 'h', 'y', 'e', 'r', 'r', '_', 'o', 'f', 'd', 'm', '_', 't', 'i', 'm', 'i', 'n', 'g', '\000'}, { 'd', '_', 'r', 'x', '_', 'p', 'h', 'y', 'e', 'r', 'r', '_', 'c', 'c', 'k', '_', 't', 'i', 'm', 'i', 'n', 'g', '\000'}}; void ath9k_get_et_strings(struct ieee80211_hw *hw , struct ieee80211_vif *vif , u32 sset , u8 *data ) { { if (sset == 1U) { memcpy((void *)data, (void const *)(& ath9k_gstrings_stats), 2624UL); } else { } return; } } int ath9k_get_et_sset_count(struct ieee80211_hw *hw , struct ieee80211_vif *vif , int sset ) { { if (sset == 1) { return (82); } else { } return (0); } } void ath9k_get_et_stats(struct ieee80211_hw *hw , struct ieee80211_vif *vif , struct ethtool_stats *stats , u64 *data ) { struct ath_softc *sc ; int i ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; int tmp___6 ; int tmp___7 ; int tmp___8 ; int tmp___9 ; int tmp___10 ; int tmp___11 ; int tmp___12 ; int tmp___13 ; int tmp___14 ; int tmp___15 ; int tmp___16 ; int tmp___17 ; int tmp___18 ; int tmp___19 ; int tmp___20 ; int tmp___21 ; int tmp___22 ; int tmp___23 ; int tmp___24 ; int tmp___25 ; int tmp___26 ; int tmp___27 ; int tmp___28 ; int tmp___29 ; int tmp___30 ; int tmp___31 ; int tmp___32 ; int tmp___33 ; int tmp___34 ; int tmp___35 ; int tmp___36 ; int tmp___37 ; int tmp___38 ; int tmp___39 ; int tmp___40 ; int tmp___41 ; int tmp___42 ; int tmp___43 ; int tmp___44 ; int tmp___45 ; int tmp___46 ; int tmp___47 ; int tmp___48 ; int tmp___49 ; int tmp___50 ; int tmp___51 ; int tmp___52 ; int tmp___53 ; int tmp___54 ; int tmp___55 ; int tmp___56 ; int tmp___57 ; int tmp___58 ; int tmp___59 ; int tmp___60 ; int tmp___61 ; int tmp___62 ; int tmp___63 ; int tmp___64 ; int tmp___65 ; int tmp___66 ; int tmp___67 ; int tmp___68 ; int tmp___69 ; int tmp___70 ; int tmp___71 ; int tmp___72 ; int tmp___73 ; int tmp___74 ; int tmp___75 ; int tmp___76 ; int tmp___77 ; int tmp___78 ; int tmp___79 ; int tmp___80 ; int __ret_warn_on ; long tmp___81 ; { sc = (struct ath_softc *)hw->priv; i = 0; tmp = i; i = i + 1; *(data + (unsigned long )tmp) = (u64 )(((sc->debug.stats.txstats[(sc->tx.txq_map[2])->axq_qnum].tx_pkts_all + sc->debug.stats.txstats[(sc->tx.txq_map[3])->axq_qnum].tx_pkts_all) + sc->debug.stats.txstats[(sc->tx.txq_map[1])->axq_qnum].tx_pkts_all) + sc->debug.stats.txstats[(sc->tx.txq_map[0])->axq_qnum].tx_pkts_all); tmp___0 = i; i = i + 1; *(data + (unsigned long )tmp___0) = (u64 )(((sc->debug.stats.txstats[(sc->tx.txq_map[2])->axq_qnum].tx_bytes_all + sc->debug.stats.txstats[(sc->tx.txq_map[3])->axq_qnum].tx_bytes_all) + sc->debug.stats.txstats[(sc->tx.txq_map[1])->axq_qnum].tx_bytes_all) + sc->debug.stats.txstats[(sc->tx.txq_map[0])->axq_qnum].tx_bytes_all); tmp___1 = i; i = i + 1; *(data + (unsigned long )tmp___1) = (u64 )sc->debug.stats.rxstats.rx_pkts_all; tmp___2 = i; i = i + 1; *(data + (unsigned long )tmp___2) = (u64 )sc->debug.stats.rxstats.rx_bytes_all; tmp___3 = i; i = i + 1; *(data + (unsigned long )tmp___3) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[2])->axq_qnum].tx_pkts_all; tmp___4 = i; i = i + 1; *(data + (unsigned long )tmp___4) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[3])->axq_qnum].tx_pkts_all; tmp___5 = i; i = i + 1; *(data + (unsigned long )tmp___5) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[1])->axq_qnum].tx_pkts_all; tmp___6 = i; i = i + 1; *(data + (unsigned long )tmp___6) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[0])->axq_qnum].tx_pkts_all; tmp___7 = i; i = i + 1; *(data + (unsigned long )tmp___7) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[2])->axq_qnum].tx_bytes_all; tmp___8 = i; i = i + 1; *(data + (unsigned long )tmp___8) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[3])->axq_qnum].tx_bytes_all; tmp___9 = i; i = i + 1; *(data + (unsigned long )tmp___9) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[1])->axq_qnum].tx_bytes_all; tmp___10 = i; i = i + 1; *(data + (unsigned long )tmp___10) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[0])->axq_qnum].tx_bytes_all; tmp___11 = i; i = i + 1; *(data + (unsigned long )tmp___11) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[2])->axq_qnum].queued; tmp___12 = i; i = i + 1; *(data + (unsigned long )tmp___12) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[3])->axq_qnum].queued; tmp___13 = i; i = i + 1; *(data + (unsigned long )tmp___13) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[1])->axq_qnum].queued; tmp___14 = i; i = i + 1; *(data + (unsigned long )tmp___14) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[0])->axq_qnum].queued; tmp___15 = i; i = i + 1; *(data + (unsigned long )tmp___15) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[2])->axq_qnum].completed; tmp___16 = i; i = i + 1; *(data + (unsigned long )tmp___16) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[3])->axq_qnum].completed; tmp___17 = i; i = i + 1; *(data + (unsigned long )tmp___17) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[1])->axq_qnum].completed; tmp___18 = i; i = i + 1; *(data + (unsigned long )tmp___18) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[0])->axq_qnum].completed; tmp___19 = i; i = i + 1; *(data + (unsigned long )tmp___19) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[2])->axq_qnum].xretries; tmp___20 = i; i = i + 1; *(data + (unsigned long )tmp___20) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[3])->axq_qnum].xretries; tmp___21 = i; i = i + 1; *(data + (unsigned long )tmp___21) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[1])->axq_qnum].xretries; tmp___22 = i; i = i + 1; *(data + (unsigned long )tmp___22) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[0])->axq_qnum].xretries; tmp___23 = i; i = i + 1; *(data + (unsigned long )tmp___23) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[2])->axq_qnum].a_aggr; tmp___24 = i; i = i + 1; *(data + (unsigned long )tmp___24) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[3])->axq_qnum].a_aggr; tmp___25 = i; i = i + 1; *(data + (unsigned long )tmp___25) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[1])->axq_qnum].a_aggr; tmp___26 = i; i = i + 1; *(data + (unsigned long )tmp___26) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[0])->axq_qnum].a_aggr; tmp___27 = i; i = i + 1; *(data + (unsigned long )tmp___27) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[2])->axq_qnum].a_queued_hw; tmp___28 = i; i = i + 1; *(data + (unsigned long )tmp___28) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[3])->axq_qnum].a_queued_hw; tmp___29 = i; i = i + 1; *(data + (unsigned long )tmp___29) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[1])->axq_qnum].a_queued_hw; tmp___30 = i; i = i + 1; *(data + (unsigned long )tmp___30) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[0])->axq_qnum].a_queued_hw; tmp___31 = i; i = i + 1; *(data + (unsigned long )tmp___31) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[2])->axq_qnum].a_queued_sw; tmp___32 = i; i = i + 1; *(data + (unsigned long )tmp___32) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[3])->axq_qnum].a_queued_sw; tmp___33 = i; i = i + 1; *(data + (unsigned long )tmp___33) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[1])->axq_qnum].a_queued_sw; tmp___34 = i; i = i + 1; *(data + (unsigned long )tmp___34) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[0])->axq_qnum].a_queued_sw; tmp___35 = i; i = i + 1; *(data + (unsigned long )tmp___35) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[2])->axq_qnum].a_completed; tmp___36 = i; i = i + 1; *(data + (unsigned long )tmp___36) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[3])->axq_qnum].a_completed; tmp___37 = i; i = i + 1; *(data + (unsigned long )tmp___37) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[1])->axq_qnum].a_completed; tmp___38 = i; i = i + 1; *(data + (unsigned long )tmp___38) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[0])->axq_qnum].a_completed; tmp___39 = i; i = i + 1; *(data + (unsigned long )tmp___39) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[2])->axq_qnum].a_retries; tmp___40 = i; i = i + 1; *(data + (unsigned long )tmp___40) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[3])->axq_qnum].a_retries; tmp___41 = i; i = i + 1; *(data + (unsigned long )tmp___41) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[1])->axq_qnum].a_retries; tmp___42 = i; i = i + 1; *(data + (unsigned long )tmp___42) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[0])->axq_qnum].a_retries; tmp___43 = i; i = i + 1; *(data + (unsigned long )tmp___43) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[2])->axq_qnum].a_xretries; tmp___44 = i; i = i + 1; *(data + (unsigned long )tmp___44) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[3])->axq_qnum].a_xretries; tmp___45 = i; i = i + 1; *(data + (unsigned long )tmp___45) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[1])->axq_qnum].a_xretries; tmp___46 = i; i = i + 1; *(data + (unsigned long )tmp___46) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[0])->axq_qnum].a_xretries; tmp___47 = i; i = i + 1; *(data + (unsigned long )tmp___47) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[2])->axq_qnum].fifo_underrun; tmp___48 = i; i = i + 1; *(data + (unsigned long )tmp___48) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[3])->axq_qnum].fifo_underrun; tmp___49 = i; i = i + 1; *(data + (unsigned long )tmp___49) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[1])->axq_qnum].fifo_underrun; tmp___50 = i; i = i + 1; *(data + (unsigned long )tmp___50) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[0])->axq_qnum].fifo_underrun; tmp___51 = i; i = i + 1; *(data + (unsigned long )tmp___51) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[2])->axq_qnum].xtxop; tmp___52 = i; i = i + 1; *(data + (unsigned long )tmp___52) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[3])->axq_qnum].xtxop; tmp___53 = i; i = i + 1; *(data + (unsigned long )tmp___53) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[1])->axq_qnum].xtxop; tmp___54 = i; i = i + 1; *(data + (unsigned long )tmp___54) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[0])->axq_qnum].xtxop; tmp___55 = i; i = i + 1; *(data + (unsigned long )tmp___55) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[2])->axq_qnum].timer_exp; tmp___56 = i; i = i + 1; *(data + (unsigned long )tmp___56) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[3])->axq_qnum].timer_exp; tmp___57 = i; i = i + 1; *(data + (unsigned long )tmp___57) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[1])->axq_qnum].timer_exp; tmp___58 = i; i = i + 1; *(data + (unsigned long )tmp___58) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[0])->axq_qnum].timer_exp; tmp___59 = i; i = i + 1; *(data + (unsigned long )tmp___59) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[2])->axq_qnum].desc_cfg_err; tmp___60 = i; i = i + 1; *(data + (unsigned long )tmp___60) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[3])->axq_qnum].desc_cfg_err; tmp___61 = i; i = i + 1; *(data + (unsigned long )tmp___61) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[1])->axq_qnum].desc_cfg_err; tmp___62 = i; i = i + 1; *(data + (unsigned long )tmp___62) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[0])->axq_qnum].desc_cfg_err; tmp___63 = i; i = i + 1; *(data + (unsigned long )tmp___63) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[2])->axq_qnum].data_underrun; tmp___64 = i; i = i + 1; *(data + (unsigned long )tmp___64) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[3])->axq_qnum].data_underrun; tmp___65 = i; i = i + 1; *(data + (unsigned long )tmp___65) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[1])->axq_qnum].data_underrun; tmp___66 = i; i = i + 1; *(data + (unsigned long )tmp___66) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[0])->axq_qnum].data_underrun; tmp___67 = i; i = i + 1; *(data + (unsigned long )tmp___67) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[2])->axq_qnum].delim_underrun; tmp___68 = i; i = i + 1; *(data + (unsigned long )tmp___68) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[3])->axq_qnum].delim_underrun; tmp___69 = i; i = i + 1; *(data + (unsigned long )tmp___69) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[1])->axq_qnum].delim_underrun; tmp___70 = i; i = i + 1; *(data + (unsigned long )tmp___70) = (u64 )sc->debug.stats.txstats[(sc->tx.txq_map[0])->axq_qnum].delim_underrun; tmp___71 = i; i = i + 1; *(data + (unsigned long )tmp___71) = (u64 )sc->debug.stats.rxstats.crc_err; tmp___72 = i; i = i + 1; *(data + (unsigned long )tmp___72) = (u64 )sc->debug.stats.rxstats.decrypt_crc_err; tmp___73 = i; i = i + 1; *(data + (unsigned long )tmp___73) = (u64 )sc->debug.stats.rxstats.phy_err; tmp___74 = i; i = i + 1; *(data + (unsigned long )tmp___74) = (u64 )sc->debug.stats.rxstats.mic_err; tmp___75 = i; i = i + 1; *(data + (unsigned long )tmp___75) = (u64 )sc->debug.stats.rxstats.pre_delim_crc_err; tmp___76 = i; i = i + 1; *(data + (unsigned long )tmp___76) = (u64 )sc->debug.stats.rxstats.post_delim_crc_err; tmp___77 = i; i = i + 1; *(data + (unsigned long )tmp___77) = (u64 )sc->debug.stats.rxstats.decrypt_busy_err; tmp___78 = i; i = i + 1; *(data + (unsigned long )tmp___78) = (u64 )sc->debug.stats.rxstats.phy_err_stats[5]; tmp___79 = i; i = i + 1; *(data + (unsigned long )tmp___79) = (u64 )sc->debug.stats.rxstats.phy_err_stats[17]; tmp___80 = i; i = i + 1; *(data + (unsigned long )tmp___80) = (u64 )sc->debug.stats.rxstats.phy_err_stats[25]; __ret_warn_on = i != 82; tmp___81 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___81 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/12119/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/ath/ath9k/debug.c", 1294); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); return; } } void ath9k_deinit_debug(struct ath_softc *sc ) { { ath9k_cmn_spectral_deinit_debug(& sc->spec_priv); return; } } int ath9k_init_debug(struct ath_hw *ah ) { struct ath_common *common ; struct ath_common *tmp ; struct ath_softc *sc ; { tmp = ath9k_hw_common(ah); common = tmp; sc = (struct ath_softc *)common->priv; sc->debug.debugfs_phy = debugfs_create_dir("ath9k", ((sc->hw)->wiphy)->debugfsdir); if ((unsigned long )sc->debug.debugfs_phy == (unsigned long )((struct dentry *)0)) { return (-12); } else { } debugfs_create_file("debug", 384, sc->debug.debugfs_phy, (void *)sc, & fops_debug); ath9k_dfs_init_debug(sc); ath9k_tx99_init_debug(sc); ath9k_cmn_spectral_init_debug(& sc->spec_priv, sc->debug.debugfs_phy); debugfs_create_devm_seqfile(sc->dev, "dma", sc->debug.debugfs_phy, & read_file_dma); debugfs_create_devm_seqfile(sc->dev, "interrupt", sc->debug.debugfs_phy, & read_file_interrupt); debugfs_create_devm_seqfile(sc->dev, "xmit", sc->debug.debugfs_phy, & read_file_xmit); debugfs_create_devm_seqfile(sc->dev, "queues", sc->debug.debugfs_phy, & read_file_queues); debugfs_create_u32("qlen_bk", 384, sc->debug.debugfs_phy, (u32 *)(& sc->tx.txq_max_pending) + 3UL); debugfs_create_u32("qlen_be", 384, sc->debug.debugfs_phy, (u32 *)(& sc->tx.txq_max_pending) + 2UL); debugfs_create_u32("qlen_vi", 384, sc->debug.debugfs_phy, (u32 *)(& sc->tx.txq_max_pending) + 1UL); debugfs_create_u32("qlen_vo", 384, sc->debug.debugfs_phy, (u32 *)(& sc->tx.txq_max_pending)); debugfs_create_devm_seqfile(sc->dev, "misc", sc->debug.debugfs_phy, & read_file_misc); debugfs_create_devm_seqfile(sc->dev, "reset", sc->debug.debugfs_phy, & read_file_reset); ath9k_cmn_debug_recv(sc->debug.debugfs_phy, & sc->debug.stats.rxstats); ath9k_cmn_debug_phy_err(sc->debug.debugfs_phy, & sc->debug.stats.rxstats); debugfs_create_u8("rx_chainmask", 256, sc->debug.debugfs_phy, & ah->rxchainmask); debugfs_create_u8("tx_chainmask", 256, sc->debug.debugfs_phy, & ah->txchainmask); debugfs_create_file("ani", 384, sc->debug.debugfs_phy, (void *)sc, & fops_ani); debugfs_create_bool("paprd", 384, sc->debug.debugfs_phy, & (sc->sc_ah)->config.enable_paprd); debugfs_create_file("regidx", 384, sc->debug.debugfs_phy, (void *)sc, & fops_regidx); debugfs_create_file("regval", 384, sc->debug.debugfs_phy, (void *)sc, & fops_regval); debugfs_create_bool("ignore_extcca", 384, sc->debug.debugfs_phy, & ah->config.cwm_ignore_extcca); debugfs_create_file("regdump", 256, sc->debug.debugfs_phy, (void *)sc, & fops_regdump); debugfs_create_devm_seqfile(sc->dev, "dump_nfcal", sc->debug.debugfs_phy, & read_file_dump_nfcal); ath9k_cmn_debug_base_eeprom(sc->debug.debugfs_phy, sc->sc_ah); ath9k_cmn_debug_modal_eeprom(sc->debug.debugfs_phy, sc->sc_ah); debugfs_create_u32("gpio_mask", 384, sc->debug.debugfs_phy, & (sc->sc_ah)->gpio_mask); debugfs_create_u32("gpio_val", 384, sc->debug.debugfs_phy, & (sc->sc_ah)->gpio_val); debugfs_create_file("antenna_diversity", 256, sc->debug.debugfs_phy, (void *)sc, & fops_antenna_diversity); debugfs_create_file("bt_ant_diversity", 384, sc->debug.debugfs_phy, (void *)sc, & fops_bt_ant_diversity); debugfs_create_file("btcoex", 256, sc->debug.debugfs_phy, (void *)sc, & fops_btcoex); debugfs_create_file("wow", 384, sc->debug.debugfs_phy, (void *)sc, & fops_wow); debugfs_create_file("ack_to", 384, sc->debug.debugfs_phy, (void *)sc, & fops_ackto); debugfs_create_file("tpc", 384, sc->debug.debugfs_phy, (void *)sc, & fops_tpc); return (0); } } extern int ldv_release_20(void) ; int ldv_retval_18 ; int ldv_retval_41 ; int ldv_retval_12 ; int ldv_retval_5 ; int ldv_retval_11 ; int ldv_retval_6 ; extern int ldv_release_18(void) ; extern int ldv_release_28(void) ; extern int ldv_release_19(void) ; int ldv_retval_16 ; extern int ldv_release_26(void) ; int ldv_retval_13 ; extern int ldv_release_17(void) ; int ldv_retval_9 ; int ldv_retval_10 ; extern int ldv_release_23(void) ; extern int ldv_release_27(void) ; int ldv_retval_4 ; extern int ldv_release_25(void) ; extern int ldv_release_24(void) ; int ldv_retval_3 ; void ldv_file_operations_20(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(1000UL); fops_btcoex_group1 = (struct inode *)tmp; tmp___0 = ldv_init_zalloc(504UL); fops_btcoex_group2 = (struct file *)tmp___0; return; } } void ldv_file_operations_26(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(1000UL); fops_bt_ant_diversity_group1 = (struct inode *)tmp; tmp___0 = ldv_init_zalloc(504UL); fops_bt_ant_diversity_group2 = (struct file *)tmp___0; return; } } void ldv_file_operations_24(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(1000UL); fops_regidx_group1 = (struct inode *)tmp; tmp___0 = ldv_init_zalloc(504UL); fops_regidx_group2 = (struct file *)tmp___0; return; } } void ldv_file_operations_17(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(1000UL); fops_tpc_group1 = (struct inode *)tmp; tmp___0 = ldv_init_zalloc(504UL); fops_tpc_group2 = (struct file *)tmp___0; return; } } void ldv_file_operations_23(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(1000UL); fops_regval_group1 = (struct inode *)tmp; tmp___0 = ldv_init_zalloc(504UL); fops_regval_group2 = (struct file *)tmp___0; return; } } void ldv_file_operations_19(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(1000UL); fops_ackto_group1 = (struct inode *)tmp; tmp___0 = ldv_init_zalloc(504UL); fops_ackto_group2 = (struct file *)tmp___0; return; } } void ldv_file_operations_25(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(1000UL); fops_antenna_diversity_group1 = (struct inode *)tmp; tmp___0 = ldv_init_zalloc(504UL); fops_antenna_diversity_group2 = (struct file *)tmp___0; return; } } void ldv_file_operations_28(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(1000UL); fops_debug_group1 = (struct inode *)tmp; tmp___0 = ldv_init_zalloc(504UL); fops_debug_group2 = (struct file *)tmp___0; return; } } void ldv_file_operations_22(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(1000UL); fops_regdump_group1 = (struct inode *)tmp; tmp___0 = ldv_init_zalloc(504UL); fops_regdump_group2 = (struct file *)tmp___0; return; } } void ldv_file_operations_21(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(1000UL); fops_dump_nfcal_group1 = (struct inode *)tmp; tmp___0 = ldv_init_zalloc(504UL); fops_dump_nfcal_group2 = (struct file *)tmp___0; return; } } void ldv_file_operations_18(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(1000UL); fops_wow_group1 = (struct inode *)tmp; tmp___0 = ldv_init_zalloc(504UL); fops_wow_group2 = (struct file *)tmp___0; return; } } void ldv_file_operations_27(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(1000UL); fops_ani_group1 = (struct inode *)tmp; tmp___0 = ldv_init_zalloc(504UL); fops_ani_group2 = (struct file *)tmp___0; return; } } void ldv_main_exported_27(void) { int ldvarg47 ; loff_t *ldvarg52 ; void *tmp ; size_t ldvarg53 ; char *ldvarg54 ; void *tmp___0 ; loff_t ldvarg48 ; size_t ldvarg50 ; loff_t *ldvarg49 ; void *tmp___1 ; char *ldvarg51 ; void *tmp___2 ; int tmp___3 ; { tmp = ldv_init_zalloc(8UL); ldvarg52 = (loff_t *)tmp; tmp___0 = ldv_init_zalloc(1UL); ldvarg54 = (char *)tmp___0; tmp___1 = ldv_init_zalloc(8UL); ldvarg49 = (loff_t *)tmp___1; tmp___2 = ldv_init_zalloc(1UL); ldvarg51 = (char *)tmp___2; ldv_memset((void *)(& ldvarg47), 0, 4UL); ldv_memset((void *)(& ldvarg53), 0, 8UL); ldv_memset((void *)(& ldvarg48), 0, 8UL); ldv_memset((void *)(& ldvarg50), 0, 8UL); tmp___3 = __VERIFIER_nondet_int(); switch (tmp___3) { case 0: ; if (ldv_state_variable_27 == 1) { ldv_retval_9 = simple_open(fops_ani_group1, fops_ani_group2); if (ldv_retval_9 == 0) { ldv_state_variable_27 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_54658; case 1: ; if (ldv_state_variable_27 == 1) { write_file_ani(fops_ani_group2, (char const *)ldvarg54, ldvarg53, ldvarg52); ldv_state_variable_27 = 1; } else { } if (ldv_state_variable_27 == 2) { write_file_ani(fops_ani_group2, (char const *)ldvarg54, ldvarg53, ldvarg52); ldv_state_variable_27 = 2; } else { } goto ldv_54658; case 2: ; if (ldv_state_variable_27 == 2) { read_file_ani(fops_ani_group2, ldvarg51, ldvarg50, ldvarg49); ldv_state_variable_27 = 2; } else { } goto ldv_54658; case 3: ; if (ldv_state_variable_27 == 2) { default_llseek(fops_ani_group2, ldvarg48, ldvarg47); ldv_state_variable_27 = 2; } else { } goto ldv_54658; case 4: ; if (ldv_state_variable_27 == 2) { ldv_release_27(); ldv_state_variable_27 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_54658; default: ldv_stop(); } ldv_54658: ; return; } } void ldv_main_exported_25(void) { loff_t ldvarg56 ; char *ldvarg59 ; void *tmp ; int ldvarg55 ; size_t ldvarg58 ; loff_t *ldvarg57 ; void *tmp___0 ; int tmp___1 ; { tmp = ldv_init_zalloc(1UL); ldvarg59 = (char *)tmp; tmp___0 = ldv_init_zalloc(8UL); ldvarg57 = (loff_t *)tmp___0; ldv_memset((void *)(& ldvarg56), 0, 8UL); ldv_memset((void *)(& ldvarg55), 0, 4UL); ldv_memset((void *)(& ldvarg58), 0, 8UL); tmp___1 = __VERIFIER_nondet_int(); switch (tmp___1) { case 0: ; if (ldv_state_variable_25 == 1) { ldv_retval_10 = simple_open(fops_antenna_diversity_group1, fops_antenna_diversity_group2); if (ldv_retval_10 == 0) { ldv_state_variable_25 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_54673; case 1: ; if (ldv_state_variable_25 == 2) { read_file_antenna_diversity(fops_antenna_diversity_group2, ldvarg59, ldvarg58, ldvarg57); ldv_state_variable_25 = 2; } else { } goto ldv_54673; case 2: ; if (ldv_state_variable_25 == 2) { default_llseek(fops_antenna_diversity_group2, ldvarg56, ldvarg55); ldv_state_variable_25 = 2; } else { } goto ldv_54673; case 3: ; if (ldv_state_variable_25 == 2) { ldv_release_25(); ldv_state_variable_25 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_54673; default: ldv_stop(); } ldv_54673: ; return; } } void ldv_main_exported_28(void) { size_t ldvarg66 ; char *ldvarg64 ; void *tmp ; loff_t ldvarg61 ; loff_t *ldvarg65 ; void *tmp___0 ; loff_t *ldvarg62 ; void *tmp___1 ; int ldvarg60 ; char *ldvarg67 ; void *tmp___2 ; size_t ldvarg63 ; int tmp___3 ; { tmp = ldv_init_zalloc(1UL); ldvarg64 = (char *)tmp; tmp___0 = ldv_init_zalloc(8UL); ldvarg65 = (loff_t *)tmp___0; tmp___1 = ldv_init_zalloc(8UL); ldvarg62 = (loff_t *)tmp___1; tmp___2 = ldv_init_zalloc(1UL); ldvarg67 = (char *)tmp___2; ldv_memset((void *)(& ldvarg66), 0, 8UL); ldv_memset((void *)(& ldvarg61), 0, 8UL); ldv_memset((void *)(& ldvarg60), 0, 4UL); ldv_memset((void *)(& ldvarg63), 0, 8UL); tmp___3 = __VERIFIER_nondet_int(); switch (tmp___3) { case 0: ; if (ldv_state_variable_28 == 1) { ldv_retval_11 = simple_open(fops_debug_group1, fops_debug_group2); if (ldv_retval_11 == 0) { ldv_state_variable_28 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_54690; case 1: ; if (ldv_state_variable_28 == 1) { write_file_debug(fops_debug_group2, (char const *)ldvarg67, ldvarg66, ldvarg65); ldv_state_variable_28 = 1; } else { } if (ldv_state_variable_28 == 2) { write_file_debug(fops_debug_group2, (char const *)ldvarg67, ldvarg66, ldvarg65); ldv_state_variable_28 = 2; } else { } goto ldv_54690; case 2: ; if (ldv_state_variable_28 == 2) { read_file_debug(fops_debug_group2, ldvarg64, ldvarg63, ldvarg62); ldv_state_variable_28 = 2; } else { } goto ldv_54690; case 3: ; if (ldv_state_variable_28 == 2) { default_llseek(fops_debug_group2, ldvarg61, ldvarg60); ldv_state_variable_28 = 2; } else { } goto ldv_54690; case 4: ; if (ldv_state_variable_28 == 2) { ldv_release_28(); ldv_state_variable_28 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_54690; default: ldv_stop(); } ldv_54690: ; return; } } void ldv_main_exported_21(void) { loff_t ldvarg6 ; int ldvarg5 ; char *ldvarg9 ; void *tmp ; loff_t *ldvarg7 ; void *tmp___0 ; size_t ldvarg8 ; int tmp___1 ; { tmp = ldv_init_zalloc(1UL); ldvarg9 = (char *)tmp; tmp___0 = ldv_init_zalloc(8UL); ldvarg7 = (loff_t *)tmp___0; ldv_memset((void *)(& ldvarg6), 0, 8UL); ldv_memset((void *)(& ldvarg5), 0, 4UL); ldv_memset((void *)(& ldvarg8), 0, 8UL); tmp___1 = __VERIFIER_nondet_int(); switch (tmp___1) { case 0: ; if (ldv_state_variable_21 == 2) { single_release(fops_dump_nfcal_group1, fops_dump_nfcal_group2); ldv_state_variable_21 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_54705; case 1: ; if (ldv_state_variable_21 == 1) { ldv_retval_3 = open_file_dump_nfcal(fops_dump_nfcal_group1, fops_dump_nfcal_group2); if (ldv_retval_3 == 0) { ldv_state_variable_21 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_54705; case 2: ; if (ldv_state_variable_21 == 2) { seq_read(fops_dump_nfcal_group2, ldvarg9, ldvarg8, ldvarg7); ldv_state_variable_21 = 2; } else { } goto ldv_54705; case 3: ; if (ldv_state_variable_21 == 2) { seq_lseek(fops_dump_nfcal_group2, ldvarg6, ldvarg5); ldv_state_variable_21 = 2; } else { } goto ldv_54705; default: ldv_stop(); } ldv_54705: ; return; } } void ldv_main_exported_26(void) { int ldvarg10 ; size_t ldvarg13 ; char *ldvarg17 ; void *tmp ; char *ldvarg14 ; void *tmp___0 ; loff_t *ldvarg15 ; void *tmp___1 ; size_t ldvarg16 ; loff_t *ldvarg12 ; void *tmp___2 ; loff_t ldvarg11 ; int tmp___3 ; { tmp = ldv_init_zalloc(1UL); ldvarg17 = (char *)tmp; tmp___0 = ldv_init_zalloc(1UL); ldvarg14 = (char *)tmp___0; tmp___1 = ldv_init_zalloc(8UL); ldvarg15 = (loff_t *)tmp___1; tmp___2 = ldv_init_zalloc(8UL); ldvarg12 = (loff_t *)tmp___2; ldv_memset((void *)(& ldvarg10), 0, 4UL); ldv_memset((void *)(& ldvarg13), 0, 8UL); ldv_memset((void *)(& ldvarg16), 0, 8UL); ldv_memset((void *)(& ldvarg11), 0, 8UL); tmp___3 = __VERIFIER_nondet_int(); switch (tmp___3) { case 0: ; if (ldv_state_variable_26 == 1) { ldv_retval_4 = simple_open(fops_bt_ant_diversity_group1, fops_bt_ant_diversity_group2); if (ldv_retval_4 == 0) { ldv_state_variable_26 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_54722; case 1: ; if (ldv_state_variable_26 == 1) { write_file_bt_ant_diversity(fops_bt_ant_diversity_group2, (char const *)ldvarg17, ldvarg16, ldvarg15); ldv_state_variable_26 = 1; } else { } if (ldv_state_variable_26 == 2) { write_file_bt_ant_diversity(fops_bt_ant_diversity_group2, (char const *)ldvarg17, ldvarg16, ldvarg15); ldv_state_variable_26 = 2; } else { } goto ldv_54722; case 2: ; if (ldv_state_variable_26 == 2) { read_file_bt_ant_diversity(fops_bt_ant_diversity_group2, ldvarg14, ldvarg13, ldvarg12); ldv_state_variable_26 = 2; } else { } goto ldv_54722; case 3: ; if (ldv_state_variable_26 == 2) { default_llseek(fops_bt_ant_diversity_group2, ldvarg11, ldvarg10); ldv_state_variable_26 = 2; } else { } goto ldv_54722; case 4: ; if (ldv_state_variable_26 == 2) { ldv_release_26(); ldv_state_variable_26 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_54722; default: ldv_stop(); } ldv_54722: ; return; } } void ldv_main_exported_17(void) { loff_t ldvarg19 ; char *ldvarg22 ; void *tmp ; char *ldvarg25 ; void *tmp___0 ; size_t ldvarg21 ; loff_t *ldvarg23 ; void *tmp___1 ; loff_t *ldvarg20 ; void *tmp___2 ; int ldvarg18 ; size_t ldvarg24 ; int tmp___3 ; { tmp = ldv_init_zalloc(1UL); ldvarg22 = (char *)tmp; tmp___0 = ldv_init_zalloc(1UL); ldvarg25 = (char *)tmp___0; tmp___1 = ldv_init_zalloc(8UL); ldvarg23 = (loff_t *)tmp___1; tmp___2 = ldv_init_zalloc(8UL); ldvarg20 = (loff_t *)tmp___2; ldv_memset((void *)(& ldvarg19), 0, 8UL); ldv_memset((void *)(& ldvarg21), 0, 8UL); ldv_memset((void *)(& ldvarg18), 0, 4UL); ldv_memset((void *)(& ldvarg24), 0, 8UL); tmp___3 = __VERIFIER_nondet_int(); switch (tmp___3) { case 0: ; if (ldv_state_variable_17 == 1) { ldv_retval_5 = simple_open(fops_tpc_group1, fops_tpc_group2); if (ldv_retval_5 == 0) { ldv_state_variable_17 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_54740; case 1: ; if (ldv_state_variable_17 == 1) { write_file_tpc(fops_tpc_group2, (char const *)ldvarg25, ldvarg24, ldvarg23); ldv_state_variable_17 = 1; } else { } if (ldv_state_variable_17 == 2) { write_file_tpc(fops_tpc_group2, (char const *)ldvarg25, ldvarg24, ldvarg23); ldv_state_variable_17 = 2; } else { } goto ldv_54740; case 2: ; if (ldv_state_variable_17 == 2) { read_file_tpc(fops_tpc_group2, ldvarg22, ldvarg21, ldvarg20); ldv_state_variable_17 = 2; } else { } goto ldv_54740; case 3: ; if (ldv_state_variable_17 == 2) { default_llseek(fops_tpc_group2, ldvarg19, ldvarg18); ldv_state_variable_17 = 2; } else { } goto ldv_54740; case 4: ; if (ldv_state_variable_17 == 2) { ldv_release_17(); ldv_state_variable_17 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_54740; default: ldv_stop(); } ldv_54740: ; return; } } void ldv_main_exported_20(void) { loff_t ldvarg69 ; char *ldvarg72 ; void *tmp ; int ldvarg68 ; size_t ldvarg71 ; loff_t *ldvarg70 ; void *tmp___0 ; int tmp___1 ; { tmp = ldv_init_zalloc(1UL); ldvarg72 = (char *)tmp; tmp___0 = ldv_init_zalloc(8UL); ldvarg70 = (loff_t *)tmp___0; ldv_memset((void *)(& ldvarg69), 0, 8UL); ldv_memset((void *)(& ldvarg68), 0, 4UL); ldv_memset((void *)(& ldvarg71), 0, 8UL); tmp___1 = __VERIFIER_nondet_int(); switch (tmp___1) { case 0: ; if (ldv_state_variable_20 == 1) { ldv_retval_12 = simple_open(fops_btcoex_group1, fops_btcoex_group2); if (ldv_retval_12 == 0) { ldv_state_variable_20 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_54755; case 1: ; if (ldv_state_variable_20 == 2) { read_file_btcoex(fops_btcoex_group2, ldvarg72, ldvarg71, ldvarg70); ldv_state_variable_20 = 2; } else { } goto ldv_54755; case 2: ; if (ldv_state_variable_20 == 2) { default_llseek(fops_btcoex_group2, ldvarg69, ldvarg68); ldv_state_variable_20 = 2; } else { } goto ldv_54755; case 3: ; if (ldv_state_variable_20 == 2) { ldv_release_20(); ldv_state_variable_20 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_54755; default: ldv_stop(); } ldv_54755: ; return; } } void ldv_main_exported_22(void) { int ldvarg90 ; loff_t *ldvarg92 ; void *tmp ; loff_t ldvarg91 ; char *ldvarg94 ; void *tmp___0 ; size_t ldvarg93 ; int tmp___1 ; { tmp = ldv_init_zalloc(8UL); ldvarg92 = (loff_t *)tmp; tmp___0 = ldv_init_zalloc(1UL); ldvarg94 = (char *)tmp___0; ldv_memset((void *)(& ldvarg90), 0, 4UL); ldv_memset((void *)(& ldvarg91), 0, 8UL); ldv_memset((void *)(& ldvarg93), 0, 8UL); tmp___1 = __VERIFIER_nondet_int(); switch (tmp___1) { case 0: ; if (ldv_state_variable_22 == 2) { ath9k_debugfs_release_buf(fops_regdump_group1, fops_regdump_group2); ldv_state_variable_22 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_54769; case 1: ; if (ldv_state_variable_22 == 1) { ldv_retval_16 = open_file_regdump(fops_regdump_group1, fops_regdump_group2); if (ldv_retval_16 == 0) { ldv_state_variable_22 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_54769; case 2: ; if (ldv_state_variable_22 == 2) { ath9k_debugfs_read_buf(fops_regdump_group2, ldvarg94, ldvarg93, ldvarg92); ldv_state_variable_22 = 2; } else { } goto ldv_54769; case 3: ; if (ldv_state_variable_22 == 2) { default_llseek(fops_regdump_group2, ldvarg91, ldvarg90); ldv_state_variable_22 = 2; } else { } goto ldv_54769; default: ldv_stop(); } ldv_54769: ; return; } } void ldv_main_exported_18(void) { loff_t *ldvarg28 ; void *tmp ; size_t ldvarg29 ; char *ldvarg30 ; void *tmp___0 ; char *ldvarg33 ; void *tmp___1 ; loff_t *ldvarg31 ; void *tmp___2 ; size_t ldvarg32 ; int ldvarg26 ; loff_t ldvarg27 ; int tmp___3 ; { tmp = ldv_init_zalloc(8UL); ldvarg28 = (loff_t *)tmp; tmp___0 = ldv_init_zalloc(1UL); ldvarg30 = (char *)tmp___0; tmp___1 = ldv_init_zalloc(1UL); ldvarg33 = (char *)tmp___1; tmp___2 = ldv_init_zalloc(8UL); ldvarg31 = (loff_t *)tmp___2; ldv_memset((void *)(& ldvarg29), 0, 8UL); ldv_memset((void *)(& ldvarg32), 0, 8UL); ldv_memset((void *)(& ldvarg26), 0, 4UL); ldv_memset((void *)(& ldvarg27), 0, 8UL); tmp___3 = __VERIFIER_nondet_int(); switch (tmp___3) { case 0: ; if (ldv_state_variable_18 == 1) { ldv_retval_6 = simple_open(fops_wow_group1, fops_wow_group2); if (ldv_retval_6 == 0) { ldv_state_variable_18 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_54786; case 1: ; if (ldv_state_variable_18 == 1) { write_file_wow(fops_wow_group2, (char const *)ldvarg33, ldvarg32, ldvarg31); ldv_state_variable_18 = 1; } else { } if (ldv_state_variable_18 == 2) { write_file_wow(fops_wow_group2, (char const *)ldvarg33, ldvarg32, ldvarg31); ldv_state_variable_18 = 2; } else { } goto ldv_54786; case 2: ; if (ldv_state_variable_18 == 2) { read_file_wow(fops_wow_group2, ldvarg30, ldvarg29, ldvarg28); ldv_state_variable_18 = 2; } else { } goto ldv_54786; case 3: ; if (ldv_state_variable_18 == 2) { default_llseek(fops_wow_group2, ldvarg27, ldvarg26); ldv_state_variable_18 = 2; } else { } goto ldv_54786; case 4: ; if (ldv_state_variable_18 == 2) { ldv_release_18(); ldv_state_variable_18 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_54786; default: ldv_stop(); } ldv_54786: ; return; } } void ldv_main_exported_24(void) { loff_t *ldvarg75 ; void *tmp ; size_t ldvarg76 ; loff_t ldvarg74 ; size_t ldvarg79 ; loff_t *ldvarg78 ; void *tmp___0 ; char *ldvarg80 ; void *tmp___1 ; int ldvarg73 ; char *ldvarg77 ; void *tmp___2 ; int tmp___3 ; { tmp = ldv_init_zalloc(8UL); ldvarg75 = (loff_t *)tmp; tmp___0 = ldv_init_zalloc(8UL); ldvarg78 = (loff_t *)tmp___0; tmp___1 = ldv_init_zalloc(1UL); ldvarg80 = (char *)tmp___1; tmp___2 = ldv_init_zalloc(1UL); ldvarg77 = (char *)tmp___2; ldv_memset((void *)(& ldvarg76), 0, 8UL); ldv_memset((void *)(& ldvarg74), 0, 8UL); ldv_memset((void *)(& ldvarg79), 0, 8UL); ldv_memset((void *)(& ldvarg73), 0, 4UL); tmp___3 = __VERIFIER_nondet_int(); switch (tmp___3) { case 0: ; if (ldv_state_variable_24 == 1) { ldv_retval_13 = simple_open(fops_regidx_group1, fops_regidx_group2); if (ldv_retval_13 == 0) { ldv_state_variable_24 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_54804; case 1: ; if (ldv_state_variable_24 == 1) { write_file_regidx(fops_regidx_group2, (char const *)ldvarg80, ldvarg79, ldvarg78); ldv_state_variable_24 = 1; } else { } if (ldv_state_variable_24 == 2) { write_file_regidx(fops_regidx_group2, (char const *)ldvarg80, ldvarg79, ldvarg78); ldv_state_variable_24 = 2; } else { } goto ldv_54804; case 2: ; if (ldv_state_variable_24 == 2) { read_file_regidx(fops_regidx_group2, ldvarg77, ldvarg76, ldvarg75); ldv_state_variable_24 = 2; } else { } goto ldv_54804; case 3: ; if (ldv_state_variable_24 == 2) { default_llseek(fops_regidx_group2, ldvarg74, ldvarg73); ldv_state_variable_24 = 2; } else { } goto ldv_54804; case 4: ; if (ldv_state_variable_24 == 2) { ldv_release_24(); ldv_state_variable_24 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_54804; default: ldv_stop(); } ldv_54804: ; return; } } void ldv_main_exported_19(void) { int ldvarg194 ; loff_t *ldvarg196 ; void *tmp ; char *ldvarg198 ; void *tmp___0 ; loff_t ldvarg195 ; size_t ldvarg197 ; int tmp___1 ; { tmp = ldv_init_zalloc(8UL); ldvarg196 = (loff_t *)tmp; tmp___0 = ldv_init_zalloc(1UL); ldvarg198 = (char *)tmp___0; ldv_memset((void *)(& ldvarg194), 0, 4UL); ldv_memset((void *)(& ldvarg195), 0, 8UL); ldv_memset((void *)(& ldvarg197), 0, 8UL); tmp___1 = __VERIFIER_nondet_int(); switch (tmp___1) { case 0: ; if (ldv_state_variable_19 == 1) { ldv_retval_41 = simple_open(fops_ackto_group1, fops_ackto_group2); if (ldv_retval_41 == 0) { ldv_state_variable_19 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_54819; case 1: ; if (ldv_state_variable_19 == 2) { read_file_ackto(fops_ackto_group2, ldvarg198, ldvarg197, ldvarg196); ldv_state_variable_19 = 2; } else { } goto ldv_54819; case 2: ; if (ldv_state_variable_19 == 2) { default_llseek(fops_ackto_group2, ldvarg195, ldvarg194); ldv_state_variable_19 = 2; } else { } goto ldv_54819; case 3: ; if (ldv_state_variable_19 == 2) { ldv_release_19(); ldv_state_variable_19 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_54819; default: ldv_stop(); } ldv_54819: ; return; } } void ldv_main_exported_23(void) { char *ldvarg99 ; void *tmp ; loff_t ldvarg96 ; char *ldvarg102 ; void *tmp___0 ; loff_t *ldvarg97 ; void *tmp___1 ; size_t ldvarg98 ; loff_t *ldvarg100 ; void *tmp___2 ; size_t ldvarg101 ; int ldvarg95 ; int tmp___3 ; { tmp = ldv_init_zalloc(1UL); ldvarg99 = (char *)tmp; tmp___0 = ldv_init_zalloc(1UL); ldvarg102 = (char *)tmp___0; tmp___1 = ldv_init_zalloc(8UL); ldvarg97 = (loff_t *)tmp___1; tmp___2 = ldv_init_zalloc(8UL); ldvarg100 = (loff_t *)tmp___2; ldv_memset((void *)(& ldvarg96), 0, 8UL); ldv_memset((void *)(& ldvarg98), 0, 8UL); ldv_memset((void *)(& ldvarg101), 0, 8UL); ldv_memset((void *)(& ldvarg95), 0, 4UL); tmp___3 = __VERIFIER_nondet_int(); switch (tmp___3) { case 0: ; if (ldv_state_variable_23 == 1) { ldv_retval_18 = simple_open(fops_regval_group1, fops_regval_group2); if (ldv_retval_18 == 0) { ldv_state_variable_23 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_54836; case 1: ; if (ldv_state_variable_23 == 1) { write_file_regval(fops_regval_group2, (char const *)ldvarg102, ldvarg101, ldvarg100); ldv_state_variable_23 = 1; } else { } if (ldv_state_variable_23 == 2) { write_file_regval(fops_regval_group2, (char const *)ldvarg102, ldvarg101, ldvarg100); ldv_state_variable_23 = 2; } else { } goto ldv_54836; case 2: ; if (ldv_state_variable_23 == 2) { read_file_regval(fops_regval_group2, ldvarg99, ldvarg98, ldvarg97); ldv_state_variable_23 = 2; } else { } goto ldv_54836; case 3: ; if (ldv_state_variable_23 == 2) { default_llseek(fops_regval_group2, ldvarg96, ldvarg95); ldv_state_variable_23 = 2; } else { } goto ldv_54836; case 4: ; if (ldv_state_variable_23 == 2) { ldv_release_23(); ldv_state_variable_23 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_54836; default: ldv_stop(); } ldv_54836: ; return; } } bool ldv_queue_work_on_321(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_322(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_323(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_324(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_7(2); return; } } bool ldv_queue_delayed_work_on_325(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_335(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_337(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_336(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; bool ldv_queue_delayed_work_on_339(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) ; void ldv_flush_workqueue_338(struct workqueue_struct *ldv_func_arg1 ) ; static ssize_t read_file_node_aggr(struct file *file , char *user_buf , size_t count , loff_t *ppos ) { struct ath_node *an ; struct ath_softc *sc ; struct ath_atx_tid *tid ; struct ath_atx_ac *ac ; struct ath_txq *txq ; u32 len ; u32 size ; char *buf ; size_t retval ; int tidno ; int acno ; void *tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; int tmp___6 ; ssize_t tmp___7 ; { an = (struct ath_node *)file->private_data; sc = an->sc; len = 0U; size = 4096U; tmp = kzalloc((size_t )size, 208U); buf = (char *)tmp; if ((unsigned long )buf == (unsigned long )((char *)0)) { return (-12L); } else { } if (! (an->sta)->ht_cap.ht_supported) { tmp___0 = scnprintf(buf, (size_t )size, "%s\n", (char *)"HT not supported"); len = (u32 )tmp___0; goto exit; } else { } tmp___1 = scnprintf(buf, (size_t )size, "Max-AMPDU: %d\n", (int )an->maxampdu); len = (u32 )tmp___1; tmp___2 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "MPDU Density: %d\n\n", (int )an->mpdudensity); len = (u32 )tmp___2 + len; tmp___3 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%2s%7s\n", (char *)"AC", (char *)"SCHED"); len = (u32 )tmp___3 + len; acno = 0; ac = (struct ath_atx_ac *)(& an->ac) + (unsigned long )acno; goto ldv_54014; ldv_54013: txq = ac->txq; ath_txq_lock(sc, txq); tmp___4 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%2d%7d\n", acno, (int )ac->sched); len = (u32 )tmp___4 + len; ath_txq_unlock(sc, txq); acno = acno + 1; ac = ac + 1; ldv_54014: ; if (acno <= 3) { goto ldv_54013; } else { } tmp___5 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "\n%3s%11s%10s%10s%10s%10s%9s%6s%8s\n", (char *)"TID", (char *)"SEQ_START", (char *)"SEQ_NEXT", (char *)"BAW_SIZE", (char *)"BAW_HEAD", (char *)"BAW_TAIL", (char *)"BAR_IDX", (char *)"SCHED", (char *)"PAUSED"); len = (u32 )tmp___5 + len; tidno = 0; tid = (struct ath_atx_tid *)(& an->tid) + (unsigned long )tidno; goto ldv_54017; ldv_54016: txq = (tid->ac)->txq; ath_txq_lock(sc, txq); if ((int )tid->active) { tmp___6 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%3d%11d%10d%10d%10d%10d%9d%6d\n", (int )tid->tidno, (int )tid->seq_start, (int )tid->seq_next, (int )tid->baw_size, tid->baw_head, tid->baw_tail, (int )tid->bar_index, (int )tid->sched); len = (u32 )tmp___6 + len; } else { } ath_txq_unlock(sc, txq); tidno = tidno + 1; tid = tid + 1; ldv_54017: ; if (tidno <= 15) { goto ldv_54016; } else { } exit: tmp___7 = simple_read_from_buffer((void *)user_buf, count, ppos, (void const *)buf, (size_t )len); retval = (size_t )tmp___7; kfree((void const *)buf); return ((ssize_t )retval); } } static struct file_operations const fops_node_aggr = {& __this_module, & default_llseek, & read_file_node_aggr, 0, 0, 0, 0, 0, 0, 0, 0, 0, & simple_open, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; void ath_debug_rate_stats(struct ath_softc *sc , struct ath_rx_status *rs , struct sk_buff *skb ) { struct ieee80211_hdr *hdr ; struct ath_hw *ah ; struct ieee80211_rx_status *rxs ; struct ath_rx_rate_stats *rstats ; struct ieee80211_sta *sta ; struct ath_node *an ; int tmp ; { hdr = (struct ieee80211_hdr *)skb->data; ah = sc->sc_ah; tmp = ieee80211_is_data((int )hdr->frame_control); if (tmp == 0) { return; } else { } rcu_read_lock(); sta = ieee80211_find_sta_by_ifaddr(sc->hw, (u8 const *)(& hdr->addr2), (u8 const *)0U); if ((unsigned long )sta == (unsigned long )((struct ieee80211_sta *)0)) { goto exit; } else { } an = (struct ath_node *)(& sta->drv_priv); rstats = & an->rx_rate_stats; rxs = IEEE80211_SKB_RXCB(skb); if ((int )((signed char )rs->rs_rate) < 0) { if ((unsigned int )rxs->rate_idx > 23U) { goto exit; } else { } if ((rxs->flag & 1024U) != 0U) { rstats->ht_stats[(int )rxs->rate_idx].ht40_cnt = rstats->ht_stats[(int )rxs->rate_idx].ht40_cnt + 1U; } else { rstats->ht_stats[(int )rxs->rate_idx].ht20_cnt = rstats->ht_stats[(int )rxs->rate_idx].ht20_cnt + 1U; } if ((rxs->flag & 2048U) != 0U) { rstats->ht_stats[(int )rxs->rate_idx].sgi_cnt = rstats->ht_stats[(int )rxs->rate_idx].sgi_cnt + 1U; } else { rstats->ht_stats[(int )rxs->rate_idx].lgi_cnt = rstats->ht_stats[(int )rxs->rate_idx].lgi_cnt + 1U; } goto exit; } else { } if ((unsigned int )rs->rs_rate > 23U && (unsigned int )rs->rs_rate <= 30U) { if ((rxs->flag & 256U) != 0U) { rstats->cck_stats[(int )rxs->rate_idx].cck_sp_cnt = rstats->cck_stats[(int )rxs->rate_idx].cck_sp_cnt + 1U; } else { rstats->cck_stats[(int )rxs->rate_idx].cck_lp_cnt = rstats->cck_stats[(int )rxs->rate_idx].cck_lp_cnt + 1U; } goto exit; } else { } if ((unsigned int )rs->rs_rate > 7U && (unsigned int )rs->rs_rate <= 15U) { if ((unsigned int )((ah->curchan)->chan)->band == 0U) { rstats->ofdm_stats[(int )rxs->rate_idx + -4].ofdm_cnt = rstats->ofdm_stats[(int )rxs->rate_idx + -4].ofdm_cnt + 1U; } else { rstats->ofdm_stats[(int )rxs->rate_idx].ofdm_cnt = rstats->ofdm_stats[(int )rxs->rate_idx].ofdm_cnt + 1U; } } else { } exit: rcu_read_unlock(); return; } } static ssize_t read_file_node_recv(struct file *file , char *user_buf , size_t count , loff_t *ppos ) { struct ath_node *an ; struct ath_softc *sc ; struct ath_hw *ah ; struct ath_rx_rate_stats *rstats ; struct ieee80211_sta *sta ; enum ieee80211_band band ; u32 len ; u32 size ; char *buf ; size_t retval ; int i ; void *tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; int tmp___6 ; int tmp___7 ; int tmp___8 ; int tmp___9 ; int tmp___10 ; int tmp___11 ; int tmp___12 ; int tmp___13 ; int tmp___14 ; int tmp___15 ; int tmp___16 ; int tmp___17 ; ssize_t tmp___18 ; { an = (struct ath_node *)file->private_data; sc = an->sc; ah = sc->sc_ah; sta = an->sta; len = 0U; size = 4096U; tmp = kzalloc((size_t )size, 208U); buf = (char *)tmp; if ((unsigned long )buf == (unsigned long )((char *)0)) { return (-12L); } else { } band = ((ah->curchan)->chan)->band; rstats = & an->rx_rate_stats; if (! sta->ht_cap.ht_supported) { goto legacy; } else { } tmp___0 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%24s%10s%10s%10s\n", (char *)"HT20", (char *)"HT40", (char *)"SGI", (char *)"LGI"); len = (u32 )tmp___0 + len; i = 0; goto ldv_54053; ldv_54052: tmp___1 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%8s%3u : %10u%10u%10u%10u\n", (char *)"MCS", i, rstats->ht_stats[i].ht20_cnt, rstats->ht_stats[i].ht40_cnt, rstats->ht_stats[i].sgi_cnt, rstats->ht_stats[i].lgi_cnt); len = (u32 )tmp___1 + len; i = i + 1; ldv_54053: ; if (i <= 23) { goto ldv_54052; } else { } tmp___2 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "\n"); len = (u32 )tmp___2 + len; legacy: ; if ((unsigned int )band == 0U) { tmp___3 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%11s : %10u\n", (char *)"CCK-1M/LP", rstats->cck_stats[0].cck_lp_cnt); len = (u32 )tmp___3 + len; tmp___4 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%11s : %10u\n", (char *)"CCK-2M/LP", rstats->cck_stats[1].cck_lp_cnt); len = (u32 )tmp___4 + len; tmp___5 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%11s : %10u\n", (char *)"CCK-5.5M/LP", rstats->cck_stats[2].cck_lp_cnt); len = (u32 )tmp___5 + len; tmp___6 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%11s : %10u\n", (char *)"CCK-11M/LP", rstats->cck_stats[3].cck_lp_cnt); len = (u32 )tmp___6 + len; tmp___7 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%11s : %10u\n", (char *)"CCK-2M/SP", rstats->cck_stats[1].cck_sp_cnt); len = (u32 )tmp___7 + len; tmp___8 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%11s : %10u\n", (char *)"CCK-5.5M/SP", rstats->cck_stats[2].cck_sp_cnt); len = (u32 )tmp___8 + len; tmp___9 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%11s : %10u\n", (char *)"CCK-11M/SP", rstats->cck_stats[3].cck_sp_cnt); len = (u32 )tmp___9 + len; } else { } tmp___10 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%11s : %10u\n", (char *)"OFDM-6M", rstats->ofdm_stats[0].ofdm_cnt); len = (u32 )tmp___10 + len; tmp___11 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%11s : %10u\n", (char *)"OFDM-9M", rstats->ofdm_stats[1].ofdm_cnt); len = (u32 )tmp___11 + len; tmp___12 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%11s : %10u\n", (char *)"OFDM-12M", rstats->ofdm_stats[2].ofdm_cnt); len = (u32 )tmp___12 + len; tmp___13 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%11s : %10u\n", (char *)"OFDM-18M", rstats->ofdm_stats[3].ofdm_cnt); len = (u32 )tmp___13 + len; tmp___14 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%11s : %10u\n", (char *)"OFDM-24M", rstats->ofdm_stats[4].ofdm_cnt); len = (u32 )tmp___14 + len; tmp___15 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%11s : %10u\n", (char *)"OFDM-36M", rstats->ofdm_stats[5].ofdm_cnt); len = (u32 )tmp___15 + len; tmp___16 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%11s : %10u\n", (char *)"OFDM-48M", rstats->ofdm_stats[6].ofdm_cnt); len = (u32 )tmp___16 + len; tmp___17 = scnprintf(buf + (unsigned long )len, (size_t )(size - len), "%11s : %10u\n", (char *)"OFDM-54M", rstats->ofdm_stats[7].ofdm_cnt); len = (u32 )tmp___17 + len; tmp___18 = simple_read_from_buffer((void *)user_buf, count, ppos, (void const *)buf, (size_t )len); retval = (size_t )tmp___18; kfree((void const *)buf); return ((ssize_t )retval); } } static struct file_operations const fops_node_recv = {& __this_module, & default_llseek, & read_file_node_recv, 0, 0, 0, 0, 0, 0, 0, 0, 0, & simple_open, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; void ath9k_sta_add_debugfs(struct ieee80211_hw *hw , struct ieee80211_vif *vif , struct ieee80211_sta *sta , struct dentry *dir ) { struct ath_node *an ; { an = (struct ath_node *)(& sta->drv_priv); debugfs_create_file("node_aggr", 292, dir, (void *)an, & fops_node_aggr); debugfs_create_file("node_recv", 292, dir, (void *)an, & fops_node_recv); return; } } extern int ldv_release_16(void) ; int ldv_retval_39 ; int ldv_retval_8 ; extern int ldv_release_15(void) ; void ldv_file_operations_16(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(1000UL); fops_node_aggr_group1 = (struct inode *)tmp; tmp___0 = ldv_init_zalloc(504UL); fops_node_aggr_group2 = (struct file *)tmp___0; return; } } void ldv_file_operations_15(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(1000UL); fops_node_recv_group1 = (struct inode *)tmp; tmp___0 = ldv_init_zalloc(504UL); fops_node_recv_group2 = (struct file *)tmp___0; return; } } void ldv_main_exported_16(void) { char *ldvarg46 ; void *tmp ; loff_t *ldvarg44 ; void *tmp___0 ; int ldvarg42 ; loff_t ldvarg43 ; size_t ldvarg45 ; int tmp___1 ; { tmp = ldv_init_zalloc(1UL); ldvarg46 = (char *)tmp; tmp___0 = ldv_init_zalloc(8UL); ldvarg44 = (loff_t *)tmp___0; ldv_memset((void *)(& ldvarg42), 0, 4UL); ldv_memset((void *)(& ldvarg43), 0, 8UL); ldv_memset((void *)(& ldvarg45), 0, 8UL); tmp___1 = __VERIFIER_nondet_int(); switch (tmp___1) { case 0: ; if (ldv_state_variable_16 == 1) { ldv_retval_8 = simple_open(fops_node_aggr_group1, fops_node_aggr_group2); if (ldv_retval_8 == 0) { ldv_state_variable_16 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_54084; case 1: ; if (ldv_state_variable_16 == 2) { read_file_node_aggr(fops_node_aggr_group2, ldvarg46, ldvarg45, ldvarg44); ldv_state_variable_16 = 2; } else { } goto ldv_54084; case 2: ; if (ldv_state_variable_16 == 2) { default_llseek(fops_node_aggr_group2, ldvarg43, ldvarg42); ldv_state_variable_16 = 2; } else { } goto ldv_54084; case 3: ; if (ldv_state_variable_16 == 2) { ldv_release_16(); ldv_state_variable_16 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_54084; default: ldv_stop(); } ldv_54084: ; return; } } void ldv_main_exported_15(void) { char *ldvarg115 ; void *tmp ; size_t ldvarg114 ; loff_t *ldvarg113 ; void *tmp___0 ; loff_t ldvarg112 ; int ldvarg111 ; int tmp___1 ; { tmp = ldv_init_zalloc(1UL); ldvarg115 = (char *)tmp; tmp___0 = ldv_init_zalloc(8UL); ldvarg113 = (loff_t *)tmp___0; ldv_memset((void *)(& ldvarg114), 0, 8UL); ldv_memset((void *)(& ldvarg112), 0, 8UL); ldv_memset((void *)(& ldvarg111), 0, 4UL); tmp___1 = __VERIFIER_nondet_int(); switch (tmp___1) { case 0: ; if (ldv_state_variable_15 == 1) { ldv_retval_39 = simple_open(fops_node_recv_group1, fops_node_recv_group2); if (ldv_retval_39 == 0) { ldv_state_variable_15 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_54098; case 1: ; if (ldv_state_variable_15 == 2) { read_file_node_recv(fops_node_recv_group2, ldvarg115, ldvarg114, ldvarg113); ldv_state_variable_15 = 2; } else { } goto ldv_54098; case 2: ; if (ldv_state_variable_15 == 2) { default_llseek(fops_node_recv_group2, ldvarg112, ldvarg111); ldv_state_variable_15 = 2; } else { } goto ldv_54098; case 3: ; if (ldv_state_variable_15 == 2) { ldv_release_15(); ldv_state_variable_15 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_54098; default: ldv_stop(); } ldv_54098: ; return; } } bool ldv_queue_work_on_335(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_336(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_337(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_7(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_338(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_7(2); return; } } bool ldv_queue_delayed_work_on_339(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_7(& ldv_func_arg3->work, 2); return (ldv_func_res); } } extern void *memset(void * , int , size_t ) ; __inline static void ldv_error(void) { { ERROR: ; __VERIFIER_error(); } } bool ldv_is_err(void const *ptr ) { { return ((unsigned long )ptr > 2012UL); } } void *ldv_err_ptr(long error ) { { return ((void *)(2012L - error)); } } long ldv_ptr_err(void const *ptr ) { { return ((long )(2012UL - (unsigned long )ptr)); } } bool ldv_is_err_or_null(void const *ptr ) { bool tmp ; int tmp___0 ; { if ((unsigned long )ptr == (unsigned long )((void const *)0)) { tmp___0 = 1; } else { tmp = ldv_is_err(ptr); if ((int )tmp) { tmp___0 = 1; } else { tmp___0 = 0; } } return ((bool )tmp___0); } } int ldv_module_refcounter = 1; void ldv_module_get(struct module *module ) { { if ((unsigned long )module != (unsigned long )((struct module *)0)) { ldv_module_refcounter = ldv_module_refcounter + 1; } else { } return; } } int ldv_try_module_get(struct module *module ) { int module_get_succeeded ; { if ((unsigned long )module != (unsigned long )((struct module *)0)) { module_get_succeeded = ldv_undef_int(); if (module_get_succeeded == 1) { ldv_module_refcounter = ldv_module_refcounter + 1; return (1); } else { return (0); } } else { } return (0); } } void ldv_module_put(struct module *module ) { { if ((unsigned long )module != (unsigned long )((struct module *)0)) { if (ldv_module_refcounter <= 1) { ldv_error(); } else { } ldv_module_refcounter = ldv_module_refcounter - 1; } else { } return; } } void ldv_module_put_and_exit(void) { { ldv_module_put((struct module *)1); LDV_STOP: ; goto LDV_STOP; } } unsigned int ldv_module_refcount(void) { { return ((unsigned int )(ldv_module_refcounter + -1)); } } void ldv_check_final_state(void) { { if (ldv_module_refcounter != 1) { ldv_error(); } else { } return; } }