extern void __VERIFIER_error() __attribute__ ((__noreturn__)); /* Generated by CIL v. 1.5.1 */ /* print_CIL_Input is false */ 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 __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 __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 _ddebug { char const *modname ; char const *function ; char const *filename ; char const *format ; unsigned int lineno : 18 ; unsigned char flags ; }; 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; 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 ; }; 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; enum tk_offsets { TK_OFFS_REAL = 0, TK_OFFS_BOOT = 1, TK_OFFS_TAI = 2, TK_OFFS_MAX = 3 } ; 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 cfg80211_chan_def; struct wireless_dev; struct station_info; struct station_parameters; struct ethtool_wolinfo; struct wiphy; struct vif_params; struct semaphore { raw_spinlock_t lock ; unsigned int count ; struct list_head wait_list ; }; 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_17700 { SS_FREE = 0, SS_UNCONNECTED = 1, SS_CONNECTING = 2, SS_CONNECTED = 3, SS_DISCONNECTING = 4 } ; typedef enum ldv_17700 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; struct klist_node; struct klist_node { void *n_klist ; struct list_head n_node ; struct kref n_ref ; }; struct path; struct seq_file { char *buf ; size_t size ; size_t from ; size_t count ; size_t pad_until ; loff_t index ; loff_t read_pos ; u64 version ; struct mutex lock ; struct seq_operations const *op ; int poll_event ; struct user_namespace *user_ns ; void *private ; }; struct seq_operations { void *(*start)(struct seq_file * , loff_t * ) ; void (*stop)(struct seq_file * , void * ) ; void *(*next)(struct seq_file * , void * , loff_t * ) ; int (*show)(struct seq_file * , void * ) ; }; struct pinctrl; struct pinctrl_state; struct dev_pin_info { struct pinctrl *p ; struct pinctrl_state *default_state ; struct pinctrl_state *sleep_state ; struct pinctrl_state *idle_state ; }; struct ratelimit_state { raw_spinlock_t lock ; int interval ; int burst ; int printed ; int missed ; unsigned long begin ; }; struct dma_map_ops; struct dev_archdata { struct dma_map_ops *dma_ops ; void *iommu ; }; struct 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 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 ; }; 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 ; }; struct skb_frag_struct; typedef struct skb_frag_struct skb_frag_t; struct __anonstruct_page_225 { struct page *p ; }; struct skb_frag_struct { struct __anonstruct_page_225 page ; __u32 page_offset ; __u32 size ; }; struct skb_shared_hwtstamps { ktime_t hwtstamp ; }; struct skb_shared_info { unsigned char nr_frags ; __u8 tx_flags ; unsigned short gso_size ; unsigned short gso_segs ; unsigned short gso_type ; struct sk_buff *frag_list ; struct skb_shared_hwtstamps hwtstamps ; u32 tskey ; __be32 ip6_frag_id ; atomic_t dataref ; void *destructor_arg ; skb_frag_t frags[17U] ; }; 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 rtable; 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_27817 { 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_27817 phy_interface_t; enum ldv_27871 { 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_27871 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 xfrm_policy; struct xfrm_state; 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 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 } ; struct page_counter { atomic_long_t count ; unsigned long limit ; struct page_counter *parent ; unsigned long watermark ; unsigned long failcnt ; }; struct sock_filter { __u16 code ; __u8 jt ; __u8 jf ; __u32 k ; }; struct bpf_insn { __u8 code ; unsigned char dst_reg : 4 ; unsigned char src_reg : 4 ; __s16 off ; __s32 imm ; }; enum bpf_prog_type { BPF_PROG_TYPE_UNSPEC = 0, BPF_PROG_TYPE_SOCKET_FILTER = 1, BPF_PROG_TYPE_KPROBE = 2, BPF_PROG_TYPE_SCHED_CLS = 3, BPF_PROG_TYPE_SCHED_ACT = 4 } ; struct bpf_prog_aux; struct sock_fprog_kern { u16 len ; struct sock_filter *filter ; }; union __anonunion____missing_field_name_332 { struct sock_filter insns[0U] ; struct bpf_insn insnsi[0U] ; }; struct bpf_prog { u16 pages ; bool jited ; bool gpl_compatible ; u32 len ; enum bpf_prog_type type ; struct bpf_prog_aux *aux ; struct sock_fprog_kern *orig_prog ; unsigned int (*bpf_func)(struct sk_buff const * , struct bpf_insn const * ) ; union __anonunion____missing_field_name_332 __annonCompField99 ; }; struct sk_filter { atomic_t refcnt ; struct callback_head rcu ; struct bpf_prog *prog ; }; 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 nla_policy { u16 type ; u16 len ; }; struct rtnl_link_ops { struct list_head list ; char const *kind ; size_t priv_size ; void (*setup)(struct net_device * ) ; int maxtype ; struct nla_policy const *policy ; int (*validate)(struct nlattr ** , struct nlattr ** ) ; int (*newlink)(struct net * , struct net_device * , struct nlattr ** , struct nlattr ** ) ; int (*changelink)(struct net_device * , struct nlattr ** , struct nlattr ** ) ; void (*dellink)(struct net_device * , struct list_head * ) ; size_t (*get_size)(struct net_device const * ) ; int (*fill_info)(struct sk_buff * , struct net_device const * ) ; size_t (*get_xstats_size)(struct net_device const * ) ; int (*fill_xstats)(struct sk_buff * , struct net_device const * ) ; unsigned int (*get_num_tx_queues)(void) ; unsigned int (*get_num_rx_queues)(void) ; int slave_maxtype ; struct nla_policy const *slave_policy ; int (*slave_validate)(struct nlattr ** , struct nlattr ** ) ; int (*slave_changelink)(struct net_device * , struct net_device * , struct nlattr ** , struct nlattr ** ) ; size_t (*get_slave_size)(struct net_device const * , struct net_device const * ) ; int (*fill_slave_info)(struct sk_buff * , struct net_device const * , struct net_device const * ) ; struct net *(*get_link_net)(struct net_device const * ) ; }; struct neigh_table; struct neigh_parms { possible_net_t net ; struct net_device *dev ; struct list_head list ; int (*neigh_setup)(struct neighbour * ) ; void (*neigh_cleanup)(struct neighbour * ) ; struct neigh_table *tbl ; void *sysctl_table ; int dead ; atomic_t refcnt ; struct callback_head callback_head ; int reachable_time ; int data[13U] ; unsigned long data_state[1U] ; }; struct neigh_statistics { unsigned long allocs ; unsigned long destroys ; unsigned long hash_grows ; unsigned long res_failed ; unsigned long lookups ; unsigned long hits ; unsigned long rcv_probes_mcast ; unsigned long rcv_probes_ucast ; unsigned long periodic_gc_runs ; unsigned long forced_gc_runs ; unsigned long unres_discards ; }; struct neigh_ops; struct neighbour { struct neighbour *next ; struct neigh_table *tbl ; struct neigh_parms *parms ; unsigned long confirmed ; unsigned long updated ; rwlock_t lock ; atomic_t refcnt ; struct sk_buff_head arp_queue ; unsigned int arp_queue_len_bytes ; struct timer_list timer ; unsigned long used ; atomic_t probes ; __u8 flags ; __u8 nud_state ; __u8 type ; __u8 dead ; seqlock_t ha_lock ; unsigned char ha[32U] ; struct hh_cache hh ; int (*output)(struct neighbour * , struct sk_buff * ) ; struct neigh_ops const *ops ; struct callback_head rcu ; struct net_device *dev ; u8 primary_key[0U] ; }; struct neigh_ops { int family ; void (*solicit)(struct neighbour * , struct sk_buff * ) ; void (*error_report)(struct neighbour * , struct sk_buff * ) ; int (*output)(struct neighbour * , struct sk_buff * ) ; int (*connected_output)(struct neighbour * , struct sk_buff * ) ; }; struct pneigh_entry { struct pneigh_entry *next ; possible_net_t net ; struct net_device *dev ; u8 flags ; u8 key[0U] ; }; struct neigh_hash_table { struct neighbour **hash_buckets ; unsigned int hash_shift ; __u32 hash_rnd[4U] ; struct callback_head rcu ; }; struct neigh_table { int family ; int entry_size ; int key_len ; __be16 protocol ; __u32 (*hash)(void const * , struct net_device const * , __u32 * ) ; bool (*key_eq)(struct neighbour const * , void const * ) ; int (*constructor)(struct neighbour * ) ; int (*pconstructor)(struct pneigh_entry * ) ; void (*pdestructor)(struct pneigh_entry * ) ; void (*proxy_redo)(struct sk_buff * ) ; char *id ; struct neigh_parms parms ; struct list_head parms_list ; int gc_interval ; int gc_thresh1 ; int gc_thresh2 ; int gc_thresh3 ; unsigned long last_flush ; struct delayed_work gc_work ; struct timer_list proxy_timer ; struct sk_buff_head proxy_queue ; atomic_t entries ; rwlock_t lock ; unsigned long last_rand ; struct neigh_statistics *stats ; struct neigh_hash_table *nht ; struct pneigh_entry **phash_buckets ; }; struct dn_route; union __anonunion____missing_field_name_343 { struct dst_entry *next ; struct rtable *rt_next ; struct rt6_info *rt6_next ; struct dn_route *dn_next ; }; struct dst_entry { struct callback_head callback_head ; struct dst_entry *child ; struct net_device *dev ; struct dst_ops *ops ; unsigned long _metrics ; unsigned long expires ; struct dst_entry *path ; struct dst_entry *from ; struct xfrm_state *xfrm ; int (*input)(struct sk_buff * ) ; int (*output)(struct sock * , struct sk_buff * ) ; unsigned short flags ; unsigned short pending_confirm ; short error ; short obsolete ; unsigned short header_len ; unsigned short trailer_len ; __u32 tclassid ; long __pad_to_align_refcnt[2U] ; atomic_t __refcnt ; int __use ; unsigned long lastuse ; union __anonunion____missing_field_name_343 __annonCompField100 ; }; struct __anonstruct_socket_lock_t_344 { spinlock_t slock ; int owned ; wait_queue_head_t wq ; struct lockdep_map dep_map ; }; typedef struct __anonstruct_socket_lock_t_344 socket_lock_t; struct proto; typedef __u32 __portpair; typedef __u64 __addrpair; struct __anonstruct____missing_field_name_346 { __be32 skc_daddr ; __be32 skc_rcv_saddr ; }; union __anonunion____missing_field_name_345 { __addrpair skc_addrpair ; struct __anonstruct____missing_field_name_346 __annonCompField101 ; }; union __anonunion____missing_field_name_347 { unsigned int skc_hash ; __u16 skc_u16hashes[2U] ; }; struct __anonstruct____missing_field_name_349 { __be16 skc_dport ; __u16 skc_num ; }; union __anonunion____missing_field_name_348 { __portpair skc_portpair ; struct __anonstruct____missing_field_name_349 __annonCompField104 ; }; union __anonunion____missing_field_name_350 { struct hlist_node skc_bind_node ; struct hlist_nulls_node skc_portaddr_node ; }; union __anonunion____missing_field_name_351 { struct hlist_node skc_node ; struct hlist_nulls_node skc_nulls_node ; }; struct sock_common { union __anonunion____missing_field_name_345 __annonCompField102 ; union __anonunion____missing_field_name_347 __annonCompField103 ; union __anonunion____missing_field_name_348 __annonCompField105 ; unsigned short skc_family ; unsigned char volatile skc_state ; unsigned char skc_reuse : 4 ; unsigned char skc_reuseport : 1 ; unsigned char skc_ipv6only : 1 ; unsigned char skc_net_refcnt : 1 ; int skc_bound_dev_if ; union __anonunion____missing_field_name_350 __annonCompField106 ; struct proto *skc_prot ; possible_net_t skc_net ; struct in6_addr skc_v6_daddr ; struct in6_addr skc_v6_rcv_saddr ; atomic64_t skc_cookie ; int skc_dontcopy_begin[0U] ; union __anonunion____missing_field_name_351 __annonCompField107 ; int skc_tx_queue_mapping ; atomic_t skc_refcnt ; int skc_dontcopy_end[0U] ; }; struct cg_proto; struct __anonstruct_sk_backlog_352 { atomic_t rmem_alloc ; int len ; struct sk_buff *head ; struct sk_buff *tail ; }; struct sock { struct sock_common __sk_common ; socket_lock_t sk_lock ; struct sk_buff_head sk_receive_queue ; struct __anonstruct_sk_backlog_352 sk_backlog ; int sk_forward_alloc ; __u32 sk_rxhash ; u16 sk_incoming_cpu ; __u32 sk_txhash ; unsigned int sk_napi_id ; unsigned int sk_ll_usec ; atomic_t sk_drops ; int sk_rcvbuf ; struct sk_filter *sk_filter ; struct socket_wq *sk_wq ; struct xfrm_policy *sk_policy[2U] ; unsigned long sk_flags ; struct dst_entry *sk_rx_dst ; struct dst_entry *sk_dst_cache ; spinlock_t sk_dst_lock ; atomic_t sk_wmem_alloc ; atomic_t sk_omem_alloc ; int sk_sndbuf ; struct sk_buff_head sk_write_queue ; unsigned char sk_shutdown : 2 ; unsigned char sk_no_check_tx : 1 ; unsigned char sk_no_check_rx : 1 ; unsigned char sk_userlocks : 4 ; unsigned char sk_protocol ; unsigned short sk_type ; int sk_wmem_queued ; gfp_t sk_allocation ; u32 sk_pacing_rate ; u32 sk_max_pacing_rate ; netdev_features_t sk_route_caps ; netdev_features_t sk_route_nocaps ; int sk_gso_type ; unsigned int sk_gso_max_size ; u16 sk_gso_max_segs ; int sk_rcvlowat ; unsigned long sk_lingertime ; struct sk_buff_head sk_error_queue ; struct proto *sk_prot_creator ; rwlock_t sk_callback_lock ; int sk_err ; int sk_err_soft ; u32 sk_ack_backlog ; u32 sk_max_ack_backlog ; __u32 sk_priority ; __u32 sk_cgrp_prioidx ; struct pid *sk_peer_pid ; struct cred const *sk_peer_cred ; long sk_rcvtimeo ; long sk_sndtimeo ; struct timer_list sk_timer ; ktime_t sk_stamp ; u16 sk_tsflags ; u32 sk_tskey ; struct socket *sk_socket ; void *sk_user_data ; struct page_frag sk_frag ; struct sk_buff *sk_send_head ; __s32 sk_peek_off ; int sk_write_pending ; void *sk_security ; __u32 sk_mark ; u32 sk_classid ; struct cg_proto *sk_cgrp ; void (*sk_state_change)(struct sock * ) ; void (*sk_data_ready)(struct sock * ) ; void (*sk_write_space)(struct sock * ) ; void (*sk_error_report)(struct sock * ) ; int (*sk_backlog_rcv)(struct sock * , struct sk_buff * ) ; void (*sk_destruct)(struct sock * ) ; }; struct request_sock_ops; struct timewait_sock_ops; struct inet_hashinfo; struct raw_hashinfo; struct udp_table; union __anonunion_h_355 { struct inet_hashinfo *hashinfo ; struct udp_table *udp_table ; struct raw_hashinfo *raw_hash ; }; struct proto { void (*close)(struct sock * , long ) ; int (*connect)(struct sock * , struct sockaddr * , int ) ; int (*disconnect)(struct sock * , int ) ; struct sock *(*accept)(struct sock * , int , int * ) ; int (*ioctl)(struct sock * , int , unsigned long ) ; int (*init)(struct sock * ) ; void (*destroy)(struct sock * ) ; void (*shutdown)(struct sock * , int ) ; int (*setsockopt)(struct sock * , int , int , char * , unsigned int ) ; int (*getsockopt)(struct sock * , int , int , char * , int * ) ; int (*compat_setsockopt)(struct sock * , int , int , char * , unsigned int ) ; int (*compat_getsockopt)(struct sock * , int , int , char * , int * ) ; int (*compat_ioctl)(struct sock * , unsigned int , unsigned long ) ; int (*sendmsg)(struct sock * , struct msghdr * , size_t ) ; int (*recvmsg)(struct sock * , struct msghdr * , size_t , int , int , int * ) ; int (*sendpage)(struct sock * , struct page * , int , size_t , int ) ; int (*bind)(struct sock * , struct sockaddr * , int ) ; int (*backlog_rcv)(struct sock * , struct sk_buff * ) ; void (*release_cb)(struct sock * ) ; void (*hash)(struct sock * ) ; void (*unhash)(struct sock * ) ; void (*rehash)(struct sock * ) ; int (*get_port)(struct sock * , unsigned short ) ; void (*clear_sk)(struct sock * , int ) ; unsigned int inuse_idx ; bool (*stream_memory_free)(struct sock const * ) ; void (*enter_memory_pressure)(struct sock * ) ; atomic_long_t *memory_allocated ; struct percpu_counter *sockets_allocated ; int *memory_pressure ; long *sysctl_mem ; int *sysctl_wmem ; int *sysctl_rmem ; int max_header ; bool no_autobind ; struct kmem_cache *slab ; unsigned int obj_size ; int slab_flags ; struct percpu_counter *orphan_count ; struct request_sock_ops *rsk_prot ; struct timewait_sock_ops *twsk_prot ; union __anonunion_h_355 h ; struct module *owner ; char name[32U] ; struct list_head node ; int (*init_cgroup)(struct mem_cgroup * , struct cgroup_subsys * ) ; void (*destroy_cgroup)(struct mem_cgroup * ) ; struct cg_proto *(*proto_cgroup)(struct mem_cgroup * ) ; }; struct cg_proto { struct page_counter memory_allocated ; struct percpu_counter sockets_allocated ; int memory_pressure ; long sysctl_mem[3U] ; unsigned long flags ; struct mem_cgroup *memcg ; }; 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_ht_operation { u8 primary_chan ; u8 ht_param ; __le16 operation_mode ; __le16 stbc_param ; u8 basic_set[16U] ; }; 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 ; }; struct ieee80211_vht_operation { u8 chan_width ; u8 center_freq_seg1_idx ; u8 center_freq_seg2_idx ; __le16 basic_mcs_set ; }; struct __anonstruct_chans_401 { u8 first_channel ; u8 num_channels ; s8 max_power ; }; struct __anonstruct_ext_402 { u8 reg_extension_id ; u8 reg_class ; u8 coverage_class ; }; union __anonunion____missing_field_name_400 { struct __anonstruct_chans_401 chans ; struct __anonstruct_ext_402 ext ; }; struct ieee80211_country_ie_triplet { union __anonunion____missing_field_name_400 __annonCompField108 ; }; struct firmware { size_t size ; u8 const *data ; struct page **pages ; void *priv ; }; struct ipv4_devconf { void *sysctl ; int data[29U] ; unsigned long state[1U] ; }; struct in_ifaddr; struct ip_mc_list; struct in_device { struct net_device *dev ; atomic_t refcnt ; int dead ; struct in_ifaddr *ifa_list ; struct ip_mc_list *mc_list ; struct ip_mc_list **mc_hash ; int mc_count ; spinlock_t mc_tomb_lock ; struct ip_mc_list *mc_tomb ; unsigned long mr_v1_seen ; unsigned long mr_v2_seen ; unsigned long mr_maxdelay ; unsigned char mr_qrv ; unsigned char mr_gq_running ; unsigned char mr_ifc_count ; struct timer_list mr_gq_timer ; struct timer_list mr_ifc_timer ; struct neigh_parms *arp_parms ; struct ipv4_devconf cnf ; struct callback_head callback_head ; }; struct in_ifaddr { struct hlist_node hash ; struct in_ifaddr *ifa_next ; struct in_device *ifa_dev ; struct callback_head callback_head ; __be32 ifa_local ; __be32 ifa_address ; __be32 ifa_mask ; __be32 ifa_broadcast ; unsigned char ifa_scope ; unsigned char ifa_prefixlen ; __u32 ifa_flags ; char ifa_label[16U] ; __u32 ifa_valid_lft ; __u32 ifa_preferred_lft ; unsigned long ifa_cstamp ; unsigned long ifa_tstamp ; }; 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 } ; struct nl80211_sta_flag_update { __u32 mask ; __u32 set ; }; 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_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_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 } ; 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[] ; }; 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 vif_params { int use_4addr ; u8 macaddr[6U] ; }; struct cfg80211_chan_def { struct ieee80211_channel *chan ; enum nl80211_chan_width width ; u32 center_freq1 ; u32 center_freq2 ; }; 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 cfg80211_beacon_data { u8 const *head ; u8 const *tail ; u8 const *beacon_ies ; u8 const *proberesp_ies ; u8 const *assocresp_ies ; u8 const *probe_resp ; size_t head_len ; size_t tail_len ; size_t beacon_ies_len ; size_t proberesp_ies_len ; size_t assocresp_ies_len ; size_t probe_resp_len ; }; struct mac_address { u8 addr[6U] ; }; struct station_parameters { u8 const *supported_rates ; struct net_device *vlan ; u32 sta_flags_mask ; u32 sta_flags_set ; u32 sta_modify_mask ; int listen_interval ; u16 aid ; u8 supported_rates_len ; u8 plink_action ; u8 plink_state ; struct ieee80211_ht_cap const *ht_capa ; struct ieee80211_vht_cap const *vht_capa ; u8 uapsd_queues ; u8 max_sp ; enum nl80211_mesh_power_mode local_pm ; u16 capability ; u8 const *ext_capab ; u8 ext_capab_len ; u8 const *supported_channels ; u8 supported_channels_len ; u8 const *supported_oper_classes ; u8 supported_oper_classes_len ; u8 opmode_notif ; bool opmode_notif_used ; }; 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 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 cfg80211_dscp_exception { u8 dscp ; u8 up ; }; struct cfg80211_dscp_range { u8 low ; u8 high ; }; struct cfg80211_qos_map { u8 num_des ; struct cfg80211_dscp_exception dscp_exception[21U] ; struct cfg80211_dscp_range up[8U] ; }; 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_406 { 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_406 wext ; }; enum mwifiex_bss_role { MWIFIEX_BSS_ROLE_STA = 0, MWIFIEX_BSS_ROLE_UAP = 1, MWIFIEX_BSS_ROLE_ANY = 255 } ; struct mwifiex_fw_image { u8 *helper_buf ; u32 helper_len ; u8 *fw_buf ; u32 fw_len ; }; struct mwifiex_802_11_ssid { u32 ssid_len ; u8 ssid[32U] ; }; struct mwifiex_wait_queue { wait_queue_head_t wait ; int status ; }; struct mwifiex_rxinfo { struct sk_buff *parent ; u8 bss_num ; u8 bss_type ; u8 use_count ; u8 buf_type ; }; struct mwifiex_txinfo { u32 status_code ; u8 flags ; u8 bss_num ; u8 bss_type ; u8 aggr_num ; u32 pkt_len ; u8 ack_frame_id ; u64 cookie ; }; enum mwifiex_wmm_ac_e { WMM_AC_BK = 0, WMM_AC_BE = 1, WMM_AC_VI = 2, WMM_AC_VO = 3 } ; struct ieee_types_wmm_ac_parameters { u8 aci_aifsn_bitmap ; u8 ecw_bitmap ; __le16 tx_op_limit ; }; struct mwifiex_types_wmm_info { u8 oui[4U] ; u8 subtype ; u8 version ; u8 qos_info ; u8 reserved ; struct ieee_types_wmm_ac_parameters ac_params[4U] ; }; struct mwifiex_chan_stats { u8 chan_num ; u8 bandcfg ; u8 flags ; s8 noise ; u16 total_bss ; u16 cca_scan_dur ; u16 cca_busy_dur ; }; struct mwifiex_histogram_data { atomic_t rx_rate[74U] ; atomic_t snr[256U] ; atomic_t noise_flr[256U] ; atomic_t sig_str[256U] ; atomic_t num_samples ; }; struct mwifiex_iface_comb { u8 sta_intf ; u8 uap_intf ; u8 p2p_intf ; }; struct mwifiex_11h_intf_state { bool is_11h_enabled ; bool is_11h_active ; }; struct mwifiex_multicast_list { u32 mode ; u32 num_multicast_addr ; u8 mac_list[32U][6U] ; }; struct wpa_param { u8 pairwise_cipher_wpa ; u8 pairwise_cipher_wpa2 ; u8 group_cipher ; u32 length ; u8 passphrase[64U] ; }; struct wep_key { u8 key_index ; u8 is_default ; u16 length ; u8 key[13U] ; }; struct mwifiex_uap_bss_param { u8 channel ; u8 band_cfg ; u16 rts_threshold ; u16 frag_threshold ; u8 retry_limit ; struct mwifiex_802_11_ssid ssid ; u8 bcast_ssid_ctl ; u8 radio_ctl ; u8 dtim_period ; u16 beacon_period ; u16 auth_mode ; u16 protocol ; u16 key_mgmt ; u16 key_mgmt_operation ; struct wpa_param wpa_cfg ; struct wep_key wep_cfg[4U] ; struct ieee80211_ht_cap ht_cap ; struct ieee80211_vht_cap vht_cap ; u8 rates[14U] ; u32 sta_ao_timer ; u32 ps_sta_ao_timer ; u8 qos_info ; u8 power_constraint ; struct mwifiex_types_wmm_info wmm_info ; }; struct mwifiex_ds_rx_reorder_tbl { u16 tid ; u8 ta[6U] ; u32 start_win ; u32 win_size ; u32 buffer[64U] ; }; struct mwifiex_ds_tx_ba_stream_tbl { u16 tid ; u8 ra[6U] ; u8 amsdu ; }; struct tdls_peer_info { u8 peer_addr[6U] ; }; struct mwifiex_debug_info { unsigned int debug_mask ; u32 int_counter ; u32 packets_out[8U] ; u32 tx_buf_size ; u32 curr_tx_buf_size ; u32 tx_tbl_num ; struct mwifiex_ds_tx_ba_stream_tbl tx_tbl[2U] ; u32 rx_tbl_num ; struct mwifiex_ds_rx_reorder_tbl rx_tbl[16U] ; u32 tdls_peer_num ; struct tdls_peer_info tdls_list[8U] ; u16 ps_mode ; u32 ps_state ; u8 is_deep_sleep ; u8 pm_wakeup_card_req ; u32 pm_wakeup_fw_try ; u8 is_hs_configured ; u8 hs_activated ; u32 num_cmd_host_to_card_failure ; u32 num_cmd_sleep_cfm_host_to_card_failure ; u32 num_tx_host_to_card_failure ; u32 num_event_deauth ; u32 num_event_disassoc ; u32 num_event_link_lost ; u32 num_cmd_deauth ; u32 num_cmd_assoc_success ; u32 num_cmd_assoc_failure ; u32 num_tx_timeout ; u8 is_cmd_timedout ; u16 timeout_cmd_id ; u16 timeout_cmd_act ; u16 last_cmd_id[5U] ; u16 last_cmd_act[5U] ; u16 last_cmd_index ; u16 last_cmd_resp_id[5U] ; u16 last_cmd_resp_index ; u16 last_event[5U] ; u16 last_event_index ; u8 data_sent ; u8 cmd_sent ; u8 cmd_resp_received ; u8 event_received ; }; struct mwifiex_ds_mem_rw { u32 addr ; u32 value ; }; struct subsc_evt_cfg { u8 abs_value ; u8 evt_freq ; }; struct mwifiex_ds_misc_subsc_evt { u16 action ; u16 events ; struct subsc_evt_cfg bcn_l_rssi_cfg ; struct subsc_evt_cfg bcn_h_rssi_cfg ; }; struct mwifiex_private; struct mwifiex_dma_mapping { dma_addr_t addr ; size_t len ; }; union __anonunion____missing_field_name_425 { struct mwifiex_rxinfo rx_info ; struct mwifiex_txinfo tx_info ; }; struct mwifiex_cb { struct mwifiex_dma_mapping dma_mapping ; union __anonunion____missing_field_name_425 __annonCompField114 ; }; struct mwifiex_chan_scan_param_set { u8 radio_type ; u8 chan_number ; u8 chan_scan_mode_bitmap ; __le16 min_scan_time ; __le16 max_scan_time ; }; struct mwifiex_ie_type_key_param_set { __le16 type ; __le16 length ; __le16 key_type_id ; __le16 key_info ; __le16 key_len ; u8 key[50U] ; }; struct mwifiex_wep_param { __le16 key_len ; u8 key[13U] ; }; struct mwifiex_tkip_param { u8 pn[8U] ; __le16 key_len ; u8 key[32U] ; }; struct mwifiex_aes_param { u8 pn[8U] ; __le16 key_len ; u8 key[16U] ; }; struct mwifiex_wapi_param { u8 pn[16U] ; __le16 key_len ; u8 key[32U] ; }; struct mwifiex_cmac_aes_param { u8 ipn[8U] ; __le16 key_len ; u8 key[16U] ; }; union __anonunion_key_params_428 { struct mwifiex_wep_param wep ; struct mwifiex_tkip_param tkip ; struct mwifiex_aes_param aes ; struct mwifiex_wapi_param wapi ; struct mwifiex_cmac_aes_param cmac_aes ; }; struct mwifiex_ie_type_key_param_set_v2 { __le16 type ; __le16 len ; u8 mac_addr[6U] ; u8 key_idx ; u8 key_type ; __le16 key_info ; union __anonunion_key_params_428 key_params ; }; struct host_cmd_ds_802_11_key_material_v2 { __le16 action ; struct mwifiex_ie_type_key_param_set_v2 key_param_set ; }; struct host_cmd_ds_802_11_key_material { __le16 action ; struct mwifiex_ie_type_key_param_set key_param_set ; }; struct ieee_types_cf_param_set { u8 element_id ; u8 len ; u8 cfp_cnt ; u8 cfp_period ; __le16 cfp_max_duration ; __le16 cfp_duration_remaining ; }; struct ieee_types_ibss_param_set { u8 element_id ; u8 len ; __le16 atim_window ; }; union ieee_types_ss_param_set { struct ieee_types_cf_param_set cf_param_set ; struct ieee_types_ibss_param_set ibss_param_set ; }; struct ieee_types_fh_param_set { u8 element_id ; u8 len ; __le16 dwell_time ; u8 hop_set ; u8 hop_pattern ; u8 hop_index ; }; struct ieee_types_ds_param_set { u8 element_id ; u8 len ; u8 current_chan ; }; union ieee_types_phy_param_set { struct ieee_types_fh_param_set fh_param_set ; struct ieee_types_ds_param_set ds_param_set ; }; struct ieee_types_oper_mode_ntf { u8 element_id ; u8 len ; u8 oper_mode ; }; struct mwifiex_hs_config_param { __le32 conditions ; u8 gpio ; u8 gap ; }; struct ieee_types_vendor_header { u8 element_id ; u8 len ; u8 oui[4U] ; u8 oui_subtype ; u8 version ; }; struct ieee_types_wmm_parameter { struct ieee_types_vendor_header vend_hdr ; u8 qos_info_bitmap ; u8 reserved ; struct ieee_types_wmm_ac_parameters ac_params[4U] ; }; struct mwifiex_wmm_ac_status { u8 disabled ; u8 flow_required ; u8 flow_created ; }; struct mwifiex_ie { __le16 ie_index ; __le16 mgmt_subtype_mask ; __le16 ie_length ; u8 ie_buffer[256U] ; }; struct mwifiex_adapter; struct usb_device_descriptor { __u8 bLength ; __u8 bDescriptorType ; __le16 bcdUSB ; __u8 bDeviceClass ; __u8 bDeviceSubClass ; __u8 bDeviceProtocol ; __u8 bMaxPacketSize0 ; __le16 idVendor ; __le16 idProduct ; __le16 bcdDevice ; __u8 iManufacturer ; __u8 iProduct ; __u8 iSerialNumber ; __u8 bNumConfigurations ; }; struct usb_config_descriptor { __u8 bLength ; __u8 bDescriptorType ; __le16 wTotalLength ; __u8 bNumInterfaces ; __u8 bConfigurationValue ; __u8 iConfiguration ; __u8 bmAttributes ; __u8 bMaxPower ; }; struct usb_interface_descriptor { __u8 bLength ; __u8 bDescriptorType ; __u8 bInterfaceNumber ; __u8 bAlternateSetting ; __u8 bNumEndpoints ; __u8 bInterfaceClass ; __u8 bInterfaceSubClass ; __u8 bInterfaceProtocol ; __u8 iInterface ; }; struct usb_endpoint_descriptor { __u8 bLength ; __u8 bDescriptorType ; __u8 bEndpointAddress ; __u8 bmAttributes ; __le16 wMaxPacketSize ; __u8 bInterval ; __u8 bRefresh ; __u8 bSynchAddress ; }; struct usb_ss_ep_comp_descriptor { __u8 bLength ; __u8 bDescriptorType ; __u8 bMaxBurst ; __u8 bmAttributes ; __le16 wBytesPerInterval ; }; struct usb_interface_assoc_descriptor { __u8 bLength ; __u8 bDescriptorType ; __u8 bFirstInterface ; __u8 bInterfaceCount ; __u8 bFunctionClass ; __u8 bFunctionSubClass ; __u8 bFunctionProtocol ; __u8 iFunction ; }; struct usb_bos_descriptor { __u8 bLength ; __u8 bDescriptorType ; __le16 wTotalLength ; __u8 bNumDeviceCaps ; }; struct usb_ext_cap_descriptor { __u8 bLength ; __u8 bDescriptorType ; __u8 bDevCapabilityType ; __le32 bmAttributes ; }; struct usb_ss_cap_descriptor { __u8 bLength ; __u8 bDescriptorType ; __u8 bDevCapabilityType ; __u8 bmAttributes ; __le16 wSpeedSupported ; __u8 bFunctionalitySupport ; __u8 bU1devExitLat ; __le16 bU2DevExitLat ; }; struct usb_ss_container_id_descriptor { __u8 bLength ; __u8 bDescriptorType ; __u8 bDevCapabilityType ; __u8 bReserved ; __u8 ContainerID[16U] ; }; enum usb_device_speed { USB_SPEED_UNKNOWN = 0, USB_SPEED_LOW = 1, USB_SPEED_FULL = 2, USB_SPEED_HIGH = 3, USB_SPEED_WIRELESS = 4, USB_SPEED_SUPER = 5 } ; enum usb_device_state { USB_STATE_NOTATTACHED = 0, USB_STATE_ATTACHED = 1, USB_STATE_POWERED = 2, USB_STATE_RECONNECTING = 3, USB_STATE_UNAUTHENTICATED = 4, USB_STATE_DEFAULT = 5, USB_STATE_ADDRESS = 6, USB_STATE_CONFIGURED = 7, USB_STATE_SUSPENDED = 8 } ; struct usb_device; struct wusb_dev; struct ep_device; struct usb_host_endpoint { struct usb_endpoint_descriptor desc ; struct usb_ss_ep_comp_descriptor ss_ep_comp ; struct list_head urb_list ; void *hcpriv ; struct ep_device *ep_dev ; unsigned char *extra ; int extralen ; int enabled ; int streams ; }; struct usb_host_interface { struct usb_interface_descriptor desc ; int extralen ; unsigned char *extra ; struct usb_host_endpoint *endpoint ; char *string ; }; enum usb_interface_condition { USB_INTERFACE_UNBOUND = 0, USB_INTERFACE_BINDING = 1, USB_INTERFACE_BOUND = 2, USB_INTERFACE_UNBINDING = 3 } ; struct usb_interface { struct usb_host_interface *altsetting ; struct usb_host_interface *cur_altsetting ; unsigned int num_altsetting ; struct usb_interface_assoc_descriptor *intf_assoc ; int minor ; enum usb_interface_condition condition ; unsigned char sysfs_files_created : 1 ; unsigned char ep_devs_created : 1 ; unsigned char unregistering : 1 ; unsigned char needs_remote_wakeup : 1 ; unsigned char needs_altsetting0 : 1 ; unsigned char needs_binding : 1 ; unsigned char resetting_device : 1 ; struct device dev ; struct device *usb_dev ; atomic_t pm_usage_cnt ; struct work_struct reset_ws ; }; struct usb_interface_cache { unsigned int num_altsetting ; struct kref ref ; struct usb_host_interface altsetting[0U] ; }; struct usb_host_config { struct usb_config_descriptor desc ; char *string ; struct usb_interface_assoc_descriptor *intf_assoc[16U] ; struct usb_interface *interface[32U] ; struct usb_interface_cache *intf_cache[32U] ; unsigned char *extra ; int extralen ; }; struct usb_host_bos { struct usb_bos_descriptor *desc ; struct usb_ext_cap_descriptor *ext_cap ; struct usb_ss_cap_descriptor *ss_cap ; struct usb_ss_container_id_descriptor *ss_id ; }; struct usb_devmap { unsigned long devicemap[2U] ; }; struct mon_bus; struct usb_bus { struct device *controller ; int busnum ; char const *bus_name ; u8 uses_dma ; u8 uses_pio_for_control ; u8 otg_port ; unsigned char is_b_host : 1 ; unsigned char b_hnp_enable : 1 ; unsigned char no_stop_on_short : 1 ; unsigned char no_sg_constraint : 1 ; unsigned int sg_tablesize ; int devnum_next ; struct usb_devmap devmap ; struct usb_device *root_hub ; struct usb_bus *hs_companion ; struct list_head bus_list ; struct mutex usb_address0_mutex ; int bandwidth_allocated ; int bandwidth_int_reqs ; int bandwidth_isoc_reqs ; unsigned int resuming_ports ; struct mon_bus *mon_bus ; int monitored ; }; struct usb_tt; enum usb_device_removable { USB_DEVICE_REMOVABLE_UNKNOWN = 0, USB_DEVICE_REMOVABLE = 1, USB_DEVICE_FIXED = 2 } ; struct usb2_lpm_parameters { unsigned int besl ; int timeout ; }; struct usb3_lpm_parameters { unsigned int mel ; unsigned int pel ; unsigned int sel ; int timeout ; }; struct usb_device { int devnum ; char devpath[16U] ; u32 route ; enum usb_device_state state ; enum usb_device_speed speed ; struct usb_tt *tt ; int ttport ; unsigned int toggle[2U] ; struct usb_device *parent ; struct usb_bus *bus ; struct usb_host_endpoint ep0 ; struct device dev ; struct usb_device_descriptor descriptor ; struct usb_host_bos *bos ; struct usb_host_config *config ; struct usb_host_config *actconfig ; struct usb_host_endpoint *ep_in[16U] ; struct usb_host_endpoint *ep_out[16U] ; char **rawdescriptors ; unsigned short bus_mA ; u8 portnum ; u8 level ; unsigned char can_submit : 1 ; unsigned char persist_enabled : 1 ; unsigned char have_langid : 1 ; unsigned char authorized : 1 ; unsigned char authenticated : 1 ; unsigned char wusb : 1 ; unsigned char lpm_capable : 1 ; unsigned char usb2_hw_lpm_capable : 1 ; unsigned char usb2_hw_lpm_besl_capable : 1 ; unsigned char usb2_hw_lpm_enabled : 1 ; unsigned char usb2_hw_lpm_allowed : 1 ; unsigned char usb3_lpm_enabled : 1 ; int string_langid ; char *product ; char *manufacturer ; char *serial ; struct list_head filelist ; int maxchild ; u32 quirks ; atomic_t urbnum ; unsigned long active_duration ; unsigned long connect_time ; unsigned char do_remote_wakeup : 1 ; unsigned char reset_resume : 1 ; unsigned char port_is_suspended : 1 ; struct wusb_dev *wusb_dev ; int slot_id ; enum usb_device_removable removable ; struct usb2_lpm_parameters l1_params ; struct usb3_lpm_parameters u1_params ; struct usb3_lpm_parameters u2_params ; unsigned int lpm_disable_count ; }; struct usb_iso_packet_descriptor { unsigned int offset ; unsigned int length ; unsigned int actual_length ; int status ; }; struct urb; struct usb_anchor { struct list_head urb_list ; wait_queue_head_t wait ; spinlock_t lock ; atomic_t suspend_wakeups ; unsigned char poisoned : 1 ; }; struct urb { struct kref kref ; void *hcpriv ; atomic_t use_count ; atomic_t reject ; int unlinked ; struct list_head urb_list ; struct list_head anchor_list ; struct usb_anchor *anchor ; struct usb_device *dev ; struct usb_host_endpoint *ep ; unsigned int pipe ; unsigned int stream_id ; int status ; unsigned int transfer_flags ; void *transfer_buffer ; dma_addr_t transfer_dma ; struct scatterlist *sg ; int num_mapped_sgs ; int num_sgs ; u32 transfer_buffer_length ; u32 actual_length ; unsigned char *setup_packet ; dma_addr_t setup_dma ; int start_frame ; int number_of_packets ; int interval ; int error_count ; void *context ; void (*complete)(struct urb * ) ; struct usb_iso_packet_descriptor iso_frame_desc[0U] ; }; struct urb_context { struct mwifiex_adapter *adapter ; struct sk_buff *skb ; struct urb *urb ; u8 ep ; }; struct usb_card_rec { struct mwifiex_adapter *adapter ; struct usb_device *udev ; struct usb_interface *intf ; u8 rx_cmd_ep ; struct urb_context rx_cmd ; atomic_t rx_cmd_urb_pending ; struct urb_context rx_data_list[6U] ; u8 usb_boot_state ; u8 rx_data_ep ; atomic_t rx_data_urb_pending ; u8 tx_data_ep ; u8 tx_cmd_ep ; atomic_t tx_data_urb_pending ; atomic_t tx_cmd_urb_pending ; int bulk_out_maxpktsize ; struct urb_context tx_cmd ; int tx_data_ix ; struct urb_context tx_data_list[6U] ; }; typedef unsigned int mmc_pm_flag_t; struct mmc_card; struct sdio_func; typedef void sdio_irq_handler_t(struct sdio_func * ); struct sdio_func_tuple { struct sdio_func_tuple *next ; unsigned char code ; unsigned char size ; unsigned char data[0U] ; }; struct sdio_func { struct mmc_card *card ; struct device dev ; sdio_irq_handler_t *irq_handler ; unsigned int num ; unsigned char class ; unsigned short vendor ; unsigned short device ; unsigned int max_blksize ; unsigned int cur_blksize ; unsigned int enable_timeout ; unsigned int state ; u8 tmpbuf[4U] ; unsigned int num_info ; char const **info ; struct sdio_func_tuple *tuples ; }; struct mmc_data; struct mmc_request; struct mmc_command { u32 opcode ; u32 arg ; u32 resp[4U] ; unsigned int flags ; unsigned int retries ; int error ; unsigned int busy_timeout ; bool sanitize_busy ; struct mmc_data *data ; struct mmc_request *mrq ; }; struct mmc_data { unsigned int timeout_ns ; unsigned int timeout_clks ; unsigned int blksz ; unsigned int blocks ; int error ; unsigned int flags ; unsigned int bytes_xfered ; struct mmc_command *stop ; struct mmc_request *mrq ; unsigned int sg_len ; int sg_count ; struct scatterlist *sg ; s32 host_cookie ; }; struct mmc_host; struct mmc_request { struct mmc_command *sbc ; struct mmc_command *cmd ; struct mmc_data *data ; struct mmc_command *stop ; struct completion completion ; void (*done)(struct mmc_request * ) ; struct mmc_host *host ; }; struct mmc_async_req; struct mmc_cid { unsigned int manfid ; char prod_name[8U] ; unsigned char prv ; unsigned int serial ; unsigned short oemid ; unsigned short year ; unsigned char hwrev ; unsigned char fwrev ; unsigned char month ; }; struct mmc_csd { unsigned char structure ; unsigned char mmca_vsn ; unsigned short cmdclass ; unsigned short tacc_clks ; unsigned int tacc_ns ; unsigned int c_size ; unsigned int r2w_factor ; unsigned int max_dtr ; unsigned int erase_size ; unsigned int read_blkbits ; unsigned int write_blkbits ; unsigned int capacity ; unsigned char read_partial : 1 ; unsigned char read_misalign : 1 ; unsigned char write_partial : 1 ; unsigned char write_misalign : 1 ; unsigned char dsr_imp : 1 ; }; struct mmc_ext_csd { u8 rev ; u8 erase_group_def ; u8 sec_feature_support ; u8 rel_sectors ; u8 rel_param ; u8 part_config ; u8 cache_ctrl ; u8 rst_n_function ; u8 max_packed_writes ; u8 max_packed_reads ; u8 packed_event_en ; unsigned int part_time ; unsigned int sa_timeout ; unsigned int generic_cmd6_time ; unsigned int power_off_longtime ; u8 power_off_notification ; unsigned int hs_max_dtr ; unsigned int hs200_max_dtr ; unsigned int sectors ; unsigned int hc_erase_size ; unsigned int hc_erase_timeout ; unsigned int sec_trim_mult ; unsigned int sec_erase_mult ; unsigned int trim_timeout ; bool partition_setting_completed ; unsigned long long enhanced_area_offset ; unsigned int enhanced_area_size ; unsigned int cache_size ; bool hpi_en ; bool hpi ; unsigned int hpi_cmd ; bool bkops ; bool man_bkops_en ; unsigned int data_sector_size ; unsigned int data_tag_unit_size ; unsigned int boot_ro_lock ; bool boot_ro_lockable ; bool ffu_capable ; u8 fwrev[8U] ; u8 raw_exception_status ; u8 raw_partition_support ; u8 raw_rpmb_size_mult ; u8 raw_erased_mem_count ; u8 raw_ext_csd_structure ; u8 raw_card_type ; u8 raw_driver_strength ; u8 out_of_int_time ; u8 raw_pwr_cl_52_195 ; u8 raw_pwr_cl_26_195 ; u8 raw_pwr_cl_52_360 ; u8 raw_pwr_cl_26_360 ; u8 raw_s_a_timeout ; u8 raw_hc_erase_gap_size ; u8 raw_erase_timeout_mult ; u8 raw_hc_erase_grp_size ; u8 raw_sec_trim_mult ; u8 raw_sec_erase_mult ; u8 raw_sec_feature_support ; u8 raw_trim_mult ; u8 raw_pwr_cl_200_195 ; u8 raw_pwr_cl_200_360 ; u8 raw_pwr_cl_ddr_52_195 ; u8 raw_pwr_cl_ddr_52_360 ; u8 raw_pwr_cl_ddr_200_360 ; u8 raw_bkops_status ; u8 raw_sectors[4U] ; unsigned int feature_support ; }; struct sd_scr { unsigned char sda_vsn ; unsigned char sda_spec3 ; unsigned char bus_widths ; unsigned char cmds ; }; struct sd_ssr { unsigned int au ; unsigned int erase_timeout ; unsigned int erase_offset ; }; struct sd_switch_caps { unsigned int hs_max_dtr ; unsigned int uhs_max_dtr ; unsigned int sd3_bus_mode ; unsigned int sd3_drv_type ; unsigned int sd3_curr_limit ; }; struct sdio_cccr { unsigned int sdio_vsn ; unsigned int sd_vsn ; unsigned char multi_block : 1 ; unsigned char low_speed : 1 ; unsigned char wide_bus : 1 ; unsigned char high_power : 1 ; unsigned char high_speed : 1 ; unsigned char disable_cd : 1 ; }; struct sdio_cis { unsigned short vendor ; unsigned short device ; unsigned short blksize ; unsigned int max_dtr ; }; struct mmc_ios; struct mmc_part { unsigned int size ; unsigned int part_cfg ; char name[20U] ; bool force_ro ; unsigned int area_type ; }; struct mmc_card { struct mmc_host *host ; struct device dev ; u32 ocr ; unsigned int rca ; unsigned int type ; unsigned int state ; unsigned int quirks ; unsigned int erase_size ; unsigned int erase_shift ; unsigned int pref_erase ; u8 erased_byte ; u32 raw_cid[4U] ; u32 raw_csd[4U] ; u32 raw_scr[2U] ; struct mmc_cid cid ; struct mmc_csd csd ; struct mmc_ext_csd ext_csd ; struct sd_scr scr ; struct sd_ssr ssr ; struct sd_switch_caps sw_caps ; unsigned int sdio_funcs ; struct sdio_cccr cccr ; struct sdio_cis cis ; struct sdio_func *sdio_func[7U] ; struct sdio_func *sdio_single_irq ; unsigned int num_info ; char const **info ; struct sdio_func_tuple *tuples ; unsigned int sd_bus_speed ; unsigned int mmc_avail_type ; unsigned int drive_strength ; struct dentry *debugfs_root ; struct mmc_part part[7U] ; unsigned int nr_parts ; }; 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 fault_attr { unsigned long probability ; unsigned long interval ; atomic_t times ; atomic_t space ; unsigned long verbose ; u32 task_filter ; unsigned long stacktrace_depth ; unsigned long require_start ; unsigned long require_end ; unsigned long reject_start ; unsigned long reject_end ; unsigned long count ; struct ratelimit_state ratelimit_state ; struct dentry *dname ; }; struct mmc_ios { unsigned int clock ; unsigned short vdd ; unsigned char bus_mode ; unsigned char chip_select ; unsigned char power_mode ; unsigned char bus_width ; unsigned char timing ; unsigned char signal_voltage ; unsigned char drv_type ; }; struct mmc_host_ops { void (*post_req)(struct mmc_host * , struct mmc_request * , int ) ; void (*pre_req)(struct mmc_host * , struct mmc_request * , bool ) ; void (*request)(struct mmc_host * , struct mmc_request * ) ; void (*set_ios)(struct mmc_host * , struct mmc_ios * ) ; int (*get_ro)(struct mmc_host * ) ; int (*get_cd)(struct mmc_host * ) ; void (*enable_sdio_irq)(struct mmc_host * , int ) ; void (*init_card)(struct mmc_host * , struct mmc_card * ) ; int (*start_signal_voltage_switch)(struct mmc_host * , struct mmc_ios * ) ; int (*card_busy)(struct mmc_host * ) ; int (*execute_tuning)(struct mmc_host * , u32 ) ; int (*prepare_hs400_tuning)(struct mmc_host * , struct mmc_ios * ) ; int (*select_drive_strength)(struct mmc_card * , unsigned int , int , int , int * ) ; void (*hw_reset)(struct mmc_host * ) ; void (*card_event)(struct mmc_host * ) ; int (*multi_io_quirk)(struct mmc_card * , unsigned int , int ) ; }; struct mmc_async_req { struct mmc_request *mrq ; int (*err_check)(struct mmc_card * , struct mmc_async_req * ) ; }; struct mmc_slot { int cd_irq ; void *handler_priv ; }; struct mmc_context_info { bool is_done_rcv ; bool is_new_req ; bool is_waiting_last_req ; wait_queue_head_t wait ; spinlock_t lock ; }; struct regulator; struct mmc_pwrseq; struct mmc_supply { struct regulator *vmmc ; struct regulator *vqmmc ; }; struct mmc_bus_ops; struct mmc_host { struct device *parent ; struct device class_dev ; int index ; struct mmc_host_ops const *ops ; struct mmc_pwrseq *pwrseq ; unsigned int f_min ; unsigned int f_max ; unsigned int f_init ; u32 ocr_avail ; u32 ocr_avail_sdio ; u32 ocr_avail_sd ; u32 ocr_avail_mmc ; struct notifier_block pm_notify ; u32 max_current_330 ; u32 max_current_300 ; u32 max_current_180 ; u32 caps ; u32 caps2 ; mmc_pm_flag_t pm_caps ; int clk_requests ; unsigned int clk_delay ; bool clk_gated ; struct delayed_work clk_gate_work ; unsigned int clk_old ; spinlock_t clk_lock ; struct mutex clk_gate_mutex ; struct device_attribute clkgate_delay_attr ; unsigned long clkgate_delay ; unsigned int max_seg_size ; unsigned short max_segs ; unsigned short unused ; unsigned int max_req_size ; unsigned int max_blk_size ; unsigned int max_blk_count ; unsigned int max_busy_timeout ; spinlock_t lock ; struct mmc_ios ios ; unsigned char use_spi_crc : 1 ; unsigned char claimed : 1 ; unsigned char bus_dead : 1 ; unsigned char removed : 1 ; unsigned char can_retune : 1 ; unsigned char doing_retune : 1 ; unsigned char retune_now : 1 ; int rescan_disable ; int rescan_entered ; int need_retune ; int hold_retune ; unsigned int retune_period ; struct timer_list retune_timer ; bool trigger_card_event ; struct mmc_card *card ; wait_queue_head_t wq ; struct task_struct *claimer ; int claim_cnt ; struct delayed_work detect ; int detect_change ; struct mmc_slot slot ; struct mmc_bus_ops const *bus_ops ; unsigned int bus_refs ; unsigned int sdio_irqs ; struct task_struct *sdio_irq_thread ; bool sdio_irq_pending ; atomic_t sdio_irq_thread_abort ; mmc_pm_flag_t pm_flags ; struct led_trigger *led ; bool regulator_enabled ; struct mmc_supply supply ; struct dentry *debugfs_root ; struct mmc_async_req *areq ; struct mmc_context_info context_info ; struct fault_attr fail_mmc_request ; unsigned int actual_clock ; unsigned int slotno ; int dsr_req ; u32 dsr ; unsigned long private[0U] ; }; struct mwifiex_sdio_mpa_tx { u8 *buf ; u32 buf_len ; u32 pkt_cnt ; u32 ports ; u16 start_port ; u8 enabled ; u32 buf_size ; u32 pkt_aggr_limit ; }; struct mwifiex_sdio_mpa_rx { u8 *buf ; u32 buf_len ; u32 pkt_cnt ; u32 ports ; u16 start_port ; struct sk_buff **skb_arr ; u32 *len_arr ; u8 enabled ; u32 buf_size ; u32 pkt_aggr_limit ; }; struct mwifiex_sdio_card_reg { u8 start_rd_port ; u8 start_wr_port ; u8 base_0_reg ; u8 base_1_reg ; u8 poll_reg ; u8 host_int_enable ; u8 host_int_rsr_reg ; u8 host_int_status_reg ; u8 host_int_mask_reg ; u8 status_reg_0 ; u8 status_reg_1 ; u8 sdio_int_mask ; u32 data_port_mask ; u8 io_port_0_reg ; u8 io_port_1_reg ; u8 io_port_2_reg ; u8 max_mp_regs ; u8 rd_bitmap_l ; u8 rd_bitmap_u ; u8 rd_bitmap_1l ; u8 rd_bitmap_1u ; u8 wr_bitmap_l ; u8 wr_bitmap_u ; u8 wr_bitmap_1l ; u8 wr_bitmap_1u ; u8 rd_len_p0_l ; u8 rd_len_p0_u ; u8 card_misc_cfg_reg ; u8 card_cfg_2_1_reg ; u8 cmd_rd_len_0 ; u8 cmd_rd_len_1 ; u8 cmd_rd_len_2 ; u8 cmd_rd_len_3 ; u8 cmd_cfg_0 ; u8 cmd_cfg_1 ; u8 cmd_cfg_2 ; u8 cmd_cfg_3 ; u8 fw_dump_ctrl ; u8 fw_dump_start ; u8 fw_dump_end ; u8 func1_dump_reg_start ; u8 func1_dump_reg_end ; u8 func1_scratch_reg ; u8 func1_spec_reg_num ; u8 func1_spec_reg_table[13U] ; }; struct sdio_mmc_card { struct sdio_func *func ; struct mwifiex_adapter *adapter ; char const *firmware ; struct mwifiex_sdio_card_reg const *reg ; u8 max_ports ; u8 mp_agg_pkt_limit ; u16 tx_buf_size ; u32 mp_tx_agg_buf_size ; u32 mp_rx_agg_buf_size ; u32 mp_rd_bitmap ; u32 mp_wr_bitmap ; u16 mp_end_port ; u32 mp_data_port_mask ; u8 curr_rd_port ; u8 curr_wr_port ; u8 *mp_regs ; bool supports_sdio_new_mode ; bool has_control_mask ; bool can_dump_fw ; bool can_auto_tdls ; bool can_ext_scan ; struct mwifiex_sdio_mpa_tx mpa_tx ; struct mwifiex_sdio_mpa_rx mpa_rx ; }; struct mwifiex_dbg { u32 num_cmd_host_to_card_failure ; u32 num_cmd_sleep_cfm_host_to_card_failure ; u32 num_tx_host_to_card_failure ; u32 num_event_deauth ; u32 num_event_disassoc ; u32 num_event_link_lost ; u32 num_cmd_deauth ; u32 num_cmd_assoc_success ; u32 num_cmd_assoc_failure ; u32 num_tx_timeout ; u16 timeout_cmd_id ; u16 timeout_cmd_act ; u16 last_cmd_id[5U] ; u16 last_cmd_act[5U] ; u16 last_cmd_index ; u16 last_cmd_resp_id[5U] ; u16 last_cmd_resp_index ; u16 last_event[5U] ; u16 last_event_index ; }; enum MWIFIEX_HARDWARE_STATUS { MWIFIEX_HW_STATUS_READY = 0, MWIFIEX_HW_STATUS_INITIALIZING = 1, MWIFIEX_HW_STATUS_INIT_DONE = 2, MWIFIEX_HW_STATUS_RESET = 3, MWIFIEX_HW_STATUS_CLOSING = 4, MWIFIEX_HW_STATUS_NOT_READY = 5 } ; struct mwifiex_tx_param { u32 next_pkt_len ; }; struct mwifiex_add_ba_param { u32 tx_win_size ; u32 rx_win_size ; u32 timeout ; u8 tx_amsdu ; u8 rx_amsdu ; }; struct mwifiex_tx_aggr { u8 ampdu_user ; u8 ampdu_ap ; u8 amsdu ; }; struct mwifiex_tid_tbl { struct list_head ra_list ; }; struct mwifiex_wmm_desc { struct mwifiex_tid_tbl tid_tbl_ptr[8U] ; u32 packets_out[8U] ; spinlock_t ra_list_spinlock ; struct mwifiex_wmm_ac_status ac_status[4U] ; enum mwifiex_wmm_ac_e ac_down_graded_vals[4U] ; u32 drv_pkt_delay_max ; u8 queue_priority[4U] ; u32 user_pri_pkt_tx_ctrl[8U] ; atomic_t tx_pkts_queued ; atomic_t highest_queued_prio ; }; struct mwifiex_802_11_security { u8 wpa_enabled ; u8 wpa2_enabled ; u8 wapi_enabled ; u8 wapi_key_on ; u8 wep_enabled ; u32 authentication_mode ; u8 is_authtype_auto ; u32 encryption_mode ; }; struct ieee_types_header { u8 element_id ; u8 len ; }; struct ieee_types_vendor_specific { struct ieee_types_vendor_header vend_hdr ; u8 data[248U] ; }; struct ieee_types_generic { struct ieee_types_header ieee_hdr ; u8 data[254U] ; }; struct mwifiex_bssdescriptor { u8 mac_address[6U] ; struct cfg80211_ssid ssid ; u32 privacy ; s32 rssi ; u32 channel ; u32 freq ; u16 beacon_period ; u8 erp_flags ; u32 bss_mode ; u8 supported_rates[14U] ; u8 data_rates[14U] ; u16 bss_band ; u64 fw_tsf ; u64 timestamp ; union ieee_types_phy_param_set phy_param_set ; union ieee_types_ss_param_set ss_param_set ; u16 cap_info_bitmap ; struct ieee_types_wmm_parameter wmm_ie ; u8 disable_11n ; struct ieee80211_ht_cap *bcn_ht_cap ; u16 ht_cap_offset ; struct ieee80211_ht_operation *bcn_ht_oper ; u16 ht_info_offset ; u8 *bcn_bss_co_2040 ; u16 bss_co_2040_offset ; u8 *bcn_ext_cap ; u16 ext_cap_offset ; struct ieee80211_vht_cap *bcn_vht_cap ; u16 vht_cap_offset ; struct ieee80211_vht_operation *bcn_vht_oper ; u16 vht_info_offset ; struct ieee_types_oper_mode_ntf *oper_mode ; u16 oper_mode_offset ; u8 disable_11ac ; struct ieee_types_vendor_specific *bcn_wpa_ie ; u16 wpa_offset ; struct ieee_types_generic *bcn_rsn_ie ; u16 rsn_offset ; struct ieee_types_generic *bcn_wapi_ie ; u16 wapi_offset ; u8 *beacon_buf ; u32 beacon_buf_size ; u8 sensed_11h ; u8 local_constraint ; u8 chan_sw_ie_present ; }; struct mwifiex_current_bss_params { struct mwifiex_bssdescriptor bss_descriptor ; u8 wmm_enabled ; u8 wmm_uapsd_enabled ; u8 band ; u32 num_of_rates ; u8 data_rates[14U] ; }; struct mwifiex_sleep_params { u16 sp_error ; u16 sp_offset ; u16 sp_stable_time ; u8 sp_cal_control ; u8 sp_ext_sleep_clk ; u16 sp_reserved ; }; struct mwifiex_sleep_period { u16 period ; u16 reserved ; }; struct mwifiex_wep_key { u32 length ; u32 key_index ; u32 key_length ; u8 key_material[16U] ; }; struct mwifiex_chan_freq_power { u16 channel ; u32 freq ; u16 max_tx_power ; u8 unsupported ; }; struct mwifiex_802_11d_domain_reg { u8 country_code[3U] ; u8 no_of_triplet ; struct ieee80211_country_ie_triplet triplet[83U] ; }; struct mwifiex_vendor_spec_cfg_ie { u16 mask ; u16 flag ; u8 ie[256U] ; }; struct wps { u8 session_enable ; }; struct mwifiex_roc_cfg { u64 cookie ; struct ieee80211_channel chan ; }; struct memory_type_mapping { u8 mem_name[8U] ; u8 *mem_ptr ; u32 mem_size ; u8 done_flag ; }; struct mwifiex_private { struct mwifiex_adapter *adapter ; u8 bss_type ; u8 bss_role ; u8 bss_priority ; u8 bss_num ; u8 bss_started ; u8 frame_type ; u8 curr_addr[6U] ; u8 media_connected ; u32 num_tx_timeout ; u8 tx_timeout_cnt ; struct net_device *netdev ; struct net_device_stats stats ; u16 curr_pkt_filter ; u32 bss_mode ; u32 pkt_tx_ctrl ; u16 tx_power_level ; u8 max_tx_power_level ; u8 min_tx_power_level ; u8 tx_rate ; u8 tx_htinfo ; u8 rxpd_htinfo ; u8 rxpd_rate ; u16 rate_bitmap ; u16 bitmap_rates[18U] ; u32 data_rate ; u8 is_data_rate_auto ; u16 bcn_avg_factor ; u16 data_avg_factor ; s16 data_rssi_last ; s16 data_nf_last ; s16 data_rssi_avg ; s16 data_nf_avg ; s16 bcn_rssi_last ; s16 bcn_nf_last ; s16 bcn_rssi_avg ; s16 bcn_nf_avg ; struct mwifiex_bssdescriptor *attempted_bss_desc ; struct cfg80211_ssid prev_ssid ; u8 prev_bssid[6U] ; struct mwifiex_current_bss_params curr_bss_params ; u16 beacon_period ; u8 dtim_period ; u16 listen_interval ; u16 atim_window ; u8 adhoc_channel ; u8 adhoc_is_link_sensed ; u8 adhoc_state ; struct mwifiex_802_11_security sec_info ; struct mwifiex_wep_key wep_key[4U] ; u16 wep_key_curr_index ; u8 wpa_ie[256U] ; u8 wpa_ie_len ; u8 wpa_is_gtk_set ; struct host_cmd_ds_802_11_key_material aes_key ; struct host_cmd_ds_802_11_key_material_v2 aes_key_v2 ; u8 wapi_ie[256U] ; u8 wapi_ie_len ; u8 *wps_ie ; u8 wps_ie_len ; u8 wmm_required ; u8 wmm_enabled ; u8 wmm_qosinfo ; struct mwifiex_wmm_desc wmm ; atomic_t wmm_tx_pending[4U] ; struct list_head sta_list ; spinlock_t sta_list_spinlock ; struct list_head auto_tdls_list ; spinlock_t auto_tdls_lock ; struct list_head tx_ba_stream_tbl_ptr ; spinlock_t tx_ba_stream_tbl_lock ; struct mwifiex_tx_aggr aggr_prio_tbl[8U] ; struct mwifiex_add_ba_param add_ba_param ; u16 rx_seq[8U] ; u8 tos_to_tid_inv[8U] ; struct list_head rx_reorder_tbl_ptr ; spinlock_t rx_reorder_tbl_lock ; spinlock_t rx_pkt_lock ; u8 assoc_rsp_buf[500U] ; u32 assoc_rsp_size ; u8 gen_ie_buf[256U] ; u8 gen_ie_buf_len ; struct mwifiex_vendor_spec_cfg_ie vs_ie[8U] ; u8 assoc_tlv_buf[256U] ; u8 assoc_tlv_buf_len ; u8 *curr_bcn_buf ; u32 curr_bcn_size ; spinlock_t curr_bcn_buf_lock ; struct wireless_dev wdev ; struct mwifiex_chan_freq_power cfp ; char version_str[128U] ; struct dentry *dfs_dev_dir ; u16 current_key_index ; struct semaphore async_sem ; struct cfg80211_scan_request *scan_request ; u8 cfg_bssid[6U] ; struct wps wps ; u8 scan_block ; s32 cqm_rssi_thold ; u32 cqm_rssi_hyst ; u8 subsc_evt_rssi_state ; struct mwifiex_ds_misc_subsc_evt async_subsc_evt_storage ; struct mwifiex_ie mgmt_ie[16U] ; u16 beacon_idx ; u16 proberesp_idx ; u16 assocresp_idx ; u16 gen_idx ; u8 ap_11n_enabled ; u8 ap_11ac_enabled ; u32 mgmt_frame_mask ; struct mwifiex_roc_cfg roc_cfg ; bool scan_aborting ; u8 csa_chan ; unsigned long csa_expire_time ; u8 del_list_idx ; bool hs2_enabled ; struct mwifiex_uap_bss_param bss_cfg ; struct cfg80211_chan_def bss_chandef ; struct station_parameters *sta_params ; struct sk_buff_head tdls_txq ; u8 check_tdls_tx ; struct timer_list auto_tdls_timer ; bool auto_tdls_timer_active ; struct idr ack_status_frames ; spinlock_t ack_status_lock ; struct mwifiex_histogram_data *hist_data ; struct cfg80211_chan_def dfs_chandef ; struct workqueue_struct *dfs_cac_workqueue ; struct delayed_work dfs_cac_work ; struct timer_list dfs_chan_switch_timer ; struct workqueue_struct *dfs_chan_sw_workqueue ; struct delayed_work dfs_chan_sw_work ; struct cfg80211_beacon_data beacon_after ; struct mwifiex_11h_intf_state state_11h ; struct mwifiex_ds_mem_rw mem_rw ; }; struct mwifiex_bss_prio_node { struct list_head list ; struct mwifiex_private *priv ; }; struct mwifiex_bss_prio_tbl { struct list_head bss_prio_head ; spinlock_t bss_prio_lock ; struct mwifiex_bss_prio_node *bss_prio_cur ; }; struct cmd_ctrl_node { struct list_head list ; struct mwifiex_private *priv ; u32 cmd_oid ; u32 cmd_flag ; struct sk_buff *cmd_skb ; struct sk_buff *resp_skb ; void *data_buf ; u32 wait_q_enabled ; struct sk_buff *skb ; u8 *condition ; u8 cmd_wait_q_woken ; }; struct mwifiex_if_ops { int (*init_if)(struct mwifiex_adapter * ) ; void (*cleanup_if)(struct mwifiex_adapter * ) ; int (*check_fw_status)(struct mwifiex_adapter * , u32 ) ; int (*prog_fw)(struct mwifiex_adapter * , struct mwifiex_fw_image * ) ; int (*register_dev)(struct mwifiex_adapter * ) ; void (*unregister_dev)(struct mwifiex_adapter * ) ; int (*enable_int)(struct mwifiex_adapter * ) ; void (*disable_int)(struct mwifiex_adapter * ) ; int (*process_int_status)(struct mwifiex_adapter * ) ; int (*host_to_card)(struct mwifiex_adapter * , u8 , struct sk_buff * , struct mwifiex_tx_param * ) ; int (*wakeup)(struct mwifiex_adapter * ) ; int (*wakeup_complete)(struct mwifiex_adapter * ) ; void (*update_mp_end_port)(struct mwifiex_adapter * , u16 ) ; void (*cleanup_mpa_buf)(struct mwifiex_adapter * ) ; int (*cmdrsp_complete)(struct mwifiex_adapter * , struct sk_buff * ) ; int (*event_complete)(struct mwifiex_adapter * , struct sk_buff * ) ; int (*init_fw_port)(struct mwifiex_adapter * ) ; int (*dnld_fw)(struct mwifiex_adapter * , struct mwifiex_fw_image * ) ; void (*card_reset)(struct mwifiex_adapter * ) ; int (*reg_dump)(struct mwifiex_adapter * , char * ) ; void (*device_dump)(struct mwifiex_adapter * ) ; int (*clean_pcie_ring)(struct mwifiex_adapter * ) ; void (*iface_work)(struct work_struct * ) ; void (*submit_rem_rx_urbs)(struct mwifiex_adapter * ) ; void (*deaggr_pkt)(struct mwifiex_adapter * , struct sk_buff * ) ; }; struct mwifiex_adapter { u8 iface_type ; unsigned int debug_mask ; struct mwifiex_iface_comb iface_limit ; struct mwifiex_iface_comb curr_iface_comb ; struct mwifiex_private *priv[3U] ; u8 priv_num ; struct firmware const *firmware ; char fw_name[32U] ; int winner ; struct device *dev ; struct wiphy *wiphy ; u8 perm_addr[6U] ; bool surprise_removed ; u32 fw_release_number ; u16 init_wait_q_woken ; wait_queue_head_t init_wait_q ; void *card ; struct mwifiex_if_ops if_ops ; atomic_t rx_pending ; atomic_t tx_pending ; atomic_t cmd_pending ; struct workqueue_struct *workqueue ; struct work_struct main_work ; struct workqueue_struct *rx_workqueue ; struct work_struct rx_work ; struct workqueue_struct *dfs_workqueue ; struct work_struct dfs_work ; bool rx_work_enabled ; bool rx_processing ; bool delay_main_work ; bool rx_locked ; bool main_locked ; struct mwifiex_bss_prio_tbl bss_prio_tbl[3U] ; spinlock_t mwifiex_lock ; spinlock_t main_proc_lock ; u32 mwifiex_processing ; u8 more_task_flag ; u16 tx_buf_size ; u16 curr_tx_buf_size ; bool sdio_rx_aggr_enable ; u16 sdio_rx_block_size ; u32 ioport ; enum MWIFIEX_HARDWARE_STATUS hw_status ; u16 number_of_antenna ; u32 fw_cap_info ; spinlock_t int_lock ; u8 int_status ; u32 event_cause ; struct sk_buff *event_skb ; u8 upld_buf[2312U] ; u8 data_sent ; u8 cmd_sent ; u8 cmd_resp_received ; u8 event_received ; u8 data_received ; u16 seq_num ; struct cmd_ctrl_node *cmd_pool ; struct cmd_ctrl_node *curr_cmd ; spinlock_t mwifiex_cmd_lock ; u8 is_cmd_timedout ; u16 last_init_cmd ; struct timer_list cmd_timer ; struct list_head cmd_free_q ; spinlock_t cmd_free_q_lock ; struct list_head cmd_pending_q ; spinlock_t cmd_pending_q_lock ; struct list_head scan_pending_q ; spinlock_t scan_pending_q_lock ; spinlock_t rx_proc_lock ; struct sk_buff_head tx_data_q ; atomic_t tx_queued ; u32 scan_processing ; u16 region_code ; struct mwifiex_802_11d_domain_reg domain_reg ; u16 scan_probes ; u32 scan_mode ; u16 specific_scan_time ; u16 active_scan_time ; u16 passive_scan_time ; u16 scan_chan_gap_time ; u8 fw_bands ; u8 adhoc_start_band ; u8 config_bands ; struct mwifiex_chan_scan_param_set *scan_channels ; u8 tx_lock_flag ; struct mwifiex_sleep_params sleep_params ; struct mwifiex_sleep_period sleep_period ; u16 ps_mode ; u32 ps_state ; u8 need_to_wakeup ; u16 multiple_dtim ; u16 local_listen_interval ; u16 null_pkt_interval ; struct sk_buff *sleep_cfm ; u16 bcn_miss_time_out ; u16 adhoc_awake_period ; u8 is_deep_sleep ; u8 delay_null_pkt ; u16 delay_to_ps ; u16 enhanced_ps_mode ; u8 pm_wakeup_card_req ; u16 gen_null_pkt ; u16 pps_uapsd_mode ; u32 pm_wakeup_fw_try ; struct timer_list wakeup_timer ; u8 is_hs_configured ; struct mwifiex_hs_config_param hs_cfg ; u8 hs_activated ; u16 hs_activate_wait_q_woken ; wait_queue_head_t hs_activate_wait_q ; bool is_suspended ; bool hs_enabling ; u8 event_body[2048U] ; u32 hw_dot_11n_dev_cap ; u8 hw_dev_mcs_support ; u8 user_dev_mcs_support ; u8 adhoc_11n_enabled ; u8 sec_chan_offset ; struct mwifiex_dbg dbg ; u8 arp_filter[68U] ; u32 arp_filter_size ; struct mwifiex_wait_queue cmd_wait_q ; u8 scan_wait_q_woken ; spinlock_t queue_lock ; u8 country_code[3U] ; u16 max_mgmt_ie_index ; struct firmware const *cal_data ; struct device_node *dt_node ; u32 is_hw_11ac_capable ; u32 hw_dot_11ac_dev_cap ; u32 hw_dot_11ac_mcs_support ; u32 usr_dot_11ac_dev_cap_bg ; u32 usr_dot_11ac_dev_cap_a ; u32 usr_dot_11ac_mcs_support ; atomic_t pending_bridged_pkts ; struct semaphore *card_sem ; bool ext_scan ; u8 fw_api_ver ; u8 key_api_major_ver ; u8 key_api_minor_ver ; struct memory_type_mapping *mem_type_mapping_tbl ; u8 num_mem_types ; void *drv_info_dump ; u32 drv_info_size ; bool scan_chan_gap_enabled ; struct sk_buff_head rx_data_q ; struct mwifiex_chan_stats *chan_stats ; u32 num_in_chan_stats ; int survey_idx ; bool auto_tdls ; u8 coex_scan ; u8 coex_min_scan_time ; u8 coex_max_scan_time ; u8 coex_win_size ; u8 coex_tx_win_size ; u8 coex_rx_win_size ; }; typedef bool ldv_func_ret_type; typedef bool ldv_func_ret_type___0; typedef bool ldv_func_ret_type___1; typedef bool ldv_func_ret_type___2; typedef int ldv_func_ret_type___3; typedef int ldv_func_ret_type___4; typedef int ldv_func_ret_type___5; enum hrtimer_restart; struct mwifiex_opt_sleep_confirm { __le16 command ; __le16 size ; __le16 seq_num ; __le16 result ; __le16 action ; __le16 resp_ctrl ; }; enum hrtimer_restart; struct region_code_mapping { u8 code ; u8 region[3U] ; }; typedef __u16 uint16_t; enum hrtimer_restart; struct mwifiex_ds_hs_cfg { u32 is_invoke_hostcmd ; u32 conditions ; u32 gpio ; u32 gap ; }; struct mwifiex_ds_auto_ds { u16 auto_ds ; u16 idle_time ; }; union __anonunion_param_380 { u32 ps_mode ; struct mwifiex_ds_hs_cfg hs_cfg ; struct mwifiex_ds_auto_ds auto_deep_sleep ; u32 sleep_period ; }; struct mwifiex_ds_pm_cfg { union __anonunion_param_380 param ; }; struct mwifiex_ds_misc_cmd { u32 len ; u8 cmd[2048U] ; }; struct mwifiex_ie_types_header { __le16 type ; __le16 len ; }; struct mwifiex_ps_param { __le16 null_pkt_interval ; __le16 multiple_dtims ; __le16 bcn_miss_timeout ; __le16 local_listen_interval ; __le16 adhoc_wake_period ; __le16 mode ; __le16 delay_to_ps ; }; struct mwifiex_ie_types_auto_ds_param { struct mwifiex_ie_types_header header ; __le16 deep_sleep_timeout ; }; struct mwifiex_ie_types_ps_param { struct mwifiex_ie_types_header header ; struct mwifiex_ps_param param ; }; union __anonunion_params_385 { struct mwifiex_ps_param opt_ps ; __le16 ps_bitmap ; }; struct host_cmd_ds_802_11_ps_mode_enh { __le16 action ; union __anonunion_params_385 params ; }; struct hw_spec_api_rev { struct mwifiex_ie_types_header header ; __le16 api_id ; u8 major_ver ; u8 minor_ver ; }; struct host_cmd_ds_get_hw_spec { __le16 hw_if_version ; __le16 version ; __le16 reserved ; __le16 num_of_mcast_adr ; u8 permanent_addr[6U] ; __le16 region_code ; __le16 number_of_antenna ; __le32 fw_release_number ; __le32 reserved_1 ; __le32 reserved_2 ; __le32 reserved_3 ; __le32 fw_cap_info ; __le32 dot_11n_dev_cap ; u8 dev_mcs_support ; __le16 mp_end_port ; __le16 mgmt_buf_count ; __le32 reserved_5 ; __le32 reserved_6 ; __le32 dot_11ac_dev_cap ; __le32 dot_11ac_mcs_support ; u8 tlvs[0U] ; }; struct host_cmd_ds_802_11_rssi_info { __le16 action ; __le16 ndata ; __le16 nbcn ; __le16 reserved[9U] ; long long reserved_1 ; }; struct host_cmd_ds_802_11_rssi_info_rsp { __le16 action ; __le16 ndata ; __le16 nbcn ; __le16 data_rssi_last ; __le16 data_nf_last ; __le16 data_rssi_avg ; __le16 data_nf_avg ; __le16 bcn_rssi_last ; __le16 bcn_nf_last ; __le16 bcn_rssi_avg ; __le16 bcn_nf_avg ; long long tsf_bcn ; }; struct host_cmd_ds_802_11_mac_address { __le16 action ; u8 mac_addr[6U] ; }; struct host_cmd_ds_mac_control { __le16 action ; __le16 reserved ; }; struct host_cmd_ds_mac_multicast_adr { __le16 action ; __le16 num_of_adrs ; u8 mac_list[32U][6U] ; }; struct host_cmd_ds_802_11_deauthenticate { u8 mac_addr[6U] ; __le16 reason_code ; }; struct host_cmd_ds_802_11_associate { u8 peer_sta_addr[6U] ; __le16 cap_info_bitmap ; __le16 listen_interval ; __le16 beacon_period ; u8 dtim_period ; }; struct ieee_types_assoc_rsp { __le16 cap_info_bitmap ; __le16 status_code ; __le16 a_id ; u8 ie_buffer[1U] ; }; struct host_cmd_ds_802_11_associate_rsp { struct ieee_types_assoc_rsp assoc_rsp ; }; struct host_cmd_ds_802_11_ad_hoc_start { u8 ssid[32U] ; u8 bss_mode ; __le16 beacon_period ; u8 dtim_period ; union ieee_types_ss_param_set ss_param_set ; union ieee_types_phy_param_set phy_param_set ; u16 reserved1 ; __le16 cap_info_bitmap ; u8 data_rate[14U] ; }; struct host_cmd_ds_802_11_ad_hoc_result { u8 pad[3U] ; u8 bssid[6U] ; }; struct adhoc_bss_desc { u8 bssid[6U] ; u8 ssid[32U] ; u8 bss_mode ; __le16 beacon_period ; u8 dtim_period ; u8 time_stamp[8U] ; u8 local_time[8U] ; union ieee_types_phy_param_set phy_param_set ; union ieee_types_ss_param_set ss_param_set ; __le16 cap_info_bitmap ; u8 data_rates[14U] ; }; struct host_cmd_ds_802_11_ad_hoc_join { struct adhoc_bss_desc bss_descriptor ; u16 reserved1 ; u16 reserved2 ; }; struct host_cmd_ds_802_11_get_log { __le32 mcast_tx_frame ; __le32 failed ; __le32 retry ; __le32 multi_retry ; __le32 frame_dup ; __le32 rts_success ; __le32 rts_failure ; __le32 ack_failure ; __le32 rx_frag ; __le32 mcast_rx_frame ; __le32 fcs_error ; __le32 tx_frame ; __le32 reserved ; __le32 wep_icv_err_cnt[4U] ; __le32 bcn_rcv_cnt ; __le32 bcn_miss_cnt ; }; struct host_cmd_ds_tx_rate_query { u8 tx_rate ; u8 ht_info ; }; struct hs_activate_param { __le16 resp_ctrl ; }; union __anonunion_params_386 { struct mwifiex_hs_config_param hs_config ; struct hs_activate_param hs_activate ; }; struct host_cmd_ds_802_11_hs_cfg_enh { __le16 action ; union __anonunion_params_386 params ; }; struct host_cmd_ds_802_11_snmp_mib { __le16 query_type ; __le16 oid ; __le16 buf_size ; u8 value[1U] ; }; struct host_cmd_ds_tx_rate_cfg { __le16 action ; __le16 cfg_index ; }; struct host_cmd_ds_txpwr_cfg { __le16 action ; __le16 cfg_index ; __le32 mode ; }; struct host_cmd_ds_rf_tx_pwr { __le16 action ; __le16 cur_level ; u8 max_power ; u8 min_power ; }; struct host_cmd_ds_rf_ant_mimo { __le16 action_tx ; __le16 tx_ant_mode ; __le16 action_rx ; __le16 rx_ant_mode ; }; struct host_cmd_ds_rf_ant_siso { __le16 action ; __le16 ant_mode ; }; struct host_cmd_ds_tdls_oper { __le16 tdls_action ; __le16 reason ; u8 peer_mac[6U] ; }; struct mwifiex_chan_desc { __le16 start_freq ; u8 chan_width ; u8 chan_num ; }; struct host_cmd_ds_chan_rpt_req { struct mwifiex_chan_desc chan_desc ; __le32 msec_dwell_time ; }; struct host_cmd_sdio_sp_rx_aggr_cfg { u8 action ; u8 enable ; __le16 block_size ; }; struct host_cmd_ds_802_11_scan { u8 bss_mode ; u8 bssid[6U] ; u8 tlv_buffer[1U] ; }; struct host_cmd_ds_802_11_scan_rsp { __le16 bss_descript_size ; u8 number_of_sets ; u8 bss_desc_and_tlv_buffer[1U] ; }; struct host_cmd_ds_802_11_scan_ext { u32 reserved ; u8 tlv_buffer[1U] ; }; struct host_cmd_ds_802_11_bg_scan_query { u8 flush ; }; struct host_cmd_ds_802_11_bg_scan_query_rsp { __le32 report_condition ; struct host_cmd_ds_802_11_scan_rsp scan_resp ; }; struct mwifiex_ietypes_domain_param_set { struct mwifiex_ie_types_header header ; u8 country_code[3U] ; struct ieee80211_country_ie_triplet triplet[1U] ; }; struct host_cmd_ds_802_11d_domain_info { __le16 action ; struct mwifiex_ietypes_domain_param_set domain ; }; struct host_cmd_ds_802_11d_domain_info_rsp { __le16 action ; struct mwifiex_ietypes_domain_param_set domain ; }; struct host_cmd_ds_11n_addba_req { u8 add_req_result ; u8 peer_mac_addr[6U] ; u8 dialog_token ; __le16 block_ack_param_set ; __le16 block_ack_tmo ; __le16 ssn ; }; struct host_cmd_ds_11n_addba_rsp { u8 add_rsp_result ; u8 peer_mac_addr[6U] ; u8 dialog_token ; __le16 status_code ; __le16 block_ack_param_set ; __le16 block_ack_tmo ; __le16 ssn ; }; struct host_cmd_ds_11n_delba { u8 del_result ; u8 peer_mac_addr[6U] ; __le16 del_ba_param_set ; __le16 reason_code ; u8 reserved ; }; struct host_cmd_ds_11n_cfg { __le16 action ; __le16 ht_tx_cap ; __le16 ht_tx_info ; __le16 misc_config ; }; struct host_cmd_ds_txbuf_cfg { __le16 action ; __le16 buff_size ; __le16 mp_end_port ; __le16 reserved3 ; }; struct host_cmd_ds_amsdu_aggr_ctrl { __le16 action ; __le16 enable ; __le16 curr_buf_size ; }; struct host_cmd_ds_sta_deauth { u8 mac[6U] ; __le16 reason ; }; struct host_cmd_ds_sta_list { u16 sta_count ; u8 tlv[0U] ; }; struct host_cmd_ds_wmm_get_status { u8 queue_status_tlv[64U] ; u8 wmm_param_tlv[28U] ; }; struct host_cmd_ds_mem_access { __le16 action ; __le16 reserved ; __le32 addr ; __le32 value ; }; struct host_cmd_ds_mac_reg_access { __le16 action ; __le16 offset ; __le32 value ; }; struct host_cmd_ds_bbp_reg_access { __le16 action ; __le16 offset ; u8 value ; u8 reserved[3U] ; }; struct host_cmd_ds_rf_reg_access { __le16 action ; __le16 offset ; u8 value ; u8 reserved[3U] ; }; struct host_cmd_ds_pmic_reg_access { __le16 action ; __le16 offset ; u8 value ; u8 reserved[3U] ; }; struct host_cmd_ds_802_11_eeprom_access { __le16 action ; __le16 offset ; __le16 byte_count ; u8 value ; }; struct host_cmd_ds_sys_config { __le16 action ; u8 tlv[0U] ; }; struct host_cmd_11ac_vht_cfg { __le16 action ; u8 band_config ; u8 misc_config ; __le32 cap_info ; __le32 mcs_tx_set ; __le32 mcs_rx_set ; }; struct host_cmd_ds_version_ext { u8 version_str_sel ; char version_str[128U] ; }; struct host_cmd_ds_mgmt_frame_reg { __le16 action ; __le32 mask ; }; struct host_cmd_ds_p2p_mode_cfg { __le16 action ; __le16 mode ; }; struct host_cmd_ds_remain_on_chan { __le16 action ; u8 status ; u8 reserved ; u8 band_cfg ; u8 channel ; __le32 duration ; }; struct host_cmd_ds_802_11_ibss_status { __le16 action ; __le16 enable ; u8 bssid[6U] ; __le16 beacon_interval ; __le16 atim_window ; __le16 use_g_rate_protect ; }; struct mwifiex_fw_mef_entry { u8 mode ; u8 action ; __le16 exprsize ; u8 expr[0U] ; }; struct host_cmd_ds_mef_cfg { __le32 criteria ; __le16 num_entries ; struct mwifiex_fw_mef_entry mef_entry[0U] ; }; struct host_cmd_ds_set_bss_mode { u8 con_type ; }; struct host_cmd_ds_pcie_details { u32 txbd_addr_lo ; u32 txbd_addr_hi ; u32 txbd_count ; u32 rxbd_addr_lo ; u32 rxbd_addr_hi ; u32 rxbd_count ; u32 evtbd_addr_lo ; u32 evtbd_addr_hi ; u32 evtbd_count ; u32 sleep_cookie_addr_lo ; u32 sleep_cookie_addr_hi ; }; struct host_cmd_ds_802_11_subsc_evt { __le16 action ; __le16 events ; }; struct coalesce_filt_field_param { u8 operation ; u8 operand_len ; __le16 offset ; u8 operand_byte_stream[4U] ; }; struct coalesce_receive_filt_rule { struct mwifiex_ie_types_header header ; u8 num_of_fields ; u8 pkt_type ; __le16 max_coalescing_delay ; struct coalesce_filt_field_param params[0U] ; }; struct host_cmd_ds_coalesce_cfg { __le16 action ; __le16 num_of_rules ; struct coalesce_receive_filt_rule rule[0U] ; }; union __anonunion_params_388 { struct host_cmd_ds_get_hw_spec hw_spec ; struct host_cmd_ds_mac_control mac_ctrl ; struct host_cmd_ds_802_11_mac_address mac_addr ; struct host_cmd_ds_mac_multicast_adr mc_addr ; struct host_cmd_ds_802_11_get_log get_log ; struct host_cmd_ds_802_11_rssi_info rssi_info ; struct host_cmd_ds_802_11_rssi_info_rsp rssi_info_rsp ; struct host_cmd_ds_802_11_snmp_mib smib ; struct host_cmd_ds_tx_rate_query tx_rate ; struct host_cmd_ds_tx_rate_cfg tx_rate_cfg ; struct host_cmd_ds_txpwr_cfg txp_cfg ; struct host_cmd_ds_rf_tx_pwr txp ; struct host_cmd_ds_rf_ant_mimo ant_mimo ; struct host_cmd_ds_rf_ant_siso ant_siso ; struct host_cmd_ds_802_11_ps_mode_enh psmode_enh ; struct host_cmd_ds_802_11_hs_cfg_enh opt_hs_cfg ; struct host_cmd_ds_802_11_scan scan ; struct host_cmd_ds_802_11_scan_ext ext_scan ; struct host_cmd_ds_802_11_scan_rsp scan_resp ; struct host_cmd_ds_802_11_bg_scan_query bg_scan_query ; struct host_cmd_ds_802_11_bg_scan_query_rsp bg_scan_query_resp ; struct host_cmd_ds_802_11_associate associate ; struct host_cmd_ds_802_11_associate_rsp associate_rsp ; struct host_cmd_ds_802_11_deauthenticate deauth ; struct host_cmd_ds_802_11_ad_hoc_start adhoc_start ; struct host_cmd_ds_802_11_ad_hoc_result adhoc_result ; struct host_cmd_ds_802_11_ad_hoc_join adhoc_join ; struct host_cmd_ds_802_11d_domain_info domain_info ; struct host_cmd_ds_802_11d_domain_info_rsp domain_info_resp ; struct host_cmd_ds_11n_addba_req add_ba_req ; struct host_cmd_ds_11n_addba_rsp add_ba_rsp ; struct host_cmd_ds_11n_delba del_ba ; struct host_cmd_ds_txbuf_cfg tx_buf ; struct host_cmd_ds_amsdu_aggr_ctrl amsdu_aggr_ctrl ; struct host_cmd_ds_11n_cfg htcfg ; struct host_cmd_ds_wmm_get_status get_wmm_status ; struct host_cmd_ds_802_11_key_material key_material ; struct host_cmd_ds_802_11_key_material_v2 key_material_v2 ; struct host_cmd_ds_version_ext verext ; struct host_cmd_ds_mgmt_frame_reg reg_mask ; struct host_cmd_ds_remain_on_chan roc_cfg ; struct host_cmd_ds_p2p_mode_cfg mode_cfg ; struct host_cmd_ds_802_11_ibss_status ibss_coalescing ; struct host_cmd_ds_mef_cfg mef_cfg ; struct host_cmd_ds_mem_access mem ; struct host_cmd_ds_mac_reg_access mac_reg ; struct host_cmd_ds_bbp_reg_access bbp_reg ; struct host_cmd_ds_rf_reg_access rf_reg ; struct host_cmd_ds_pmic_reg_access pmic_reg ; struct host_cmd_ds_set_bss_mode bss_mode ; struct host_cmd_ds_pcie_details pcie_host_spec ; struct host_cmd_ds_802_11_eeprom_access eeprom ; struct host_cmd_ds_802_11_subsc_evt subsc_evt ; struct host_cmd_ds_sys_config uap_sys_config ; struct host_cmd_ds_sta_deauth sta_deauth ; struct host_cmd_ds_sta_list sta_list ; struct host_cmd_11ac_vht_cfg vht_cfg ; struct host_cmd_ds_coalesce_cfg coalesce_cfg ; struct host_cmd_ds_tdls_oper tdls_oper ; struct host_cmd_ds_chan_rpt_req chan_rpt_req ; struct host_cmd_sdio_sp_rx_aggr_cfg sdio_rx_aggr_cfg ; }; struct host_cmd_ds_command { __le16 command ; __le16 size ; __le16 seq_num ; __le16 result ; union __anonunion_params_388 params ; }; enum hrtimer_restart; struct ieee80211_hdr { __le16 frame_control ; __le16 duration_id ; u8 addr1[6U] ; u8 addr2[6U] ; u8 addr3[6U] ; __le16 seq_ctrl ; u8 addr4[6U] ; }; struct mwifiex_debug_data { char name[32U] ; u32 size ; size_t addr ; int num ; }; struct rxpd { u8 bss_type ; u8 bss_num ; __le16 rx_pkt_length ; __le16 rx_pkt_offset ; __le16 rx_pkt_type ; __le16 seq_num ; u8 priority ; u8 rx_rate ; s8 snr ; s8 nf ; u8 ht_info ; u8 reserved[3U] ; u8 flags ; }; struct ieee_types_extcap { struct ieee_types_header ieee_hdr ; u8 ext_capab[8U] ; }; struct mwifiex_tdls_capab { __le16 capab ; u8 rates[32U] ; u8 rates_len ; u8 qos_info ; u8 coex_2040 ; u16 aid ; struct ieee80211_ht_cap ht_capb ; struct ieee80211_ht_operation ht_oper ; struct ieee_types_extcap extcap ; struct ieee_types_generic rsn_ie ; struct ieee80211_vht_cap vhtcap ; struct ieee80211_vht_operation vhtoper ; }; struct mwifiex_station_stats { u64 last_rx ; s8 rssi ; u64 rx_bytes ; u64 tx_bytes ; u32 rx_packets ; u32 tx_packets ; u32 tx_failed ; u8 last_tx_rate ; u8 last_tx_htinfo ; }; struct mwifiex_sta_node { struct list_head list ; u8 mac_addr[6U] ; u8 is_wmm_enabled ; u8 is_11n_enabled ; u8 is_11ac_enabled ; u8 ampdu_sta[8U] ; u16 rx_seq[8U] ; u16 max_amsdu ; u8 tdls_status ; struct mwifiex_tdls_capab tdls_cap ; struct mwifiex_station_stats stats ; }; enum hrtimer_restart; union __anonunion___u_168 { struct idr_layer *__val ; char __c[1U] ; }; union __anonunion___u_170 { struct idr_layer *__val ; char __c[1U] ; }; struct txpd { u8 bss_type ; u8 bss_num ; __le16 tx_pkt_length ; __le16 tx_pkt_offset ; __le16 tx_pkt_type ; __le32 tx_control ; u8 priority ; u8 flags ; u8 pkt_delay_2ms ; u8 reserved1[2U] ; u8 tx_token_id ; u8 reserved[2U] ; }; struct tx_status_event { u8 packet_type ; u8 tx_token_id ; u8 status ; }; typedef __kernel_long_t __kernel_suseconds_t; struct timeval { __kernel_time_t tv_sec ; __kernel_suseconds_t tv_usec ; }; enum hrtimer_restart; struct mwifiex_ie_types_data { struct mwifiex_ie_types_header header ; u8 data[1U] ; }; struct mwifiex_ie_types_wmm_param_set { struct mwifiex_ie_types_header header ; u8 wmm_ie[1U] ; }; struct mwifiex_ie_types_wmm_queue_status { struct mwifiex_ie_types_header header ; u8 queue_index ; u8 disabled ; __le16 medium_time ; u8 flow_required ; u8 flow_created ; u32 reserved ; }; enum mwifiex_ba_status { BA_SETUP_NONE = 0, BA_SETUP_INPROGRESS = 1, BA_SETUP_COMPLETE = 2 } ; struct mwifiex_ra_list_tbl { struct list_head list ; struct sk_buff_head skb_head ; u8 ra[6U] ; u32 is_11n_enabled ; u16 max_amsdu ; u16 ba_pkt_count ; u8 ba_packet_thr ; enum mwifiex_ba_status ba_status ; u8 amsdu_in_ampdu ; u16 total_pkt_count ; bool tdls_link ; }; struct mwifiex_tx_ba_stream_tbl { struct list_head list ; int tid ; u8 ra[6U] ; enum mwifiex_ba_status ba_status ; u8 amsdu ; }; enum hrtimer_restart; struct mwifiex_ds_11n_tx_cfg { u16 tx_htcap ; u16 tx_htinfo ; u16 misc_config ; }; struct mwifiex_ds_11n_amsdu_aggr_ctrl { u16 enable ; u16 curr_buf_size ; }; struct mwifiex_ie_types_chan_list_param_set { struct mwifiex_ie_types_header header ; struct mwifiex_chan_scan_param_set chan_scan_param[1U] ; }; struct mwifiex_ie_types_htcap { struct mwifiex_ie_types_header header ; struct ieee80211_ht_cap ht_cap ; }; struct mwifiex_ie_types_htinfo { struct mwifiex_ie_types_header header ; struct ieee80211_ht_operation ht_oper ; }; struct mwifiex_ie_types_2040bssco { struct mwifiex_ie_types_header header ; u8 bss_co_2040 ; }; struct mwifiex_ie_types_extcap { struct mwifiex_ie_types_header header ; u8 ext_capab[0U] ; }; struct mwifiex_rx_reorder_tbl; struct reorder_tmr_cnxt { struct timer_list timer ; struct mwifiex_rx_reorder_tbl *ptr ; struct mwifiex_private *priv ; u8 timer_is_set ; }; struct mwifiex_rx_reorder_tbl { struct list_head list ; int tid ; u8 ta[6U] ; int init_win ; int start_win ; int win_size ; void **rx_reorder_ptr ; struct reorder_tmr_cnxt timer_context ; u8 amsdu ; u8 flags ; }; enum hrtimer_restart; struct mwifiex_11ac_vht_cfg { u8 band_config ; u8 misc_config ; u32 cap_info ; u32 mcs_tx_set ; u32 mcs_rx_set ; }; struct mwifiex_ie_types_vhtcap { struct mwifiex_ie_types_header header ; struct ieee80211_vht_cap vht_cap ; }; struct mwifiex_ie_types_oper_mode_ntf { struct mwifiex_ie_types_header header ; u8 oper_mode ; }; struct mwifiex_ie_types_vht_oper { struct mwifiex_ie_types_header header ; u8 chan_width ; u8 chan_center_freq_1 ; u8 chan_center_freq_2 ; __le16 basic_mcs_map ; }; enum hrtimer_restart; struct rfc_1042_hdr { u8 llc_dsap ; u8 llc_ssap ; u8 llc_ctrl ; u8 snap_oui[3U] ; __be16 snap_type ; }; struct tx_packet_hdr { struct ethhdr eth803_hdr ; struct rfc_1042_hdr rfc1042_hdr ; }; enum hrtimer_restart; struct host_cmd_ds_11n_batimeout { u8 tid ; u8 peer_mac_addr[6U] ; u8 origninator ; }; typedef __u64 __le64; enum hrtimer_restart; struct cfg80211_bss_ies { u64 tsf ; struct callback_head callback_head ; int len ; bool from_beacon ; u8 data[] ; }; struct cfg80211_bss { struct ieee80211_channel *channel ; enum nl80211_bss_scan_width scan_width ; struct cfg80211_bss_ies const *ies ; struct cfg80211_bss_ies const *beacon_ies ; struct cfg80211_bss_ies const *proberesp_ies ; struct cfg80211_bss *hidden_beacon_bss ; s32 signal ; u16 beacon_interval ; u16 capability ; u8 bssid[6U] ; u8 priv[0U] ; }; enum cfg80211_bss_frame_type { CFG80211_BSS_FTYPE_UNKNOWN = 0, CFG80211_BSS_FTYPE_BEACON = 1, CFG80211_BSS_FTYPE_PRESP = 2 } ; struct mwifiex_fw_chan_stats { u8 chan_num ; u8 bandcfg ; u8 flags ; s8 noise ; __le16 total_bss ; __le16 cca_scan_dur ; __le16 cca_busy_dur ; }; struct chan_band_param_set { u8 radio_type ; u8 chan_number ; }; struct mwifiex_ie_types_chan_band_list_param_set { struct mwifiex_ie_types_header header ; struct chan_band_param_set chan_band_param[1U] ; }; struct mwifiex_ie_types_rates_param_set { struct mwifiex_ie_types_header header ; u8 rates[1U] ; }; struct mwifiex_ie_types_num_probes { struct mwifiex_ie_types_header header ; __le16 num_probes ; }; struct mwifiex_ie_types_scan_chan_gap { struct mwifiex_ie_types_header header ; __le16 chan_gap ; }; struct mwifiex_ietypes_chanstats { struct mwifiex_ie_types_header header ; struct mwifiex_fw_chan_stats chanstats[0U] ; }; struct mwifiex_ie_types_wildcard_ssid_params { struct mwifiex_ie_types_header header ; u8 max_ssid_length ; u8 ssid[1U] ; }; struct mwifiex_ie_types_tsf_timestamp { struct mwifiex_ie_types_header header ; u8 tsf_data[1U] ; }; struct mwifiex_ie_types_vendor_param_set { struct mwifiex_ie_types_header header ; u8 ie[256U] ; }; struct mwifiex_fixed_bcn_param { __le64 timestamp ; __le16 beacon_period ; __le16 cap_info_bitmap ; }; struct mwifiex_event_scan_result { __le16 event_id ; u8 bss_index ; u8 bss_type ; u8 more_event ; u8 reserved[3U] ; __le16 buf_size ; u8 num_of_set ; }; struct mwifiex_scan_cmd_config { u8 bss_mode ; u8 specific_bssid[6U] ; u32 tlv_buf_len ; u8 tlv_buf[1U] ; }; struct mwifiex_user_scan_chan { u8 chan_number ; u8 radio_type ; u8 scan_type ; u8 reserved ; u32 scan_time ; }; struct mwifiex_user_scan_cfg { u8 bss_mode ; u8 num_probes ; u8 reserved ; u8 specific_bssid[6U] ; struct cfg80211_ssid *ssid_list ; u8 num_ssids ; struct mwifiex_user_scan_chan chan_list[50U] ; u16 scan_chan_gap ; }; struct ie_body { u8 grp_key_oui[4U] ; u8 ptk_cnt[2U] ; u8 ptk_body[4U] ; }; struct mwifiex_ie_types_bss_scan_rsp { struct mwifiex_ie_types_header header ; u8 bssid[6U] ; u8 frame_body[1U] ; }; struct mwifiex_ie_types_bss_scan_info { struct mwifiex_ie_types_header header ; __le16 rssi ; __le16 anpi ; u8 cca_busy_fraction ; u8 radio_type ; u8 channel ; u8 reserved ; __le64 tsf ; }; struct mwifiex_ie_types_bssid_list { struct mwifiex_ie_types_header header ; u8 bssid[6U] ; }; struct mwifiex_bss_priv { u8 band ; u64 fw_tsf ; }; union mwifiex_scan_cmd_config_tlv { struct mwifiex_scan_cmd_config config ; u8 config_alloc_buf[549U] ; }; enum hrtimer_restart; struct mwifiex_ie_types_ssid_param_set { struct mwifiex_ie_types_header header ; u8 ssid[1U] ; }; struct mwifiex_cf_param_set { u8 cfp_cnt ; u8 cfp_period ; __le16 cfp_max_duration ; __le16 cfp_duration_remaining ; }; struct mwifiex_ibss_param_set { __le16 atim_window ; }; union __anonunion_cf_ibss_382 { struct mwifiex_cf_param_set cf_param_set[1U] ; struct mwifiex_ibss_param_set ibss_param_set[1U] ; }; struct mwifiex_ie_types_ss_param_set { struct mwifiex_ie_types_header header ; union __anonunion_cf_ibss_382 cf_ibss ; }; struct mwifiex_fh_param_set { __le16 dwell_time ; u8 hop_set ; u8 hop_pattern ; u8 hop_index ; }; struct mwifiex_ds_param_set { u8 current_chan ; }; union __anonunion_fh_ds_383 { struct mwifiex_fh_param_set fh_param_set[1U] ; struct mwifiex_ds_param_set ds_param_set[1U] ; }; struct mwifiex_ie_types_phy_param_set { struct mwifiex_ie_types_header header ; union __anonunion_fh_ds_383 fh_ds ; }; struct mwifiex_ie_types_auth_type { struct mwifiex_ie_types_header header ; __le16 auth_type ; }; struct mwifiex_ie_types_rsn_param_set { struct mwifiex_ie_types_header header ; u8 rsn_ie[1U] ; }; typedef int pao_T__; typedef int pao_T_____0; enum hrtimer_restart; struct netdev_hw_addr { struct list_head list ; unsigned char addr[32U] ; unsigned char type ; bool global_use ; int sync_cnt ; int refcount ; int synced ; struct callback_head callback_head ; }; enum nl80211_channel_type { NL80211_CHAN_NO_HT = 0, NL80211_CHAN_HT20 = 1, NL80211_CHAN_HT40MINUS = 2, NL80211_CHAN_HT40PLUS = 3 } ; struct key_params { u8 const *key ; u8 const *seq ; int key_len ; int seq_len ; u32 cipher ; }; struct mwifiex_ds_get_stats { u32 mcast_tx_frame ; u32 failed ; u32 retry ; u32 multi_retry ; u32 frame_dup ; u32 rts_success ; u32 rts_failure ; u32 ack_failure ; u32 rx_frag ; u32 mcast_rx_frame ; u32 fcs_error ; u32 tx_frame ; u32 wep_icv_error[4U] ; u32 bcn_rcv_cnt ; u32 bcn_miss_cnt ; }; struct mwifiex_ver_ext { u32 version_str_sel ; char version_str[128U] ; }; struct mwifiex_bss_info { u32 bss_mode ; struct cfg80211_ssid ssid ; u32 bss_chan ; u8 country_code[3U] ; u32 media_connected ; u32 max_power_level ; u32 min_power_level ; u32 adhoc_state ; int bcn_nf_last ; u32 wep_status ; u32 is_hs_configured ; u32 is_deep_sleep ; u8 bssid[6U] ; }; struct mwifiex_ds_encrypt_key { u32 key_disable ; u32 key_index ; u32 key_len ; u8 key_material[32U] ; u8 mac_addr[6U] ; u32 is_wapi_key ; u8 pn[16U] ; u8 pn_len ; u8 is_igtk_key ; u8 is_current_wep_key ; u8 is_rx_seq_valid ; }; struct mwifiex_power_cfg { u32 is_power_auto ; u32 power_level ; }; struct mwifiex_ds_reg_rw { __le32 type ; __le32 offset ; __le32 value ; }; struct mwifiex_ds_read_eeprom { __le16 offset ; __le16 byte_count ; u8 value[256U] ; }; struct mwifiex_ds_misc_gen_ie { u32 type ; u32 len ; u8 ie_data[256U] ; }; struct mwifiex_power_group { u8 modulation_class ; u8 first_rate_code ; u8 last_rate_code ; s8 power_step ; s8 power_min ; s8 power_max ; u8 ht_bandwidth ; u8 reserved ; }; struct mwifiex_types_power_group { __le16 type ; __le16 length ; }; union __anonunion___u_435 { struct cfg80211_bss_ies const *__val ; char __c[1U] ; }; union __anonunion_ver_437 { __le32 l ; u8 c[4U] ; }; 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_dev; struct pci_bus; struct pci_device_id { __u32 vendor ; __u32 device ; __u32 subvendor ; __u32 subdevice ; __u32 class ; __u32 class_mask ; kernel_ulong_t driver_data ; }; struct mwifiex_ds_ant_cfg { u32 tx_ant ; u32 rx_ant ; }; struct mwifiex_mef_filter { u16 repeat ; u16 offset ; s8 byte_seq[7U] ; u8 filt_type ; u8 filt_action ; }; struct mwifiex_mef_entry { u8 mode ; u8 action ; struct mwifiex_mef_filter filter[10U] ; }; struct mwifiex_ds_mef_cfg { u32 criteria ; u16 num_entries ; struct mwifiex_mef_entry *mef_entry ; }; struct filt_field_param { u8 operation ; u8 operand_len ; u16 offset ; u8 operand_byte_stream[4U] ; }; struct mwifiex_coalesce_rule { u16 max_coalescing_delay ; u8 num_of_fields ; u8 pkt_type ; struct filt_field_param params[4U] ; }; struct mwifiex_ds_coalesce_cfg { u16 num_of_rules ; struct mwifiex_coalesce_rule rule[8U] ; }; struct mwifiex_ds_tdls_oper { u16 tdls_action ; u8 peer_mac[6U] ; u16 capability ; u8 qos_info ; u8 *ext_capab ; u8 ext_capab_len ; u8 *supp_rates ; u8 supp_rates_len ; u8 *ht_capab ; }; struct mwifiex_ie_types_tdls_idle_timeout { struct mwifiex_ie_types_header header ; __le16 value ; }; struct mwifiex_cmac_param { u8 ipn[8U] ; u8 key[16U] ; }; struct mwifiex_rate_scope { __le16 type ; __le16 length ; __le16 hr_dsss_rate_bitmap ; __le16 ofdm_rate_bitmap ; __le16 ht_mcs_rate_bitmap[8U] ; __le16 vht_mcs_rate_bitmap[8U] ; }; struct mwifiex_rate_drop_pattern { __le16 type ; __le16 length ; __le32 rate_drop_mode ; }; struct mwifiex_ie_types_aid { struct mwifiex_ie_types_header header ; __le16 aid ; }; struct mwifiex_ie_types_qos_info { struct mwifiex_ie_types_header header ; u8 qos_info ; }; struct host_cmd_tlv_rates { struct mwifiex_ie_types_header header ; u8 rates[0U] ; }; struct host_cmd_tlv_mac_addr { struct mwifiex_ie_types_header header ; u8 mac_addr[6U] ; }; struct mwifiex_ie_types_rssi_threshold { struct mwifiex_ie_types_header header ; u8 abs_value ; u8 evt_freq ; }; 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_433 { 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_433 __annonCompField115 ; struct pci_ats *ats ; phys_addr_t rom ; size_t romlen ; char *driver_override ; }; struct pci_ops; struct msi_controller; struct pci_bus { struct list_head node ; struct pci_bus *parent ; struct list_head children ; struct list_head devices ; struct pci_dev *self ; struct list_head slots ; struct resource *resource[4U] ; struct list_head resources ; struct resource busn_res ; struct pci_ops *ops ; struct msi_controller *msi ; void *sysdata ; struct proc_dir_entry *procdir ; unsigned char number ; unsigned char primary ; unsigned char max_bus_speed ; unsigned char cur_bus_speed ; char name[48U] ; unsigned short bridge_ctl ; pci_bus_flags_t bus_flags ; struct device *bridge ; struct device dev ; struct bin_attribute *legacy_io ; struct bin_attribute *legacy_mem ; unsigned char is_added : 1 ; }; struct pci_ops { void *(*map_bus)(struct pci_bus * , unsigned int , int ) ; int (*read)(struct pci_bus * , unsigned int , int , int , u32 * ) ; int (*write)(struct pci_bus * , unsigned int , int , int , u32 ) ; }; struct pci_dynids { spinlock_t lock ; struct list_head list ; }; typedef unsigned int pci_ers_result_t; struct pci_error_handlers { pci_ers_result_t (*error_detected)(struct pci_dev * , enum pci_channel_state ) ; pci_ers_result_t (*mmio_enabled)(struct pci_dev * ) ; pci_ers_result_t (*link_reset)(struct pci_dev * ) ; pci_ers_result_t (*slot_reset)(struct pci_dev * ) ; void (*reset_notify)(struct pci_dev * , bool ) ; void (*resume)(struct pci_dev * ) ; }; struct pci_driver { struct list_head node ; char const *name ; struct pci_device_id const *id_table ; int (*probe)(struct pci_dev * , struct pci_device_id const * ) ; void (*remove)(struct pci_dev * ) ; int (*suspend)(struct pci_dev * , pm_message_t ) ; int (*suspend_late)(struct pci_dev * , pm_message_t ) ; int (*resume_early)(struct pci_dev * ) ; int (*resume)(struct pci_dev * ) ; void (*shutdown)(struct pci_dev * ) ; int (*sriov_configure)(struct pci_dev * , int ) ; struct pci_error_handlers const *err_handler ; struct device_driver driver ; struct pci_dynids dynids ; }; struct mwifiex_pcie_card_reg { u16 cmd_addr_lo ; u16 cmd_addr_hi ; u16 fw_status ; u16 cmd_size ; u16 cmdrsp_addr_lo ; u16 cmdrsp_addr_hi ; u16 tx_rdptr ; u16 tx_wrptr ; u16 rx_rdptr ; u16 rx_wrptr ; u16 evt_rdptr ; u16 evt_wrptr ; u16 drv_rdy ; u16 tx_start_ptr ; u32 tx_mask ; u32 tx_wrap_mask ; u32 rx_mask ; u32 rx_wrap_mask ; u32 tx_rollover_ind ; u32 rx_rollover_ind ; u32 evt_rollover_ind ; u8 ring_flag_sop ; u8 ring_flag_eop ; u8 ring_flag_xs_sop ; u8 ring_flag_xs_eop ; u32 ring_tx_start_ptr ; u8 pfu_enabled ; u8 sleep_cookie ; u16 fw_dump_ctrl ; u16 fw_dump_start ; u16 fw_dump_end ; }; struct mwifiex_pcie_device { char const *firmware ; struct mwifiex_pcie_card_reg const *reg ; u16 blksz_fw_dl ; u16 tx_buf_size ; bool can_dump_fw ; bool can_ext_scan ; }; struct pcie_service_card { struct pci_dev *dev ; struct mwifiex_adapter *adapter ; struct mwifiex_pcie_device pcie ; u8 txbd_flush ; u32 txbd_wrptr ; u32 txbd_rdptr ; u32 txbd_ring_size ; u8 *txbd_ring_vbase ; dma_addr_t txbd_ring_pbase ; void *txbd_ring[32U] ; struct sk_buff *tx_buf_list[32U] ; u32 rxbd_wrptr ; u32 rxbd_rdptr ; u32 rxbd_ring_size ; u8 *rxbd_ring_vbase ; dma_addr_t rxbd_ring_pbase ; void *rxbd_ring[32U] ; struct sk_buff *rx_buf_list[32U] ; u32 evtbd_wrptr ; u32 evtbd_rdptr ; u32 evtbd_ring_size ; u8 *evtbd_ring_vbase ; dma_addr_t evtbd_ring_pbase ; void *evtbd_ring[8U] ; struct sk_buff *evt_buf_list[8U] ; struct sk_buff *cmd_buf ; struct sk_buff *cmdrsp_buf ; u8 *sleep_cookie_vbase ; dma_addr_t sleep_cookie_pbase ; void *pci_mmap ; void *pci_mmap1 ; }; enum state_11d_t { DISABLE_11D = 0, ENABLE_11D = 1 } ; enum hrtimer_restart; enum nl80211_hidden_ssid { NL80211_HIDDEN_SSID_NOT_IN_USE = 0, NL80211_HIDDEN_SSID_ZERO_LEN = 1, NL80211_HIDDEN_SSID_ZERO_CONTENTS = 2 } ; enum nl80211_acl_policy { NL80211_ACL_POLICY_ACCEPT_UNLESS_LISTED = 0, NL80211_ACL_POLICY_DENY_UNLESS_LISTED = 1 } ; enum nl80211_smps_mode { NL80211_SMPS_OFF = 0, NL80211_SMPS_STATIC = 1, NL80211_SMPS_DYNAMIC = 2, __NL80211_SMPS_AFTER_LAST = 3, NL80211_SMPS_MAX = 2 } ; struct cfg80211_acl_data { enum nl80211_acl_policy acl_policy ; int n_acl_entries ; struct mac_address mac_addrs[] ; }; struct cfg80211_ap_settings { struct cfg80211_chan_def chandef ; struct cfg80211_beacon_data beacon ; int beacon_interval ; int dtim_period ; u8 const *ssid ; size_t ssid_len ; enum nl80211_hidden_ssid hidden_ssid ; struct cfg80211_crypto_settings crypto ; bool privacy ; enum nl80211_auth_type auth_type ; enum nl80211_smps_mode smps_mode ; int inactivity_timeout ; u8 p2p_ctwindow ; bool p2p_opp_ps ; struct cfg80211_acl_data const *acl ; }; struct mwifiex_ie_types_wmmcap { struct mwifiex_ie_types_header header ; struct mwifiex_types_wmm_info wmm_info ; }; struct host_cmd_tlv_akmp { struct mwifiex_ie_types_header header ; __le16 key_mgmt ; __le16 key_mgmt_operation ; }; struct host_cmd_tlv_pwk_cipher { struct mwifiex_ie_types_header header ; __le16 proto ; u8 cipher ; u8 reserved ; }; struct host_cmd_tlv_gwk_cipher { struct mwifiex_ie_types_header header ; u8 cipher ; u8 reserved ; }; struct host_cmd_tlv_passphrase { struct mwifiex_ie_types_header header ; u8 passphrase[0U] ; }; struct host_cmd_tlv_wep_key { struct mwifiex_ie_types_header header ; u8 key_index ; u8 is_default ; u8 key[1U] ; }; struct host_cmd_tlv_auth_type { struct mwifiex_ie_types_header header ; u8 auth_type ; }; struct host_cmd_tlv_encrypt_protocol { struct mwifiex_ie_types_header header ; __le16 proto ; }; struct host_cmd_tlv_ssid { struct mwifiex_ie_types_header header ; u8 ssid[0U] ; }; struct host_cmd_tlv_bcast_ssid { struct mwifiex_ie_types_header header ; u8 bcast_ctl ; }; struct host_cmd_tlv_beacon_period { struct mwifiex_ie_types_header header ; __le16 period ; }; struct host_cmd_tlv_dtim_period { struct mwifiex_ie_types_header header ; u8 period ; }; struct host_cmd_tlv_frag_threshold { struct mwifiex_ie_types_header header ; __le16 frag_thr ; }; struct host_cmd_tlv_rts_threshold { struct mwifiex_ie_types_header header ; __le16 rts_thr ; }; struct host_cmd_tlv_retry_limit { struct mwifiex_ie_types_header header ; u8 limit ; }; struct host_cmd_tlv_channel_band { struct mwifiex_ie_types_header header ; u8 band_config ; u8 channel ; }; struct host_cmd_tlv_ageout_timer { struct mwifiex_ie_types_header header ; __le32 sta_ao_timer ; }; struct host_cmd_tlv_power_constraint { struct mwifiex_ie_types_header header ; u8 constraint ; }; struct mwifiex_ie_list { __le16 type ; __le16 len ; struct mwifiex_ie ie_list[16U] ; }; enum hrtimer_restart; struct ieee80211_vendor_ie { u8 element_id ; u8 len ; u8 oui[3U] ; u8 oui_type ; }; enum hrtimer_restart; struct mwifiex_ie_types_sta_info { struct mwifiex_ie_types_header header ; u8 mac[6U] ; u8 power_mfg_status ; s8 rssi ; }; union reg { struct host_cmd_ds_mac_reg_access *mac ; struct host_cmd_ds_bbp_reg_access *bbp ; struct host_cmd_ds_rf_reg_access *rf ; struct host_cmd_ds_pmic_reg_access *pmic ; struct host_cmd_ds_802_11_eeprom_access *eeprom ; }; enum hrtimer_restart; enum nl80211_key_type { NL80211_KEYTYPE_GROUP = 0, NL80211_KEYTYPE_PAIRWISE = 1, NL80211_KEYTYPE_PEERKEY = 2, NUM_NL80211_KEYTYPES = 3 } ; enum nl80211_cqm_rssi_threshold_event { NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW = 0, NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH = 1, NL80211_CQM_RSSI_BEACON_LOSS_EVENT = 2 } ; enum nl80211_tdls_operation { NL80211_TDLS_DISCOVERY_REQ = 0, NL80211_TDLS_SETUP = 1, NL80211_TDLS_TEARDOWN = 2, NL80211_TDLS_ENABLE_LINK = 3, NL80211_TDLS_DISABLE_LINK = 4 } ; struct mwifiex_ie_types_btcoex_scan_time { struct mwifiex_ie_types_header header ; u8 coex_scan ; u8 reserved ; u16 min_scan_time ; u16 max_scan_time ; }; struct mwifiex_ie_types_btcoex_aggr_win_size { struct mwifiex_ie_types_header header ; u8 coex_win_size ; u8 tx_win_size ; u8 rx_win_size ; u8 reserved ; }; union __anonunion_u_387 { __le16 reason_code ; __le16 reserved ; }; struct mwifiex_tdls_generic_event { __le16 type ; u8 peer_mac[6U] ; union __anonunion_u_387 u ; }; enum hrtimer_restart; struct mwifiex_assoc_event { u8 sta_addr[6U] ; __le16 type ; __le16 len ; __le16 frame_control ; __le16 cap_info ; __le16 listen_interval ; u8 data[0U] ; }; enum hrtimer_restart; typedef __u16 __sum16; enum hrtimer_restart; struct ipv6hdr { unsigned char priority : 4 ; unsigned char version : 4 ; __u8 flow_lbl[3U] ; __be16 payload_len ; __u8 nexthdr ; __u8 hop_limit ; struct in6_addr saddr ; struct in6_addr daddr ; }; struct icmpv6_echo { __be16 identifier ; __be16 sequence ; }; struct icmpv6_nd_advt { unsigned char reserved : 5 ; unsigned char override : 1 ; unsigned char solicited : 1 ; unsigned char router : 1 ; unsigned int reserved2 : 24 ; }; struct icmpv6_nd_ra { __u8 hop_limit ; unsigned char reserved : 3 ; unsigned char router_pref : 2 ; unsigned char home_agent : 1 ; unsigned char other : 1 ; unsigned char managed : 1 ; __be16 rt_lifetime ; }; union __anonunion_icmp6_dataun_236 { __be32 un_data32[1U] ; __be16 un_data16[2U] ; __u8 un_data8[4U] ; struct icmpv6_echo u_echo ; struct icmpv6_nd_advt u_nd_advt ; struct icmpv6_nd_ra u_nd_ra ; }; struct icmp6hdr { __u8 icmp6_type ; __u8 icmp6_code ; __sum16 icmp6_cksum ; union __anonunion_icmp6_dataun_236 icmp6_dataun ; }; struct arphdr { __be16 ar_hrd ; __be16 ar_pro ; unsigned char ar_hln ; unsigned char ar_pln ; __be16 ar_op ; }; struct mwifiex_arp_eth_header { struct arphdr hdr ; u8 ar_sha[6U] ; u8 ar_sip[4U] ; u8 ar_tha[6U] ; u8 ar_tip[4U] ; }; struct rx_packet_hdr { struct ethhdr eth803_hdr ; struct rfc_1042_hdr rfc1042_hdr ; }; enum hrtimer_restart; struct uap_txpd { u8 bss_type ; u8 bss_num ; __le16 tx_pkt_length ; __le16 tx_pkt_offset ; __le16 tx_pkt_type ; __le32 tx_control ; u8 priority ; u8 flags ; u8 pkt_delay_2ms ; u8 reserved1[2U] ; u8 tx_token_id ; u8 reserved[2U] ; }; struct uap_rxpd { u8 bss_type ; u8 bss_num ; __le16 rx_pkt_length ; __le16 rx_pkt_offset ; __le16 rx_pkt_type ; __le16 seq_num ; u8 priority ; u8 rx_rate ; s8 snr ; s8 nf ; u8 ht_info ; u8 reserved[3U] ; u8 flags ; }; enum hrtimer_restart; enum nl80211_ac { NL80211_AC_VO = 0, NL80211_AC_VI = 1, NL80211_AC_BE = 2, NL80211_AC_BK = 3, NL80211_NUM_ACS = 4 } ; enum nl80211_txrate_gi { NL80211_TXRATE_DEFAULT_GI = 0, NL80211_TXRATE_FORCE_SGI = 1, NL80211_TXRATE_FORCE_LGI = 2 } ; enum nl80211_tx_power_setting { NL80211_TX_POWER_AUTOMATIC = 0, NL80211_TX_POWER_LIMITED = 1, NL80211_TX_POWER_FIXED = 2 } ; enum nl80211_coalesce_condition { NL80211_COALESCE_CONDITION_MATCH = 0, NL80211_COALESCE_CONDITION_NO_MATCH = 1 } ; enum nl80211_crit_proto_id { NL80211_CRIT_PROTO_UNSPEC = 0, NL80211_CRIT_PROTO_DHCP = 1, NL80211_CRIT_PROTO_EAPOL = 2, NL80211_CRIT_PROTO_APIPA = 3, NUM_NL80211_CRIT_PROTO = 4 } ; struct ieee80211_msrment_ie { u8 token ; u8 mode ; u8 type ; u8 request[0U] ; }; struct ieee80211_channel_sw_ie { u8 mode ; u8 new_ch_num ; u8 count ; }; struct 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_323 { __le16 auth_alg ; __le16 auth_transaction ; __le16 status_code ; u8 variable[0U] ; }; struct __anonstruct_deauth_324 { __le16 reason_code ; }; struct __anonstruct_assoc_req_325 { __le16 capab_info ; __le16 listen_interval ; u8 variable[0U] ; }; struct __anonstruct_assoc_resp_326 { __le16 capab_info ; __le16 status_code ; __le16 aid ; u8 variable[0U] ; }; struct __anonstruct_reassoc_resp_327 { __le16 capab_info ; __le16 status_code ; __le16 aid ; u8 variable[0U] ; }; struct __anonstruct_reassoc_req_328 { __le16 capab_info ; __le16 listen_interval ; u8 current_ap[6U] ; u8 variable[0U] ; }; struct __anonstruct_disassoc_329 { __le16 reason_code ; }; struct __anonstruct_beacon_330 { __le64 timestamp ; __le16 beacon_int ; __le16 capab_info ; u8 variable[0U] ; }; struct __anonstruct_probe_req_331 { u8 variable[0U] ; }; struct __anonstruct_probe_resp_332 { __le64 timestamp ; __le16 beacon_int ; __le16 capab_info ; u8 variable[0U] ; }; struct __anonstruct_wme_action_335 { u8 action_code ; u8 dialog_token ; u8 status_code ; u8 variable[0U] ; }; struct __anonstruct_chan_switch_336 { u8 action_code ; u8 variable[0U] ; }; struct __anonstruct_ext_chan_switch_337 { u8 action_code ; struct ieee80211_ext_chansw_ie data ; u8 variable[0U] ; }; struct __anonstruct_measurement_338 { u8 action_code ; u8 dialog_token ; u8 element_id ; u8 length ; struct ieee80211_msrment_ie msr_elem ; }; struct __anonstruct_addba_req_339 { u8 action_code ; u8 dialog_token ; __le16 capab ; __le16 timeout ; __le16 start_seq_num ; }; struct __anonstruct_addba_resp_340 { u8 action_code ; u8 dialog_token ; __le16 status ; __le16 capab ; __le16 timeout ; }; struct __anonstruct_delba_341 { u8 action_code ; __le16 params ; __le16 reason_code ; }; struct __anonstruct_self_prot_342 { u8 action_code ; u8 variable[0U] ; }; struct __anonstruct_mesh_action_343 { u8 action_code ; u8 variable[0U] ; }; struct __anonstruct_sa_query_344 { u8 action ; u8 trans_id[2U] ; }; struct __anonstruct_ht_smps_345 { u8 action ; u8 smps_control ; }; struct __anonstruct_ht_notify_cw_346 { u8 action_code ; u8 chanwidth ; }; struct __anonstruct_tdls_discover_resp_347 { u8 action_code ; u8 dialog_token ; __le16 capability ; u8 variable[0U] ; }; struct __anonstruct_vht_opmode_notif_348 { u8 action_code ; u8 operating_mode ; }; struct __anonstruct_tpc_report_349 { u8 action_code ; u8 dialog_token ; u8 tpc_elem_id ; u8 tpc_elem_length ; struct ieee80211_tpc_report_ie tpc ; }; union __anonunion_u_334 { struct __anonstruct_wme_action_335 wme_action ; struct __anonstruct_chan_switch_336 chan_switch ; struct __anonstruct_ext_chan_switch_337 ext_chan_switch ; struct __anonstruct_measurement_338 measurement ; struct __anonstruct_addba_req_339 addba_req ; struct __anonstruct_addba_resp_340 addba_resp ; struct __anonstruct_delba_341 delba ; struct __anonstruct_self_prot_342 self_prot ; struct __anonstruct_mesh_action_343 mesh_action ; struct __anonstruct_sa_query_344 sa_query ; struct __anonstruct_ht_smps_345 ht_smps ; struct __anonstruct_ht_notify_cw_346 ht_notify_cw ; struct __anonstruct_tdls_discover_resp_347 tdls_discover_resp ; struct __anonstruct_vht_opmode_notif_348 vht_opmode_notif ; struct __anonstruct_tpc_report_349 tpc_report ; }; struct __anonstruct_action_333 { u8 category ; union __anonunion_u_334 u ; }; union __anonunion_u_322 { struct __anonstruct_auth_323 auth ; struct __anonstruct_deauth_324 deauth ; struct __anonstruct_assoc_req_325 assoc_req ; struct __anonstruct_assoc_resp_326 assoc_resp ; struct __anonstruct_reassoc_resp_327 reassoc_resp ; struct __anonstruct_reassoc_req_328 reassoc_req ; struct __anonstruct_disassoc_329 disassoc ; struct __anonstruct_beacon_330 beacon ; struct __anonstruct_probe_req_331 probe_req ; struct __anonstruct_probe_resp_332 probe_resp ; struct __anonstruct_action_333 action ; }; struct ieee80211_mgmt { __le16 frame_control ; __le16 duration ; u8 da[6U] ; u8 sa[6U] ; u8 bssid[6U] ; __le16 seq_ctrl ; union __anonunion_u_322 u ; }; enum ieee80211_bss_type { IEEE80211_BSS_TYPE_ESS = 0, IEEE80211_BSS_TYPE_PBSS = 1, IEEE80211_BSS_TYPE_IBSS = 2, IEEE80211_BSS_TYPE_MBSS = 3, IEEE80211_BSS_TYPE_ANY = 4 } ; enum ieee80211_privacy { IEEE80211_PRIVACY_ON = 0, IEEE80211_PRIVACY_OFF = 1, IEEE80211_PRIVACY_ANY = 2 } ; 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_csa_settings { struct cfg80211_chan_def chandef ; struct cfg80211_beacon_data beacon_csa ; u16 const *counter_offsets_beacon ; u16 const *counter_offsets_presp ; unsigned int n_counter_offsets_beacon ; unsigned int n_counter_offsets_presp ; struct cfg80211_beacon_data beacon_after ; bool radar_required ; bool block_tx ; u8 count ; }; struct station_del_parameters { u8 const *mac ; u8 subtype ; u16 reason_code ; }; struct mpath_info { u32 filled ; u32 frame_qlen ; u32 sn ; u32 metric ; u32 exptime ; u32 discovery_timeout ; u8 discovery_retries ; u8 flags ; int generation ; }; struct bss_parameters { int use_cts_prot ; int use_short_preamble ; int use_short_slot_time ; u8 const *basic_rates ; u8 basic_rates_len ; int ap_isolate ; int ht_opmode ; s8 p2p_ctwindow ; s8 p2p_opp_ps ; }; struct mesh_config { u16 dot11MeshRetryTimeout ; u16 dot11MeshConfirmTimeout ; u16 dot11MeshHoldingTimeout ; u16 dot11MeshMaxPeerLinks ; u8 dot11MeshMaxRetries ; u8 dot11MeshTTL ; u8 element_ttl ; bool auto_open_plinks ; u32 dot11MeshNbrOffsetMaxNeighbor ; u8 dot11MeshHWMPmaxPREQretries ; u32 path_refresh_time ; u16 min_discovery_timeout ; u32 dot11MeshHWMPactivePathTimeout ; u16 dot11MeshHWMPpreqMinInterval ; u16 dot11MeshHWMPperrMinInterval ; u16 dot11MeshHWMPnetDiameterTraversalTime ; u8 dot11MeshHWMPRootMode ; u16 dot11MeshHWMPRannInterval ; bool dot11MeshGateAnnouncementProtocol ; bool dot11MeshForwarding ; s32 rssi_threshold ; u16 ht_opmode ; u32 dot11MeshHWMPactivePathToRootTimeout ; u16 dot11MeshHWMProotInterval ; u16 dot11MeshHWMPconfirmationInterval ; enum nl80211_mesh_power_mode power_mode ; u16 dot11MeshAwakeWindowDuration ; u32 plink_timeout ; }; struct mesh_setup { struct cfg80211_chan_def chandef ; u8 const *mesh_id ; u8 mesh_id_len ; u8 sync_method ; u8 path_sel_proto ; u8 path_metric ; u8 auth_id ; u8 const *ie ; u8 ie_len ; bool is_authenticated ; bool is_secure ; bool user_mpm ; u8 dtim_period ; u16 beacon_interval ; int mcast_rate[3U] ; u32 basic_rates ; }; struct ocb_setup { struct cfg80211_chan_def chandef ; }; struct ieee80211_txq_params { enum nl80211_ac ac ; u16 txop ; u16 cwmin ; u16 cwmax ; u8 aifs ; }; struct cfg80211_auth_request { struct cfg80211_bss *bss ; u8 const *ie ; size_t ie_len ; enum nl80211_auth_type auth_type ; u8 const *key ; u8 key_len ; u8 key_idx ; u8 const *sae_data ; size_t sae_data_len ; }; struct cfg80211_assoc_request { struct cfg80211_bss *bss ; u8 const *ie ; u8 const *prev_bssid ; size_t ie_len ; struct cfg80211_crypto_settings crypto ; bool use_mfp ; u32 flags ; 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_deauth_request { u8 const *bssid ; u8 const *ie ; size_t ie_len ; u16 reason_code ; bool local_state_change ; }; struct cfg80211_disassoc_request { struct cfg80211_bss *bss ; u8 const *ie ; size_t ie_len ; u16 reason_code ; bool local_state_change ; }; struct __anonstruct_control_361 { u32 legacy ; u8 ht_mcs[10U] ; u16 vht_mcs[8U] ; enum nl80211_txrate_gi gi ; }; struct cfg80211_bitrate_mask { struct __anonstruct_control_361 control[3U] ; }; struct cfg80211_pmksa { u8 const *bssid ; u8 const *pmkid ; }; struct cfg80211_coalesce_rules { int delay ; enum nl80211_coalesce_condition condition ; struct cfg80211_pkt_pattern *patterns ; int n_patterns ; }; struct cfg80211_coalesce { struct cfg80211_coalesce_rules *rules ; int n_rules ; }; struct cfg80211_gtk_rekey_data { u8 const *kek ; u8 const *kck ; u8 const *replay_ctr ; }; struct cfg80211_update_ft_ies_params { u16 md ; u8 const *ie ; size_t ie_len ; }; struct cfg80211_mgmt_tx_params { struct ieee80211_channel *chan ; bool offchan ; unsigned int wait ; u8 const *buf ; size_t len ; bool no_cck ; bool dont_wait_for_ack ; int n_csa_offsets ; u16 const *csa_offsets ; }; struct cfg80211_ops { int (*suspend)(struct wiphy * , struct cfg80211_wowlan * ) ; int (*resume)(struct wiphy * ) ; void (*set_wakeup)(struct wiphy * , bool ) ; struct wireless_dev *(*add_virtual_intf)(struct wiphy * , char const * , unsigned char , enum nl80211_iftype , u32 * , struct vif_params * ) ; int (*del_virtual_intf)(struct wiphy * , struct wireless_dev * ) ; int (*change_virtual_intf)(struct wiphy * , struct net_device * , enum nl80211_iftype , u32 * , struct vif_params * ) ; int (*add_key)(struct wiphy * , struct net_device * , u8 , bool , u8 const * , struct key_params * ) ; int (*get_key)(struct wiphy * , struct net_device * , u8 , bool , u8 const * , void * , void (*)(void * , struct key_params * ) ) ; int (*del_key)(struct wiphy * , struct net_device * , u8 , bool , u8 const * ) ; int (*set_default_key)(struct wiphy * , struct net_device * , u8 , bool , bool ) ; int (*set_default_mgmt_key)(struct wiphy * , struct net_device * , u8 ) ; int (*start_ap)(struct wiphy * , struct net_device * , struct cfg80211_ap_settings * ) ; int (*change_beacon)(struct wiphy * , struct net_device * , struct cfg80211_beacon_data * ) ; int (*stop_ap)(struct wiphy * , struct net_device * ) ; int (*add_station)(struct wiphy * , struct net_device * , u8 const * , struct station_parameters * ) ; int (*del_station)(struct wiphy * , struct net_device * , struct station_del_parameters * ) ; int (*change_station)(struct wiphy * , struct net_device * , u8 const * , struct station_parameters * ) ; int (*get_station)(struct wiphy * , struct net_device * , u8 const * , struct station_info * ) ; int (*dump_station)(struct wiphy * , struct net_device * , int , u8 * , struct station_info * ) ; int (*add_mpath)(struct wiphy * , struct net_device * , u8 const * , u8 const * ) ; int (*del_mpath)(struct wiphy * , struct net_device * , u8 const * ) ; int (*change_mpath)(struct wiphy * , struct net_device * , u8 const * , u8 const * ) ; int (*get_mpath)(struct wiphy * , struct net_device * , u8 * , u8 * , struct mpath_info * ) ; int (*dump_mpath)(struct wiphy * , struct net_device * , int , u8 * , u8 * , struct mpath_info * ) ; int (*get_mpp)(struct wiphy * , struct net_device * , u8 * , u8 * , struct mpath_info * ) ; int (*dump_mpp)(struct wiphy * , struct net_device * , int , u8 * , u8 * , struct mpath_info * ) ; int (*get_mesh_config)(struct wiphy * , struct net_device * , struct mesh_config * ) ; int (*update_mesh_config)(struct wiphy * , struct net_device * , u32 , struct mesh_config const * ) ; int (*join_mesh)(struct wiphy * , struct net_device * , struct mesh_config const * , struct mesh_setup const * ) ; int (*leave_mesh)(struct wiphy * , struct net_device * ) ; int (*join_ocb)(struct wiphy * , struct net_device * , struct ocb_setup * ) ; int (*leave_ocb)(struct wiphy * , struct net_device * ) ; int (*change_bss)(struct wiphy * , struct net_device * , struct bss_parameters * ) ; int (*set_txq_params)(struct wiphy * , struct net_device * , struct ieee80211_txq_params * ) ; int (*libertas_set_mesh_channel)(struct wiphy * , struct net_device * , struct ieee80211_channel * ) ; int (*set_monitor_channel)(struct wiphy * , struct cfg80211_chan_def * ) ; int (*scan)(struct wiphy * , struct cfg80211_scan_request * ) ; int (*auth)(struct wiphy * , struct net_device * , struct cfg80211_auth_request * ) ; int (*assoc)(struct wiphy * , struct net_device * , struct cfg80211_assoc_request * ) ; int (*deauth)(struct wiphy * , struct net_device * , struct cfg80211_deauth_request * ) ; int (*disassoc)(struct wiphy * , struct net_device * , struct cfg80211_disassoc_request * ) ; int (*connect)(struct wiphy * , struct net_device * , struct cfg80211_connect_params * ) ; int (*disconnect)(struct wiphy * , struct net_device * , u16 ) ; int (*join_ibss)(struct wiphy * , struct net_device * , struct cfg80211_ibss_params * ) ; int (*leave_ibss)(struct wiphy * , struct net_device * ) ; int (*set_mcast_rate)(struct wiphy * , struct net_device * , int * ) ; int (*set_wiphy_params)(struct wiphy * , u32 ) ; int (*set_tx_power)(struct wiphy * , struct wireless_dev * , enum nl80211_tx_power_setting , int ) ; int (*get_tx_power)(struct wiphy * , struct wireless_dev * , int * ) ; int (*set_wds_peer)(struct wiphy * , struct net_device * , u8 const * ) ; void (*rfkill_poll)(struct wiphy * ) ; int (*testmode_cmd)(struct wiphy * , struct wireless_dev * , void * , int ) ; int (*testmode_dump)(struct wiphy * , struct sk_buff * , struct netlink_callback * , void * , int ) ; int (*set_bitrate_mask)(struct wiphy * , struct net_device * , u8 const * , struct cfg80211_bitrate_mask const * ) ; int (*dump_survey)(struct wiphy * , struct net_device * , int , struct survey_info * ) ; int (*set_pmksa)(struct wiphy * , struct net_device * , struct cfg80211_pmksa * ) ; int (*del_pmksa)(struct wiphy * , struct net_device * , struct cfg80211_pmksa * ) ; int (*flush_pmksa)(struct wiphy * , struct net_device * ) ; int (*remain_on_channel)(struct wiphy * , struct wireless_dev * , struct ieee80211_channel * , unsigned int , u64 * ) ; int (*cancel_remain_on_channel)(struct wiphy * , struct wireless_dev * , u64 ) ; int (*mgmt_tx)(struct wiphy * , struct wireless_dev * , struct cfg80211_mgmt_tx_params * , u64 * ) ; int (*mgmt_tx_cancel_wait)(struct wiphy * , struct wireless_dev * , u64 ) ; int (*set_power_mgmt)(struct wiphy * , struct net_device * , bool , int ) ; int (*set_cqm_rssi_config)(struct wiphy * , struct net_device * , s32 , u32 ) ; int (*set_cqm_txe_config)(struct wiphy * , struct net_device * , u32 , u32 , u32 ) ; void (*mgmt_frame_register)(struct wiphy * , struct wireless_dev * , u16 , bool ) ; int (*set_antenna)(struct wiphy * , u32 , u32 ) ; int (*get_antenna)(struct wiphy * , u32 * , u32 * ) ; int (*sched_scan_start)(struct wiphy * , struct net_device * , struct cfg80211_sched_scan_request * ) ; int (*sched_scan_stop)(struct wiphy * , struct net_device * ) ; int (*set_rekey_data)(struct wiphy * , struct net_device * , struct cfg80211_gtk_rekey_data * ) ; int (*tdls_mgmt)(struct wiphy * , struct net_device * , u8 const * , u8 , u8 , u16 , u32 , bool , u8 const * , size_t ) ; int (*tdls_oper)(struct wiphy * , struct net_device * , u8 const * , enum nl80211_tdls_operation ) ; int (*probe_client)(struct wiphy * , struct net_device * , u8 const * , u64 * ) ; int (*set_noack_map)(struct wiphy * , struct net_device * , u16 ) ; int (*get_channel)(struct wiphy * , struct wireless_dev * , struct cfg80211_chan_def * ) ; int (*start_p2p_device)(struct wiphy * , struct wireless_dev * ) ; void (*stop_p2p_device)(struct wiphy * , struct wireless_dev * ) ; int (*set_mac_acl)(struct wiphy * , struct net_device * , struct cfg80211_acl_data const * ) ; int (*start_radar_detection)(struct wiphy * , struct net_device * , struct cfg80211_chan_def * , u32 ) ; int (*update_ft_ies)(struct wiphy * , struct net_device * , struct cfg80211_update_ft_ies_params * ) ; int (*crit_proto_start)(struct wiphy * , struct wireless_dev * , enum nl80211_crit_proto_id , u16 ) ; void (*crit_proto_stop)(struct wiphy * , struct wireless_dev * ) ; int (*set_coalesce)(struct wiphy * , struct cfg80211_coalesce * ) ; int (*channel_switch)(struct wiphy * , struct net_device * , struct cfg80211_csa_settings * ) ; int (*set_qos_map)(struct wiphy * , struct net_device * , struct cfg80211_qos_map * ) ; int (*set_ap_chanwidth)(struct wiphy * , struct net_device * , struct cfg80211_chan_def * ) ; int (*add_tx_ts)(struct wiphy * , struct net_device * , u8 , u8 const * , u8 , u16 ) ; int (*del_tx_ts)(struct wiphy * , struct net_device * , u8 , u8 const * ) ; int (*tdls_channel_switch)(struct wiphy * , struct net_device * , u8 const * , u8 , struct cfg80211_chan_def * ) ; void (*tdls_cancel_channel_switch)(struct wiphy * , struct net_device * , u8 const * ) ; }; struct mwifiex_radar_params { struct cfg80211_chan_def *chandef ; u32 cac_time_ms ; }; enum hrtimer_restart; enum hrtimer_restart; enum nl80211_radar_event { NL80211_RADAR_DETECTED = 0, NL80211_RADAR_CAC_FINISHED = 1, NL80211_RADAR_CAC_ABORTED = 2, NL80211_RADAR_NOP_FINISHED = 3 } ; struct host_cmd_ds_chan_rpt_event { __le32 result ; __le64 start_tsf ; __le32 duration ; u8 tlvbuf[0U] ; }; struct mwifiex_ie_types_pwr_capability { struct mwifiex_ie_types_header header ; s8 min_pwr ; s8 max_pwr ; }; struct mwifiex_ie_types_local_pwr_constraint { struct mwifiex_ie_types_header header ; u8 chan ; u8 constraint ; }; struct mwifiex_radar_det_event { __le32 detect_count ; u8 reg_domain ; u8 det_type ; __le16 pw_chirp_type ; u8 pw_chirp_idx ; u8 pw_value ; u8 pri_radar_type ; u8 pri_bincnt ; u8 bin_counter[7U] ; u8 num_dfs_records ; u8 dfs_record_hdr[10U][8U] ; __le32 passed ; }; struct meas_rpt_map { unsigned char rssi : 3 ; unsigned char unmeasured : 1 ; unsigned char radar : 1 ; unsigned char unidentified_sig : 1 ; unsigned char ofdm_preamble : 1 ; unsigned char bss : 1 ; }; struct mwifiex_ie_types_chan_rpt_data { struct mwifiex_ie_types_header header ; struct meas_rpt_map map ; }; typedef bool ldv_func_ret_type___6; typedef bool ldv_func_ret_type___7; enum hrtimer_restart; struct ieee80211_wmm_ac_param { u8 aci_aifsn ; u8 cw ; __le16 txop_limit ; }; struct ieee80211_wmm_param_ie { u8 element_id ; u8 len ; u8 oui[3U] ; u8 oui_type ; u8 oui_subtype ; u8 version ; u8 qos_info ; u8 reserved ; struct ieee80211_wmm_ac_param ac[4U] ; }; struct ieee80211_tdls_lnkie { u8 ie_type ; u8 ie_len ; u8 bssid[6U] ; u8 init_sta[6U] ; u8 resp_sta[6U] ; }; struct __anonstruct_setup_req_393 { u8 dialog_token ; __le16 capability ; u8 variable[0U] ; }; struct __anonstruct_setup_resp_394 { __le16 status_code ; u8 dialog_token ; __le16 capability ; u8 variable[0U] ; }; struct __anonstruct_setup_cfm_395 { __le16 status_code ; u8 dialog_token ; u8 variable[0U] ; }; struct __anonstruct_teardown_396 { __le16 reason_code ; u8 variable[0U] ; }; struct __anonstruct_discover_req_397 { u8 dialog_token ; u8 variable[0U] ; }; struct __anonstruct_chan_switch_req_398 { u8 target_channel ; u8 oper_class ; u8 variable[0U] ; }; struct __anonstruct_chan_switch_resp_399 { __le16 status_code ; u8 variable[0U] ; }; union __anonunion_u_392 { struct __anonstruct_setup_req_393 setup_req ; struct __anonstruct_setup_resp_394 setup_resp ; struct __anonstruct_setup_cfm_395 setup_cfm ; struct __anonstruct_teardown_396 teardown ; struct __anonstruct_discover_req_397 discover_req ; struct __anonstruct_chan_switch_req_398 chan_switch_req ; struct __anonstruct_chan_switch_resp_399 chan_switch_resp ; }; struct ieee80211_tdls_data { u8 da[6U] ; u8 sa[6U] ; __be16 ether_type ; u8 payload_type ; u8 category ; u8 action_code ; union __anonunion_u_392 u ; }; struct mwifiex_auto_tdls_peer { struct list_head list ; u8 mac_addr[6U] ; u8 tdls_status ; int rssi ; long rssi_jiffies ; u8 failure_count ; u8 do_discover ; u8 do_setup ; }; typedef int ldv_func_ret_type___8; enum hrtimer_restart; __inline static long ldv__builtin_expect(long exp , long c ) ; extern struct module __this_module ; __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 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 int printk(char const * , ...) ; extern void __dynamic_pr_debug(struct _ddebug * , char const * , ...) ; extern void __might_sleep(char const * , int , int ) ; extern int sprintf(char * , char const * , ...) ; bool ldv_is_err(void const *ptr ) ; __inline static void INIT_LIST_HEAD(struct list_head *list ) { { list->next = list; list->prev = list; return; } } __inline static int list_empty(struct list_head const *head ) { { return ((unsigned long )((struct list_head const *)head->next) == (unsigned long )head); } } extern void *memcpy(void * , void const * , size_t ) ; extern void *memset(void * , int , size_t ) ; extern void *__memmove(void * , void const * , size_t ) ; extern size_t strlen(char const * ) ; extern char *strcpy(char * , char const * ) ; extern int __bitmap_weight(unsigned long const * , unsigned int ) ; __inline static int bitmap_weight(unsigned long const *src , unsigned int nbits ) { int tmp___0 ; { tmp___0 = __bitmap_weight(src, nbits); return (tmp___0); } } extern int nr_cpu_ids ; extern struct cpumask const * const cpu_possible_mask ; __inline static unsigned int cpumask_weight(struct cpumask const *srcp ) { int tmp ; { tmp = bitmap_weight((unsigned long const *)(& srcp->bits), (unsigned int )nr_cpu_ids); return ((unsigned int )tmp); } } __inline static bool IS_ERR(void const *ptr ) ; extern void __xadd_wrong_size(void) ; __inline static int atomic_read(atomic_t const *v ) { int __var ; { __var = 0; return ((int )*((int const volatile *)(& v->counter))); } } __inline static 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; } } __inline static int atomic_add_return(int i , atomic_t *v ) { int __ret ; { __ret = i; switch (4UL) { case 1UL: __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; xaddb %b0, %1\n": "+q" (__ret), "+m" (v->counter): : "memory", "cc"); goto ldv_5659; case 2UL: __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; xaddw %w0, %1\n": "+r" (__ret), "+m" (v->counter): : "memory", "cc"); goto ldv_5659; case 4UL: __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; xaddl %0, %1\n": "+r" (__ret), "+m" (v->counter): : "memory", "cc"); goto ldv_5659; case 8UL: __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; xaddq %q0, %1\n": "+r" (__ret), "+m" (v->counter): : "memory", "cc"); goto ldv_5659; default: __xadd_wrong_size(); } ldv_5659: ; return (__ret + i); } } extern void lockdep_init_map(struct lockdep_map * , char const * , struct lock_class_key * , int ) ; extern unsigned long _raw_spin_lock_irqsave(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_unlock_irqrestore(spinlock_t *lock , unsigned long flags ) { { _raw_spin_unlock_irqrestore(& lock->__annonCompField18.rlock, flags); return; } } extern void __init_waitqueue_head(wait_queue_head_t * , char const * , struct lock_class_key * ) ; extern 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 unsigned long volatile jiffies ; extern ktime_t ktime_get_with_offset(enum tk_offsets ) ; __inline static ktime_t ktime_get_real(void) { ktime_t tmp ; { tmp = ktime_get_with_offset(0); return (tmp); } } extern int del_timer(struct timer_list * ) ; int ldv_del_timer_12(struct timer_list *ldv_func_arg1 ) ; extern int mod_timer(struct timer_list * , unsigned long ) ; int ldv_mod_timer_11(struct timer_list *ldv_func_arg1 , unsigned long ldv_func_arg2 ) ; extern int del_timer_sync(struct timer_list * ) ; int ldv_del_timer_sync_10(struct timer_list *ldv_func_arg1 ) ; extern void __init_work(struct work_struct * , int ) ; extern struct workqueue_struct *__alloc_workqueue_key(char const * , unsigned int , int , struct lock_class_key * , char const * , ...) ; extern void destroy_workqueue(struct workqueue_struct * ) ; void ldv_destroy_workqueue_14(struct workqueue_struct *ldv_func_arg1 ) ; void ldv_destroy_workqueue_16(struct workqueue_struct *ldv_func_arg1 ) ; 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 ) ; void ldv_flush_workqueue_13(struct workqueue_struct *ldv_func_arg1 ) ; void ldv_flush_workqueue_15(struct workqueue_struct *ldv_func_arg1 ) ; __inline static bool queue_work(struct workqueue_struct *wq , struct work_struct *work ) { bool tmp ; { tmp = ldv_queue_work_on_5(8192, wq, work); return (tmp); } } extern int idr_alloc(struct idr * , void * , int , int , gfp_t ) ; extern void schedule(void) ; extern void kfree(void const * ) ; extern void *__kmalloc(size_t , gfp_t ) ; __inline static void *kmalloc(size_t size , gfp_t flags ) { void *tmp___2 ; { tmp___2 = __kmalloc(size, flags); return (tmp___2); } } __inline static void *kzalloc(size_t size , gfp_t flags ) { void *tmp ; { tmp = kmalloc(size, flags | 32768U); return (tmp); } } extern void *malloc(size_t ) ; extern void *calloc(size_t , size_t ) ; extern int __VERIFIER_nondet_int(void) ; extern unsigned long __VERIFIER_nondet_ulong(void) ; extern void *__VERIFIER_nondet_pointer(void) ; extern void __VERIFIER_assume(int ) ; void *ldv_malloc(size_t size ) { void *p ; void *tmp ; int tmp___0 ; { tmp___0 = __VERIFIER_nondet_int(); if (tmp___0 != 0) { return ((void *)0); } else { tmp = malloc(size); p = tmp; __VERIFIER_assume((unsigned long )p != (unsigned long )((void *)0)); return (p); } } } void *ldv_zalloc(size_t size ) { void *p ; void *tmp ; int tmp___0 ; { tmp___0 = __VERIFIER_nondet_int(); if (tmp___0 != 0) { return ((void *)0); } else { tmp = calloc(1UL, size); p = tmp; __VERIFIER_assume((unsigned long )p != (unsigned long )((void *)0)); return (p); } } } void *ldv_init_zalloc(size_t size ) { void *p ; void *tmp ; { tmp = calloc(1UL, size); p = tmp; __VERIFIER_assume((unsigned long )p != (unsigned long )((void *)0)); return (p); } } void *ldv_memset(void *s , int c , size_t n ) { void *tmp ; { tmp = memset(s, c, n); return (tmp); } } int ldv_undef_int(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); return (tmp); } } void *ldv_undef_ptr(void) { void *tmp ; { tmp = __VERIFIER_nondet_pointer(); return (tmp); } } unsigned long ldv_undef_ulong(void) { unsigned long tmp ; { tmp = __VERIFIER_nondet_ulong(); return (tmp); } } __inline static void ldv_stop(void) { { LDV_STOP: ; goto LDV_STOP; } } __inline static long ldv__builtin_expect(long exp , long c ) { { return (exp); } } struct net_device *mwifiex_cfg80211_ops_group5 ; struct timer_list *ldv_timer_list_7_1 ; struct file *mwifiex_dfs_device_dump_fops_group2 ; int ldv_state_variable_20 ; struct work_struct *ldv_work_struct_3_1 ; struct file *mwifiex_dfs_getlog_fops_group2 ; int ldv_state_variable_0 ; struct timer_list *ldv_timer_list_8_1 ; int ldv_timer_5_2 ; int ldv_work_1_1 ; int ldv_state_variable_12 ; struct timer_list *ldv_timer_list_5_0 ; struct inode *mwifiex_dfs_info_fops_group1 ; struct cfg80211_chan_def *mwifiex_cfg80211_ops_group6 ; int ldv_state_variable_14 ; int ldv_timer_6_2 ; struct timer_list *ldv_timer_list_5_3 ; int ldv_state_variable_17 ; struct work_struct *ldv_work_struct_2_0 ; int ldv_state_variable_19 ; struct work_struct *ldv_work_struct_4_3 ; int ldv_state_variable_9 ; int ldv_timer_6_0 ; struct work_struct *ldv_work_struct_2_2 ; struct inode *mwifiex_dfs_histogram_fops_group1 ; struct timer_list *ldv_timer_list_5_1 ; struct wireless_dev *mwifiex_cfg80211_ops_group0 ; int ref_cnt ; int ldv_work_3_3 ; struct work_struct *ldv_work_struct_4_0 ; int ldv_state_variable_7 ; struct work_struct *ldv_work_struct_3_3 ; struct timer_list *ldv_timer_list_6_3 ; struct inode *mwifiex_dfs_regrdwr_fops_group1 ; struct inode *mwifiex_dfs_hscfg_fops_group1 ; int ldv_timer_8_2 ; struct timer_list *ldv_timer_list_6_2 ; struct work_struct *ldv_work_struct_1_1 ; struct net_device *mwifiex_ethtool_ops_group0 ; struct file *mwifiex_dfs_histogram_fops_group2 ; struct file *mwifiex_dfs_debug_fops_group2 ; struct timer_list *ldv_timer_list_7_3 ; int ldv_work_1_3 ; struct work_struct *ldv_work_struct_2_1 ; int ldv_work_4_0 ; struct work_struct *ldv_work_struct_3_2 ; int ldv_state_variable_6 ; struct inode *mwifiex_dfs_memrw_fops_group1 ; struct work_struct *ldv_work_struct_4_2 ; struct timer_list *ldv_timer_list_6_0 ; struct file *mwifiex_dfs_regrdwr_fops_group2 ; struct timer_list *ldv_timer_list_8_3 ; int ldv_timer_7_1 ; int LDV_IN_INTERRUPT = 1; int ldv_timer_5_3 ; struct inode *mwifiex_dfs_rdeeprom_fops_group1 ; struct timer_list *ldv_timer_list_7_0 ; struct file *mwifiex_dfs_info_fops_group2 ; int ldv_state_variable_3 ; struct inode *mwifiex_dfs_getlog_fops_group1 ; int ldv_work_1_0 ; struct station_info *mwifiex_cfg80211_ops_group1 ; struct inode *mwifiex_dfs_debug_mask_fops_group1 ; int ldv_timer_8_3 ; int ldv_state_variable_4 ; int ldv_work_2_1 ; int ldv_timer_7_3 ; int ldv_state_variable_8 ; int ldv_state_variable_15 ; struct station_parameters *mwifiex_cfg80211_ops_group3 ; struct work_struct *ldv_work_struct_1_3 ; struct timer_list *ldv_timer_list_5_2 ; int ldv_state_variable_21 ; int ldv_state_variable_5 ; int ldv_state_variable_13 ; int ldv_work_3_2 ; int ldv_timer_5_1 ; struct timer_list *ldv_timer_list_7_2 ; int ldv_work_3_0 ; struct ethtool_wolinfo *mwifiex_ethtool_ops_group1 ; struct work_struct *ldv_work_struct_2_3 ; struct timer_list *ldv_timer_list_6_1 ; int ldv_timer_7_0 ; struct file *mwifiex_dfs_hscfg_fops_group2 ; int ldv_state_variable_1 ; int ldv_timer_6_3 ; int ldv_timer_8_0 ; struct work_struct *ldv_work_struct_1_0 ; int ldv_state_variable_10 ; struct inode *mwifiex_dfs_debug_fops_group1 ; int ldv_work_4_1 ; int ldv_work_4_3 ; int ldv_timer_8_1 ; int ldv_state_variable_16 ; int ldv_work_3_1 ; int ldv_state_variable_2 ; int ldv_work_2_0 ; int ldv_timer_5_0 ; struct work_struct *ldv_work_struct_3_0 ; int ldv_work_4_2 ; int ldv_state_variable_11 ; int ldv_timer_7_2 ; int ldv_work_1_2 ; struct wiphy *mwifiex_cfg80211_ops_group2 ; int ldv_state_variable_18 ; struct timer_list *ldv_timer_list_8_0 ; struct work_struct *ldv_work_struct_1_2 ; struct net_device *mwifiex_netdev_ops_group1 ; int ldv_timer_6_1 ; struct file *mwifiex_dfs_memrw_fops_group2 ; int ldv_work_2_2 ; struct file *mwifiex_dfs_rdeeprom_fops_group2 ; struct work_struct *ldv_work_struct_4_1 ; struct vif_params *mwifiex_cfg80211_ops_group4 ; struct file *mwifiex_dfs_debug_mask_fops_group2 ; int ldv_work_2_3 ; struct timer_list *ldv_timer_list_8_2 ; struct inode *mwifiex_dfs_device_dump_fops_group1 ; void work_init_3(void) ; void call_and_disable_work_1(struct work_struct *work ) ; int reg_timer_7(struct timer_list *timer , void (*function)(unsigned long ) , unsigned long data ) ; void ldv_timer_5(int state , struct timer_list *timer ) ; void choose_timer_5(void) ; void call_and_disable_all_2(int state ) ; void ldv_file_operations_15(void) ; void ldv_file_operations_14(void) ; void activate_work_1(struct work_struct *work , int state ) ; void ldv_initialize_cfg80211_ops_20(void) ; void ldv_file_operations_16(void) ; void ldv_file_operations_9(void) ; void timer_init_6(void) ; void ldv_initialize_ethtool_ops_19(void) ; void disable_work_1(struct work_struct *work ) ; void timer_init_5(void) ; void work_init_1(void) ; void ldv_file_operations_17(void) ; void disable_suitable_timer_5(struct timer_list *timer ) ; void ldv_net_device_ops_21(void) ; void ldv_file_operations_12(void) ; void invoke_work_2(void) ; void work_init_2(void) ; void disable_suitable_timer_7(struct timer_list *timer ) ; void call_and_disable_all_1(int state ) ; void activate_work_2(struct work_struct *work , int state ) ; void ldv_file_operations_10(void) ; void timer_init_7(void) ; void ldv_file_operations_18(void) ; void ldv_file_operations_13(void) ; void disable_work_2(struct work_struct *work ) ; void work_init_4(void) ; void invoke_work_1(void) ; void activate_pending_timer_5(struct timer_list *timer , unsigned long data , int pending_flag ) ; void timer_init_8(void) ; int reg_timer_5(struct timer_list *timer , void (*function)(unsigned long ) , unsigned long data ) ; void ldv_file_operations_11(void) ; void activate_suitable_timer_5(struct timer_list *timer , unsigned long data ) ; void activate_pending_timer_7(struct timer_list *timer , unsigned long data , int pending_flag ) ; void call_and_disable_work_2(struct work_struct *work ) ; extern int down_interruptible(struct semaphore * ) ; extern void up(struct semaphore * ) ; extern void _dev_info(struct device const * , char const * , ...) ; extern void kfree_skb(struct sk_buff * ) ; extern struct sk_buff *skb_clone(struct sk_buff * , gfp_t ) ; extern struct sk_buff *skb_realloc_headroom(struct sk_buff * , unsigned int ) ; __inline static unsigned char *skb_end_pointer(struct sk_buff const *skb ) { { return ((unsigned char *)skb->head + (unsigned long )skb->end); } } __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 int skb_shared(struct sk_buff const *skb ) { int tmp ; { tmp = atomic_read(& skb->users); return (tmp != 1); } } extern struct sk_buff *skb_dequeue(struct sk_buff_head * ) ; __inline static unsigned int skb_headroom(struct sk_buff const *skb ) { { return ((unsigned int )((long )skb->data) - (unsigned int )((long )skb->head)); } } __inline static void __net_timestamp(struct sk_buff *skb ) { { skb->__annonCompField68.__annonCompField67.__annonCompField66.tstamp = ktime_get_real(); return; } } __inline static struct netdev_queue *netdev_get_tx_queue(struct net_device const *dev , unsigned int index ) { { return ((struct netdev_queue *)dev->_tx + (unsigned long )index); } } __inline static void *netdev_priv(struct net_device const *dev ) { { return ((void *)dev + 3008U); } } extern void free_netdev(struct net_device * ) ; __inline static void netif_tx_stop_queue(struct netdev_queue *dev_queue ) { { set_bit(0L, (unsigned long volatile *)(& dev_queue->state)); return; } } __inline static bool netif_tx_queue_stopped(struct netdev_queue const *dev_queue ) { int tmp ; { tmp = constant_test_bit(0L, (unsigned long const volatile *)(& dev_queue->state)); return (tmp != 0); } } 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 bool netif_carrier_ok(struct net_device const *dev ) { int tmp ; { tmp = constant_test_bit(2L, (unsigned long const volatile *)(& dev->state)); return (tmp == 0); } } extern void netif_carrier_off(struct net_device * ) ; __inline static bool is_multicast_ether_addr(u8 const *addr ) { u32 a ; { a = *((u32 const *)addr); return ((a & 1U) != 0U); } } __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 bool ether_addr_equal(u8 const *addr1 , u8 const *addr2 ) { u32 fold ; { fold = ((unsigned int )*((u32 const *)addr1) ^ (unsigned int )*((u32 const *)addr2)) | (unsigned int )((int )((unsigned short )*((u16 const *)addr1 + 4U)) ^ (int )((unsigned short )*((u16 const *)addr2 + 4U))); return (fold == 0U); } } __inline static bool ether_addr_equal_unaligned(u8 const *addr1 , u8 const *addr2 ) { bool tmp ; { tmp = ether_addr_equal(addr1, addr2); return (tmp); } } extern void rtnl_lock(void) ; extern void rtnl_unlock(void) ; extern void *vzalloc(unsigned long ) ; extern void vfree(void const * ) ; extern int request_firmware(struct firmware const ** , char const * , struct device * ) ; 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 void dev_coredumpv(struct device * , void const * , size_t , gfp_t ) ; extern void wiphy_unregister(struct wiphy * ) ; extern void wiphy_free(struct wiphy * ) ; extern unsigned int cfg80211_classify8021d(struct sk_buff * , struct cfg80211_qos_map * ) ; extern void cfg80211_scan_done(struct cfg80211_scan_request * , bool ) ; __inline static struct mwifiex_rxinfo *MWIFIEX_SKB_RXCB(struct sk_buff *skb ) { struct mwifiex_cb *cb ; { cb = (struct mwifiex_cb *)(& skb->cb); return (& cb->__annonCompField114.rx_info); } } __inline static struct mwifiex_txinfo *MWIFIEX_SKB_TXCB(struct sk_buff *skb ) { struct mwifiex_cb *cb ; { cb = (struct mwifiex_cb *)(& skb->cb); return (& cb->__annonCompField114.tx_info); } } int mwifiex_debug_info_to_buffer(struct mwifiex_private *priv , char *buf , struct mwifiex_debug_info *info___0 ) ; char const driver_version[18U] ; void mwifiex_process_tx_queue(struct mwifiex_adapter *adapter ) ; int mwifiex_init_lock_list(struct mwifiex_adapter *adapter ) ; void mwifiex_set_trans_start(struct net_device *dev ) ; void mwifiex_stop_net_dev_queue(struct net_device *netdev , struct mwifiex_adapter *adapter ) ; int mwifiex_init_fw(struct mwifiex_adapter *adapter ) ; int mwifiex_init_fw_complete(struct mwifiex_adapter *adapter ) ; int mwifiex_shutdown_drv(struct mwifiex_adapter *adapter ) ; int mwifiex_dnld_fw(struct mwifiex_adapter *adapter , struct mwifiex_fw_image *pmfw ) ; int mwifiex_process_event(struct mwifiex_adapter *adapter ) ; int mwifiex_send_cmd(struct mwifiex_private *priv , u16 cmd_no , u16 cmd_action , u32 cmd_oid , void *data_buf , bool sync ) ; void mwifiex_cmd_timeout_func(unsigned long function_context ) ; int mwifiex_get_debug_info(struct mwifiex_private *priv , struct mwifiex_debug_info *info___0 ) ; int mwifiex_exec_next_cmd(struct mwifiex_adapter *adapter ) ; int mwifiex_process_cmdresp(struct mwifiex_adapter *adapter ) ; int mwifiex_handle_rx_packet(struct mwifiex_adapter *adapter , struct sk_buff *skb ) ; int mwifiex_send_null_packet(struct mwifiex_private *priv , u8 flags ) ; void mwifiex_check_ps_cond(struct mwifiex_adapter *adapter ) ; void mwifiex_process_hs_config(struct mwifiex_adapter *adapter ) ; void mwifiex_hs_activated_event(struct mwifiex_private *priv , u8 activated ) ; void mwifiex_free_curr_bcn(struct mwifiex_private *priv ) ; int is_command_pending(struct mwifiex_adapter *adapter ) ; void mwifiex_init_priv_params(struct mwifiex_private *priv , struct net_device *dev ) ; __inline static struct mwifiex_private *mwifiex_get_priv(struct mwifiex_adapter *adapter , enum mwifiex_bss_role bss_role ) { int i ; { i = 0; goto ldv_60344; ldv_60343: ; if ((unsigned long )adapter->priv[i] != (unsigned long )((struct mwifiex_private *)0)) { if ((unsigned int )bss_role == 255U || ((unsigned long )(adapter->priv[i])->bss_role & 1UL) == (unsigned long )bss_role) { goto ldv_60342; } else { } } else { } i = i + 1; ldv_60344: ; if ((int )adapter->priv_num > i) { goto ldv_60343; } else { } ldv_60342: ; return ((int )adapter->priv_num > i ? adapter->priv[i] : (struct mwifiex_private *)0); } } __inline static struct mwifiex_private *mwifiex_netdev_get_priv(struct net_device *dev ) { void *tmp ; { tmp = netdev_priv((struct net_device const *)dev); return ((struct mwifiex_private *)*((unsigned long *)tmp)); } } int mwifiex_add_card(void *card , struct semaphore *sem , struct mwifiex_if_ops *if_ops , u8 iface_type ) ; int mwifiex_remove_card(struct mwifiex_adapter *adapter , struct semaphore *sem ) ; int mwifiex_request_set_multicast_list(struct mwifiex_private *priv , struct mwifiex_multicast_list *mcast_list ) ; int mwifiex_copy_mcast_addr(struct mwifiex_multicast_list *mlist , struct net_device *dev ) ; int mwifiex_drv_get_driver_version(struct mwifiex_adapter *adapter , char *version , int max_len ) ; int mwifiex_main_process(struct mwifiex_adapter *adapter ) ; int mwifiex_queue_tx_pkt(struct mwifiex_private *priv , struct sk_buff *skb ) ; struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy , char const *name , unsigned char name_assign_type , enum nl80211_iftype type , u32 *flags , struct vif_params *params ) ; int mwifiex_del_virtual_intf(struct wiphy *wiphy , struct wireless_dev *wdev ) ; int mwifiex_init_channel_scan_gap(struct mwifiex_adapter *adapter ) ; int mwifiex_tdls_check_tx(struct mwifiex_private *priv , struct sk_buff *skb ) ; struct sk_buff *mwifiex_clone_skb_for_tx_status(struct mwifiex_private *priv , struct sk_buff *skb , u8 flag , u64 *cookie ) ; void mwifiex_hist_data_reset(struct mwifiex_private *priv ) ; void mwifiex_drv_info_dump(struct mwifiex_adapter *adapter ) ; void mwifiex_upload_device_dump(struct mwifiex_adapter *adapter ) ; void mwifiex_queue_main_work(struct mwifiex_adapter *adapter ) ; void mwifiex_debugfs_init(void) ; void mwifiex_debugfs_remove(void) ; static u16 const mwifiex_1d_to_wmm_queue[8U] = { 1U, 0U, 0U, 1U, 2U, 2U, 3U, 3U}; void mwifiex_wmm_add_buf_txqueue(struct mwifiex_private *priv , struct sk_buff *skb ) ; int mwifiex_wmm_lists_empty(struct mwifiex_adapter *adapter ) ; void mwifiex_wmm_process_tx(struct mwifiex_adapter *adapter ) ; int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter ) ; static unsigned int debug_mask = 7U; char const driver_version[18U] = { 'm', 'w', 'i', 'f', 'i', 'e', 'x', ' ', '1', '.', '0', ' ', '(', '%', 's', ')', ' ', '\000'}; static char *cal_data_cfg ; static unsigned short driver_mode ; static int mwifiex_register(void *card , struct mwifiex_if_ops *if_ops , void **padapter ) { struct mwifiex_adapter *adapter ; int i ; void *tmp ; int tmp___0 ; void *tmp___1 ; { tmp = kzalloc(7456UL, 208U); adapter = (struct mwifiex_adapter *)tmp; if ((unsigned long )adapter == (unsigned long )((struct mwifiex_adapter *)0)) { return (-12); } else { } *padapter = (void *)adapter; adapter->card = card; __memmove((void *)(& adapter->if_ops), (void const *)if_ops, 200UL); adapter->debug_mask = debug_mask; if ((unsigned long )adapter->if_ops.init_if != (unsigned long )((int (*)(struct mwifiex_adapter * ))0)) { tmp___0 = (*(adapter->if_ops.init_if))(adapter); if (tmp___0 != 0) { goto error; } else { } } else { } adapter->priv_num = 0U; i = 0; goto ldv_61032; ldv_61031: tmp___1 = kzalloc(12568UL, 208U); adapter->priv[i] = (struct mwifiex_private *)tmp___1; if ((unsigned long )adapter->priv[i] == (unsigned long )((struct mwifiex_private *)0)) { goto error; } else { } (adapter->priv[i])->adapter = adapter; adapter->priv_num = (u8 )((int )adapter->priv_num + 1); i = i + 1; ldv_61032: ; if (i <= 2) { goto ldv_61031; } else { } mwifiex_init_lock_list(adapter); reg_timer_7(& adapter->cmd_timer, & mwifiex_cmd_timeout_func, (unsigned long )adapter); return (0); error: ; if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: leave mwifiex_register with error\n"); } else { } } else { } i = 0; goto ldv_61035; ldv_61034: kfree((void const *)adapter->priv[i]); i = i + 1; ldv_61035: ; if ((int )adapter->priv_num > i) { goto ldv_61034; } else { } kfree((void const *)adapter); return (-1); } } static int mwifiex_unregister(struct mwifiex_adapter *adapter ) { s32 i ; { if ((unsigned long )adapter->if_ops.cleanup_if != (unsigned long )((void (*)(struct mwifiex_adapter * ))0)) { (*(adapter->if_ops.cleanup_if))(adapter); } else { } ldv_del_timer_sync_10(& adapter->cmd_timer); i = 0; goto ldv_61042; ldv_61041: ; if ((unsigned long )adapter->priv[i] != (unsigned long )((struct mwifiex_private *)0)) { mwifiex_free_curr_bcn(adapter->priv[i]); kfree((void const *)adapter->priv[i]); } else { } i = i + 1; ldv_61042: ; if ((int )adapter->priv_num > i) { goto ldv_61041; } else { } vfree((void const *)adapter->chan_stats); kfree((void const *)adapter); return (0); } } void mwifiex_queue_main_work(struct mwifiex_adapter *adapter ) { unsigned long flags ; raw_spinlock_t *tmp ; { tmp = spinlock_check(& adapter->main_proc_lock); flags = _raw_spin_lock_irqsave(tmp); if (adapter->mwifiex_processing != 0U) { adapter->more_task_flag = 1U; spin_unlock_irqrestore(& adapter->main_proc_lock, flags); } else { spin_unlock_irqrestore(& adapter->main_proc_lock, flags); queue_work(adapter->workqueue, & adapter->main_work); } return; } } static char const __kstrtab_mwifiex_queue_main_work[24U] = { 'm', 'w', 'i', 'f', 'i', 'e', 'x', '_', 'q', 'u', 'e', 'u', 'e', '_', 'm', 'a', 'i', 'n', '_', 'w', 'o', 'r', 'k', '\000'}; struct kernel_symbol const __ksymtab_mwifiex_queue_main_work ; struct kernel_symbol const __ksymtab_mwifiex_queue_main_work = {(unsigned long )(& mwifiex_queue_main_work), (char const *)(& __kstrtab_mwifiex_queue_main_work)}; static void mwifiex_queue_rx_work(struct mwifiex_adapter *adapter ) { unsigned long flags ; raw_spinlock_t *tmp ; { tmp = spinlock_check(& adapter->rx_proc_lock); flags = _raw_spin_lock_irqsave(tmp); if ((int )adapter->rx_processing) { spin_unlock_irqrestore(& adapter->rx_proc_lock, flags); } else { spin_unlock_irqrestore(& adapter->rx_proc_lock, flags); queue_work(adapter->rx_workqueue, & adapter->rx_work); } return; } } static int mwifiex_process_rx(struct mwifiex_adapter *adapter ) { unsigned long flags ; struct sk_buff *skb ; struct mwifiex_rxinfo *rx_info ; raw_spinlock_t *tmp ; int tmp___0 ; raw_spinlock_t *tmp___1 ; { tmp = spinlock_check(& adapter->rx_proc_lock); flags = _raw_spin_lock_irqsave(tmp); if ((int )adapter->rx_processing || (int )adapter->rx_locked) { spin_unlock_irqrestore(& adapter->rx_proc_lock, flags); goto exit_rx_proc; } else { adapter->rx_processing = 1; spin_unlock_irqrestore(& adapter->rx_proc_lock, flags); } goto ldv_61076; ldv_61075: atomic_dec(& adapter->rx_pending); if ((int )adapter->delay_main_work || (unsigned int )adapter->iface_type == 2U) { tmp___0 = atomic_read((atomic_t const *)(& adapter->rx_pending)); if (tmp___0 <= 19) { if ((unsigned long )adapter->if_ops.submit_rem_rx_urbs != (unsigned long )((void (*)(struct mwifiex_adapter * ))0)) { (*(adapter->if_ops.submit_rem_rx_urbs))(adapter); } else { } adapter->delay_main_work = 0; mwifiex_queue_main_work(adapter); } else { } } else { } rx_info = MWIFIEX_SKB_RXCB(skb); if ((unsigned int )rx_info->buf_type == 10U) { if ((unsigned long )adapter->if_ops.deaggr_pkt != (unsigned long )((void (*)(struct mwifiex_adapter * , struct sk_buff * ))0)) { (*(adapter->if_ops.deaggr_pkt))(adapter, skb); } else { } dev_kfree_skb_any(skb); } else { mwifiex_handle_rx_packet(adapter, skb); } ldv_61076: skb = skb_dequeue(& adapter->rx_data_q); if ((unsigned long )skb != (unsigned long )((struct sk_buff *)0)) { goto ldv_61075; } else { } tmp___1 = spinlock_check(& adapter->rx_proc_lock); flags = _raw_spin_lock_irqsave(tmp___1); adapter->rx_processing = 0; spin_unlock_irqrestore(& adapter->rx_proc_lock, flags); exit_rx_proc: ; return (0); } } int mwifiex_main_process(struct mwifiex_adapter *adapter ) { int ret ; unsigned long flags ; raw_spinlock_t *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 ; struct mwifiex_private *tmp___8 ; int tmp___9 ; struct mwifiex_private *tmp___10 ; int tmp___11 ; struct mwifiex_private *tmp___12 ; int tmp___13 ; int tmp___14 ; int tmp___15 ; int tmp___16 ; raw_spinlock_t *tmp___17 ; { ret = 0; tmp = spinlock_check(& adapter->main_proc_lock); flags = _raw_spin_lock_irqsave(tmp); if (adapter->mwifiex_processing != 0U || (int )adapter->main_locked) { adapter->more_task_flag = 1U; spin_unlock_irqrestore(& adapter->main_proc_lock, flags); goto exit_main_proc; } else { adapter->mwifiex_processing = 1U; spin_unlock_irqrestore(& adapter->main_proc_lock, flags); } process_start: ; ldv_61093: ; if ((unsigned int )adapter->hw_status == 4U || (unsigned int )adapter->hw_status == 5U) { goto ldv_61091; } else { } tmp___0 = atomic_read((atomic_t const *)(& adapter->rx_pending)); if (tmp___0 > 49 && (unsigned int )adapter->iface_type != 2U) { adapter->delay_main_work = 1; mwifiex_queue_rx_work(adapter); goto ldv_61091; } else { } if ((unsigned int )adapter->int_status != 0U) { if ((unsigned int )adapter->hs_activated != 0U) { mwifiex_process_hs_config(adapter); } else { } if ((unsigned long )adapter->if_ops.process_int_status != (unsigned long )((int (*)(struct mwifiex_adapter * ))0)) { (*(adapter->if_ops.process_int_status))(adapter); } else { } } else { } if ((int )adapter->rx_work_enabled && (unsigned int )adapter->data_received != 0U) { mwifiex_queue_rx_work(adapter); } else { } if (adapter->ps_state == 3U && ((unsigned int )adapter->pm_wakeup_card_req != 0U && adapter->pm_wakeup_fw_try == 0U)) { tmp___1 = is_command_pending(adapter); if (tmp___1 != 0) { adapter->pm_wakeup_fw_try = 1U; ldv_mod_timer_11(& adapter->wakeup_timer, (unsigned long )jiffies + 750UL); (*(adapter->if_ops.wakeup))(adapter); goto ldv_61092; } else { tmp___2 = skb_queue_empty((struct sk_buff_head const *)(& adapter->tx_data_q)); if (tmp___2 == 0) { adapter->pm_wakeup_fw_try = 1U; ldv_mod_timer_11(& adapter->wakeup_timer, (unsigned long )jiffies + 750UL); (*(adapter->if_ops.wakeup))(adapter); goto ldv_61092; } else { tmp___3 = mwifiex_wmm_lists_empty(adapter); if (tmp___3 == 0) { adapter->pm_wakeup_fw_try = 1U; ldv_mod_timer_11(& adapter->wakeup_timer, (unsigned long )jiffies + 750UL); (*(adapter->if_ops.wakeup))(adapter); goto ldv_61092; } else { } } } } else { } if (((unsigned int )adapter->cmd_resp_received != 0U || (unsigned int )adapter->event_received != 0U) || (unsigned int )adapter->data_received != 0U) { adapter->data_received = 0U; adapter->pm_wakeup_fw_try = 0U; ldv_del_timer_12(& adapter->wakeup_timer); if (adapter->ps_state == 3U) { adapter->ps_state = 0U; } else { } } else { if (adapter->pm_wakeup_fw_try != 0U) { goto ldv_61091; } else { } if (adapter->ps_state != 0U || (unsigned int )adapter->tx_lock_flag != 0U) { goto ldv_61091; } else { } if ((! adapter->scan_chan_gap_enabled && adapter->scan_processing != 0U) || (unsigned int )adapter->data_sent != 0U) { goto _L; } else { tmp___5 = mwifiex_wmm_lists_empty(adapter); if (tmp___5 != 0) { tmp___6 = skb_queue_empty((struct sk_buff_head const *)(& adapter->tx_data_q)); if (tmp___6 != 0) { _L: /* CIL Label */ if ((unsigned int )adapter->cmd_sent != 0U || (unsigned long )adapter->curr_cmd != (unsigned long )((struct cmd_ctrl_node *)0)) { goto ldv_61091; } else { tmp___4 = is_command_pending(adapter); if (tmp___4 == 0) { goto ldv_61091; } else { } } } else { } } else { } } } if ((unsigned int )adapter->event_received != 0U) { adapter->event_received = 0U; mwifiex_process_event(adapter); } else { } if ((unsigned int )adapter->cmd_resp_received != 0U) { adapter->cmd_resp_received = 0U; mwifiex_process_cmdresp(adapter); if ((unsigned int )adapter->hw_status == 2U) { adapter->hw_status = 0; mwifiex_init_fw_complete(adapter); } else { } } else { } if (adapter->ps_state == 1U) { if ((unsigned int )adapter->cmd_sent == 0U && (unsigned long )adapter->curr_cmd == (unsigned long )((struct cmd_ctrl_node *)0)) { mwifiex_check_ps_cond(adapter); } else { } } else { } if (((adapter->ps_state == 3U || adapter->ps_state == 1U) || adapter->ps_state == 2U) || (unsigned int )adapter->tx_lock_flag != 0U) { goto ldv_61092; } else { } if ((unsigned int )adapter->cmd_sent == 0U && (unsigned long )adapter->curr_cmd == (unsigned long )((struct cmd_ctrl_node *)0)) { tmp___7 = mwifiex_exec_next_cmd(adapter); if (tmp___7 == -1) { ret = -1; goto ldv_61091; } else { } } else { } if (((int )adapter->scan_chan_gap_enabled || adapter->scan_processing == 0U) && (unsigned int )adapter->data_sent == 0U) { tmp___9 = skb_queue_empty((struct sk_buff_head const *)(& adapter->tx_data_q)); if (tmp___9 == 0) { mwifiex_process_tx_queue(adapter); if ((unsigned int )adapter->hs_activated != 0U) { adapter->is_hs_configured = 0U; tmp___8 = mwifiex_get_priv(adapter, 255); mwifiex_hs_activated_event(tmp___8, 0); } else { } } else { } } else { } if (((int )adapter->scan_chan_gap_enabled || adapter->scan_processing == 0U) && (unsigned int )adapter->data_sent == 0U) { tmp___11 = mwifiex_wmm_lists_empty(adapter); if (tmp___11 == 0) { mwifiex_wmm_process_tx(adapter); if ((unsigned int )adapter->hs_activated != 0U) { adapter->is_hs_configured = 0U; tmp___10 = mwifiex_get_priv(adapter, 255); mwifiex_hs_activated_event(tmp___10, 0); } else { } } else { } } else { } if (((unsigned int )adapter->delay_null_pkt != 0U && (unsigned int )adapter->cmd_sent == 0U) && (unsigned long )adapter->curr_cmd == (unsigned long )((struct cmd_ctrl_node *)0)) { tmp___14 = is_command_pending(adapter); if (tmp___14 == 0) { tmp___15 = mwifiex_wmm_lists_empty(adapter); if (tmp___15 != 0) { tmp___16 = skb_queue_empty((struct sk_buff_head const *)(& adapter->tx_data_q)); if (tmp___16 != 0) { tmp___12 = mwifiex_get_priv(adapter, 0); tmp___13 = mwifiex_send_null_packet(tmp___12, 9); if (tmp___13 == 0) { adapter->delay_null_pkt = 0U; adapter->ps_state = 3U; } else { } goto ldv_61091; } else { } } else { } } else { } } else { } ldv_61092: ; goto ldv_61093; ldv_61091: tmp___17 = spinlock_check(& adapter->main_proc_lock); flags = _raw_spin_lock_irqsave(tmp___17); if ((unsigned int )adapter->more_task_flag != 0U) { adapter->more_task_flag = 0U; spin_unlock_irqrestore(& adapter->main_proc_lock, flags); goto process_start; } else { } adapter->mwifiex_processing = 0U; spin_unlock_irqrestore(& adapter->main_proc_lock, flags); exit_main_proc: ; if ((unsigned int )adapter->hw_status == 4U) { mwifiex_shutdown_drv(adapter); } else { } return (ret); } } static char const __kstrtab_mwifiex_main_process[21U] = { 'm', 'w', 'i', 'f', 'i', 'e', 'x', '_', 'm', 'a', 'i', 'n', '_', 'p', 'r', 'o', 'c', 'e', 's', 's', '\000'}; struct kernel_symbol const __ksymtab_mwifiex_main_process ; struct kernel_symbol const __ksymtab_mwifiex_main_process = {(unsigned long )(& mwifiex_main_process), (char const *)(& __kstrtab_mwifiex_main_process)}; static void mwifiex_free_adapter(struct mwifiex_adapter *adapter ) { struct _ddebug descriptor ; long tmp ; { if ((unsigned long )adapter == (unsigned long )((struct mwifiex_adapter *)0)) { printk("\vmwifiex: %s: adapter is NULL\n", "mwifiex_free_adapter"); return; } else { } mwifiex_unregister(adapter); descriptor.modname = "mwifiex"; descriptor.function = "mwifiex_free_adapter"; descriptor.filename = "/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/11944/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/mwifiex/main.c"; descriptor.format = "info: %s: free adapter\n"; descriptor.lineno = 424U; descriptor.flags = 0U; tmp = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp != 0L) { __dynamic_pr_debug(& descriptor, "mwifiex: info: %s: free adapter\n", "mwifiex_free_adapter"); } else { } return; } } static void mwifiex_terminate_workqueue(struct mwifiex_adapter *adapter ) { { ldv_flush_workqueue_13(adapter->workqueue); ldv_destroy_workqueue_14(adapter->workqueue); adapter->workqueue = (struct workqueue_struct *)0; if ((unsigned long )adapter->rx_workqueue != (unsigned long )((struct workqueue_struct *)0)) { ldv_flush_workqueue_15(adapter->rx_workqueue); ldv_destroy_workqueue_16(adapter->rx_workqueue); adapter->rx_workqueue = (struct workqueue_struct *)0; } else { } return; } } static void mwifiex_fw_dpc(struct firmware const *firmware , void *context ) { int ret ; char fmt[64U] ; struct mwifiex_private *priv ; struct mwifiex_adapter *adapter ; struct mwifiex_fw_image fw ; struct semaphore *sem ; bool init_failed ; struct wireless_dev *wdev ; int tmp ; int tmp___0 ; int __ret ; wait_queue_t __wait ; long __ret___0 ; long __int ; long tmp___1 ; int tmp___2 ; int tmp___3 ; bool tmp___4 ; bool tmp___5 ; bool tmp___6 ; struct _ddebug descriptor ; long tmp___7 ; int __ret___1 ; wait_queue_t __wait___0 ; long __ret___2 ; long __int___0 ; long tmp___8 ; int tmp___9 ; { adapter = (struct mwifiex_adapter *)context; sem = adapter->card_sem; init_failed = 0; if ((unsigned long )firmware == (unsigned long )((struct firmware const *)0)) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "Failed to get firmware %s\n", (char *)(& adapter->fw_name)); } else { } } else { } goto err_dnld_fw; } else { } memset((void *)(& fw), 0, 32UL); adapter->firmware = firmware; fw.fw_buf = (u8 *)(adapter->firmware)->data; fw.fw_len = (u32 )(adapter->firmware)->size; if ((unsigned long )adapter->if_ops.dnld_fw != (unsigned long )((int (*)(struct mwifiex_adapter * , struct mwifiex_fw_image * ))0)) { ret = (*(adapter->if_ops.dnld_fw))(adapter, & fw); } else { ret = mwifiex_dnld_fw(adapter, & fw); } if (ret == -1) { goto err_dnld_fw; } else { } if ((int )adapter->debug_mask & 1) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "WLAN FW is active\n"); } else { } } else { } if ((unsigned long )cal_data_cfg != (unsigned long )((char *)0)) { tmp = request_firmware(& adapter->cal_data, (char const *)cal_data_cfg, adapter->dev); if (tmp < 0) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "Cal data request_firmware() failed\n"); } else { } } else { } } else { } } else { } if ((unsigned long )adapter->if_ops.enable_int != (unsigned long )((int (*)(struct mwifiex_adapter * ))0)) { tmp___0 = (*(adapter->if_ops.enable_int))(adapter); if (tmp___0 != 0) { goto err_dnld_fw; } else { } } else { } adapter->init_wait_q_woken = 0U; ret = mwifiex_init_fw(adapter); if (ret == -1) { goto err_init_fw; } else if (ret == 0) { adapter->hw_status = 0; goto done; } else { } __ret = 0; __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/11944/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/mwifiex/main.c", 505, 0); if ((unsigned int )adapter->init_wait_q_woken == 0U) { __ret___0 = 0L; INIT_LIST_HEAD(& __wait.task_list); __wait.flags = 0U; ldv_61133: tmp___1 = prepare_to_wait_event(& adapter->init_wait_q, & __wait, 1); __int = tmp___1; if ((unsigned int )adapter->init_wait_q_woken != 0U) { goto ldv_61132; } else { } if (__int != 0L) { __ret___0 = __int; goto ldv_61132; } else { } schedule(); goto ldv_61133; ldv_61132: finish_wait(& adapter->init_wait_q, & __wait); __ret = (int )__ret___0; } else { } if ((unsigned int )adapter->hw_status != 0U) { goto err_init_fw; } else { } priv = adapter->priv[0]; tmp___2 = mwifiex_register_cfg80211(adapter); if (tmp___2 != 0) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cannot register with cfg80211\n"); } else { } } else { } goto err_init_fw; } else { } tmp___3 = mwifiex_init_channel_scan_gap(adapter); if (tmp___3 != 0) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "could not init channel stats table\n"); } else { } } else { } goto err_init_fw; } else { } if ((unsigned int )driver_mode != 0U) { driver_mode = (unsigned int )driver_mode & 7U; driver_mode = (unsigned int )driver_mode | 1U; } else { } rtnl_lock(); wdev = mwifiex_add_virtual_intf(adapter->wiphy, "mlan%d", 1, 2, (u32 *)0U, (struct vif_params *)0); tmp___4 = IS_ERR((void const *)wdev); if ((int )tmp___4) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cannot create default STA interface\n"); } else { } } else { } rtnl_unlock(); goto err_add_intf; } else { } if (((unsigned long )driver_mode & 2UL) != 0UL) { wdev = mwifiex_add_virtual_intf(adapter->wiphy, "uap%d", 1, 3, (u32 *)0U, (struct vif_params *)0); tmp___5 = IS_ERR((void const *)wdev); if ((int )tmp___5) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cannot create AP interface\n"); } else { } } else { } rtnl_unlock(); goto err_add_intf; } else { } } else { } if (((unsigned long )driver_mode & 4UL) != 0UL) { wdev = mwifiex_add_virtual_intf(adapter->wiphy, "p2p%d", 1, 8, (u32 *)0U, (struct vif_params *)0); tmp___6 = IS_ERR((void const *)wdev); if ((int )tmp___6) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cannot create p2p client interface\n"); } else { } } else { } rtnl_unlock(); goto err_add_intf; } else { } } else { } rtnl_unlock(); mwifiex_drv_get_driver_version(adapter, (char *)(& fmt), 63); if ((int )adapter->debug_mask & 1) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "driver_version = %s\n", (char *)(& fmt)); } else { } } else { } goto done; err_add_intf: wiphy_unregister(adapter->wiphy); wiphy_free(adapter->wiphy); err_init_fw: ; if ((unsigned long )adapter->if_ops.disable_int != (unsigned long )((void (*)(struct mwifiex_adapter * ))0)) { (*(adapter->if_ops.disable_int))(adapter); } else { } err_dnld_fw: ; if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: %s: unregister device\n", "mwifiex_fw_dpc"); } else { } } else { } if ((unsigned long )adapter->if_ops.unregister_dev != (unsigned long )((void (*)(struct mwifiex_adapter * ))0)) { (*(adapter->if_ops.unregister_dev))(adapter); } else { } if ((unsigned int )adapter->hw_status == 0U) { descriptor.modname = "mwifiex"; descriptor.function = "mwifiex_fw_dpc"; descriptor.filename = "/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/11944/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/mwifiex/main.c"; descriptor.format = "info: %s: shutdown mwifiex\n"; descriptor.lineno = 579U; descriptor.flags = 0U; tmp___7 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___7 != 0L) { __dynamic_pr_debug(& descriptor, "mwifiex: info: %s: shutdown mwifiex\n", "mwifiex_fw_dpc"); } else { } adapter->init_wait_q_woken = 0U; tmp___9 = mwifiex_shutdown_drv(adapter); if (tmp___9 == -115) { __ret___1 = 0; __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/11944/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/mwifiex/main.c", 584, 0); if ((unsigned int )adapter->init_wait_q_woken == 0U) { __ret___2 = 0L; INIT_LIST_HEAD(& __wait___0.task_list); __wait___0.flags = 0U; ldv_61145: tmp___8 = prepare_to_wait_event(& adapter->init_wait_q, & __wait___0, 1); __int___0 = tmp___8; if ((unsigned int )adapter->init_wait_q_woken != 0U) { goto ldv_61144; } else { } if (__int___0 != 0L) { __ret___2 = __int___0; goto ldv_61144; } else { } schedule(); goto ldv_61145; ldv_61144: finish_wait(& adapter->init_wait_q, & __wait___0); __ret___1 = (int )__ret___2; } else { } } else { } } else { } adapter->surprise_removed = 1; mwifiex_terminate_workqueue(adapter); init_failed = 1; done: ; if ((unsigned long )adapter->cal_data != (unsigned long )((struct firmware const *)0)) { release_firmware(adapter->cal_data); adapter->cal_data = (struct firmware const *)0; } else { } if ((unsigned long )adapter->firmware != (unsigned long )((struct firmware const *)0)) { release_firmware(adapter->firmware); adapter->firmware = (struct firmware const *)0; } else { } if ((int )init_failed) { mwifiex_free_adapter(adapter); } else { } up(sem); return; } } static int mwifiex_init_hw_fw(struct mwifiex_adapter *adapter ) { int ret ; { ret = request_firmware_nowait(& __this_module, 1, (char const *)(& adapter->fw_name), adapter->dev, 208U, (void *)adapter, & mwifiex_fw_dpc); if (ret < 0) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "request_firmware_nowait error %d\n", ret); } else { } } else { } } else { } return (ret); } } static int mwifiex_open(struct net_device *dev ) { { netif_carrier_off(dev); return (0); } } static int mwifiex_close(struct net_device *dev ) { struct mwifiex_private *priv ; struct mwifiex_private *tmp ; { tmp = mwifiex_netdev_get_priv(dev); priv = tmp; if ((unsigned long )priv->scan_request != (unsigned long )((struct cfg80211_scan_request *)0)) { if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "aborting scan on ndo_stop\n"); } else { } } else { } cfg80211_scan_done(priv->scan_request, 1); priv->scan_request = (struct cfg80211_scan_request *)0; priv->scan_aborting = 1; } else { } return (0); } } int mwifiex_queue_tx_pkt(struct mwifiex_private *priv , struct sk_buff *skb ) { struct netdev_queue *txq ; int index ; bool tmp ; int tmp___0 ; int tmp___1 ; { index = (int )mwifiex_1d_to_wmm_queue[skb->priority]; tmp___1 = atomic_add_return(1, (atomic_t *)(& priv->wmm_tx_pending) + (unsigned long )index); if (tmp___1 > 99) { txq = netdev_get_tx_queue((struct net_device const *)priv->netdev, (unsigned int )index); tmp = netif_tx_queue_stopped((struct netdev_queue const *)txq); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { netif_tx_stop_queue(txq); if (((priv->adapter)->debug_mask & 8U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "stop queue: %d\n", index); } else { } } else { } } else { } } else { } atomic_inc(& (priv->adapter)->tx_pending); mwifiex_wmm_add_buf_txqueue(priv, skb); mwifiex_queue_main_work(priv->adapter); return (0); } } struct sk_buff *mwifiex_clone_skb_for_tx_status(struct mwifiex_private *priv , struct sk_buff *skb , u8 flag , u64 *cookie ) { struct sk_buff *orig_skb ; struct mwifiex_txinfo *tx_info ; struct mwifiex_txinfo *orig_tx_info ; unsigned long flags ; int id ; raw_spinlock_t *tmp ; int tmp___0 ; { orig_skb = skb; skb = skb_clone(skb, 32U); if ((unsigned long )skb != (unsigned long )((struct sk_buff *)0)) { tmp = spinlock_check(& priv->ack_status_lock); flags = _raw_spin_lock_irqsave(tmp); id = idr_alloc(& priv->ack_status_frames, (void *)orig_skb, 1, 255, 32U); spin_unlock_irqrestore(& priv->ack_status_lock, flags); if (id >= 0) { tx_info = MWIFIEX_SKB_TXCB(skb); tx_info->ack_frame_id = (u8 )id; tx_info->flags = (u8 )((int )tx_info->flags | (int )flag); orig_tx_info = MWIFIEX_SKB_TXCB(orig_skb); orig_tx_info->ack_frame_id = (u8 )id; orig_tx_info->flags = (u8 )((int )orig_tx_info->flags | (int )flag); if ((unsigned int )flag == 16U && (unsigned long )cookie != (unsigned long )((u64 *)0ULL)) { orig_tx_info->cookie = *cookie; } else { } } else { tmp___0 = skb_shared((struct sk_buff const *)skb); if (tmp___0 != 0) { kfree_skb(orig_skb); } else { kfree_skb(skb); skb = orig_skb; } } } else { skb = orig_skb; } return (skb); } } static int mwifiex_hard_start_xmit(struct sk_buff *skb , struct net_device *dev ) { struct mwifiex_private *priv ; struct mwifiex_private *tmp ; struct sk_buff *new_skb ; struct mwifiex_txinfo *tx_info ; bool multicast ; unsigned int tmp___0 ; long tmp___1 ; unsigned int tmp___2 ; unsigned int tmp___3 ; unsigned char *tmp___4 ; int tmp___5 ; long tmp___6 ; bool tmp___7 ; int tmp___8 ; { tmp = mwifiex_netdev_get_priv(dev); priv = tmp; if (((priv->adapter)->debug_mask & 8U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "data: %lu BSS(%d-%d): Data <= kernel\n", jiffies, (int )priv->bss_type, (int )priv->bss_num); } else { } } else { } if ((int )(priv->adapter)->surprise_removed) { kfree_skb(skb); priv->stats.tx_dropped = priv->stats.tx_dropped + 1UL; return (0); } else { } if (skb->len == 0U || skb->len > 1514U) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Tx: bad skb len %d\n", skb->len); } else { } } else { } kfree_skb(skb); priv->stats.tx_dropped = priv->stats.tx_dropped + 1UL; return (0); } else { } tmp___3 = skb_headroom((struct sk_buff const *)skb); if (tmp___3 <= 99U) { if (((priv->adapter)->debug_mask & 8U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { tmp___0 = skb_headroom((struct sk_buff const *)skb); _dev_info((struct device const *)(priv->adapter)->dev, "data: Tx: insufficient skb headroom %d\n", tmp___0); } else { } } else { } new_skb = skb_realloc_headroom(skb, 100U); tmp___1 = ldv__builtin_expect((unsigned long )new_skb == (unsigned long )((struct sk_buff *)0), 0L); if (tmp___1 != 0L) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Tx: cannot alloca new_skb\n"); } else { } } else { } kfree_skb(skb); priv->stats.tx_dropped = priv->stats.tx_dropped + 1UL; return (0); } else { } kfree_skb(skb); skb = new_skb; if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { tmp___2 = skb_headroom((struct sk_buff const *)skb); _dev_info((struct device const *)(priv->adapter)->dev, "info: new skb headroomd %d\n", tmp___2); } else { } } else { } } else { } tx_info = MWIFIEX_SKB_TXCB(skb); memset((void *)tx_info, 0, 24UL); tx_info->bss_num = priv->bss_num; tx_info->bss_type = priv->bss_type; tx_info->pkt_len = skb->len; multicast = is_multicast_ether_addr((u8 const *)skb->data); if (! multicast && (unsigned long )skb->sk != (unsigned long )((struct sock *)0)) { tmp___4 = skb_end_pointer((struct sk_buff const *)skb); if (((int )((struct skb_shared_info *)tmp___4)->tx_flags & 16) != 0) { if ((unsigned int )(priv->adapter)->fw_api_ver == 15U) { tmp___5 = 1; } else { tmp___5 = 0; } } else { tmp___5 = 0; } } else { tmp___5 = 0; } tmp___6 = ldv__builtin_expect((long )tmp___5, 0L); if (tmp___6 != 0L) { skb = mwifiex_clone_skb_for_tx_status(priv, skb, 8, (u64 *)0ULL); } else { } __net_timestamp(skb); if (((unsigned long )(priv->adapter)->fw_cap_info & 16384UL) != 0UL && (unsigned int )priv->bss_type == 0U) { tmp___7 = ether_addr_equal_unaligned((u8 const *)(& priv->cfg_bssid), (u8 const *)skb->data); if (tmp___7) { tmp___8 = 0; } else { tmp___8 = 1; } if (tmp___8) { if ((int )(priv->adapter)->auto_tdls && (unsigned int )priv->check_tdls_tx != 0U) { mwifiex_tdls_check_tx(priv, skb); } else { } } else { } } else { } mwifiex_queue_tx_pkt(priv, skb); return (0); } } static int mwifiex_set_mac_address(struct net_device *dev , void *addr ) { struct mwifiex_private *priv ; struct mwifiex_private *tmp ; struct sockaddr *hw_addr ; int ret ; { tmp = mwifiex_netdev_get_priv(dev); priv = tmp; hw_addr = (struct sockaddr *)addr; memcpy((void *)(& priv->curr_addr), (void const *)(& hw_addr->sa_data), 6UL); ret = mwifiex_send_cmd(priv, 77, 1, 0U, (void *)0, 1); if (ret == 0) { memcpy((void *)(priv->netdev)->dev_addr, (void const *)(& priv->curr_addr), 6UL); } else if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "set mac address failed: ret=%d\n", ret); } else { } } else { } memcpy((void *)dev->dev_addr, (void const *)(& priv->curr_addr), 6UL); return (ret); } } static void mwifiex_set_multicast_list(struct net_device *dev ) { struct mwifiex_private *priv ; struct mwifiex_private *tmp ; struct mwifiex_multicast_list mcast_list ; int tmp___0 ; { tmp = mwifiex_netdev_get_priv(dev); priv = tmp; if ((dev->flags & 256U) != 0U) { mcast_list.mode = 1U; } else if ((dev->flags & 512U) != 0U || dev->mc.count > 32) { mcast_list.mode = 4U; } else { mcast_list.mode = 2U; tmp___0 = mwifiex_copy_mcast_addr(& mcast_list, dev); mcast_list.num_multicast_addr = (u32 )tmp___0; } mwifiex_request_set_multicast_list(priv, & mcast_list); return; } } static void mwifiex_tx_timeout(struct net_device *dev ) { struct mwifiex_private *priv ; struct mwifiex_private *tmp ; { tmp = mwifiex_netdev_get_priv(dev); priv = tmp; priv->num_tx_timeout = priv->num_tx_timeout + 1U; priv->tx_timeout_cnt = (u8 )((int )priv->tx_timeout_cnt + 1); if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "%lu : Tx timeout(#%d), bss_type-num = %d-%d\n", jiffies, (int )priv->tx_timeout_cnt, (int )priv->bss_type, (int )priv->bss_num); } else { } } else { } mwifiex_set_trans_start(dev); if ((unsigned int )priv->tx_timeout_cnt > 6U && (unsigned long )(priv->adapter)->if_ops.card_reset != (unsigned long )((void (*)(struct mwifiex_adapter * ))0)) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "tx_timeout_cnt exceeds threshold.\tTriggering card reset!\n"); } else { } } else { } (*((priv->adapter)->if_ops.card_reset))(priv->adapter); } else { } return; } } void mwifiex_drv_info_dump(struct mwifiex_adapter *adapter ) { void *p ; char drv_version[64U] ; struct usb_card_rec *cardp ; struct sdio_mmc_card *sdio_card ; struct mwifiex_private *priv ; int i ; int idx ; struct netdev_queue *txq ; struct mwifiex_debug_info *debug_info ; 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 ; bool tmp___25 ; int tmp___26 ; bool tmp___27 ; int tmp___28 ; int tmp___29 ; int tmp___30 ; int tmp___31 ; int tmp___32 ; void *tmp___33 ; int tmp___34 ; { if ((unsigned long )adapter->drv_info_dump != (unsigned long )((void *)0)) { vfree((void const *)adapter->drv_info_dump); adapter->drv_info_dump = (void *)0; adapter->drv_info_size = 0U; } else { } if ((int )adapter->debug_mask & 1) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "===mwifiex driverinfo dump start===\n"); } else { } } else { } adapter->drv_info_dump = vzalloc(262144UL); if ((unsigned long )adapter->drv_info_dump == (unsigned long )((void *)0)) { return; } else { } p = adapter->drv_info_dump; tmp = sprintf((char *)p, "driver_name = \"mwifiex\"\n"); p = p + (unsigned long )tmp; mwifiex_drv_get_driver_version(adapter, (char *)(& drv_version), 63); tmp___0 = sprintf((char *)p, "driver_version = %s\n", (char *)(& drv_version)); p = p + (unsigned long )tmp___0; if ((unsigned int )adapter->iface_type == 2U) { cardp = (struct usb_card_rec *)adapter->card; tmp___1 = atomic_read((atomic_t const *)(& cardp->tx_cmd_urb_pending)); tmp___2 = sprintf((char *)p, "tx_cmd_urb_pending = %d\n", tmp___1); p = p + (unsigned long )tmp___2; tmp___3 = atomic_read((atomic_t const *)(& cardp->tx_data_urb_pending)); tmp___4 = sprintf((char *)p, "tx_data_urb_pending = %d\n", tmp___3); p = p + (unsigned long )tmp___4; tmp___5 = atomic_read((atomic_t const *)(& cardp->rx_cmd_urb_pending)); tmp___6 = sprintf((char *)p, "rx_cmd_urb_pending = %d\n", tmp___5); p = p + (unsigned long )tmp___6; tmp___7 = atomic_read((atomic_t const *)(& cardp->rx_data_urb_pending)); tmp___8 = sprintf((char *)p, "rx_data_urb_pending = %d\n", tmp___7); p = p + (unsigned long )tmp___8; } else { } tmp___9 = atomic_read((atomic_t const *)(& adapter->tx_pending)); tmp___10 = sprintf((char *)p, "tx_pending = %d\n", tmp___9); p = p + (unsigned long )tmp___10; tmp___11 = atomic_read((atomic_t const *)(& adapter->rx_pending)); tmp___12 = sprintf((char *)p, "rx_pending = %d\n", tmp___11); p = p + (unsigned long )tmp___12; if ((unsigned int )adapter->iface_type == 0U) { sdio_card = (struct sdio_mmc_card *)adapter->card; tmp___13 = sprintf((char *)p, "\nmp_rd_bitmap=0x%x curr_rd_port=0x%x\n", sdio_card->mp_rd_bitmap, (int )sdio_card->curr_rd_port); p = p + (unsigned long )tmp___13; tmp___14 = sprintf((char *)p, "mp_wr_bitmap=0x%x curr_wr_port=0x%x\n", sdio_card->mp_wr_bitmap, (int )sdio_card->curr_wr_port); p = p + (unsigned long )tmp___14; } else { } i = 0; goto ldv_61220; ldv_61219: ; if ((unsigned long )adapter->priv[i] == (unsigned long )((struct mwifiex_private *)0) || (unsigned long )(adapter->priv[i])->netdev == (unsigned long )((struct net_device *)0)) { goto ldv_61215; } else { } priv = adapter->priv[i]; tmp___15 = sprintf((char *)p, "\n[interface : \"%s\"]\n", (char *)(& (priv->netdev)->name)); p = p + (unsigned long )tmp___15; tmp___16 = atomic_read((atomic_t const *)(& priv->wmm_tx_pending)); tmp___17 = sprintf((char *)p, "wmm_tx_pending[0] = %d\n", tmp___16); p = p + (unsigned long )tmp___17; tmp___18 = atomic_read((atomic_t const *)(& priv->wmm_tx_pending) + 1U); tmp___19 = sprintf((char *)p, "wmm_tx_pending[1] = %d\n", tmp___18); p = p + (unsigned long )tmp___19; tmp___20 = atomic_read((atomic_t const *)(& priv->wmm_tx_pending) + 2U); tmp___21 = sprintf((char *)p, "wmm_tx_pending[2] = %d\n", tmp___20); p = p + (unsigned long )tmp___21; tmp___22 = atomic_read((atomic_t const *)(& priv->wmm_tx_pending) + 3U); tmp___23 = sprintf((char *)p, "wmm_tx_pending[3] = %d\n", tmp___22); p = p + (unsigned long )tmp___23; tmp___24 = sprintf((char *)p, "media_state=\"%s\"\n", (unsigned int )priv->media_connected == 0U ? (char *)"Disconnected" : (char *)"Connected"); p = p + (unsigned long )tmp___24; tmp___25 = netif_carrier_ok((struct net_device const *)priv->netdev); tmp___26 = sprintf((char *)p, "carrier %s\n", (int )tmp___25 ? (char *)"on" : (char *)"off"); p = p + (unsigned long )tmp___26; idx = 0; goto ldv_61217; ldv_61216: txq = netdev_get_tx_queue((struct net_device const *)priv->netdev, (unsigned int )idx); tmp___27 = netif_tx_queue_stopped((struct netdev_queue const *)txq); tmp___28 = sprintf((char *)p, "tx queue %d:%s ", idx, (int )tmp___27 ? (char *)"stopped" : (char *)"started"); p = p + (unsigned long )tmp___28; idx = idx + 1; ldv_61217: ; if ((unsigned int )idx < (priv->netdev)->num_tx_queues) { goto ldv_61216; } else { } tmp___29 = sprintf((char *)p, "\n%s: num_tx_timeout = %d\n", (char *)(& (priv->netdev)->name), priv->num_tx_timeout); p = p + (unsigned long )tmp___29; ldv_61215: i = i + 1; ldv_61220: ; if ((int )adapter->priv_num > i) { goto ldv_61219; } else { } if ((unsigned int )adapter->iface_type == 0U) { tmp___30 = sprintf((char *)p, "\n=== SDIO register dump===\n"); p = p + (unsigned long )tmp___30; if ((unsigned long )adapter->if_ops.reg_dump != (unsigned long )((int (*)(struct mwifiex_adapter * , char * ))0)) { tmp___31 = (*(adapter->if_ops.reg_dump))(adapter, (char *)p); p = p + (unsigned long )tmp___31; } else { } } else { } tmp___32 = sprintf((char *)p, "\n=== more debug information\n"); p = p + (unsigned long )tmp___32; tmp___33 = kzalloc(4596UL, 208U); debug_info = (struct mwifiex_debug_info *)tmp___33; if ((unsigned long )debug_info != (unsigned long )((struct mwifiex_debug_info *)0)) { i = 0; goto ldv_61225; ldv_61224: ; if ((unsigned long )adapter->priv[i] == (unsigned long )((struct mwifiex_private *)0) || (unsigned long )(adapter->priv[i])->netdev == (unsigned long )((struct net_device *)0)) { goto ldv_61222; } else { } priv = adapter->priv[i]; mwifiex_get_debug_info(priv, debug_info); tmp___34 = mwifiex_debug_info_to_buffer(priv, (char *)p, debug_info); p = p + (unsigned long )tmp___34; goto ldv_61223; ldv_61222: i = i + 1; ldv_61225: ; if ((int )adapter->priv_num > i) { goto ldv_61224; } else { } ldv_61223: kfree((void const *)debug_info); } else { } adapter->drv_info_size = (u32 )((long )p) - (u32 )((long )adapter->drv_info_dump); if ((int )adapter->debug_mask & 1) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "===mwifiex driverinfo dump end===\n"); } else { } } else { } return; } } static char const __kstrtab_mwifiex_drv_info_dump[22U] = { 'm', 'w', 'i', 'f', 'i', 'e', 'x', '_', 'd', 'r', 'v', '_', 'i', 'n', 'f', 'o', '_', 'd', 'u', 'm', 'p', '\000'}; struct kernel_symbol const __ksymtab_mwifiex_drv_info_dump ; struct kernel_symbol const __ksymtab_mwifiex_drv_info_dump = {(unsigned long )(& mwifiex_drv_info_dump), (char const *)(& __kstrtab_mwifiex_drv_info_dump)}; void mwifiex_upload_device_dump(struct mwifiex_adapter *adapter ) { u8 idx ; u8 *dump_data ; u8 *fw_dump_ptr ; u32 dump_len ; size_t tmp ; size_t tmp___0 ; struct memory_type_mapping *entry ; size_t tmp___1 ; size_t tmp___2 ; size_t tmp___3 ; size_t tmp___4 ; void *tmp___5 ; size_t tmp___6 ; size_t tmp___7 ; struct memory_type_mapping *entry___0 ; size_t tmp___8 ; size_t tmp___9 ; size_t tmp___10 ; size_t tmp___11 ; struct memory_type_mapping *entry___1 ; { tmp = strlen("========Start dump driverinfo========\n"); tmp___0 = strlen("\n========End dump========\n"); dump_len = ((u32 )tmp + adapter->drv_info_size) + (u32 )tmp___0; idx = 0U; goto ldv_61242; ldv_61241: entry = adapter->mem_type_mapping_tbl + (unsigned long )idx; if ((unsigned long )entry->mem_ptr != (unsigned long )((u8 *)0U)) { tmp___1 = strlen("========Start dump "); tmp___2 = strlen((char const *)(& entry->mem_name)); tmp___3 = strlen("========\n"); tmp___4 = strlen("\n========End dump========\n"); dump_len = ((((((u32 )tmp___1 + (u32 )tmp___2) + (u32 )tmp___3) + entry->mem_size) + (u32 )tmp___4) + dump_len) + 1U; } else { } idx = (u8 )((int )idx + 1); ldv_61242: ; if ((int )adapter->num_mem_types > (int )idx) { goto ldv_61241; } else { } tmp___5 = vzalloc((unsigned long )(dump_len + 1U)); dump_data = (u8 *)tmp___5; if ((unsigned long )dump_data == (unsigned long )((u8 *)0U)) { goto done; } else { } fw_dump_ptr = dump_data; if ((int )adapter->debug_mask & 1) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "== mwifiex dump information to /sys/class/devcoredump start"); } else { } } else { } strcpy((char *)fw_dump_ptr, "========Start dump driverinfo========\n"); tmp___6 = strlen("========Start dump driverinfo========\n"); fw_dump_ptr = fw_dump_ptr + tmp___6; memcpy((void *)fw_dump_ptr, (void const *)adapter->drv_info_dump, (size_t )adapter->drv_info_size); fw_dump_ptr = fw_dump_ptr + (unsigned long )adapter->drv_info_size; strcpy((char *)fw_dump_ptr, "\n========End dump========\n"); tmp___7 = strlen("\n========End dump========\n"); fw_dump_ptr = fw_dump_ptr + tmp___7; idx = 0U; goto ldv_61247; ldv_61246: entry___0 = adapter->mem_type_mapping_tbl + (unsigned long )idx; if ((unsigned long )entry___0->mem_ptr != (unsigned long )((u8 *)0U)) { strcpy((char *)fw_dump_ptr, "========Start dump "); tmp___8 = strlen("========Start dump "); fw_dump_ptr = fw_dump_ptr + tmp___8; strcpy((char *)fw_dump_ptr, (char const *)(& entry___0->mem_name)); tmp___9 = strlen((char const *)(& entry___0->mem_name)); fw_dump_ptr = fw_dump_ptr + tmp___9; strcpy((char *)fw_dump_ptr, "========\n"); tmp___10 = strlen("========\n"); fw_dump_ptr = fw_dump_ptr + tmp___10; memcpy((void *)fw_dump_ptr, (void const *)entry___0->mem_ptr, (size_t )entry___0->mem_size); fw_dump_ptr = fw_dump_ptr + (unsigned long )entry___0->mem_size; strcpy((char *)fw_dump_ptr, "\n========End dump========\n"); tmp___11 = strlen("\n========End dump========\n"); fw_dump_ptr = fw_dump_ptr + tmp___11; } else { } idx = (u8 )((int )idx + 1); ldv_61247: ; if ((int )adapter->num_mem_types > (int )idx) { goto ldv_61246; } else { } dev_coredumpv(adapter->dev, (void const *)dump_data, (size_t )dump_len, 208U); if ((int )adapter->debug_mask & 1) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "== mwifiex dump information to /sys/class/devcoredump end"); } else { } } else { } done: idx = 0U; goto ldv_61251; ldv_61250: entry___1 = adapter->mem_type_mapping_tbl + (unsigned long )idx; if ((unsigned long )entry___1->mem_ptr != (unsigned long )((u8 *)0U)) { vfree((void const *)entry___1->mem_ptr); entry___1->mem_ptr = (u8 *)0U; } else { } entry___1->mem_size = 0U; idx = (u8 )((int )idx + 1); ldv_61251: ; if ((int )adapter->num_mem_types > (int )idx) { goto ldv_61250; } else { } if ((unsigned long )adapter->drv_info_dump != (unsigned long )((void *)0)) { vfree((void const *)adapter->drv_info_dump); adapter->drv_info_dump = (void *)0; adapter->drv_info_size = 0U; } else { } return; } } static char const __kstrtab_mwifiex_upload_device_dump[27U] = { 'm', 'w', 'i', 'f', 'i', 'e', 'x', '_', 'u', 'p', 'l', 'o', 'a', 'd', '_', 'd', 'e', 'v', 'i', 'c', 'e', '_', 'd', 'u', 'm', 'p', '\000'}; struct kernel_symbol const __ksymtab_mwifiex_upload_device_dump ; struct kernel_symbol const __ksymtab_mwifiex_upload_device_dump = {(unsigned long )(& mwifiex_upload_device_dump), (char const *)(& __kstrtab_mwifiex_upload_device_dump)}; static struct net_device_stats *mwifiex_get_stats(struct net_device *dev ) { struct mwifiex_private *priv ; struct mwifiex_private *tmp ; { tmp = mwifiex_netdev_get_priv(dev); priv = tmp; return (& priv->stats); } } static u16 mwifiex_netdev_select_wmm_queue(struct net_device *dev , struct sk_buff *skb , void *accel_priv , u16 (*fallback)(struct net_device * , struct sk_buff * ) ) { { skb->priority = cfg80211_classify8021d(skb, (struct cfg80211_qos_map *)0); return ((u16 )mwifiex_1d_to_wmm_queue[skb->priority]); } } static struct net_device_ops const mwifiex_netdev_ops = {0, 0, & mwifiex_open, & mwifiex_close, (netdev_tx_t (*)(struct sk_buff * , struct net_device * ))(& mwifiex_hard_start_xmit), & mwifiex_netdev_select_wmm_queue, 0, & mwifiex_set_multicast_list, & mwifiex_set_mac_address, 0, 0, 0, 0, 0, & mwifiex_tx_timeout, 0, & mwifiex_get_stats, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; void mwifiex_init_priv_params(struct mwifiex_private *priv , struct net_device *dev ) { void *tmp ; { dev->netdev_ops = & mwifiex_netdev_ops; dev->destructor = & free_netdev; priv->current_key_index = 0U; priv->media_connected = 0U; memset((void *)(& priv->mgmt_ie), 0, 4192UL); priv->beacon_idx = 65535U; priv->proberesp_idx = 65535U; priv->assocresp_idx = 65535U; priv->gen_idx = 65535U; priv->num_tx_timeout = 0U; ether_addr_copy((u8 *)(& priv->curr_addr), (u8 const *)(& (priv->adapter)->perm_addr)); memcpy((void *)dev->dev_addr, (void const *)(& priv->curr_addr), 6UL); if (((unsigned long )priv->bss_role & 1UL) == 0UL || (int )priv->bss_role & 1) { tmp = kmalloc(3372UL, 208U); priv->hist_data = (struct mwifiex_histogram_data *)tmp; if ((unsigned long )priv->hist_data != (unsigned long )((struct mwifiex_histogram_data *)0)) { mwifiex_hist_data_reset(priv); } else { } } else { } return; } } int is_command_pending(struct mwifiex_adapter *adapter ) { unsigned long flags ; int is_cmd_pend_q_empty ; raw_spinlock_t *tmp ; { tmp = spinlock_check(& adapter->cmd_pending_q_lock); flags = _raw_spin_lock_irqsave(tmp); is_cmd_pend_q_empty = list_empty((struct list_head const *)(& adapter->cmd_pending_q)); spin_unlock_irqrestore(& adapter->cmd_pending_q_lock, flags); return (is_cmd_pend_q_empty == 0); } } static void mwifiex_rx_work_queue(struct work_struct *work ) { struct mwifiex_adapter *adapter ; struct work_struct const *__mptr ; { __mptr = (struct work_struct const *)work; adapter = (struct mwifiex_adapter *)__mptr + 0xfffffffffffffde8UL; if ((int )adapter->surprise_removed) { return; } else { } mwifiex_process_rx(adapter); return; } } static void mwifiex_main_work_queue(struct work_struct *work ) { struct mwifiex_adapter *adapter ; struct work_struct const *__mptr ; { __mptr = (struct work_struct const *)work; adapter = (struct mwifiex_adapter *)__mptr + 0xfffffffffffffe40UL; if ((int )adapter->surprise_removed) { return; } else { } mwifiex_main_process(adapter); return; } } int mwifiex_add_card(void *card , struct semaphore *sem , struct mwifiex_if_ops *if_ops , u8 iface_type ) { struct mwifiex_adapter *adapter ; int tmp ; int tmp___0 ; struct lock_class_key __key ; struct lock_class_key __key___0 ; struct lock_class_key __key___1 ; unsigned int tmp___1 ; unsigned int tmp___2 ; struct lock_class_key __key___2 ; char const *__lock_name ; struct workqueue_struct *tmp___3 ; struct lock_class_key __key___3 ; atomic_long_t __constr_expr_0 ; struct lock_class_key __key___4 ; char const *__lock_name___0 ; struct workqueue_struct *tmp___4 ; struct lock_class_key __key___5 ; atomic_long_t __constr_expr_1 ; int tmp___5 ; int tmp___6 ; struct _ddebug descriptor ; long tmp___7 ; struct _ddebug descriptor___0 ; long tmp___8 ; int __ret ; wait_queue_t __wait ; long __ret___0 ; long __int ; long tmp___9 ; int tmp___10 ; { tmp = down_interruptible(sem); if (tmp != 0) { goto exit_sem_err; } else { } tmp___0 = mwifiex_register(card, if_ops, (void **)(& adapter)); if (tmp___0 != 0) { printk("\vmwifiex: %s: software init failed\n", "mwifiex_add_card"); goto err_init_sw; } else { } adapter->iface_type = iface_type; adapter->card_sem = sem; adapter->hw_status = 1; adapter->surprise_removed = 0; __init_waitqueue_head(& adapter->init_wait_q, "&adapter->init_wait_q", & __key); adapter->is_suspended = 0; adapter->hs_activated = 0U; __init_waitqueue_head(& adapter->hs_activate_wait_q, "&adapter->hs_activate_wait_q", & __key___0); __init_waitqueue_head(& adapter->cmd_wait_q.wait, "&adapter->cmd_wait_q.wait", & __key___1); adapter->cmd_wait_q.status = 0; adapter->scan_wait_q_woken = 0U; tmp___2 = cpumask_weight(cpu_possible_mask); if (tmp___2 > 1U || (unsigned int )adapter->iface_type == 2U) { adapter->rx_work_enabled = 1; tmp___1 = cpumask_weight(cpu_possible_mask); printk("\rmwifiex: rx work enabled, cpus %d\n", tmp___1); } else { } __lock_name = "\"MWIFIEX_WORK_QUEUE\""; tmp___3 = __alloc_workqueue_key("MWIFIEX_WORK_QUEUE", 26U, 1, & __key___2, __lock_name); adapter->workqueue = tmp___3; if ((unsigned long )adapter->workqueue == (unsigned long )((struct workqueue_struct *)0)) { goto err_kmalloc; } else { } __init_work(& adapter->main_work, 0); __constr_expr_0.counter = 137438953408L; adapter->main_work.data = __constr_expr_0; lockdep_init_map(& adapter->main_work.lockdep_map, "(&adapter->main_work)", & __key___3, 0); INIT_LIST_HEAD(& adapter->main_work.entry); adapter->main_work.func = & mwifiex_main_work_queue; if ((int )adapter->rx_work_enabled) { __lock_name___0 = "\"MWIFIEX_RX_WORK_QUEUE\""; tmp___4 = __alloc_workqueue_key("MWIFIEX_RX_WORK_QUEUE", 26U, 1, & __key___4, __lock_name___0); adapter->rx_workqueue = tmp___4; if ((unsigned long )adapter->rx_workqueue == (unsigned long )((struct workqueue_struct *)0)) { goto err_kmalloc; } else { } __init_work(& adapter->rx_work, 0); __constr_expr_1.counter = 137438953408L; adapter->rx_work.data = __constr_expr_1; lockdep_init_map(& adapter->rx_work.lockdep_map, "(&adapter->rx_work)", & __key___5, 0); INIT_LIST_HEAD(& adapter->rx_work.entry); adapter->rx_work.func = & mwifiex_rx_work_queue; } else { } tmp___5 = (*(adapter->if_ops.register_dev))(adapter); if (tmp___5 != 0) { printk("\vmwifiex: %s: failed to register mwifiex device\n", "mwifiex_add_card"); goto err_registerdev; } else { } tmp___6 = mwifiex_init_hw_fw(adapter); if (tmp___6 != 0) { printk("\vmwifiex: %s: firmware init failed\n", "mwifiex_add_card"); goto err_init_fw; } else { } return (0); err_init_fw: descriptor.modname = "mwifiex"; descriptor.function = "mwifiex_add_card"; descriptor.filename = "/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/11944/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/mwifiex/main.c"; descriptor.format = "info: %s: unregister device\n"; descriptor.lineno = 1276U; descriptor.flags = 0U; tmp___7 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___7 != 0L) { __dynamic_pr_debug(& descriptor, "mwifiex: info: %s: unregister device\n", "mwifiex_add_card"); } else { } if ((unsigned long )adapter->if_ops.unregister_dev != (unsigned long )((void (*)(struct mwifiex_adapter * ))0)) { (*(adapter->if_ops.unregister_dev))(adapter); } else { } if ((unsigned int )adapter->hw_status == 0U) { descriptor___0.modname = "mwifiex"; descriptor___0.function = "mwifiex_add_card"; descriptor___0.filename = "/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/11944/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/mwifiex/main.c"; descriptor___0.format = "info: %s: shutdown mwifiex\n"; descriptor___0.lineno = 1280U; descriptor___0.flags = 0U; tmp___8 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___8 != 0L) { __dynamic_pr_debug(& descriptor___0, "mwifiex: info: %s: shutdown mwifiex\n", "mwifiex_add_card"); } else { } adapter->init_wait_q_woken = 0U; tmp___10 = mwifiex_shutdown_drv(adapter); if (tmp___10 == -115) { __ret = 0; __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/11944/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/mwifiex/main.c", 1285, 0); if ((unsigned int )adapter->init_wait_q_woken == 0U) { __ret___0 = 0L; INIT_LIST_HEAD(& __wait.task_list); __wait.flags = 0U; ldv_61329: tmp___9 = prepare_to_wait_event(& adapter->init_wait_q, & __wait, 1); __int = tmp___9; if ((unsigned int )adapter->init_wait_q_woken != 0U) { goto ldv_61328; } else { } if (__int != 0L) { __ret___0 = __int; goto ldv_61328; } else { } schedule(); goto ldv_61329; ldv_61328: finish_wait(& adapter->init_wait_q, & __wait); __ret = (int )__ret___0; } else { } } else { } } else { } err_registerdev: adapter->surprise_removed = 1; mwifiex_terminate_workqueue(adapter); err_kmalloc: mwifiex_free_adapter(adapter); err_init_sw: up(sem); exit_sem_err: ; return (-1); } } static char const __kstrtab_mwifiex_add_card[17U] = { 'm', 'w', 'i', 'f', 'i', 'e', 'x', '_', 'a', 'd', 'd', '_', 'c', 'a', 'r', 'd', '\000'}; struct kernel_symbol const __ksymtab_mwifiex_add_card ; struct kernel_symbol const __ksymtab_mwifiex_add_card = {(unsigned long )(& mwifiex_add_card), (char const *)(& __kstrtab_mwifiex_add_card)}; int mwifiex_remove_card(struct mwifiex_adapter *adapter , struct semaphore *sem ) { struct mwifiex_private *priv ; int i ; int tmp ; bool tmp___0 ; int __ret ; wait_queue_t __wait ; long __ret___0 ; long __int ; long tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; int tmp___6 ; int tmp___7 ; int tmp___8 ; { priv = (struct mwifiex_private *)0; tmp = down_interruptible(sem); if (tmp != 0) { goto exit_sem_err; } else { } if ((unsigned long )adapter == (unsigned long )((struct mwifiex_adapter *)0)) { goto exit_remove; } else { } if ((unsigned long )adapter->if_ops.disable_int != (unsigned long )((void (*)(struct mwifiex_adapter * ))0)) { (*(adapter->if_ops.disable_int))(adapter); } else { } adapter->surprise_removed = 1; mwifiex_terminate_workqueue(adapter); i = 0; goto ldv_61351; ldv_61350: priv = adapter->priv[i]; if ((unsigned long )priv != (unsigned long )((struct mwifiex_private *)0) && (unsigned long )priv->netdev != (unsigned long )((struct net_device *)0)) { mwifiex_stop_net_dev_queue(priv->netdev, adapter); tmp___0 = netif_carrier_ok((struct net_device const *)priv->netdev); if ((int )tmp___0) { netif_carrier_off(priv->netdev); } else { } } else { } i = i + 1; ldv_61351: ; if ((int )adapter->priv_num > i) { goto ldv_61350; } else { } if ((adapter->debug_mask & 16U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cmd: calling mwifiex_shutdown_drv...\n"); } else { } } else { } adapter->init_wait_q_woken = 0U; tmp___2 = mwifiex_shutdown_drv(adapter); if (tmp___2 == -115) { __ret = 0; __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/11944/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/mwifiex/main.c", 1348, 0); if ((unsigned int )adapter->init_wait_q_woken == 0U) { __ret___0 = 0L; INIT_LIST_HEAD(& __wait.task_list); __wait.flags = 0U; ldv_61359: tmp___1 = prepare_to_wait_event(& adapter->init_wait_q, & __wait, 1); __int = tmp___1; if ((unsigned int )adapter->init_wait_q_woken != 0U) { goto ldv_61358; } else { } if (__int != 0L) { __ret___0 = __int; goto ldv_61358; } else { } schedule(); goto ldv_61359; ldv_61358: finish_wait(& adapter->init_wait_q, & __wait); __ret = (int )__ret___0; } else { } } else { } if ((adapter->debug_mask & 16U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cmd: mwifiex_shutdown_drv done\n"); } else { } } else { } tmp___6 = atomic_read((atomic_t const *)(& adapter->rx_pending)); if (tmp___6 != 0) { goto _L; } else { tmp___7 = atomic_read((atomic_t const *)(& adapter->tx_pending)); if (tmp___7 != 0) { goto _L; } else { tmp___8 = atomic_read((atomic_t const *)(& adapter->cmd_pending)); if (tmp___8 != 0) { _L: /* CIL Label */ if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { tmp___3 = atomic_read((atomic_t const *)(& adapter->cmd_pending)); tmp___4 = atomic_read((atomic_t const *)(& adapter->tx_pending)); tmp___5 = atomic_read((atomic_t const *)(& adapter->rx_pending)); _dev_info((struct device const *)adapter->dev, "rx_pending=%d, tx_pending=%d,\tcmd_pending=%d\n", tmp___5, tmp___4, tmp___3); } else { } } else { } } else { } } } i = 0; goto ldv_61364; ldv_61363: priv = adapter->priv[i]; if ((unsigned long )priv == (unsigned long )((struct mwifiex_private *)0)) { goto ldv_61362; } else { } rtnl_lock(); if ((unsigned long )priv->netdev != (unsigned long )((struct net_device *)0) && (unsigned int )priv->wdev.iftype != 0U) { mwifiex_del_virtual_intf(adapter->wiphy, & priv->wdev); } else { } rtnl_unlock(); ldv_61362: i = i + 1; ldv_61364: ; if ((int )adapter->priv_num > i) { goto ldv_61363; } else { } wiphy_unregister(adapter->wiphy); wiphy_free(adapter->wiphy); if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: unregister device\n"); } else { } } else { } if ((unsigned long )adapter->if_ops.unregister_dev != (unsigned long )((void (*)(struct mwifiex_adapter * ))0)) { (*(adapter->if_ops.unregister_dev))(adapter); } else { } if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: free adapter\n"); } else { } } else { } mwifiex_free_adapter(adapter); exit_remove: up(sem); exit_sem_err: ; return (0); } } static char const __kstrtab_mwifiex_remove_card[20U] = { 'm', 'w', 'i', 'f', 'i', 'e', 'x', '_', 'r', 'e', 'm', 'o', 'v', 'e', '_', 'c', 'a', 'r', 'd', '\000'}; struct kernel_symbol const __ksymtab_mwifiex_remove_card ; struct kernel_symbol const __ksymtab_mwifiex_remove_card = {(unsigned long )(& mwifiex_remove_card), (char const *)(& __kstrtab_mwifiex_remove_card)}; static int mwifiex_init_module(void) { { mwifiex_debugfs_init(); return (0); } } static void mwifiex_cleanup_module(void) { { mwifiex_debugfs_remove(); return; } } int ldv_retval_5 ; int ldv_retval_1 ; extern void ldv_initialize(void) ; extern int ldv_ndo_init_21(void) ; void ldv_check_final_state(void) ; int ldv_retval_2 ; extern int ldv_ndo_uninit_21(void) ; void call_and_disable_work_1(struct work_struct *work ) { { if ((ldv_work_1_0 == 2 || ldv_work_1_0 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_1_0) { mwifiex_main_work_queue(work); ldv_work_1_0 = 1; return; } else { } if ((ldv_work_1_1 == 2 || ldv_work_1_1 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_1_1) { mwifiex_main_work_queue(work); ldv_work_1_1 = 1; return; } else { } if ((ldv_work_1_2 == 2 || ldv_work_1_2 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_1_2) { mwifiex_main_work_queue(work); ldv_work_1_2 = 1; return; } else { } if ((ldv_work_1_3 == 2 || ldv_work_1_3 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_1_3) { mwifiex_main_work_queue(work); ldv_work_1_3 = 1; return; } else { } return; } } void ldv_timer_5(int state , struct timer_list *timer ) { { LDV_IN_INTERRUPT = 2; mwifiex_cmd_timeout_func(timer->data); LDV_IN_INTERRUPT = 1; return; } } void choose_timer_5(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_timer_5_0 == 1) { ldv_timer_5_0 = 2; ldv_timer_5(ldv_timer_5_0, ldv_timer_list_5_0); } else { } goto ldv_61418; case 1: ; if (ldv_timer_5_1 == 1) { ldv_timer_5_1 = 2; ldv_timer_5(ldv_timer_5_1, ldv_timer_list_5_1); } else { } goto ldv_61418; case 2: ; if (ldv_timer_5_2 == 1) { ldv_timer_5_2 = 2; ldv_timer_5(ldv_timer_5_2, ldv_timer_list_5_2); } else { } goto ldv_61418; case 3: ; if (ldv_timer_5_3 == 1) { ldv_timer_5_3 = 2; ldv_timer_5(ldv_timer_5_3, ldv_timer_list_5_3); } else { } goto ldv_61418; default: ldv_stop(); } ldv_61418: ; return; } } void call_and_disable_all_2(int state ) { { if (ldv_work_2_0 == state) { call_and_disable_work_2(ldv_work_struct_2_0); } else { } if (ldv_work_2_1 == state) { call_and_disable_work_2(ldv_work_struct_2_1); } else { } if (ldv_work_2_2 == state) { call_and_disable_work_2(ldv_work_struct_2_2); } else { } if (ldv_work_2_3 == state) { call_and_disable_work_2(ldv_work_struct_2_3); } else { } return; } } void activate_work_1(struct work_struct *work , int state ) { { if (ldv_work_1_0 == 0) { ldv_work_struct_1_0 = work; ldv_work_1_0 = state; return; } else { } if (ldv_work_1_1 == 0) { ldv_work_struct_1_1 = work; ldv_work_1_1 = state; return; } else { } if (ldv_work_1_2 == 0) { ldv_work_struct_1_2 = work; ldv_work_1_2 = state; return; } else { } if (ldv_work_1_3 == 0) { ldv_work_struct_1_3 = work; ldv_work_1_3 = state; return; } else { } return; } } void disable_work_1(struct work_struct *work ) { { if ((ldv_work_1_0 == 3 || ldv_work_1_0 == 2) && (unsigned long )ldv_work_struct_1_0 == (unsigned long )work) { ldv_work_1_0 = 1; } else { } if ((ldv_work_1_1 == 3 || ldv_work_1_1 == 2) && (unsigned long )ldv_work_struct_1_1 == (unsigned long )work) { ldv_work_1_1 = 1; } else { } if ((ldv_work_1_2 == 3 || ldv_work_1_2 == 2) && (unsigned long )ldv_work_struct_1_2 == (unsigned long )work) { ldv_work_1_2 = 1; } else { } if ((ldv_work_1_3 == 3 || ldv_work_1_3 == 2) && (unsigned long )ldv_work_struct_1_3 == (unsigned long )work) { ldv_work_1_3 = 1; } else { } return; } } void timer_init_5(void) { { ldv_timer_5_0 = 0; ldv_timer_5_1 = 0; ldv_timer_5_2 = 0; ldv_timer_5_3 = 0; return; } } void work_init_1(void) { { ldv_work_1_0 = 0; ldv_work_1_1 = 0; ldv_work_1_2 = 0; ldv_work_1_3 = 0; return; } } void disable_suitable_timer_5(struct timer_list *timer ) { { if (ldv_timer_5_0 != 0 && (unsigned long )timer == (unsigned long )ldv_timer_list_5_0) { ldv_timer_5_0 = 0; return; } else { } if (ldv_timer_5_1 != 0 && (unsigned long )timer == (unsigned long )ldv_timer_list_5_1) { ldv_timer_5_1 = 0; return; } else { } if (ldv_timer_5_2 != 0 && (unsigned long )timer == (unsigned long )ldv_timer_list_5_2) { ldv_timer_5_2 = 0; return; } else { } if (ldv_timer_5_3 != 0 && (unsigned long )timer == (unsigned long )ldv_timer_list_5_3) { ldv_timer_5_3 = 0; return; } else { } return; } } void ldv_net_device_ops_21(void) { void *tmp ; { tmp = ldv_init_zalloc(3008UL); mwifiex_netdev_ops_group1 = (struct net_device *)tmp; return; } } void invoke_work_2(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_work_2_0 == 2 || ldv_work_2_0 == 3) { ldv_work_2_0 = 4; mwifiex_rx_work_queue(ldv_work_struct_2_0); ldv_work_2_0 = 1; } else { } goto ldv_61451; case 1: ; if (ldv_work_2_1 == 2 || ldv_work_2_1 == 3) { ldv_work_2_1 = 4; mwifiex_rx_work_queue(ldv_work_struct_2_0); ldv_work_2_1 = 1; } else { } goto ldv_61451; case 2: ; if (ldv_work_2_2 == 2 || ldv_work_2_2 == 3) { ldv_work_2_2 = 4; mwifiex_rx_work_queue(ldv_work_struct_2_0); ldv_work_2_2 = 1; } else { } goto ldv_61451; case 3: ; if (ldv_work_2_3 == 2 || ldv_work_2_3 == 3) { ldv_work_2_3 = 4; mwifiex_rx_work_queue(ldv_work_struct_2_0); ldv_work_2_3 = 1; } else { } goto ldv_61451; default: ldv_stop(); } ldv_61451: ; return; } } void work_init_2(void) { { ldv_work_2_0 = 0; ldv_work_2_1 = 0; ldv_work_2_2 = 0; ldv_work_2_3 = 0; return; } } void call_and_disable_all_1(int state ) { { if (ldv_work_1_0 == state) { call_and_disable_work_1(ldv_work_struct_1_0); } else { } if (ldv_work_1_1 == state) { call_and_disable_work_1(ldv_work_struct_1_1); } else { } if (ldv_work_1_2 == state) { call_and_disable_work_1(ldv_work_struct_1_2); } else { } if (ldv_work_1_3 == state) { call_and_disable_work_1(ldv_work_struct_1_3); } else { } return; } } void activate_work_2(struct work_struct *work , int state ) { { if (ldv_work_2_0 == 0) { ldv_work_struct_2_0 = work; ldv_work_2_0 = state; return; } else { } if (ldv_work_2_1 == 0) { ldv_work_struct_2_1 = work; ldv_work_2_1 = state; return; } else { } if (ldv_work_2_2 == 0) { ldv_work_struct_2_2 = work; ldv_work_2_2 = state; return; } else { } if (ldv_work_2_3 == 0) { ldv_work_struct_2_3 = work; ldv_work_2_3 = state; return; } else { } return; } } void disable_work_2(struct work_struct *work ) { { if ((ldv_work_2_0 == 3 || ldv_work_2_0 == 2) && (unsigned long )ldv_work_struct_2_0 == (unsigned long )work) { ldv_work_2_0 = 1; } else { } if ((ldv_work_2_1 == 3 || ldv_work_2_1 == 2) && (unsigned long )ldv_work_struct_2_1 == (unsigned long )work) { ldv_work_2_1 = 1; } else { } if ((ldv_work_2_2 == 3 || ldv_work_2_2 == 2) && (unsigned long )ldv_work_struct_2_2 == (unsigned long )work) { ldv_work_2_2 = 1; } else { } if ((ldv_work_2_3 == 3 || ldv_work_2_3 == 2) && (unsigned long )ldv_work_struct_2_3 == (unsigned long )work) { ldv_work_2_3 = 1; } else { } return; } } void invoke_work_1(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_work_1_0 == 2 || ldv_work_1_0 == 3) { ldv_work_1_0 = 4; mwifiex_main_work_queue(ldv_work_struct_1_0); ldv_work_1_0 = 1; } else { } goto ldv_61475; case 1: ; if (ldv_work_1_1 == 2 || ldv_work_1_1 == 3) { ldv_work_1_1 = 4; mwifiex_main_work_queue(ldv_work_struct_1_0); ldv_work_1_1 = 1; } else { } goto ldv_61475; case 2: ; if (ldv_work_1_2 == 2 || ldv_work_1_2 == 3) { ldv_work_1_2 = 4; mwifiex_main_work_queue(ldv_work_struct_1_0); ldv_work_1_2 = 1; } else { } goto ldv_61475; case 3: ; if (ldv_work_1_3 == 2 || ldv_work_1_3 == 3) { ldv_work_1_3 = 4; mwifiex_main_work_queue(ldv_work_struct_1_0); ldv_work_1_3 = 1; } else { } goto ldv_61475; default: ldv_stop(); } ldv_61475: ; return; } } void activate_pending_timer_5(struct timer_list *timer , unsigned long data , int pending_flag ) { { if ((unsigned long )ldv_timer_list_5_0 == (unsigned long )timer) { if (ldv_timer_5_0 == 2 || pending_flag != 0) { ldv_timer_list_5_0 = timer; ldv_timer_list_5_0->data = data; ldv_timer_5_0 = 1; } else { } return; } else { } if ((unsigned long )ldv_timer_list_5_1 == (unsigned long )timer) { if (ldv_timer_5_1 == 2 || pending_flag != 0) { ldv_timer_list_5_1 = timer; ldv_timer_list_5_1->data = data; ldv_timer_5_1 = 1; } else { } return; } else { } if ((unsigned long )ldv_timer_list_5_2 == (unsigned long )timer) { if (ldv_timer_5_2 == 2 || pending_flag != 0) { ldv_timer_list_5_2 = timer; ldv_timer_list_5_2->data = data; ldv_timer_5_2 = 1; } else { } return; } else { } if ((unsigned long )ldv_timer_list_5_3 == (unsigned long )timer) { if (ldv_timer_5_3 == 2 || pending_flag != 0) { ldv_timer_list_5_3 = timer; ldv_timer_list_5_3->data = data; ldv_timer_5_3 = 1; } else { } return; } else { } activate_suitable_timer_5(timer, data); return; } } int reg_timer_5(struct timer_list *timer , void (*function)(unsigned long ) , unsigned long data ) { { if ((unsigned long )function == (unsigned long )(& mwifiex_cmd_timeout_func)) { activate_suitable_timer_5(timer, data); } else { } return (0); } } void activate_suitable_timer_5(struct timer_list *timer , unsigned long data ) { { if (ldv_timer_5_0 == 0 || ldv_timer_5_0 == 2) { ldv_timer_list_5_0 = timer; ldv_timer_list_5_0->data = data; ldv_timer_5_0 = 1; return; } else { } if (ldv_timer_5_1 == 0 || ldv_timer_5_1 == 2) { ldv_timer_list_5_1 = timer; ldv_timer_list_5_1->data = data; ldv_timer_5_1 = 1; return; } else { } if (ldv_timer_5_2 == 0 || ldv_timer_5_2 == 2) { ldv_timer_list_5_2 = timer; ldv_timer_list_5_2->data = data; ldv_timer_5_2 = 1; return; } else { } if (ldv_timer_5_3 == 0 || ldv_timer_5_3 == 2) { ldv_timer_list_5_3 = timer; ldv_timer_list_5_3->data = data; ldv_timer_5_3 = 1; return; } else { } return; } } void call_and_disable_work_2(struct work_struct *work ) { { if ((ldv_work_2_0 == 2 || ldv_work_2_0 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_2_0) { mwifiex_rx_work_queue(work); ldv_work_2_0 = 1; return; } else { } if ((ldv_work_2_1 == 2 || ldv_work_2_1 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_2_1) { mwifiex_rx_work_queue(work); ldv_work_2_1 = 1; return; } else { } if ((ldv_work_2_2 == 2 || ldv_work_2_2 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_2_2) { mwifiex_rx_work_queue(work); ldv_work_2_2 = 1; return; } else { } if ((ldv_work_2_3 == 2 || ldv_work_2_3 == 3) && (unsigned long )work == (unsigned long )ldv_work_struct_2_3) { mwifiex_rx_work_queue(work); ldv_work_2_3 = 1; return; } else { } return; } } void ldv_main_exported_20(void) ; void ldv_main_exported_11(void) ; void ldv_main_exported_9(void) ; void ldv_main_exported_17(void) ; void ldv_main_exported_12(void) ; void ldv_main_exported_15(void) ; void ldv_main_exported_14(void) ; void ldv_main_exported_18(void) ; void ldv_main_exported_10(void) ; void ldv_main_exported_13(void) ; void ldv_main_exported_16(void) ; void ldv_main_exported_19(void) ; int main(void) { u16 (*ldvarg8)(struct net_device * , struct sk_buff * ) ; struct sk_buff *ldvarg7 ; void *tmp ; struct sk_buff *ldvarg10 ; void *tmp___0 ; void *ldvarg9 ; void *tmp___1 ; void *ldvarg6 ; void *tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; { tmp = ldv_init_zalloc(232UL); ldvarg7 = (struct sk_buff *)tmp; tmp___0 = ldv_init_zalloc(232UL); ldvarg10 = (struct sk_buff *)tmp___0; tmp___1 = ldv_init_zalloc(1UL); ldvarg9 = tmp___1; tmp___2 = ldv_init_zalloc(1UL); ldvarg6 = tmp___2; ldv_initialize(); ldv_memset((void *)(& ldvarg8), 0, 8UL); ldv_state_variable_11 = 0; ldv_state_variable_21 = 0; timer_init_7(); ldv_state_variable_7 = 1; ldv_state_variable_17 = 0; work_init_2(); ldv_state_variable_2 = 1; work_init_1(); ldv_state_variable_1 = 1; ldv_state_variable_18 = 0; ref_cnt = 0; ldv_state_variable_0 = 1; ldv_state_variable_16 = 0; ldv_state_variable_13 = 0; timer_init_6(); ldv_state_variable_6 = 1; work_init_3(); ldv_state_variable_3 = 1; ldv_state_variable_9 = 0; ldv_state_variable_12 = 0; ldv_state_variable_20 = 0; ldv_state_variable_14 = 0; ldv_state_variable_15 = 0; timer_init_8(); ldv_state_variable_8 = 1; work_init_4(); ldv_state_variable_4 = 1; ldv_state_variable_19 = 0; ldv_state_variable_10 = 0; timer_init_5(); ldv_state_variable_5 = 1; ldv_61583: tmp___3 = __VERIFIER_nondet_int(); switch (tmp___3) { case 0: ; if (ldv_state_variable_11 != 0) { ldv_main_exported_11(); } else { } goto ldv_61543; case 1: ; if (ldv_state_variable_21 != 0) { tmp___4 = __VERIFIER_nondet_int(); switch (tmp___4) { case 0: ; if (ldv_state_variable_21 == 1) { mwifiex_set_multicast_list(mwifiex_netdev_ops_group1); ldv_state_variable_21 = 1; } else { } if (ldv_state_variable_21 == 3) { mwifiex_set_multicast_list(mwifiex_netdev_ops_group1); ldv_state_variable_21 = 3; } else { } if (ldv_state_variable_21 == 2) { mwifiex_set_multicast_list(mwifiex_netdev_ops_group1); ldv_state_variable_21 = 2; } else { } goto ldv_61546; case 1: ; if (ldv_state_variable_21 == 3) { mwifiex_close(mwifiex_netdev_ops_group1); ldv_state_variable_21 = 2; } else { } goto ldv_61546; case 2: ; if (ldv_state_variable_21 == 1) { mwifiex_get_stats(mwifiex_netdev_ops_group1); ldv_state_variable_21 = 1; } else { } if (ldv_state_variable_21 == 3) { mwifiex_get_stats(mwifiex_netdev_ops_group1); ldv_state_variable_21 = 3; } else { } if (ldv_state_variable_21 == 2) { mwifiex_get_stats(mwifiex_netdev_ops_group1); ldv_state_variable_21 = 2; } else { } goto ldv_61546; case 3: ; if (ldv_state_variable_21 == 1) { mwifiex_netdev_select_wmm_queue(mwifiex_netdev_ops_group1, ldvarg10, ldvarg9, ldvarg8); ldv_state_variable_21 = 1; } else { } if (ldv_state_variable_21 == 3) { mwifiex_netdev_select_wmm_queue(mwifiex_netdev_ops_group1, ldvarg10, ldvarg9, ldvarg8); ldv_state_variable_21 = 3; } else { } if (ldv_state_variable_21 == 2) { mwifiex_netdev_select_wmm_queue(mwifiex_netdev_ops_group1, ldvarg10, ldvarg9, ldvarg8); ldv_state_variable_21 = 2; } else { } goto ldv_61546; case 4: ; if (ldv_state_variable_21 == 2) { ldv_retval_2 = mwifiex_open(mwifiex_netdev_ops_group1); if (ldv_retval_2 == 0) { ldv_state_variable_21 = 3; } else { } } else { } goto ldv_61546; case 5: ; if (ldv_state_variable_21 == 3) { mwifiex_hard_start_xmit(ldvarg7, mwifiex_netdev_ops_group1); ldv_state_variable_21 = 3; } else { } goto ldv_61546; case 6: ; if (ldv_state_variable_21 == 1) { mwifiex_set_mac_address(mwifiex_netdev_ops_group1, ldvarg6); ldv_state_variable_21 = 1; } else { } if (ldv_state_variable_21 == 3) { mwifiex_set_mac_address(mwifiex_netdev_ops_group1, ldvarg6); ldv_state_variable_21 = 3; } else { } if (ldv_state_variable_21 == 2) { mwifiex_set_mac_address(mwifiex_netdev_ops_group1, ldvarg6); ldv_state_variable_21 = 2; } else { } goto ldv_61546; case 7: ; if (ldv_state_variable_21 == 1) { mwifiex_tx_timeout(mwifiex_netdev_ops_group1); ldv_state_variable_21 = 1; } else { } if (ldv_state_variable_21 == 3) { mwifiex_tx_timeout(mwifiex_netdev_ops_group1); ldv_state_variable_21 = 3; } else { } if (ldv_state_variable_21 == 2) { mwifiex_tx_timeout(mwifiex_netdev_ops_group1); ldv_state_variable_21 = 2; } else { } goto ldv_61546; case 8: ; if (ldv_state_variable_21 == 1) { ldv_retval_1 = ldv_ndo_init_21(); if (ldv_retval_1 == 0) { ldv_state_variable_21 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_61546; case 9: ; if (ldv_state_variable_21 == 2) { ldv_ndo_uninit_21(); ldv_state_variable_21 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_61546; default: ldv_stop(); } ldv_61546: ; } else { } goto ldv_61543; case 2: ; goto ldv_61543; case 3: ; if (ldv_state_variable_17 != 0) { ldv_main_exported_17(); } else { } goto ldv_61543; case 4: ; if (ldv_state_variable_2 != 0) { invoke_work_2(); } else { } goto ldv_61543; case 5: ; if (ldv_state_variable_1 != 0) { invoke_work_1(); } else { } goto ldv_61543; case 6: ; if (ldv_state_variable_18 != 0) { ldv_main_exported_18(); } else { } goto ldv_61543; case 7: ; if (ldv_state_variable_0 != 0) { tmp___5 = __VERIFIER_nondet_int(); switch (tmp___5) { case 0: ; if (ldv_state_variable_0 == 2 && ref_cnt == 0) { mwifiex_cleanup_module(); ldv_state_variable_0 = 3; goto ldv_final; } else { } goto ldv_61565; case 1: ; if (ldv_state_variable_0 == 1) { ldv_retval_5 = mwifiex_init_module(); if (ldv_retval_5 != 0) { ldv_state_variable_0 = 3; goto ldv_final; } else { } if (ldv_retval_5 == 0) { ldv_state_variable_0 = 2; ldv_state_variable_16 = 1; ldv_file_operations_16(); ldv_state_variable_13 = 1; ldv_file_operations_13(); ldv_state_variable_10 = 1; ldv_file_operations_10(); ldv_state_variable_19 = 1; ldv_initialize_ethtool_ops_19(); ldv_state_variable_18 = 1; ldv_file_operations_18(); ldv_state_variable_14 = 1; ldv_file_operations_14(); ldv_state_variable_15 = 1; ldv_file_operations_15(); ldv_state_variable_20 = 1; ldv_initialize_cfg80211_ops_20(); ldv_state_variable_12 = 1; ldv_file_operations_12(); ldv_state_variable_17 = 1; ldv_file_operations_17(); ldv_state_variable_9 = 1; ldv_file_operations_9(); ldv_state_variable_21 = 1; ldv_net_device_ops_21(); ldv_state_variable_11 = 1; ldv_file_operations_11(); } else { } } else { } goto ldv_61565; default: ldv_stop(); } ldv_61565: ; } else { } goto ldv_61543; case 8: ; if (ldv_state_variable_16 != 0) { ldv_main_exported_16(); } else { } goto ldv_61543; case 9: ; if (ldv_state_variable_13 != 0) { ldv_main_exported_13(); } else { } goto ldv_61543; case 10: ; goto ldv_61543; case 11: ; goto ldv_61543; case 12: ; if (ldv_state_variable_9 != 0) { ldv_main_exported_9(); } else { } goto ldv_61543; case 13: ; if (ldv_state_variable_12 != 0) { ldv_main_exported_12(); } else { } goto ldv_61543; case 14: ; if (ldv_state_variable_20 != 0) { ldv_main_exported_20(); } else { } goto ldv_61543; case 15: ; if (ldv_state_variable_14 != 0) { ldv_main_exported_14(); } else { } goto ldv_61543; case 16: ; if (ldv_state_variable_15 != 0) { ldv_main_exported_15(); } else { } goto ldv_61543; case 17: ; goto ldv_61543; case 18: ; goto ldv_61543; case 19: ; if (ldv_state_variable_19 != 0) { ldv_main_exported_19(); } else { } goto ldv_61543; case 20: ; if (ldv_state_variable_10 != 0) { ldv_main_exported_10(); } else { } goto ldv_61543; case 21: ; if (ldv_state_variable_5 != 0) { choose_timer_5(); } else { } goto ldv_61543; default: ldv_stop(); } ldv_61543: ; goto ldv_61583; ldv_final: ldv_check_final_state(); return 0; } } __inline static bool IS_ERR(void const *ptr ) { bool tmp ; { tmp = ldv_is_err(ptr); return (tmp); } } bool ldv_queue_work_on_5(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_6(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_7(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_8(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_9(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } int ldv_del_timer_sync_10(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_7(ldv_func_arg1); return (ldv_func_res); } } int ldv_mod_timer_11(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_7(ldv_func_arg1, ldv_func_arg2, 1); return (ldv_func_res); } } int ldv_del_timer_12(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___5 ldv_func_res ; int tmp ; { tmp = del_timer(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_7(ldv_func_arg1); return (ldv_func_res); } } void ldv_flush_workqueue_13(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } void ldv_destroy_workqueue_14(struct workqueue_struct *ldv_func_arg1 ) { { destroy_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } void ldv_flush_workqueue_15(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } void ldv_destroy_workqueue_16(struct workqueue_struct *ldv_func_arg1 ) { { destroy_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } 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 * ) ; __inline static void atomic_set(atomic_t *v , int i ) { { v->counter = i; return; } } extern void __raw_spin_lock_init(raw_spinlock_t * , char const * , struct lock_class_key * ) ; extern void _raw_spin_lock(raw_spinlock_t * ) ; extern void _raw_spin_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 * ) ; int ldv_del_timer_38(struct timer_list *ldv_func_arg1 ) ; int ldv_del_timer_sync_39(struct timer_list *ldv_func_arg1 ) ; bool ldv_queue_work_on_33(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_35(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_34(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_37(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_36(struct workqueue_struct *ldv_func_arg1 ) ; extern void idr_init(struct idr * ) ; void activate_suitable_timer_6(struct timer_list *timer , unsigned long data ) ; void disable_suitable_timer_6(struct timer_list *timer ) ; void activate_pending_timer_6(struct timer_list *timer , unsigned long data , int pending_flag ) ; void choose_timer_6(void) ; int reg_timer_6(struct timer_list *timer , void (*function)(unsigned long ) , unsigned long data ) ; void ldv_timer_6(int state , struct timer_list *timer ) ; __inline static void __skb_queue_head_init(struct sk_buff_head *list ) { struct sk_buff *tmp ; { tmp = (struct sk_buff *)list; list->next = tmp; list->prev = tmp; list->qlen = 0U; return; } } __inline static void skb_queue_head_init(struct sk_buff_head *list ) { struct lock_class_key __key ; { spinlock_check(& list->lock); __raw_spin_lock_init(& list->lock.__annonCompField18.rlock, "&(&list->lock)->rlock", & __key); __skb_queue_head_init(list); return; } } extern unsigned char *skb_put(struct sk_buff * , unsigned int ) ; __inline static void skb_reserve(struct sk_buff *skb , int len ) { { skb->data = skb->data + (unsigned long )len; skb->tail = skb->tail + (sk_buff_data_t )len; return; } } extern struct sk_buff *__netdev_alloc_skb(struct net_device * , unsigned int , gfp_t ) ; __inline static struct sk_buff *netdev_alloc_skb(struct net_device *dev , unsigned int length ) { struct sk_buff *tmp ; { tmp = __netdev_alloc_skb(dev, length, 32U); return (tmp); } } __inline static struct sk_buff *dev_alloc_skb(unsigned int length ) { struct sk_buff *tmp ; { tmp = netdev_alloc_skb((struct net_device *)0, length); return (tmp); } } extern void netif_tx_wake_queue(struct netdev_queue * ) ; __inline static void eth_broadcast_addr(u8 *addr ) { { memset((void *)addr, 255, 6UL); return; } } void mwifiex_wake_up_net_dev_queue(struct net_device *netdev , struct mwifiex_adapter *adapter ) ; int mwifiex_init_priv(struct mwifiex_private *priv ) ; void mwifiex_free_priv(struct mwifiex_private *priv ) ; int mwifiex_shutdown_fw_complete(struct mwifiex_adapter *adapter ) ; int mwifiex_alloc_cmd_buffer(struct mwifiex_adapter *adapter ) ; int mwifiex_free_cmd_buffer(struct mwifiex_adapter *adapter ) ; void mwifiex_cancel_all_pending_cmd(struct mwifiex_adapter *adapter ) ; void mwifiex_recycle_cmd_node(struct mwifiex_adapter *adapter , struct cmd_ctrl_node *cmd_node ) ; int mwifiex_write_data_complete(struct mwifiex_adapter *adapter , struct sk_buff *skb , int aggr , int status ) ; void mwifiex_clean_txrx(struct mwifiex_private *priv ) ; int mwifiex_sta_init_cmd(struct mwifiex_private *priv , u8 first_sta , bool init ) ; void mwifiex_init_11h_params(struct mwifiex_private *priv ) ; void mwifiex_clean_auto_tdls(struct mwifiex_private *priv ) ; void mwifiex_abort_cac(struct mwifiex_private *priv ) ; static u8 const tos_to_tid_inv[8U] = { 2U, 0U, 1U, 3U, 4U, 5U, 6U, 7U}; void mwifiex_wmm_init(struct mwifiex_adapter *adapter ) ; static int mwifiex_add_bss_prio_tbl(struct mwifiex_private *priv ) { struct mwifiex_adapter *adapter ; struct mwifiex_bss_prio_node *bss_prio ; struct mwifiex_bss_prio_tbl *tbl ; unsigned long flags ; void *tmp ; raw_spinlock_t *tmp___0 ; { adapter = priv->adapter; tbl = (struct mwifiex_bss_prio_tbl *)(& adapter->bss_prio_tbl); tmp = kzalloc(24UL, 208U); bss_prio = (struct mwifiex_bss_prio_node *)tmp; if ((unsigned long )bss_prio == (unsigned long )((struct mwifiex_bss_prio_node *)0)) { return (-12); } else { } bss_prio->priv = priv; INIT_LIST_HEAD(& bss_prio->list); tmp___0 = spinlock_check(& (tbl + (unsigned long )priv->bss_priority)->bss_prio_lock); flags = _raw_spin_lock_irqsave(tmp___0); list_add_tail(& bss_prio->list, & (tbl + (unsigned long )priv->bss_priority)->bss_prio_head); spin_unlock_irqrestore(& (tbl + (unsigned long )priv->bss_priority)->bss_prio_lock, flags); return (0); } } static void wakeup_timer_fn(unsigned long data ) { struct mwifiex_adapter *adapter ; { adapter = (struct mwifiex_adapter *)data; if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "Firmware wakeup failed\n"); } else { } } else { } adapter->hw_status = 3; mwifiex_cancel_all_pending_cmd(adapter); if ((unsigned long )adapter->if_ops.card_reset != (unsigned long )((void (*)(struct mwifiex_adapter * ))0)) { (*(adapter->if_ops.card_reset))(adapter); } else { } return; } } int mwifiex_init_priv(struct mwifiex_private *priv ) { u32 i ; int tmp ; { priv->media_connected = 0U; eth_broadcast_addr((u8 *)(& priv->curr_addr)); priv->pkt_tx_ctrl = 0U; priv->bss_mode = 0U; priv->data_rate = 0U; priv->is_data_rate_auto = 1U; priv->bcn_avg_factor = 8U; priv->data_avg_factor = 8U; priv->sec_info.wep_enabled = 0U; priv->sec_info.authentication_mode = 0U; priv->sec_info.encryption_mode = 0U; i = 0U; goto ldv_60958; ldv_60957: memset((void *)(& priv->wep_key) + (unsigned long )i, 0, 28UL); i = i + 1U; ldv_60958: ; if (i <= 3U) { goto ldv_60957; } else { } priv->wep_key_curr_index = 0U; priv->curr_pkt_filter = 19U; priv->beacon_period = 100U; priv->attempted_bss_desc = (struct mwifiex_bssdescriptor *)0; memset((void *)(& priv->curr_bss_params), 0, 360UL); priv->listen_interval = 10U; memset((void *)(& priv->prev_ssid), 0, 33UL); memset((void *)(& priv->prev_bssid), 0, 6UL); memset((void *)(& priv->assoc_rsp_buf), 0, 500UL); priv->assoc_rsp_size = 0U; priv->adhoc_channel = 6U; priv->atim_window = 0U; priv->adhoc_state = 0U; priv->tx_power_level = 0U; priv->max_tx_power_level = 0U; priv->min_tx_power_level = 0U; priv->tx_rate = 0U; priv->rxpd_htinfo = 0U; priv->rxpd_rate = 0U; priv->rate_bitmap = 0U; priv->data_rssi_last = 0; priv->data_rssi_avg = 0; priv->data_nf_avg = 0; priv->data_nf_last = 0; priv->bcn_rssi_last = 0; priv->bcn_rssi_avg = 0; priv->bcn_nf_avg = 0; priv->bcn_nf_last = 0; memset((void *)(& priv->wpa_ie), 0, 256UL); memset((void *)(& priv->aes_key), 0, 62UL); priv->wpa_ie_len = 0U; priv->wpa_is_gtk_set = 0U; memset((void *)(& priv->assoc_tlv_buf), 0, 256UL); priv->assoc_tlv_buf_len = 0U; memset((void *)(& priv->wps), 0, 1UL); memset((void *)(& priv->gen_ie_buf), 0, 256UL); priv->gen_ie_buf_len = 0U; memset((void *)(& priv->vs_ie), 0, 2080UL); priv->wmm_required = 1U; priv->wmm_enabled = 0U; priv->wmm_qosinfo = 0U; priv->curr_bcn_buf = (u8 *)0U; priv->curr_bcn_size = 0U; priv->wps_ie = (u8 *)0U; priv->wps_ie_len = 0U; priv->ap_11n_enabled = 0U; memset((void *)(& priv->roc_cfg), 0, 72UL); priv->scan_block = 0U; priv->csa_chan = 0U; priv->csa_expire_time = 0UL; priv->del_list_idx = 0U; priv->hs2_enabled = 0; priv->check_tdls_tx = 0U; memcpy((void *)(& priv->tos_to_tid_inv), (void const *)(& tos_to_tid_inv), 8UL); mwifiex_init_11h_params(priv); tmp = mwifiex_add_bss_prio_tbl(priv); return (tmp); } } static int mwifiex_allocate_adapter(struct mwifiex_adapter *adapter ) { int ret ; { ret = mwifiex_alloc_cmd_buffer(adapter); if (ret != 0) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "%s: failed to alloc cmd buffer\n", "mwifiex_allocate_adapter"); } else { } } else { } return (-1); } else { } adapter->sleep_cfm = dev_alloc_skb(16U); if ((unsigned long )adapter->sleep_cfm == (unsigned long )((struct sk_buff *)0)) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "%s: failed to alloc sleep cfm\t cmd buffer\n", "mwifiex_allocate_adapter"); } else { } } else { } return (-1); } else { } skb_reserve(adapter->sleep_cfm, 4); return (0); } } static void mwifiex_init_adapter(struct mwifiex_adapter *adapter ) { struct mwifiex_opt_sleep_confirm *sleep_cfm_buf ; { sleep_cfm_buf = (struct mwifiex_opt_sleep_confirm *)0; skb_put(adapter->sleep_cfm, 12U); adapter->cmd_sent = 0U; if ((unsigned int )adapter->iface_type == 0U) { adapter->data_sent = 1U; } else { adapter->data_sent = 0U; } adapter->cmd_resp_received = 0U; adapter->event_received = 0U; adapter->data_received = 0U; adapter->surprise_removed = 0; adapter->hw_status = 1; adapter->ps_mode = 0U; adapter->ps_state = 0U; adapter->need_to_wakeup = 0U; adapter->scan_mode = 3U; adapter->specific_scan_time = 30U; adapter->active_scan_time = 30U; adapter->passive_scan_time = 110U; adapter->scan_chan_gap_time = 50U; adapter->scan_probes = 1U; adapter->multiple_dtim = 1U; adapter->local_listen_interval = 0U; adapter->is_deep_sleep = 0U; adapter->delay_null_pkt = 0U; adapter->delay_to_ps = 1000U; adapter->enhanced_ps_mode = 1U; adapter->gen_null_pkt = 0U; adapter->pps_uapsd_mode = 0U; adapter->pm_wakeup_card_req = 0U; adapter->pm_wakeup_fw_try = 0U; adapter->curr_tx_buf_size = 2048U; adapter->is_hs_configured = 0U; adapter->hs_cfg.conditions = 0U; adapter->hs_cfg.gpio = 255U; adapter->hs_cfg.gap = 255U; adapter->hs_activated = 0U; memset((void *)(& adapter->event_body), 0, 2048UL); adapter->hw_dot_11n_dev_cap = 0U; adapter->hw_dev_mcs_support = 0U; adapter->sec_chan_offset = 0U; adapter->adhoc_11n_enabled = 0U; mwifiex_wmm_init(adapter); sleep_cfm_buf = (struct mwifiex_opt_sleep_confirm *)(adapter->sleep_cfm)->data; memset((void *)sleep_cfm_buf, 0, (size_t )(adapter->sleep_cfm)->len); sleep_cfm_buf->command = 228U; sleep_cfm_buf->size = (unsigned short )(adapter->sleep_cfm)->len; sleep_cfm_buf->result = 0U; sleep_cfm_buf->action = 5U; sleep_cfm_buf->resp_ctrl = 1U; memset((void *)(& adapter->sleep_params), 0, 10UL); memset((void *)(& adapter->sleep_period), 0, 4UL); adapter->tx_lock_flag = 0U; adapter->null_pkt_interval = 0U; adapter->fw_bands = 0U; adapter->config_bands = 0U; adapter->adhoc_start_band = 0U; adapter->scan_channels = (struct mwifiex_chan_scan_param_set *)0; adapter->fw_release_number = 0U; adapter->fw_cap_info = 0U; memset((void *)(& adapter->upld_buf), 0, 2312UL); adapter->event_cause = 0U; adapter->region_code = 0U; adapter->bcn_miss_time_out = 5U; adapter->adhoc_awake_period = 0U; memset((void *)(& adapter->arp_filter), 0, 68UL); adapter->arp_filter_size = 0U; adapter->max_mgmt_ie_index = 16U; adapter->key_api_major_ver = 0U; adapter->key_api_minor_ver = 0U; eth_broadcast_addr((u8 *)(& adapter->perm_addr)); adapter->iface_limit.sta_intf = 1U; adapter->iface_limit.uap_intf = 1U; adapter->iface_limit.p2p_intf = 1U; reg_timer_7(& adapter->wakeup_timer, & wakeup_timer_fn, (unsigned long )adapter); return; } } void mwifiex_set_trans_start(struct net_device *dev ) { int i ; struct netdev_queue *tmp ; { i = 0; goto ldv_60974; ldv_60973: tmp = netdev_get_tx_queue((struct net_device const *)dev, (unsigned int )i); tmp->trans_start = jiffies; i = i + 1; ldv_60974: ; if ((unsigned int )i < dev->num_tx_queues) { goto ldv_60973; } else { } dev->trans_start = jiffies; return; } } void mwifiex_wake_up_net_dev_queue(struct net_device *netdev , struct mwifiex_adapter *adapter ) { unsigned long dev_queue_flags ; unsigned int i ; raw_spinlock_t *tmp ; struct netdev_queue *txq ; struct netdev_queue *tmp___0 ; bool tmp___1 ; { tmp = spinlock_check(& adapter->queue_lock); dev_queue_flags = _raw_spin_lock_irqsave(tmp); i = 0U; goto ldv_60987; ldv_60986: tmp___0 = netdev_get_tx_queue((struct net_device const *)netdev, i); txq = tmp___0; tmp___1 = netif_tx_queue_stopped((struct netdev_queue const *)txq); if ((int )tmp___1) { netif_tx_wake_queue(txq); } else { } i = i + 1U; ldv_60987: ; if (netdev->num_tx_queues > i) { goto ldv_60986; } else { } spin_unlock_irqrestore(& adapter->queue_lock, dev_queue_flags); return; } } void mwifiex_stop_net_dev_queue(struct net_device *netdev , struct mwifiex_adapter *adapter ) { unsigned long dev_queue_flags ; unsigned int i ; raw_spinlock_t *tmp ; struct netdev_queue *txq ; struct netdev_queue *tmp___0 ; bool tmp___1 ; int tmp___2 ; { tmp = spinlock_check(& adapter->queue_lock); dev_queue_flags = _raw_spin_lock_irqsave(tmp); i = 0U; goto ldv_61000; ldv_60999: tmp___0 = netdev_get_tx_queue((struct net_device const *)netdev, i); txq = tmp___0; tmp___1 = netif_tx_queue_stopped((struct netdev_queue const *)txq); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { netif_tx_stop_queue(txq); } else { } i = i + 1U; ldv_61000: ; if (netdev->num_tx_queues > i) { goto ldv_60999; } else { } spin_unlock_irqrestore(& adapter->queue_lock, dev_queue_flags); return; } } static void mwifiex_free_lock_list(struct mwifiex_adapter *adapter ) { struct mwifiex_private *priv ; s32 i ; s32 j ; { list_del(& adapter->cmd_free_q); list_del(& adapter->cmd_pending_q); list_del(& adapter->scan_pending_q); i = 0; goto ldv_61009; ldv_61008: list_del(& adapter->bss_prio_tbl[i].bss_prio_head); i = i + 1; ldv_61009: ; if ((int )adapter->priv_num > i) { goto ldv_61008; } else { } i = 0; goto ldv_61015; ldv_61014: ; if ((unsigned long )adapter->priv[i] != (unsigned long )((struct mwifiex_private *)0)) { priv = adapter->priv[i]; j = 0; goto ldv_61012; ldv_61011: list_del(& priv->wmm.tid_tbl_ptr[j].ra_list); j = j + 1; ldv_61012: ; if (j <= 7) { goto ldv_61011; } else { } list_del(& priv->tx_ba_stream_tbl_ptr); list_del(& priv->rx_reorder_tbl_ptr); list_del(& priv->sta_list); list_del(& priv->auto_tdls_list); } else { } i = i + 1; ldv_61015: ; if ((int )adapter->priv_num > i) { goto ldv_61014; } else { } return; } } static void mwifiex_adapter_cleanup(struct mwifiex_adapter *adapter ) { int idx ; struct memory_type_mapping *entry ; { if ((unsigned long )adapter == (unsigned long )((struct mwifiex_adapter *)0)) { printk("\vmwifiex: %s: adapter is NULL\n", "mwifiex_adapter_cleanup"); return; } else { } ldv_del_timer_38(& adapter->wakeup_timer); mwifiex_cancel_all_pending_cmd(adapter); __wake_up(& adapter->cmd_wait_q.wait, 1U, 1, (void *)0); __wake_up(& adapter->hs_activate_wait_q, 1U, 1, (void *)0); mwifiex_free_lock_list(adapter); if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: free cmd buffer\n"); } else { } } else { } mwifiex_free_cmd_buffer(adapter); idx = 0; goto ldv_61024; ldv_61023: entry = adapter->mem_type_mapping_tbl + (unsigned long )idx; if ((unsigned long )entry->mem_ptr != (unsigned long )((u8 *)0U)) { vfree((void const *)entry->mem_ptr); entry->mem_ptr = (u8 *)0U; } else { } entry->mem_size = 0U; idx = idx + 1; ldv_61024: ; if ((int )adapter->num_mem_types > idx) { goto ldv_61023; } else { } if ((unsigned long )adapter->drv_info_dump != (unsigned long )((void *)0)) { vfree((void const *)adapter->drv_info_dump); adapter->drv_info_dump = (void *)0; adapter->drv_info_size = 0U; } else { } if ((unsigned long )adapter->sleep_cfm != (unsigned long )((struct sk_buff *)0)) { dev_kfree_skb_any(adapter->sleep_cfm); } else { } return; } } int mwifiex_init_lock_list(struct mwifiex_adapter *adapter ) { struct mwifiex_private *priv ; s32 i ; s32 j ; struct lock_class_key __key ; 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 ; struct lock_class_key __key___6 ; struct lock_class_key __key___7 ; struct lock_class_key __key___8 ; struct lock_class_key __key___9 ; struct lock_class_key __key___10 ; struct lock_class_key __key___11 ; struct lock_class_key __key___12 ; struct lock_class_key __key___13 ; struct lock_class_key __key___14 ; struct lock_class_key __key___15 ; struct lock_class_key __key___16 ; { spinlock_check(& adapter->mwifiex_lock); __raw_spin_lock_init(& adapter->mwifiex_lock.__annonCompField18.rlock, "&(&adapter->mwifiex_lock)->rlock", & __key); spinlock_check(& adapter->int_lock); __raw_spin_lock_init(& adapter->int_lock.__annonCompField18.rlock, "&(&adapter->int_lock)->rlock", & __key___0); spinlock_check(& adapter->main_proc_lock); __raw_spin_lock_init(& adapter->main_proc_lock.__annonCompField18.rlock, "&(&adapter->main_proc_lock)->rlock", & __key___1); spinlock_check(& adapter->mwifiex_cmd_lock); __raw_spin_lock_init(& adapter->mwifiex_cmd_lock.__annonCompField18.rlock, "&(&adapter->mwifiex_cmd_lock)->rlock", & __key___2); spinlock_check(& adapter->queue_lock); __raw_spin_lock_init(& adapter->queue_lock.__annonCompField18.rlock, "&(&adapter->queue_lock)->rlock", & __key___3); i = 0; goto ldv_61043; ldv_61042: ; if ((unsigned long )adapter->priv[i] != (unsigned long )((struct mwifiex_private *)0)) { priv = adapter->priv[i]; spinlock_check(& priv->rx_pkt_lock); __raw_spin_lock_init(& priv->rx_pkt_lock.__annonCompField18.rlock, "&(&priv->rx_pkt_lock)->rlock", & __key___4); spinlock_check(& priv->wmm.ra_list_spinlock); __raw_spin_lock_init(& priv->wmm.ra_list_spinlock.__annonCompField18.rlock, "&(&priv->wmm.ra_list_spinlock)->rlock", & __key___5); spinlock_check(& priv->curr_bcn_buf_lock); __raw_spin_lock_init(& priv->curr_bcn_buf_lock.__annonCompField18.rlock, "&(&priv->curr_bcn_buf_lock)->rlock", & __key___6); spinlock_check(& priv->sta_list_spinlock); __raw_spin_lock_init(& priv->sta_list_spinlock.__annonCompField18.rlock, "&(&priv->sta_list_spinlock)->rlock", & __key___7); spinlock_check(& priv->auto_tdls_lock); __raw_spin_lock_init(& priv->auto_tdls_lock.__annonCompField18.rlock, "&(&priv->auto_tdls_lock)->rlock", & __key___8); } else { } i = i + 1; ldv_61043: ; if ((int )adapter->priv_num > i) { goto ldv_61042; } else { } INIT_LIST_HEAD(& adapter->cmd_free_q); INIT_LIST_HEAD(& adapter->cmd_pending_q); INIT_LIST_HEAD(& adapter->scan_pending_q); spinlock_check(& adapter->cmd_free_q_lock); __raw_spin_lock_init(& adapter->cmd_free_q_lock.__annonCompField18.rlock, "&(&adapter->cmd_free_q_lock)->rlock", & __key___9); spinlock_check(& adapter->cmd_pending_q_lock); __raw_spin_lock_init(& adapter->cmd_pending_q_lock.__annonCompField18.rlock, "&(&adapter->cmd_pending_q_lock)->rlock", & __key___10); spinlock_check(& adapter->scan_pending_q_lock); __raw_spin_lock_init(& adapter->scan_pending_q_lock.__annonCompField18.rlock, "&(&adapter->scan_pending_q_lock)->rlock", & __key___11); spinlock_check(& adapter->rx_proc_lock); __raw_spin_lock_init(& adapter->rx_proc_lock.__annonCompField18.rlock, "&(&adapter->rx_proc_lock)->rlock", & __key___12); skb_queue_head_init(& adapter->rx_data_q); skb_queue_head_init(& adapter->tx_data_q); i = 0; goto ldv_61051; ldv_61050: INIT_LIST_HEAD(& adapter->bss_prio_tbl[i].bss_prio_head); spinlock_check(& adapter->bss_prio_tbl[i].bss_prio_lock); __raw_spin_lock_init(& adapter->bss_prio_tbl[i].bss_prio_lock.__annonCompField18.rlock, "&(&adapter->bss_prio_tbl[i].bss_prio_lock)->rlock", & __key___13); i = i + 1; ldv_61051: ; if ((int )adapter->priv_num > i) { goto ldv_61050; } else { } i = 0; goto ldv_61061; ldv_61060: ; if ((unsigned long )adapter->priv[i] == (unsigned long )((struct mwifiex_private *)0)) { goto ldv_61053; } else { } priv = adapter->priv[i]; j = 0; goto ldv_61055; ldv_61054: INIT_LIST_HEAD(& priv->wmm.tid_tbl_ptr[j].ra_list); j = j + 1; ldv_61055: ; if (j <= 7) { goto ldv_61054; } else { } INIT_LIST_HEAD(& priv->tx_ba_stream_tbl_ptr); INIT_LIST_HEAD(& priv->rx_reorder_tbl_ptr); INIT_LIST_HEAD(& priv->sta_list); INIT_LIST_HEAD(& priv->auto_tdls_list); skb_queue_head_init(& priv->tdls_txq); spinlock_check(& priv->tx_ba_stream_tbl_lock); __raw_spin_lock_init(& priv->tx_ba_stream_tbl_lock.__annonCompField18.rlock, "&(&priv->tx_ba_stream_tbl_lock)->rlock", & __key___14); spinlock_check(& priv->rx_reorder_tbl_lock); __raw_spin_lock_init(& priv->rx_reorder_tbl_lock.__annonCompField18.rlock, "&(&priv->rx_reorder_tbl_lock)->rlock", & __key___15); spinlock_check(& priv->ack_status_lock); __raw_spin_lock_init(& priv->ack_status_lock.__annonCompField18.rlock, "&(&priv->ack_status_lock)->rlock", & __key___16); idr_init(& priv->ack_status_frames); ldv_61053: i = i + 1; ldv_61061: ; if ((int )adapter->priv_num > i) { goto ldv_61060; } else { } return (0); } } int mwifiex_init_fw(struct mwifiex_adapter *adapter ) { int ret ; struct mwifiex_private *priv ; u8 i ; u8 first_sta ; int is_cmd_pend_q_empty ; unsigned long flags ; int tmp ; raw_spinlock_t *tmp___0 ; int tmp___1 ; { first_sta = 1U; adapter->hw_status = 1; ret = mwifiex_allocate_adapter(adapter); if (ret != 0) { return (-1); } else { } mwifiex_init_adapter(adapter); i = 0U; goto ldv_61073; ldv_61072: ; if ((unsigned long )adapter->priv[(int )i] != (unsigned long )((struct mwifiex_private *)0)) { priv = adapter->priv[(int )i]; ret = mwifiex_init_priv(priv); if (ret != 0) { return (-1); } else { } } else { } i = (u8 )((int )i + 1); ldv_61073: ; if ((int )adapter->priv_num > (int )i) { goto ldv_61072; } else { } if ((unsigned long )adapter->if_ops.init_fw_port != (unsigned long )((int (*)(struct mwifiex_adapter * ))0)) { tmp = (*(adapter->if_ops.init_fw_port))(adapter); if (tmp != 0) { return (-1); } else { } } else { } i = 0U; goto ldv_61076; ldv_61075: ; if ((unsigned long )adapter->priv[(int )i] != (unsigned long )((struct mwifiex_private *)0)) { ret = mwifiex_sta_init_cmd(adapter->priv[(int )i], (int )first_sta, 1); if (ret == -1) { return (-1); } else { } first_sta = 0U; } else { } i = (u8 )((int )i + 1); ldv_61076: ; if ((int )adapter->priv_num > (int )i) { goto ldv_61075; } else { } tmp___0 = spinlock_check(& adapter->cmd_pending_q_lock); flags = _raw_spin_lock_irqsave(tmp___0); is_cmd_pend_q_empty = list_empty((struct list_head const *)(& adapter->cmd_pending_q)); spin_unlock_irqrestore(& adapter->cmd_pending_q_lock, flags); if (is_cmd_pend_q_empty == 0) { tmp___1 = mwifiex_main_process(adapter); if (tmp___1 != -1) { ret = -115; } else { } } else { adapter->hw_status = 0; } return (ret); } } static void mwifiex_delete_bss_prio_tbl(struct mwifiex_private *priv ) { int i ; struct mwifiex_adapter *adapter ; struct mwifiex_bss_prio_node *bssprio_node ; struct mwifiex_bss_prio_node *tmp_node ; struct list_head *head ; spinlock_t *lock ; unsigned long flags ; raw_spinlock_t *tmp ; int tmp___0 ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; { adapter = priv->adapter; i = 0; goto ldv_61105; ldv_61104: head = & adapter->bss_prio_tbl[i].bss_prio_head; lock = & adapter->bss_prio_tbl[i].bss_prio_lock; if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: delete BSS priority table,\tbss_type = %d, bss_num = %d, i = %d,\thead = %p\n", (int )priv->bss_type, (int )priv->bss_num, i, head); } else { } } else { } tmp = spinlock_check(lock); flags = _raw_spin_lock_irqsave(tmp); tmp___0 = list_empty((struct list_head const *)head); if (tmp___0 != 0) { spin_unlock_irqrestore(lock, flags); goto ldv_61094; } else { } __mptr = (struct list_head const *)head->next; bssprio_node = (struct mwifiex_bss_prio_node *)__mptr; __mptr___0 = (struct list_head const *)bssprio_node->list.next; tmp_node = (struct mwifiex_bss_prio_node *)__mptr___0; goto ldv_61102; ldv_61101: ; if ((unsigned long )bssprio_node->priv == (unsigned long )priv) { if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: Delete\tnode %p, next = %p\n", bssprio_node, tmp_node); } else { } } else { } list_del(& bssprio_node->list); kfree((void const *)bssprio_node); } else { } bssprio_node = tmp_node; __mptr___1 = (struct list_head const *)tmp_node->list.next; tmp_node = (struct mwifiex_bss_prio_node *)__mptr___1; ldv_61102: ; if ((unsigned long )(& bssprio_node->list) != (unsigned long )head) { goto ldv_61101; } else { } spin_unlock_irqrestore(lock, flags); ldv_61094: i = i + 1; ldv_61105: ; if ((int )adapter->priv_num > i) { goto ldv_61104; } else { } return; } } void mwifiex_free_priv(struct mwifiex_private *priv ) { { mwifiex_clean_txrx(priv); mwifiex_delete_bss_prio_tbl(priv); mwifiex_free_curr_bcn(priv); return; } } int mwifiex_shutdown_drv(struct mwifiex_adapter *adapter ) { int ret ; struct mwifiex_private *priv ; s32 i ; unsigned long flags ; struct sk_buff *skb ; raw_spinlock_t *tmp ; struct mwifiex_rxinfo *rx_info ; struct mwifiex_rxinfo *tmp___0 ; { ret = -115; if ((unsigned int )adapter->hw_status == 5U) { return (0); } else { } adapter->hw_status = 4; if (adapter->mwifiex_processing != 0U) { if ((adapter->debug_mask & 536870912U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "main process is still running\n"); } else { } } else { } return (ret); } else { } if ((unsigned long )adapter->curr_cmd != (unsigned long )((struct cmd_ctrl_node *)0)) { if ((adapter->debug_mask & 536870912U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "curr_cmd is still in processing\n"); } else { } } else { } ldv_del_timer_sync_39(& adapter->cmd_timer); mwifiex_recycle_cmd_node(adapter, adapter->curr_cmd); adapter->curr_cmd = (struct cmd_ctrl_node *)0; } else { } if ((int )adapter->debug_mask & 1) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: shutdown mwifiex...\n"); } else { } } else { } i = 0; goto ldv_61119; ldv_61118: ; if ((unsigned long )adapter->priv[i] != (unsigned long )((struct mwifiex_private *)0)) { priv = adapter->priv[i]; mwifiex_clean_auto_tdls(priv); mwifiex_abort_cac(priv); mwifiex_clean_txrx(priv); mwifiex_delete_bss_prio_tbl(priv); } else { } i = i + 1; ldv_61119: ; if ((int )adapter->priv_num > i) { goto ldv_61118; } else { } atomic_set(& adapter->tx_queued, 0); goto ldv_61122; ldv_61121: mwifiex_write_data_complete(adapter, skb, 0, 0); ldv_61122: skb = skb_dequeue(& adapter->tx_data_q); if ((unsigned long )skb != (unsigned long )((struct sk_buff *)0)) { goto ldv_61121; } else { } tmp = spinlock_check(& adapter->rx_proc_lock); flags = _raw_spin_lock_irqsave(tmp); goto ldv_61129; ldv_61128: tmp___0 = MWIFIEX_SKB_RXCB(skb); rx_info = tmp___0; atomic_dec(& adapter->rx_pending); priv = adapter->priv[(int )rx_info->bss_num]; if ((unsigned long )priv != (unsigned long )((struct mwifiex_private *)0)) { priv->stats.rx_dropped = priv->stats.rx_dropped + 1UL; } else { } dev_kfree_skb_any(skb); ldv_61129: skb = skb_dequeue(& adapter->rx_data_q); if ((unsigned long )skb != (unsigned long )((struct sk_buff *)0)) { goto ldv_61128; } else { } spin_unlock_irqrestore(& adapter->rx_proc_lock, flags); spin_lock(& adapter->mwifiex_lock); mwifiex_adapter_cleanup(adapter); spin_unlock(& adapter->mwifiex_lock); ret = mwifiex_shutdown_fw_complete(adapter); return (ret); } } int mwifiex_dnld_fw(struct mwifiex_adapter *adapter , struct mwifiex_fw_image *pmfw ) { int ret ; u32 poll_num ; { poll_num = 1U; if ((unsigned long )adapter->if_ops.check_fw_status != (unsigned long )((int (*)(struct mwifiex_adapter * , u32 ))0)) { adapter->winner = 0; ret = (*(adapter->if_ops.check_fw_status))(adapter, poll_num); if (ret == 0) { if ((int )adapter->debug_mask & 1) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "WLAN FW already running! Skip FW dnld\n"); } else { } } else { } return (0); } else { } poll_num = 100U; if (adapter->winner == 0) { if ((int )adapter->debug_mask & 1) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "FW already running! Skip FW dnld\n"); } else { } } else { } goto poll_fw; } else { } } else { } if ((unsigned long )pmfw != (unsigned long )((struct mwifiex_fw_image *)0)) { ret = (*(adapter->if_ops.prog_fw))(adapter, pmfw); if (ret != 0) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "prog_fw failed ret=%#x\n", ret); } else { } } else { } return (ret); } else { } } else { } poll_fw: ret = (*(adapter->if_ops.check_fw_status))(adapter, poll_num); if (ret != 0) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "FW failed to be active in time\n"); } else { } } else { } } else { } return (ret); } } void activate_suitable_timer_6(struct timer_list *timer , unsigned long data ) { { if (ldv_timer_6_0 == 0 || ldv_timer_6_0 == 2) { ldv_timer_list_6_0 = timer; ldv_timer_list_6_0->data = data; ldv_timer_6_0 = 1; return; } else { } if (ldv_timer_6_1 == 0 || ldv_timer_6_1 == 2) { ldv_timer_list_6_1 = timer; ldv_timer_list_6_1->data = data; ldv_timer_6_1 = 1; return; } else { } if (ldv_timer_6_2 == 0 || ldv_timer_6_2 == 2) { ldv_timer_list_6_2 = timer; ldv_timer_list_6_2->data = data; ldv_timer_6_2 = 1; return; } else { } if (ldv_timer_6_3 == 0 || ldv_timer_6_3 == 2) { ldv_timer_list_6_3 = timer; ldv_timer_list_6_3->data = data; ldv_timer_6_3 = 1; return; } else { } return; } } void timer_init_6(void) { { ldv_timer_6_0 = 0; ldv_timer_6_1 = 0; ldv_timer_6_2 = 0; ldv_timer_6_3 = 0; return; } } void disable_suitable_timer_6(struct timer_list *timer ) { { if (ldv_timer_6_0 != 0 && (unsigned long )timer == (unsigned long )ldv_timer_list_6_0) { ldv_timer_6_0 = 0; return; } else { } if (ldv_timer_6_1 != 0 && (unsigned long )timer == (unsigned long )ldv_timer_list_6_1) { ldv_timer_6_1 = 0; return; } else { } if (ldv_timer_6_2 != 0 && (unsigned long )timer == (unsigned long )ldv_timer_list_6_2) { ldv_timer_6_2 = 0; return; } else { } if (ldv_timer_6_3 != 0 && (unsigned long )timer == (unsigned long )ldv_timer_list_6_3) { ldv_timer_6_3 = 0; return; } else { } return; } } void activate_pending_timer_6(struct timer_list *timer , unsigned long data , int pending_flag ) { { if ((unsigned long )ldv_timer_list_6_0 == (unsigned long )timer) { if (ldv_timer_6_0 == 2 || pending_flag != 0) { ldv_timer_list_6_0 = timer; ldv_timer_list_6_0->data = data; ldv_timer_6_0 = 1; } else { } return; } else { } if ((unsigned long )ldv_timer_list_6_1 == (unsigned long )timer) { if (ldv_timer_6_1 == 2 || pending_flag != 0) { ldv_timer_list_6_1 = timer; ldv_timer_list_6_1->data = data; ldv_timer_6_1 = 1; } else { } return; } else { } if ((unsigned long )ldv_timer_list_6_2 == (unsigned long )timer) { if (ldv_timer_6_2 == 2 || pending_flag != 0) { ldv_timer_list_6_2 = timer; ldv_timer_list_6_2->data = data; ldv_timer_6_2 = 1; } else { } return; } else { } if ((unsigned long )ldv_timer_list_6_3 == (unsigned long )timer) { if (ldv_timer_6_3 == 2 || pending_flag != 0) { ldv_timer_list_6_3 = timer; ldv_timer_list_6_3->data = data; ldv_timer_6_3 = 1; } else { } return; } else { } activate_suitable_timer_6(timer, data); return; } } void choose_timer_6(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_timer_6_0 == 1) { ldv_timer_6_0 = 2; ldv_timer_6(ldv_timer_6_0, ldv_timer_list_6_0); } else { } goto ldv_61157; case 1: ; if (ldv_timer_6_1 == 1) { ldv_timer_6_1 = 2; ldv_timer_6(ldv_timer_6_1, ldv_timer_list_6_1); } else { } goto ldv_61157; case 2: ; if (ldv_timer_6_2 == 1) { ldv_timer_6_2 = 2; ldv_timer_6(ldv_timer_6_2, ldv_timer_list_6_2); } else { } goto ldv_61157; case 3: ; if (ldv_timer_6_3 == 1) { ldv_timer_6_3 = 2; ldv_timer_6(ldv_timer_6_3, ldv_timer_list_6_3); } else { } goto ldv_61157; default: ldv_stop(); } ldv_61157: ; return; } } int reg_timer_6(struct timer_list *timer , void (*function)(unsigned long ) , unsigned long data ) { { if ((unsigned long )function == (unsigned long )(& wakeup_timer_fn)) { activate_suitable_timer_6(timer, data); } else { } return (0); } } void ldv_timer_6(int state , struct timer_list *timer ) { { LDV_IN_INTERRUPT = 2; wakeup_timer_fn(timer->data); LDV_IN_INTERRUPT = 1; return; } } bool ldv_queue_work_on_33(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_34(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_35(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_36(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_37(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } int ldv_del_timer_38(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___3 ldv_func_res ; int tmp ; { tmp = del_timer(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_7(ldv_func_arg1); return (ldv_func_res); } } int ldv_del_timer_sync_39(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___4 ldv_func_res ; int tmp ; { tmp = del_timer_sync(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_7(ldv_func_arg1); return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; extern void warn_slowpath_null(char const * , int const ) ; bool ldv_queue_work_on_51(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_53(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_52(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_55(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_54(struct workqueue_struct *ldv_func_arg1 ) ; u8 mwifiex_band_to_radio_type(u8 band ) ; struct mwifiex_chan_freq_power *mwifiex_get_cfp(struct mwifiex_private *priv , u8 band , u16 channel , u32 freq ) ; u32 mwifiex_index_to_data_rate(struct mwifiex_private *priv , u8 index , u8 ht_info ) ; u32 mwifiex_index_to_acs_data_rate(struct mwifiex_private *priv , u8 index , u8 ht_info ) ; u32 mwifiex_get_active_data_rates(struct mwifiex_private *priv , u8 *rates ) ; u32 mwifiex_get_supported_rates(struct mwifiex_private *priv , u8 *rates ) ; u32 mwifiex_get_rates_from_cfg80211(struct mwifiex_private *priv , u8 *rates , u8 radio_type ) ; u8 mwifiex_is_rate_auto(struct mwifiex_private *priv ) ; u16 region_code_index[7U] ; __inline static u32 mwifiex_copy_rates(u8 *dest , u32 pos , u8 *src , int len ) { int i ; { i = 0; goto ldv_60295; ldv_60294: ; if (pos > 13U) { goto ldv_60293; } else { } *(dest + (unsigned long )pos) = *(src + (unsigned long )i); i = i + 1; pos = pos + 1U; ldv_60295: ; if (i < len && (unsigned int )*(src + (unsigned long )i) != 0U) { goto ldv_60294; } else { } ldv_60293: ; return (pos); } } u8 *mwifiex_11d_code_2_region(u8 code ) ; u8 mwifiex_adjust_data_rate(struct mwifiex_private *priv , u8 rx_rate , u8 rate_info ) ; static u8 adhoc_rates_b[5U] = { 130U, 132U, 139U, 150U, 0U}; static u8 adhoc_rates_g[9U] = { 140U, 18U, 152U, 36U, 176U, 72U, 96U, 108U, 0U}; static u8 adhoc_rates_bg[13U] = { 130U, 132U, 139U, 150U, 12U, 18U, 24U, 36U, 48U, 72U, 96U, 108U, 0U}; static u8 adhoc_rates_a[9U] = { 140U, 18U, 152U, 36U, 176U, 72U, 96U, 108U, 0U}; static u8 supported_rates_a[9U] = { 12U, 18U, 24U, 36U, 176U, 72U, 96U, 108U, 0U}; static u16 mwifiex_data_rates[32U] = { 2U, 4U, 11U, 22U, 0U, 12U, 18U, 24U, 36U, 48U, 72U, 96U, 108U, 144U, 13U, 26U, 39U, 52U, 78U, 104U, 117U, 130U, 12U, 27U, 54U, 81U, 108U, 162U, 216U, 243U, 270U, 0U}; static u8 supported_rates_b[5U] = { 2U, 4U, 11U, 22U, 0U}; static u8 supported_rates_g[9U] = { 12U, 18U, 24U, 36U, 48U, 72U, 96U, 108U, 0U}; static u8 supported_rates_bg[13U] = { 2U, 4U, 11U, 12U, 18U, 22U, 24U, 36U, 48U, 72U, 96U, 108U, 0U}; u16 region_code_index[7U] = { 16U, 32U, 48U, 50U, 64U, 65U, 255U}; static u8 supported_rates_n[3U] = { 2U, 4U, 0U}; static u16 const mcs_rate[4U][16U] = { { 27U, 54U, 81U, 108U, 162U, 216U, 243U, 270U, 54U, 108U, 162U, 216U, 324U, 432U, 486U, 540U}, { 30U, 60U, 90U, 120U, 180U, 240U, 270U, 300U, 60U, 120U, 180U, 240U, 360U, 480U, 540U, 600U}, { 13U, 26U, 39U, 52U, 78U, 104U, 117U, 130U, 26U, 52U, 78U, 104U, 156U, 208U, 234U, 260U}, { 14U, 28U, 43U, 57U, 86U, 115U, 130U, 144U, 28U, 57U, 86U, 115U, 173U, 231U, 260U, 288U}}; static u16 const ac_mcs_rate_nss1[8U][10U] = { { 117U, 234U, 351U, 468U, 702U, 936U, 1053U, 1170U, 1404U, 1560U}, { 130U, 260U, 390U, 520U, 780U, 1040U, 1170U, 1300U, 1560U, 1734U}, { 59U, 117U, 176U, 234U, 351U, 468U, 527U, 585U, 702U, 780U}, { 65U, 130U, 195U, 260U, 390U, 520U, 585U, 650U, 780U, 867U}, { 27U, 54U, 81U, 108U, 162U, 216U, 243U, 270U, 324U, 360U}, { 30U, 60U, 90U, 120U, 180U, 240U, 270U, 300U, 360U, 400U}, { 13U, 26U, 39U, 52U, 78U, 104U, 117U, 130U, 156U, 0U}, { 15U, 29U, 44U, 58U, 87U, 116U, 130U, 145U, 174U, 0U}}; static u16 const ac_mcs_rate_nss2[8U][10U] = { { 234U, 468U, 702U, 936U, 1404U, 1872U, 2106U, 2340U, 2808U, 3120U}, { 260U, 520U, 780U, 1040U, 1560U, 2080U, 2340U, 2600U, 3120U, 3467U}, { 117U, 234U, 351U, 468U, 702U, 936U, 1053U, 1170U, 1404U, 1560U}, { 130U, 260U, 390U, 520U, 780U, 1040U, 1170U, 1300U, 1560U, 1734U}, { 54U, 108U, 162U, 216U, 324U, 432U, 486U, 540U, 648U, 720U}, { 60U, 120U, 180U, 240U, 360U, 480U, 540U, 600U, 720U, 800U}, { 26U, 52U, 74U, 104U, 156U, 208U, 234U, 260U, 312U, 0U}, { 29U, 58U, 87U, 116U, 174U, 230U, 260U, 289U, 347U, 0U}}; static struct region_code_mapping region_code_mapping_t[8U] = { {16U, {'U', 'S', ' '}}, {32U, {'C', 'A', ' '}}, {48U, {'E', 'U', ' '}}, {49U, {'E', 'S', ' '}}, {50U, {'F', 'R', ' '}}, {64U, {'J', 'P', ' '}}, {65U, {'J', 'P', ' '}}, {80U, {'C', 'N', ' '}}}; u8 *mwifiex_11d_code_2_region(u8 code ) { u8 i ; u8 size ; { size = 8U; i = 0U; goto ldv_60693; ldv_60692: ; if ((int )region_code_mapping_t[(int )i].code == (int )code) { return ((u8 *)(& region_code_mapping_t[(int )i].region)); } else { } i = (u8 )((int )i + 1); ldv_60693: ; if ((int )i < (int )size) { goto ldv_60692; } else { } return ((u8 *)0U); } } u32 mwifiex_index_to_acs_data_rate(struct mwifiex_private *priv , u8 index , u8 ht_info ) { u32 rate ; u8 mcs_index ; u8 bw ; u8 gi ; int _min1 ; int _min2 ; { rate = 0U; mcs_index = 0U; bw = 0U; gi = 0U; if (((int )ht_info & 3) == 2) { _min1 = (int )index & 15; _min2 = 9; mcs_index = (u8 )(_min1 < _min2 ? _min1 : _min2); bw = (u8 )(((int )ht_info & 12) >> 2); gi = (u8 )(((int )ht_info & 16) >> 4); if ((unsigned int )((int )index >> 4) == 1U) { rate = (u32 )ac_mcs_rate_nss2[(3 - (int )bw) * 2 + (int )gi][(int )mcs_index]; } else { rate = (u32 )ac_mcs_rate_nss1[(3 - (int )bw) * 2 + (int )gi][(int )mcs_index]; } } else if (((int )ht_info & 3) == 1) { bw = (u8 )(((int )ht_info & 12) >> 2); gi = (u8 )(((int )ht_info & 16) >> 4); if ((unsigned int )index == 32U) { if ((unsigned int )gi == 1U) { rate = 13U; } else { rate = 12U; } } else if ((unsigned int )index <= 15U) { if ((unsigned int )bw == 1U || (unsigned int )bw == 0U) { rate = (u32 )mcs_rate[((int )bw * -2 + 2) + (int )gi][(int )index]; } else { rate = (u32 )mwifiex_data_rates[0]; } } else { rate = (u32 )mwifiex_data_rates[0]; } } else { if ((unsigned int )index > 31U) { index = 0U; } else { } rate = (u32 )mwifiex_data_rates[(int )index]; } return (rate); } } u32 mwifiex_index_to_data_rate(struct mwifiex_private *priv , u8 index , u8 ht_info ) { u32 mcs_num_supp ; u32 rate ; u32 tmp ; { mcs_num_supp = (unsigned int )(priv->adapter)->user_dev_mcs_support == 34U ? 16U : 8U; if ((priv->adapter)->is_hw_11ac_capable != 0U) { tmp = mwifiex_index_to_acs_data_rate(priv, (int )index, (int )ht_info); return (tmp); } else { } if ((int )ht_info & 1) { if ((unsigned int )index == 32U) { if (((unsigned long )ht_info & 4UL) != 0UL) { rate = 13U; } else { rate = 12U; } } else if ((u32 )index < mcs_num_supp) { if (((unsigned long )ht_info & 2UL) != 0UL) { if (((unsigned long )ht_info & 4UL) != 0UL) { rate = (u32 )mcs_rate[1][(int )index]; } else { rate = (u32 )mcs_rate[0][(int )index]; } } else if (((unsigned long )ht_info & 4UL) != 0UL) { rate = (u32 )mcs_rate[3][(int )index]; } else { rate = (u32 )mcs_rate[2][(int )index]; } } else { rate = (u32 )mwifiex_data_rates[0]; } } else { if ((unsigned int )index > 31U) { index = 0U; } else { } rate = (u32 )mwifiex_data_rates[(int )index]; } return (rate); } } u32 mwifiex_get_active_data_rates(struct mwifiex_private *priv , u8 *rates ) { u32 tmp ; u32 tmp___0 ; { if ((unsigned int )priv->media_connected == 0U) { tmp = mwifiex_get_supported_rates(priv, rates); return (tmp); } else { tmp___0 = mwifiex_copy_rates(rates, 0U, (u8 *)(& priv->curr_bss_params.data_rates), (int )priv->curr_bss_params.num_of_rates); return (tmp___0); } } } struct mwifiex_chan_freq_power *mwifiex_get_cfp(struct mwifiex_private *priv , u8 band , u16 channel , u32 freq ) { struct mwifiex_chan_freq_power *cfp ; struct ieee80211_supported_band *sband ; struct ieee80211_channel *ch ; int i ; u8 tmp ; { cfp = (struct mwifiex_chan_freq_power *)0; ch = (struct ieee80211_channel *)0; if ((unsigned int )channel == 0U && freq == 0U) { return (cfp); } else { } tmp = mwifiex_band_to_radio_type((int )band); if ((unsigned int )tmp == 0U) { sband = (priv->wdev.wiphy)->bands[0]; } else { sband = (priv->wdev.wiphy)->bands[1]; } if ((unsigned long )sband == (unsigned long )((struct ieee80211_supported_band *)0)) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "%s: cannot find cfp by band %d\n", "mwifiex_get_cfp", (int )band); } else { } } else { } return (cfp); } else { } i = 0; goto ldv_60732; ldv_60731: ch = sband->channels + (unsigned long )i; if ((int )ch->flags & 1) { goto ldv_60729; } else { } if (freq != 0U) { if ((u32 )ch->center_freq == freq) { goto ldv_60730; } else { } } else if ((int )ch->hw_value == (int )channel || (unsigned int )channel == 255U) { goto ldv_60730; } else { } ldv_60729: i = i + 1; ldv_60732: ; if (sband->n_channels > i) { goto ldv_60731; } else { } ldv_60730: ; if (sband->n_channels == i) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "%s: cannot find cfp by band %d\t& channel=%d freq=%d\n", "mwifiex_get_cfp", (int )band, (int )channel, freq); } else { } } else { } } else { if ((unsigned long )ch == (unsigned long )((struct ieee80211_channel *)0)) { return (cfp); } else { } priv->cfp.channel = ch->hw_value; priv->cfp.freq = (u32 )ch->center_freq; priv->cfp.max_tx_power = (u16 )ch->max_power; cfp = & priv->cfp; } return (cfp); } } u8 mwifiex_is_rate_auto(struct mwifiex_private *priv ) { u32 i ; int rate_num ; { rate_num = 0; i = 0U; goto ldv_60741; ldv_60740: ; if ((unsigned int )priv->bitmap_rates[i] != 0U) { rate_num = rate_num + 1; } else { } i = i + 1U; ldv_60741: ; if (i <= 17U) { goto ldv_60740; } else { } if (rate_num > 1) { return (1U); } else { return (0U); } } } u32 mwifiex_get_rates_from_cfg80211(struct mwifiex_private *priv , u8 *rates , u8 radio_type ) { struct wiphy *wiphy ; struct cfg80211_scan_request *request ; u32 num_rates ; u32 rate_mask ; struct ieee80211_supported_band *sband ; int i ; bool __warned ; int __ret_warn_once ; int __ret_warn_on ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; bool __warned___0 ; int __ret_warn_once___0 ; int __ret_warn_on___0 ; long tmp___3 ; long tmp___4 ; long tmp___5 ; long tmp___6 ; u32 tmp___7 ; { wiphy = (priv->adapter)->wiphy; request = priv->scan_request; if ((unsigned int )radio_type != 0U) { sband = wiphy->bands[1]; __ret_warn_once = (unsigned long )sband == (unsigned long )((struct ieee80211_supported_band *)0); tmp___1 = ldv__builtin_expect(__ret_warn_once != 0, 0L); if (tmp___1 != 0L) { __ret_warn_on = ! __warned; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11944/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/mwifiex/cfp.c", 403); } else { } tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { __warned = 1; } else { } } else { } tmp___2 = ldv__builtin_expect(__ret_warn_once != 0, 0L); if (tmp___2 != 0L) { return (0U); } else { } rate_mask = request->rates[1]; } else { sband = wiphy->bands[0]; __ret_warn_once___0 = (unsigned long )sband == (unsigned long )((struct ieee80211_supported_band *)0); tmp___5 = ldv__builtin_expect(__ret_warn_once___0 != 0, 0L); if (tmp___5 != 0L) { __ret_warn_on___0 = ! __warned___0; tmp___3 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___3 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11944/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/mwifiex/cfp.c", 408); } else { } tmp___4 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___4 != 0L) { __warned___0 = 1; } else { } } else { } tmp___6 = ldv__builtin_expect(__ret_warn_once___0 != 0, 0L); if (tmp___6 != 0L) { return (0U); } else { } rate_mask = request->rates[0]; } num_rates = 0U; i = 0; goto ldv_60766; ldv_60765: ; if ((((unsigned long )rate_mask >> i) & 1UL) == 0UL) { goto ldv_60764; } else { } tmp___7 = num_rates; num_rates = num_rates + 1U; *(rates + (unsigned long )tmp___7) = (unsigned char )((unsigned int )(sband->bitrates + (unsigned long )i)->bitrate / 5U); ldv_60764: i = i + 1; ldv_60766: ; if (sband->n_bitrates > i) { goto ldv_60765; } else { } return (num_rates); } } u32 mwifiex_get_supported_rates(struct mwifiex_private *priv , u8 *rates ) { u32 k ; struct mwifiex_adapter *adapter ; { k = 0U; adapter = priv->adapter; if (priv->bss_mode == 2U || priv->bss_mode == 8U) { switch ((int )adapter->config_bands) { case 1: ; if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: infra band=%d\tsupported_rates_b\n", (int )adapter->config_bands); } else { } } else { } k = mwifiex_copy_rates(rates, k, (u8 *)(& supported_rates_b), 5); goto ldv_60775; case 2: ; case 10: ; if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: infra band=%d\tsupported_rates_g\n", (int )adapter->config_bands); } else { } } else { } k = mwifiex_copy_rates(rates, k, (u8 *)(& supported_rates_g), 9); goto ldv_60775; case 3: ; case 7: ; case 5: ; case 31: ; case 63: ; case 11: ; if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: infra band=%d\tsupported_rates_bg\n", (int )adapter->config_bands); } else { } } else { } k = mwifiex_copy_rates(rates, k, (u8 *)(& supported_rates_bg), 13); goto ldv_60775; case 4: ; case 6: ; if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: infra band=%d\tsupported_rates_a\n", (int )adapter->config_bands); } else { } } else { } k = mwifiex_copy_rates(rates, k, (u8 *)(& supported_rates_a), 9); goto ldv_60775; case 16: ; case 20: ; case 52: ; case 30: ; case 62: ; if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: infra band=%d\tsupported_rates_a\n", (int )adapter->config_bands); } else { } } else { } k = mwifiex_copy_rates(rates, k, (u8 *)(& supported_rates_a), 9); goto ldv_60775; case 8: ; if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: infra band=%d\tsupported_rates_n\n", (int )adapter->config_bands); } else { } } else { } k = mwifiex_copy_rates(rates, k, (u8 *)(& supported_rates_n), 3); goto ldv_60775; } ldv_60775: ; } else { switch ((int )adapter->adhoc_start_band) { case 1: ; if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: adhoc B\n"); } else { } } else { } k = mwifiex_copy_rates(rates, k, (u8 *)(& adhoc_rates_b), 5); goto ldv_60793; case 2: ; case 10: ; if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: adhoc G only\n"); } else { } } else { } k = mwifiex_copy_rates(rates, k, (u8 *)(& adhoc_rates_g), 9); goto ldv_60793; case 3: ; case 11: ; if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: adhoc BG\n"); } else { } } else { } k = mwifiex_copy_rates(rates, k, (u8 *)(& adhoc_rates_bg), 13); goto ldv_60793; case 4: ; case 20: ; if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: adhoc A\n"); } else { } } else { } k = mwifiex_copy_rates(rates, k, (u8 *)(& adhoc_rates_a), 9); goto ldv_60793; } ldv_60793: ; } return (k); } } u8 mwifiex_adjust_data_rate(struct mwifiex_private *priv , u8 rx_rate , u8 rate_info ) { u8 rate_index ; { rate_index = 0U; if ((int )rate_info & 1 && ((unsigned long )rate_info & 2UL) != 0UL) { rate_index = (unsigned int )rx_rate + 27U; } else if ((int )rate_info & 1) { rate_index = (unsigned int )rx_rate + 12U; } else { rate_index = (unsigned int )rx_rate > 4U ? (unsigned int )rx_rate + 255U : rx_rate; } return (rate_index); } } bool ldv_queue_work_on_51(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_52(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_53(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_54(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_55(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } extern void print_hex_dump(char const * , char const * , int , int , int , void const * , size_t , bool ) ; __inline static void list_add(struct list_head *new , struct list_head *head ) { { __list_add(new, head, head->next); return; } } 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); } } int ldv_mod_timer_70(struct timer_list *ldv_func_arg1 , unsigned long ldv_func_arg2 ) ; int ldv_del_timer_sync_71(struct timer_list *ldv_func_arg1 ) ; 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_work_on_67(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_66(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_69(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_68(struct workqueue_struct *ldv_func_arg1 ) ; __inline static bool queue_work___0(struct workqueue_struct *wq , struct work_struct *work ) { bool tmp ; { tmp = ldv_queue_work_on_65(8192, wq, work); return (tmp); } } __inline static void *kmalloc_array(size_t n , size_t size , gfp_t flags ) { void *tmp ; { if (size != 0UL && 0xffffffffffffffffUL / size < n) { return ((void *)0); } else { } tmp = __kmalloc(n * size, flags); return (tmp); } } __inline static void *kcalloc(size_t n , size_t size , gfp_t flags ) { void *tmp ; { tmp = kmalloc_array(n, size, flags | 32768U); return (tmp); } } extern unsigned char *skb_push(struct sk_buff * , unsigned int ) ; extern unsigned char *skb_pull(struct sk_buff * , unsigned int ) ; extern void skb_trim(struct sk_buff * , unsigned int ) ; int mwifiex_complete_cmd(struct mwifiex_adapter *adapter , struct cmd_ctrl_node *cmd_node ) ; void mwifiex_cancel_pending_ioctl(struct mwifiex_adapter *adapter ) ; void mwifiex_insert_cmd_to_free_q(struct mwifiex_adapter *adapter , struct cmd_ctrl_node *cmd_node ) ; void mwifiex_insert_cmd_to_pending_q(struct mwifiex_adapter *adapter , struct cmd_ctrl_node *cmd_node , u32 add_tail ) ; void mwifiex_process_sleep_confirm_resp(struct mwifiex_adapter *adapter , u8 *pbuf , u32 upld_len ) ; int mwifiex_cmd_enh_power_mode(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd , u16 cmd_action , uint16_t ps_bitmap , struct mwifiex_ds_auto_ds *auto_ds ) ; int mwifiex_ret_enh_power_mode(struct mwifiex_private *priv , struct host_cmd_ds_command *resp , struct mwifiex_ds_pm_cfg *pm_cfg ) ; int mwifiex_ret_802_11_hs_cfg(struct mwifiex_private *priv , struct host_cmd_ds_command *resp ) ; int mwifiex_sta_prepare_cmd(struct mwifiex_private *priv , uint16_t cmd_no , u16 cmd_action , u32 cmd_oid , void *data_buf , void *cmd_buf ) ; int mwifiex_uap_prepare_cmd(struct mwifiex_private *priv , unsigned short cmd_no , u16 cmd_action , u32 type , void *data_buf , void *cmd_buf ) ; int mwifiex_process_sta_cmdresp(struct mwifiex_private *priv , u16 cmdresp_no , struct host_cmd_ds_command *resp ) ; int mwifiex_process_sta_event(struct mwifiex_private *priv ) ; int mwifiex_process_uap_event(struct mwifiex_private *priv ) ; void mwifiex_queue_scan_cmd(struct mwifiex_private *priv , struct cmd_ctrl_node *cmd_node ) ; int mwifiex_cmd_get_hw_spec(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd ) ; int mwifiex_ret_get_hw_spec(struct mwifiex_private *priv , struct host_cmd_ds_command *resp ) ; __inline static struct mwifiex_private *mwifiex_get_priv_by_id(struct mwifiex_adapter *adapter , u8 bss_num , u8 bss_type ) { int i ; { i = 0; goto ldv_60314; ldv_60313: ; if ((unsigned long )adapter->priv[i] != (unsigned long )((struct mwifiex_private *)0)) { if ((int )(adapter->priv[i])->bss_num == (int )bss_num && (int )(adapter->priv[i])->bss_type == (int )bss_type) { goto ldv_60312; } else { } } else { } i = i + 1; ldv_60314: ; if ((int )adapter->priv_num > i) { goto ldv_60313; } else { } ldv_60312: ; return ((int )adapter->priv_num > i ? adapter->priv[i] : (struct mwifiex_private *)0); } } __inline static struct mwifiex_private *mwifiex_get_priv___0(struct mwifiex_adapter *adapter , enum mwifiex_bss_role bss_role ) { int i ; { i = 0; goto ldv_60322; ldv_60321: ; if ((unsigned long )adapter->priv[i] != (unsigned long )((struct mwifiex_private *)0)) { if ((unsigned int )bss_role == 255U || ((unsigned long )(adapter->priv[i])->bss_role & 1UL) == (unsigned long )bss_role) { goto ldv_60320; } else { } } else { } i = i + 1; ldv_60322: ; if ((int )adapter->priv_num > i) { goto ldv_60321; } else { } ldv_60320: ; return ((int )adapter->priv_num > i ? adapter->priv[i] : (struct mwifiex_private *)0); } } int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter , struct cmd_ctrl_node *cmd_queued ) ; void mwifiex_update_rxreor_flags(struct mwifiex_adapter *adapter , u8 flags ) ; static void mwifiex_init_cmd_node(struct mwifiex_private *priv , struct cmd_ctrl_node *cmd_node , u32 cmd_oid , void *data_buf , bool sync ) { { cmd_node->priv = priv; cmd_node->cmd_oid = cmd_oid; if ((int )sync) { cmd_node->wait_q_enabled = 1U; cmd_node->cmd_wait_q_woken = 0U; cmd_node->condition = & cmd_node->cmd_wait_q_woken; } else { } cmd_node->data_buf = data_buf; cmd_node->cmd_skb = cmd_node->skb; return; } } static struct cmd_ctrl_node *mwifiex_get_cmd_node(struct mwifiex_adapter *adapter ) { struct cmd_ctrl_node *cmd_node ; unsigned long flags ; raw_spinlock_t *tmp ; int tmp___0 ; struct list_head const *__mptr ; { tmp = spinlock_check(& adapter->cmd_free_q_lock); flags = _raw_spin_lock_irqsave(tmp); tmp___0 = list_empty((struct list_head const *)(& adapter->cmd_free_q)); if (tmp___0 != 0) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "GET_CMD_NODE: cmd node not available\n"); } else { } } else { } spin_unlock_irqrestore(& adapter->cmd_free_q_lock, flags); return ((struct cmd_ctrl_node *)0); } else { } __mptr = (struct list_head const *)adapter->cmd_free_q.next; cmd_node = (struct cmd_ctrl_node *)__mptr; list_del(& cmd_node->list); spin_unlock_irqrestore(& adapter->cmd_free_q_lock, flags); return (cmd_node); } } static void mwifiex_clean_cmd_node(struct mwifiex_adapter *adapter , struct cmd_ctrl_node *cmd_node ) { { cmd_node->cmd_oid = 0U; cmd_node->cmd_flag = 0U; cmd_node->data_buf = (void *)0; cmd_node->wait_q_enabled = 0U; if ((unsigned long )cmd_node->cmd_skb != (unsigned long )((struct sk_buff *)0)) { skb_trim(cmd_node->cmd_skb, 0U); } else { } if ((unsigned long )cmd_node->resp_skb != (unsigned long )((struct sk_buff *)0)) { (*(adapter->if_ops.cmdrsp_complete))(adapter, cmd_node->resp_skb); cmd_node->resp_skb = (struct sk_buff *)0; } else { } return; } } static int mwifiex_cmd_host_cmd(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd , struct mwifiex_ds_misc_cmd *pcmd_ptr ) { { memcpy((void *)cmd, (void const *)(& pcmd_ptr->cmd), (size_t )pcmd_ptr->len); if (((priv->adapter)->debug_mask & 16U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "cmd: host cmd size = %d\n", pcmd_ptr->len); } else { } } else { } return (0); } } static int mwifiex_dnld_cmd_to_fw(struct mwifiex_private *priv , struct cmd_ctrl_node *cmd_node ) { struct mwifiex_adapter *adapter ; int ret ; struct host_cmd_ds_command *host_cmd ; uint16_t cmd_code ; uint16_t cmd_size ; unsigned long flags ; __le32 tmp ; raw_spinlock_t *tmp___0 ; raw_spinlock_t *tmp___1 ; unsigned long tmp___2 ; { adapter = priv->adapter; if ((unsigned long )adapter == (unsigned long )((struct mwifiex_adapter *)0) || (unsigned long )cmd_node == (unsigned long )((struct cmd_ctrl_node *)0)) { return (-1); } else { } host_cmd = (struct host_cmd_ds_command *)(cmd_node->cmd_skb)->data; if ((unsigned long )host_cmd == (unsigned long )((struct host_cmd_ds_command *)0) || (unsigned int )host_cmd->size == 0U) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "DNLD_CMD: host_cmd is null\tor cmd size is 0, not sending\n"); } else { } } else { } if (cmd_node->wait_q_enabled != 0U) { adapter->cmd_wait_q.status = -1; } else { } mwifiex_recycle_cmd_node(adapter, cmd_node); return (-1); } else { } cmd_code = host_cmd->command; cmd_size = host_cmd->size; if (((unsigned int )adapter->hw_status == 3U && (unsigned int )cmd_code != 170U) && (unsigned int )cmd_code != 169U) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "DNLD_CMD: FW in reset state, ignore cmd %#x\n", (int )cmd_code); } else { } } else { } if (cmd_node->wait_q_enabled != 0U) { mwifiex_complete_cmd(adapter, cmd_node); } else { } mwifiex_recycle_cmd_node(adapter, cmd_node); queue_work___0(adapter->workqueue, & adapter->main_work); return (-1); } else { } adapter->seq_num = (u16 )((int )adapter->seq_num + 1); host_cmd->seq_num = (unsigned short )((((int )adapter->seq_num & 255) | (((int )(cmd_node->priv)->bss_num & 15) << 8)) | (((int )(cmd_node->priv)->bss_type << 12) & 65535)); tmp___0 = spinlock_check(& adapter->mwifiex_cmd_lock); flags = _raw_spin_lock_irqsave(tmp___0); adapter->curr_cmd = cmd_node; spin_unlock_irqrestore(& adapter->mwifiex_cmd_lock, flags); if ((cmd_node->cmd_skb)->len > (unsigned int )cmd_size) { skb_trim(cmd_node->cmd_skb, (unsigned int )cmd_size); } else if ((cmd_node->cmd_skb)->len < (unsigned int )cmd_size) { skb_put(cmd_node->cmd_skb, (unsigned int )cmd_size - (cmd_node->cmd_skb)->len); } else { } if ((adapter->debug_mask & 16U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cmd: DNLD_CMD: %#x, act %#x, len %d, seqno %#x\n", (int )cmd_code, (int )*((__le16 *)host_cmd + 8U), (int )cmd_size, (int )host_cmd->seq_num); } else { } } else { } if ((adapter->debug_mask & 131072U) != 0U) { print_hex_dump("\017", "cmd buffer:", 2, 16, 1, (void const *)host_cmd, (size_t )cmd_size, 0); } else { } if ((unsigned int )adapter->iface_type == 2U) { tmp = 4027448014U; skb_push(cmd_node->cmd_skb, 4U); memcpy((void *)(cmd_node->cmd_skb)->data, (void const *)(& tmp), 4UL); adapter->cmd_sent = 1U; ret = (*(adapter->if_ops.host_to_card))(adapter, 1, cmd_node->cmd_skb, (struct mwifiex_tx_param *)0); skb_pull(cmd_node->cmd_skb, 4U); if (ret == -16) { cmd_node->cmd_skb = (struct sk_buff *)0; } else { } } else { skb_push(cmd_node->cmd_skb, 4U); ret = (*(adapter->if_ops.host_to_card))(adapter, 1, cmd_node->cmd_skb, (struct mwifiex_tx_param *)0); skb_pull(cmd_node->cmd_skb, 4U); } if (ret == -1) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "DNLD_CMD: host to card failed\n"); } else { } } else { } if ((unsigned int )adapter->iface_type == 2U) { adapter->cmd_sent = 0U; } else { } if (cmd_node->wait_q_enabled != 0U) { adapter->cmd_wait_q.status = -1; } else { } mwifiex_recycle_cmd_node(adapter, adapter->curr_cmd); tmp___1 = spinlock_check(& adapter->mwifiex_cmd_lock); flags = _raw_spin_lock_irqsave(tmp___1); adapter->curr_cmd = (struct cmd_ctrl_node *)0; spin_unlock_irqrestore(& adapter->mwifiex_cmd_lock, flags); adapter->dbg.num_cmd_host_to_card_failure = adapter->dbg.num_cmd_host_to_card_failure + 1U; return (-1); } else { } adapter->dbg.last_cmd_index = (u16 )(((int )adapter->dbg.last_cmd_index + 1) % 5); adapter->dbg.last_cmd_id[(int )adapter->dbg.last_cmd_index] = cmd_code; adapter->dbg.last_cmd_act[(int )adapter->dbg.last_cmd_index] = *((__le16 *)host_cmd + 8U); cmd_code = (unsigned int )cmd_code & 4095U; tmp___2 = msecs_to_jiffies(10000U); ldv_mod_timer_70(& adapter->cmd_timer, tmp___2 + (unsigned long )jiffies); return (0); } } static int mwifiex_dnld_sleep_confirm_cmd(struct mwifiex_adapter *adapter ) { int ret ; struct mwifiex_private *priv ; struct mwifiex_opt_sleep_confirm *sleep_cfm_buf ; struct sk_buff *sleep_cfm_tmp ; __le32 tmp ; struct mwifiex_private *tmp___0 ; { sleep_cfm_buf = (struct mwifiex_opt_sleep_confirm *)(adapter->sleep_cfm)->data; priv = mwifiex_get_priv___0(adapter, 255); adapter->seq_num = (u16 )((int )adapter->seq_num + 1); sleep_cfm_buf->seq_num = (unsigned short )((((int )adapter->seq_num & 255) | (((int )priv->bss_num & 15) << 8)) | (((int )priv->bss_type << 12) & 65535)); if ((adapter->debug_mask & 16U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cmd: DNLD_CMD: %#x, act %#x, len %d, seqno %#x\n", (int )sleep_cfm_buf->command, (int )sleep_cfm_buf->action, (int )sleep_cfm_buf->size, (int )sleep_cfm_buf->seq_num); } else { } } else { } if ((adapter->debug_mask & 131072U) != 0U) { print_hex_dump("\017", "SLEEP_CFM buffer: ", 2, 16, 1, (void const *)sleep_cfm_buf, (size_t )sleep_cfm_buf->size, 0); } else { } if ((unsigned int )adapter->iface_type == 2U) { sleep_cfm_tmp = dev_alloc_skb(16U); skb_put(sleep_cfm_tmp, 16U); tmp = 4027448014U; memcpy((void *)sleep_cfm_tmp->data, (void const *)(& tmp), 4UL); memcpy((void *)sleep_cfm_tmp->data + 4U, (void const *)(adapter->sleep_cfm)->data, 12UL); ret = (*(adapter->if_ops.host_to_card))(adapter, 1, sleep_cfm_tmp, (struct mwifiex_tx_param *)0); if (ret != -16) { dev_kfree_skb_any(sleep_cfm_tmp); } else { } } else { skb_push(adapter->sleep_cfm, 4U); ret = (*(adapter->if_ops.host_to_card))(adapter, 1, adapter->sleep_cfm, (struct mwifiex_tx_param *)0); skb_pull(adapter->sleep_cfm, 4U); } if (ret == -1) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "SLEEP_CFM: failed\n"); } else { } } else { } adapter->dbg.num_cmd_sleep_cfm_host_to_card_failure = adapter->dbg.num_cmd_sleep_cfm_host_to_card_failure + 1U; return (-1); } else { } if ((unsigned int )sleep_cfm_buf->resp_ctrl == 0U) { adapter->ps_state = 3U; } else { adapter->ps_state = 2U; } if ((unsigned int )sleep_cfm_buf->resp_ctrl == 0U && ((unsigned int )adapter->is_hs_configured != 0U && (unsigned int )adapter->sleep_period.period == 0U)) { adapter->pm_wakeup_card_req = 1U; tmp___0 = mwifiex_get_priv___0(adapter, 255); mwifiex_hs_activated_event(tmp___0, 1); } else { } return (ret); } } int mwifiex_alloc_cmd_buffer(struct mwifiex_adapter *adapter ) { struct cmd_ctrl_node *cmd_array ; u32 i ; void *tmp ; { tmp = kcalloc(50UL, 88UL, 208U); cmd_array = (struct cmd_ctrl_node *)tmp; if ((unsigned long )cmd_array == (unsigned long )((struct cmd_ctrl_node *)0)) { return (-12); } else { } adapter->cmd_pool = cmd_array; i = 0U; goto ldv_61013; ldv_61012: (cmd_array + (unsigned long )i)->skb = dev_alloc_skb(2048U); if ((unsigned long )(cmd_array + (unsigned long )i)->skb == (unsigned long )((struct sk_buff *)0)) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "unable to allocate command buffer\n"); } else { } } else { } return (-12); } else { } i = i + 1U; ldv_61013: ; if (i <= 49U) { goto ldv_61012; } else { } i = 0U; goto ldv_61016; ldv_61015: mwifiex_insert_cmd_to_free_q(adapter, cmd_array + (unsigned long )i); i = i + 1U; ldv_61016: ; if (i <= 49U) { goto ldv_61015; } else { } return (0); } } int mwifiex_free_cmd_buffer(struct mwifiex_adapter *adapter ) { struct cmd_ctrl_node *cmd_array ; u32 i ; { if ((unsigned long )adapter->cmd_pool == (unsigned long )((struct cmd_ctrl_node *)0)) { if ((adapter->debug_mask & 2U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: FREE_CMD_BUF: cmd_pool is null\n"); } else { } } else { } return (0); } else { } cmd_array = adapter->cmd_pool; i = 0U; goto ldv_61025; ldv_61024: ; if ((unsigned long )(cmd_array + (unsigned long )i)->skb != (unsigned long )((struct sk_buff *)0)) { if ((adapter->debug_mask & 16U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cmd: free cmd buffer %d\n", i); } else { } } else { } dev_kfree_skb_any((cmd_array + (unsigned long )i)->skb); } else { } if ((unsigned long )(cmd_array + (unsigned long )i)->resp_skb == (unsigned long )((struct sk_buff *)0)) { goto ldv_61023; } else { } if ((unsigned int )adapter->iface_type == 2U) { (*(adapter->if_ops.cmdrsp_complete))(adapter, (cmd_array + (unsigned long )i)->resp_skb); } else { dev_kfree_skb_any((cmd_array + (unsigned long )i)->resp_skb); } ldv_61023: i = i + 1U; ldv_61025: ; if (i <= 49U) { goto ldv_61024; } else { } if ((unsigned long )adapter->cmd_pool != (unsigned long )((struct cmd_ctrl_node *)0)) { if ((adapter->debug_mask & 16U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cmd: free cmd pool\n"); } else { } } else { } kfree((void const *)adapter->cmd_pool); adapter->cmd_pool = (struct cmd_ctrl_node *)0; } else { } return (0); } } int mwifiex_process_event(struct mwifiex_adapter *adapter ) { int ret ; struct mwifiex_private *priv ; struct mwifiex_private *tmp ; struct sk_buff *skb ; u32 eventcause ; struct mwifiex_rxinfo *rx_info ; { tmp = mwifiex_get_priv___0(adapter, 255); priv = tmp; skb = adapter->event_skb; eventcause = adapter->event_cause; adapter->dbg.last_event_index = (u16 )(((int )adapter->dbg.last_event_index + 1) % 5); adapter->dbg.last_event[(int )adapter->dbg.last_event_index] = (unsigned short )eventcause; priv = mwifiex_get_priv_by_id(adapter, (int )((u8 )(eventcause >> 16)) & 15, (int )((u8 )(eventcause >> 24))); if ((unsigned long )priv == (unsigned long )((struct mwifiex_private *)0)) { priv = mwifiex_get_priv___0(adapter, 255); } else { } eventcause = eventcause & 65535U; adapter->event_cause = eventcause; if ((unsigned long )skb != (unsigned long )((struct sk_buff *)0)) { rx_info = MWIFIEX_SKB_RXCB(skb); memset((void *)rx_info, 0, 16UL); rx_info->bss_num = priv->bss_num; rx_info->bss_type = priv->bss_type; if ((adapter->debug_mask & 262144U) != 0U) { print_hex_dump("\017", "Event Buf:", 2, 16, 1, (void const *)skb->data, (size_t )skb->len, 0); } else { } } else { } if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "EVENT: cause: %#x\n", eventcause); } else { } } else { } if ((unsigned int )priv->bss_role == 1U) { ret = mwifiex_process_uap_event(priv); } else { ret = mwifiex_process_sta_event(priv); } adapter->event_cause = 0U; adapter->event_skb = (struct sk_buff *)0; (*(adapter->if_ops.event_complete))(adapter, skb); return (ret); } } int mwifiex_send_cmd(struct mwifiex_private *priv , u16 cmd_no , u16 cmd_action , u32 cmd_oid , void *data_buf , bool sync ) { int ret ; struct mwifiex_adapter *adapter ; struct cmd_ctrl_node *cmd_node ; struct host_cmd_ds_command *cmd_ptr ; unsigned char *tmp ; { adapter = priv->adapter; if ((unsigned long )adapter == (unsigned long )((struct mwifiex_adapter *)0)) { printk("\vmwifiex: PREP_CMD: adapter is NULL\n"); return (-1); } else { } if ((int )adapter->is_suspended) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "PREP_CMD: device in suspended state\n"); } else { } } else { } return (-1); } else { } if ((int )adapter->hs_enabling && (unsigned int )cmd_no != 229U) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "PREP_CMD: host entering sleep state\n"); } else { } } else { } return (-1); } else { } if ((int )adapter->surprise_removed) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "PREP_CMD: card is removed\n"); } else { } } else { } return (-1); } else { } if ((unsigned int )adapter->is_cmd_timedout != 0U) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "PREP_CMD: FW is in bad state\n"); } else { } } else { } return (-1); } else { } if ((unsigned int )adapter->hw_status == 3U) { if ((unsigned int )cmd_no != 169U) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "PREP_CMD: FW in reset state\n"); } else { } } else { } return (-1); } else { } } else { } cmd_node = mwifiex_get_cmd_node(adapter); if ((unsigned long )cmd_node == (unsigned long )((struct cmd_ctrl_node *)0)) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "PREP_CMD: no free cmd node\n"); } else { } } else { } return (-1); } else { } mwifiex_init_cmd_node(priv, cmd_node, cmd_oid, data_buf, (int )sync); if ((unsigned long )cmd_node->cmd_skb == (unsigned long )((struct sk_buff *)0)) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "PREP_CMD: no free cmd buf\n"); } else { } } else { } return (-1); } else { } tmp = skb_put(cmd_node->cmd_skb, 208U); memset((void *)tmp, 0, 208UL); cmd_ptr = (struct host_cmd_ds_command *)(cmd_node->cmd_skb)->data; cmd_ptr->command = cmd_no; cmd_ptr->result = 0U; if ((unsigned int )cmd_no != 0U) { switch ((int )cmd_no) { case 176: ; case 177: ; case 178: ; case 181: ; case 175: ; case 179: ret = mwifiex_uap_prepare_cmd(priv, (int )cmd_no, (int )cmd_action, cmd_oid, data_buf, (void *)cmd_ptr); goto ldv_61053; default: ret = mwifiex_sta_prepare_cmd(priv, (int )cmd_no, (int )cmd_action, cmd_oid, data_buf, (void *)cmd_ptr); goto ldv_61053; } ldv_61053: ; } else { ret = mwifiex_cmd_host_cmd(priv, cmd_ptr, (struct mwifiex_ds_misc_cmd *)data_buf); cmd_node->cmd_flag = cmd_node->cmd_flag | 1U; } if (ret != 0) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "PREP_CMD: cmd %#x preparation failed\n", (int )cmd_no); } else { } } else { } mwifiex_insert_cmd_to_free_q(adapter, cmd_node); return (-1); } else { } if ((unsigned int )cmd_no == 6U || (unsigned int )cmd_no == 263U) { mwifiex_queue_scan_cmd(priv, cmd_node); } else { mwifiex_insert_cmd_to_pending_q(adapter, cmd_node, 1U); queue_work___0(adapter->workqueue, & adapter->main_work); if (cmd_node->wait_q_enabled != 0U) { ret = mwifiex_wait_queue_complete(adapter, cmd_node); } else { } } return (ret); } } void mwifiex_insert_cmd_to_free_q(struct mwifiex_adapter *adapter , struct cmd_ctrl_node *cmd_node ) { unsigned long flags ; raw_spinlock_t *tmp ; { if ((unsigned long )cmd_node == (unsigned long )((struct cmd_ctrl_node *)0)) { return; } else { } if (cmd_node->wait_q_enabled != 0U) { mwifiex_complete_cmd(adapter, cmd_node); } else { } mwifiex_clean_cmd_node(adapter, cmd_node); tmp = spinlock_check(& adapter->cmd_free_q_lock); flags = _raw_spin_lock_irqsave(tmp); list_add_tail(& cmd_node->list, & adapter->cmd_free_q); spin_unlock_irqrestore(& adapter->cmd_free_q_lock, flags); return; } } void mwifiex_recycle_cmd_node(struct mwifiex_adapter *adapter , struct cmd_ctrl_node *cmd_node ) { struct host_cmd_ds_command *host_cmd ; int tmp ; { host_cmd = (struct host_cmd_ds_command *)(cmd_node->cmd_skb)->data; mwifiex_insert_cmd_to_free_q(adapter, cmd_node); atomic_dec(& adapter->cmd_pending); if ((adapter->debug_mask & 16U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { tmp = atomic_read((atomic_t const *)(& adapter->cmd_pending)); _dev_info((struct device const *)adapter->dev, "cmd: FREE_CMD: cmd=%#x, cmd_pending=%d\n", (int )host_cmd->command, tmp); } else { } } else { } return; } } void mwifiex_insert_cmd_to_pending_q(struct mwifiex_adapter *adapter , struct cmd_ctrl_node *cmd_node , u32 add_tail ) { struct host_cmd_ds_command *host_cmd ; u16 command ; unsigned long flags ; struct host_cmd_ds_802_11_ps_mode_enh *pm ; raw_spinlock_t *tmp ; int tmp___0 ; { host_cmd = (struct host_cmd_ds_command *)0; host_cmd = (struct host_cmd_ds_command *)(cmd_node->cmd_skb)->data; if ((unsigned long )host_cmd == (unsigned long )((struct host_cmd_ds_command *)0)) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "QUEUE_CMD: host_cmd is NULL\n"); } else { } } else { } return; } else { } command = host_cmd->command; if ((unsigned int )command == 228U) { pm = & host_cmd->params.psmode_enh; if ((unsigned int )pm->action == 2U || (unsigned int )pm->action == 254U) { if (adapter->ps_state != 0U) { add_tail = 0U; } else { } } else { } } else { } tmp = spinlock_check(& adapter->cmd_pending_q_lock); flags = _raw_spin_lock_irqsave(tmp); if (add_tail != 0U) { list_add_tail(& cmd_node->list, & adapter->cmd_pending_q); } else { list_add(& cmd_node->list, & adapter->cmd_pending_q); } spin_unlock_irqrestore(& adapter->cmd_pending_q_lock, flags); atomic_inc(& adapter->cmd_pending); if ((adapter->debug_mask & 16U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { tmp___0 = atomic_read((atomic_t const *)(& adapter->cmd_pending)); _dev_info((struct device const *)adapter->dev, "cmd: QUEUE_CMD: cmd=%#x, cmd_pending=%d\n", (int )command, tmp___0); } else { } } else { } return; } } int mwifiex_exec_next_cmd(struct mwifiex_adapter *adapter ) { struct mwifiex_private *priv ; struct cmd_ctrl_node *cmd_node ; int ret ; struct host_cmd_ds_command *host_cmd ; unsigned long cmd_flags ; unsigned long cmd_pending_q_flags ; raw_spinlock_t *tmp ; raw_spinlock_t *tmp___0 ; int tmp___1 ; struct list_head const *__mptr ; raw_spinlock_t *tmp___2 ; { ret = 0; if ((unsigned long )adapter->curr_cmd != (unsigned long )((struct cmd_ctrl_node *)0)) { if ((adapter->debug_mask & 2U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "EXEC_NEXT_CMD: cmd in processing\n"); } else { } } else { } return (-1); } else { } tmp = spinlock_check(& adapter->mwifiex_cmd_lock); cmd_flags = _raw_spin_lock_irqsave(tmp); tmp___0 = spinlock_check(& adapter->cmd_pending_q_lock); cmd_pending_q_flags = _raw_spin_lock_irqsave(tmp___0); tmp___1 = list_empty((struct list_head const *)(& adapter->cmd_pending_q)); if (tmp___1 != 0) { spin_unlock_irqrestore(& adapter->cmd_pending_q_lock, cmd_pending_q_flags); spin_unlock_irqrestore(& adapter->mwifiex_cmd_lock, cmd_flags); return (0); } else { } __mptr = (struct list_head const *)adapter->cmd_pending_q.next; cmd_node = (struct cmd_ctrl_node *)__mptr; spin_unlock_irqrestore(& adapter->cmd_pending_q_lock, cmd_pending_q_flags); host_cmd = (struct host_cmd_ds_command *)(cmd_node->cmd_skb)->data; priv = cmd_node->priv; if (adapter->ps_state != 0U) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "%s: cannot send cmd in sleep state,\tthis should not happen\n", "mwifiex_exec_next_cmd"); } else { } } else { } spin_unlock_irqrestore(& adapter->mwifiex_cmd_lock, cmd_flags); return (ret); } else { } tmp___2 = spinlock_check(& adapter->cmd_pending_q_lock); cmd_pending_q_flags = _raw_spin_lock_irqsave(tmp___2); list_del(& cmd_node->list); spin_unlock_irqrestore(& adapter->cmd_pending_q_lock, cmd_pending_q_flags); spin_unlock_irqrestore(& adapter->mwifiex_cmd_lock, cmd_flags); ret = mwifiex_dnld_cmd_to_fw(priv, cmd_node); priv = mwifiex_get_priv___0(adapter, 255); if ((unsigned long )priv != (unsigned long )((struct mwifiex_private *)0) && (unsigned int )host_cmd->command != 229U) { if ((unsigned int )adapter->hs_activated != 0U) { adapter->is_hs_configured = 0U; mwifiex_hs_activated_event(priv, 0); } else { } } else { } return (ret); } } int mwifiex_process_cmdresp(struct mwifiex_adapter *adapter ) { struct host_cmd_ds_command *resp ; struct mwifiex_private *priv ; struct mwifiex_private *tmp ; int ret ; uint16_t orig_cmdresp_no ; uint16_t cmdresp_no ; uint16_t cmdresp_result ; unsigned long flags ; raw_spinlock_t *tmp___0 ; struct mwifiex_ds_misc_cmd *hostcmd ; uint16_t size ; u16 __min1 ; u16 __min2 ; raw_spinlock_t *tmp___1 ; raw_spinlock_t *tmp___2 ; { tmp = mwifiex_get_priv___0(adapter, 255); priv = tmp; ret = 0; ldv_del_timer_sync_71(& adapter->cmd_timer); if ((unsigned long )adapter->curr_cmd == (unsigned long )((struct cmd_ctrl_node *)0) || (unsigned long )(adapter->curr_cmd)->resp_skb == (unsigned long )((struct sk_buff *)0)) { resp = (struct host_cmd_ds_command *)(& adapter->upld_buf); if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "CMD_RESP: NULL curr_cmd, %#x\n", (int )resp->command); } else { } } else { } return (-1); } else { } adapter->is_cmd_timedout = 0U; resp = (struct host_cmd_ds_command *)((adapter->curr_cmd)->resp_skb)->data; if (((adapter->curr_cmd)->cmd_flag & 2U) != 0U) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "CMD_RESP: %#x been canceled\n", (int )resp->command); } else { } } else { } mwifiex_recycle_cmd_node(adapter, adapter->curr_cmd); tmp___0 = spinlock_check(& adapter->mwifiex_cmd_lock); flags = _raw_spin_lock_irqsave(tmp___0); adapter->curr_cmd = (struct cmd_ctrl_node *)0; spin_unlock_irqrestore(& adapter->mwifiex_cmd_lock, flags); return (-1); } else { } if ((int )(adapter->curr_cmd)->cmd_flag & 1) { size = resp->size; if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: host cmd resp size = %d\n", (int )size); } else { } } else { } __min1 = size; __min2 = 2048U; size = (uint16_t )((int )__min1 < (int )__min2 ? __min1 : __min2); if ((unsigned long )(adapter->curr_cmd)->data_buf != (unsigned long )((void *)0)) { hostcmd = (struct mwifiex_ds_misc_cmd *)(adapter->curr_cmd)->data_buf; hostcmd->len = (u32 )size; memcpy((void *)(& hostcmd->cmd), (void const *)resp, (size_t )size); } else { } } else { } orig_cmdresp_no = resp->command; priv = mwifiex_get_priv_by_id(adapter, (int )((u8 )(((int )resp->seq_num & 3840) >> 8)), (int )((u8 )((int )resp->seq_num >> 12))); if ((unsigned long )priv == (unsigned long )((struct mwifiex_private *)0)) { priv = mwifiex_get_priv___0(adapter, 255); } else { } resp->command = (unsigned int )orig_cmdresp_no & 4095U; cmdresp_no = resp->command; cmdresp_result = resp->result; adapter->dbg.last_cmd_resp_index = (u16 )(((int )adapter->dbg.last_cmd_resp_index + 1) % 5); adapter->dbg.last_cmd_resp_id[(int )adapter->dbg.last_cmd_resp_index] = orig_cmdresp_no; if ((adapter->debug_mask & 16U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cmd: CMD_RESP: 0x%x, result %d, len %d, seqno 0x%x\n", (int )orig_cmdresp_no, (int )cmdresp_result, (int )resp->size, (int )resp->seq_num); } else { } } else { } if ((adapter->debug_mask & 131072U) != 0U) { print_hex_dump("\017", "CMD_RESP buffer:", 2, 16, 1, (void const *)resp, (size_t )resp->size, 0); } else { } if ((int )((short )orig_cmdresp_no) >= 0) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "CMD_RESP: invalid cmd resp\n"); } else { } } else { } if ((adapter->curr_cmd)->wait_q_enabled != 0U) { adapter->cmd_wait_q.status = -1; } else { } mwifiex_recycle_cmd_node(adapter, adapter->curr_cmd); tmp___1 = spinlock_check(& adapter->mwifiex_cmd_lock); flags = _raw_spin_lock_irqsave(tmp___1); adapter->curr_cmd = (struct cmd_ctrl_node *)0; spin_unlock_irqrestore(& adapter->mwifiex_cmd_lock, flags); return (-1); } else { } if ((int )(adapter->curr_cmd)->cmd_flag & 1) { (adapter->curr_cmd)->cmd_flag = (adapter->curr_cmd)->cmd_flag & 4294967294U; if ((unsigned int )cmdresp_result == 0U && (unsigned int )cmdresp_no == 229U) { ret = mwifiex_ret_802_11_hs_cfg(priv, resp); } else { } } else { ret = mwifiex_process_sta_cmdresp(priv, (int )cmdresp_no, resp); } if ((unsigned int )adapter->hw_status == 1U) { if (ret != 0) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "%s: cmd %#x failed during\tinitialization\n", "mwifiex_process_cmdresp", (int )cmdresp_no); } else { } } else { } mwifiex_init_fw_complete(adapter); return (-1); } else if ((int )adapter->last_init_cmd == (int )cmdresp_no) { adapter->hw_status = 2; } else { } } else { } if ((unsigned long )adapter->curr_cmd != (unsigned long )((struct cmd_ctrl_node *)0)) { if ((adapter->curr_cmd)->wait_q_enabled != 0U) { adapter->cmd_wait_q.status = ret; } else { } mwifiex_recycle_cmd_node(adapter, adapter->curr_cmd); tmp___2 = spinlock_check(& adapter->mwifiex_cmd_lock); flags = _raw_spin_lock_irqsave(tmp___2); adapter->curr_cmd = (struct cmd_ctrl_node *)0; spin_unlock_irqrestore(& adapter->mwifiex_cmd_lock, flags); } else { } return (ret); } } void mwifiex_cmd_timeout_func(unsigned long function_context ) { struct mwifiex_adapter *adapter ; struct cmd_ctrl_node *cmd_node ; { adapter = (struct mwifiex_adapter *)function_context; adapter->is_cmd_timedout = 1U; if ((unsigned long )adapter->curr_cmd == (unsigned long )((struct cmd_ctrl_node *)0)) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cmd: empty curr_cmd\n"); } else { } } else { } return; } else { } cmd_node = adapter->curr_cmd; if ((unsigned long )cmd_node != (unsigned long )((struct cmd_ctrl_node *)0)) { adapter->dbg.timeout_cmd_id = adapter->dbg.last_cmd_id[(int )adapter->dbg.last_cmd_index]; adapter->dbg.timeout_cmd_act = adapter->dbg.last_cmd_act[(int )adapter->dbg.last_cmd_index]; if ((int )adapter->debug_mask & 1) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "%s: Timeout cmd id = %#x, act = %#x\n", "mwifiex_cmd_timeout_func", (int )adapter->dbg.timeout_cmd_id, (int )adapter->dbg.timeout_cmd_act); } else { } } else { } if ((int )adapter->debug_mask & 1) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "num_data_h2c_failure = %d\n", adapter->dbg.num_tx_host_to_card_failure); } else { } } else { } if ((int )adapter->debug_mask & 1) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "num_cmd_h2c_failure = %d\n", adapter->dbg.num_cmd_host_to_card_failure); } else { } } else { } if ((int )adapter->debug_mask & 1) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "is_cmd_timedout = %d\n", (int )adapter->is_cmd_timedout); } else { } } else { } if ((int )adapter->debug_mask & 1) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "num_tx_timeout = %d\n", adapter->dbg.num_tx_timeout); } else { } } else { } if ((int )adapter->debug_mask & 1) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "last_cmd_index = %d\n", (int )adapter->dbg.last_cmd_index); } else { } } else { } if ((int )adapter->debug_mask & 1) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "last_cmd_id: %*ph\n", 10, (u16 *)(& adapter->dbg.last_cmd_id)); } else { } } else { } if ((int )adapter->debug_mask & 1) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "last_cmd_act: %*ph\n", 10, (u16 *)(& adapter->dbg.last_cmd_act)); } else { } } else { } if ((int )adapter->debug_mask & 1) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "last_cmd_resp_index = %d\n", (int )adapter->dbg.last_cmd_resp_index); } else { } } else { } if ((int )adapter->debug_mask & 1) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "last_cmd_resp_id: %*ph\n", 10, (u16 *)(& adapter->dbg.last_cmd_resp_id)); } else { } } else { } if ((int )adapter->debug_mask & 1) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "last_event_index = %d\n", (int )adapter->dbg.last_event_index); } else { } } else { } if ((int )adapter->debug_mask & 1) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "last_event: %*ph\n", 10, (u16 *)(& adapter->dbg.last_event)); } else { } } else { } if ((int )adapter->debug_mask & 1) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "data_sent=%d cmd_sent=%d\n", (int )adapter->data_sent, (int )adapter->cmd_sent); } else { } } else { } if ((int )adapter->debug_mask & 1) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "ps_mode=%d ps_state=%d\n", (int )adapter->ps_mode, adapter->ps_state); } else { } } else { } if (cmd_node->wait_q_enabled != 0U) { adapter->cmd_wait_q.status = -110; __wake_up(& adapter->cmd_wait_q.wait, 1U, 1, (void *)0); mwifiex_cancel_pending_ioctl(adapter); } else { } } else { } if ((unsigned int )adapter->hw_status == 1U) { mwifiex_init_fw_complete(adapter); } else { } if ((unsigned long )adapter->if_ops.device_dump != (unsigned long )((void (*)(struct mwifiex_adapter * ))0)) { (*(adapter->if_ops.device_dump))(adapter); } else { } if ((unsigned long )adapter->if_ops.card_reset != (unsigned long )((void (*)(struct mwifiex_adapter * ))0)) { (*(adapter->if_ops.card_reset))(adapter); } else { } return; } } void mwifiex_cancel_all_pending_cmd(struct mwifiex_adapter *adapter ) { struct cmd_ctrl_node *cmd_node ; struct cmd_ctrl_node *tmp_node ; unsigned long flags ; unsigned long cmd_flags ; struct mwifiex_private *priv ; int i ; raw_spinlock_t *tmp ; raw_spinlock_t *tmp___0 ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; raw_spinlock_t *tmp___1 ; struct list_head const *__mptr___1 ; raw_spinlock_t *tmp___2 ; struct list_head const *__mptr___2 ; struct list_head const *__mptr___3 ; struct list_head const *__mptr___4 ; raw_spinlock_t *tmp___3 ; { cmd_node = (struct cmd_ctrl_node *)0; tmp = spinlock_check(& adapter->mwifiex_cmd_lock); cmd_flags = _raw_spin_lock_irqsave(tmp); if ((unsigned long )adapter->curr_cmd != (unsigned long )((struct cmd_ctrl_node *)0) && (adapter->curr_cmd)->wait_q_enabled != 0U) { (adapter->curr_cmd)->wait_q_enabled = 0U; adapter->cmd_wait_q.status = -1; mwifiex_complete_cmd(adapter, adapter->curr_cmd); } else { } tmp___0 = spinlock_check(& adapter->cmd_pending_q_lock); flags = _raw_spin_lock_irqsave(tmp___0); __mptr = (struct list_head const *)adapter->cmd_pending_q.next; cmd_node = (struct cmd_ctrl_node *)__mptr; __mptr___0 = (struct list_head const *)cmd_node->list.next; tmp_node = (struct cmd_ctrl_node *)__mptr___0; goto ldv_61157; ldv_61156: list_del(& cmd_node->list); spin_unlock_irqrestore(& adapter->cmd_pending_q_lock, flags); if (cmd_node->wait_q_enabled != 0U) { adapter->cmd_wait_q.status = -1; mwifiex_complete_cmd(adapter, cmd_node); cmd_node->wait_q_enabled = 0U; } else { } mwifiex_recycle_cmd_node(adapter, cmd_node); tmp___1 = spinlock_check(& adapter->cmd_pending_q_lock); flags = _raw_spin_lock_irqsave(tmp___1); cmd_node = tmp_node; __mptr___1 = (struct list_head const *)tmp_node->list.next; tmp_node = (struct cmd_ctrl_node *)__mptr___1; ldv_61157: ; if ((unsigned long )(& cmd_node->list) != (unsigned long )(& adapter->cmd_pending_q)) { goto ldv_61156; } else { } spin_unlock_irqrestore(& adapter->cmd_pending_q_lock, flags); spin_unlock_irqrestore(& adapter->mwifiex_cmd_lock, cmd_flags); tmp___2 = spinlock_check(& adapter->scan_pending_q_lock); flags = _raw_spin_lock_irqsave(tmp___2); __mptr___2 = (struct list_head const *)adapter->scan_pending_q.next; cmd_node = (struct cmd_ctrl_node *)__mptr___2; __mptr___3 = (struct list_head const *)cmd_node->list.next; tmp_node = (struct cmd_ctrl_node *)__mptr___3; goto ldv_61169; ldv_61168: list_del(& cmd_node->list); cmd_node->wait_q_enabled = 0U; mwifiex_insert_cmd_to_free_q(adapter, cmd_node); cmd_node = tmp_node; __mptr___4 = (struct list_head const *)tmp_node->list.next; tmp_node = (struct cmd_ctrl_node *)__mptr___4; ldv_61169: ; if ((unsigned long )(& cmd_node->list) != (unsigned long )(& adapter->scan_pending_q)) { goto ldv_61168; } else { } spin_unlock_irqrestore(& adapter->scan_pending_q_lock, flags); if (adapter->scan_processing != 0U) { tmp___3 = spinlock_check(& adapter->mwifiex_cmd_lock); cmd_flags = _raw_spin_lock_irqsave(tmp___3); adapter->scan_processing = 0U; spin_unlock_irqrestore(& adapter->mwifiex_cmd_lock, cmd_flags); i = 0; goto ldv_61176; ldv_61175: priv = adapter->priv[i]; if ((unsigned long )priv == (unsigned long )((struct mwifiex_private *)0)) { goto ldv_61174; } else { } if ((unsigned long )priv->scan_request != (unsigned long )((struct cfg80211_scan_request *)0)) { if ((adapter->debug_mask & 536870912U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: aborting scan\n"); } else { } } else { } cfg80211_scan_done(priv->scan_request, 1); priv->scan_request = (struct cfg80211_scan_request *)0; } else { } ldv_61174: i = i + 1; ldv_61176: ; if ((int )adapter->priv_num > i) { goto ldv_61175; } else { } } else { } return; } } void mwifiex_cancel_pending_ioctl(struct mwifiex_adapter *adapter ) { struct cmd_ctrl_node *cmd_node ; struct cmd_ctrl_node *tmp_node ; unsigned long cmd_flags ; unsigned long scan_pending_q_flags ; struct mwifiex_private *priv ; int i ; raw_spinlock_t *tmp ; raw_spinlock_t *tmp___0 ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; raw_spinlock_t *tmp___1 ; { cmd_node = (struct cmd_ctrl_node *)0; tmp_node = (struct cmd_ctrl_node *)0; if ((unsigned long )adapter->curr_cmd != (unsigned long )((struct cmd_ctrl_node *)0) && (adapter->curr_cmd)->wait_q_enabled != 0U) { tmp = spinlock_check(& adapter->mwifiex_cmd_lock); cmd_flags = _raw_spin_lock_irqsave(tmp); cmd_node = adapter->curr_cmd; cmd_node->wait_q_enabled = 0U; cmd_node->cmd_flag = cmd_node->cmd_flag | 2U; mwifiex_recycle_cmd_node(adapter, cmd_node); mwifiex_complete_cmd(adapter, adapter->curr_cmd); adapter->curr_cmd = (struct cmd_ctrl_node *)0; spin_unlock_irqrestore(& adapter->mwifiex_cmd_lock, cmd_flags); } else { } tmp___0 = spinlock_check(& adapter->scan_pending_q_lock); scan_pending_q_flags = _raw_spin_lock_irqsave(tmp___0); __mptr = (struct list_head const *)adapter->scan_pending_q.next; cmd_node = (struct cmd_ctrl_node *)__mptr; __mptr___0 = (struct list_head const *)cmd_node->list.next; tmp_node = (struct cmd_ctrl_node *)__mptr___0; goto ldv_61200; ldv_61199: list_del(& cmd_node->list); cmd_node->wait_q_enabled = 0U; mwifiex_insert_cmd_to_free_q(adapter, cmd_node); cmd_node = tmp_node; __mptr___1 = (struct list_head const *)tmp_node->list.next; tmp_node = (struct cmd_ctrl_node *)__mptr___1; ldv_61200: ; if ((unsigned long )(& cmd_node->list) != (unsigned long )(& adapter->scan_pending_q)) { goto ldv_61199; } else { } spin_unlock_irqrestore(& adapter->scan_pending_q_lock, scan_pending_q_flags); if (adapter->scan_processing != 0U) { tmp___1 = spinlock_check(& adapter->mwifiex_cmd_lock); cmd_flags = _raw_spin_lock_irqsave(tmp___1); adapter->scan_processing = 0U; spin_unlock_irqrestore(& adapter->mwifiex_cmd_lock, cmd_flags); i = 0; goto ldv_61207; ldv_61206: priv = adapter->priv[i]; if ((unsigned long )priv == (unsigned long )((struct mwifiex_private *)0)) { goto ldv_61205; } else { } if ((unsigned long )priv->scan_request != (unsigned long )((struct cfg80211_scan_request *)0)) { if ((adapter->debug_mask & 536870912U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: aborting scan\n"); } else { } } else { } cfg80211_scan_done(priv->scan_request, 1); priv->scan_request = (struct cfg80211_scan_request *)0; } else { } ldv_61205: i = i + 1; ldv_61207: ; if ((int )adapter->priv_num > i) { goto ldv_61206; } else { } } else { } adapter->cmd_wait_q.status = -1; return; } } void mwifiex_check_ps_cond(struct mwifiex_adapter *adapter ) { { if (((unsigned int )adapter->cmd_sent == 0U && (unsigned long )adapter->curr_cmd == (unsigned long )((struct cmd_ctrl_node *)0)) && (((unsigned int )adapter->cmd_resp_received == 0U && (unsigned int )adapter->event_received == 0U) && (unsigned int )adapter->data_received == 0U)) { mwifiex_dnld_sleep_confirm_cmd(adapter); } else if ((adapter->debug_mask & 16U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cmd: Delay Sleep Confirm (%s%s%s)\n", (unsigned int )adapter->cmd_sent != 0U ? (char *)"D" : (char *)"", (unsigned long )adapter->curr_cmd != (unsigned long )((struct cmd_ctrl_node *)0) ? (char *)"C" : (char *)"", ((unsigned int )adapter->cmd_resp_received != 0U || (unsigned int )adapter->event_received != 0U) || (unsigned int )adapter->data_received != 0U ? (char *)"R" : (char *)""); } else { } } else { } return; } } void mwifiex_hs_activated_event(struct mwifiex_private *priv , u8 activated ) { { if ((unsigned int )activated != 0U) { if ((unsigned int )(priv->adapter)->is_hs_configured != 0U) { (priv->adapter)->hs_activated = 1U; mwifiex_update_rxreor_flags(priv->adapter, 1); if (((priv->adapter)->debug_mask & 32U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "event: hs_activated\n"); } else { } } else { } (priv->adapter)->hs_activate_wait_q_woken = 1U; __wake_up(& (priv->adapter)->hs_activate_wait_q, 1U, 1, (void *)0); } else if (((priv->adapter)->debug_mask & 32U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "event: HS not configured\n"); } else { } } else { } } else { if (((priv->adapter)->debug_mask & 32U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "event: hs_deactivated\n"); } else { } } else { } (priv->adapter)->hs_activated = 0U; } return; } } int mwifiex_ret_802_11_hs_cfg(struct mwifiex_private *priv , struct host_cmd_ds_command *resp ) { struct mwifiex_adapter *adapter ; struct host_cmd_ds_802_11_hs_cfg_enh *phs_cfg ; uint32_t conditions ; { adapter = priv->adapter; phs_cfg = & resp->params.opt_hs_cfg; conditions = phs_cfg->params.hs_config.conditions; if ((unsigned int )phs_cfg->action == 2U && (unsigned int )adapter->iface_type != 2U) { mwifiex_hs_activated_event(priv, 1); return (0); } else if ((adapter->debug_mask & 16U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cmd: CMD_RESP: HS_CFG cmd reply\t result=%#x, conditions=0x%x gpio=0x%x gap=0x%x\n", (int )resp->result, conditions, (int )phs_cfg->params.hs_config.gpio, (int )phs_cfg->params.hs_config.gap); } else { } } else { } if (conditions != 4294967295U) { adapter->is_hs_configured = 1U; if ((unsigned int )adapter->iface_type == 2U) { mwifiex_hs_activated_event(priv, 1); } else { } } else { adapter->is_hs_configured = 0U; if ((unsigned int )adapter->hs_activated != 0U) { mwifiex_hs_activated_event(priv, 0); } else { } } return (0); } } void mwifiex_process_hs_config(struct mwifiex_adapter *adapter ) { struct mwifiex_private *tmp ; { if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: %s: auto cancelling host sleep\tsince there is interrupt from the firmware\n", "mwifiex_process_hs_config"); } else { } } else { } (*(adapter->if_ops.wakeup))(adapter); adapter->hs_activated = 0U; adapter->is_hs_configured = 0U; adapter->is_suspended = 0; tmp = mwifiex_get_priv___0(adapter, 255); mwifiex_hs_activated_event(tmp, 0); return; } } static char const __kstrtab_mwifiex_process_hs_config[26U] = { 'm', 'w', 'i', 'f', 'i', 'e', 'x', '_', 'p', 'r', 'o', 'c', 'e', 's', 's', '_', 'h', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\000'}; struct kernel_symbol const __ksymtab_mwifiex_process_hs_config ; struct kernel_symbol const __ksymtab_mwifiex_process_hs_config = {(unsigned long )(& mwifiex_process_hs_config), (char const *)(& __kstrtab_mwifiex_process_hs_config)}; void mwifiex_process_sleep_confirm_resp(struct mwifiex_adapter *adapter , u8 *pbuf , u32 upld_len ) { struct host_cmd_ds_command *cmd ; struct mwifiex_private *priv ; struct mwifiex_private *tmp ; uint16_t result ; uint16_t command ; uint16_t seq_num ; struct mwifiex_private *tmp___0 ; { cmd = (struct host_cmd_ds_command *)pbuf; tmp = mwifiex_get_priv___0(adapter, 255); priv = tmp; result = cmd->result; command = cmd->command; seq_num = cmd->seq_num; if (upld_len == 0U) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "%s: cmd size is 0\n", "mwifiex_process_sleep_confirm_resp"); } else { } } else { } return; } else { } if ((adapter->debug_mask & 16U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cmd: CMD_RESP: 0x%x, result %d, len %d, seqno 0x%x\n", (int )command, (int )result, (int )cmd->size, (int )seq_num); } else { } } else { } priv = mwifiex_get_priv_by_id(adapter, (int )((u8 )(((int )seq_num & 3840) >> 8)), (int )((u8 )((int )seq_num >> 12))); if ((unsigned long )priv == (unsigned long )((struct mwifiex_private *)0)) { priv = mwifiex_get_priv___0(adapter, 255); } else { } seq_num = (unsigned int )seq_num & 255U; command = (unsigned int )command & 4095U; if ((unsigned int )command != 228U) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "%s: rcvd unexpected resp for cmd %#x, result = %x\n", "mwifiex_process_sleep_confirm_resp", (int )command, (int )result); } else { } } else { } return; } else { } if ((unsigned int )result != 0U) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "%s: sleep confirm cmd failed\n", "mwifiex_process_sleep_confirm_resp"); } else { } } else { } adapter->pm_wakeup_card_req = 0U; adapter->ps_state = 0U; return; } else { } adapter->pm_wakeup_card_req = 1U; if ((unsigned int )adapter->is_hs_configured != 0U) { tmp___0 = mwifiex_get_priv___0(adapter, 255); mwifiex_hs_activated_event(tmp___0, 1); } else { } adapter->ps_state = 3U; cmd->command = command; cmd->seq_num = seq_num; return; } } static char const __kstrtab_mwifiex_process_sleep_confirm_resp[35U] = { 'm', 'w', 'i', 'f', 'i', 'e', 'x', '_', 'p', 'r', 'o', 'c', 'e', 's', 's', '_', 's', 'l', 'e', 'e', 'p', '_', 'c', 'o', 'n', 'f', 'i', 'r', 'm', '_', 'r', 'e', 's', 'p', '\000'}; struct kernel_symbol const __ksymtab_mwifiex_process_sleep_confirm_resp ; struct kernel_symbol const __ksymtab_mwifiex_process_sleep_confirm_resp = {(unsigned long )(& mwifiex_process_sleep_confirm_resp), (char const *)(& __kstrtab_mwifiex_process_sleep_confirm_resp)}; int mwifiex_cmd_enh_power_mode(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd , u16 cmd_action , uint16_t ps_bitmap , struct mwifiex_ds_auto_ds *auto_ds ) { struct host_cmd_ds_802_11_ps_mode_enh *psmode_enh ; u8 *tlv ; u16 cmd_size ; struct mwifiex_adapter *adapter ; struct mwifiex_ie_types_ps_param *ps_tlv ; struct mwifiex_ps_param *ps_mode ; struct mwifiex_ie_types_auto_ds_param *auto_ds_tlv ; u16 idletime ; { psmode_enh = & cmd->params.psmode_enh; cmd_size = 0U; cmd->command = 228U; if ((unsigned int )cmd_action == 254U) { psmode_enh->action = 254U; psmode_enh->params.ps_bitmap = ps_bitmap; cmd->size = 12U; } else if ((unsigned int )cmd_action == 0U) { psmode_enh->action = 0U; psmode_enh->params.ps_bitmap = ps_bitmap; cmd->size = 12U; } else if ((unsigned int )cmd_action == 255U) { psmode_enh->action = 255U; psmode_enh->params.ps_bitmap = ps_bitmap; cmd_size = 12U; tlv = (u8 *)cmd + (unsigned long )cmd_size; if (((int )ps_bitmap & 16) != 0) { adapter = priv->adapter; ps_tlv = (struct mwifiex_ie_types_ps_param *)tlv; ps_mode = & ps_tlv->param; ps_tlv->header.type = 370U; ps_tlv->header.len = 14U; cmd_size = (unsigned int )cmd_size + 18U; tlv = tlv + 18UL; if (((priv->adapter)->debug_mask & 16U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "cmd: PS Command: Enter PS\n"); } else { } } else { } ps_mode->null_pkt_interval = adapter->null_pkt_interval; ps_mode->multiple_dtims = adapter->multiple_dtim; ps_mode->bcn_miss_timeout = adapter->bcn_miss_time_out; ps_mode->local_listen_interval = adapter->local_listen_interval; ps_mode->adhoc_wake_period = adapter->adhoc_awake_period; ps_mode->delay_to_ps = adapter->delay_to_ps; ps_mode->mode = adapter->enhanced_ps_mode; } else { } if ((int )ps_bitmap & 1) { auto_ds_tlv = (struct mwifiex_ie_types_auto_ds_param *)tlv; idletime = 0U; auto_ds_tlv->header.type = 369U; auto_ds_tlv->header.len = 2U; cmd_size = (unsigned int )cmd_size + 6U; tlv = tlv + 6UL; if ((unsigned long )auto_ds != (unsigned long )((struct mwifiex_ds_auto_ds *)0)) { idletime = auto_ds->idle_time; } else { } if (((priv->adapter)->debug_mask & 16U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "cmd: PS Command: Enter Auto Deep Sleep\n"); } else { } } else { } auto_ds_tlv->deep_sleep_timeout = idletime; } else { } cmd->size = cmd_size; } else { } return (0); } } int mwifiex_ret_enh_power_mode(struct mwifiex_private *priv , struct host_cmd_ds_command *resp , struct mwifiex_ds_pm_cfg *pm_cfg ) { struct mwifiex_adapter *adapter ; struct host_cmd_ds_802_11_ps_mode_enh *ps_mode ; uint16_t action ; uint16_t ps_bitmap ; uint16_t auto_ps_bitmap ; { adapter = priv->adapter; ps_mode = & resp->params.psmode_enh; action = ps_mode->action; ps_bitmap = ps_mode->params.ps_bitmap; auto_ps_bitmap = ps_mode->params.ps_bitmap; if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: %s: PS_MODE cmd reply result=%#x action=%#X\n", "mwifiex_ret_enh_power_mode", (int )resp->result, (int )action); } else { } } else { } if ((unsigned int )action == 255U) { if ((int )auto_ps_bitmap & 1) { if ((adapter->debug_mask & 16U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cmd: Enabled auto deep sleep\n"); } else { } } else { } (priv->adapter)->is_deep_sleep = 1U; } else { } if (((int )auto_ps_bitmap & 16) != 0) { if ((adapter->debug_mask & 16U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cmd: Enabled STA power save\n"); } else { } } else { } if ((unsigned int )adapter->sleep_period.period != 0U) { if ((adapter->debug_mask & 16U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cmd: set to uapsd/pps mode\n"); } else { } } else { } } else { } } else { } } else if ((unsigned int )action == 254U) { if ((int )ps_bitmap & 1) { (priv->adapter)->is_deep_sleep = 0U; if ((adapter->debug_mask & 16U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cmd: Disabled auto deep sleep\n"); } else { } } else { } } else { } if (((int )ps_bitmap & 16) != 0) { if ((adapter->debug_mask & 16U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cmd: Disabled STA power save\n"); } else { } } else { } if ((unsigned int )adapter->sleep_period.period != 0U) { adapter->delay_null_pkt = 0U; adapter->tx_lock_flag = 0U; adapter->pps_uapsd_mode = 0U; } else { } } else { } } else if ((unsigned int )action == 0U) { if (((int )ps_bitmap & 16) != 0) { adapter->ps_mode = 1U; } else { adapter->ps_mode = 0U; } if ((adapter->debug_mask & 16U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cmd: ps_bitmap=%#x\n", (int )ps_bitmap); } else { } } else { } if ((unsigned long )pm_cfg != (unsigned long )((struct mwifiex_ds_pm_cfg *)0)) { if (((int )ps_bitmap & 16) != 0) { pm_cfg->param.ps_mode = 1U; } else { pm_cfg->param.ps_mode = 0U; } } else { } } else { } return (0); } } int mwifiex_cmd_get_hw_spec(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd ) { struct host_cmd_ds_get_hw_spec *hw_spec ; { hw_spec = & cmd->params.hw_spec; cmd->command = 3U; cmd->size = 71U; memcpy((void *)(& hw_spec->permanent_addr), (void const *)(& priv->curr_addr), 6UL); return (0); } } int mwifiex_ret_get_hw_spec(struct mwifiex_private *priv , struct host_cmd_ds_command *resp ) { struct host_cmd_ds_get_hw_spec *hw_spec ; struct mwifiex_adapter *adapter ; struct mwifiex_ie_types_header *tlv ; struct hw_spec_api_rev *api_rev ; u16 resp_size ; u16 api_id ; int i ; int left_len ; int parsed_len ; { hw_spec = & resp->params.hw_spec; adapter = priv->adapter; parsed_len = 0; adapter->fw_cap_info = hw_spec->fw_cap_info; if (((unsigned long )adapter->fw_cap_info & 12032UL) != 0UL) { adapter->fw_bands = (unsigned int )((unsigned char )((adapter->fw_cap_info & 12032U) >> 8)) & 63U; } else { adapter->fw_bands = 1U; } adapter->config_bands = adapter->fw_bands; if (((int )adapter->fw_bands & 4) != 0) { if (((int )adapter->fw_bands & 8) != 0) { adapter->config_bands = (u8 )((unsigned int )adapter->config_bands | 16U); adapter->fw_bands = (u8 )((unsigned int )adapter->fw_bands | 16U); } else { } if (((int )adapter->fw_bands & 16) != 0) { adapter->adhoc_start_band = 20U; adapter->adhoc_11n_enabled = 1U; } else { adapter->adhoc_start_band = 4U; } priv->adhoc_channel = 36U; } else if (((int )adapter->fw_bands & 8) != 0) { adapter->adhoc_start_band = 11U; priv->adhoc_channel = 6U; adapter->adhoc_11n_enabled = 1U; } else if (((int )adapter->fw_bands & 2) != 0) { adapter->adhoc_start_band = 3U; priv->adhoc_channel = 6U; } else if ((int )adapter->fw_bands & 1) { adapter->adhoc_start_band = 1U; priv->adhoc_channel = 6U; } else { } adapter->fw_release_number = hw_spec->fw_release_number; adapter->fw_api_ver = (u8 )(adapter->fw_release_number >> 16); adapter->number_of_antenna = hw_spec->number_of_antenna; if (hw_spec->dot_11ac_dev_cap != 0U) { adapter->is_hw_11ac_capable = 1U; adapter->hw_dot_11ac_dev_cap = hw_spec->dot_11ac_dev_cap; adapter->usr_dot_11ac_dev_cap_bg = adapter->hw_dot_11ac_dev_cap & 4292933631U; adapter->usr_dot_11ac_dev_cap_a = adapter->hw_dot_11ac_dev_cap & 4292933631U; adapter->hw_dot_11ac_mcs_support = hw_spec->dot_11ac_mcs_support; adapter->usr_dot_11ac_mcs_support = adapter->hw_dot_11ac_mcs_support; } else { adapter->is_hw_11ac_capable = 0U; } resp_size = (unsigned int )resp->size - 8U; if ((unsigned int )resp_size > 63U) { left_len = (int )((unsigned int )resp_size - 63U); goto ldv_61306; ldv_61305: tlv = (struct mwifiex_ie_types_header *)(& hw_spec->tlvs) + (unsigned long )parsed_len; switch ((int )tlv->type) { case 455: api_rev = (struct hw_spec_api_rev *)tlv; api_id = api_rev->api_id; switch ((int )api_id) { case 1: adapter->key_api_major_ver = api_rev->major_ver; adapter->key_api_minor_ver = api_rev->minor_ver; if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "key_api v%d.%d\n", (int )adapter->key_api_major_ver, (int )adapter->key_api_minor_ver); } else { } } else { } goto ldv_61300; case 2: adapter->fw_api_ver = api_rev->major_ver; if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "Firmware api version %d\n", (int )adapter->fw_api_ver); } else { } } else { } goto ldv_61300; default: ; if ((adapter->debug_mask & 2U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "Unknown api_id: %d\n", (int )api_id); } else { } } else { } goto ldv_61300; } ldv_61300: ; goto ldv_61303; default: ; if ((adapter->debug_mask & 2U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "Unknown GET_HW_SPEC TLV type: %#x\n", (int )tlv->type); } else { } } else { } goto ldv_61303; } ldv_61303: parsed_len = (int )(((unsigned int )tlv->len + (unsigned int )parsed_len) + 4U); left_len = (int )(((unsigned int )left_len - (unsigned int )tlv->len) - 4U); ldv_61306: ; if ((unsigned int )left_len > 4U) { goto ldv_61305; } else { } } else { } if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: GET_HW_SPEC: fw_release_number- %#x\n", adapter->fw_release_number); } else { } } else { } if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: GET_HW_SPEC: permanent addr: %pM\n", (u8 *)(& hw_spec->permanent_addr)); } else { } } else { } if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: GET_HW_SPEC: hw_if_version=%#x version=%#x\n", (int )hw_spec->hw_if_version, (int )hw_spec->version); } else { } } else { } ether_addr_copy((u8 *)(& (priv->adapter)->perm_addr), (u8 const *)(& hw_spec->permanent_addr)); adapter->region_code = hw_spec->region_code; i = 0; goto ldv_61310; ldv_61309: ; if ((int )adapter->region_code == (int )region_code_index[i]) { goto ldv_61308; } else { } i = i + 1; ldv_61310: ; if (i <= 6) { goto ldv_61309; } else { } ldv_61308: ; if (i > 6) { adapter->region_code = 16U; if ((adapter->debug_mask & 536870912U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cmd: unknown region code, use default (USA)\n"); } else { } } else { } } else { } adapter->hw_dot_11n_dev_cap = hw_spec->dot_11n_dev_cap; adapter->hw_dev_mcs_support = hw_spec->dev_mcs_support; adapter->user_dev_mcs_support = adapter->hw_dev_mcs_support; if ((unsigned long )adapter->if_ops.update_mp_end_port != (unsigned long )((void (*)(struct mwifiex_adapter * , u16 ))0)) { (*(adapter->if_ops.update_mp_end_port))(adapter, (int )hw_spec->mp_end_port); } else { } if ((unsigned int )adapter->fw_api_ver == 15U) { adapter->scan_chan_gap_enabled = 1; } else { } return (0); } } 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 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_66(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_67(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_68(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_69(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } int ldv_mod_timer_70(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_7(ldv_func_arg1, ldv_func_arg2, 1); return (ldv_func_res); } } int ldv_del_timer_sync_71(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___4 ldv_func_res ; int tmp ; { tmp = del_timer_sync(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_7(ldv_func_arg1); return (ldv_func_res); } } extern void __bad_percpu_size(void) ; extern int memcmp(void const * , void const * , size_t ) ; extern int __preempt_count ; __inline static int preempt_count(void) { int pfo_ret__ ; { switch (4UL) { case 1UL: __asm__ ("movb %%gs:%1,%0": "=q" (pfo_ret__): "m" (__preempt_count)); goto ldv_6002; case 2UL: __asm__ ("movw %%gs:%1,%0": "=r" (pfo_ret__): "m" (__preempt_count)); goto ldv_6002; case 4UL: __asm__ ("movl %%gs:%1,%0": "=r" (pfo_ret__): "m" (__preempt_count)); goto ldv_6002; case 8UL: __asm__ ("movq %%gs:%1,%0": "=r" (pfo_ret__): "m" (__preempt_count)); goto ldv_6002; default: __bad_percpu_size(); } ldv_6002: ; return (pfo_ret__ & 2147483647); } } bool ldv_queue_work_on_83(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_85(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_84(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_87(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_86(struct workqueue_struct *ldv_func_arg1 ) ; __inline static struct sk_buff *__dev_alloc_skb(unsigned int length , gfp_t gfp_mask ) { struct sk_buff *tmp ; { tmp = __netdev_alloc_skb((struct net_device *)0, length, gfp_mask); return (tmp); } } __inline static int ieee80211_is_mgmt(__le16 fc ) { { return (((int )fc & 12) == 0); } } extern int netif_rx(struct sk_buff * ) ; extern int netif_rx_ni(struct sk_buff * ) ; extern u8 const *cfg80211_find_ie(u8 , u8 const * , int ) ; extern bool cfg80211_rx_mgmt(struct wireless_dev * , int , int , u8 const * , size_t , u32 ) ; extern __be16 eth_type_trans(struct sk_buff * , struct net_device * ) ; int mwifiex_recv_packet(struct mwifiex_private *priv , struct sk_buff *skb ) ; int mwifiex_process_mgmt_packet(struct mwifiex_private *priv , struct sk_buff *skb ) ; int mwifiex_init_shutdown_fw(struct mwifiex_private *priv , u32 func_init_shutdown ) ; void mwifiex_del_all_sta_list(struct mwifiex_private *priv ) ; void mwifiex_del_sta_entry(struct mwifiex_private *priv , u8 const *mac ) ; void mwifiex_set_sta_ht_cap(struct mwifiex_private *priv , u8 const *ies , int ies_len , struct mwifiex_sta_node *node ) ; struct mwifiex_sta_node *mwifiex_add_sta_entry(struct mwifiex_private *priv , u8 const *mac ) ; struct mwifiex_sta_node *mwifiex_get_sta_entry(struct mwifiex_private *priv , u8 const *mac ) ; int mwifiex_get_tdls_list(struct mwifiex_private *priv , struct tdls_peer_info *buf ) ; void mwifiex_auto_tdls_update_peer_signal(struct mwifiex_private *priv , u8 *mac , s8 snr , s8 nflr ) ; void mwifiex_hist_data_set(struct mwifiex_private *priv , u8 rx_rate , s8 snr , s8 nflr ) ; void mwifiex_hist_data_add(struct mwifiex_private *priv , u8 rx_rate , s8 snr , s8 nflr ) ; void *mwifiex_alloc_dma_align_buf(int rx_len , gfp_t flags ) ; int mwifiex_get_rx_reorder_tbl(struct mwifiex_private *priv , struct mwifiex_ds_rx_reorder_tbl *buf ) ; int mwifiex_get_tx_ba_stream_tbl(struct mwifiex_private *priv , struct mwifiex_ds_tx_ba_stream_tbl *buf ) ; static struct mwifiex_debug_data items[42U] = { {{'d', 'e', 'b', 'u', 'g', '_', 'm', 'a', 's', 'k', '\000'}, 4U, 0UL, 1}, {{'i', 'n', 't', '_', 'c', 'o', 'u', 'n', 't', 'e', 'r', '\000'}, 4U, 4UL, 1}, {{'w', 'm', 'm', '_', 'a', 'c', '_', 'v', 'o', '\000'}, 4U, 20UL, 1}, {{'w', 'm', 'm', '_', 'a', 'c', '_', 'v', 'i', '\000'}, 4U, 16UL, 1}, {{'w', 'm', 'm', '_', 'a', 'c', '_', 'b', 'e', '\000'}, 4U, 12UL, 1}, {{'w', 'm', 'm', '_', 'a', 'c', '_', 'b', 'k', '\000'}, 4U, 8UL, 1}, {{'t', 'x', '_', 'b', 'u', 'f', '_', 's', 'i', 'z', 'e', '\000'}, 4U, 40UL, 1}, {{'c', 'u', 'r', 'r', '_', 't', 'x', '_', 'b', 'u', 'f', '_', 's', 'i', 'z', 'e', '\000'}, 4U, 44UL, 1}, {{'p', 's', '_', 'm', 'o', 'd', 'e', '\000'}, 2U, 4480UL, 1}, {{'p', 's', '_', 's', 't', 'a', 't', 'e', '\000'}, 4U, 4484UL, 1}, {{'i', 's', '_', 'd', 'e', 'e', 'p', '_', 's', 'l', 'e', 'e', 'p', '\000'}, 1U, 4488UL, 1}, {{'w', 'a', 'k', 'e', 'u', 'p', '_', 'd', 'e', 'v', '_', 'r', 'e', 'q', '\000'}, 1U, 4489UL, 1}, {{'w', 'a', 'k', 'e', 'u', 'p', '_', 't', 'r', 'i', 'e', 's', '\000'}, 4U, 4492UL, 1}, {{'h', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'e', 'd', '\000'}, 1U, 4496UL, 1}, {{'h', 's', '_', 'a', 'c', 't', 'i', 'v', 'a', 't', 'e', 'd', '\000'}, 1U, 4497UL, 1}, {{'n', 'u', 'm', '_', 't', 'x', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\000'}, 4U, 4536UL, 1}, {{'i', 's', '_', 'c', 'm', 'd', '_', 't', 'i', 'm', 'e', 'd', 'o', 'u', 't', '\000'}, 1U, 4540UL, 1}, {{'t', 'i', 'm', 'e', 'o', 'u', 't', '_', 'c', 'm', 'd', '_', 'i', 'd', '\000'}, 2U, 4542UL, 1}, {{'t', 'i', 'm', 'e', 'o', 'u', 't', '_', 'c', 'm', 'd', '_', 'a', 'c', 't', '\000'}, 2U, 4544UL, 1}, {{'l', 'a', 's', 't', '_', 'c', 'm', 'd', '_', 'i', 'd', '\000'}, 10U, 4546UL, 5}, {{'l', 'a', 's', 't', '_', 'c', 'm', 'd', '_', 'a', 'c', 't', '\000'}, 10U, 4556UL, 5}, {{'l', 'a', 's', 't', '_', 'c', 'm', 'd', '_', 'i', 'n', 'd', 'e', 'x', '\000'}, 2U, 4566UL, 1}, {{'l', 'a', 's', 't', '_', 'c', 'm', 'd', '_', 'r', 'e', 's', 'p', '_', 'i', 'd', '\000'}, 10U, 4568UL, 5}, {{'l', 'a', 's', 't', '_', 'c', 'm', 'd', '_', 'r', 'e', 's', 'p', '_', 'i', 'n', 'd', 'e', 'x', '\000'}, 2U, 4578UL, 1}, {{'l', 'a', 's', 't', '_', 'e', 'v', 'e', 'n', 't', '\000'}, 10U, 4580UL, 5}, {{'l', 'a', 's', 't', '_', 'e', 'v', 'e', 'n', 't', '_', 'i', 'n', 'd', 'e', 'x', '\000'}, 2U, 4590UL, 1}, {{'n', 'u', 'm', '_', 'c', 'm', 'd', '_', 'h', '2', 'c', '_', 'f', 'a', 'i', 'l', '\000'}, 4U, 4500UL, 1}, {{'n', 'u', 'm', '_', 'c', 'm', 'd', '_', 's', 'l', 'e', 'e', 'p', '_', 'c', 'f', 'm', '_', 'f', 'a', 'i', 'l', '\000'}, 4U, 4504UL, 1}, {{'n', 'u', 'm', '_', 't', 'x', '_', 'h', '2', 'c', '_', 'f', 'a', 'i', 'l', '\000'}, 4U, 4508UL, 1}, {{'n', 'u', 'm', '_', 'e', 'v', 't', '_', 'd', 'e', 'a', 'u', 't', 'h', '\000'}, 4U, 4512UL, 1}, {{'n', 'u', 'm', '_', 'e', 'v', 't', '_', 'd', 'i', 's', 'a', 's', 's', 'o', 'c', '\000'}, 4U, 4516UL, 1}, {{'n', 'u', 'm', '_', 'e', 'v', 't', '_', 'l', 'i', 'n', 'k', '_', 'l', 'o', 's', 't', '\000'}, 4U, 4520UL, 1}, {{'n', 'u', 'm', '_', 'c', 'm', 'd', '_', 'd', 'e', 'a', 'u', 't', 'h', '\000'}, 4U, 4524UL, 1}, {{'n', 'u', 'm', '_', 'c', 'm', 'd', '_', 'a', 's', 's', 'o', 'c', '_', 'o', 'k', '\000'}, 4U, 4528UL, 1}, {{'n', 'u', 'm', '_', 'c', 'm', 'd', '_', 'a', 's', 's', 'o', 'c', '_', 'f', 'a', 'i', 'l', '\000'}, 4U, 4532UL, 1}, {{'c', 'm', 'd', '_', 's', 'e', 'n', 't', '\000'}, 1U, 4593UL, 1}, {{'d', 'a', 't', 'a', '_', 's', 'e', 'n', 't', '\000'}, 1U, 4592UL, 1}, {{'c', 'm', 'd', '_', 'r', 'e', 's', 'p', '_', 'r', 'e', 'c', 'e', 'i', 'v', 'e', 'd', '\000'}, 1U, 4594UL, 1}, {{'e', 'v', 'e', 'n', 't', '_', 'r', 'e', 'c', 'e', 'i', 'v', 'e', 'd', '\000'}, 1U, 4595UL, 1}, {{'c', 'm', 'd', '_', 'p', 'e', 'n', 'd', 'i', 'n', 'g', '\000'}, 4U, 432UL, 1}, {{'t', 'x', '_', 'p', 'e', 'n', 'd', 'i', 'n', 'g', '\000'}, 4U, 428UL, 1}, {{'r', 'x', '_', 'p', 'e', 'n', 'd', 'i', 'n', 'g', '\000'}, 4U, 424UL, 1}}; static int num_of_items = 42; int mwifiex_init_fw_complete(struct mwifiex_adapter *adapter ) { { adapter->init_wait_q_woken = 1U; __wake_up(& adapter->init_wait_q, 1U, 1, (void *)0); return (0); } } int mwifiex_shutdown_fw_complete(struct mwifiex_adapter *adapter ) { { adapter->hw_status = 5; adapter->init_wait_q_woken = 1U; __wake_up(& adapter->init_wait_q, 1U, 1, (void *)0); return (0); } } int mwifiex_init_shutdown_fw(struct mwifiex_private *priv , u32 func_init_shutdown ) { u16 cmd ; int tmp ; { if (func_init_shutdown == 1U) { cmd = 169U; } else if (func_init_shutdown == 2U) { cmd = 170U; } else { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "unsupported parameter\n"); } else { } } else { } return (-1); } tmp = mwifiex_send_cmd(priv, (int )cmd, 1, 0U, (void *)0, 1); return (tmp); } } static char const __kstrtab_mwifiex_init_shutdown_fw[25U] = { 'm', 'w', 'i', 'f', 'i', 'e', 'x', '_', 'i', 'n', 'i', 't', '_', 's', 'h', 'u', 't', 'd', 'o', 'w', 'n', '_', 'f', 'w', '\000'}; struct kernel_symbol const __ksymtab_mwifiex_init_shutdown_fw ; struct kernel_symbol const __ksymtab_mwifiex_init_shutdown_fw = {(unsigned long )(& mwifiex_init_shutdown_fw), (char const *)(& __kstrtab_mwifiex_init_shutdown_fw)}; int mwifiex_get_debug_info(struct mwifiex_private *priv , struct mwifiex_debug_info *info___0 ) { struct mwifiex_adapter *adapter ; int tmp ; int tmp___0 ; int tmp___1 ; { adapter = priv->adapter; if ((unsigned long )info___0 != (unsigned long )((struct mwifiex_debug_info *)0)) { info___0->debug_mask = adapter->debug_mask; memcpy((void *)(& info___0->packets_out), (void const *)(& priv->wmm.packets_out), 32UL); info___0->curr_tx_buf_size = (unsigned int )adapter->curr_tx_buf_size; info___0->tx_buf_size = (unsigned int )adapter->tx_buf_size; tmp = mwifiex_get_rx_reorder_tbl(priv, (struct mwifiex_ds_rx_reorder_tbl *)(& info___0->rx_tbl)); info___0->rx_tbl_num = (u32 )tmp; tmp___0 = mwifiex_get_tx_ba_stream_tbl(priv, (struct mwifiex_ds_tx_ba_stream_tbl *)(& info___0->tx_tbl)); info___0->tx_tbl_num = (u32 )tmp___0; tmp___1 = mwifiex_get_tdls_list(priv, (struct tdls_peer_info *)(& info___0->tdls_list)); info___0->tdls_peer_num = (u32 )tmp___1; info___0->ps_mode = adapter->ps_mode; info___0->ps_state = adapter->ps_state; info___0->is_deep_sleep = adapter->is_deep_sleep; info___0->pm_wakeup_card_req = adapter->pm_wakeup_card_req; info___0->pm_wakeup_fw_try = adapter->pm_wakeup_fw_try; info___0->is_hs_configured = adapter->is_hs_configured; info___0->hs_activated = adapter->hs_activated; info___0->is_cmd_timedout = adapter->is_cmd_timedout; info___0->num_cmd_host_to_card_failure = adapter->dbg.num_cmd_host_to_card_failure; info___0->num_cmd_sleep_cfm_host_to_card_failure = adapter->dbg.num_cmd_sleep_cfm_host_to_card_failure; info___0->num_tx_host_to_card_failure = adapter->dbg.num_tx_host_to_card_failure; info___0->num_event_deauth = adapter->dbg.num_event_deauth; info___0->num_event_disassoc = adapter->dbg.num_event_disassoc; info___0->num_event_link_lost = adapter->dbg.num_event_link_lost; info___0->num_cmd_deauth = adapter->dbg.num_cmd_deauth; info___0->num_cmd_assoc_success = adapter->dbg.num_cmd_assoc_success; info___0->num_cmd_assoc_failure = adapter->dbg.num_cmd_assoc_failure; info___0->num_tx_timeout = adapter->dbg.num_tx_timeout; info___0->timeout_cmd_id = adapter->dbg.timeout_cmd_id; info___0->timeout_cmd_act = adapter->dbg.timeout_cmd_act; memcpy((void *)(& info___0->last_cmd_id), (void const *)(& adapter->dbg.last_cmd_id), 10UL); memcpy((void *)(& info___0->last_cmd_act), (void const *)(& adapter->dbg.last_cmd_act), 10UL); info___0->last_cmd_index = adapter->dbg.last_cmd_index; memcpy((void *)(& info___0->last_cmd_resp_id), (void const *)(& adapter->dbg.last_cmd_resp_id), 10UL); info___0->last_cmd_resp_index = adapter->dbg.last_cmd_resp_index; memcpy((void *)(& info___0->last_event), (void const *)(& adapter->dbg.last_event), 10UL); info___0->last_event_index = adapter->dbg.last_event_index; info___0->data_sent = adapter->data_sent; info___0->cmd_sent = adapter->cmd_sent; info___0->cmd_resp_received = adapter->cmd_resp_received; } else { } return (0); } } int mwifiex_debug_info_to_buffer(struct mwifiex_private *priv , char *buf , struct mwifiex_debug_info *info___0 ) { char *p ; struct mwifiex_debug_data *d ; size_t size ; size_t addr ; long val ; int i ; int j ; 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 ; { p = buf; d = (struct mwifiex_debug_data *)(& items); if ((unsigned long )info___0 == (unsigned long )((struct mwifiex_debug_info *)0)) { return (0); } else { } i = 0; goto ldv_60979; ldv_60978: tmp = sprintf(p, "%s=", (char *)(& (d + (unsigned long )i)->name)); p = p + (unsigned long )tmp; size = (size_t )((d + (unsigned long )i)->size / (u32 )(d + (unsigned long )i)->num); if (num_of_items + -3 > i) { addr = (d + (unsigned long )i)->addr + (unsigned long )info___0; } else { addr = (d + (unsigned long )i)->addr + (unsigned long )priv->adapter; } j = 0; goto ldv_60976; ldv_60975: ; switch (size) { case 1UL: val = (long )*((u8 *)addr); goto ldv_60970; case 2UL: val = (long )*((u16 *)addr); goto ldv_60970; case 4UL: val = (long )*((u32 *)addr); goto ldv_60970; case 8UL: val = (long )*((long long *)addr); goto ldv_60970; default: val = -1L; goto ldv_60970; } ldv_60970: tmp___0 = sprintf(p, "%#lx ", val); p = p + (unsigned long )tmp___0; addr = addr + size; j = j + 1; ldv_60976: ; if ((d + (unsigned long )i)->num > j) { goto ldv_60975; } else { } tmp___1 = sprintf(p, "\n"); p = p + (unsigned long )tmp___1; i = i + 1; ldv_60979: ; if (i < num_of_items) { goto ldv_60978; } else { } if (info___0->tx_tbl_num != 0U) { tmp___2 = sprintf(p, "Tx BA stream table:\n"); p = p + (unsigned long )tmp___2; i = 0; goto ldv_60982; ldv_60981: tmp___3 = sprintf(p, "tid = %d, ra = %pM\n", (int )info___0->tx_tbl[i].tid, (u8 *)(& info___0->tx_tbl[i].ra)); p = p + (unsigned long )tmp___3; i = i + 1; ldv_60982: ; if ((u32 )i < info___0->tx_tbl_num) { goto ldv_60981; } else { } } else { } if (info___0->rx_tbl_num != 0U) { tmp___4 = sprintf(p, "Rx reorder table:\n"); p = p + (unsigned long )tmp___4; i = 0; goto ldv_60988; ldv_60987: tmp___5 = sprintf(p, "tid = %d, ta = %pM, ", (int )info___0->rx_tbl[i].tid, (u8 *)(& info___0->rx_tbl[i].ta)); p = p + (unsigned long )tmp___5; tmp___6 = sprintf(p, "start_win = %d, ", info___0->rx_tbl[i].start_win); p = p + (unsigned long )tmp___6; tmp___7 = sprintf(p, "win_size = %d, buffer: ", info___0->rx_tbl[i].win_size); p = p + (unsigned long )tmp___7; j = 0; goto ldv_60985; ldv_60984: tmp___8 = sprintf(p, "%c ", info___0->rx_tbl[i].buffer[j] != 0U ? 49 : 48); p = p + (unsigned long )tmp___8; j = j + 1; ldv_60985: ; if ((u32 )j < info___0->rx_tbl[i].win_size) { goto ldv_60984; } else { } tmp___9 = sprintf(p, "\n"); p = p + (unsigned long )tmp___9; i = i + 1; ldv_60988: ; if ((u32 )i < info___0->rx_tbl_num) { goto ldv_60987; } else { } } else { } if (info___0->tdls_peer_num != 0U) { tmp___10 = sprintf(p, "TDLS peer table:\n"); p = p + (unsigned long )tmp___10; i = 0; goto ldv_60991; ldv_60990: tmp___11 = sprintf(p, "peer = %pM", (u8 *)(& info___0->tdls_list[i].peer_addr)); p = p + (unsigned long )tmp___11; tmp___12 = sprintf(p, "\n"); p = p + (unsigned long )tmp___12; i = i + 1; ldv_60991: ; if ((u32 )i < info___0->tdls_peer_num) { goto ldv_60990; } else { } } else { } return ((int )((unsigned int )((long )p) - (unsigned int )((long )buf))); } } static int mwifiex_parse_mgmt_packet(struct mwifiex_private *priv , u8 *payload , u16 len , struct rxpd *rx_pd ) { u16 stype ; u8 category ; u8 action_code ; u8 *addr2 ; struct ieee80211_hdr *ieee_hdr ; { ieee_hdr = (struct ieee80211_hdr *)payload; stype = (unsigned int )ieee_hdr->frame_control & 240U; switch ((int )stype) { case 208: category = *(payload + 30UL); switch ((int )category) { case 4: action_code = *(payload + 31U); if ((unsigned int )action_code == 14U) { addr2 = (u8 *)(& ieee_hdr->addr2); if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "TDLS discovery response %pM nf=%d, snr=%d\n", addr2, (int )rx_pd->nf, (int )rx_pd->snr); } else { } } else { } mwifiex_auto_tdls_update_peer_signal(priv, addr2, (int )rx_pd->snr, (int )rx_pd->nf); } else { } goto ldv_61006; case 3: ; if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "drop BACK action frames"); } else { } } else { } return (-1); default: ; if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "unknown public action frame category %d\n", (int )category); } else { } } else { } } ldv_61006: ; default: ; if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "unknown mgmt frame subtype %#x\n", (int )stype); } else { } } else { } return (0); } return (0); } } int mwifiex_process_mgmt_packet(struct mwifiex_private *priv , struct sk_buff *skb ) { struct rxpd *rx_pd ; u16 pkt_len ; struct ieee80211_hdr *ieee_hdr ; int tmp ; int tmp___0 ; { if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { return (-1); } else { } if (priv->mgmt_frame_mask == 0U || (unsigned int )priv->wdev.iftype == 0U) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "do not receive mgmt frames on uninitialized intf"); } else { } } else { } return (-1); } else { } rx_pd = (struct rxpd *)skb->data; skb_pull(skb, (unsigned int )rx_pd->rx_pkt_offset); skb_pull(skb, 2U); pkt_len = rx_pd->rx_pkt_length; ieee_hdr = (struct ieee80211_hdr *)skb->data; tmp___0 = ieee80211_is_mgmt((int )ieee_hdr->frame_control); if (tmp___0 != 0) { tmp = mwifiex_parse_mgmt_packet(priv, (u8 *)ieee_hdr, (int )pkt_len, rx_pd); if (tmp != 0) { return (-1); } else { } } else { } __memmove((void *)skb->data + 24U, (void const *)skb->data + 30U, (unsigned long )pkt_len - 30UL); pkt_len = (unsigned int )pkt_len - 8U; rx_pd->rx_pkt_length = pkt_len; cfg80211_rx_mgmt(& priv->wdev, (int )priv->roc_cfg.chan.center_freq, (int )((short )rx_pd->snr) + (int )((short )rx_pd->nf), (u8 const *)skb->data, (size_t )pkt_len, 0U); return (0); } } int mwifiex_recv_packet(struct mwifiex_private *priv , struct sk_buff *skb ) { struct mwifiex_sta_node *src_node ; struct ethhdr *p_ethhdr ; int tmp ; { if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { return (-1); } else { } priv->stats.rx_bytes = priv->stats.rx_bytes + (unsigned long )skb->len; priv->stats.rx_packets = priv->stats.rx_packets + 1UL; if ((int )priv->bss_role & 1) { p_ethhdr = (struct ethhdr *)skb->data; src_node = mwifiex_get_sta_entry(priv, (u8 const *)(& p_ethhdr->h_source)); if ((unsigned long )src_node != (unsigned long )((struct mwifiex_sta_node *)0)) { src_node->stats.last_rx = (u64 )jiffies; src_node->stats.rx_bytes = src_node->stats.rx_bytes + (u64 )skb->len; src_node->stats.rx_packets = src_node->stats.rx_packets + 1U; } else { } } else { } skb->dev = priv->netdev; skb->protocol = eth_type_trans(skb, priv->netdev); skb->ip_summed = 0U; if (((unsigned int )(priv->adapter)->iface_type == 2U || (unsigned int )(priv->adapter)->iface_type == 1U) && skb->truesize > 4096U) { skb->truesize = (skb->truesize + skb->len) - 4096U; } else { } tmp = preempt_count(); if (((unsigned long )tmp & 2096896UL) != 0UL) { netif_rx(skb); } else { netif_rx_ni(skb); } return (0); } } int mwifiex_complete_cmd(struct mwifiex_adapter *adapter , struct cmd_ctrl_node *cmd_node ) { { if ((adapter->debug_mask & 16U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cmd completed: status=%d\n", adapter->cmd_wait_q.status); } else { } } else { } *(cmd_node->condition) = 1U; if (adapter->cmd_wait_q.status == -110) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cmd timeout\n"); } else { } } else { } } else { __wake_up(& adapter->cmd_wait_q.wait, 1U, 1, (void *)0); } return (0); } } struct mwifiex_sta_node *mwifiex_get_sta_entry(struct mwifiex_private *priv , u8 const *mac ) { struct mwifiex_sta_node *node ; struct list_head const *__mptr ; int tmp ; struct list_head const *__mptr___0 ; { if ((unsigned long )mac == (unsigned long )((u8 const *)0U)) { return ((struct mwifiex_sta_node *)0); } else { } __mptr = (struct list_head const *)priv->sta_list.next; node = (struct mwifiex_sta_node *)__mptr; goto ldv_61037; ldv_61036: tmp = memcmp((void const *)(& node->mac_addr), (void const *)mac, 6UL); if (tmp == 0) { return (node); } else { } __mptr___0 = (struct list_head const *)node->list.next; node = (struct mwifiex_sta_node *)__mptr___0; ldv_61037: ; if ((unsigned long )(& node->list) != (unsigned long )(& priv->sta_list)) { goto ldv_61036; } else { } return ((struct mwifiex_sta_node *)0); } } struct mwifiex_sta_node *mwifiex_add_sta_entry(struct mwifiex_private *priv , u8 const *mac ) { struct mwifiex_sta_node *node ; unsigned long flags ; raw_spinlock_t *tmp ; void *tmp___0 ; { if ((unsigned long )mac == (unsigned long )((u8 const *)0U)) { return ((struct mwifiex_sta_node *)0); } else { } tmp = spinlock_check(& priv->sta_list_spinlock); flags = _raw_spin_lock_irqsave(tmp); node = mwifiex_get_sta_entry(priv, mac); if ((unsigned long )node != (unsigned long )((struct mwifiex_sta_node *)0)) { goto done; } else { } tmp___0 = kzalloc(480UL, 32U); node = (struct mwifiex_sta_node *)tmp___0; if ((unsigned long )node == (unsigned long )((struct mwifiex_sta_node *)0)) { goto done; } else { } memcpy((void *)(& node->mac_addr), (void const *)mac, 6UL); list_add_tail(& node->list, & priv->sta_list); done: spin_unlock_irqrestore(& priv->sta_list_spinlock, flags); return (node); } } void mwifiex_set_sta_ht_cap(struct mwifiex_private *priv , u8 const *ies , int ies_len , struct mwifiex_sta_node *node ) { struct ieee_types_header *ht_cap_ie ; struct ieee80211_ht_cap const *ht_cap ; u8 const *tmp ; { if ((unsigned long )ies == (unsigned long )((u8 const *)0U)) { return; } else { } tmp = cfg80211_find_ie(45, ies, ies_len); ht_cap_ie = (struct ieee_types_header *)tmp; if ((unsigned long )ht_cap_ie != (unsigned long )((struct ieee_types_header *)0)) { ht_cap = (struct ieee80211_ht_cap const *)ht_cap_ie + 1U; node->is_11n_enabled = 1U; node->max_amsdu = ((int )ht_cap->cap_info & 2048) != 0 ? 8192U : 4096U; } else { node->is_11n_enabled = 0U; } return; } } void mwifiex_del_sta_entry(struct mwifiex_private *priv , u8 const *mac ) { struct mwifiex_sta_node *node ; unsigned long flags ; raw_spinlock_t *tmp ; { tmp = spinlock_check(& priv->sta_list_spinlock); flags = _raw_spin_lock_irqsave(tmp); node = mwifiex_get_sta_entry(priv, mac); if ((unsigned long )node != (unsigned long )((struct mwifiex_sta_node *)0)) { list_del(& node->list); kfree((void const *)node); } else { } spin_unlock_irqrestore(& priv->sta_list_spinlock, flags); return; } } void mwifiex_del_all_sta_list(struct mwifiex_private *priv ) { struct mwifiex_sta_node *node ; struct mwifiex_sta_node *tmp ; unsigned long flags ; raw_spinlock_t *tmp___0 ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; { tmp___0 = spinlock_check(& priv->sta_list_spinlock); flags = _raw_spin_lock_irqsave(tmp___0); __mptr = (struct list_head const *)priv->sta_list.next; node = (struct mwifiex_sta_node *)__mptr; __mptr___0 = (struct list_head const *)node->list.next; tmp = (struct mwifiex_sta_node *)__mptr___0; goto ldv_61082; ldv_61081: list_del(& node->list); kfree((void const *)node); node = tmp; __mptr___1 = (struct list_head const *)tmp->list.next; tmp = (struct mwifiex_sta_node *)__mptr___1; ldv_61082: ; if ((unsigned long )(& node->list) != (unsigned long )(& priv->sta_list)) { goto ldv_61081; } else { } INIT_LIST_HEAD(& priv->sta_list); spin_unlock_irqrestore(& priv->sta_list_spinlock, flags); return; } } void mwifiex_hist_data_add(struct mwifiex_private *priv , u8 rx_rate , s8 snr , s8 nflr ) { struct mwifiex_histogram_data *phist_data ; int tmp ; { phist_data = priv->hist_data; tmp = atomic_read((atomic_t const *)(& phist_data->num_samples)); if (tmp > 1048576) { mwifiex_hist_data_reset(priv); } else { } mwifiex_hist_data_set(priv, (int )rx_rate, (int )snr, (int )nflr); return; } } void mwifiex_hist_data_set(struct mwifiex_private *priv , u8 rx_rate , s8 snr , s8 nflr ) { struct mwifiex_histogram_data *phist_data ; { phist_data = priv->hist_data; atomic_inc(& phist_data->num_samples); atomic_inc((atomic_t *)(& phist_data->rx_rate) + (unsigned long )rx_rate); atomic_inc((atomic_t *)(& phist_data->snr) + (unsigned long )snr); atomic_inc((atomic_t *)(& phist_data->noise_flr) + (unsigned long )((int )nflr + 128)); atomic_inc((atomic_t *)(& phist_data->sig_str) + (unsigned long )((int )nflr - (int )snr)); return; } } void mwifiex_hist_data_reset(struct mwifiex_private *priv ) { int ix ; struct mwifiex_histogram_data *phist_data ; { phist_data = priv->hist_data; atomic_set(& phist_data->num_samples, 0); ix = 0; goto ldv_61104; ldv_61103: atomic_set((atomic_t *)(& phist_data->rx_rate) + (unsigned long )ix, 0); ix = ix + 1; ldv_61104: ; if (ix <= 73) { goto ldv_61103; } else { } ix = 0; goto ldv_61107; ldv_61106: atomic_set((atomic_t *)(& phist_data->snr) + (unsigned long )ix, 0); ix = ix + 1; ldv_61107: ; if (ix <= 255) { goto ldv_61106; } else { } ix = 0; goto ldv_61110; ldv_61109: atomic_set((atomic_t *)(& phist_data->noise_flr) + (unsigned long )ix, 0); ix = ix + 1; ldv_61110: ; if (ix <= 255) { goto ldv_61109; } else { } ix = 0; goto ldv_61113; ldv_61112: atomic_set((atomic_t *)(& phist_data->sig_str) + (unsigned long )ix, 0); ix = ix + 1; ldv_61113: ; if (ix <= 255) { goto ldv_61112; } else { } return; } } void *mwifiex_alloc_dma_align_buf(int rx_len , gfp_t flags ) { struct sk_buff *skb ; int buf_len ; int pad ; { buf_len = rx_len + 128; skb = __dev_alloc_skb((unsigned int )buf_len, flags); if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { return ((void *)0); } else { } skb_reserve(skb, 64); pad = (int )((((unsigned int )((long )skb->data) + 63U) & 4294967232U) - (unsigned int )((long )skb->data)); skb_reserve(skb, pad); return ((void *)skb); } } static char const __kstrtab_mwifiex_alloc_dma_align_buf[28U] = { 'm', 'w', 'i', 'f', 'i', 'e', 'x', '_', 'a', 'l', 'l', 'o', 'c', '_', 'd', 'm', 'a', '_', 'a', 'l', 'i', 'g', 'n', '_', 'b', 'u', 'f', '\000'}; struct kernel_symbol const __ksymtab_mwifiex_alloc_dma_align_buf ; struct kernel_symbol const __ksymtab_mwifiex_alloc_dma_align_buf = {(unsigned long )(& mwifiex_alloc_dma_align_buf), (char const *)(& __kstrtab_mwifiex_alloc_dma_align_buf)}; bool ldv_queue_work_on_83(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_84(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_85(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_86(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_87(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } __inline static void __read_once_size(void const volatile *p , void *res , int size ) { { switch (size) { case 1: *((__u8 *)res) = *((__u8 volatile *)p); goto ldv_880; case 2: *((__u16 *)res) = *((__u16 volatile *)p); goto ldv_880; case 4: *((__u32 *)res) = *((__u32 volatile *)p); goto ldv_880; case 8: *((__u64 *)res) = *((__u64 volatile *)p); goto ldv_880; default: __asm__ volatile ("": : : "memory"); __builtin_memcpy(res, (void const *)p, (unsigned long )size); __asm__ volatile ("": : : "memory"); } ldv_880: ; return; } } __inline static void atomic_add(int i , atomic_t *v ) { { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; addl %1,%0": "+m" (v->counter): "ir" (i)); return; } } __inline static void atomic_sub(int i , atomic_t *v ) { { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; subl %1,%0": "+m" (v->counter): "ir" (i)); return; } } __inline static int atomic_sub_return(int i , atomic_t *v ) { int tmp ; { tmp = atomic_add_return(- i, v); return (tmp); } } extern int debug_lockdep_rcu_enabled(void) ; bool ldv_queue_work_on_97(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_99(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_98(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_101(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_100(struct workqueue_struct *ldv_func_arg1 ) ; extern void *idr_find_slowpath(struct idr * , int ) ; extern void idr_remove(struct idr * , int ) ; __inline static void *idr_find(struct idr *idr , int id ) { struct idr_layer *hint ; struct idr_layer *________p1 ; struct idr_layer *_________p1 ; union __anonunion___u_168 __u ; int tmp ; struct idr_layer *________p1___0 ; struct idr_layer *_________p1___0 ; union __anonunion___u_170 __u___0 ; int tmp___0 ; void *tmp___1 ; { __read_once_size((void const volatile *)(& idr->hint), (void *)(& __u.__c), 8); _________p1 = __u.__val; ________p1 = _________p1; tmp = debug_lockdep_rcu_enabled(); hint = ________p1; if ((unsigned long )hint != (unsigned long )((struct idr_layer *)0) && (id & -256) == hint->prefix) { __read_once_size((void const volatile *)(& hint->ary) + ((unsigned long )id & 255UL), (void *)(& __u___0.__c), 8); _________p1___0 = __u___0.__val; ________p1___0 = _________p1___0; tmp___0 = debug_lockdep_rcu_enabled(); return ((void *)________p1___0); } else { } tmp___1 = idr_find_slowpath(idr, id); return (tmp___1); } } __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); } } extern void skb_queue_head(struct sk_buff_head * , struct sk_buff * ) ; extern void skb_queue_tail(struct sk_buff_head * , struct sk_buff * ) ; extern void skb_complete_wifi_ack(struct sk_buff * , bool ) ; extern void cfg80211_mgmt_tx_status(struct wireless_dev * , u64 , u8 const * , size_t , bool , gfp_t ) ; int mwifiex_process_tx(struct mwifiex_private *priv , struct sk_buff *skb , struct mwifiex_tx_param *tx_param ) ; int mwifiex_process_sta_rx_packet(struct mwifiex_private *priv , struct sk_buff *skb ) ; int mwifiex_process_uap_rx_packet(struct mwifiex_private *priv , struct sk_buff *skb ) ; void *mwifiex_process_sta_txpd(struct mwifiex_private *priv , struct sk_buff *skb ) ; void *mwifiex_process_uap_txpd(struct mwifiex_private *priv , struct sk_buff *skb ) ; __inline static struct mwifiex_private *mwifiex_get_priv_by_id___0(struct mwifiex_adapter *adapter , u8 bss_num , u8 bss_type ) { int i ; { i = 0; goto ldv_60304; ldv_60303: ; if ((unsigned long )adapter->priv[i] != (unsigned long )((struct mwifiex_private *)0)) { if ((int )(adapter->priv[i])->bss_num == (int )bss_num && (int )(adapter->priv[i])->bss_type == (int )bss_type) { goto ldv_60302; } else { } } else { } i = i + 1; ldv_60304: ; if ((int )adapter->priv_num > i) { goto ldv_60303; } else { } ldv_60302: ; return ((int )adapter->priv_num > i ? adapter->priv[i] : (struct mwifiex_private *)0); } } __inline static struct mwifiex_private *mwifiex_get_priv___1(struct mwifiex_adapter *adapter , enum mwifiex_bss_role bss_role ) { int i ; { i = 0; goto ldv_60312; ldv_60311: ; if ((unsigned long )adapter->priv[i] != (unsigned long )((struct mwifiex_private *)0)) { if ((unsigned int )bss_role == 255U || ((unsigned long )(adapter->priv[i])->bss_role & 1UL) == (unsigned long )bss_role) { goto ldv_60310; } else { } } else { } i = i + 1; ldv_60312: ; if ((int )adapter->priv_num > i) { goto ldv_60311; } else { } ldv_60310: ; return ((int )adapter->priv_num > i ? adapter->priv[i] : (struct mwifiex_private *)0); } } void mwifiex_parse_tx_status_event(struct mwifiex_private *priv , void *event_body ) ; static u16 const mwifiex_1d_to_wmm_queue___0[8U] = { 1U, 0U, 0U, 1U, 2U, 2U, 3U, 3U}; int mwifiex_handle_rx_packet(struct mwifiex_adapter *adapter , struct sk_buff *skb ) { struct mwifiex_private *priv ; struct mwifiex_private *tmp ; struct rxpd *local_rx_pd ; struct mwifiex_rxinfo *rx_info ; struct mwifiex_rxinfo *tmp___0 ; int ret ; size_t __min1 ; size_t __min2 ; { tmp = mwifiex_get_priv___1(adapter, 255); priv = tmp; tmp___0 = MWIFIEX_SKB_RXCB(skb); rx_info = tmp___0; local_rx_pd = (struct rxpd *)skb->data; priv = mwifiex_get_priv_by_id___0(adapter, (int )local_rx_pd->bss_num & 15, (int )local_rx_pd->bss_type); if ((unsigned long )priv == (unsigned long )((struct mwifiex_private *)0)) { priv = mwifiex_get_priv___1(adapter, 255); } else { } if ((unsigned long )priv == (unsigned long )((struct mwifiex_private *)0)) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "data: priv not found. Drop RX packet\n"); } else { } } else { } dev_kfree_skb_any(skb); return (-1); } else { } if ((adapter->debug_mask & 65536U) != 0U) { __min1 = (size_t )skb->len; __min2 = 128UL; print_hex_dump("\017", "rx pkt:", 2, 16, 1, (void const *)skb->data, __min1 < __min2 ? __min1 : __min2, 0); } else { } memset((void *)rx_info, 0, 16UL); rx_info->bss_num = priv->bss_num; rx_info->bss_type = priv->bss_type; if ((unsigned int )priv->bss_role == 1U) { ret = mwifiex_process_uap_rx_packet(priv, skb); } else { ret = mwifiex_process_sta_rx_packet(priv, skb); } return (ret); } } static char const __kstrtab_mwifiex_handle_rx_packet[25U] = { 'm', 'w', 'i', 'f', 'i', 'e', 'x', '_', 'h', 'a', 'n', 'd', 'l', 'e', '_', 'r', 'x', '_', 'p', 'a', 'c', 'k', 'e', 't', '\000'}; struct kernel_symbol const __ksymtab_mwifiex_handle_rx_packet ; struct kernel_symbol const __ksymtab_mwifiex_handle_rx_packet = {(unsigned long )(& mwifiex_handle_rx_packet), (char const *)(& __kstrtab_mwifiex_handle_rx_packet)}; int mwifiex_process_tx(struct mwifiex_private *priv , struct sk_buff *skb , struct mwifiex_tx_param *tx_param ) { int hroom ; int ret ; struct mwifiex_adapter *adapter ; u8 *head_ptr ; struct txpd *local_tx_pd ; struct mwifiex_sta_node *dest_node ; struct ethhdr *hdr ; void *tmp ; void *tmp___0 ; size_t __min1 ; size_t __min2 ; { ret = -1; adapter = priv->adapter; local_tx_pd = (struct txpd *)0; hdr = (struct ethhdr *)skb->data; hroom = (unsigned int )adapter->iface_type == 2U ? 0 : 4; if ((unsigned int )priv->bss_role == 1U) { dest_node = mwifiex_get_sta_entry(priv, (u8 const *)(& hdr->h_dest)); if ((unsigned long )dest_node != (unsigned long )((struct mwifiex_sta_node *)0)) { dest_node->stats.tx_bytes = dest_node->stats.tx_bytes + (u64 )skb->len; dest_node->stats.tx_packets = dest_node->stats.tx_packets + 1U; } else { } tmp = mwifiex_process_uap_txpd(priv, skb); head_ptr = (u8 *)tmp; } else { tmp___0 = mwifiex_process_sta_txpd(priv, skb); head_ptr = (u8 *)tmp___0; } if (((unsigned int )adapter->data_sent != 0U || (unsigned int )adapter->tx_lock_flag != 0U) && (unsigned long )head_ptr != (unsigned long )((u8 *)0U)) { skb_queue_tail(& adapter->tx_data_q, skb); atomic_inc(& adapter->tx_queued); return (0); } else { } if ((unsigned long )head_ptr != (unsigned long )((u8 *)0U)) { if (((unsigned long )priv->bss_role & 1UL) == 0UL) { local_tx_pd = (struct txpd *)head_ptr + (unsigned long )hroom; } else { } if ((unsigned int )adapter->iface_type == 2U) { adapter->data_sent = 1U; ret = (*(adapter->if_ops.host_to_card))(adapter, 2, skb, (struct mwifiex_tx_param *)0); } else { ret = (*(adapter->if_ops.host_to_card))(adapter, 0, skb, tx_param); } } else { } if ((adapter->debug_mask & 65536U) != 0U) { __min1 = (size_t )skb->len; __min2 = 128UL; print_hex_dump("\017", "tx pkt:", 2, 16, 1, (void const *)skb->data, __min1 < __min2 ? __min1 : __min2, 0); } else { } switch (ret) { case -63: ; if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "data: -ENOSR is returned\n"); } else { } } else { } goto ldv_60782; case -16: ; if ((((unsigned long )priv->bss_role & 1UL) == 0UL && (unsigned int )adapter->pps_uapsd_mode != 0U) && (unsigned int )adapter->tx_lock_flag != 0U) { (priv->adapter)->tx_lock_flag = 0U; if ((unsigned long )local_tx_pd != (unsigned long )((struct txpd *)0)) { local_tx_pd->flags = 0U; } else { } } else { } if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "data: -EBUSY is returned\n"); } else { } } else { } goto ldv_60782; case -1: ; if ((unsigned int )adapter->iface_type != 1U) { adapter->data_sent = 0U; } else { } if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "mwifiex_write_data_async failed: 0x%X\n", ret); } else { } } else { } adapter->dbg.num_tx_host_to_card_failure = adapter->dbg.num_tx_host_to_card_failure + 1U; mwifiex_write_data_complete(adapter, skb, 0, ret); goto ldv_60782; case -115: ; if ((unsigned int )adapter->iface_type != 1U) { adapter->data_sent = 0U; } else { } goto ldv_60782; case 0: mwifiex_write_data_complete(adapter, skb, 0, ret); goto ldv_60782; default: ; goto ldv_60782; } ldv_60782: ; return (ret); } } static int mwifiex_host_to_card(struct mwifiex_adapter *adapter , struct sk_buff *skb , struct mwifiex_tx_param *tx_param ) { struct txpd *local_tx_pd ; u8 *head_ptr ; int ret ; struct mwifiex_private *priv ; struct mwifiex_txinfo *tx_info ; { local_tx_pd = (struct txpd *)0; head_ptr = skb->data; ret = 0; tx_info = MWIFIEX_SKB_TXCB(skb); priv = mwifiex_get_priv_by_id___0(adapter, (int )tx_info->bss_num, (int )tx_info->bss_type); if ((unsigned long )priv == (unsigned long )((struct mwifiex_private *)0)) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "data: priv not found. Drop TX packet\n"); } else { } } else { } adapter->dbg.num_tx_host_to_card_failure = adapter->dbg.num_tx_host_to_card_failure + 1U; mwifiex_write_data_complete(adapter, skb, 0, 0); return (ret); } else { } if (((unsigned long )priv->bss_role & 1UL) == 0UL) { if ((unsigned int )adapter->iface_type == 2U) { local_tx_pd = (struct txpd *)head_ptr; } else { local_tx_pd = (struct txpd *)head_ptr + 4U; } } else { } if ((unsigned int )adapter->iface_type == 2U) { adapter->data_sent = 1U; ret = (*(adapter->if_ops.host_to_card))(adapter, 2, skb, (struct mwifiex_tx_param *)0); } else { ret = (*(adapter->if_ops.host_to_card))(adapter, 0, skb, tx_param); } switch (ret) { case -63: ; if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "data: -ENOSR is returned\n"); } else { } } else { } goto ldv_60799; case -16: ; if ((((unsigned long )priv->bss_role & 1UL) == 0UL && (unsigned int )adapter->pps_uapsd_mode != 0U) && (unsigned int )adapter->tx_lock_flag != 0U) { (priv->adapter)->tx_lock_flag = 0U; if ((unsigned long )local_tx_pd != (unsigned long )((struct txpd *)0)) { local_tx_pd->flags = 0U; } else { } } else { } skb_queue_head(& adapter->tx_data_q, skb); if (((unsigned long )tx_info->flags & 32UL) != 0UL) { atomic_add((int )tx_info->aggr_num, & adapter->tx_queued); } else { atomic_inc(& adapter->tx_queued); } if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "data: -EBUSY is returned\n"); } else { } } else { } goto ldv_60799; case -1: ; if ((unsigned int )adapter->iface_type != 1U) { adapter->data_sent = 0U; } else { } if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "mwifiex_write_data_async failed: 0x%X\n", ret); } else { } } else { } adapter->dbg.num_tx_host_to_card_failure = adapter->dbg.num_tx_host_to_card_failure + 1U; mwifiex_write_data_complete(adapter, skb, 0, ret); goto ldv_60799; case -115: ; if ((unsigned int )adapter->iface_type != 1U) { adapter->data_sent = 0U; } else { } goto ldv_60799; case 0: mwifiex_write_data_complete(adapter, skb, 0, ret); goto ldv_60799; default: ; goto ldv_60799; } ldv_60799: ; return (ret); } } static int mwifiex_dequeue_tx_queue(struct mwifiex_adapter *adapter ) { struct sk_buff *skb ; struct sk_buff *skb_next ; struct mwifiex_txinfo *tx_info ; struct mwifiex_tx_param tx_param ; int tmp ; int tmp___0 ; int tmp___1 ; { skb = skb_dequeue(& adapter->tx_data_q); if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { return (-1); } else { } tx_info = MWIFIEX_SKB_TXCB(skb); if (((unsigned long )tx_info->flags & 32UL) != 0UL) { atomic_sub((int )tx_info->aggr_num, & adapter->tx_queued); } else { atomic_dec(& adapter->tx_queued); } tmp = skb_queue_empty((struct sk_buff_head const *)(& adapter->tx_data_q)); if (tmp == 0) { skb_next = skb_peek((struct sk_buff_head const *)(& adapter->tx_data_q)); } else { skb_next = (struct sk_buff *)0; } tx_param.next_pkt_len = (unsigned long )skb_next != (unsigned long )((struct sk_buff *)0) ? skb_next->len : 0U; if (tx_param.next_pkt_len == 0U) { tmp___0 = mwifiex_wmm_lists_empty(adapter); if (tmp___0 == 0) { tx_param.next_pkt_len = 1U; } else { } } else { } tmp___1 = mwifiex_host_to_card(adapter, skb, & tx_param); return (tmp___1); } } void mwifiex_process_tx_queue(struct mwifiex_adapter *adapter ) { int tmp ; int tmp___0 ; { ldv_60816: ; if ((unsigned int )adapter->data_sent != 0U || (unsigned int )adapter->tx_lock_flag != 0U) { goto ldv_60815; } else { } tmp = mwifiex_dequeue_tx_queue(adapter); if (tmp != 0) { goto ldv_60815; } else { } tmp___0 = skb_queue_empty((struct sk_buff_head const *)(& adapter->tx_data_q)); if (tmp___0 == 0) { goto ldv_60816; } else { } ldv_60815: ; return; } } int mwifiex_write_data_complete(struct mwifiex_adapter *adapter , struct sk_buff *skb , int aggr , int status ) { struct mwifiex_private *priv ; struct mwifiex_txinfo *tx_info ; struct netdev_queue *txq ; int index ; bool tmp ; int tmp___0 ; { if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { return (0); } else { } tx_info = MWIFIEX_SKB_TXCB(skb); priv = mwifiex_get_priv_by_id___0(adapter, (int )tx_info->bss_num, (int )tx_info->bss_type); if ((unsigned long )priv == (unsigned long )((struct mwifiex_private *)0)) { goto done; } else { } if ((unsigned int )adapter->iface_type == 2U) { adapter->data_sent = 0U; } else { } mwifiex_set_trans_start(priv->netdev); if (status == 0) { priv->stats.tx_packets = priv->stats.tx_packets + 1UL; priv->stats.tx_bytes = priv->stats.tx_bytes + (unsigned long )tx_info->pkt_len; if ((unsigned int )priv->tx_timeout_cnt != 0U) { priv->tx_timeout_cnt = 0U; } else { } } else { priv->stats.tx_errors = priv->stats.tx_errors + 1UL; } if (((unsigned long )tx_info->flags & 2UL) != 0UL) { atomic_sub_return(1, & adapter->pending_bridged_pkts); } else { } if (((unsigned long )tx_info->flags & 32UL) != 0UL) { goto done; } else { } if (aggr != 0) { goto done; } else { } atomic_dec(& adapter->tx_pending); index = (int )mwifiex_1d_to_wmm_queue___0[skb->priority]; tmp___0 = atomic_sub_return(1, (atomic_t *)(& priv->wmm_tx_pending) + (unsigned long )index); if (tmp___0 <= 79) { txq = netdev_get_tx_queue((struct net_device const *)priv->netdev, (unsigned int )index); tmp = netif_tx_queue_stopped((struct netdev_queue const *)txq); if ((int )tmp) { netif_tx_wake_queue(txq); if ((adapter->debug_mask & 8U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "wake queue: %d\n", index); } else { } } else { } } else { } } else { } done: dev_kfree_skb_any(skb); return (0); } } static char const __kstrtab_mwifiex_write_data_complete[28U] = { 'm', 'w', 'i', 'f', 'i', 'e', 'x', '_', 'w', 'r', 'i', 't', 'e', '_', 'd', 'a', 't', 'a', '_', 'c', 'o', 'm', 'p', 'l', 'e', 't', 'e', '\000'}; struct kernel_symbol const __ksymtab_mwifiex_write_data_complete ; struct kernel_symbol const __ksymtab_mwifiex_write_data_complete = {(unsigned long )(& mwifiex_write_data_complete), (char const *)(& __kstrtab_mwifiex_write_data_complete)}; void mwifiex_parse_tx_status_event(struct mwifiex_private *priv , void *event_body ) { struct tx_status_event *tx_status ; struct sk_buff *ack_skb ; unsigned long flags ; struct mwifiex_txinfo *tx_info ; raw_spinlock_t *tmp ; void *tmp___0 ; { tx_status = (struct tx_status_event *)(& (priv->adapter)->event_body); if ((unsigned int )tx_status->tx_token_id == 0U) { return; } else { } tmp = spinlock_check(& priv->ack_status_lock); flags = _raw_spin_lock_irqsave(tmp); tmp___0 = idr_find(& priv->ack_status_frames, (int )tx_status->tx_token_id); ack_skb = (struct sk_buff *)tmp___0; if ((unsigned long )ack_skb != (unsigned long )((struct sk_buff *)0)) { idr_remove(& priv->ack_status_frames, (int )tx_status->tx_token_id); } else { } spin_unlock_irqrestore(& priv->ack_status_lock, flags); if ((unsigned long )ack_skb != (unsigned long )((struct sk_buff *)0)) { tx_info = MWIFIEX_SKB_TXCB(ack_skb); if (((unsigned long )tx_info->flags & 8UL) != 0UL) { skb_complete_wifi_ack(ack_skb, (unsigned int )tx_status->status == 0U); } else { cfg80211_mgmt_tx_status(& priv->wdev, tx_info->cookie, (u8 const *)ack_skb->data, (size_t )ack_skb->len, (unsigned int )tx_status->status == 0U, 32U); dev_kfree_skb_any(ack_skb); } } else { } return; } } bool ldv_queue_work_on_97(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_98(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_99(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_100(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_101(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; __inline static __u16 __fswab16(__u16 val ) { { return ((__u16 )((int )((short )((int )val << 8)) | (int )((short )((int )val >> 8)))); } } extern void __list_del_entry(struct list_head * ) ; __inline static void list_move(struct list_head *list , struct list_head *head ) { { __list_del_entry(list); list_add(list, head); return; } } __inline static s64 ktime_divns(ktime_t const kt , s64 div ) { int __ret_warn_on ; long tmp ; { __ret_warn_on = div < 0LL; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("include/linux/ktime.h", 194); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); return ((long long )kt.tv64 / div); } } __inline static s64 ktime_to_ms(ktime_t const kt ) { s64 tmp ; { tmp = ktime_divns(kt, 1000000LL); return (tmp); } } extern void do_gettimeofday(struct timeval * ) ; bool ldv_queue_work_on_111(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_113(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_112(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_115(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_114(struct workqueue_struct *ldv_func_arg1 ) ; extern int idr_for_each(struct idr * , int (*)(int , void * , void * ) , void * ) ; extern void idr_destroy(struct idr * ) ; __inline static ktime_t net_timedelta(ktime_t t ) { ktime_t __constr_expr_0 ; ktime_t tmp ; { tmp = ktime_get_real(); __constr_expr_0.tv64 = tmp.tv64 - t.tv64; return (__constr_expr_0); } } __inline static bool is_broadcast_ether_addr(u8 const *addr ) { { return ((unsigned int )(((int )((unsigned short )*((u16 const *)addr)) & (int )((unsigned short )*((u16 const *)addr + 2U))) & (int )((unsigned short )*((u16 const *)addr + 4U))) == 65535U); } } void mwifiex_wmm_del_peer_ra_list(struct mwifiex_private *priv , u8 const *ra_addr ) ; void mwifiex_set_ba_params(struct mwifiex_private *priv ) ; __inline static u8 mwifiex_queuing_ra_based(struct mwifiex_private *priv ) { { if (priv->bss_mode == 2U && ((unsigned long )priv->bss_role & 1UL) == 0UL) { return (0U); } else { } return (1U); } } __inline static bool mwifiex_is_skb_mgmt_frame(struct sk_buff *skb ) { { return (*((__le32 *)skb->data) == 229U); } } int mwifiex_get_tdls_link_status(struct mwifiex_private *priv , u8 const *mac ) ; __inline static int mwifiex_get_tid(struct mwifiex_ra_list_tbl *ptr ) { struct sk_buff *skb ; int tmp ; { tmp = skb_queue_empty((struct sk_buff_head const *)(& ptr->skb_head)); if (tmp != 0) { return (0); } else { } skb = skb_peek((struct sk_buff_head const *)(& ptr->skb_head)); return ((int )skb->priority); } } __inline static int mwifiex_wmm_list_len(struct list_head *head ) { struct list_head *pos ; int count ; { count = 0; pos = head->next; goto ldv_60686; ldv_60685: count = count + 1; pos = pos->next; ldv_60686: ; if ((unsigned long )pos != (unsigned long )head) { goto ldv_60685; } else { } return (count); } } void mwifiex_ralist_add(struct mwifiex_private *priv , u8 const *ra ) ; void mwifiex_rotate_priolists(struct mwifiex_private *priv , struct mwifiex_ra_list_tbl *ra , int tid ) ; int mwifiex_is_ralist_valid(struct mwifiex_private *priv , struct mwifiex_ra_list_tbl *ra_list , int ptr_index ) ; u8 mwifiex_wmm_compute_drv_pkt_delay(struct mwifiex_private *priv , struct sk_buff const *skb ) ; u32 mwifiex_wmm_process_association_req(struct mwifiex_private *priv , u8 **assoc_buf , struct ieee_types_wmm_parameter *wmm_ie , struct ieee80211_ht_cap *ht_cap ) ; void mwifiex_wmm_setup_queue_priorities(struct mwifiex_private *priv , struct ieee_types_wmm_parameter *wmm_ie ) ; void mwifiex_wmm_setup_ac_downgrade(struct mwifiex_private *priv ) ; int mwifiex_ret_wmm_get_status(struct mwifiex_private *priv , struct host_cmd_ds_command const *resp ) ; struct mwifiex_ra_list_tbl *mwifiex_wmm_get_queue_raptr(struct mwifiex_private *priv , u8 tid , u8 const *ra_addr ) ; u8 mwifiex_wmm_downgrade_tid(struct mwifiex_private *priv , u32 tid ) ; struct mwifiex_ra_list_tbl *mwifiex_wmm_get_ralist_node(struct mwifiex_private *priv , u8 tid , u8 const *ra_addr ) ; int mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv , struct mwifiex_ra_list_tbl *pra_list , int ptrindex , unsigned long ra_list_flags ) ; __inline static void mwifiex_reset_11n_rx_seq_num(struct mwifiex_private *priv ) { { memset((void *)(& priv->rx_seq), 255, 16UL); return; } } void mwifiex_11n_cleanup_reorder_tbl(struct mwifiex_private *priv ) ; void mwifiex_11n_delete_all_tx_ba_stream_tbl(struct mwifiex_private *priv ) ; void mwifiex_create_ba_tbl(struct mwifiex_private *priv , u8 *ra , int tid , enum mwifiex_ba_status ba_status ) ; int mwifiex_send_addba(struct mwifiex_private *priv , int tid , u8 *peer_mac ) ; int mwifiex_send_delba(struct mwifiex_private *priv , int tid , u8 *peer_mac , int initiator ) ; __inline static u8 mwifiex_is_station_ampdu_allowed(struct mwifiex_private *priv , struct mwifiex_ra_list_tbl *ptr , int tid ) { struct mwifiex_sta_node *node ; struct mwifiex_sta_node *tmp ; long tmp___0 ; { tmp = mwifiex_get_sta_entry(priv, (u8 const *)(& ptr->ra)); node = tmp; tmp___0 = ldv__builtin_expect((unsigned long )node == (unsigned long )((struct mwifiex_sta_node *)0), 0L); if (tmp___0 != 0L) { return (0U); } else { } return ((unsigned int )node->ampdu_sta[tid] != 255U); } } __inline static u8 mwifiex_is_ampdu_allowed(struct mwifiex_private *priv , struct mwifiex_ra_list_tbl *ptr , int tid ) { bool tmp ; u8 tmp___0 ; u8 tmp___1 ; { tmp = is_broadcast_ether_addr((u8 const *)(& ptr->ra)); if ((int )tmp) { return (0U); } else { } if ((int )priv->bss_role & 1) { tmp___0 = mwifiex_is_station_ampdu_allowed(priv, ptr, tid); return (tmp___0); } else { if ((int )ptr->tdls_link) { tmp___1 = mwifiex_is_station_ampdu_allowed(priv, ptr, tid); return (tmp___1); } else { } return ((unsigned int )priv->aggr_prio_tbl[tid].ampdu_ap != 255U); } } } __inline static u8 mwifiex_is_amsdu_allowed(struct mwifiex_private *priv , int tid ) { { return ((u8 )((unsigned int )priv->aggr_prio_tbl[tid].amsdu != 255U && ((unsigned int )priv->is_data_rate_auto != 0U || ((int )priv->bitmap_rates[2] & 3) == 0))); } } __inline static u8 mwifiex_space_avail_for_new_ba_stream(struct mwifiex_adapter *adapter ) { struct mwifiex_private *priv ; u8 i ; u32 ba_stream_num ; u32 ba_stream_max ; int tmp ; { ba_stream_num = 0U; ba_stream_max = 2U; i = 0U; goto ldv_60898; ldv_60897: priv = adapter->priv[(int )i]; if ((unsigned long )priv != (unsigned long )((struct mwifiex_private *)0)) { tmp = mwifiex_wmm_list_len(& priv->tx_ba_stream_tbl_ptr); ba_stream_num = (u32 )tmp + ba_stream_num; } else { } i = (u8 )((int )i + 1); ldv_60898: ; if ((int )adapter->priv_num > (int )i) { goto ldv_60897; } else { } if ((unsigned int )adapter->fw_api_ver == 15U) { ba_stream_max = (adapter->hw_dot_11n_dev_cap >> 18) & 15U; if (ba_stream_max == 0U) { ba_stream_max = 2U; } else { } } else { } return (ba_stream_num < ba_stream_max); } } __inline static u8 mwifiex_find_stream_to_delete(struct mwifiex_private *priv , int ptr_tid , int *ptid , u8 *ra ) { int tid ; u8 ret ; struct mwifiex_tx_ba_stream_tbl *tx_tbl ; unsigned long flags ; raw_spinlock_t *tmp ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; { ret = 0U; tid = (int )priv->aggr_prio_tbl[ptr_tid].ampdu_user; tmp = spinlock_check(& priv->tx_ba_stream_tbl_lock); flags = _raw_spin_lock_irqsave(tmp); __mptr = (struct list_head const *)priv->tx_ba_stream_tbl_ptr.next; tx_tbl = (struct mwifiex_tx_ba_stream_tbl *)__mptr; goto ldv_60918; ldv_60917: ; if ((int )priv->aggr_prio_tbl[tx_tbl->tid].ampdu_user < tid) { tid = (int )priv->aggr_prio_tbl[tx_tbl->tid].ampdu_user; *ptid = tx_tbl->tid; memcpy((void *)ra, (void const *)(& tx_tbl->ra), 6UL); ret = 1U; } else { } __mptr___0 = (struct list_head const *)tx_tbl->list.next; tx_tbl = (struct mwifiex_tx_ba_stream_tbl *)__mptr___0; ldv_60918: ; if ((unsigned long )(& tx_tbl->list) != (unsigned long )(& priv->tx_ba_stream_tbl_ptr)) { goto ldv_60917; } else { } spin_unlock_irqrestore(& priv->tx_ba_stream_tbl_lock, flags); return (ret); } } __inline static int mwifiex_is_sta_11n_enabled(struct mwifiex_private *priv , struct mwifiex_sta_node *node ) { { if (((unsigned long )node == (unsigned long )((struct mwifiex_sta_node *)0) || (unsigned int )priv->bss_role != 1U) || (unsigned int )priv->ap_11n_enabled == 0U) { return (0); } else { } return ((int )node->is_11n_enabled); } } __inline static u8 mwifiex_tdls_peer_11n_enabled(struct mwifiex_private *priv , u8 const *ra ) { struct mwifiex_sta_node *node ; struct mwifiex_sta_node *tmp ; { tmp = mwifiex_get_sta_entry(priv, ra); node = tmp; if ((unsigned long )node != (unsigned long )((struct mwifiex_sta_node *)0)) { return (node->is_11n_enabled); } else { } return (0U); } } static bool disable_tx_amsdu ; static u8 const wmm_info_ie[9U] = { 221U, 7U, 0U, 80U, 242U, 2U, 0U, 1U, 0U}; static u8 const wmm_aci_to_qidx_map[4U] = { 1U, 0U, 2U, 3U}; static u8 tos_to_tid[8U] = { 1U, 2U, 0U, 3U, 4U, 5U, 6U, 7U}; static u8 ac_to_tid[4U][2U] = { { 1U, 2U}, { 0U, 3U}, { 4U, 5U}, { 6U, 7U}}; static void mwifiex_wmm_ac_debug_print(struct ieee_types_wmm_ac_parameters const *ac_param ) { char const *ac_str[4U] ; struct _ddebug descriptor ; long tmp ; { ac_str[0] = "BK"; ac_str[1] = "BE"; ac_str[2] = "VI"; ac_str[3] = "VO"; descriptor.modname = "mwifiex"; descriptor.function = "mwifiex_wmm_ac_debug_print"; descriptor.filename = "/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/11944/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/mwifiex/wmm.c"; descriptor.format = "info: WMM AC_%s: ACI=%d, ACM=%d, Aifsn=%d, EcwMin=%d, EcwMax=%d, TxopLimit=%d\n"; descriptor.lineno = 86U; descriptor.flags = 0U; tmp = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp != 0L) { __dynamic_pr_debug(& descriptor, "mwifiex: info: WMM AC_%s: ACI=%d, ACM=%d, Aifsn=%d, EcwMin=%d, EcwMax=%d, TxopLimit=%d\n", ac_str[(int )wmm_aci_to_qidx_map[((int )ac_param->aci_aifsn_bitmap & 96) >> 5]], ((int )ac_param->aci_aifsn_bitmap & 96) >> 5, ((int )ac_param->aci_aifsn_bitmap & 16) >> 4, (int )ac_param->aci_aifsn_bitmap & 15, (int )ac_param->ecw_bitmap & 15, (int )((int const )ac_param->ecw_bitmap >> 4), (int )ac_param->tx_op_limit); } else { } return; } } static struct mwifiex_ra_list_tbl *mwifiex_wmm_allocate_ralist_node(struct mwifiex_adapter *adapter , u8 const *ra ) { struct mwifiex_ra_list_tbl *ra_list ; void *tmp ; { tmp = kzalloc(144UL, 32U); ra_list = (struct mwifiex_ra_list_tbl *)tmp; if ((unsigned long )ra_list == (unsigned long )((struct mwifiex_ra_list_tbl *)0)) { return ((struct mwifiex_ra_list_tbl *)0); } else { } INIT_LIST_HEAD(& ra_list->list); skb_queue_head_init(& ra_list->skb_head); memcpy((void *)(& ra_list->ra), (void const *)ra, 6UL); ra_list->total_pkt_count = 0U; if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: allocated ra_list %p\n", ra_list); } else { } } else { } return (ra_list); } } static u8 mwifiex_get_random_ba_threshold(void) { u32 sec ; u32 usec ; struct timeval ba_tstamp ; u8 ba_threshold ; { do_gettimeofday(& ba_tstamp); sec = ((u32 )ba_tstamp.tv_sec & 65535U) + (u32 )(ba_tstamp.tv_sec >> 16); usec = ((u32 )ba_tstamp.tv_usec & 65535U) + (u32 )(ba_tstamp.tv_usec >> 16); ba_threshold = ((unsigned int )((u8 )usec) & 15U) + 16U; return (ba_threshold); } } void mwifiex_ralist_add(struct mwifiex_private *priv , u8 const *ra ) { int i ; struct mwifiex_ra_list_tbl *ra_list ; struct mwifiex_adapter *adapter ; struct mwifiex_sta_node *node ; unsigned long flags ; u8 tmp ; int tmp___0 ; raw_spinlock_t *tmp___1 ; int tmp___2 ; u8 tmp___3 ; { adapter = priv->adapter; i = 0; goto ldv_60984; ldv_60983: ra_list = mwifiex_wmm_allocate_ralist_node(adapter, ra); if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: created ra_list %p\n", ra_list); } else { } } else { } if ((unsigned long )ra_list == (unsigned long )((struct mwifiex_ra_list_tbl *)0)) { goto ldv_60979; } else { } ra_list->is_11n_enabled = 0U; ra_list->tdls_link = 0; ra_list->ba_status = 0; ra_list->amsdu_in_ampdu = 0U; tmp___3 = mwifiex_queuing_ra_based(priv); if ((unsigned int )tmp___3 == 0U) { tmp___0 = mwifiex_get_tdls_link_status(priv, ra); if (tmp___0 == 2) { ra_list->tdls_link = 1; tmp = mwifiex_tdls_peer_11n_enabled(priv, ra); ra_list->is_11n_enabled = (u32 )tmp; } else { ra_list->is_11n_enabled = (u32 )((((int )(priv->adapter)->config_bands & 8) != 0 || ((int )(priv->adapter)->config_bands & 16) != 0) && (unsigned long )priv->curr_bss_params.bss_descriptor.bcn_ht_cap != (unsigned long )((struct ieee80211_ht_cap *)0)); } } else { tmp___1 = spinlock_check(& priv->sta_list_spinlock); flags = _raw_spin_lock_irqsave(tmp___1); node = mwifiex_get_sta_entry(priv, ra); tmp___2 = mwifiex_is_sta_11n_enabled(priv, node); ra_list->is_11n_enabled = (u32 )tmp___2; if (ra_list->is_11n_enabled != 0U) { ra_list->max_amsdu = node->max_amsdu; } else { } spin_unlock_irqrestore(& priv->sta_list_spinlock, flags); } if ((adapter->debug_mask & 8U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "data: ralist %p: is_11n_enabled=%d\n", ra_list, ra_list->is_11n_enabled); } else { } } else { } if (ra_list->is_11n_enabled != 0U) { ra_list->ba_pkt_count = 0U; ra_list->ba_packet_thr = mwifiex_get_random_ba_threshold(); } else { } list_add_tail(& ra_list->list, & priv->wmm.tid_tbl_ptr[i].ra_list); i = i + 1; ldv_60984: ; if (i <= 7) { goto ldv_60983; } else { } ldv_60979: ; return; } } static void mwifiex_wmm_default_queue_priorities(struct mwifiex_private *priv ) { { priv->wmm.queue_priority[0] = 3U; priv->wmm.queue_priority[1] = 2U; priv->wmm.queue_priority[2] = 1U; priv->wmm.queue_priority[3] = 0U; return; } } static void mwifiex_wmm_queue_priorities_tid(struct mwifiex_private *priv ) { struct mwifiex_wmm_desc *wmm ; u8 *queue_priority ; int i ; { wmm = & priv->wmm; queue_priority = (u8 *)(& wmm->queue_priority); i = 0; goto ldv_60995; ldv_60994: tos_to_tid[i * -2 + 7] = ac_to_tid[(int )*(queue_priority + (unsigned long )i)][1]; tos_to_tid[(3 - i) * 2] = ac_to_tid[(int )*(queue_priority + (unsigned long )i)][0]; i = i + 1; ldv_60995: ; if (i <= 3) { goto ldv_60994; } else { } i = 0; goto ldv_60998; ldv_60997: priv->tos_to_tid_inv[(int )tos_to_tid[i]] = (unsigned char )i; i = i + 1; ldv_60998: ; if (i <= 7) { goto ldv_60997; } else { } atomic_set(& wmm->highest_queued_prio, 7); return; } } void mwifiex_wmm_setup_queue_priorities(struct mwifiex_private *priv , struct ieee_types_wmm_parameter *wmm_ie ) { u16 cw_min ; u16 avg_back_off ; u16 tmp[4U] ; u32 i ; u32 j ; u32 num_ac ; u8 ac_idx ; u8 ecw ; u8 aci_aifsn ; u16 __tmp ; u8 __tmp___0 ; u8 __tmp___1 ; { if ((unsigned long )wmm_ie == (unsigned long )((struct ieee_types_wmm_parameter *)0) || (unsigned int )priv->wmm_enabled == 0U) { mwifiex_wmm_default_queue_priorities(priv); return; } else { } if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: WMM Parameter IE: version=%d,\tqos_info Parameter Set Count=%d, Reserved=%#x\n", (int )wmm_ie->vend_hdr.version, (int )wmm_ie->qos_info_bitmap & 15, (int )wmm_ie->reserved); } else { } } else { } num_ac = 0U; goto ldv_61016; ldv_61015: ecw = wmm_ie->ac_params[num_ac].ecw_bitmap; aci_aifsn = wmm_ie->ac_params[num_ac].aci_aifsn_bitmap; cw_min = (unsigned int )((u16 )(1 << ((int )ecw & 15))) + 65535U; avg_back_off = (unsigned int )((u16 )((int )cw_min >> 1)) + ((unsigned int )((u16 )aci_aifsn) & 15U); ac_idx = wmm_aci_to_qidx_map[((int )aci_aifsn & 96) >> 5]; priv->wmm.queue_priority[(int )ac_idx] = ac_idx; tmp[(int )ac_idx] = avg_back_off; if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: WMM: CWmax=%d CWmin=%d Avg Back-off=%d\n", (1 << ((int )ecw >> 4)) + -1, (int )cw_min, (int )avg_back_off); } else { } } else { } mwifiex_wmm_ac_debug_print((struct ieee_types_wmm_ac_parameters const *)(& wmm_ie->ac_params) + (unsigned long )num_ac); num_ac = num_ac + 1U; ldv_61016: ; if (num_ac <= 3U) { goto ldv_61015; } else { } i = 0U; goto ldv_61025; ldv_61024: j = 1U; goto ldv_61022; ldv_61021: ; if ((int )tmp[j - 1U] > (int )tmp[j]) { __tmp = tmp[j - 1U]; tmp[j - 1U] = tmp[j]; tmp[j] = __tmp; __tmp___0 = priv->wmm.queue_priority[j - 1U]; priv->wmm.queue_priority[j - 1U] = priv->wmm.queue_priority[j]; priv->wmm.queue_priority[j] = __tmp___0; } else if ((int )tmp[j - 1U] == (int )tmp[j]) { if ((int )priv->wmm.queue_priority[j - 1U] < (int )priv->wmm.queue_priority[j]) { __tmp___1 = priv->wmm.queue_priority[j - 1U]; priv->wmm.queue_priority[j - 1U] = priv->wmm.queue_priority[j]; priv->wmm.queue_priority[j] = __tmp___1; } else { } } else { } j = j + 1U; ldv_61022: ; if (num_ac - i > j) { goto ldv_61021; } else { } i = i + 1U; ldv_61025: ; if (i < num_ac) { goto ldv_61024; } else { } mwifiex_wmm_queue_priorities_tid(priv); return; } } static enum mwifiex_wmm_ac_e mwifiex_wmm_eval_downgrade_ac(struct mwifiex_private *priv , enum mwifiex_wmm_ac_e eval_ac ) { int down_ac ; enum mwifiex_wmm_ac_e ret_ac ; struct mwifiex_wmm_ac_status *ac_status ; { ac_status = (struct mwifiex_wmm_ac_status *)(& priv->wmm.ac_status) + (unsigned long )eval_ac; if ((unsigned int )ac_status->disabled == 0U) { return (eval_ac); } else { } ret_ac = 0; down_ac = 0; goto ldv_61035; ldv_61034: ac_status = (struct mwifiex_wmm_ac_status *)(& priv->wmm.ac_status) + (unsigned long )down_ac; if ((unsigned int )ac_status->disabled == 0U && (unsigned int )ac_status->flow_required == 0U) { ret_ac = (enum mwifiex_wmm_ac_e )down_ac; } else { } down_ac = down_ac + 1; ldv_61035: ; if ((int )eval_ac > down_ac) { goto ldv_61034; } else { } return (ret_ac); } } void mwifiex_wmm_setup_ac_downgrade(struct mwifiex_private *priv ) { int ac_val ; { if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: WMM: AC Priorities:\tBK(0), BE(1), VI(2), VO(3)\n"); } else { } } else { } if ((unsigned int )priv->wmm_enabled == 0U) { ac_val = 0; goto ldv_61042; ldv_61041: priv->wmm.ac_down_graded_vals[ac_val] = (enum mwifiex_wmm_ac_e )ac_val; ac_val = ac_val + 1; ldv_61042: ; if (ac_val <= 3) { goto ldv_61041; } else { } } else { ac_val = 0; goto ldv_61045; ldv_61044: priv->wmm.ac_down_graded_vals[ac_val] = mwifiex_wmm_eval_downgrade_ac(priv, (int )((enum mwifiex_wmm_ac_e )ac_val)); if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: WMM: AC PRIO %d maps to %d\n", ac_val, (int )priv->wmm.ac_down_graded_vals[ac_val]); } else { } } else { } ac_val = ac_val + 1; ldv_61045: ; if (ac_val <= 3) { goto ldv_61044; } else { } } return; } } static enum mwifiex_wmm_ac_e mwifiex_wmm_convert_tos_to_ac(struct mwifiex_adapter *adapter , u32 tos ) { enum mwifiex_wmm_ac_e tos_to_ac[8U] ; { tos_to_ac[0] = 1; tos_to_ac[1] = 0; tos_to_ac[2] = 0; tos_to_ac[3] = 1; tos_to_ac[4] = 2; tos_to_ac[5] = 2; tos_to_ac[6] = 3; tos_to_ac[7] = 3; if (tos > 7U) { return (1); } else { } return (tos_to_ac[tos]); } } u8 mwifiex_wmm_downgrade_tid(struct mwifiex_private *priv , u32 tid ) { enum mwifiex_wmm_ac_e ac ; enum mwifiex_wmm_ac_e ac_down ; u8 new_tid ; { ac = mwifiex_wmm_convert_tos_to_ac(priv->adapter, tid); ac_down = priv->wmm.ac_down_graded_vals[(int )ac]; new_tid = ac_to_tid[(int )ac_down][tid & 1U]; return (new_tid); } } void mwifiex_wmm_init(struct mwifiex_adapter *adapter ) { int i ; int j ; struct mwifiex_private *priv ; u8 tmp ; u8 tmp___0 ; u8 tmp___1 ; u8 tmp___2 ; { j = 0; goto ldv_61072; ldv_61071: priv = adapter->priv[j]; if ((unsigned long )priv == (unsigned long )((struct mwifiex_private *)0)) { goto ldv_61067; } else { } i = 0; goto ldv_61069; ldv_61068: ; if (! disable_tx_amsdu && (unsigned int )adapter->tx_buf_size > 2048U) { priv->aggr_prio_tbl[i].amsdu = priv->tos_to_tid_inv[i]; } else { priv->aggr_prio_tbl[i].amsdu = 255U; } priv->aggr_prio_tbl[i].ampdu_ap = priv->tos_to_tid_inv[i]; priv->aggr_prio_tbl[i].ampdu_user = priv->tos_to_tid_inv[i]; i = i + 1; ldv_61069: ; if (i <= 7) { goto ldv_61068; } else { } tmp___0 = 255U; priv->aggr_prio_tbl[6].ampdu_user = tmp___0; tmp = tmp___0; priv->aggr_prio_tbl[6].ampdu_ap = tmp; priv->aggr_prio_tbl[6].amsdu = tmp; tmp___2 = 255U; priv->aggr_prio_tbl[7].ampdu_user = tmp___2; tmp___1 = tmp___2; priv->aggr_prio_tbl[7].ampdu_ap = tmp___1; priv->aggr_prio_tbl[7].amsdu = tmp___1; mwifiex_set_ba_params(priv); mwifiex_reset_11n_rx_seq_num(priv); atomic_set(& priv->wmm.tx_pkts_queued, 0); atomic_set(& priv->wmm.highest_queued_prio, 7); ldv_61067: j = j + 1; ldv_61072: ; if ((int )adapter->priv_num > j) { goto ldv_61071; } else { } return; } } int mwifiex_wmm_lists_empty(struct mwifiex_adapter *adapter ) { int i ; struct mwifiex_private *priv ; int tmp ; { i = 0; goto ldv_61080; ldv_61079: priv = adapter->priv[i]; if ((unsigned long )priv != (unsigned long )((struct mwifiex_private *)0)) { tmp = atomic_read((atomic_t const *)(& priv->wmm.tx_pkts_queued)); if (tmp != 0) { return (0); } else { } } else { } i = i + 1; ldv_61080: ; if ((int )adapter->priv_num > i) { goto ldv_61079; } else { } return (1); } } static void mwifiex_wmm_del_pkts_in_ralist_node(struct mwifiex_private *priv , struct mwifiex_ra_list_tbl *ra_list ) { struct mwifiex_adapter *adapter ; struct sk_buff *skb ; struct sk_buff *tmp ; { adapter = priv->adapter; skb = ra_list->skb_head.next; tmp = skb->__annonCompField68.__annonCompField67.next; goto ldv_61090; ldv_61089: mwifiex_write_data_complete(adapter, skb, 0, -1); skb = tmp; tmp = skb->__annonCompField68.__annonCompField67.next; ldv_61090: ; if ((unsigned long )((struct sk_buff *)(& ra_list->skb_head)) != (unsigned long )skb) { goto ldv_61089; } else { } return; } } static void mwifiex_wmm_del_pkts_in_ralist(struct mwifiex_private *priv , struct list_head *ra_list_head ) { struct mwifiex_ra_list_tbl *ra_list ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; { __mptr = (struct list_head const *)ra_list_head->next; ra_list = (struct mwifiex_ra_list_tbl *)__mptr; goto ldv_61102; ldv_61101: mwifiex_wmm_del_pkts_in_ralist_node(priv, ra_list); __mptr___0 = (struct list_head const *)ra_list->list.next; ra_list = (struct mwifiex_ra_list_tbl *)__mptr___0; ldv_61102: ; if ((unsigned long )(& ra_list->list) != (unsigned long )ra_list_head) { goto ldv_61101; } else { } return; } } static void mwifiex_wmm_cleanup_queues(struct mwifiex_private *priv ) { int i ; { i = 0; goto ldv_61109; ldv_61108: mwifiex_wmm_del_pkts_in_ralist(priv, & priv->wmm.tid_tbl_ptr[i].ra_list); i = i + 1; ldv_61109: ; if (i <= 7) { goto ldv_61108; } else { } atomic_set(& priv->wmm.tx_pkts_queued, 0); atomic_set(& priv->wmm.highest_queued_prio, 7); return; } } static void mwifiex_wmm_delete_all_ralist(struct mwifiex_private *priv ) { struct mwifiex_ra_list_tbl *ra_list ; struct mwifiex_ra_list_tbl *tmp_node ; int i ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; { i = 0; goto ldv_61127; ldv_61126: ; if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: ra_list: freeing buf for tid %d\n", i); } else { } } else { } __mptr = (struct list_head const *)priv->wmm.tid_tbl_ptr[i].ra_list.next; ra_list = (struct mwifiex_ra_list_tbl *)__mptr; __mptr___0 = (struct list_head const *)ra_list->list.next; tmp_node = (struct mwifiex_ra_list_tbl *)__mptr___0; goto ldv_61124; ldv_61123: list_del(& ra_list->list); kfree((void const *)ra_list); ra_list = tmp_node; __mptr___1 = (struct list_head const *)tmp_node->list.next; tmp_node = (struct mwifiex_ra_list_tbl *)__mptr___1; ldv_61124: ; if ((unsigned long )(& ra_list->list) != (unsigned long )(& priv->wmm.tid_tbl_ptr[i].ra_list)) { goto ldv_61123; } else { } INIT_LIST_HEAD(& priv->wmm.tid_tbl_ptr[i].ra_list); i = i + 1; ldv_61127: ; if (i <= 7) { goto ldv_61126; } else { } return; } } static int mwifiex_free_ack_frame(int id , void *p , void *data ) { { printk("\fmwifiex: Have pending ack frames!\n"); kfree_skb((struct sk_buff *)p); return (0); } } void mwifiex_clean_txrx(struct mwifiex_private *priv ) { unsigned long flags ; struct sk_buff *skb ; struct sk_buff *tmp ; raw_spinlock_t *tmp___0 ; { mwifiex_11n_cleanup_reorder_tbl(priv); tmp___0 = spinlock_check(& priv->wmm.ra_list_spinlock); flags = _raw_spin_lock_irqsave(tmp___0); mwifiex_wmm_cleanup_queues(priv); mwifiex_11n_delete_all_tx_ba_stream_tbl(priv); if ((unsigned long )(priv->adapter)->if_ops.cleanup_mpa_buf != (unsigned long )((void (*)(struct mwifiex_adapter * ))0)) { (*((priv->adapter)->if_ops.cleanup_mpa_buf))(priv->adapter); } else { } mwifiex_wmm_delete_all_ralist(priv); memcpy((void *)(& tos_to_tid), (void const *)(& ac_to_tid), 8UL); if ((unsigned long )(priv->adapter)->if_ops.clean_pcie_ring != (unsigned long )((int (*)(struct mwifiex_adapter * ))0) && ! (priv->adapter)->surprise_removed) { (*((priv->adapter)->if_ops.clean_pcie_ring))(priv->adapter); } else { } spin_unlock_irqrestore(& priv->wmm.ra_list_spinlock, flags); skb = priv->tdls_txq.next; tmp = skb->__annonCompField68.__annonCompField67.next; goto ldv_61144; ldv_61143: mwifiex_write_data_complete(priv->adapter, skb, 0, -1); skb = tmp; tmp = skb->__annonCompField68.__annonCompField67.next; ldv_61144: ; if ((unsigned long )((struct sk_buff *)(& priv->tdls_txq)) != (unsigned long )skb) { goto ldv_61143; } else { } idr_for_each(& priv->ack_status_frames, & mwifiex_free_ack_frame, (void *)0); idr_destroy(& priv->ack_status_frames); return; } } struct mwifiex_ra_list_tbl *mwifiex_wmm_get_ralist_node(struct mwifiex_private *priv , u8 tid , u8 const *ra_addr ) { struct mwifiex_ra_list_tbl *ra_list ; struct list_head const *__mptr ; int tmp ; struct list_head const *__mptr___0 ; { __mptr = (struct list_head const *)priv->wmm.tid_tbl_ptr[(int )tid].ra_list.next; ra_list = (struct mwifiex_ra_list_tbl *)__mptr; goto ldv_61157; ldv_61156: tmp = memcmp((void const *)(& ra_list->ra), (void const *)ra_addr, 6UL); if (tmp == 0) { return (ra_list); } else { } __mptr___0 = (struct list_head const *)ra_list->list.next; ra_list = (struct mwifiex_ra_list_tbl *)__mptr___0; ldv_61157: ; if ((unsigned long )(& ra_list->list) != (unsigned long )(& priv->wmm.tid_tbl_ptr[(int )tid].ra_list)) { goto ldv_61156; } else { } return ((struct mwifiex_ra_list_tbl *)0); } } struct mwifiex_ra_list_tbl *mwifiex_wmm_get_queue_raptr(struct mwifiex_private *priv , u8 tid , u8 const *ra_addr ) { struct mwifiex_ra_list_tbl *ra_list ; struct mwifiex_ra_list_tbl *tmp ; { ra_list = mwifiex_wmm_get_ralist_node(priv, (int )tid, ra_addr); if ((unsigned long )ra_list != (unsigned long )((struct mwifiex_ra_list_tbl *)0)) { return (ra_list); } else { } mwifiex_ralist_add(priv, ra_addr); tmp = mwifiex_wmm_get_ralist_node(priv, (int )tid, ra_addr); return (tmp); } } void mwifiex_wmm_del_peer_ra_list(struct mwifiex_private *priv , u8 const *ra_addr ) { struct mwifiex_ra_list_tbl *ra_list ; unsigned long flags ; int i ; raw_spinlock_t *tmp ; { tmp = spinlock_check(& priv->wmm.ra_list_spinlock); flags = _raw_spin_lock_irqsave(tmp); i = 0; goto ldv_61177; ldv_61176: ra_list = mwifiex_wmm_get_ralist_node(priv, (int )((u8 )i), ra_addr); if ((unsigned long )ra_list == (unsigned long )((struct mwifiex_ra_list_tbl *)0)) { goto ldv_61175; } else { } mwifiex_wmm_del_pkts_in_ralist_node(priv, ra_list); atomic_sub((int )ra_list->total_pkt_count, & priv->wmm.tx_pkts_queued); list_del(& ra_list->list); kfree((void const *)ra_list); ldv_61175: i = i + 1; ldv_61177: ; if (i <= 7) { goto ldv_61176; } else { } spin_unlock_irqrestore(& priv->wmm.ra_list_spinlock, flags); return; } } int mwifiex_is_ralist_valid(struct mwifiex_private *priv , struct mwifiex_ra_list_tbl *ra_list , int ptr_index ) { struct mwifiex_ra_list_tbl *rlist ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; { __mptr = (struct list_head const *)priv->wmm.tid_tbl_ptr[ptr_index].ra_list.next; rlist = (struct mwifiex_ra_list_tbl *)__mptr; goto ldv_61190; ldv_61189: ; if ((unsigned long )rlist == (unsigned long )ra_list) { return (1); } else { } __mptr___0 = (struct list_head const *)rlist->list.next; rlist = (struct mwifiex_ra_list_tbl *)__mptr___0; ldv_61190: ; if ((unsigned long )(& rlist->list) != (unsigned long )(& priv->wmm.tid_tbl_ptr[ptr_index].ra_list)) { goto ldv_61189; } else { } return (0); } } void mwifiex_wmm_add_buf_txqueue(struct mwifiex_private *priv , struct sk_buff *skb ) { struct mwifiex_adapter *adapter ; u32 tid ; struct mwifiex_ra_list_tbl *ra_list ; u8 ra[6U] ; u8 tid_down ; unsigned long flags ; struct list_head list_head ; int tdls_status ; struct ethhdr *eth_hdr___0 ; struct mwifiex_txinfo *tx_info ; struct mwifiex_txinfo *tmp ; int tmp___0 ; __u16 tmp___1 ; bool tmp___2 ; int tmp___3 ; raw_spinlock_t *tmp___4 ; struct list_head const *__mptr ; int tmp___5 ; bool tmp___6 ; u8 tmp___7 ; bool tmp___8 ; int tmp___9 ; int tmp___10 ; { adapter = priv->adapter; tdls_status = 0; eth_hdr___0 = (struct ethhdr *)skb->data; tmp = MWIFIEX_SKB_TXCB(skb); tx_info = tmp; memcpy((void *)(& ra), (void const *)(& eth_hdr___0->h_dest), 6UL); if (((unsigned long )priv->bss_role & 1UL) == 0UL && ((unsigned long )adapter->fw_cap_info & 16384UL) != 0UL) { tmp___1 = __fswab16((int )eth_hdr___0->h_proto); if ((unsigned int )tmp___1 == 35085U) { if ((adapter->debug_mask & 8U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "TDLS setup packet for %pM.\tDon\'t block\n", (u8 *)(& ra)); } else { } } else { } } else { tmp___0 = memcmp((void const *)(& priv->cfg_bssid), (void const *)(& ra), 6UL); if (tmp___0 != 0) { tdls_status = mwifiex_get_tdls_link_status(priv, (u8 const *)(& ra)); } else { } } } else { } if ((unsigned int )priv->media_connected == 0U) { tmp___2 = mwifiex_is_skb_mgmt_frame(skb); if (tmp___2) { tmp___3 = 0; } else { tmp___3 = 1; } if (tmp___3) { if ((adapter->debug_mask & 8U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "data: drop packet in disconnect\n"); } else { } } else { } mwifiex_write_data_complete(adapter, skb, 0, -1); return; } else { } } else { } tid = skb->priority; tmp___4 = spinlock_check(& priv->wmm.ra_list_spinlock); flags = _raw_spin_lock_irqsave(tmp___4); tid_down = mwifiex_wmm_downgrade_tid(priv, tid); tmp___7 = mwifiex_queuing_ra_based(priv); if ((unsigned int )tmp___7 == 0U) { tmp___8 = mwifiex_is_skb_mgmt_frame(skb); if (tmp___8) { tmp___9 = 0; } else { tmp___9 = 1; } if (tmp___9) { switch (tdls_status) { case 2: ra_list = mwifiex_wmm_get_queue_raptr(priv, (int )tid_down, (u8 const *)(& ra)); tx_info->flags = (u8 )((unsigned int )tx_info->flags | 4U); goto ldv_61210; case 1: skb_queue_tail(& priv->tdls_txq, skb); spin_unlock_irqrestore(& priv->wmm.ra_list_spinlock, flags); return; default: list_head = priv->wmm.tid_tbl_ptr[(int )tid_down].ra_list; tmp___5 = list_empty((struct list_head const *)(& list_head)); if (tmp___5 == 0) { __mptr = (struct list_head const *)list_head.next; ra_list = (struct mwifiex_ra_list_tbl *)__mptr; } else { ra_list = (struct mwifiex_ra_list_tbl *)0; } goto ldv_61210; } ldv_61210: ; } else { goto _L; } } else { _L: /* CIL Label */ memcpy((void *)(& ra), (void const *)skb->data, 6UL); if ((int )ra[0] & 1) { eth_broadcast_addr((u8 *)(& ra)); } else { tmp___6 = mwifiex_is_skb_mgmt_frame(skb); if ((int )tmp___6) { eth_broadcast_addr((u8 *)(& ra)); } else { } } ra_list = mwifiex_wmm_get_queue_raptr(priv, (int )tid_down, (u8 const *)(& ra)); } if ((unsigned long )ra_list == (unsigned long )((struct mwifiex_ra_list_tbl *)0)) { spin_unlock_irqrestore(& priv->wmm.ra_list_spinlock, flags); mwifiex_write_data_complete(adapter, skb, 0, -1); return; } else { } skb_queue_tail(& ra_list->skb_head, skb); ra_list->ba_pkt_count = (u16 )((int )ra_list->ba_pkt_count + 1); ra_list->total_pkt_count = (u16 )((int )ra_list->total_pkt_count + 1); tmp___10 = atomic_read((atomic_t const *)(& priv->wmm.highest_queued_prio)); if (tmp___10 < (int )priv->tos_to_tid_inv[(int )tid_down]) { atomic_set(& priv->wmm.highest_queued_prio, (int )priv->tos_to_tid_inv[(int )tid_down]); } else { } atomic_inc(& priv->wmm.tx_pkts_queued); spin_unlock_irqrestore(& priv->wmm.ra_list_spinlock, flags); return; } } int mwifiex_ret_wmm_get_status(struct mwifiex_private *priv , struct host_cmd_ds_command const *resp ) { u8 *curr ; uint16_t resp_len ; uint16_t tlv_len ; int mask ; bool valid ; struct mwifiex_ie_types_data *tlv_hdr ; struct mwifiex_ie_types_wmm_queue_status *tlv_wmm_qstatus ; struct ieee_types_wmm_parameter *wmm_param_ie ; struct mwifiex_wmm_ac_status *ac_status ; { curr = (u8 *)(& resp->params.get_wmm_status); resp_len = resp->size; mask = 15; valid = 1; wmm_param_ie = (struct ieee_types_wmm_parameter *)0; if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: WMM: WMM_GET_STATUS cmdresp received: %d\n", (int )resp_len); } else { } } else { } goto ldv_61234; ldv_61233: tlv_hdr = (struct mwifiex_ie_types_data *)curr; tlv_len = tlv_hdr->header.len; if ((unsigned long )resp_len < (unsigned long )tlv_len + 4UL) { goto ldv_61228; } else { } switch ((int )tlv_hdr->header.type) { case 272: tlv_wmm_qstatus = (struct mwifiex_ie_types_wmm_queue_status *)tlv_hdr; if (((priv->adapter)->debug_mask & 16U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: CMD_RESP: WMM_GET_STATUS:\tQSTATUS TLV: %d, %d, %d\n", (int )tlv_wmm_qstatus->queue_index, (int )tlv_wmm_qstatus->flow_required, (int )tlv_wmm_qstatus->disabled); } else { } } else { } ac_status = (struct mwifiex_wmm_ac_status *)(& priv->wmm.ac_status) + (unsigned long )tlv_wmm_qstatus->queue_index; ac_status->disabled = tlv_wmm_qstatus->disabled; ac_status->flow_required = tlv_wmm_qstatus->flow_required; ac_status->flow_created = tlv_wmm_qstatus->flow_created; goto ldv_61230; case 221: wmm_param_ie = (struct ieee_types_wmm_parameter *)curr + 2U; wmm_param_ie->vend_hdr.len = (unsigned char )tlv_len; wmm_param_ie->vend_hdr.element_id = 221U; if (((priv->adapter)->debug_mask & 16U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: CMD_RESP: WMM_GET_STATUS:\tWMM Parameter Set Count: %d\n", (int )wmm_param_ie->qos_info_bitmap & mask); } else { } } else { } memcpy((void *)(& priv->curr_bss_params.bss_descriptor.wmm_ie), (void const *)wmm_param_ie, (size_t )((int )wmm_param_ie->vend_hdr.len + 2)); goto ldv_61230; default: valid = 0; goto ldv_61230; } ldv_61230: curr = curr + ((unsigned long )tlv_len + 4UL); resp_len = (unsigned int )((int )resp_len - (int )tlv_len) - 4U; ldv_61234: ; if ((unsigned int )resp_len > 3U && (int )valid) { goto ldv_61233; } else { } ldv_61228: mwifiex_wmm_setup_queue_priorities(priv, wmm_param_ie); mwifiex_wmm_setup_ac_downgrade(priv); return (0); } } u32 mwifiex_wmm_process_association_req(struct mwifiex_private *priv , u8 **assoc_buf , struct ieee_types_wmm_parameter *wmm_ie , struct ieee80211_ht_cap *ht_cap ) { struct mwifiex_ie_types_wmm_param_set *wmm_tlv ; u32 ret_len ; { ret_len = 0U; if ((unsigned long )assoc_buf == (unsigned long )((u8 **)0U)) { return (0U); } else { } if ((unsigned long )*assoc_buf == (unsigned long )((u8 *)0U)) { return (0U); } else { } if ((unsigned long )wmm_ie == (unsigned long )((struct ieee_types_wmm_parameter *)0)) { return (0U); } else { } if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: WMM: process assoc req: bss->wmm_ie=%#x\n", (int )wmm_ie->vend_hdr.element_id); } else { } } else { } if (((unsigned int )priv->wmm_required != 0U || ((unsigned long )ht_cap != (unsigned long )((struct ieee80211_ht_cap *)0) && (((int )(priv->adapter)->config_bands & 8) != 0 || ((int )(priv->adapter)->config_bands & 16) != 0))) && (unsigned int )wmm_ie->vend_hdr.element_id == 221U) { wmm_tlv = (struct mwifiex_ie_types_wmm_param_set *)*assoc_buf; wmm_tlv->header.type = (unsigned short )wmm_info_ie[0]; wmm_tlv->header.len = (unsigned short )wmm_info_ie[1]; memcpy((void *)(& wmm_tlv->wmm_ie), (void const *)(& wmm_info_ie) + 2U, (size_t )wmm_tlv->header.len); if ((int )((signed char )wmm_ie->qos_info_bitmap) < 0) { memcpy((void *)(& wmm_tlv->wmm_ie) + ((unsigned long )wmm_tlv->header.len + 0xffffffffffffffffUL), (void const *)(& priv->wmm_qosinfo), 1UL); } else { } ret_len = (u32 )wmm_tlv->header.len + 4U; *assoc_buf = *assoc_buf + (unsigned long )ret_len; } else { } return (ret_len); } } u8 mwifiex_wmm_compute_drv_pkt_delay(struct mwifiex_private *priv , struct sk_buff const *skb ) { u32 queue_delay ; ktime_t tmp ; s64 tmp___0 ; u8 ret_val ; u32 _min1 ; u32 _min2 ; { tmp = net_timedelta(skb->__annonCompField68.__annonCompField67.__annonCompField66.tstamp); tmp___0 = ktime_to_ms(tmp); queue_delay = (u32 )tmp___0; _min1 = queue_delay; _min2 = priv->wmm.drv_pkt_delay_max; ret_val = (unsigned char )((_min1 < _min2 ? _min1 : _min2) >> 1); if (((priv->adapter)->debug_mask & 8U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "data: WMM: Pkt Delay: %d ms,\t%d ms sent to FW\n", queue_delay, (int )ret_val); } else { } } else { } return (ret_val); } } static struct mwifiex_ra_list_tbl *mwifiex_wmm_get_highest_priolist_ptr(struct mwifiex_adapter *adapter , struct mwifiex_private **priv , int *tid ) { struct mwifiex_private *priv_tmp ; struct mwifiex_ra_list_tbl *ptr ; struct mwifiex_tid_tbl *tid_ptr ; atomic_t *hqp ; unsigned long flags_ra ; int i ; int j ; struct list_head const *__mptr ; int tmp ; raw_spinlock_t *tmp___0 ; struct list_head const *__mptr___0 ; int tmp___1 ; struct list_head const *__mptr___1 ; struct list_head const *__mptr___2 ; int tmp___2 ; { j = (int )adapter->priv_num + -1; goto ldv_61287; ldv_61286: __mptr = (struct list_head const *)adapter->bss_prio_tbl[j].bss_prio_head.next; adapter->bss_prio_tbl[j].bss_prio_cur = (struct mwifiex_bss_prio_node *)__mptr; goto ldv_61284; ldv_61283: priv_tmp = (adapter->bss_prio_tbl[j].bss_prio_cur)->priv; tmp = atomic_read((atomic_t const *)(& priv_tmp->wmm.tx_pkts_queued)); if (tmp == 0) { goto ldv_61268; } else { } hqp = & priv_tmp->wmm.highest_queued_prio; i = atomic_read((atomic_t const *)hqp); goto ldv_61281; ldv_61280: tmp___0 = spinlock_check(& priv_tmp->wmm.ra_list_spinlock); flags_ra = _raw_spin_lock_irqsave(tmp___0); tid_ptr = (struct mwifiex_tid_tbl *)(& priv_tmp->wmm.tid_tbl_ptr) + (unsigned long )tos_to_tid[i]; __mptr___0 = (struct list_head const *)tid_ptr->ra_list.next; ptr = (struct mwifiex_ra_list_tbl *)__mptr___0; goto ldv_61278; ldv_61277: tmp___1 = skb_queue_empty((struct sk_buff_head const *)(& ptr->skb_head)); if (tmp___1 == 0) { goto found; } else { } __mptr___1 = (struct list_head const *)ptr->list.next; ptr = (struct mwifiex_ra_list_tbl *)__mptr___1; ldv_61278: ; if ((unsigned long )ptr != (unsigned long )tid_ptr) { goto ldv_61277; } else { } spin_unlock_irqrestore(& priv_tmp->wmm.ra_list_spinlock, flags_ra); i = i - 1; ldv_61281: ; if (i >= 0) { goto ldv_61280; } else { } ldv_61268: __mptr___2 = (struct list_head const *)(adapter->bss_prio_tbl[j].bss_prio_cur)->list.next; adapter->bss_prio_tbl[j].bss_prio_cur = (struct mwifiex_bss_prio_node *)__mptr___2; ldv_61284: ; if ((unsigned long )(& (adapter->bss_prio_tbl[j].bss_prio_cur)->list) != (unsigned long )(& adapter->bss_prio_tbl[j].bss_prio_head)) { goto ldv_61283; } else { } j = j - 1; ldv_61287: ; if (j >= 0) { goto ldv_61286; } else { } return ((struct mwifiex_ra_list_tbl *)0); found: tmp___2 = atomic_read((atomic_t const *)hqp); if (tmp___2 > i) { atomic_set(hqp, i); } else { } spin_unlock_irqrestore(& priv_tmp->wmm.ra_list_spinlock, flags_ra); *priv = priv_tmp; *tid = (int )tos_to_tid[i]; return (ptr); } } void mwifiex_rotate_priolists(struct mwifiex_private *priv , struct mwifiex_ra_list_tbl *ra , int tid ) { struct mwifiex_adapter *adapter ; struct mwifiex_bss_prio_tbl *tbl ; struct mwifiex_tid_tbl *tid_ptr ; unsigned long flags ; raw_spinlock_t *tmp ; raw_spinlock_t *tmp___0 ; int tmp___1 ; { adapter = priv->adapter; tbl = (struct mwifiex_bss_prio_tbl *)(& adapter->bss_prio_tbl); tid_ptr = (struct mwifiex_tid_tbl *)(& priv->wmm.tid_tbl_ptr) + (unsigned long )tid; tmp = spinlock_check(& (tbl + (unsigned long )priv->bss_priority)->bss_prio_lock); flags = _raw_spin_lock_irqsave(tmp); list_move(& (tbl + (unsigned long )priv->bss_priority)->bss_prio_head, & ((tbl + (unsigned long )priv->bss_priority)->bss_prio_cur)->list); spin_unlock_irqrestore(& (tbl + (unsigned long )priv->bss_priority)->bss_prio_lock, flags); tmp___0 = spinlock_check(& priv->wmm.ra_list_spinlock); flags = _raw_spin_lock_irqsave(tmp___0); tmp___1 = mwifiex_is_ralist_valid(priv, ra, tid); if (tmp___1 != 0) { priv->wmm.packets_out[tid] = priv->wmm.packets_out[tid] + 1U; list_move(& tid_ptr->ra_list, & ra->list); } else { } spin_unlock_irqrestore(& priv->wmm.ra_list_spinlock, flags); return; } } static int mwifiex_is_11n_aggragation_possible(struct mwifiex_private *priv , struct mwifiex_ra_list_tbl *ptr , int max_buf_size ) { int count ; int total_size ; struct sk_buff *skb ; struct sk_buff *tmp ; int max_amsdu_size ; int __min1 ; int __min2 ; { count = 0; total_size = 0; if (((unsigned int )priv->bss_role == 1U && (unsigned int )priv->ap_11n_enabled != 0U) && ptr->is_11n_enabled != 0U) { __min1 = (int )ptr->max_amsdu; __min2 = max_buf_size; max_amsdu_size = __min1 < __min2 ? __min1 : __min2; } else { max_amsdu_size = max_buf_size; } skb = ptr->skb_head.next; tmp = skb->__annonCompField68.__annonCompField67.next; goto ldv_61319; ldv_61318: total_size = (int )(skb->len + (unsigned int )total_size); if (total_size >= max_amsdu_size) { goto ldv_61317; } else { } count = count + 1; if (count > 1) { return (1); } else { } skb = tmp; tmp = skb->__annonCompField68.__annonCompField67.next; ldv_61319: ; if ((unsigned long )((struct sk_buff *)(& ptr->skb_head)) != (unsigned long )skb) { goto ldv_61318; } else { } ldv_61317: ; return (0); } } static void mwifiex_send_single_packet(struct mwifiex_private *priv , struct mwifiex_ra_list_tbl *ptr , int ptr_index , unsigned long ra_list_flags ) { struct sk_buff *skb ; struct sk_buff *skb_next ; struct mwifiex_tx_param tx_param ; struct mwifiex_adapter *adapter ; struct mwifiex_txinfo *tx_info ; int tmp ; int tmp___0 ; raw_spinlock_t *tmp___1 ; int tmp___2 ; int tmp___3 ; { adapter = priv->adapter; tmp = skb_queue_empty((struct sk_buff_head const *)(& ptr->skb_head)); if (tmp != 0) { spin_unlock_irqrestore(& priv->wmm.ra_list_spinlock, ra_list_flags); if ((adapter->debug_mask & 8U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "data: nothing to send\n"); } else { } } else { } return; } else { } skb = skb_dequeue(& ptr->skb_head); tx_info = MWIFIEX_SKB_TXCB(skb); if ((adapter->debug_mask & 8U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "data: dequeuing the packet %p %p\n", ptr, skb); } else { } } else { } ptr->total_pkt_count = (u16 )((int )ptr->total_pkt_count - 1); tmp___0 = skb_queue_empty((struct sk_buff_head const *)(& ptr->skb_head)); if (tmp___0 == 0) { skb_next = skb_peek((struct sk_buff_head const *)(& ptr->skb_head)); } else { skb_next = (struct sk_buff *)0; } spin_unlock_irqrestore(& priv->wmm.ra_list_spinlock, ra_list_flags); tx_param.next_pkt_len = (unsigned long )skb_next != (unsigned long )((struct sk_buff *)0) ? skb_next->len + 20U : 0U; tmp___3 = mwifiex_process_tx(priv, skb, & tx_param); if (tmp___3 == -16) { tmp___1 = spinlock_check(& priv->wmm.ra_list_spinlock); ra_list_flags = _raw_spin_lock_irqsave(tmp___1); tmp___2 = mwifiex_is_ralist_valid(priv, ptr, ptr_index); if (tmp___2 == 0) { spin_unlock_irqrestore(& priv->wmm.ra_list_spinlock, ra_list_flags); mwifiex_write_data_complete(adapter, skb, 0, -1); return; } else { } skb_queue_tail(& ptr->skb_head, skb); ptr->total_pkt_count = (u16 )((int )ptr->total_pkt_count + 1); ptr->ba_pkt_count = (u16 )((int )ptr->ba_pkt_count + 1); tx_info->flags = (u8 )((unsigned int )tx_info->flags | 1U); spin_unlock_irqrestore(& priv->wmm.ra_list_spinlock, ra_list_flags); } else { mwifiex_rotate_priolists(priv, ptr, ptr_index); atomic_dec(& priv->wmm.tx_pkts_queued); } return; } } static int mwifiex_is_ptr_processed(struct mwifiex_private *priv , struct mwifiex_ra_list_tbl *ptr ) { struct sk_buff *skb ; struct mwifiex_txinfo *tx_info ; int tmp ; { tmp = skb_queue_empty((struct sk_buff_head const *)(& ptr->skb_head)); if (tmp != 0) { return (0); } else { } skb = skb_peek((struct sk_buff_head const *)(& ptr->skb_head)); tx_info = MWIFIEX_SKB_TXCB(skb); if ((int )tx_info->flags & 1) { return (1); } else { } return (0); } } static void mwifiex_send_processed_packet(struct mwifiex_private *priv , struct mwifiex_ra_list_tbl *ptr , int ptr_index , unsigned long ra_list_flags ) { struct mwifiex_tx_param tx_param ; struct mwifiex_adapter *adapter ; int ret ; struct sk_buff *skb ; struct sk_buff *skb_next ; struct mwifiex_txinfo *tx_info ; int tmp ; int tmp___0 ; raw_spinlock_t *tmp___1 ; int tmp___2 ; { adapter = priv->adapter; ret = -1; tmp = skb_queue_empty((struct sk_buff_head const *)(& ptr->skb_head)); if (tmp != 0) { spin_unlock_irqrestore(& priv->wmm.ra_list_spinlock, ra_list_flags); return; } else { } skb = skb_dequeue(& ptr->skb_head); if ((unsigned int )adapter->data_sent != 0U || (unsigned int )adapter->tx_lock_flag != 0U) { spin_unlock_irqrestore(& priv->wmm.ra_list_spinlock, ra_list_flags); skb_queue_tail(& adapter->tx_data_q, skb); atomic_inc(& adapter->tx_queued); return; } else { } tmp___0 = skb_queue_empty((struct sk_buff_head const *)(& ptr->skb_head)); if (tmp___0 == 0) { skb_next = skb_peek((struct sk_buff_head const *)(& ptr->skb_head)); } else { skb_next = (struct sk_buff *)0; } tx_info = MWIFIEX_SKB_TXCB(skb); spin_unlock_irqrestore(& priv->wmm.ra_list_spinlock, ra_list_flags); if ((unsigned int )adapter->iface_type == 2U) { adapter->data_sent = 1U; ret = (*(adapter->if_ops.host_to_card))(adapter, 2, skb, (struct mwifiex_tx_param *)0); } else { tx_param.next_pkt_len = (unsigned long )skb_next != (unsigned long )((struct sk_buff *)0) ? skb_next->len + 20U : 0U; ret = (*(adapter->if_ops.host_to_card))(adapter, 0, skb, & tx_param); } switch (ret) { case -16: ; if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "data: -EBUSY is returned\n"); } else { } } else { } tmp___1 = spinlock_check(& priv->wmm.ra_list_spinlock); ra_list_flags = _raw_spin_lock_irqsave(tmp___1); tmp___2 = mwifiex_is_ralist_valid(priv, ptr, ptr_index); if (tmp___2 == 0) { spin_unlock_irqrestore(& priv->wmm.ra_list_spinlock, ra_list_flags); mwifiex_write_data_complete(adapter, skb, 0, -1); return; } else { } skb_queue_tail(& ptr->skb_head, skb); tx_info->flags = (u8 )((unsigned int )tx_info->flags | 1U); spin_unlock_irqrestore(& priv->wmm.ra_list_spinlock, ra_list_flags); goto ldv_61356; case -1: ; if ((unsigned int )adapter->iface_type != 1U) { adapter->data_sent = 0U; } else { } if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "host_to_card failed: %#x\n", ret); } else { } } else { } adapter->dbg.num_tx_host_to_card_failure = adapter->dbg.num_tx_host_to_card_failure + 1U; mwifiex_write_data_complete(adapter, skb, 0, ret); goto ldv_61356; case -115: ; if ((unsigned int )adapter->iface_type != 1U) { adapter->data_sent = 0U; } else { } goto ldv_61356; case 0: mwifiex_write_data_complete(adapter, skb, 0, ret); default: ; goto ldv_61356; } ldv_61356: ; if (ret != -16) { mwifiex_rotate_priolists(priv, ptr, ptr_index); atomic_dec(& priv->wmm.tx_pkts_queued); } else { } return; } } static int mwifiex_dequeue_tx_packet(struct mwifiex_adapter *adapter ) { struct mwifiex_ra_list_tbl *ptr ; struct mwifiex_private *priv ; int ptr_index ; u8 ra[6U] ; int tid_del ; int tid ; unsigned long flags ; raw_spinlock_t *tmp ; int tmp___0 ; int tmp___1 ; u8 tmp___2 ; int tmp___3 ; u8 tmp___4 ; u8 tmp___5 ; u8 tmp___6 ; u8 tmp___7 ; int tmp___8 ; { priv = (struct mwifiex_private *)0; ptr_index = 0; tid_del = 0; tid = 0; ptr = mwifiex_wmm_get_highest_priolist_ptr(adapter, & priv, & ptr_index); if ((unsigned long )ptr == (unsigned long )((struct mwifiex_ra_list_tbl *)0)) { return (-1); } else { } tid = mwifiex_get_tid(ptr); if ((adapter->debug_mask & 8U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "data: tid=%d\n", tid); } else { } } else { } tmp = spinlock_check(& priv->wmm.ra_list_spinlock); flags = _raw_spin_lock_irqsave(tmp); tmp___0 = mwifiex_is_ralist_valid(priv, ptr, ptr_index); if (tmp___0 == 0) { spin_unlock_irqrestore(& priv->wmm.ra_list_spinlock, flags); return (-1); } else { } tmp___1 = mwifiex_is_ptr_processed(priv, ptr); if (tmp___1 != 0) { mwifiex_send_processed_packet(priv, ptr, ptr_index, flags); return (0); } else { } if ((ptr->is_11n_enabled == 0U || (unsigned int )ptr->ba_status != 0U) || (unsigned int )priv->wps.session_enable != 0U) { if ((ptr->is_11n_enabled != 0U && (unsigned int )ptr->ba_status != 0U) && (unsigned int )ptr->amsdu_in_ampdu != 0U) { tmp___2 = mwifiex_is_amsdu_allowed(priv, tid); if ((unsigned int )tmp___2 != 0U) { tmp___3 = mwifiex_is_11n_aggragation_possible(priv, ptr, (int )adapter->tx_buf_size); if (tmp___3 != 0) { mwifiex_11n_aggregate_pkt(priv, ptr, ptr_index, flags); } else { mwifiex_send_single_packet(priv, ptr, ptr_index, flags); } } else { mwifiex_send_single_packet(priv, ptr, ptr_index, flags); } } else { mwifiex_send_single_packet(priv, ptr, ptr_index, flags); } } else { tmp___6 = mwifiex_is_ampdu_allowed(priv, ptr, tid); if ((unsigned int )tmp___6 != 0U && (int )ptr->ba_pkt_count > (int )((unsigned short )ptr->ba_packet_thr)) { tmp___5 = mwifiex_space_avail_for_new_ba_stream(adapter); if ((unsigned int )tmp___5 != 0U) { mwifiex_create_ba_tbl(priv, (u8 *)(& ptr->ra), tid, 1); mwifiex_send_addba(priv, tid, (u8 *)(& ptr->ra)); } else { tmp___4 = mwifiex_find_stream_to_delete(priv, tid, & tid_del, (u8 *)(& ra)); if ((unsigned int )tmp___4 != 0U) { mwifiex_create_ba_tbl(priv, (u8 *)(& ptr->ra), tid, 1); mwifiex_send_delba(priv, tid_del, (u8 *)(& ra), 1); } else { } } } else { } tmp___7 = mwifiex_is_amsdu_allowed(priv, tid); if ((unsigned int )tmp___7 != 0U) { tmp___8 = mwifiex_is_11n_aggragation_possible(priv, ptr, (int )adapter->tx_buf_size); if (tmp___8 != 0) { mwifiex_11n_aggregate_pkt(priv, ptr, ptr_index, flags); } else { mwifiex_send_single_packet(priv, ptr, ptr_index, flags); } } else { mwifiex_send_single_packet(priv, ptr, ptr_index, flags); } } return (0); } } void mwifiex_wmm_process_tx(struct mwifiex_adapter *adapter ) { int tmp ; int tmp___0 ; int tmp___1 ; { ldv_61378: tmp = mwifiex_dequeue_tx_packet(adapter); if (tmp != 0) { goto ldv_61377; } else { } if ((unsigned int )adapter->iface_type != 0U) { if ((unsigned int )adapter->data_sent != 0U || (unsigned int )adapter->tx_lock_flag != 0U) { goto ldv_61377; } else { } } else { tmp___0 = atomic_read((atomic_t const *)(& adapter->tx_queued)); if (tmp___0 > 15) { goto ldv_61377; } else { } } tmp___1 = mwifiex_wmm_lists_empty(adapter); if (tmp___1 == 0) { goto ldv_61378; } else { } ldv_61377: ; return; } } bool ldv_queue_work_on_111(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_112(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_113(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_114(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_115(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; extern void __dynamic_dev_dbg(struct _ddebug * , struct device const * , char const * , ...) ; bool ldv_queue_work_on_125(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_127(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_126(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_129(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_128(struct workqueue_struct *ldv_func_arg1 ) ; void mwifiex_update_ampdu_txwinsize(struct mwifiex_adapter *adapter ) ; void mwifiex_11n_delba(struct mwifiex_private *priv , int tid ) ; void mwifiex_del_ba_tbl(struct mwifiex_private *priv , int tid , u8 *peer_mac , u8 type , int initiator ) ; int mwifiex_ret_11n_delba(struct mwifiex_private *priv , struct host_cmd_ds_command *resp ) ; int mwifiex_ret_11n_addba_req(struct mwifiex_private *priv , struct host_cmd_ds_command *resp ) ; int mwifiex_cmd_11n_cfg(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd , u16 cmd_action , struct mwifiex_ds_11n_tx_cfg *txcfg ) ; int mwifiex_cmd_append_11n_tlv(struct mwifiex_private *priv , struct mwifiex_bssdescriptor *bss_desc , u8 **buffer ) ; int mwifiex_fill_cap_info(struct mwifiex_private *priv , u8 radio_type , struct ieee80211_ht_cap *ht_cap ) ; void mwifiex_11n_delete_tx_ba_stream_tbl_entry(struct mwifiex_private *priv , struct mwifiex_tx_ba_stream_tbl *tx_ba_tsr_tbl ) ; struct mwifiex_tx_ba_stream_tbl *mwifiex_get_ba_tbl(struct mwifiex_private *priv , int tid , u8 *ra ) ; void mwifiex_11n_delete_ba_stream(struct mwifiex_private *priv , u8 *del_ba ) ; int mwifiex_cmd_recfg_tx_buf(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd , int cmd_action , u16 *buf_size ) ; int mwifiex_cmd_amsdu_aggr_ctrl(struct host_cmd_ds_command *cmd , int cmd_action , struct mwifiex_ds_11n_amsdu_aggr_ctrl *aa_ctrl ) ; void mwifiex_del_tx_ba_stream_tbl_by_ra(struct mwifiex_private *priv , u8 *ra ) ; u8 mwifiex_get_sec_chan_offset(int chan ) ; int mwifiex_fill_cap_info(struct mwifiex_private *priv , u8 radio_type , struct ieee80211_ht_cap *ht_cap ) { uint16_t ht_ext_cap ; struct ieee80211_supported_band *sband ; bool __warned ; int __ret_warn_once ; int __ret_warn_on ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; { ht_ext_cap = ht_cap->extended_ht_cap_info; sband = (priv->wdev.wiphy)->bands[(int )radio_type]; __ret_warn_once = (unsigned long )sband == (unsigned long )((struct ieee80211_supported_band *)0); tmp___1 = ldv__builtin_expect(__ret_warn_once != 0, 0L); if (tmp___1 != 0L) { __ret_warn_on = ! __warned; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11944/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/mwifiex/11n.c", 44); } else { } tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { __warned = 1; } else { } } else { } tmp___2 = ldv__builtin_expect(__ret_warn_once != 0, 0L); if (tmp___2 != 0L) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Invalid radio type!\n"); } else { } } else { } return (-22); } else { } ht_cap->ampdu_params_info = (u8 )(((int )((signed char )sband->ht_cap.ampdu_factor) & 3) | ((int )((signed char )((int )sband->ht_cap.ampdu_density << 2)) & 28)); memcpy((void *)(& ht_cap->mcs), (void const *)(& sband->ht_cap.mcs), 16UL); if (priv->bss_mode == 2U || (((int )sband->ht_cap.cap & 2) != 0 && (unsigned int )(priv->adapter)->sec_chan_offset != 0U)) { ht_cap->mcs.rx_mask[4] = (u8 )((unsigned int )ht_cap->mcs.rx_mask[4] | 1U); } else { } ht_ext_cap = (unsigned int )ht_ext_cap & 63487U; ht_cap->cap_info = sband->ht_cap.cap; ht_cap->extended_ht_cap_info = ht_ext_cap; if (((unsigned long )(priv->adapter)->hw_dot_11n_dev_cap & 1073741824UL) != 0UL) { ht_cap->tx_BF_cap_info = 165797896U; } else { } return (0); } } static struct mwifiex_tx_ba_stream_tbl *mwifiex_get_ba_status(struct mwifiex_private *priv , enum mwifiex_ba_status ba_status ) { struct mwifiex_tx_ba_stream_tbl *tx_ba_tsr_tbl ; unsigned long flags ; raw_spinlock_t *tmp ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; { tmp = spinlock_check(& priv->tx_ba_stream_tbl_lock); flags = _raw_spin_lock_irqsave(tmp); __mptr = (struct list_head const *)priv->tx_ba_stream_tbl_ptr.next; tx_ba_tsr_tbl = (struct mwifiex_tx_ba_stream_tbl *)__mptr; goto ldv_60955; ldv_60954: ; if ((unsigned int )tx_ba_tsr_tbl->ba_status == (unsigned int )ba_status) { spin_unlock_irqrestore(& priv->tx_ba_stream_tbl_lock, flags); return (tx_ba_tsr_tbl); } else { } __mptr___0 = (struct list_head const *)tx_ba_tsr_tbl->list.next; tx_ba_tsr_tbl = (struct mwifiex_tx_ba_stream_tbl *)__mptr___0; ldv_60955: ; if ((unsigned long )(& tx_ba_tsr_tbl->list) != (unsigned long )(& priv->tx_ba_stream_tbl_ptr)) { goto ldv_60954; } else { } spin_unlock_irqrestore(& priv->tx_ba_stream_tbl_lock, flags); return ((struct mwifiex_tx_ba_stream_tbl *)0); } } int mwifiex_ret_11n_delba(struct mwifiex_private *priv , struct host_cmd_ds_command *resp ) { int tid ; struct mwifiex_tx_ba_stream_tbl *tx_ba_tbl ; struct host_cmd_ds_11n_delba *del_ba ; uint16_t del_ba_param_set ; { del_ba = & resp->params.del_ba; del_ba_param_set = del_ba->del_ba_param_set; tid = (int )del_ba_param_set >> 12; if ((unsigned int )del_ba->del_result == 0U) { mwifiex_del_ba_tbl(priv, tid, (u8 *)(& del_ba->peer_mac_addr), 1, (int )(((unsigned long )del_ba_param_set & 2048UL) >> 11)); tx_ba_tbl = mwifiex_get_ba_status(priv, 1); if ((unsigned long )tx_ba_tbl != (unsigned long )((struct mwifiex_tx_ba_stream_tbl *)0)) { mwifiex_send_addba(priv, tx_ba_tbl->tid, (u8 *)(& tx_ba_tbl->ra)); } else { } } else { if (((unsigned long )del_ba_param_set & 2048UL) >> 11 == 0UL) { return (0); } else { } mwifiex_create_ba_tbl(priv, (u8 *)(& del_ba->peer_mac_addr), tid, 1); tx_ba_tbl = mwifiex_get_ba_status(priv, 1); if ((unsigned long )tx_ba_tbl != (unsigned long )((struct mwifiex_tx_ba_stream_tbl *)0)) { mwifiex_del_ba_tbl(priv, tx_ba_tbl->tid, (u8 *)(& tx_ba_tbl->ra), 1, 1); } else { } } return (0); } } int mwifiex_ret_11n_addba_req(struct mwifiex_private *priv , struct host_cmd_ds_command *resp ) { int tid ; int tid_down ; struct host_cmd_ds_11n_addba_rsp *add_ba_rsp ; struct mwifiex_tx_ba_stream_tbl *tx_ba_tbl ; struct mwifiex_ra_list_tbl *ra_list ; u16 block_ack_param_set ; u8 tmp ; { add_ba_rsp = & resp->params.add_ba_rsp; block_ack_param_set = add_ba_rsp->block_ack_param_set; add_ba_rsp->ssn = (unsigned int )add_ba_rsp->ssn & 65520U; tid = ((int )block_ack_param_set & 60) >> 2; tmp = mwifiex_wmm_downgrade_tid(priv, (u32 )tid); tid_down = (int )tmp; ra_list = mwifiex_wmm_get_ralist_node(priv, (int )((u8 )tid_down), (u8 const *)(& add_ba_rsp->peer_mac_addr)); if ((unsigned int )add_ba_rsp->status_code != 0U) { if ((unsigned long )ra_list != (unsigned long )((struct mwifiex_ra_list_tbl *)0)) { ra_list->ba_status = 0; ra_list->amsdu_in_ampdu = 0U; } else { } mwifiex_del_ba_tbl(priv, tid, (u8 *)(& add_ba_rsp->peer_mac_addr), 1, 1); if ((unsigned int )add_ba_rsp->add_rsp_result != 2U) { priv->aggr_prio_tbl[tid].ampdu_ap = 255U; } else { } return (0); } else { } tx_ba_tbl = mwifiex_get_ba_tbl(priv, tid, (u8 *)(& add_ba_rsp->peer_mac_addr)); if ((unsigned long )tx_ba_tbl != (unsigned long )((struct mwifiex_tx_ba_stream_tbl *)0)) { if (((priv->adapter)->debug_mask & 32U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: BA stream complete\n"); } else { } } else { } tx_ba_tbl->ba_status = 2; if (((int )block_ack_param_set & 1 && (unsigned int )priv->add_ba_param.tx_amsdu != 0U) && (unsigned int )priv->aggr_prio_tbl[tid].amsdu != 255U) { tx_ba_tbl->amsdu = 1U; } else { tx_ba_tbl->amsdu = 0U; } if ((unsigned long )ra_list != (unsigned long )((struct mwifiex_ra_list_tbl *)0)) { ra_list->amsdu_in_ampdu = tx_ba_tbl->amsdu; ra_list->ba_status = 2; } else { } } else if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "BA stream not created\n"); } else { } } else { } return (0); } } int mwifiex_cmd_recfg_tx_buf(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd , int cmd_action , u16 *buf_size ) { struct host_cmd_ds_txbuf_cfg *tx_buf ; u16 action ; { tx_buf = & cmd->params.tx_buf; action = (unsigned short )cmd_action; cmd->command = 217U; cmd->size = 16U; tx_buf->action = action; switch ((int )action) { case 1: ; if (((priv->adapter)->debug_mask & 16U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "cmd: set tx_buf=%d\n", (int )*buf_size); } else { } } else { } tx_buf->buff_size = *buf_size; goto ldv_60984; case 0: ; default: tx_buf->buff_size = 0U; goto ldv_60984; } ldv_60984: ; return (0); } } int mwifiex_cmd_amsdu_aggr_ctrl(struct host_cmd_ds_command *cmd , int cmd_action , struct mwifiex_ds_11n_amsdu_aggr_ctrl *aa_ctrl ) { struct host_cmd_ds_amsdu_aggr_ctrl *amsdu_ctrl ; u16 action ; { amsdu_ctrl = & cmd->params.amsdu_aggr_ctrl; action = (unsigned short )cmd_action; cmd->command = 223U; cmd->size = 14U; amsdu_ctrl->action = action; switch ((int )action) { case 1: amsdu_ctrl->enable = aa_ctrl->enable; amsdu_ctrl->curr_buf_size = 0U; goto ldv_60995; case 0: ; default: amsdu_ctrl->curr_buf_size = 0U; goto ldv_60995; } ldv_60995: ; return (0); } } int mwifiex_cmd_11n_cfg(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd , u16 cmd_action , struct mwifiex_ds_11n_tx_cfg *txcfg ) { struct host_cmd_ds_11n_cfg *htcfg ; { htcfg = & cmd->params.htcfg; cmd->command = 205U; cmd->size = 16U; htcfg->action = cmd_action; htcfg->ht_tx_cap = txcfg->tx_htcap; htcfg->ht_tx_info = txcfg->tx_htinfo; if ((priv->adapter)->is_hw_11ac_capable != 0U) { htcfg->misc_config = txcfg->misc_config; } else { } return (0); } } int mwifiex_cmd_append_11n_tlv(struct mwifiex_private *priv , struct mwifiex_bssdescriptor *bss_desc , u8 **buffer ) { struct mwifiex_ie_types_htcap *ht_cap ; struct mwifiex_ie_types_htinfo *ht_info ; struct mwifiex_ie_types_chan_list_param_set *chan_list ; struct mwifiex_ie_types_2040bssco *bss_co_2040 ; struct mwifiex_ie_types_extcap *ext_cap ; int ret_len ; struct ieee80211_supported_band *sband ; struct ieee_types_header *hdr ; u8 radio_type ; { ret_len = 0; if ((unsigned long )buffer == (unsigned long )((u8 **)0U) || (unsigned long )*buffer == (unsigned long )((u8 *)0U)) { return (ret_len); } else { } radio_type = mwifiex_band_to_radio_type((int )((unsigned char )bss_desc->bss_band)); sband = (priv->wdev.wiphy)->bands[(int )radio_type]; if ((unsigned long )bss_desc->bcn_ht_cap != (unsigned long )((struct ieee80211_ht_cap *)0)) { ht_cap = (struct mwifiex_ie_types_htcap *)*buffer; memset((void *)ht_cap, 0, 30UL); ht_cap->header.type = 45U; ht_cap->header.len = 26U; memcpy((void *)ht_cap + 4U, (void const *)bss_desc->bcn_ht_cap, (size_t )ht_cap->header.len); mwifiex_fill_cap_info(priv, (int )radio_type, & ht_cap->ht_cap); *buffer = *buffer + 30UL; ret_len = (int )((unsigned int )ret_len + 30U); } else { } if ((unsigned long )bss_desc->bcn_ht_oper != (unsigned long )((struct ieee80211_ht_operation *)0)) { if (priv->bss_mode == 1U) { ht_info = (struct mwifiex_ie_types_htinfo *)*buffer; memset((void *)ht_info, 0, 26UL); ht_info->header.type = 61U; ht_info->header.len = 22U; memcpy((void *)ht_info + 4U, (void const *)bss_desc->bcn_ht_oper, (size_t )ht_info->header.len); if (((int )sband->ht_cap.cap & 2) == 0) { ht_info->ht_oper.ht_param = (unsigned int )ht_info->ht_oper.ht_param & 248U; } else { } *buffer = *buffer + 26UL; ret_len = (int )((unsigned int )ret_len + 26U); } else { } chan_list = (struct mwifiex_ie_types_chan_list_param_set *)*buffer; memset((void *)chan_list, 0, 11UL); chan_list->header.type = 257U; chan_list->header.len = 7U; chan_list->chan_scan_param[0].chan_number = (bss_desc->bcn_ht_oper)->primary_chan; chan_list->chan_scan_param[0].radio_type = mwifiex_band_to_radio_type((int )((unsigned char )bss_desc->bss_band)); if (((int )sband->ht_cap.cap & 2) != 0 && ((int )(bss_desc->bcn_ht_oper)->ht_param & 4) != 0) { chan_list->chan_scan_param[0].radio_type = (u8 )((int )((signed char )chan_list->chan_scan_param[0].radio_type) | (int )((signed char )(((int )(bss_desc->bcn_ht_oper)->ht_param & 3) << 4))); } else { } *buffer = *buffer + 11UL; ret_len = (int )((unsigned int )ret_len + 11U); } else { } if ((unsigned long )bss_desc->bcn_bss_co_2040 != (unsigned long )((u8 *)0U)) { bss_co_2040 = (struct mwifiex_ie_types_2040bssco *)*buffer; memset((void *)bss_co_2040, 0, 5UL); bss_co_2040->header.type = 72U; bss_co_2040->header.len = 1U; memcpy((void *)bss_co_2040 + 4U, (void const *)bss_desc->bcn_bss_co_2040 + 2U, (size_t )bss_co_2040->header.len); *buffer = *buffer + 5UL; ret_len = (int )((unsigned int )ret_len + 5U); } else { } if ((unsigned long )bss_desc->bcn_ext_cap != (unsigned long )((u8 *)0U)) { hdr = (struct ieee_types_header *)bss_desc->bcn_ext_cap; ext_cap = (struct mwifiex_ie_types_extcap *)*buffer; memset((void *)ext_cap, 0, 4UL); ext_cap->header.type = 127U; ext_cap->header.len = (unsigned short )hdr->len; memcpy((void *)(& ext_cap->ext_capab), (void const *)bss_desc->bcn_ext_cap + 2U, (size_t )ext_cap->header.len); if ((unsigned int )hdr->len > 3U && (int )((signed char )ext_cap->ext_capab[3]) < 0) { priv->hs2_enabled = 1; } else { priv->hs2_enabled = 0; } *buffer = *buffer + ((unsigned long )hdr->len + 4UL); ret_len = (int )(((unsigned int )hdr->len + (unsigned int )ret_len) + 4U); } else { } return (ret_len); } } static int mwifiex_is_tx_ba_stream_ptr_valid(struct mwifiex_private *priv , struct mwifiex_tx_ba_stream_tbl *tx_tbl_ptr ) { struct mwifiex_tx_ba_stream_tbl *tx_ba_tsr_tbl ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; { __mptr = (struct list_head const *)priv->tx_ba_stream_tbl_ptr.next; tx_ba_tsr_tbl = (struct mwifiex_tx_ba_stream_tbl *)__mptr; goto ldv_61029; ldv_61028: ; if ((unsigned long )tx_ba_tsr_tbl == (unsigned long )tx_tbl_ptr) { return (1); } else { } __mptr___0 = (struct list_head const *)tx_ba_tsr_tbl->list.next; tx_ba_tsr_tbl = (struct mwifiex_tx_ba_stream_tbl *)__mptr___0; ldv_61029: ; if ((unsigned long )(& tx_ba_tsr_tbl->list) != (unsigned long )(& priv->tx_ba_stream_tbl_ptr)) { goto ldv_61028; } else { } return (0); } } void mwifiex_11n_delete_tx_ba_stream_tbl_entry(struct mwifiex_private *priv , struct mwifiex_tx_ba_stream_tbl *tx_ba_tsr_tbl ) { int tmp ; { if ((unsigned long )tx_ba_tsr_tbl == (unsigned long )((struct mwifiex_tx_ba_stream_tbl *)0)) { tmp = mwifiex_is_tx_ba_stream_ptr_valid(priv, tx_ba_tsr_tbl); if (tmp != 0) { return; } else { } } else { } if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: tx_ba_tsr_tbl %p\n", tx_ba_tsr_tbl); } else { } } else { } list_del(& tx_ba_tsr_tbl->list); kfree((void const *)tx_ba_tsr_tbl); return; } } void mwifiex_11n_delete_all_tx_ba_stream_tbl(struct mwifiex_private *priv ) { int i ; struct mwifiex_tx_ba_stream_tbl *del_tbl_ptr ; struct mwifiex_tx_ba_stream_tbl *tmp_node ; unsigned long flags ; raw_spinlock_t *tmp ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; { tmp = spinlock_check(& priv->tx_ba_stream_tbl_lock); flags = _raw_spin_lock_irqsave(tmp); __mptr = (struct list_head const *)priv->tx_ba_stream_tbl_ptr.next; del_tbl_ptr = (struct mwifiex_tx_ba_stream_tbl *)__mptr; __mptr___0 = (struct list_head const *)del_tbl_ptr->list.next; tmp_node = (struct mwifiex_tx_ba_stream_tbl *)__mptr___0; goto ldv_61052; ldv_61051: mwifiex_11n_delete_tx_ba_stream_tbl_entry(priv, del_tbl_ptr); del_tbl_ptr = tmp_node; __mptr___1 = (struct list_head const *)tmp_node->list.next; tmp_node = (struct mwifiex_tx_ba_stream_tbl *)__mptr___1; ldv_61052: ; if ((unsigned long )(& del_tbl_ptr->list) != (unsigned long )(& priv->tx_ba_stream_tbl_ptr)) { goto ldv_61051; } else { } spin_unlock_irqrestore(& priv->tx_ba_stream_tbl_lock, flags); INIT_LIST_HEAD(& priv->tx_ba_stream_tbl_ptr); i = 0; goto ldv_61055; ldv_61054: priv->aggr_prio_tbl[i].ampdu_ap = priv->aggr_prio_tbl[i].ampdu_user; i = i + 1; ldv_61055: ; if (i <= 7) { goto ldv_61054; } else { } return; } } struct mwifiex_tx_ba_stream_tbl *mwifiex_get_ba_tbl(struct mwifiex_private *priv , int tid , u8 *ra ) { struct mwifiex_tx_ba_stream_tbl *tx_ba_tsr_tbl ; unsigned long flags ; raw_spinlock_t *tmp ; struct list_head const *__mptr ; bool tmp___0 ; struct list_head const *__mptr___0 ; { tmp = spinlock_check(& priv->tx_ba_stream_tbl_lock); flags = _raw_spin_lock_irqsave(tmp); __mptr = (struct list_head const *)priv->tx_ba_stream_tbl_ptr.next; tx_ba_tsr_tbl = (struct mwifiex_tx_ba_stream_tbl *)__mptr; goto ldv_61072; ldv_61071: tmp___0 = ether_addr_equal_unaligned((u8 const *)(& tx_ba_tsr_tbl->ra), (u8 const *)ra); if ((int )tmp___0 && tx_ba_tsr_tbl->tid == tid) { spin_unlock_irqrestore(& priv->tx_ba_stream_tbl_lock, flags); return (tx_ba_tsr_tbl); } else { } __mptr___0 = (struct list_head const *)tx_ba_tsr_tbl->list.next; tx_ba_tsr_tbl = (struct mwifiex_tx_ba_stream_tbl *)__mptr___0; ldv_61072: ; if ((unsigned long )(& tx_ba_tsr_tbl->list) != (unsigned long )(& priv->tx_ba_stream_tbl_ptr)) { goto ldv_61071; } else { } spin_unlock_irqrestore(& priv->tx_ba_stream_tbl_lock, flags); return ((struct mwifiex_tx_ba_stream_tbl *)0); } } void mwifiex_create_ba_tbl(struct mwifiex_private *priv , u8 *ra , int tid , enum mwifiex_ba_status ba_status ) { struct mwifiex_tx_ba_stream_tbl *new_node ; struct mwifiex_ra_list_tbl *ra_list ; unsigned long flags ; int tid_down ; void *tmp ; u8 tmp___0 ; raw_spinlock_t *tmp___1 ; struct mwifiex_tx_ba_stream_tbl *tmp___2 ; { tmp___2 = mwifiex_get_ba_tbl(priv, tid, ra); if ((unsigned long )tmp___2 == (unsigned long )((struct mwifiex_tx_ba_stream_tbl *)0)) { tmp = kzalloc(40UL, 32U); new_node = (struct mwifiex_tx_ba_stream_tbl *)tmp; if ((unsigned long )new_node == (unsigned long )((struct mwifiex_tx_ba_stream_tbl *)0)) { return; } else { } tmp___0 = mwifiex_wmm_downgrade_tid(priv, (u32 )tid); tid_down = (int )tmp___0; ra_list = mwifiex_wmm_get_ralist_node(priv, (int )((u8 )tid_down), (u8 const *)ra); if ((unsigned long )ra_list != (unsigned long )((struct mwifiex_ra_list_tbl *)0)) { ra_list->ba_status = ba_status; ra_list->amsdu_in_ampdu = 0U; } else { } INIT_LIST_HEAD(& new_node->list); new_node->tid = tid; new_node->ba_status = ba_status; memcpy((void *)(& new_node->ra), (void const *)ra, 6UL); tmp___1 = spinlock_check(& priv->tx_ba_stream_tbl_lock); flags = _raw_spin_lock_irqsave(tmp___1); list_add_tail(& new_node->list, & priv->tx_ba_stream_tbl_ptr); spin_unlock_irqrestore(& priv->tx_ba_stream_tbl_lock, flags); } else { } return; } } int mwifiex_send_addba(struct mwifiex_private *priv , int tid , u8 *peer_mac ) { struct host_cmd_ds_11n_addba_req add_ba_req ; u32 tx_win_size ; u8 dialog_tok ; int ret ; unsigned long flags ; u16 block_ack_param_set ; struct mwifiex_sta_node *sta_ptr ; raw_spinlock_t *tmp ; int tmp___0 ; { tx_win_size = priv->add_ba_param.tx_win_size; if (((priv->adapter)->debug_mask & 16U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "cmd: %s: tid %d\n", "mwifiex_send_addba", tid); } else { } } else { } if ((((unsigned long )priv->bss_role & 1UL) == 0UL && ((unsigned long )(priv->adapter)->fw_cap_info & 16384UL) != 0UL) && (priv->adapter)->is_hw_11ac_capable != 0U) { tmp___0 = memcmp((void const *)(& priv->cfg_bssid), (void const *)peer_mac, 6UL); if (tmp___0 != 0) { tmp = spinlock_check(& priv->sta_list_spinlock); flags = _raw_spin_lock_irqsave(tmp); sta_ptr = mwifiex_get_sta_entry(priv, (u8 const *)peer_mac); if ((unsigned long )sta_ptr == (unsigned long )((struct mwifiex_sta_node *)0)) { spin_unlock_irqrestore(& priv->sta_list_spinlock, flags); if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "BA setup with unknown TDLS peer %pM!\n", peer_mac); } else { } } else { } return (-1); } else { } if ((unsigned int )sta_ptr->is_11ac_enabled != 0U) { tx_win_size = 64U; } else { } spin_unlock_irqrestore(& priv->sta_list_spinlock, flags); } else { } } else { } block_ack_param_set = (unsigned int )(((int )((unsigned short )tid) << 2U) | ((int )((unsigned short )tx_win_size) << 6U)) | 2U; if ((unsigned int )priv->add_ba_param.tx_amsdu != 0U && (unsigned int )priv->aggr_prio_tbl[tid].amsdu != 255U) { block_ack_param_set = (u16 )((unsigned int )block_ack_param_set | 1U); } else { } add_ba_req.block_ack_param_set = block_ack_param_set; add_ba_req.block_ack_tmo = (unsigned short )priv->add_ba_param.timeout; dialog_tok = (u8 )((int )dialog_tok + 1); if ((unsigned int )dialog_tok == 0U) { dialog_tok = 1U; } else { } add_ba_req.dialog_token = dialog_tok; memcpy((void *)(& add_ba_req.peer_mac_addr), (void const *)peer_mac, 6UL); ret = mwifiex_send_cmd(priv, 206, 0, 0U, (void *)(& add_ba_req), 0); return (ret); } } int mwifiex_send_delba(struct mwifiex_private *priv , int tid , u8 *peer_mac , int initiator ) { struct host_cmd_ds_11n_delba delba ; int ret ; uint16_t del_ba_param_set ; { memset((void *)(& delba), 0, 12UL); delba.del_ba_param_set = (int )((unsigned short )tid) << 12U; del_ba_param_set = delba.del_ba_param_set; if (initiator != 0) { del_ba_param_set = (uint16_t )((unsigned int )del_ba_param_set | 2048U); } else { del_ba_param_set = (unsigned int )del_ba_param_set & 63487U; } memcpy((void *)(& delba.peer_mac_addr), (void const *)peer_mac, 6UL); ret = mwifiex_send_cmd(priv, 208, 1, 0U, (void *)(& delba), 0); return (ret); } } void mwifiex_11n_delba(struct mwifiex_private *priv , int tid ) { struct mwifiex_rx_reorder_tbl *rx_reor_tbl_ptr ; struct _ddebug descriptor ; long tmp ; int tmp___0 ; struct list_head const *__mptr ; struct _ddebug descriptor___0 ; long tmp___1 ; struct list_head const *__mptr___0 ; { tmp___0 = list_empty((struct list_head const *)(& priv->rx_reorder_tbl_ptr)); if (tmp___0 != 0) { descriptor.modname = "mwifiex"; descriptor.function = "mwifiex_11n_delba"; descriptor.filename = "/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/11944/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/mwifiex/11n.c"; descriptor.format = "mwifiex_11n_delba: rx_reorder_tbl_ptr empty\n"; descriptor.lineno = 659U; descriptor.flags = 0U; tmp = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)(priv->adapter)->dev, "mwifiex_11n_delba: rx_reorder_tbl_ptr empty\n"); } else { } return; } else { } __mptr = (struct list_head const *)priv->rx_reorder_tbl_ptr.next; rx_reor_tbl_ptr = (struct mwifiex_rx_reorder_tbl *)__mptr; goto ldv_61125; ldv_61124: ; if (rx_reor_tbl_ptr->tid == tid) { descriptor___0.modname = "mwifiex"; descriptor___0.function = "mwifiex_11n_delba"; descriptor___0.filename = "/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/11944/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/mwifiex/11n.c"; descriptor___0.format = "Send delba to tid=%d, %pM\n"; descriptor___0.lineno = 667U; descriptor___0.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___1 != 0L) { __dynamic_dev_dbg(& descriptor___0, (struct device const *)(priv->adapter)->dev, "Send delba to tid=%d, %pM\n", tid, (u8 *)(& rx_reor_tbl_ptr->ta)); } else { } mwifiex_send_delba(priv, tid, (u8 *)(& rx_reor_tbl_ptr->ta), 0); return; } else { } __mptr___0 = (struct list_head const *)rx_reor_tbl_ptr->list.next; rx_reor_tbl_ptr = (struct mwifiex_rx_reorder_tbl *)__mptr___0; ldv_61125: ; if ((unsigned long )(& rx_reor_tbl_ptr->list) != (unsigned long )(& priv->rx_reorder_tbl_ptr)) { goto ldv_61124; } else { } return; } } void mwifiex_11n_delete_ba_stream(struct mwifiex_private *priv , u8 *del_ba ) { struct host_cmd_ds_11n_delba *cmd_del_ba ; uint16_t del_ba_param_set ; int tid ; { cmd_del_ba = (struct host_cmd_ds_11n_delba *)del_ba; del_ba_param_set = cmd_del_ba->del_ba_param_set; tid = (int )del_ba_param_set >> 12; mwifiex_del_ba_tbl(priv, tid, (u8 *)(& cmd_del_ba->peer_mac_addr), 2, (int )(((unsigned long )del_ba_param_set & 2048UL) >> 11)); return; } } int mwifiex_get_rx_reorder_tbl(struct mwifiex_private *priv , struct mwifiex_ds_rx_reorder_tbl *buf ) { int i ; struct mwifiex_ds_rx_reorder_tbl *rx_reo_tbl ; struct mwifiex_rx_reorder_tbl *rx_reorder_tbl_ptr ; int count ; unsigned long flags ; raw_spinlock_t *tmp ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; { rx_reo_tbl = buf; count = 0; tmp = spinlock_check(& priv->rx_reorder_tbl_lock); flags = _raw_spin_lock_irqsave(tmp); __mptr = (struct list_head const *)priv->rx_reorder_tbl_ptr.next; rx_reorder_tbl_ptr = (struct mwifiex_rx_reorder_tbl *)__mptr; goto ldv_61155; ldv_61154: rx_reo_tbl->tid = (unsigned short )rx_reorder_tbl_ptr->tid; memcpy((void *)(& rx_reo_tbl->ta), (void const *)(& rx_reorder_tbl_ptr->ta), 6UL); rx_reo_tbl->start_win = (u32 )rx_reorder_tbl_ptr->start_win; rx_reo_tbl->win_size = (u32 )rx_reorder_tbl_ptr->win_size; i = 0; goto ldv_61151; ldv_61150: ; if ((unsigned long )*(rx_reorder_tbl_ptr->rx_reorder_ptr + (unsigned long )i) != (unsigned long )((void *)0)) { rx_reo_tbl->buffer[i] = 1U; } else { rx_reo_tbl->buffer[i] = 0U; } i = i + 1; ldv_61151: ; if (rx_reorder_tbl_ptr->win_size > i) { goto ldv_61150; } else { } rx_reo_tbl = rx_reo_tbl + 1; count = count + 1; if (count > 15) { goto ldv_61153; } else { } __mptr___0 = (struct list_head const *)rx_reorder_tbl_ptr->list.next; rx_reorder_tbl_ptr = (struct mwifiex_rx_reorder_tbl *)__mptr___0; ldv_61155: ; if ((unsigned long )(& rx_reorder_tbl_ptr->list) != (unsigned long )(& priv->rx_reorder_tbl_ptr)) { goto ldv_61154; } else { } ldv_61153: spin_unlock_irqrestore(& priv->rx_reorder_tbl_lock, flags); return (count); } } int mwifiex_get_tx_ba_stream_tbl(struct mwifiex_private *priv , struct mwifiex_ds_tx_ba_stream_tbl *buf ) { struct mwifiex_tx_ba_stream_tbl *tx_ba_tsr_tbl ; struct mwifiex_ds_tx_ba_stream_tbl *rx_reo_tbl ; int count ; unsigned long flags ; raw_spinlock_t *tmp ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; { rx_reo_tbl = buf; count = 0; tmp = spinlock_check(& priv->tx_ba_stream_tbl_lock); flags = _raw_spin_lock_irqsave(tmp); __mptr = (struct list_head const *)priv->tx_ba_stream_tbl_ptr.next; tx_ba_tsr_tbl = (struct mwifiex_tx_ba_stream_tbl *)__mptr; goto ldv_61174; ldv_61173: rx_reo_tbl->tid = (unsigned short )tx_ba_tsr_tbl->tid; if (((priv->adapter)->debug_mask & 8U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "data: %s tid=%d\n", "mwifiex_get_tx_ba_stream_tbl", (int )rx_reo_tbl->tid); } else { } } else { } memcpy((void *)(& rx_reo_tbl->ra), (void const *)(& tx_ba_tsr_tbl->ra), 6UL); rx_reo_tbl->amsdu = tx_ba_tsr_tbl->amsdu; rx_reo_tbl = rx_reo_tbl + 1; count = count + 1; if (count > 1) { goto ldv_61172; } else { } __mptr___0 = (struct list_head const *)tx_ba_tsr_tbl->list.next; tx_ba_tsr_tbl = (struct mwifiex_tx_ba_stream_tbl *)__mptr___0; ldv_61174: ; if ((unsigned long )(& tx_ba_tsr_tbl->list) != (unsigned long )(& priv->tx_ba_stream_tbl_ptr)) { goto ldv_61173; } else { } ldv_61172: spin_unlock_irqrestore(& priv->tx_ba_stream_tbl_lock, flags); return (count); } } void mwifiex_del_tx_ba_stream_tbl_by_ra(struct mwifiex_private *priv , u8 *ra ) { struct mwifiex_tx_ba_stream_tbl *tbl ; struct mwifiex_tx_ba_stream_tbl *tmp ; unsigned long flags ; raw_spinlock_t *tmp___0 ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; raw_spinlock_t *tmp___1 ; int tmp___2 ; struct list_head const *__mptr___1 ; { if ((unsigned long )ra == (unsigned long )((u8 *)0U)) { return; } else { } tmp___0 = spinlock_check(& priv->tx_ba_stream_tbl_lock); flags = _raw_spin_lock_irqsave(tmp___0); __mptr = (struct list_head const *)priv->tx_ba_stream_tbl_ptr.next; tbl = (struct mwifiex_tx_ba_stream_tbl *)__mptr; __mptr___0 = (struct list_head const *)tbl->list.next; tmp = (struct mwifiex_tx_ba_stream_tbl *)__mptr___0; goto ldv_61195; ldv_61194: tmp___2 = memcmp((void const *)(& tbl->ra), (void const *)ra, 6UL); if (tmp___2 == 0) { spin_unlock_irqrestore(& priv->tx_ba_stream_tbl_lock, flags); mwifiex_11n_delete_tx_ba_stream_tbl_entry(priv, tbl); tmp___1 = spinlock_check(& priv->tx_ba_stream_tbl_lock); flags = _raw_spin_lock_irqsave(tmp___1); } else { } tbl = tmp; __mptr___1 = (struct list_head const *)tmp->list.next; tmp = (struct mwifiex_tx_ba_stream_tbl *)__mptr___1; ldv_61195: ; if ((unsigned long )(& tbl->list) != (unsigned long )(& priv->tx_ba_stream_tbl_ptr)) { goto ldv_61194; } else { } spin_unlock_irqrestore(& priv->tx_ba_stream_tbl_lock, flags); return; } } void mwifiex_set_ba_params(struct mwifiex_private *priv ) { { priv->add_ba_param.timeout = 65535U; if ((int )priv->bss_role & 1) { priv->add_ba_param.tx_win_size = 32U; priv->add_ba_param.rx_win_size = 16U; } else { priv->add_ba_param.tx_win_size = 64U; priv->add_ba_param.rx_win_size = 64U; } priv->add_ba_param.tx_amsdu = 1U; priv->add_ba_param.rx_amsdu = 1U; return; } } u8 mwifiex_get_sec_chan_offset(int chan ) { u8 sec_offset ; { switch (chan) { case 36: ; case 44: ; case 52: ; case 60: ; case 100: ; case 108: ; case 116: ; case 124: ; case 132: ; case 140: ; case 149: ; case 157: sec_offset = 1U; goto ldv_61216; case 40: ; case 48: ; case 56: ; case 64: ; case 104: ; case 112: ; case 120: ; case 128: ; case 136: ; case 144: ; case 153: ; case 161: sec_offset = 3U; goto ldv_61216; case 165: ; default: sec_offset = 0U; goto ldv_61216; } ldv_61216: ; return (sec_offset); } } static void mwifiex_send_delba_txbastream_tbl(struct mwifiex_private *priv , u8 tid ) { struct mwifiex_adapter *adapter ; struct mwifiex_tx_ba_stream_tbl *tx_ba_stream_tbl_ptr ; int tmp ; struct list_head const *__mptr ; struct _ddebug descriptor ; long tmp___0 ; struct list_head const *__mptr___0 ; { adapter = priv->adapter; tmp = list_empty((struct list_head const *)(& priv->tx_ba_stream_tbl_ptr)); if (tmp != 0) { return; } else { } __mptr = (struct list_head const *)priv->tx_ba_stream_tbl_ptr.next; tx_ba_stream_tbl_ptr = (struct mwifiex_tx_ba_stream_tbl *)__mptr; goto ldv_61244; ldv_61243: ; if ((unsigned int )tx_ba_stream_tbl_ptr->ba_status == 2U) { if ((int )tid == tx_ba_stream_tbl_ptr->tid) { descriptor.modname = "mwifiex"; descriptor.function = "mwifiex_send_delba_txbastream_tbl"; descriptor.filename = "/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/11944/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/mwifiex/11n.c"; descriptor.format = "Tx:Send delba to tid=%d, %pM\n"; descriptor.lineno = 865U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)adapter->dev, "Tx:Send delba to tid=%d, %pM\n", (int )tid, (u8 *)(& tx_ba_stream_tbl_ptr->ra)); } else { } mwifiex_send_delba(priv, tx_ba_stream_tbl_ptr->tid, (u8 *)(& tx_ba_stream_tbl_ptr->ra), 1); return; } else { } } else { } __mptr___0 = (struct list_head const *)tx_ba_stream_tbl_ptr->list.next; tx_ba_stream_tbl_ptr = (struct mwifiex_tx_ba_stream_tbl *)__mptr___0; ldv_61244: ; if ((unsigned long )(& tx_ba_stream_tbl_ptr->list) != (unsigned long )(& priv->tx_ba_stream_tbl_ptr)) { goto ldv_61243; } else { } return; } } void mwifiex_update_ampdu_txwinsize(struct mwifiex_adapter *adapter ) { u8 i ; u32 tx_win_size ; struct mwifiex_private *priv ; { i = 0U; goto ldv_61257; ldv_61256: ; if ((unsigned long )adapter->priv[(int )i] == (unsigned long )((struct mwifiex_private *)0)) { goto ldv_61252; } else { } priv = adapter->priv[(int )i]; tx_win_size = priv->add_ba_param.tx_win_size; if ((unsigned int )priv->bss_type == 0U) { priv->add_ba_param.tx_win_size = 64U; } else { } if ((unsigned int )priv->bss_type == 2U) { priv->add_ba_param.tx_win_size = 64U; } else { } if ((unsigned int )priv->bss_type == 1U) { priv->add_ba_param.tx_win_size = 32U; } else { } if ((unsigned int )adapter->coex_win_size != 0U) { if ((unsigned int )adapter->coex_tx_win_size != 0U) { priv->add_ba_param.tx_win_size = (u32 )adapter->coex_tx_win_size; } else { } } else { } if (priv->add_ba_param.tx_win_size != tx_win_size) { if ((unsigned int )priv->media_connected == 0U) { goto ldv_61252; } else { } i = 0U; goto ldv_61254; ldv_61253: mwifiex_send_delba_txbastream_tbl(priv, (int )i); i = (u8 )((int )i + 1); ldv_61254: ; if ((unsigned int )i <= 7U) { goto ldv_61253; } else { } } else { } ldv_61252: i = (u8 )((int )i + 1); ldv_61257: ; if ((int )adapter->priv_num > (int )i) { goto ldv_61256; } else { } return; } } bool ldv_queue_work_on_125(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_126(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_127(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_128(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_129(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_139(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_141(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_140(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_143(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_142(struct workqueue_struct *ldv_func_arg1 ) ; void mwifiex_set_11ac_ba_params(struct mwifiex_private *priv ) ; bool mwifiex_is_bss_in_11ac_mode(struct mwifiex_private *priv ) ; u8 mwifiex_get_center_freq_index(struct mwifiex_private *priv , u8 band , u32 pri_chan , u8 chan_bw ) ; int mwifiex_cmd_append_11ac_tlv(struct mwifiex_private *priv , struct mwifiex_bssdescriptor *bss_desc , u8 **buffer ) ; int mwifiex_cmd_11ac_cfg(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd , u16 cmd_action , struct mwifiex_11ac_vht_cfg *cfg ) ; void mwifiex_fill_vht_cap_tlv(struct mwifiex_private *priv , struct ieee80211_vht_cap *vht_cap , u8 bands ) ; static u16 const max_rate_lgi_80MHZ[8U][3U] = { { 292U, 351U, 390U}, { 585U, 702U, 780U}, { 877U, 1053U, 1170U}, { 1170U, 1404U, 1560U}, { 1462U, 1755U, 1950U}, { 1755U, 2106U, 0U}, { 2047U, 2457U, 2730U}, { 2340U, 2808U, 3120U}}; static u16 const max_rate_lgi_160MHZ[8U][3U] = { { 585U, 702U, 780U}, { 1170U, 1404U, 1560U}, { 1755U, 2106U, 0U}, { 2340U, 2808U, 3120U}, { 2925U, 3510U, 3900U}, { 3510U, 4212U, 4680U}, { 4095U, 4914U, 5460U}, { 4680U, 5616U, 6240U}}; static u16 mwifiex_convert_mcsmap_to_maxrate(struct mwifiex_private *priv , u8 bands , u16 mcs_map ) { u8 i ; u8 nss ; u8 mcs ; u16 max_rate ; u32 usr_vht_cap_info ; struct mwifiex_adapter *adapter ; { max_rate = 0U; usr_vht_cap_info = 0U; adapter = priv->adapter; if (((int )bands & 32) != 0) { usr_vht_cap_info = adapter->usr_dot_11ac_dev_cap_a; } else { usr_vht_cap_info = adapter->usr_dot_11ac_dev_cap_bg; } nss = 1U; i = 1U; goto ldv_60698; ldv_60697: mcs = (unsigned int )((u8 )((int )mcs_map >> ((int )i + -1) * 2)) & 3U; if ((unsigned int )mcs <= 2U) { nss = i; } else { } i = (u8 )((int )i + 1); ldv_60698: ; if ((unsigned int )i <= 8U) { goto ldv_60697; } else { } mcs = (unsigned int )((u8 )((int )mcs_map >> ((int )nss + -1) * 2)) & 3U; if ((unsigned int )mcs == 3U) { mcs = 2U; } else { } if (((usr_vht_cap_info >> 2) & 3U) != 0U) { max_rate = max_rate_lgi_160MHZ[(int )nss + -1][(int )mcs]; if ((unsigned int )max_rate == 0U) { max_rate = max_rate_lgi_160MHZ[(int )nss + -1][(int )mcs + -1]; } else { } } else { max_rate = max_rate_lgi_80MHZ[(int )nss + -1][(int )mcs]; if ((unsigned int )max_rate == 0U) { max_rate = max_rate_lgi_80MHZ[(int )nss + -1][(int )mcs + -1]; } else { } } return (max_rate); } } static void mwifiex_fill_vht_cap_info(struct mwifiex_private *priv , struct ieee80211_vht_cap *vht_cap , u8 bands ) { struct mwifiex_adapter *adapter ; { adapter = priv->adapter; if (((int )bands & 4) != 0) { vht_cap->vht_cap_info = adapter->usr_dot_11ac_dev_cap_a; } else { vht_cap->vht_cap_info = adapter->usr_dot_11ac_dev_cap_bg; } return; } } void mwifiex_fill_vht_cap_tlv(struct mwifiex_private *priv , struct ieee80211_vht_cap *vht_cap , u8 bands ) { struct mwifiex_adapter *adapter ; u16 mcs_map_user ; u16 mcs_map_resp ; u16 mcs_map_result ; u16 mcs_user ; u16 mcs_resp ; u16 nss ; u16 tmp ; u16 _min1 ; u16 _min2 ; u16 _min1___0 ; u16 _min2___0 ; { adapter = priv->adapter; mwifiex_fill_vht_cap_info(priv, vht_cap, (int )bands); mcs_map_user = (u16 )adapter->usr_dot_11ac_mcs_support; mcs_map_resp = vht_cap->supp_mcs.rx_mcs_map; mcs_map_result = 0U; nss = 1U; goto ldv_60723; ldv_60722: mcs_user = (unsigned int )((u16 )((int )mcs_map_user >> ((int )nss + -1) * 2)) & 3U; mcs_resp = (unsigned int )((u16 )((int )mcs_map_resp >> ((int )nss + -1) * 2)) & 3U; if ((unsigned int )mcs_user == 3U || (unsigned int )mcs_resp == 3U) { mcs_map_result = (u16 )((int )((short )(3 << ((int )nss + -1) * 2)) | (int )((short )mcs_map_result)); } else { _min1 = mcs_user; _min2 = mcs_resp; mcs_map_result = (u16 )((int )((short )((((int )_min1 < (int )_min2 ? _min1 : _min2) & 3) << ((int )nss + -1) * 2)) | (int )((short )mcs_map_result)); } nss = (u16 )((int )nss + 1); ldv_60723: ; if ((unsigned int )nss <= 8U) { goto ldv_60722; } else { } vht_cap->supp_mcs.rx_mcs_map = mcs_map_result; tmp = mwifiex_convert_mcsmap_to_maxrate(priv, (int )bands, (int )mcs_map_result); vht_cap->supp_mcs.rx_highest = tmp; mcs_map_user = (u16 )(adapter->usr_dot_11ac_mcs_support >> 16); mcs_map_resp = vht_cap->supp_mcs.tx_mcs_map; mcs_map_result = 0U; nss = 1U; goto ldv_60729; ldv_60728: mcs_user = (unsigned int )((u16 )((int )mcs_map_user >> ((int )nss + -1) * 2)) & 3U; mcs_resp = (unsigned int )((u16 )((int )mcs_map_resp >> ((int )nss + -1) * 2)) & 3U; if ((unsigned int )mcs_user == 3U || (unsigned int )mcs_resp == 3U) { mcs_map_result = (u16 )((int )((short )(3 << ((int )nss + -1) * 2)) | (int )((short )mcs_map_result)); } else { _min1___0 = mcs_user; _min2___0 = mcs_resp; mcs_map_result = (u16 )((int )((short )((((int )_min1___0 < (int )_min2___0 ? _min1___0 : _min2___0) & 3) << ((int )nss + -1) * 2)) | (int )((short )mcs_map_result)); } nss = (u16 )((int )nss + 1); ldv_60729: ; if ((unsigned int )nss <= 8U) { goto ldv_60728; } else { } vht_cap->supp_mcs.tx_mcs_map = mcs_map_result; tmp = mwifiex_convert_mcsmap_to_maxrate(priv, (int )bands, (int )mcs_map_result); vht_cap->supp_mcs.tx_highest = tmp; return; } } int mwifiex_cmd_append_11ac_tlv(struct mwifiex_private *priv , struct mwifiex_bssdescriptor *bss_desc , u8 **buffer ) { struct mwifiex_ie_types_vhtcap *vht_cap ; struct mwifiex_ie_types_oper_mode_ntf *oper_ntf ; struct ieee_types_oper_mode_ntf *ieee_oper_ntf ; struct mwifiex_ie_types_vht_oper *vht_op ; struct mwifiex_adapter *adapter ; u8 supp_chwd_set ; u32 usr_vht_cap_info ; int ret_len ; u8 __min1 ; u8 __min2 ; u8 __min1___0 ; u8 __min2___0 ; u8 __min1___1 ; u8 __min2___1 ; { adapter = priv->adapter; ret_len = 0; if (((int )bss_desc->bss_band & 4) != 0) { usr_vht_cap_info = adapter->usr_dot_11ac_dev_cap_a; } else { usr_vht_cap_info = adapter->usr_dot_11ac_dev_cap_bg; } if ((unsigned long )bss_desc->bcn_vht_cap != (unsigned long )((struct ieee80211_vht_cap *)0)) { vht_cap = (struct mwifiex_ie_types_vhtcap *)*buffer; memset((void *)vht_cap, 0, 16UL); vht_cap->header.type = 191U; vht_cap->header.len = 12U; memcpy((void *)vht_cap + 4U, (void const *)bss_desc->bcn_vht_cap, (size_t )vht_cap->header.len); mwifiex_fill_vht_cap_tlv(priv, & vht_cap->vht_cap, (int )((u8 )bss_desc->bss_band)); *buffer = *buffer + 16UL; ret_len = (int )((unsigned int )ret_len + 16U); } else { } if ((unsigned long )bss_desc->bcn_vht_oper != (unsigned long )((struct ieee80211_vht_operation *)0)) { if (priv->bss_mode == 2U) { vht_op = (struct mwifiex_ie_types_vht_oper *)*buffer; memset((void *)vht_op, 0, 9UL); vht_op->header.type = 192U; vht_op->header.len = 5U; memcpy((void *)vht_op + 4U, (void const *)bss_desc->bcn_vht_oper, (size_t )vht_op->header.len); supp_chwd_set = (unsigned int )((u8 )(usr_vht_cap_info >> 2)) & 3U; switch ((int )supp_chwd_set) { case 0: __min1 = 1U; __min2 = (bss_desc->bcn_vht_oper)->chan_width; vht_op->chan_width = (u8 )((int )__min1 < (int )__min2 ? __min1 : __min2); goto ldv_60748; case 1: __min1___0 = 2U; __min2___0 = (bss_desc->bcn_vht_oper)->chan_width; vht_op->chan_width = (u8 )((int )__min1___0 < (int )__min2___0 ? __min1___0 : __min2___0); goto ldv_60748; case 2: __min1___1 = 3U; __min2___1 = (bss_desc->bcn_vht_oper)->chan_width; vht_op->chan_width = (u8 )((int )__min1___1 < (int )__min2___1 ? __min1___1 : __min2___1); goto ldv_60748; default: vht_op->chan_width = 0U; goto ldv_60748; } ldv_60748: *buffer = *buffer + 9UL; ret_len = (int )((unsigned int )ret_len + 9U); } else { } } else { } if ((unsigned long )bss_desc->oper_mode != (unsigned long )((struct ieee_types_oper_mode_ntf *)0)) { ieee_oper_ntf = bss_desc->oper_mode; oper_ntf = (struct mwifiex_ie_types_oper_mode_ntf *)*buffer; memset((void *)oper_ntf, 0, 5UL); oper_ntf->header.type = 199U; oper_ntf->header.len = 1U; oper_ntf->oper_mode = ieee_oper_ntf->oper_mode; *buffer = *buffer + 5UL; ret_len = (int )((unsigned int )ret_len + 5U); } else { } return (ret_len); } } int mwifiex_cmd_11ac_cfg(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd , u16 cmd_action , struct mwifiex_11ac_vht_cfg *cfg ) { struct host_cmd_11ac_vht_cfg *vhtcfg ; { vhtcfg = & cmd->params.vht_cfg; cmd->command = 274U; cmd->size = 24U; vhtcfg->action = cmd_action; vhtcfg->band_config = cfg->band_config; vhtcfg->misc_config = cfg->misc_config; vhtcfg->cap_info = cfg->cap_info; vhtcfg->mcs_tx_set = cfg->mcs_tx_set; vhtcfg->mcs_rx_set = cfg->mcs_rx_set; return (0); } } void mwifiex_set_11ac_ba_params(struct mwifiex_private *priv ) { { priv->add_ba_param.timeout = 65535U; if ((int )priv->bss_role & 1) { priv->add_ba_param.tx_win_size = 64U; priv->add_ba_param.rx_win_size = 64U; } else { priv->add_ba_param.tx_win_size = 64U; priv->add_ba_param.rx_win_size = 64U; } return; } } bool mwifiex_is_bss_in_11ac_mode(struct mwifiex_private *priv ) { struct mwifiex_bssdescriptor *bss_desc ; struct ieee80211_vht_operation *vht_oper ; { bss_desc = & priv->curr_bss_params.bss_descriptor; vht_oper = bss_desc->bcn_vht_oper; if ((unsigned long )bss_desc->bcn_vht_cap == (unsigned long )((struct ieee80211_vht_cap *)0) || (unsigned long )vht_oper == (unsigned long )((struct ieee80211_vht_operation *)0)) { return (0); } else { } if ((unsigned int )vht_oper->chan_width == 0U) { return (0); } else { } return (1); } } u8 mwifiex_get_center_freq_index(struct mwifiex_private *priv , u8 band , u32 pri_chan , u8 chan_bw ) { u8 center_freq_idx ; { center_freq_idx = 0U; if (((int )band & 32) != 0) { switch (pri_chan) { case 36U: ; case 40U: ; case 44U: ; case 48U: ; if ((unsigned int )chan_bw == 1U) { center_freq_idx = 42U; } else { } goto ldv_60784; case 52U: ; case 56U: ; case 60U: ; case 64U: ; if ((unsigned int )chan_bw == 1U) { center_freq_idx = 58U; } else if ((unsigned int )chan_bw == 2U) { center_freq_idx = 50U; } else { } goto ldv_60784; case 100U: ; case 104U: ; case 108U: ; case 112U: ; if ((unsigned int )chan_bw == 1U) { center_freq_idx = 106U; } else { } goto ldv_60784; case 116U: ; case 120U: ; case 124U: ; case 128U: ; if ((unsigned int )chan_bw == 1U) { center_freq_idx = 122U; } else if ((unsigned int )chan_bw == 2U) { center_freq_idx = 114U; } else { } goto ldv_60784; case 132U: ; case 136U: ; case 140U: ; case 144U: ; if ((unsigned int )chan_bw == 1U) { center_freq_idx = 138U; } else { } goto ldv_60784; case 149U: ; case 153U: ; case 157U: ; case 161U: ; if ((unsigned int )chan_bw == 1U) { center_freq_idx = 155U; } else { } goto ldv_60784; default: center_freq_idx = 42U; } ldv_60784: ; } else { } return (center_freq_idx); } } bool ldv_queue_work_on_139(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_140(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_141(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_142(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_143(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; __inline static ktime_t ktime_set(s64 const secs , unsigned long const nsecs ) { ktime_t __constr_expr_0 ; long tmp ; ktime_t __constr_expr_1 ; { tmp = ldv__builtin_expect((long long )secs > 9223372035LL, 0L); if (tmp != 0L) { __constr_expr_0.tv64 = 9223372036854775807LL; return (__constr_expr_0); } else { } __constr_expr_1.tv64 = (long long )secs * 1000000000LL + (long long )nsecs; return (__constr_expr_1); } } __inline static ktime_t timeval_to_ktime(struct timeval tv ) { ktime_t tmp ; { tmp = ktime_set((s64 const )tv.tv_sec, (unsigned long const )(tv.tv_usec * 1000L)); return (tmp); } } bool ldv_queue_work_on_153(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_155(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_154(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_157(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_156(struct workqueue_struct *ldv_func_arg1 ) ; __inline static bool skb_is_nonlinear(struct sk_buff const *skb ) { { return ((unsigned int )skb->data_len != 0U); } } __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)); } } u8 mwifiex_check_last_packet_indication(struct mwifiex_private *priv ) ; static int mwifiex_11n_form_amsdu_pkt(struct sk_buff *skb_aggr , struct sk_buff *skb_src , int *pad ) { int dt_offset ; struct rfc_1042_hdr snap ; struct tx_packet_hdr *tx_header ; unsigned char *tmp ; __u16 tmp___0 ; unsigned char *tmp___1 ; { snap.llc_dsap = 170U; snap.llc_ssap = 170U; snap.llc_ctrl = 3U; snap.snap_oui[0] = 0U; snap.snap_oui[1] = 0U; snap.snap_oui[2] = 0U; snap.snap_type = 0U; tmp = skb_put(skb_aggr, 22U); tx_header = (struct tx_packet_hdr *)tmp; dt_offset = 12; memcpy((void *)(& tx_header->eth803_hdr), (void const *)skb_src->data, (size_t )dt_offset); snap.snap_type = ((struct ethhdr *)skb_src->data)->h_proto; dt_offset = (int )((unsigned int )dt_offset + 2U); memcpy((void *)(& tx_header->rfc1042_hdr), (void const *)(& snap), 8UL); skb_pull(skb_src, (unsigned int )dt_offset); tmp___0 = __fswab16((int )((unsigned int )((__u16 )skb_src->len) + 8U)); tx_header->eth803_hdr.h_proto = tmp___0; tmp___1 = skb_put(skb_aggr, skb_src->len); memcpy((void *)tmp___1, (void const *)skb_src->data, (size_t )skb_src->len); *pad = (int )(- skb_aggr->tail) & 3; return ((int )(skb_aggr->len + (unsigned int )*pad)); } } static void mwifiex_11n_form_amsdu_txpd(struct mwifiex_private *priv , struct sk_buff *skb ) { struct txpd *local_tx_pd ; struct mwifiex_txinfo *tx_info ; struct mwifiex_txinfo *tmp ; unsigned int pad ; int headroom ; u8 tmp___0 ; { tmp = MWIFIEX_SKB_TXCB(skb); tx_info = tmp; headroom = (unsigned int )(priv->adapter)->iface_type == 2U ? 0 : 4; pad = (unsigned int )((long )((void *)skb->data + (0xffffffffffffffecUL - (unsigned long )headroom))) & 63U; skb_push(skb, pad); skb_push(skb, 20U); local_tx_pd = (struct txpd *)skb->data; memset((void *)local_tx_pd, 0, 20UL); local_tx_pd->priority = (unsigned char )skb->priority; local_tx_pd->pkt_delay_2ms = mwifiex_wmm_compute_drv_pkt_delay(priv, (struct sk_buff const *)skb); local_tx_pd->bss_num = priv->bss_num; local_tx_pd->bss_type = priv->bss_type; local_tx_pd->tx_pkt_offset = (unsigned int )((unsigned short )pad) + 20U; local_tx_pd->tx_pkt_type = 230U; local_tx_pd->tx_pkt_length = (unsigned int )((int )((unsigned short )skb->len) - (int )((unsigned short )pad)) - 20U; if (((unsigned long )tx_info->flags & 4UL) != 0UL) { local_tx_pd->flags = (u8 )((unsigned int )local_tx_pd->flags | 16U); } else { } if (local_tx_pd->tx_control == 0U) { local_tx_pd->tx_control = priv->pkt_tx_ctrl; } else { } if (((unsigned long )priv->bss_role & 1UL) == 0UL && (unsigned int )(priv->adapter)->pps_uapsd_mode != 0U) { tmp___0 = mwifiex_check_last_packet_indication(priv); if ((unsigned int )tmp___0 == 1U) { (priv->adapter)->tx_lock_flag = 1U; local_tx_pd->flags = 8U; } else { } } else { } return; } } int mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv , struct mwifiex_ra_list_tbl *pra_list , int ptrindex , unsigned long ra_list_flags ) { struct mwifiex_adapter *adapter ; struct sk_buff *skb_aggr ; struct sk_buff *skb_src ; struct mwifiex_txinfo *tx_info_aggr ; struct mwifiex_txinfo *tx_info_src ; int pad ; int aggr_num ; int ret ; struct mwifiex_tx_param tx_param ; struct txpd *ptx_pd ; struct timeval tv ; int headroom ; void *tmp ; int tmp___0 ; raw_spinlock_t *tmp___1 ; int tmp___2 ; int tmp___3 ; raw_spinlock_t *tmp___4 ; int tmp___5 ; { adapter = priv->adapter; pad = 0; aggr_num = 0; ptx_pd = (struct txpd *)0; headroom = (unsigned int )adapter->iface_type == 2U ? 0 : 4; skb_src = skb_peek((struct sk_buff_head const *)(& pra_list->skb_head)); if ((unsigned long )skb_src == (unsigned long )((struct sk_buff *)0)) { spin_unlock_irqrestore(& priv->wmm.ra_list_spinlock, ra_list_flags); return (0); } else { } tx_info_src = MWIFIEX_SKB_TXCB(skb_src); tmp = mwifiex_alloc_dma_align_buf((int )adapter->tx_buf_size, 33U); skb_aggr = (struct sk_buff *)tmp; if ((unsigned long )skb_aggr == (unsigned long )((struct sk_buff *)0)) { spin_unlock_irqrestore(& priv->wmm.ra_list_spinlock, ra_list_flags); return (-1); } else { } skb_reserve(skb_aggr, 100); tx_info_aggr = MWIFIEX_SKB_TXCB(skb_aggr); memset((void *)tx_info_aggr, 0, 24UL); tx_info_aggr->bss_type = tx_info_src->bss_type; tx_info_aggr->bss_num = tx_info_src->bss_num; if (((unsigned long )tx_info_src->flags & 4UL) != 0UL) { tx_info_aggr->flags = (u8 )((unsigned int )tx_info_aggr->flags | 4U); } else { } tx_info_aggr->flags = (u8 )((unsigned int )tx_info_aggr->flags | 32U); skb_aggr->priority = skb_src->priority; do_gettimeofday(& tv); skb_aggr->__annonCompField68.__annonCompField67.__annonCompField66.tstamp = timeval_to_ktime(tv); ldv_60967: tmp___0 = skb_tailroom((struct sk_buff const *)skb_aggr); if ((unsigned int )tmp___0 < skb_src->len + 8U) { goto ldv_60963; } else { } skb_src = skb_dequeue(& pra_list->skb_head); pra_list->total_pkt_count = (u16 )((int )pra_list->total_pkt_count - 1); atomic_dec(& priv->wmm.tx_pkts_queued); aggr_num = aggr_num + 1; spin_unlock_irqrestore(& priv->wmm.ra_list_spinlock, ra_list_flags); mwifiex_11n_form_amsdu_pkt(skb_aggr, skb_src, & pad); mwifiex_write_data_complete(adapter, skb_src, 0, 0); tmp___1 = spinlock_check(& priv->wmm.ra_list_spinlock); ra_list_flags = _raw_spin_lock_irqsave(tmp___1); tmp___2 = mwifiex_is_ralist_valid(priv, pra_list, ptrindex); if (tmp___2 == 0) { spin_unlock_irqrestore(& priv->wmm.ra_list_spinlock, ra_list_flags); return (-1); } else { } tmp___3 = skb_tailroom((struct sk_buff const *)skb_aggr); if (tmp___3 < pad) { pad = 0; goto ldv_60963; } else { } skb_put(skb_aggr, (unsigned int )pad); skb_src = skb_peek((struct sk_buff_head const *)(& pra_list->skb_head)); if ((unsigned long )skb_src != (unsigned long )((struct sk_buff *)0)) { goto ldv_60967; } else { } ldv_60963: spin_unlock_irqrestore(& priv->wmm.ra_list_spinlock, ra_list_flags); skb_trim(skb_aggr, skb_aggr->len - (unsigned int )pad); mwifiex_11n_form_amsdu_txpd(priv, skb_aggr); if (((unsigned long )priv->bss_role & 1UL) == 0UL) { ptx_pd = (struct txpd *)skb_aggr->data; } else { } skb_push(skb_aggr, (unsigned int )headroom); tx_info_aggr->aggr_num = (unsigned int )((u8 )aggr_num) * 2U; if ((unsigned int )adapter->data_sent != 0U || (unsigned int )adapter->tx_lock_flag != 0U) { atomic_add(aggr_num * 2, & adapter->tx_queued); skb_queue_tail(& adapter->tx_data_q, skb_aggr); return (0); } else { } if ((unsigned int )adapter->iface_type == 2U) { adapter->data_sent = 1U; ret = (*(adapter->if_ops.host_to_card))(adapter, 2, skb_aggr, (struct mwifiex_tx_param *)0); } else { if ((unsigned long )skb_src != (unsigned long )((struct sk_buff *)0)) { tx_param.next_pkt_len = skb_src->len + 20U; } else { tx_param.next_pkt_len = 0U; } ret = (*(adapter->if_ops.host_to_card))(adapter, 0, skb_aggr, & tx_param); } switch (ret) { case -16: tmp___4 = spinlock_check(& priv->wmm.ra_list_spinlock); ra_list_flags = _raw_spin_lock_irqsave(tmp___4); tmp___5 = mwifiex_is_ralist_valid(priv, pra_list, ptrindex); if (tmp___5 == 0) { spin_unlock_irqrestore(& priv->wmm.ra_list_spinlock, ra_list_flags); mwifiex_write_data_complete(adapter, skb_aggr, 1, -1); return (-1); } else { } if ((((unsigned long )priv->bss_role & 1UL) == 0UL && (unsigned int )adapter->pps_uapsd_mode != 0U) && (unsigned int )adapter->tx_lock_flag != 0U) { (priv->adapter)->tx_lock_flag = 0U; if ((unsigned long )ptx_pd != (unsigned long )((struct txpd *)0)) { ptx_pd->flags = 0U; } else { } } else { } skb_queue_tail(& pra_list->skb_head, skb_aggr); pra_list->total_pkt_count = (u16 )((int )pra_list->total_pkt_count + 1); atomic_inc(& priv->wmm.tx_pkts_queued); tx_info_aggr->flags = (u8 )((unsigned int )tx_info_aggr->flags | 1U); spin_unlock_irqrestore(& priv->wmm.ra_list_spinlock, ra_list_flags); if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "data: -EBUSY is returned\n"); } else { } } else { } goto ldv_60972; case -1: ; if ((unsigned int )adapter->iface_type != 1U) { adapter->data_sent = 0U; } else { } if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "%s: host_to_card failed: %#x\n", "mwifiex_11n_aggregate_pkt", ret); } else { } } else { } adapter->dbg.num_tx_host_to_card_failure = adapter->dbg.num_tx_host_to_card_failure + 1U; mwifiex_write_data_complete(adapter, skb_aggr, 1, ret); return (0); case -115: ; if ((unsigned int )adapter->iface_type != 1U) { adapter->data_sent = 0U; } else { } goto ldv_60972; case 0: mwifiex_write_data_complete(adapter, skb_aggr, 1, ret); goto ldv_60972; default: ; goto ldv_60972; } ldv_60972: ; if (ret != -16) { mwifiex_rotate_priolists(priv, pra_list, ptrindex); } else { } return (0); } } bool ldv_queue_work_on_153(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_154(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_155(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_156(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_157(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; int ldv_mod_timer_174(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_167(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_169(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_168(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_171(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_170(struct workqueue_struct *ldv_func_arg1 ) ; void ldv_flush_workqueue_172(struct workqueue_struct *ldv_func_arg1 ) ; void ldv_timer_7(int state , struct timer_list *timer ) ; void choose_timer_7(void) ; void activate_suitable_timer_7(struct timer_list *timer , unsigned long data ) ; __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); } } extern void ieee80211_amsdu_to_8023s(struct sk_buff * , struct sk_buff_head * , u8 const * , enum nl80211_iftype , unsigned int const , bool ) ; int mwifiex_process_rx_packet(struct mwifiex_private *priv , struct sk_buff *skb ) ; int mwifiex_handle_uap_rx_forward(struct mwifiex_private *priv , struct sk_buff *skb ) ; void mwifiex_coex_ampdu_rxwinsize(struct mwifiex_adapter *adapter ) ; int mwifiex_11n_rx_reorder_pkt(struct mwifiex_private *priv , u16 seq_num , u16 tid , u8 *ta , u8 pkt_type , void *payload ) ; void mwifiex_11n_ba_stream_timeout(struct mwifiex_private *priv , struct host_cmd_ds_11n_batimeout *event ) ; int mwifiex_ret_11n_addba_resp(struct mwifiex_private *priv , struct host_cmd_ds_command *resp ) ; int mwifiex_cmd_11n_delba(struct host_cmd_ds_command *cmd , void *data_buf ) ; int mwifiex_cmd_11n_addba_rsp_gen(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd , struct host_cmd_ds_11n_addba_req *cmd_addba_req ) ; int mwifiex_cmd_11n_addba_req(struct host_cmd_ds_command *cmd , void *data_buf ) ; struct mwifiex_rx_reorder_tbl *mwifiex_11n_get_rx_reorder_tbl(struct mwifiex_private *priv , int tid , u8 *ta ) ; void mwifiex_11n_del_rx_reorder_tbl_by_ta(struct mwifiex_private *priv , u8 *ta ) ; static int mwifiex_11n_dispatch_amsdu_pkt(struct mwifiex_private *priv , struct sk_buff *skb ) { struct rxpd *local_rx_pd ; int ret ; struct sk_buff_head list ; struct sk_buff *rx_skb ; int tmp ; { local_rx_pd = (struct rxpd *)skb->data; if ((unsigned int )local_rx_pd->rx_pkt_type == 230U) { __skb_queue_head_init(& list); skb_pull(skb, (unsigned int )local_rx_pd->rx_pkt_offset); skb_trim(skb, (unsigned int )local_rx_pd->rx_pkt_length); ieee80211_amsdu_to_8023s(skb, & list, (u8 const *)(& priv->curr_addr), priv->wdev.iftype, 0U, 0); goto ldv_60952; ldv_60951: rx_skb = __skb_dequeue(& list); ret = mwifiex_recv_packet(priv, rx_skb); if (ret == -1) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Rx of A-MSDU failed"); } else { } } else { } } else { } ldv_60952: tmp = skb_queue_empty((struct sk_buff_head const *)(& list)); if (tmp == 0) { goto ldv_60951; } else { } return (0); } else { } return (-1); } } static int mwifiex_11n_dispatch_pkt(struct mwifiex_private *priv , void *payload ) { int ret ; int tmp ; int tmp___0 ; int tmp___1 ; { tmp = mwifiex_11n_dispatch_amsdu_pkt(priv, (struct sk_buff *)payload); ret = tmp; if (ret == 0) { return (0); } else { } if ((unsigned int )priv->bss_role == 1U) { tmp___0 = mwifiex_handle_uap_rx_forward(priv, (struct sk_buff *)payload); return (tmp___0); } else { } tmp___1 = mwifiex_process_rx_packet(priv, (struct sk_buff *)payload); return (tmp___1); } } static void mwifiex_11n_dispatch_pkt_until_start_win(struct mwifiex_private *priv , struct mwifiex_rx_reorder_tbl *tbl , int start_win ) { int pkt_to_send ; int i ; void *rx_tmp_ptr ; unsigned long flags ; int _min1 ; int _min2 ; raw_spinlock_t *tmp ; raw_spinlock_t *tmp___0 ; { if (tbl->start_win < start_win) { _min1 = start_win - tbl->start_win; _min2 = tbl->win_size; pkt_to_send = _min1 < _min2 ? _min1 : _min2; } else { pkt_to_send = tbl->win_size; } i = 0; goto ldv_60975; ldv_60974: tmp = spinlock_check(& priv->rx_pkt_lock); flags = _raw_spin_lock_irqsave(tmp); rx_tmp_ptr = (void *)0; if ((unsigned long )*(tbl->rx_reorder_ptr + (unsigned long )i) != (unsigned long )((void *)0)) { rx_tmp_ptr = *(tbl->rx_reorder_ptr + (unsigned long )i); *(tbl->rx_reorder_ptr + (unsigned long )i) = (void *)0; } else { } spin_unlock_irqrestore(& priv->rx_pkt_lock, flags); if ((unsigned long )rx_tmp_ptr != (unsigned long )((void *)0)) { mwifiex_11n_dispatch_pkt(priv, rx_tmp_ptr); } else { } i = i + 1; ldv_60975: ; if (i < pkt_to_send) { goto ldv_60974; } else { } tmp___0 = spinlock_check(& priv->rx_pkt_lock); flags = _raw_spin_lock_irqsave(tmp___0); i = 0; goto ldv_60981; ldv_60980: *(tbl->rx_reorder_ptr + (unsigned long )i) = *(tbl->rx_reorder_ptr + (unsigned long )(pkt_to_send + i)); *(tbl->rx_reorder_ptr + (unsigned long )(pkt_to_send + i)) = (void *)0; i = i + 1; ldv_60981: ; if (tbl->win_size - pkt_to_send > i) { goto ldv_60980; } else { } tbl->start_win = start_win; spin_unlock_irqrestore(& priv->rx_pkt_lock, flags); return; } } static void mwifiex_11n_scan_and_dispatch(struct mwifiex_private *priv , struct mwifiex_rx_reorder_tbl *tbl ) { int i ; int j ; int xchg ; void *rx_tmp_ptr ; unsigned long flags ; raw_spinlock_t *tmp ; raw_spinlock_t *tmp___0 ; { i = 0; goto ldv_60997; ldv_60996: tmp = spinlock_check(& priv->rx_pkt_lock); flags = _raw_spin_lock_irqsave(tmp); if ((unsigned long )*(tbl->rx_reorder_ptr + (unsigned long )i) == (unsigned long )((void *)0)) { spin_unlock_irqrestore(& priv->rx_pkt_lock, flags); goto ldv_60995; } else { } rx_tmp_ptr = *(tbl->rx_reorder_ptr + (unsigned long )i); *(tbl->rx_reorder_ptr + (unsigned long )i) = (void *)0; spin_unlock_irqrestore(& priv->rx_pkt_lock, flags); mwifiex_11n_dispatch_pkt(priv, rx_tmp_ptr); i = i + 1; ldv_60997: ; if (tbl->win_size > i) { goto ldv_60996; } else { } ldv_60995: tmp___0 = spinlock_check(& priv->rx_pkt_lock); flags = _raw_spin_lock_irqsave(tmp___0); if (i > 0) { xchg = tbl->win_size - i; j = 0; goto ldv_61002; ldv_61001: *(tbl->rx_reorder_ptr + (unsigned long )j) = *(tbl->rx_reorder_ptr + (unsigned long )(i + j)); *(tbl->rx_reorder_ptr + (unsigned long )(i + j)) = (void *)0; j = j + 1; ldv_61002: ; if (j < xchg) { goto ldv_61001; } else { } } else { } tbl->start_win = (tbl->start_win + i) & 4095; spin_unlock_irqrestore(& priv->rx_pkt_lock, flags); return; } } static void mwifiex_del_rx_reorder_entry(struct mwifiex_private *priv , struct mwifiex_rx_reorder_tbl *tbl ) { unsigned long flags ; int start_win ; raw_spinlock_t *tmp ; raw_spinlock_t *tmp___0 ; raw_spinlock_t *tmp___1 ; { if ((unsigned long )tbl == (unsigned long )((struct mwifiex_rx_reorder_tbl *)0)) { return; } else { } tmp = spinlock_check(& (priv->adapter)->rx_proc_lock); flags = _raw_spin_lock_irqsave(tmp); (priv->adapter)->rx_locked = 1; if ((int )(priv->adapter)->rx_processing) { spin_unlock_irqrestore(& (priv->adapter)->rx_proc_lock, flags); ldv_flush_workqueue_172((priv->adapter)->rx_workqueue); } else { spin_unlock_irqrestore(& (priv->adapter)->rx_proc_lock, flags); } start_win = (tbl->start_win + tbl->win_size) & 4095; mwifiex_11n_dispatch_pkt_until_start_win(priv, tbl, start_win); ldv_del_timer_sync_173(& tbl->timer_context.timer); tbl->timer_context.timer_is_set = 0U; tmp___0 = spinlock_check(& priv->rx_reorder_tbl_lock); flags = _raw_spin_lock_irqsave(tmp___0); list_del(& tbl->list); spin_unlock_irqrestore(& priv->rx_reorder_tbl_lock, flags); kfree((void const *)tbl->rx_reorder_ptr); kfree((void const *)tbl); tmp___1 = spinlock_check(& (priv->adapter)->rx_proc_lock); flags = _raw_spin_lock_irqsave(tmp___1); (priv->adapter)->rx_locked = 0; spin_unlock_irqrestore(& (priv->adapter)->rx_proc_lock, flags); return; } } struct mwifiex_rx_reorder_tbl *mwifiex_11n_get_rx_reorder_tbl(struct mwifiex_private *priv , int tid , u8 *ta ) { struct mwifiex_rx_reorder_tbl *tbl ; unsigned long flags ; raw_spinlock_t *tmp ; struct list_head const *__mptr ; int tmp___0 ; struct list_head const *__mptr___0 ; { tmp = spinlock_check(& priv->rx_reorder_tbl_lock); flags = _raw_spin_lock_irqsave(tmp); __mptr = (struct list_head const *)priv->rx_reorder_tbl_ptr.next; tbl = (struct mwifiex_rx_reorder_tbl *)__mptr; goto ldv_61034; ldv_61033: tmp___0 = memcmp((void const *)(& tbl->ta), (void const *)ta, 6UL); if (tmp___0 == 0 && tbl->tid == tid) { spin_unlock_irqrestore(& priv->rx_reorder_tbl_lock, flags); return (tbl); } else { } __mptr___0 = (struct list_head const *)tbl->list.next; tbl = (struct mwifiex_rx_reorder_tbl *)__mptr___0; ldv_61034: ; if ((unsigned long )(& tbl->list) != (unsigned long )(& priv->rx_reorder_tbl_ptr)) { goto ldv_61033; } else { } spin_unlock_irqrestore(& priv->rx_reorder_tbl_lock, flags); return ((struct mwifiex_rx_reorder_tbl *)0); } } void mwifiex_11n_del_rx_reorder_tbl_by_ta(struct mwifiex_private *priv , u8 *ta ) { struct mwifiex_rx_reorder_tbl *tbl ; struct mwifiex_rx_reorder_tbl *tmp ; unsigned long flags ; raw_spinlock_t *tmp___0 ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; raw_spinlock_t *tmp___1 ; int tmp___2 ; struct list_head const *__mptr___1 ; { if ((unsigned long )ta == (unsigned long )((u8 *)0U)) { return; } else { } tmp___0 = spinlock_check(& priv->rx_reorder_tbl_lock); flags = _raw_spin_lock_irqsave(tmp___0); __mptr = (struct list_head const *)priv->rx_reorder_tbl_ptr.next; tbl = (struct mwifiex_rx_reorder_tbl *)__mptr; __mptr___0 = (struct list_head const *)tbl->list.next; tmp = (struct mwifiex_rx_reorder_tbl *)__mptr___0; goto ldv_61056; ldv_61055: tmp___2 = memcmp((void const *)(& tbl->ta), (void const *)ta, 6UL); if (tmp___2 == 0) { spin_unlock_irqrestore(& priv->rx_reorder_tbl_lock, flags); mwifiex_del_rx_reorder_entry(priv, tbl); tmp___1 = spinlock_check(& priv->rx_reorder_tbl_lock); flags = _raw_spin_lock_irqsave(tmp___1); } else { } tbl = tmp; __mptr___1 = (struct list_head const *)tmp->list.next; tmp = (struct mwifiex_rx_reorder_tbl *)__mptr___1; ldv_61056: ; if ((unsigned long )(& tbl->list) != (unsigned long )(& priv->rx_reorder_tbl_ptr)) { goto ldv_61055; } else { } spin_unlock_irqrestore(& priv->rx_reorder_tbl_lock, flags); return; } } static int mwifiex_11n_find_last_seq_num(struct reorder_tmr_cnxt *ctx ) { struct mwifiex_rx_reorder_tbl *rx_reorder_tbl_ptr ; struct mwifiex_private *priv ; unsigned long flags ; int i ; raw_spinlock_t *tmp ; { rx_reorder_tbl_ptr = ctx->ptr; priv = ctx->priv; tmp = spinlock_check(& priv->rx_reorder_tbl_lock); flags = _raw_spin_lock_irqsave(tmp); i = rx_reorder_tbl_ptr->win_size + -1; goto ldv_61069; ldv_61068: ; if ((unsigned long )*(rx_reorder_tbl_ptr->rx_reorder_ptr + (unsigned long )i) != (unsigned long )((void *)0)) { spin_unlock_irqrestore(& priv->rx_reorder_tbl_lock, flags); return (i); } else { } i = i - 1; ldv_61069: ; if (i >= 0) { goto ldv_61068; } else { } spin_unlock_irqrestore(& priv->rx_reorder_tbl_lock, flags); return (-1); } } static void mwifiex_flush_data(unsigned long context ) { struct reorder_tmr_cnxt *ctx ; int start_win ; int seq_num ; { ctx = (struct reorder_tmr_cnxt *)context; ctx->timer_is_set = 0U; seq_num = mwifiex_11n_find_last_seq_num(ctx); if (seq_num < 0) { return; } else { } if ((((ctx->priv)->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )((ctx->priv)->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)((ctx->priv)->adapter)->dev, "info: flush data %d\n", seq_num); } else { } } else { } start_win = (((ctx->ptr)->start_win + seq_num) + 1) & 4095; mwifiex_11n_dispatch_pkt_until_start_win(ctx->priv, ctx->ptr, start_win); return; } } static void mwifiex_11n_create_rx_reorder_tbl(struct mwifiex_private *priv , u8 *ta , int tid , int win_size , int seq_num ) { int i ; struct mwifiex_rx_reorder_tbl *tbl ; struct mwifiex_rx_reorder_tbl *new_node ; u16 last_seq ; unsigned long flags ; struct mwifiex_sta_node *node ; void *tmp ; raw_spinlock_t *tmp___0 ; u8 tmp___1 ; void *tmp___2 ; raw_spinlock_t *tmp___3 ; { last_seq = 0U; tbl = mwifiex_11n_get_rx_reorder_tbl(priv, tid, ta); if ((unsigned long )tbl != (unsigned long )((struct mwifiex_rx_reorder_tbl *)0)) { mwifiex_11n_dispatch_pkt_until_start_win(priv, tbl, seq_num); return; } else { } tmp = kzalloc(208UL, 208U); new_node = (struct mwifiex_rx_reorder_tbl *)tmp; if ((unsigned long )new_node == (unsigned long )((struct mwifiex_rx_reorder_tbl *)0)) { return; } else { } INIT_LIST_HEAD(& new_node->list); new_node->tid = tid; memcpy((void *)(& new_node->ta), (void const *)ta, 6UL); new_node->start_win = seq_num; new_node->init_win = seq_num; new_node->flags = 0U; tmp___0 = spinlock_check(& priv->sta_list_spinlock); flags = _raw_spin_lock_irqsave(tmp___0); tmp___1 = mwifiex_queuing_ra_based(priv); if ((unsigned int )tmp___1 != 0U) { if ((unsigned int )priv->bss_role == 1U) { node = mwifiex_get_sta_entry(priv, (u8 const *)ta); if ((unsigned long )node != (unsigned long )((struct mwifiex_sta_node *)0)) { last_seq = node->rx_seq[tid]; } else { } } else { } } else { node = mwifiex_get_sta_entry(priv, (u8 const *)ta); if ((unsigned long )node != (unsigned long )((struct mwifiex_sta_node *)0)) { last_seq = node->rx_seq[tid]; } else { last_seq = priv->rx_seq[tid]; } } spin_unlock_irqrestore(& priv->sta_list_spinlock, flags); if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: last_seq=%d start_win=%d\n", (int )last_seq, new_node->start_win); } else { } } else { } if ((unsigned int )last_seq != 65535U && (int )last_seq >= new_node->start_win) { new_node->start_win = (int )last_seq + 1; new_node->flags = (u8 )((unsigned int )new_node->flags | 2U); } else { } new_node->win_size = win_size; tmp___2 = kzalloc((unsigned long )win_size * 8UL, 208U); new_node->rx_reorder_ptr = (void **)tmp___2; if ((unsigned long )new_node->rx_reorder_ptr == (unsigned long )((void **)0)) { kfree((void const *)new_node); if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "%s: failed to alloc reorder_ptr\n", "mwifiex_11n_create_rx_reorder_tbl"); } else { } } else { } return; } else { } new_node->timer_context.ptr = new_node; new_node->timer_context.priv = priv; new_node->timer_context.timer_is_set = 0U; reg_timer_7(& new_node->timer_context.timer, & mwifiex_flush_data, (unsigned long )(& new_node->timer_context)); i = 0; goto ldv_61095; ldv_61094: *(new_node->rx_reorder_ptr + (unsigned long )i) = (void *)0; i = i + 1; ldv_61095: ; if (i < win_size) { goto ldv_61094; } else { } tmp___3 = spinlock_check(& priv->rx_reorder_tbl_lock); flags = _raw_spin_lock_irqsave(tmp___3); list_add_tail(& new_node->list, & priv->rx_reorder_tbl_ptr); spin_unlock_irqrestore(& priv->rx_reorder_tbl_lock, flags); return; } } static void mwifiex_11n_rxreorder_timer_restart(struct mwifiex_rx_reorder_tbl *tbl ) { u32 min_flush_time ; unsigned long tmp ; { if (tbl->win_size > 31) { min_flush_time = 15U; } else { min_flush_time = 50U; } tmp = msecs_to_jiffies((u32 )tbl->win_size * min_flush_time); ldv_mod_timer_174(& tbl->timer_context.timer, tmp + (unsigned long )jiffies); tbl->timer_context.timer_is_set = 1U; return; } } int mwifiex_cmd_11n_addba_req(struct host_cmd_ds_command *cmd , void *data_buf ) { struct host_cmd_ds_11n_addba_req *add_ba_req ; { add_ba_req = & cmd->params.add_ba_req; cmd->command = 206U; cmd->size = 22U; memcpy((void *)add_ba_req, (void const *)data_buf, 14UL); return (0); } } int mwifiex_cmd_11n_addba_rsp_gen(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd , struct host_cmd_ds_11n_addba_req *cmd_addba_req ) { struct host_cmd_ds_11n_addba_rsp *add_ba_rsp ; struct mwifiex_sta_node *sta_ptr ; u32 rx_win_size ; u8 tid ; int win_size ; unsigned long flags ; uint16_t block_ack_param_set ; raw_spinlock_t *tmp ; int tmp___0 ; { add_ba_rsp = & cmd->params.add_ba_rsp; rx_win_size = priv->add_ba_param.rx_win_size; if ((((unsigned long )priv->bss_role & 1UL) == 0UL && ((unsigned long )(priv->adapter)->fw_cap_info & 16384UL) != 0UL) && (priv->adapter)->is_hw_11ac_capable != 0U) { tmp___0 = memcmp((void const *)(& priv->cfg_bssid), (void const *)(& cmd_addba_req->peer_mac_addr), 6UL); if (tmp___0 != 0) { tmp = spinlock_check(& priv->sta_list_spinlock); flags = _raw_spin_lock_irqsave(tmp); sta_ptr = mwifiex_get_sta_entry(priv, (u8 const *)(& cmd_addba_req->peer_mac_addr)); if ((unsigned long )sta_ptr == (unsigned long )((struct mwifiex_sta_node *)0)) { spin_unlock_irqrestore(& priv->sta_list_spinlock, flags); if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "BA setup with unknown TDLS peer %pM!\n", (u8 *)(& cmd_addba_req->peer_mac_addr)); } else { } } else { } return (-1); } else { } if ((unsigned int )sta_ptr->is_11ac_enabled != 0U) { rx_win_size = 64U; } else { } spin_unlock_irqrestore(& priv->sta_list_spinlock, flags); } else { } } else { } cmd->command = 207U; cmd->size = 24U; memcpy((void *)(& add_ba_rsp->peer_mac_addr), (void const *)(& cmd_addba_req->peer_mac_addr), 6UL); add_ba_rsp->dialog_token = cmd_addba_req->dialog_token; add_ba_rsp->block_ack_tmo = cmd_addba_req->block_ack_tmo; add_ba_rsp->ssn = cmd_addba_req->ssn; block_ack_param_set = cmd_addba_req->block_ack_param_set; tid = (u8 )(((int )block_ack_param_set & 60) >> 2); add_ba_rsp->status_code = 0U; block_ack_param_set = (unsigned int )block_ack_param_set & 63U; if ((unsigned int )priv->add_ba_param.rx_amsdu == 0U || (unsigned int )priv->aggr_prio_tbl[(int )tid].amsdu == 255U) { block_ack_param_set = (unsigned int )block_ack_param_set & 65534U; } else { } block_ack_param_set = ((int )((uint16_t )rx_win_size) << 6U) | (int )block_ack_param_set; add_ba_rsp->block_ack_param_set = block_ack_param_set; win_size = (int )add_ba_rsp->block_ack_param_set >> 6; cmd_addba_req->block_ack_param_set = block_ack_param_set; mwifiex_11n_create_rx_reorder_tbl(priv, (u8 *)(& cmd_addba_req->peer_mac_addr), (int )tid, win_size, (int )cmd_addba_req->ssn); return (0); } } int mwifiex_cmd_11n_delba(struct host_cmd_ds_command *cmd , void *data_buf ) { struct host_cmd_ds_11n_delba *del_ba ; { del_ba = & cmd->params.del_ba; cmd->command = 208U; cmd->size = 20U; memcpy((void *)del_ba, (void const *)data_buf, 12UL); return (0); } } int mwifiex_11n_rx_reorder_pkt(struct mwifiex_private *priv , u16 seq_num , u16 tid , u8 *ta , u8 pkt_type , void *payload ) { struct mwifiex_rx_reorder_tbl *tbl ; int prev_start_win ; int start_win ; int end_win ; int win_size ; u16 pkt_index ; bool init_window_shift ; int ret ; { init_window_shift = 0; ret = 0; tbl = mwifiex_11n_get_rx_reorder_tbl(priv, (int )tid, ta); if ((unsigned long )tbl == (unsigned long )((struct mwifiex_rx_reorder_tbl *)0)) { if ((unsigned int )pkt_type != 231U) { mwifiex_11n_dispatch_pkt(priv, payload); } else { } return (ret); } else { } if ((unsigned int )pkt_type == 230U && (unsigned int )tbl->amsdu == 0U) { mwifiex_11n_dispatch_pkt(priv, payload); return (ret); } else { } start_win = tbl->start_win; prev_start_win = start_win; win_size = tbl->win_size; end_win = ((start_win + win_size) + -1) & 4095; if (((int )tbl->flags & 2) != 0) { init_window_shift = 1; tbl->flags = (unsigned int )tbl->flags & 253U; } else { } if ((int )tbl->flags & 1) { if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "RXREOR_FORCE_NO_DROP when HS is activated\n"); } else { } } else { } tbl->flags = (unsigned int )tbl->flags & 254U; } else if (((int )init_window_shift && (int )seq_num < start_win) && (int )seq_num >= tbl->init_win) { if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Sender TID sequence number reset %d->%d for SSN %d\n", start_win, (int )seq_num, tbl->init_win); } else { } } else { } start_win = (int )seq_num; tbl->start_win = start_win; end_win = ((start_win + win_size) + -1) & 4095; } else if (start_win + 2048 > 4095) { if ((int )seq_num >= ((start_win + 2048) & 4095) && (int )seq_num < start_win) { ret = -1; goto done; } else { } } else if ((int )seq_num < start_win || (int )seq_num >= start_win + 2048) { ret = -1; goto done; } else { } if ((unsigned int )pkt_type == 231U) { seq_num = (unsigned int )((u16 )((unsigned int )((int )((unsigned short )win_size) + (int )seq_num) + 65535U)) & 4095U; } else { } if (((end_win < start_win && (int )seq_num < start_win) && (int )seq_num > end_win) || (end_win > start_win && ((int )seq_num > end_win || (int )seq_num < start_win))) { end_win = (int )seq_num; if (((int )seq_num - win_size) + 1 >= 0) { start_win = (end_win - win_size) + 1; } else { start_win = ((int )seq_num - win_size) + 4097; } mwifiex_11n_dispatch_pkt_until_start_win(priv, tbl, start_win); } else { } if ((unsigned int )pkt_type != 231U) { if ((int )seq_num >= start_win) { pkt_index = (int )seq_num - (int )((u16 )start_win); } else { pkt_index = (unsigned int )((int )seq_num - (int )((u16 )start_win)) + 4096U; } if ((unsigned long )*(tbl->rx_reorder_ptr + (unsigned long )pkt_index) != (unsigned long )((void *)0)) { ret = -1; goto done; } else { } *(tbl->rx_reorder_ptr + (unsigned long )pkt_index) = payload; } else { } mwifiex_11n_scan_and_dispatch(priv, tbl); done: ; if ((unsigned int )tbl->timer_context.timer_is_set == 0U || tbl->start_win != prev_start_win) { mwifiex_11n_rxreorder_timer_restart(tbl); } else { } return (ret); } } void mwifiex_del_ba_tbl(struct mwifiex_private *priv , int tid , u8 *peer_mac , u8 type , int initiator ) { struct mwifiex_rx_reorder_tbl *tbl ; struct mwifiex_tx_ba_stream_tbl *ptx_tbl ; struct mwifiex_ra_list_tbl *ra_list ; u8 cleanup_rx_reorder_tbl ; unsigned long flags ; int tid_down ; u8 tmp ; raw_spinlock_t *tmp___0 ; { if ((unsigned int )type == 2U) { cleanup_rx_reorder_tbl = initiator != 0; } else { cleanup_rx_reorder_tbl = initiator == 0; } if (((priv->adapter)->debug_mask & 32U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "event: DELBA: %pM tid=%d initiator=%d\n", peer_mac, tid, initiator); } else { } } else { } if ((unsigned int )cleanup_rx_reorder_tbl != 0U) { tbl = mwifiex_11n_get_rx_reorder_tbl(priv, tid, peer_mac); if ((unsigned long )tbl == (unsigned long )((struct mwifiex_rx_reorder_tbl *)0)) { if (((priv->adapter)->debug_mask & 32U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "event: TID, TA not found in table\n"); } else { } } else { } return; } else { } mwifiex_del_rx_reorder_entry(priv, tbl); } else { ptx_tbl = mwifiex_get_ba_tbl(priv, tid, peer_mac); if ((unsigned long )ptx_tbl == (unsigned long )((struct mwifiex_tx_ba_stream_tbl *)0)) { if (((priv->adapter)->debug_mask & 32U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "event: TID, RA not found in table\n"); } else { } } else { } return; } else { } tmp = mwifiex_wmm_downgrade_tid(priv, (u32 )tid); tid_down = (int )tmp; ra_list = mwifiex_wmm_get_ralist_node(priv, (int )((u8 )tid_down), (u8 const *)peer_mac); if ((unsigned long )ra_list != (unsigned long )((struct mwifiex_ra_list_tbl *)0)) { ra_list->amsdu_in_ampdu = 0U; ra_list->ba_status = 0; } else { } tmp___0 = spinlock_check(& priv->tx_ba_stream_tbl_lock); flags = _raw_spin_lock_irqsave(tmp___0); mwifiex_11n_delete_tx_ba_stream_tbl_entry(priv, ptx_tbl); spin_unlock_irqrestore(& priv->tx_ba_stream_tbl_lock, flags); } return; } } int mwifiex_ret_11n_addba_resp(struct mwifiex_private *priv , struct host_cmd_ds_command *resp ) { struct host_cmd_ds_11n_addba_rsp *add_ba_rsp ; int tid ; int win_size ; struct mwifiex_rx_reorder_tbl *tbl ; uint16_t block_ack_param_set ; { add_ba_rsp = & resp->params.add_ba_rsp; block_ack_param_set = add_ba_rsp->block_ack_param_set; tid = ((int )block_ack_param_set & 60) >> 2; if ((unsigned int )add_ba_rsp->status_code != 0U) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "ADDBA RSP: failed %pM tid=%d)\n", (u8 *)(& add_ba_rsp->peer_mac_addr), tid); } else { } } else { } tbl = mwifiex_11n_get_rx_reorder_tbl(priv, tid, (u8 *)(& add_ba_rsp->peer_mac_addr)); if ((unsigned long )tbl != (unsigned long )((struct mwifiex_rx_reorder_tbl *)0)) { mwifiex_del_rx_reorder_entry(priv, tbl); } else { } return (0); } else { } win_size = (int )block_ack_param_set >> 6; tbl = mwifiex_11n_get_rx_reorder_tbl(priv, tid, (u8 *)(& add_ba_rsp->peer_mac_addr)); if ((unsigned long )tbl != (unsigned long )((struct mwifiex_rx_reorder_tbl *)0)) { if (((int )block_ack_param_set & 1 && (unsigned int )priv->add_ba_param.rx_amsdu != 0U) && (unsigned int )priv->aggr_prio_tbl[tid].amsdu != 255U) { tbl->amsdu = 1U; } else { tbl->amsdu = 0U; } } else { } if (((priv->adapter)->debug_mask & 16U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "cmd: ADDBA RSP: %pM tid=%d ssn=%d win_size=%d\n", (u8 *)(& add_ba_rsp->peer_mac_addr), tid, (int )add_ba_rsp->ssn, win_size); } else { } } else { } return (0); } } void mwifiex_11n_ba_stream_timeout(struct mwifiex_private *priv , struct host_cmd_ds_11n_batimeout *event ) { struct host_cmd_ds_11n_delba delba ; { memset((void *)(& delba), 0, 12UL); memcpy((void *)(& delba.peer_mac_addr), (void const *)(& event->peer_mac_addr), 6UL); delba.del_ba_param_set = (__le16 )((int )delba.del_ba_param_set | ((int )((unsigned short )event->tid) << 12U)); delba.del_ba_param_set = (__le16 )((int )delba.del_ba_param_set | ((int )((unsigned short )event->origninator) << 11U)); delba.reason_code = 39U; mwifiex_send_cmd(priv, 208, 0, 0U, (void *)(& delba), 0); return; } } void mwifiex_11n_cleanup_reorder_tbl(struct mwifiex_private *priv ) { struct mwifiex_rx_reorder_tbl *del_tbl_ptr ; struct mwifiex_rx_reorder_tbl *tmp_node ; unsigned long flags ; raw_spinlock_t *tmp ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; raw_spinlock_t *tmp___0 ; struct list_head const *__mptr___1 ; { tmp = spinlock_check(& priv->rx_reorder_tbl_lock); flags = _raw_spin_lock_irqsave(tmp); __mptr = (struct list_head const *)priv->rx_reorder_tbl_ptr.next; del_tbl_ptr = (struct mwifiex_rx_reorder_tbl *)__mptr; __mptr___0 = (struct list_head const *)del_tbl_ptr->list.next; tmp_node = (struct mwifiex_rx_reorder_tbl *)__mptr___0; goto ldv_61195; ldv_61194: spin_unlock_irqrestore(& priv->rx_reorder_tbl_lock, flags); mwifiex_del_rx_reorder_entry(priv, del_tbl_ptr); tmp___0 = spinlock_check(& priv->rx_reorder_tbl_lock); flags = _raw_spin_lock_irqsave(tmp___0); del_tbl_ptr = tmp_node; __mptr___1 = (struct list_head const *)tmp_node->list.next; tmp_node = (struct mwifiex_rx_reorder_tbl *)__mptr___1; ldv_61195: ; if ((unsigned long )(& del_tbl_ptr->list) != (unsigned long )(& priv->rx_reorder_tbl_ptr)) { goto ldv_61194; } else { } INIT_LIST_HEAD(& priv->rx_reorder_tbl_ptr); spin_unlock_irqrestore(& priv->rx_reorder_tbl_lock, flags); mwifiex_reset_11n_rx_seq_num(priv); return; } } void mwifiex_update_rxreor_flags(struct mwifiex_adapter *adapter , u8 flags ) { struct mwifiex_private *priv ; struct mwifiex_rx_reorder_tbl *tbl ; unsigned long lock_flags ; int i ; raw_spinlock_t *tmp ; int tmp___0 ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; { i = 0; goto ldv_61217; ldv_61216: priv = adapter->priv[i]; if ((unsigned long )priv == (unsigned long )((struct mwifiex_private *)0)) { goto ldv_61205; } else { } tmp = spinlock_check(& priv->rx_reorder_tbl_lock); lock_flags = _raw_spin_lock_irqsave(tmp); tmp___0 = list_empty((struct list_head const *)(& priv->rx_reorder_tbl_ptr)); if (tmp___0 != 0) { spin_unlock_irqrestore(& priv->rx_reorder_tbl_lock, lock_flags); goto ldv_61205; } else { } __mptr = (struct list_head const *)priv->rx_reorder_tbl_ptr.next; tbl = (struct mwifiex_rx_reorder_tbl *)__mptr; goto ldv_61214; ldv_61213: tbl->flags = flags; __mptr___0 = (struct list_head const *)tbl->list.next; tbl = (struct mwifiex_rx_reorder_tbl *)__mptr___0; ldv_61214: ; if ((unsigned long )(& tbl->list) != (unsigned long )(& priv->rx_reorder_tbl_ptr)) { goto ldv_61213; } else { } spin_unlock_irqrestore(& priv->rx_reorder_tbl_lock, lock_flags); ldv_61205: i = i + 1; ldv_61217: ; if ((int )adapter->priv_num > i) { goto ldv_61216; } else { } return; } } static void mwifiex_update_ampdu_rxwinsize(struct mwifiex_adapter *adapter , bool coex_flag ) { u8 i ; u32 rx_win_size ; struct mwifiex_private *priv ; struct _ddebug descriptor ; long tmp ; { descriptor.modname = "mwifiex"; descriptor.function = "mwifiex_update_ampdu_rxwinsize"; descriptor.filename = "/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/11944/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/mwifiex/11n_rxreorder.c"; descriptor.format = "Update rxwinsize %d\n"; descriptor.lineno = 841U; descriptor.flags = 0U; tmp = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)adapter->dev, "Update rxwinsize %d\n", (int )coex_flag); } else { } i = 0U; goto ldv_61233; ldv_61232: ; if ((unsigned long )adapter->priv[(int )i] == (unsigned long )((struct mwifiex_private *)0)) { goto ldv_61228; } else { } priv = adapter->priv[(int )i]; rx_win_size = priv->add_ba_param.rx_win_size; if ((int )coex_flag) { if ((unsigned int )priv->bss_type == 0U) { priv->add_ba_param.rx_win_size = 16U; } else { } if ((unsigned int )priv->bss_type == 2U) { priv->add_ba_param.rx_win_size = 16U; } else { } if ((unsigned int )priv->bss_type == 1U) { priv->add_ba_param.rx_win_size = 16U; } else { } } else { if ((unsigned int )priv->bss_type == 0U) { priv->add_ba_param.rx_win_size = 64U; } else { } if ((unsigned int )priv->bss_type == 2U) { priv->add_ba_param.rx_win_size = 64U; } else { } if ((unsigned int )priv->bss_type == 1U) { priv->add_ba_param.rx_win_size = 16U; } else { } } if ((unsigned int )adapter->coex_win_size != 0U && (unsigned int )adapter->coex_rx_win_size != 0U) { priv->add_ba_param.rx_win_size = (u32 )adapter->coex_rx_win_size; } else { } if (priv->add_ba_param.rx_win_size != rx_win_size) { if ((unsigned int )priv->media_connected == 0U) { goto ldv_61228; } else { } i = 0U; goto ldv_61230; ldv_61229: mwifiex_11n_delba(priv, (int )i); i = (u8 )((int )i + 1); ldv_61230: ; if ((unsigned int )i <= 7U) { goto ldv_61229; } else { } } else { } ldv_61228: i = (u8 )((int )i + 1); ldv_61233: ; if ((int )adapter->priv_num > (int )i) { goto ldv_61232; } else { } return; } } void mwifiex_coex_ampdu_rxwinsize(struct mwifiex_adapter *adapter ) { u8 i ; struct mwifiex_private *priv ; u8 count ; { count = 0U; i = 0U; goto ldv_61243; ldv_61242: ; if ((unsigned long )adapter->priv[(int )i] != (unsigned long )((struct mwifiex_private *)0)) { priv = adapter->priv[(int )i]; if (((unsigned long )priv->bss_role & 1UL) == 0UL) { if ((unsigned int )priv->media_connected != 0U) { count = (u8 )((int )count + 1); } else { } } else { } if ((int )priv->bss_role & 1) { if ((unsigned int )priv->bss_started != 0U) { count = (u8 )((int )count + 1); } else { } } else { } } else { } if ((unsigned int )count > 1U) { goto ldv_61241; } else { } i = (u8 )((int )i + 1); ldv_61243: ; if ((int )adapter->priv_num > (int )i) { goto ldv_61242; } else { } ldv_61241: ; if ((unsigned int )count > 1U) { mwifiex_update_ampdu_rxwinsize(adapter, 1); } else { mwifiex_update_ampdu_rxwinsize(adapter, 0); } return; } } int reg_timer_7(struct timer_list *timer , void (*function)(unsigned long ) , unsigned long data ) { { if ((unsigned long )function == (unsigned long )(& mwifiex_flush_data)) { activate_suitable_timer_7(timer, data); } else { } return (0); } } void ldv_timer_7(int state , struct timer_list *timer ) { { LDV_IN_INTERRUPT = 2; mwifiex_flush_data(timer->data); LDV_IN_INTERRUPT = 1; return; } } void disable_suitable_timer_7(struct timer_list *timer ) { { if (ldv_timer_7_0 != 0 && (unsigned long )timer == (unsigned long )ldv_timer_list_7_0) { ldv_timer_7_0 = 0; return; } else { } if (ldv_timer_7_1 != 0 && (unsigned long )timer == (unsigned long )ldv_timer_list_7_1) { ldv_timer_7_1 = 0; return; } else { } if (ldv_timer_7_2 != 0 && (unsigned long )timer == (unsigned long )ldv_timer_list_7_2) { ldv_timer_7_2 = 0; return; } else { } if (ldv_timer_7_3 != 0 && (unsigned long )timer == (unsigned long )ldv_timer_list_7_3) { ldv_timer_7_3 = 0; return; } else { } return; } } void timer_init_7(void) { { ldv_timer_7_0 = 0; ldv_timer_7_1 = 0; ldv_timer_7_2 = 0; ldv_timer_7_3 = 0; return; } } void choose_timer_7(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_timer_7_0 == 1) { ldv_timer_7_0 = 2; ldv_timer_7(ldv_timer_7_0, ldv_timer_list_7_0); } else { } goto ldv_61264; case 1: ; if (ldv_timer_7_1 == 1) { ldv_timer_7_1 = 2; ldv_timer_7(ldv_timer_7_1, ldv_timer_list_7_1); } else { } goto ldv_61264; case 2: ; if (ldv_timer_7_2 == 1) { ldv_timer_7_2 = 2; ldv_timer_7(ldv_timer_7_2, ldv_timer_list_7_2); } else { } goto ldv_61264; case 3: ; if (ldv_timer_7_3 == 1) { ldv_timer_7_3 = 2; ldv_timer_7(ldv_timer_7_3, ldv_timer_list_7_3); } else { } goto ldv_61264; default: ldv_stop(); } ldv_61264: ; return; } } void activate_pending_timer_7(struct timer_list *timer , unsigned long data , int pending_flag ) { { if ((unsigned long )ldv_timer_list_7_0 == (unsigned long )timer) { if (ldv_timer_7_0 == 2 || pending_flag != 0) { ldv_timer_list_7_0 = timer; ldv_timer_list_7_0->data = data; ldv_timer_7_0 = 1; } else { } return; } else { } if ((unsigned long )ldv_timer_list_7_1 == (unsigned long )timer) { if (ldv_timer_7_1 == 2 || pending_flag != 0) { ldv_timer_list_7_1 = timer; ldv_timer_list_7_1->data = data; ldv_timer_7_1 = 1; } else { } return; } else { } if ((unsigned long )ldv_timer_list_7_2 == (unsigned long )timer) { if (ldv_timer_7_2 == 2 || pending_flag != 0) { ldv_timer_list_7_2 = timer; ldv_timer_list_7_2->data = data; ldv_timer_7_2 = 1; } else { } return; } else { } if ((unsigned long )ldv_timer_list_7_3 == (unsigned long )timer) { if (ldv_timer_7_3 == 2 || pending_flag != 0) { ldv_timer_list_7_3 = timer; ldv_timer_list_7_3->data = data; ldv_timer_7_3 = 1; } else { } return; } else { } activate_suitable_timer_7(timer, data); return; } } void activate_suitable_timer_7(struct timer_list *timer , unsigned long data ) { { if (ldv_timer_7_0 == 0 || ldv_timer_7_0 == 2) { ldv_timer_list_7_0 = timer; ldv_timer_list_7_0->data = data; ldv_timer_7_0 = 1; return; } else { } if (ldv_timer_7_1 == 0 || ldv_timer_7_1 == 2) { ldv_timer_list_7_1 = timer; ldv_timer_list_7_1->data = data; ldv_timer_7_1 = 1; return; } else { } if (ldv_timer_7_2 == 0 || ldv_timer_7_2 == 2) { ldv_timer_list_7_2 = timer; ldv_timer_list_7_2->data = data; ldv_timer_7_2 = 1; return; } else { } if (ldv_timer_7_3 == 0 || ldv_timer_7_3 == 2) { ldv_timer_list_7_3 = timer; ldv_timer_list_7_3->data = data; ldv_timer_7_3 = 1; return; } else { } return; } } bool ldv_queue_work_on_167(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_168(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_169(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_170(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_171(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } void ldv_flush_workqueue_172(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } int ldv_del_timer_sync_173(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_7(ldv_func_arg1); return (ldv_func_res); } } int ldv_mod_timer_174(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_7(ldv_func_arg1, ldv_func_arg2, 1); return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; __inline static void le16_add_cpu(__le16 *var , u16 val ) { { *var = (int )*var + (int )val; return; } } bool ldv_queue_work_on_187(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; 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_delayed_work_on_188(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_191(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_190(struct workqueue_struct *ldv_func_arg1 ) ; __inline static bool queue_work___1(struct workqueue_struct *wq , struct work_struct *work ) { bool tmp ; { tmp = ldv_queue_work_on_187(8192, wq, work); return (tmp); } } extern struct ieee80211_channel *__ieee80211_get_channel(struct wiphy * , int ) ; __inline static struct ieee80211_channel *ieee80211_get_channel(struct wiphy *wiphy , int freq ) { struct ieee80211_channel *tmp ; { tmp = __ieee80211_get_channel(wiphy, freq); return (tmp); } } extern struct cfg80211_bss *cfg80211_inform_bss_width(struct wiphy * , struct ieee80211_channel * , enum nl80211_bss_scan_width , enum cfg80211_bss_frame_type , u8 const * , u64 , u16 , u16 , u8 const * , size_t , s32 , gfp_t ) ; __inline static struct cfg80211_bss *cfg80211_inform_bss(struct wiphy *wiphy , struct ieee80211_channel *rx_channel , enum cfg80211_bss_frame_type ftype , u8 const *bssid , u64 tsf , u16 capability , u16 beacon_interval , u8 const *ie , size_t ielen , s32 signal , gfp_t gfp ) { struct cfg80211_bss *tmp ; { tmp = cfg80211_inform_bss_width(wiphy, rx_channel, 0, ftype, bssid, tsf, (int )capability, (int )beacon_interval, ie, ielen, signal, gfp); return (tmp); } } extern void cfg80211_put_bss(struct wiphy * , struct cfg80211_bss * ) ; __inline static bool is_zero_ether_addr(u8 const *addr ) { { return (((unsigned int )*((u32 const *)addr) | (unsigned int )*((u16 const *)addr + 4U)) == 0U); } } int mwifiex_cmd_802_11_scan(struct host_cmd_ds_command *cmd , struct mwifiex_scan_cmd_config *scan_cfg ) ; int mwifiex_ret_802_11_scan(struct mwifiex_private *priv , struct host_cmd_ds_command *resp ) ; s32 mwifiex_ssid_cmp(struct cfg80211_ssid *ssid1 , struct cfg80211_ssid *ssid2 ) ; int mwifiex_cmd_802_11_bg_scan_query(struct host_cmd_ds_command *cmd ) ; int mwifiex_cmd_append_vsie_tlv(struct mwifiex_private *priv , u16 vsie_mask , u8 **buffer ) ; void mwifiex_save_curr_bcn(struct mwifiex_private *priv ) ; int mwifiex_cmd_802_11_scan_ext(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd , void *data_buf ) ; int mwifiex_ret_802_11_scan_ext(struct mwifiex_private *priv , struct host_cmd_ds_command *resp ) ; int mwifiex_handle_event_ext_scan_report(struct mwifiex_private *priv , void *buf ) ; __inline static u8 mwifiex_11h_get_csa_closed_channel(struct mwifiex_private *priv ) { { if ((unsigned int )priv->csa_chan == 0U) { return (0U); } else { } if ((long )(priv->csa_expire_time - (unsigned long )jiffies) < 0L) { priv->csa_chan = 0U; priv->csa_expire_time = 0UL; } else { } return (priv->csa_chan); } } int mwifiex_request_scan(struct mwifiex_private *priv , struct cfg80211_ssid *req_ssid ) ; int mwifiex_scan_networks(struct mwifiex_private *priv , struct mwifiex_user_scan_cfg const *user_scan_in ) ; int mwifiex_fill_new_bss_desc(struct mwifiex_private *priv , struct cfg80211_bss *bss , struct mwifiex_bssdescriptor *bss_desc ) ; int mwifiex_update_bss_desc_with_ie(struct mwifiex_adapter *adapter , struct mwifiex_bssdescriptor *bss_entry ) ; int mwifiex_check_network_compatibility(struct mwifiex_private *priv , struct mwifiex_bssdescriptor *bss_desc ) ; static u8 mwifiex_wpa_oui[2U][4U] = { { 0U, 80U, 242U, 2U}, { 0U, 80U, 242U, 4U}}; static u8 mwifiex_rsn_oui[2U][4U] = { { 0U, 15U, 172U, 2U}, { 0U, 15U, 172U, 4U}}; static u8 mwifiex_search_oui_in_ie(struct ie_body *iebody , u8 *oui ) { u8 count ; int tmp ; struct _ddebug descriptor ; long tmp___0 ; { count = iebody->ptk_cnt[0]; goto ldv_60946; ldv_60945: tmp = memcmp((void const *)(& iebody->ptk_body), (void const *)oui, 4UL); if (tmp == 0) { return (1U); } else { } count = (u8 )((int )count - 1); if ((unsigned int )count != 0U) { iebody = iebody + 4U; } else { } ldv_60946: ; if ((unsigned int )count != 0U) { goto ldv_60945; } else { } descriptor.modname = "mwifiex"; descriptor.function = "mwifiex_search_oui_in_ie"; descriptor.filename = "/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/11944/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/mwifiex/scan.c"; descriptor.format = "info: %s: OUI is not found in PTK\n"; descriptor.lineno = 106U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { __dynamic_pr_debug(& descriptor, "mwifiex: info: %s: OUI is not found in PTK\n", "mwifiex_search_oui_in_ie"); } else { } return (0U); } } static u8 mwifiex_is_rsn_oui_present(struct mwifiex_bssdescriptor *bss_desc , u32 cipher ) { u8 *oui ; struct ie_body *iebody ; u8 ret ; { ret = 0U; if ((unsigned long )bss_desc->bcn_rsn_ie != (unsigned long )((struct ieee_types_generic *)0) && (unsigned int )(bss_desc->bcn_rsn_ie)->ieee_hdr.element_id == 48U) { iebody = (struct ie_body *)(& (bss_desc->bcn_rsn_ie)->data) + 2U; oui = (u8 *)(& mwifiex_rsn_oui) + (unsigned long )cipher; ret = mwifiex_search_oui_in_ie(iebody, oui); if ((unsigned int )ret != 0U) { return (ret); } else { } } else { } return (ret); } } static u8 mwifiex_is_wpa_oui_present(struct mwifiex_bssdescriptor *bss_desc , u32 cipher ) { u8 *oui ; struct ie_body *iebody ; u8 ret ; { ret = 0U; if ((unsigned long )bss_desc->bcn_wpa_ie != (unsigned long )((struct ieee_types_vendor_specific *)0) && (unsigned int )(bss_desc->bcn_wpa_ie)->vend_hdr.element_id == 221U) { iebody = (struct ie_body *)(& (bss_desc->bcn_wpa_ie)->data); oui = (u8 *)(& mwifiex_wpa_oui) + (unsigned long )cipher; ret = mwifiex_search_oui_in_ie(iebody, oui); if ((unsigned int )ret != 0U) { return (ret); } else { } } else { } return (ret); } } s32 mwifiex_ssid_cmp(struct cfg80211_ssid *ssid1 , struct cfg80211_ssid *ssid2 ) { int tmp ; { if (((unsigned long )ssid1 == (unsigned long )((struct cfg80211_ssid *)0) || (unsigned long )ssid2 == (unsigned long )((struct cfg80211_ssid *)0)) || (int )ssid1->ssid_len != (int )ssid2->ssid_len) { return (-1); } else { } tmp = memcmp((void const *)(& ssid1->ssid), (void const *)(& ssid2->ssid), (size_t )ssid1->ssid_len); return (tmp); } } static bool mwifiex_is_bss_wapi(struct mwifiex_private *priv , struct mwifiex_bssdescriptor *bss_desc ) { { if ((unsigned int )priv->sec_info.wapi_enabled != 0U && ((unsigned long )bss_desc->bcn_wapi_ie != (unsigned long )((struct ieee_types_generic *)0) && (unsigned int )(bss_desc->bcn_wapi_ie)->ieee_hdr.element_id == 68U)) { return (1); } else { } return (0); } } static bool mwifiex_is_bss_no_sec(struct mwifiex_private *priv , struct mwifiex_bssdescriptor *bss_desc ) { { if (((((((unsigned int )priv->sec_info.wep_enabled == 0U && (unsigned int )priv->sec_info.wpa_enabled == 0U) && (unsigned int )priv->sec_info.wpa2_enabled == 0U) && ((unsigned long )bss_desc->bcn_wpa_ie == (unsigned long )((struct ieee_types_vendor_specific *)0) || (unsigned int )(bss_desc->bcn_wpa_ie)->vend_hdr.element_id != 221U)) && ((unsigned long )bss_desc->bcn_rsn_ie == (unsigned long )((struct ieee_types_generic *)0) || (unsigned int )(bss_desc->bcn_rsn_ie)->ieee_hdr.element_id != 48U)) && priv->sec_info.encryption_mode == 0U) && bss_desc->privacy == 0U) { return (1); } else { } return (0); } } static bool mwifiex_is_bss_static_wep(struct mwifiex_private *priv , struct mwifiex_bssdescriptor *bss_desc ) { { if ((((unsigned int )priv->sec_info.wep_enabled != 0U && (unsigned int )priv->sec_info.wpa_enabled == 0U) && (unsigned int )priv->sec_info.wpa2_enabled == 0U) && bss_desc->privacy != 0U) { return (1); } else { } return (0); } } static bool mwifiex_is_bss_wpa(struct mwifiex_private *priv , struct mwifiex_bssdescriptor *bss_desc ) { { if ((((unsigned int )priv->sec_info.wep_enabled == 0U && (unsigned int )priv->sec_info.wpa_enabled != 0U) && (unsigned int )priv->sec_info.wpa2_enabled == 0U) && ((unsigned long )bss_desc->bcn_wpa_ie != (unsigned long )((struct ieee_types_vendor_specific *)0) && (unsigned int )(bss_desc->bcn_wpa_ie)->vend_hdr.element_id == 221U)) { if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: %s: WPA:\twpa_ie=%#x wpa2_ie=%#x WEP=%s WPA=%s WPA2=%s\tEncMode=%#x privacy=%#x\n", "mwifiex_is_bss_wpa", (unsigned long )bss_desc->bcn_wpa_ie != (unsigned long )((struct ieee_types_vendor_specific *)0) ? (int )(bss_desc->bcn_wpa_ie)->vend_hdr.element_id : 0, (unsigned long )bss_desc->bcn_rsn_ie != (unsigned long )((struct ieee_types_generic *)0) ? (int )(bss_desc->bcn_rsn_ie)->ieee_hdr.element_id : 0, (unsigned int )priv->sec_info.wep_enabled != 0U ? (char *)"e" : (char *)"d", (unsigned int )priv->sec_info.wpa_enabled != 0U ? (char *)"e" : (char *)"d", (unsigned int )priv->sec_info.wpa2_enabled != 0U ? (char *)"e" : (char *)"d", priv->sec_info.encryption_mode, bss_desc->privacy); } else { } } else { } return (1); } else { } return (0); } } static bool mwifiex_is_bss_wpa2(struct mwifiex_private *priv , struct mwifiex_bssdescriptor *bss_desc ) { { if ((((unsigned int )priv->sec_info.wep_enabled == 0U && (unsigned int )priv->sec_info.wpa_enabled == 0U) && (unsigned int )priv->sec_info.wpa2_enabled != 0U) && ((unsigned long )bss_desc->bcn_rsn_ie != (unsigned long )((struct ieee_types_generic *)0) && (unsigned int )(bss_desc->bcn_rsn_ie)->ieee_hdr.element_id == 48U)) { if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: %s: WPA2:\twpa_ie=%#x wpa2_ie=%#x WEP=%s WPA=%s WPA2=%s\tEncMode=%#x privacy=%#x\n", "mwifiex_is_bss_wpa2", (unsigned long )bss_desc->bcn_wpa_ie != (unsigned long )((struct ieee_types_vendor_specific *)0) ? (int )(bss_desc->bcn_wpa_ie)->vend_hdr.element_id : 0, (unsigned long )bss_desc->bcn_rsn_ie != (unsigned long )((struct ieee_types_generic *)0) ? (int )(bss_desc->bcn_rsn_ie)->ieee_hdr.element_id : 0, (unsigned int )priv->sec_info.wep_enabled != 0U ? (char *)"e" : (char *)"d", (unsigned int )priv->sec_info.wpa_enabled != 0U ? (char *)"e" : (char *)"d", (unsigned int )priv->sec_info.wpa2_enabled != 0U ? (char *)"e" : (char *)"d", priv->sec_info.encryption_mode, bss_desc->privacy); } else { } } else { } return (1); } else { } return (0); } } static bool mwifiex_is_bss_adhoc_aes(struct mwifiex_private *priv , struct mwifiex_bssdescriptor *bss_desc ) { { if (((((((unsigned int )priv->sec_info.wep_enabled == 0U && (unsigned int )priv->sec_info.wpa_enabled == 0U) && (unsigned int )priv->sec_info.wpa2_enabled == 0U) && ((unsigned long )bss_desc->bcn_wpa_ie == (unsigned long )((struct ieee_types_vendor_specific *)0) || (unsigned int )(bss_desc->bcn_wpa_ie)->vend_hdr.element_id != 221U)) && ((unsigned long )bss_desc->bcn_rsn_ie == (unsigned long )((struct ieee_types_generic *)0) || (unsigned int )(bss_desc->bcn_rsn_ie)->ieee_hdr.element_id != 48U)) && priv->sec_info.encryption_mode == 0U) && bss_desc->privacy != 0U) { return (1); } else { } return (0); } } static bool mwifiex_is_bss_dynamic_wep(struct mwifiex_private *priv , struct mwifiex_bssdescriptor *bss_desc ) { { if (((((((unsigned int )priv->sec_info.wep_enabled == 0U && (unsigned int )priv->sec_info.wpa_enabled == 0U) && (unsigned int )priv->sec_info.wpa2_enabled == 0U) && ((unsigned long )bss_desc->bcn_wpa_ie == (unsigned long )((struct ieee_types_vendor_specific *)0) || (unsigned int )(bss_desc->bcn_wpa_ie)->vend_hdr.element_id != 221U)) && ((unsigned long )bss_desc->bcn_rsn_ie == (unsigned long )((struct ieee_types_generic *)0) || (unsigned int )(bss_desc->bcn_rsn_ie)->ieee_hdr.element_id != 48U)) && priv->sec_info.encryption_mode != 0U) && bss_desc->privacy != 0U) { if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: %s: dynamic\tWEP: wpa_ie=%#x wpa2_ie=%#x\tEncMode=%#x privacy=%#x\n", "mwifiex_is_bss_dynamic_wep", (unsigned long )bss_desc->bcn_wpa_ie != (unsigned long )((struct ieee_types_vendor_specific *)0) ? (int )(bss_desc->bcn_wpa_ie)->vend_hdr.element_id : 0, (unsigned long )bss_desc->bcn_rsn_ie != (unsigned long )((struct ieee_types_generic *)0) ? (int )(bss_desc->bcn_rsn_ie)->ieee_hdr.element_id : 0, priv->sec_info.encryption_mode, bss_desc->privacy); } else { } } else { } return (1); } else { } return (0); } } static s32 mwifiex_is_network_compatible(struct mwifiex_private *priv , struct mwifiex_bssdescriptor *bss_desc , u32 mode ) { struct mwifiex_adapter *adapter ; bool tmp ; u8 tmp___0 ; u8 tmp___1 ; u8 tmp___2 ; u8 tmp___3 ; bool tmp___4 ; bool tmp___5 ; bool tmp___6 ; bool tmp___7 ; bool tmp___8 ; bool tmp___9 ; { adapter = priv->adapter; bss_desc->disable_11n = 0U; if (((unsigned int )priv->media_connected != 0U && priv->bss_mode == 2U) && bss_desc->bss_mode == 2U) { return (0); } else { } if ((unsigned int )priv->wps.session_enable != 0U) { if ((adapter->debug_mask & 128U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: return success directly in WPS period\n"); } else { } } else { } return (0); } else { } if ((unsigned int )bss_desc->chan_sw_ie_present != 0U) { if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "Don\'t connect to AP with WLAN_EID_CHANNEL_SWITCH\n"); } else { } } else { } return (-1); } else { } tmp = mwifiex_is_bss_wapi(priv, bss_desc); if ((int )tmp) { if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: return success for WAPI AP\n"); } else { } } else { } return (0); } else { } if (bss_desc->bss_mode == mode) { tmp___9 = mwifiex_is_bss_no_sec(priv, bss_desc); if ((int )tmp___9) { return (0); } else { tmp___8 = mwifiex_is_bss_static_wep(priv, bss_desc); if ((int )tmp___8) { if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: Disable 11n in WEP mode.\n"); } else { } } else { } bss_desc->disable_11n = 1U; return (0); } else { tmp___7 = mwifiex_is_bss_wpa(priv, bss_desc); if ((int )tmp___7) { if ((((int )(priv->adapter)->config_bands & 8) != 0 || ((int )(priv->adapter)->config_bands & 16) != 0) && (unsigned long )bss_desc->bcn_ht_cap != (unsigned long )((struct ieee80211_ht_cap *)0)) { tmp___1 = mwifiex_is_wpa_oui_present(bss_desc, 1U); if ((unsigned int )tmp___1 == 0U) { tmp___0 = mwifiex_is_wpa_oui_present(bss_desc, 0U); if ((unsigned int )tmp___0 != 0U) { if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: Disable 11n if AES\tis not supported by AP\n"); } else { } } else { } bss_desc->disable_11n = 1U; } else { return (-1); } } else { } } else { } return (0); } else { tmp___6 = mwifiex_is_bss_wpa2(priv, bss_desc); if ((int )tmp___6) { if ((((int )(priv->adapter)->config_bands & 8) != 0 || ((int )(priv->adapter)->config_bands & 16) != 0) && (unsigned long )bss_desc->bcn_ht_cap != (unsigned long )((struct ieee80211_ht_cap *)0)) { tmp___3 = mwifiex_is_rsn_oui_present(bss_desc, 1U); if ((unsigned int )tmp___3 == 0U) { tmp___2 = mwifiex_is_rsn_oui_present(bss_desc, 0U); if ((unsigned int )tmp___2 != 0U) { if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: Disable 11n if AES\tis not supported by AP\n"); } else { } } else { } bss_desc->disable_11n = 1U; } else { return (-1); } } else { } } else { } return (0); } else { tmp___5 = mwifiex_is_bss_adhoc_aes(priv, bss_desc); if ((int )tmp___5) { return (0); } else { tmp___4 = mwifiex_is_bss_dynamic_wep(priv, bss_desc); if ((int )tmp___4) { return (0); } else { } } } } } } if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: %s: failed: wpa_ie=%#x wpa2_ie=%#x WEP=%s\tWPA=%s WPA2=%s EncMode=%#x privacy=%#x\n", "mwifiex_is_network_compatible", (unsigned long )bss_desc->bcn_wpa_ie != (unsigned long )((struct ieee_types_vendor_specific *)0) ? (int )(bss_desc->bcn_wpa_ie)->vend_hdr.element_id : 0, (unsigned long )bss_desc->bcn_rsn_ie != (unsigned long )((struct ieee_types_generic *)0) ? (int )(bss_desc->bcn_rsn_ie)->ieee_hdr.element_id : 0, (unsigned int )priv->sec_info.wep_enabled != 0U ? (char *)"e" : (char *)"d", (unsigned int )priv->sec_info.wpa_enabled != 0U ? (char *)"e" : (char *)"d", (unsigned int )priv->sec_info.wpa2_enabled != 0U ? (char *)"e" : (char *)"d", priv->sec_info.encryption_mode, bss_desc->privacy); } else { } } else { } return (-1); } else { } return (-1); } } static int mwifiex_scan_create_channel_list(struct mwifiex_private *priv , struct mwifiex_user_scan_cfg const *user_scan_in , struct mwifiex_chan_scan_param_set *scan_chan_list , u8 filtered_scan ) { enum ieee80211_band band ; struct ieee80211_supported_band *sband ; struct ieee80211_channel *ch ; struct mwifiex_adapter *adapter ; int chan_idx ; int i ; { adapter = priv->adapter; chan_idx = 0; band = 0; goto ldv_61024; ldv_61023: ; if ((unsigned long )(priv->wdev.wiphy)->bands[(unsigned int )band] == (unsigned long )((struct ieee80211_supported_band *)0)) { goto ldv_61018; } else { } sband = (priv->wdev.wiphy)->bands[(unsigned int )band]; i = 0; goto ldv_61021; ldv_61020: ch = sband->channels + (unsigned long )i; if ((int )ch->flags & 1) { goto ldv_61019; } else { } (scan_chan_list + (unsigned long )chan_idx)->radio_type = (u8 )band; if ((unsigned long )user_scan_in != (unsigned long )((struct mwifiex_user_scan_cfg const *)0) && (unsigned int )user_scan_in->chan_list[0].scan_time != 0U) { (scan_chan_list + (unsigned long )chan_idx)->max_scan_time = (unsigned short )user_scan_in->chan_list[0].scan_time; } else if ((ch->flags & 2U) != 0U) { (scan_chan_list + (unsigned long )chan_idx)->max_scan_time = adapter->passive_scan_time; } else { (scan_chan_list + (unsigned long )chan_idx)->max_scan_time = adapter->active_scan_time; } if ((ch->flags & 2U) != 0U) { (scan_chan_list + (unsigned long )chan_idx)->chan_scan_mode_bitmap = (u8 )((unsigned int )(scan_chan_list + (unsigned long )chan_idx)->chan_scan_mode_bitmap | 1U); } else { (scan_chan_list + (unsigned long )chan_idx)->chan_scan_mode_bitmap = (unsigned int )(scan_chan_list + (unsigned long )chan_idx)->chan_scan_mode_bitmap & 254U; } (scan_chan_list + (unsigned long )chan_idx)->chan_number = (u8 )ch->hw_value; if ((unsigned int )filtered_scan != 0U) { (scan_chan_list + (unsigned long )chan_idx)->max_scan_time = adapter->specific_scan_time; (scan_chan_list + (unsigned long )chan_idx)->chan_scan_mode_bitmap = (u8 )((unsigned int )(scan_chan_list + (unsigned long )chan_idx)->chan_scan_mode_bitmap | 2U); } else { } chan_idx = chan_idx + 1; ldv_61019: i = i + 1; ldv_61021: ; if (sband->n_channels > i) { goto ldv_61020; } else { } ldv_61018: band = (enum ieee80211_band )((unsigned int )band + 1U); ldv_61024: ; if ((unsigned int )band <= 2U) { goto ldv_61023; } else { } return (chan_idx); } } static int mwifiex_append_rate_tlv(struct mwifiex_private *priv , struct mwifiex_scan_cmd_config *scan_cfg_out , u8 radio ) { struct mwifiex_ie_types_rates_param_set *rates_tlv ; u8 rates[14U] ; u8 *tlv_pos ; u32 rates_size ; { memset((void *)(& rates), 0, 14UL); tlv_pos = (u8 *)(& scan_cfg_out->tlv_buf) + (unsigned long )scan_cfg_out->tlv_buf_len; if ((unsigned long )priv->scan_request != (unsigned long )((struct cfg80211_scan_request *)0)) { rates_size = mwifiex_get_rates_from_cfg80211(priv, (u8 *)(& rates), (int )radio); } else { rates_size = mwifiex_get_supported_rates(priv, (u8 *)(& rates)); } if (((priv->adapter)->debug_mask & 16U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: SCAN_CMD: Rates size = %d\n", rates_size); } else { } } else { } rates_tlv = (struct mwifiex_ie_types_rates_param_set *)tlv_pos; rates_tlv->header.type = 1U; rates_tlv->header.len = (unsigned short )rates_size; memcpy((void *)(& rates_tlv->rates), (void const *)(& rates), (size_t )rates_size); scan_cfg_out->tlv_buf_len = (scan_cfg_out->tlv_buf_len + rates_size) + 4U; return ((int )rates_size); } } static int mwifiex_scan_channel_list(struct mwifiex_private *priv , u32 max_chan_per_scan , u8 filtered_scan , struct mwifiex_scan_cmd_config *scan_cfg_out , struct mwifiex_ie_types_chan_list_param_set *chan_tlv_out , struct mwifiex_chan_scan_param_set *scan_chan_list ) { struct mwifiex_adapter *adapter ; int ret ; struct mwifiex_chan_scan_param_set *tmp_chan_list ; struct mwifiex_chan_scan_param_set *start_chan ; struct cmd_ctrl_node *cmd_node ; struct cmd_ctrl_node *tmp_node ; unsigned long flags ; u32 tlv_idx ; u32 rates_size ; u32 cmd_no ; u32 total_scan_time ; u32 done_early ; u8 radio_type ; int tmp ; raw_spinlock_t *tmp___0 ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; { adapter = priv->adapter; ret = 0; if (((unsigned long )scan_cfg_out == (unsigned long )((struct mwifiex_scan_cmd_config *)0) || (unsigned long )chan_tlv_out == (unsigned long )((struct mwifiex_ie_types_chan_list_param_set *)0)) || (unsigned long )scan_chan_list == (unsigned long )((struct mwifiex_chan_scan_param_set *)0)) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: Scan: Null detect: %p, %p, %p\n", scan_cfg_out, chan_tlv_out, scan_chan_list); } else { } } else { } return (-1); } else { } mwifiex_11h_get_csa_closed_channel(priv); chan_tlv_out->header.type = 257U; tmp_chan_list = scan_chan_list; goto ldv_61073; ldv_61072: tlv_idx = 0U; total_scan_time = 0U; radio_type = 0U; chan_tlv_out->header.len = 0U; start_chan = tmp_chan_list; done_early = 0U; goto ldv_61056; ldv_61057: ; if ((int )tmp_chan_list->chan_number == (int )priv->csa_chan) { tmp_chan_list = tmp_chan_list + 1; goto ldv_61056; } else { } radio_type = tmp_chan_list->radio_type; if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: Scan: Chan(%3d), Radio(%d),\tMode(%d, %d), Dur(%d)\n", (int )tmp_chan_list->chan_number, (int )tmp_chan_list->radio_type, (int )tmp_chan_list->chan_scan_mode_bitmap & 1, ((int )tmp_chan_list->chan_scan_mode_bitmap & 2) >> 1, (int )tmp_chan_list->max_scan_time); } else { } } else { } memcpy((void *)(& chan_tlv_out->chan_scan_param) + (unsigned long )tlv_idx, (void const *)tmp_chan_list, 7UL); le16_add_cpu(& chan_tlv_out->header.len, 7); scan_cfg_out->tlv_buf_len = (unsigned int )((long )chan_tlv_out) - (unsigned int )((long )(& scan_cfg_out->tlv_buf)); scan_cfg_out->tlv_buf_len = (scan_cfg_out->tlv_buf_len + (u32 )chan_tlv_out->header.len) + 4U; tlv_idx = tlv_idx + 1U; total_scan_time = (u32 )tmp_chan_list->max_scan_time + total_scan_time; done_early = 0U; if ((unsigned int )filtered_scan == 0U && (((unsigned int )tmp_chan_list->chan_number == 1U || (unsigned int )tmp_chan_list->chan_number == 6U) || (unsigned int )tmp_chan_list->chan_number == 11U)) { done_early = 1U; } else { } tmp_chan_list = tmp_chan_list + 1; if ((unsigned int )filtered_scan == 0U && (((unsigned int )tmp_chan_list->chan_number == 1U || (unsigned int )tmp_chan_list->chan_number == 6U) || (unsigned int )tmp_chan_list->chan_number == 11U)) { done_early = 1U; } else { } ldv_61056: ; if ((tlv_idx < max_chan_per_scan && (unsigned int )tmp_chan_list->chan_number != 0U) && done_early == 0U) { goto ldv_61057; } else { } if (total_scan_time > 9000U) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "total scan time %dms\tis over limit (%dms), scan skipped\n", total_scan_time, 9000); } else { } } else { } ret = -1; goto ldv_61059; } else { } tmp = mwifiex_append_rate_tlv(priv, scan_cfg_out, (int )radio_type); rates_size = (u32 )tmp; (priv->adapter)->scan_channels = start_chan; if ((int )(priv->adapter)->ext_scan) { cmd_no = 263U; } else { cmd_no = 6U; } ret = mwifiex_send_cmd(priv, (int )((u16 )cmd_no), 1, 0U, (void *)scan_cfg_out, 0); scan_cfg_out->tlv_buf_len = (scan_cfg_out->tlv_buf_len - rates_size) - 4U; if (ret != 0) { tmp___0 = spinlock_check(& adapter->scan_pending_q_lock); flags = _raw_spin_lock_irqsave(tmp___0); __mptr = (struct list_head const *)adapter->scan_pending_q.next; cmd_node = (struct cmd_ctrl_node *)__mptr; __mptr___0 = (struct list_head const *)cmd_node->list.next; tmp_node = (struct cmd_ctrl_node *)__mptr___0; goto ldv_61070; ldv_61069: list_del(& cmd_node->list); cmd_node->wait_q_enabled = 0U; mwifiex_insert_cmd_to_free_q(adapter, cmd_node); cmd_node = tmp_node; __mptr___1 = (struct list_head const *)tmp_node->list.next; tmp_node = (struct cmd_ctrl_node *)__mptr___1; ldv_61070: ; if ((unsigned long )(& cmd_node->list) != (unsigned long )(& adapter->scan_pending_q)) { goto ldv_61069; } else { } spin_unlock_irqrestore(& adapter->scan_pending_q_lock, flags); goto ldv_61059; } else { } ldv_61073: ; if ((unsigned int )tmp_chan_list->chan_number != 0U) { goto ldv_61072; } else { } ldv_61059: ; if (ret != 0) { return (-1); } else { } return (0); } } static void mwifiex_config_scan(struct mwifiex_private *priv , struct mwifiex_user_scan_cfg const *user_scan_in , struct mwifiex_scan_cmd_config *scan_cfg_out , struct mwifiex_ie_types_chan_list_param_set **chan_list_out , struct mwifiex_chan_scan_param_set *scan_chan_list , u8 *max_chan_per_scan , u8 *filtered_scan , u8 *scan_current_only ) { struct mwifiex_adapter *adapter ; struct mwifiex_ie_types_num_probes *num_probes_tlv ; struct mwifiex_ie_types_scan_chan_gap *chan_gap_tlv ; struct mwifiex_ie_types_wildcard_ssid_params *wildcard_ssid_tlv ; struct mwifiex_ie_types_bssid_list *bssid_tlv ; u8 *tlv_pos ; u32 num_probes ; u32 ssid_len ; u32 chan_idx ; u32 chan_num ; u32 scan_type ; u16 scan_dur ; u8 channel ; u8 radio_type ; int i ; u8 ssid_filter ; struct mwifiex_ie_types_htcap *ht_cap ; bool tmp ; int tmp___0 ; bool tmp___1 ; int tmp___2 ; int tmp___3 ; { adapter = priv->adapter; scan_cfg_out->tlv_buf_len = 0U; tlv_pos = (u8 *)(& scan_cfg_out->tlv_buf); *filtered_scan = 0U; *scan_current_only = 0U; if ((unsigned long )user_scan_in != (unsigned long )((struct mwifiex_user_scan_cfg const *)0)) { ssid_filter = 1U; scan_cfg_out->bss_mode = (unsigned int )((unsigned char )user_scan_in->bss_mode) != 0U ? (u8 )user_scan_in->bss_mode : (u8 )adapter->scan_mode; num_probes = (unsigned int )((unsigned char )user_scan_in->num_probes) != 0U ? (u32 )user_scan_in->num_probes : (u32 )adapter->scan_probes; memcpy((void *)(& scan_cfg_out->specific_bssid), (void const *)(& user_scan_in->specific_bssid), 6UL); if ((int )adapter->ext_scan) { tmp = is_zero_ether_addr((u8 const *)(& scan_cfg_out->specific_bssid)); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { bssid_tlv = (struct mwifiex_ie_types_bssid_list *)tlv_pos; bssid_tlv->header.type = 291U; bssid_tlv->header.len = 6U; memcpy((void *)(& bssid_tlv->bssid), (void const *)(& user_scan_in->specific_bssid), 6UL); tlv_pos = tlv_pos + 10UL; } else { } } else { } i = 0; goto ldv_61102; ldv_61101: ssid_len = (u32 )(user_scan_in->ssid_list + (unsigned long )i)->ssid_len; wildcard_ssid_tlv = (struct mwifiex_ie_types_wildcard_ssid_params *)tlv_pos; wildcard_ssid_tlv->header.type = 274U; wildcard_ssid_tlv->header.len = (unsigned int )((unsigned short )ssid_len) + 1U; if (ssid_len != 0U) { wildcard_ssid_tlv->max_ssid_length = 0U; } else { wildcard_ssid_tlv->max_ssid_length = 32U; } memcpy((void *)(& wildcard_ssid_tlv->ssid), (void const *)(& (user_scan_in->ssid_list + (unsigned long )i)->ssid), (size_t )ssid_len); tlv_pos = tlv_pos + ((unsigned long )wildcard_ssid_tlv->header.len + 4UL); if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: scan: ssid[%d]: %s, %d\n", i, (u8 *)(& wildcard_ssid_tlv->ssid), (int )wildcard_ssid_tlv->max_ssid_length); } else { } } else { } if (ssid_len == 0U && (unsigned int )wildcard_ssid_tlv->max_ssid_length != 0U) { ssid_filter = 0U; } else { } i = i + 1; ldv_61102: ; if ((int )user_scan_in->num_ssids > i) { goto ldv_61101; } else { } if (i != 0 && (unsigned int )ssid_filter != 0U) { *filtered_scan = 1U; } else { tmp___1 = is_zero_ether_addr((u8 const *)(& scan_cfg_out->specific_bssid)); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { *filtered_scan = 1U; } else { } } if ((unsigned int )((unsigned short )user_scan_in->scan_chan_gap) != 0U) { if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: scan: channel gap = %d\n", (int )user_scan_in->scan_chan_gap); } else { } } else { } *max_chan_per_scan = 14U; chan_gap_tlv = (struct mwifiex_ie_types_scan_chan_gap *)tlv_pos; chan_gap_tlv->header.type = 453U; chan_gap_tlv->header.len = 2U; chan_gap_tlv->chan_gap = user_scan_in->scan_chan_gap; tlv_pos = tlv_pos + 6UL; } else { } } else { scan_cfg_out->bss_mode = (unsigned char )adapter->scan_mode; num_probes = (u32 )adapter->scan_probes; } if ((unsigned int )*filtered_scan != 0U) { *max_chan_per_scan = 14U; } else { *max_chan_per_scan = 4U; } if (num_probes != 0U) { if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: scan: num_probes = %d\n", num_probes); } else { } } else { } num_probes_tlv = (struct mwifiex_ie_types_num_probes *)tlv_pos; num_probes_tlv->header.type = 258U; num_probes_tlv->header.len = 2U; num_probes_tlv->num_probes = (unsigned short )num_probes; tlv_pos = tlv_pos + ((unsigned long )num_probes_tlv->header.len + 4UL); } else { } if (((unsigned long )(priv->adapter)->fw_cap_info & 2048UL) != 0UL && (((int )(priv->adapter)->config_bands & 8) != 0 || ((int )(priv->adapter)->config_bands & 16) != 0)) { ht_cap = (struct mwifiex_ie_types_htcap *)tlv_pos; memset((void *)ht_cap, 0, 30UL); ht_cap->header.type = 45U; ht_cap->header.len = 26U; radio_type = mwifiex_band_to_radio_type((int )(priv->adapter)->config_bands); mwifiex_fill_cap_info(priv, (int )radio_type, & ht_cap->ht_cap); tlv_pos = tlv_pos + 30UL; } else { } mwifiex_cmd_append_vsie_tlv(priv, 1, & tlv_pos); *chan_list_out = (struct mwifiex_ie_types_chan_list_param_set *)tlv_pos; if ((unsigned long )user_scan_in != (unsigned long )((struct mwifiex_user_scan_cfg const *)0) && (unsigned int )((unsigned char )user_scan_in->chan_list[0].chan_number) != 0U) { if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: Scan: Using supplied channel list\n"); } else { } } else { } chan_idx = 0U; goto ldv_61105; ldv_61104: channel = user_scan_in->chan_list[chan_idx].chan_number; (scan_chan_list + (unsigned long )chan_idx)->chan_number = channel; radio_type = user_scan_in->chan_list[chan_idx].radio_type; (scan_chan_list + (unsigned long )chan_idx)->radio_type = radio_type; scan_type = (u32 )user_scan_in->chan_list[chan_idx].scan_type; if (scan_type == 2U) { (scan_chan_list + (unsigned long )chan_idx)->chan_scan_mode_bitmap = (u8 )((unsigned int )(scan_chan_list + (unsigned long )chan_idx)->chan_scan_mode_bitmap | 1U); } else { (scan_chan_list + (unsigned long )chan_idx)->chan_scan_mode_bitmap = (unsigned int )(scan_chan_list + (unsigned long )chan_idx)->chan_scan_mode_bitmap & 254U; } if ((unsigned int )*filtered_scan != 0U) { (scan_chan_list + (unsigned long )chan_idx)->chan_scan_mode_bitmap = (u8 )((unsigned int )(scan_chan_list + (unsigned long )chan_idx)->chan_scan_mode_bitmap | 2U); } else { } if ((unsigned int )user_scan_in->chan_list[chan_idx].scan_time != 0U) { scan_dur = (unsigned short )user_scan_in->chan_list[chan_idx].scan_time; } else if (scan_type == 2U) { scan_dur = adapter->passive_scan_time; } else if ((unsigned int )*filtered_scan != 0U) { scan_dur = adapter->specific_scan_time; } else { scan_dur = adapter->active_scan_time; } (scan_chan_list + (unsigned long )chan_idx)->min_scan_time = scan_dur; (scan_chan_list + (unsigned long )chan_idx)->max_scan_time = scan_dur; chan_idx = chan_idx + 1U; ldv_61105: ; if (chan_idx <= 49U && (unsigned int )((unsigned char )user_scan_in->chan_list[chan_idx].chan_number) != 0U) { goto ldv_61104; } else { } if (chan_idx == 1U && (u32 )user_scan_in->chan_list[0].chan_number == priv->curr_bss_params.bss_descriptor.channel) { *scan_current_only = 1U; if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: Scan: Scanning current channel only\n"); } else { } } else { } } else { } chan_num = chan_idx; } else { if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: Scan: Creating full region channel list\n"); } else { } } else { } tmp___3 = mwifiex_scan_create_channel_list(priv, user_scan_in, scan_chan_list, (int )*filtered_scan); chan_num = (u32 )tmp___3; } return; } } static void mwifiex_ret_802_11_scan_get_tlv_ptrs(struct mwifiex_adapter *adapter , struct mwifiex_ie_types_data *tlv , u32 tlv_buf_size , u32 req_tlv_type , struct mwifiex_ie_types_data **tlv_data ) { struct mwifiex_ie_types_data *current_tlv ; u32 tlv_buf_left ; u32 tlv_type ; u32 tlv_len ; { current_tlv = tlv; tlv_buf_left = tlv_buf_size; *tlv_data = (struct mwifiex_ie_types_data *)0; if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: SCAN_RESP: tlv_buf_size = %d\n", tlv_buf_size); } else { } } else { } goto ldv_61124; ldv_61123: tlv_type = (u32 )current_tlv->header.type; tlv_len = (u32 )current_tlv->header.len; if ((unsigned long )tlv_len + 4UL > (unsigned long )tlv_buf_left) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "SCAN_RESP: TLV buffer corrupt\n"); } else { } } else { } goto ldv_61118; } else { } if (req_tlv_type == tlv_type) { switch (tlv_type) { case 275U: ; if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: SCAN_RESP: TSF\ttimestamp TLV, len = %d\n", tlv_len); } else { } } else { } *tlv_data = current_tlv; goto ldv_61120; case 298U: ; if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: SCAN_RESP: channel\tband list TLV, len = %d\n", tlv_len); } else { } } else { } *tlv_data = current_tlv; goto ldv_61120; default: ; if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "SCAN_RESP: unhandled TLV = %d\n", tlv_type); } else { } } else { } return; } ldv_61120: ; } else { } if ((unsigned long )*tlv_data != (unsigned long )((struct mwifiex_ie_types_data *)0)) { goto ldv_61118; } else { } tlv_buf_left = (tlv_buf_left - tlv_len) - 4U; current_tlv = (struct mwifiex_ie_types_data *)(& current_tlv->data) + (unsigned long )tlv_len; ldv_61124: ; if (tlv_buf_left > 3U) { goto ldv_61123; } else { } ldv_61118: ; return; } } int mwifiex_update_bss_desc_with_ie(struct mwifiex_adapter *adapter , struct mwifiex_bssdescriptor *bss_entry ) { int ret ; u8 element_id ; struct ieee_types_fh_param_set *fh_param_set ; struct ieee_types_ds_param_set *ds_param_set ; struct ieee_types_cf_param_set *cf_param_set ; struct ieee_types_ibss_param_set *ibss_param_set ; u8 *current_ptr ; u8 *rate ; u8 element_len ; u16 total_ie_len ; u8 bytes_to_copy ; u8 rate_size ; u8 found_data_rate_ie ; u32 bytes_left ; struct ieee_types_vendor_specific *vendor_ie ; u8 wpa_oui[4U] ; u8 wmm_oui[4U] ; int tmp ; int tmp___0 ; { ret = 0; wpa_oui[0] = 0U; wpa_oui[1] = 80U; wpa_oui[2] = 242U; wpa_oui[3] = 1U; wmm_oui[0] = 0U; wmm_oui[1] = 80U; wmm_oui[2] = 242U; wmm_oui[3] = 2U; found_data_rate_ie = 0U; rate_size = 0U; current_ptr = bss_entry->beacon_buf; bytes_left = bss_entry->beacon_buf_size; goto ldv_61172; ldv_61171: element_id = *current_ptr; element_len = *(current_ptr + 1UL); total_ie_len = (unsigned int )((u16 )element_len) + 2U; if ((u32 )total_ie_len > bytes_left) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "err: InterpretIE: in processing\tIE, bytes left < IE length\n"); } else { } } else { } return (-1); } else { } switch ((int )element_id) { case 0: bss_entry->ssid.ssid_len = element_len; memcpy((void *)(& bss_entry->ssid.ssid), (void const *)current_ptr + 2U, (size_t )element_len); if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: InterpretIE: ssid: %-32s\n", (u8 *)(& bss_entry->ssid.ssid)); } else { } } else { } goto ldv_61147; case 1: memcpy((void *)(& bss_entry->data_rates), (void const *)current_ptr + 2U, (size_t )element_len); memcpy((void *)(& bss_entry->supported_rates), (void const *)current_ptr + 2U, (size_t )element_len); rate_size = element_len; found_data_rate_ie = 1U; goto ldv_61147; case 2: fh_param_set = (struct ieee_types_fh_param_set *)current_ptr; memcpy((void *)(& bss_entry->phy_param_set.fh_param_set), (void const *)fh_param_set, 7UL); goto ldv_61147; case 3: ds_param_set = (struct ieee_types_ds_param_set *)current_ptr; bss_entry->channel = (u32 )ds_param_set->current_chan; memcpy((void *)(& bss_entry->phy_param_set.ds_param_set), (void const *)ds_param_set, 3UL); goto ldv_61147; case 4: cf_param_set = (struct ieee_types_cf_param_set *)current_ptr; memcpy((void *)(& bss_entry->ss_param_set.cf_param_set), (void const *)cf_param_set, 8UL); goto ldv_61147; case 6: ibss_param_set = (struct ieee_types_ibss_param_set *)current_ptr; memcpy((void *)(& bss_entry->ss_param_set.ibss_param_set), (void const *)ibss_param_set, 4UL); goto ldv_61147; case 42: bss_entry->erp_flags = *(current_ptr + 2UL); goto ldv_61147; case 32: bss_entry->local_constraint = *(current_ptr + 2UL); bss_entry->sensed_11h = 1U; goto ldv_61147; case 37: bss_entry->chan_sw_ie_present = 1U; case 33: ; case 35: ; case 40: bss_entry->sensed_11h = 1U; goto ldv_61147; case 50: ; if ((unsigned int )found_data_rate_ie != 0U) { if ((int )element_len + (int )rate_size > 14) { bytes_to_copy = 14U - (unsigned int )rate_size; } else { bytes_to_copy = element_len; } rate = (u8 *)(& bss_entry->data_rates); rate = rate + (unsigned long )rate_size; memcpy((void *)rate, (void const *)current_ptr + 2U, (size_t )bytes_to_copy); rate = (u8 *)(& bss_entry->supported_rates); rate = rate + (unsigned long )rate_size; memcpy((void *)rate, (void const *)current_ptr + 2U, (size_t )bytes_to_copy); } else { } goto ldv_61147; case 221: vendor_ie = (struct ieee_types_vendor_specific *)current_ptr; tmp___0 = memcmp((void const *)(& vendor_ie->vend_hdr.oui), (void const *)(& wpa_oui), 4UL); if (tmp___0 == 0) { bss_entry->bcn_wpa_ie = (struct ieee_types_vendor_specific *)current_ptr; bss_entry->wpa_offset = (int )((unsigned short )((long )current_ptr)) - (int )((unsigned short )((long )bss_entry->beacon_buf)); } else { tmp = memcmp((void const *)(& vendor_ie->vend_hdr.oui), (void const *)(& wmm_oui), 4UL); if (tmp == 0) { if ((unsigned int )total_ie_len == 26U || (unsigned int )total_ie_len == 9U) { memcpy((void *)(& bss_entry->wmm_ie), (void const *)current_ptr, (size_t )total_ie_len); } else { } } else { } } goto ldv_61147; case 48: bss_entry->bcn_rsn_ie = (struct ieee_types_generic *)current_ptr; bss_entry->rsn_offset = (int )((unsigned short )((long )current_ptr)) - (int )((unsigned short )((long )bss_entry->beacon_buf)); goto ldv_61147; case 68: bss_entry->bcn_wapi_ie = (struct ieee_types_generic *)current_ptr; bss_entry->wapi_offset = (int )((unsigned short )((long )current_ptr)) - (int )((unsigned short )((long )bss_entry->beacon_buf)); goto ldv_61147; case 45: bss_entry->bcn_ht_cap = (struct ieee80211_ht_cap *)current_ptr + 2U; bss_entry->ht_cap_offset = (int )((unsigned short )((long )(current_ptr + 2UL))) - (int )((unsigned short )((long )bss_entry->beacon_buf)); goto ldv_61147; case 61: bss_entry->bcn_ht_oper = (struct ieee80211_ht_operation *)current_ptr + 2U; bss_entry->ht_info_offset = (int )((unsigned short )((long )(current_ptr + 2UL))) - (int )((unsigned short )((long )bss_entry->beacon_buf)); goto ldv_61147; case 191: bss_entry->disable_11ac = 0U; bss_entry->bcn_vht_cap = (struct ieee80211_vht_cap *)current_ptr + 2U; bss_entry->vht_cap_offset = (int )((unsigned short )((long )bss_entry->bcn_vht_cap)) - (int )((unsigned short )((long )bss_entry->beacon_buf)); goto ldv_61147; case 192: bss_entry->bcn_vht_oper = (struct ieee80211_vht_operation *)current_ptr + 2U; bss_entry->vht_info_offset = (int )((unsigned short )((long )bss_entry->bcn_vht_oper)) - (int )((unsigned short )((long )bss_entry->beacon_buf)); goto ldv_61147; case 72: bss_entry->bcn_bss_co_2040 = current_ptr; bss_entry->bss_co_2040_offset = (int )((unsigned short )((long )current_ptr)) - (int )((unsigned short )((long )bss_entry->beacon_buf)); goto ldv_61147; case 127: bss_entry->bcn_ext_cap = current_ptr; bss_entry->ext_cap_offset = (int )((unsigned short )((long )current_ptr)) - (int )((unsigned short )((long )bss_entry->beacon_buf)); goto ldv_61147; case 199: bss_entry->oper_mode = (struct ieee_types_oper_mode_ntf *)current_ptr; bss_entry->oper_mode_offset = (int )((unsigned short )((long )bss_entry->oper_mode)) - (int )((unsigned short )((long )bss_entry->beacon_buf)); goto ldv_61147; default: ; goto ldv_61147; } ldv_61147: current_ptr = current_ptr + ((unsigned long )element_len + 2UL); bytes_left = (bytes_left - (u32 )element_len) + 4294967294U; ldv_61172: ; if (bytes_left > 1U) { goto ldv_61171; } else { } return (ret); } } static u8 mwifiex_radio_type_to_band(u8 radio_type ) { { switch ((int )radio_type) { case 1: ; return (4U); case 0: ; default: ; return (2U); } } } int mwifiex_scan_networks(struct mwifiex_private *priv , struct mwifiex_user_scan_cfg const *user_scan_in ) { int ret ; struct mwifiex_adapter *adapter ; struct cmd_ctrl_node *cmd_node ; union mwifiex_scan_cmd_config_tlv *scan_cfg_out ; struct mwifiex_ie_types_chan_list_param_set *chan_list_out ; struct mwifiex_chan_scan_param_set *scan_chan_list ; u8 filtered_scan ; u8 scan_current_chan_only ; u8 max_chan_per_scan ; unsigned long flags ; raw_spinlock_t *tmp ; void *tmp___0 ; void *tmp___1 ; raw_spinlock_t *tmp___2 ; struct list_head const *__mptr ; int tmp___3 ; raw_spinlock_t *tmp___4 ; { adapter = priv->adapter; if (adapter->scan_processing != 0U) { if ((adapter->debug_mask & 536870912U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cmd: Scan already in process...\n"); } else { } } else { } return (-16); } else { } if ((unsigned int )priv->scan_block != 0U) { if ((adapter->debug_mask & 536870912U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cmd: Scan is blocked during association...\n"); } else { } } else { } return (-16); } else { } if ((int )adapter->surprise_removed || (unsigned int )adapter->is_cmd_timedout != 0U) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "Ignore scan. Card removed or firmware in bad state\n"); } else { } } else { } return (-14); } else { } tmp = spinlock_check(& adapter->mwifiex_cmd_lock); flags = _raw_spin_lock_irqsave(tmp); adapter->scan_processing = 1U; spin_unlock_irqrestore(& adapter->mwifiex_cmd_lock, flags); tmp___0 = kzalloc(549UL, 208U); scan_cfg_out = (union mwifiex_scan_cmd_config_tlv *)tmp___0; if ((unsigned long )scan_cfg_out == (unsigned long )((union mwifiex_scan_cmd_config_tlv *)0)) { ret = -12; goto done; } else { } tmp___1 = kcalloc(50UL, 7UL, 208U); scan_chan_list = (struct mwifiex_chan_scan_param_set *)tmp___1; if ((unsigned long )scan_chan_list == (unsigned long )((struct mwifiex_chan_scan_param_set *)0)) { kfree((void const *)scan_cfg_out); ret = -12; goto done; } else { } mwifiex_config_scan(priv, user_scan_in, & scan_cfg_out->config, & chan_list_out, scan_chan_list, & max_chan_per_scan, & filtered_scan, & scan_current_chan_only); ret = mwifiex_scan_channel_list(priv, (u32 )max_chan_per_scan, (int )filtered_scan, & scan_cfg_out->config, chan_list_out, scan_chan_list); if (ret == 0) { tmp___2 = spinlock_check(& adapter->scan_pending_q_lock); flags = _raw_spin_lock_irqsave(tmp___2); tmp___3 = list_empty((struct list_head const *)(& adapter->scan_pending_q)); if (tmp___3 == 0) { __mptr = (struct list_head const *)adapter->scan_pending_q.next; cmd_node = (struct cmd_ctrl_node *)__mptr; list_del(& cmd_node->list); spin_unlock_irqrestore(& adapter->scan_pending_q_lock, flags); mwifiex_insert_cmd_to_pending_q(adapter, cmd_node, 1U); queue_work___1(adapter->workqueue, & adapter->main_work); if ((unsigned long )priv->scan_request == (unsigned long )((struct cfg80211_scan_request *)0)) { if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "wait internal scan\n"); } else { } } else { } mwifiex_wait_queue_complete(adapter, cmd_node); } else { } } else { spin_unlock_irqrestore(& adapter->scan_pending_q_lock, flags); } } else { } kfree((void const *)scan_cfg_out); kfree((void const *)scan_chan_list); done: ; if (ret != 0) { tmp___4 = spinlock_check(& adapter->mwifiex_cmd_lock); flags = _raw_spin_lock_irqsave(tmp___4); adapter->scan_processing = 0U; spin_unlock_irqrestore(& adapter->mwifiex_cmd_lock, flags); } else { } return (ret); } } int mwifiex_cmd_802_11_scan(struct host_cmd_ds_command *cmd , struct mwifiex_scan_cmd_config *scan_cfg ) { struct host_cmd_ds_802_11_scan *scan_cmd ; { scan_cmd = & cmd->params.scan; scan_cmd->bss_mode = scan_cfg->bss_mode; memcpy((void *)(& scan_cmd->bssid), (void const *)(& scan_cfg->specific_bssid), 6UL); memcpy((void *)(& scan_cmd->tlv_buffer), (void const *)(& scan_cfg->tlv_buf), (size_t )scan_cfg->tlv_buf_len); cmd->command = 6U; cmd->size = (unsigned int )((unsigned short )scan_cfg->tlv_buf_len) + 15U; return (0); } } int mwifiex_check_network_compatibility(struct mwifiex_private *priv , struct mwifiex_bssdescriptor *bss_desc ) { int ret ; struct mwifiex_chan_freq_power *tmp ; { ret = -1; if ((unsigned long )bss_desc == (unsigned long )((struct mwifiex_bssdescriptor *)0)) { return (-1); } else { } tmp = mwifiex_get_cfp(priv, (int )((unsigned char )bss_desc->bss_band), (int )((unsigned short )bss_desc->channel), 0U); if ((unsigned long )tmp != (unsigned long )((struct mwifiex_chan_freq_power *)0)) { switch (priv->bss_mode) { case 2U: ; case 1U: ret = mwifiex_is_network_compatible(priv, bss_desc, priv->bss_mode); if (ret != 0) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Incompatible network settings\n"); } else { } } else { } } else { } goto ldv_61218; default: ret = 0; } ldv_61218: ; } else { } return (ret); } } static int mwifiex_update_curr_bss_params(struct mwifiex_private *priv , struct cfg80211_bss *bss ) { struct mwifiex_bssdescriptor *bss_desc ; int ret ; unsigned long flags ; void *tmp ; raw_spinlock_t *tmp___0 ; { tmp = kzalloc(336UL, 208U); bss_desc = (struct mwifiex_bssdescriptor *)tmp; if ((unsigned long )bss_desc == (unsigned long )((struct mwifiex_bssdescriptor *)0)) { return (-12); } else { } ret = mwifiex_fill_new_bss_desc(priv, bss, bss_desc); if (ret != 0) { goto done; } else { } ret = mwifiex_check_network_compatibility(priv, bss_desc); if (ret != 0) { goto done; } else { } tmp___0 = spinlock_check(& priv->curr_bcn_buf_lock); flags = _raw_spin_lock_irqsave(tmp___0); memcpy((void *)(& priv->curr_bss_params.bss_descriptor), (void const *)bss_desc, 336UL); mwifiex_save_curr_bcn(priv); spin_unlock_irqrestore(& priv->curr_bcn_buf_lock, flags); done: kfree((void const *)bss_desc->beacon_buf); kfree((void const *)bss_desc); return (0); } } static int mwifiex_parse_single_response_buf(struct mwifiex_private *priv , u8 **bss_info , u32 *bytes_left , u64 fw_tsf , u8 *radio_type , bool ext_scan , s32 rssi_val ) { struct mwifiex_adapter *adapter ; struct mwifiex_chan_freq_power *cfp ; struct cfg80211_bss *bss ; u8 bssid[6U] ; s32 rssi ; u8 const *ie_buf ; size_t ie_len ; u16 channel ; u16 beacon_size ; u32 curr_bcn_bytes ; u32 freq ; u16 beacon_period ; u16 cap_info_bitmap ; u8 *current_ptr ; u64 timestamp ; struct mwifiex_fixed_bcn_param *bcn_param ; struct mwifiex_bss_priv *bss_priv ; u8 element_id ; u8 element_len ; struct ieee80211_channel *chan ; u8 band ; int tmp ; { adapter = priv->adapter; channel = 0U; beacon_size = 0U; if (*bytes_left > 1U) { beacon_size = *((__le16 *)*bss_info); *bytes_left = *bytes_left - 2U; *bss_info = *bss_info + 2UL; } else { } if ((unsigned int )beacon_size == 0U || (u32 )beacon_size > *bytes_left) { *bss_info = *bss_info + (unsigned long )*bytes_left; *bytes_left = 0U; return (-14); } else { } current_ptr = *bss_info; *bss_info = *bss_info + (unsigned long )beacon_size; *bytes_left = *bytes_left - (u32 )beacon_size; curr_bcn_bytes = (u32 )beacon_size; if (curr_bcn_bytes <= 18U) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "InterpretIE: not enough bytes left\n"); } else { } } else { } return (-14); } else { } memcpy((void *)(& bssid), (void const *)current_ptr, 6UL); current_ptr = current_ptr + 6UL; curr_bcn_bytes = curr_bcn_bytes - 6U; if (! ext_scan) { rssi = (int )*current_ptr; rssi = rssi * -100; current_ptr = current_ptr + 1UL; curr_bcn_bytes = curr_bcn_bytes - 1U; if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: InterpretIE: RSSI=%d\n", rssi); } else { } } else { } } else { rssi = rssi_val; } bcn_param = (struct mwifiex_fixed_bcn_param *)current_ptr; current_ptr = current_ptr + 12UL; curr_bcn_bytes = curr_bcn_bytes - 12U; timestamp = bcn_param->timestamp; beacon_period = bcn_param->beacon_period; cap_info_bitmap = bcn_param->cap_info_bitmap; if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: InterpretIE: capabilities=0x%X\n", (int )cap_info_bitmap); } else { } } else { } ie_buf = (u8 const *)current_ptr; ie_len = (size_t )curr_bcn_bytes; if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: InterpretIE: IELength for this AP = %d\n", curr_bcn_bytes); } else { } } else { } goto ldv_61262; ldv_61261: element_id = *current_ptr; element_len = *(current_ptr + 1UL); if ((unsigned long )curr_bcn_bytes < (unsigned long )element_len + 2UL) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "%s: bytes left < IE length\n", "mwifiex_parse_single_response_buf"); } else { } } else { } return (-14); } else { } if ((unsigned int )element_id == 3U) { channel = (u16 )*(current_ptr + 2UL); goto ldv_61260; } else { } current_ptr = current_ptr + ((unsigned long )element_len + 2UL); curr_bcn_bytes = (curr_bcn_bytes - (u32 )element_len) - 2U; ldv_61262: ; if (curr_bcn_bytes > 1U) { goto ldv_61261; } else { } ldv_61260: ; if ((unsigned int )channel != 0U) { if ((int )((unsigned short )priv->csa_chan) == (int )channel) { if ((adapter->debug_mask & 536870912U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "Dropping entry on csa closed channel\n"); } else { } } else { } return (0); } else { } band = 2U; if ((unsigned long )radio_type != (unsigned long )((u8 *)0U)) { band = mwifiex_radio_type_to_band((int )*radio_type & 3); } else { } cfp = mwifiex_get_cfp(priv, (int )band, (int )channel, 0U); freq = (unsigned long )cfp != (unsigned long )((struct mwifiex_chan_freq_power *)0) ? cfp->freq : 0U; chan = ieee80211_get_channel(priv->wdev.wiphy, (int )freq); if ((unsigned long )chan != (unsigned long )((struct ieee80211_channel *)0) && (chan->flags & 1U) == 0U) { bss = cfg80211_inform_bss(priv->wdev.wiphy, chan, 0, (u8 const *)(& bssid), timestamp, (int )cap_info_bitmap, (int )beacon_period, ie_buf, ie_len, rssi, 208U); bss_priv = (struct mwifiex_bss_priv *)(& bss->priv); bss_priv->band = band; bss_priv->fw_tsf = fw_tsf; if ((unsigned int )priv->media_connected != 0U) { tmp = memcmp((void const *)(& bssid), (void const *)(& priv->curr_bss_params.bss_descriptor.mac_address), 6UL); if (tmp == 0) { mwifiex_update_curr_bss_params(priv, bss); } else { } } else { } cfg80211_put_bss(priv->wdev.wiphy, bss); } else { } } else if ((adapter->debug_mask & 536870912U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "missing BSS channel IE\n"); } else { } } else { } return (0); } } static void mwifiex_complete_scan(struct mwifiex_private *priv ) { struct mwifiex_adapter *adapter ; { adapter = priv->adapter; adapter->survey_idx = 0; if ((adapter->curr_cmd)->wait_q_enabled != 0U) { adapter->cmd_wait_q.status = 0; if ((unsigned long )priv->scan_request == (unsigned long )((struct cfg80211_scan_request *)0)) { if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "complete internal scan\n"); } else { } } else { } mwifiex_complete_cmd(adapter, adapter->curr_cmd); } else { } } else { } return; } } static void mwifiex_check_next_scan_command(struct mwifiex_private *priv ) { struct mwifiex_adapter *adapter ; struct cmd_ctrl_node *cmd_node ; struct cmd_ctrl_node *tmp_node ; unsigned long flags ; raw_spinlock_t *tmp ; raw_spinlock_t *tmp___0 ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; raw_spinlock_t *tmp___1 ; struct list_head const *__mptr___2 ; int tmp___2 ; { adapter = priv->adapter; tmp = spinlock_check(& adapter->scan_pending_q_lock); flags = _raw_spin_lock_irqsave(tmp); tmp___2 = list_empty((struct list_head const *)(& adapter->scan_pending_q)); if (tmp___2 != 0) { spin_unlock_irqrestore(& adapter->scan_pending_q_lock, flags); tmp___0 = spinlock_check(& adapter->mwifiex_cmd_lock); flags = _raw_spin_lock_irqsave(tmp___0); adapter->scan_processing = 0U; spin_unlock_irqrestore(& adapter->mwifiex_cmd_lock, flags); if (! adapter->ext_scan) { mwifiex_complete_scan(priv); } else { } if ((unsigned long )priv->scan_request != (unsigned long )((struct cfg80211_scan_request *)0)) { if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: notifying scan done\n"); } else { } } else { } cfg80211_scan_done(priv->scan_request, 0); priv->scan_request = (struct cfg80211_scan_request *)0; } else { priv->scan_aborting = 0; if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: scan already aborted\n"); } else { } } else { } } } else if (((int )priv->scan_aborting && (unsigned long )priv->scan_request == (unsigned long )((struct cfg80211_scan_request *)0)) || (unsigned int )priv->scan_block != 0U) { __mptr = (struct list_head const *)adapter->scan_pending_q.next; cmd_node = (struct cmd_ctrl_node *)__mptr; __mptr___0 = (struct list_head const *)cmd_node->list.next; tmp_node = (struct cmd_ctrl_node *)__mptr___0; goto ldv_61289; ldv_61288: list_del(& cmd_node->list); mwifiex_insert_cmd_to_free_q(adapter, cmd_node); cmd_node = tmp_node; __mptr___1 = (struct list_head const *)tmp_node->list.next; tmp_node = (struct cmd_ctrl_node *)__mptr___1; ldv_61289: ; if ((unsigned long )(& cmd_node->list) != (unsigned long )(& adapter->scan_pending_q)) { goto ldv_61288; } else { } spin_unlock_irqrestore(& adapter->scan_pending_q_lock, flags); tmp___1 = spinlock_check(& adapter->mwifiex_cmd_lock); flags = _raw_spin_lock_irqsave(tmp___1); adapter->scan_processing = 0U; spin_unlock_irqrestore(& adapter->mwifiex_cmd_lock, flags); if ((unsigned long )priv->scan_request != (unsigned long )((struct cfg80211_scan_request *)0)) { if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: aborting scan\n"); } else { } } else { } cfg80211_scan_done(priv->scan_request, 1); priv->scan_request = (struct cfg80211_scan_request *)0; } else { priv->scan_aborting = 0; if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: scan already aborted\n"); } else { } } else { } } } else { __mptr___2 = (struct list_head const *)adapter->scan_pending_q.next; cmd_node = (struct cmd_ctrl_node *)__mptr___2; list_del(& cmd_node->list); spin_unlock_irqrestore(& adapter->scan_pending_q_lock, flags); mwifiex_insert_cmd_to_pending_q(adapter, cmd_node, 1U); } return; } } int mwifiex_ret_802_11_scan(struct mwifiex_private *priv , struct host_cmd_ds_command *resp ) { int ret ; struct mwifiex_adapter *adapter ; struct host_cmd_ds_802_11_scan_rsp *scan_rsp ; struct mwifiex_ie_types_data *tlv_data ; struct mwifiex_ie_types_tsf_timestamp *tsf_tlv ; u8 *bss_info ; u32 scan_resp_size ; u32 bytes_left ; u32 idx ; u32 tlv_buf_size ; struct mwifiex_ie_types_chan_band_list_param_set *chan_band_tlv ; struct chan_band_param_set *chan_band ; u8 is_bgscan_resp ; __le64 fw_tsf ; u8 *radio_type ; { ret = 0; adapter = priv->adapter; fw_tsf = 0ULL; is_bgscan_resp = (unsigned int )resp->command == 108U; if ((unsigned int )is_bgscan_resp != 0U) { scan_rsp = & resp->params.bg_scan_query_resp.scan_resp; } else { scan_rsp = & resp->params.scan_resp; } if ((unsigned int )scan_rsp->number_of_sets > 64U) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "SCAN_RESP: too many AP returned (%d)\n", (int )scan_rsp->number_of_sets); } else { } } else { } ret = -1; goto check_next_scan; } else { } mwifiex_11h_get_csa_closed_channel(priv); bytes_left = (u32 )scan_rsp->bss_descript_size; if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: SCAN_RESP: bss_descript_size %d\n", bytes_left); } else { } } else { } scan_resp_size = (u32 )resp->size; if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: SCAN_RESP: returned %d APs before parsing\n", (int )scan_rsp->number_of_sets); } else { } } else { } bss_info = (u8 *)(& scan_rsp->bss_desc_and_tlv_buffer); tlv_buf_size = (scan_resp_size - bytes_left) - 11U; tlv_data = (struct mwifiex_ie_types_data *)(& scan_rsp->bss_desc_and_tlv_buffer) + (unsigned long )bytes_left; mwifiex_ret_802_11_scan_get_tlv_ptrs(adapter, tlv_data, tlv_buf_size, 275U, (struct mwifiex_ie_types_data **)(& tsf_tlv)); mwifiex_ret_802_11_scan_get_tlv_ptrs(adapter, tlv_data, tlv_buf_size, 298U, (struct mwifiex_ie_types_data **)(& chan_band_tlv)); idx = 0U; goto ldv_61317; ldv_61316: ; if ((unsigned long )tsf_tlv != (unsigned long )((struct mwifiex_ie_types_tsf_timestamp *)0)) { memcpy((void *)(& fw_tsf), (void const *)(& tsf_tlv->tsf_data) + (unsigned long )(idx * 8U), 8UL); } else { } if ((unsigned long )chan_band_tlv != (unsigned long )((struct mwifiex_ie_types_chan_band_list_param_set *)0)) { chan_band = (struct chan_band_param_set *)(& chan_band_tlv->chan_band_param) + (unsigned long )idx; radio_type = & chan_band->radio_type; } else { radio_type = (u8 *)0U; } ret = mwifiex_parse_single_response_buf(priv, & bss_info, & bytes_left, fw_tsf, radio_type, 0, 0); if (ret != 0) { goto check_next_scan; } else { } idx = idx + 1U; ldv_61317: ; if ((u32 )scan_rsp->number_of_sets > idx && bytes_left != 0U) { goto ldv_61316; } else { } check_next_scan: mwifiex_check_next_scan_command(priv); return (ret); } } int mwifiex_cmd_802_11_scan_ext(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd , void *data_buf ) { struct host_cmd_ds_802_11_scan_ext *ext_scan ; struct mwifiex_scan_cmd_config *scan_cfg ; { ext_scan = & cmd->params.ext_scan; scan_cfg = (struct mwifiex_scan_cmd_config *)data_buf; memcpy((void *)(& ext_scan->tlv_buffer), (void const *)(& scan_cfg->tlv_buf), (size_t )scan_cfg->tlv_buf_len); cmd->command = 263U; cmd->size = (unsigned int )((unsigned short )scan_cfg->tlv_buf_len) + 12U; return (0); } } static void mwifiex_update_chan_statistics(struct mwifiex_private *priv , struct mwifiex_ietypes_chanstats *tlv_stat ) { struct mwifiex_adapter *adapter ; u8 i ; u8 num_chan ; struct mwifiex_fw_chan_stats *fw_chan_stats ; struct mwifiex_chan_stats chan_stats ; int tmp ; { adapter = priv->adapter; fw_chan_stats = (struct mwifiex_fw_chan_stats *)tlv_stat + 4U; num_chan = (u8 )((unsigned int )tlv_stat->header.len / 10U); i = 0U; goto ldv_61336; ldv_61335: chan_stats.chan_num = fw_chan_stats->chan_num; chan_stats.bandcfg = fw_chan_stats->bandcfg; chan_stats.flags = fw_chan_stats->flags; chan_stats.noise = fw_chan_stats->noise; chan_stats.total_bss = fw_chan_stats->total_bss; chan_stats.cca_scan_dur = fw_chan_stats->cca_scan_dur; chan_stats.cca_busy_dur = fw_chan_stats->cca_busy_dur; if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "chan=%d, noise=%d, total_network=%d scan_duration=%d, busy_duration=%d\n", (int )chan_stats.chan_num, (int )chan_stats.noise, (int )chan_stats.total_bss, (int )chan_stats.cca_scan_dur, (int )chan_stats.cca_busy_dur); } else { } } else { } tmp = adapter->survey_idx; adapter->survey_idx = adapter->survey_idx + 1; memcpy((void *)adapter->chan_stats + (unsigned long )tmp, (void const *)(& chan_stats), 10UL); fw_chan_stats = fw_chan_stats + 1; i = (u8 )((int )i + 1); ldv_61336: ; if ((int )i < (int )num_chan) { goto ldv_61335; } else { } return; } } int mwifiex_ret_802_11_scan_ext(struct mwifiex_private *priv , struct host_cmd_ds_command *resp ) { struct mwifiex_adapter *adapter ; struct host_cmd_ds_802_11_scan_ext *ext_scan_resp ; struct mwifiex_ie_types_header *tlv ; struct mwifiex_ietypes_chanstats *tlv_stat ; u16 buf_left ; u16 type ; u16 len ; struct host_cmd_ds_command *cmd_ptr ; struct cmd_ctrl_node *cmd_node ; unsigned long cmd_flags ; unsigned long scan_flags ; bool complete_scan ; raw_spinlock_t *tmp ; raw_spinlock_t *tmp___0 ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; int tmp___1 ; { adapter = priv->adapter; complete_scan = 0; if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: EXT scan returns successfully\n"); } else { } } else { } ext_scan_resp = & resp->params.ext_scan; tlv = (struct mwifiex_ie_types_header *)(& ext_scan_resp->tlv_buffer); buf_left = (unsigned int )resp->size - 12U; goto ldv_61359; ldv_61358: type = tlv->type; len = tlv->len; if ((unsigned long )buf_left < (unsigned long )len + 4UL) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "error processing scan response TLVs"); } else { } } else { } goto ldv_61354; } else { } switch ((int )type) { case 454: tlv_stat = (struct mwifiex_ietypes_chanstats *)tlv; mwifiex_update_chan_statistics(priv, tlv_stat); goto ldv_61356; default: ; goto ldv_61356; } ldv_61356: buf_left = (unsigned int )((int )buf_left - (int )len) - 4U; tlv = tlv + ((unsigned long )len + 4UL); ldv_61359: ; if ((unsigned int )buf_left > 3U) { goto ldv_61358; } else { } ldv_61354: tmp = spinlock_check(& adapter->cmd_pending_q_lock); cmd_flags = _raw_spin_lock_irqsave(tmp); tmp___0 = spinlock_check(& adapter->scan_pending_q_lock); scan_flags = _raw_spin_lock_irqsave(tmp___0); tmp___1 = list_empty((struct list_head const *)(& adapter->scan_pending_q)); if (tmp___1 != 0) { complete_scan = 1; __mptr = (struct list_head const *)adapter->cmd_pending_q.next; cmd_node = (struct cmd_ctrl_node *)__mptr; goto ldv_61372; ldv_61371: cmd_ptr = (struct host_cmd_ds_command *)(cmd_node->cmd_skb)->data; if ((unsigned int )cmd_ptr->command == 263U) { if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "Scan pending in command pending list"); } else { } } else { } complete_scan = 0; goto ldv_61370; } else { } __mptr___0 = (struct list_head const *)cmd_node->list.next; cmd_node = (struct cmd_ctrl_node *)__mptr___0; ldv_61372: ; if ((unsigned long )(& cmd_node->list) != (unsigned long )(& adapter->cmd_pending_q)) { goto ldv_61371; } else { } ldv_61370: ; } else { } spin_unlock_irqrestore(& adapter->scan_pending_q_lock, scan_flags); spin_unlock_irqrestore(& adapter->cmd_pending_q_lock, cmd_flags); if ((int )complete_scan) { mwifiex_complete_scan(priv); } else { } return (0); } } int mwifiex_handle_event_ext_scan_report(struct mwifiex_private *priv , void *buf ) { int ret ; struct mwifiex_adapter *adapter ; u8 *bss_info ; u32 bytes_left ; u32 bytes_left_for_tlv ; u32 idx ; u16 type ; u16 len ; struct mwifiex_ie_types_data *tlv ; struct mwifiex_ie_types_bss_scan_rsp *scan_rsp_tlv ; struct mwifiex_ie_types_bss_scan_info *scan_info_tlv ; u8 *radio_type ; u64 fw_tsf ; s32 rssi ; struct mwifiex_event_scan_result *event_scan ; u8 num_of_set ; u8 *scan_resp ; u16 scan_resp_size ; { ret = 0; adapter = priv->adapter; fw_tsf = 0ULL; rssi = 0; event_scan = (struct mwifiex_event_scan_result *)buf; num_of_set = event_scan->num_of_set; scan_resp = (u8 *)buf + 11U; scan_resp_size = event_scan->buf_size; if ((unsigned int )num_of_set > 64U) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "EXT_SCAN: Invalid number of AP returned (%d)!!\n", (int )num_of_set); } else { } } else { } ret = -1; goto check_next_scan; } else { } bytes_left = (u32 )scan_resp_size; if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "EXT_SCAN: size %d, returned %d APs...", (int )scan_resp_size, (int )num_of_set); } else { } } else { } if ((adapter->debug_mask & 131072U) != 0U) { print_hex_dump("\017", "EXT_SCAN buffer:", 2, 16, 1, (void const *)buf, (unsigned long )scan_resp_size + 11UL, 0); } else { } tlv = (struct mwifiex_ie_types_data *)scan_resp; idx = 0U; goto ldv_61404; ldv_61403: type = tlv->header.type; len = tlv->header.len; if ((unsigned long )bytes_left < (unsigned long )len + 4UL) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "EXT_SCAN: Error bytes left < TLV length\n"); } else { } } else { } goto ldv_61396; } else { } scan_rsp_tlv = (struct mwifiex_ie_types_bss_scan_rsp *)0; scan_info_tlv = (struct mwifiex_ie_types_bss_scan_info *)0; bytes_left_for_tlv = bytes_left; if ((unsigned int )type != 342U) { goto ldv_61396; } else { } bss_info = (u8 *)tlv; scan_rsp_tlv = (struct mwifiex_ie_types_bss_scan_rsp *)tlv; tlv = (struct mwifiex_ie_types_data *)(& tlv->data) + (unsigned long )len; bytes_left_for_tlv = (bytes_left_for_tlv - (u32 )len) - 4U; goto ldv_61397; ldv_61401: type = tlv->header.type; len = tlv->header.len; if ((unsigned long )bytes_left_for_tlv < (unsigned long )len + 4UL) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "EXT_SCAN: Error in processing TLV,\tbytes left < TLV length\n"); } else { } } else { } scan_rsp_tlv = (struct mwifiex_ie_types_bss_scan_rsp *)0; bytes_left_for_tlv = 0U; goto ldv_61397; } else { } switch ((int )type) { case 343: scan_info_tlv = (struct mwifiex_ie_types_bss_scan_info *)tlv; if ((unsigned int )len != 16U) { bytes_left_for_tlv = 0U; goto ldv_61397; } else { } goto ldv_61399; default: ; goto ldv_61399; } ldv_61399: tlv = (struct mwifiex_ie_types_data *)(& tlv->data) + (unsigned long )len; bytes_left = (bytes_left - (u32 )len) - 4U; bytes_left_for_tlv = (bytes_left_for_tlv - (u32 )len) - 4U; ldv_61397: ; if (bytes_left_for_tlv > 3U && (unsigned int )tlv->header.type != 342U) { goto ldv_61401; } else { } if ((unsigned long )scan_rsp_tlv == (unsigned long )((struct mwifiex_ie_types_bss_scan_rsp *)0)) { goto ldv_61396; } else { } bss_info = bss_info + 2UL; bytes_left = bytes_left - 2U; if ((unsigned long )scan_info_tlv != (unsigned long )((struct mwifiex_ie_types_bss_scan_info *)0)) { rssi = (int )((short )scan_info_tlv->rssi); rssi = rssi * 100; if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: InterpretIE: RSSI=%d\n", rssi); } else { } } else { } fw_tsf = scan_info_tlv->tsf; radio_type = & scan_info_tlv->radio_type; } else { radio_type = (u8 *)0U; } ret = mwifiex_parse_single_response_buf(priv, & bss_info, & bytes_left, fw_tsf, radio_type, 1, rssi); if (ret != 0) { goto check_next_scan; } else { } idx = idx + 1U; ldv_61404: ; if ((u32 )num_of_set > idx && bytes_left != 0U) { goto ldv_61403; } else { } ldv_61396: ; check_next_scan: ; if ((unsigned int )event_scan->more_event == 0U) { mwifiex_check_next_scan_command(priv); } else { } return (ret); } } int mwifiex_cmd_802_11_bg_scan_query(struct host_cmd_ds_command *cmd ) { struct host_cmd_ds_802_11_bg_scan_query *bg_query ; { bg_query = & cmd->params.bg_scan_query; cmd->command = 108U; cmd->size = 9U; bg_query->flush = 1U; return (0); } } void mwifiex_queue_scan_cmd(struct mwifiex_private *priv , struct cmd_ctrl_node *cmd_node ) { struct mwifiex_adapter *adapter ; unsigned long flags ; raw_spinlock_t *tmp ; { adapter = priv->adapter; cmd_node->wait_q_enabled = 1U; cmd_node->condition = & adapter->scan_wait_q_woken; tmp = spinlock_check(& adapter->scan_pending_q_lock); flags = _raw_spin_lock_irqsave(tmp); list_add_tail(& cmd_node->list, & adapter->scan_pending_q); spin_unlock_irqrestore(& adapter->scan_pending_q_lock, flags); return; } } static int mwifiex_scan_specific_ssid(struct mwifiex_private *priv , struct cfg80211_ssid *req_ssid ) { struct mwifiex_adapter *adapter ; int ret ; struct mwifiex_user_scan_cfg *scan_cfg ; void *tmp ; { adapter = priv->adapter; if (adapter->scan_processing != 0U) { if ((adapter->debug_mask & 536870912U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cmd: Scan already in process...\n"); } else { } } else { } return (-16); } else { } if ((unsigned int )priv->scan_block != 0U) { if ((adapter->debug_mask & 536870912U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cmd: Scan is blocked during association...\n"); } else { } } else { } return (-16); } else { } tmp = kzalloc(420UL, 208U); scan_cfg = (struct mwifiex_user_scan_cfg *)tmp; if ((unsigned long )scan_cfg == (unsigned long )((struct mwifiex_user_scan_cfg *)0)) { return (-12); } else { } scan_cfg->ssid_list = req_ssid; scan_cfg->num_ssids = 1U; ret = mwifiex_scan_networks(priv, (struct mwifiex_user_scan_cfg const *)scan_cfg); kfree((void const *)scan_cfg); return (ret); } } int mwifiex_request_scan(struct mwifiex_private *priv , struct cfg80211_ssid *req_ssid ) { int ret ; int tmp ; { tmp = down_interruptible(& priv->async_sem); if (tmp != 0) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "%s: acquire semaphore fail\n", "mwifiex_request_scan"); } else { } } else { } return (-1); } else { } (priv->adapter)->scan_wait_q_woken = 0U; if ((unsigned long )req_ssid != (unsigned long )((struct cfg80211_ssid *)0) && (unsigned int )req_ssid->ssid_len != 0U) { ret = mwifiex_scan_specific_ssid(priv, req_ssid); } else { ret = mwifiex_scan_networks(priv, (struct mwifiex_user_scan_cfg const *)0); } up(& priv->async_sem); return (ret); } } int mwifiex_cmd_append_vsie_tlv(struct mwifiex_private *priv , u16 vsie_mask , u8 **buffer ) { int id ; int ret_len ; struct mwifiex_ie_types_vendor_param_set *vs_param_set ; { ret_len = 0; if ((unsigned long )buffer == (unsigned long )((u8 **)0U)) { return (0); } else { } if ((unsigned long )*buffer == (unsigned long )((u8 *)0U)) { return (0); } else { } id = 0; goto ldv_61440; ldv_61439: ; if ((unsigned int )((int )priv->vs_ie[id].mask & (int )vsie_mask) != 0U) { vs_param_set = (struct mwifiex_ie_types_vendor_param_set *)*buffer; vs_param_set->header.type = 266U; vs_param_set->header.len = (unsigned int )((unsigned short )priv->vs_ie[id].ie[1]) + 2U; memcpy((void *)(& vs_param_set->ie), (void const *)(& priv->vs_ie[id].ie), (size_t )vs_param_set->header.len); *buffer = *buffer + ((unsigned long )vs_param_set->header.len + 4UL); ret_len = (int )(((unsigned int )vs_param_set->header.len + (unsigned int )ret_len) + 4U); } else { } id = id + 1; ldv_61440: ; if (id <= 7) { goto ldv_61439; } else { } return (ret_len); } } void mwifiex_save_curr_bcn(struct mwifiex_private *priv ) { struct mwifiex_bssdescriptor *curr_bss ; void *tmp ; { curr_bss = & priv->curr_bss_params.bss_descriptor; if (curr_bss->beacon_buf_size == 0U) { return; } else { } if ((unsigned long )priv->curr_bcn_buf == (unsigned long )((u8 *)0U) || priv->curr_bcn_size != curr_bss->beacon_buf_size) { priv->curr_bcn_size = curr_bss->beacon_buf_size; kfree((void const *)priv->curr_bcn_buf); tmp = kmalloc((size_t )curr_bss->beacon_buf_size, 32U); priv->curr_bcn_buf = (u8 *)tmp; if ((unsigned long )priv->curr_bcn_buf == (unsigned long )((u8 *)0U)) { return; } else { } } else { } memcpy((void *)priv->curr_bcn_buf, (void const *)curr_bss->beacon_buf, (size_t )curr_bss->beacon_buf_size); if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: current beacon saved %d\n", priv->curr_bcn_size); } else { } } else { } curr_bss->beacon_buf = priv->curr_bcn_buf; if ((unsigned long )curr_bss->bcn_wpa_ie != (unsigned long )((struct ieee_types_vendor_specific *)0)) { curr_bss->bcn_wpa_ie = (struct ieee_types_vendor_specific *)curr_bss->beacon_buf + (unsigned long )curr_bss->wpa_offset; } else { } if ((unsigned long )curr_bss->bcn_rsn_ie != (unsigned long )((struct ieee_types_generic *)0)) { curr_bss->bcn_rsn_ie = (struct ieee_types_generic *)curr_bss->beacon_buf + (unsigned long )curr_bss->rsn_offset; } else { } if ((unsigned long )curr_bss->bcn_ht_cap != (unsigned long )((struct ieee80211_ht_cap *)0)) { curr_bss->bcn_ht_cap = (struct ieee80211_ht_cap *)curr_bss->beacon_buf + (unsigned long )curr_bss->ht_cap_offset; } else { } if ((unsigned long )curr_bss->bcn_ht_oper != (unsigned long )((struct ieee80211_ht_operation *)0)) { curr_bss->bcn_ht_oper = (struct ieee80211_ht_operation *)curr_bss->beacon_buf + (unsigned long )curr_bss->ht_info_offset; } else { } if ((unsigned long )curr_bss->bcn_vht_cap != (unsigned long )((struct ieee80211_vht_cap *)0)) { curr_bss->bcn_vht_cap = (struct ieee80211_vht_cap *)curr_bss->beacon_buf + (unsigned long )curr_bss->vht_cap_offset; } else { } if ((unsigned long )curr_bss->bcn_vht_oper != (unsigned long )((struct ieee80211_vht_operation *)0)) { curr_bss->bcn_vht_oper = (struct ieee80211_vht_operation *)curr_bss->beacon_buf + (unsigned long )curr_bss->vht_info_offset; } else { } if ((unsigned long )curr_bss->bcn_bss_co_2040 != (unsigned long )((u8 *)0U)) { curr_bss->bcn_bss_co_2040 = curr_bss->beacon_buf + (unsigned long )curr_bss->bss_co_2040_offset; } else { } if ((unsigned long )curr_bss->bcn_ext_cap != (unsigned long )((u8 *)0U)) { curr_bss->bcn_ext_cap = curr_bss->beacon_buf + (unsigned long )curr_bss->ext_cap_offset; } else { } if ((unsigned long )curr_bss->oper_mode != (unsigned long )((struct ieee_types_oper_mode_ntf *)0)) { curr_bss->oper_mode = (struct ieee_types_oper_mode_ntf *)curr_bss->beacon_buf + (unsigned long )curr_bss->oper_mode_offset; } else { } return; } } void mwifiex_free_curr_bcn(struct mwifiex_private *priv ) { { kfree((void const *)priv->curr_bcn_buf); priv->curr_bcn_buf = (u8 *)0U; return; } } bool ldv_queue_work_on_187(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_188(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_189(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_190(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_191(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } extern void *kmemdup(void const * , size_t , gfp_t ) ; bool ldv_queue_work_on_201(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; 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_delayed_work_on_202(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_205(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_204(struct workqueue_struct *ldv_func_arg1 ) ; extern void dev_err(struct device const * , char const * , ...) ; extern void netif_carrier_on(struct net_device * ) ; extern void cfg80211_disconnected(struct net_device * , u16 , u8 const * , size_t , bool , gfp_t ) ; int mwifiex_associate(struct mwifiex_private *priv , struct mwifiex_bssdescriptor *bss_desc ) ; int mwifiex_cmd_802_11_associate(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd , struct mwifiex_bssdescriptor *bss_desc ) ; int mwifiex_ret_802_11_associate(struct mwifiex_private *priv , struct host_cmd_ds_command *resp ) ; void mwifiex_reset_connect_state(struct mwifiex_private *priv , u16 reason_code ) ; int mwifiex_deauthenticate(struct mwifiex_private *priv , u8 *mac ) ; void mwifiex_deauthenticate_all(struct mwifiex_adapter *adapter ) ; int mwifiex_adhoc_start(struct mwifiex_private *priv , struct cfg80211_ssid *adhoc_ssid ) ; int mwifiex_adhoc_join(struct mwifiex_private *priv , struct mwifiex_bssdescriptor *bss_desc ) ; int mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd , struct cfg80211_ssid *req_ssid ) ; int mwifiex_cmd_802_11_ad_hoc_join(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd , struct mwifiex_bssdescriptor *bss_desc ) ; int mwifiex_ret_802_11_ad_hoc(struct mwifiex_private *priv , struct host_cmd_ds_command *resp ) ; void mwifiex_11h_process_join(struct mwifiex_private *priv , u8 **buffer , struct mwifiex_bssdescriptor *bss_desc ) ; static int mwifiex_cmd_append_generic_ie(struct mwifiex_private *priv , u8 **buffer ) { int ret_len ; struct mwifiex_ie_types_header ie_header ; { ret_len = 0; if ((unsigned long )buffer == (unsigned long )((u8 **)0U)) { return (0); } else { } if ((unsigned long )*buffer == (unsigned long )((u8 *)0U)) { return (0); } else { } if ((unsigned int )priv->gen_ie_buf_len != 0U) { if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: %s: append generic ie len %d to %p\n", "mwifiex_cmd_append_generic_ie", (int )priv->gen_ie_buf_len, *buffer); } else { } } else { } ie_header.type = 266U; ie_header.len = (unsigned short )priv->gen_ie_buf_len; memcpy((void *)*buffer, (void const *)(& ie_header), 4UL); *buffer = *buffer + 4UL; ret_len = (int )((unsigned int )ret_len + 4U); memcpy((void *)*buffer, (void const *)(& priv->gen_ie_buf), (size_t )priv->gen_ie_buf_len); *buffer = *buffer + (unsigned long )priv->gen_ie_buf_len; ret_len = (int )priv->gen_ie_buf_len + ret_len; priv->gen_ie_buf_len = 0U; } else { } return (ret_len); } } static int mwifiex_cmd_append_tsf_tlv(struct mwifiex_private *priv , u8 **buffer , struct mwifiex_bssdescriptor *bss_desc ) { struct mwifiex_ie_types_tsf_timestamp tsf_tlv ; __le64 tsf_val ; { if ((unsigned long )buffer == (unsigned long )((u8 **)0U)) { return (0); } else { } if ((unsigned long )*buffer == (unsigned long )((u8 *)0U)) { return (0); } else { } memset((void *)(& tsf_tlv), 0, 5UL); tsf_tlv.header.type = 275U; tsf_tlv.header.len = 16U; memcpy((void *)*buffer, (void const *)(& tsf_tlv), 4UL); *buffer = *buffer + 4UL; tsf_val = bss_desc->fw_tsf; memcpy((void *)*buffer, (void const *)(& tsf_val), 8UL); *buffer = *buffer + 8UL; tsf_val = bss_desc->timestamp; if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: %s: TSF offset calc: %016llx - %016llx\n", "mwifiex_cmd_append_tsf_tlv", bss_desc->timestamp, bss_desc->fw_tsf); } else { } } else { } memcpy((void *)*buffer, (void const *)(& tsf_val), 8UL); *buffer = *buffer + 8UL; return (20); } } static int mwifiex_get_common_rates(struct mwifiex_private *priv , u8 *rate1 , u32 rate1_size , u8 *rate2 , u32 rate2_size ) { int ret ; u8 *ptr ; u8 *tmp ; u32 i ; u32 j ; void *tmp___0 ; u8 *tmp___1 ; { ptr = rate1; tmp___0 = kmemdup((void const *)rate1, (size_t )rate1_size, 208U); tmp = (u8 *)tmp___0; if ((unsigned long )tmp == (unsigned long )((u8 *)0U)) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "failed to alloc tmp buf\n"); } else { } } else { } return (-12); } else { } memset((void *)rate1, 0, (size_t )rate1_size); i = 0U; goto ldv_60977; ldv_60976: j = 0U; goto ldv_60975; ldv_60974: ; if ((((int )*(rate2 + (unsigned long )i) ^ (int )*(tmp + (unsigned long )j)) & 127) == 0) { tmp___1 = rate1; rate1 = rate1 + 1; *tmp___1 = *(tmp + (unsigned long )j); goto ldv_60973; } else { } j = j + 1U; ldv_60975: ; if (j < rate1_size && (unsigned int )*(tmp + (unsigned long )j) != 0U) { goto ldv_60974; } else { } ldv_60973: i = i + 1U; ldv_60977: ; if (i < rate2_size && (unsigned int )*(rate2 + (unsigned long )i) != 0U) { goto ldv_60976; } else { } if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: Tx data rate set to %#x\n", priv->data_rate); } else { } } else { } if ((unsigned int )priv->is_data_rate_auto == 0U) { goto ldv_60981; ldv_60980: ; if (((u32 )*ptr & 127U) == priv->data_rate) { ret = 0; goto done; } else { } ptr = ptr + 1; ldv_60981: ; if ((unsigned int )*ptr != 0U) { goto ldv_60980; } else { } if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "previously set fixed data rate %#x\tis not compatible with the network\n", priv->data_rate); } else { } } else { } ret = -1; goto done; } else { } ret = 0; done: kfree((void const *)tmp); return (ret); } } static int mwifiex_setup_rates_from_bssdesc(struct mwifiex_private *priv , struct mwifiex_bssdescriptor *bss_desc , u8 *out_rates , u32 *out_rates_size ) { u8 card_rates[14U] ; u32 card_rates_size ; int tmp ; size_t __min1 ; size_t tmp___0 ; size_t __min2 ; { memcpy((void *)out_rates, (void const *)(& bss_desc->supported_rates), 14UL); card_rates_size = mwifiex_get_active_data_rates(priv, (u8 *)(& card_rates)); tmp = mwifiex_get_common_rates(priv, out_rates, 14U, (u8 *)(& card_rates), card_rates_size); if (tmp != 0) { *out_rates_size = 0U; if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "%s: cannot get common rates\n", "mwifiex_setup_rates_from_bssdesc"); } else { } } else { } return (-1); } else { } tmp___0 = strlen((char const *)out_rates); __min1 = tmp___0; __min2 = 14UL; *out_rates_size = (u32 )(__min1 < __min2 ? __min1 : __min2); return (0); } } static int mwifiex_cmd_append_wps_ie(struct mwifiex_private *priv , u8 **buffer ) { int retLen ; struct mwifiex_ie_types_header ie_header ; { retLen = 0; if ((unsigned long )buffer == (unsigned long )((u8 **)0U) || (unsigned long )*buffer == (unsigned long )((u8 *)0U)) { return (0); } else { } if ((unsigned int )priv->wps_ie_len != 0U) { if (((priv->adapter)->debug_mask & 16U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "cmd: append wps ie %d to %p\n", (int )priv->wps_ie_len, *buffer); } else { } } else { } ie_header.type = 361U; ie_header.len = (unsigned short )priv->wps_ie_len; memcpy((void *)*buffer, (void const *)(& ie_header), 4UL); *buffer = *buffer + 4UL; retLen = (int )((unsigned int )retLen + 4U); memcpy((void *)*buffer, (void const *)priv->wps_ie, (size_t )priv->wps_ie_len); *buffer = *buffer + (unsigned long )priv->wps_ie_len; retLen = (int )priv->wps_ie_len + retLen; } else { } kfree((void const *)priv->wps_ie); priv->wps_ie_len = 0U; return (retLen); } } static int mwifiex_cmd_append_wapi_ie(struct mwifiex_private *priv , u8 **buffer ) { int retLen ; struct mwifiex_ie_types_header ie_header ; { retLen = 0; if ((unsigned long )buffer == (unsigned long )((u8 **)0U)) { return (0); } else { } if ((unsigned long )*buffer == (unsigned long )((u8 *)0U)) { return (0); } else { } if ((unsigned int )priv->wapi_ie_len != 0U) { if (((priv->adapter)->debug_mask & 16U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "cmd: append wapi ie %d to %p\n", (int )priv->wapi_ie_len, *buffer); } else { } } else { } ie_header.type = 350U; ie_header.len = (unsigned short )priv->wapi_ie_len; memcpy((void *)*buffer, (void const *)(& ie_header), 4UL); *buffer = *buffer + 4UL; retLen = (int )((unsigned int )retLen + 4U); memcpy((void *)*buffer, (void const *)(& priv->wapi_ie), (size_t )priv->wapi_ie_len); *buffer = *buffer + (unsigned long )priv->wapi_ie_len; retLen = (int )priv->wapi_ie_len + retLen; } else { } return (retLen); } } static int mwifiex_append_rsn_ie_wpa_wpa2(struct mwifiex_private *priv , u8 **buffer ) { struct mwifiex_ie_types_rsn_param_set *rsn_ie_tlv ; int rsn_ie_len ; { if ((unsigned long )buffer == (unsigned long )((u8 **)0U) || (unsigned long )*buffer == (unsigned long )((u8 *)0U)) { return (0); } else { } rsn_ie_tlv = (struct mwifiex_ie_types_rsn_param_set *)*buffer; rsn_ie_tlv->header.type = (unsigned short )priv->wpa_ie[0]; rsn_ie_tlv->header.type = (unsigned int )rsn_ie_tlv->header.type & 255U; rsn_ie_tlv->header.len = (unsigned short )priv->wpa_ie[1]; rsn_ie_tlv->header.len = (unsigned int )rsn_ie_tlv->header.len & 255U; if ((unsigned int )rsn_ie_tlv->header.len <= 254U) { memcpy((void *)(& rsn_ie_tlv->rsn_ie), (void const *)(& priv->wpa_ie) + 2U, (size_t )rsn_ie_tlv->header.len); } else { return (-1); } rsn_ie_len = (int )((unsigned int )rsn_ie_tlv->header.len + 4U); *buffer = *buffer + (unsigned long )rsn_ie_len; return (rsn_ie_len); } } int mwifiex_cmd_802_11_associate(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd , struct mwifiex_bssdescriptor *bss_desc ) { struct host_cmd_ds_802_11_associate *assoc ; struct mwifiex_ie_types_ssid_param_set *ssid_tlv ; struct mwifiex_ie_types_phy_param_set *phy_tlv ; struct mwifiex_ie_types_ss_param_set *ss_tlv ; struct mwifiex_ie_types_rates_param_set *rates_tlv ; struct mwifiex_ie_types_auth_type *auth_tlv ; struct mwifiex_ie_types_chan_list_param_set *chan_tlv ; u8 rates[14U] ; u32 rates_size ; u16 tmp_cap ; u8 *pos ; int rsn_ie_len ; int tmp ; { assoc = & cmd->params.associate; rsn_ie_len = 0; pos = (u8 *)assoc; cmd->command = 18U; priv->attempted_bss_desc = bss_desc; memcpy((void *)(& assoc->peer_sta_addr), (void const *)(& bss_desc->mac_address), 6UL); pos = pos + 6UL; assoc->listen_interval = priv->listen_interval; assoc->beacon_period = bss_desc->beacon_period; pos = pos + 2UL; pos = pos + 2UL; pos = pos + 2UL; pos = pos + 1UL; ssid_tlv = (struct mwifiex_ie_types_ssid_param_set *)pos; ssid_tlv->header.type = 0U; ssid_tlv->header.len = (unsigned short )bss_desc->ssid.ssid_len; memcpy((void *)(& ssid_tlv->ssid), (void const *)(& bss_desc->ssid.ssid), (size_t )ssid_tlv->header.len); pos = pos + ((unsigned long )ssid_tlv->header.len + 4UL); phy_tlv = (struct mwifiex_ie_types_phy_param_set *)pos; phy_tlv->header.type = 3U; phy_tlv->header.len = 1U; memcpy((void *)(& phy_tlv->fh_ds.ds_param_set), (void const *)(& bss_desc->phy_param_set.ds_param_set.current_chan), 1UL); pos = pos + ((unsigned long )phy_tlv->header.len + 4UL); ss_tlv = (struct mwifiex_ie_types_ss_param_set *)pos; ss_tlv->header.type = 4U; ss_tlv->header.len = 6U; pos = pos + ((unsigned long )ss_tlv->header.len + 4UL); tmp = mwifiex_setup_rates_from_bssdesc(priv, bss_desc, (u8 *)(& rates), & rates_size); if (tmp != 0) { return (-1); } else { } priv->curr_bss_params.num_of_rates = rates_size; memcpy((void *)(& priv->curr_bss_params.data_rates), (void const *)(& rates), (size_t )rates_size); rates_tlv = (struct mwifiex_ie_types_rates_param_set *)pos; rates_tlv->header.type = 1U; rates_tlv->header.len = (unsigned short )rates_size; memcpy((void *)(& rates_tlv->rates), (void const *)(& rates), (size_t )rates_size); pos = pos + ((unsigned long )rates_size + 4UL); if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: ASSOC_CMD: rates size = %d\n", rates_size); } else { } } else { } auth_tlv = (struct mwifiex_ie_types_auth_type *)pos; auth_tlv->header.type = 287U; auth_tlv->header.len = 2U; if ((unsigned int )priv->sec_info.wep_enabled != 0U) { auth_tlv->auth_type = (unsigned short )priv->sec_info.authentication_mode; } else { auth_tlv->auth_type = 0U; } pos = pos + ((unsigned long )auth_tlv->header.len + 4UL); if (((unsigned long )(priv->adapter)->fw_cap_info & 12032UL) != 0UL && (((((unsigned long )(priv->adapter)->fw_cap_info & 2048UL) == 0UL || (unsigned int )bss_desc->disable_11n != 0U) || (((int )(priv->adapter)->config_bands & 8) == 0 && ((int )(priv->adapter)->config_bands & 16) == 0)) || (unsigned long )bss_desc->bcn_ht_cap == (unsigned long )((struct ieee80211_ht_cap *)0))) { chan_tlv = (struct mwifiex_ie_types_chan_list_param_set *)pos; chan_tlv->header.type = 257U; chan_tlv->header.len = 7U; memset((void *)(& chan_tlv->chan_scan_param), 0, 7UL); chan_tlv->chan_scan_param[0].chan_number = bss_desc->phy_param_set.ds_param_set.current_chan; if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: Assoc: TLV Chan = %d\n", (int )chan_tlv->chan_scan_param[0].chan_number); } else { } } else { } chan_tlv->chan_scan_param[0].radio_type = mwifiex_band_to_radio_type((int )((unsigned char )bss_desc->bss_band)); if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: Assoc: TLV Band = %d\n", (int )chan_tlv->chan_scan_param[0].radio_type); } else { } } else { } pos = pos + 11UL; } else { } if ((unsigned int )priv->wps.session_enable == 0U) { if ((unsigned int )priv->sec_info.wpa_enabled != 0U || (unsigned int )priv->sec_info.wpa2_enabled != 0U) { rsn_ie_len = mwifiex_append_rsn_ie_wpa_wpa2(priv, & pos); } else { } if (rsn_ie_len == -1) { return (-1); } else { } } else { } if ((((unsigned long )(priv->adapter)->fw_cap_info & 2048UL) != 0UL && (unsigned int )bss_desc->disable_11n == 0U) && (((int )(priv->adapter)->config_bands & 8) != 0 || ((int )(priv->adapter)->config_bands & 16) != 0)) { mwifiex_cmd_append_11n_tlv(priv, bss_desc, & pos); } else { } if (((((unsigned long )(priv->adapter)->fw_cap_info & 8192UL) != 0UL && (unsigned int )bss_desc->disable_11n == 0U) && (unsigned int )bss_desc->disable_11ac == 0U) && ((int )(priv->adapter)->config_bands & 32) != 0) { mwifiex_cmd_append_11ac_tlv(priv, bss_desc, & pos); } else { } mwifiex_cmd_append_vsie_tlv(priv, 2, & pos); mwifiex_wmm_process_association_req(priv, & pos, & bss_desc->wmm_ie, bss_desc->bcn_ht_cap); if ((unsigned int )priv->sec_info.wapi_enabled != 0U && (unsigned int )priv->wapi_ie_len != 0U) { mwifiex_cmd_append_wapi_ie(priv, & pos); } else { } if ((unsigned int )priv->wps.session_enable != 0U && (unsigned int )priv->wps_ie_len != 0U) { mwifiex_cmd_append_wps_ie(priv, & pos); } else { } mwifiex_cmd_append_generic_ie(priv, & pos); mwifiex_cmd_append_tsf_tlv(priv, & pos, bss_desc); mwifiex_11h_process_join(priv, & pos, bss_desc); cmd->size = (unsigned int )((int )((unsigned short )((long )pos)) - (int )((unsigned short )((long )assoc))) + 8U; tmp_cap = bss_desc->cap_info_bitmap; if ((unsigned int )(priv->adapter)->config_bands == 1U) { tmp_cap = (unsigned int )tmp_cap & 64511U; } else { } tmp_cap = (unsigned int )tmp_cap & 9727U; if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: ASSOC_CMD: tmp_cap=%4X CAPINFO_MASK=%4lX\n", (int )tmp_cap, 0xffffffffffff25ffUL); } else { } } else { } assoc->cap_info_bitmap = tmp_cap; return (0); } } static char const *assoc_failure_reason_to_str(u16 cap_info ) { { switch ((int )cap_info) { case 65531: ; return ("CONNECT_ERR_AUTH_ERR_STA_FAILURE"); case 65534: ; return ("CONNECT_ERR_AUTH_MSG_UNHANDLED"); case 65532: ; return ("CONNECT_ERR_ASSOC_ERR_TIMEOUT"); case 65533: ; return ("CONNECT_ERR_ASSOC_ERR_AUTH_REFUSED"); case 65535: ; return ("CONNECT_ERR_STA_FAILURE"); } return ("Unknown connect failure"); } } int mwifiex_ret_802_11_associate(struct mwifiex_private *priv , struct host_cmd_ds_command *resp ) { struct mwifiex_adapter *adapter ; int ret ; struct ieee_types_assoc_rsp *assoc_rsp ; struct mwifiex_bssdescriptor *bss_desc ; bool enable_data ; u16 cap_info ; u16 status_code ; u16 aid ; unsigned long _min1 ; unsigned long _min2 ; char const *tmp ; bool tmp___0 ; int tmp___1 ; { adapter = priv->adapter; ret = 0; enable_data = 1; assoc_rsp = (struct ieee_types_assoc_rsp *)(& resp->params); cap_info = assoc_rsp->cap_info_bitmap; status_code = assoc_rsp->status_code; aid = assoc_rsp->a_id; if (((unsigned long )aid & 49152UL) != 49152UL) { dev_err((struct device const *)(priv->adapter)->dev, "invalid AID value 0x%x; bits 15:14 not set\n", (int )aid); } else { } aid = (unsigned int )aid & 16383U; _min1 = (unsigned long )resp->size - 8UL; _min2 = 500UL; priv->assoc_rsp_size = (u32 )(_min1 < _min2 ? _min1 : _min2); memcpy((void *)(& priv->assoc_rsp_buf), (void const *)(& resp->params), (size_t )priv->assoc_rsp_size); assoc_rsp->a_id = aid; if ((unsigned int )status_code != 0U) { (priv->adapter)->dbg.num_cmd_assoc_failure = (priv->adapter)->dbg.num_cmd_assoc_failure + 1U; if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "ASSOC_RESP: failed,\tstatus code=%d err=%#x a_id=%#x\n", (int )status_code, (int )cap_info, (int )assoc_rsp->a_id); } else { } } else { } if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { tmp = assoc_failure_reason_to_str((int )cap_info); _dev_info((struct device const *)(priv->adapter)->dev, "assoc failure: reason %s\n", tmp); } else { } } else { } if ((unsigned int )cap_info == 65532U) { if ((unsigned int )status_code == 2U) { ret = 16; if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "ASSOC_RESP: AUTH timeout\n"); } else { } } else { } } else { ret = 1; if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "ASSOC_RESP: UNSPECIFIED failure\n"); } else { } } else { } } } else { ret = (int )status_code; } goto done; } else { } priv->media_connected = 1U; (priv->adapter)->ps_state = 0U; (priv->adapter)->pps_uapsd_mode = 0U; (priv->adapter)->tx_lock_flag = 0U; bss_desc = priv->attempted_bss_desc; if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: ASSOC_RESP: %s\n", (u8 *)(& bss_desc->ssid.ssid)); } else { } } else { } memcpy((void *)(& priv->curr_bss_params.bss_descriptor), (void const *)bss_desc, 336UL); priv->curr_bss_params.bss_descriptor.channel = (u32 )bss_desc->phy_param_set.ds_param_set.current_chan; priv->curr_bss_params.band = (unsigned char )bss_desc->bss_band; if ((unsigned int )bss_desc->wmm_ie.vend_hdr.element_id == 221U) { priv->curr_bss_params.wmm_enabled = 1U; } else { priv->curr_bss_params.wmm_enabled = 0U; } if (((unsigned int )priv->wmm_required != 0U || (unsigned long )bss_desc->bcn_ht_cap != (unsigned long )((struct ieee80211_ht_cap *)0)) && (unsigned int )priv->curr_bss_params.wmm_enabled != 0U) { priv->wmm_enabled = 1U; } else { priv->wmm_enabled = 0U; } priv->curr_bss_params.wmm_uapsd_enabled = 0U; if ((unsigned int )priv->wmm_enabled != 0U) { priv->curr_bss_params.wmm_uapsd_enabled = (int )((signed char )bss_desc->wmm_ie.qos_info_bitmap) < 0; } else { } if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: ASSOC_RESP: curr_pkt_filter is %#x\n", (int )priv->curr_pkt_filter); } else { } } else { } if ((unsigned int )priv->sec_info.wpa_enabled != 0U || (unsigned int )priv->sec_info.wpa2_enabled != 0U) { priv->wpa_is_gtk_set = 0U; } else { } if ((unsigned int )priv->wmm_enabled != 0U) { enable_data = 0; } else { mwifiex_wmm_setup_queue_priorities(priv, (struct ieee_types_wmm_parameter *)0); mwifiex_wmm_setup_ac_downgrade(priv); } if ((int )enable_data) { if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: post association, re-enabling data flow\n"); } else { } } else { } } else { } priv->data_rssi_last = 0; priv->data_nf_last = 0; priv->data_rssi_avg = 0; priv->data_nf_avg = 0; priv->bcn_rssi_last = 0; priv->bcn_nf_last = 0; priv->bcn_rssi_avg = 0; priv->bcn_nf_avg = 0; priv->rxpd_rate = 0U; priv->rxpd_htinfo = 0U; mwifiex_save_curr_bcn(priv); (priv->adapter)->dbg.num_cmd_assoc_success = (priv->adapter)->dbg.num_cmd_assoc_success + 1U; if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: ASSOC_RESP: associated\n"); } else { } } else { } mwifiex_ralist_add(priv, (u8 const *)(& priv->curr_bss_params.bss_descriptor.mac_address)); tmp___0 = netif_carrier_ok((struct net_device const *)priv->netdev); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { netif_carrier_on(priv->netdev); } else { } mwifiex_wake_up_net_dev_queue(priv->netdev, adapter); if ((unsigned int )priv->sec_info.wpa_enabled != 0U || (unsigned int )priv->sec_info.wpa2_enabled != 0U) { priv->scan_block = 1U; } else { } done: ; if ((adapter->curr_cmd)->wait_q_enabled != 0U) { if (ret != 0) { adapter->cmd_wait_q.status = -1; } else { adapter->cmd_wait_q.status = 0; } } else { } return (ret); } } int mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd , struct cfg80211_ssid *req_ssid ) { int rsn_ie_len ; struct mwifiex_adapter *adapter ; struct host_cmd_ds_802_11_ad_hoc_start *adhoc_start ; struct mwifiex_bssdescriptor *bss_desc ; u32 cmd_append_size ; u32 i ; u16 tmp_cap ; struct mwifiex_ie_types_chan_list_param_set *chan_tlv ; u8 radio_type ; struct mwifiex_ie_types_htcap *ht_cap ; struct mwifiex_ie_types_htinfo *ht_info ; u8 *pos ; struct mwifiex_chan_freq_power *cfp ; struct mwifiex_chan_freq_power *tmp ; int tmp___0 ; int tmp___1 ; u16 tmp_ht_cap ; { rsn_ie_len = 0; adapter = priv->adapter; adhoc_start = & cmd->params.adhoc_start; cmd_append_size = 0U; pos = (u8 *)adhoc_start + 69UL; if ((unsigned long )adapter == (unsigned long )((struct mwifiex_adapter *)0)) { return (-1); } else { } cmd->command = 43U; bss_desc = & priv->curr_bss_params.bss_descriptor; priv->attempted_bss_desc = bss_desc; memset((void *)(& adhoc_start->ssid), 0, 32UL); memcpy((void *)(& adhoc_start->ssid), (void const *)(& req_ssid->ssid), (size_t )req_ssid->ssid_len); if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: ADHOC_S_CMD: SSID = %s\n", (u8 *)(& adhoc_start->ssid)); } else { } } else { } memset((void *)(& bss_desc->ssid.ssid), 0, 32UL); memcpy((void *)(& bss_desc->ssid.ssid), (void const *)(& req_ssid->ssid), (size_t )req_ssid->ssid_len); bss_desc->ssid.ssid_len = req_ssid->ssid_len; adhoc_start->bss_mode = 2U; bss_desc->bss_mode = 1U; adhoc_start->beacon_period = priv->beacon_period; bss_desc->beacon_period = priv->beacon_period; adhoc_start->phy_param_set.ds_param_set.element_id = 3U; adhoc_start->phy_param_set.ds_param_set.len = 1U; tmp = mwifiex_get_cfp(priv, (int )adapter->adhoc_start_band, (int )priv->adhoc_channel, 0U); if ((unsigned long )tmp == (unsigned long )((struct mwifiex_chan_freq_power *)0)) { cfp = mwifiex_get_cfp(priv, (int )adapter->adhoc_start_band, 255, 0U); if ((unsigned long )cfp != (unsigned long )((struct mwifiex_chan_freq_power *)0)) { priv->adhoc_channel = (unsigned char )cfp->channel; } else { } } else { } if ((unsigned int )priv->adhoc_channel == 0U) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "ADHOC_S_CMD: adhoc_channel cannot be 0\n"); } else { } } else { } return (-1); } else { } if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: ADHOC_S_CMD: creating ADHOC on channel %d\n", (int )priv->adhoc_channel); } else { } } else { } priv->curr_bss_params.bss_descriptor.channel = (u32 )priv->adhoc_channel; priv->curr_bss_params.band = adapter->adhoc_start_band; bss_desc->channel = (u32 )priv->adhoc_channel; adhoc_start->phy_param_set.ds_param_set.current_chan = priv->adhoc_channel; memcpy((void *)(& bss_desc->phy_param_set), (void const *)(& adhoc_start->phy_param_set), 7UL); adhoc_start->ss_param_set.ibss_param_set.element_id = 6U; adhoc_start->ss_param_set.ibss_param_set.len = 2U; adhoc_start->ss_param_set.ibss_param_set.atim_window = priv->atim_window; memcpy((void *)(& bss_desc->ss_param_set), (void const *)(& adhoc_start->ss_param_set), 8UL); bss_desc->cap_info_bitmap = (u16 )((unsigned int )bss_desc->cap_info_bitmap | 2U); tmp_cap = 2U; if (priv->sec_info.encryption_mode != 0U) { if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: ADHOC_S_CMD: wep_status set privacy to WEP\n"); } else { } } else { } bss_desc->privacy = 1U; tmp_cap = (u16 )((unsigned int )tmp_cap | 16U); } else { if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: ADHOC_S_CMD: wep_status NOT set,\tsetting privacy to ACCEPT ALL\n"); } else { } } else { } bss_desc->privacy = 0U; } memset((void *)(& adhoc_start->data_rate), 0, 14UL); mwifiex_get_active_data_rates(priv, (u8 *)(& adhoc_start->data_rate)); if (((int )adapter->adhoc_start_band & 2) != 0 && ((int )priv->curr_pkt_filter & 8192) != 0) { tmp___0 = mwifiex_send_cmd(priv, 40, 1, 0U, (void *)(& priv->curr_pkt_filter), 0); if (tmp___0 != 0) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "ADHOC_S_CMD: G Protection config failed\n"); } else { } } else { } return (-1); } else { } } else { } i = 0U; goto ldv_61074; ldv_61073: ; if ((unsigned int )adhoc_start->data_rate[i] == 0U) { goto ldv_61072; } else { } i = i + 1U; ldv_61074: ; if (i <= 13U) { goto ldv_61073; } else { } ldv_61072: priv->curr_bss_params.num_of_rates = i; memcpy((void *)(& priv->curr_bss_params.data_rates), (void const *)(& adhoc_start->data_rate), (size_t )priv->curr_bss_params.num_of_rates); if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: ADHOC_S_CMD: rates=%4ph\n", (u8 *)(& adhoc_start->data_rate)); } else { } } else { } if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: ADHOC_S_CMD: AD-HOC Start command is ready\n"); } else { } } else { } if (((unsigned long )adapter->fw_cap_info & 12032UL) != 0UL) { chan_tlv = (struct mwifiex_ie_types_chan_list_param_set *)pos; chan_tlv->header.type = 257U; chan_tlv->header.len = 7U; memset((void *)(& chan_tlv->chan_scan_param), 0, 7UL); chan_tlv->chan_scan_param[0].chan_number = (unsigned char )priv->curr_bss_params.bss_descriptor.channel; if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: ADHOC_S_CMD: TLV Chan = %d\n", (int )chan_tlv->chan_scan_param[0].chan_number); } else { } } else { } chan_tlv->chan_scan_param[0].radio_type = mwifiex_band_to_radio_type((int )priv->curr_bss_params.band); if (((int )adapter->adhoc_start_band & 8) != 0 || ((int )adapter->adhoc_start_band & 16) != 0) { if ((unsigned int )adapter->sec_chan_offset == 1U) { chan_tlv->chan_scan_param[0].radio_type = (u8 )((unsigned int )chan_tlv->chan_scan_param[0].radio_type | 16U); } else if ((unsigned int )adapter->sec_chan_offset == 3U) { chan_tlv->chan_scan_param[0].radio_type = (u8 )((unsigned int )chan_tlv->chan_scan_param[0].radio_type | 48U); } else { } } else { } if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: ADHOC_S_CMD: TLV Band = %d\n", (int )chan_tlv->chan_scan_param[0].radio_type); } else { } } else { } pos = pos + 11UL; cmd_append_size = cmd_append_size + 11U; } else { } tmp___1 = mwifiex_cmd_append_vsie_tlv(priv, 4, & pos); cmd_append_size = (u32 )tmp___1 + cmd_append_size; if ((unsigned int )priv->sec_info.wpa_enabled != 0U) { rsn_ie_len = mwifiex_append_rsn_ie_wpa_wpa2(priv, & pos); if (rsn_ie_len == -1) { return (-1); } else { } cmd_append_size = cmd_append_size + (u32 )rsn_ie_len; } else { } if ((unsigned int )adapter->adhoc_11n_enabled != 0U) { ht_cap = (struct mwifiex_ie_types_htcap *)pos; memset((void *)ht_cap, 0, 30UL); ht_cap->header.type = 45U; ht_cap->header.len = 26U; radio_type = mwifiex_band_to_radio_type((int )(priv->adapter)->config_bands); mwifiex_fill_cap_info(priv, (int )radio_type, & ht_cap->ht_cap); if ((unsigned int )adapter->sec_chan_offset == 0U) { tmp_ht_cap = ht_cap->ht_cap.cap_info; tmp_ht_cap = (unsigned int )tmp_ht_cap & 65533U; tmp_ht_cap = (unsigned int )tmp_ht_cap & 65471U; ht_cap->ht_cap.cap_info = tmp_ht_cap; } else { } pos = pos + 30UL; cmd_append_size = cmd_append_size + 30U; ht_info = (struct mwifiex_ie_types_htinfo *)pos; memset((void *)ht_info, 0, 26UL); ht_info->header.type = 61U; ht_info->header.len = 22U; ht_info->ht_oper.primary_chan = (unsigned char )priv->curr_bss_params.bss_descriptor.channel; if ((unsigned int )adapter->sec_chan_offset != 0U) { ht_info->ht_oper.ht_param = adapter->sec_chan_offset; ht_info->ht_oper.ht_param = (u8 )((unsigned int )ht_info->ht_oper.ht_param | 4U); } else { } ht_info->ht_oper.operation_mode = 4U; ht_info->ht_oper.basic_set[0] = 255U; pos = pos + 26UL; cmd_append_size = cmd_append_size + 26U; } else { } cmd->size = (unsigned int )((unsigned short )cmd_append_size) + 77U; if ((unsigned int )adapter->adhoc_start_band == 1U) { tmp_cap = (unsigned int )tmp_cap & 64511U; } else { tmp_cap = (u16 )((unsigned int )tmp_cap | 1024U); } adhoc_start->cap_info_bitmap = tmp_cap; return (0); } } int mwifiex_cmd_802_11_ad_hoc_join(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd , struct mwifiex_bssdescriptor *bss_desc ) { int rsn_ie_len ; struct host_cmd_ds_802_11_ad_hoc_join *adhoc_join ; struct mwifiex_ie_types_chan_list_param_set *chan_tlv ; u32 cmd_append_size ; u16 tmp_cap ; u32 i ; u32 rates_size ; u16 curr_pkt_filter ; u8 *pos ; int tmp ; int tmp___0 ; int tmp___1 ; { rsn_ie_len = 0; adhoc_join = & cmd->params.adhoc_join; cmd_append_size = 0U; rates_size = 0U; pos = (u8 *)adhoc_join + 93UL; if (((int )bss_desc->erp_flags & 2) != 0) { curr_pkt_filter = (u16 )((unsigned int )priv->curr_pkt_filter | 8192U); tmp = mwifiex_send_cmd(priv, 40, 1, 0U, (void *)(& curr_pkt_filter), 0); if (tmp != 0) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "ADHOC_J_CMD: G Protection config failed\n"); } else { } } else { } return (-1); } else { } } else { } priv->attempted_bss_desc = bss_desc; cmd->command = 44U; adhoc_join->bss_descriptor.bss_mode = 2U; adhoc_join->bss_descriptor.beacon_period = bss_desc->beacon_period; memcpy((void *)(& adhoc_join->bss_descriptor.bssid), (void const *)(& bss_desc->mac_address), 6UL); memcpy((void *)(& adhoc_join->bss_descriptor.ssid), (void const *)(& bss_desc->ssid.ssid), (size_t )bss_desc->ssid.ssid_len); memcpy((void *)(& adhoc_join->bss_descriptor.phy_param_set), (void const *)(& bss_desc->phy_param_set), 7UL); memcpy((void *)(& adhoc_join->bss_descriptor.ss_param_set), (void const *)(& bss_desc->ss_param_set), 8UL); tmp_cap = bss_desc->cap_info_bitmap; tmp_cap = (unsigned int )tmp_cap & 9727U; if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: ADHOC_J_CMD: tmp_cap=%4X CAPINFO_MASK=%4lX\n", (int )tmp_cap, 0xffffffffffff25ffUL); } else { } } else { } if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: ADHOC_J_CMD: BSSID=%pM, SSID=\'%s\'\n", (u8 *)(& adhoc_join->bss_descriptor.bssid), (u8 *)(& adhoc_join->bss_descriptor.ssid)); } else { } } else { } i = 0U; goto ldv_61091; ldv_61090: i = i + 1U; ldv_61091: ; if (i <= 13U && (unsigned int )bss_desc->supported_rates[i] != 0U) { goto ldv_61090; } else { } rates_size = i; memset((void *)(& adhoc_join->bss_descriptor.data_rates), 0, 14UL); memcpy((void *)(& adhoc_join->bss_descriptor.data_rates), (void const *)(& bss_desc->supported_rates), (size_t )rates_size); priv->curr_bss_params.num_of_rates = rates_size; memcpy((void *)(& priv->curr_bss_params.data_rates), (void const *)(& bss_desc->supported_rates), (size_t )rates_size); priv->curr_bss_params.bss_descriptor.channel = bss_desc->channel; priv->curr_bss_params.band = (unsigned char )bss_desc->bss_band; if ((unsigned int )priv->sec_info.wep_enabled != 0U || (unsigned int )priv->sec_info.wpa_enabled != 0U) { tmp_cap = (u16 )((unsigned int )tmp_cap | 16U); } else { } if (((unsigned long )(priv->adapter)->fw_cap_info & 12032UL) != 0UL) { chan_tlv = (struct mwifiex_ie_types_chan_list_param_set *)pos; chan_tlv->header.type = 257U; chan_tlv->header.len = 7U; memset((void *)(& chan_tlv->chan_scan_param), 0, 7UL); chan_tlv->chan_scan_param[0].chan_number = bss_desc->phy_param_set.ds_param_set.current_chan; if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: ADHOC_J_CMD: TLV Chan=%d\n", (int )chan_tlv->chan_scan_param[0].chan_number); } else { } } else { } chan_tlv->chan_scan_param[0].radio_type = mwifiex_band_to_radio_type((int )((unsigned char )bss_desc->bss_band)); if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: ADHOC_J_CMD: TLV Band=%d\n", (int )chan_tlv->chan_scan_param[0].radio_type); } else { } } else { } pos = pos + 11UL; cmd_append_size = cmd_append_size + 11U; } else { } if ((unsigned int )priv->sec_info.wpa_enabled != 0U) { rsn_ie_len = mwifiex_append_rsn_ie_wpa_wpa2(priv, & pos); } else { } if (rsn_ie_len == -1) { return (-1); } else { } cmd_append_size = cmd_append_size + (u32 )rsn_ie_len; if (((unsigned long )(priv->adapter)->fw_cap_info & 2048UL) != 0UL) { tmp___0 = mwifiex_cmd_append_11n_tlv(priv, bss_desc, & pos); cmd_append_size = (u32 )tmp___0 + cmd_append_size; } else { } tmp___1 = mwifiex_cmd_append_vsie_tlv(priv, 4, & pos); cmd_append_size = (u32 )tmp___1 + cmd_append_size; cmd->size = (unsigned int )((unsigned short )cmd_append_size) + 101U; adhoc_join->bss_descriptor.cap_info_bitmap = tmp_cap; return (0); } } int mwifiex_ret_802_11_ad_hoc(struct mwifiex_private *priv , struct host_cmd_ds_command *resp ) { int ret ; struct mwifiex_adapter *adapter ; struct host_cmd_ds_802_11_ad_hoc_result *adhoc_result ; struct mwifiex_bssdescriptor *bss_desc ; u16 reason_code ; bool tmp ; int tmp___0 ; { ret = 0; adapter = priv->adapter; adhoc_result = & resp->params.adhoc_result; bss_desc = priv->attempted_bss_desc; reason_code = resp->result; if ((unsigned int )reason_code != 0U) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "ADHOC_RESP: failed\n"); } else { } } else { } if ((unsigned int )priv->media_connected != 0U) { mwifiex_reset_connect_state(priv, (int )reason_code); } else { } memset((void *)(& priv->curr_bss_params.bss_descriptor), 0, 336UL); ret = -1; goto done; } else { } priv->media_connected = 1U; if ((unsigned int )resp->command == 43U) { if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: ADHOC_S_RESP %s\n", (u8 *)(& bss_desc->ssid.ssid)); } else { } } else { } memcpy((void *)(& bss_desc->mac_address), (void const *)(& adhoc_result->bssid), 6UL); priv->adhoc_state = 1U; } else { if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: ADHOC_J_RESP %s\n", (u8 *)(& bss_desc->ssid.ssid)); } else { } } else { } memcpy((void *)(& priv->curr_bss_params.bss_descriptor), (void const *)bss_desc, 336UL); priv->adhoc_state = 2U; } if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: ADHOC_RESP: channel = %d\n", (int )priv->adhoc_channel); } else { } } else { } if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: ADHOC_RESP: BSSID = %pM\n", (u8 *)(& priv->curr_bss_params.bss_descriptor.mac_address)); } else { } } else { } tmp = netif_carrier_ok((struct net_device const *)priv->netdev); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { netif_carrier_on(priv->netdev); } else { } mwifiex_wake_up_net_dev_queue(priv->netdev, adapter); mwifiex_save_curr_bcn(priv); done: ; if ((adapter->curr_cmd)->wait_q_enabled != 0U) { if (ret != 0) { adapter->cmd_wait_q.status = -1; } else { adapter->cmd_wait_q.status = 0; } } else { } return (ret); } } int mwifiex_associate(struct mwifiex_private *priv , struct mwifiex_bssdescriptor *bss_desc ) { int tmp ; { if ((int )priv->bss_role & 1 || bss_desc->bss_mode != 2U) { return (-1); } else { } if (((((unsigned long )(priv->adapter)->fw_cap_info & 8192UL) != 0UL && (unsigned int )bss_desc->disable_11n == 0U) && (unsigned int )bss_desc->disable_11ac == 0U) && ((int )(priv->adapter)->config_bands & 32) != 0) { mwifiex_set_11ac_ba_params(priv); } else { mwifiex_set_ba_params(priv); } priv->assoc_rsp_size = 0U; tmp = mwifiex_send_cmd(priv, 18, 1, 0U, (void *)bss_desc, 1); return (tmp); } } int mwifiex_adhoc_start(struct mwifiex_private *priv , struct cfg80211_ssid *adhoc_ssid ) { int tmp ; { if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: Adhoc Channel = %d\n", (int )priv->adhoc_channel); } else { } } else { } if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: curr_bss_params.channel = %d\n", priv->curr_bss_params.bss_descriptor.channel); } else { } } else { } if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: curr_bss_params.band = %d\n", (int )priv->curr_bss_params.band); } else { } } else { } if (((unsigned long )(priv->adapter)->fw_cap_info & 8192UL) != 0UL && ((int )(priv->adapter)->config_bands & 32) != 0) { mwifiex_set_11ac_ba_params(priv); } else { mwifiex_set_ba_params(priv); } tmp = mwifiex_send_cmd(priv, 43, 1, 0U, (void *)adhoc_ssid, 1); return (tmp); } } int mwifiex_adhoc_join(struct mwifiex_private *priv , struct mwifiex_bssdescriptor *bss_desc ) { s32 tmp ; int tmp___0 ; { if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: adhoc join: curr_bss ssid =%s\n", (u8 *)(& priv->curr_bss_params.bss_descriptor.ssid.ssid)); } else { } } else { } if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: adhoc join: curr_bss ssid_len =%u\n", (int )priv->curr_bss_params.bss_descriptor.ssid.ssid_len); } else { } } else { } if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: adhoc join: ssid =%s\n", (u8 *)(& bss_desc->ssid.ssid)); } else { } } else { } if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: adhoc join: ssid_len =%u\n", (int )bss_desc->ssid.ssid_len); } else { } } else { } if ((unsigned int )priv->curr_bss_params.bss_descriptor.ssid.ssid_len != 0U) { tmp = mwifiex_ssid_cmp(& bss_desc->ssid, & priv->curr_bss_params.bss_descriptor.ssid); if (tmp == 0) { if (priv->curr_bss_params.bss_descriptor.bss_mode == 1U) { if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: ADHOC_J_CMD: new ad-hoc SSID\tis the same as current; not attempting to re-join\n"); } else { } } else { } return (-1); } else { } } else { } } else { } if (((((unsigned long )(priv->adapter)->fw_cap_info & 8192UL) != 0UL && (unsigned int )bss_desc->disable_11n == 0U) && (unsigned int )bss_desc->disable_11ac == 0U) && ((int )(priv->adapter)->config_bands & 32) != 0) { mwifiex_set_11ac_ba_params(priv); } else { mwifiex_set_ba_params(priv); } if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: curr_bss_params.channel = %d\n", priv->curr_bss_params.bss_descriptor.channel); } else { } } else { } if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: curr_bss_params.band = %c\n", (int )priv->curr_bss_params.band); } else { } } else { } tmp___0 = mwifiex_send_cmd(priv, 44, 1, 0U, (void *)bss_desc, 1); return (tmp___0); } } static int mwifiex_deauthenticate_infra(struct mwifiex_private *priv , u8 *mac ) { u8 mac_address[6U] ; int ret ; bool tmp ; { if ((unsigned long )mac == (unsigned long )((u8 *)0U)) { memcpy((void *)(& mac_address), (void const *)(& priv->curr_bss_params.bss_descriptor.mac_address), 6UL); } else { tmp = is_zero_ether_addr((u8 const *)mac); if ((int )tmp) { memcpy((void *)(& mac_address), (void const *)(& priv->curr_bss_params.bss_descriptor.mac_address), 6UL); } else { memcpy((void *)(& mac_address), (void const *)mac, 6UL); } } ret = mwifiex_send_cmd(priv, 36, 1, 0U, (void *)(& mac_address), 1); return (ret); } } int mwifiex_deauthenticate(struct mwifiex_private *priv , u8 *mac ) { int ret ; int tmp ; int tmp___0 ; { ret = 0; if ((unsigned int )priv->media_connected == 0U) { return (0); } else { } switch (priv->bss_mode) { case 2U: ; case 8U: ret = mwifiex_deauthenticate_infra(priv, mac); if (ret != 0) { cfg80211_disconnected(priv->netdev, 0, (u8 const *)0U, 0UL, 1, 208U); } else { } goto ldv_61128; case 1U: tmp = mwifiex_send_cmd(priv, 64, 1, 0U, (void *)0, 1); return (tmp); case 3U: tmp___0 = mwifiex_send_cmd(priv, 178, 1, 0U, (void *)0, 1); return (tmp___0); default: ; goto ldv_61128; } ldv_61128: ; return (ret); } } void mwifiex_deauthenticate_all(struct mwifiex_adapter *adapter ) { struct mwifiex_private *priv ; int i ; { i = 0; goto ldv_61138; ldv_61137: priv = adapter->priv[i]; if ((unsigned long )priv != (unsigned long )((struct mwifiex_private *)0)) { mwifiex_deauthenticate(priv, (u8 *)0U); } else { } i = i + 1; ldv_61138: ; if ((int )adapter->priv_num > i) { goto ldv_61137; } else { } return; } } static char const __kstrtab_mwifiex_deauthenticate_all[27U] = { 'm', 'w', 'i', 'f', 'i', 'e', 'x', '_', 'd', 'e', 'a', 'u', 't', 'h', 'e', 'n', 't', 'i', 'c', 'a', 't', 'e', '_', 'a', 'l', 'l', '\000'}; struct kernel_symbol const __ksymtab_mwifiex_deauthenticate_all ; struct kernel_symbol const __ksymtab_mwifiex_deauthenticate_all = {(unsigned long )(& mwifiex_deauthenticate_all), (char const *)(& __kstrtab_mwifiex_deauthenticate_all)}; u8 mwifiex_band_to_radio_type(u8 band ) { { switch ((int )band) { case 4: ; case 16: ; case 20: ; case 52: ; return (1U); case 1: ; case 2: ; case 3: ; default: ; return (0U); } } } bool ldv_queue_work_on_201(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_202(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_203(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_204(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_205(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } extern int snprintf(char * , size_t , char const * , ...) ; extern int strncmp(char const * , char const * , __kernel_size_t ) ; __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 rcu_read_lock_held(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_215(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_217(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_216(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_219(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_218(struct workqueue_struct *ldv_func_arg1 ) ; extern long schedule_timeout(long ) ; extern u8 const *ieee80211_bss_get_ie(struct cfg80211_bss * , u8 ) ; extern int ieee80211_frequency_to_channel(int ) ; int mwifiex_set_hs_params(struct mwifiex_private *priv , u16 action , int cmd_type , struct mwifiex_ds_hs_cfg *hs_cfg ) ; int mwifiex_bss_start(struct mwifiex_private *priv , struct cfg80211_bss *bss , struct cfg80211_ssid *req_ssid ) ; int mwifiex_cancel_hs(struct mwifiex_private *priv , int cmd_type ) ; int mwifiex_enable_hs(struct mwifiex_adapter *adapter ) ; int mwifiex_disable_auto_ds(struct mwifiex_private *priv ) ; int mwifiex_drv_get_data_rate(struct mwifiex_private *priv , u32 *rate ) ; int mwifiex_set_encode(struct mwifiex_private *priv , struct key_params *kp , u8 const *key , int key_len , u8 key_index , u8 const *mac_addr , int disable ) ; int mwifiex_set_gen_ie(struct mwifiex_private *priv , u8 const *ie , int ie_len ) ; int mwifiex_get_ver_ext(struct mwifiex_private *priv ) ; int mwifiex_remain_on_chan_cfg(struct mwifiex_private *priv , u16 action , struct ieee80211_channel *chan , unsigned int duration ) ; int mwifiex_get_stats_info(struct mwifiex_private *priv , struct mwifiex_ds_get_stats *log ) ; int mwifiex_reg_write(struct mwifiex_private *priv , u32 reg_type , u32 reg_offset , u32 reg_value ) ; int mwifiex_reg_read(struct mwifiex_private *priv , u32 reg_type , u32 reg_offset , u32 *value ) ; int mwifiex_eeprom_read(struct mwifiex_private *priv , u16 offset , u16 bytes , u8 *value ) ; int mwifiex_drv_set_power(struct mwifiex_private *priv , u32 *ps_mode ) ; int mwifiex_set_tx_power(struct mwifiex_private *priv , struct mwifiex_power_cfg *power_cfg ) ; int mwifiex_get_bss_info(struct mwifiex_private *priv , struct mwifiex_bss_info *info___0 ) ; u8 mwifiex_chan_type_to_sec_chan_offset(enum nl80211_channel_type chan_type ) ; int mwifiex_dnld_dt_cfgdata(struct mwifiex_private *priv , struct device_node *node , char const *prefix ) ; void mwifiex_dnld_txpwr_table(struct mwifiex_private *priv ) ; static int disconnect_on_suspend ; int mwifiex_copy_mcast_addr(struct mwifiex_multicast_list *mlist , struct net_device *dev ) { int i ; struct netdev_hw_addr *ha ; struct list_head const *__mptr ; int tmp ; struct list_head const *__mptr___0 ; { i = 0; __mptr = (struct list_head const *)dev->mc.list.next; ha = (struct netdev_hw_addr *)__mptr; goto ldv_60961; ldv_60960: tmp = i; i = i + 1; memcpy((void *)(& mlist->mac_list) + (unsigned long )tmp, (void const *)(& ha->addr), 6UL); __mptr___0 = (struct list_head const *)ha->list.next; ha = (struct netdev_hw_addr *)__mptr___0; ldv_60961: ; if ((unsigned long )(& ha->list) != (unsigned long )(& dev->mc.list)) { goto ldv_60960; } else { } return (i); } } int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter , struct cmd_ctrl_node *cmd_queued ) { int status ; long __ret ; wait_queue_t __wait ; long __ret___0 ; long __int ; long tmp ; bool __cond ; bool __cond___0 ; { __ret = 3000L; __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/11944/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/mwifiex/sta_ioctl.c", 65, 0); __cond___0 = (unsigned int )*(cmd_queued->condition) != 0U; if ((int )__cond___0 && __ret == 0L) { __ret = 1L; } else { } if (((int )__cond___0 || __ret == 0L) == 0) { __ret___0 = 3000L; INIT_LIST_HEAD(& __wait.task_list); __wait.flags = 0U; ldv_60978: tmp = prepare_to_wait_event(& adapter->cmd_wait_q.wait, & __wait, 1); __int = tmp; __cond = (unsigned int )*(cmd_queued->condition) != 0U; if ((int )__cond && __ret___0 == 0L) { __ret___0 = 1L; } else { } if (((int )__cond || __ret___0 == 0L) != 0) { goto ldv_60977; } else { } if (__int != 0L) { __ret___0 = __int; goto ldv_60977; } else { } __ret___0 = schedule_timeout(__ret___0); goto ldv_60978; ldv_60977: finish_wait(& adapter->cmd_wait_q.wait, & __wait); __ret = __ret___0; } else { } status = (int )__ret; if (status <= 0) { if (status == 0) { status = -110; } else { } if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cmd_wait_q terminated: %d\n", status); } else { } } else { } mwifiex_cancel_all_pending_cmd(adapter); return (status); } else { } status = adapter->cmd_wait_q.status; adapter->cmd_wait_q.status = 0; return (status); } } int mwifiex_request_set_multicast_list(struct mwifiex_private *priv , struct mwifiex_multicast_list *mcast_list ) { int ret ; u16 old_pkt_filter ; { ret = 0; old_pkt_filter = priv->curr_pkt_filter; if (mcast_list->mode == 1U) { if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: Enable Promiscuous mode\n"); } else { } } else { } priv->curr_pkt_filter = (u16 )((unsigned int )priv->curr_pkt_filter | 128U); priv->curr_pkt_filter = (unsigned int )priv->curr_pkt_filter & 65279U; } else { priv->curr_pkt_filter = (unsigned int )priv->curr_pkt_filter & 65407U; if (mcast_list->mode == 4U) { if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: Enabling All Multicast!\n"); } else { } } else { } priv->curr_pkt_filter = (u16 )((unsigned int )priv->curr_pkt_filter | 256U); } else { priv->curr_pkt_filter = (unsigned int )priv->curr_pkt_filter & 65279U; if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: Set multicast list=%d\n", mcast_list->num_multicast_addr); } else { } } else { } ret = mwifiex_send_cmd(priv, 16, 1, 0U, (void *)mcast_list, 0); } } if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: old_pkt_filter=%#x, curr_pkt_filter=%#x\n", (int )old_pkt_filter, (int )priv->curr_pkt_filter); } else { } } else { } if ((int )priv->curr_pkt_filter != (int )old_pkt_filter) { ret = mwifiex_send_cmd(priv, 40, 1, 0U, (void *)(& priv->curr_pkt_filter), 0); } else { } return (ret); } } int mwifiex_fill_new_bss_desc(struct mwifiex_private *priv , struct cfg80211_bss *bss , struct mwifiex_bssdescriptor *bss_desc ) { u8 *beacon_ie ; size_t beacon_ie_len ; struct mwifiex_bss_priv *bss_priv ; struct cfg80211_bss_ies const *ies ; struct cfg80211_bss_ies const *________p1 ; struct cfg80211_bss_ies const *_________p1 ; union __anonunion___u_435 __u ; bool __warned ; int tmp ; int tmp___0 ; void *tmp___1 ; int tmp___2 ; { bss_priv = (struct mwifiex_bss_priv *)(& bss->priv); rcu_read_lock(); __read_once_size((void const volatile *)(& bss->ies), (void *)(& __u.__c), 8); _________p1 = __u.__val; ________p1 = _________p1; tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { tmp___0 = rcu_read_lock_held(); if (tmp___0 == 0) { __warned = 1; lockdep_rcu_suspicious("/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/11944/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/mwifiex/sta_ioctl.c", 151, "suspicious rcu_dereference_check() usage"); } else { } } else { } ies = ________p1; tmp___1 = kmemdup((void const *)(& ies->data), (size_t )ies->len, 32U); beacon_ie = (u8 *)tmp___1; beacon_ie_len = (size_t )ies->len; bss_desc->timestamp = ies->tsf; rcu_read_unlock(); if ((unsigned long )beacon_ie == (unsigned long )((u8 *)0U)) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, " failed to alloc beacon_ie\n"); } else { } } else { } return (-12); } else { } memcpy((void *)(& bss_desc->mac_address), (void const *)(& bss->bssid), 6UL); bss_desc->rssi = bss->signal; bss_desc->beacon_buf = beacon_ie; bss_desc->beacon_buf_size = (u32 )beacon_ie_len; bss_desc->beacon_period = bss->beacon_interval; bss_desc->cap_info_bitmap = bss->capability; bss_desc->bss_band = (u16 )bss_priv->band; bss_desc->fw_tsf = bss_priv->fw_tsf; if (((int )bss_desc->cap_info_bitmap & 16) != 0) { if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: InterpretIE: AP WEP enabled\n"); } else { } } else { } bss_desc->privacy = 1U; } else { bss_desc->privacy = 0U; } if (((int )bss_desc->cap_info_bitmap & 2) != 0) { bss_desc->bss_mode = 1U; } else { bss_desc->bss_mode = 2U; } bss_desc->disable_11ac = 1U; if (((int )bss_desc->cap_info_bitmap & 256) != 0) { bss_desc->sensed_11h = 1U; } else { } tmp___2 = mwifiex_update_bss_desc_with_ie(priv->adapter, bss_desc); return (tmp___2); } } void mwifiex_dnld_txpwr_table(struct mwifiex_private *priv ) { char txpwr[22U] ; { if ((unsigned long )(priv->adapter)->dt_node != (unsigned long )((struct device_node *)0)) { txpwr[0] = 'm'; txpwr[1] = 'a'; txpwr[2] = 'r'; txpwr[3] = 'v'; txpwr[4] = 'e'; txpwr[5] = 'l'; txpwr[6] = 'l'; txpwr[7] = ','; txpwr[8] = '0'; txpwr[9] = '0'; txpwr[10] = '_'; txpwr[11] = 't'; txpwr[12] = 'x'; txpwr[13] = 'p'; txpwr[14] = 'w'; txpwr[15] = 'r'; txpwr[16] = 'l'; txpwr[17] = 'i'; txpwr[18] = 'm'; txpwr[19] = 'i'; txpwr[20] = 't'; txpwr[21] = '\000'; memcpy((void *)(& txpwr) + 8U, (void const *)(& (priv->adapter)->country_code), 2UL); mwifiex_dnld_dt_cfgdata(priv, (priv->adapter)->dt_node, (char const *)(& txpwr)); } else { } return; } } static int mwifiex_process_country_ie(struct mwifiex_private *priv , struct cfg80211_bss *bss ) { u8 const *country_ie ; u8 country_ie_len ; struct mwifiex_802_11d_domain_reg *domain_info ; int tmp ; int tmp___0 ; { domain_info = & (priv->adapter)->domain_reg; rcu_read_lock(); country_ie = ieee80211_bss_get_ie(bss, 7); if ((unsigned long )country_ie == (unsigned long )((u8 const *)0U)) { rcu_read_unlock(); return (0); } else { } country_ie_len = *(country_ie + 1UL); if ((unsigned int )country_ie_len <= 5U) { rcu_read_unlock(); return (0); } else { } tmp = strncmp((char const *)(& (priv->adapter)->country_code), (char const *)country_ie + 2U, 2UL); if (tmp == 0) { rcu_read_unlock(); if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "11D: skip setting domain info in FW\n"); } else { } } else { } return (0); } else { } memcpy((void *)(& (priv->adapter)->country_code), (void const *)country_ie + 2U, 2UL); domain_info->country_code[0] = *(country_ie + 2UL); domain_info->country_code[1] = *(country_ie + 3UL); domain_info->country_code[2] = 32U; country_ie_len = (unsigned int )country_ie_len + 253U; domain_info->no_of_triplet = (u8 )((unsigned int )country_ie_len / 3U); memcpy((void *)(& domain_info->triplet), (void const *)country_ie + 5U, (size_t )country_ie_len); rcu_read_unlock(); tmp___0 = mwifiex_send_cmd(priv, 91, 1, 0U, (void *)0, 0); if (tmp___0 != 0) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "11D: setting domain info in FW fail\n"); } else { } } else { } return (-1); } else { } mwifiex_dnld_txpwr_table(priv); return (0); } } int mwifiex_bss_start(struct mwifiex_private *priv , struct cfg80211_bss *bss , struct cfg80211_ssid *req_ssid ) { int ret ; struct mwifiex_adapter *adapter ; struct mwifiex_bssdescriptor *bss_desc ; void *tmp ; u8 config_bands ; u8 tmp___0 ; u8 tmp___1 ; bool tmp___2 ; s32 tmp___3 ; bool tmp___4 ; { adapter = priv->adapter; bss_desc = (struct mwifiex_bssdescriptor *)0; priv->scan_block = 0U; if ((unsigned long )bss != (unsigned long )((struct cfg80211_bss *)0)) { mwifiex_process_country_ie(priv, bss); tmp = kzalloc(336UL, 208U); bss_desc = (struct mwifiex_bssdescriptor *)tmp; if ((unsigned long )bss_desc == (unsigned long )((struct mwifiex_bssdescriptor *)0)) { return (-12); } else { } ret = mwifiex_fill_new_bss_desc(priv, bss, bss_desc); if (ret != 0) { goto done; } else { } } else { } if (priv->bss_mode == 2U || priv->bss_mode == 8U) { if ((unsigned long )bss_desc == (unsigned long )((struct mwifiex_bssdescriptor *)0)) { return (-1); } else { } tmp___0 = mwifiex_band_to_radio_type((int )((u8 )bss_desc->bss_band)); if ((unsigned int )tmp___0 == 0U) { config_bands = 11U; } else { config_bands = 20U; if (((int )adapter->fw_bands & 32) != 0) { config_bands = (u8 )((unsigned int )config_bands | 32U); } else { } } if ((((int )adapter->fw_bands | (int )config_bands) & ~ ((int )adapter->fw_bands)) == 0) { adapter->config_bands = config_bands; } else { } ret = mwifiex_check_network_compatibility(priv, bss_desc); if (ret != 0) { goto done; } else { } tmp___1 = mwifiex_11h_get_csa_closed_channel(priv); if ((int )tmp___1 == (int )((unsigned char )bss_desc->channel)) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "Attempt to reconnect on csa closed chan(%d)\n", bss_desc->channel); } else { } } else { } goto done; } else { } if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: SSID found in scan list ...\tassociating...\n"); } else { } } else { } mwifiex_stop_net_dev_queue(priv->netdev, adapter); tmp___2 = netif_carrier_ok((struct net_device const *)priv->netdev); if ((int )tmp___2) { netif_carrier_off(priv->netdev); } else { } priv->assoc_rsp_size = 0U; ret = mwifiex_associate(priv, bss_desc); if ((ret == 13 && (unsigned int )priv->sec_info.is_authtype_auto != 0U) && (unsigned int )priv->sec_info.wep_enabled != 0U) { priv->sec_info.authentication_mode = 1U; ret = mwifiex_associate(priv, bss_desc); } else { } if ((unsigned long )bss != (unsigned long )((struct cfg80211_bss *)0)) { cfg80211_put_bss((priv->adapter)->wiphy, bss); } else { } } else { if ((unsigned long )bss_desc != (unsigned long )((struct mwifiex_bssdescriptor *)0) && (unsigned int )bss_desc->ssid.ssid_len != 0U) { tmp___3 = mwifiex_ssid_cmp(& priv->curr_bss_params.bss_descriptor.ssid, & bss_desc->ssid); if (tmp___3 == 0) { ret = 0; goto done; } else { } } else { } priv->adhoc_is_link_sensed = 0U; ret = mwifiex_check_network_compatibility(priv, bss_desc); mwifiex_stop_net_dev_queue(priv->netdev, adapter); tmp___4 = netif_carrier_ok((struct net_device const *)priv->netdev); if ((int )tmp___4) { netif_carrier_off(priv->netdev); } else { } if (ret == 0) { if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: network found in scan\t list. Joining...\n"); } else { } } else { } ret = mwifiex_adhoc_join(priv, bss_desc); if ((unsigned long )bss != (unsigned long )((struct cfg80211_bss *)0)) { cfg80211_put_bss((priv->adapter)->wiphy, bss); } else { } } else { if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: Network not found in\tthe list, creating adhoc with ssid = %s\n", (u8 *)(& req_ssid->ssid)); } else { } } else { } ret = mwifiex_adhoc_start(priv, req_ssid); } } done: ; if ((unsigned long )bss_desc != (unsigned long )((struct mwifiex_bssdescriptor *)0)) { kfree((void const *)bss_desc->beacon_buf); } else { } kfree((void const *)bss_desc); return (ret); } } int mwifiex_set_hs_params(struct mwifiex_private *priv , u16 action , int cmd_type , struct mwifiex_ds_hs_cfg *hs_cfg ) { struct mwifiex_adapter *adapter ; int status ; u32 prev_cond ; { adapter = priv->adapter; status = 0; prev_cond = 0U; if ((unsigned long )hs_cfg == (unsigned long )((struct mwifiex_ds_hs_cfg *)0)) { return (-12); } else { } switch ((int )action) { case 1: ; if ((unsigned int )adapter->pps_uapsd_mode != 0U) { if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: Host Sleep IOCTL\tis blocked in UAPSD/PPS mode\n"); } else { } } else { } status = -1; goto ldv_61037; } else { } if (hs_cfg->is_invoke_hostcmd != 0U) { if (hs_cfg->conditions == 4294967295U) { if ((unsigned int )adapter->is_hs_configured == 0U) { goto ldv_61037; } else { } prev_cond = adapter->hs_cfg.conditions; adapter->hs_cfg.conditions = hs_cfg->conditions; } else if (hs_cfg->conditions != 0U) { adapter->hs_cfg.conditions = hs_cfg->conditions; adapter->hs_cfg.gpio = (unsigned char )hs_cfg->gpio; if (hs_cfg->gap != 0U) { adapter->hs_cfg.gap = (unsigned char )hs_cfg->gap; } else { } } else if (adapter->hs_cfg.conditions == 4294967295U) { status = -1; goto ldv_61037; } else { } status = mwifiex_send_cmd(priv, 229, 1, 0U, (void *)(& adapter->hs_cfg), cmd_type == 1); if (hs_cfg->conditions == 4294967295U) { adapter->hs_cfg.conditions = prev_cond; } else { } } else { adapter->hs_cfg.conditions = hs_cfg->conditions; adapter->hs_cfg.gpio = (unsigned char )hs_cfg->gpio; adapter->hs_cfg.gap = (unsigned char )hs_cfg->gap; } goto ldv_61037; case 0: hs_cfg->conditions = adapter->hs_cfg.conditions; hs_cfg->gpio = (u32 )adapter->hs_cfg.gpio; hs_cfg->gap = (u32 )adapter->hs_cfg.gap; goto ldv_61037; default: status = -1; goto ldv_61037; } ldv_61037: ; return (status); } } int mwifiex_cancel_hs(struct mwifiex_private *priv , int cmd_type ) { struct mwifiex_ds_hs_cfg hscfg ; int tmp ; { hscfg.conditions = 4294967295U; hscfg.is_invoke_hostcmd = 1U; tmp = mwifiex_set_hs_params(priv, 1, cmd_type, & hscfg); return (tmp); } } static char const __kstrtab_mwifiex_cancel_hs[18U] = { 'm', 'w', 'i', 'f', 'i', 'e', 'x', '_', 'c', 'a', 'n', 'c', 'e', 'l', '_', 'h', 's', '\000'}; struct kernel_symbol const __ksymtab_mwifiex_cancel_hs ; struct kernel_symbol const __ksymtab_mwifiex_cancel_hs = {(unsigned long )(& mwifiex_cancel_hs), (char const *)(& __kstrtab_mwifiex_cancel_hs)}; int mwifiex_enable_hs(struct mwifiex_adapter *adapter ) { struct mwifiex_ds_hs_cfg hscfg ; struct mwifiex_private *priv ; int i ; struct mwifiex_private *tmp ; int tmp___0 ; long __ret ; wait_queue_t __wait ; long __ret___0 ; long __int ; long tmp___1 ; bool __cond ; bool __cond___0 ; { if (disconnect_on_suspend != 0) { i = 0; goto ldv_61060; ldv_61059: priv = adapter->priv[i]; if ((unsigned long )priv != (unsigned long )((struct mwifiex_private *)0)) { mwifiex_deauthenticate(priv, (u8 *)0U); } else { } i = i + 1; ldv_61060: ; if ((int )adapter->priv_num > i) { goto ldv_61059; } else { } } else { } if ((unsigned int )adapter->hs_activated != 0U) { if ((adapter->debug_mask & 16U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cmd: HS Already activated\n"); } else { } } else { } return (1); } else { } adapter->hs_activate_wait_q_woken = 0U; memset((void *)(& hscfg), 0, 16UL); hscfg.is_invoke_hostcmd = 1U; adapter->hs_enabling = 1; mwifiex_cancel_all_pending_cmd(adapter); tmp = mwifiex_get_priv___1(adapter, 0); tmp___0 = mwifiex_set_hs_params(tmp, 1, 1, & hscfg); if (tmp___0 != 0) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "IOCTL request HS enable failed\n"); } else { } } else { } return (0); } else { } __ret = 2500L; __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/11944/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/mwifiex/sta_ioctl.c", 531, 0); __cond___0 = (unsigned int )adapter->hs_activate_wait_q_woken != 0U; if ((int )__cond___0 && __ret == 0L) { __ret = 1L; } else { } if (((int )__cond___0 || __ret == 0L) == 0) { __ret___0 = 2500L; INIT_LIST_HEAD(& __wait.task_list); __wait.flags = 0U; ldv_61072: tmp___1 = prepare_to_wait_event(& adapter->hs_activate_wait_q, & __wait, 1); __int = tmp___1; __cond = (unsigned int )adapter->hs_activate_wait_q_woken != 0U; if ((int )__cond && __ret___0 == 0L) { __ret___0 = 1L; } else { } if (((int )__cond || __ret___0 == 0L) != 0) { goto ldv_61071; } else { } if (__int != 0L) { __ret___0 = __int; goto ldv_61071; } else { } __ret___0 = schedule_timeout(__ret___0); goto ldv_61072; ldv_61071: finish_wait(& adapter->hs_activate_wait_q, & __wait); __ret = __ret___0; } else { } if (__ret <= 0L) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "hs_activate_wait_q terminated\n"); } else { } } else { } return (0); } else { } return (1); } } static char const __kstrtab_mwifiex_enable_hs[18U] = { 'm', 'w', 'i', 'f', 'i', 'e', 'x', '_', 'e', 'n', 'a', 'b', 'l', 'e', '_', 'h', 's', '\000'}; struct kernel_symbol const __ksymtab_mwifiex_enable_hs ; struct kernel_symbol const __ksymtab_mwifiex_enable_hs = {(unsigned long )(& mwifiex_enable_hs), (char const *)(& __kstrtab_mwifiex_enable_hs)}; int mwifiex_get_bss_info(struct mwifiex_private *priv , struct mwifiex_bss_info *info___0 ) { struct mwifiex_adapter *adapter ; struct mwifiex_bssdescriptor *bss_desc ; { adapter = priv->adapter; if ((unsigned long )info___0 == (unsigned long )((struct mwifiex_bss_info *)0)) { return (-1); } else { } bss_desc = & priv->curr_bss_params.bss_descriptor; info___0->bss_mode = priv->bss_mode; memcpy((void *)(& info___0->ssid), (void const *)(& bss_desc->ssid), 33UL); memcpy((void *)(& info___0->bssid), (void const *)(& bss_desc->mac_address), 6UL); info___0->bss_chan = bss_desc->channel; memcpy((void *)(& info___0->country_code), (void const *)(& adapter->country_code), 3UL); info___0->media_connected = (u32 )priv->media_connected; info___0->max_power_level = (u32 )priv->max_tx_power_level; info___0->min_power_level = (u32 )priv->min_tx_power_level; info___0->adhoc_state = (u32 )priv->adhoc_state; info___0->bcn_nf_last = (int )priv->bcn_nf_last; if ((unsigned int )priv->sec_info.wep_enabled != 0U) { info___0->wep_status = 1U; } else { info___0->wep_status = 0U; } info___0->is_hs_configured = (u32 )adapter->is_hs_configured; info___0->is_deep_sleep = (u32 )adapter->is_deep_sleep; return (0); } } int mwifiex_disable_auto_ds(struct mwifiex_private *priv ) { struct mwifiex_ds_auto_ds auto_ds ; int tmp ; { auto_ds.auto_ds = 0U; tmp = mwifiex_send_cmd(priv, 228, 254, 1U, (void *)(& auto_ds), 1); return (tmp); } } static char const __kstrtab_mwifiex_disable_auto_ds[24U] = { 'm', 'w', 'i', 'f', 'i', 'e', 'x', '_', 'd', 'i', 's', 'a', 'b', 'l', 'e', '_', 'a', 'u', 't', 'o', '_', 'd', 's', '\000'}; struct kernel_symbol const __ksymtab_mwifiex_disable_auto_ds ; struct kernel_symbol const __ksymtab_mwifiex_disable_auto_ds = {(unsigned long )(& mwifiex_disable_auto_ds), (char const *)(& __kstrtab_mwifiex_disable_auto_ds)}; int mwifiex_drv_get_data_rate(struct mwifiex_private *priv , u32 *rate ) { int ret ; { ret = mwifiex_send_cmd(priv, 127, 0, 0U, (void *)0, 1); if (ret == 0) { if ((unsigned int )priv->is_data_rate_auto != 0U) { *rate = mwifiex_index_to_data_rate(priv, (int )priv->tx_rate, (int )priv->tx_htinfo); } else { *rate = priv->data_rate; } } else { } return (ret); } } int mwifiex_set_tx_power(struct mwifiex_private *priv , struct mwifiex_power_cfg *power_cfg ) { int ret ; struct host_cmd_ds_txpwr_cfg *txp_cfg ; struct mwifiex_types_power_group *pg_tlv ; struct mwifiex_power_group *pg ; u8 *buf ; u16 dbm ; void *tmp ; { dbm = 0U; if (power_cfg->is_power_auto == 0U) { dbm = (unsigned short )power_cfg->power_level; if ((int )((unsigned short )priv->min_tx_power_level) > (int )dbm || (int )((unsigned short )priv->max_tx_power_level) < (int )dbm) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "txpower value %d dBm\tis out of range (%d dBm-%d dBm)\n", (int )dbm, (int )priv->min_tx_power_level, (int )priv->max_tx_power_level); } else { } } else { } return (-1); } else { } } else { } tmp = kzalloc(2048UL, 208U); buf = (u8 *)tmp; if ((unsigned long )buf == (unsigned long )((u8 *)0U)) { return (-12); } else { } txp_cfg = (struct host_cmd_ds_txpwr_cfg *)buf; txp_cfg->action = 1U; if (power_cfg->is_power_auto == 0U) { txp_cfg->mode = 1U; pg_tlv = (struct mwifiex_types_power_group *)buf + 8U; pg_tlv->type = 340U; pg_tlv->length = 32U; pg = (struct mwifiex_power_group *)buf + 12U; pg->first_rate_code = 0U; pg->last_rate_code = 3U; pg->modulation_class = 3U; pg->power_step = 0; pg->power_min = (signed char )dbm; pg->power_max = (signed char )dbm; pg = pg + 1; pg->first_rate_code = 0U; pg->last_rate_code = 7U; pg->modulation_class = 7U; pg->power_step = 0; pg->power_min = (signed char )dbm; pg->power_max = (signed char )dbm; pg = pg + 1; pg->first_rate_code = 0U; pg->last_rate_code = 32U; pg->modulation_class = 8U; pg->power_step = 0; pg->power_min = (signed char )dbm; pg->power_max = (signed char )dbm; pg->ht_bandwidth = 0U; pg = pg + 1; pg->first_rate_code = 0U; pg->last_rate_code = 32U; pg->modulation_class = 8U; pg->power_step = 0; pg->power_min = (signed char )dbm; pg->power_max = (signed char )dbm; pg->ht_bandwidth = 1U; } else { } ret = mwifiex_send_cmd(priv, 209, 1, 0U, (void *)buf, 1); kfree((void const *)buf); return (ret); } } int mwifiex_drv_set_power(struct mwifiex_private *priv , u32 *ps_mode ) { int ret ; struct mwifiex_adapter *adapter ; u16 sub_cmd ; { adapter = priv->adapter; if (*ps_mode != 0U) { adapter->ps_mode = 1U; } else { adapter->ps_mode = 0U; } sub_cmd = *ps_mode != 0U ? 255U : 254U; ret = mwifiex_send_cmd(priv, 228, (int )sub_cmd, 16U, (void *)0, 1); if (ret == 0 && (unsigned int )sub_cmd == 254U) { ret = mwifiex_send_cmd(priv, 228, 0, 0U, (void *)0, 0); } else { } return (ret); } } static int mwifiex_set_wpa_ie_helper(struct mwifiex_private *priv , u8 *ie_data_ptr , u16 ie_len ) { { if ((unsigned int )ie_len != 0U) { if ((unsigned int )ie_len > 256U) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "failed to copy WPA IE, too big\n"); } else { } } else { } return (-1); } else { } memcpy((void *)(& priv->wpa_ie), (void const *)ie_data_ptr, (size_t )ie_len); priv->wpa_ie_len = (unsigned char )ie_len; if (((priv->adapter)->debug_mask & 16U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "cmd: Set Wpa_ie_len=%d IE=%#x\n", (int )priv->wpa_ie_len, (int )priv->wpa_ie[0]); } else { } } else { } if ((unsigned int )priv->wpa_ie[0] == 221U) { priv->sec_info.wpa_enabled = 1U; } else if ((unsigned int )priv->wpa_ie[0] == 48U) { priv->sec_info.wpa2_enabled = 1U; } else { priv->sec_info.wpa_enabled = 0U; priv->sec_info.wpa2_enabled = 0U; } } else { memset((void *)(& priv->wpa_ie), 0, 256UL); priv->wpa_ie_len = 0U; if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: reset wpa_ie_len=%d IE=%#x\n", (int )priv->wpa_ie_len, (int )priv->wpa_ie[0]); } else { } } else { } priv->sec_info.wpa_enabled = 0U; priv->sec_info.wpa2_enabled = 0U; } return (0); } } static int mwifiex_set_wapi_ie(struct mwifiex_private *priv , u8 *ie_data_ptr , u16 ie_len ) { { if ((unsigned int )ie_len != 0U) { if ((unsigned int )ie_len > 256U) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: failed to copy WAPI IE, too big\n"); } else { } } else { } return (-1); } else { } memcpy((void *)(& priv->wapi_ie), (void const *)ie_data_ptr, (size_t )ie_len); priv->wapi_ie_len = (u8 )ie_len; if (((priv->adapter)->debug_mask & 16U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "cmd: Set wapi_ie_len=%d IE=%#x\n", (int )priv->wapi_ie_len, (int )priv->wapi_ie[0]); } else { } } else { } if ((unsigned int )priv->wapi_ie[0] == 68U) { priv->sec_info.wapi_enabled = 1U; } else { } } else { memset((void *)(& priv->wapi_ie), 0, 256UL); priv->wapi_ie_len = (u8 )ie_len; if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: Reset wapi_ie_len=%d IE=%#x\n", (int )priv->wapi_ie_len, (int )priv->wapi_ie[0]); } else { } } else { } priv->sec_info.wapi_enabled = 0U; } return (0); } } static int mwifiex_set_wps_ie(struct mwifiex_private *priv , u8 *ie_data_ptr , u16 ie_len ) { void *tmp ; { if ((unsigned int )ie_len != 0U) { if ((unsigned int )ie_len > 256U) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: failed to copy WPS IE, too big\n"); } else { } } else { } return (-1); } else { } tmp = kzalloc(256UL, 208U); priv->wps_ie = (u8 *)tmp; if ((unsigned long )priv->wps_ie == (unsigned long )((u8 *)0U)) { return (-12); } else { } memcpy((void *)priv->wps_ie, (void const *)ie_data_ptr, (size_t )ie_len); priv->wps_ie_len = (u8 )ie_len; if (((priv->adapter)->debug_mask & 16U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "cmd: Set wps_ie_len=%d IE=%#x\n", (int )priv->wps_ie_len, (int )*(priv->wps_ie)); } else { } } else { } } else { kfree((void const *)priv->wps_ie); priv->wps_ie_len = (u8 )ie_len; if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: Reset wps_ie_len=%d\n", (int )priv->wps_ie_len); } else { } } else { } } return (0); } } static int mwifiex_sec_ioctl_set_wapi_key(struct mwifiex_private *priv , struct mwifiex_ds_encrypt_key *encrypt_key ) { int tmp ; { tmp = mwifiex_send_cmd(priv, 94, 1, 1U, (void *)encrypt_key, 1); return (tmp); } } static int mwifiex_sec_ioctl_set_wep_key(struct mwifiex_private *priv , struct mwifiex_ds_encrypt_key *encrypt_key ) { struct mwifiex_adapter *adapter ; int ret ; struct mwifiex_wep_key *wep_key ; int index ; void *enc_key ; { adapter = priv->adapter; if ((unsigned int )priv->wep_key_curr_index > 3U) { priv->wep_key_curr_index = 0U; } else { } wep_key = (struct mwifiex_wep_key *)(& priv->wep_key) + (unsigned long )priv->wep_key_curr_index; index = (int )encrypt_key->key_index; if (encrypt_key->key_disable != 0U) { priv->sec_info.wep_enabled = 0U; } else if (encrypt_key->key_len == 0U) { wep_key = (struct mwifiex_wep_key *)(& priv->wep_key) + (unsigned long )index; if (wep_key->key_length == 0U) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "key not set, so cannot enable it\n"); } else { } } else { } return (-1); } else { } if ((unsigned int )adapter->key_api_major_ver == 2U) { memcpy((void *)(& encrypt_key->key_material), (void const *)(& wep_key->key_material), (size_t )wep_key->key_length); encrypt_key->key_len = wep_key->key_length; } else { } priv->wep_key_curr_index = (unsigned short )index; priv->sec_info.wep_enabled = 1U; } else { wep_key = (struct mwifiex_wep_key *)(& priv->wep_key) + (unsigned long )index; memset((void *)wep_key, 0, 28UL); memcpy((void *)(& wep_key->key_material), (void const *)(& encrypt_key->key_material), (size_t )encrypt_key->key_len); wep_key->key_index = (u32 )index; wep_key->key_length = encrypt_key->key_len; priv->sec_info.wep_enabled = 1U; } if (wep_key->key_length != 0U) { if (encrypt_key->key_disable != 0U) { memset((void *)(& priv->wep_key) + (unsigned long )index, 0, 28UL); if (wep_key->key_length != 0U) { goto done; } else { } } else { } if ((unsigned int )adapter->key_api_major_ver == 2U) { enc_key = (void *)encrypt_key; } else { enc_key = (void *)0; } ret = mwifiex_send_cmd(priv, 94, 1, 0U, enc_key, 0); if (ret != 0) { return (ret); } else { } } else { } done: ; if ((unsigned int )priv->sec_info.wep_enabled != 0U) { priv->curr_pkt_filter = (u16 )((unsigned int )priv->curr_pkt_filter | 8U); } else { priv->curr_pkt_filter = (unsigned int )priv->curr_pkt_filter & 65527U; } ret = mwifiex_send_cmd(priv, 40, 1, 0U, (void *)(& priv->curr_pkt_filter), 1); return (ret); } } static int mwifiex_sec_ioctl_set_wpa_key(struct mwifiex_private *priv , struct mwifiex_ds_encrypt_key *encrypt_key ) { int ret ; u8 remove_key ; struct host_cmd_ds_802_11_key_material *ibss_key ; { remove_key = 0U; if (encrypt_key->key_len > 32U) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "key length too long\n"); } else { } } else { } return (-1); } else { } if (priv->bss_mode == 1U) { encrypt_key->key_index = 1073741824U; ret = mwifiex_send_cmd(priv, 94, 1, 1U, (void *)encrypt_key, 0); if (ret != 0) { return (ret); } else { } ibss_key = & priv->aes_key; memset((void *)ibss_key, 0, 62UL); memcpy((void *)(& ibss_key->key_param_set.key), (void const *)(& encrypt_key->key_material), (size_t )encrypt_key->key_len); memcpy((void *)(& ibss_key->key_param_set.key_len), (void const *)(& encrypt_key->key_len), 2UL); ibss_key->key_param_set.key_type_id = 1U; ibss_key->key_param_set.key_info = 4U; encrypt_key->key_index = 3221225471U; } else { } if (encrypt_key->key_index == 0U) { encrypt_key->key_index = 1073741824U; } else { } if ((unsigned int )remove_key != 0U) { ret = mwifiex_send_cmd(priv, 94, 1, 0U, (void *)encrypt_key, 1); } else { ret = mwifiex_send_cmd(priv, 94, 1, 1U, (void *)encrypt_key, 1); } return (ret); } } static int mwifiex_sec_ioctl_encrypt_key(struct mwifiex_private *priv , struct mwifiex_ds_encrypt_key *encrypt_key ) { int status ; { if (encrypt_key->is_wapi_key != 0U) { status = mwifiex_sec_ioctl_set_wapi_key(priv, encrypt_key); } else if (encrypt_key->key_len > 13U) { status = mwifiex_sec_ioctl_set_wpa_key(priv, encrypt_key); } else { status = mwifiex_sec_ioctl_set_wep_key(priv, encrypt_key); } return (status); } } int mwifiex_drv_get_driver_version(struct mwifiex_adapter *adapter , char *version , int max_len ) { union __anonunion_ver_437 ver ; char fw_ver[32U] ; { ver.l = adapter->fw_release_number; sprintf((char *)(& fw_ver), "%u.%u.%u.p%u", (int )ver.c[2], (int )ver.c[1], (int )ver.c[0], (int )ver.c[3]); snprintf(version, (size_t )max_len, (char const *)(& driver_version), (char *)(& fw_ver)); if ((int )adapter->debug_mask & 1) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: MWIFIEX VERSION: %s\n", version); } else { } } else { } return (0); } } int mwifiex_set_encode(struct mwifiex_private *priv , struct key_params *kp , u8 const *key , int key_len , u8 key_index , u8 const *mac_addr , int disable ) { struct mwifiex_ds_encrypt_key encrypt_key ; int tmp ; { memset((void *)(& encrypt_key), 0, 76UL); encrypt_key.key_len = (u32 )key_len; encrypt_key.key_index = (u32 )key_index; if ((unsigned long )kp != (unsigned long )((struct key_params *)0) && kp->cipher == 1027078U) { encrypt_key.is_igtk_key = 1U; } else { } if (disable == 0) { if (key_len != 0) { memcpy((void *)(& encrypt_key.key_material), (void const *)key, (size_t )key_len); } else { encrypt_key.is_current_wep_key = 1U; } if ((unsigned long )mac_addr != (unsigned long )((u8 const *)0U)) { memcpy((void *)(& encrypt_key.mac_addr), (void const *)mac_addr, 6UL); } else { } if (((unsigned long )kp != (unsigned long )((struct key_params *)0) && (unsigned long )kp->seq != (unsigned long )((u8 const *)0U)) && kp->seq_len != 0) { memcpy((void *)(& encrypt_key.pn), (void const *)kp->seq, (size_t )kp->seq_len); encrypt_key.pn_len = (u8 )kp->seq_len; encrypt_key.is_rx_seq_valid = 1U; } else { } } else { if ((int )priv->bss_role & 1) { return (0); } else { } encrypt_key.key_disable = 1U; if ((unsigned long )mac_addr != (unsigned long )((u8 const *)0U)) { memcpy((void *)(& encrypt_key.mac_addr), (void const *)mac_addr, 6UL); } else { } } tmp = mwifiex_sec_ioctl_encrypt_key(priv, & encrypt_key); return (tmp); } } int mwifiex_get_ver_ext(struct mwifiex_private *priv ) { struct mwifiex_ver_ext ver_ext ; int tmp ; { memset((void *)(& ver_ext), 0, 129UL); tmp = mwifiex_send_cmd(priv, 151, 0, 0U, (void *)(& ver_ext), 1); if (tmp != 0) { return (-1); } else { } return (0); } } int mwifiex_remain_on_chan_cfg(struct mwifiex_private *priv , u16 action , struct ieee80211_channel *chan , unsigned int duration ) { struct host_cmd_ds_remain_on_chan roc_cfg ; u8 sc ; int tmp ; int tmp___0 ; { memset((void *)(& roc_cfg), 0, 10UL); roc_cfg.action = action; if ((unsigned int )action == 1U) { roc_cfg.band_cfg = (u8 )chan->band; sc = mwifiex_chan_type_to_sec_chan_offset(0); roc_cfg.band_cfg = (u8 )((int )((signed char )roc_cfg.band_cfg) | (int )((signed char )((int )sc << 2))); tmp = ieee80211_frequency_to_channel((int )chan->center_freq); roc_cfg.channel = (u8 )tmp; roc_cfg.duration = duration; } else { } tmp___0 = mwifiex_send_cmd(priv, 269, (int )action, 0U, (void *)(& roc_cfg), 1); if (tmp___0 != 0) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "failed to remain on channel\n"); } else { } } else { } return (-1); } else { } return ((int )roc_cfg.status); } } int mwifiex_get_stats_info(struct mwifiex_private *priv , struct mwifiex_ds_get_stats *log ) { int tmp ; { tmp = mwifiex_send_cmd(priv, 11, 0, 0U, (void *)log, 1); return (tmp); } } static int mwifiex_reg_mem_ioctl_reg_rw(struct mwifiex_private *priv , struct mwifiex_ds_reg_rw *reg_rw , u16 action ) { u16 cmd_no ; int tmp ; { switch (reg_rw->type) { case 1U: cmd_no = 25U; goto ldv_61205; case 2U: cmd_no = 26U; goto ldv_61205; case 3U: cmd_no = 27U; goto ldv_61205; case 4U: cmd_no = 173U; goto ldv_61205; case 5U: cmd_no = 237U; goto ldv_61205; default: ; return (-1); } ldv_61205: tmp = mwifiex_send_cmd(priv, (int )cmd_no, (int )action, 0U, (void *)reg_rw, 1); return (tmp); } } int mwifiex_reg_write(struct mwifiex_private *priv , u32 reg_type , u32 reg_offset , u32 reg_value ) { struct mwifiex_ds_reg_rw reg_rw ; int tmp ; { reg_rw.type = reg_type; reg_rw.offset = reg_offset; reg_rw.value = reg_value; tmp = mwifiex_reg_mem_ioctl_reg_rw(priv, & reg_rw, 1); return (tmp); } } int mwifiex_reg_read(struct mwifiex_private *priv , u32 reg_type , u32 reg_offset , u32 *value ) { int ret ; struct mwifiex_ds_reg_rw reg_rw ; { reg_rw.type = reg_type; reg_rw.offset = reg_offset; ret = mwifiex_reg_mem_ioctl_reg_rw(priv, & reg_rw, 0); if (ret != 0) { goto done; } else { } *value = reg_rw.value; done: ; return (ret); } } int mwifiex_eeprom_read(struct mwifiex_private *priv , u16 offset , u16 bytes , u8 *value ) { int ret ; struct mwifiex_ds_read_eeprom rd_eeprom ; { rd_eeprom.offset = offset; rd_eeprom.byte_count = bytes; ret = mwifiex_send_cmd(priv, 89, 0, 0U, (void *)(& rd_eeprom), 1); if (ret == 0) { memcpy((void *)value, (void const *)(& rd_eeprom.value), 256UL); } else { } return (ret); } } static int mwifiex_set_gen_ie_helper(struct mwifiex_private *priv , u8 *ie_data_ptr , u16 ie_len ) { int ret ; struct ieee_types_vendor_header *pvendor_ie ; u8 wpa_oui[4U] ; u8 wps_oui[4U] ; int tmp ; int tmp___0 ; { ret = 0; wpa_oui[0] = 0U; wpa_oui[1] = 80U; wpa_oui[2] = 242U; wpa_oui[3] = 1U; wps_oui[0] = 0U; wps_oui[1] = 80U; wps_oui[2] = 242U; wps_oui[3] = 4U; if ((unsigned int )ie_len == 0U) { priv->gen_ie_buf_len = 0U; priv->wps.session_enable = 0U; return (0); } else if ((unsigned long )ie_data_ptr == (unsigned long )((u8 *)0U)) { return (-1); } else { } pvendor_ie = (struct ieee_types_vendor_header *)ie_data_ptr; if ((unsigned int )pvendor_ie->element_id == 221U) { tmp = memcmp((void const *)(& pvendor_ie->oui), (void const *)(& wpa_oui), 4UL); if (tmp == 0) { ret = mwifiex_set_wpa_ie_helper(priv, ie_data_ptr, (int )ie_len); priv->wps.session_enable = 0U; return (ret); } else { goto _L; } } else _L: /* CIL Label */ if ((unsigned int )pvendor_ie->element_id == 48U) { ret = mwifiex_set_wpa_ie_helper(priv, ie_data_ptr, (int )ie_len); priv->wps.session_enable = 0U; return (ret); } else if ((unsigned int )pvendor_ie->element_id == 68U) { ret = mwifiex_set_wapi_ie(priv, ie_data_ptr, (int )ie_len); return (ret); } else { } if ((unsigned long )ie_len < 256UL - (unsigned long )priv->gen_ie_buf_len) { pvendor_ie = (struct ieee_types_vendor_header *)ie_data_ptr; if ((unsigned int )pvendor_ie->element_id == 221U) { tmp___0 = memcmp((void const *)(& pvendor_ie->oui), (void const *)(& wps_oui), 4UL); if (tmp___0 == 0) { priv->wps.session_enable = 1U; if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: WPS Session Enabled.\n"); } else { } } else { } ret = mwifiex_set_wps_ie(priv, ie_data_ptr, (int )ie_len); } else { } } else { } memcpy((void *)(& priv->gen_ie_buf) + (unsigned long )priv->gen_ie_buf_len, (void const *)ie_data_ptr, (size_t )ie_len); priv->gen_ie_buf_len = (int )priv->gen_ie_buf_len + (int )((u8 )ie_len); } else { ret = -1; } return (ret); } } static int mwifiex_misc_ioctl_gen_ie(struct mwifiex_private *priv , struct mwifiex_ds_misc_gen_ie *gen_ie , u16 action ) { struct mwifiex_adapter *adapter ; { adapter = priv->adapter; switch (gen_ie->type) { case 0U: ; if ((unsigned int )action == 0U) { gen_ie->len = (u32 )priv->wpa_ie_len; memcpy((void *)(& gen_ie->ie_data), (void const *)(& priv->wpa_ie), (size_t )gen_ie->len); } else { mwifiex_set_gen_ie_helper(priv, (u8 *)(& gen_ie->ie_data), (int )((unsigned short )gen_ie->len)); } goto ldv_61251; case 1U: memset((void *)(& adapter->arp_filter), 0, 68UL); if (gen_ie->len > 68U) { adapter->arp_filter_size = 0U; if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "invalid ARP filter size\n"); } else { } } else { } return (-1); } else { memcpy((void *)(& adapter->arp_filter), (void const *)(& gen_ie->ie_data), (size_t )gen_ie->len); adapter->arp_filter_size = gen_ie->len; } goto ldv_61251; default: ; if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "invalid IE type\n"); } else { } } else { } return (-1); } ldv_61251: ; return (0); } } int mwifiex_set_gen_ie(struct mwifiex_private *priv , u8 const *ie , int ie_len ) { struct mwifiex_ds_misc_gen_ie gen_ie ; int tmp ; { if (ie_len > 256) { return (-14); } else { } gen_ie.type = 0U; gen_ie.len = (u32 )ie_len; memcpy((void *)(& gen_ie.ie_data), (void const *)ie, (size_t )ie_len); tmp = mwifiex_misc_ioctl_gen_ie(priv, & gen_ie, 1); if (tmp != 0) { return (-14); } else { } return (0); } } bool ldv_queue_work_on_215(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_216(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_217(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_218(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_219(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } extern long simple_strtol(char const * , char ** , unsigned int ) ; bool ldv_queue_work_on_229(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_231(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_230(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_233(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_232(struct workqueue_struct *ldv_func_arg1 ) ; extern struct device_node *of_find_node_by_name(struct device_node * , char const * ) ; extern int of_property_read_u8_array(struct device_node const * , char const * , u8 * , size_t ) ; extern unsigned char const _ctype[] ; int mwifiex_cmd_issue_chan_report_request(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd , void *data_buf ) ; static bool disable_auto_ds ; static int mwifiex_cmd_802_11_rssi_info(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd , u16 cmd_action ) { { cmd->command = 164U; cmd->size = 40U; cmd->params.rssi_info.action = cmd_action; cmd->params.rssi_info.ndata = priv->data_avg_factor; cmd->params.rssi_info.nbcn = priv->bcn_avg_factor; priv->data_rssi_last = 0; priv->data_nf_last = 0; priv->data_rssi_avg = 0; priv->data_nf_avg = 0; priv->bcn_rssi_last = 0; priv->bcn_nf_last = 0; priv->bcn_rssi_avg = 0; priv->bcn_nf_avg = 0; return (0); } } static int mwifiex_cmd_mac_control(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd , u16 cmd_action , u16 *action ) { struct host_cmd_ds_mac_control *mac_ctrl ; { mac_ctrl = & cmd->params.mac_ctrl; if ((unsigned int )cmd_action != 1U) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "mac_control: only support set cmd\n"); } else { } } else { } return (-1); } else { } cmd->command = 40U; cmd->size = 12U; mac_ctrl->action = *action; return (0); } } static int mwifiex_cmd_802_11_snmp_mib(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd , u16 cmd_action , u32 cmd_oid , u16 *ul_temp ) { struct host_cmd_ds_802_11_snmp_mib *snmp_mib ; { snmp_mib = & cmd->params.smib; if (((priv->adapter)->debug_mask & 16U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "cmd: SNMP_CMD: cmd_oid = 0x%x\n", cmd_oid); } else { } } else { } cmd->command = 22U; cmd->size = 14U; snmp_mib->oid = (unsigned short )cmd_oid; if ((unsigned int )cmd_action == 0U) { snmp_mib->query_type = 0U; snmp_mib->buf_size = 128U; le16_add_cpu(& cmd->size, 128); } else if ((unsigned int )cmd_action == 1U) { snmp_mib->query_type = 1U; snmp_mib->buf_size = 2U; *((__le16 *)(& snmp_mib->value)) = *ul_temp; le16_add_cpu(& cmd->size, 2); } else { } if (((priv->adapter)->debug_mask & 16U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "cmd: SNMP_CMD: Action=0x%x, OID=0x%x,\tOIDSize=0x%x, Value=0x%x\n", (int )cmd_action, cmd_oid, (int )snmp_mib->buf_size, (int )*((__le16 *)(& snmp_mib->value))); } else { } } else { } return (0); } } static int mwifiex_cmd_802_11_get_log(struct host_cmd_ds_command *cmd ) { { cmd->command = 11U; cmd->size = 84U; return (0); } } static int mwifiex_cmd_tx_rate_cfg(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd , u16 cmd_action , u16 *pbitmap_rates ) { struct host_cmd_ds_tx_rate_cfg *rate_cfg ; struct mwifiex_rate_scope *rate_scope ; struct mwifiex_rate_drop_pattern *rate_drop ; u32 i ; { rate_cfg = & cmd->params.tx_rate_cfg; cmd->command = 214U; rate_cfg->action = cmd_action; rate_cfg->cfg_index = 0U; rate_scope = (struct mwifiex_rate_scope *)rate_cfg + 4U; rate_scope->type = 339U; rate_scope->length = 36U; if ((unsigned long )pbitmap_rates != (unsigned long )((u16 *)0U)) { rate_scope->hr_dsss_rate_bitmap = *pbitmap_rates; rate_scope->ofdm_rate_bitmap = *(pbitmap_rates + 1UL); i = 0U; goto ldv_61000; ldv_60999: rate_scope->ht_mcs_rate_bitmap[i] = *(pbitmap_rates + (unsigned long )(i + 2U)); i = i + 1U; ldv_61000: ; if (i <= 7U) { goto ldv_60999; } else { } if ((unsigned int )(priv->adapter)->fw_api_ver == 15U) { i = 0U; goto ldv_61005; ldv_61004: rate_scope->vht_mcs_rate_bitmap[i] = *(pbitmap_rates + (unsigned long )(i + 10U)); i = i + 1U; ldv_61005: ; if (i <= 7U) { goto ldv_61004; } else { } } else { } } else { rate_scope->hr_dsss_rate_bitmap = priv->bitmap_rates[0]; rate_scope->ofdm_rate_bitmap = priv->bitmap_rates[1]; i = 0U; goto ldv_61008; ldv_61007: rate_scope->ht_mcs_rate_bitmap[i] = priv->bitmap_rates[i + 2U]; i = i + 1U; ldv_61008: ; if (i <= 7U) { goto ldv_61007; } else { } if ((unsigned int )(priv->adapter)->fw_api_ver == 15U) { i = 0U; goto ldv_61013; ldv_61012: rate_scope->vht_mcs_rate_bitmap[i] = priv->bitmap_rates[i + 10U]; i = i + 1U; ldv_61013: ; if (i <= 7U) { goto ldv_61012; } else { } } else { } } rate_drop = (struct mwifiex_rate_drop_pattern *)rate_scope + 40U; rate_drop->type = 338U; rate_drop->length = 4U; rate_drop->rate_drop_mode = 0U; cmd->size = 60U; return (0); } } static int mwifiex_cmd_tx_power_cfg(struct host_cmd_ds_command *cmd , u16 cmd_action , struct host_cmd_ds_txpwr_cfg *txp ) { struct mwifiex_types_power_group *pg_tlv ; struct host_cmd_ds_txpwr_cfg *cmd_txp_cfg ; { cmd_txp_cfg = & cmd->params.txp_cfg; cmd->command = 209U; cmd->size = 16U; switch ((int )cmd_action) { case 1: ; if (txp->mode != 0U) { pg_tlv = (struct mwifiex_types_power_group *)((unsigned long )txp + 8UL); __memmove((void *)cmd_txp_cfg, (void const *)txp, (unsigned long )pg_tlv->length + 12UL); pg_tlv = (struct mwifiex_types_power_group *)cmd_txp_cfg + 8U; cmd->size = (unsigned int )((int )cmd->size + (int )pg_tlv->length) + 4U; } else { __memmove((void *)cmd_txp_cfg, (void const *)txp, 8UL); } cmd_txp_cfg->action = cmd_action; goto ldv_61023; case 0: cmd_txp_cfg->action = cmd_action; goto ldv_61023; } ldv_61023: ; return (0); } } static int mwifiex_cmd_rf_tx_power(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd , u16 cmd_action , void *data_buf ) { struct host_cmd_ds_rf_tx_pwr *txp ; { txp = & cmd->params.txp; cmd->size = 14U; cmd->command = 30U; txp->action = cmd_action; return (0); } } static int mwifiex_cmd_rf_antenna(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd , u16 cmd_action , struct mwifiex_ds_ant_cfg *ant_cfg ) { struct host_cmd_ds_rf_ant_mimo *ant_mimo ; struct host_cmd_ds_rf_ant_siso *ant_siso ; { ant_mimo = & cmd->params.ant_mimo; ant_siso = & cmd->params.ant_siso; cmd->command = 32U; if ((unsigned int )cmd_action != 1U) { return (0); } else { } if ((unsigned int )(priv->adapter)->hw_dev_mcs_support == 34U) { cmd->size = 16U; ant_mimo->action_tx = 2U; ant_mimo->tx_ant_mode = (unsigned short )ant_cfg->tx_ant; ant_mimo->action_rx = 1U; ant_mimo->rx_ant_mode = (unsigned short )ant_cfg->rx_ant; } else { cmd->size = 12U; ant_siso->action = 3U; ant_siso->ant_mode = (unsigned short )ant_cfg->tx_ant; } return (0); } } static int mwifiex_cmd_802_11_hs_cfg(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd , u16 cmd_action , struct mwifiex_hs_config_param *hscfg_param ) { struct mwifiex_adapter *adapter ; struct host_cmd_ds_802_11_hs_cfg_enh *hs_cfg ; bool hs_activate ; { adapter = priv->adapter; hs_cfg = & cmd->params.opt_hs_cfg; hs_activate = 0; if ((unsigned long )hscfg_param == (unsigned long )((struct mwifiex_hs_config_param *)0)) { hs_activate = 1; } else { } cmd->command = 229U; if ((! hs_activate && hscfg_param->conditions != 4294967295U) && (adapter->arp_filter_size != 0U && adapter->arp_filter_size <= 68U)) { if ((adapter->debug_mask & 16U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cmd: Attach %d bytes ArpFilter to HSCfg cmd\n", adapter->arp_filter_size); } else { } } else { } memcpy((void *)hs_cfg + 8U, (void const *)(& adapter->arp_filter), (size_t )adapter->arp_filter_size); cmd->size = (unsigned int )((unsigned short )adapter->arp_filter_size) + 16U; } else { cmd->size = 16U; } if ((int )hs_activate) { hs_cfg->action = 2U; hs_cfg->params.hs_activate.resp_ctrl = 1U; } else { hs_cfg->action = 1U; hs_cfg->params.hs_config.conditions = hscfg_param->conditions; hs_cfg->params.hs_config.gpio = hscfg_param->gpio; hs_cfg->params.hs_config.gap = hscfg_param->gap; if ((adapter->debug_mask & 16U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cmd: HS_CFG_CMD: condition:0x%x gpio:0x%x gap:0x%x\n", hs_cfg->params.hs_config.conditions, (int )hs_cfg->params.hs_config.gpio, (int )hs_cfg->params.hs_config.gap); } else { } } else { } } return (0); } } static int mwifiex_cmd_802_11_mac_address(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd , u16 cmd_action ) { { cmd->command = 77U; cmd->size = 16U; cmd->result = 0U; cmd->params.mac_addr.action = cmd_action; if ((unsigned int )cmd_action == 1U) { memcpy((void *)(& cmd->params.mac_addr.mac_addr), (void const *)(& priv->curr_addr), 6UL); } else { } return (0); } } static int mwifiex_cmd_mac_multicast_adr(struct host_cmd_ds_command *cmd , u16 cmd_action , struct mwifiex_multicast_list *mcast_list ) { struct host_cmd_ds_mac_multicast_adr *mcast_addr ; { mcast_addr = & cmd->params.mc_addr; cmd->size = 204U; cmd->command = 16U; mcast_addr->action = cmd_action; mcast_addr->num_of_adrs = (unsigned short )mcast_list->num_multicast_addr; memcpy((void *)(& mcast_addr->mac_list), (void const *)(& mcast_list->mac_list), (size_t )(mcast_list->num_multicast_addr * 6U)); return (0); } } static int mwifiex_cmd_802_11_deauthenticate(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd , u8 *mac ) { struct host_cmd_ds_802_11_deauthenticate *deauth ; { deauth = & cmd->params.deauth; cmd->command = 36U; cmd->size = 16U; memcpy((void *)(& deauth->mac_addr), (void const *)mac, 6UL); if (((priv->adapter)->debug_mask & 16U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "cmd: Deauth: %pM\n", (u8 *)(& deauth->mac_addr)); } else { } } else { } deauth->reason_code = 3U; return (0); } } static int mwifiex_cmd_802_11_ad_hoc_stop(struct host_cmd_ds_command *cmd ) { { cmd->command = 64U; cmd->size = 8U; return (0); } } static int mwifiex_set_keyparamset_wep(struct mwifiex_private *priv , struct mwifiex_ie_type_key_param_set *key_param_set , u16 *key_param_len ) { int cur_key_param_len ; u8 i ; { i = 0U; goto ldv_61078; ldv_61077: ; if (priv->wep_key[(int )i].key_length == 5U || priv->wep_key[(int )i].key_length == 13U) { key_param_set->type = 256U; key_param_set->length = (unsigned int )((unsigned short )priv->wep_key[(int )i].key_length) + 8U; key_param_set->key_type_id = 0U; key_param_set->key_info = 7U; key_param_set->key_len = (unsigned short )priv->wep_key[(int )i].key_length; key_param_set->key[0] = i; if ((int )i == ((int )priv->wep_key_curr_index & 16383)) { key_param_set->key[1] = 1U; } else { key_param_set->key[1] = 0U; } __memmove((void *)(& key_param_set->key) + 2U, (void const *)(& priv->wep_key[(int )i].key_material), (size_t )priv->wep_key[(int )i].key_length); cur_key_param_len = (int )(priv->wep_key[(int )i].key_length + 12U); *key_param_len = (int )*key_param_len + (int )((u16 )cur_key_param_len); key_param_set = key_param_set + (unsigned long )cur_key_param_len; } else if (priv->wep_key[(int )i].key_length == 0U) { } else { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "key%d Length = %d is incorrect\n", (int )i + 1, priv->wep_key[(int )i].key_length); } else { } } else { } return (-1); } i = (u8 )((int )i + 1); ldv_61078: ; if ((unsigned int )i <= 3U) { goto ldv_61077; } else { } return (0); } } static int mwifiex_set_aes_key_v2(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd , struct mwifiex_ds_encrypt_key *enc_key , struct host_cmd_ds_802_11_key_material_v2 *km ) { struct mwifiex_adapter *adapter ; u16 size ; u16 len ; { adapter = priv->adapter; len = 10U; if ((unsigned int )enc_key->is_igtk_key != 0U) { if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "%s: Set CMAC AES Key\n", "mwifiex_set_aes_key_v2"); } else { } } else { } if ((unsigned int )enc_key->is_rx_seq_valid != 0U) { memcpy((void *)(& km->key_param_set.key_params.cmac_aes.ipn), (void const *)(& enc_key->pn), (size_t )enc_key->pn_len); } else { } km->key_param_set.key_info = (unsigned int )km->key_param_set.key_info & 65534U; km->key_param_set.key_info = (__le16 )((unsigned int )km->key_param_set.key_info | 1024U); km->key_param_set.key_type = 4U; km->key_param_set.key_params.cmac_aes.key_len = (unsigned short )enc_key->key_len; memcpy((void *)(& km->key_param_set.key_params.cmac_aes.key), (void const *)(& enc_key->key_material), (size_t )enc_key->key_len); len = (unsigned int )len + 26U; } else { if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "%s: Set AES Key\n", "mwifiex_set_aes_key_v2"); } else { } } else { } if ((unsigned int )enc_key->is_rx_seq_valid != 0U) { memcpy((void *)(& km->key_param_set.key_params.aes.pn), (void const *)(& enc_key->pn), (size_t )enc_key->pn_len); } else { } km->key_param_set.key_type = 2U; km->key_param_set.key_params.aes.key_len = (unsigned short )enc_key->key_len; memcpy((void *)(& km->key_param_set.key_params.aes.key), (void const *)(& enc_key->key_material), (size_t )enc_key->key_len); len = (unsigned int )len + 26U; } km->key_param_set.len = len; size = (unsigned int )len + 14U; cmd->size = size; return (0); } } static int mwifiex_cmd_802_11_key_material_v2(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd , u16 cmd_action , u32 cmd_oid , struct mwifiex_ds_encrypt_key *enc_key ) { struct mwifiex_adapter *adapter ; u8 *mac ; u16 key_info ; u16 len ; struct host_cmd_ds_802_11_key_material_v2 *km ; bool tmp ; bool tmp___0 ; bool tmp___1 ; bool tmp___2 ; int tmp___3 ; int tmp___4 ; { adapter = priv->adapter; mac = (u8 *)(& enc_key->mac_addr); len = 10U; km = & cmd->params.key_material_v2; cmd->command = 94U; km->action = cmd_action; if ((unsigned int )cmd_action == 0U) { if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "%s: Get key\n", "mwifiex_cmd_802_11_key_material_v2"); } else { } } else { } km->key_param_set.key_idx = (unsigned int )((u8 )enc_key->key_index) & 15U; km->key_param_set.type = 412U; km->key_param_set.len = 10U; memcpy((void *)(& km->key_param_set.mac_addr), (void const *)mac, 6UL); if ((enc_key->key_index & 1073741824U) != 0U) { key_info = 2U; } else { key_info = 1U; } if ((unsigned int )enc_key->is_igtk_key != 0U) { key_info = (u16 )((unsigned int )key_info | 1024U); } else { } km->key_param_set.key_info = key_info; cmd->size = 24U; return (0); } else { } memset((void *)(& km->key_param_set), 0, 64UL); if (enc_key->key_disable != 0U) { if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "%s: Remove key\n", "mwifiex_cmd_802_11_key_material_v2"); } else { } } else { } km->action = 4U; km->key_param_set.type = 412U; km->key_param_set.len = 10U; km->key_param_set.key_idx = (unsigned int )((u8 )enc_key->key_index) & 15U; key_info = 3U; km->key_param_set.key_info = key_info; memcpy((void *)(& km->key_param_set.mac_addr), (void const *)mac, 6UL); cmd->size = 24U; return (0); } else { } km->action = 1U; km->key_param_set.key_idx = (unsigned int )((u8 )enc_key->key_index) & 15U; km->key_param_set.type = 412U; key_info = 4U; memcpy((void *)(& km->key_param_set.mac_addr), (void const *)mac, 6UL); if (enc_key->key_len <= 13U) { if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "%s: Set WEP Key\n", "mwifiex_cmd_802_11_key_material_v2"); } else { } } else { } len = (unsigned int )len + 15U; km->key_param_set.len = len; km->key_param_set.key_type = 0U; if ((int )priv->bss_role & 1) { key_info = (u16 )((unsigned int )key_info | 3U); } else if ((unsigned int )enc_key->is_current_wep_key != 0U) { key_info = (u16 )((unsigned int )key_info | 3U); if ((int )km->key_param_set.key_idx == ((int )priv->wep_key_curr_index & 15)) { key_info = (u16 )((unsigned int )key_info | 8U); } else { } } else if ((unsigned long )mac != (unsigned long )((u8 *)0U)) { tmp = is_broadcast_ether_addr((u8 const *)mac); if ((int )tmp) { key_info = (u16 )((unsigned int )key_info | 1U); } else { key_info = (u16 )((unsigned int )key_info | 10U); } } else { key_info = (u16 )((unsigned int )key_info | 1U); } km->key_param_set.key_info = key_info; km->key_param_set.key_params.wep.key_len = (unsigned short )enc_key->key_len; memcpy((void *)(& km->key_param_set.key_params.wep.key), (void const *)(& enc_key->key_material), (size_t )enc_key->key_len); cmd->size = (unsigned int )len + 14U; return (0); } else { } tmp___0 = is_broadcast_ether_addr((u8 const *)mac); if ((int )tmp___0) { key_info = (u16 )((unsigned int )key_info | 33U); } else { key_info = (u16 )((unsigned int )key_info | 50U); } if (enc_key->is_wapi_key != 0U) { if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "%s: Set WAPI Key\n", "mwifiex_cmd_802_11_key_material_v2"); } else { } } else { } km->key_param_set.key_type = 3U; memcpy((void *)(& km->key_param_set.key_params.wapi.pn), (void const *)(& enc_key->pn), 16UL); km->key_param_set.key_params.wapi.key_len = (unsigned short )enc_key->key_len; memcpy((void *)(& km->key_param_set.key_params.wapi.key), (void const *)(& enc_key->key_material), (size_t )enc_key->key_len); tmp___1 = is_broadcast_ether_addr((u8 const *)mac); if ((int )tmp___1) { priv->sec_info.wapi_key_on = 1U; } else { } if ((unsigned int )priv->sec_info.wapi_key_on == 0U) { key_info = (u16 )((unsigned int )key_info | 8U); } else { } km->key_param_set.key_info = key_info; len = (unsigned int )len + 50U; km->key_param_set.len = len; cmd->size = (unsigned int )len + 14U; return (0); } else { } if (priv->bss_mode == 1U) { key_info = (u16 )((unsigned int )key_info | 8U); if ((unsigned int )priv->sec_info.wpa2_enabled == 0U) { tmp___2 = is_broadcast_ether_addr((u8 const *)mac); if (tmp___2) { tmp___3 = 0; } else { tmp___3 = 1; } if (tmp___3) { key_info = (u16 )((unsigned int )key_info | 2U); } else { } } else { } } else if ((unsigned int )priv->wpa_is_gtk_set == 0U) { key_info = (u16 )((unsigned int )key_info | 8U); } else { } km->key_param_set.key_info = key_info; if (enc_key->key_len == 16U) { tmp___4 = mwifiex_set_aes_key_v2(priv, cmd, enc_key, km); return (tmp___4); } else { } if (enc_key->key_len == 32U) { if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "%s: Set TKIP Key\n", "mwifiex_cmd_802_11_key_material_v2"); } else { } } else { } if ((unsigned int )enc_key->is_rx_seq_valid != 0U) { memcpy((void *)(& km->key_param_set.key_params.tkip.pn), (void const *)(& enc_key->pn), (size_t )enc_key->pn_len); } else { } km->key_param_set.key_type = 1U; km->key_param_set.key_params.tkip.key_len = (unsigned short )enc_key->key_len; memcpy((void *)(& km->key_param_set.key_params.tkip.key), (void const *)(& enc_key->key_material), (size_t )enc_key->key_len); len = (unsigned int )len + 42U; km->key_param_set.len = len; cmd->size = (unsigned int )len + 14U; } else { } return (0); } } static int mwifiex_cmd_802_11_key_material_v1(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd , u16 cmd_action , u32 cmd_oid , struct mwifiex_ds_encrypt_key *enc_key ) { struct host_cmd_ds_802_11_key_material *key_material ; struct host_cmd_tlv_mac_addr *tlv_mac ; u16 key_param_len ; u16 cmd_size ; int ret ; bool tmp ; int tmp___0 ; struct mwifiex_cmac_param *param ; { key_material = & cmd->params.key_material; key_param_len = 0U; ret = 0; cmd->command = 94U; key_material->action = cmd_action; if ((unsigned int )cmd_action == 0U) { cmd->size = 10U; return (ret); } else { } if ((unsigned long )enc_key == (unsigned long )((struct mwifiex_ds_encrypt_key *)0)) { memset((void *)(& key_material->key_param_set), 0, 240UL); ret = mwifiex_set_keyparamset_wep(priv, & key_material->key_param_set, & key_param_len); cmd->size = (unsigned int )key_param_len + 10U; return (ret); } else { memset((void *)(& key_material->key_param_set), 0, 60UL); } if (enc_key->is_wapi_key != 0U) { if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: Set WAPI Key\n"); } else { } } else { } key_material->key_param_set.key_type_id = 3U; if (cmd_oid == 1U) { key_material->key_param_set.key_info = 4U; } else { key_material->key_param_set.key_info = 0U; } key_material->key_param_set.key[0] = (u8 )enc_key->key_index; if ((unsigned int )priv->sec_info.wapi_key_on == 0U) { key_material->key_param_set.key[1] = 1U; } else { key_material->key_param_set.key[1] = 0U; } tmp = is_broadcast_ether_addr((u8 const *)(& enc_key->mac_addr)); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { key_material->key_param_set.key_info = (__le16 )((unsigned int )key_material->key_param_set.key_info | 2U); } else { key_material->key_param_set.key_info = (__le16 )((unsigned int )key_material->key_param_set.key_info | 1U); priv->sec_info.wapi_key_on = 1U; } key_material->key_param_set.type = 256U; key_material->key_param_set.key_len = 50U; memcpy((void *)(& key_material->key_param_set.key) + 2U, (void const *)(& enc_key->key_material), (size_t )enc_key->key_len); memcpy((void *)(& key_material->key_param_set.key) + (unsigned long )(enc_key->key_len + 2U), (void const *)(& enc_key->pn), 16UL); key_material->key_param_set.length = 56U; key_param_len = 60U; cmd->size = (unsigned int )key_param_len + 10U; return (ret); } else { } if (enc_key->key_len == 16U) { if ((unsigned int )enc_key->is_igtk_key != 0U) { if (((priv->adapter)->debug_mask & 16U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "cmd: CMAC_AES\n"); } else { } } else { } key_material->key_param_set.key_type_id = 4U; if (cmd_oid == 1U) { key_material->key_param_set.key_info = 4U; } else { key_material->key_param_set.key_info = 0U; } key_material->key_param_set.key_info = (__le16 )((unsigned int )key_material->key_param_set.key_info | 1024U); } else { if (((priv->adapter)->debug_mask & 16U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "cmd: WPA_AES\n"); } else { } } else { } key_material->key_param_set.key_type_id = 2U; if (cmd_oid == 1U) { key_material->key_param_set.key_info = 4U; } else { key_material->key_param_set.key_info = 0U; } if ((enc_key->key_index & 1073741824U) != 0U) { key_material->key_param_set.key_info = (__le16 )((unsigned int )key_material->key_param_set.key_info | 2U); } else { key_material->key_param_set.key_info = (__le16 )((unsigned int )key_material->key_param_set.key_info | 1U); } } } else if (enc_key->key_len == 32U) { if (((priv->adapter)->debug_mask & 16U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "cmd: WPA_TKIP\n"); } else { } } else { } key_material->key_param_set.key_type_id = 1U; key_material->key_param_set.key_info = 4U; if ((enc_key->key_index & 1073741824U) != 0U) { key_material->key_param_set.key_info = (__le16 )((unsigned int )key_material->key_param_set.key_info | 2U); } else { key_material->key_param_set.key_info = (__le16 )((unsigned int )key_material->key_param_set.key_info | 1U); } } else { } if ((unsigned int )key_material->key_param_set.key_type_id != 0U) { key_material->key_param_set.type = 256U; key_material->key_param_set.key_len = (unsigned short )enc_key->key_len; memcpy((void *)(& key_material->key_param_set.key), (void const *)(& enc_key->key_material), (size_t )enc_key->key_len); key_material->key_param_set.length = (unsigned int )((unsigned short )enc_key->key_len) + 6U; key_param_len = (unsigned int )((u16 )enc_key->key_len) + 10U; if ((unsigned int )key_material->key_param_set.key_type_id == 4U) { param = (struct mwifiex_cmac_param *)(& key_material->key_param_set.key); memcpy((void *)(& param->ipn), (void const *)(& enc_key->pn), 8UL); memcpy((void *)(& param->key), (void const *)(& enc_key->key_material), 16UL); key_param_len = 24U; key_material->key_param_set.key_len = key_param_len; key_param_len = (unsigned int )key_param_len + 6U; key_material->key_param_set.length = key_param_len; key_param_len = (unsigned int )key_param_len + 4U; } else { } cmd->size = (unsigned int )key_param_len + 10U; if ((int )priv->bss_role & 1) { tlv_mac = (struct host_cmd_tlv_mac_addr *)(& key_material->key_param_set) + (unsigned long )key_param_len; tlv_mac->header.type = 288U; tlv_mac->header.len = 6U; memcpy((void *)(& tlv_mac->mac_addr), (void const *)(& enc_key->mac_addr), 6UL); cmd_size = (unsigned int )key_param_len + 20U; } else { cmd_size = (unsigned int )key_param_len + 10U; } cmd->size = cmd_size; } else { } return (ret); } } static int mwifiex_cmd_802_11_key_material(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd , u16 cmd_action , u32 cmd_oid , struct mwifiex_ds_encrypt_key *enc_key ) { int tmp ; int tmp___0 ; { if ((unsigned int )(priv->adapter)->key_api_major_ver == 2U) { tmp = mwifiex_cmd_802_11_key_material_v2(priv, cmd, (int )cmd_action, cmd_oid, enc_key); return (tmp); } else { tmp___0 = mwifiex_cmd_802_11_key_material_v1(priv, cmd, (int )cmd_action, cmd_oid, enc_key); return (tmp___0); } } } static int mwifiex_cmd_802_11d_domain_info(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd , u16 cmd_action ) { struct mwifiex_adapter *adapter ; struct host_cmd_ds_802_11d_domain_info *domain_info ; struct mwifiex_ietypes_domain_param_set *domain ; u8 no_of_triplet ; { adapter = priv->adapter; domain_info = & cmd->params.domain_info; domain = & domain_info->domain; no_of_triplet = adapter->domain_reg.no_of_triplet; if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: 11D: no_of_triplet=0x%x\n", (int )no_of_triplet); } else { } } else { } cmd->command = 91U; domain_info->action = cmd_action; if ((unsigned int )cmd_action == 0U) { cmd->size = 10U; return (0); } else { } domain->header.type = 7U; memcpy((void *)(& domain->country_code), (void const *)(& adapter->domain_reg.country_code), 3UL); domain->header.len = ((unsigned int )((unsigned short )no_of_triplet) + 1U) * 3U; if ((unsigned int )no_of_triplet != 0U) { memcpy((void *)(& domain->triplet), (void const *)(& adapter->domain_reg.triplet), (unsigned long )no_of_triplet * 3UL); cmd->size = (unsigned int )domain->header.len + 14U; } else { cmd->size = 10U; } return (0); } } static int mwifiex_cmd_ibss_coalescing_status(struct host_cmd_ds_command *cmd , u16 cmd_action , u16 *enable ) { struct host_cmd_ds_802_11_ibss_status *ibss_coal ; { ibss_coal = & cmd->params.ibss_coalescing; cmd->command = 131U; cmd->size = 24U; cmd->result = 0U; ibss_coal->action = cmd_action; switch ((int )cmd_action) { case 1: ; if ((unsigned long )enable != (unsigned long )((u16 *)0U)) { ibss_coal->enable = *enable; } else { ibss_coal->enable = 0U; } goto ldv_61139; case 0: ; default: ; goto ldv_61139; } ldv_61139: ; return (0); } } static int mwifiex_cmd_mem_access(struct host_cmd_ds_command *cmd , u16 cmd_action , void *pdata_buf ) { struct mwifiex_ds_mem_rw *mem_rw ; struct host_cmd_ds_mem_access *mem_access ; { mem_rw = (struct mwifiex_ds_mem_rw *)pdata_buf; mem_access = & cmd->params.mem; cmd->command = 134U; cmd->size = 20U; mem_access->action = cmd_action; mem_access->addr = mem_rw->addr; mem_access->value = mem_rw->value; return (0); } } static int mwifiex_cmd_reg_access(struct host_cmd_ds_command *cmd , u16 cmd_action , void *data_buf ) { struct mwifiex_ds_reg_rw *reg_rw ; struct host_cmd_ds_mac_reg_access *mac_reg ; struct host_cmd_ds_bbp_reg_access *bbp_reg ; struct host_cmd_ds_rf_reg_access *rf_reg ; struct host_cmd_ds_pmic_reg_access *pmic_reg ; struct host_cmd_ds_rf_reg_access *cau_reg ; struct mwifiex_ds_read_eeprom *rd_eeprom ; struct host_cmd_ds_802_11_eeprom_access *cmd_eeprom ; { reg_rw = (struct mwifiex_ds_reg_rw *)data_buf; switch ((int )cmd->command) { case 25: cmd->size = 16U; mac_reg = & cmd->params.mac_reg; mac_reg->action = cmd_action; mac_reg->offset = (unsigned short )reg_rw->offset; mac_reg->value = reg_rw->value; goto ldv_61157; case 26: cmd->size = 16U; bbp_reg = & cmd->params.bbp_reg; bbp_reg->action = cmd_action; bbp_reg->offset = (unsigned short )reg_rw->offset; bbp_reg->value = (unsigned char )reg_rw->value; goto ldv_61157; case 27: cmd->size = 16U; rf_reg = & cmd->params.rf_reg; rf_reg->action = cmd_action; rf_reg->offset = (unsigned short )reg_rw->offset; rf_reg->value = (unsigned char )reg_rw->value; goto ldv_61157; case 173: cmd->size = 16U; pmic_reg = & cmd->params.pmic_reg; pmic_reg->action = cmd_action; pmic_reg->offset = (unsigned short )reg_rw->offset; pmic_reg->value = (unsigned char )reg_rw->value; goto ldv_61157; case 237: cmd->size = 16U; cau_reg = & cmd->params.rf_reg; cau_reg->action = cmd_action; cau_reg->offset = (unsigned short )reg_rw->offset; cau_reg->value = (unsigned char )reg_rw->value; goto ldv_61157; case 89: rd_eeprom = (struct mwifiex_ds_read_eeprom *)data_buf; cmd_eeprom = & cmd->params.eeprom; cmd->size = 15U; cmd_eeprom->action = cmd_action; cmd_eeprom->offset = rd_eeprom->offset; cmd_eeprom->byte_count = rd_eeprom->byte_count; cmd_eeprom->value = 0U; goto ldv_61157; default: ; return (-1); } ldv_61157: ; return (0); } } static int mwifiex_cmd_pcie_host_spec(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd , u16 action ) { struct host_cmd_ds_pcie_details *host_spec ; struct pcie_service_card *card ; { host_spec = & cmd->params.pcie_host_spec; card = (struct pcie_service_card *)(priv->adapter)->card; cmd->command = 250U; cmd->size = 52U; cmd->result = 0U; memset((void *)host_spec, 0, 44UL); if ((unsigned int )action != 1U) { return (0); } else { } host_spec->txbd_addr_lo = (unsigned int )card->txbd_ring_pbase; host_spec->txbd_addr_hi = (unsigned int )(card->txbd_ring_pbase >> 32); host_spec->txbd_count = 32U; host_spec->rxbd_addr_lo = (unsigned int )card->rxbd_ring_pbase; host_spec->rxbd_addr_hi = (unsigned int )(card->rxbd_ring_pbase >> 32); host_spec->rxbd_count = 32U; host_spec->evtbd_addr_lo = (unsigned int )card->evtbd_ring_pbase; host_spec->evtbd_addr_hi = (unsigned int )(card->evtbd_ring_pbase >> 32); host_spec->evtbd_count = 8U; if ((unsigned long )card->sleep_cookie_vbase != (unsigned long )((u8 *)0U)) { host_spec->sleep_cookie_addr_lo = (unsigned int )card->sleep_cookie_pbase; host_spec->sleep_cookie_addr_hi = (unsigned int )(card->sleep_cookie_pbase >> 32); if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "sleep_cook_lo phy addr: 0x%x\n", host_spec->sleep_cookie_addr_lo); } else { } } else { } } else { } return (0); } } static int mwifiex_cmd_802_11_subsc_evt(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd , struct mwifiex_ds_misc_subsc_evt *subsc_evt_cfg ) { struct host_cmd_ds_802_11_subsc_evt *subsc_evt ; struct mwifiex_ie_types_rssi_threshold *rssi_tlv ; u16 event_bitmap ; u8 *pos ; { subsc_evt = & cmd->params.subsc_evt; cmd->command = 117U; cmd->size = 12U; subsc_evt->action = subsc_evt_cfg->action; if (((priv->adapter)->debug_mask & 16U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "cmd: action: %d\n", (int )subsc_evt_cfg->action); } else { } } else { } if ((unsigned int )subsc_evt_cfg->action == 0U) { return (0); } else { } subsc_evt->events = subsc_evt_cfg->events; event_bitmap = subsc_evt_cfg->events; if (((priv->adapter)->debug_mask & 16U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "cmd: event bitmap : %16x\n", (int )event_bitmap); } else { } } else { } if (((unsigned int )subsc_evt_cfg->action == 3U || (unsigned int )subsc_evt_cfg->action == 2U) && (unsigned int )event_bitmap == 0U) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Error: No event specified\tfor bitwise action type\n"); } else { } } else { } return (-22); } else { } if ((unsigned int )subsc_evt_cfg->action == 3U) { return (0); } else { } pos = (u8 *)subsc_evt + 4UL; if ((int )event_bitmap & 1) { rssi_tlv = (struct mwifiex_ie_types_rssi_threshold *)pos; rssi_tlv->header.type = 260U; rssi_tlv->header.len = 2U; rssi_tlv->abs_value = subsc_evt_cfg->bcn_l_rssi_cfg.abs_value; rssi_tlv->evt_freq = subsc_evt_cfg->bcn_l_rssi_cfg.evt_freq; if (((priv->adapter)->debug_mask & 32U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Cfg Beacon Low Rssi event,\tRSSI:-%d dBm, Freq:%d\n", (int )subsc_evt_cfg->bcn_l_rssi_cfg.abs_value, (int )subsc_evt_cfg->bcn_l_rssi_cfg.evt_freq); } else { } } else { } pos = pos + 6UL; le16_add_cpu(& cmd->size, 6); } else { } if (((unsigned long )event_bitmap & 16UL) != 0UL) { rssi_tlv = (struct mwifiex_ie_types_rssi_threshold *)pos; rssi_tlv->header.type = 278U; rssi_tlv->header.len = 2U; rssi_tlv->abs_value = subsc_evt_cfg->bcn_h_rssi_cfg.abs_value; rssi_tlv->evt_freq = subsc_evt_cfg->bcn_h_rssi_cfg.evt_freq; if (((priv->adapter)->debug_mask & 32U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Cfg Beacon High Rssi event,\tRSSI:-%d dBm, Freq:%d\n", (int )subsc_evt_cfg->bcn_h_rssi_cfg.abs_value, (int )subsc_evt_cfg->bcn_h_rssi_cfg.evt_freq); } else { } } else { } pos = pos + 6UL; le16_add_cpu(& cmd->size, 6); } else { } return (0); } } static int mwifiex_cmd_append_rpn_expression(struct mwifiex_private *priv , struct mwifiex_mef_entry *mef_entry , u8 **buffer ) { struct mwifiex_mef_filter *filter ; int i ; int byte_len ; u8 *stack_ptr ; { filter = (struct mwifiex_mef_filter *)(& mef_entry->filter); stack_ptr = *buffer; i = 0; goto ldv_61197; ldv_61196: filter = (struct mwifiex_mef_filter *)(& mef_entry->filter) + (unsigned long )i; if ((unsigned int )filter->filt_type == 0U) { goto ldv_61195; } else { } *((__le32 *)stack_ptr) = (unsigned int )filter->repeat; stack_ptr = stack_ptr + 4UL; *stack_ptr = 1U; stack_ptr = stack_ptr + 1UL; byte_len = (int )filter->byte_seq[6]; memcpy((void *)stack_ptr, (void const *)(& filter->byte_seq), (size_t )byte_len); stack_ptr = stack_ptr + (unsigned long )byte_len; *stack_ptr = (u8 )byte_len; stack_ptr = stack_ptr + 1UL; *stack_ptr = 2U; stack_ptr = stack_ptr + 1UL; *((__le32 *)stack_ptr) = (unsigned int )filter->offset; stack_ptr = stack_ptr + 4UL; *stack_ptr = 1U; stack_ptr = stack_ptr + 1UL; *stack_ptr = filter->filt_type; stack_ptr = stack_ptr + 1UL; if ((unsigned int )filter->filt_action != 0U) { *stack_ptr = filter->filt_action; stack_ptr = stack_ptr + 1UL; } else { } if ((long )stack_ptr - (long )*buffer > 100L) { return (-1); } else { } i = i + 1; ldv_61197: ; if (i <= 9) { goto ldv_61196; } else { } ldv_61195: *buffer = stack_ptr; return (0); } } static int mwifiex_cmd_mef_cfg(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd , struct mwifiex_ds_mef_cfg *mef ) { struct host_cmd_ds_mef_cfg *mef_cfg ; struct mwifiex_fw_mef_entry *mef_entry ; u8 *pos ; u16 i ; int tmp ; { mef_cfg = & cmd->params.mef_cfg; mef_entry = (struct mwifiex_fw_mef_entry *)0; pos = (u8 *)mef_cfg; cmd->command = 154U; mef_cfg->criteria = mef->criteria; mef_cfg->num_entries = mef->num_entries; pos = pos + 6UL; i = 0U; goto ldv_61208; ldv_61207: mef_entry = (struct mwifiex_fw_mef_entry *)pos; mef_entry->mode = (mef->mef_entry + (unsigned long )i)->mode; mef_entry->action = (mef->mef_entry + (unsigned long )i)->action; pos = pos + 4UL; tmp = mwifiex_cmd_append_rpn_expression(priv, mef->mef_entry + (unsigned long )i, & pos); if (tmp != 0) { return (-1); } else { } mef_entry->exprsize = (int )((unsigned short )((long )pos)) - (int )((unsigned short )((long )(& mef_entry->expr))); i = (u16 )((int )i + 1); ldv_61208: ; if ((int )mef->num_entries > (int )i) { goto ldv_61207; } else { } cmd->size = (unsigned int )((int )((unsigned short )((long )pos)) - (int )((unsigned short )((long )mef_cfg))) + 8U; return (0); } } static u32 mwifiex_parse_cal_cfg(u8 *src , size_t len , u8 *dst ) { u8 *s ; u8 *d ; u8 *tmp ; long tmp___0 ; { s = src; d = dst; goto ldv_61217; ldv_61218: ; if ((unsigned int )*s != 0U && (((int )_ctype[(int )*s] & 32) != 0 || (unsigned int )*s == 9U)) { s = s + 1; goto ldv_61217; } else { } if (((int )_ctype[(int )*s] & 68) != 0) { tmp = d; d = d + 1; tmp___0 = simple_strtol((char const *)s, (char **)0, 16U); *tmp = (u8 )tmp___0; s = s + 2UL; } else { s = s + 1; } ldv_61217: ; if ((unsigned long )((long )s - (long )src) < len) { goto ldv_61218; } else { } return ((u32 )((long )d) - (u32 )((long )dst)); } } int mwifiex_dnld_dt_cfgdata(struct mwifiex_private *priv , struct device_node *node , char const *prefix ) { struct property *prop ; size_t len ; size_t tmp ; int ret ; size_t tmp___0 ; int tmp___1 ; { tmp = strlen(prefix); len = tmp; prop = node->properties; goto ldv_61230; ldv_61229: tmp___0 = strlen((char const *)prop->name); if (tmp___0 < len) { goto ldv_61228; } else { tmp___1 = strncmp((char const *)prop->name, prefix, len); if (tmp___1 != 0) { goto ldv_61228; } else { } } if ((((unsigned long )prop != (unsigned long )((struct property *)0) && (unsigned long )prop->value != (unsigned long )((void *)0)) && prop->length > 6) && (unsigned int )prop->length <= 2040U) { ret = mwifiex_send_cmd(priv, 143, 1, 0U, (void *)prop, 1); if (ret != 0) { return (ret); } else { } } else { } ldv_61228: prop = prop->next; ldv_61230: ; if ((unsigned long )prop != (unsigned long )((struct property *)0)) { goto ldv_61229; } else { } return (0); } } static int mwifiex_cmd_cfg_data(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd , void *data_buf ) { struct mwifiex_adapter *adapter ; struct property *prop ; u32 len ; u8 *data ; int ret ; { adapter = priv->adapter; prop = (struct property *)data_buf; data = (u8 *)cmd + 8UL; if ((unsigned long )prop != (unsigned long )((struct property *)0)) { len = (u32 )prop->length; ret = of_property_read_u8_array((struct device_node const *)adapter->dt_node, (char const *)prop->name, data, (size_t )len); if (ret != 0) { return (ret); } else { } if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "download cfg_data from device tree: %s\n", prop->name); } else { } } else { } } else if ((unsigned long )(adapter->cal_data)->data != (unsigned long )((u8 const */* const */)0U) && (unsigned long )(adapter->cal_data)->size != 0UL) { len = mwifiex_parse_cal_cfg((u8 *)(adapter->cal_data)->data, (adapter->cal_data)->size, data); if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "download cfg_data from config file\n"); } else { } } else { } } else { return (-1); } cmd->command = 143U; cmd->size = (unsigned int )((unsigned short )len) + 8U; return (0); } } static int mwifiex_cmd_coalesce_cfg(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd , u16 cmd_action , void *data_buf ) { struct host_cmd_ds_coalesce_cfg *coalesce_cfg ; struct mwifiex_ds_coalesce_cfg *cfg ; struct coalesce_filt_field_param *param ; u16 cnt ; u16 idx ; u16 length ; struct coalesce_receive_filt_rule *rule ; { coalesce_cfg = & cmd->params.coalesce_cfg; cfg = (struct mwifiex_ds_coalesce_cfg *)data_buf; cmd->command = 266U; cmd->size = 8U; coalesce_cfg->action = cmd_action; coalesce_cfg->num_of_rules = cfg->num_of_rules; rule = (struct coalesce_receive_filt_rule *)(& coalesce_cfg->rule); cnt = 0U; goto ldv_61259; ldv_61258: rule->header.type = 410U; rule->max_coalescing_delay = cfg->rule[(int )cnt].max_coalescing_delay; rule->pkt_type = cfg->rule[(int )cnt].pkt_type; rule->num_of_fields = cfg->rule[(int )cnt].num_of_fields; length = 0U; param = (struct coalesce_filt_field_param *)(& rule->params); idx = 0U; goto ldv_61256; ldv_61255: param->operation = cfg->rule[(int )cnt].params[(int )idx].operation; param->operand_len = cfg->rule[(int )cnt].params[(int )idx].operand_len; param->offset = cfg->rule[(int )cnt].params[(int )idx].offset; memcpy((void *)(& param->operand_byte_stream), (void const *)(& cfg->rule[(int )cnt].params[(int )idx].operand_byte_stream), (size_t )param->operand_len); length = (unsigned int )length + 8U; param = param + 1; idx = (u16 )((int )idx + 1); ldv_61256: ; if ((int )((unsigned short )cfg->rule[(int )cnt].num_of_fields) > (int )idx) { goto ldv_61255; } else { } rule->header.len = (unsigned int )length + 4U; le16_add_cpu(& cmd->size, (int )((unsigned int )rule->header.len + 4U)); rule = (struct coalesce_receive_filt_rule *)(& rule->params) + (unsigned long )length; cnt = (u16 )((int )cnt + 1); ldv_61259: ; if ((int )cfg->num_of_rules > (int )cnt) { goto ldv_61258; } else { } le16_add_cpu(& cmd->size, 4); return (0); } } static int mwifiex_cmd_tdls_oper(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd , void *data_buf ) { struct host_cmd_ds_tdls_oper *tdls_oper ; struct mwifiex_ds_tdls_oper *oper ; struct mwifiex_sta_node *sta_ptr ; struct host_cmd_tlv_rates *tlv_rates ; struct mwifiex_ie_types_htcap *ht_capab ; struct mwifiex_ie_types_qos_info *wmm_qos_info ; struct mwifiex_ie_types_extcap *extcap ; struct mwifiex_ie_types_vhtcap *vht_capab ; struct mwifiex_ie_types_aid *aid ; struct mwifiex_ie_types_tdls_idle_timeout *timeout ; u8 *pos ; u8 qos_info ; u16 config_len ; struct station_parameters *params ; { tdls_oper = & cmd->params.tdls_oper; oper = (struct mwifiex_ds_tdls_oper *)data_buf; config_len = 0U; params = priv->sta_params; cmd->command = 290U; cmd->size = 8U; le16_add_cpu(& cmd->size, 10); tdls_oper->reason = 0U; memcpy((void *)(& tdls_oper->peer_mac), (void const *)(& oper->peer_mac), 6UL); sta_ptr = mwifiex_get_sta_entry(priv, (u8 const *)(& oper->peer_mac)); pos = (u8 *)tdls_oper + 10UL; switch ((int )oper->tdls_action) { case 0: tdls_oper->tdls_action = 0U; goto ldv_61281; case 2: tdls_oper->tdls_action = 1U; goto ldv_61281; case 3: tdls_oper->tdls_action = 2U; if ((unsigned long )params == (unsigned long )((struct station_parameters *)0)) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "TDLS config params not available for %pM\n", (u8 *)(& oper->peer_mac)); } else { } } else { } return (-61); } else { } *((__le16 *)pos) = params->capability; config_len = (unsigned int )config_len + 2U; qos_info = (u8 )((int )((signed char )params->uapsd_queues) | (int )((signed char )((int )params->max_sp << 5))); wmm_qos_info = (struct mwifiex_ie_types_qos_info *)pos + (unsigned long )config_len; wmm_qos_info->header.type = 46U; wmm_qos_info->header.len = 1U; wmm_qos_info->qos_info = qos_info; config_len = (unsigned int )config_len + 5U; if ((unsigned long )params->ht_capa != (unsigned long )((struct ieee80211_ht_cap const *)0)) { ht_capab = (struct mwifiex_ie_types_htcap *)pos + (unsigned long )config_len; ht_capab->header.type = 45U; ht_capab->header.len = 26U; memcpy((void *)(& ht_capab->ht_cap), (void const *)params->ht_capa, 26UL); config_len = (unsigned int )config_len + 30U; } else { } if ((unsigned long )params->supported_rates != (unsigned long )((u8 const *)0U) && (unsigned int )params->supported_rates_len != 0U) { tlv_rates = (struct host_cmd_tlv_rates *)pos + (unsigned long )config_len; tlv_rates->header.type = 1U; tlv_rates->header.len = (unsigned short )params->supported_rates_len; memcpy((void *)(& tlv_rates->rates), (void const *)params->supported_rates, (size_t )params->supported_rates_len); config_len = (unsigned int )((int )((u16 )params->supported_rates_len) + (int )config_len) + 4U; } else { } if ((unsigned long )params->ext_capab != (unsigned long )((u8 const *)0U) && (unsigned int )params->ext_capab_len != 0U) { extcap = (struct mwifiex_ie_types_extcap *)pos + (unsigned long )config_len; extcap->header.type = 127U; extcap->header.len = (unsigned short )params->ext_capab_len; memcpy((void *)(& extcap->ext_capab), (void const *)params->ext_capab, (size_t )params->ext_capab_len); config_len = (unsigned int )((int )((u16 )params->ext_capab_len) + (int )config_len) + 4U; } else { } if ((unsigned long )params->vht_capa != (unsigned long )((struct ieee80211_vht_cap const *)0)) { vht_capab = (struct mwifiex_ie_types_vhtcap *)pos + (unsigned long )config_len; vht_capab->header.type = 191U; vht_capab->header.len = 12U; memcpy((void *)(& vht_capab->vht_cap), (void const *)params->vht_capa, 12UL); config_len = (unsigned int )config_len + 16U; } else { } if ((unsigned int )params->aid != 0U) { aid = (struct mwifiex_ie_types_aid *)pos + (unsigned long )config_len; aid->header.type = 197U; aid->header.len = 2U; aid->aid = params->aid; config_len = (unsigned int )config_len + 6U; } else { } timeout = (struct mwifiex_ie_types_tdls_idle_timeout *)pos + (unsigned long )config_len; timeout->header.type = 450U; timeout->header.len = 2U; timeout->value = 60U; config_len = (unsigned int )config_len + 6U; goto ldv_61281; default: ; if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Unknown TDLS operation\n"); } else { } } else { } return (-524); } ldv_61281: le16_add_cpu(& cmd->size, (int )config_len); return (0); } } static int mwifiex_cmd_sdio_rx_aggr_cfg(struct host_cmd_ds_command *cmd , u16 cmd_action , void *data_buf ) { struct host_cmd_sdio_sp_rx_aggr_cfg *cfg ; { cfg = & cmd->params.sdio_rx_aggr_cfg; cmd->command = 547U; cmd->size = 12U; cfg->action = (u8 )cmd_action; if ((unsigned int )cmd_action == 1U) { cfg->enable = *((u8 *)data_buf); } else { } return (0); } } int mwifiex_sta_prepare_cmd(struct mwifiex_private *priv , uint16_t cmd_no , u16 cmd_action , u32 cmd_oid , void *data_buf , void *cmd_buf ) { struct host_cmd_ds_command *cmd_ptr ; int ret ; { cmd_ptr = (struct host_cmd_ds_command *)cmd_buf; ret = 0; switch ((int )cmd_no) { case 3: ret = mwifiex_cmd_get_hw_spec(priv, cmd_ptr); goto ldv_61302; case 143: ret = mwifiex_cmd_cfg_data(priv, cmd_ptr, data_buf); goto ldv_61302; case 40: ret = mwifiex_cmd_mac_control(priv, cmd_ptr, (int )cmd_action, (u16 *)data_buf); goto ldv_61302; case 77: ret = mwifiex_cmd_802_11_mac_address(priv, cmd_ptr, (int )cmd_action); goto ldv_61302; case 16: ret = mwifiex_cmd_mac_multicast_adr(cmd_ptr, (int )cmd_action, (struct mwifiex_multicast_list *)data_buf); goto ldv_61302; case 214: ret = mwifiex_cmd_tx_rate_cfg(priv, cmd_ptr, (int )cmd_action, (u16 *)data_buf); goto ldv_61302; case 209: ret = mwifiex_cmd_tx_power_cfg(cmd_ptr, (int )cmd_action, (struct host_cmd_ds_txpwr_cfg *)data_buf); goto ldv_61302; case 30: ret = mwifiex_cmd_rf_tx_power(priv, cmd_ptr, (int )cmd_action, data_buf); goto ldv_61302; case 32: ret = mwifiex_cmd_rf_antenna(priv, cmd_ptr, (int )cmd_action, (struct mwifiex_ds_ant_cfg *)data_buf); goto ldv_61302; case 228: ret = mwifiex_cmd_enh_power_mode(priv, cmd_ptr, (int )cmd_action, (int )((unsigned short )cmd_oid), (struct mwifiex_ds_auto_ds *)data_buf); goto ldv_61302; case 229: ret = mwifiex_cmd_802_11_hs_cfg(priv, cmd_ptr, (int )cmd_action, (struct mwifiex_hs_config_param *)data_buf); goto ldv_61302; case 6: ret = mwifiex_cmd_802_11_scan(cmd_ptr, (struct mwifiex_scan_cmd_config *)data_buf); goto ldv_61302; case 108: ret = mwifiex_cmd_802_11_bg_scan_query(cmd_ptr); goto ldv_61302; case 18: ret = mwifiex_cmd_802_11_associate(priv, cmd_ptr, (struct mwifiex_bssdescriptor *)data_buf); goto ldv_61302; case 36: ret = mwifiex_cmd_802_11_deauthenticate(priv, cmd_ptr, (u8 *)data_buf); goto ldv_61302; case 43: ret = mwifiex_cmd_802_11_ad_hoc_start(priv, cmd_ptr, (struct cfg80211_ssid *)data_buf); goto ldv_61302; case 11: ret = mwifiex_cmd_802_11_get_log(cmd_ptr); goto ldv_61302; case 44: ret = mwifiex_cmd_802_11_ad_hoc_join(priv, cmd_ptr, (struct mwifiex_bssdescriptor *)data_buf); goto ldv_61302; case 64: ret = mwifiex_cmd_802_11_ad_hoc_stop(cmd_ptr); goto ldv_61302; case 164: ret = mwifiex_cmd_802_11_rssi_info(priv, cmd_ptr, (int )cmd_action); goto ldv_61302; case 22: ret = mwifiex_cmd_802_11_snmp_mib(priv, cmd_ptr, (int )cmd_action, cmd_oid, (u16 *)data_buf); goto ldv_61302; case 127: cmd_ptr->command = 127U; cmd_ptr->size = 10U; priv->tx_rate = 0U; ret = 0; goto ldv_61302; case 151: cmd_ptr->command = cmd_no; cmd_ptr->params.verext.version_str_sel = (unsigned char )*((u32 *)data_buf); memcpy((void *)(& cmd_ptr->params), (void const *)data_buf, 129UL); cmd_ptr->size = 137U; ret = 0; goto ldv_61302; case 268: cmd_ptr->command = cmd_no; cmd_ptr->params.reg_mask.action = cmd_action; cmd_ptr->params.reg_mask.mask = *((u32 *)data_buf); cmd_ptr->size = 14U; ret = 0; goto ldv_61302; case 269: cmd_ptr->command = cmd_no; memcpy((void *)(& cmd_ptr->params), (void const *)data_buf, 10UL); cmd_ptr->size = 18U; goto ldv_61302; case 274: ret = mwifiex_cmd_11ac_cfg(priv, cmd_ptr, (int )cmd_action, (struct mwifiex_11ac_vht_cfg *)data_buf); goto ldv_61302; case 235: cmd_ptr->command = cmd_no; cmd_ptr->params.mode_cfg.action = cmd_action; cmd_ptr->params.mode_cfg.mode = *((u16 *)data_buf); cmd_ptr->size = 12U; goto ldv_61302; case 169: ; if ((unsigned int )(priv->adapter)->hw_status == 3U) { (priv->adapter)->hw_status = 0; } else { } cmd_ptr->command = cmd_no; cmd_ptr->size = 8U; goto ldv_61302; case 170: (priv->adapter)->hw_status = 3; cmd_ptr->command = cmd_no; cmd_ptr->size = 8U; goto ldv_61302; case 206: ret = mwifiex_cmd_11n_addba_req(cmd_ptr, data_buf); goto ldv_61302; case 208: ret = mwifiex_cmd_11n_delba(cmd_ptr, data_buf); goto ldv_61302; case 207: ret = mwifiex_cmd_11n_addba_rsp_gen(priv, cmd_ptr, (struct host_cmd_ds_11n_addba_req *)data_buf); goto ldv_61302; case 94: ret = mwifiex_cmd_802_11_key_material(priv, cmd_ptr, (int )cmd_action, cmd_oid, (struct mwifiex_ds_encrypt_key *)data_buf); goto ldv_61302; case 91: ret = mwifiex_cmd_802_11d_domain_info(priv, cmd_ptr, (int )cmd_action); goto ldv_61302; case 217: ret = mwifiex_cmd_recfg_tx_buf(priv, cmd_ptr, (int )cmd_action, (u16 *)data_buf); goto ldv_61302; case 223: ret = mwifiex_cmd_amsdu_aggr_ctrl(cmd_ptr, (int )cmd_action, (struct mwifiex_ds_11n_amsdu_aggr_ctrl *)data_buf); goto ldv_61302; case 205: ret = mwifiex_cmd_11n_cfg(priv, cmd_ptr, (int )cmd_action, (struct mwifiex_ds_11n_tx_cfg *)data_buf); goto ldv_61302; case 113: ; if (((priv->adapter)->debug_mask & 16U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "cmd: WMM: WMM_GET_STATUS cmd sent\n"); } else { } } else { } cmd_ptr->command = 113U; cmd_ptr->size = 100U; ret = 0; goto ldv_61302; case 131: ret = mwifiex_cmd_ibss_coalescing_status(cmd_ptr, (int )cmd_action, (u16 *)data_buf); goto ldv_61302; case 263: ret = mwifiex_cmd_802_11_scan_ext(priv, cmd_ptr, data_buf); goto ldv_61302; case 134: ret = mwifiex_cmd_mem_access(cmd_ptr, (int )cmd_action, data_buf); goto ldv_61302; case 25: ; case 26: ; case 27: ; case 173: ; case 237: ; case 89: ret = mwifiex_cmd_reg_access(cmd_ptr, (int )cmd_action, data_buf); goto ldv_61302; case 247: cmd_ptr->command = cmd_no; if (priv->bss_mode == 1U) { cmd_ptr->params.bss_mode.con_type = 1U; } else if (priv->bss_mode == 2U) { cmd_ptr->params.bss_mode.con_type = 0U; } else if (priv->bss_mode == 3U) { cmd_ptr->params.bss_mode.con_type = 2U; } else { } cmd_ptr->size = 9U; ret = 0; goto ldv_61302; case 250: ret = mwifiex_cmd_pcie_host_spec(priv, cmd_ptr, (int )cmd_action); goto ldv_61302; case 117: ret = mwifiex_cmd_802_11_subsc_evt(priv, cmd_ptr, (struct mwifiex_ds_misc_subsc_evt *)data_buf); goto ldv_61302; case 154: ret = mwifiex_cmd_mef_cfg(priv, cmd_ptr, (struct mwifiex_ds_mef_cfg *)data_buf); goto ldv_61302; case 266: ret = mwifiex_cmd_coalesce_cfg(priv, cmd_ptr, (int )cmd_action, data_buf); goto ldv_61302; case 290: ret = mwifiex_cmd_tdls_oper(priv, cmd_ptr, data_buf); goto ldv_61302; case 221: ret = mwifiex_cmd_issue_chan_report_request(priv, cmd_ptr, data_buf); goto ldv_61302; case 547: ret = mwifiex_cmd_sdio_rx_aggr_cfg(cmd_ptr, (int )cmd_action, data_buf); goto ldv_61302; default: ; if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "PREP_CMD: unknown cmd- %#x\n", (int )cmd_no); } else { } } else { } ret = -1; goto ldv_61302; } ldv_61302: ; return (ret); } } int mwifiex_sta_init_cmd(struct mwifiex_private *priv , u8 first_sta , bool init ) { struct mwifiex_adapter *adapter ; int ret ; u16 enable ; struct mwifiex_ds_11n_amsdu_aggr_ctrl amsdu_aggr_ctrl ; struct mwifiex_ds_auto_ds auto_ds ; enum state_11d_t state_11d ; struct mwifiex_ds_11n_tx_cfg tx_cfg ; u8 sdio_sp_rx_aggr_enable ; { adapter = priv->adapter; enable = 1U; if ((unsigned int )first_sta != 0U) { if ((unsigned int )(priv->adapter)->iface_type == 1U) { ret = mwifiex_send_cmd(priv, 250, 1, 0U, (void *)0, 1); if (ret != 0) { return (-1); } else { } } else { } ret = mwifiex_send_cmd(priv, 169, 1, 0U, (void *)0, 1); if (ret != 0) { return (-1); } else { } adapter->dt_node = of_find_node_by_name((struct device_node *)0, "marvell_cfgdata"); if ((unsigned long )adapter->dt_node != (unsigned long )((struct device_node *)0)) { ret = mwifiex_dnld_dt_cfgdata(priv, adapter->dt_node, "marvell,caldata"); if (ret != 0) { return (-1); } else { } } else { } if ((unsigned long )adapter->cal_data != (unsigned long )((struct firmware const *)0)) { ret = mwifiex_send_cmd(priv, 143, 1, 0U, (void *)0, 1); if (ret != 0) { return (-1); } else { } } else { } ret = mwifiex_send_cmd(priv, 3, 0, 0U, (void *)0, 1); if (ret != 0) { return (-1); } else { } if ((unsigned int )(priv->adapter)->iface_type == 0U && ((unsigned long )(priv->adapter)->fw_cap_info & 65536UL) != 0UL) { sdio_sp_rx_aggr_enable = 1U; ret = mwifiex_send_cmd(priv, 547, 1, 0U, (void *)(& sdio_sp_rx_aggr_enable), 1); if (ret != 0) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "error while enabling SP aggregation..disable it"); } else { } } else { } adapter->sdio_rx_aggr_enable = 0; } else { } } else { } ret = mwifiex_send_cmd(priv, 217, 1, 0U, (void *)(& (priv->adapter)->tx_buf_size), 1); if (ret != 0) { return (-1); } else { } if ((unsigned int )priv->bss_type != 1U) { (priv->adapter)->ps_mode = 1U; ret = mwifiex_send_cmd(priv, 228, 255, 16U, (void *)0, 1); if (ret != 0) { return (-1); } else { } } else { } } else { } ret = mwifiex_send_cmd(priv, 214, 0, 0U, (void *)0, 1); if (ret != 0) { return (-1); } else { } priv->data_rate = 0U; ret = mwifiex_send_cmd(priv, 30, 0, 0U, (void *)0, 1); if (ret != 0) { return (-1); } else { } if ((unsigned int )priv->bss_type == 0U) { ret = mwifiex_send_cmd(priv, 131, 1, 0U, (void *)(& enable), 1); if (ret != 0) { return (-1); } else { } } else { } memset((void *)(& amsdu_aggr_ctrl), 0, 4UL); amsdu_aggr_ctrl.enable = 1U; ret = mwifiex_send_cmd(priv, 223, 1, 0U, (void *)(& amsdu_aggr_ctrl), 1); if (ret != 0) { return (-1); } else { } ret = mwifiex_send_cmd(priv, 40, 1, 0U, (void *)(& priv->curr_pkt_filter), 1); if (ret != 0) { return (-1); } else { } if (((! disable_auto_ds && (unsigned int )first_sta != 0U) && (unsigned int )(priv->adapter)->iface_type != 2U) && (unsigned int )priv->bss_type != 1U) { auto_ds.auto_ds = 1U; auto_ds.idle_time = 100U; ret = mwifiex_send_cmd(priv, 228, 255, 1U, (void *)(& auto_ds), 1); if (ret != 0) { return (-1); } else { } } else { } if ((unsigned int )priv->bss_type != 1U) { state_11d = 1; ret = mwifiex_send_cmd(priv, 22, 1, 9U, (void *)(& state_11d), 1); if (ret != 0) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "11D: failed to enable 11D\n"); } else { } } else { } } else { } } else { } tx_cfg.tx_htcap = 114U; ret = mwifiex_send_cmd(priv, 205, 1, 0U, (void *)(& tx_cfg), 1); if ((int )init) { (priv->adapter)->last_init_cmd = 205U; ret = -115; } else { } return (ret); } } bool ldv_queue_work_on_229(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_230(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_231(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_232(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_233(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_243(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_245(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_244(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_247(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_246(struct workqueue_struct *ldv_func_arg1 ) ; extern u8 const *cfg80211_find_vendor_ie(unsigned int , u8 , u8 const * , int ) ; int mwifiex_set_secure_params(struct mwifiex_private *priv , struct mwifiex_uap_bss_param *bss_config , struct cfg80211_ap_settings *params ) ; void mwifiex_set_ht_params(struct mwifiex_private *priv , struct mwifiex_uap_bss_param *bss_cfg , struct cfg80211_ap_settings *params ) ; void mwifiex_set_vht_params(struct mwifiex_private *priv , struct mwifiex_uap_bss_param *bss_cfg , struct cfg80211_ap_settings *params ) ; void mwifiex_set_tpc_params(struct mwifiex_private *priv , struct mwifiex_uap_bss_param *bss_cfg , struct cfg80211_ap_settings *params ) ; void mwifiex_set_uap_rates(struct mwifiex_uap_bss_param *bss_cfg , struct cfg80211_ap_settings *params ) ; void mwifiex_set_vht_width(struct mwifiex_private *priv , enum nl80211_chan_width width , bool ap_11ac_enable ) ; void mwifiex_set_wmm_params(struct mwifiex_private *priv , struct mwifiex_uap_bss_param *bss_cfg , struct cfg80211_ap_settings *params ) ; void mwifiex_set_sys_config_invalid_data(struct mwifiex_uap_bss_param *config ) ; int mwifiex_del_mgmt_ies(struct mwifiex_private *priv ) ; void mwifiex_uap_set_channel(struct mwifiex_private *priv , struct mwifiex_uap_bss_param *bss_cfg , struct cfg80211_chan_def chandef ) ; int mwifiex_config_start_uap(struct mwifiex_private *priv , struct mwifiex_uap_bss_param *bss_cfg ) ; int mwifiex_set_secure_params(struct mwifiex_private *priv , struct mwifiex_uap_bss_param *bss_config , struct cfg80211_ap_settings *params ) { int i ; struct mwifiex_wep_key wep_key ; { if (! params->privacy) { bss_config->protocol = 1U; bss_config->key_mgmt = 4U; bss_config->wpa_cfg.length = 0U; priv->sec_info.wep_enabled = 0U; priv->sec_info.wpa_enabled = 0U; priv->sec_info.wpa2_enabled = 0U; return (0); } else { } switch ((unsigned int )params->auth_type) { case 0U: bss_config->auth_mode = 0U; goto ldv_60692; case 1U: bss_config->auth_mode = 1U; goto ldv_60692; case 3U: bss_config->auth_mode = 128U; goto ldv_60692; default: bss_config->auth_mode = 255U; goto ldv_60692; } ldv_60692: bss_config->key_mgmt_operation = (u16 )((unsigned int )bss_config->key_mgmt_operation | 3U); i = 0; goto ldv_60701; ldv_60700: ; switch (params->crypto.akm_suites[i]) { case 1027073U: ; if ((int )params->crypto.wpa_versions & 1) { bss_config->protocol = 8U; bss_config->key_mgmt = 1U; } else { } if ((params->crypto.wpa_versions & 2U) != 0U) { bss_config->protocol = (u16 )((unsigned int )bss_config->protocol | 32U); bss_config->key_mgmt = 1U; } else { } goto ldv_60697; case 1027074U: ; if ((int )params->crypto.wpa_versions & 1) { bss_config->protocol = 8U; bss_config->key_mgmt = 2U; } else { } if ((params->crypto.wpa_versions & 2U) != 0U) { bss_config->protocol = (u16 )((unsigned int )bss_config->protocol | 32U); bss_config->key_mgmt = 2U; } else { } goto ldv_60697; default: ; goto ldv_60697; } ldv_60697: i = i + 1; ldv_60701: ; if (params->crypto.n_akm_suites > i) { goto ldv_60700; } else { } i = 0; goto ldv_60710; ldv_60709: ; switch (params->crypto.ciphers_pairwise[i]) { case 1027073U: ; case 1027077U: ; goto ldv_60705; case 1027074U: ; if ((int )params->crypto.wpa_versions & 1) { bss_config->wpa_cfg.pairwise_cipher_wpa = (u8 )((unsigned int )bss_config->wpa_cfg.pairwise_cipher_wpa | 4U); } else { } if ((params->crypto.wpa_versions & 2U) != 0U) { bss_config->wpa_cfg.pairwise_cipher_wpa2 = (u8 )((unsigned int )bss_config->wpa_cfg.pairwise_cipher_wpa2 | 4U); } else { } goto ldv_60705; case 1027076U: ; if ((int )params->crypto.wpa_versions & 1) { bss_config->wpa_cfg.pairwise_cipher_wpa = (u8 )((unsigned int )bss_config->wpa_cfg.pairwise_cipher_wpa | 8U); } else { } if ((params->crypto.wpa_versions & 2U) != 0U) { bss_config->wpa_cfg.pairwise_cipher_wpa2 = (u8 )((unsigned int )bss_config->wpa_cfg.pairwise_cipher_wpa2 | 8U); } else { } default: ; goto ldv_60705; } ldv_60705: i = i + 1; ldv_60710: ; if (params->crypto.n_ciphers_pairwise > i) { goto ldv_60709; } else { } switch (params->crypto.cipher_group) { case 1027073U: ; case 1027077U: ; if ((unsigned int )priv->sec_info.wep_enabled != 0U) { bss_config->protocol = 2U; bss_config->key_mgmt = 4U; bss_config->wpa_cfg.length = 0U; i = 0; goto ldv_60715; ldv_60714: wep_key = priv->wep_key[i]; bss_config->wep_cfg[i].key_index = (u8 )i; if ((int )priv->wep_key_curr_index == i) { bss_config->wep_cfg[i].is_default = 1U; } else { bss_config->wep_cfg[i].is_default = 0U; } bss_config->wep_cfg[i].length = (u16 )wep_key.key_length; memcpy((void *)(& bss_config->wep_cfg[i].key), (void const *)(& wep_key.key_material), (size_t )wep_key.key_length); i = i + 1; ldv_60715: ; if (i <= 3) { goto ldv_60714; } else { } } else { } goto ldv_60717; case 1027074U: bss_config->wpa_cfg.group_cipher = 4U; goto ldv_60717; case 1027076U: bss_config->wpa_cfg.group_cipher = 8U; goto ldv_60717; default: ; goto ldv_60717; } ldv_60717: ; return (0); } } void mwifiex_set_ht_params(struct mwifiex_private *priv , struct mwifiex_uap_bss_param *bss_cfg , struct cfg80211_ap_settings *params ) { u8 const *ht_ie ; u16 cap_info ; { if (((unsigned long )(priv->adapter)->fw_cap_info & 2048UL) == 0UL) { return; } else { } ht_ie = cfg80211_find_ie(45, params->beacon.tail, (int )params->beacon.tail_len); if ((unsigned long )ht_ie != (unsigned long )((u8 const *)0U)) { memcpy((void *)(& bss_cfg->ht_cap), (void const *)ht_ie + 2U, 26UL); cap_info = bss_cfg->ht_cap.cap_info; memset((void *)(& bss_cfg->ht_cap.mcs), 0, (size_t )(priv->adapter)->number_of_antenna); switch ((int )cap_info & 768) { case 256: bss_cfg->ht_cap.mcs.rx_mask[0] = 255U; goto ldv_60729; case 512: ; case 768: bss_cfg->ht_cap.mcs.rx_mask[0] = 255U; bss_cfg->ht_cap.mcs.rx_mask[1] = 255U; goto ldv_60729; default: ; if (((priv->adapter)->debug_mask & 536870912U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Unsupported RX-STBC, default to 2x2\n"); } else { } } else { } bss_cfg->ht_cap.mcs.rx_mask[0] = 255U; bss_cfg->ht_cap.mcs.rx_mask[1] = 255U; goto ldv_60729; } ldv_60729: priv->ap_11n_enabled = 1U; } else { memset((void *)(& bss_cfg->ht_cap), 0, 26UL); bss_cfg->ht_cap.cap_info = 4364U; bss_cfg->ht_cap.ampdu_params_info = 3U; } return; } } void mwifiex_set_vht_params(struct mwifiex_private *priv , struct mwifiex_uap_bss_param *bss_cfg , struct cfg80211_ap_settings *params ) { u8 const *vht_ie ; { vht_ie = cfg80211_find_ie(191, params->beacon.tail, (int )params->beacon.tail_len); if ((unsigned long )vht_ie != (unsigned long )((u8 const *)0U)) { memcpy((void *)(& bss_cfg->vht_cap), (void const *)vht_ie + 2U, 12UL); priv->ap_11ac_enabled = 1U; } else { priv->ap_11ac_enabled = 0U; } return; } } void mwifiex_set_tpc_params(struct mwifiex_private *priv , struct mwifiex_uap_bss_param *bss_cfg , struct cfg80211_ap_settings *params ) { u8 const *tpc_ie ; { tpc_ie = cfg80211_find_ie(34, params->beacon.tail, (int )params->beacon.tail_len); if ((unsigned long )tpc_ie != (unsigned long )((u8 const *)0U)) { bss_cfg->power_constraint = *(tpc_ie + 2UL); } else { bss_cfg->power_constraint = 0U; } return; } } void mwifiex_set_vht_width(struct mwifiex_private *priv , enum nl80211_chan_width width , bool ap_11ac_enable ) { struct mwifiex_adapter *adapter ; struct mwifiex_11ac_vht_cfg vht_cfg ; { adapter = priv->adapter; vht_cfg.band_config = 2U; vht_cfg.cap_info = adapter->hw_dot_11ac_dev_cap; if (! ap_11ac_enable) { vht_cfg.mcs_tx_set = 65535U; vht_cfg.mcs_rx_set = 65535U; } else { vht_cfg.mcs_tx_set = 65530U; vht_cfg.mcs_rx_set = 65530U; } vht_cfg.misc_config = 3U; if ((int )ap_11ac_enable && (unsigned int )width > 2U) { vht_cfg.misc_config = (u8 )((unsigned int )vht_cfg.misc_config | 4U); } else { } mwifiex_send_cmd(priv, 274, 1, 0U, (void *)(& vht_cfg), 1); return; } } void mwifiex_set_uap_rates(struct mwifiex_uap_bss_param *bss_cfg , struct cfg80211_ap_settings *params ) { struct ieee_types_header *rate_ie ; int var_offset ; u8 const *var_pos ; int len ; u8 rate_len ; u8 const *tmp ; u8 const *tmp___0 ; { var_offset = 36; var_pos = params->beacon.head + (unsigned long )var_offset; len = (int )((unsigned int )params->beacon.head_len - (unsigned int )var_offset); rate_len = 0U; tmp = cfg80211_find_ie(1, var_pos, len); rate_ie = (struct ieee_types_header *)tmp; if ((unsigned long )rate_ie != (unsigned long )((struct ieee_types_header *)0)) { memcpy((void *)(& bss_cfg->rates), (void const *)rate_ie + 1U, (size_t )rate_ie->len); rate_len = rate_ie->len; } else { } tmp___0 = cfg80211_find_ie(50, params->beacon.tail, (int )params->beacon.tail_len); rate_ie = (struct ieee_types_header *)tmp___0; if ((unsigned long )rate_ie != (unsigned long )((struct ieee_types_header *)0)) { memcpy((void *)(& bss_cfg->rates) + (unsigned long )rate_len, (void const *)rate_ie + 1U, (size_t )rate_ie->len); } else { } return; } } void mwifiex_set_sys_config_invalid_data(struct mwifiex_uap_bss_param *config ) { { config->bcast_ssid_ctl = 127U; config->radio_ctl = 127U; config->dtim_period = 127U; config->beacon_period = 32767U; config->auth_mode = 127U; config->rts_threshold = 32767U; config->frag_threshold = 32767U; config->retry_limit = 127U; config->qos_info = 255U; return; } } static void mwifiex_uap_bss_wpa(u8 **tlv_buf , void *cmd_buf , u16 *param_size ) { struct host_cmd_tlv_pwk_cipher *pwk_cipher ; struct host_cmd_tlv_gwk_cipher *gwk_cipher ; struct host_cmd_tlv_passphrase *passphrase ; struct host_cmd_tlv_akmp *tlv_akmp ; struct mwifiex_uap_bss_param *bss_cfg ; u16 cmd_size ; u8 *tlv ; { bss_cfg = (struct mwifiex_uap_bss_param *)cmd_buf; cmd_size = *param_size; tlv = *tlv_buf; tlv_akmp = (struct host_cmd_tlv_akmp *)tlv; tlv_akmp->header.type = 321U; tlv_akmp->header.len = 4U; tlv_akmp->key_mgmt_operation = bss_cfg->key_mgmt_operation; tlv_akmp->key_mgmt = bss_cfg->key_mgmt; cmd_size = (unsigned int )cmd_size + 8U; tlv = tlv + 8UL; if (((int )bss_cfg->wpa_cfg.pairwise_cipher_wpa & 12) != 0) { pwk_cipher = (struct host_cmd_tlv_pwk_cipher *)tlv; pwk_cipher->header.type = 401U; pwk_cipher->header.len = 4U; pwk_cipher->proto = 8U; pwk_cipher->cipher = bss_cfg->wpa_cfg.pairwise_cipher_wpa; cmd_size = (unsigned int )cmd_size + 8U; tlv = tlv + 8UL; } else { } if (((int )bss_cfg->wpa_cfg.pairwise_cipher_wpa2 & 12) != 0) { pwk_cipher = (struct host_cmd_tlv_pwk_cipher *)tlv; pwk_cipher->header.type = 401U; pwk_cipher->header.len = 4U; pwk_cipher->proto = 32U; pwk_cipher->cipher = bss_cfg->wpa_cfg.pairwise_cipher_wpa2; cmd_size = (unsigned int )cmd_size + 8U; tlv = tlv + 8UL; } else { } if (((int )bss_cfg->wpa_cfg.group_cipher & 12) != 0) { gwk_cipher = (struct host_cmd_tlv_gwk_cipher *)tlv; gwk_cipher->header.type = 402U; gwk_cipher->header.len = 2U; gwk_cipher->cipher = bss_cfg->wpa_cfg.group_cipher; cmd_size = (unsigned int )cmd_size + 6U; tlv = tlv + 6UL; } else { } if (bss_cfg->wpa_cfg.length != 0U) { passphrase = (struct host_cmd_tlv_passphrase *)tlv; passphrase->header.type = 316U; passphrase->header.len = (unsigned short )bss_cfg->wpa_cfg.length; memcpy((void *)(& passphrase->passphrase), (void const *)(& bss_cfg->wpa_cfg.passphrase), (size_t )bss_cfg->wpa_cfg.length); cmd_size = (unsigned int )((int )((u16 )bss_cfg->wpa_cfg.length) + (int )cmd_size) + 4U; tlv = tlv + ((unsigned long )bss_cfg->wpa_cfg.length + 4UL); } else { } *param_size = cmd_size; *tlv_buf = tlv; return; } } void mwifiex_set_wmm_params(struct mwifiex_private *priv , struct mwifiex_uap_bss_param *bss_cfg , struct cfg80211_ap_settings *params ) { u8 const *vendor_ie ; struct ieee_types_header *wmm_ie ; u8 wmm_oui[4U] ; { wmm_oui[0] = 0U; wmm_oui[1] = 80U; wmm_oui[2] = 242U; wmm_oui[3] = 2U; vendor_ie = cfg80211_find_vendor_ie(20722U, 2, params->beacon.tail, (int )params->beacon.tail_len); if ((unsigned long )vendor_ie != (unsigned long )((u8 const *)0U)) { wmm_ie = (struct ieee_types_header *)vendor_ie; memcpy((void *)(& bss_cfg->wmm_info), (void const *)wmm_ie + 1U, 24UL); priv->wmm_enabled = 1U; } else { memset((void *)(& bss_cfg->wmm_info), 0, 24UL); memcpy((void *)(& bss_cfg->wmm_info.oui), (void const *)(& wmm_oui), 4UL); bss_cfg->wmm_info.subtype = 1U; bss_cfg->wmm_info.version = 1U; priv->wmm_enabled = 0U; } bss_cfg->qos_info = 0U; return; } } static void mwifiex_uap_bss_wep(u8 **tlv_buf , void *cmd_buf , u16 *param_size ) { struct host_cmd_tlv_wep_key *wep_key ; u16 cmd_size ; int i ; u8 *tlv ; struct mwifiex_uap_bss_param *bss_cfg ; { cmd_size = *param_size; tlv = *tlv_buf; bss_cfg = (struct mwifiex_uap_bss_param *)cmd_buf; i = 0; goto ldv_60795; ldv_60794: ; if ((unsigned int )bss_cfg->wep_cfg[i].length != 0U && ((unsigned int )bss_cfg->wep_cfg[i].length == 5U || (unsigned int )bss_cfg->wep_cfg[i].length == 13U)) { wep_key = (struct host_cmd_tlv_wep_key *)tlv; wep_key->header.type = 315U; wep_key->header.len = (unsigned int )bss_cfg->wep_cfg[i].length + 2U; wep_key->key_index = bss_cfg->wep_cfg[i].key_index; wep_key->is_default = bss_cfg->wep_cfg[i].is_default; memcpy((void *)(& wep_key->key), (void const *)(& bss_cfg->wep_cfg[i].key), (size_t )bss_cfg->wep_cfg[i].length); cmd_size = (unsigned int )((int )bss_cfg->wep_cfg[i].length + (int )cmd_size) + 6U; tlv = tlv + ((unsigned long )bss_cfg->wep_cfg[i].length + 6UL); } else { } i = i + 1; ldv_60795: ; if (i <= 3) { goto ldv_60794; } else { } *param_size = cmd_size; *tlv_buf = tlv; return; } } static int mwifiex_uap_bss_param_prepare(u8 *tlv , void *cmd_buf , u16 *param_size ) { struct host_cmd_tlv_dtim_period *dtim_period ; struct host_cmd_tlv_beacon_period *beacon_period ; struct host_cmd_tlv_ssid *ssid ; struct host_cmd_tlv_bcast_ssid *bcast_ssid ; struct host_cmd_tlv_channel_band *chan_band ; struct host_cmd_tlv_frag_threshold *frag_threshold ; struct host_cmd_tlv_rts_threshold *rts_threshold ; struct host_cmd_tlv_retry_limit *retry_limit ; struct host_cmd_tlv_encrypt_protocol *encrypt_protocol ; struct host_cmd_tlv_auth_type *auth_type ; struct host_cmd_tlv_rates *tlv_rates ; struct host_cmd_tlv_ageout_timer *ao_timer ; struct host_cmd_tlv_ageout_timer *ps_ao_timer ; struct host_cmd_tlv_power_constraint *pwr_ct ; struct mwifiex_ie_types_htcap *htcap ; struct mwifiex_ie_types_wmmcap *wmm_cap ; struct mwifiex_uap_bss_param *bss_cfg ; int i ; u16 cmd_size ; { bss_cfg = (struct mwifiex_uap_bss_param *)cmd_buf; cmd_size = *param_size; if (bss_cfg->ssid.ssid_len != 0U) { ssid = (struct host_cmd_tlv_ssid *)tlv; ssid->header.type = 0U; ssid->header.len = (unsigned short )bss_cfg->ssid.ssid_len; memcpy((void *)(& ssid->ssid), (void const *)(& bss_cfg->ssid.ssid), (size_t )bss_cfg->ssid.ssid_len); cmd_size = (unsigned int )((int )((u16 )bss_cfg->ssid.ssid_len) + (int )cmd_size) + 4U; tlv = tlv + ((unsigned long )bss_cfg->ssid.ssid_len + 4UL); bcast_ssid = (struct host_cmd_tlv_bcast_ssid *)tlv; bcast_ssid->header.type = 304U; bcast_ssid->header.len = 1U; bcast_ssid->bcast_ctl = bss_cfg->bcast_ssid_ctl; cmd_size = (unsigned int )cmd_size + 5U; tlv = tlv + 5UL; } else { } if ((unsigned int )bss_cfg->rates[0] != 0U) { tlv_rates = (struct host_cmd_tlv_rates *)tlv; tlv_rates->header.type = 1U; i = 0; goto ldv_60822; ldv_60821: tlv_rates->rates[i] = bss_cfg->rates[i]; i = i + 1; ldv_60822: ; if (i <= 13 && (unsigned int )bss_cfg->rates[i] != 0U) { goto ldv_60821; } else { } tlv_rates->header.len = (unsigned short )i; cmd_size = (unsigned int )((int )((u16 )i) + (int )cmd_size) + 4U; tlv = tlv + ((unsigned long )i + 4UL); } else { } if ((unsigned int )bss_cfg->channel != 0U && (((unsigned int )bss_cfg->band_cfg == 0U && (unsigned int )bss_cfg->channel <= 14U) || ((unsigned int )bss_cfg->band_cfg == 1U && (unsigned int )bss_cfg->channel <= 165U))) { chan_band = (struct host_cmd_tlv_channel_band *)tlv; chan_band->header.type = 298U; chan_band->header.len = 2U; chan_band->band_config = bss_cfg->band_cfg; chan_band->channel = bss_cfg->channel; cmd_size = (unsigned int )cmd_size + 6U; tlv = tlv + 6UL; } else { } if ((unsigned int )bss_cfg->beacon_period > 49U && (unsigned int )bss_cfg->beacon_period <= 4000U) { beacon_period = (struct host_cmd_tlv_beacon_period *)tlv; beacon_period->header.type = 300U; beacon_period->header.len = 2U; beacon_period->period = bss_cfg->beacon_period; cmd_size = (unsigned int )cmd_size + 6U; tlv = tlv + 6UL; } else { } if ((unsigned int )bss_cfg->dtim_period != 0U && (unsigned int )bss_cfg->dtim_period <= 100U) { dtim_period = (struct host_cmd_tlv_dtim_period *)tlv; dtim_period->header.type = 301U; dtim_period->header.len = 1U; dtim_period->period = bss_cfg->dtim_period; cmd_size = (unsigned int )cmd_size + 5U; tlv = tlv + 5UL; } else { } if ((unsigned int )bss_cfg->rts_threshold <= 2347U) { rts_threshold = (struct host_cmd_tlv_rts_threshold *)tlv; rts_threshold->header.type = 307U; rts_threshold->header.len = 2U; rts_threshold->rts_thr = bss_cfg->rts_threshold; cmd_size = (unsigned int )cmd_size + 6U; tlv = tlv + 6UL; } else { } if ((unsigned int )bss_cfg->frag_threshold > 255U && (unsigned int )bss_cfg->frag_threshold <= 2346U) { frag_threshold = (struct host_cmd_tlv_frag_threshold *)tlv; frag_threshold->header.type = 326U; frag_threshold->header.len = 2U; frag_threshold->frag_thr = bss_cfg->frag_threshold; cmd_size = (unsigned int )cmd_size + 6U; tlv = tlv + 6UL; } else { } if ((unsigned int )bss_cfg->retry_limit <= 14U) { retry_limit = (struct host_cmd_tlv_retry_limit *)tlv; retry_limit->header.type = 349U; retry_limit->header.len = 1U; retry_limit->limit = bss_cfg->retry_limit; cmd_size = (unsigned int )cmd_size + 5U; tlv = tlv + 5UL; } else { } if ((((int )bss_cfg->protocol & 8) != 0 || ((int )bss_cfg->protocol & 32) != 0) || ((int )bss_cfg->protocol & 64) != 0) { mwifiex_uap_bss_wpa(& tlv, cmd_buf, & cmd_size); } else { mwifiex_uap_bss_wep(& tlv, cmd_buf, & cmd_size); } if ((unsigned int )bss_cfg->auth_mode <= 1U || (unsigned int )bss_cfg->auth_mode == 255U) { auth_type = (struct host_cmd_tlv_auth_type *)tlv; auth_type->header.type = 287U; auth_type->header.len = 1U; auth_type->auth_type = (unsigned char )bss_cfg->auth_mode; cmd_size = (unsigned int )cmd_size + 5U; tlv = tlv + 5UL; } else { } if ((unsigned int )bss_cfg->protocol != 0U) { encrypt_protocol = (struct host_cmd_tlv_encrypt_protocol *)tlv; encrypt_protocol->header.type = 320U; encrypt_protocol->header.len = 2U; encrypt_protocol->proto = bss_cfg->protocol; cmd_size = (unsigned int )cmd_size + 6U; tlv = tlv + 6UL; } else { } if ((unsigned int )bss_cfg->ht_cap.cap_info != 0U) { htcap = (struct mwifiex_ie_types_htcap *)tlv; htcap->header.type = 45U; htcap->header.len = 26U; htcap->ht_cap.cap_info = bss_cfg->ht_cap.cap_info; htcap->ht_cap.ampdu_params_info = bss_cfg->ht_cap.ampdu_params_info; memcpy((void *)(& htcap->ht_cap.mcs), (void const *)(& bss_cfg->ht_cap.mcs), 16UL); htcap->ht_cap.extended_ht_cap_info = bss_cfg->ht_cap.extended_ht_cap_info; htcap->ht_cap.tx_BF_cap_info = bss_cfg->ht_cap.tx_BF_cap_info; htcap->ht_cap.antenna_selection_info = bss_cfg->ht_cap.antenna_selection_info; cmd_size = (unsigned int )cmd_size + 30U; tlv = tlv + 30UL; } else { } if ((unsigned int )bss_cfg->wmm_info.qos_info != 255U) { wmm_cap = (struct mwifiex_ie_types_wmmcap *)tlv; wmm_cap->header.type = 221U; wmm_cap->header.len = 24U; memcpy((void *)(& wmm_cap->wmm_info), (void const *)(& bss_cfg->wmm_info), 24UL); cmd_size = (unsigned int )cmd_size + 28U; tlv = tlv + 28UL; } else { } if (bss_cfg->sta_ao_timer != 0U) { ao_timer = (struct host_cmd_tlv_ageout_timer *)tlv; ao_timer->header.type = 313U; ao_timer->header.len = 4U; ao_timer->sta_ao_timer = bss_cfg->sta_ao_timer; cmd_size = (unsigned int )cmd_size + 8U; tlv = tlv + 8UL; } else { } if ((unsigned int )bss_cfg->power_constraint != 0U) { pwr_ct = (struct host_cmd_tlv_power_constraint *)tlv; pwr_ct->header.type = 32U; pwr_ct->header.len = 1U; pwr_ct->constraint = bss_cfg->power_constraint; cmd_size = (unsigned int )cmd_size + 5U; tlv = tlv + 5UL; } else { } if (bss_cfg->ps_sta_ao_timer != 0U) { ps_ao_timer = (struct host_cmd_tlv_ageout_timer *)tlv; ps_ao_timer->header.type = 379U; ps_ao_timer->header.len = 4U; ps_ao_timer->sta_ao_timer = bss_cfg->ps_sta_ao_timer; cmd_size = (unsigned int )cmd_size + 8U; tlv = tlv + 8UL; } else { } *param_size = cmd_size; return (0); } } static int mwifiex_uap_custom_ie_prepare(u8 *tlv , void *cmd_buf , u16 *ie_size ) { struct mwifiex_ie_list *ap_ie ; struct mwifiex_ie_types_header *tlv_ie ; { ap_ie = (struct mwifiex_ie_list *)cmd_buf; tlv_ie = (struct mwifiex_ie_types_header *)tlv; if (((unsigned long )ap_ie == (unsigned long )((struct mwifiex_ie_list *)0) || (unsigned int )ap_ie->len == 0U) || (unsigned long )(& ap_ie->ie_list) == (unsigned long )((struct mwifiex_ie (*)[16])0)) { return (-1); } else { } *ie_size = (unsigned int )((int )*ie_size + (int )ap_ie->len) + 4U; tlv_ie->type = 361U; tlv_ie->len = ap_ie->len; tlv = tlv + 4UL; memcpy((void *)tlv, (void const *)(& ap_ie->ie_list), (size_t )ap_ie->len); return (0); } } static int mwifiex_cmd_uap_sys_config(struct host_cmd_ds_command *cmd , u16 cmd_action , u32 type , void *cmd_buf ) { u8 *tlv ; u16 cmd_size ; u16 param_size ; u16 ie_size ; struct host_cmd_ds_sys_config *sys_cfg ; int tmp ; int tmp___0 ; { cmd->command = 176U; cmd_size = 10U; sys_cfg = & cmd->params.uap_sys_config; sys_cfg->action = cmd_action; tlv = (u8 *)(& sys_cfg->tlv); switch (type) { case 0U: param_size = cmd_size; tmp = mwifiex_uap_bss_param_prepare(tlv, cmd_buf, & param_size); if (tmp != 0) { return (-1); } else { } cmd->size = param_size; goto ldv_60843; case 1U: ie_size = cmd_size; tmp___0 = mwifiex_uap_custom_ie_prepare(tlv, cmd_buf, & ie_size); if (tmp___0 != 0) { return (-1); } else { } cmd->size = ie_size; goto ldv_60843; default: ; return (-1); } ldv_60843: ; return (0); } } static int mwifiex_cmd_uap_sta_deauth(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd , u8 *mac ) { struct host_cmd_ds_sta_deauth *sta_deauth ; { sta_deauth = & cmd->params.sta_deauth; cmd->command = 181U; memcpy((void *)(& sta_deauth->mac), (void const *)mac, 6UL); sta_deauth->reason = 3U; cmd->size = 16U; return (0); } } int mwifiex_uap_prepare_cmd(struct mwifiex_private *priv , unsigned short cmd_no , u16 cmd_action , u32 type , void *data_buf , void *cmd_buf ) { struct host_cmd_ds_command *cmd ; int tmp ; int tmp___0 ; int tmp___1 ; { cmd = (struct host_cmd_ds_command *)cmd_buf; switch ((int )cmd_no) { case 176: tmp = mwifiex_cmd_uap_sys_config(cmd, (int )cmd_action, type, data_buf); if (tmp != 0) { return (-1); } else { } goto ldv_60862; case 177: ; case 178: ; case 175: ; case 179: cmd->command = cmd_no; cmd->size = 8U; goto ldv_60862; case 181: tmp___0 = mwifiex_cmd_uap_sta_deauth(priv, cmd, (u8 *)data_buf); if (tmp___0 != 0) { return (-1); } else { } goto ldv_60862; case 221: tmp___1 = mwifiex_cmd_issue_chan_report_request(priv, (struct host_cmd_ds_command *)cmd_buf, data_buf); if (tmp___1 != 0) { return (-1); } else { } goto ldv_60862; default: ; if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "PREP_CMD: unknown cmd %#x\n", (int )cmd_no); } else { } } else { } return (-1); } ldv_60862: ; return (0); } } void mwifiex_uap_set_channel(struct mwifiex_private *priv , struct mwifiex_uap_bss_param *bss_cfg , struct cfg80211_chan_def chandef ) { u8 config_bands ; int tmp ; { config_bands = 0U; priv->bss_chandef = chandef; tmp = ieee80211_frequency_to_channel((int )(chandef.chan)->center_freq); bss_cfg->channel = (u8 )tmp; if ((unsigned int )(chandef.chan)->band == 0U) { bss_cfg->band_cfg = 0U; config_bands = 3U; if ((unsigned int )chandef.width != 0U) { config_bands = (u8 )((unsigned int )config_bands | 8U); } else { } } else { bss_cfg->band_cfg = 1U; config_bands = 4U; if ((unsigned int )chandef.width != 0U) { config_bands = (u8 )((unsigned int )config_bands | 16U); } else { } if ((unsigned int )chandef.width > 2U) { config_bands = (u8 )((unsigned int )config_bands | 32U); } else { } } (priv->adapter)->config_bands = config_bands; return; } } int mwifiex_config_start_uap(struct mwifiex_private *priv , struct mwifiex_uap_bss_param *bss_cfg ) { enum state_11d_t state_11d ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; { tmp = mwifiex_del_mgmt_ies(priv); if (tmp != 0) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Failed to delete mgmt IEs!\n"); } else { } } else { } } else { } tmp___0 = mwifiex_send_cmd(priv, 178, 1, 0U, (void *)0, 1); if (tmp___0 != 0) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Failed to stop the BSS\n"); } else { } } else { } return (-1); } else { } tmp___1 = mwifiex_send_cmd(priv, 175, 1, 0U, (void *)0, 1); if (tmp___1 != 0) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Failed to reset BSS\n"); } else { } } else { } return (-1); } else { } tmp___2 = mwifiex_send_cmd(priv, 176, 1, 0U, (void *)bss_cfg, 0); if (tmp___2 != 0) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Failed to set the SSID\n"); } else { } } else { } return (-1); } else { } state_11d = 1; tmp___3 = mwifiex_send_cmd(priv, 22, 1, 9U, (void *)(& state_11d), 1); if (tmp___3 != 0) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "11D: failed to enable 11D\n"); } else { } } else { } return (-1); } else { } tmp___4 = mwifiex_send_cmd(priv, 177, 1, 0U, (void *)0, 0); if (tmp___4 != 0) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Failed to start the BSS\n"); } else { } } else { } return (-1); } else { } if ((unsigned int )priv->sec_info.wep_enabled != 0U) { priv->curr_pkt_filter = (u16 )((unsigned int )priv->curr_pkt_filter | 8U); } else { priv->curr_pkt_filter = (unsigned int )priv->curr_pkt_filter & 65527U; } tmp___5 = mwifiex_send_cmd(priv, 40, 1, 0U, (void *)(& priv->curr_pkt_filter), 1); if (tmp___5 != 0) { return (-1); } else { } return (0); } } bool ldv_queue_work_on_243(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_244(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_245(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_246(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_247(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_257(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_259(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_258(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_261(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_260(struct workqueue_struct *ldv_func_arg1 ) ; int mwifiex_set_mgmt_ies(struct mwifiex_private *priv , struct cfg80211_beacon_data *info___0 ) ; static int mwifiex_ie_index_used_by_other_intf(struct mwifiex_private *priv , u16 idx ) { int i ; struct mwifiex_adapter *adapter ; struct mwifiex_ie *ie ; { adapter = priv->adapter; i = 0; goto ldv_60675; ldv_60674: ; if ((unsigned long )adapter->priv[i] != (unsigned long )priv) { ie = (struct mwifiex_ie *)(& (adapter->priv[i])->mgmt_ie) + (unsigned long )idx; if ((unsigned int )ie->mgmt_subtype_mask != 0U && (unsigned int )ie->ie_length != 0U) { return (-1); } else { } } else { } i = i + 1; ldv_60675: ; if ((int )adapter->priv_num > i) { goto ldv_60674; } else { } return (0); } } static int mwifiex_ie_get_autoidx(struct mwifiex_private *priv , u16 subtype_mask , struct mwifiex_ie *ie , u16 *index ) { u16 mask ; u16 len ; u16 i ; int tmp ; { i = 0U; goto ldv_60688; ldv_60687: mask = priv->mgmt_ie[(int )i].mgmt_subtype_mask; len = ie->ie_length; if ((unsigned int )mask == 65535U) { goto ldv_60686; } else { } if ((int )mask == (int )subtype_mask) { if ((unsigned int )len > 256U) { goto ldv_60686; } else { } *index = i; return (0); } else { } if ((unsigned int )priv->mgmt_ie[(int )i].ie_length == 0U) { tmp = mwifiex_ie_index_used_by_other_intf(priv, (int )i); if (tmp != 0) { goto ldv_60686; } else { } *index = i; return (0); } else { } ldv_60686: i = (u16 )((int )i + 1); ldv_60688: ; if ((int )(priv->adapter)->max_mgmt_ie_index > (int )i) { goto ldv_60687; } else { } return (-1); } } static int mwifiex_update_autoindex_ies(struct mwifiex_private *priv , struct mwifiex_ie_list *ie_list ) { u16 travel_len ; u16 index ; u16 mask ; s16 input_len ; s16 tlv_len ; struct mwifiex_ie *ie ; u8 *tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; { input_len = (s16 )ie_list->len; travel_len = 4U; ie_list->len = 0U; goto ldv_60702; ldv_60701: ie = (struct mwifiex_ie *)ie_list + (unsigned long )travel_len; tlv_len = (s16 )ie->ie_length; travel_len = (unsigned int )((int )travel_len + (int )((u16 )tlv_len)) + 6U; if ((unsigned long )input_len < (unsigned long )tlv_len + 6UL) { return (-1); } else { } index = ie->ie_index; mask = ie->mgmt_subtype_mask; if ((unsigned int )index == 65535U) { tmp___0 = mwifiex_ie_get_autoidx(priv, (int )mask, ie, & index); if (tmp___0 != 0) { return (-1); } else { } if ((unsigned int )index == 65535U) { return (-1); } else { } tmp = (u8 *)(& priv->mgmt_ie[(int )index].ie_buffer); memcpy((void *)tmp, (void const *)(& ie->ie_buffer), (size_t )ie->ie_length); priv->mgmt_ie[(int )index].ie_length = ie->ie_length; priv->mgmt_ie[(int )index].ie_index = index; priv->mgmt_ie[(int )index].mgmt_subtype_mask = mask; ie->ie_index = index; } else { if ((unsigned int )mask != 0U) { return (-1); } else { } tmp___1 = mwifiex_ie_index_used_by_other_intf(priv, (int )index); if (tmp___1 != 0) { return (-1); } else { } ie->ie_length = 0U; memcpy((void *)(& priv->mgmt_ie) + (unsigned long )index, (void const *)ie, 262UL); } le16_add_cpu(& ie_list->len, (int )((unsigned int )priv->mgmt_ie[(int )index].ie_length + 6U)); input_len = (s16 )((unsigned int )((int )((unsigned short )input_len) - (int )((unsigned short )tlv_len)) - 6U); ldv_60702: ; if ((unsigned int )((unsigned short )input_len) > 3U) { goto ldv_60701; } else { } if ((int )priv->bss_role & 1) { tmp___2 = mwifiex_send_cmd(priv, 176, 1, 1U, (void *)ie_list, 0); return (tmp___2); } else { } return (0); } } static int mwifiex_update_uap_custom_ie(struct mwifiex_private *priv , struct mwifiex_ie *beacon_ie , u16 *beacon_idx , struct mwifiex_ie *pr_ie , u16 *probe_idx , struct mwifiex_ie *ar_ie , u16 *assoc_idx ) { struct mwifiex_ie_list *ap_custom_ie ; u8 *pos ; u16 len ; int ret ; void *tmp ; { tmp = kzalloc(4196UL, 208U); ap_custom_ie = (struct mwifiex_ie_list *)tmp; if ((unsigned long )ap_custom_ie == (unsigned long )((struct mwifiex_ie_list *)0)) { return (-12); } else { } ap_custom_ie->type = 361U; pos = (u8 *)(& ap_custom_ie->ie_list); if ((unsigned long )beacon_ie != (unsigned long )((struct mwifiex_ie *)0)) { len = (unsigned int )beacon_ie->ie_length + 6U; memcpy((void *)pos, (void const *)beacon_ie, (size_t )len); pos = pos + (unsigned long )len; le16_add_cpu(& ap_custom_ie->len, (int )len); } else { } if ((unsigned long )pr_ie != (unsigned long )((struct mwifiex_ie *)0)) { len = (unsigned int )pr_ie->ie_length + 6U; memcpy((void *)pos, (void const *)pr_ie, (size_t )len); pos = pos + (unsigned long )len; le16_add_cpu(& ap_custom_ie->len, (int )len); } else { } if ((unsigned long )ar_ie != (unsigned long )((struct mwifiex_ie *)0)) { len = (unsigned int )ar_ie->ie_length + 6U; memcpy((void *)pos, (void const *)ar_ie, (size_t )len); pos = pos + (unsigned long )len; le16_add_cpu(& ap_custom_ie->len, (int )len); } else { } ret = mwifiex_update_autoindex_ies(priv, ap_custom_ie); pos = (u8 *)(& ap_custom_ie->ie_list[0].ie_index); if ((unsigned long )beacon_ie != (unsigned long )((struct mwifiex_ie *)0) && (unsigned int )*beacon_idx == 65535U) { *beacon_idx = ap_custom_ie->ie_list[0].ie_index; len = (unsigned int )beacon_ie->ie_length + 6U; pos = pos + (unsigned long )len; } else { } if ((unsigned long )pr_ie != (unsigned long )((struct mwifiex_ie *)0) && (unsigned int )pr_ie->ie_index == 65535U) { *probe_idx = *((u16 *)pos); len = (unsigned int )pr_ie->ie_length + 6U; pos = pos + (unsigned long )len; } else { } if ((unsigned long )ar_ie != (unsigned long )((struct mwifiex_ie *)0) && (unsigned int )ar_ie->ie_index == 65535U) { *assoc_idx = *((u16 *)pos); } else { } kfree((void const *)ap_custom_ie); return (ret); } } static int mwifiex_update_vs_ie(u8 const *ies , int ies_len , struct mwifiex_ie **ie_ptr , u16 mask , unsigned int oui , u8 oui_type ) { struct ieee_types_header *vs_ie ; struct mwifiex_ie *ie ; u8 const *vendor_ie ; void *tmp ; { ie = *ie_ptr; vendor_ie = cfg80211_find_vendor_ie(oui, (int )oui_type, ies, ies_len); if ((unsigned long )vendor_ie != (unsigned long )((u8 const *)0U)) { if ((unsigned long )*ie_ptr == (unsigned long )((struct mwifiex_ie *)0)) { tmp = kzalloc(262UL, 208U); *ie_ptr = (struct mwifiex_ie *)tmp; if ((unsigned long )*ie_ptr == (unsigned long )((struct mwifiex_ie *)0)) { return (-12); } else { } ie = *ie_ptr; } else { } vs_ie = (struct ieee_types_header *)vendor_ie; memcpy((void *)(& ie->ie_buffer) + (unsigned long )ie->ie_length, (void const *)vs_ie, (size_t )((int )vs_ie->len + 2)); le16_add_cpu(& ie->ie_length, (int )((unsigned int )((u16 )vs_ie->len) + 2U)); ie->mgmt_subtype_mask = mask; ie->ie_index = 65535U; } else { } *ie_ptr = ie; return (0); } } static int mwifiex_set_mgmt_beacon_data_ies(struct mwifiex_private *priv , struct cfg80211_beacon_data *data ) { struct mwifiex_ie *beacon_ie ; struct mwifiex_ie *pr_ie ; struct mwifiex_ie *ar_ie ; u16 beacon_idx ; u16 pr_idx ; u16 ar_idx ; int ret ; { beacon_ie = (struct mwifiex_ie *)0; pr_ie = (struct mwifiex_ie *)0; ar_ie = (struct mwifiex_ie *)0; beacon_idx = 65535U; pr_idx = 65535U; ar_idx = 65535U; ret = 0; if ((unsigned long )data->beacon_ies != (unsigned long )((u8 const *)0U) && data->beacon_ies_len != 0UL) { mwifiex_update_vs_ie(data->beacon_ies, (int )data->beacon_ies_len, & beacon_ie, 256, 20722U, 4); mwifiex_update_vs_ie(data->beacon_ies, (int )data->beacon_ies_len, & beacon_ie, 256, 5271450U, 9); } else { } if ((unsigned long )data->proberesp_ies != (unsigned long )((u8 const *)0U) && data->proberesp_ies_len != 0UL) { mwifiex_update_vs_ie(data->proberesp_ies, (int )data->proberesp_ies_len, & pr_ie, 32, 20722U, 4); mwifiex_update_vs_ie(data->proberesp_ies, (int )data->proberesp_ies_len, & pr_ie, 32, 5271450U, 9); } else { } if ((unsigned long )data->assocresp_ies != (unsigned long )((u8 const *)0U) && data->assocresp_ies_len != 0UL) { mwifiex_update_vs_ie(data->assocresp_ies, (int )data->assocresp_ies_len, & ar_ie, 10, 20722U, 4); mwifiex_update_vs_ie(data->assocresp_ies, (int )data->assocresp_ies_len, & ar_ie, 10, 5271450U, 9); } else { } if (((unsigned long )beacon_ie != (unsigned long )((struct mwifiex_ie *)0) || (unsigned long )pr_ie != (unsigned long )((struct mwifiex_ie *)0)) || (unsigned long )ar_ie != (unsigned long )((struct mwifiex_ie *)0)) { ret = mwifiex_update_uap_custom_ie(priv, beacon_ie, & beacon_idx, pr_ie, & pr_idx, ar_ie, & ar_idx); if (ret != 0) { goto done; } else { } } else { } priv->beacon_idx = beacon_idx; priv->proberesp_idx = pr_idx; priv->assocresp_idx = ar_idx; done: kfree((void const *)beacon_ie); kfree((void const *)pr_ie); kfree((void const *)ar_ie); return (ret); } } static int mwifiex_uap_parse_tail_ies(struct mwifiex_private *priv , struct cfg80211_beacon_data *info___0 ) { struct mwifiex_ie *gen_ie ; struct ieee_types_header *hdr ; struct ieee80211_vendor_ie *vendorhdr ; u16 gen_idx ; u16 ie_len ; int left_len ; int parsed_len ; void *tmp ; u8 const *tmp___0 ; int tmp___1 ; { gen_idx = 65535U; ie_len = 0U; parsed_len = 0; if ((unsigned long )info___0->tail == (unsigned long )((u8 const *)0U) || info___0->tail_len == 0UL) { return (0); } else { } tmp = kzalloc(262UL, 208U); gen_ie = (struct mwifiex_ie *)tmp; if ((unsigned long )gen_ie == (unsigned long )((struct mwifiex_ie *)0)) { return (-12); } else { } left_len = (int )info___0->tail_len; goto ldv_60764; ldv_60763: hdr = (struct ieee_types_header *)info___0->tail + (unsigned long )parsed_len; switch ((int )hdr->element_id) { case 0: ; case 1: ; case 7: ; case 32: ; case 50: ; case 45: ; case 61: ; case 191: ; case 192: ; case 221: ; goto ldv_60761; default: memcpy((void *)(& gen_ie->ie_buffer) + (unsigned long )ie_len, (void const *)hdr, (unsigned long )hdr->len + 2UL); ie_len = (unsigned int )((int )((u16 )hdr->len) + (int )ie_len) + 2U; goto ldv_60761; } ldv_60761: left_len = (int )(((unsigned int )left_len - (unsigned int )hdr->len) - 2U); parsed_len = (int )(((unsigned int )hdr->len + (unsigned int )parsed_len) + 2U); ldv_60764: ; if ((unsigned int )left_len > 2U) { goto ldv_60763; } else { } tmp___0 = cfg80211_find_vendor_ie(20722U, 1, info___0->tail, (int )info___0->tail_len); vendorhdr = (struct ieee80211_vendor_ie *)tmp___0; if ((unsigned long )vendorhdr != (unsigned long )((struct ieee80211_vendor_ie *)0)) { memcpy((void *)(& gen_ie->ie_buffer) + (unsigned long )ie_len, (void const *)vendorhdr, (unsigned long )vendorhdr->len + 2UL); ie_len = (unsigned int )((int )((u16 )vendorhdr->len) + (int )ie_len) + 2U; } else { } if ((unsigned int )ie_len == 0U) { kfree((void const *)gen_ie); return (0); } else { } gen_ie->ie_index = gen_idx; gen_ie->mgmt_subtype_mask = 290U; gen_ie->ie_length = ie_len; tmp___1 = mwifiex_update_uap_custom_ie(priv, gen_ie, & gen_idx, (struct mwifiex_ie *)0, (u16 *)0U, (struct mwifiex_ie *)0, (u16 *)0U); if (tmp___1 != 0) { kfree((void const *)gen_ie); return (-1); } else { } priv->gen_idx = gen_idx; kfree((void const *)gen_ie); return (0); } } int mwifiex_set_mgmt_ies(struct mwifiex_private *priv , struct cfg80211_beacon_data *info___0 ) { int ret ; int tmp ; { ret = mwifiex_uap_parse_tail_ies(priv, info___0); return (ret); tmp = mwifiex_set_mgmt_beacon_data_ies(priv, info___0); return (tmp); } } int mwifiex_del_mgmt_ies(struct mwifiex_private *priv ) { struct mwifiex_ie *beacon_ie ; struct mwifiex_ie *pr_ie ; struct mwifiex_ie *ar_ie ; struct mwifiex_ie *gen_ie ; int ret ; void *tmp ; int tmp___0 ; void *tmp___1 ; void *tmp___2 ; void *tmp___3 ; { beacon_ie = (struct mwifiex_ie *)0; pr_ie = (struct mwifiex_ie *)0; ar_ie = (struct mwifiex_ie *)0; gen_ie = (struct mwifiex_ie *)0; ret = 0; if ((unsigned int )priv->gen_idx != 65535U) { tmp = kmalloc(262UL, 208U); gen_ie = (struct mwifiex_ie *)tmp; if ((unsigned long )gen_ie == (unsigned long )((struct mwifiex_ie *)0)) { return (-12); } else { } gen_ie->ie_index = priv->gen_idx; gen_ie->mgmt_subtype_mask = 0U; gen_ie->ie_length = 0U; tmp___0 = mwifiex_update_uap_custom_ie(priv, gen_ie, & priv->gen_idx, (struct mwifiex_ie *)0, & priv->proberesp_idx, (struct mwifiex_ie *)0, & priv->assocresp_idx); if (tmp___0 != 0) { ret = -1; goto done; } else { } priv->gen_idx = 65535U; } else { } if ((unsigned int )priv->beacon_idx != 65535U) { tmp___1 = kmalloc(262UL, 208U); beacon_ie = (struct mwifiex_ie *)tmp___1; if ((unsigned long )beacon_ie == (unsigned long )((struct mwifiex_ie *)0)) { ret = -12; goto done; } else { } beacon_ie->ie_index = priv->beacon_idx; beacon_ie->mgmt_subtype_mask = 0U; beacon_ie->ie_length = 0U; } else { } if ((unsigned int )priv->proberesp_idx != 65535U) { tmp___2 = kmalloc(262UL, 208U); pr_ie = (struct mwifiex_ie *)tmp___2; if ((unsigned long )pr_ie == (unsigned long )((struct mwifiex_ie *)0)) { ret = -12; goto done; } else { } pr_ie->ie_index = priv->proberesp_idx; pr_ie->mgmt_subtype_mask = 0U; pr_ie->ie_length = 0U; } else { } if ((unsigned int )priv->assocresp_idx != 65535U) { tmp___3 = kmalloc(262UL, 208U); ar_ie = (struct mwifiex_ie *)tmp___3; if ((unsigned long )ar_ie == (unsigned long )((struct mwifiex_ie *)0)) { ret = -12; goto done; } else { } ar_ie->ie_index = priv->assocresp_idx; ar_ie->mgmt_subtype_mask = 0U; ar_ie->ie_length = 0U; } else { } if (((unsigned long )beacon_ie != (unsigned long )((struct mwifiex_ie *)0) || (unsigned long )pr_ie != (unsigned long )((struct mwifiex_ie *)0)) || (unsigned long )ar_ie != (unsigned long )((struct mwifiex_ie *)0)) { ret = mwifiex_update_uap_custom_ie(priv, beacon_ie, & priv->beacon_idx, pr_ie, & priv->proberesp_idx, ar_ie, & priv->assocresp_idx); } else { } done: kfree((void const *)beacon_ie); kfree((void const *)pr_ie); kfree((void const *)ar_ie); return (ret); } } bool ldv_queue_work_on_257(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_258(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_259(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_260(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_261(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; bool ldv_queue_work_on_271(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_273(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_272(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_275(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_274(struct workqueue_struct *ldv_func_arg1 ) ; static void mwifiex_process_cmdresp_error(struct mwifiex_private *priv , struct host_cmd_ds_command *resp ) { struct cmd_ctrl_node *cmd_node ; struct cmd_ctrl_node *tmp_node ; struct mwifiex_adapter *adapter ; struct host_cmd_ds_802_11_ps_mode_enh *pm ; unsigned long flags ; raw_spinlock_t *tmp ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; raw_spinlock_t *tmp___0 ; struct list_head const *__mptr___1 ; raw_spinlock_t *tmp___1 ; raw_spinlock_t *tmp___2 ; { cmd_node = (struct cmd_ctrl_node *)0; adapter = priv->adapter; if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "CMD_RESP: cmd %#x error, result=%#x\n", (int )resp->command, (int )resp->result); } else { } } else { } if ((adapter->curr_cmd)->wait_q_enabled != 0U) { adapter->cmd_wait_q.status = -1; } else { } switch ((int )resp->command) { case 228: pm = & resp->params.psmode_enh; if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "PS_MODE_ENH cmd failed: result=0x%x action=0x%X\n", (int )resp->result, (int )pm->action); } else { } } else { } if (((unsigned int )pm->action == 255U && ((int )pm->params.ps_bitmap & 16) != 0) && priv->bss_mode == 1U) { adapter->ps_mode = 0U; } else { } goto ldv_60956; case 6: ; case 263: tmp = spinlock_check(& adapter->scan_pending_q_lock); flags = _raw_spin_lock_irqsave(tmp); __mptr = (struct list_head const *)adapter->scan_pending_q.next; cmd_node = (struct cmd_ctrl_node *)__mptr; __mptr___0 = (struct list_head const *)cmd_node->list.next; tmp_node = (struct cmd_ctrl_node *)__mptr___0; goto ldv_60972; ldv_60971: list_del(& cmd_node->list); spin_unlock_irqrestore(& adapter->scan_pending_q_lock, flags); mwifiex_insert_cmd_to_free_q(adapter, cmd_node); tmp___0 = spinlock_check(& adapter->scan_pending_q_lock); flags = _raw_spin_lock_irqsave(tmp___0); cmd_node = tmp_node; __mptr___1 = (struct list_head const *)tmp_node->list.next; tmp_node = (struct cmd_ctrl_node *)__mptr___1; ldv_60972: ; if ((unsigned long )(& cmd_node->list) != (unsigned long )(& adapter->scan_pending_q)) { goto ldv_60971; } else { } spin_unlock_irqrestore(& adapter->scan_pending_q_lock, flags); tmp___1 = spinlock_check(& adapter->mwifiex_cmd_lock); flags = _raw_spin_lock_irqsave(tmp___1); adapter->scan_processing = 0U; spin_unlock_irqrestore(& adapter->mwifiex_cmd_lock, flags); goto ldv_60956; case 40: ; goto ldv_60956; case 547: ; if ((int )adapter->debug_mask & 1) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "SDIO RX single-port aggregation Not support\n"); } else { } } else { } goto ldv_60956; default: ; goto ldv_60956; } ldv_60956: mwifiex_recycle_cmd_node(adapter, adapter->curr_cmd); tmp___2 = spinlock_check(& adapter->mwifiex_cmd_lock); flags = _raw_spin_lock_irqsave(tmp___2); adapter->curr_cmd = (struct cmd_ctrl_node *)0; spin_unlock_irqrestore(& adapter->mwifiex_cmd_lock, flags); return; } } static int mwifiex_ret_802_11_rssi_info(struct mwifiex_private *priv , struct host_cmd_ds_command *resp ) { struct host_cmd_ds_802_11_rssi_info_rsp *rssi_info_rsp ; struct mwifiex_ds_misc_subsc_evt *subsc_evt ; long ret ; int __x___0 ; long ret___0 ; int __x___2 ; long ret___1 ; int __x___4 ; long ret___2 ; int __x___6 ; { rssi_info_rsp = & resp->params.rssi_info_rsp; subsc_evt = & priv->async_subsc_evt_storage; priv->data_rssi_last = (s16 )rssi_info_rsp->data_rssi_last; priv->data_nf_last = (s16 )rssi_info_rsp->data_nf_last; priv->data_rssi_avg = (s16 )rssi_info_rsp->data_rssi_avg; priv->data_nf_avg = (s16 )rssi_info_rsp->data_nf_avg; priv->bcn_rssi_last = (s16 )rssi_info_rsp->bcn_rssi_last; priv->bcn_nf_last = (s16 )rssi_info_rsp->bcn_nf_last; priv->bcn_rssi_avg = (s16 )rssi_info_rsp->bcn_rssi_avg; priv->bcn_nf_avg = (s16 )rssi_info_rsp->bcn_nf_avg; if ((unsigned int )priv->subsc_evt_rssi_state == 0U) { return (0); } else { } memset((void *)subsc_evt, 0, 8UL); subsc_evt->events = 17U; subsc_evt->action = 2U; if ((unsigned int )priv->subsc_evt_rssi_state == 1U) { __x___0 = (int )((u32 )priv->bcn_rssi_avg - priv->cqm_rssi_hyst); ret = (long )(__x___0 < 0 ? - __x___0 : __x___0); subsc_evt->bcn_l_rssi_cfg.abs_value = (u8 )ret; __x___2 = priv->cqm_rssi_thold; ret___0 = (long )(__x___2 < 0 ? - __x___2 : __x___2); subsc_evt->bcn_h_rssi_cfg.abs_value = (u8 )ret___0; } else if ((unsigned int )priv->subsc_evt_rssi_state == 2U) { __x___4 = priv->cqm_rssi_thold; ret___1 = (long )(__x___4 < 0 ? - __x___4 : __x___4); subsc_evt->bcn_l_rssi_cfg.abs_value = (u8 )ret___1; __x___6 = (int )((u32 )priv->bcn_rssi_avg + priv->cqm_rssi_hyst); ret___2 = (long )(__x___6 < 0 ? - __x___6 : __x___6); subsc_evt->bcn_h_rssi_cfg.abs_value = (u8 )ret___2; } else { } subsc_evt->bcn_l_rssi_cfg.evt_freq = 1U; subsc_evt->bcn_h_rssi_cfg.evt_freq = 1U; priv->subsc_evt_rssi_state = 0U; mwifiex_send_cmd(priv, 117, 0, 0U, (void *)subsc_evt, 0); return (0); } } static int mwifiex_ret_802_11_snmp_mib(struct mwifiex_private *priv , struct host_cmd_ds_command *resp , u32 *data_buf ) { struct host_cmd_ds_802_11_snmp_mib *smib ; u16 oid ; u16 query_type ; u32 ul_temp ; { smib = & resp->params.smib; oid = smib->oid; query_type = smib->query_type; if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: SNMP_RESP: oid value = %#x,\tquery_type = %#x, buf size = %#x\n", (int )oid, (int )query_type, (int )smib->buf_size); } else { } } else { } if ((unsigned int )query_type == 0U) { ul_temp = (u32 )*((__le16 *)(& smib->value)); if ((unsigned long )data_buf != (unsigned long )((u32 *)0U)) { *data_buf = ul_temp; } else { } switch ((int )oid) { case 8: ; if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: SNMP_RESP: FragThsd =%u\n", ul_temp); } else { } } else { } goto ldv_61015; case 5: ; if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: SNMP_RESP: RTSThsd =%u\n", ul_temp); } else { } } else { } goto ldv_61015; case 6: ; if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: SNMP_RESP: TxRetryCount=%u\n", ul_temp); } else { } } else { } goto ldv_61015; case 3: ; if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: SNMP_RESP: DTIM period=%u\n", ul_temp); } else { } } else { } default: ; goto ldv_61015; } ldv_61015: ; } else { } return (0); } } static int mwifiex_ret_get_log(struct mwifiex_private *priv , struct host_cmd_ds_command *resp , struct mwifiex_ds_get_stats *stats ) { struct host_cmd_ds_802_11_get_log *get_log ; { get_log = & resp->params.get_log; if ((unsigned long )stats != (unsigned long )((struct mwifiex_ds_get_stats *)0)) { stats->mcast_tx_frame = get_log->mcast_tx_frame; stats->failed = get_log->failed; stats->retry = get_log->retry; stats->multi_retry = get_log->multi_retry; stats->frame_dup = get_log->frame_dup; stats->rts_success = get_log->rts_success; stats->rts_failure = get_log->rts_failure; stats->ack_failure = get_log->ack_failure; stats->rx_frag = get_log->rx_frag; stats->mcast_rx_frame = get_log->mcast_rx_frame; stats->fcs_error = get_log->fcs_error; stats->tx_frame = get_log->tx_frame; stats->wep_icv_error[0] = get_log->wep_icv_err_cnt[0]; stats->wep_icv_error[1] = get_log->wep_icv_err_cnt[1]; stats->wep_icv_error[2] = get_log->wep_icv_err_cnt[2]; stats->wep_icv_error[3] = get_log->wep_icv_err_cnt[3]; stats->bcn_rcv_cnt = get_log->bcn_rcv_cnt; stats->bcn_miss_cnt = get_log->bcn_miss_cnt; } else { } return (0); } } static int mwifiex_ret_tx_rate_cfg(struct mwifiex_private *priv , struct host_cmd_ds_command *resp ) { struct host_cmd_ds_tx_rate_cfg *rate_cfg ; struct mwifiex_rate_scope *rate_scope ; struct mwifiex_ie_types_header *head ; u16 tlv ; u16 tlv_buf_len ; u16 tlv_buf_left ; u8 *tlv_buf ; u32 i ; int tmp ; { rate_cfg = & resp->params.tx_rate_cfg; tlv_buf = (u8 *)rate_cfg + 4UL; tlv_buf_left = (unsigned int )resp->size - 12U; goto ldv_61050; ldv_61049: head = (struct mwifiex_ie_types_header *)tlv_buf; tlv = head->type; tlv_buf_len = head->len; if ((unsigned long )tlv_buf_left < (unsigned long )tlv_buf_len + 4UL) { goto ldv_61038; } else { } switch ((int )tlv) { case 339: rate_scope = (struct mwifiex_rate_scope *)tlv_buf; priv->bitmap_rates[0] = rate_scope->hr_dsss_rate_bitmap; priv->bitmap_rates[1] = rate_scope->ofdm_rate_bitmap; i = 0U; goto ldv_61041; ldv_61040: priv->bitmap_rates[i + 2U] = rate_scope->ht_mcs_rate_bitmap[i]; i = i + 1U; ldv_61041: ; if (i <= 7U) { goto ldv_61040; } else { } if ((unsigned int )(priv->adapter)->fw_api_ver == 15U) { i = 0U; goto ldv_61046; ldv_61045: priv->bitmap_rates[i + 10U] = rate_scope->vht_mcs_rate_bitmap[i]; i = i + 1U; ldv_61046: ; if (i <= 7U) { goto ldv_61045; } else { } } else { } goto ldv_61048; } ldv_61048: tlv_buf = tlv_buf + ((unsigned long )tlv_buf_len + 4UL); tlv_buf_left = (unsigned int )((int )tlv_buf_left - (int )tlv_buf_len) - 4U; ldv_61050: ; if ((unsigned int )tlv_buf_left > 3U) { goto ldv_61049; } else { } ldv_61038: priv->is_data_rate_auto = mwifiex_is_rate_auto(priv); if ((unsigned int )priv->is_data_rate_auto != 0U) { priv->data_rate = 0U; } else { tmp = mwifiex_send_cmd(priv, 127, 0, 0U, (void *)0, 0); return (tmp); } return (0); } } static int mwifiex_get_power_level(struct mwifiex_private *priv , void *data_buf ) { int length ; int max_power ; int min_power ; struct mwifiex_types_power_group *pg_tlv_hdr ; struct mwifiex_power_group *pg ; { max_power = -1; min_power = -1; if ((unsigned long )data_buf == (unsigned long )((void *)0)) { return (-1); } else { } pg_tlv_hdr = (struct mwifiex_types_power_group *)data_buf; pg = (struct mwifiex_power_group *)pg_tlv_hdr + 4U; length = (int )pg_tlv_hdr->length; if ((unsigned int )length <= 7U) { return (0); } else { } max_power = (int )pg->power_max; min_power = (int )pg->power_min; length = (int )((unsigned int )length - 8U); goto ldv_61061; ldv_61060: pg = pg + 1; if ((int )pg->power_max > max_power) { max_power = (int )pg->power_max; } else { } if ((int )pg->power_min < min_power) { min_power = (int )pg->power_min; } else { } length = (int )((unsigned int )length - 8U); ldv_61061: ; if ((unsigned int )length > 7U) { goto ldv_61060; } else { } priv->min_tx_power_level = (unsigned char )min_power; priv->max_tx_power_level = (unsigned char )max_power; return (0); } } static int mwifiex_ret_tx_power_cfg(struct mwifiex_private *priv , struct host_cmd_ds_command *resp ) { struct mwifiex_adapter *adapter ; struct host_cmd_ds_txpwr_cfg *txp_cfg ; struct mwifiex_types_power_group *pg_tlv_hdr ; struct mwifiex_power_group *pg ; u16 action ; u16 tlv_buf_left ; { adapter = priv->adapter; txp_cfg = & resp->params.txp_cfg; action = txp_cfg->action; pg_tlv_hdr = (struct mwifiex_types_power_group *)txp_cfg + 8U; pg = (struct mwifiex_power_group *)pg_tlv_hdr + 4U; tlv_buf_left = (unsigned int )resp->size - 16U; if ((unsigned long )tlv_buf_left < (unsigned long )pg_tlv_hdr->length + 4UL) { return (0); } else { } switch ((int )action) { case 0: ; if ((unsigned int )adapter->hw_status == 1U) { mwifiex_get_power_level(priv, (void *)pg_tlv_hdr); } else { } priv->tx_power_level = (unsigned short )pg->power_min; goto ldv_61074; case 1: ; if (txp_cfg->mode == 0U) { goto ldv_61074; } else { } if ((int )pg->power_max == (int )pg->power_min) { priv->tx_power_level = (unsigned short )pg->power_min; } else { } goto ldv_61074; default: ; if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "CMD_RESP: unknown cmd action %d\n", (int )action); } else { } } else { } return (0); } ldv_61074: ; if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: Current TxPower Level = %d, Max Power=%d, Min Power=%d\n", (int )priv->tx_power_level, (int )priv->max_tx_power_level, (int )priv->min_tx_power_level); } else { } } else { } return (0); } } static int mwifiex_ret_rf_tx_power(struct mwifiex_private *priv , struct host_cmd_ds_command *resp ) { struct host_cmd_ds_rf_tx_pwr *txp ; u16 action ; { txp = & resp->params.txp; action = txp->action; priv->tx_power_level = txp->cur_level; if ((unsigned int )action == 0U) { priv->max_tx_power_level = txp->max_power; priv->min_tx_power_level = txp->min_power; } else { } if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Current TxPower Level=%d, Max Power=%d, Min Power=%d\n", (int )priv->tx_power_level, (int )priv->max_tx_power_level, (int )priv->min_tx_power_level); } else { } } else { } return (0); } } static int mwifiex_ret_rf_antenna(struct mwifiex_private *priv , struct host_cmd_ds_command *resp ) { struct host_cmd_ds_rf_ant_mimo *ant_mimo ; struct host_cmd_ds_rf_ant_siso *ant_siso ; struct mwifiex_adapter *adapter ; { ant_mimo = & resp->params.ant_mimo; ant_siso = & resp->params.ant_siso; adapter = priv->adapter; if ((unsigned int )adapter->hw_dev_mcs_support == 34U) { if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "RF_ANT_RESP: Tx action = 0x%x, Tx Mode = 0x%04x\tRx action = 0x%x, Rx Mode = 0x%04x\n", (int )ant_mimo->action_tx, (int )ant_mimo->tx_ant_mode, (int )ant_mimo->action_rx, (int )ant_mimo->rx_ant_mode); } else { } } else { } } else if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "RF_ANT_RESP: action = 0x%x, Mode = 0x%04x\n", (int )ant_siso->action, (int )ant_siso->ant_mode); } else { } } else { } return (0); } } static int mwifiex_ret_802_11_mac_address(struct mwifiex_private *priv , struct host_cmd_ds_command *resp ) { struct host_cmd_ds_802_11_mac_address *cmd_mac_addr ; { cmd_mac_addr = & resp->params.mac_addr; memcpy((void *)(& priv->curr_addr), (void const *)(& cmd_mac_addr->mac_addr), 6UL); if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: set mac address: %pM\n", (u8 *)(& priv->curr_addr)); } else { } } else { } return (0); } } static int mwifiex_ret_mac_multicast_adr(struct mwifiex_private *priv , struct host_cmd_ds_command *resp ) { { return (0); } } static int mwifiex_ret_802_11_tx_rate_query(struct mwifiex_private *priv , struct host_cmd_ds_command *resp ) { { priv->tx_rate = resp->params.tx_rate.tx_rate; priv->tx_htinfo = resp->params.tx_rate.ht_info; if ((unsigned int )priv->is_data_rate_auto == 0U) { priv->data_rate = mwifiex_index_to_data_rate(priv, (int )priv->tx_rate, (int )priv->tx_htinfo); } else { } return (0); } } static int mwifiex_ret_802_11_deauthenticate(struct mwifiex_private *priv , struct host_cmd_ds_command *resp ) { struct mwifiex_adapter *adapter ; int tmp ; { adapter = priv->adapter; adapter->dbg.num_cmd_deauth = adapter->dbg.num_cmd_deauth + 1U; tmp = memcmp((void const *)(& resp->params.deauth.mac_addr), (void const *)(& priv->curr_bss_params.bss_descriptor.mac_address), 6UL); if (tmp == 0) { mwifiex_reset_connect_state(priv, 3); } else { } return (0); } } static int mwifiex_ret_802_11_ad_hoc_stop(struct mwifiex_private *priv , struct host_cmd_ds_command *resp ) { { mwifiex_reset_connect_state(priv, 3); return (0); } } static int mwifiex_ret_802_11_key_material_v1(struct mwifiex_private *priv , struct host_cmd_ds_command *resp ) { struct host_cmd_ds_802_11_key_material *key ; { key = & resp->params.key_material; if ((unsigned int )key->action == 1U) { if ((int )key->key_param_set.key_info & 1) { if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: key: GTK is set\n"); } else { } } else { } priv->wpa_is_gtk_set = 1U; priv->scan_block = 0U; } else { } } else { } memset((void *)(& priv->aes_key.key_param_set.key), 0, 50UL); priv->aes_key.key_param_set.key_len = key->key_param_set.key_len; memcpy((void *)(& priv->aes_key.key_param_set.key), (void const *)(& key->key_param_set.key), (size_t )priv->aes_key.key_param_set.key_len); return (0); } } static int mwifiex_ret_802_11_key_material_v2(struct mwifiex_private *priv , struct host_cmd_ds_command *resp ) { struct host_cmd_ds_802_11_key_material_v2 *key_v2 ; __le16 len ; { key_v2 = & resp->params.key_material_v2; if ((unsigned int )key_v2->action == 1U) { if ((int )key_v2->key_param_set.key_info & 1) { if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: key: GTK is set\n"); } else { } } else { } priv->wpa_is_gtk_set = 1U; priv->scan_block = 0U; } else { } } else { } if ((unsigned int )key_v2->key_param_set.key_type != 2U) { return (0); } else { } memset((void *)(& priv->aes_key_v2.key_param_set.key_params.aes.key), 0, 16UL); priv->aes_key_v2.key_param_set.key_params.aes.key_len = key_v2->key_param_set.key_params.aes.key_len; len = priv->aes_key_v2.key_param_set.key_params.aes.key_len; memcpy((void *)(& priv->aes_key_v2.key_param_set.key_params.aes.key), (void const *)(& key_v2->key_param_set.key_params.aes.key), (size_t )len); return (0); } } static int mwifiex_ret_802_11_key_material(struct mwifiex_private *priv , struct host_cmd_ds_command *resp ) { int tmp ; int tmp___0 ; { if ((unsigned int )(priv->adapter)->key_api_major_ver == 2U) { tmp = mwifiex_ret_802_11_key_material_v2(priv, resp); return (tmp); } else { tmp___0 = mwifiex_ret_802_11_key_material_v1(priv, resp); return (tmp___0); } } } static int mwifiex_ret_802_11d_domain_info(struct mwifiex_private *priv , struct host_cmd_ds_command *resp ) { struct host_cmd_ds_802_11d_domain_info_rsp *domain_info ; struct mwifiex_ietypes_domain_param_set *domain ; u16 action ; u8 no_of_triplet ; { domain_info = & resp->params.domain_info_resp; domain = & domain_info->domain; action = domain_info->action; no_of_triplet = (unsigned char )((unsigned long )((int )domain->header.len + -3) / 3UL); if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: 11D Domain Info Resp: no_of_triplet=%d\n", (int )no_of_triplet); } else { } } else { } if ((unsigned int )no_of_triplet > 83U) { if (((priv->adapter)->debug_mask & 2U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "11D: invalid number of triplets %d returned\n", (int )no_of_triplet); } else { } } else { } return (-1); } else { } switch ((int )action) { case 1: ; goto ldv_61136; case 0: ; goto ldv_61136; default: ; if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "11D: invalid action:%d\n", (int )domain_info->action); } else { } } else { } return (-1); } ldv_61136: ; return (0); } } static int mwifiex_ret_ver_ext(struct mwifiex_private *priv , struct host_cmd_ds_command *resp , struct host_cmd_ds_version_ext *version_ext ) { struct host_cmd_ds_version_ext *ver_ext ; { ver_ext = & resp->params.verext; if ((unsigned long )version_ext != (unsigned long )((struct host_cmd_ds_version_ext *)0)) { version_ext->version_str_sel = ver_ext->version_str_sel; memcpy((void *)(& version_ext->version_str), (void const *)(& ver_ext->version_str), 128UL); memcpy((void *)(& priv->version_str), (void const *)(& ver_ext->version_str), 128UL); } else { } return (0); } } static int mwifiex_ret_remain_on_chan(struct mwifiex_private *priv , struct host_cmd_ds_command *resp , struct host_cmd_ds_remain_on_chan *roc_cfg ) { struct host_cmd_ds_remain_on_chan *resp_cfg ; { resp_cfg = & resp->params.roc_cfg; if ((unsigned long )roc_cfg != (unsigned long )((struct host_cmd_ds_remain_on_chan *)0)) { memcpy((void *)roc_cfg, (void const *)resp_cfg, 10UL); } else { } return (0); } } static int mwifiex_ret_p2p_mode_cfg(struct mwifiex_private *priv , struct host_cmd_ds_command *resp , void *data_buf ) { struct host_cmd_ds_p2p_mode_cfg *mode_cfg ; { mode_cfg = & resp->params.mode_cfg; if ((unsigned long )data_buf != (unsigned long )((void *)0)) { *((u16 *)data_buf) = mode_cfg->mode; } else { } return (0); } } static int mwifiex_ret_mem_access(struct mwifiex_private *priv , struct host_cmd_ds_command *resp , void *pioctl_buf ) { struct host_cmd_ds_mem_access *mem ; { mem = & resp->params.mem; priv->mem_rw.addr = mem->addr; priv->mem_rw.value = mem->value; return (0); } } static int mwifiex_ret_reg_access(u16 type , struct host_cmd_ds_command *resp , void *data_buf ) { struct mwifiex_ds_reg_rw *reg_rw ; struct mwifiex_ds_read_eeprom *eeprom ; union reg r ; struct _ddebug descriptor ; long tmp ; struct _ddebug descriptor___0 ; long tmp___0 ; { if ((unsigned long )data_buf == (unsigned long )((void *)0)) { return (0); } else { } reg_rw = (struct mwifiex_ds_reg_rw *)data_buf; eeprom = (struct mwifiex_ds_read_eeprom *)data_buf; switch ((int )type) { case 25: r.mac = & resp->params.mac_reg; reg_rw->offset = (unsigned int )(r.mac)->offset; reg_rw->value = (r.mac)->value; goto ldv_61178; case 26: r.bbp = & resp->params.bbp_reg; reg_rw->offset = (unsigned int )(r.bbp)->offset; reg_rw->value = (unsigned int )(r.bbp)->value; goto ldv_61178; case 27: r.rf = & resp->params.rf_reg; reg_rw->offset = (unsigned int )(r.rf)->offset; reg_rw->value = (unsigned int )(r.bbp)->value; goto ldv_61178; case 173: r.pmic = & resp->params.pmic_reg; reg_rw->offset = (unsigned int )(r.pmic)->offset; reg_rw->value = (unsigned int )(r.pmic)->value; goto ldv_61178; case 237: r.rf = & resp->params.rf_reg; reg_rw->offset = (unsigned int )(r.rf)->offset; reg_rw->value = (unsigned int )(r.rf)->value; goto ldv_61178; case 89: r.eeprom = & resp->params.eeprom; descriptor.modname = "mwifiex"; descriptor.function = "mwifiex_ret_reg_access"; descriptor.filename = "/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/11944/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/mwifiex/sta_cmdresp.c"; descriptor.format = "info: EEPROM read len=%x\n"; descriptor.lineno = 819U; descriptor.flags = 0U; tmp = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp != 0L) { __dynamic_pr_debug(& descriptor, "mwifiex: info: EEPROM read len=%x\n", (int )(r.eeprom)->byte_count); } else { } if ((int )eeprom->byte_count < (int )(r.eeprom)->byte_count) { eeprom->byte_count = 0U; descriptor___0.modname = "mwifiex"; descriptor___0.function = "mwifiex_ret_reg_access"; descriptor___0.filename = "/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/11944/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/mwifiex/sta_cmdresp.c"; descriptor___0.format = "info: EEPROM read length is too big\n"; descriptor___0.lineno = 823U; descriptor___0.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___0 != 0L) { __dynamic_pr_debug(& descriptor___0, "mwifiex: info: EEPROM read length is too big\n"); } else { } return (-1); } else { } eeprom->offset = (r.eeprom)->offset; eeprom->byte_count = (r.eeprom)->byte_count; if ((unsigned int )eeprom->byte_count != 0U) { memcpy((void *)(& eeprom->value), (void const *)(& (r.eeprom)->value), (size_t )(r.eeprom)->byte_count); } else { } goto ldv_61178; default: ; return (-1); } ldv_61178: ; return (0); } } static int mwifiex_ret_ibss_coalescing_status(struct mwifiex_private *priv , struct host_cmd_ds_command *resp ) { struct host_cmd_ds_802_11_ibss_status *ibss_coal_resp ; bool tmp ; bool tmp___0 ; int tmp___1 ; { ibss_coal_resp = & resp->params.ibss_coalescing; if ((unsigned int )ibss_coal_resp->action == 1U) { return (0); } else { } if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: new BSSID %pM\n", (u8 *)(& ibss_coal_resp->bssid)); } else { } } else { } tmp = is_zero_ether_addr((u8 const *)(& ibss_coal_resp->bssid)); if ((int )tmp) { if (((priv->adapter)->debug_mask & 2U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "new BSSID is NULL\n"); } else { } } else { } return (0); } else { } tmp___0 = ether_addr_equal((u8 const *)(& priv->curr_bss_params.bss_descriptor.mac_address), (u8 const *)(& ibss_coal_resp->bssid)); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { memcpy((void *)(& priv->curr_bss_params.bss_descriptor.mac_address), (void const *)(& ibss_coal_resp->bssid), 6UL); priv->curr_bss_params.bss_descriptor.beacon_period = ibss_coal_resp->beacon_interval; priv->curr_bss_params.bss_descriptor.erp_flags = (unsigned char )ibss_coal_resp->use_g_rate_protect; priv->adhoc_state = 3U; } else { } return (0); } } static int mwifiex_ret_tdls_oper(struct mwifiex_private *priv , struct host_cmd_ds_command *resp ) { struct host_cmd_ds_tdls_oper *cmd_tdls_oper ; u16 reason ; u16 action ; struct mwifiex_sta_node *node ; struct mwifiex_sta_node *tmp ; { cmd_tdls_oper = & resp->params.tdls_oper; reason = cmd_tdls_oper->reason; action = cmd_tdls_oper->tdls_action; tmp = mwifiex_get_sta_entry(priv, (u8 const *)(& cmd_tdls_oper->peer_mac)); node = tmp; switch ((int )action) { case 0: ; if ((unsigned int )reason != 0U) { if ((unsigned long )node == (unsigned long )((struct mwifiex_sta_node *)0) || (unsigned int )reason == 4U) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "TDLS link delete for %pM failed: reason %d\n", (u8 *)(& cmd_tdls_oper->peer_mac), (int )reason); } else { } } else { } } else if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "TDLS link delete for %pM failed: reason %d\n", (u8 *)(& cmd_tdls_oper->peer_mac), (int )reason); } else { } } else { } } else if ((int )(priv->adapter)->debug_mask & 1) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "TDLS link delete for %pM successful\n", (u8 *)(& cmd_tdls_oper->peer_mac)); } else { } } else { } goto ldv_61202; case 1: ; if ((unsigned int )reason != 0U) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "TDLS link creation for %pM failed: reason %d", (u8 *)(& cmd_tdls_oper->peer_mac), (int )reason); } else { } } else { } if ((unsigned long )node != (unsigned long )((struct mwifiex_sta_node *)0) && (unsigned int )reason != 3U) { node->tdls_status = 3U; } else { } } else if ((int )(priv->adapter)->debug_mask & 1) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "TDLS link creation for %pM successful", (u8 *)(& cmd_tdls_oper->peer_mac)); } else { } } else { } goto ldv_61202; case 2: ; if ((unsigned int )reason != 0U) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "TDLS link config for %pM failed, reason %d\n", (u8 *)(& cmd_tdls_oper->peer_mac), (int )reason); } else { } } else { } if ((unsigned long )node != (unsigned long )((struct mwifiex_sta_node *)0)) { node->tdls_status = 3U; } else { } } else if ((int )(priv->adapter)->debug_mask & 1) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "TDLS link config for %pM successful\n", (u8 *)(& cmd_tdls_oper->peer_mac)); } else { } } else { } goto ldv_61202; default: ; if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Unknown TDLS command action response %d", (int )action); } else { } } else { } return (-1); } ldv_61202: ; return (0); } } static int mwifiex_ret_subsc_evt(struct mwifiex_private *priv , struct host_cmd_ds_command *resp ) { struct host_cmd_ds_802_11_subsc_evt *cmd_sub_event ; { cmd_sub_event = & resp->params.subsc_evt; if (((priv->adapter)->debug_mask & 32U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Bitmap of currently subscribed events: %16x\n", (int )cmd_sub_event->events); } else { } } else { } return (0); } } static int mwifiex_ret_uap_sta_list(struct mwifiex_private *priv , struct host_cmd_ds_command *resp ) { struct host_cmd_ds_sta_list *sta_list ; struct mwifiex_ie_types_sta_info *sta_info ; int i ; struct mwifiex_sta_node *sta_node ; long tmp ; { sta_list = & resp->params.sta_list; sta_info = (struct mwifiex_ie_types_sta_info *)(& sta_list->tlv); i = 0; goto ldv_61221; ldv_61220: sta_node = mwifiex_get_sta_entry(priv, (u8 const *)(& sta_info->mac)); tmp = ldv__builtin_expect((unsigned long )sta_node == (unsigned long )((struct mwifiex_sta_node *)0), 0L); if (tmp != 0L) { goto ldv_61219; } else { } sta_node->stats.rssi = sta_info->rssi; sta_info = sta_info + 1; ldv_61219: i = i + 1; ldv_61221: ; if ((int )sta_list->sta_count > i) { goto ldv_61220; } else { } return (0); } } static int mwifiex_ret_cfg_data(struct mwifiex_private *priv , struct host_cmd_ds_command *resp ) { { if ((unsigned int )resp->result != 0U) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Cal data cmd resp failed\n"); } else { } } else { } return (-1); } else { } return (0); } } static int mwifiex_ret_sdio_rx_aggr_cfg(struct mwifiex_private *priv , struct host_cmd_ds_command *resp ) { struct mwifiex_adapter *adapter ; struct host_cmd_sdio_sp_rx_aggr_cfg *cfg ; { adapter = priv->adapter; cfg = & resp->params.sdio_rx_aggr_cfg; adapter->sdio_rx_aggr_enable = (unsigned int )cfg->enable != 0U; adapter->sdio_rx_block_size = cfg->block_size; return (0); } } int mwifiex_process_sta_cmdresp(struct mwifiex_private *priv , u16 cmdresp_no , struct host_cmd_ds_command *resp ) { int ret ; struct mwifiex_adapter *adapter ; void *data_buf ; { ret = 0; adapter = priv->adapter; data_buf = (adapter->curr_cmd)->data_buf; if ((unsigned int )resp->result != 0U) { mwifiex_process_cmdresp_error(priv, resp); return (-1); } else { } switch ((int )cmdresp_no) { case 3: ret = mwifiex_ret_get_hw_spec(priv, resp); goto ldv_61242; case 143: ret = mwifiex_ret_cfg_data(priv, resp); goto ldv_61242; case 40: ; goto ldv_61242; case 77: ret = mwifiex_ret_802_11_mac_address(priv, resp); goto ldv_61242; case 16: ret = mwifiex_ret_mac_multicast_adr(priv, resp); goto ldv_61242; case 214: ret = mwifiex_ret_tx_rate_cfg(priv, resp); goto ldv_61242; case 6: ret = mwifiex_ret_802_11_scan(priv, resp); (adapter->curr_cmd)->wait_q_enabled = 0U; goto ldv_61242; case 263: ret = mwifiex_ret_802_11_scan_ext(priv, resp); (adapter->curr_cmd)->wait_q_enabled = 0U; goto ldv_61242; case 108: ret = mwifiex_ret_802_11_scan(priv, resp); if ((adapter->debug_mask & 16U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: CMD_RESP: BG_SCAN result is ready!\n"); } else { } } else { } goto ldv_61242; case 209: ret = mwifiex_ret_tx_power_cfg(priv, resp); goto ldv_61242; case 30: ret = mwifiex_ret_rf_tx_power(priv, resp); goto ldv_61242; case 32: ret = mwifiex_ret_rf_antenna(priv, resp); goto ldv_61242; case 228: ret = mwifiex_ret_enh_power_mode(priv, resp, (struct mwifiex_ds_pm_cfg *)data_buf); goto ldv_61242; case 229: ret = mwifiex_ret_802_11_hs_cfg(priv, resp); goto ldv_61242; case 18: ret = mwifiex_ret_802_11_associate(priv, resp); goto ldv_61242; case 36: ret = mwifiex_ret_802_11_deauthenticate(priv, resp); goto ldv_61242; case 43: ; case 44: ret = mwifiex_ret_802_11_ad_hoc(priv, resp); goto ldv_61242; case 64: ret = mwifiex_ret_802_11_ad_hoc_stop(priv, resp); goto ldv_61242; case 11: ret = mwifiex_ret_get_log(priv, resp, (struct mwifiex_ds_get_stats *)data_buf); goto ldv_61242; case 164: ret = mwifiex_ret_802_11_rssi_info(priv, resp); goto ldv_61242; case 22: ret = mwifiex_ret_802_11_snmp_mib(priv, resp, (u32 *)data_buf); goto ldv_61242; case 127: ret = mwifiex_ret_802_11_tx_rate_query(priv, resp); goto ldv_61242; case 151: ret = mwifiex_ret_ver_ext(priv, resp, (struct host_cmd_ds_version_ext *)data_buf); goto ldv_61242; case 269: ret = mwifiex_ret_remain_on_chan(priv, resp, (struct host_cmd_ds_remain_on_chan *)data_buf); goto ldv_61242; case 274: ; goto ldv_61242; case 235: ret = mwifiex_ret_p2p_mode_cfg(priv, resp, data_buf); goto ldv_61242; case 268: ; case 169: ; case 170: ; goto ldv_61242; case 94: ret = mwifiex_ret_802_11_key_material(priv, resp); goto ldv_61242; case 91: ret = mwifiex_ret_802_11d_domain_info(priv, resp); goto ldv_61242; case 206: ret = mwifiex_ret_11n_addba_req(priv, resp); goto ldv_61242; case 208: ret = mwifiex_ret_11n_delba(priv, resp); goto ldv_61242; case 207: ret = mwifiex_ret_11n_addba_resp(priv, resp); goto ldv_61242; case 217: adapter->tx_buf_size = resp->params.tx_buf.buff_size; adapter->tx_buf_size = (unsigned int )((u16 )((unsigned int )adapter->tx_buf_size / 256U)) * 256U; adapter->curr_tx_buf_size = adapter->tx_buf_size; if ((adapter->debug_mask & 16U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cmd: curr_tx_buf_size=%d\n", (int )adapter->curr_tx_buf_size); } else { } } else { } if ((unsigned long )adapter->if_ops.update_mp_end_port != (unsigned long )((void (*)(struct mwifiex_adapter * , u16 ))0)) { (*(adapter->if_ops.update_mp_end_port))(adapter, (int )resp->params.tx_buf.mp_end_port); } else { } goto ldv_61242; case 223: ; goto ldv_61242; case 113: ret = mwifiex_ret_wmm_get_status(priv, (struct host_cmd_ds_command const *)resp); goto ldv_61242; case 131: ret = mwifiex_ret_ibss_coalescing_status(priv, resp); goto ldv_61242; case 134: ret = mwifiex_ret_mem_access(priv, resp, data_buf); goto ldv_61242; case 25: ; case 26: ; case 27: ; case 173: ; case 237: ; case 89: ret = mwifiex_ret_reg_access((int )cmdresp_no, resp, data_buf); goto ldv_61242; case 247: ; goto ldv_61242; case 205: ; goto ldv_61242; case 250: ; goto ldv_61242; case 117: ret = mwifiex_ret_subsc_evt(priv, resp); goto ldv_61242; case 176: ; goto ldv_61242; case 179: ret = mwifiex_ret_uap_sta_list(priv, resp); goto ldv_61242; case 177: adapter->tx_lock_flag = 0U; adapter->pps_uapsd_mode = 0U; adapter->delay_null_pkt = 0U; priv->bss_started = 1U; goto ldv_61242; case 178: priv->bss_started = 0U; goto ldv_61242; case 181: ; goto ldv_61242; case 175: ; goto ldv_61242; case 154: ; goto ldv_61242; case 266: ; goto ldv_61242; case 290: ret = mwifiex_ret_tdls_oper(priv, resp); goto ldv_61242; case 221: ; goto ldv_61242; case 547: ret = mwifiex_ret_sdio_rx_aggr_cfg(priv, resp); goto ldv_61242; default: ; if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "CMD_RESP: unknown cmd response %#x\n", (int )resp->command); } else { } } else { } goto ldv_61242; } ldv_61242: ; return (ret); } } bool ldv_queue_work_on_271(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_272(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_273(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_274(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_275(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; int ldv_del_timer_290(struct timer_list *ldv_func_arg1 ) ; int ldv_del_timer_291(struct timer_list *ldv_func_arg1 ) ; bool ldv_queue_work_on_285(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_287(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_286(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_289(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_288(struct workqueue_struct *ldv_func_arg1 ) ; extern void cfg80211_michael_mic_failure(struct net_device * , u8 const * , enum nl80211_key_type , int , u8 const * , gfp_t ) ; extern void cfg80211_remain_on_channel_expired(struct wireless_dev * , u64 , struct ieee80211_channel * , gfp_t ) ; extern void cfg80211_cqm_rssi_notify(struct net_device * , enum nl80211_cqm_rssi_threshold_event , gfp_t ) ; extern void cfg80211_tdls_oper_request(struct net_device * , u8 const * , enum nl80211_tdls_operation , u16 , gfp_t ) ; __inline static void eth_zero_addr(u8 *addr ) { { memset((void *)addr, 0, 6UL); return; } } void mwifiex_bt_coex_wlan_param_update_event(struct mwifiex_private *priv , struct sk_buff *event_skb ) ; void mwifiex_disable_all_tdls_links(struct mwifiex_private *priv ) ; int mwifiex_11h_handle_chanrpt_ready(struct mwifiex_private *priv , struct sk_buff *skb ) ; int mwifiex_11h_handle_radar_detected(struct mwifiex_private *priv , struct sk_buff *skb ) ; void mwifiex_reset_connect_state(struct mwifiex_private *priv , u16 reason_code ) { struct mwifiex_adapter *adapter ; bool tmp ; { adapter = priv->adapter; if ((unsigned int )priv->media_connected == 0U) { return; } else { } if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: handles disconnect event\n"); } else { } } else { } priv->media_connected = 0U; priv->scan_block = 0U; if (((unsigned long )priv->bss_role & 1UL) == 0UL && ((unsigned long )(priv->adapter)->fw_cap_info & 16384UL) != 0UL) { mwifiex_disable_all_tdls_links(priv); if ((int )(priv->adapter)->auto_tdls) { mwifiex_clean_auto_tdls(priv); } else { } } else { } mwifiex_clean_txrx(priv); priv->data_rssi_last = 0; priv->data_nf_last = 0; priv->data_rssi_avg = 0; priv->data_nf_avg = 0; priv->bcn_rssi_last = 0; priv->bcn_nf_last = 0; priv->bcn_rssi_avg = 0; priv->bcn_nf_avg = 0; priv->rxpd_rate = 0U; priv->rxpd_htinfo = 0U; priv->sec_info.wpa_enabled = 0U; priv->sec_info.wpa2_enabled = 0U; priv->wpa_ie_len = 0U; priv->sec_info.wapi_enabled = 0U; priv->wapi_ie_len = 0U; priv->sec_info.wapi_key_on = 0U; priv->sec_info.encryption_mode = 0U; priv->is_data_rate_auto = 1U; priv->data_rate = 0U; if ((((unsigned long )priv->bss_role & 1UL) == 0UL || (int )priv->bss_role & 1) && (unsigned long )priv->hist_data != (unsigned long )((struct mwifiex_histogram_data *)0)) { mwifiex_hist_data_reset(priv); } else { } if (priv->bss_mode == 1U) { priv->adhoc_state = 0U; priv->adhoc_is_link_sensed = 0U; } else { } if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: previous SSID=%s, SSID len=%u\n", (u8 *)(& priv->prev_ssid.ssid), (int )priv->prev_ssid.ssid_len); } else { } } else { } if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: current SSID=%s, SSID len=%u\n", (u8 *)(& priv->curr_bss_params.bss_descriptor.ssid.ssid), (int )priv->curr_bss_params.bss_descriptor.ssid.ssid_len); } else { } } else { } memcpy((void *)(& priv->prev_ssid), (void const *)(& priv->curr_bss_params.bss_descriptor.ssid), 33UL); memcpy((void *)(& priv->prev_bssid), (void const *)(& priv->curr_bss_params.bss_descriptor.mac_address), 6UL); memset((void *)(& priv->curr_bss_params), 0, 360UL); adapter->tx_lock_flag = 0U; adapter->pps_uapsd_mode = 0U; if ((unsigned int )adapter->is_cmd_timedout != 0U && (unsigned long )adapter->curr_cmd != (unsigned long )((struct cmd_ctrl_node *)0)) { return; } else { } priv->media_connected = 0U; if ((int )adapter->debug_mask & 1) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: successfully disconnected from %pM: reason code %d\n", (u8 *)(& priv->cfg_bssid), (int )reason_code); } else { } } else { } if (priv->bss_mode == 2U || priv->bss_mode == 8U) { cfg80211_disconnected(priv->netdev, (int )reason_code, (u8 const *)0U, 0UL, 0, 208U); } else { } eth_zero_addr((u8 *)(& priv->cfg_bssid)); mwifiex_stop_net_dev_queue(priv->netdev, adapter); tmp = netif_carrier_ok((struct net_device const *)priv->netdev); if ((int )tmp) { netif_carrier_off(priv->netdev); } else { } return; } } static int mwifiex_parse_tdls_event(struct mwifiex_private *priv , struct sk_buff *event_skb ) { int ret ; struct mwifiex_adapter *adapter ; struct mwifiex_sta_node *sta_ptr ; struct mwifiex_tdls_generic_event *tdls_evt ; { ret = 0; adapter = priv->adapter; tdls_evt = (struct mwifiex_tdls_generic_event *)event_skb->data + 4U; if (event_skb->len <= 3U) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "Invalid event length!\n"); } else { } } else { } return (-1); } else { } sta_ptr = mwifiex_get_sta_entry(priv, (u8 const *)(& tdls_evt->peer_mac)); if ((unsigned long )sta_ptr == (unsigned long )((struct mwifiex_sta_node *)0)) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cannot get sta entry!\n"); } else { } } else { } return (-1); } else { } switch ((int )tdls_evt->type) { case 3: cfg80211_tdls_oper_request(priv->netdev, (u8 const *)(& tdls_evt->peer_mac), 2, (int )tdls_evt->u.reason_code, 208U); goto ldv_60951; default: ; goto ldv_60951; } ldv_60951: ; return (ret); } } void mwifiex_bt_coex_wlan_param_update_event(struct mwifiex_private *priv , struct sk_buff *event_skb ) { struct mwifiex_adapter *adapter ; struct mwifiex_ie_types_header *tlv ; struct mwifiex_ie_types_btcoex_aggr_win_size *winsizetlv ; struct mwifiex_ie_types_btcoex_scan_time *scantlv ; s32 len ; u8 *cur_ptr ; u16 tlv_type ; u16 tlv_len ; struct _ddebug descriptor ; long tmp ; { adapter = priv->adapter; len = (s32 )(event_skb->len - 4U); cur_ptr = event_skb->data + 4U; goto ldv_60971; ldv_60970: tlv = (struct mwifiex_ie_types_header *)cur_ptr; tlv_len = tlv->len; tlv_type = tlv->type; if ((unsigned long )tlv_len + 4UL > (unsigned long )len) { goto ldv_60965; } else { } switch ((int )tlv_type) { case 458: winsizetlv = (struct mwifiex_ie_types_btcoex_aggr_win_size *)tlv; adapter->coex_win_size = winsizetlv->coex_win_size; adapter->coex_tx_win_size = winsizetlv->tx_win_size; adapter->coex_rx_win_size = winsizetlv->rx_win_size; mwifiex_coex_ampdu_rxwinsize(adapter); mwifiex_update_ampdu_txwinsize(adapter); goto ldv_60967; case 459: scantlv = (struct mwifiex_ie_types_btcoex_scan_time *)tlv; adapter->coex_scan = scantlv->coex_scan; adapter->coex_min_scan_time = (u8 )scantlv->min_scan_time; adapter->coex_max_scan_time = (u8 )scantlv->max_scan_time; goto ldv_60967; default: ; goto ldv_60967; } ldv_60967: len = (s32 )(((unsigned int )len - (unsigned int )tlv_len) - 4U); cur_ptr = cur_ptr + ((unsigned long )tlv_len + 4UL); ldv_60971: ; if ((unsigned int )len > 3U) { goto ldv_60970; } else { } ldv_60965: descriptor.modname = "mwifiex"; descriptor.function = "mwifiex_bt_coex_wlan_param_update_event"; descriptor.filename = "/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/11944/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/mwifiex/sta_event.c"; descriptor.format = "coex_scan=%d min_scan=%d coex_win=%d, tx_win=%d rx_win=%d\n"; descriptor.lineno = 239U; descriptor.flags = 0U; tmp = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)adapter->dev, "coex_scan=%d min_scan=%d coex_win=%d, tx_win=%d rx_win=%d\n", (int )adapter->coex_scan, (int )adapter->coex_min_scan_time, (int )adapter->coex_win_size, (int )adapter->coex_tx_win_size, (int )adapter->coex_rx_win_size); } else { } return; } } int mwifiex_process_sta_event(struct mwifiex_private *priv ) { struct mwifiex_adapter *adapter ; int ret ; u32 eventcause ; u16 ctrl ; u16 reason_code ; bool tmp ; int tmp___0 ; int tmp___1 ; u8 tmp___2 ; bool tmp___3 ; u16 __min1 ; u16 __min2 ; unsigned long tmp___4 ; struct _ddebug descriptor ; long tmp___5 ; { adapter = priv->adapter; ret = 0; eventcause = adapter->event_cause; switch (eventcause) { case 1U: ; if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "invalid EVENT: DUMMY_HOST_WAKEUP_SIGNAL, ignore it\n"); } else { } } else { } goto ldv_60983; case 4U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: LINK_SENSED\n"); } else { } } else { } tmp = netif_carrier_ok((struct net_device const *)priv->netdev); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { netif_carrier_on(priv->netdev); } else { } mwifiex_wake_up_net_dev_queue(priv->netdev, adapter); goto ldv_60983; case 8U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: Deauthenticated\n"); } else { } } else { } if ((unsigned int )priv->wps.session_enable != 0U) { if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: receive deauth event in wps session\n"); } else { } } else { } goto ldv_60983; } else { } adapter->dbg.num_event_deauth = adapter->dbg.num_event_deauth + 1U; if ((unsigned int )priv->media_connected != 0U) { reason_code = *((__le16 *)(& adapter->event_body)); mwifiex_reset_connect_state(priv, (int )reason_code); } else { } goto ldv_60983; case 9U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: Disassociated\n"); } else { } } else { } if ((unsigned int )priv->wps.session_enable != 0U) { if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: receive disassoc event in wps session\n"); } else { } } else { } goto ldv_60983; } else { } adapter->dbg.num_event_disassoc = adapter->dbg.num_event_disassoc + 1U; if ((unsigned int )priv->media_connected != 0U) { reason_code = *((__le16 *)(& adapter->event_body)); mwifiex_reset_connect_state(priv, (int )reason_code); } else { } goto ldv_60983; case 3U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: Link lost\n"); } else { } } else { } adapter->dbg.num_event_link_lost = adapter->dbg.num_event_link_lost + 1U; if ((unsigned int )priv->media_connected != 0U) { reason_code = *((__le16 *)(& adapter->event_body)); mwifiex_reset_connect_state(priv, (int )reason_code); } else { } goto ldv_60983; case 11U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: EVENT: SLEEP\n"); } else { } } else { } adapter->ps_state = 1U; mwifiex_check_ps_cond(adapter); goto ldv_60983; case 10U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: EVENT: AWAKE\n"); } else { } } else { } if (((unsigned int )adapter->pps_uapsd_mode == 0U && (unsigned int )priv->media_connected != 0U) && (unsigned int )adapter->sleep_period.period != 0U) { adapter->pps_uapsd_mode = 1U; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: PPS/UAPSD mode activated\n"); } else { } } else { } } else { } adapter->tx_lock_flag = 0U; if ((unsigned int )adapter->pps_uapsd_mode != 0U && (unsigned int )adapter->gen_null_pkt != 0U) { tmp___2 = mwifiex_check_last_packet_indication(priv); if ((unsigned int )tmp___2 != 0U) { if ((unsigned int )adapter->data_sent != 0U) { adapter->ps_state = 0U; adapter->pm_wakeup_card_req = 0U; adapter->pm_wakeup_fw_try = 0U; ldv_del_timer_290(& adapter->wakeup_timer); goto ldv_60983; } else { } tmp___1 = mwifiex_send_null_packet(priv, 9); if (tmp___1 == 0) { adapter->ps_state = 3U; } else { } return (0); } else { } } else { } adapter->ps_state = 0U; adapter->pm_wakeup_card_req = 0U; adapter->pm_wakeup_fw_try = 0U; ldv_del_timer_291(& adapter->wakeup_timer); goto ldv_60983; case 16U: (*(adapter->if_ops.wakeup_complete))(adapter); if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: DS_AWAKE\n"); } else { } } else { } if ((unsigned int )adapter->is_deep_sleep != 0U) { adapter->is_deep_sleep = 0U; } else { } goto ldv_60983; case 71U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: HS_ACT_REQ\n"); } else { } } else { } ret = mwifiex_send_cmd(priv, 229, 0, 0U, (void *)0, 0); goto ldv_60983; case 14U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: UNICAST MIC OLD_ERROR\n"); } else { } } else { } cfg80211_michael_mic_failure(priv->netdev, (u8 const *)(& priv->cfg_bssid), 1, -1, (u8 const *)0U, 208U); goto ldv_60983; case 13U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: MULTICAST MIC OLD_ERROR\n"); } else { } } else { } cfg80211_michael_mic_failure(priv->netdev, (u8 const *)(& priv->cfg_bssid), 0, -1, (u8 const *)0U, 208U); goto ldv_60983; case 6U: ; case 7U: ; goto ldv_60983; case 17U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: ADHOC_BCN_LOST\n"); } else { } } else { } priv->adhoc_is_link_sensed = 0U; mwifiex_clean_txrx(priv); mwifiex_stop_net_dev_queue(priv->netdev, adapter); tmp___3 = netif_carrier_ok((struct net_device const *)priv->netdev); if ((int )tmp___3) { netif_carrier_off(priv->netdev); } else { } goto ldv_60983; case 24U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: BGS_REPORT\n"); } else { } } else { } ret = mwifiex_send_cmd(priv, 108, 0, 0U, (void *)0, 0); goto ldv_60983; case 43U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: PORT RELEASE\n"); } else { } } else { } goto ldv_60983; case 88U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: EXT_SCAN Report\n"); } else { } } else { } if ((int )adapter->ext_scan) { ret = mwifiex_handle_event_ext_scan_report(priv, (void *)(adapter->event_skb)->data); } else { } goto ldv_60983; case 23U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: WMM status changed\n"); } else { } } else { } ret = mwifiex_send_cmd(priv, 113, 0, 0U, (void *)0, 0); goto ldv_60983; case 25U: cfg80211_cqm_rssi_notify(priv->netdev, 0, 208U); mwifiex_send_cmd(priv, 164, 0, 0U, (void *)0, 0); priv->subsc_evt_rssi_state = 1U; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: Beacon RSSI_LOW\n"); } else { } } else { } goto ldv_60983; case 26U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: Beacon SNR_LOW\n"); } else { } } else { } goto ldv_60983; case 27U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: MAX_FAIL\n"); } else { } } else { } goto ldv_60983; case 28U: cfg80211_cqm_rssi_notify(priv->netdev, 1, 208U); mwifiex_send_cmd(priv, 164, 0, 0U, (void *)0, 0); priv->subsc_evt_rssi_state = 2U; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: Beacon RSSI_HIGH\n"); } else { } } else { } goto ldv_60983; case 29U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: Beacon SNR_HIGH\n"); } else { } } else { } goto ldv_60983; case 36U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: Data RSSI_LOW\n"); } else { } } else { } goto ldv_60983; case 37U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: Data SNR_LOW\n"); } else { } } else { } goto ldv_60983; case 38U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: Data RSSI_HIGH\n"); } else { } } else { } goto ldv_60983; case 39U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: Data SNR_HIGH\n"); } else { } } else { } goto ldv_60983; case 40U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: Link Quality\n"); } else { } } else { } goto ldv_60983; case 49U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: Pre-Beacon Lost\n"); } else { } } else { } goto ldv_60983; case 30U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: IBSS_COALESCED\n"); } else { } } else { } ret = mwifiex_send_cmd(priv, 131, 0, 0U, (void *)0, 0); goto ldv_60983; case 51U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: ADDBA Request\n"); } else { } } else { } mwifiex_send_cmd(priv, 207, 1, 0U, (void *)(& adapter->event_body), 0); goto ldv_60983; case 52U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: DELBA Request\n"); } else { } } else { } mwifiex_11n_delete_ba_stream(priv, (u8 *)(& adapter->event_body)); goto ldv_60983; case 55U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: BA Stream timeout\n"); } else { } } else { } mwifiex_11n_ba_stream_timeout(priv, (struct host_cmd_ds_11n_batimeout *)(& adapter->event_body)); goto ldv_60983; case 66U: ctrl = *((__le16 *)(& adapter->event_body)); if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: AMSDU_AGGR_CTRL %d\n", (int )ctrl); } else { } } else { } __min1 = adapter->curr_tx_buf_size; __min2 = ctrl; adapter->tx_buf_size = (u16 )((int )__min1 < (int )__min2 ? __min1 : __min2); if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: tx_buf_size %d\n", (int )adapter->tx_buf_size); } else { } } else { } goto ldv_60983; case 70U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: WEP ICV error\n"); } else { } } else { } goto ldv_60983; case 72U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: BW Change\n"); } else { } } else { } goto ldv_60983; case 77U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: HOSTWAKE_STAIE %d\n", eventcause); } else { } } else { } goto ldv_60983; case 95U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: Remain on channel expired\n"); } else { } } else { } cfg80211_remain_on_channel_expired(& priv->wdev, priv->roc_cfg.cookie, & priv->roc_cfg.chan, 32U); memset((void *)(& priv->roc_cfg), 0, 72UL); goto ldv_60983; case 80U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: Channel Switch Announcement\n"); } else { } } else { } tmp___4 = msecs_to_jiffies(10000U); priv->csa_expire_time = tmp___4 + (unsigned long )jiffies; priv->csa_chan = (u8 )priv->curr_bss_params.bss_descriptor.channel; ret = mwifiex_send_cmd(priv, 36, 1, 0U, (void *)(& priv->curr_bss_params.bss_descriptor.mac_address), 0); goto ldv_60983; case 82U: ret = mwifiex_parse_tdls_event(priv, adapter->event_skb); goto ldv_60983; case 116U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: TX_STATUS Report\n"); } else { } } else { } mwifiex_parse_tx_status_event(priv, (void *)(& adapter->event_body)); goto ldv_60983; case 84U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: Channel Report\n"); } else { } } else { } ret = mwifiex_11h_handle_chanrpt_ready(priv, adapter->event_skb); goto ldv_60983; case 83U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: Radar detected\n"); } else { } } else { } ret = mwifiex_11h_handle_radar_detected(priv, adapter->event_skb); goto ldv_60983; case 118U: descriptor.modname = "mwifiex"; descriptor.function = "mwifiex_process_sta_event"; descriptor.filename = "/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/11944/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/mwifiex/sta_event.c"; descriptor.format = "EVENT: BT coex wlan param update\n"; descriptor.lineno = 592U; descriptor.flags = 0U; tmp___5 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___5 != 0L) { __dynamic_dev_dbg(& descriptor, (struct device const *)adapter->dev, "EVENT: BT coex wlan param update\n"); } else { } mwifiex_bt_coex_wlan_param_update_event(priv, adapter->event_skb); goto ldv_60983; default: ; if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: unknown event id: %#x\n", eventcause); } else { } } else { } goto ldv_60983; } ldv_60983: ; return (ret); } } bool ldv_queue_work_on_285(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_286(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_287(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_288(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_289(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } int ldv_del_timer_290(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___3 ldv_func_res ; int tmp ; { tmp = del_timer(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_7(ldv_func_arg1); return (ldv_func_res); } } int ldv_del_timer_291(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___4 ldv_func_res ; int tmp ; { tmp = del_timer(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_7(ldv_func_arg1); return (ldv_func_res); } } bool ldv_queue_work_on_303(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_305(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_304(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_307(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_306(struct workqueue_struct *ldv_func_arg1 ) ; __inline static int ieee80211_is_assoc_req(__le16 fc ) { { return (((int )fc & 252) == 0); } } __inline static int ieee80211_is_reassoc_req(__le16 fc ) { { return (((int )fc & 252) == 32); } } extern void cfg80211_new_sta(struct net_device * , u8 const * , struct station_info * , gfp_t ) ; extern void cfg80211_del_sta_sinfo(struct net_device * , u8 const * , struct station_info * , gfp_t ) ; __inline static void cfg80211_del_sta(struct net_device *dev , u8 const *mac_addr , gfp_t gfp ) { { cfg80211_del_sta_sinfo(dev, mac_addr, (struct station_info *)0, gfp); return; } } void mwifiex_uap_del_sta_data(struct mwifiex_private *priv , struct mwifiex_sta_node *node ) ; static int mwifiex_check_uap_capabilties(struct mwifiex_private *priv , struct sk_buff *event ) { int evt_len ; u8 *curr ; u16 tlv_len ; struct mwifiex_ie_types_data *tlv_hdr ; struct ieee_types_wmm_parameter *wmm_param_ie ; int mask ; { wmm_param_ie = (struct ieee_types_wmm_parameter *)0; mask = 15; priv->wmm_enabled = 0U; skb_pull(event, 12U); evt_len = (int )event->len; curr = event->data; if (((priv->adapter)->debug_mask & 262144U) != 0U) { print_hex_dump("\017", "uap capabilties:", 2, 16, 1, (void const *)event->data, (size_t )event->len, 0); } else { } goto ldv_60946; ldv_60945: tlv_hdr = (struct mwifiex_ie_types_data *)curr; tlv_len = tlv_hdr->header.len; if ((unsigned long )evt_len < (unsigned long )tlv_len + 4UL) { goto ldv_60939; } else { } switch ((int )tlv_hdr->header.type) { case 45: priv->ap_11n_enabled = 1U; goto ldv_60941; case 191: priv->ap_11ac_enabled = 1U; goto ldv_60941; case 221: wmm_param_ie = (struct ieee_types_wmm_parameter *)curr + 2U; wmm_param_ie->vend_hdr.len = (unsigned char )tlv_len; wmm_param_ie->vend_hdr.element_id = 221U; if (((priv->adapter)->debug_mask & 32U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: check uap capabilities:\twmm parameter set count: %d\n", (int )wmm_param_ie->qos_info_bitmap & mask); } else { } } else { } mwifiex_wmm_setup_ac_downgrade(priv); priv->wmm_enabled = 1U; mwifiex_wmm_setup_queue_priorities(priv, wmm_param_ie); goto ldv_60941; default: ; goto ldv_60941; } ldv_60941: curr = curr + ((unsigned long )tlv_len + 4UL); evt_len = (int )(((unsigned int )evt_len - (unsigned int )tlv_len) - 4U); ldv_60946: ; if ((unsigned int )evt_len > 3U) { goto ldv_60945; } else { } ldv_60939: ; return (0); } } int mwifiex_process_uap_event(struct mwifiex_private *priv ) { struct mwifiex_adapter *adapter ; int len ; int i ; u32 eventcause ; struct station_info sinfo ; struct mwifiex_assoc_event *event ; struct mwifiex_sta_node *node ; u8 *deauth_mac ; struct host_cmd_ds_11n_batimeout *ba_timeout ; u16 ctrl ; int tmp ; int tmp___0 ; bool tmp___1 ; bool tmp___2 ; int tmp___3 ; u16 __min1 ; u16 __min2 ; int tmp___4 ; int tmp___5 ; u8 tmp___6 ; { adapter = priv->adapter; eventcause = adapter->event_cause; switch (eventcause) { case 45U: memset((void *)(& sinfo), 0, 840UL); event = (struct mwifiex_assoc_event *)(& adapter->event_body) + 2U; if ((unsigned int )event->type == 360U) { len = -1; tmp___0 = ieee80211_is_assoc_req((int )event->frame_control); if (tmp___0 != 0) { len = 0; } else { tmp = ieee80211_is_reassoc_req((int )event->frame_control); if (tmp != 0) { len = 6; } else { } } if (len != -1) { sinfo.assoc_req_ies = (u8 const *)(& event->data) + (unsigned long )len; len = (int )((unsigned int )((long )sinfo.assoc_req_ies) - (unsigned int )((long )(& event->frame_control))); sinfo.assoc_req_ies_len = (size_t )((int )event->len - (int )((unsigned short )len)); } else { } } else { } cfg80211_new_sta(priv->netdev, (u8 const *)(& event->sta_addr), & sinfo, 208U); node = mwifiex_add_sta_entry(priv, (u8 const *)(& event->sta_addr)); if ((unsigned long )node == (unsigned long )((struct mwifiex_sta_node *)0)) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "could not create station entry!\n"); } else { } } else { } return (-1); } else { } if ((unsigned int )priv->ap_11n_enabled == 0U) { goto ldv_60961; } else { } mwifiex_set_sta_ht_cap(priv, sinfo.assoc_req_ies, (int )sinfo.assoc_req_ies_len, node); i = 0; goto ldv_60963; ldv_60962: ; if ((unsigned int )node->is_11n_enabled != 0U) { node->ampdu_sta[i] = priv->aggr_prio_tbl[i].ampdu_user; } else { node->ampdu_sta[i] = 255U; } i = i + 1; ldv_60963: ; if (i <= 7) { goto ldv_60962; } else { } memset((void *)(& node->rx_seq), 255, 16UL); goto ldv_60961; case 44U: deauth_mac = (u8 *)(& adapter->event_body) + 2UL; cfg80211_del_sta(priv->netdev, (u8 const *)deauth_mac, 208U); if ((unsigned int )priv->ap_11n_enabled != 0U) { mwifiex_11n_del_rx_reorder_tbl_by_ta(priv, deauth_mac); mwifiex_del_tx_ba_stream_tbl_by_ra(priv, deauth_mac); } else { } mwifiex_wmm_del_peer_ra_list(priv, (u8 const *)deauth_mac); mwifiex_del_sta_entry(priv, (u8 const *)deauth_mac); goto ldv_60961; case 67U: priv->media_connected = 0U; tmp___1 = netif_carrier_ok((struct net_device const *)priv->netdev); if ((int )tmp___1) { netif_carrier_off(priv->netdev); } else { } mwifiex_stop_net_dev_queue(priv->netdev, adapter); mwifiex_clean_txrx(priv); mwifiex_del_all_sta_list(priv); goto ldv_60961; case 68U: priv->media_connected = 1U; tmp___2 = netif_carrier_ok((struct net_device const *)priv->netdev); if (tmp___2) { tmp___3 = 0; } else { tmp___3 = 1; } if (tmp___3) { netif_carrier_on(priv->netdev); } else { } mwifiex_wake_up_net_dev_queue(priv->netdev, adapter); goto ldv_60961; case 46U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "AP EVENT: event id: %#x\n", eventcause); } else { } } else { } memcpy((void *)(priv->netdev)->dev_addr, (void const *)(& adapter->event_body) + 2U, 6UL); if ((unsigned long )priv->hist_data != (unsigned long )((struct mwifiex_histogram_data *)0)) { mwifiex_hist_data_reset(priv); } else { } mwifiex_check_uap_capabilties(priv, adapter->event_skb); goto ldv_60961; case 76U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "AP EVENT: event id: %#x\n", eventcause); } else { } } else { } goto ldv_60961; case 66U: ctrl = *((__le16 *)(& adapter->event_body)); if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: AMSDU_AGGR_CTRL %d\n", (int )ctrl); } else { } } else { } if ((unsigned int )priv->media_connected != 0U) { __min1 = adapter->curr_tx_buf_size; __min2 = ctrl; adapter->tx_buf_size = (u16 )((int )__min1 < (int )__min2 ? __min1 : __min2); if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: tx_buf_size %d\n", (int )adapter->tx_buf_size); } else { } } else { } } else { } goto ldv_60961; case 51U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: ADDBA Request\n"); } else { } } else { } if ((unsigned int )priv->media_connected != 0U) { mwifiex_send_cmd(priv, 207, 1, 0U, (void *)(& adapter->event_body), 0); } else { } goto ldv_60961; case 52U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: DELBA Request\n"); } else { } } else { } if ((unsigned int )priv->media_connected != 0U) { mwifiex_11n_delete_ba_stream(priv, (u8 *)(& adapter->event_body)); } else { } goto ldv_60961; case 55U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: BA Stream timeout\n"); } else { } } else { } if ((unsigned int )priv->media_connected != 0U) { ba_timeout = (struct host_cmd_ds_11n_batimeout *)(& adapter->event_body); mwifiex_11n_ba_stream_timeout(priv, ba_timeout); } else { } goto ldv_60961; case 88U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: EXT_SCAN Report\n"); } else { } } else { } if ((int )adapter->ext_scan) { tmp___4 = mwifiex_handle_event_ext_scan_report(priv, (void *)(adapter->event_skb)->data); return (tmp___4); } else { } goto ldv_60961; case 116U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: TX_STATUS Report\n"); } else { } } else { } mwifiex_parse_tx_status_event(priv, (void *)(& adapter->event_body)); goto ldv_60961; case 11U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: EVENT: SLEEP\n"); } else { } } else { } adapter->ps_state = 1U; mwifiex_check_ps_cond(adapter); goto ldv_60961; case 10U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: EVENT: AWAKE\n"); } else { } } else { } if (((unsigned int )adapter->pps_uapsd_mode == 0U && (unsigned int )priv->media_connected != 0U) && (unsigned int )adapter->sleep_period.period != 0U) { adapter->pps_uapsd_mode = 1U; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: PPS/UAPSD mode activated\n"); } else { } } else { } } else { } adapter->tx_lock_flag = 0U; if ((unsigned int )adapter->pps_uapsd_mode != 0U && (unsigned int )adapter->gen_null_pkt != 0U) { tmp___6 = mwifiex_check_last_packet_indication(priv); if ((unsigned int )tmp___6 != 0U) { if ((unsigned int )adapter->data_sent != 0U) { adapter->ps_state = 0U; adapter->pm_wakeup_card_req = 0U; adapter->pm_wakeup_fw_try = 0U; goto ldv_60961; } else { } tmp___5 = mwifiex_send_null_packet(priv, 9); if (tmp___5 == 0) { adapter->ps_state = 3U; } else { } return (0); } else { } } else { } adapter->ps_state = 0U; adapter->pm_wakeup_card_req = 0U; adapter->pm_wakeup_fw_try = 0U; goto ldv_60961; case 84U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: Channel Report\n"); } else { } } else { } mwifiex_11h_handle_chanrpt_ready(priv, adapter->event_skb); goto ldv_60961; case 83U: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: Radar detected\n"); } else { } } else { } mwifiex_11h_handle_radar_detected(priv, adapter->event_skb); goto ldv_60961; case 118U: dev_err((struct device const *)adapter->dev, "EVENT: BT coex wlan param update\n"); mwifiex_bt_coex_wlan_param_update_event(priv, adapter->event_skb); goto ldv_60961; default: ; if ((adapter->debug_mask & 32U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "event: unknown event id: %#x\n", eventcause); } else { } } else { } goto ldv_60961; } ldv_60961: ; return (0); } } void mwifiex_uap_del_sta_data(struct mwifiex_private *priv , struct mwifiex_sta_node *node ) { { if ((unsigned int )priv->ap_11n_enabled != 0U && (unsigned int )node->is_11n_enabled != 0U) { mwifiex_11n_del_rx_reorder_tbl_by_ta(priv, (u8 *)(& node->mac_addr)); mwifiex_del_tx_ba_stream_tbl_by_ra(priv, (u8 *)(& node->mac_addr)); } else { } mwifiex_del_sta_entry(priv, (u8 const *)(& node->mac_addr)); return; } } bool ldv_queue_work_on_303(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_304(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_305(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_306(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_307(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; bool ldv_queue_work_on_317(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_319(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_318(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_321(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_320(struct workqueue_struct *ldv_func_arg1 ) ; void *mwifiex_process_sta_txpd(struct mwifiex_private *priv , struct sk_buff *skb ) { struct mwifiex_adapter *adapter ; struct txpd *local_tx_pd ; struct mwifiex_txinfo *tx_info ; struct mwifiex_txinfo *tmp ; unsigned int pad ; u16 pkt_type ; u16 pkt_offset ; int hroom ; unsigned int tmp___0 ; long tmp___1 ; bool tmp___2 ; u8 tmp___3 ; { adapter = priv->adapter; tmp = MWIFIEX_SKB_TXCB(skb); tx_info = tmp; hroom = (unsigned int )(priv->adapter)->iface_type == 2U ? 0 : 4; if (skb->len == 0U) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "Tx: bad packet length: %d\n", skb->len); } else { } } else { } tx_info->status_code = 4294967295U; return ((void *)skb->data); } else { } tmp___0 = skb_headroom((struct sk_buff const *)skb); tmp___1 = ldv__builtin_expect(tmp___0 <= 99U, 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/11944/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/mwifiex/sta_tx.c"), "i" (62), "i" (12UL)); ldv_60758: ; goto ldv_60758; } else { } tmp___2 = mwifiex_is_skb_mgmt_frame(skb); pkt_type = (int )tmp___2 ? 229U : 0U; pad = (unsigned int )((long )((void *)skb->data + - ((unsigned long )hroom + 20UL))) & 63U; skb_push(skb, pad + 20U); local_tx_pd = (struct txpd *)skb->data; memset((void *)local_tx_pd, 0, 20UL); local_tx_pd->bss_num = priv->bss_num; local_tx_pd->bss_type = priv->bss_type; local_tx_pd->tx_pkt_length = (unsigned int )((int )((unsigned short )skb->len) - (int )((unsigned short )pad)) - 20U; local_tx_pd->priority = (unsigned char )skb->priority; local_tx_pd->pkt_delay_2ms = mwifiex_wmm_compute_drv_pkt_delay(priv, (struct sk_buff const *)skb); if (((unsigned long )tx_info->flags & 8UL) != 0UL || ((unsigned long )tx_info->flags & 16UL) != 0UL) { local_tx_pd->tx_token_id = tx_info->ack_frame_id; local_tx_pd->flags = (u8 )((unsigned int )local_tx_pd->flags | 32U); } else { } if ((unsigned int )local_tx_pd->priority <= 7U) { local_tx_pd->tx_control = priv->wmm.user_pri_pkt_tx_ctrl[(int )local_tx_pd->priority]; } else { } if ((unsigned int )adapter->pps_uapsd_mode != 0U) { tmp___3 = mwifiex_check_last_packet_indication(priv); if ((unsigned int )tmp___3 != 0U) { adapter->tx_lock_flag = 1U; local_tx_pd->flags = 8U; } else { } } else { } if (((unsigned long )tx_info->flags & 4UL) != 0UL) { local_tx_pd->flags = (u8 )((unsigned int )local_tx_pd->flags | 16U); } else { } pkt_offset = (unsigned int )((u16 )pad) + 20U; if ((unsigned int )pkt_type == 229U) { local_tx_pd->tx_pkt_type = pkt_type; pkt_offset = (unsigned int )pkt_offset + 8U; } else { } local_tx_pd->tx_pkt_offset = pkt_offset; skb_push(skb, (unsigned int )hroom); if (local_tx_pd->tx_control == 0U) { local_tx_pd->tx_control = priv->pkt_tx_ctrl; } else { } return ((void *)skb->data); } } int mwifiex_send_null_packet(struct mwifiex_private *priv , u8 flags ) { struct mwifiex_adapter *adapter ; struct txpd *local_tx_pd ; struct mwifiex_tx_param tx_param ; u32 data_len ; struct sk_buff *skb ; int ret ; struct mwifiex_txinfo *tx_info ; { adapter = priv->adapter; data_len = 64U; tx_info = (struct mwifiex_txinfo *)0; if ((int )adapter->surprise_removed) { return (-1); } else { } if ((unsigned int )priv->media_connected == 0U) { return (-1); } else { } if ((unsigned int )adapter->data_sent != 0U) { return (-1); } else { } skb = dev_alloc_skb(data_len); if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { return (-1); } else { } tx_info = MWIFIEX_SKB_TXCB(skb); memset((void *)tx_info, 0, 24UL); tx_info->bss_num = priv->bss_num; tx_info->bss_type = priv->bss_type; tx_info->pkt_len = data_len - 24U; skb_reserve(skb, 24); skb_push(skb, 20U); local_tx_pd = (struct txpd *)skb->data; local_tx_pd->tx_control = priv->pkt_tx_ctrl; local_tx_pd->flags = flags; local_tx_pd->priority = 7U; local_tx_pd->tx_pkt_offset = 20U; local_tx_pd->bss_num = priv->bss_num; local_tx_pd->bss_type = priv->bss_type; if ((unsigned int )adapter->iface_type == 2U) { ret = (*(adapter->if_ops.host_to_card))(adapter, 2, skb, (struct mwifiex_tx_param *)0); } else { skb_push(skb, 4U); tx_param.next_pkt_len = 0U; ret = (*(adapter->if_ops.host_to_card))(adapter, 0, skb, & tx_param); } switch (ret) { case -16: dev_kfree_skb_any(skb); if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "%s: host_to_card failed: ret=%d\n", "mwifiex_send_null_packet", ret); } else { } } else { } adapter->dbg.num_tx_host_to_card_failure = adapter->dbg.num_tx_host_to_card_failure + 1U; goto ldv_60774; case -1: adapter->data_sent = 0U; dev_kfree_skb_any(skb); if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "%s: host_to_card failed: ret=%d\n", "mwifiex_send_null_packet", ret); } else { } } else { } adapter->dbg.num_tx_host_to_card_failure = adapter->dbg.num_tx_host_to_card_failure + 1U; goto ldv_60774; case 0: dev_kfree_skb_any(skb); if ((adapter->debug_mask & 8U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "data: %s: host_to_card succeeded\n", "mwifiex_send_null_packet"); } else { } } else { } adapter->tx_lock_flag = 1U; goto ldv_60774; case -115: adapter->tx_lock_flag = 1U; goto ldv_60774; default: ; goto ldv_60774; } ldv_60774: ; return (ret); } } u8 mwifiex_check_last_packet_indication(struct mwifiex_private *priv ) { struct mwifiex_adapter *adapter ; u8 ret ; int tmp ; int tmp___0 ; { adapter = priv->adapter; ret = 0U; if ((unsigned int )adapter->sleep_period.period == 0U) { return (ret); } else { } tmp = mwifiex_wmm_lists_empty(adapter); if (tmp != 0) { ret = 1U; } else { } if (((unsigned int )ret != 0U && (unsigned int )adapter->cmd_sent == 0U) && (unsigned long )adapter->curr_cmd == (unsigned long )((struct cmd_ctrl_node *)0)) { tmp___0 = is_command_pending(adapter); if (tmp___0 == 0) { adapter->delay_null_pkt = 0U; ret = 1U; } else { ret = 0U; adapter->delay_null_pkt = 1U; } } else { ret = 0U; adapter->delay_null_pkt = 1U; } return (ret); } } bool ldv_queue_work_on_317(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_318(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_319(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_320(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_321(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_331(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_333(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_332(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_335(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_334(struct workqueue_struct *ldv_func_arg1 ) ; extern unsigned char const rfc1042_header[6U] ; extern unsigned char const bridge_tunnel_header[6U] ; void mwifiex_process_tdls_action_frame(struct mwifiex_private *priv , u8 *buf , int len ) ; static bool mwifiex_discard_gratuitous_arp(struct mwifiex_private *priv , struct sk_buff *skb ) { struct mwifiex_arp_eth_header const *arp ; struct ethhdr *eth ; struct ipv6hdr *ipv6 ; struct icmp6hdr *icmpv6 ; __u16 tmp ; int tmp___0 ; int tmp___1 ; { eth = (struct ethhdr *)skb->data; tmp = __fswab16((int )eth->h_proto); switch ((int )tmp) { case 2054: arp = (struct mwifiex_arp_eth_header const *)skb->data + 14U; if ((unsigned int )((unsigned short )arp->hdr.ar_op) == 512U || (unsigned int )((unsigned short )arp->hdr.ar_op) == 256U) { tmp___0 = memcmp((void const *)(& arp->ar_sip), (void const *)(& arp->ar_tip), 4UL); if (tmp___0 == 0) { return (1); } else { } } else { } goto ldv_61030; case 34525: ipv6 = (struct ipv6hdr *)skb->data + 14U; icmpv6 = (struct icmp6hdr *)skb->data + 54U; if ((unsigned int )icmpv6->icmp6_type == 136U) { tmp___1 = memcmp((void const *)(& ipv6->saddr), (void const *)(& ipv6->daddr), 16UL); if (tmp___1 == 0) { return (1); } else { } } else { } goto ldv_61030; default: ; goto ldv_61030; } ldv_61030: ; return (0); } } int mwifiex_process_rx_packet(struct mwifiex_private *priv , struct sk_buff *skb ) { int ret ; struct rx_packet_hdr *rx_pkt_hdr ; struct rxpd *local_rx_pd ; int hdr_chop ; struct ethhdr *eth ; u16 rx_pkt_off ; u16 rx_pkt_len ; u8 *offset ; u8 adj_rx_rate ; int tmp ; int tmp___0 ; __u16 tmp___1 ; __u16 tmp___2 ; bool tmp___3 ; __u16 tmp___4 ; { adj_rx_rate = 0U; local_rx_pd = (struct rxpd *)skb->data; rx_pkt_off = local_rx_pd->rx_pkt_offset; rx_pkt_len = local_rx_pd->rx_pkt_length; rx_pkt_hdr = (struct rx_packet_hdr *)local_rx_pd + (unsigned long )rx_pkt_off; tmp = memcmp((void const *)(& rx_pkt_hdr->rfc1042_hdr), (void const *)(& bridge_tunnel_header), 6UL); if (tmp == 0) { eth = & rx_pkt_hdr->eth803_hdr + 8U; memcpy((void *)(& eth->h_source), (void const *)(& rx_pkt_hdr->eth803_hdr.h_source), 6UL); memcpy((void *)(& eth->h_dest), (void const *)(& rx_pkt_hdr->eth803_hdr.h_dest), 6UL); hdr_chop = (int )((unsigned int )((long )eth) - (unsigned int )((long )local_rx_pd)); } else { tmp___0 = memcmp((void const *)(& rx_pkt_hdr->rfc1042_hdr), (void const *)(& rfc1042_header), 6UL); if (tmp___0 == 0) { tmp___1 = __fswab16((int )rx_pkt_hdr->rfc1042_hdr.snap_type); if ((unsigned int )tmp___1 != 33011U) { tmp___2 = __fswab16((int )rx_pkt_hdr->rfc1042_hdr.snap_type); if ((unsigned int )tmp___2 != 33079U) { eth = & rx_pkt_hdr->eth803_hdr + 8U; memcpy((void *)(& eth->h_source), (void const *)(& rx_pkt_hdr->eth803_hdr.h_source), 6UL); memcpy((void *)(& eth->h_dest), (void const *)(& rx_pkt_hdr->eth803_hdr.h_dest), 6UL); hdr_chop = (int )((unsigned int )((long )eth) - (unsigned int )((long )local_rx_pd)); } else { hdr_chop = (int )((unsigned int )((long )(& rx_pkt_hdr->eth803_hdr)) - (unsigned int )((long )local_rx_pd)); } } else { hdr_chop = (int )((unsigned int )((long )(& rx_pkt_hdr->eth803_hdr)) - (unsigned int )((long )local_rx_pd)); } } else { hdr_chop = (int )((unsigned int )((long )(& rx_pkt_hdr->eth803_hdr)) - (unsigned int )((long )local_rx_pd)); } } skb_pull(skb, (unsigned int )hdr_chop); if ((int )priv->hs2_enabled) { tmp___3 = mwifiex_discard_gratuitous_arp(priv, skb); if ((int )tmp___3) { if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Bypassed Gratuitous ARP\n"); } else { } } else { } dev_kfree_skb_any(skb); return (0); } else { } } else { } if (((unsigned long )(priv->adapter)->fw_cap_info & 16384UL) != 0UL) { tmp___4 = __fswab16((int )rx_pkt_hdr->eth803_hdr.h_proto); if ((unsigned int )tmp___4 == 35085U) { offset = (u8 *)local_rx_pd + (unsigned long )rx_pkt_off; mwifiex_process_tdls_action_frame(priv, offset, (int )rx_pkt_len); } else { } } else { } priv->rxpd_rate = local_rx_pd->rx_rate; priv->rxpd_htinfo = local_rx_pd->ht_info; if (((unsigned long )priv->bss_role & 1UL) == 0UL || (int )priv->bss_role & 1) { adj_rx_rate = mwifiex_adjust_data_rate(priv, (int )priv->rxpd_rate, (int )priv->rxpd_htinfo); mwifiex_hist_data_add(priv, (int )adj_rx_rate, (int )local_rx_pd->snr, (int )local_rx_pd->nf); } else { } ret = mwifiex_recv_packet(priv, skb); if (ret == -1) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "recv packet failed\n"); } else { } } else { } } else { } return (ret); } } int mwifiex_process_sta_rx_packet(struct mwifiex_private *priv , struct sk_buff *skb ) { struct mwifiex_adapter *adapter ; int ret ; struct rxpd *local_rx_pd ; struct rx_packet_hdr *rx_pkt_hdr ; u8 ta[6U] ; u16 rx_pkt_type ; u16 rx_pkt_offset ; u16 rx_pkt_length ; u16 seq_num ; struct mwifiex_sta_node *sta_ptr ; bool tmp ; int tmp___0 ; u8 tmp___1 ; { adapter = priv->adapter; ret = 0; local_rx_pd = (struct rxpd *)skb->data; rx_pkt_type = local_rx_pd->rx_pkt_type; rx_pkt_offset = local_rx_pd->rx_pkt_offset; rx_pkt_length = local_rx_pd->rx_pkt_length; seq_num = local_rx_pd->seq_num; rx_pkt_hdr = (struct rx_packet_hdr *)local_rx_pd + (unsigned long )rx_pkt_offset; if ((int )rx_pkt_offset + (int )rx_pkt_length > (int )((unsigned short )skb->len)) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "wrong rx packet: len=%d, rx_pkt_offset=%d, rx_pkt_length=%d\n", skb->len, (int )rx_pkt_offset, (int )rx_pkt_length); } else { } } else { } priv->stats.rx_dropped = priv->stats.rx_dropped + 1UL; dev_kfree_skb_any(skb); return (ret); } else { } if ((unsigned int )rx_pkt_type == 229U) { ret = mwifiex_process_mgmt_packet(priv, skb); if (ret != 0) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "Rx of mgmt packet failed"); } else { } } else { } } else { } dev_kfree_skb_any(skb); return (ret); } else { } if (((((int )(priv->adapter)->config_bands & 8) == 0 && ((int )(priv->adapter)->config_bands & 16) == 0) || (unsigned long )priv->curr_bss_params.bss_descriptor.bcn_ht_cap == (unsigned long )((struct ieee80211_ht_cap *)0)) && (((unsigned long )(priv->adapter)->fw_cap_info & 16384UL) == 0UL || (int )local_rx_pd->flags & 1)) { mwifiex_process_rx_packet(priv, skb); return (ret); } else { tmp = ether_addr_equal_unaligned((u8 const *)(& priv->curr_addr), (u8 const *)(& rx_pkt_hdr->eth803_hdr.h_dest)); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { mwifiex_process_rx_packet(priv, skb); return (ret); } else { } } tmp___1 = mwifiex_queuing_ra_based(priv); if ((unsigned int )tmp___1 != 0U || (((unsigned long )(priv->adapter)->fw_cap_info & 16384UL) != 0UL && (int )local_rx_pd->flags & 1)) { memcpy((void *)(& ta), (void const *)(& rx_pkt_hdr->eth803_hdr.h_source), 6UL); if ((int )local_rx_pd->flags & 1 && (unsigned int )local_rx_pd->priority <= 7U) { sta_ptr = mwifiex_get_sta_entry(priv, (u8 const *)(& ta)); if ((unsigned long )sta_ptr != (unsigned long )((struct mwifiex_sta_node *)0)) { sta_ptr->rx_seq[(int )local_rx_pd->priority] = local_rx_pd->seq_num; } else { } mwifiex_auto_tdls_update_peer_signal(priv, (u8 *)(& ta), (int )local_rx_pd->snr, (int )local_rx_pd->nf); } else { } } else { if ((unsigned int )rx_pkt_type != 231U) { priv->rx_seq[(int )local_rx_pd->priority] = seq_num; } else { } memcpy((void *)(& ta), (void const *)(& priv->curr_bss_params.bss_descriptor.mac_address), 6UL); } ret = mwifiex_11n_rx_reorder_pkt(priv, (int )seq_num, (int )local_rx_pd->priority, (u8 *)(& ta), (int )((unsigned char )rx_pkt_type), (void *)skb); if (ret != 0 || (unsigned int )rx_pkt_type == 231U) { dev_kfree_skb_any(skb); } else { } if (ret != 0) { priv->stats.rx_dropped = priv->stats.rx_dropped + 1UL; } else { } return (ret); } } bool ldv_queue_work_on_331(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_332(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_333(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_334(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_335(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; bool ldv_queue_work_on_345(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_347(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_346(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_349(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_348(struct workqueue_struct *ldv_func_arg1 ) ; extern struct sk_buff *skb_copy(struct sk_buff const * , gfp_t ) ; __inline static bool is_unicast_ether_addr(u8 const *addr ) { bool tmp ; int tmp___0 ; { tmp = is_multicast_ether_addr(addr); if ((int )tmp != 0) { tmp___0 = 0; } else { tmp___0 = 1; } return ((bool )tmp___0); } } static bool mwifiex_uap_del_tx_pkts_in_ralist(struct mwifiex_private *priv , struct list_head *ra_list_head ) { struct mwifiex_ra_list_tbl *ra_list ; struct sk_buff *skb ; struct sk_buff *tmp ; bool pkt_deleted ; struct mwifiex_txinfo *tx_info ; struct mwifiex_adapter *adapter ; struct list_head const *__mptr ; int tmp___0 ; int tmp___1 ; struct list_head const *__mptr___0 ; { pkt_deleted = 0; adapter = priv->adapter; __mptr = (struct list_head const *)ra_list_head->next; ra_list = (struct mwifiex_ra_list_tbl *)__mptr; goto ldv_60825; ldv_60824: tmp___0 = skb_queue_empty((struct sk_buff_head const *)(& ra_list->skb_head)); if (tmp___0 != 0) { goto ldv_60820; } else { } skb = ra_list->skb_head.next; tmp = skb->__annonCompField68.__annonCompField67.next; goto ldv_60823; ldv_60822: tx_info = MWIFIEX_SKB_TXCB(skb); if (((unsigned long )tx_info->flags & 2UL) != 0UL) { __skb_unlink(skb, & ra_list->skb_head); mwifiex_write_data_complete(adapter, skb, 0, -1); atomic_dec(& priv->wmm.tx_pkts_queued); pkt_deleted = 1; } else { } tmp___1 = atomic_read((atomic_t const *)(& adapter->pending_bridged_pkts)); if (tmp___1 <= 128) { goto ldv_60821; } else { } skb = tmp; tmp = skb->__annonCompField68.__annonCompField67.next; ldv_60823: ; if ((unsigned long )((struct sk_buff *)(& ra_list->skb_head)) != (unsigned long )skb) { goto ldv_60822; } else { } ldv_60821: ; ldv_60820: __mptr___0 = (struct list_head const *)ra_list->list.next; ra_list = (struct mwifiex_ra_list_tbl *)__mptr___0; ldv_60825: ; if ((unsigned long )(& ra_list->list) != (unsigned long )ra_list_head) { goto ldv_60824; } else { } return (pkt_deleted); } } static void mwifiex_uap_cleanup_tx_queues(struct mwifiex_private *priv ) { unsigned long flags ; struct list_head *ra_list ; int i ; raw_spinlock_t *tmp ; bool tmp___0 ; { tmp = spinlock_check(& priv->wmm.ra_list_spinlock); flags = _raw_spin_lock_irqsave(tmp); i = 0; goto ldv_60838; ldv_60837: ; if ((unsigned int )priv->del_list_idx == 8U) { priv->del_list_idx = 0U; } else { } ra_list = & priv->wmm.tid_tbl_ptr[(int )priv->del_list_idx].ra_list; tmp___0 = mwifiex_uap_del_tx_pkts_in_ralist(priv, ra_list); if ((int )tmp___0) { priv->del_list_idx = (u8 )((int )priv->del_list_idx + 1); goto ldv_60836; } else { } i = i + 1; priv->del_list_idx = (u8 )((int )priv->del_list_idx + 1); ldv_60838: ; if (i <= 7) { goto ldv_60837; } else { } ldv_60836: spin_unlock_irqrestore(& priv->wmm.ra_list_spinlock, flags); return; } } static void mwifiex_uap_queue_bridged_pkt(struct mwifiex_private *priv , struct sk_buff *skb ) { struct mwifiex_adapter *adapter ; struct uap_rxpd *uap_rx_pd ; struct rx_packet_hdr *rx_pkt_hdr ; struct sk_buff *new_skb ; struct mwifiex_txinfo *tx_info ; int hdr_chop ; struct ethhdr *p_ethhdr ; struct mwifiex_sta_node *src_node ; int tmp ; int tmp___0 ; int tmp___1 ; __u16 tmp___2 ; __u16 tmp___3 ; unsigned int tmp___4 ; long tmp___5 ; unsigned int tmp___6 ; unsigned int tmp___7 ; bool tmp___8 ; { adapter = priv->adapter; uap_rx_pd = (struct uap_rxpd *)skb->data; rx_pkt_hdr = (struct rx_packet_hdr *)uap_rx_pd + (unsigned long )uap_rx_pd->rx_pkt_offset; tmp = atomic_read((atomic_t const *)(& adapter->pending_bridged_pkts)); if (tmp > 1023) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Tx: Bridge packet limit reached. Drop packet!\n"); } else { } } else { } kfree_skb(skb); mwifiex_uap_cleanup_tx_queues(priv); return; } else { } tmp___0 = memcmp((void const *)(& rx_pkt_hdr->rfc1042_hdr), (void const *)(& bridge_tunnel_header), 6UL); if (tmp___0 == 0) { p_ethhdr = & rx_pkt_hdr->eth803_hdr + 8U; memcpy((void *)(& p_ethhdr->h_source), (void const *)(& rx_pkt_hdr->eth803_hdr.h_source), 6UL); memcpy((void *)(& p_ethhdr->h_dest), (void const *)(& rx_pkt_hdr->eth803_hdr.h_dest), 6UL); hdr_chop = (int )((unsigned int )((long )p_ethhdr) - (unsigned int )((long )uap_rx_pd)); } else { tmp___1 = memcmp((void const *)(& rx_pkt_hdr->rfc1042_hdr), (void const *)(& rfc1042_header), 6UL); if (tmp___1 == 0) { tmp___2 = __fswab16((int )rx_pkt_hdr->rfc1042_hdr.snap_type); if ((unsigned int )tmp___2 != 33011U) { tmp___3 = __fswab16((int )rx_pkt_hdr->rfc1042_hdr.snap_type); if ((unsigned int )tmp___3 != 33079U) { p_ethhdr = & rx_pkt_hdr->eth803_hdr + 8U; memcpy((void *)(& p_ethhdr->h_source), (void const *)(& rx_pkt_hdr->eth803_hdr.h_source), 6UL); memcpy((void *)(& p_ethhdr->h_dest), (void const *)(& rx_pkt_hdr->eth803_hdr.h_dest), 6UL); hdr_chop = (int )((unsigned int )((long )p_ethhdr) - (unsigned int )((long )uap_rx_pd)); } else { hdr_chop = (int )((unsigned int )((long )(& rx_pkt_hdr->eth803_hdr)) - (unsigned int )((long )uap_rx_pd)); } } else { hdr_chop = (int )((unsigned int )((long )(& rx_pkt_hdr->eth803_hdr)) - (unsigned int )((long )uap_rx_pd)); } } else { hdr_chop = (int )((unsigned int )((long )(& rx_pkt_hdr->eth803_hdr)) - (unsigned int )((long )uap_rx_pd)); } } skb_pull(skb, (unsigned int )hdr_chop); tmp___7 = skb_headroom((struct sk_buff const *)skb); if (tmp___7 <= 99U) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { tmp___4 = skb_headroom((struct sk_buff const *)skb); _dev_info((struct device const *)(priv->adapter)->dev, "data: Tx: insufficient skb headroom %d\n", tmp___4); } else { } } else { } new_skb = skb_realloc_headroom(skb, 100U); tmp___5 = ldv__builtin_expect((unsigned long )new_skb == (unsigned long )((struct sk_buff *)0), 0L); if (tmp___5 != 0L) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Tx: cannot allocate new_skb\n"); } else { } } else { } kfree_skb(skb); priv->stats.tx_dropped = priv->stats.tx_dropped + 1UL; return; } else { } kfree_skb(skb); skb = new_skb; if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { tmp___6 = skb_headroom((struct sk_buff const *)skb); _dev_info((struct device const *)(priv->adapter)->dev, "info: new skb headroom %d\n", tmp___6); } else { } } else { } } else { } tx_info = MWIFIEX_SKB_TXCB(skb); memset((void *)tx_info, 0, 24UL); tx_info->bss_num = priv->bss_num; tx_info->bss_type = priv->bss_type; tx_info->flags = (u8 )((unsigned int )tx_info->flags | 2U); src_node = mwifiex_get_sta_entry(priv, (u8 const *)(& rx_pkt_hdr->eth803_hdr.h_source)); if ((unsigned long )src_node != (unsigned long )((struct mwifiex_sta_node *)0)) { src_node->stats.last_rx = (u64 )jiffies; src_node->stats.rx_bytes = src_node->stats.rx_bytes + (u64 )skb->len; src_node->stats.rx_packets = src_node->stats.rx_packets + 1U; src_node->stats.last_tx_rate = uap_rx_pd->rx_rate; src_node->stats.last_tx_htinfo = uap_rx_pd->ht_info; } else { } tmp___8 = is_unicast_ether_addr((u8 const *)(& rx_pkt_hdr->eth803_hdr.h_dest)); if ((int )tmp___8) { priv->stats.rx_bytes = priv->stats.rx_bytes + (unsigned long )skb->len; priv->stats.rx_packets = priv->stats.rx_packets + 1UL; tx_info->pkt_len = skb->len; } else { } __net_timestamp(skb); mwifiex_wmm_add_buf_txqueue(priv, skb); atomic_inc(& adapter->tx_pending); atomic_inc(& adapter->pending_bridged_pkts); return; } } int mwifiex_handle_uap_rx_forward(struct mwifiex_private *priv , struct sk_buff *skb ) { struct mwifiex_adapter *adapter ; struct uap_rxpd *uap_rx_pd ; struct rx_packet_hdr *rx_pkt_hdr ; u8 ra[6U] ; struct sk_buff *skb_uap ; struct mwifiex_sta_node *tmp ; bool tmp___0 ; int tmp___1 ; { adapter = priv->adapter; uap_rx_pd = (struct uap_rxpd *)skb->data; rx_pkt_hdr = (struct rx_packet_hdr *)uap_rx_pd + (unsigned long )uap_rx_pd->rx_pkt_offset; if ((unsigned int )priv->media_connected == 0U) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "drop packet in disconnected state.\n"); } else { } } else { } dev_kfree_skb_any(skb); return (0); } else { } memcpy((void *)(& ra), (void const *)(& rx_pkt_hdr->eth803_hdr.h_dest), 6UL); tmp___0 = is_multicast_ether_addr((u8 const *)(& ra)); if ((int )tmp___0) { skb_uap = skb_copy((struct sk_buff const *)skb, 32U); mwifiex_uap_queue_bridged_pkt(priv, skb_uap); } else { tmp = mwifiex_get_sta_entry(priv, (u8 const *)(& ra)); if ((unsigned long )tmp != (unsigned long )((struct mwifiex_sta_node *)0)) { mwifiex_uap_queue_bridged_pkt(priv, skb); return (0); } else { } } tmp___1 = mwifiex_process_rx_packet(priv, skb); return (tmp___1); } } int mwifiex_process_uap_rx_packet(struct mwifiex_private *priv , struct sk_buff *skb ) { struct mwifiex_adapter *adapter ; int ret ; struct uap_rxpd *uap_rx_pd ; struct rx_packet_hdr *rx_pkt_hdr ; u16 rx_pkt_type ; u8 ta[6U] ; u8 pkt_type ; unsigned long flags ; struct mwifiex_sta_node *node ; raw_spinlock_t *tmp ; struct mwifiex_rx_reorder_tbl *tmp___0 ; { adapter = priv->adapter; uap_rx_pd = (struct uap_rxpd *)skb->data; rx_pkt_type = uap_rx_pd->rx_pkt_type; rx_pkt_hdr = (struct rx_packet_hdr *)uap_rx_pd + (unsigned long )uap_rx_pd->rx_pkt_offset; ether_addr_copy((u8 *)(& ta), (u8 const *)(& rx_pkt_hdr->eth803_hdr.h_source)); if ((int )uap_rx_pd->rx_pkt_offset + (int )uap_rx_pd->rx_pkt_length > (int )((unsigned short )skb->len)) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "wrong rx packet: len=%d, offset=%d, length=%d\n", skb->len, (int )uap_rx_pd->rx_pkt_offset, (int )uap_rx_pd->rx_pkt_length); } else { } } else { } priv->stats.rx_dropped = priv->stats.rx_dropped + 1UL; node = mwifiex_get_sta_entry(priv, (u8 const *)(& ta)); if ((unsigned long )node != (unsigned long )((struct mwifiex_sta_node *)0)) { node->stats.tx_failed = node->stats.tx_failed + 1U; } else { } dev_kfree_skb_any(skb); return (0); } else { } if ((unsigned int )rx_pkt_type == 229U) { ret = mwifiex_process_mgmt_packet(priv, skb); if (ret != 0) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "Rx of mgmt packet failed"); } else { } } else { } } else { } dev_kfree_skb_any(skb); return (ret); } else { } if ((unsigned int )rx_pkt_type != 231U && (unsigned int )uap_rx_pd->priority <= 7U) { tmp = spinlock_check(& priv->sta_list_spinlock); flags = _raw_spin_lock_irqsave(tmp); node = mwifiex_get_sta_entry(priv, (u8 const *)(& ta)); if ((unsigned long )node != (unsigned long )((struct mwifiex_sta_node *)0)) { node->rx_seq[(int )uap_rx_pd->priority] = uap_rx_pd->seq_num; } else { } spin_unlock_irqrestore(& priv->sta_list_spinlock, flags); } else { } if ((unsigned int )priv->ap_11n_enabled == 0U) { ret = mwifiex_handle_uap_rx_forward(priv, skb); return (ret); } else { tmp___0 = mwifiex_11n_get_rx_reorder_tbl(priv, (int )uap_rx_pd->priority, (u8 *)(& ta)); if ((unsigned long )tmp___0 == (unsigned long )((struct mwifiex_rx_reorder_tbl *)0) && (unsigned int )uap_rx_pd->rx_pkt_type != 230U) { ret = mwifiex_handle_uap_rx_forward(priv, skb); return (ret); } else { } } pkt_type = (unsigned char )uap_rx_pd->rx_pkt_type; ret = mwifiex_11n_rx_reorder_pkt(priv, (int )uap_rx_pd->seq_num, (int )uap_rx_pd->priority, (u8 *)(& ta), (int )pkt_type, (void *)skb); if (ret != 0 || (unsigned int )rx_pkt_type == 231U) { dev_kfree_skb_any(skb); } else { } if (ret != 0) { priv->stats.rx_dropped = priv->stats.rx_dropped + 1UL; } else { } return (ret); } } void *mwifiex_process_uap_txpd(struct mwifiex_private *priv , struct sk_buff *skb ) { struct mwifiex_adapter *adapter ; struct uap_txpd *txpd ; struct mwifiex_txinfo *tx_info ; struct mwifiex_txinfo *tmp ; int pad ; u16 pkt_type ; u16 pkt_offset ; int hroom ; unsigned int tmp___0 ; long tmp___1 ; bool tmp___2 ; { adapter = priv->adapter; tmp = MWIFIEX_SKB_TXCB(skb); tx_info = tmp; hroom = (unsigned int )(priv->adapter)->iface_type == 2U ? 0 : 4; if (skb->len == 0U) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "Tx: bad packet length: %d\n", skb->len); } else { } } else { } tx_info->status_code = 4294967295U; return ((void *)skb->data); } else { } tmp___0 = skb_headroom((struct sk_buff const *)skb); tmp___1 = ldv__builtin_expect(tmp___0 <= 99U, 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/11944/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/mwifiex/uap_txrx.c"), "i" (382), "i" (12UL)); ldv_60887: ; goto ldv_60887; } else { } tmp___2 = mwifiex_is_skb_mgmt_frame(skb); pkt_type = (int )tmp___2 ? 229U : 0U; pad = (int )((long )((void *)skb->data + - ((unsigned long )hroom + 20UL))) & 63; skb_push(skb, (unsigned int )pad + 20U); txpd = (struct uap_txpd *)skb->data; memset((void *)txpd, 0, 20UL); txpd->bss_num = priv->bss_num; txpd->bss_type = priv->bss_type; txpd->tx_pkt_length = (unsigned int )((int )((unsigned short )skb->len) - (int )((unsigned short )pad)) - 20U; txpd->priority = (unsigned char )skb->priority; txpd->pkt_delay_2ms = mwifiex_wmm_compute_drv_pkt_delay(priv, (struct sk_buff const *)skb); if (((unsigned long )tx_info->flags & 8UL) != 0UL || ((unsigned long )tx_info->flags & 16UL) != 0UL) { txpd->tx_token_id = tx_info->ack_frame_id; txpd->flags = (u8 )((unsigned int )txpd->flags | 32U); } else { } if ((unsigned int )txpd->priority <= 7U) { txpd->tx_control = priv->wmm.user_pri_pkt_tx_ctrl[(int )txpd->priority]; } else { } pkt_offset = (unsigned int )((u16 )pad) + 20U; if ((unsigned int )pkt_type == 229U) { txpd->tx_pkt_type = pkt_type; pkt_offset = (unsigned int )pkt_offset + 8U; } else { } txpd->tx_pkt_offset = pkt_offset; skb_push(skb, (unsigned int )hroom); if (txpd->tx_control == 0U) { txpd->tx_control = priv->pkt_tx_ctrl; } else { } return ((void *)skb->data); } } bool ldv_queue_work_on_345(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_346(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_347(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_348(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_349(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; void *ldv_err_ptr(long error ) ; __inline static void *ERR_PTR(long error ) ; extern unsigned int jiffies_to_msecs(unsigned long const ) ; extern void init_timer_key(struct timer_list * , unsigned int , char const * , struct lock_class_key * ) ; extern void delayed_work_timer_fn(unsigned long ) ; void ldv_destroy_workqueue_367(struct workqueue_struct *ldv_func_arg1 ) ; void ldv_destroy_workqueue_369(struct workqueue_struct *ldv_func_arg1 ) ; bool ldv_queue_work_on_359(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_361(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_360(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_363(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_362(struct workqueue_struct *ldv_func_arg1 ) ; void ldv_flush_workqueue_364(struct workqueue_struct *ldv_func_arg1 ) ; void ldv_flush_workqueue_365(struct workqueue_struct *ldv_func_arg1 ) ; void ldv_flush_workqueue_366(struct workqueue_struct *ldv_func_arg1 ) ; void ldv_flush_workqueue_368(struct workqueue_struct *ldv_func_arg1 ) ; __inline static bool queue_delayed_work(struct workqueue_struct *wq , struct delayed_work *dwork , unsigned long delay ) { bool tmp ; { tmp = ldv_queue_delayed_work_on_360(8192, wq, dwork, delay); return (tmp); } } void activate_work_3(struct work_struct *work , int state ) ; void call_and_disable_all_4(int state ) ; void call_and_disable_work_3(struct work_struct *work ) ; void disable_work_3(struct work_struct *work ) ; void invoke_work_4(void) ; void activate_work_4(struct work_struct *work , int state ) ; void disable_work_4(struct work_struct *work ) ; void invoke_work_3(void) ; void call_and_disable_all_3(int state ) ; void call_and_disable_work_4(struct work_struct *work ) ; extern int device_set_wakeup_enable(struct device * , bool ) ; __inline static void sema_init(struct semaphore *sem , int val ) { struct lock_class_key __key ; struct semaphore __constr_expr_0 ; { __constr_expr_0.lock.raw_lock.val.counter = 0; __constr_expr_0.lock.magic = 3735899821U; __constr_expr_0.lock.owner_cpu = 4294967295U; __constr_expr_0.lock.owner = (void *)-1; __constr_expr_0.lock.dep_map.key = 0; __constr_expr_0.lock.dep_map.class_cache[0] = 0; __constr_expr_0.lock.dep_map.class_cache[1] = 0; __constr_expr_0.lock.dep_map.name = "(*sem).lock"; __constr_expr_0.lock.dep_map.cpu = 0; __constr_expr_0.lock.dep_map.ip = 0UL; __constr_expr_0.count = (unsigned int )val; __constr_expr_0.wait_list.next = & sem->wait_list; __constr_expr_0.wait_list.prev = & sem->wait_list; *sem = __constr_expr_0; lockdep_init_map(& sem->lock.dep_map, "semaphore->lock", & __key, 0); return; } } extern u32 prandom_u32(void) ; __inline static void write_pnet(possible_net_t *pnet , struct net *net ) { { pnet->net = net; return; } } __inline static struct net *read_pnet(possible_net_t const *pnet ) { { return ((struct net *)pnet->net); } } __inline static void dev_net_set(struct net_device *dev , struct net *net ) { { write_pnet(& dev->nd_net, net); return; } } extern int register_netdevice(struct net_device * ) ; extern void unregister_netdevice_queue(struct net_device * , struct list_head * ) ; __inline static void unregister_netdevice(struct net_device *dev ) { { unregister_netdevice_queue(dev, (struct list_head *)0); return; } } extern void ether_setup(struct net_device * ) ; extern struct net_device *alloc_netdev_mqs(int , char const * , unsigned char , void (*)(struct net_device * ) , unsigned int , unsigned int ) ; __inline static int ieee80211_is_probe_resp(__le16 fc ) { { return (((int )fc & 252) == 80); } } __inline static int ieee80211_is_action(__le16 fc ) { { return (((int )fc & 252) == 208); } } __inline static enum nl80211_channel_type cfg80211_get_chandef_type(struct cfg80211_chan_def const *chandef ) { int __ret_warn_on ; long tmp ; { switch ((unsigned int )chandef->width) { case 0U: ; return (0); case 1U: ; return (1); case 2U: ; if ((unsigned int )chandef->center_freq1 > (unsigned int )(chandef->chan)->center_freq) { return (3); } else { } return (2); default: __ret_warn_on = 1; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("include/net/cfg80211.h", 423); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); return (0); } } } extern void cfg80211_chandef_create(struct cfg80211_chan_def * , struct ieee80211_channel * , enum nl80211_channel_type ) ; __inline static bool cfg80211_chandef_identical(struct cfg80211_chan_def const *chandef1 , struct cfg80211_chan_def const *chandef2 ) { { return ((bool )((((unsigned long )chandef1->chan == (unsigned long )chandef2->chan && (unsigned int )chandef1->width == (unsigned int )chandef2->width) && (unsigned int )chandef1->center_freq1 == (unsigned int )chandef2->center_freq1) && (unsigned int )chandef1->center_freq2 == (unsigned int )chandef2->center_freq2)); } } extern bool cfg80211_chandef_valid(struct cfg80211_chan_def const * ) ; extern int cfg80211_chandef_dfs_required(struct wiphy * , struct cfg80211_chan_def const * , enum nl80211_iftype ) ; __inline static struct net *wiphy_net(struct wiphy *wiphy ) { struct net *tmp ; { tmp = read_pnet((possible_net_t const *)(& wiphy->_net)); return (tmp); } } __inline static void *wiphy_priv(struct wiphy *wiphy ) { long tmp ; { tmp = ldv__builtin_expect((unsigned long )wiphy == (unsigned long )((struct wiphy *)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 *)"include/net/cfg80211.h"), "i" (3259), "i" (12UL)); ldv_47251: ; goto ldv_47251; } else { } return ((void *)(& wiphy->priv)); } } __inline static void set_wiphy_dev(struct wiphy *wiphy , struct device *dev ) { { wiphy->dev.parent = dev; return; } } __inline static struct device *wiphy_dev(struct wiphy *wiphy ) { { return (wiphy->dev.parent); } } extern struct wiphy *wiphy_new_nm(struct cfg80211_ops const * , int , char const * ) ; __inline static struct wiphy *wiphy_new(struct cfg80211_ops const *ops , int sizeof_priv ) { struct wiphy *tmp ; { tmp = wiphy_new_nm(ops, sizeof_priv, (char const *)0); return (tmp); } } extern int wiphy_register(struct wiphy * ) ; extern int ieee80211_channel_to_frequency(int , enum ieee80211_band ) ; extern int regulatory_hint(struct wiphy * , char const * ) ; extern struct cfg80211_bss *cfg80211_get_bss(struct wiphy * , struct ieee80211_channel * , u8 const * , u8 const * , size_t , enum ieee80211_bss_type , enum ieee80211_privacy ) ; extern void cfg80211_ibss_joined(struct net_device * , u8 const * , struct ieee80211_channel * , gfp_t ) ; extern void cfg80211_connect_result(struct net_device * , u8 const * , u8 const * , size_t , u8 const * , size_t , u16 , gfp_t ) ; extern void cfg80211_ready_on_channel(struct wireless_dev * , u64 , struct ieee80211_channel * , unsigned int , gfp_t ) ; __inline static bool is_valid_ether_addr(u8 const *addr ) { bool tmp ; int tmp___0 ; bool tmp___1 ; int tmp___2 ; int tmp___3 ; { tmp = is_multicast_ether_addr(addr); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { tmp___1 = is_zero_ether_addr(addr); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { tmp___3 = 1; } else { tmp___3 = 0; } } else { tmp___3 = 0; } return ((bool )tmp___3); } } extern int lockdep_rtnl_is_held(void) ; extern void *vmalloc(unsigned long ) ; __inline static struct in_device *__in_dev_get_rtnl(struct net_device const *dev ) { bool __warned ; int tmp ; int tmp___0 ; { tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { tmp___0 = lockdep_rtnl_is_held(); if (tmp___0 == 0) { __warned = 1; lockdep_rcu_suspicious("include/linux/inetdevice.h", 222, "suspicious rcu_dereference_protected() usage"); } else { } } else { } return ((struct in_device *)dev->ip_ptr); } } __inline static struct mwifiex_private *mwifiex_get_priv___3(struct mwifiex_adapter *adapter , enum mwifiex_bss_role bss_role ) { int i ; { i = 0; goto ldv_60336; ldv_60335: ; if ((unsigned long )adapter->priv[i] != (unsigned long )((struct mwifiex_private *)0)) { if ((unsigned int )bss_role == 255U || ((unsigned long )(adapter->priv[i])->bss_role & 1UL) == (unsigned long )bss_role) { goto ldv_60334; } else { } } else { } i = i + 1; ldv_60336: ; if ((int )adapter->priv_num > i) { goto ldv_60335; } else { } ldv_60334: ; return ((int )adapter->priv_num > i ? adapter->priv[i] : (struct mwifiex_private *)0); } } __inline static struct mwifiex_private *mwifiex_get_unused_priv(struct mwifiex_adapter *adapter ) { int i ; { i = 0; goto ldv_60343; ldv_60342: ; if ((unsigned long )adapter->priv[i] != (unsigned long )((struct mwifiex_private *)0)) { if ((adapter->priv[i])->bss_mode == 0U) { goto ldv_60341; } else { } } else { } i = i + 1; ldv_60343: ; if ((int )adapter->priv_num > i) { goto ldv_60342; } else { } ldv_60341: ; return ((int )adapter->priv_num > i ? adapter->priv[i] : (struct mwifiex_private *)0); } } __inline static u8 mwifiex_is_any_intf_active(struct mwifiex_private *priv ) { struct mwifiex_private *priv_num ; int i ; { i = 0; goto ldv_60365; ldv_60364: priv_num = (priv->adapter)->priv[i]; if ((unsigned long )priv_num != (unsigned long )((struct mwifiex_private *)0)) { if (((int )priv_num->bss_role & 1 && (unsigned int )priv_num->bss_started != 0U) || (((unsigned long )priv_num->bss_role & 1UL) == 0UL && (unsigned int )priv_num->media_connected != 0U)) { return (1U); } else { } } else { } i = i + 1; ldv_60365: ; if ((int )(priv->adapter)->priv_num > i) { goto ldv_60364; } else { } return (0U); } } u8 mwifiex_sec_chan_offset_to_chan_type(u8 second_chan_offset ) ; extern int mwifiex_is_11h_active(struct mwifiex_private * ) ; int mwifiex_11h_activate(struct mwifiex_private *priv , bool flag ) ; struct ethtool_ops const mwifiex_ethtool_ops ; int mwifiex_send_tdls_data_frame(struct mwifiex_private *priv , u8 const *peer , u8 action_code , u8 dialog_token , u16 status_code , u8 const *extra_ies , size_t extra_ies_len ) ; int mwifiex_send_tdls_action_frame(struct mwifiex_private *priv , u8 const *peer , u8 action_code , u8 dialog_token , u16 status_code , u8 const *extra_ies , size_t extra_ies_len ) ; int mwifiex_tdls_oper(struct mwifiex_private *priv , u8 const *peer , u8 action ) ; void mwifiex_add_auto_tdls_peer(struct mwifiex_private *priv , u8 const *mac ) ; void mwifiex_setup_auto_tdls_timer(struct mwifiex_private *priv ) ; void mwifiex_dfs_cac_work_queue(struct work_struct *work ) ; void mwifiex_dfs_chan_sw_work_queue(struct work_struct *work ) ; void mwifiex_dev_debugfs_init(struct mwifiex_private *priv ) ; void mwifiex_dev_debugfs_remove(struct mwifiex_private *priv ) ; static char *reg_alpha2 ; static struct ieee80211_iface_limit const mwifiex_ap_sta_limits[2U] = { {2U, 772U}, {1U, 8U}}; static struct ieee80211_iface_combination const mwifiex_iface_comb_ap_sta = {(struct ieee80211_iface_limit const *)(& mwifiex_ap_sta_limits), 1U, 3U, 2U, 1, (unsigned char)0, (unsigned char)0}; u8 mwifiex_chan_type_to_sec_chan_offset(enum nl80211_channel_type chan_type ) { { switch ((unsigned int )chan_type) { case 0U: ; case 1U: ; return (0U); case 3U: ; return (1U); case 2U: ; return (3U); default: ; return (0U); } } } u8 mwifiex_sec_chan_offset_to_chan_type(u8 second_chan_offset ) { { switch ((int )second_chan_offset) { case 0: ; return (1U); case 1: ; return (3U); case 3: ; return (2U); default: ; return (1U); } } } static int mwifiex_is_alg_wep(u32 cipher ) { { switch (cipher) { case 1027073U: ; case 1027077U: ; return (1); default: ; goto ldv_60737; } ldv_60737: ; return (0); } } static void *mwifiex_cfg80211_get_adapter(struct wiphy *wiphy ) { void *tmp ; { tmp = wiphy_priv(wiphy); return ((void *)*((unsigned long *)tmp)); } } static int mwifiex_cfg80211_del_key(struct wiphy *wiphy , struct net_device *netdev , u8 key_index , bool pairwise , u8 const *mac_addr ) { struct mwifiex_private *priv ; struct mwifiex_private *tmp ; u8 bc_mac[6U] ; u8 const *peer_mac ; int tmp___0 ; { tmp = mwifiex_netdev_get_priv(netdev); priv = tmp; bc_mac[0] = 255U; bc_mac[1] = 255U; bc_mac[2] = 255U; bc_mac[3] = 255U; bc_mac[4] = 255U; bc_mac[5] = 255U; peer_mac = (int )pairwise ? mac_addr : (u8 const *)(& bc_mac); tmp___0 = mwifiex_set_encode(priv, (struct key_params *)0, (u8 const *)0U, 0, (int )key_index, peer_mac, 1); if (tmp___0 != 0) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "deleting the crypto keys\n"); } else { } } else { } return (-14); } else { } if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: crypto keys deleted\n"); } else { } } else { } return (0); } } static int mwifiex_form_mgmt_frame(struct sk_buff *skb , u8 const *buf , size_t len ) { u8 addr[6U] ; u16 pkt_len ; u32 tx_control ; u32 pkt_type ; unsigned char *tmp ; unsigned char *tmp___0 ; unsigned char *tmp___1 ; unsigned char *tmp___2 ; unsigned char *tmp___3 ; unsigned char *tmp___4 ; { addr[0] = 255U; addr[1] = 255U; addr[2] = 255U; addr[3] = 255U; addr[4] = 255U; addr[5] = 255U; tx_control = 0U; pkt_type = 229U; pkt_len = (unsigned int )((u16 )len) + 6U; skb_reserve(skb, 110); tmp = skb_push(skb, 2U); memcpy((void *)tmp, (void const *)(& pkt_len), 2UL); tmp___0 = skb_push(skb, 4U); memcpy((void *)tmp___0, (void const *)(& tx_control), 4UL); tmp___1 = skb_push(skb, 4U); memcpy((void *)tmp___1, (void const *)(& pkt_type), 4UL); tmp___2 = skb_put(skb, 24U); memcpy((void *)tmp___2, (void const *)buf, 24UL); tmp___3 = skb_put(skb, 6U); memcpy((void *)tmp___3, (void const *)(& addr), 6UL); tmp___4 = skb_put(skb, (unsigned int )len - 24U); memcpy((void *)tmp___4, (void const *)buf + 24U, len - 24UL); skb->priority = 0U; __net_timestamp(skb); return (0); } } static int mwifiex_cfg80211_mgmt_tx(struct wiphy *wiphy , struct wireless_dev *wdev , struct cfg80211_mgmt_tx_params *params , u64 *cookie ) { u8 const *buf ; size_t len ; struct sk_buff *skb ; u16 pkt_len ; struct ieee80211_mgmt const *mgmt ; struct mwifiex_txinfo *tx_info ; struct mwifiex_private *priv ; struct mwifiex_private *tmp ; int tmp___0 ; u32 tmp___1 ; int tmp___2 ; { buf = params->buf; len = params->len; tmp = mwifiex_netdev_get_priv(wdev->netdev); priv = tmp; if ((unsigned long )buf == (unsigned long )((u8 const *)0U) || len == 0UL) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "invalid buffer and length\n"); } else { } } else { } return (-14); } else { } mgmt = (struct ieee80211_mgmt const *)buf; if ((int )priv->bss_role & 1) { tmp___0 = ieee80211_is_probe_resp((int )mgmt->frame_control); if (tmp___0 != 0) { if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: skip to send probe resp in AP or GO mode\n"); } else { } } else { } return (0); } else { } } else { } pkt_len = (unsigned int )((u16 )len) + 6U; skb = dev_alloc_skb((unsigned int )pkt_len + 110U); if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "allocate skb failed for management frame\n"); } else { } } else { } return (-12); } else { } tx_info = MWIFIEX_SKB_TXCB(skb); memset((void *)tx_info, 0, 24UL); tx_info->bss_num = priv->bss_num; tx_info->bss_type = priv->bss_type; tx_info->pkt_len = (u32 )pkt_len; mwifiex_form_mgmt_frame(skb, buf, len); tmp___1 = prandom_u32(); *cookie = (u64 )(tmp___1 | 1U); tmp___2 = ieee80211_is_action((int )mgmt->frame_control); if (tmp___2 != 0) { skb = mwifiex_clone_skb_for_tx_status(priv, skb, 16, cookie); } else { cfg80211_mgmt_tx_status(wdev, *cookie, buf, len, 1, 32U); } mwifiex_queue_tx_pkt(priv, skb); if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: management frame transmitted\n"); } else { } } else { } return (0); } } static void mwifiex_cfg80211_mgmt_frame_register(struct wiphy *wiphy , struct wireless_dev *wdev , u16 frame_type , bool reg ) { struct mwifiex_private *priv ; struct mwifiex_private *tmp ; u32 mask ; { tmp = mwifiex_netdev_get_priv(wdev->netdev); priv = tmp; if ((int )reg) { mask = priv->mgmt_frame_mask | (u32 )(1UL << ((int )frame_type >> 4)); } else { mask = priv->mgmt_frame_mask & ~ ((u32 )(1UL << ((int )frame_type >> 4))); } if (priv->mgmt_frame_mask != mask) { priv->mgmt_frame_mask = mask; mwifiex_send_cmd(priv, 268, 1, 0U, (void *)(& priv->mgmt_frame_mask), 0); if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: mgmt frame registered\n"); } else { } } else { } } else { } return; } } static int mwifiex_cfg80211_remain_on_channel(struct wiphy *wiphy , struct wireless_dev *wdev , struct ieee80211_channel *chan , unsigned int duration , u64 *cookie ) { struct mwifiex_private *priv ; struct mwifiex_private *tmp ; int ret ; u32 tmp___0 ; { tmp = mwifiex_netdev_get_priv(wdev->netdev); priv = tmp; if ((unsigned long )chan == (unsigned long )((struct ieee80211_channel *)0) || (unsigned long )cookie == (unsigned long )((u64 *)0ULL)) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Invalid parameter for ROC\n"); } else { } } else { } return (-22); } else { } if (priv->roc_cfg.cookie != 0ULL) { if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: ongoing ROC, cookie = 0x%llx\n", priv->roc_cfg.cookie); } else { } } else { } return (-16); } else { } ret = mwifiex_remain_on_chan_cfg(priv, 1, chan, duration); if (ret == 0) { tmp___0 = prandom_u32(); *cookie = (u64 )(tmp___0 | 1U); priv->roc_cfg.cookie = *cookie; priv->roc_cfg.chan = *chan; cfg80211_ready_on_channel(wdev, *cookie, chan, duration, 32U); if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: ROC, cookie = 0x%llx\n", *cookie); } else { } } else { } } else { } return (ret); } } static int mwifiex_cfg80211_cancel_remain_on_channel(struct wiphy *wiphy , struct wireless_dev *wdev , u64 cookie ) { struct mwifiex_private *priv ; struct mwifiex_private *tmp ; int ret ; { tmp = mwifiex_netdev_get_priv(wdev->netdev); priv = tmp; if (priv->roc_cfg.cookie != cookie) { return (-2); } else { } ret = mwifiex_remain_on_chan_cfg(priv, 4, & priv->roc_cfg.chan, 0U); if (ret == 0) { cfg80211_remain_on_channel_expired(wdev, cookie, & priv->roc_cfg.chan, 32U); memset((void *)(& priv->roc_cfg), 0, 72UL); if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: cancel ROC, cookie = 0x%llx\n", cookie); } else { } } else { } } else { } return (ret); } } static int mwifiex_cfg80211_set_tx_power(struct wiphy *wiphy , struct wireless_dev *wdev , enum nl80211_tx_power_setting type , int mbm ) { struct mwifiex_adapter *adapter ; void *tmp ; struct mwifiex_private *priv ; struct mwifiex_power_cfg power_cfg ; int dbm ; int tmp___0 ; { tmp = mwifiex_cfg80211_get_adapter(wiphy); adapter = (struct mwifiex_adapter *)tmp; dbm = mbm / 100; if ((unsigned int )type == 2U) { power_cfg.is_power_auto = 0U; power_cfg.power_level = (u32 )dbm; } else { power_cfg.is_power_auto = 1U; } priv = mwifiex_get_priv___3(adapter, 255); tmp___0 = mwifiex_set_tx_power(priv, & power_cfg); return (tmp___0); } } static int mwifiex_cfg80211_set_power_mgmt(struct wiphy *wiphy , struct net_device *dev , bool enabled , int timeout ) { struct mwifiex_private *priv ; struct mwifiex_private *tmp ; u32 ps_mode ; int tmp___0 ; { tmp = mwifiex_netdev_get_priv(dev); priv = tmp; if (timeout != 0) { if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: ignore timeout value for IEEE Power Save\n"); } else { } } else { } } else { } ps_mode = (u32 )enabled; tmp___0 = mwifiex_drv_set_power(priv, & ps_mode); return (tmp___0); } } static int mwifiex_cfg80211_set_default_key(struct wiphy *wiphy , struct net_device *netdev , u8 key_index , bool unicast , bool multicast ) { struct mwifiex_private *priv ; struct mwifiex_private *tmp ; int tmp___0 ; { tmp = mwifiex_netdev_get_priv(netdev); priv = tmp; if ((unsigned int )priv->sec_info.wep_enabled == 0U) { return (0); } else { } if ((unsigned int )priv->bss_type == 1U) { priv->wep_key_curr_index = (u16 )key_index; } else { tmp___0 = mwifiex_set_encode(priv, (struct key_params *)0, (u8 const *)0U, 0, (int )key_index, (u8 const *)0U, 0); if (tmp___0 != 0) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "set default Tx key index\n"); } else { } } else { } return (-14); } else { } } return (0); } } static int mwifiex_cfg80211_add_key(struct wiphy *wiphy , struct net_device *netdev , u8 key_index , bool pairwise , u8 const *mac_addr , struct key_params *params ) { struct mwifiex_private *priv ; struct mwifiex_private *tmp ; struct mwifiex_wep_key *wep_key ; u8 bc_mac[6U] ; u8 const *peer_mac ; int tmp___0 ; { tmp = mwifiex_netdev_get_priv(netdev); priv = tmp; bc_mac[0] = 255U; bc_mac[1] = 255U; bc_mac[2] = 255U; bc_mac[3] = 255U; bc_mac[4] = 255U; bc_mac[5] = 255U; peer_mac = (int )pairwise ? mac_addr : (u8 const *)(& bc_mac); if ((int )priv->bss_role & 1 && (params->cipher == 1027073U || params->cipher == 1027077U)) { if ((unsigned long )params->key != (unsigned long )((u8 const *)0U) && params->key_len != 0) { wep_key = (struct mwifiex_wep_key *)(& priv->wep_key) + (unsigned long )key_index; memset((void *)wep_key, 0, 28UL); memcpy((void *)(& wep_key->key_material), (void const *)params->key, (size_t )params->key_len); wep_key->key_index = (u32 )key_index; wep_key->key_length = (u32 )params->key_len; priv->sec_info.wep_enabled = 1U; } else { } return (0); } else { } tmp___0 = mwifiex_set_encode(priv, params, params->key, params->key_len, (int )key_index, peer_mac, 0); if (tmp___0 != 0) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "crypto keys added\n"); } else { } } else { } return (-14); } else { } return (0); } } static int mwifiex_send_domain_info_cmd_fw(struct wiphy *wiphy ) { u8 no_of_triplet ; struct ieee80211_country_ie_triplet *t ; u8 no_of_parsed_chan ; u8 first_chan ; u8 next_chan ; u8 max_pwr ; u8 i ; u8 flag ; enum ieee80211_band band ; struct ieee80211_supported_band *sband ; struct ieee80211_channel *ch ; struct mwifiex_adapter *adapter ; void *tmp ; struct mwifiex_private *priv ; struct mwifiex_802_11d_domain_reg *domain_info ; u8 tmp___0 ; int tmp___1 ; { no_of_triplet = 0U; no_of_parsed_chan = 0U; first_chan = 0U; next_chan = 0U; max_pwr = 0U; flag = 0U; tmp = mwifiex_cfg80211_get_adapter(wiphy); adapter = (struct mwifiex_adapter *)tmp; domain_info = & adapter->domain_reg; domain_info->country_code[0] = adapter->country_code[0]; domain_info->country_code[1] = adapter->country_code[1]; domain_info->country_code[2] = 32U; tmp___0 = mwifiex_band_to_radio_type((int )adapter->config_bands); band = (enum ieee80211_band )tmp___0; if ((unsigned long )wiphy->bands[(unsigned int )band] == (unsigned long )((struct ieee80211_supported_band *)0)) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "11D: setting domain info in FW\n"); } else { } } else { } return (-1); } else { } sband = wiphy->bands[(unsigned int )band]; i = 0U; goto ldv_60854; ldv_60853: ch = sband->channels + (unsigned long )i; if ((int )ch->flags & 1) { goto ldv_60852; } else { } if ((unsigned int )flag == 0U) { flag = 1U; first_chan = (u8 )ch->hw_value; next_chan = first_chan; max_pwr = (u8 )ch->max_power; no_of_parsed_chan = 1U; goto ldv_60852; } else { } if ((int )ch->hw_value == (int )next_chan + 1 && ch->max_power == (int )max_pwr) { next_chan = (u8 )((int )next_chan + 1); no_of_parsed_chan = (u8 )((int )no_of_parsed_chan + 1); } else { t = (struct ieee80211_country_ie_triplet *)(& domain_info->triplet) + (unsigned long )no_of_triplet; t->__annonCompField108.chans.first_channel = first_chan; t->__annonCompField108.chans.num_channels = no_of_parsed_chan; t->__annonCompField108.chans.max_power = (s8 )max_pwr; no_of_triplet = (u8 )((int )no_of_triplet + 1); first_chan = (u8 )ch->hw_value; next_chan = first_chan; max_pwr = (u8 )ch->max_power; no_of_parsed_chan = 1U; } ldv_60852: i = (u8 )((int )i + 1); ldv_60854: ; if ((int )i < sband->n_channels) { goto ldv_60853; } else { } if ((unsigned int )flag != 0U) { t = (struct ieee80211_country_ie_triplet *)(& domain_info->triplet) + (unsigned long )no_of_triplet; t->__annonCompField108.chans.first_channel = first_chan; t->__annonCompField108.chans.num_channels = no_of_parsed_chan; t->__annonCompField108.chans.max_power = (s8 )max_pwr; no_of_triplet = (u8 )((int )no_of_triplet + 1); } else { } domain_info->no_of_triplet = no_of_triplet; priv = mwifiex_get_priv___3(adapter, 255); tmp___1 = mwifiex_send_cmd(priv, 91, 1, 0U, (void *)0, 0); if (tmp___1 != 0) { if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "11D: setting domain info in FW\n"); } else { } } else { } return (-1); } else { } return (0); } } static void mwifiex_reg_notifier(struct wiphy *wiphy , struct regulatory_request *request ) { struct mwifiex_adapter *adapter ; void *tmp ; struct mwifiex_private *priv ; struct mwifiex_private *tmp___0 ; int tmp___1 ; int tmp___2 ; { tmp = mwifiex_cfg80211_get_adapter(wiphy); adapter = (struct mwifiex_adapter *)tmp; tmp___0 = mwifiex_get_priv___3(adapter, 255); priv = tmp___0; if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: cfg80211 regulatory domain callback for %c%c\n", (int )request->alpha2[0], (int )request->alpha2[1]); } else { } } else { } switch ((unsigned int )request->initiator) { case 2U: ; case 0U: ; case 1U: ; case 3U: ; goto ldv_60866; default: ; if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "unknown regdom initiator: %d\n", (unsigned int )request->initiator); } else { } } else { } return; } ldv_60866: tmp___1 = strncmp((char const *)(& request->alpha2), "00", 2UL); if (tmp___1 != 0) { tmp___2 = strncmp((char const *)(& request->alpha2), (char const *)(& adapter->country_code), 2UL); if (tmp___2 != 0) { memcpy((void *)(& adapter->country_code), (void const *)(& request->alpha2), 2UL); mwifiex_send_domain_info_cmd_fw(wiphy); mwifiex_dnld_txpwr_table(priv); } else { } } else { } return; } } static int mwifiex_set_frag(struct mwifiex_private *priv , u32 frag_thr ) { int tmp ; { if (frag_thr <= 255U || frag_thr > 2346U) { frag_thr = 2346U; } else { } tmp = mwifiex_send_cmd(priv, 22, 1, 8U, (void *)(& frag_thr), 1); return (tmp); } } static int mwifiex_set_rts(struct mwifiex_private *priv , u32 rts_thr ) { int tmp ; { if (rts_thr > 2347U) { rts_thr = 2347U; } else { } tmp = mwifiex_send_cmd(priv, 22, 1, 5U, (void *)(& rts_thr), 1); return (tmp); } } static int mwifiex_cfg80211_set_wiphy_params(struct wiphy *wiphy , u32 changed ) { struct mwifiex_adapter *adapter ; void *tmp ; struct mwifiex_private *priv ; struct mwifiex_uap_bss_param *bss_cfg ; int ret ; void *tmp___0 ; { tmp = mwifiex_cfg80211_get_adapter(wiphy); adapter = (struct mwifiex_adapter *)tmp; priv = mwifiex_get_priv___3(adapter, 255); switch ((int )priv->bss_role) { case 1: ; if ((unsigned int )priv->bss_started != 0U) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cannot change wiphy params when bss started"); } else { } } else { } return (-22); } else { } tmp___0 = kzalloc(292UL, 208U); bss_cfg = (struct mwifiex_uap_bss_param *)tmp___0; if ((unsigned long )bss_cfg == (unsigned long )((struct mwifiex_uap_bss_param *)0)) { return (-12); } else { } mwifiex_set_sys_config_invalid_data(bss_cfg); if ((changed & 8U) != 0U) { bss_cfg->rts_threshold = (u16 )wiphy->rts_threshold; } else { } if ((changed & 4U) != 0U) { bss_cfg->frag_threshold = (u16 )wiphy->frag_threshold; } else { } if ((changed & 2U) != 0U) { bss_cfg->retry_limit = wiphy->retry_long; } else { } ret = mwifiex_send_cmd(priv, 176, 1, 0U, (void *)bss_cfg, 0); kfree((void const *)bss_cfg); if (ret != 0) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "Failed to set wiphy phy params\n"); } else { } } else { } return (ret); } else { } goto ldv_60885; case 0: ; if ((unsigned int )priv->media_connected != 0U) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cannot change wiphy params when connected"); } else { } } else { } return (-22); } else { } if ((changed & 8U) != 0U) { ret = mwifiex_set_rts(priv, wiphy->rts_threshold); if (ret != 0) { return (ret); } else { } } else { } if ((changed & 4U) != 0U) { ret = mwifiex_set_frag(priv, wiphy->frag_threshold); if (ret != 0) { return (ret); } else { } } else { } goto ldv_60885; } ldv_60885: ; return (0); } } static int mwifiex_cfg80211_deinit_p2p(struct mwifiex_private *priv ) { u16 mode ; int tmp ; { mode = 0U; tmp = mwifiex_send_cmd(priv, 235, 1, 0U, (void *)(& mode), 1); if (tmp != 0) { return (-1); } else { } return (0); } } static int mwifiex_cfg80211_init_p2p_client(struct mwifiex_private *priv ) { u16 mode ; int tmp ; int tmp___0 ; int tmp___1 ; { tmp = mwifiex_cfg80211_deinit_p2p(priv); if (tmp != 0) { return (-1); } else { } mode = 1U; tmp___0 = mwifiex_send_cmd(priv, 235, 1, 0U, (void *)(& mode), 1); if (tmp___0 != 0) { return (-1); } else { } mode = 3U; tmp___1 = mwifiex_send_cmd(priv, 235, 1, 0U, (void *)(& mode), 1); if (tmp___1 != 0) { return (-1); } else { } return (0); } } static int mwifiex_cfg80211_init_p2p_go(struct mwifiex_private *priv ) { u16 mode ; int tmp ; int tmp___0 ; int tmp___1 ; { tmp = mwifiex_cfg80211_deinit_p2p(priv); if (tmp != 0) { return (-1); } else { } mode = 1U; tmp___0 = mwifiex_send_cmd(priv, 235, 1, 0U, (void *)(& mode), 1); if (tmp___0 != 0) { return (-1); } else { } mode = 2U; tmp___1 = mwifiex_send_cmd(priv, 235, 1, 0U, (void *)(& mode), 1); if (tmp___1 != 0) { return (-1); } else { } return (0); } } static int mwifiex_deinit_priv_params(struct mwifiex_private *priv ) { struct mwifiex_adapter *adapter ; unsigned long flags ; int tmp ; raw_spinlock_t *tmp___0 ; raw_spinlock_t *tmp___1 ; { adapter = priv->adapter; priv->mgmt_frame_mask = 0U; tmp = mwifiex_send_cmd(priv, 268, 1, 0U, (void *)(& priv->mgmt_frame_mask), 0); if (tmp != 0) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "could not unregister mgmt frame rx\n"); } else { } } else { } return (-1); } else { } mwifiex_deauthenticate(priv, (u8 *)0U); tmp___0 = spinlock_check(& adapter->main_proc_lock); flags = _raw_spin_lock_irqsave(tmp___0); adapter->main_locked = 1; if (adapter->mwifiex_processing != 0U) { spin_unlock_irqrestore(& adapter->main_proc_lock, flags); ldv_flush_workqueue_364(adapter->workqueue); } else { spin_unlock_irqrestore(& adapter->main_proc_lock, flags); } tmp___1 = spinlock_check(& adapter->rx_proc_lock); flags = _raw_spin_lock_irqsave(tmp___1); adapter->rx_locked = 1; if ((int )adapter->rx_processing) { spin_unlock_irqrestore(& adapter->rx_proc_lock, flags); ldv_flush_workqueue_365(adapter->rx_workqueue); } else { spin_unlock_irqrestore(& adapter->rx_proc_lock, flags); } mwifiex_free_priv(priv); priv->wdev.iftype = 0; priv->bss_mode = 0U; priv->sec_info.authentication_mode = 0U; return (0); } } static int mwifiex_init_new_priv_params(struct mwifiex_private *priv , struct net_device *dev , enum nl80211_iftype type ) { struct mwifiex_adapter *adapter ; unsigned long flags ; raw_spinlock_t *tmp ; raw_spinlock_t *tmp___0 ; { adapter = priv->adapter; mwifiex_init_priv(priv); priv->bss_mode = (u32 )type; priv->wdev.iftype = type; mwifiex_init_priv_params(priv, priv->netdev); priv->bss_started = 0U; switch ((unsigned int )type) { case 2U: ; case 1U: priv->bss_role = 0U; priv->bss_type = 0U; goto ldv_60919; case 8U: ; case 9U: priv->bss_role = 0U; priv->bss_type = 2U; goto ldv_60919; case 3U: priv->bss_type = 1U; priv->bss_role = 1U; goto ldv_60919; default: ; if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "%s: changing to %d not supported\n", (char *)(& dev->name), (unsigned int )type); } else { } } else { } return (-95); } ldv_60919: tmp = spinlock_check(& adapter->main_proc_lock); flags = _raw_spin_lock_irqsave(tmp); adapter->main_locked = 0; spin_unlock_irqrestore(& adapter->main_proc_lock, flags); tmp___0 = spinlock_check(& adapter->rx_proc_lock); flags = _raw_spin_lock_irqsave(tmp___0); adapter->rx_locked = 0; spin_unlock_irqrestore(& adapter->rx_proc_lock, flags); return (0); } } static int mwifiex_change_vif_to_p2p(struct net_device *dev , enum nl80211_iftype curr_iftype , enum nl80211_iftype type , u32 *flags , struct vif_params *params ) { struct mwifiex_private *priv ; struct mwifiex_adapter *adapter ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; { priv = mwifiex_netdev_get_priv(dev); if ((unsigned long )priv == (unsigned long )((struct mwifiex_private *)0)) { return (-1); } else { } adapter = priv->adapter; if ((int )adapter->curr_iface_comb.p2p_intf == (int )adapter->iface_limit.p2p_intf) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cannot create multiple P2P ifaces\n"); } else { } } else { } return (-1); } else { } if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "%s: changing role to p2p\n", (char *)(& dev->name)); } else { } } else { } tmp = mwifiex_deinit_priv_params(priv); if (tmp != 0) { return (-1); } else { } tmp___0 = mwifiex_init_new_priv_params(priv, dev, type); if (tmp___0 != 0) { return (-1); } else { } switch ((unsigned int )type) { case 8U: tmp___1 = mwifiex_cfg80211_init_p2p_client(priv); if (tmp___1 != 0) { return (-14); } else { } goto ldv_60940; case 9U: tmp___2 = mwifiex_cfg80211_init_p2p_go(priv); if (tmp___2 != 0) { return (-14); } else { } goto ldv_60940; default: ; if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "%s: changing to %d not supported\n", (char *)(& dev->name), (unsigned int )type); } else { } } else { } return (-95); } ldv_60940: tmp___3 = mwifiex_send_cmd(priv, 247, 1, 0U, (void *)0, 1); if (tmp___3 != 0) { return (-1); } else { } tmp___4 = mwifiex_sta_init_cmd(priv, 0, 0); if (tmp___4 != 0) { return (-1); } else { } switch ((unsigned int )curr_iftype) { case 2U: ; case 1U: adapter->curr_iface_comb.sta_intf = (u8 )((int )adapter->curr_iface_comb.sta_intf - 1); goto ldv_60945; case 3U: adapter->curr_iface_comb.uap_intf = (u8 )((int )adapter->curr_iface_comb.uap_intf - 1); goto ldv_60945; default: ; goto ldv_60945; } ldv_60945: adapter->curr_iface_comb.p2p_intf = (u8 )((int )adapter->curr_iface_comb.p2p_intf + 1); (dev->ieee80211_ptr)->iftype = type; return (0); } } static int mwifiex_change_vif_to_sta_adhoc(struct net_device *dev , enum nl80211_iftype curr_iftype , enum nl80211_iftype type , u32 *flags , struct vif_params *params ) { struct mwifiex_private *priv ; struct mwifiex_adapter *adapter ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; { priv = mwifiex_netdev_get_priv(dev); if ((unsigned long )priv == (unsigned long )((struct mwifiex_private *)0)) { return (-1); } else { } adapter = priv->adapter; if (((unsigned int )curr_iftype != 8U && (unsigned int )curr_iftype != 9U) && (int )adapter->curr_iface_comb.sta_intf == (int )adapter->iface_limit.sta_intf) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cannot create multiple station/adhoc ifaces\n"); } else { } } else { } return (-1); } else { } if ((unsigned int )type == 2U) { if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "%s: changing role to station\n", (char *)(& dev->name)); } else { } } else { } } else if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "%s: changing role to adhoc\n", (char *)(& dev->name)); } else { } } else { } tmp = mwifiex_deinit_priv_params(priv); if (tmp != 0) { return (-1); } else { } tmp___0 = mwifiex_init_new_priv_params(priv, dev, type); if (tmp___0 != 0) { return (-1); } else { } tmp___1 = mwifiex_send_cmd(priv, 247, 1, 0U, (void *)0, 1); if (tmp___1 != 0) { return (-1); } else { } tmp___2 = mwifiex_sta_init_cmd(priv, 0, 0); if (tmp___2 != 0) { return (-1); } else { } switch ((unsigned int )curr_iftype) { case 8U: ; case 9U: adapter->curr_iface_comb.p2p_intf = (u8 )((int )adapter->curr_iface_comb.p2p_intf - 1); goto ldv_60959; case 3U: adapter->curr_iface_comb.uap_intf = (u8 )((int )adapter->curr_iface_comb.uap_intf - 1); goto ldv_60959; default: ; goto ldv_60959; } ldv_60959: adapter->curr_iface_comb.sta_intf = (u8 )((int )adapter->curr_iface_comb.sta_intf + 1); (dev->ieee80211_ptr)->iftype = type; return (0); } } static int mwifiex_change_vif_to_ap(struct net_device *dev , enum nl80211_iftype curr_iftype , enum nl80211_iftype type , u32 *flags , struct vif_params *params ) { struct mwifiex_private *priv ; struct mwifiex_adapter *adapter ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; { priv = mwifiex_netdev_get_priv(dev); if ((unsigned long )priv == (unsigned long )((struct mwifiex_private *)0)) { return (-1); } else { } adapter = priv->adapter; if ((int )adapter->curr_iface_comb.uap_intf == (int )adapter->iface_limit.uap_intf) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cannot create multiple AP ifaces\n"); } else { } } else { } return (-1); } else { } if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "%s: changing role to AP\n", (char *)(& dev->name)); } else { } } else { } tmp = mwifiex_deinit_priv_params(priv); if (tmp != 0) { return (-1); } else { } tmp___0 = mwifiex_init_new_priv_params(priv, dev, type); if (tmp___0 != 0) { return (-1); } else { } tmp___1 = mwifiex_send_cmd(priv, 247, 1, 0U, (void *)0, 1); if (tmp___1 != 0) { return (-1); } else { } tmp___2 = mwifiex_sta_init_cmd(priv, 0, 0); if (tmp___2 != 0) { return (-1); } else { } switch ((unsigned int )curr_iftype) { case 8U: ; case 9U: adapter->curr_iface_comb.p2p_intf = (u8 )((int )adapter->curr_iface_comb.p2p_intf - 1); goto ldv_60973; case 2U: ; case 1U: adapter->curr_iface_comb.sta_intf = (u8 )((int )adapter->curr_iface_comb.sta_intf - 1); goto ldv_60973; default: ; goto ldv_60973; } ldv_60973: adapter->curr_iface_comb.uap_intf = (u8 )((int )adapter->curr_iface_comb.uap_intf + 1); (dev->ieee80211_ptr)->iftype = type; return (0); } } static int mwifiex_cfg80211_change_virtual_intf(struct wiphy *wiphy , struct net_device *dev , enum nl80211_iftype type , u32 *flags , struct vif_params *params ) { struct mwifiex_private *priv ; struct mwifiex_private *tmp ; enum nl80211_iftype curr_iftype ; 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 ; { tmp = mwifiex_netdev_get_priv(dev); priv = tmp; curr_iftype = (dev->ieee80211_ptr)->iftype; switch ((unsigned int )curr_iftype) { case 1U: ; switch ((unsigned int )type) { case 2U: priv->bss_mode = (u32 )type; priv->sec_info.authentication_mode = 0U; (dev->ieee80211_ptr)->iftype = type; mwifiex_deauthenticate(priv, (u8 *)0U); tmp___0 = mwifiex_send_cmd(priv, 247, 1, 0U, (void *)0, 1); return (tmp___0); case 8U: ; case 9U: tmp___1 = mwifiex_change_vif_to_p2p(dev, curr_iftype, type, flags, params); return (tmp___1); case 3U: tmp___2 = mwifiex_change_vif_to_ap(dev, curr_iftype, type, flags, params); return (tmp___2); case 0U: ; if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "%s: kept type as IBSS\n", (char *)(& dev->name)); } else { } } else { } case 1U: ; return (0); default: ; if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "%s: changing to %d not supported\n", (char *)(& dev->name), (unsigned int )type); } else { } } else { } return (-95); } goto ldv_60994; case 2U: ; switch ((unsigned int )type) { case 1U: priv->bss_mode = (u32 )type; priv->sec_info.authentication_mode = 0U; (dev->ieee80211_ptr)->iftype = type; mwifiex_deauthenticate(priv, (u8 *)0U); tmp___3 = mwifiex_send_cmd(priv, 247, 1, 0U, (void *)0, 1); return (tmp___3); case 8U: ; case 9U: tmp___4 = mwifiex_change_vif_to_p2p(dev, curr_iftype, type, flags, params); return (tmp___4); case 3U: tmp___5 = mwifiex_change_vif_to_ap(dev, curr_iftype, type, flags, params); return (tmp___5); case 0U: ; if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "%s: kept type as STA\n", (char *)(& dev->name)); } else { } } else { } case 2U: ; return (0); default: ; if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "%s: changing to %d not supported\n", (char *)(& dev->name), (unsigned int )type); } else { } } else { } return (-95); } goto ldv_60994; case 3U: ; switch ((unsigned int )type) { case 1U: ; case 2U: tmp___6 = mwifiex_change_vif_to_sta_adhoc(dev, curr_iftype, type, flags, params); return (tmp___6); case 8U: ; case 9U: tmp___7 = mwifiex_change_vif_to_p2p(dev, curr_iftype, type, flags, params); return (tmp___7); case 0U: ; if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "%s: kept type as AP\n", (char *)(& dev->name)); } else { } } else { } case 3U: ; return (0); default: ; if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "%s: changing to %d not supported\n", (char *)(& dev->name), (unsigned int )type); } else { } } else { } return (-95); } goto ldv_60994; case 8U: ; case 9U: ; switch ((unsigned int )type) { case 2U: tmp___8 = mwifiex_cfg80211_init_p2p_client(priv); if (tmp___8 != 0) { return (-14); } else { } (dev->ieee80211_ptr)->iftype = type; goto ldv_61014; case 1U: tmp___9 = mwifiex_cfg80211_deinit_p2p(priv); if (tmp___9 != 0) { return (-14); } else { } tmp___10 = mwifiex_change_vif_to_sta_adhoc(dev, curr_iftype, type, flags, params); return (tmp___10); case 3U: tmp___11 = mwifiex_cfg80211_deinit_p2p(priv); if (tmp___11 != 0) { return (-14); } else { } tmp___12 = mwifiex_change_vif_to_ap(dev, curr_iftype, type, flags, params); return (tmp___12); case 0U: ; if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "%s: kept type as P2P\n", (char *)(& dev->name)); } else { } } else { } case 8U: ; case 9U: ; return (0); default: ; if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "%s: changing to %d not supported\n", (char *)(& dev->name), (unsigned int )type); } else { } } else { } return (-95); } ldv_61014: ; goto ldv_60994; default: ; if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "%s: unknown iftype: %d\n", (char *)(& dev->name), (unsigned int )(dev->ieee80211_ptr)->iftype); } else { } } else { } return (-95); } ldv_60994: ; return (0); } } static void mwifiex_parse_htinfo(struct mwifiex_private *priv , u8 tx_htinfo , struct rate_info *rate ) { struct mwifiex_adapter *adapter ; { adapter = priv->adapter; if (adapter->is_hw_11ac_capable != 0U) { if ((int )tx_htinfo & 1) { rate->mcs = priv->tx_rate; rate->flags = (u8 )((unsigned int )rate->flags | 1U); } else { } if (((unsigned long )tx_htinfo & 2UL) != 0UL) { rate->mcs = (unsigned int )priv->tx_rate & 15U; rate->flags = (u8 )((unsigned int )rate->flags | 2U); } else { } if (((unsigned long )tx_htinfo & 3UL) != 0UL) { switch ((unsigned long )tx_htinfo & 12UL) { case 0UL: rate->bw = 2U; goto ldv_61029; case 4UL: rate->bw = 3U; goto ldv_61029; case 8UL: rate->bw = 4U; goto ldv_61029; case 12UL: rate->bw = 5U; goto ldv_61029; } ldv_61029: ; if (((unsigned long )tx_htinfo & 16UL) != 0UL) { rate->flags = (u8 )((unsigned int )rate->flags | 4U); } else { } if ((unsigned int )((int )priv->tx_rate >> 4) == 1U) { rate->nss = 2U; } else { rate->nss = 1U; } } else { } } else if ((int )tx_htinfo & 1 && (unsigned int )priv->tx_rate <= 15U) { rate->mcs = priv->tx_rate; rate->flags = (u8 )((unsigned int )rate->flags | 1U); rate->bw = 2U; if (((unsigned long )tx_htinfo & 2UL) != 0UL) { rate->bw = 3U; } else { } if (((unsigned long )tx_htinfo & 4UL) != 0UL) { rate->flags = (u8 )((unsigned int )rate->flags | 4U); } else { } } else { } return; } } static int mwifiex_dump_station_info(struct mwifiex_private *priv , struct mwifiex_sta_node *node , struct station_info *sinfo ) { u32 rate ; int tmp ; int tmp___0 ; { sinfo->filled = 10124U; if ((int )priv->bss_role & 1) { if ((unsigned long )node == (unsigned long )((struct mwifiex_sta_node *)0)) { return (-2); } else { } sinfo->filled = sinfo->filled | 4098U; sinfo->inactive_time = jiffies_to_msecs((unsigned long const )((unsigned long long )jiffies - node->stats.last_rx)); sinfo->signal = node->stats.rssi; sinfo->signal_avg = node->stats.rssi; sinfo->rx_bytes = node->stats.rx_bytes; sinfo->tx_bytes = node->stats.tx_bytes; sinfo->rx_packets = node->stats.rx_packets; sinfo->tx_packets = node->stats.tx_packets; sinfo->tx_failed = node->stats.tx_failed; mwifiex_parse_htinfo(priv, (int )node->stats.last_tx_htinfo, & sinfo->txrate); sinfo->txrate.legacy = (unsigned int )((u16 )node->stats.last_tx_rate) * 5U; return (0); } else { } tmp = mwifiex_send_cmd(priv, 164, 0, 0U, (void *)0, 1); if (tmp != 0) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "failed to get signal information\n"); } else { } } else { } return (-14); } else { } tmp___0 = mwifiex_drv_get_data_rate(priv, & rate); if (tmp___0 != 0) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "getting data rate error\n"); } else { } } else { } return (-14); } else { } mwifiex_send_cmd(priv, 22, 0, 3U, (void *)(& priv->dtim_period), 1); mwifiex_parse_htinfo(priv, (int )priv->tx_htinfo, & sinfo->txrate); sinfo->signal_avg = (s8 )priv->bcn_rssi_avg; sinfo->rx_bytes = (u64 )priv->stats.rx_bytes; sinfo->tx_bytes = (u64 )priv->stats.tx_bytes; sinfo->rx_packets = (u32 )priv->stats.rx_packets; sinfo->tx_packets = (u32 )priv->stats.tx_packets; sinfo->signal = (s8 )priv->bcn_rssi_avg; sinfo->txrate.legacy = (unsigned int )((u16 )rate) * 5U; if (priv->bss_mode == 2U) { sinfo->filled = sinfo->filled | 32768U; sinfo->bss_param.flags = 0U; if (((int )priv->curr_bss_params.bss_descriptor.cap_info_bitmap & 32) != 0) { sinfo->bss_param.flags = (u8 )((unsigned int )sinfo->bss_param.flags | 2U); } else { } if (((int )priv->curr_bss_params.bss_descriptor.cap_info_bitmap & 1024) != 0) { sinfo->bss_param.flags = (u8 )((unsigned int )sinfo->bss_param.flags | 4U); } else { } sinfo->bss_param.dtim_period = priv->dtim_period; sinfo->bss_param.beacon_interval = priv->curr_bss_params.bss_descriptor.beacon_period; } else { } return (0); } } static int mwifiex_cfg80211_get_station(struct wiphy *wiphy , struct net_device *dev , u8 const *mac , struct station_info *sinfo ) { struct mwifiex_private *priv ; struct mwifiex_private *tmp ; int tmp___0 ; int tmp___1 ; { tmp = mwifiex_netdev_get_priv(dev); priv = tmp; if ((unsigned int )priv->media_connected == 0U) { return (-2); } else { } tmp___0 = memcmp((void const *)mac, (void const *)(& priv->cfg_bssid), 6UL); if (tmp___0 != 0) { return (-2); } else { } tmp___1 = mwifiex_dump_station_info(priv, (struct mwifiex_sta_node *)0, sinfo); return (tmp___1); } } static int mwifiex_cfg80211_dump_station(struct wiphy *wiphy , struct net_device *dev , int idx , u8 *mac , struct station_info *sinfo ) { struct mwifiex_private *priv ; struct mwifiex_private *tmp ; struct mwifiex_sta_node *node ; int tmp___0 ; struct list_head const *__mptr ; struct mwifiex_sta_node *tmp___1 ; struct list_head const *__mptr___0 ; int tmp___2 ; struct list_head const *__mptr___1 ; { tmp = mwifiex_netdev_get_priv(dev); priv = tmp; if ((((unsigned long )priv->bss_role & 1UL) == 0UL && (unsigned int )priv->media_connected != 0U) && idx == 0) { ether_addr_copy(mac, (u8 const *)(& priv->cfg_bssid)); tmp___0 = mwifiex_dump_station_info(priv, (struct mwifiex_sta_node *)0, sinfo); return (tmp___0); } else if ((int )priv->bss_role & 1) { mwifiex_send_cmd(priv, 179, 0, 0U, (void *)0, 1); if ((unsigned long )node != (unsigned long )((struct mwifiex_sta_node *)0) && (unsigned long )(& node->list) == (unsigned long )(& priv->sta_list)) { node = (struct mwifiex_sta_node *)0; return (-2); } else { } tmp___1 = (unsigned long )node != (unsigned long )((struct mwifiex_sta_node *)0); if (tmp___1) { } else { __mptr = (struct list_head const *)(& priv->sta_list); tmp___1 = (struct mwifiex_sta_node *)__mptr; } node = tmp___1; __mptr___0 = (struct list_head const *)node->list.next; node = (struct mwifiex_sta_node *)__mptr___0; goto ldv_61062; ldv_61061: ether_addr_copy(mac, (u8 const *)(& node->mac_addr)); tmp___2 = mwifiex_dump_station_info(priv, node, sinfo); return (tmp___2); __mptr___1 = (struct list_head const *)node->list.next; node = (struct mwifiex_sta_node *)__mptr___1; ldv_61062: ; if ((unsigned long )(& node->list) != (unsigned long )(& priv->sta_list)) { goto ldv_61061; } else { } } else { } return (-2); } } static int mwifiex_cfg80211_dump_survey(struct wiphy *wiphy , struct net_device *dev , int idx , struct survey_info *survey ) { struct mwifiex_private *priv ; struct mwifiex_private *tmp ; struct mwifiex_chan_stats *pchan_stats ; enum ieee80211_band band ; u8 curr_bss_band ; u32 chan ; u8 tmp___0 ; int tmp___1 ; int tmp___2 ; { tmp = mwifiex_netdev_get_priv(dev); priv = tmp; pchan_stats = (priv->adapter)->chan_stats; if ((int )(priv->adapter)->debug_mask < 0) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "dump_survey idx=%d\n", idx); } else { } } else { } memset((void *)survey, 0, 64UL); if ((((unsigned long )priv->bss_role & 1UL) == 0UL && (unsigned int )priv->media_connected != 0U) && idx == 0) { curr_bss_band = priv->curr_bss_params.band; chan = priv->curr_bss_params.bss_descriptor.channel; tmp___0 = mwifiex_band_to_radio_type((int )curr_bss_band); band = (enum ieee80211_band )tmp___0; tmp___1 = ieee80211_channel_to_frequency((int )chan, band); survey->channel = ieee80211_get_channel(wiphy, tmp___1); if ((int )priv->bcn_nf_last != 0) { survey->filled = 1U; survey->noise = (s8 )priv->bcn_nf_last; } else { } return (0); } else { } if ((u32 )idx >= (priv->adapter)->num_in_chan_stats) { return (-2); } else { } if ((unsigned int )(pchan_stats + (unsigned long )idx)->cca_scan_dur == 0U) { return (0); } else { } band = (enum ieee80211_band )(pchan_stats + (unsigned long )idx)->bandcfg; tmp___2 = ieee80211_channel_to_frequency((int )(pchan_stats + (unsigned long )idx)->chan_num, band); survey->channel = ieee80211_get_channel(wiphy, tmp___2); survey->filled = 13U; survey->noise = (pchan_stats + (unsigned long )idx)->noise; survey->time = (u64 )(pchan_stats + (unsigned long )idx)->cca_scan_dur; survey->time_busy = (u64 )(pchan_stats + (unsigned long )idx)->cca_busy_dur; return (0); } } static struct ieee80211_rate mwifiex_rates[12U] = { {0U, 10U, 2U, (unsigned short)0}, {0U, 20U, 4U, (unsigned short)0}, {0U, 55U, 11U, (unsigned short)0}, {0U, 110U, 22U, (unsigned short)0}, {0U, 60U, 12U, (unsigned short)0}, {0U, 90U, 18U, (unsigned short)0}, {0U, 120U, 24U, (unsigned short)0}, {0U, 180U, 36U, (unsigned short)0}, {0U, 240U, 48U, (unsigned short)0}, {0U, 360U, 72U, (unsigned short)0}, {0U, 480U, 96U, (unsigned short)0}, {0U, 540U, 108U, (unsigned short)0}}; static struct ieee80211_channel mwifiex_channels_2ghz[14U] = { {0, 2412U, 1U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}, {0, 2417U, 2U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}, {0, 2422U, 3U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}, {0, 2427U, 4U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}, {0, 2432U, 5U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}, {0, 2437U, 6U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}, {0, 2442U, 7U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}, {0, 2447U, 8U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}, {0, 2452U, 9U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}, {0, 2457U, 10U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}, {0, 2462U, 11U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}, {0, 2467U, 12U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}, {0, 2472U, 13U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}, {0, 2484U, 14U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}}; static struct ieee80211_supported_band mwifiex_band_2ghz = {(struct ieee80211_channel *)(& mwifiex_channels_2ghz), (struct ieee80211_rate *)(& mwifiex_rates), 0, 14, 12, {(unsigned short)0, (_Bool)0, (unsigned char)0, (unsigned char)0, {{(unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0}, (unsigned short)0, (unsigned char)0, {(unsigned char)0, (unsigned char)0, (unsigned char)0}}}, {(_Bool)0, 0U, {(unsigned short)0, (unsigned short)0, (unsigned short)0, (unsigned short)0}}}; static struct ieee80211_channel mwifiex_channels_5ghz[31U] = { {0, 5040U, 8U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}, {0, 5060U, 12U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}, {0, 5080U, 16U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}, {0, 5170U, 34U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}, {0, 5190U, 38U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}, {0, 5210U, 42U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}, {0, 5230U, 46U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}, {0, 5180U, 36U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}, {0, 5200U, 40U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}, {0, 5220U, 44U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}, {0, 5240U, 48U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}, {0, 5260U, 52U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}, {0, 5280U, 56U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}, {0, 5300U, 60U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}, {0, 5320U, 64U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}, {0, 5500U, 100U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}, {0, 5520U, 104U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}, {0, 5540U, 108U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}, {0, 5560U, 112U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}, {0, 5580U, 116U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}, {0, 5600U, 120U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}, {0, 5620U, 124U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}, {0, 5640U, 128U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}, {0, 5660U, 132U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}, {0, 5680U, 136U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}, {0, 5700U, 140U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}, {0, 5745U, 149U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}, {0, 5765U, 153U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}, {0, 5785U, 157U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}, {0, 5805U, 161U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}, {0, 5825U, 165U, 0U, 0, 0, 0, (_Bool)0, 0U, 0, 0, 0, 0UL, 0U}}; static struct ieee80211_supported_band mwifiex_band_5ghz = {(struct ieee80211_channel *)(& mwifiex_channels_5ghz), (struct ieee80211_rate *)(& mwifiex_rates) + 4UL, 0, 31, 8, {(unsigned short)0, (_Bool)0, (unsigned char)0, (unsigned char)0, {{(unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0}, (unsigned short)0, (unsigned char)0, {(unsigned char)0, (unsigned char)0, (unsigned char)0}}}, {(_Bool)0, 0U, {(unsigned short)0, (unsigned short)0, (unsigned short)0, (unsigned short)0}}}; static u32 const mwifiex_cipher_suites[5U] = { 1027073U, 1027077U, 1027074U, 1027076U, 1027078U}; static struct ieee80211_txrx_stypes const mwifiex_mgmt_stypes[12U] = { {(unsigned short)0, (unsigned short)0}, {(unsigned short)0, (unsigned short)0}, {8224U, 8208U}, {8224U, 8208U}, {(unsigned short)0, (unsigned short)0}, {(unsigned short)0, (unsigned short)0}, {(unsigned short)0, (unsigned short)0}, {(unsigned short)0, (unsigned short)0}, {8224U, 8208U}, {8224U, 8208U}}; static int mwifiex_cfg80211_set_bitrate_mask(struct wiphy *wiphy , struct net_device *dev , u8 const *peer , struct cfg80211_bitrate_mask const *mask ) { struct mwifiex_private *priv ; struct mwifiex_private *tmp ; u16 bitmap_rates[18U] ; enum ieee80211_band band ; struct mwifiex_adapter *adapter ; u8 tmp___0 ; int tmp___1 ; { tmp = mwifiex_netdev_get_priv(dev); priv = tmp; adapter = priv->adapter; if ((unsigned int )priv->media_connected == 0U) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "Can not set Tx data rate in disconnected state\n"); } else { } } else { } return (-22); } else { } tmp___0 = mwifiex_band_to_radio_type((int )priv->curr_bss_params.band); band = (enum ieee80211_band )tmp___0; memset((void *)(& bitmap_rates), 0, 36UL); if ((unsigned int )band == 0U) { bitmap_rates[0] = (unsigned int )((u16 )mask->control[(unsigned int )band].legacy) & 15U; } else { } if ((unsigned int )band == 0U) { bitmap_rates[1] = (u16 )(((unsigned int )mask->control[(unsigned int )band].legacy & 4080U) >> 4); } else { bitmap_rates[1] = (u16 )mask->control[(unsigned int )band].legacy; } bitmap_rates[2] = (u16 )mask->control[(unsigned int )band].ht_mcs[0]; if ((unsigned int )adapter->hw_dev_mcs_support == 34U) { bitmap_rates[2] = (u16 )((int )((short )bitmap_rates[2]) | (int )((short )((int )mask->control[(unsigned int )band].ht_mcs[1] << 8))); } else { } if ((unsigned int )adapter->fw_api_ver == 15U) { bitmap_rates[10] = mask->control[(unsigned int )band].vht_mcs[0]; if ((unsigned int )adapter->hw_dev_mcs_support == 34U) { bitmap_rates[11] = mask->control[(unsigned int )band].vht_mcs[1]; } else { } } else { } tmp___1 = mwifiex_send_cmd(priv, 214, 1, 0U, (void *)(& bitmap_rates), 1); return (tmp___1); } } static int mwifiex_cfg80211_set_cqm_rssi_config(struct wiphy *wiphy , struct net_device *dev , s32 rssi_thold , u32 rssi_hyst ) { struct mwifiex_private *priv ; struct mwifiex_private *tmp ; struct mwifiex_ds_misc_subsc_evt subsc_evt ; long ret ; int __x___0 ; long ret___0 ; int __x___2 ; int tmp___0 ; int tmp___1 ; { tmp = mwifiex_netdev_get_priv(dev); priv = tmp; priv->cqm_rssi_thold = rssi_thold; priv->cqm_rssi_hyst = rssi_hyst; memset((void *)(& subsc_evt), 0, 8UL); subsc_evt.events = 17U; if (rssi_thold != 0 && rssi_hyst != 0U) { subsc_evt.action = 2U; __x___0 = rssi_thold; ret = (long )(__x___0 < 0 ? - __x___0 : __x___0); subsc_evt.bcn_l_rssi_cfg.abs_value = (u8 )ret; __x___2 = rssi_thold; ret___0 = (long )(__x___2 < 0 ? - __x___2 : __x___2); subsc_evt.bcn_h_rssi_cfg.abs_value = (u8 )ret___0; subsc_evt.bcn_l_rssi_cfg.evt_freq = 1U; subsc_evt.bcn_h_rssi_cfg.evt_freq = 1U; tmp___0 = mwifiex_send_cmd(priv, 117, 0, 0U, (void *)(& subsc_evt), 1); return (tmp___0); } else { subsc_evt.action = 3U; tmp___1 = mwifiex_send_cmd(priv, 117, 0, 0U, (void *)(& subsc_evt), 1); return (tmp___1); } return (0); } } static int mwifiex_cfg80211_change_beacon(struct wiphy *wiphy , struct net_device *dev , struct cfg80211_beacon_data *data ) { struct mwifiex_private *priv ; struct mwifiex_private *tmp ; int tmp___0 ; { tmp = mwifiex_netdev_get_priv(dev); priv = tmp; if (((unsigned long )priv->bss_role & 1UL) == 0UL) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "%s: bss_type mismatched\n", "mwifiex_cfg80211_change_beacon"); } else { } } else { } return (-22); } else { } if ((unsigned int )priv->bss_started == 0U) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "%s: bss not started\n", "mwifiex_cfg80211_change_beacon"); } else { } } else { } return (-22); } else { } tmp___0 = mwifiex_set_mgmt_ies(priv, data); if (tmp___0 != 0) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "%s: setting mgmt ies failed\n", "mwifiex_cfg80211_change_beacon"); } else { } } else { } return (-14); } else { } return (0); } } static int mwifiex_cfg80211_del_station(struct wiphy *wiphy , struct net_device *dev , struct station_del_parameters *params ) { struct mwifiex_private *priv ; struct mwifiex_private *tmp ; struct mwifiex_sta_node *sta_node ; u8 deauth_mac[6U] ; unsigned long flags ; int tmp___0 ; bool tmp___1 ; raw_spinlock_t *tmp___2 ; int tmp___3 ; bool tmp___4 ; { tmp = mwifiex_netdev_get_priv(dev); priv = tmp; tmp___0 = list_empty((struct list_head const *)(& priv->sta_list)); if (tmp___0 != 0 || (unsigned int )priv->bss_started == 0U) { return (0); } else { } if ((unsigned long )params->mac == (unsigned long )((u8 const *)0U)) { return (0); } else { tmp___1 = is_broadcast_ether_addr(params->mac); if ((int )tmp___1) { return (0); } else { } } if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "%s: mac address %pM\n", "mwifiex_cfg80211_del_station", params->mac); } else { } } else { } eth_zero_addr((u8 *)(& deauth_mac)); tmp___2 = spinlock_check(& priv->sta_list_spinlock); flags = _raw_spin_lock_irqsave(tmp___2); sta_node = mwifiex_get_sta_entry(priv, params->mac); if ((unsigned long )sta_node != (unsigned long )((struct mwifiex_sta_node *)0)) { ether_addr_copy((u8 *)(& deauth_mac), params->mac); } else { } spin_unlock_irqrestore(& priv->sta_list_spinlock, flags); tmp___4 = is_valid_ether_addr((u8 const *)(& deauth_mac)); if ((int )tmp___4) { tmp___3 = mwifiex_send_cmd(priv, 181, 1, 0U, (void *)(& deauth_mac), 1); if (tmp___3 != 0) { return (-1); } else { } } else { } return (0); } } static int mwifiex_cfg80211_set_antenna(struct wiphy *wiphy , u32 tx_ant , u32 rx_ant ) { struct mwifiex_adapter *adapter ; void *tmp ; struct mwifiex_private *priv ; struct mwifiex_private *tmp___0 ; struct mwifiex_ds_ant_cfg ant_cfg ; struct ieee80211_sta_ht_cap *ht_info ; int rx_mcs_supp ; enum ieee80211_band band ; int tmp___1 ; { tmp = mwifiex_cfg80211_get_adapter(wiphy); adapter = (struct mwifiex_adapter *)tmp; tmp___0 = mwifiex_get_priv___3(adapter, 255); priv = tmp___0; if (tx_ant == 0U || rx_ant == 0U) { return (-95); } else { } if ((unsigned int )adapter->hw_dev_mcs_support != 34U) { if (tx_ant != rx_ant) { return (-95); } else { } if (((tx_ant - 1U) & tx_ant) != 0U && (unsigned long )tx_ant != (1UL << (int )adapter->number_of_antenna) - 1UL) { return (-95); } else { } if ((unsigned long )tx_ant == (1UL << (int )adapter->number_of_antenna) - 1UL && (unsigned int )(priv->adapter)->number_of_antenna > 1U) { tx_ant = 65535U; rx_ant = 65535U; } else { } } else { if (tx_ant == 1U && rx_ant == 1U) { adapter->user_dev_mcs_support = 17U; if (adapter->is_hw_11ac_capable != 0U) { adapter->usr_dot_11ac_mcs_support = 4294901758U; } else { } } else { adapter->user_dev_mcs_support = 34U; if (adapter->is_hw_11ac_capable != 0U) { adapter->usr_dot_11ac_mcs_support = 4294639610U; } else { } } band = 0; goto ldv_61149; ldv_61148: ; if ((unsigned long )(adapter->wiphy)->bands[(unsigned int )band] == (unsigned long )((struct ieee80211_supported_band *)0)) { goto ldv_61147; } else { } ht_info = & ((adapter->wiphy)->bands[(unsigned int )band])->ht_cap; rx_mcs_supp = (int )adapter->user_dev_mcs_support & 15; memset((void *)(& ht_info->mcs), 0, (size_t )adapter->number_of_antenna); memset((void *)(& ht_info->mcs), 255, (size_t )rx_mcs_supp); ldv_61147: band = (enum ieee80211_band )((unsigned int )band + 1U); ldv_61149: ; if ((unsigned int )band <= 2U) { goto ldv_61148; } else { } } ant_cfg.tx_ant = tx_ant; ant_cfg.rx_ant = rx_ant; tmp___1 = mwifiex_send_cmd(priv, 32, 1, 0U, (void *)(& ant_cfg), 1); return (tmp___1); } } static int mwifiex_cfg80211_stop_ap(struct wiphy *wiphy , struct net_device *dev ) { struct mwifiex_private *priv ; struct mwifiex_private *tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; { tmp = mwifiex_netdev_get_priv(dev); priv = tmp; mwifiex_abort_cac(priv); tmp___0 = mwifiex_del_mgmt_ies(priv); if (tmp___0 != 0) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Failed to delete mgmt IEs!\n"); } else { } } else { } } else { } priv->ap_11n_enabled = 0U; memset((void *)(& priv->bss_cfg), 0, 292UL); tmp___1 = mwifiex_send_cmd(priv, 178, 1, 0U, (void *)0, 1); if (tmp___1 != 0) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Failed to stop the BSS\n"); } else { } } else { } return (-1); } else { } tmp___2 = mwifiex_send_cmd(priv, 175, 1, 0U, (void *)0, 1); if (tmp___2 != 0) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Failed to reset BSS\n"); } else { } } else { } return (-1); } else { } return (0); } } static int mwifiex_cfg80211_start_ap(struct wiphy *wiphy , struct net_device *dev , struct cfg80211_ap_settings *params ) { struct mwifiex_uap_bss_param *bss_cfg ; struct mwifiex_private *priv ; struct mwifiex_private *tmp ; void *tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; int tmp___6 ; int tmp___7 ; { tmp = mwifiex_netdev_get_priv(dev); priv = tmp; if (((unsigned long )priv->bss_role & 1UL) == 0UL) { return (-1); } else { } tmp___0 = kzalloc(292UL, 208U); bss_cfg = (struct mwifiex_uap_bss_param *)tmp___0; if ((unsigned long )bss_cfg == (unsigned long )((struct mwifiex_uap_bss_param *)0)) { return (-12); } else { } mwifiex_set_sys_config_invalid_data(bss_cfg); if (params->beacon_interval != 0) { bss_cfg->beacon_period = (u16 )params->beacon_interval; } else { } if (params->dtim_period != 0) { bss_cfg->dtim_period = (u8 )params->dtim_period; } else { } if ((unsigned long )params->ssid != (unsigned long )((u8 const *)0U) && params->ssid_len != 0UL) { memcpy((void *)(& bss_cfg->ssid.ssid), (void const *)params->ssid, params->ssid_len); bss_cfg->ssid.ssid_len = (u32 )params->ssid_len; } else { } if (params->inactivity_timeout > 0) { bss_cfg->sta_ao_timer = (u32 )(params->inactivity_timeout * 10); bss_cfg->ps_sta_ao_timer = (u32 )(params->inactivity_timeout * 10); } else { } switch ((unsigned int )params->hidden_ssid) { case 0U: bss_cfg->bcast_ssid_ctl = 1U; goto ldv_61164; case 1U: bss_cfg->bcast_ssid_ctl = 0U; goto ldv_61164; case 2U: ; default: kfree((void const *)bss_cfg); return (-22); } ldv_61164: mwifiex_uap_set_channel(priv, bss_cfg, params->chandef); mwifiex_set_uap_rates(bss_cfg, params); tmp___1 = mwifiex_set_secure_params(priv, bss_cfg, params); if (tmp___1 != 0) { kfree((void const *)bss_cfg); if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Failed to parse secuirty parameters!\n"); } else { } } else { } return (-1); } else { } mwifiex_set_ht_params(priv, bss_cfg, params); if ((priv->adapter)->is_hw_11ac_capable != 0U) { mwifiex_set_vht_params(priv, bss_cfg, params); mwifiex_set_vht_width(priv, params->chandef.width, (unsigned int )priv->ap_11ac_enabled != 0U); } else { } if ((unsigned int )priv->ap_11ac_enabled != 0U) { mwifiex_set_11ac_ba_params(priv); } else { mwifiex_set_ba_params(priv); } mwifiex_set_wmm_params(priv, bss_cfg, params); tmp___2 = mwifiex_is_11h_active(priv); if (tmp___2 != 0) { mwifiex_set_tpc_params(priv, bss_cfg, params); } else { } tmp___4 = mwifiex_is_11h_active(priv); if (tmp___4 != 0) { tmp___5 = cfg80211_chandef_dfs_required(wiphy, (struct cfg80211_chan_def const *)(& params->chandef), (enum nl80211_iftype )priv->bss_mode); if (tmp___5 == 0) { if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Disable 11h extensions in FW\n"); } else { } } else { } tmp___3 = mwifiex_11h_activate(priv, 0); if (tmp___3 != 0) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Failed to disable 11h extensions!!"); } else { } } else { } return (-1); } else { } priv->state_11h.is_11h_active = 0; } else { } } else { } tmp___6 = mwifiex_config_start_uap(priv, bss_cfg); if (tmp___6 != 0) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Failed to start AP\n"); } else { } } else { } kfree((void const *)bss_cfg); return (-1); } else { } tmp___7 = mwifiex_set_mgmt_ies(priv, & params->beacon); if (tmp___7 != 0) { return (-1); } else { } memcpy((void *)(& priv->bss_cfg), (void const *)bss_cfg, 292UL); kfree((void const *)bss_cfg); return (0); } } static int mwifiex_cfg80211_disconnect(struct wiphy *wiphy , struct net_device *dev , u16 reason_code ) { struct mwifiex_private *priv ; struct mwifiex_private *tmp ; int tmp___0 ; { tmp = mwifiex_netdev_get_priv(dev); priv = tmp; tmp___0 = mwifiex_deauthenticate(priv, (u8 *)0U); if (tmp___0 != 0) { return (-14); } else { } if ((int )(priv->adapter)->debug_mask & 1) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: successfully disconnected from %pM:\treason code %d\n", (u8 *)(& priv->cfg_bssid), (int )reason_code); } else { } } else { } eth_zero_addr((u8 *)(& priv->cfg_bssid)); priv->hs2_enabled = 0; return (0); } } static int mwifiex_cfg80211_inform_ibss_bss(struct mwifiex_private *priv ) { struct ieee80211_channel *chan ; struct mwifiex_bss_info bss_info ; struct cfg80211_bss *bss ; int ie_len ; u8 ie_buf[34U] ; enum ieee80211_band band ; int tmp ; u8 tmp___0 ; int tmp___1 ; { tmp = mwifiex_get_bss_info(priv, & bss_info); if (tmp != 0) { return (-1); } else { } ie_buf[0] = 0U; ie_buf[1] = bss_info.ssid.ssid_len; memcpy((void *)(& ie_buf) + 2U, (void const *)(& bss_info.ssid.ssid), (size_t )bss_info.ssid.ssid_len); ie_len = (int )((unsigned int )ie_buf[1] + 2U); tmp___0 = mwifiex_band_to_radio_type((int )priv->curr_bss_params.band); band = (enum ieee80211_band )tmp___0; tmp___1 = ieee80211_channel_to_frequency((int )bss_info.bss_chan, band); chan = __ieee80211_get_channel(priv->wdev.wiphy, tmp___1); bss = cfg80211_inform_bss(priv->wdev.wiphy, chan, 0, (u8 const *)(& bss_info.bssid), 0ULL, 2, 0, (u8 const *)(& ie_buf), (size_t )ie_len, 0, 208U); cfg80211_put_bss(priv->wdev.wiphy, bss); memcpy((void *)(& priv->cfg_bssid), (void const *)(& bss_info.bssid), 6UL); return (0); } } static int mwifiex_cfg80211_assoc(struct mwifiex_private *priv , size_t ssid_len , u8 const *ssid , u8 const *bssid , int mode , struct ieee80211_channel *channel , struct cfg80211_connect_params *sme , bool privacy ) { struct cfg80211_ssid req_ssid ; int ret ; int auth_type ; struct cfg80211_bss *bss ; u8 is_scanning_required ; int tmp ; int tmp___0 ; int tmp___1 ; { auth_type = 0; bss = (struct cfg80211_bss *)0; is_scanning_required = 0U; memset((void *)(& req_ssid), 0, 33UL); req_ssid.ssid_len = (u8 )ssid_len; if (ssid_len > 32UL) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "invalid SSID - aborting\n"); } else { } } else { } return (-22); } else { } memcpy((void *)(& req_ssid.ssid), (void const *)ssid, ssid_len); if ((unsigned int )req_ssid.ssid_len == 0U || (unsigned int )req_ssid.ssid[0] <= 31U) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "invalid SSID - aborting\n"); } else { } } else { } return (-22); } else { } priv->sec_info.wpa_enabled = 0U; priv->sec_info.wpa2_enabled = 0U; priv->wep_key_curr_index = 0U; priv->sec_info.encryption_mode = 0U; priv->sec_info.is_authtype_auto = 0U; ret = mwifiex_set_encode(priv, (struct key_params *)0, (u8 const *)0U, 0, 0, (u8 const *)0U, 1); if (mode == 1) { if ((int )privacy) { priv->sec_info.encryption_mode = 1027077U; priv->sec_info.authentication_mode = 0U; } else { } goto done; } else { } if ((unsigned int )sme->auth_type == 5U) { auth_type = 0; priv->sec_info.is_authtype_auto = 1U; } else { auth_type = (int )sme->auth_type; } if (sme->crypto.n_ciphers_pairwise != 0) { priv->sec_info.encryption_mode = sme->crypto.ciphers_pairwise[0]; priv->sec_info.authentication_mode = (u32 )auth_type; } else { } if (sme->crypto.cipher_group != 0U) { priv->sec_info.encryption_mode = sme->crypto.cipher_group; priv->sec_info.authentication_mode = (u32 )auth_type; } else { } if ((unsigned long )sme->ie != (unsigned long )((u8 const *)0U)) { ret = mwifiex_set_gen_ie(priv, sme->ie, (int )sme->ie_len); } else { } if ((unsigned long )sme->key != (unsigned long )((u8 const *)0U)) { tmp = mwifiex_is_alg_wep(priv->sec_info.encryption_mode); if (tmp != 0) { if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: setting wep encryption\twith key len %d\n", (int )sme->key_len); } else { } } else { } priv->wep_key_curr_index = (u16 )sme->key_idx; ret = mwifiex_set_encode(priv, (struct key_params *)0, sme->key, (int )sme->key_len, (int )sme->key_idx, (u8 const *)0U, 0); } else { } } else { } done: ; ldv_61200: ; if ((unsigned int )is_scanning_required != 0U) { tmp___0 = mwifiex_request_scan(priv, & req_ssid); if (tmp___0 != 0) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "scan error\n"); } else { } } else { } return (-14); } else { } } else { } if (mode == 1) { bss = cfg80211_get_bss(priv->wdev.wiphy, channel, bssid, ssid, ssid_len, 2, 2); } else { bss = cfg80211_get_bss(priv->wdev.wiphy, channel, bssid, ssid, ssid_len, 0, 2); } if ((unsigned long )bss == (unsigned long )((struct cfg80211_bss *)0)) { if ((unsigned int )is_scanning_required != 0U) { if (((priv->adapter)->debug_mask & 536870912U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "assoc: requested bss not found in scan results\n"); } else { } } else { } goto ldv_61199; } else { } is_scanning_required = 1U; } else { if ((int )(priv->adapter)->debug_mask & 1) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: trying to associate to \'%s\' bssid %pM\n", (char *)(& req_ssid.ssid), (u8 *)(& bss->bssid)); } else { } } else { } memcpy((void *)(& priv->cfg_bssid), (void const *)(& bss->bssid), 6UL); goto ldv_61199; } goto ldv_61200; ldv_61199: ret = mwifiex_bss_start(priv, bss, & req_ssid); if (ret != 0) { return (ret); } else { } if (mode == 1) { tmp___1 = mwifiex_cfg80211_inform_ibss_bss(priv); if (tmp___1 != 0) { return (-14); } else { } } else { } return (ret); } } static int mwifiex_cfg80211_connect(struct wiphy *wiphy , struct net_device *dev , struct cfg80211_connect_params *sme ) { struct mwifiex_private *priv ; struct mwifiex_private *tmp ; struct mwifiex_adapter *adapter ; int ret ; { tmp = mwifiex_netdev_get_priv(dev); priv = tmp; adapter = priv->adapter; if ((int )priv->bss_role & 1) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "%s: reject infra assoc request in non-STA role\n", (char *)(& dev->name)); } else { } } else { } return (-22); } else { } if ((unsigned long )priv->wdev.current_bss != (unsigned long )((struct cfg80211_internal_bss *)0)) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "%s: already connected\n", (char *)(& dev->name)); } else { } } else { } return (-114); } else { } if ((int )adapter->surprise_removed || (unsigned int )adapter->is_cmd_timedout != 0U) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "%s: Ignore connection.\tCard removed or FW in bad state\n", (char *)(& dev->name)); } else { } } else { } return (-14); } else { } if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: Trying to associate to %s and bssid %pM\n", (char *)sme->ssid, sme->bssid); } else { } } else { } ret = mwifiex_cfg80211_assoc(priv, sme->ssid_len, sme->ssid, sme->bssid, (int )priv->bss_mode, sme->channel, sme, 0); if (ret == 0) { cfg80211_connect_result(priv->netdev, (u8 const *)(& priv->cfg_bssid), (u8 const *)0U, 0UL, (u8 const *)0U, 0UL, 0, 208U); if ((int )(priv->adapter)->debug_mask & 1) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: associated to bssid %pM successfully\n", (u8 *)(& priv->cfg_bssid)); } else { } } else { } if ((((unsigned long )(priv->adapter)->fw_cap_info & 16384UL) != 0UL && (int )(priv->adapter)->auto_tdls) && (unsigned int )priv->bss_type == 0U) { mwifiex_setup_auto_tdls_timer(priv); } else { } } else { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: association to bssid %pM failed\n", (u8 *)(& priv->cfg_bssid)); } else { } } else { } eth_zero_addr((u8 *)(& priv->cfg_bssid)); if (ret > 0) { cfg80211_connect_result(priv->netdev, (u8 const *)(& priv->cfg_bssid), (u8 const *)0U, 0UL, (u8 const *)0U, 0UL, (int )((u16 )ret), 208U); } else { cfg80211_connect_result(priv->netdev, (u8 const *)(& priv->cfg_bssid), (u8 const *)0U, 0UL, (u8 const *)0U, 0UL, 1, 208U); } } return (0); } } static int mwifiex_set_ibss_params(struct mwifiex_private *priv , struct cfg80211_ibss_params *params ) { struct mwifiex_adapter *adapter ; int index ; int i ; u8 config_bands ; enum nl80211_channel_type tmp ; enum nl80211_channel_type tmp___0 ; enum nl80211_channel_type tmp___1 ; int tmp___2 ; { adapter = priv->adapter; index = 0; config_bands = 0U; if ((unsigned int )(params->chandef.chan)->band == 0U) { if (params->basic_rates == 0U) { config_bands = 3U; } else { i = 0; goto ldv_61219; ldv_61218: ; if ((unsigned int )mwifiex_rates[i].bitrate == 60U) { index = 1 << i; goto ldv_61217; } else { } i = i + 1; ldv_61219: ; if (mwifiex_band_2ghz.n_bitrates > i) { goto ldv_61218; } else { } ldv_61217: ; if (params->basic_rates < (u32 )index) { config_bands = 1U; } else { config_bands = 2U; if (params->basic_rates % (u32 )index != 0U) { config_bands = (u8 )((unsigned int )config_bands | 1U); } else { } } } tmp = cfg80211_get_chandef_type((struct cfg80211_chan_def const *)(& params->chandef)); if ((unsigned int )tmp != 0U) { config_bands = (u8 )((unsigned int )config_bands | 10U); } else { } } else { tmp___0 = cfg80211_get_chandef_type((struct cfg80211_chan_def const *)(& params->chandef)); if ((unsigned int )tmp___0 == 0U) { config_bands = 4U; } else { config_bands = 20U; } } if ((((int )adapter->fw_bands | (int )config_bands) & ~ ((int )adapter->fw_bands)) == 0) { adapter->config_bands = config_bands; adapter->adhoc_start_band = config_bands; if (((int )config_bands & 8) != 0 || ((int )config_bands & 16) != 0) { adapter->adhoc_11n_enabled = 1U; } else { adapter->adhoc_11n_enabled = 0U; } } else { } tmp___1 = cfg80211_get_chandef_type((struct cfg80211_chan_def const *)(& params->chandef)); adapter->sec_chan_offset = mwifiex_chan_type_to_sec_chan_offset(tmp___1); tmp___2 = ieee80211_frequency_to_channel((int )(params->chandef.chan)->center_freq); priv->adhoc_channel = (u8 )tmp___2; if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: set ibss band %d, chan %d, chan offset %d\n", (int )config_bands, (int )priv->adhoc_channel, (int )adapter->sec_chan_offset); } else { } } else { } return (0); } } static int mwifiex_cfg80211_join_ibss(struct wiphy *wiphy , struct net_device *dev , struct cfg80211_ibss_params *params ) { struct mwifiex_private *priv ; struct mwifiex_private *tmp ; int ret ; { tmp = mwifiex_netdev_get_priv(dev); priv = tmp; ret = 0; if (priv->bss_mode != 1U) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "request to join ibss received\twhen station is not in ibss mode\n"); } else { } } else { } goto done; } else { } if ((int )(priv->adapter)->debug_mask & 1) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: trying to join to %s and bssid %pM\n", (char *)params->ssid, params->bssid); } else { } } else { } mwifiex_set_ibss_params(priv, params); ret = mwifiex_cfg80211_assoc(priv, (size_t )params->ssid_len, params->ssid, params->bssid, (int )priv->bss_mode, params->chandef.chan, (struct cfg80211_connect_params *)0, (int )params->privacy); done: ; if (ret == 0) { cfg80211_ibss_joined(priv->netdev, (u8 const *)(& priv->cfg_bssid), params->chandef.chan, 208U); if ((int )(priv->adapter)->debug_mask & 1) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: joined/created adhoc network with bssid\t%pM successfully\n", (u8 *)(& priv->cfg_bssid)); } else { } } else { } } else if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: failed creating/joining adhoc network\n"); } else { } } else { } return (ret); } } static int mwifiex_cfg80211_leave_ibss(struct wiphy *wiphy , struct net_device *dev ) { struct mwifiex_private *priv ; struct mwifiex_private *tmp ; int tmp___0 ; { tmp = mwifiex_netdev_get_priv(dev); priv = tmp; if ((int )(priv->adapter)->debug_mask & 1) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: disconnecting from essid %pM\n", (u8 *)(& priv->cfg_bssid)); } else { } } else { } tmp___0 = mwifiex_deauthenticate(priv, (u8 *)0U); if (tmp___0 != 0) { return (-14); } else { } eth_zero_addr((u8 *)(& priv->cfg_bssid)); return (0); } } static int mwifiex_cfg80211_scan(struct wiphy *wiphy , struct cfg80211_scan_request *request ) { struct net_device *dev ; struct mwifiex_private *priv ; struct mwifiex_private *tmp ; int i ; int offset ; int ret ; struct ieee80211_channel *chan ; struct ieee_types_header *ie ; struct mwifiex_user_scan_cfg *user_scan_cfg ; void *tmp___0 ; u32 __min1 ; u32 __min2 ; u8 tmp___1 ; { dev = (request->wdev)->netdev; tmp = mwifiex_netdev_get_priv(dev); priv = tmp; if (((priv->adapter)->debug_mask & 16U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "info: received scan request on %s\n", (char *)(& dev->name)); } else { } } else { } if ((unsigned long )priv->scan_request != (unsigned long )((struct cfg80211_scan_request *)0) || (int )priv->scan_aborting) { if (((priv->adapter)->debug_mask & 536870912U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "cmd: Scan already in process..\n"); } else { } } else { } return (-16); } else { } tmp___0 = kzalloc(420UL, 208U); user_scan_cfg = (struct mwifiex_user_scan_cfg *)tmp___0; if ((unsigned long )user_scan_cfg == (unsigned long )((struct mwifiex_user_scan_cfg *)0)) { return (-12); } else { } priv->scan_request = request; user_scan_cfg->num_ssids = (u8 )request->n_ssids; user_scan_cfg->ssid_list = request->ssids; if ((unsigned long )request->ie != (unsigned long )((u8 const *)0U) && request->ie_len != 0UL) { offset = 0; i = 0; goto ldv_61248; ldv_61247: ; if ((unsigned int )priv->vs_ie[i].mask != 0U) { goto ldv_61245; } else { } priv->vs_ie[i].mask = 1U; ie = (struct ieee_types_header *)request->ie + (unsigned long )offset; memcpy((void *)(& priv->vs_ie[i].ie), (void const *)ie, (unsigned long )ie->len + 2UL); offset = (int )(((unsigned int )ie->len + (unsigned int )offset) + 2U); if ((size_t )offset >= request->ie_len) { goto ldv_61246; } else { } ldv_61245: i = i + 1; ldv_61248: ; if (i <= 7) { goto ldv_61247; } else { } ldv_61246: ; } else { } i = 0; goto ldv_61253; ldv_61252: chan = request->channels[i]; user_scan_cfg->chan_list[i].chan_number = (u8 )chan->hw_value; user_scan_cfg->chan_list[i].radio_type = (u8 )chan->band; if ((chan->flags & 2U) != 0U || request->n_ssids == 0) { user_scan_cfg->chan_list[i].scan_type = 2U; } else { user_scan_cfg->chan_list[i].scan_type = 1U; } user_scan_cfg->chan_list[i].scan_time = 0U; i = i + 1; ldv_61253: __min1 = request->n_channels; __min2 = 50U; if ((u32 )i < (__min1 < __min2 ? __min1 : __min2)) { goto ldv_61252; } else { } if ((int )(priv->adapter)->scan_chan_gap_enabled) { tmp___1 = mwifiex_is_any_intf_active(priv); if ((unsigned int )tmp___1 != 0U) { user_scan_cfg->scan_chan_gap = (priv->adapter)->scan_chan_gap_time; } else { } } else { } ret = mwifiex_scan_networks(priv, (struct mwifiex_user_scan_cfg const *)user_scan_cfg); kfree((void const *)user_scan_cfg); if (ret != 0) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "scan failed: %d\n", ret); } else { } } else { } priv->scan_aborting = 0; priv->scan_request = (struct cfg80211_scan_request *)0; return (ret); } else { } if ((unsigned long )request->ie != (unsigned long )((u8 const *)0U) && request->ie_len != 0UL) { i = 0; goto ldv_61256; ldv_61255: ; if ((unsigned int )priv->vs_ie[i].mask == 1U) { priv->vs_ie[i].mask = 0U; memset((void *)(& priv->vs_ie[i].ie), 0, 256UL); } else { } i = i + 1; ldv_61256: ; if (i <= 7) { goto ldv_61255; } else { } } else { } return (0); } } static void mwifiex_setup_vht_caps(struct ieee80211_sta_vht_cap *vht_info , struct mwifiex_private *priv ) { struct mwifiex_adapter *adapter ; { adapter = priv->adapter; vht_info->vht_supported = 1; vht_info->cap = adapter->hw_dot_11ac_dev_cap; vht_info->vht_mcs.rx_mcs_map = (unsigned short )adapter->hw_dot_11ac_mcs_support; vht_info->vht_mcs.rx_highest = 0U; vht_info->vht_mcs.tx_mcs_map = (unsigned short )(adapter->hw_dot_11ac_mcs_support >> 16); vht_info->vht_mcs.tx_highest = 0U; return; } } static void mwifiex_setup_ht_caps(struct ieee80211_sta_ht_cap *ht_info , struct mwifiex_private *priv ) { int rx_mcs_supp ; struct ieee80211_mcs_info mcs_set ; u8 *mcs ; struct mwifiex_adapter *adapter ; { mcs = (u8 *)(& mcs_set); adapter = priv->adapter; ht_info->ht_supported = 1; ht_info->ampdu_factor = 3U; ht_info->ampdu_density = 0U; memset((void *)(& ht_info->mcs), 0, 16UL); if (((unsigned long )adapter->hw_dot_11n_dev_cap & 131072UL) != 0UL) { ht_info->cap = (u16 )((unsigned int )ht_info->cap | 2U); } else { ht_info->cap = (unsigned int )ht_info->cap & 65533U; } if (((unsigned long )adapter->hw_dot_11n_dev_cap & 8388608UL) != 0UL) { ht_info->cap = (u16 )((unsigned int )ht_info->cap | 32U); } else { ht_info->cap = (unsigned int )ht_info->cap & 65503U; } if (((unsigned long )adapter->hw_dot_11n_dev_cap & 16777216UL) != 0UL) { ht_info->cap = (u16 )((unsigned int )ht_info->cap | 64U); } else { ht_info->cap = (unsigned int )ht_info->cap & 65471U; } if ((unsigned int )adapter->user_dev_mcs_support == 34U) { ht_info->cap = (u16 )((unsigned int )ht_info->cap | 768U); } else { ht_info->cap = (u16 )((unsigned int )ht_info->cap | 256U); } if (((unsigned long )adapter->hw_dot_11n_dev_cap & 33554432UL) != 0UL) { ht_info->cap = (u16 )((unsigned int )ht_info->cap | 128U); } else { ht_info->cap = (unsigned int )ht_info->cap & 65407U; } if (((unsigned long )adapter->hw_dot_11n_dev_cap & 536870912UL) != 0UL) { ht_info->cap = (u16 )((unsigned int )ht_info->cap | 16U); } else { ht_info->cap = (unsigned int )ht_info->cap & 65519U; } if (((unsigned long )adapter->hw_dot_11n_dev_cap & 256UL) != 0UL) { ht_info->cap = (u16 )((unsigned int )ht_info->cap | 16384U); } else { ht_info->cap = (unsigned int )ht_info->cap & 49151U; } if (((unsigned long )adapter->hw_dot_11n_dev_cap & 4194304UL) != 0UL) { ht_info->cap = (u16 )((unsigned int )ht_info->cap | 1U); } else { ht_info->cap = (unsigned int )ht_info->cap & 65534U; } ht_info->cap = (unsigned int )ht_info->cap & 63487U; ht_info->cap = (u16 )((unsigned int )ht_info->cap | 12U); rx_mcs_supp = (int )adapter->user_dev_mcs_support & 15; memset((void *)mcs, 255, (size_t )rx_mcs_supp); memset((void *)mcs + (unsigned long )rx_mcs_supp, 0, 16UL - (unsigned long )rx_mcs_supp); if (priv->bss_mode == 2U || ((unsigned long )adapter->hw_dot_11n_dev_cap & 131072UL) != 0UL) { mcs_set.rx_mask[4] = (u8 )((unsigned int )mcs_set.rx_mask[4] | 1U); } else { } memcpy((void *)(& ht_info->mcs), (void const *)mcs, 16UL); ht_info->mcs.tx_params = 1U; return; } } struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy , char const *name , unsigned char name_assign_type , enum nl80211_iftype type , u32 *flags , struct vif_params *params ) { struct mwifiex_adapter *adapter ; void *tmp ; struct mwifiex_private *priv ; struct net_device *dev ; void *mdev_priv ; void *tmp___0 ; void *tmp___1 ; void *tmp___2 ; void *tmp___3 ; void *tmp___4 ; void *tmp___5 ; void *tmp___6 ; void *tmp___7 ; int tmp___8 ; void *tmp___9 ; void *tmp___10 ; struct net *tmp___11 ; void *tmp___12 ; int tmp___13 ; struct lock_class_key __key ; char const *__lock_name ; struct workqueue_struct *tmp___14 ; void *tmp___15 ; struct lock_class_key __key___0 ; atomic_long_t __constr_expr_0 ; struct lock_class_key __key___1 ; struct lock_class_key __key___2 ; char const *__lock_name___0 ; struct workqueue_struct *tmp___16 ; void *tmp___17 ; struct lock_class_key __key___3 ; atomic_long_t __constr_expr_1 ; struct lock_class_key __key___4 ; void *tmp___18 ; { tmp = mwifiex_cfg80211_get_adapter(wiphy); adapter = (struct mwifiex_adapter *)tmp; if ((unsigned long )adapter == (unsigned long )((struct mwifiex_adapter *)0)) { tmp___0 = ERR_PTR(-14L); return ((struct wireless_dev *)tmp___0); } else { } switch ((unsigned int )type) { case 0U: ; case 2U: ; case 1U: ; if ((int )adapter->curr_iface_comb.sta_intf == (int )adapter->iface_limit.sta_intf) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cannot create multiple sta/adhoc ifaces\n"); } else { } } else { } tmp___1 = ERR_PTR(-22L); return ((struct wireless_dev *)tmp___1); } else { } priv = mwifiex_get_unused_priv(adapter); if ((unsigned long )priv == (unsigned long )((struct mwifiex_private *)0)) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "could not get free private struct\n"); } else { } } else { } tmp___2 = ERR_PTR(-14L); return ((struct wireless_dev *)tmp___2); } else { } priv->wdev.wiphy = wiphy; priv->wdev.iftype = 2; if ((unsigned int )type == 0U) { priv->bss_mode = 2U; } else { priv->bss_mode = (u32 )type; } priv->bss_type = 0U; priv->frame_type = 0U; priv->bss_priority = 0U; priv->bss_role = 0U; priv->bss_num = adapter->curr_iface_comb.sta_intf; goto ldv_61286; case 3U: ; if ((int )adapter->curr_iface_comb.uap_intf == (int )adapter->iface_limit.uap_intf) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cannot create multiple AP ifaces\n"); } else { } } else { } tmp___3 = ERR_PTR(-22L); return ((struct wireless_dev *)tmp___3); } else { } priv = mwifiex_get_unused_priv(adapter); if ((unsigned long )priv == (unsigned long )((struct mwifiex_private *)0)) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "could not get free private struct\n"); } else { } } else { } tmp___4 = ERR_PTR(-14L); return ((struct wireless_dev *)tmp___4); } else { } priv->wdev.wiphy = wiphy; priv->wdev.iftype = 3; priv->bss_type = 1U; priv->frame_type = 0U; priv->bss_priority = 0U; priv->bss_role = 1U; priv->bss_started = 0U; priv->bss_num = adapter->curr_iface_comb.uap_intf; priv->bss_mode = (u32 )type; goto ldv_61286; case 8U: ; if ((int )adapter->curr_iface_comb.p2p_intf == (int )adapter->iface_limit.p2p_intf) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cannot create multiple P2P ifaces\n"); } else { } } else { } tmp___5 = ERR_PTR(-22L); return ((struct wireless_dev *)tmp___5); } else { } priv = mwifiex_get_unused_priv(adapter); if ((unsigned long )priv == (unsigned long )((struct mwifiex_private *)0)) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "could not get free private struct\n"); } else { } } else { } tmp___6 = ERR_PTR(-14L); return ((struct wireless_dev *)tmp___6); } else { } priv->wdev.wiphy = wiphy; priv->wdev.iftype = 8; priv->bss_mode = 8U; priv->bss_type = 2U; priv->frame_type = 0U; priv->bss_priority = 0U; priv->bss_role = 0U; priv->bss_started = 0U; priv->bss_num = adapter->curr_iface_comb.p2p_intf; tmp___8 = mwifiex_cfg80211_init_p2p_client(priv); if (tmp___8 != 0) { memset((void *)(& priv->wdev), 0, 976UL); priv->wdev.iftype = 0; tmp___7 = ERR_PTR(-14L); return ((struct wireless_dev *)tmp___7); } else { } goto ldv_61286; default: ; if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "type not supported\n"); } else { } } else { } tmp___9 = ERR_PTR(-22L); return ((struct wireless_dev *)tmp___9); } ldv_61286: dev = alloc_netdev_mqs(8, name, (int )name_assign_type, & ether_setup, 4U, 1U); if ((unsigned long )dev == (unsigned long )((struct net_device *)0)) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "no memory available for netdevice\n"); } else { } } else { } memset((void *)(& priv->wdev), 0, 976UL); priv->wdev.iftype = 0; priv->bss_mode = 0U; tmp___10 = ERR_PTR(-12L); return ((struct wireless_dev *)tmp___10); } else { } mwifiex_init_priv_params(priv, dev); priv->netdev = dev; mwifiex_setup_ht_caps(& (wiphy->bands[0])->ht_cap, priv); if (adapter->is_hw_11ac_capable != 0U) { mwifiex_setup_vht_caps(& (wiphy->bands[0])->vht_cap, priv); } else { } if (((int )adapter->config_bands & 4) != 0) { mwifiex_setup_ht_caps(& (wiphy->bands[1])->ht_cap, priv); } else { } if (((int )adapter->config_bands & 4) != 0 && adapter->is_hw_11ac_capable != 0U) { mwifiex_setup_vht_caps(& (wiphy->bands[1])->vht_cap, priv); } else { } tmp___11 = wiphy_net(wiphy); dev_net_set(dev, tmp___11); dev->ieee80211_ptr = & priv->wdev; (dev->ieee80211_ptr)->iftype = (enum nl80211_iftype )priv->bss_mode; memcpy((void *)dev->dev_addr, (void const *)(& wiphy->perm_addr), 6UL); dev->dev.parent = wiphy_dev(wiphy); dev->flags = dev->flags | 4098U; dev->watchdog_timeo = 1250; dev->hard_header_len = (unsigned int )dev->hard_header_len + 100U; dev->ethtool_ops = & mwifiex_ethtool_ops; mdev_priv = netdev_priv((struct net_device const *)dev); *((unsigned long *)mdev_priv) = (unsigned long )priv; dev->dev.parent = adapter->dev; tmp___13 = register_netdevice(dev); if (tmp___13 != 0) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cannot register virtual network device\n"); } else { } } else { } free_netdev(dev); priv->bss_mode = 0U; priv->netdev = (struct net_device *)0; memset((void *)(& priv->wdev), 0, 976UL); priv->wdev.iftype = 0; tmp___12 = ERR_PTR(-14L); return ((struct wireless_dev *)tmp___12); } else { } __lock_name = "\"MWIFIEX_DFS_CAC%s\"name"; tmp___14 = __alloc_workqueue_key("MWIFIEX_DFS_CAC%s", 26U, 1, & __key, __lock_name, name); priv->dfs_cac_workqueue = tmp___14; if ((unsigned long )priv->dfs_cac_workqueue == (unsigned long )((struct workqueue_struct *)0)) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cannot register virtual network device\n"); } else { } } else { } free_netdev(dev); priv->bss_mode = 0U; priv->netdev = (struct net_device *)0; memset((void *)(& priv->wdev), 0, 976UL); priv->wdev.iftype = 0; tmp___15 = ERR_PTR(-12L); return ((struct wireless_dev *)tmp___15); } else { } __init_work(& priv->dfs_cac_work.work, 0); __constr_expr_0.counter = 137438953408L; priv->dfs_cac_work.work.data = __constr_expr_0; lockdep_init_map(& priv->dfs_cac_work.work.lockdep_map, "(&(&priv->dfs_cac_work)->work)", & __key___0, 0); INIT_LIST_HEAD(& priv->dfs_cac_work.work.entry); priv->dfs_cac_work.work.func = & mwifiex_dfs_cac_work_queue; init_timer_key(& priv->dfs_cac_work.timer, 2097152U, "(&(&priv->dfs_cac_work)->timer)", & __key___1); priv->dfs_cac_work.timer.function = & delayed_work_timer_fn; priv->dfs_cac_work.timer.data = (unsigned long )(& priv->dfs_cac_work); __lock_name___0 = "\"MWIFIEX_DFS_CHSW%s\"name"; tmp___16 = __alloc_workqueue_key("MWIFIEX_DFS_CHSW%s", 26U, 1, & __key___2, __lock_name___0, name); priv->dfs_chan_sw_workqueue = tmp___16; if ((unsigned long )priv->dfs_chan_sw_workqueue == (unsigned long )((struct workqueue_struct *)0)) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "cannot register virtual network device\n"); } else { } } else { } free_netdev(dev); priv->bss_mode = 0U; priv->netdev = (struct net_device *)0; memset((void *)(& priv->wdev), 0, 976UL); priv->wdev.iftype = 0; tmp___17 = ERR_PTR(-12L); return ((struct wireless_dev *)tmp___17); } else { } __init_work(& priv->dfs_chan_sw_work.work, 0); __constr_expr_1.counter = 137438953408L; priv->dfs_chan_sw_work.work.data = __constr_expr_1; lockdep_init_map(& priv->dfs_chan_sw_work.work.lockdep_map, "(&(&priv->dfs_chan_sw_work)->work)", & __key___3, 0); INIT_LIST_HEAD(& priv->dfs_chan_sw_work.work.entry); priv->dfs_chan_sw_work.work.func = & mwifiex_dfs_chan_sw_work_queue; init_timer_key(& priv->dfs_chan_sw_work.timer, 2097152U, "(&(&priv->dfs_chan_sw_work)->timer)", & __key___4); priv->dfs_chan_sw_work.timer.function = & delayed_work_timer_fn; priv->dfs_chan_sw_work.timer.data = (unsigned long )(& priv->dfs_chan_sw_work); sema_init(& priv->async_sem, 1); if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "info: %s: Marvell 802.11 Adapter\n", (char *)(& dev->name)); } else { } } else { } mwifiex_dev_debugfs_init(priv); switch ((unsigned int )type) { case 0U: ; case 2U: ; case 1U: adapter->curr_iface_comb.sta_intf = (u8 )((int )adapter->curr_iface_comb.sta_intf + 1); goto ldv_61305; case 3U: adapter->curr_iface_comb.uap_intf = (u8 )((int )adapter->curr_iface_comb.uap_intf + 1); goto ldv_61305; case 8U: adapter->curr_iface_comb.p2p_intf = (u8 )((int )adapter->curr_iface_comb.p2p_intf + 1); goto ldv_61305; default: ; if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "type not supported\n"); } else { } } else { } tmp___18 = ERR_PTR(-22L); return ((struct wireless_dev *)tmp___18); } ldv_61305: ; return (& priv->wdev); } } static char const __kstrtab_mwifiex_add_virtual_intf[25U] = { 'm', 'w', 'i', 'f', 'i', 'e', 'x', '_', 'a', 'd', 'd', '_', 'v', 'i', 'r', 't', 'u', 'a', 'l', '_', 'i', 'n', 't', 'f', '\000'}; struct kernel_symbol const __ksymtab_mwifiex_add_virtual_intf ; struct kernel_symbol const __ksymtab_mwifiex_add_virtual_intf = {(unsigned long )(& mwifiex_add_virtual_intf), (char const *)(& __kstrtab_mwifiex_add_virtual_intf)}; int mwifiex_del_virtual_intf(struct wiphy *wiphy , struct wireless_dev *wdev ) { struct mwifiex_private *priv ; struct mwifiex_private *tmp ; struct mwifiex_adapter *adapter ; bool tmp___0 ; { tmp = mwifiex_netdev_get_priv(wdev->netdev); priv = tmp; adapter = priv->adapter; mwifiex_dev_debugfs_remove(priv); mwifiex_stop_net_dev_queue(priv->netdev, adapter); tmp___0 = netif_carrier_ok((struct net_device const *)priv->netdev); if ((int )tmp___0) { netif_carrier_off(priv->netdev); } else { } if ((unsigned int )(wdev->netdev)->reg_state == 1U) { unregister_netdevice(wdev->netdev); } else { } if ((unsigned long )priv->dfs_cac_workqueue != (unsigned long )((struct workqueue_struct *)0)) { ldv_flush_workqueue_366(priv->dfs_cac_workqueue); ldv_destroy_workqueue_367(priv->dfs_cac_workqueue); priv->dfs_cac_workqueue = (struct workqueue_struct *)0; } else { } if ((unsigned long )priv->dfs_chan_sw_workqueue != (unsigned long )((struct workqueue_struct *)0)) { ldv_flush_workqueue_368(priv->dfs_chan_sw_workqueue); ldv_destroy_workqueue_369(priv->dfs_chan_sw_workqueue); priv->dfs_chan_sw_workqueue = (struct workqueue_struct *)0; } else { } (priv->netdev)->ieee80211_ptr = (struct wireless_dev *)0; priv->netdev = (struct net_device *)0; priv->wdev.iftype = 0; priv->media_connected = 0U; switch (priv->bss_mode) { case 0U: ; case 2U: ; case 1U: adapter->curr_iface_comb.sta_intf = (u8 )((int )adapter->curr_iface_comb.sta_intf + 1); goto ldv_61330; case 3U: adapter->curr_iface_comb.uap_intf = (u8 )((int )adapter->curr_iface_comb.uap_intf + 1); goto ldv_61330; case 8U: ; case 9U: adapter->curr_iface_comb.p2p_intf = (u8 )((int )adapter->curr_iface_comb.p2p_intf + 1); goto ldv_61330; default: ; if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "del_virtual_intf: type not supported\n"); } else { } } else { } goto ldv_61330; } ldv_61330: priv->bss_mode = 0U; if (((unsigned long )priv->bss_role & 1UL) == 0UL || (int )priv->bss_role & 1) { kfree((void const *)priv->hist_data); } else { } return (0); } } static char const __kstrtab_mwifiex_del_virtual_intf[25U] = { 'm', 'w', 'i', 'f', 'i', 'e', 'x', '_', 'd', 'e', 'l', '_', 'v', 'i', 'r', 't', 'u', 'a', 'l', '_', 'i', 'n', 't', 'f', '\000'}; struct kernel_symbol const __ksymtab_mwifiex_del_virtual_intf ; struct kernel_symbol const __ksymtab_mwifiex_del_virtual_intf = {(unsigned long )(& mwifiex_del_virtual_intf), (char const *)(& __kstrtab_mwifiex_del_virtual_intf)}; static bool mwifiex_is_pattern_supported(struct cfg80211_pkt_pattern *pat , s8 *byte_seq , u8 max_byte_seq ) { int j ; int k ; int valid_byte_cnt ; bool dont_care_byte ; { valid_byte_cnt = 0; dont_care_byte = 0; j = 0; goto ldv_61356; ldv_61355: k = 0; goto ldv_61353; ldv_61352: ; if (((int )*(pat->mask + (unsigned long )j) >> k) & 1) { memcpy((void *)byte_seq + (unsigned long )valid_byte_cnt, (void const *)pat->pattern + (unsigned long )(j * 8 + k), 1UL); valid_byte_cnt = valid_byte_cnt + 1; if ((int )dont_care_byte) { return (0); } else { } } else if (valid_byte_cnt != 0) { dont_care_byte = 1; } else { } if ((int )max_byte_seq < valid_byte_cnt) { return (0); } else { } k = k + 1; ldv_61353: ; if (k <= 7) { goto ldv_61352; } else { } j = j + 1; ldv_61356: ; if ((pat->pattern_len + 7) / 8 > j) { goto ldv_61355; } else { } *(byte_seq + (unsigned long )max_byte_seq) = (s8 )valid_byte_cnt; return (1); } } static void mwifiex_set_auto_arp_mef_entry(struct mwifiex_private *priv , struct mwifiex_mef_entry *mef_entry ) { int i ; int filt_num ; int num_ipv4 ; struct in_device *in_dev ; struct in_ifaddr *ifa ; __be32 ips[4U] ; struct mwifiex_adapter *adapter ; { filt_num = 0; num_ipv4 = 0; adapter = priv->adapter; mef_entry->mode = 1U; mef_entry->action = 16U; memset((void *)(& ips), 0, 16UL); i = 0; goto ldv_61371; ldv_61370: ; if ((unsigned long )(adapter->priv[i])->netdev != (unsigned long )((struct net_device *)0)) { in_dev = __in_dev_get_rtnl((struct net_device const *)(adapter->priv[i])->netdev); if ((unsigned long )in_dev == (unsigned long )((struct in_device *)0)) { goto ldv_61369; } else { } ifa = in_dev->ifa_list; if ((unsigned long )ifa == (unsigned long )((struct in_ifaddr *)0) || ifa->ifa_local == 0U) { goto ldv_61369; } else { } ips[i] = ifa->ifa_local; num_ipv4 = num_ipv4 + 1; } else { } ldv_61369: i = i + 1; ldv_61371: ; if (i <= 2) { goto ldv_61370; } else { } i = 0; goto ldv_61375; ldv_61374: ; if (ips[i] == 0U) { goto ldv_61373; } else { } mef_entry->filter[filt_num].repeat = 1U; memcpy((void *)(& mef_entry->filter[filt_num].byte_seq), (void const *)(& ips) + (unsigned long )i, 4UL); mef_entry->filter[filt_num].byte_seq[6] = 4; mef_entry->filter[filt_num].offset = 46U; mef_entry->filter[filt_num].filt_type = 65U; if (filt_num != 0) { mef_entry->filter[filt_num].filt_action = 69U; } else { } filt_num = filt_num + 1; ldv_61373: i = i + 1; ldv_61375: ; if (i < num_ipv4) { goto ldv_61374; } else { } mef_entry->filter[filt_num].repeat = 1U; mef_entry->filter[filt_num].byte_seq[0] = 8; mef_entry->filter[filt_num].byte_seq[1] = 6; mef_entry->filter[filt_num].byte_seq[6] = 2; mef_entry->filter[filt_num].offset = 20U; mef_entry->filter[filt_num].filt_type = 65U; mef_entry->filter[filt_num].filt_action = 68U; return; } } static int mwifiex_set_wowlan_mef_entry(struct mwifiex_private *priv , struct mwifiex_ds_mef_cfg *mef_cfg , struct mwifiex_mef_entry *mef_entry , struct cfg80211_wowlan *wowlan ) { int i ; int filt_num ; int ret ; bool first_pat ; u8 byte_seq[7U] ; u8 ipv4_mc_mac[2U] ; u8 ipv6_mc_mac[3U] ; bool tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; bool tmp___3 ; { filt_num = 0; ret = 0; first_pat = 1; ipv4_mc_mac[0] = 51U; ipv4_mc_mac[1] = 51U; ipv6_mc_mac[0] = 1U; ipv6_mc_mac[1] = 0U; ipv6_mc_mac[2] = 94U; mef_entry->mode = 1U; mef_entry->action = 3U; i = 0; goto ldv_61392; ldv_61391: memset((void *)(& byte_seq), 0, 7UL); tmp = mwifiex_is_pattern_supported(wowlan->patterns + (unsigned long )i, (s8 *)(& byte_seq), 6); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Pattern not supported\n"); } else { } } else { } kfree((void const *)mef_entry); return (-95); } else { } if ((wowlan->patterns + (unsigned long )i)->pkt_offset == 0) { if (((int )byte_seq[0] & 1) == 0 && (unsigned int )byte_seq[6] == 1U) { mef_cfg->criteria = mef_cfg->criteria | 2U; goto ldv_61390; } else { tmp___3 = is_broadcast_ether_addr((u8 const *)(& byte_seq)); if ((int )tmp___3) { mef_cfg->criteria = mef_cfg->criteria | 1U; goto ldv_61390; } else { tmp___1 = memcmp((void const *)(& byte_seq), (void const *)(& ipv4_mc_mac), 2UL); if (tmp___1 == 0 && (unsigned int )byte_seq[6] == 2U) { mef_cfg->criteria = mef_cfg->criteria | 8U; goto ldv_61390; } else { tmp___2 = memcmp((void const *)(& byte_seq), (void const *)(& ipv6_mc_mac), 3UL); if (tmp___2 == 0 && (unsigned int )byte_seq[6] == 3U) { mef_cfg->criteria = mef_cfg->criteria | 8U; goto ldv_61390; } else { } } } } } else { } mef_entry->filter[filt_num].repeat = 1U; mef_entry->filter[filt_num].offset = (u16 )(wowlan->patterns + (unsigned long )i)->pkt_offset; memcpy((void *)(& mef_entry->filter[filt_num].byte_seq), (void const *)(& byte_seq), 7UL); mef_entry->filter[filt_num].filt_type = 65U; if ((int )first_pat) { first_pat = 0; } else { mef_entry->filter[filt_num].filt_action = 68U; } filt_num = filt_num + 1; ldv_61390: i = i + 1; ldv_61392: ; if (wowlan->n_patterns > i) { goto ldv_61391; } else { } if ((int )wowlan->magic_pkt) { mef_cfg->criteria = mef_cfg->criteria | 2U; mef_entry->filter[filt_num].repeat = 16U; memcpy((void *)(& mef_entry->filter[filt_num].byte_seq), (void const *)(& priv->curr_addr), 6UL); mef_entry->filter[filt_num].byte_seq[6] = 6; mef_entry->filter[filt_num].offset = 28U; mef_entry->filter[filt_num].filt_type = 65U; if (filt_num != 0) { mef_entry->filter[filt_num].filt_action = 69U; } else { } filt_num = filt_num + 1; mef_entry->filter[filt_num].repeat = 16U; memcpy((void *)(& mef_entry->filter[filt_num].byte_seq), (void const *)(& priv->curr_addr), 6UL); mef_entry->filter[filt_num].byte_seq[6] = 6; mef_entry->filter[filt_num].offset = 56U; mef_entry->filter[filt_num].filt_type = 65U; mef_entry->filter[filt_num].filt_action = 69U; } else { } return (ret); } } static int mwifiex_set_mef_filter(struct mwifiex_private *priv , struct cfg80211_wowlan *wowlan ) { int ret ; int num_entries ; struct mwifiex_ds_mef_cfg mef_cfg ; struct mwifiex_mef_entry *mef_entry ; void *tmp ; { ret = 0; num_entries = 1; if (wowlan->n_patterns != 0 || (int )wowlan->magic_pkt) { num_entries = num_entries + 1; } else { } tmp = kcalloc((size_t )num_entries, 142UL, 208U); mef_entry = (struct mwifiex_mef_entry *)tmp; if ((unsigned long )mef_entry == (unsigned long )((struct mwifiex_mef_entry *)0)) { return (-12); } else { } memset((void *)(& mef_cfg), 0, 16UL); mef_cfg.criteria = mef_cfg.criteria | 3U; mef_cfg.num_entries = (u16 )num_entries; mef_cfg.mef_entry = mef_entry; mwifiex_set_auto_arp_mef_entry(priv, mef_entry); if (wowlan->n_patterns != 0 || (int )wowlan->magic_pkt) { ret = mwifiex_set_wowlan_mef_entry(priv, & mef_cfg, mef_entry + 1UL, wowlan); } else { } if (mef_cfg.criteria == 0U) { mef_cfg.criteria = 11U; } else { } ret = mwifiex_send_cmd(priv, 154, 1, 0U, (void *)(& mef_cfg), 1); kfree((void const *)mef_entry); return (ret); } } static int mwifiex_cfg80211_suspend(struct wiphy *wiphy , struct cfg80211_wowlan *wowlan ) { struct mwifiex_adapter *adapter ; void *tmp ; struct mwifiex_ds_hs_cfg hs_cfg ; int i ; int ret ; struct mwifiex_private *priv ; { tmp = mwifiex_cfg80211_get_adapter(wiphy); adapter = (struct mwifiex_adapter *)tmp; ret = 0; i = 0; goto ldv_61412; ldv_61411: priv = adapter->priv[i]; mwifiex_abort_cac(priv); i = i + 1; ldv_61412: ; if ((int )adapter->priv_num > i) { goto ldv_61411; } else { } mwifiex_cancel_all_pending_cmd(adapter); if ((unsigned long )wowlan == (unsigned long )((struct cfg80211_wowlan *)0)) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "None of the WOWLAN triggers enabled\n"); } else { } } else { } return (0); } else { } priv = mwifiex_get_priv___3(adapter, 0); if ((unsigned int )priv->media_connected == 0U) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "Can not configure WOWLAN in disconnected state\n"); } else { } } else { } return (0); } else { } ret = mwifiex_set_mef_filter(priv, wowlan); if (ret != 0) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "Failed to set MEF filter\n"); } else { } } else { } return (ret); } else { } if ((int )wowlan->disconnect) { memset((void *)(& hs_cfg), 0, 16UL); hs_cfg.is_invoke_hostcmd = 0U; hs_cfg.conditions = 4U; hs_cfg.gpio = 255U; hs_cfg.gap = 255U; ret = mwifiex_set_hs_params(priv, 1, 1, & hs_cfg); if (ret != 0) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "Failed to set HS params\n"); } else { } } else { } return (ret); } else { } } else { } return (ret); } } static int mwifiex_cfg80211_resume(struct wiphy *wiphy ) { { return (0); } } static void mwifiex_cfg80211_set_wakeup(struct wiphy *wiphy , bool enabled ) { struct mwifiex_adapter *adapter ; void *tmp ; { tmp = mwifiex_cfg80211_get_adapter(wiphy); adapter = (struct mwifiex_adapter *)tmp; device_set_wakeup_enable(adapter->dev, (int )enabled); return; } } static int mwifiex_get_coalesce_pkt_type(u8 *byte_seq ) { u8 ipv4_mc_mac[2U] ; u8 ipv6_mc_mac[3U] ; u8 bc_mac[4U] ; int tmp ; int tmp___0 ; int tmp___1 ; { ipv4_mc_mac[0] = 51U; ipv4_mc_mac[1] = 51U; ipv6_mc_mac[0] = 1U; ipv6_mc_mac[1] = 0U; ipv6_mc_mac[2] = 94U; bc_mac[0] = 255U; bc_mac[1] = 255U; bc_mac[2] = 255U; bc_mac[3] = 255U; if ((int )*byte_seq & 1 && (unsigned int )*(byte_seq + 4UL) == 1U) { return (1); } else { tmp___1 = memcmp((void const *)byte_seq, (void const *)(& bc_mac), 4UL); if (tmp___1 == 0) { return (3); } else { tmp = memcmp((void const *)byte_seq, (void const *)(& ipv4_mc_mac), 2UL); if (tmp == 0 && (unsigned int )*(byte_seq + 4UL) == 2U) { return (2); } else { tmp___0 = memcmp((void const *)byte_seq, (void const *)(& ipv6_mc_mac), 3UL); if (tmp___0 == 0 && (unsigned int )*(byte_seq + 4UL) == 3U) { return (2); } else { } } } } return (0); } } static int mwifiex_fill_coalesce_rule_info(struct mwifiex_private *priv , struct cfg80211_coalesce_rules *crule , struct mwifiex_coalesce_rule *mrule ) { u8 byte_seq[5U] ; struct filt_field_param *param ; int i ; bool tmp ; int tmp___0 ; u8 pkt_type ; int tmp___1 ; { mrule->max_coalescing_delay = (u16 )crule->delay; param = (struct filt_field_param *)(& mrule->params); i = 0; goto ldv_61439; ldv_61438: memset((void *)(& byte_seq), 0, 5UL); tmp = mwifiex_is_pattern_supported(crule->patterns + (unsigned long )i, (s8 *)(& byte_seq), 4); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Pattern not supported\n"); } else { } } else { } return (-95); } else { } if ((crule->patterns + (unsigned long )i)->pkt_offset == 0) { tmp___1 = mwifiex_get_coalesce_pkt_type((u8 *)(& byte_seq)); pkt_type = (u8 )tmp___1; if ((unsigned int )pkt_type != 0U && (unsigned int )mrule->pkt_type != 0U) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Multiple packet types not allowed\n"); } else { } } else { } return (-95); } else if ((unsigned int )pkt_type != 0U) { mrule->pkt_type = pkt_type; goto ldv_61437; } else { } } else { } if ((unsigned int )crule->condition == 0U) { param->operation = 128U; } else { param->operation = 129U; } param->operand_len = byte_seq[4]; memcpy((void *)(& param->operand_byte_stream), (void const *)(& byte_seq), (size_t )param->operand_len); param->offset = (u16 )(crule->patterns + (unsigned long )i)->pkt_offset; param = param + 1; mrule->num_of_fields = (u8 )((int )mrule->num_of_fields + 1); ldv_61437: i = i + 1; ldv_61439: ; if (crule->n_patterns > i) { goto ldv_61438; } else { } if ((unsigned int )mrule->pkt_type == 0U) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Packet type can not be determined\n"); } else { } } else { } return (-95); } else { } return (0); } } static int mwifiex_cfg80211_set_coalesce(struct wiphy *wiphy , struct cfg80211_coalesce *coalesce ) { struct mwifiex_adapter *adapter ; void *tmp ; int i ; int ret ; struct mwifiex_ds_coalesce_cfg coalesce_cfg ; struct mwifiex_private *priv ; struct mwifiex_private *tmp___0 ; int tmp___1 ; int tmp___2 ; { tmp = mwifiex_cfg80211_get_adapter(wiphy); adapter = (struct mwifiex_adapter *)tmp; tmp___0 = mwifiex_get_priv___3(adapter, 0); priv = tmp___0; memset((void *)(& coalesce_cfg), 0, 290UL); if ((unsigned long )coalesce == (unsigned long )((struct cfg80211_coalesce *)0)) { if ((adapter->debug_mask & 536870912U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "Disable coalesce and reset all previous rules\n"); } else { } } else { } tmp___1 = mwifiex_send_cmd(priv, 266, 1, 0U, (void *)(& coalesce_cfg), 1); return (tmp___1); } else { } coalesce_cfg.num_of_rules = (u16 )coalesce->n_rules; i = 0; goto ldv_61451; ldv_61450: ret = mwifiex_fill_coalesce_rule_info(priv, coalesce->rules + (unsigned long )i, (struct mwifiex_coalesce_rule *)(& coalesce_cfg.rule) + (unsigned long )i); if (ret != 0) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "Recheck the patterns provided for rule %d\n", i + 1); } else { } } else { } return (ret); } else { } i = i + 1; ldv_61451: ; if (coalesce->n_rules > i) { goto ldv_61450; } else { } tmp___2 = mwifiex_send_cmd(priv, 266, 1, 0U, (void *)(& coalesce_cfg), 1); return (tmp___2); } } static int mwifiex_cfg80211_tdls_mgmt(struct wiphy *wiphy , struct net_device *dev , u8 const *peer , u8 action_code , u8 dialog_token , u16 status_code , u32 peer_capability , bool initiator , u8 const *extra_ies , size_t extra_ies_len ) { struct mwifiex_private *priv ; struct mwifiex_private *tmp ; int ret ; { tmp = mwifiex_netdev_get_priv(dev); priv = tmp; if ((wiphy->flags & 32768U) == 0U) { return (-524); } else { } if ((unsigned int )priv->bss_type != 0U || (unsigned int )priv->media_connected == 0U) { return (-524); } else { } switch ((int )action_code) { case 0: ; if ((int )(priv->adapter)->debug_mask & 1) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Send TDLS Setup Request to %pM status_code=%d\n", peer, (int )status_code); } else { } } else { } mwifiex_add_auto_tdls_peer(priv, peer); ret = mwifiex_send_tdls_data_frame(priv, peer, (int )action_code, (int )dialog_token, (int )status_code, extra_ies, extra_ies_len); goto ldv_61468; case 1: mwifiex_add_auto_tdls_peer(priv, peer); if ((int )(priv->adapter)->debug_mask & 1) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Send TDLS Setup Response to %pM status_code=%d\n", peer, (int )status_code); } else { } } else { } ret = mwifiex_send_tdls_data_frame(priv, peer, (int )action_code, (int )dialog_token, (int )status_code, extra_ies, extra_ies_len); goto ldv_61468; case 2: ; if ((int )(priv->adapter)->debug_mask & 1) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Send TDLS Confirm to %pM status_code=%d\n", peer, (int )status_code); } else { } } else { } ret = mwifiex_send_tdls_data_frame(priv, peer, (int )action_code, (int )dialog_token, (int )status_code, extra_ies, extra_ies_len); goto ldv_61468; case 3: ; if ((int )(priv->adapter)->debug_mask & 1) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Send TDLS Tear down to %pM\n", peer); } else { } } else { } ret = mwifiex_send_tdls_data_frame(priv, peer, (int )action_code, (int )dialog_token, (int )status_code, extra_ies, extra_ies_len); goto ldv_61468; case 10: ; if ((int )(priv->adapter)->debug_mask & 1) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Send TDLS Discovery Request to %pM\n", peer); } else { } } else { } ret = mwifiex_send_tdls_data_frame(priv, peer, (int )action_code, (int )dialog_token, (int )status_code, extra_ies, extra_ies_len); goto ldv_61468; case 14: ; if ((int )(priv->adapter)->debug_mask & 1) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Send TDLS Discovery Response to %pM\n", peer); } else { } } else { } ret = mwifiex_send_tdls_action_frame(priv, peer, (int )action_code, (int )dialog_token, (int )status_code, extra_ies, extra_ies_len); goto ldv_61468; default: ; if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Unknown TDLS mgmt/action frame %pM\n", peer); } else { } } else { } ret = -22; goto ldv_61468; } ldv_61468: ; return (ret); } } static int mwifiex_cfg80211_tdls_oper(struct wiphy *wiphy , struct net_device *dev , u8 const *peer , enum nl80211_tdls_operation action ) { struct mwifiex_private *priv ; struct mwifiex_private *tmp ; int tmp___0 ; { tmp = mwifiex_netdev_get_priv(dev); priv = tmp; if ((wiphy->flags & 32768U) == 0U || (wiphy->flags & 65536U) == 0U) { return (-524); } else { } if ((unsigned int )priv->bss_type != 0U || (unsigned int )priv->media_connected == 0U) { return (-524); } else { } if ((int )(priv->adapter)->debug_mask & 1) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "TDLS peer=%pM, oper=%d\n", peer, (unsigned int )action); } else { } } else { } switch ((unsigned int )action) { case 3U: action = 1; goto ldv_61483; case 4U: action = 0; goto ldv_61483; case 2U: ; if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "tdls_oper: teardown from driver not supported\n"); } else { } } else { } return (-22); case 1U: ; if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "tdls_oper: setup from driver not supported\n"); } else { } } else { } return (-22); case 0U: ; if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "tdls_oper: discovery from driver not supported\n"); } else { } } else { } return (-22); default: ; if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "tdls_oper: operation not supported\n"); } else { } } else { } return (-524); } ldv_61483: tmp___0 = mwifiex_tdls_oper(priv, peer, (int )((u8 )action)); return (tmp___0); } } static int mwifiex_cfg80211_add_station(struct wiphy *wiphy , struct net_device *dev , u8 const *mac , struct station_parameters *params ) { struct mwifiex_private *priv ; struct mwifiex_private *tmp ; int tmp___0 ; { tmp = mwifiex_netdev_get_priv(dev); priv = tmp; if (((unsigned long )params->sta_flags_set & 64UL) == 0UL) { return (-524); } else { } if ((unsigned int )priv->bss_type != 0U || (unsigned int )priv->media_connected == 0U) { return (-524); } else { } tmp___0 = mwifiex_tdls_oper(priv, mac, 2); return (tmp___0); } } static int mwifiex_cfg80211_channel_switch(struct wiphy *wiphy , struct net_device *dev , struct cfg80211_csa_settings *params ) { struct ieee_types_header *chsw_ie ; struct ieee80211_channel_sw_ie *channel_sw ; int chsw_msec ; struct mwifiex_private *priv ; struct mwifiex_private *tmp ; bool tmp___0 ; u8 const *tmp___1 ; bool tmp___2 ; int tmp___3 ; int tmp___4 ; int _max1 ; int _max2 ; unsigned long tmp___5 ; { tmp = mwifiex_netdev_get_priv(dev); priv = tmp; if ((priv->adapter)->scan_processing != 0U) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "radar detection: scan in process...\n"); } else { } } else { } return (-16); } else { } if ((int )priv->wdev.cac_started) { return (-16); } else { } tmp___0 = cfg80211_chandef_identical((struct cfg80211_chan_def const *)(& params->chandef), (struct cfg80211_chan_def const *)(& priv->dfs_chandef)); if ((int )tmp___0) { return (-22); } else { } tmp___1 = cfg80211_find_ie(37, params->beacon_csa.tail, (int )params->beacon_csa.tail_len); chsw_ie = (struct ieee_types_header *)tmp___1; if ((unsigned long )chsw_ie == (unsigned long )((struct ieee_types_header *)0)) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Could not parse channel switch announcement IE\n"); } else { } } else { } return (-22); } else { } channel_sw = (struct ieee80211_channel_sw_ie *)chsw_ie + 1U; if ((unsigned int )channel_sw->mode != 0U) { tmp___2 = netif_carrier_ok((struct net_device const *)priv->netdev); if ((int )tmp___2) { netif_carrier_off(priv->netdev); } else { } mwifiex_stop_net_dev_queue(priv->netdev, priv->adapter); } else { } tmp___3 = mwifiex_del_mgmt_ies(priv); if (tmp___3 != 0) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Failed to delete mgmt IEs!\n"); } else { } } else { } } else { } tmp___4 = mwifiex_set_mgmt_ies(priv, & params->beacon_csa); if (tmp___4 != 0) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "%s: setting mgmt ies failed\n", "mwifiex_cfg80211_channel_switch"); } else { } } else { } return (-14); } else { } memcpy((void *)(& priv->dfs_chandef), (void const *)(& params->chandef), 24UL); memcpy((void *)(& priv->beacon_after), (void const *)(& params->beacon_after), 96UL); _max1 = (int )channel_sw->count * (int )priv->bss_cfg.beacon_period; _max2 = 100; chsw_msec = _max1 > _max2 ? _max1 : _max2; tmp___5 = msecs_to_jiffies((unsigned int const )chsw_msec); queue_delayed_work(priv->dfs_chan_sw_workqueue, & priv->dfs_chan_sw_work, tmp___5); return (0); } } static int mwifiex_cfg80211_get_channel(struct wiphy *wiphy , struct wireless_dev *wdev , struct cfg80211_chan_def *chandef ) { struct mwifiex_private *priv ; struct mwifiex_private *tmp ; struct mwifiex_bssdescriptor *curr_bss ; struct ieee80211_channel *chan ; u8 second_chan_offset ; enum nl80211_channel_type chan_type ; enum ieee80211_band band ; int freq ; int ret ; u8 tmp___0 ; u8 tmp___1 ; bool tmp___2 ; { tmp = mwifiex_netdev_get_priv(wdev->netdev); priv = tmp; ret = -61; if ((int )priv->bss_role & 1) { tmp___2 = cfg80211_chandef_valid((struct cfg80211_chan_def const *)(& priv->bss_chandef)); if ((int )tmp___2) { *chandef = priv->bss_chandef; ret = 0; } else { goto _L; } } else _L: /* CIL Label */ if ((unsigned int )priv->media_connected != 0U) { curr_bss = & priv->curr_bss_params.bss_descriptor; tmp___0 = mwifiex_band_to_radio_type((int )priv->curr_bss_params.band); band = (enum ieee80211_band )tmp___0; freq = ieee80211_channel_to_frequency((int )curr_bss->channel, band); chan = ieee80211_get_channel(wiphy, freq); if ((unsigned long )curr_bss->bcn_ht_oper != (unsigned long )((struct ieee80211_ht_operation *)0)) { second_chan_offset = (unsigned int )(curr_bss->bcn_ht_oper)->ht_param & 3U; tmp___1 = mwifiex_sec_chan_offset_to_chan_type((int )second_chan_offset); chan_type = (enum nl80211_channel_type )tmp___1; cfg80211_chandef_create(chandef, chan, chan_type); } else { cfg80211_chandef_create(chandef, chan, 0); } ret = 0; } else { } return (ret); } } static int mwifiex_cfg80211_start_radar_detection(struct wiphy *wiphy , struct net_device *dev , struct cfg80211_chan_def *chandef , u32 cac_time_ms ) { struct mwifiex_private *priv ; struct mwifiex_private *tmp ; struct mwifiex_radar_params radar_params ; int tmp___0 ; int tmp___1 ; int tmp___2 ; unsigned long tmp___3 ; { tmp = mwifiex_netdev_get_priv(dev); priv = tmp; if ((priv->adapter)->scan_processing != 0U) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "radar detection: scan already in process...\n"); } else { } } else { } return (-16); } else { } tmp___1 = mwifiex_is_11h_active(priv); if (tmp___1 == 0) { if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Enable 11h extensions in FW\n"); } else { } } else { } tmp___0 = mwifiex_11h_activate(priv, 1); if (tmp___0 != 0) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Failed to activate 11h extensions!!"); } else { } } else { } return (-1); } else { } priv->state_11h.is_11h_active = 1; } else { } memset((void *)(& radar_params), 0, 12UL); radar_params.chandef = chandef; radar_params.cac_time_ms = cac_time_ms; memcpy((void *)(& priv->dfs_chandef), (void const *)chandef, 24UL); tmp___2 = mwifiex_send_cmd(priv, 221, 1, 0U, (void *)(& radar_params), 1); if (tmp___2 != 0) { return (-1); } else { } tmp___3 = msecs_to_jiffies(cac_time_ms); queue_delayed_work(priv->dfs_cac_workqueue, & priv->dfs_cac_work, tmp___3); return (0); } } static int mwifiex_cfg80211_change_station(struct wiphy *wiphy , struct net_device *dev , u8 const *mac , struct station_parameters *params ) { int ret ; struct mwifiex_private *priv ; struct mwifiex_private *tmp ; { tmp = mwifiex_netdev_get_priv(dev); priv = tmp; if (((unsigned long )params->sta_flags_set & 64UL) == 0UL) { return (-524); } else { } if ((unsigned int )priv->bss_type != 0U || (unsigned int )priv->media_connected == 0U) { return (-524); } else { } priv->sta_params = params; ret = mwifiex_tdls_oper(priv, mac, 3); priv->sta_params = (struct station_parameters *)0; return (ret); } } static struct cfg80211_ops mwifiex_cfg80211_ops = {& mwifiex_cfg80211_suspend, & mwifiex_cfg80211_resume, & mwifiex_cfg80211_set_wakeup, & mwifiex_add_virtual_intf, & mwifiex_del_virtual_intf, & mwifiex_cfg80211_change_virtual_intf, & mwifiex_cfg80211_add_key, 0, & mwifiex_cfg80211_del_key, & mwifiex_cfg80211_set_default_key, 0, & mwifiex_cfg80211_start_ap, & mwifiex_cfg80211_change_beacon, & mwifiex_cfg80211_stop_ap, & mwifiex_cfg80211_add_station, & mwifiex_cfg80211_del_station, & mwifiex_cfg80211_change_station, & mwifiex_cfg80211_get_station, & mwifiex_cfg80211_dump_station, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & mwifiex_cfg80211_scan, 0, 0, 0, 0, & mwifiex_cfg80211_connect, & mwifiex_cfg80211_disconnect, & mwifiex_cfg80211_join_ibss, & mwifiex_cfg80211_leave_ibss, 0, & mwifiex_cfg80211_set_wiphy_params, & mwifiex_cfg80211_set_tx_power, 0, 0, 0, 0, 0, & mwifiex_cfg80211_set_bitrate_mask, & mwifiex_cfg80211_dump_survey, 0, 0, 0, & mwifiex_cfg80211_remain_on_channel, & mwifiex_cfg80211_cancel_remain_on_channel, & mwifiex_cfg80211_mgmt_tx, 0, & mwifiex_cfg80211_set_power_mgmt, & mwifiex_cfg80211_set_cqm_rssi_config, 0, & mwifiex_cfg80211_mgmt_frame_register, & mwifiex_cfg80211_set_antenna, 0, 0, 0, 0, & mwifiex_cfg80211_tdls_mgmt, & mwifiex_cfg80211_tdls_oper, 0, 0, & mwifiex_cfg80211_get_channel, 0, 0, 0, & mwifiex_cfg80211_start_radar_detection, 0, 0, 0, & mwifiex_cfg80211_set_coalesce, & mwifiex_cfg80211_channel_switch, 0, 0, 0, 0, 0, 0}; static struct wiphy_wowlan_support const mwifiex_wowlan_support = {6U, 10, 20, 1, 100, 0, 0}; static bool mwifiex_is_valid_alpha2(char const *alpha2 ) { size_t tmp ; { if ((unsigned long )alpha2 == (unsigned long )((char const *)0)) { return (0); } else { tmp = strlen(alpha2); if (tmp != 2UL) { return (0); } else { } } if (((int )_ctype[(int )((unsigned char )*alpha2)] & 3) != 0 && ((int )_ctype[(int )((unsigned char )*(alpha2 + 1UL))] & 3) != 0) { return (1); } else { } return (0); } } static struct wiphy_coalesce_support const mwifiex_coalesce_support = {8, 100, 4, 20, 1, 100}; int mwifiex_init_channel_scan_gap(struct mwifiex_adapter *adapter ) { u32 n_channels_bg ; u32 n_channels_a ; u32 __max1 ; u32 __max2 ; void *tmp ; { n_channels_a = 0U; n_channels_bg = (u32 )mwifiex_band_2ghz.n_channels; if (((int )adapter->config_bands & 4) != 0) { n_channels_a = (u32 )mwifiex_band_5ghz.n_channels; } else { } __max1 = n_channels_bg; __max2 = n_channels_a; adapter->num_in_chan_stats = __max1 > __max2 ? __max1 : __max2; tmp = vmalloc((unsigned long )adapter->num_in_chan_stats * 10UL); adapter->chan_stats = (struct mwifiex_chan_stats *)tmp; if ((unsigned long )adapter->chan_stats == (unsigned long )((struct mwifiex_chan_stats *)0)) { return (-12); } else { } return (0); } } int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter ) { int ret ; void *wdev_priv___0 ; struct wiphy *wiphy ; struct mwifiex_private *priv ; u8 *country_code ; u32 thr ; u32 retry ; bool tmp ; { priv = adapter->priv[0]; wiphy = wiphy_new((struct cfg80211_ops const *)(& mwifiex_cfg80211_ops), 8); if ((unsigned long )wiphy == (unsigned long )((struct wiphy *)0)) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "%s: creating new wiphy\n", "mwifiex_register_cfg80211"); } else { } } else { } return (-12); } else { } wiphy->max_scan_ssids = 10U; wiphy->max_scan_ie_len = 256U; wiphy->mgmt_stypes = (struct ieee80211_txrx_stypes const *)(& mwifiex_mgmt_stypes); wiphy->max_remain_on_channel_duration = 5000U; wiphy->interface_modes = 782U; wiphy->bands[0] = & mwifiex_band_2ghz; if (((int )adapter->config_bands & 4) != 0) { wiphy->bands[1] = & mwifiex_band_5ghz; } else { wiphy->bands[1] = (struct ieee80211_supported_band *)0; } wiphy->iface_combinations = & mwifiex_iface_comb_ap_sta; wiphy->n_iface_combinations = 1; wiphy->cipher_suites = (u32 const *)(& mwifiex_cipher_suites); wiphy->n_cipher_suites = 5; ether_addr_copy((u8 *)(& wiphy->perm_addr), (u8 const *)(& adapter->perm_addr)); wiphy->signal_type = 1; wiphy->flags = wiphy->flags | 11157520U; if (((unsigned long )adapter->fw_cap_info & 16384UL) != 0UL) { wiphy->flags = wiphy->flags | 98304U; } else { } wiphy->wowlan = & mwifiex_wowlan_support; wiphy->coalesce = & mwifiex_coalesce_support; wiphy->probe_resp_offload = 7U; wiphy->available_antennas_tx = (u32 )(1UL << (int )adapter->number_of_antenna) - 1U; wiphy->available_antennas_rx = (u32 )(1UL << (int )adapter->number_of_antenna) - 1U; wiphy->features = wiphy->features | 1030U; if ((unsigned int )adapter->fw_api_ver == 15U) { wiphy->features = wiphy->features | 1U; } else { } wiphy->bss_priv_size = 16; wiphy->reg_notifier = & mwifiex_reg_notifier; wdev_priv___0 = wiphy_priv(wiphy); *((unsigned long *)wdev_priv___0) = (unsigned long )adapter; set_wiphy_dev(wiphy, (priv->adapter)->dev); ret = wiphy_register(wiphy); if (ret < 0) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "%s: wiphy_register failed: %d\n", "mwifiex_register_cfg80211", ret); } else { } } else { } wiphy_free(wiphy); return (ret); } else { } if ((unsigned long )reg_alpha2 != (unsigned long )((char *)0)) { tmp = mwifiex_is_valid_alpha2((char const *)reg_alpha2); if ((int )tmp) { if ((adapter->debug_mask & 1073741824U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "driver hint alpha2: %2.2s\n", reg_alpha2); } else { } } else { } regulatory_hint(wiphy, (char const *)reg_alpha2); } else { goto _L; } } else { _L: /* CIL Label */ country_code = mwifiex_11d_code_2_region((int )((u8 )adapter->region_code)); if ((unsigned long )country_code != (unsigned long )((u8 *)0U)) { if ((adapter->debug_mask & 536870912U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "ignoring F/W country code %2.2s\n", country_code); } else { } } else { } } else { } } mwifiex_send_cmd(priv, 22, 0, 8U, (void *)(& thr), 1); wiphy->frag_threshold = thr; mwifiex_send_cmd(priv, 22, 0, 5U, (void *)(& thr), 1); wiphy->rts_threshold = thr; mwifiex_send_cmd(priv, 22, 0, 6U, (void *)(& retry), 1); wiphy->retry_short = (unsigned char )retry; mwifiex_send_cmd(priv, 22, 0, 7U, (void *)(& retry), 1); wiphy->retry_long = (unsigned char )retry; adapter->wiphy = wiphy; return (ret); } } int ldv_retval_12 ; extern int ldv_bind_20(void) ; extern int ldv_release_20(void) ; int ldv_retval_11 ; int ldv_retval_10 ; 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 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 ldv_initialize_cfg80211_ops_20(void) { void *tmp ; void *tmp___0 ; void *tmp___1 ; void *tmp___2 ; void *tmp___3 ; void *tmp___4 ; void *tmp___5 ; { tmp = ldv_init_zalloc(976UL); mwifiex_cfg80211_ops_group0 = (struct wireless_dev *)tmp; tmp___0 = ldv_init_zalloc(3008UL); mwifiex_cfg80211_ops_group5 = (struct net_device *)tmp___0; tmp___1 = ldv_init_zalloc(1792UL); mwifiex_cfg80211_ops_group2 = (struct wiphy *)tmp___1; tmp___2 = ldv_init_zalloc(24UL); mwifiex_cfg80211_ops_group6 = (struct cfg80211_chan_def *)tmp___2; tmp___3 = ldv_init_zalloc(120UL); mwifiex_cfg80211_ops_group3 = (struct station_parameters *)tmp___3; tmp___4 = ldv_init_zalloc(12UL); mwifiex_cfg80211_ops_group4 = (struct vif_params *)tmp___4; tmp___5 = ldv_init_zalloc(840UL); mwifiex_cfg80211_ops_group1 = (struct station_info *)tmp___5; 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) { mwifiex_dfs_cac_work_queue(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) { mwifiex_dfs_cac_work_queue(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) { mwifiex_dfs_cac_work_queue(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) { mwifiex_dfs_cac_work_queue(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 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; mwifiex_dfs_chan_sw_work_queue(ldv_work_struct_4_0); ldv_work_4_0 = 1; } else { } goto ldv_61599; case 1: ; if (ldv_work_4_1 == 2 || ldv_work_4_1 == 3) { ldv_work_4_1 = 4; mwifiex_dfs_chan_sw_work_queue(ldv_work_struct_4_0); ldv_work_4_1 = 1; } else { } goto ldv_61599; case 2: ; if (ldv_work_4_2 == 2 || ldv_work_4_2 == 3) { ldv_work_4_2 = 4; mwifiex_dfs_chan_sw_work_queue(ldv_work_struct_4_0); ldv_work_4_2 = 1; } else { } goto ldv_61599; case 3: ; if (ldv_work_4_3 == 2 || ldv_work_4_3 == 3) { ldv_work_4_3 = 4; mwifiex_dfs_chan_sw_work_queue(ldv_work_struct_4_0); ldv_work_4_3 = 1; } else { } goto ldv_61599; default: ldv_stop(); } ldv_61599: ; 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 disable_work_4(struct work_struct *work ) { { if ((ldv_work_4_0 == 3 || ldv_work_4_0 == 2) && (unsigned long )ldv_work_struct_4_0 == (unsigned long )work) { ldv_work_4_0 = 1; } else { } if ((ldv_work_4_1 == 3 || ldv_work_4_1 == 2) && (unsigned long )ldv_work_struct_4_1 == (unsigned long )work) { ldv_work_4_1 = 1; } else { } if ((ldv_work_4_2 == 3 || ldv_work_4_2 == 2) && (unsigned long )ldv_work_struct_4_2 == (unsigned long )work) { ldv_work_4_2 = 1; } else { } if ((ldv_work_4_3 == 3 || ldv_work_4_3 == 2) && (unsigned long )ldv_work_struct_4_3 == (unsigned long )work) { ldv_work_4_3 = 1; } else { } return; } } void work_init_4(void) { { ldv_work_4_0 = 0; ldv_work_4_1 = 0; ldv_work_4_2 = 0; ldv_work_4_3 = 0; return; } } void invoke_work_3(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_work_3_0 == 2 || ldv_work_3_0 == 3) { ldv_work_3_0 = 4; mwifiex_dfs_cac_work_queue(ldv_work_struct_3_0); ldv_work_3_0 = 1; } else { } goto ldv_61620; case 1: ; if (ldv_work_3_1 == 2 || ldv_work_3_1 == 3) { ldv_work_3_1 = 4; mwifiex_dfs_cac_work_queue(ldv_work_struct_3_0); ldv_work_3_1 = 1; } else { } goto ldv_61620; case 2: ; if (ldv_work_3_2 == 2 || ldv_work_3_2 == 3) { ldv_work_3_2 = 4; mwifiex_dfs_cac_work_queue(ldv_work_struct_3_0); ldv_work_3_2 = 1; } else { } goto ldv_61620; case 3: ; if (ldv_work_3_3 == 2 || ldv_work_3_3 == 3) { ldv_work_3_3 = 4; mwifiex_dfs_cac_work_queue(ldv_work_struct_3_0); ldv_work_3_3 = 1; } else { } goto ldv_61620; default: ldv_stop(); } ldv_61620: ; 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 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) { mwifiex_dfs_chan_sw_work_queue(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) { mwifiex_dfs_chan_sw_work_queue(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) { mwifiex_dfs_chan_sw_work_queue(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) { mwifiex_dfs_chan_sw_work_queue(work); ldv_work_4_3 = 1; return; } else { } return; } } void ldv_main_exported_20(void) { s32 ldvarg52 ; u8 *ldvarg74 ; void *tmp ; int ldvarg61 ; enum nl80211_tx_power_setting ldvarg78 ; u32 *ldvarg88 ; void *tmp___0 ; u64 ldvarg73 ; struct cfg80211_bitrate_mask *ldvarg96 ; void *tmp___1 ; u8 *ldvarg66 ; void *tmp___2 ; u8 ldvarg57 ; u32 ldvarg65 ; bool ldvarg62 ; enum nl80211_iftype ldvarg87 ; u32 ldvarg80 ; u8 *ldvarg39 ; void *tmp___3 ; u8 ldvarg89 ; u32 ldvarg93 ; u64 *ldvarg48 ; void *tmp___4 ; enum nl80211_tdls_operation ldvarg38 ; unsigned char ldvarg85 ; u8 *ldvarg95 ; void *tmp___5 ; struct key_params *ldvarg97 ; void *tmp___6 ; u8 ldvarg98 ; bool ldvarg72 ; bool ldvarg56 ; struct cfg80211_ibss_params *ldvarg71 ; void *tmp___7 ; u64 *ldvarg43 ; void *tmp___8 ; u32 ldvarg94 ; u8 *ldvarg91 ; void *tmp___9 ; bool ldvarg67 ; struct cfg80211_connect_params *ldvarg77 ; void *tmp___10 ; u8 *ldvarg75 ; void *tmp___11 ; struct cfg80211_coalesce *ldvarg76 ; void *tmp___12 ; bool ldvarg82 ; struct cfg80211_wowlan *ldvarg92 ; void *tmp___13 ; u8 *ldvarg54 ; void *tmp___14 ; u8 ldvarg68 ; bool ldvarg90 ; u8 ldvarg70 ; u16 ldvarg63 ; u32 ldvarg45 ; u16 ldvarg81 ; bool ldvarg99 ; struct survey_info *ldvarg40 ; void *tmp___15 ; struct cfg80211_scan_request *ldvarg55 ; void *tmp___16 ; int ldvarg79 ; struct station_del_parameters *ldvarg49 ; void *tmp___17 ; char *ldvarg86 ; void *tmp___18 ; u32 *ldvarg59 ; void *tmp___19 ; enum nl80211_iftype ldvarg60 ; int ldvarg41 ; struct ieee80211_channel *ldvarg47 ; void *tmp___20 ; size_t ldvarg69 ; int ldvarg83 ; struct cfg80211_mgmt_tx_params *ldvarg44 ; void *tmp___21 ; u8 *ldvarg64 ; void *tmp___22 ; struct cfg80211_ap_settings *ldvarg53 ; void *tmp___23 ; bool ldvarg58 ; unsigned int ldvarg46 ; struct cfg80211_csa_settings *ldvarg50 ; void *tmp___24 ; u8 *ldvarg100 ; void *tmp___25 ; u16 ldvarg42 ; struct cfg80211_beacon_data *ldvarg101 ; void *tmp___26 ; u32 ldvarg51 ; u8 *ldvarg84 ; void *tmp___27 ; int tmp___28 ; { tmp = ldv_init_zalloc(1UL); ldvarg74 = (u8 *)tmp; tmp___0 = ldv_init_zalloc(4UL); ldvarg88 = (u32 *)tmp___0; tmp___1 = ldv_init_zalloc(108UL); ldvarg96 = (struct cfg80211_bitrate_mask *)tmp___1; tmp___2 = ldv_init_zalloc(1UL); ldvarg66 = (u8 *)tmp___2; tmp___3 = ldv_init_zalloc(1UL); ldvarg39 = (u8 *)tmp___3; tmp___4 = ldv_init_zalloc(8UL); ldvarg48 = (u64 *)tmp___4; tmp___5 = ldv_init_zalloc(1UL); ldvarg95 = (u8 *)tmp___5; tmp___6 = ldv_init_zalloc(32UL); ldvarg97 = (struct key_params *)tmp___6; tmp___7 = ldv_init_zalloc(128UL); ldvarg71 = (struct cfg80211_ibss_params *)tmp___7; tmp___8 = ldv_init_zalloc(8UL); ldvarg43 = (u64 *)tmp___8; tmp___9 = ldv_init_zalloc(1UL); ldvarg91 = (u8 *)tmp___9; tmp___10 = ldv_init_zalloc(232UL); ldvarg77 = (struct cfg80211_connect_params *)tmp___10; tmp___11 = ldv_init_zalloc(1UL); ldvarg75 = (u8 *)tmp___11; tmp___12 = ldv_init_zalloc(16UL); ldvarg76 = (struct cfg80211_coalesce *)tmp___12; tmp___13 = ldv_init_zalloc(40UL); ldvarg92 = (struct cfg80211_wowlan *)tmp___13; tmp___14 = ldv_init_zalloc(1UL); ldvarg54 = (u8 *)tmp___14; tmp___15 = ldv_init_zalloc(64UL); ldvarg40 = (struct survey_info *)tmp___15; tmp___16 = ldv_init_zalloc(104UL); ldvarg55 = (struct cfg80211_scan_request *)tmp___16; tmp___17 = ldv_init_zalloc(16UL); ldvarg49 = (struct station_del_parameters *)tmp___17; tmp___18 = ldv_init_zalloc(1UL); ldvarg86 = (char *)tmp___18; tmp___19 = ldv_init_zalloc(4UL); ldvarg59 = (u32 *)tmp___19; tmp___20 = ldv_init_zalloc(64UL); ldvarg47 = (struct ieee80211_channel *)tmp___20; tmp___21 = ldv_init_zalloc(48UL); ldvarg44 = (struct cfg80211_mgmt_tx_params *)tmp___21; tmp___22 = ldv_init_zalloc(1UL); ldvarg64 = (u8 *)tmp___22; tmp___23 = ldv_init_zalloc(232UL); ldvarg53 = (struct cfg80211_ap_settings *)tmp___23; tmp___24 = ldv_init_zalloc(248UL); ldvarg50 = (struct cfg80211_csa_settings *)tmp___24; tmp___25 = ldv_init_zalloc(1UL); ldvarg100 = (u8 *)tmp___25; tmp___26 = ldv_init_zalloc(96UL); ldvarg101 = (struct cfg80211_beacon_data *)tmp___26; tmp___27 = ldv_init_zalloc(1UL); ldvarg84 = (u8 *)tmp___27; ldv_memset((void *)(& ldvarg52), 0, 4UL); ldv_memset((void *)(& ldvarg61), 0, 4UL); ldv_memset((void *)(& ldvarg78), 0, 4UL); ldv_memset((void *)(& ldvarg73), 0, 8UL); ldv_memset((void *)(& ldvarg57), 0, 1UL); ldv_memset((void *)(& ldvarg65), 0, 4UL); ldv_memset((void *)(& ldvarg62), 0, 1UL); ldv_memset((void *)(& ldvarg87), 0, 4UL); ldv_memset((void *)(& ldvarg80), 0, 4UL); ldv_memset((void *)(& ldvarg89), 0, 1UL); ldv_memset((void *)(& ldvarg93), 0, 4UL); ldv_memset((void *)(& ldvarg38), 0, 4UL); ldv_memset((void *)(& ldvarg85), 0, 1UL); ldv_memset((void *)(& ldvarg98), 0, 1UL); ldv_memset((void *)(& ldvarg72), 0, 1UL); ldv_memset((void *)(& ldvarg56), 0, 1UL); ldv_memset((void *)(& ldvarg94), 0, 4UL); ldv_memset((void *)(& ldvarg67), 0, 1UL); ldv_memset((void *)(& ldvarg82), 0, 1UL); ldv_memset((void *)(& ldvarg68), 0, 1UL); ldv_memset((void *)(& ldvarg90), 0, 1UL); ldv_memset((void *)(& ldvarg70), 0, 1UL); ldv_memset((void *)(& ldvarg63), 0, 2UL); ldv_memset((void *)(& ldvarg45), 0, 4UL); ldv_memset((void *)(& ldvarg81), 0, 2UL); ldv_memset((void *)(& ldvarg99), 0, 1UL); ldv_memset((void *)(& ldvarg79), 0, 4UL); ldv_memset((void *)(& ldvarg60), 0, 4UL); ldv_memset((void *)(& ldvarg41), 0, 4UL); ldv_memset((void *)(& ldvarg69), 0, 8UL); ldv_memset((void *)(& ldvarg83), 0, 4UL); ldv_memset((void *)(& ldvarg58), 0, 1UL); ldv_memset((void *)(& ldvarg46), 0, 4UL); ldv_memset((void *)(& ldvarg42), 0, 2UL); ldv_memset((void *)(& ldvarg51), 0, 4UL); tmp___28 = __VERIFIER_nondet_int(); switch (tmp___28) { case 0: ; if (ldv_state_variable_20 == 4) { mwifiex_cfg80211_change_beacon(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, ldvarg101); ldv_state_variable_20 = 4; } else { } if (ldv_state_variable_20 == 1) { mwifiex_cfg80211_change_beacon(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, ldvarg101); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 3) { mwifiex_cfg80211_change_beacon(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, ldvarg101); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { mwifiex_cfg80211_change_beacon(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, ldvarg101); ldv_state_variable_20 = 2; } else { } goto ldv_61701; case 1: ; if (ldv_state_variable_20 == 4) { mwifiex_cfg80211_add_key(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, (int )ldvarg98, (int )ldvarg99, (u8 const *)ldvarg100, ldvarg97); ldv_state_variable_20 = 4; } else { } if (ldv_state_variable_20 == 1) { mwifiex_cfg80211_add_key(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, (int )ldvarg98, (int )ldvarg99, (u8 const *)ldvarg100, ldvarg97); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 3) { mwifiex_cfg80211_add_key(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, (int )ldvarg98, (int )ldvarg99, (u8 const *)ldvarg100, ldvarg97); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { mwifiex_cfg80211_add_key(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, (int )ldvarg98, (int )ldvarg99, (u8 const *)ldvarg100, ldvarg97); ldv_state_variable_20 = 2; } else { } goto ldv_61701; case 2: ; if (ldv_state_variable_20 == 4) { mwifiex_cfg80211_set_bitrate_mask(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, (u8 const *)ldvarg95, (struct cfg80211_bitrate_mask const *)ldvarg96); ldv_state_variable_20 = 4; } else { } if (ldv_state_variable_20 == 1) { mwifiex_cfg80211_set_bitrate_mask(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, (u8 const *)ldvarg95, (struct cfg80211_bitrate_mask const *)ldvarg96); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 3) { mwifiex_cfg80211_set_bitrate_mask(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, (u8 const *)ldvarg95, (struct cfg80211_bitrate_mask const *)ldvarg96); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { mwifiex_cfg80211_set_bitrate_mask(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, (u8 const *)ldvarg95, (struct cfg80211_bitrate_mask const *)ldvarg96); ldv_state_variable_20 = 2; } else { } goto ldv_61701; case 3: ; if (ldv_state_variable_20 == 4) { mwifiex_cfg80211_set_antenna(mwifiex_cfg80211_ops_group2, ldvarg94, ldvarg93); ldv_state_variable_20 = 4; } else { } if (ldv_state_variable_20 == 1) { mwifiex_cfg80211_set_antenna(mwifiex_cfg80211_ops_group2, ldvarg94, ldvarg93); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 3) { mwifiex_cfg80211_set_antenna(mwifiex_cfg80211_ops_group2, ldvarg94, ldvarg93); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { mwifiex_cfg80211_set_antenna(mwifiex_cfg80211_ops_group2, ldvarg94, ldvarg93); ldv_state_variable_20 = 2; } else { } goto ldv_61701; case 4: ; if (ldv_state_variable_20 == 3) { ldv_retval_12 = mwifiex_cfg80211_suspend(mwifiex_cfg80211_ops_group2, ldvarg92); if (ldv_retval_12 == 0) { ldv_state_variable_20 = 4; } else { } } else { } goto ldv_61701; case 5: ; if (ldv_state_variable_20 == 4) { mwifiex_del_virtual_intf(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group0); ldv_state_variable_20 = 4; } else { } if (ldv_state_variable_20 == 1) { mwifiex_del_virtual_intf(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group0); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 3) { mwifiex_del_virtual_intf(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group0); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { mwifiex_del_virtual_intf(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group0); ldv_state_variable_20 = 2; } else { } goto ldv_61701; case 6: ; if (ldv_state_variable_20 == 4) { mwifiex_cfg80211_del_key(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, (int )ldvarg89, (int )ldvarg90, (u8 const *)ldvarg91); ldv_state_variable_20 = 4; } else { } if (ldv_state_variable_20 == 1) { mwifiex_cfg80211_del_key(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, (int )ldvarg89, (int )ldvarg90, (u8 const *)ldvarg91); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 3) { mwifiex_cfg80211_del_key(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, (int )ldvarg89, (int )ldvarg90, (u8 const *)ldvarg91); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { mwifiex_cfg80211_del_key(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, (int )ldvarg89, (int )ldvarg90, (u8 const *)ldvarg91); ldv_state_variable_20 = 2; } else { } goto ldv_61701; case 7: ; if (ldv_state_variable_20 == 4) { mwifiex_add_virtual_intf(mwifiex_cfg80211_ops_group2, (char const *)ldvarg86, (int )ldvarg85, ldvarg87, ldvarg88, mwifiex_cfg80211_ops_group4); ldv_state_variable_20 = 4; } else { } if (ldv_state_variable_20 == 1) { mwifiex_add_virtual_intf(mwifiex_cfg80211_ops_group2, (char const *)ldvarg86, (int )ldvarg85, ldvarg87, ldvarg88, mwifiex_cfg80211_ops_group4); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 3) { mwifiex_add_virtual_intf(mwifiex_cfg80211_ops_group2, (char const *)ldvarg86, (int )ldvarg85, ldvarg87, ldvarg88, mwifiex_cfg80211_ops_group4); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { mwifiex_add_virtual_intf(mwifiex_cfg80211_ops_group2, (char const *)ldvarg86, (int )ldvarg85, ldvarg87, ldvarg88, mwifiex_cfg80211_ops_group4); ldv_state_variable_20 = 2; } else { } goto ldv_61701; case 8: ; if (ldv_state_variable_20 == 4) { mwifiex_cfg80211_dump_station(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, ldvarg83, ldvarg84, mwifiex_cfg80211_ops_group1); ldv_state_variable_20 = 4; } else { } if (ldv_state_variable_20 == 1) { mwifiex_cfg80211_dump_station(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, ldvarg83, ldvarg84, mwifiex_cfg80211_ops_group1); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 3) { mwifiex_cfg80211_dump_station(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, ldvarg83, ldvarg84, mwifiex_cfg80211_ops_group1); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { mwifiex_cfg80211_dump_station(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, ldvarg83, ldvarg84, mwifiex_cfg80211_ops_group1); ldv_state_variable_20 = 2; } else { } goto ldv_61701; case 9: ; if (ldv_state_variable_20 == 4) { mwifiex_cfg80211_mgmt_frame_register(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group0, (int )ldvarg81, (int )ldvarg82); ldv_state_variable_20 = 4; } else { } if (ldv_state_variable_20 == 1) { mwifiex_cfg80211_mgmt_frame_register(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group0, (int )ldvarg81, (int )ldvarg82); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 3) { mwifiex_cfg80211_mgmt_frame_register(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group0, (int )ldvarg81, (int )ldvarg82); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { mwifiex_cfg80211_mgmt_frame_register(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group0, (int )ldvarg81, (int )ldvarg82); ldv_state_variable_20 = 2; } else { } goto ldv_61701; case 10: ; if (ldv_state_variable_20 == 4) { mwifiex_cfg80211_start_radar_detection(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, mwifiex_cfg80211_ops_group6, ldvarg80); ldv_state_variable_20 = 4; } else { } if (ldv_state_variable_20 == 1) { mwifiex_cfg80211_start_radar_detection(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, mwifiex_cfg80211_ops_group6, ldvarg80); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 3) { mwifiex_cfg80211_start_radar_detection(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, mwifiex_cfg80211_ops_group6, ldvarg80); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { mwifiex_cfg80211_start_radar_detection(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, mwifiex_cfg80211_ops_group6, ldvarg80); ldv_state_variable_20 = 2; } else { } goto ldv_61701; case 11: ; if (ldv_state_variable_20 == 4) { ldv_retval_11 = mwifiex_cfg80211_resume(mwifiex_cfg80211_ops_group2); if (ldv_retval_11 == 0) { ldv_state_variable_20 = 3; } else { } } else { } goto ldv_61701; case 12: ; if (ldv_state_variable_20 == 4) { mwifiex_cfg80211_set_tx_power(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group0, ldvarg78, ldvarg79); ldv_state_variable_20 = 4; } else { } if (ldv_state_variable_20 == 1) { mwifiex_cfg80211_set_tx_power(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group0, ldvarg78, ldvarg79); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 3) { mwifiex_cfg80211_set_tx_power(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group0, ldvarg78, ldvarg79); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { mwifiex_cfg80211_set_tx_power(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group0, ldvarg78, ldvarg79); ldv_state_variable_20 = 2; } else { } goto ldv_61701; case 13: ; if (ldv_state_variable_20 == 2) { ldv_retval_10 = mwifiex_cfg80211_connect(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, ldvarg77); if (ldv_retval_10 == 0) { ldv_state_variable_20 = 3; } else { } } else { } goto ldv_61701; case 14: ; if (ldv_state_variable_20 == 4) { mwifiex_cfg80211_set_coalesce(mwifiex_cfg80211_ops_group2, ldvarg76); ldv_state_variable_20 = 4; } else { } if (ldv_state_variable_20 == 1) { mwifiex_cfg80211_set_coalesce(mwifiex_cfg80211_ops_group2, ldvarg76); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 3) { mwifiex_cfg80211_set_coalesce(mwifiex_cfg80211_ops_group2, ldvarg76); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { mwifiex_cfg80211_set_coalesce(mwifiex_cfg80211_ops_group2, ldvarg76); ldv_state_variable_20 = 2; } else { } goto ldv_61701; case 15: ; if (ldv_state_variable_20 == 4) { mwifiex_cfg80211_get_station(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, (u8 const *)ldvarg75, mwifiex_cfg80211_ops_group1); ldv_state_variable_20 = 4; } else { } if (ldv_state_variable_20 == 1) { mwifiex_cfg80211_get_station(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, (u8 const *)ldvarg75, mwifiex_cfg80211_ops_group1); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 3) { mwifiex_cfg80211_get_station(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, (u8 const *)ldvarg75, mwifiex_cfg80211_ops_group1); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { mwifiex_cfg80211_get_station(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, (u8 const *)ldvarg75, mwifiex_cfg80211_ops_group1); ldv_state_variable_20 = 2; } else { } goto ldv_61701; case 16: ; if (ldv_state_variable_20 == 4) { mwifiex_cfg80211_change_station(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, (u8 const *)ldvarg74, mwifiex_cfg80211_ops_group3); ldv_state_variable_20 = 4; } else { } if (ldv_state_variable_20 == 1) { mwifiex_cfg80211_change_station(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, (u8 const *)ldvarg74, mwifiex_cfg80211_ops_group3); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 3) { mwifiex_cfg80211_change_station(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, (u8 const *)ldvarg74, mwifiex_cfg80211_ops_group3); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { mwifiex_cfg80211_change_station(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, (u8 const *)ldvarg74, mwifiex_cfg80211_ops_group3); ldv_state_variable_20 = 2; } else { } goto ldv_61701; case 17: ; if (ldv_state_variable_20 == 4) { mwifiex_cfg80211_cancel_remain_on_channel(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group0, ldvarg73); ldv_state_variable_20 = 4; } else { } if (ldv_state_variable_20 == 1) { mwifiex_cfg80211_cancel_remain_on_channel(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group0, ldvarg73); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 3) { mwifiex_cfg80211_cancel_remain_on_channel(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group0, ldvarg73); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { mwifiex_cfg80211_cancel_remain_on_channel(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group0, ldvarg73); ldv_state_variable_20 = 2; } else { } goto ldv_61701; case 18: ; if (ldv_state_variable_20 == 4) { mwifiex_cfg80211_set_wakeup(mwifiex_cfg80211_ops_group2, (int )ldvarg72); ldv_state_variable_20 = 4; } else { } if (ldv_state_variable_20 == 1) { mwifiex_cfg80211_set_wakeup(mwifiex_cfg80211_ops_group2, (int )ldvarg72); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 3) { mwifiex_cfg80211_set_wakeup(mwifiex_cfg80211_ops_group2, (int )ldvarg72); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { mwifiex_cfg80211_set_wakeup(mwifiex_cfg80211_ops_group2, (int )ldvarg72); ldv_state_variable_20 = 2; } else { } goto ldv_61701; case 19: ; if (ldv_state_variable_20 == 4) { mwifiex_cfg80211_join_ibss(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, ldvarg71); ldv_state_variable_20 = 4; } else { } if (ldv_state_variable_20 == 1) { mwifiex_cfg80211_join_ibss(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, ldvarg71); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 3) { mwifiex_cfg80211_join_ibss(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, ldvarg71); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { mwifiex_cfg80211_join_ibss(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, ldvarg71); ldv_state_variable_20 = 2; } else { } goto ldv_61701; case 20: ; if (ldv_state_variable_20 == 4) { mwifiex_cfg80211_stop_ap(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5); ldv_state_variable_20 = 4; } else { } if (ldv_state_variable_20 == 1) { mwifiex_cfg80211_stop_ap(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 3) { mwifiex_cfg80211_stop_ap(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { mwifiex_cfg80211_stop_ap(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5); ldv_state_variable_20 = 2; } else { } goto ldv_61701; case 21: ; if (ldv_state_variable_20 == 4) { mwifiex_cfg80211_tdls_mgmt(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, (u8 const *)ldvarg64, (int )ldvarg68, (int )ldvarg70, (int )ldvarg63, ldvarg65, (int )ldvarg67, (u8 const *)ldvarg66, ldvarg69); ldv_state_variable_20 = 4; } else { } if (ldv_state_variable_20 == 1) { mwifiex_cfg80211_tdls_mgmt(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, (u8 const *)ldvarg64, (int )ldvarg68, (int )ldvarg70, (int )ldvarg63, ldvarg65, (int )ldvarg67, (u8 const *)ldvarg66, ldvarg69); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 3) { mwifiex_cfg80211_tdls_mgmt(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, (u8 const *)ldvarg64, (int )ldvarg68, (int )ldvarg70, (int )ldvarg63, ldvarg65, (int )ldvarg67, (u8 const *)ldvarg66, ldvarg69); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { mwifiex_cfg80211_tdls_mgmt(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, (u8 const *)ldvarg64, (int )ldvarg68, (int )ldvarg70, (int )ldvarg63, ldvarg65, (int )ldvarg67, (u8 const *)ldvarg66, ldvarg69); ldv_state_variable_20 = 2; } else { } goto ldv_61701; case 22: ; if (ldv_state_variable_20 == 4) { mwifiex_cfg80211_set_power_mgmt(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, (int )ldvarg62, ldvarg61); ldv_state_variable_20 = 4; } else { } if (ldv_state_variable_20 == 1) { mwifiex_cfg80211_set_power_mgmt(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, (int )ldvarg62, ldvarg61); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 3) { mwifiex_cfg80211_set_power_mgmt(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, (int )ldvarg62, ldvarg61); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { mwifiex_cfg80211_set_power_mgmt(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, (int )ldvarg62, ldvarg61); ldv_state_variable_20 = 2; } else { } goto ldv_61701; case 23: ; if (ldv_state_variable_20 == 4) { mwifiex_cfg80211_change_virtual_intf(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, ldvarg60, ldvarg59, mwifiex_cfg80211_ops_group4); ldv_state_variable_20 = 4; } else { } if (ldv_state_variable_20 == 1) { mwifiex_cfg80211_change_virtual_intf(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, ldvarg60, ldvarg59, mwifiex_cfg80211_ops_group4); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 3) { mwifiex_cfg80211_change_virtual_intf(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, ldvarg60, ldvarg59, mwifiex_cfg80211_ops_group4); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { mwifiex_cfg80211_change_virtual_intf(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, ldvarg60, ldvarg59, mwifiex_cfg80211_ops_group4); ldv_state_variable_20 = 2; } else { } goto ldv_61701; case 24: ; if (ldv_state_variable_20 == 4) { mwifiex_cfg80211_set_default_key(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, (int )ldvarg57, (int )ldvarg56, (int )ldvarg58); ldv_state_variable_20 = 4; } else { } if (ldv_state_variable_20 == 1) { mwifiex_cfg80211_set_default_key(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, (int )ldvarg57, (int )ldvarg56, (int )ldvarg58); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 3) { mwifiex_cfg80211_set_default_key(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, (int )ldvarg57, (int )ldvarg56, (int )ldvarg58); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { mwifiex_cfg80211_set_default_key(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, (int )ldvarg57, (int )ldvarg56, (int )ldvarg58); ldv_state_variable_20 = 2; } else { } goto ldv_61701; case 25: ; if (ldv_state_variable_20 == 4) { mwifiex_cfg80211_scan(mwifiex_cfg80211_ops_group2, ldvarg55); ldv_state_variable_20 = 4; } else { } if (ldv_state_variable_20 == 1) { mwifiex_cfg80211_scan(mwifiex_cfg80211_ops_group2, ldvarg55); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 3) { mwifiex_cfg80211_scan(mwifiex_cfg80211_ops_group2, ldvarg55); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { mwifiex_cfg80211_scan(mwifiex_cfg80211_ops_group2, ldvarg55); ldv_state_variable_20 = 2; } else { } goto ldv_61701; case 26: ; if (ldv_state_variable_20 == 4) { mwifiex_cfg80211_add_station(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, (u8 const *)ldvarg54, mwifiex_cfg80211_ops_group3); ldv_state_variable_20 = 4; } else { } if (ldv_state_variable_20 == 1) { mwifiex_cfg80211_add_station(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, (u8 const *)ldvarg54, mwifiex_cfg80211_ops_group3); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 3) { mwifiex_cfg80211_add_station(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, (u8 const *)ldvarg54, mwifiex_cfg80211_ops_group3); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { mwifiex_cfg80211_add_station(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, (u8 const *)ldvarg54, mwifiex_cfg80211_ops_group3); ldv_state_variable_20 = 2; } else { } goto ldv_61701; case 27: ; if (ldv_state_variable_20 == 4) { mwifiex_cfg80211_start_ap(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, ldvarg53); ldv_state_variable_20 = 4; } else { } if (ldv_state_variable_20 == 1) { mwifiex_cfg80211_start_ap(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, ldvarg53); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 3) { mwifiex_cfg80211_start_ap(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, ldvarg53); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { mwifiex_cfg80211_start_ap(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, ldvarg53); ldv_state_variable_20 = 2; } else { } goto ldv_61701; case 28: ; if (ldv_state_variable_20 == 4) { mwifiex_cfg80211_set_cqm_rssi_config(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, ldvarg52, ldvarg51); ldv_state_variable_20 = 4; } else { } if (ldv_state_variable_20 == 1) { mwifiex_cfg80211_set_cqm_rssi_config(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, ldvarg52, ldvarg51); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 3) { mwifiex_cfg80211_set_cqm_rssi_config(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, ldvarg52, ldvarg51); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { mwifiex_cfg80211_set_cqm_rssi_config(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, ldvarg52, ldvarg51); ldv_state_variable_20 = 2; } else { } goto ldv_61701; case 29: ; if (ldv_state_variable_20 == 4) { mwifiex_cfg80211_channel_switch(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, ldvarg50); ldv_state_variable_20 = 4; } else { } if (ldv_state_variable_20 == 1) { mwifiex_cfg80211_channel_switch(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, ldvarg50); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 3) { mwifiex_cfg80211_channel_switch(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, ldvarg50); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { mwifiex_cfg80211_channel_switch(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, ldvarg50); ldv_state_variable_20 = 2; } else { } goto ldv_61701; case 30: ; if (ldv_state_variable_20 == 4) { mwifiex_cfg80211_del_station(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, ldvarg49); ldv_state_variable_20 = 4; } else { } if (ldv_state_variable_20 == 1) { mwifiex_cfg80211_del_station(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, ldvarg49); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 3) { mwifiex_cfg80211_del_station(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, ldvarg49); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { mwifiex_cfg80211_del_station(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, ldvarg49); ldv_state_variable_20 = 2; } else { } goto ldv_61701; case 31: ; if (ldv_state_variable_20 == 4) { mwifiex_cfg80211_leave_ibss(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5); ldv_state_variable_20 = 4; } else { } if (ldv_state_variable_20 == 1) { mwifiex_cfg80211_leave_ibss(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 3) { mwifiex_cfg80211_leave_ibss(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { mwifiex_cfg80211_leave_ibss(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5); ldv_state_variable_20 = 2; } else { } goto ldv_61701; case 32: ; if (ldv_state_variable_20 == 4) { mwifiex_cfg80211_remain_on_channel(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group0, ldvarg47, ldvarg46, ldvarg48); ldv_state_variable_20 = 4; } else { } if (ldv_state_variable_20 == 1) { mwifiex_cfg80211_remain_on_channel(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group0, ldvarg47, ldvarg46, ldvarg48); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 3) { mwifiex_cfg80211_remain_on_channel(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group0, ldvarg47, ldvarg46, ldvarg48); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { mwifiex_cfg80211_remain_on_channel(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group0, ldvarg47, ldvarg46, ldvarg48); ldv_state_variable_20 = 2; } else { } goto ldv_61701; case 33: ; if (ldv_state_variable_20 == 4) { mwifiex_cfg80211_set_wiphy_params(mwifiex_cfg80211_ops_group2, ldvarg45); ldv_state_variable_20 = 4; } else { } if (ldv_state_variable_20 == 1) { mwifiex_cfg80211_set_wiphy_params(mwifiex_cfg80211_ops_group2, ldvarg45); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 3) { mwifiex_cfg80211_set_wiphy_params(mwifiex_cfg80211_ops_group2, ldvarg45); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { mwifiex_cfg80211_set_wiphy_params(mwifiex_cfg80211_ops_group2, ldvarg45); ldv_state_variable_20 = 2; } else { } goto ldv_61701; case 34: ; if (ldv_state_variable_20 == 4) { mwifiex_cfg80211_get_channel(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group0, mwifiex_cfg80211_ops_group6); ldv_state_variable_20 = 4; } else { } if (ldv_state_variable_20 == 1) { mwifiex_cfg80211_get_channel(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group0, mwifiex_cfg80211_ops_group6); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 3) { mwifiex_cfg80211_get_channel(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group0, mwifiex_cfg80211_ops_group6); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { mwifiex_cfg80211_get_channel(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group0, mwifiex_cfg80211_ops_group6); ldv_state_variable_20 = 2; } else { } goto ldv_61701; case 35: ; if (ldv_state_variable_20 == 4) { mwifiex_cfg80211_mgmt_tx(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group0, ldvarg44, ldvarg43); ldv_state_variable_20 = 4; } else { } if (ldv_state_variable_20 == 1) { mwifiex_cfg80211_mgmt_tx(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group0, ldvarg44, ldvarg43); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 3) { mwifiex_cfg80211_mgmt_tx(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group0, ldvarg44, ldvarg43); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { mwifiex_cfg80211_mgmt_tx(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group0, ldvarg44, ldvarg43); ldv_state_variable_20 = 2; } else { } goto ldv_61701; case 36: ; if (ldv_state_variable_20 == 4) { mwifiex_cfg80211_disconnect(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, (int )ldvarg42); ldv_state_variable_20 = 2; } else { } if (ldv_state_variable_20 == 3) { mwifiex_cfg80211_disconnect(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, (int )ldvarg42); ldv_state_variable_20 = 2; } else { } goto ldv_61701; case 37: ; if (ldv_state_variable_20 == 4) { mwifiex_cfg80211_dump_survey(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, ldvarg41, ldvarg40); ldv_state_variable_20 = 4; } else { } if (ldv_state_variable_20 == 1) { mwifiex_cfg80211_dump_survey(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, ldvarg41, ldvarg40); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 3) { mwifiex_cfg80211_dump_survey(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, ldvarg41, ldvarg40); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { mwifiex_cfg80211_dump_survey(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, ldvarg41, ldvarg40); ldv_state_variable_20 = 2; } else { } goto ldv_61701; case 38: ; if (ldv_state_variable_20 == 4) { mwifiex_cfg80211_tdls_oper(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, (u8 const *)ldvarg39, ldvarg38); ldv_state_variable_20 = 4; } else { } if (ldv_state_variable_20 == 1) { mwifiex_cfg80211_tdls_oper(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, (u8 const *)ldvarg39, ldvarg38); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 3) { mwifiex_cfg80211_tdls_oper(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, (u8 const *)ldvarg39, ldvarg38); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { mwifiex_cfg80211_tdls_oper(mwifiex_cfg80211_ops_group2, mwifiex_cfg80211_ops_group5, (u8 const *)ldvarg39, ldvarg38); ldv_state_variable_20 = 2; } else { } goto ldv_61701; case 39: ; if (ldv_state_variable_20 == 2) { ldv_release_20(); ldv_state_variable_20 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_61701; case 40: ; if (ldv_state_variable_20 == 1) { ldv_bind_20(); ldv_state_variable_20 = 2; ref_cnt = ref_cnt + 1; } else { } goto ldv_61701; default: ldv_stop(); } ldv_61701: ; return; } } __inline static void *ERR_PTR(long error ) { void *tmp ; { tmp = ldv_err_ptr(error); return (tmp); } } bool ldv_queue_work_on_359(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_360(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_361(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_362(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_363(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } void ldv_flush_workqueue_364(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } void ldv_flush_workqueue_365(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } void ldv_flush_workqueue_366(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } void ldv_destroy_workqueue_367(struct workqueue_struct *ldv_func_arg1 ) { { destroy_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } void ldv_flush_workqueue_368(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } void ldv_destroy_workqueue_369(struct workqueue_struct *ldv_func_arg1 ) { { destroy_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_work_on_385(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_387(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_386(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_389(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_388(struct workqueue_struct *ldv_func_arg1 ) ; static void mwifiex_ethtool_get_wol(struct net_device *dev , struct ethtool_wolinfo *wol ) { struct mwifiex_private *priv ; struct mwifiex_private *tmp ; u32 conditions ; { tmp = mwifiex_netdev_get_priv(dev); priv = tmp; conditions = (priv->adapter)->hs_cfg.conditions; wol->supported = 15U; if (conditions == 0U) { return; } else { } if ((conditions & 2U) != 0U) { wol->wolopts = wol->wolopts | 2U; } else { } if ((conditions & 8U) != 0U) { wol->wolopts = wol->wolopts | 4U; } else { } if ((int )conditions & 1) { wol->wolopts = wol->wolopts | 8U; } else { } if ((conditions & 4U) != 0U) { wol->wolopts = wol->wolopts | 1U; } else { } return; } } static int mwifiex_ethtool_set_wol(struct net_device *dev , struct ethtool_wolinfo *wol ) { struct mwifiex_private *priv ; struct mwifiex_private *tmp ; u32 conditions ; { tmp = mwifiex_netdev_get_priv(dev); priv = tmp; conditions = 0U; if ((wol->wolopts & 4294967280U) != 0U) { return (-95); } else { } if ((wol->wolopts & 2U) != 0U) { conditions = conditions | 2U; } else { } if ((wol->wolopts & 4U) != 0U) { conditions = conditions | 8U; } else { } if ((wol->wolopts & 8U) != 0U) { conditions = conditions | 1U; } else { } if ((int )wol->wolopts & 1) { conditions = conditions | 4U; } else { } if (wol->wolopts == 0U) { conditions = conditions; } else { } (priv->adapter)->hs_cfg.conditions = conditions; return (0); } } struct ethtool_ops const mwifiex_ethtool_ops = {0, 0, 0, 0, 0, & mwifiex_ethtool_get_wol, & mwifiex_ethtool_set_wol, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; void ldv_initialize_ethtool_ops_19(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(3008UL); mwifiex_ethtool_ops_group0 = (struct net_device *)tmp; tmp___0 = ldv_init_zalloc(20UL); mwifiex_ethtool_ops_group1 = (struct ethtool_wolinfo *)tmp___0; return; } } void ldv_main_exported_19(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_state_variable_19 == 1) { mwifiex_ethtool_set_wol(mwifiex_ethtool_ops_group0, mwifiex_ethtool_ops_group1); ldv_state_variable_19 = 1; } else { } goto ldv_60687; case 1: ; if (ldv_state_variable_19 == 1) { mwifiex_ethtool_get_wol(mwifiex_ethtool_ops_group0, mwifiex_ethtool_ops_group1); ldv_state_variable_19 = 1; } else { } goto ldv_60687; default: ldv_stop(); } ldv_60687: ; return; } } bool ldv_queue_work_on_385(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_386(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_387(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_388(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_389(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; bool ldv_queue_work_on_399(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_401(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_400(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_403(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_402(struct workqueue_struct *ldv_func_arg1 ) ; extern bool cancel_delayed_work_sync(struct delayed_work * ) ; bool ldv_cancel_delayed_work_sync_404(struct delayed_work *ldv_func_arg1 ) ; bool ldv_cancel_delayed_work_sync_405(struct delayed_work *ldv_func_arg1 ) ; extern void cfg80211_radar_event(struct wiphy * , struct cfg80211_chan_def * , gfp_t ) ; extern void cfg80211_cac_event(struct net_device * , struct cfg80211_chan_def const * , enum nl80211_radar_event , gfp_t ) ; extern void cfg80211_ch_switch_notify(struct net_device * , struct cfg80211_chan_def * ) ; int mwifiex_stop_radar_detection(struct mwifiex_private *priv , struct cfg80211_chan_def *chandef ) ; void mwifiex_init_11h_params(struct mwifiex_private *priv ) { { priv->state_11h.is_11h_enabled = 1; priv->state_11h.is_11h_active = 0; return; } } static void mwifiex_11h_process_infra_join(struct mwifiex_private *priv , u8 **buffer , struct mwifiex_bssdescriptor *bss_desc ) { struct mwifiex_ie_types_header *ie_header ; struct mwifiex_ie_types_pwr_capability *cap ; struct mwifiex_ie_types_local_pwr_constraint *constraint ; struct ieee80211_supported_band *sband ; u8 radio_type ; int i ; u8 *tmp ; u8 *tmp___0 ; u8 *tmp___1 ; int tmp___2 ; u8 *tmp___3 ; { if ((unsigned long )buffer == (unsigned long )((u8 **)0U) || (unsigned long )*buffer == (unsigned long )((u8 *)0U)) { return; } else { } radio_type = mwifiex_band_to_radio_type((int )((unsigned char )bss_desc->bss_band)); sband = (priv->wdev.wiphy)->bands[(int )radio_type]; cap = (struct mwifiex_ie_types_pwr_capability *)*buffer; cap->header.type = 33U; cap->header.len = 2U; cap->min_pwr = 0; cap->max_pwr = 0; *buffer = *buffer + 6UL; constraint = (struct mwifiex_ie_types_local_pwr_constraint *)*buffer; constraint->header.type = 32U; constraint->header.len = 2U; constraint->chan = (u8 )bss_desc->channel; constraint->constraint = bss_desc->local_constraint; *buffer = *buffer + 6UL; ie_header = (struct mwifiex_ie_types_header *)*buffer; ie_header->type = 266U; ie_header->len = ((unsigned int )((unsigned short )sband->n_channels) + 1U) * 2U; *buffer = *buffer + 4UL; tmp = *buffer; *buffer = *buffer + 1; *tmp = 36U; tmp___0 = *buffer; *buffer = *buffer + 1; *tmp___0 = (unsigned int )((u8 )sband->n_channels) * 2U; i = 0; goto ldv_60693; ldv_60692: tmp___1 = *buffer; *buffer = *buffer + 1; tmp___2 = ieee80211_frequency_to_channel((int )(sband->channels + (unsigned long )i)->center_freq); *tmp___1 = (u8 )tmp___2; tmp___3 = *buffer; *buffer = *buffer + 1; *tmp___3 = 1U; i = i + 1; ldv_60693: ; if (sband->n_channels > i) { goto ldv_60692; } else { } return; } } int mwifiex_11h_activate(struct mwifiex_private *priv , bool flag ) { u32 enable ; int tmp ; { enable = (u32 )flag; if ((int )priv->bss_role & 1 && enable != 0U) { enable = enable | 2U; } else { } tmp = mwifiex_send_cmd(priv, 22, 1, 10U, (void *)(& enable), 1); return (tmp); } } void mwifiex_11h_process_join(struct mwifiex_private *priv , u8 **buffer , struct mwifiex_bssdescriptor *bss_desc ) { { if ((unsigned int )bss_desc->sensed_11h != 0U) { mwifiex_11h_activate(priv, 1); priv->state_11h.is_11h_active = 1; bss_desc->cap_info_bitmap = (u16 )((unsigned int )bss_desc->cap_info_bitmap | 256U); mwifiex_11h_process_infra_join(priv, buffer, bss_desc); } else { mwifiex_11h_activate(priv, 0); priv->state_11h.is_11h_active = 0; bss_desc->cap_info_bitmap = (unsigned int )bss_desc->cap_info_bitmap & 65279U; } return; } } void mwifiex_dfs_cac_work_queue(struct work_struct *work ) { struct cfg80211_chan_def chandef ; struct delayed_work *delayed_work ; struct work_struct const *__mptr ; struct mwifiex_private *priv ; struct delayed_work const *__mptr___0 ; int __ret_warn_on ; long tmp ; long tmp___0 ; { __mptr = (struct work_struct const *)work; delayed_work = (struct delayed_work *)__mptr; __mptr___0 = (struct delayed_work const *)delayed_work; priv = (struct mwifiex_private *)__mptr___0 + 0xffffffffffffd1a0UL; __ret_warn_on = (unsigned long )priv == (unsigned long )((struct mwifiex_private *)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/11944/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/mwifiex/11h.c", 132); } else { } tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { return; } else { } chandef = priv->dfs_chandef; if ((int )priv->wdev.cac_started) { if ((int )(priv->adapter)->debug_mask & 1) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "CAC timer finished; No radar detected\n"); } else { } } else { } cfg80211_cac_event(priv->netdev, (struct cfg80211_chan_def const *)(& chandef), 1, 208U); } else { } return; } } int mwifiex_cmd_issue_chan_report_request(struct mwifiex_private *priv , struct host_cmd_ds_command *cmd , void *data_buf ) { struct host_cmd_ds_chan_rpt_req *cr_req ; struct mwifiex_radar_params *radar_params ; { cr_req = & cmd->params.chan_rpt_req; radar_params = (struct mwifiex_radar_params *)data_buf; cmd->command = 221U; cmd->size = 8U; le16_add_cpu(& cmd->size, 8); cr_req->chan_desc.start_freq = 5000U; cr_req->chan_desc.chan_num = (u8 )((radar_params->chandef)->chan)->hw_value; cr_req->chan_desc.chan_width = (u8 )(radar_params->chandef)->width; cr_req->msec_dwell_time = radar_params->cac_time_ms; if (radar_params->cac_time_ms != 0U) { if ((int )(priv->adapter)->debug_mask & 1) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "11h: issuing DFS Radar check for channel=%d\n", (int )((radar_params->chandef)->chan)->hw_value); } else { } } else { } } else if ((int )(priv->adapter)->debug_mask & 1) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "cancelling CAC\n"); } else { } } else { } return (0); } } int mwifiex_stop_radar_detection(struct mwifiex_private *priv , struct cfg80211_chan_def *chandef ) { struct mwifiex_radar_params radar_params ; int tmp ; { memset((void *)(& radar_params), 0, 12UL); radar_params.chandef = chandef; radar_params.cac_time_ms = 0U; tmp = mwifiex_send_cmd(priv, 221, 1, 0U, (void *)(& radar_params), 1); return (tmp); } } void mwifiex_abort_cac(struct mwifiex_private *priv ) { int tmp ; { if ((int )priv->wdev.cac_started) { tmp = mwifiex_stop_radar_detection(priv, & priv->dfs_chandef); if (tmp != 0) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "failed to stop CAC in FW\n"); } else { } } else { } } else { } if ((int )(priv->adapter)->debug_mask & 1) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Aborting delayed work for CAC.\n"); } else { } } else { } ldv_cancel_delayed_work_sync_404(& priv->dfs_cac_work); cfg80211_cac_event(priv->netdev, (struct cfg80211_chan_def const *)(& priv->dfs_chandef), 2, 208U); } else { } return; } } int mwifiex_11h_handle_chanrpt_ready(struct mwifiex_private *priv , struct sk_buff *skb ) { struct host_cmd_ds_chan_rpt_event *rpt_event ; struct mwifiex_ie_types_chan_rpt_data *rpt ; u8 *evt_buf ; u16 event_len ; u16 tlv_len ; { rpt_event = (struct host_cmd_ds_chan_rpt_event *)skb->data + 4U; event_len = (unsigned int )((u16 )skb->len) - 20U; if (rpt_event->result != 0U) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Error in channel report event\n"); } else { } } else { } return (-1); } else { } evt_buf = (u8 *)(& rpt_event->tlvbuf); goto ldv_60745; ldv_60744: rpt = (struct mwifiex_ie_types_chan_rpt_data *)(& rpt_event->tlvbuf); tlv_len = rpt->header.len; switch ((int )rpt->header.type) { case 347: ; if ((unsigned int )*((unsigned char *)rpt + 4UL) != 0U) { if ((int )(priv->adapter)->debug_mask & 1) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "RADAR Detected on channel %d!\n", (int )(priv->dfs_chandef.chan)->hw_value); } else { } } else { } ldv_cancel_delayed_work_sync_405(& priv->dfs_cac_work); cfg80211_cac_event(priv->netdev, (struct cfg80211_chan_def const *)(& priv->dfs_chandef), 0, 208U); } else { } goto ldv_60742; default: ; goto ldv_60742; } ldv_60742: evt_buf = evt_buf + ((unsigned long )tlv_len + 4UL); event_len = (unsigned int )((int )event_len - (int )tlv_len) - 4U; ldv_60745: ; if ((unsigned int )event_len > 3U) { goto ldv_60744; } else { } return (0); } } int mwifiex_11h_handle_radar_detected(struct mwifiex_private *priv , struct sk_buff *skb ) { struct mwifiex_radar_det_event *rdr_event ; int tmp ; { rdr_event = (struct mwifiex_radar_det_event *)skb->data + 4U; if (rdr_event->passed != 0U) { if ((int )(priv->adapter)->debug_mask & 1) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "radar detected; indicating kernel\n"); } else { } } else { } tmp = mwifiex_stop_radar_detection(priv, & priv->dfs_chandef); if (tmp != 0) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Failed to stop CAC in FW\n"); } else { } } else { } } else { } cfg80211_radar_event((priv->adapter)->wiphy, & priv->dfs_chandef, 208U); if ((int )(priv->adapter)->debug_mask & 1) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "regdomain: %d\n", (int )rdr_event->reg_domain); } else { } } else { } if ((int )(priv->adapter)->debug_mask & 1) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "radar detection type: %d\n", (int )rdr_event->det_type); } else { } } else { } } else if ((int )(priv->adapter)->debug_mask & 1) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "false radar detection event!\n"); } else { } } else { } return (0); } } void mwifiex_dfs_chan_sw_work_queue(struct work_struct *work ) { struct mwifiex_uap_bss_param *bss_cfg ; struct delayed_work *delayed_work ; struct work_struct const *__mptr ; struct mwifiex_private *priv ; struct delayed_work const *__mptr___0 ; int __ret_warn_on ; long tmp ; long tmp___0 ; int tmp___1 ; { __mptr = (struct work_struct const *)work; delayed_work = (struct delayed_work *)__mptr; __mptr___0 = (struct delayed_work const *)delayed_work; priv = (struct mwifiex_private *)__mptr___0 + 0xffffffffffffd038UL; __ret_warn_on = (unsigned long )priv == (unsigned long )((struct mwifiex_private *)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/11944/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/mwifiex/11h.c", 298); } else { } tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { return; } else { } bss_cfg = & priv->bss_cfg; if ((unsigned int )bss_cfg->beacon_period == 0U) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "channel switch: AP already stopped\n"); } else { } } else { } return; } else { } mwifiex_uap_set_channel(priv, bss_cfg, priv->dfs_chandef); tmp___1 = mwifiex_config_start_uap(priv, bss_cfg); if (tmp___1 != 0) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Failed to start AP after channel switch\n"); } else { } } else { } return; } else { } if ((int )(priv->adapter)->debug_mask & 1) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "indicating channel switch completion to kernel\n"); } else { } } else { } cfg80211_ch_switch_notify(priv->netdev, & priv->dfs_chandef); return; } } bool ldv_queue_work_on_399(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_400(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_401(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_402(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_403(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_cancel_delayed_work_sync_404(struct delayed_work *ldv_func_arg1 ) { ldv_func_ret_type___6 ldv_func_res ; bool tmp ; { tmp = cancel_delayed_work_sync(ldv_func_arg1); ldv_func_res = tmp; disable_work_2(& ldv_func_arg1->work); return (ldv_func_res); } } bool ldv_cancel_delayed_work_sync_405(struct delayed_work *ldv_func_arg1 ) { ldv_func_ret_type___7 ldv_func_res ; bool tmp ; { tmp = cancel_delayed_work_sync(ldv_func_arg1); ldv_func_res = tmp; disable_work_2(& ldv_func_arg1->work); return (ldv_func_res); } } __inline static long ldv__builtin_expect(long exp , long c ) ; int ldv_del_timer_425(struct timer_list *ldv_func_arg1 ) ; int ldv_mod_timer_422(struct timer_list *ldv_func_arg1 , unsigned long ldv_func_arg2 ) ; int ldv_mod_timer_423(struct timer_list *ldv_func_arg1 , unsigned long ldv_func_arg2 ) ; int ldv_mod_timer_424(struct timer_list *ldv_func_arg1 , unsigned long ldv_func_arg2 ) ; bool ldv_queue_work_on_417(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_419(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_418(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_421(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_420(struct workqueue_struct *ldv_func_arg1 ) ; void disable_suitable_timer_8(struct timer_list *timer ) ; void activate_pending_timer_8(struct timer_list *timer , unsigned long data , int pending_flag ) ; void choose_timer_8(void) ; int reg_timer_8(struct timer_list *timer , void (*function)(unsigned long ) , unsigned long data ) ; void ldv_timer_8(int state , struct timer_list *timer ) ; void activate_suitable_timer_8(struct timer_list *timer , unsigned long data ) ; void mwifiex_flush_auto_tdls_list(struct mwifiex_private *priv ) ; void mwifiex_auto_tdls_update_peer_status(struct mwifiex_private *priv , u8 const *mac , u8 link_status ) ; void mwifiex_check_auto_tdls(unsigned long context ) ; static u8 const tos_to_tid_inv___0[8U] = { 2U, 0U, 1U, 3U, 4U, 5U, 6U, 7U}; static void mwifiex_restore_tdls_packets(struct mwifiex_private *priv , u8 const *mac , u8 status ) { struct mwifiex_ra_list_tbl *ra_list ; struct list_head *tid_list ; struct sk_buff *skb ; struct sk_buff *tmp ; struct mwifiex_txinfo *tx_info ; unsigned long flags ; u32 tid ; u8 tid_down ; raw_spinlock_t *tmp___0 ; bool tmp___1 ; int tmp___2 ; struct list_head const *__mptr ; int tmp___3 ; int tmp___4 ; { if (((priv->adapter)->debug_mask & 8U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "%s: %pM\n", "mwifiex_restore_tdls_packets", mac); } else { } } else { } tmp___0 = spinlock_check(& priv->wmm.ra_list_spinlock); flags = _raw_spin_lock_irqsave(tmp___0); skb = priv->tdls_txq.next; tmp = skb->__annonCompField68.__annonCompField67.next; goto ldv_60989; ldv_60988: tmp___1 = ether_addr_equal(mac, (u8 const *)skb->data); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { goto ldv_60985; } else { } __skb_unlink(skb, & priv->tdls_txq); tx_info = MWIFIEX_SKB_TXCB(skb); tid = skb->priority; tid_down = mwifiex_wmm_downgrade_tid(priv, tid); if ((unsigned int )status == 2U) { ra_list = mwifiex_wmm_get_queue_raptr(priv, (int )((u8 )tid), mac); ra_list->tdls_link = 1; tx_info->flags = (u8 )((unsigned int )tx_info->flags | 4U); } else { tid_list = & priv->wmm.tid_tbl_ptr[(int )tid_down].ra_list; tmp___3 = list_empty((struct list_head const *)tid_list); if (tmp___3 == 0) { __mptr = (struct list_head const *)tid_list->next; ra_list = (struct mwifiex_ra_list_tbl *)__mptr; } else { ra_list = (struct mwifiex_ra_list_tbl *)0; } tx_info->flags = (unsigned int )tx_info->flags & 251U; } if ((unsigned long )ra_list == (unsigned long )((struct mwifiex_ra_list_tbl *)0)) { mwifiex_write_data_complete(priv->adapter, skb, 0, -1); goto ldv_60985; } else { } skb_queue_tail(& ra_list->skb_head, skb); ra_list->ba_pkt_count = (u16 )((int )ra_list->ba_pkt_count + 1); ra_list->total_pkt_count = (u16 )((int )ra_list->total_pkt_count + 1); tmp___4 = atomic_read((atomic_t const *)(& priv->wmm.highest_queued_prio)); if (tmp___4 < (int )tos_to_tid_inv___0[(int )tid_down]) { atomic_set(& priv->wmm.highest_queued_prio, (int )tos_to_tid_inv___0[(int )tid_down]); } else { } atomic_inc(& priv->wmm.tx_pkts_queued); ldv_60985: skb = tmp; tmp = skb->__annonCompField68.__annonCompField67.next; ldv_60989: ; if ((unsigned long )((struct sk_buff *)(& priv->tdls_txq)) != (unsigned long )skb) { goto ldv_60988; } else { } spin_unlock_irqrestore(& priv->wmm.ra_list_spinlock, flags); return; } } static void mwifiex_hold_tdls_packets(struct mwifiex_private *priv , u8 const *mac ) { struct mwifiex_ra_list_tbl *ra_list ; struct list_head *ra_list_head ; struct sk_buff *skb ; struct sk_buff *tmp ; unsigned long flags ; int i ; raw_spinlock_t *tmp___0 ; struct list_head const *__mptr ; bool tmp___1 ; int tmp___2 ; struct list_head const *__mptr___0 ; int tmp___3 ; { if (((priv->adapter)->debug_mask & 8U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "%s: %pM\n", "mwifiex_hold_tdls_packets", mac); } else { } } else { } tmp___0 = spinlock_check(& priv->wmm.ra_list_spinlock); flags = _raw_spin_lock_irqsave(tmp___0); i = 0; goto ldv_61017; ldv_61016: tmp___3 = list_empty((struct list_head const *)(& priv->wmm.tid_tbl_ptr[i].ra_list)); if (tmp___3 == 0) { ra_list_head = & priv->wmm.tid_tbl_ptr[i].ra_list; __mptr = (struct list_head const *)ra_list_head->next; ra_list = (struct mwifiex_ra_list_tbl *)__mptr; goto ldv_61014; ldv_61013: skb = ra_list->skb_head.next; tmp = skb->__annonCompField68.__annonCompField67.next; goto ldv_61011; ldv_61010: tmp___1 = ether_addr_equal(mac, (u8 const *)skb->data); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { goto ldv_61009; } else { } __skb_unlink(skb, & ra_list->skb_head); atomic_dec(& priv->wmm.tx_pkts_queued); ra_list->total_pkt_count = (u16 )((int )ra_list->total_pkt_count - 1); skb_queue_tail(& priv->tdls_txq, skb); ldv_61009: skb = tmp; tmp = skb->__annonCompField68.__annonCompField67.next; ldv_61011: ; if ((unsigned long )((struct sk_buff *)(& ra_list->skb_head)) != (unsigned long )skb) { goto ldv_61010; } else { } __mptr___0 = (struct list_head const *)ra_list->list.next; ra_list = (struct mwifiex_ra_list_tbl *)__mptr___0; ldv_61014: ; if ((unsigned long )(& ra_list->list) != (unsigned long )ra_list_head) { goto ldv_61013; } else { } } else { } i = i + 1; ldv_61017: ; if (i <= 7) { goto ldv_61016; } else { } spin_unlock_irqrestore(& priv->wmm.ra_list_spinlock, flags); return; } } static int mwifiex_tdls_append_rates_ie(struct mwifiex_private *priv , struct sk_buff *skb ) { u8 rates[14U] ; u8 *pos ; u16 rates_size ; u16 supp_rates_size ; u16 ext_rates_size ; u32 tmp ; u16 __min1 ; u16 __min2 ; int tmp___0 ; unsigned char *tmp___1 ; u8 *tmp___2 ; u8 *tmp___3 ; unsigned char *tmp___4 ; u8 *tmp___5 ; u8 *tmp___6 ; { memset((void *)(& rates), 0, 14UL); tmp = mwifiex_get_supported_rates(priv, (u8 *)(& rates)); rates_size = (u16 )tmp; __min1 = rates_size; __min2 = 8U; supp_rates_size = (u16 )((int )__min1 < (int )__min2 ? __min1 : __min2); tmp___0 = skb_tailroom((struct sk_buff const *)skb); if (tmp___0 < (int )rates_size + 4) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Insuffient space while adding rates\n"); } else { } } else { } return (-12); } else { } tmp___1 = skb_put(skb, (unsigned int )((int )supp_rates_size + 2)); pos = tmp___1; tmp___2 = pos; pos = pos + 1; *tmp___2 = 1U; tmp___3 = pos; pos = pos + 1; *tmp___3 = (u8 )supp_rates_size; memcpy((void *)pos, (void const *)(& rates), (size_t )supp_rates_size); if ((unsigned int )rates_size > 8U) { ext_rates_size = (unsigned int )rates_size + 65528U; tmp___4 = skb_put(skb, (unsigned int )((int )ext_rates_size + 2)); pos = tmp___4; tmp___5 = pos; pos = pos + 1; *tmp___5 = 50U; tmp___6 = pos; pos = pos + 1; *tmp___6 = (u8 )ext_rates_size; memcpy((void *)pos, (void const *)(& rates) + 8U, (size_t )ext_rates_size); } else { } return (0); } } static void mwifiex_tdls_add_aid(struct mwifiex_private *priv , struct sk_buff *skb ) { struct ieee_types_assoc_rsp *assoc_rsp ; u8 *pos ; unsigned char *tmp ; u8 *tmp___0 ; u8 *tmp___1 ; u8 *tmp___2 ; { assoc_rsp = (struct ieee_types_assoc_rsp *)(& priv->assoc_rsp_buf); tmp = skb_put(skb, 4U); pos = tmp; tmp___0 = pos; pos = pos + 1; *tmp___0 = 197U; tmp___1 = pos; pos = pos + 1; *tmp___1 = 2U; tmp___2 = pos; pos = pos + 1; *tmp___2 = (u8 )assoc_rsp->a_id; return; } } static int mwifiex_tdls_add_vht_capab(struct mwifiex_private *priv , struct sk_buff *skb ) { struct ieee80211_vht_cap vht_cap ; u8 *pos ; unsigned char *tmp ; u8 *tmp___0 ; u8 *tmp___1 ; { tmp = skb_put(skb, 14U); pos = tmp; tmp___0 = pos; pos = pos + 1; *tmp___0 = 191U; tmp___1 = pos; pos = pos + 1; *tmp___1 = 12U; memset((void *)(& vht_cap), 0, 12UL); mwifiex_fill_vht_cap_tlv(priv, & vht_cap, (int )priv->curr_bss_params.band); memcpy((void *)pos, (void const *)(& vht_cap), 12UL); return (0); } } static int mwifiex_tdls_add_ht_oper(struct mwifiex_private *priv , u8 const *mac , u8 vht_enabled , struct sk_buff *skb ) { struct ieee80211_ht_operation *ht_oper ; struct mwifiex_sta_node *sta_ptr ; struct mwifiex_bssdescriptor *bss_desc ; u8 *pos ; long tmp ; unsigned char *tmp___0 ; u8 *tmp___1 ; u8 *tmp___2 ; { bss_desc = & priv->curr_bss_params.bss_descriptor; sta_ptr = mwifiex_get_sta_entry(priv, mac); tmp = ldv__builtin_expect((unsigned long )sta_ptr == (unsigned long )((struct mwifiex_sta_node *)0), 0L); if (tmp != 0L) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "TDLS peer station not found in list\n"); } else { } } else { } return (-1); } else { } tmp___0 = skb_put(skb, 24U); pos = tmp___0; tmp___1 = pos; pos = pos + 1; *tmp___1 = 61U; tmp___2 = pos; pos = pos + 1; *tmp___2 = 22U; ht_oper = (struct ieee80211_ht_operation *)pos; ht_oper->primary_chan = (u8 )bss_desc->channel; if ((((unsigned long )(priv->adapter)->hw_dot_11n_dev_cap & 131072UL) != 0UL && (unsigned long )bss_desc->bcn_ht_cap != (unsigned long )((struct ieee80211_ht_cap *)0)) && ((unsigned long )(bss_desc->bcn_ht_oper)->ht_param & 4UL) != 0UL) { ht_oper->ht_param = (bss_desc->bcn_ht_oper)->ht_param; } else { } if ((unsigned int )vht_enabled != 0U) { ht_oper->ht_param = mwifiex_get_sec_chan_offset((int )bss_desc->channel); ht_oper->ht_param = (u8 )((unsigned int )ht_oper->ht_param | 4U); } else { } memcpy((void *)(& sta_ptr->tdls_cap.ht_oper), (void const *)ht_oper, 22UL); return (0); } } static int mwifiex_tdls_add_vht_oper(struct mwifiex_private *priv , u8 const *mac , struct sk_buff *skb ) { struct mwifiex_bssdescriptor *bss_desc ; struct ieee80211_vht_operation *vht_oper ; struct ieee80211_vht_cap *vht_cap ; struct ieee80211_vht_cap *ap_vht_cap ; struct mwifiex_sta_node *sta_ptr ; struct mwifiex_adapter *adapter ; u8 supp_chwd_set ; u8 peer_supp_chwd_set ; u8 *pos ; u8 ap_supp_chwd_set ; u8 chan_bw ; u16 mcs_map_user ; u16 mcs_map_resp ; u16 mcs_map_result ; u16 mcs_user ; u16 mcs_resp ; u16 nss ; u32 usr_vht_cap_info ; long tmp ; bool tmp___0 ; int tmp___1 ; unsigned char *tmp___2 ; u8 *tmp___3 ; u8 *tmp___4 ; u8 __min1 ; u8 __min2 ; u8 __min1___0 ; u8 __min2___0 ; u16 __min1___1 ; u16 __min2___1 ; { ap_vht_cap = (struct ieee80211_vht_cap *)0; adapter = priv->adapter; bss_desc = & priv->curr_bss_params.bss_descriptor; sta_ptr = mwifiex_get_sta_entry(priv, mac); tmp = ldv__builtin_expect((unsigned long )sta_ptr == (unsigned long )((struct mwifiex_sta_node *)0), 0L); if (tmp != 0L) { if ((adapter->debug_mask & 4U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "TDLS peer station not found in list\n"); } else { } } else { } return (-1); } else { } tmp___0 = mwifiex_is_bss_in_11ac_mode(priv); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { if ((int )((signed char )sta_ptr->tdls_cap.extcap.ext_capab[7]) < 0) { if ((adapter->debug_mask & 536870912U) != 0U) { if ((unsigned long )adapter->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)adapter->dev, "TDLS peer doesn\'t support wider bandwidth\n"); } else { } } else { } return (0); } else { } } else { ap_vht_cap = bss_desc->bcn_vht_cap; } tmp___2 = skb_put(skb, 7U); pos = tmp___2; tmp___3 = pos; pos = pos + 1; *tmp___3 = 192U; tmp___4 = pos; pos = pos + 1; *tmp___4 = 5U; vht_oper = (struct ieee80211_vht_operation *)pos; if (((int )bss_desc->bss_band & 4) != 0) { usr_vht_cap_info = adapter->usr_dot_11ac_dev_cap_a; } else { usr_vht_cap_info = adapter->usr_dot_11ac_dev_cap_bg; } vht_cap = & sta_ptr->tdls_cap.vhtcap; supp_chwd_set = (unsigned int )((u8 )(usr_vht_cap_info >> 2)) & 3U; peer_supp_chwd_set = (unsigned int )((u8 )(vht_cap->vht_cap_info >> 2)) & 3U; __min1 = supp_chwd_set; __min2 = peer_supp_chwd_set; supp_chwd_set = (u8 )((int )__min1 < (int )__min2 ? __min1 : __min2); if ((unsigned long )ap_vht_cap != (unsigned long )((struct ieee80211_vht_cap *)0) && (int )((signed char )sta_ptr->tdls_cap.extcap.ext_capab[7]) < 0) { ap_supp_chwd_set = (unsigned int )((u8 )(ap_vht_cap->vht_cap_info >> 2)) & 3U; __min1___0 = supp_chwd_set; __min2___0 = ap_supp_chwd_set; supp_chwd_set = (u8 )((int )__min1___0 < (int )__min2___0 ? __min1___0 : __min2___0); } else { } switch ((int )supp_chwd_set) { case 1: vht_oper->chan_width = 1U; goto ldv_61083; case 2: vht_oper->chan_width = 2U; goto ldv_61083; case 3: vht_oper->chan_width = 3U; goto ldv_61083; default: vht_oper->chan_width = 0U; goto ldv_61083; } ldv_61083: mcs_map_user = (u16 )adapter->usr_dot_11ac_mcs_support; mcs_map_resp = vht_cap->supp_mcs.rx_mcs_map; mcs_map_result = 0U; nss = 1U; goto ldv_61091; ldv_61090: mcs_user = (unsigned int )((u16 )((int )mcs_map_user >> ((int )nss + -1) * 2)) & 3U; mcs_resp = (unsigned int )((u16 )((int )mcs_map_resp >> ((int )nss + -1) * 2)) & 3U; if ((unsigned int )mcs_user == 3U || (unsigned int )mcs_resp == 3U) { mcs_map_result = (u16 )((int )((short )(3 << ((int )nss + -1) * 2)) | (int )((short )mcs_map_result)); } else { __min1___1 = mcs_user; __min2___1 = mcs_resp; mcs_map_result = (u16 )((int )((short )((((int )__min1___1 < (int )__min2___1 ? __min1___1 : __min2___1) & 3) << ((int )nss + -1) * 2)) | (int )((short )mcs_map_result)); } nss = (u16 )((int )nss + 1); ldv_61091: ; if ((unsigned int )nss <= 8U) { goto ldv_61090; } else { } vht_oper->basic_mcs_set = mcs_map_result; switch ((int )vht_oper->chan_width) { case 1: chan_bw = 1U; goto ldv_61094; case 2: chan_bw = 2U; goto ldv_61094; case 3: chan_bw = 1U; goto ldv_61094; default: chan_bw = 0U; goto ldv_61094; } ldv_61094: vht_oper->center_freq_seg1_idx = mwifiex_get_center_freq_index(priv, 32, bss_desc->channel, (int )chan_bw); return (0); } } static void mwifiex_tdls_add_ext_capab(struct mwifiex_private *priv , struct sk_buff *skb ) { struct ieee_types_extcap *extcap ; unsigned char *tmp ; { tmp = skb_put(skb, 10U); extcap = (struct ieee_types_extcap *)tmp; extcap->ieee_hdr.element_id = 127U; extcap->ieee_hdr.len = 8U; memset((void *)(& extcap->ext_capab), 0, 8UL); extcap->ext_capab[4] = (u8 )((unsigned int )extcap->ext_capab[4] | 32U); if ((priv->adapter)->is_hw_11ac_capable != 0U) { extcap->ext_capab[7] = (u8 )((unsigned int )extcap->ext_capab[7] | 128U); } else { } return; } } static void mwifiex_tdls_add_qos_capab(struct sk_buff *skb ) { u8 *pos ; unsigned char *tmp ; u8 *tmp___0 ; u8 *tmp___1 ; u8 *tmp___2 ; { tmp = skb_put(skb, 3U); pos = tmp; tmp___0 = pos; pos = pos + 1; *tmp___0 = 46U; tmp___1 = pos; pos = pos + 1; *tmp___1 = 1U; tmp___2 = pos; pos = pos + 1; *tmp___2 = 15U; return; } } static void mwifiex_tdls_add_wmm_param_ie(struct mwifiex_private *priv , struct sk_buff *skb ) { struct ieee80211_wmm_param_ie *wmm ; u8 ac_vi[4U] ; u8 ac_vo[4U] ; u8 ac_be[4U] ; u8 ac_bk[4U] ; unsigned char *tmp ; { ac_vi[0] = 66U; ac_vi[1] = 67U; ac_vi[2] = 94U; ac_vi[3] = 0U; ac_vo[0] = 98U; ac_vo[1] = 50U; ac_vo[2] = 47U; ac_vo[3] = 0U; ac_be[0] = 3U; ac_be[1] = 164U; ac_be[2] = 0U; ac_be[3] = 0U; ac_bk[0] = 39U; ac_bk[1] = 164U; ac_bk[2] = 0U; ac_bk[3] = 0U; tmp = skb_put(skb, 26U); wmm = (struct ieee80211_wmm_param_ie *)tmp; memset((void *)wmm, 0, 26UL); wmm->element_id = 221U; wmm->len = 24U; wmm->oui[0] = 0U; wmm->oui[1] = 80U; wmm->oui[2] = 242U; wmm->oui_type = 2U; wmm->oui_subtype = 1U; wmm->version = 1U; wmm->qos_info = 0U; memcpy((void *)(& wmm->ac), (void const *)(& ac_be), 4UL); memcpy((void *)(& wmm->ac) + 1U, (void const *)(& ac_bk), 4UL); memcpy((void *)(& wmm->ac) + 2U, (void const *)(& ac_vi), 4UL); memcpy((void *)(& wmm->ac) + 3U, (void const *)(& ac_vo), 4UL); return; } } static void mwifiex_add_wmm_info_ie(struct mwifiex_private *priv , struct sk_buff *skb , u8 qosinfo ) { u8 *buf ; unsigned char *tmp ; u8 *tmp___0 ; u8 *tmp___1 ; u8 *tmp___2 ; u8 *tmp___3 ; u8 *tmp___4 ; u8 *tmp___5 ; u8 *tmp___6 ; u8 *tmp___7 ; u8 *tmp___8 ; { tmp = skb_put(skb, 9U); buf = tmp; tmp___0 = buf; buf = buf + 1; *tmp___0 = 221U; tmp___1 = buf; buf = buf + 1; *tmp___1 = 7U; tmp___2 = buf; buf = buf + 1; *tmp___2 = 0U; tmp___3 = buf; buf = buf + 1; *tmp___3 = 80U; tmp___4 = buf; buf = buf + 1; *tmp___4 = 242U; tmp___5 = buf; buf = buf + 1; *tmp___5 = 2U; tmp___6 = buf; buf = buf + 1; *tmp___6 = 0U; tmp___7 = buf; buf = buf + 1; *tmp___7 = 1U; tmp___8 = buf; buf = buf + 1; *tmp___8 = qosinfo; return; } } static int mwifiex_prep_tdls_encap_data(struct mwifiex_private *priv , u8 const *peer , u8 action_code , u8 dialog_token , u16 status_code , struct sk_buff *skb ) { struct ieee80211_tdls_data *tf ; int ret ; u16 capab ; struct ieee80211_ht_cap *ht_cap ; u8 radio ; u8 *pos ; unsigned char *tmp ; unsigned char *tmp___0 ; u8 *tmp___1 ; u8 *tmp___2 ; unsigned char *tmp___3 ; u8 *tmp___4 ; u8 *tmp___5 ; { capab = priv->curr_bss_params.bss_descriptor.cap_info_bitmap; tmp = skb_put(skb, 17U); tf = (struct ieee80211_tdls_data *)tmp; memcpy((void *)(& tf->da), (void const *)peer, 6UL); memcpy((void *)(& tf->sa), (void const *)(& priv->curr_addr), 6UL); tf->ether_type = 3465U; tf->payload_type = 2U; switch ((int )action_code) { case 0: tf->category = 12U; tf->action_code = 0U; skb_put(skb, 3U); tf->u.setup_req.dialog_token = dialog_token; tf->u.setup_req.capability = capab; ret = mwifiex_tdls_append_rates_ie(priv, skb); if (ret != 0) { dev_kfree_skb_any(skb); return (ret); } else { } tmp___0 = skb_put(skb, 28U); pos = tmp___0; tmp___1 = pos; pos = pos + 1; *tmp___1 = 45U; tmp___2 = pos; pos = pos + 1; *tmp___2 = 26U; ht_cap = (struct ieee80211_ht_cap *)pos; radio = mwifiex_band_to_radio_type((int )priv->curr_bss_params.band); ret = mwifiex_fill_cap_info(priv, (int )radio, ht_cap); if (ret != 0) { dev_kfree_skb_any(skb); return (ret); } else { } if ((priv->adapter)->is_hw_11ac_capable != 0U) { ret = mwifiex_tdls_add_vht_capab(priv, skb); if (ret != 0) { dev_kfree_skb_any(skb); return (ret); } else { } mwifiex_tdls_add_aid(priv, skb); } else { } mwifiex_tdls_add_ext_capab(priv, skb); mwifiex_tdls_add_qos_capab(skb); mwifiex_add_wmm_info_ie(priv, skb, 0); goto ldv_61137; case 1: tf->category = 12U; tf->action_code = 1U; skb_put(skb, 5U); tf->u.setup_resp.status_code = status_code; tf->u.setup_resp.dialog_token = dialog_token; tf->u.setup_resp.capability = capab; ret = mwifiex_tdls_append_rates_ie(priv, skb); if (ret != 0) { dev_kfree_skb_any(skb); return (ret); } else { } tmp___3 = skb_put(skb, 28U); pos = tmp___3; tmp___4 = pos; pos = pos + 1; *tmp___4 = 45U; tmp___5 = pos; pos = pos + 1; *tmp___5 = 26U; ht_cap = (struct ieee80211_ht_cap *)pos; radio = mwifiex_band_to_radio_type((int )priv->curr_bss_params.band); ret = mwifiex_fill_cap_info(priv, (int )radio, ht_cap); if (ret != 0) { dev_kfree_skb_any(skb); return (ret); } else { } if ((priv->adapter)->is_hw_11ac_capable != 0U) { ret = mwifiex_tdls_add_vht_capab(priv, skb); if (ret != 0) { dev_kfree_skb_any(skb); return (ret); } else { } mwifiex_tdls_add_aid(priv, skb); } else { } mwifiex_tdls_add_ext_capab(priv, skb); mwifiex_tdls_add_qos_capab(skb); mwifiex_add_wmm_info_ie(priv, skb, 0); goto ldv_61137; case 2: tf->category = 12U; tf->action_code = 2U; skb_put(skb, 3U); tf->u.setup_cfm.status_code = status_code; tf->u.setup_cfm.dialog_token = dialog_token; mwifiex_tdls_add_wmm_param_ie(priv, skb); if ((priv->adapter)->is_hw_11ac_capable != 0U) { ret = mwifiex_tdls_add_vht_oper(priv, peer, skb); if (ret != 0) { dev_kfree_skb_any(skb); return (ret); } else { } ret = mwifiex_tdls_add_ht_oper(priv, peer, 1, skb); if (ret != 0) { dev_kfree_skb_any(skb); return (ret); } else { } } else { ret = mwifiex_tdls_add_ht_oper(priv, peer, 0, skb); if (ret != 0) { dev_kfree_skb_any(skb); return (ret); } else { } } goto ldv_61137; case 3: tf->category = 12U; tf->action_code = 3U; skb_put(skb, 2U); tf->u.teardown.reason_code = status_code; goto ldv_61137; case 10: tf->category = 12U; tf->action_code = 10U; skb_put(skb, 1U); tf->u.discover_req.dialog_token = dialog_token; goto ldv_61137; default: ; if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Unknown TDLS frame type.\n"); } else { } } else { } return (-22); } ldv_61137: ; return (0); } } static void mwifiex_tdls_add_link_ie(struct sk_buff *skb , u8 const *src_addr , u8 const *peer , u8 const *bssid ) { struct ieee80211_tdls_lnkie *lnkid ; unsigned char *tmp ; { tmp = skb_put(skb, 20U); lnkid = (struct ieee80211_tdls_lnkie *)tmp; lnkid->ie_type = 101U; lnkid->ie_len = 18U; memcpy((void *)(& lnkid->bssid), (void const *)bssid, 6UL); memcpy((void *)(& lnkid->init_sta), (void const *)src_addr, 6UL); memcpy((void *)(& lnkid->resp_sta), (void const *)peer, 6UL); return; } } int mwifiex_send_tdls_data_frame(struct mwifiex_private *priv , u8 const *peer , u8 action_code , u8 dialog_token , u16 status_code , u8 const *extra_ies , size_t extra_ies_len ) { struct sk_buff *skb ; struct mwifiex_txinfo *tx_info ; int ret ; u16 skb_len ; unsigned long _max1 ; unsigned long _max2 ; unsigned char *tmp ; unsigned char *tmp___0 ; { _max1 = 36UL; _max2 = 22UL; skb_len = (unsigned int )((int )((u16 )(_max1 > _max2 ? _max1 : _max2)) + (int )((u16 )extra_ies_len)) + 232U; if ((priv->adapter)->is_hw_11ac_capable != 0U) { skb_len = (unsigned int )skb_len + 25U; } else { } skb = dev_alloc_skb((unsigned int )skb_len); if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "allocate skb failed for management frame\n"); } else { } } else { } return (-12); } else { } skb_reserve(skb, 100); switch ((int )action_code) { case 0: ; case 2: ; case 3: ; case 10: ret = mwifiex_prep_tdls_encap_data(priv, peer, (int )action_code, (int )dialog_token, (int )status_code, skb); if (ret != 0) { dev_kfree_skb_any(skb); return (ret); } else { } if (extra_ies_len != 0UL) { tmp = skb_put(skb, (unsigned int )extra_ies_len); memcpy((void *)tmp, (void const *)extra_ies, extra_ies_len); } else { } mwifiex_tdls_add_link_ie(skb, (u8 const *)(& priv->curr_addr), peer, (u8 const *)(& priv->cfg_bssid)); goto ldv_61170; case 1: ret = mwifiex_prep_tdls_encap_data(priv, peer, (int )action_code, (int )dialog_token, (int )status_code, skb); if (ret != 0) { dev_kfree_skb_any(skb); return (ret); } else { } if (extra_ies_len != 0UL) { tmp___0 = skb_put(skb, (unsigned int )extra_ies_len); memcpy((void *)tmp___0, (void const *)extra_ies, extra_ies_len); } else { } mwifiex_tdls_add_link_ie(skb, peer, (u8 const *)(& priv->curr_addr), (u8 const *)(& priv->cfg_bssid)); goto ldv_61170; } ldv_61170: ; switch ((int )action_code) { case 0: ; case 1: skb->priority = 2U; goto ldv_61174; default: skb->priority = 5U; goto ldv_61174; } ldv_61174: tx_info = MWIFIEX_SKB_TXCB(skb); memset((void *)tx_info, 0, 24UL); tx_info->bss_num = priv->bss_num; tx_info->bss_type = priv->bss_type; __net_timestamp(skb); mwifiex_queue_tx_pkt(priv, skb); return (0); } } static int mwifiex_construct_tdls_action_frame(struct mwifiex_private *priv , u8 const *peer , u8 action_code , u8 dialog_token , u16 status_code , struct sk_buff *skb ) { struct ieee80211_mgmt *mgmt ; u8 bc_addr[6U] ; int ret ; u16 capab ; struct ieee80211_ht_cap *ht_cap ; u8 radio ; u8 *pos ; unsigned char *tmp ; unsigned char *tmp___0 ; unsigned char *tmp___1 ; u8 *tmp___2 ; u8 *tmp___3 ; { bc_addr[0] = 255U; bc_addr[1] = 255U; bc_addr[2] = 255U; bc_addr[3] = 255U; bc_addr[4] = 255U; bc_addr[5] = 255U; capab = priv->curr_bss_params.bss_descriptor.cap_info_bitmap; tmp = skb_put(skb, 24U); mgmt = (struct ieee80211_mgmt *)tmp; memset((void *)mgmt, 0, 24UL); memcpy((void *)(& mgmt->da), (void const *)peer, 6UL); memcpy((void *)(& mgmt->sa), (void const *)(& priv->curr_addr), 6UL); memcpy((void *)(& mgmt->bssid), (void const *)(& priv->cfg_bssid), 6UL); mgmt->frame_control = 208U; tmp___0 = skb_put(skb, 6U); pos = tmp___0; switch ((int )action_code) { case 14: skb_put(skb, 5U); mgmt->u.action.category = 4U; mgmt->u.action.u.tdls_discover_resp.action_code = 14U; mgmt->u.action.u.tdls_discover_resp.dialog_token = dialog_token; mgmt->u.action.u.tdls_discover_resp.capability = capab; __memmove((void *)pos + 6U, (void const *)(& mgmt->u.action.category), 4UL); memcpy((void *)pos, (void const *)(& bc_addr), 6UL); ret = mwifiex_tdls_append_rates_ie(priv, skb); if (ret != 0) { dev_kfree_skb_any(skb); return (ret); } else { } tmp___1 = skb_put(skb, 28U); pos = tmp___1; tmp___2 = pos; pos = pos + 1; *tmp___2 = 45U; tmp___3 = pos; pos = pos + 1; *tmp___3 = 26U; ht_cap = (struct ieee80211_ht_cap *)pos; radio = mwifiex_band_to_radio_type((int )priv->curr_bss_params.band); ret = mwifiex_fill_cap_info(priv, (int )radio, ht_cap); if (ret != 0) { dev_kfree_skb_any(skb); return (ret); } else { } if ((priv->adapter)->is_hw_11ac_capable != 0U) { ret = mwifiex_tdls_add_vht_capab(priv, skb); if (ret != 0) { dev_kfree_skb_any(skb); return (ret); } else { } mwifiex_tdls_add_aid(priv, skb); } else { } mwifiex_tdls_add_ext_capab(priv, skb); mwifiex_tdls_add_qos_capab(skb); goto ldv_61192; default: ; if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Unknown TDLS action frame type\n"); } else { } } else { } return (-22); } ldv_61192: ; return (0); } } int mwifiex_send_tdls_action_frame(struct mwifiex_private *priv , u8 const *peer , u8 action_code , u8 dialog_token , u16 status_code , u8 const *extra_ies , size_t extra_ies_len ) { struct sk_buff *skb ; struct mwifiex_txinfo *tx_info ; u8 *pos ; u32 pkt_type ; u32 tx_control ; u16 pkt_len ; u16 skb_len ; unsigned long _max1 ; unsigned long _max2 ; unsigned char *tmp ; int tmp___0 ; unsigned char *tmp___1 ; { _max1 = 36UL; _max2 = 22UL; skb_len = (unsigned int )((int )((u16 )(_max1 > _max2 ? _max1 : _max2)) + (int )((u16 )extra_ies_len)) + 212U; if ((priv->adapter)->is_hw_11ac_capable != 0U) { skb_len = (unsigned int )skb_len + 25U; } else { } skb = dev_alloc_skb((unsigned int )skb_len); if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "allocate skb failed for management frame\n"); } else { } } else { } return (-12); } else { } skb_reserve(skb, 100); pkt_type = 229U; tx_control = 0U; tmp = skb_put(skb, 10U); pos = tmp; memset((void *)pos, 0, 10UL); memcpy((void *)pos, (void const *)(& pkt_type), 4UL); memcpy((void *)pos + 4U, (void const *)(& tx_control), 4UL); tmp___0 = mwifiex_construct_tdls_action_frame(priv, peer, (int )action_code, (int )dialog_token, (int )status_code, skb); if (tmp___0 != 0) { dev_kfree_skb_any(skb); return (-22); } else { } if (extra_ies_len != 0UL) { tmp___1 = skb_put(skb, (unsigned int )extra_ies_len); memcpy((void *)tmp___1, (void const *)extra_ies, extra_ies_len); } else { } mwifiex_tdls_add_link_ie(skb, peer, (u8 const *)(& priv->curr_addr), (u8 const *)(& priv->cfg_bssid)); skb->priority = 5U; tx_info = MWIFIEX_SKB_TXCB(skb); memset((void *)tx_info, 0, 24UL); tx_info->bss_num = priv->bss_num; tx_info->bss_type = priv->bss_type; tx_info->flags = (u8 )((unsigned int )tx_info->flags | 4U); pkt_len = (unsigned int )((u16 )skb->len) - 10U; memcpy((void *)skb->data + 8U, (void const *)(& pkt_len), 2UL); __net_timestamp(skb); mwifiex_queue_tx_pkt(priv, skb); return (0); } } void mwifiex_process_tdls_action_frame(struct mwifiex_private *priv , u8 *buf , int len ) { struct mwifiex_sta_node *sta_ptr ; u8 *peer ; u8 *pos ; u8 *end ; u8 i ; u8 action ; u8 basic ; __le16 cap ; int ie_len ; u8 __min1 ; u8 __min2 ; u8 __min1___0 ; u8 __min2___0 ; { cap = 0U; ie_len = 0; if ((unsigned int )len <= 16U) { return; } else { } if ((unsigned int )*(buf + 14UL) != 2U) { return; } else { } if ((unsigned int )*(buf + 15U) != 12U) { return; } else { } peer = buf + 6UL; action = *(buf + 16U); if (((priv->adapter)->debug_mask & 8U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "rx:tdls action: peer=%pM, action=%d\n", peer, (int )action); } else { } } else { } switch ((int )action) { case 0: ; if ((unsigned int )len <= 19U) { return; } else { } pos = buf + 18U; cap = *((u16 *)pos); ie_len = (int )((unsigned int )len - 20U); pos = pos + 2UL; goto ldv_61228; case 1: ; if ((unsigned int )len <= 21U) { return; } else { } pos = buf + 20U; cap = *((u16 *)pos); ie_len = (int )((unsigned int )len - 22U); pos = pos + 2UL; goto ldv_61228; case 2: ; if ((unsigned int )len <= 19U) { return; } else { } pos = buf + 20U; ie_len = (int )((unsigned int )len - 20U); goto ldv_61228; default: ; if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Unknown TDLS frame type.\n"); } else { } } else { } return; } ldv_61228: sta_ptr = mwifiex_add_sta_entry(priv, (u8 const *)peer); if ((unsigned long )sta_ptr == (unsigned long )((struct mwifiex_sta_node *)0)) { return; } else { } sta_ptr->tdls_cap.capab = cap; end = pos + (unsigned long )ie_len; goto ldv_61259; ldv_61258: ; if ((unsigned long )(pos + ((unsigned long )*(pos + 1UL) + 2UL)) > (unsigned long )end) { goto ldv_61232; } else { } switch ((int )*pos) { case 1: sta_ptr->tdls_cap.rates_len = *(pos + 1UL); i = 0U; goto ldv_61235; ldv_61234: sta_ptr->tdls_cap.rates[(int )i] = *(pos + ((unsigned long )i + 2UL)); i = (u8 )((int )i + 1); ldv_61235: ; if ((int )*(pos + 1UL) > (int )i) { goto ldv_61234; } else { } goto ldv_61237; case 50: basic = sta_ptr->tdls_cap.rates_len; i = 0U; goto ldv_61240; ldv_61239: sta_ptr->tdls_cap.rates[(int )basic + (int )i] = *(pos + ((unsigned long )i + 2UL)); i = (u8 )((int )i + 1); ldv_61240: ; if ((int )*(pos + 1UL) > (int )i) { goto ldv_61239; } else { } sta_ptr->tdls_cap.rates_len = (int )sta_ptr->tdls_cap.rates_len + (int )*(pos + 1UL); goto ldv_61237; case 45: memcpy((void *)(& sta_ptr->tdls_cap.ht_capb), (void const *)pos, 26UL); sta_ptr->is_11n_enabled = 1U; goto ldv_61237; case 61: memcpy((void *)(& sta_ptr->tdls_cap.ht_oper), (void const *)pos, 22UL); goto ldv_61237; case 72: sta_ptr->tdls_cap.coex_2040 = *(pos + 2UL); goto ldv_61237; case 127: __min1 = *(pos + 1UL); __min2 = 8U; memcpy((void *)(& sta_ptr->tdls_cap.extcap), (void const *)pos, (unsigned long )((int )__min1 < (int )__min2 ? __min1 : __min2) + 2UL); goto ldv_61237; case 48: __min1___0 = *(pos + 1UL); __min2___0 = 254U; memcpy((void *)(& sta_ptr->tdls_cap.rsn_ie), (void const *)pos, (unsigned long )((int )__min1___0 < (int )__min2___0 ? __min1___0 : __min2___0) + 2UL); goto ldv_61237; case 46: sta_ptr->tdls_cap.qos_info = *(pos + 2UL); goto ldv_61237; case 192: ; if ((priv->adapter)->is_hw_11ac_capable != 0U) { memcpy((void *)(& sta_ptr->tdls_cap.vhtoper), (void const *)pos, 5UL); } else { } goto ldv_61237; case 191: ; if ((priv->adapter)->is_hw_11ac_capable != 0U) { memcpy((void *)(& sta_ptr->tdls_cap.vhtcap), (void const *)pos, 12UL); sta_ptr->is_11ac_enabled = 1U; } else { } goto ldv_61237; case 197: ; if ((priv->adapter)->is_hw_11ac_capable != 0U) { sta_ptr->tdls_cap.aid = *((__le16 *)pos + 2U); } else { } default: ; goto ldv_61237; } ldv_61237: pos = pos + (unsigned long )((int )*(pos + 1UL) + 2); ldv_61259: ; if ((unsigned long )(pos + 1UL) < (unsigned long )end) { goto ldv_61258; } else { } ldv_61232: ; return; } } static int mwifiex_tdls_process_config_link(struct mwifiex_private *priv , u8 const *peer ) { struct mwifiex_sta_node *sta_ptr ; struct mwifiex_ds_tdls_oper tdls_oper ; int tmp ; { memset((void *)(& tdls_oper), 0, 56UL); sta_ptr = mwifiex_get_sta_entry(priv, peer); if ((unsigned long )sta_ptr == (unsigned long )((struct mwifiex_sta_node *)0) || (unsigned int )sta_ptr->tdls_status == 3U) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "link absent for peer %pM; cannot config\n", peer); } else { } } else { } return (-22); } else { } memcpy((void *)(& tdls_oper.peer_mac), (void const *)peer, 6UL); tdls_oper.tdls_action = 3U; tmp = mwifiex_send_cmd(priv, 290, 1, 0U, (void *)(& tdls_oper), 1); return (tmp); } } static int mwifiex_tdls_process_create_link(struct mwifiex_private *priv , u8 const *peer ) { struct mwifiex_sta_node *sta_ptr ; struct mwifiex_ds_tdls_oper tdls_oper ; int tmp ; { memset((void *)(& tdls_oper), 0, 56UL); sta_ptr = mwifiex_get_sta_entry(priv, peer); if ((unsigned long )sta_ptr != (unsigned long )((struct mwifiex_sta_node *)0) && (unsigned int )sta_ptr->tdls_status == 1U) { if (((priv->adapter)->debug_mask & 536870912U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Setup already in progress for peer %pM\n", peer); } else { } } else { } return (0); } else { } sta_ptr = mwifiex_add_sta_entry(priv, peer); if ((unsigned long )sta_ptr == (unsigned long )((struct mwifiex_sta_node *)0)) { return (-12); } else { } sta_ptr->tdls_status = 1U; mwifiex_hold_tdls_packets(priv, peer); memcpy((void *)(& tdls_oper.peer_mac), (void const *)peer, 6UL); tdls_oper.tdls_action = 2U; tmp = mwifiex_send_cmd(priv, 290, 1, 0U, (void *)(& tdls_oper), 1); return (tmp); } } static int mwifiex_tdls_process_disable_link(struct mwifiex_private *priv , u8 const *peer ) { struct mwifiex_sta_node *sta_ptr ; struct mwifiex_ds_tdls_oper tdls_oper ; unsigned long flags ; raw_spinlock_t *tmp ; int tmp___0 ; { memset((void *)(& tdls_oper), 0, 56UL); sta_ptr = mwifiex_get_sta_entry(priv, peer); if ((unsigned long )sta_ptr != (unsigned long )((struct mwifiex_sta_node *)0)) { if ((unsigned int )sta_ptr->is_11n_enabled != 0U) { mwifiex_11n_cleanup_reorder_tbl(priv); tmp = spinlock_check(& priv->wmm.ra_list_spinlock); flags = _raw_spin_lock_irqsave(tmp); mwifiex_11n_delete_all_tx_ba_stream_tbl(priv); spin_unlock_irqrestore(& priv->wmm.ra_list_spinlock, flags); } else { } mwifiex_del_sta_entry(priv, peer); } else { } mwifiex_restore_tdls_packets(priv, peer, 4); mwifiex_auto_tdls_update_peer_status(priv, peer, 0); memcpy((void *)(& tdls_oper.peer_mac), (void const *)peer, 6UL); tdls_oper.tdls_action = 0U; tmp___0 = mwifiex_send_cmd(priv, 290, 1, 0U, (void *)(& tdls_oper), 1); return (tmp___0); } } static int mwifiex_tdls_process_enable_link(struct mwifiex_private *priv , u8 const *peer ) { struct mwifiex_sta_node *sta_ptr ; struct ieee80211_mcs_info mcs ; unsigned long flags ; int i ; raw_spinlock_t *tmp ; { sta_ptr = mwifiex_get_sta_entry(priv, peer); if ((unsigned long )sta_ptr != (unsigned long )((struct mwifiex_sta_node *)0) && (unsigned int )sta_ptr->tdls_status != 3U) { if ((int )(priv->adapter)->debug_mask & 1) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "tdls: enable link %pM success\n", peer); } else { } } else { } sta_ptr->tdls_status = 2U; mcs = sta_ptr->tdls_cap.ht_capb.mcs; if ((unsigned int )mcs.rx_mask[0] != 255U) { sta_ptr->is_11n_enabled = 1U; } else { } if ((unsigned int )sta_ptr->is_11n_enabled != 0U) { if (((int )sta_ptr->tdls_cap.ht_capb.cap_info & 2048) != 0) { sta_ptr->max_amsdu = 8192U; } else { sta_ptr->max_amsdu = 4096U; } i = 0; goto ldv_61291; ldv_61290: sta_ptr->ampdu_sta[i] = priv->aggr_prio_tbl[i].ampdu_user; i = i + 1; ldv_61291: ; if (i <= 7) { goto ldv_61290; } else { } } else { i = 0; goto ldv_61294; ldv_61293: sta_ptr->ampdu_sta[i] = 255U; i = i + 1; ldv_61294: ; if (i <= 7) { goto ldv_61293; } else { } } memset((void *)(& sta_ptr->rx_seq), 255, 16UL); mwifiex_restore_tdls_packets(priv, peer, 2); mwifiex_auto_tdls_update_peer_status(priv, peer, 2); } else { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "tdls: enable link %pM failed\n", peer); } else { } } else { } if ((unsigned long )sta_ptr != (unsigned long )((struct mwifiex_sta_node *)0)) { mwifiex_11n_cleanup_reorder_tbl(priv); tmp = spinlock_check(& priv->wmm.ra_list_spinlock); flags = _raw_spin_lock_irqsave(tmp); mwifiex_11n_delete_all_tx_ba_stream_tbl(priv); spin_unlock_irqrestore(& priv->wmm.ra_list_spinlock, flags); mwifiex_del_sta_entry(priv, peer); } else { } mwifiex_restore_tdls_packets(priv, peer, 4); mwifiex_auto_tdls_update_peer_status(priv, peer, 0); return (-1); } return (0); } } int mwifiex_tdls_oper(struct mwifiex_private *priv , u8 const *peer , u8 action ) { int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; { switch ((int )action) { case 1: tmp = mwifiex_tdls_process_enable_link(priv, peer); return (tmp); case 0: tmp___0 = mwifiex_tdls_process_disable_link(priv, peer); return (tmp___0); case 2: tmp___1 = mwifiex_tdls_process_create_link(priv, peer); return (tmp___1); case 3: tmp___2 = mwifiex_tdls_process_config_link(priv, peer); return (tmp___2); } return (0); } } int mwifiex_get_tdls_link_status(struct mwifiex_private *priv , u8 const *mac ) { struct mwifiex_sta_node *sta_ptr ; { sta_ptr = mwifiex_get_sta_entry(priv, mac); if ((unsigned long )sta_ptr != (unsigned long )((struct mwifiex_sta_node *)0)) { return ((int )sta_ptr->tdls_status); } else { } return (0); } } int mwifiex_get_tdls_list(struct mwifiex_private *priv , struct tdls_peer_info *buf ) { struct mwifiex_sta_node *sta_ptr ; struct tdls_peer_info *peer ; int count ; unsigned long flags ; raw_spinlock_t *tmp ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; { peer = buf; count = 0; if (((unsigned long )(priv->adapter)->fw_cap_info & 16384UL) == 0UL) { return (0); } else { } if ((unsigned int )priv->bss_type != 0U || (unsigned int )priv->media_connected == 0U) { return (0); } else { } tmp = spinlock_check(& priv->sta_list_spinlock); flags = _raw_spin_lock_irqsave(tmp); __mptr = (struct list_head const *)priv->sta_list.next; sta_ptr = (struct mwifiex_sta_node *)__mptr; goto ldv_61330; ldv_61329: ; if ((unsigned int )sta_ptr->tdls_status == 2U) { ether_addr_copy((u8 *)(& peer->peer_addr), (u8 const *)(& sta_ptr->mac_addr)); peer = peer + 1; count = count + 1; if (count > 7) { goto ldv_61328; } else { } } else { } __mptr___0 = (struct list_head const *)sta_ptr->list.next; sta_ptr = (struct mwifiex_sta_node *)__mptr___0; ldv_61330: ; if ((unsigned long )(& sta_ptr->list) != (unsigned long )(& priv->sta_list)) { goto ldv_61329; } else { } ldv_61328: spin_unlock_irqrestore(& priv->sta_list_spinlock, flags); return (count); } } void mwifiex_disable_all_tdls_links(struct mwifiex_private *priv ) { struct mwifiex_sta_node *sta_ptr ; struct mwifiex_ds_tdls_oper tdls_oper ; unsigned long flags ; int tmp ; struct list_head const *__mptr ; raw_spinlock_t *tmp___0 ; int tmp___1 ; struct list_head const *__mptr___0 ; { tmp = list_empty((struct list_head const *)(& priv->sta_list)); if (tmp != 0) { return; } else { } __mptr = (struct list_head const *)priv->sta_list.next; sta_ptr = (struct mwifiex_sta_node *)__mptr; goto ldv_61345; ldv_61344: memset((void *)(& tdls_oper), 0, 56UL); if ((unsigned int )sta_ptr->is_11n_enabled != 0U) { mwifiex_11n_cleanup_reorder_tbl(priv); tmp___0 = spinlock_check(& priv->wmm.ra_list_spinlock); flags = _raw_spin_lock_irqsave(tmp___0); mwifiex_11n_delete_all_tx_ba_stream_tbl(priv); spin_unlock_irqrestore(& priv->wmm.ra_list_spinlock, flags); } else { } mwifiex_restore_tdls_packets(priv, (u8 const *)(& sta_ptr->mac_addr), 4); memcpy((void *)(& tdls_oper.peer_mac), (void const *)(& sta_ptr->mac_addr), 6UL); tdls_oper.tdls_action = 0U; tmp___1 = mwifiex_send_cmd(priv, 290, 1, 0U, (void *)(& tdls_oper), 0); if (tmp___1 != 0) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Disable link failed for TDLS peer %pM", (u8 *)(& sta_ptr->mac_addr)); } else { } } else { } } else { } __mptr___0 = (struct list_head const *)sta_ptr->list.next; sta_ptr = (struct mwifiex_sta_node *)__mptr___0; ldv_61345: ; if ((unsigned long )(& sta_ptr->list) != (unsigned long )(& priv->sta_list)) { goto ldv_61344; } else { } mwifiex_del_all_sta_list(priv); return; } } int mwifiex_tdls_check_tx(struct mwifiex_private *priv , struct sk_buff *skb ) { struct mwifiex_auto_tdls_peer *peer ; unsigned long flags ; u8 mac[6U] ; raw_spinlock_t *tmp ; struct list_head const *__mptr ; int tmp___0 ; struct list_head const *__mptr___0 ; { ether_addr_copy((u8 *)(& mac), (u8 const *)skb->data); tmp = spinlock_check(& priv->auto_tdls_lock); flags = _raw_spin_lock_irqsave(tmp); __mptr = (struct list_head const *)priv->auto_tdls_list.next; peer = (struct mwifiex_auto_tdls_peer *)__mptr; goto ldv_61362; ldv_61361: tmp___0 = memcmp((void const *)(& mac), (void const *)(& peer->mac_addr), 6UL); if (tmp___0 == 0) { if ((peer->rssi <= 50 && (unsigned int )peer->tdls_status == 0U) && (unsigned int )peer->failure_count <= 3U) { peer->tdls_status = 1U; if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "setup TDLS link, peer=%pM rssi=%d\n", (u8 *)(& peer->mac_addr), peer->rssi); } else { } } else { } cfg80211_tdls_oper_request(priv->netdev, (u8 const *)(& peer->mac_addr), 1, 0, 32U); peer->do_setup = 0U; priv->check_tdls_tx = 0U; } else if ((unsigned int )peer->failure_count <= 3U && (unsigned int )peer->do_discover != 0U) { mwifiex_send_tdls_data_frame(priv, (u8 const *)(& peer->mac_addr), 10, 1, 0, (u8 const *)0U, 0UL); peer->do_discover = 0U; } else { } } else { } __mptr___0 = (struct list_head const *)peer->list.next; peer = (struct mwifiex_auto_tdls_peer *)__mptr___0; ldv_61362: ; if ((unsigned long )(& peer->list) != (unsigned long )(& priv->auto_tdls_list)) { goto ldv_61361; } else { } spin_unlock_irqrestore(& priv->auto_tdls_lock, flags); return (0); } } void mwifiex_flush_auto_tdls_list(struct mwifiex_private *priv ) { struct mwifiex_auto_tdls_peer *peer ; struct mwifiex_auto_tdls_peer *tmp_node ; unsigned long flags ; raw_spinlock_t *tmp ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; { tmp = spinlock_check(& priv->auto_tdls_lock); flags = _raw_spin_lock_irqsave(tmp); __mptr = (struct list_head const *)priv->auto_tdls_list.next; peer = (struct mwifiex_auto_tdls_peer *)__mptr; __mptr___0 = (struct list_head const *)peer->list.next; tmp_node = (struct mwifiex_auto_tdls_peer *)__mptr___0; goto ldv_61380; ldv_61379: list_del(& peer->list); kfree((void const *)peer); peer = tmp_node; __mptr___1 = (struct list_head const *)tmp_node->list.next; tmp_node = (struct mwifiex_auto_tdls_peer *)__mptr___1; ldv_61380: ; if ((unsigned long )(& peer->list) != (unsigned long )(& priv->auto_tdls_list)) { goto ldv_61379; } else { } INIT_LIST_HEAD(& priv->auto_tdls_list); spin_unlock_irqrestore(& priv->auto_tdls_lock, flags); priv->check_tdls_tx = 0U; return; } } void mwifiex_add_auto_tdls_peer(struct mwifiex_private *priv , u8 const *mac ) { struct mwifiex_auto_tdls_peer *tdls_peer ; unsigned long flags ; raw_spinlock_t *tmp ; struct list_head const *__mptr ; int tmp___0 ; struct list_head const *__mptr___0 ; void *tmp___1 ; { if (! (priv->adapter)->auto_tdls) { return; } else { } tmp = spinlock_check(& priv->auto_tdls_lock); flags = _raw_spin_lock_irqsave(tmp); __mptr = (struct list_head const *)priv->auto_tdls_list.next; tdls_peer = (struct mwifiex_auto_tdls_peer *)__mptr; goto ldv_61396; ldv_61395: tmp___0 = memcmp((void const *)(& tdls_peer->mac_addr), (void const *)mac, 6UL); if (tmp___0 == 0) { tdls_peer->tdls_status = 1U; tdls_peer->rssi_jiffies = (long )jiffies; spin_unlock_irqrestore(& priv->auto_tdls_lock, flags); return; } else { } __mptr___0 = (struct list_head const *)tdls_peer->list.next; tdls_peer = (struct mwifiex_auto_tdls_peer *)__mptr___0; ldv_61396: ; if ((unsigned long )(& tdls_peer->list) != (unsigned long )(& priv->auto_tdls_list)) { goto ldv_61395; } else { } tmp___1 = kzalloc(48UL, 32U); tdls_peer = (struct mwifiex_auto_tdls_peer *)tmp___1; if ((unsigned long )tdls_peer != (unsigned long )((struct mwifiex_auto_tdls_peer *)0)) { ether_addr_copy((u8 *)(& tdls_peer->mac_addr), mac); tdls_peer->tdls_status = 1U; tdls_peer->rssi_jiffies = (long )jiffies; INIT_LIST_HEAD(& tdls_peer->list); list_add_tail(& tdls_peer->list, & priv->auto_tdls_list); if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Add auto TDLS peer= %pM to list\n", mac); } else { } } else { } } else { } spin_unlock_irqrestore(& priv->auto_tdls_lock, flags); return; } } void mwifiex_auto_tdls_update_peer_status(struct mwifiex_private *priv , u8 const *mac , u8 link_status ) { struct mwifiex_auto_tdls_peer *peer ; unsigned long flags ; raw_spinlock_t *tmp ; struct list_head const *__mptr ; int tmp___0 ; struct list_head const *__mptr___0 ; { if (! (priv->adapter)->auto_tdls) { return; } else { } tmp = spinlock_check(& priv->auto_tdls_lock); flags = _raw_spin_lock_irqsave(tmp); __mptr = (struct list_head const *)priv->auto_tdls_list.next; peer = (struct mwifiex_auto_tdls_peer *)__mptr; goto ldv_61414; ldv_61413: tmp___0 = memcmp((void const *)(& peer->mac_addr), (void const *)mac, 6UL); if (tmp___0 == 0) { if ((unsigned int )link_status == 0U && (unsigned int )peer->tdls_status == 1U) { peer->failure_count = (u8 )((int )peer->failure_count + 1); } else if ((unsigned int )link_status == 2U) { peer->failure_count = 0U; } else { } peer->tdls_status = link_status; goto ldv_61412; } else { } __mptr___0 = (struct list_head const *)peer->list.next; peer = (struct mwifiex_auto_tdls_peer *)__mptr___0; ldv_61414: ; if ((unsigned long )(& peer->list) != (unsigned long )(& priv->auto_tdls_list)) { goto ldv_61413; } else { } ldv_61412: spin_unlock_irqrestore(& priv->auto_tdls_lock, flags); return; } } void mwifiex_auto_tdls_update_peer_signal(struct mwifiex_private *priv , u8 *mac , s8 snr , s8 nflr ) { struct mwifiex_auto_tdls_peer *peer ; unsigned long flags ; raw_spinlock_t *tmp ; struct list_head const *__mptr ; int tmp___0 ; struct list_head const *__mptr___0 ; { if (! (priv->adapter)->auto_tdls) { return; } else { } tmp = spinlock_check(& priv->auto_tdls_lock); flags = _raw_spin_lock_irqsave(tmp); __mptr = (struct list_head const *)priv->auto_tdls_list.next; peer = (struct mwifiex_auto_tdls_peer *)__mptr; goto ldv_61432; ldv_61431: tmp___0 = memcmp((void const *)(& peer->mac_addr), (void const *)mac, 6UL); if (tmp___0 == 0) { peer->rssi = (int )nflr - (int )snr; peer->rssi_jiffies = (long )jiffies; goto ldv_61430; } else { } __mptr___0 = (struct list_head const *)peer->list.next; peer = (struct mwifiex_auto_tdls_peer *)__mptr___0; ldv_61432: ; if ((unsigned long )(& peer->list) != (unsigned long )(& priv->auto_tdls_list)) { goto ldv_61431; } else { } ldv_61430: spin_unlock_irqrestore(& priv->auto_tdls_lock, flags); return; } } void mwifiex_check_auto_tdls(unsigned long context ) { struct mwifiex_private *priv ; struct mwifiex_auto_tdls_peer *tdls_peer ; unsigned long flags ; u16 reason ; bool __warned ; int __ret_warn_once ; int __ret_warn_on ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; unsigned long tmp___4 ; int tmp___5 ; raw_spinlock_t *tmp___6 ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; unsigned long tmp___7 ; { priv = (struct mwifiex_private *)context; reason = 26U; __ret_warn_once = (unsigned long )priv == (unsigned long )((struct mwifiex_private *)0) || (unsigned long )priv->adapter == (unsigned long )((struct mwifiex_adapter *)0); tmp___1 = ldv__builtin_expect(__ret_warn_once != 0, 0L); if (tmp___1 != 0L) { __ret_warn_on = ! __warned; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--drivers/--X--defaultlinux-4.2-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.2-rc1.tar.xz/csd_deg_dscv/11944/dscv_tempdir/dscv/ri/08_1a/drivers/net/wireless/mwifiex/tdls.c", 1335); } else { } tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { __warned = 1; } else { } } else { } tmp___2 = ldv__builtin_expect(__ret_warn_once != 0, 0L); if (tmp___2 != 0L) { printk("\vmwifiex: mwifiex: %s: adapter or private structure is NULL\n", "mwifiex_check_auto_tdls"); return; } else { } tmp___3 = ldv__builtin_expect((long )(! (priv->adapter)->auto_tdls), 0L); if (tmp___3 != 0L) { return; } else { } if (! priv->auto_tdls_timer_active) { if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "auto TDLS timer inactive; return"); } else { } } else { } return; } else { } priv->check_tdls_tx = 0U; tmp___5 = list_empty((struct list_head const *)(& priv->auto_tdls_list)); if (tmp___5 != 0) { tmp___4 = msecs_to_jiffies(10000U); ldv_mod_timer_422(& priv->auto_tdls_timer, tmp___4 + (unsigned long )jiffies); return; } else { } tmp___6 = spinlock_check(& priv->auto_tdls_lock); flags = _raw_spin_lock_irqsave(tmp___6); __mptr = (struct list_head const *)priv->auto_tdls_list.next; tdls_peer = (struct mwifiex_auto_tdls_peer *)__mptr; goto ldv_61454; ldv_61453: ; if ((unsigned long )jiffies - (unsigned long )tdls_peer->rssi_jiffies > 2500UL) { tdls_peer->rssi = 0; tdls_peer->do_discover = 1U; priv->check_tdls_tx = 1U; } else { } if ((tdls_peer->rssi > 54 || tdls_peer->rssi == 0) && (unsigned int )tdls_peer->tdls_status == 2U) { tdls_peer->tdls_status = 4U; if ((int )(priv->adapter)->debug_mask & 1) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "teardown TDLS link,peer=%pM rssi=%d\n", (u8 *)(& tdls_peer->mac_addr), - tdls_peer->rssi); } else { } } else { } tdls_peer->do_discover = 1U; priv->check_tdls_tx = 1U; cfg80211_tdls_oper_request(priv->netdev, (u8 const *)(& tdls_peer->mac_addr), 2, (int )reason, 32U); } else if (((tdls_peer->rssi != 0 && tdls_peer->rssi <= 50) && (unsigned int )tdls_peer->tdls_status == 0U) && (unsigned int )tdls_peer->failure_count <= 3U) { priv->check_tdls_tx = 1U; tdls_peer->do_setup = 1U; if (((priv->adapter)->debug_mask & 1073741824U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "check TDLS with peer=%pM\trssi=%d\n", (u8 *)(& tdls_peer->mac_addr), tdls_peer->rssi); } else { } } else { } } else { } __mptr___0 = (struct list_head const *)tdls_peer->list.next; tdls_peer = (struct mwifiex_auto_tdls_peer *)__mptr___0; ldv_61454: ; if ((unsigned long )(& tdls_peer->list) != (unsigned long )(& priv->auto_tdls_list)) { goto ldv_61453; } else { } spin_unlock_irqrestore(& priv->auto_tdls_lock, flags); tmp___7 = msecs_to_jiffies(10000U); ldv_mod_timer_423(& priv->auto_tdls_timer, tmp___7 + (unsigned long )jiffies); return; } } void mwifiex_setup_auto_tdls_timer(struct mwifiex_private *priv ) { unsigned long tmp ; { reg_timer_7(& priv->auto_tdls_timer, & mwifiex_check_auto_tdls, (unsigned long )priv); priv->auto_tdls_timer_active = 1; tmp = msecs_to_jiffies(10000U); ldv_mod_timer_424(& priv->auto_tdls_timer, tmp + (unsigned long )jiffies); return; } } void mwifiex_clean_auto_tdls(struct mwifiex_private *priv ) { { if ((((unsigned long )(priv->adapter)->fw_cap_info & 16384UL) != 0UL && (int )(priv->adapter)->auto_tdls) && (unsigned int )priv->bss_type == 0U) { priv->auto_tdls_timer_active = 0; ldv_del_timer_425(& priv->auto_tdls_timer); mwifiex_flush_auto_tdls_list(priv); } else { } return; } } void disable_suitable_timer_8(struct timer_list *timer ) { { if (ldv_timer_8_0 != 0 && (unsigned long )timer == (unsigned long )ldv_timer_list_8_0) { ldv_timer_8_0 = 0; return; } else { } if (ldv_timer_8_1 != 0 && (unsigned long )timer == (unsigned long )ldv_timer_list_8_1) { ldv_timer_8_1 = 0; return; } else { } if (ldv_timer_8_2 != 0 && (unsigned long )timer == (unsigned long )ldv_timer_list_8_2) { ldv_timer_8_2 = 0; return; } else { } if (ldv_timer_8_3 != 0 && (unsigned long )timer == (unsigned long )ldv_timer_list_8_3) { ldv_timer_8_3 = 0; return; } else { } return; } } void activate_pending_timer_8(struct timer_list *timer , unsigned long data , int pending_flag ) { { if ((unsigned long )ldv_timer_list_8_0 == (unsigned long )timer) { if (ldv_timer_8_0 == 2 || pending_flag != 0) { ldv_timer_list_8_0 = timer; ldv_timer_list_8_0->data = data; ldv_timer_8_0 = 1; } else { } return; } else { } if ((unsigned long )ldv_timer_list_8_1 == (unsigned long )timer) { if (ldv_timer_8_1 == 2 || pending_flag != 0) { ldv_timer_list_8_1 = timer; ldv_timer_list_8_1->data = data; ldv_timer_8_1 = 1; } else { } return; } else { } if ((unsigned long )ldv_timer_list_8_2 == (unsigned long )timer) { if (ldv_timer_8_2 == 2 || pending_flag != 0) { ldv_timer_list_8_2 = timer; ldv_timer_list_8_2->data = data; ldv_timer_8_2 = 1; } else { } return; } else { } if ((unsigned long )ldv_timer_list_8_3 == (unsigned long )timer) { if (ldv_timer_8_3 == 2 || pending_flag != 0) { ldv_timer_list_8_3 = timer; ldv_timer_list_8_3->data = data; ldv_timer_8_3 = 1; } else { } return; } else { } activate_suitable_timer_8(timer, data); return; } } void choose_timer_8(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_timer_8_0 == 1) { ldv_timer_8_0 = 2; ldv_timer_8(ldv_timer_8_0, ldv_timer_list_8_0); } else { } goto ldv_61474; case 1: ; if (ldv_timer_8_1 == 1) { ldv_timer_8_1 = 2; ldv_timer_8(ldv_timer_8_1, ldv_timer_list_8_1); } else { } goto ldv_61474; case 2: ; if (ldv_timer_8_2 == 1) { ldv_timer_8_2 = 2; ldv_timer_8(ldv_timer_8_2, ldv_timer_list_8_2); } else { } goto ldv_61474; case 3: ; if (ldv_timer_8_3 == 1) { ldv_timer_8_3 = 2; ldv_timer_8(ldv_timer_8_3, ldv_timer_list_8_3); } else { } goto ldv_61474; default: ldv_stop(); } ldv_61474: ; return; } } int reg_timer_8(struct timer_list *timer , void (*function)(unsigned long ) , unsigned long data ) { { if ((unsigned long )function == (unsigned long )(& mwifiex_check_auto_tdls)) { activate_suitable_timer_8(timer, data); } else { } return (0); } } void ldv_timer_8(int state , struct timer_list *timer ) { { LDV_IN_INTERRUPT = 2; mwifiex_check_auto_tdls(timer->data); LDV_IN_INTERRUPT = 1; return; } } void timer_init_8(void) { { ldv_timer_8_0 = 0; ldv_timer_8_1 = 0; ldv_timer_8_2 = 0; ldv_timer_8_3 = 0; return; } } void activate_suitable_timer_8(struct timer_list *timer , unsigned long data ) { { if (ldv_timer_8_0 == 0 || ldv_timer_8_0 == 2) { ldv_timer_list_8_0 = timer; ldv_timer_list_8_0->data = data; ldv_timer_8_0 = 1; return; } else { } if (ldv_timer_8_1 == 0 || ldv_timer_8_1 == 2) { ldv_timer_list_8_1 = timer; ldv_timer_list_8_1->data = data; ldv_timer_8_1 = 1; return; } else { } if (ldv_timer_8_2 == 0 || ldv_timer_8_2 == 2) { ldv_timer_list_8_2 = timer; ldv_timer_list_8_2->data = data; ldv_timer_8_2 = 1; return; } else { } if (ldv_timer_8_3 == 0 || ldv_timer_8_3 == 2) { ldv_timer_list_8_3 = timer; ldv_timer_list_8_3->data = data; ldv_timer_8_3 = 1; return; } else { } return; } } bool ldv_queue_work_on_417(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_418(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_419(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_420(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_421(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } int ldv_mod_timer_422(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_7(ldv_func_arg1, ldv_func_arg2, 1); return (ldv_func_res); } } int ldv_mod_timer_423(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_7(ldv_func_arg1, ldv_func_arg2, 1); return (ldv_func_res); } } int ldv_mod_timer_424(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_7(ldv_func_arg1, ldv_func_arg2, 1); return (ldv_func_res); } } int ldv_del_timer_425(struct timer_list *ldv_func_arg1 ) { ldv_func_ret_type___8 ldv_func_res ; int tmp ; { tmp = del_timer(ldv_func_arg1); ldv_func_res = tmp; disable_suitable_timer_7(ldv_func_arg1); return (ldv_func_res); } } __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); } } extern int sscanf(char const * , char const * , ...) ; bool ldv_queue_work_on_439(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_work_on_441(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) ; bool ldv_queue_delayed_work_on_440(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_443(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_442(struct workqueue_struct *ldv_func_arg1 ) ; extern unsigned long get_zeroed_page(gfp_t ) ; extern void free_pages(unsigned long , unsigned 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 struct dentry *debugfs_create_dir(char const * , struct dentry * ) ; extern void debugfs_remove(struct dentry * ) ; extern void debugfs_remove_recursive(struct dentry * ) ; 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); } } static struct dentry *mwifiex_dfs_dir ; static char *bss_modes[11U] = { (char *)"UNSPECIFIED", (char *)"ADHOC", (char *)"STATION", (char *)"AP", (char *)"AP_VLAN", (char *)"WDS", (char *)"MONITOR", (char *)"MESH_POINT", (char *)"P2P_CLIENT", (char *)"P2P_GO", (char *)"P2P_DEVICE"}; static ssize_t mwifiex_info_read(struct file *file , char *ubuf , size_t count , loff_t *ppos ) { struct mwifiex_private *priv ; struct net_device *netdev ; struct netdev_hw_addr *ha ; struct netdev_queue *txq ; unsigned long page ; unsigned long tmp ; char *p ; char fmt[64U] ; struct mwifiex_bss_info info___0 ; ssize_t ret ; int i ; 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 ; struct list_head const *__mptr ; int tmp___14 ; int tmp___15 ; struct list_head const *__mptr___0 ; int tmp___16 ; int tmp___17 ; int tmp___18 ; int tmp___19 ; int tmp___20 ; int tmp___21 ; int tmp___22 ; int tmp___23 ; bool tmp___24 ; int tmp___25 ; int tmp___26 ; bool tmp___27 ; int tmp___28 ; int tmp___29 ; { priv = (struct mwifiex_private *)file->private_data; netdev = priv->netdev; tmp = get_zeroed_page(208U); page = tmp; p = (char *)page; i = 0; if ((unsigned long )p == (unsigned long )((char *)0)) { return (-12L); } else { } memset((void *)(& info___0), 0, 88UL); tmp___0 = mwifiex_get_bss_info(priv, & info___0); ret = (ssize_t )tmp___0; if (ret != 0L) { goto free_and_exit; } else { } mwifiex_drv_get_driver_version(priv->adapter, (char *)(& fmt), 63); if ((int )((signed char )priv->version_str[0]) == 0) { mwifiex_get_ver_ext(priv); } else { } tmp___1 = sprintf(p, "driver_name = \"mwifiex\"\n"); p = p + (unsigned long )tmp___1; tmp___2 = sprintf(p, "driver_version = %s", (char *)(& fmt)); p = p + (unsigned long )tmp___2; tmp___3 = sprintf(p, "\nverext = %s", (char *)(& priv->version_str)); p = p + (unsigned long )tmp___3; tmp___4 = sprintf(p, "\ninterface_name=\"%s\"\n", (char *)(& netdev->name)); p = p + (unsigned long )tmp___4; if (info___0.bss_mode > 10U) { tmp___5 = sprintf(p, "bss_mode=\"%d\"\n", info___0.bss_mode); p = p + (unsigned long )tmp___5; } else { tmp___6 = sprintf(p, "bss_mode=\"%s\"\n", bss_modes[info___0.bss_mode]); p = p + (unsigned long )tmp___6; } tmp___7 = sprintf(p, "media_state=\"%s\"\n", (unsigned int )priv->media_connected == 0U ? (char *)"Disconnected" : (char *)"Connected"); p = p + (unsigned long )tmp___7; tmp___8 = sprintf(p, "mac_address=\"%pM\"\n", netdev->dev_addr); p = p + (unsigned long )tmp___8; if (((unsigned long )priv->bss_role & 1UL) == 0UL) { tmp___9 = sprintf(p, "multicast_count=\"%d\"\n", netdev->mc.count); p = p + (unsigned long )tmp___9; tmp___10 = sprintf(p, "essid=\"%s\"\n", (u8 *)(& info___0.ssid.ssid)); p = p + (unsigned long )tmp___10; tmp___11 = sprintf(p, "bssid=\"%pM\"\n", (u8 *)(& info___0.bssid)); p = p + (unsigned long )tmp___11; tmp___12 = sprintf(p, "channel=\"%d\"\n", (int )info___0.bss_chan); p = p + (unsigned long )tmp___12; tmp___13 = sprintf(p, "country_code = \"%s\"\n", (u8 *)(& info___0.country_code)); p = p + (unsigned long )tmp___13; __mptr = (struct list_head const *)netdev->mc.list.next; ha = (struct netdev_hw_addr *)__mptr; goto ldv_60955; ldv_60954: tmp___14 = i; i = i + 1; tmp___15 = sprintf(p, "multicast_address[%d]=\"%pM\"\n", tmp___14, (unsigned char *)(& ha->addr)); p = p + (unsigned long )tmp___15; __mptr___0 = (struct list_head const *)ha->list.next; ha = (struct netdev_hw_addr *)__mptr___0; ldv_60955: ; if ((unsigned long )(& ha->list) != (unsigned long )(& netdev->mc.list)) { goto ldv_60954; } else { } } else { } tmp___16 = sprintf(p, "num_tx_bytes = %lu\n", priv->stats.tx_bytes); p = p + (unsigned long )tmp___16; tmp___17 = sprintf(p, "num_rx_bytes = %lu\n", priv->stats.rx_bytes); p = p + (unsigned long )tmp___17; tmp___18 = sprintf(p, "num_tx_pkts = %lu\n", priv->stats.tx_packets); p = p + (unsigned long )tmp___18; tmp___19 = sprintf(p, "num_rx_pkts = %lu\n", priv->stats.rx_packets); p = p + (unsigned long )tmp___19; tmp___20 = sprintf(p, "num_tx_pkts_dropped = %lu\n", priv->stats.tx_dropped); p = p + (unsigned long )tmp___20; tmp___21 = sprintf(p, "num_rx_pkts_dropped = %lu\n", priv->stats.rx_dropped); p = p + (unsigned long )tmp___21; tmp___22 = sprintf(p, "num_tx_pkts_err = %lu\n", priv->stats.tx_errors); p = p + (unsigned long )tmp___22; tmp___23 = sprintf(p, "num_rx_pkts_err = %lu\n", priv->stats.rx_errors); p = p + (unsigned long )tmp___23; tmp___24 = netif_carrier_ok((struct net_device const *)priv->netdev); tmp___25 = sprintf(p, "carrier %s\n", (int )tmp___24 ? (char *)"on" : (char *)"off"); p = p + (unsigned long )tmp___25; tmp___26 = sprintf(p, "tx queue"); p = p + (unsigned long )tmp___26; i = 0; goto ldv_60958; ldv_60957: txq = netdev_get_tx_queue((struct net_device const *)netdev, (unsigned int )i); tmp___27 = netif_tx_queue_stopped((struct netdev_queue const *)txq); tmp___28 = sprintf(p, " %d:%s", i, (int )tmp___27 ? (char *)"stopped" : (char *)"started"); p = p + (unsigned long )tmp___28; i = i + 1; ldv_60958: ; if ((unsigned int )i < netdev->num_tx_queues) { goto ldv_60957; } else { } tmp___29 = sprintf(p, "\n"); p = p + (unsigned long )tmp___29; ret = simple_read_from_buffer((void *)ubuf, count, ppos, (void const *)page, (unsigned long )p - page); free_and_exit: free_pages(page, 0U); return (ret); } } static ssize_t mwifiex_device_dump_read(struct file *file , char *ubuf , size_t count , loff_t *ppos ) { struct mwifiex_private *priv ; { priv = (struct mwifiex_private *)file->private_data; if ((unsigned long )(priv->adapter)->if_ops.device_dump == (unsigned long )((void (*)(struct mwifiex_adapter * ))0)) { return (-5L); } else { } (*((priv->adapter)->if_ops.device_dump))(priv->adapter); return (0L); } } static ssize_t mwifiex_getlog_read(struct file *file , char *ubuf , size_t count , loff_t *ppos ) { struct mwifiex_private *priv ; unsigned long page ; unsigned long tmp ; char *p ; ssize_t ret ; struct mwifiex_ds_get_stats stats ; int tmp___0 ; int tmp___1 ; { priv = (struct mwifiex_private *)file->private_data; tmp = get_zeroed_page(208U); page = tmp; p = (char *)page; if ((unsigned long )p == (unsigned long )((char *)0)) { return (-12L); } else { } memset((void *)(& stats), 0, 72UL); tmp___0 = mwifiex_get_stats_info(priv, & stats); ret = (ssize_t )tmp___0; if (ret != 0L) { goto free_and_exit; } else { } tmp___1 = sprintf(p, "\nmcasttxframe %u\nfailed %u\nretry %u\nmultiretry %u\nframedup %u\nrtssuccess %u\nrtsfailure %u\nackfailure %u\nrxfrag %u\nmcastrxframe %u\nfcserror %u\ntxframe %u\nwepicverrcnt-1 %u\nwepicverrcnt-2 %u\nwepicverrcnt-3 %u\nwepicverrcnt-4 %u\nbcn_rcv_cnt %u\nbcn_miss_cnt %u\n", stats.mcast_tx_frame, stats.failed, stats.retry, stats.multi_retry, stats.frame_dup, stats.rts_success, stats.rts_failure, stats.ack_failure, stats.rx_frag, stats.mcast_rx_frame, stats.fcs_error, stats.tx_frame, stats.wep_icv_error[0], stats.wep_icv_error[1], stats.wep_icv_error[2], stats.wep_icv_error[3], stats.bcn_rcv_cnt, stats.bcn_miss_cnt); p = p + (unsigned long )tmp___1; ret = simple_read_from_buffer((void *)ubuf, count, ppos, (void const *)page, (unsigned long )p - page); free_and_exit: free_pages(page, 0U); return (ret); } } static ssize_t mwifiex_histogram_read(struct file *file , char *ubuf , size_t count , loff_t *ppos ) { struct mwifiex_private *priv ; ssize_t ret ; struct mwifiex_histogram_data *phist_data ; int i ; int value ; unsigned long page ; unsigned long tmp ; char *p ; 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 ; { priv = (struct mwifiex_private *)file->private_data; tmp = get_zeroed_page(208U); page = tmp; p = (char *)page; if ((unsigned long )p == (unsigned long )((char *)0)) { return (-12L); } else { } if ((unsigned long )priv == (unsigned long )((struct mwifiex_private *)0) || (unsigned long )priv->hist_data == (unsigned long )((struct mwifiex_histogram_data *)0)) { return (-14L); } else { } phist_data = priv->hist_data; tmp___0 = atomic_read((atomic_t const *)(& phist_data->num_samples)); tmp___1 = sprintf(p, "\ntotal samples = %d\n", tmp___0); p = p + (unsigned long )tmp___1; tmp___2 = sprintf(p, "rx rates (in Mbps): 0=1M 1=2M"); p = p + (unsigned long )tmp___2; tmp___3 = sprintf(p, "2=5.5M 3=11M 4=6M 5=9M 6=12M\n"); p = p + (unsigned long )tmp___3; tmp___4 = sprintf(p, "7=18M 8=24M 9=36M 10=48M 11=54M"); p = p + (unsigned long )tmp___4; tmp___5 = sprintf(p, "12-27=MCS0-15(BW20) 28-43=MCS0-15(BW40)\n"); p = p + (unsigned long )tmp___5; if (((unsigned long )(priv->adapter)->fw_cap_info & 8192UL) != 0UL) { tmp___6 = sprintf(p, "44-53=MCS0-9(VHT:BW20)"); p = p + (unsigned long )tmp___6; tmp___7 = sprintf(p, "54-63=MCS0-9(VHT:BW40)"); p = p + (unsigned long )tmp___7; tmp___8 = sprintf(p, "64-73=MCS0-9(VHT:BW80)\n\n"); p = p + (unsigned long )tmp___8; } else { tmp___9 = sprintf(p, "\n"); p = p + (unsigned long )tmp___9; } i = 0; goto ldv_60993; ldv_60992: value = atomic_read((atomic_t const *)(& phist_data->rx_rate) + (unsigned long )i); if (value != 0) { tmp___10 = sprintf(p, "rx_rate[%02d] = %d\n", i, value); p = p + (unsigned long )tmp___10; } else { } i = i + 1; ldv_60993: ; if (i <= 43) { goto ldv_60992; } else { } if (((unsigned long )(priv->adapter)->fw_cap_info & 8192UL) != 0UL) { i = 44; goto ldv_60996; ldv_60995: value = atomic_read((atomic_t const *)(& phist_data->rx_rate) + (unsigned long )i); if (value != 0) { tmp___11 = sprintf(p, "rx_rate[%02d] = %d\n", i, value); p = p + (unsigned long )tmp___11; } else { } i = i + 1; ldv_60996: ; if (i <= 73) { goto ldv_60995; } else { } } else { } i = 0; goto ldv_60999; ldv_60998: value = atomic_read((atomic_t const *)(& phist_data->snr) + (unsigned long )i); if (value != 0) { tmp___12 = sprintf(p, "snr[%02ddB] = %d\n", i, value); p = p + (unsigned long )tmp___12; } else { } i = i + 1; ldv_60999: ; if (i <= 255) { goto ldv_60998; } else { } i = 0; goto ldv_61002; ldv_61001: value = atomic_read((atomic_t const *)(& phist_data->noise_flr) + (unsigned long )i); if (value != 0) { tmp___13 = sprintf(p, "noise_flr[-%02ddBm] = %d\n", i + -128, value); p = p + (unsigned long )tmp___13; } else { } i = i + 1; ldv_61002: ; if (i <= 255) { goto ldv_61001; } else { } i = 0; goto ldv_61005; ldv_61004: value = atomic_read((atomic_t const *)(& phist_data->sig_str) + (unsigned long )i); if (value != 0) { tmp___14 = sprintf(p, "sig_strength[-%02ddBm] = %d\n", i, value); p = p + (unsigned long )tmp___14; } else { } i = i + 1; ldv_61005: ; if (i <= 255) { goto ldv_61004; } else { } ret = simple_read_from_buffer((void *)ubuf, count, ppos, (void const *)page, (unsigned long )p - page); return (ret); } } static ssize_t mwifiex_histogram_write(struct file *file , char const *ubuf , size_t count , loff_t *ppos ) { struct mwifiex_private *priv ; { priv = (struct mwifiex_private *)file->private_data; if ((unsigned long )priv != (unsigned long )((struct mwifiex_private *)0) && (unsigned long )priv->hist_data != (unsigned long )((struct mwifiex_histogram_data *)0)) { mwifiex_hist_data_reset(priv); } else { } return (0L); } } static struct mwifiex_debug_info info ; static ssize_t mwifiex_debug_read(struct file *file , char *ubuf , size_t count , loff_t *ppos ) { struct mwifiex_private *priv ; unsigned long page ; unsigned long tmp ; char *p ; ssize_t ret ; int tmp___0 ; int tmp___1 ; { priv = (struct mwifiex_private *)file->private_data; tmp = get_zeroed_page(208U); page = tmp; p = (char *)page; if ((unsigned long )p == (unsigned long )((char *)0)) { return (-12L); } else { } tmp___0 = mwifiex_get_debug_info(priv, & info); ret = (ssize_t )tmp___0; if (ret != 0L) { goto free_and_exit; } else { } tmp___1 = mwifiex_debug_info_to_buffer(priv, p, & info); p = p + (unsigned long )tmp___1; ret = simple_read_from_buffer((void *)ubuf, count, ppos, (void const *)page, (unsigned long )p - page); free_and_exit: free_pages(page, 0U); return (ret); } } static u32 saved_reg_type ; static u32 saved_reg_offset ; static u32 saved_reg_value ; static ssize_t mwifiex_regrdwr_write(struct file *file , char const *ubuf , size_t count , loff_t *ppos ) { unsigned long addr ; unsigned long tmp ; char *buf ; size_t buf_size ; size_t __min1 ; size_t __min2 ; int ret ; u32 reg_type ; u32 reg_offset ; u32 reg_value ; unsigned long tmp___0 ; { tmp = get_zeroed_page(208U); addr = tmp; buf = (char *)addr; __min1 = count; __min2 = 4095UL; buf_size = __min1 < __min2 ? __min1 : __min2; reg_type = 0U; reg_offset = 0U; reg_value = 4294967295U; if ((unsigned long )buf == (unsigned long )((char *)0)) { return (-12L); } else { } tmp___0 = copy_from_user((void *)buf, (void const *)ubuf, buf_size); if (tmp___0 != 0UL) { ret = -14; goto done; } else { } sscanf((char const *)buf, "%u %x %x", & reg_type, & reg_offset, & reg_value); if (reg_type == 0U || reg_offset == 0U) { ret = -22; goto done; } else { saved_reg_type = reg_type; saved_reg_offset = reg_offset; saved_reg_value = reg_value; ret = (int )count; } done: free_pages(addr, 0U); return ((ssize_t )ret); } } static ssize_t mwifiex_regrdwr_read(struct file *file , char *ubuf , size_t count , loff_t *ppos ) { struct mwifiex_private *priv ; unsigned long addr ; unsigned long tmp ; char *buf ; int pos ; int ret ; u32 reg_value ; int tmp___0 ; int tmp___1 ; ssize_t tmp___2 ; int tmp___3 ; ssize_t tmp___4 ; { priv = (struct mwifiex_private *)file->private_data; tmp = get_zeroed_page(208U); addr = tmp; buf = (char *)addr; pos = 0; ret = 0; if ((unsigned long )buf == (unsigned long )((char *)0)) { return (-12L); } else { } if (saved_reg_type == 0U) { tmp___0 = snprintf(buf, 4096UL, "0"); pos = tmp___0 + pos; goto done; } else { } if (saved_reg_value != 4294967295U) { ret = mwifiex_reg_write(priv, saved_reg_type, saved_reg_offset, saved_reg_value); tmp___1 = snprintf(buf, 4096UL, "%u 0x%x 0x%x\n", saved_reg_type, saved_reg_offset, saved_reg_value); pos = tmp___1 + pos; tmp___2 = simple_read_from_buffer((void *)ubuf, count, ppos, (void const *)buf, (size_t )pos); ret = (int )tmp___2; goto done; } else { } ret = mwifiex_reg_read(priv, saved_reg_type, saved_reg_offset, & reg_value); if (ret != 0) { ret = -22; goto done; } else { } tmp___3 = snprintf(buf, 4096UL, "%u 0x%x 0x%x\n", saved_reg_type, saved_reg_offset, reg_value); pos = tmp___3 + pos; tmp___4 = simple_read_from_buffer((void *)ubuf, count, ppos, (void const *)buf, (size_t )pos); ret = (int )tmp___4; done: free_pages(addr, 0U); return ((ssize_t )ret); } } static ssize_t mwifiex_debug_mask_read(struct file *file , char *ubuf , size_t count , loff_t *ppos ) { struct mwifiex_private *priv ; unsigned long page ; unsigned long tmp ; char *buf ; size_t ret ; int pos ; int tmp___0 ; ssize_t tmp___1 ; { priv = (struct mwifiex_private *)file->private_data; tmp = get_zeroed_page(208U); page = tmp; buf = (char *)page; ret = 0UL; pos = 0; if ((unsigned long )buf == (unsigned long )((char *)0)) { return (-12L); } else { } tmp___0 = snprintf(buf, 4096UL, "debug mask=0x%08x\n", (priv->adapter)->debug_mask); pos = tmp___0 + pos; tmp___1 = simple_read_from_buffer((void *)ubuf, count, ppos, (void const *)buf, (size_t )pos); ret = (size_t )tmp___1; free_pages(page, 0U); return ((ssize_t )ret); } } static ssize_t mwifiex_debug_mask_write(struct file *file , char const *ubuf , size_t count , loff_t *ppos ) { int ret ; unsigned long debug_mask___0 ; struct mwifiex_private *priv ; unsigned long addr ; unsigned long tmp ; char *buf ; size_t buf_size ; size_t _min1 ; unsigned long _min2 ; unsigned long tmp___0 ; int tmp___1 ; { priv = (struct mwifiex_private *)file->private_data; tmp = get_zeroed_page(208U); addr = tmp; buf = (char *)addr; _min1 = count; _min2 = 4095UL; buf_size = _min1 < _min2 ? _min1 : _min2; if ((unsigned long )buf == (unsigned long )((char *)0)) { return (-12L); } else { } tmp___0 = copy_from_user((void *)buf, (void const *)ubuf, buf_size); if (tmp___0 != 0UL) { ret = -14; goto done; } else { } tmp___1 = kstrtoul((char const *)buf, 0U, & debug_mask___0); if (tmp___1 != 0) { ret = -22; goto done; } else { } (priv->adapter)->debug_mask = (unsigned int )debug_mask___0; ret = (int )count; done: free_pages(addr, 0U); return ((ssize_t )ret); } } static ssize_t mwifiex_memrw_write(struct file *file , char const *ubuf , size_t count , loff_t *ppos ) { int ret ; char cmd ; struct mwifiex_ds_mem_rw mem_rw ; u16 cmd_action ; struct mwifiex_private *priv ; unsigned long addr ; unsigned long tmp ; char *buf ; size_t buf_size ; size_t _min1 ; unsigned long _min2 ; unsigned long tmp___0 ; int tmp___1 ; { priv = (struct mwifiex_private *)file->private_data; tmp = get_zeroed_page(208U); addr = tmp; buf = (char *)addr; _min1 = count; _min2 = 4095UL; buf_size = _min1 < _min2 ? _min1 : _min2; if ((unsigned long )buf == (unsigned long )((char *)0)) { return (-12L); } else { } tmp___0 = copy_from_user((void *)buf, (void const *)ubuf, buf_size); if (tmp___0 != 0UL) { ret = -14; goto done; } else { } ret = sscanf((char const *)buf, "%c %x %x", & cmd, & mem_rw.addr, & mem_rw.value); if (ret != 3) { ret = -22; goto done; } else { } if ((int )((signed char )cmd) == 114 || (int )((signed char )cmd) == 82) { cmd_action = 0U; mem_rw.value = 0U; } else if ((int )((signed char )cmd) == 119 || (int )((signed char )cmd) == 87) { cmd_action = 1U; } else { ret = -22; goto done; } memcpy((void *)(& priv->mem_rw), (void const *)(& mem_rw), 8UL); tmp___1 = mwifiex_send_cmd(priv, 134, (int )cmd_action, 0U, (void *)(& mem_rw), 1); if (tmp___1 != 0) { ret = -1; } else { ret = (int )count; } done: free_pages(addr, 0U); return ((ssize_t )ret); } } static ssize_t mwifiex_memrw_read(struct file *file , char *ubuf , size_t count , loff_t *ppos ) { struct mwifiex_private *priv ; unsigned long addr ; unsigned long tmp ; char *buf ; int ret ; int pos ; int tmp___0 ; ssize_t tmp___1 ; { priv = (struct mwifiex_private *)file->private_data; tmp = get_zeroed_page(208U); addr = tmp; buf = (char *)addr; pos = 0; if ((unsigned long )buf == (unsigned long )((char *)0)) { return (-12L); } else { } tmp___0 = snprintf(buf, 4096UL, "0x%x 0x%x\n", priv->mem_rw.addr, priv->mem_rw.value); pos = tmp___0 + pos; tmp___1 = simple_read_from_buffer((void *)ubuf, count, ppos, (void const *)buf, (size_t )pos); ret = (int )tmp___1; free_pages(addr, 0U); return ((ssize_t )ret); } } static u32 saved_offset = 4294967295U; static u32 saved_bytes = 4294967295U; static ssize_t mwifiex_rdeeprom_write(struct file *file , char const *ubuf , size_t count , loff_t *ppos ) { unsigned long addr ; unsigned long tmp ; char *buf ; size_t buf_size ; size_t __min1 ; size_t __min2 ; int ret ; int offset ; int bytes ; unsigned long tmp___0 ; { tmp = get_zeroed_page(208U); addr = tmp; buf = (char *)addr; __min1 = count; __min2 = 4095UL; buf_size = __min1 < __min2 ? __min1 : __min2; ret = 0; offset = -1; bytes = -1; if ((unsigned long )buf == (unsigned long )((char *)0)) { return (-12L); } else { } tmp___0 = copy_from_user((void *)buf, (void const *)ubuf, buf_size); if (tmp___0 != 0UL) { ret = -14; goto done; } else { } sscanf((char const *)buf, "%d %d", & offset, & bytes); if (offset == -1 || bytes == -1) { ret = -22; goto done; } else { saved_offset = (u32 )offset; saved_bytes = (u32 )bytes; ret = (int )count; } done: free_pages(addr, 0U); return ((ssize_t )ret); } } static ssize_t mwifiex_rdeeprom_read(struct file *file , char *ubuf , size_t count , loff_t *ppos ) { struct mwifiex_private *priv ; unsigned long addr ; unsigned long tmp ; char *buf ; int pos ; int ret ; int i ; u8 value[256U] ; int tmp___0 ; int tmp___1 ; size_t tmp___2 ; int tmp___3 ; ssize_t tmp___4 ; { priv = (struct mwifiex_private *)file->private_data; tmp = get_zeroed_page(208U); addr = tmp; buf = (char *)addr; pos = 0; ret = 0; if ((unsigned long )buf == (unsigned long )((char *)0)) { return (-12L); } else { } if (saved_offset == 4294967295U) { tmp___0 = snprintf(buf, 4096UL, "0"); pos = tmp___0 + pos; goto done; } else { } ret = mwifiex_eeprom_read(priv, (int )((unsigned short )saved_offset), (int )((unsigned short )saved_bytes), (u8 *)(& value)); if (ret != 0) { ret = -22; goto done; } else { } tmp___1 = snprintf(buf, 4096UL, "%d %d ", saved_offset, saved_bytes); pos = tmp___1 + pos; i = 0; goto ldv_61148; ldv_61147: tmp___2 = strlen((char const *)buf); tmp___3 = snprintf(buf + tmp___2, 4096UL, "%d ", (int )value[i]); pos = tmp___3 + pos; i = i + 1; ldv_61148: ; if ((u32 )i < saved_bytes) { goto ldv_61147; } else { } tmp___4 = simple_read_from_buffer((void *)ubuf, count, ppos, (void const *)buf, (size_t )pos); ret = (int )tmp___4; done: free_pages(addr, 0U); return ((ssize_t )ret); } } static ssize_t mwifiex_hscfg_write(struct file *file , char const *ubuf , size_t count , loff_t *ppos ) { struct mwifiex_private *priv ; unsigned long addr ; unsigned long tmp ; char *buf ; size_t buf_size ; size_t __min1 ; size_t __min2 ; int ret ; int arg_num ; struct mwifiex_ds_hs_cfg hscfg ; int conditions ; u32 gpio ; u32 gap ; unsigned long tmp___0 ; { priv = (struct mwifiex_private *)file->private_data; tmp = get_zeroed_page(208U); addr = tmp; buf = (char *)addr; __min1 = count; __min2 = 4095UL; buf_size = __min1 < __min2 ? __min1 : __min2; conditions = 0; gpio = 255U; gap = 255U; if ((unsigned long )buf == (unsigned long )((char *)0)) { return (-12L); } else { } tmp___0 = copy_from_user((void *)buf, (void const *)ubuf, buf_size); if (tmp___0 != 0UL) { ret = -14; goto done; } else { } arg_num = sscanf((char const *)buf, "%d %x %x", & conditions, & gpio, & gap); memset((void *)(& hscfg), 0, 16UL); if (arg_num > 3) { if (((priv->adapter)->debug_mask & 4U) != 0U) { if ((unsigned long )(priv->adapter)->dev != (unsigned long )((struct device *)0)) { _dev_info((struct device const *)(priv->adapter)->dev, "Too many arguments\n"); } else { } } else { } ret = -22; goto done; } else { } if (arg_num > 0 && arg_num <= 2) { mwifiex_set_hs_params(priv, 0, 1, & hscfg); } else { } if (arg_num != 0) { if (conditions == -1) { mwifiex_cancel_hs(priv, 0); ret = (int )count; goto done; } else { } hscfg.conditions = (u32 )conditions; } else { } if (arg_num > 1) { hscfg.gpio = gpio; } else { } if (arg_num == 3) { hscfg.gap = gap; } else { } hscfg.is_invoke_hostcmd = 0U; mwifiex_set_hs_params(priv, 1, 1, & hscfg); mwifiex_enable_hs(priv->adapter); (priv->adapter)->hs_enabling = 0; ret = (int )count; done: free_pages(addr, 0U); return ((ssize_t )ret); } } static ssize_t mwifiex_hscfg_read(struct file *file , char *ubuf , size_t count , loff_t *ppos ) { struct mwifiex_private *priv ; unsigned long addr ; unsigned long tmp ; char *buf ; int pos ; int ret ; struct mwifiex_ds_hs_cfg hscfg ; ssize_t tmp___0 ; { priv = (struct mwifiex_private *)file->private_data; tmp = get_zeroed_page(208U); addr = tmp; buf = (char *)addr; if ((unsigned long )buf == (unsigned long )((char *)0)) { return (-12L); } else { } mwifiex_set_hs_params(priv, 0, 1, & hscfg); pos = snprintf(buf, 4096UL, "%u 0x%x 0x%x\n", hscfg.conditions, hscfg.gpio, hscfg.gap); tmp___0 = simple_read_from_buffer((void *)ubuf, count, ppos, (void const *)buf, (size_t )pos); ret = (int )tmp___0; free_pages(addr, 0U); return ((ssize_t )ret); } } static struct file_operations const mwifiex_dfs_info_fops = {0, 0, & mwifiex_info_read, 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 struct file_operations const mwifiex_dfs_debug_fops = {0, 0, & mwifiex_debug_read, 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 struct file_operations const mwifiex_dfs_getlog_fops = {0, 0, & mwifiex_getlog_read, 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 struct file_operations const mwifiex_dfs_device_dump_fops = {0, 0, & mwifiex_device_dump_read, 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 struct file_operations const mwifiex_dfs_regrdwr_fops = {0, 0, & mwifiex_regrdwr_read, & mwifiex_regrdwr_write, 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 mwifiex_dfs_rdeeprom_fops = {0, 0, & mwifiex_rdeeprom_read, & mwifiex_rdeeprom_write, 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 mwifiex_dfs_memrw_fops = {0, 0, & mwifiex_memrw_read, & mwifiex_memrw_write, 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 mwifiex_dfs_hscfg_fops = {0, 0, & mwifiex_hscfg_read, & mwifiex_hscfg_write, 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 mwifiex_dfs_histogram_fops = {0, 0, & mwifiex_histogram_read, & mwifiex_histogram_write, 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 mwifiex_dfs_debug_mask_fops = {0, 0, & mwifiex_debug_mask_read, & mwifiex_debug_mask_write, 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 mwifiex_dev_debugfs_init(struct mwifiex_private *priv ) { struct dentry *tmp ; struct dentry *tmp___0 ; struct dentry *tmp___1 ; struct dentry *tmp___2 ; struct dentry *tmp___3 ; struct dentry *tmp___4 ; struct dentry *tmp___5 ; struct dentry *tmp___6 ; struct dentry *tmp___7 ; struct dentry *tmp___8 ; { if ((unsigned long )mwifiex_dfs_dir == (unsigned long )((struct dentry *)0) || (unsigned long )priv == (unsigned long )((struct mwifiex_private *)0)) { return; } else { } priv->dfs_dev_dir = debugfs_create_dir((char const *)(& (priv->netdev)->name), mwifiex_dfs_dir); if ((unsigned long )priv->dfs_dev_dir == (unsigned long )((struct dentry *)0)) { return; } else { } tmp = debugfs_create_file("info", 420, priv->dfs_dev_dir, (void *)priv, & mwifiex_dfs_info_fops); if ((unsigned long )tmp == (unsigned long )((struct dentry *)0)) { return; } else { } tmp___0 = debugfs_create_file("debug", 420, priv->dfs_dev_dir, (void *)priv, & mwifiex_dfs_debug_fops); if ((unsigned long )tmp___0 == (unsigned long )((struct dentry *)0)) { return; } else { } tmp___1 = debugfs_create_file("getlog", 420, priv->dfs_dev_dir, (void *)priv, & mwifiex_dfs_getlog_fops); if ((unsigned long )tmp___1 == (unsigned long )((struct dentry *)0)) { return; } else { } tmp___2 = debugfs_create_file("regrdwr", 420, priv->dfs_dev_dir, (void *)priv, & mwifiex_dfs_regrdwr_fops); if ((unsigned long )tmp___2 == (unsigned long )((struct dentry *)0)) { return; } else { } tmp___3 = debugfs_create_file("rdeeprom", 420, priv->dfs_dev_dir, (void *)priv, & mwifiex_dfs_rdeeprom_fops); if ((unsigned long )tmp___3 == (unsigned long )((struct dentry *)0)) { return; } else { } tmp___4 = debugfs_create_file("device_dump", 420, priv->dfs_dev_dir, (void *)priv, & mwifiex_dfs_device_dump_fops); if ((unsigned long )tmp___4 == (unsigned long )((struct dentry *)0)) { return; } else { } tmp___5 = debugfs_create_file("memrw", 420, priv->dfs_dev_dir, (void *)priv, & mwifiex_dfs_memrw_fops); if ((unsigned long )tmp___5 == (unsigned long )((struct dentry *)0)) { return; } else { } tmp___6 = debugfs_create_file("hscfg", 420, priv->dfs_dev_dir, (void *)priv, & mwifiex_dfs_hscfg_fops); if ((unsigned long )tmp___6 == (unsigned long )((struct dentry *)0)) { return; } else { } tmp___7 = debugfs_create_file("histogram", 420, priv->dfs_dev_dir, (void *)priv, & mwifiex_dfs_histogram_fops); if ((unsigned long )tmp___7 == (unsigned long )((struct dentry *)0)) { return; } else { } tmp___8 = debugfs_create_file("debug_mask", 420, priv->dfs_dev_dir, (void *)priv, & mwifiex_dfs_debug_mask_fops); if ((unsigned long )tmp___8 == (unsigned long )((struct dentry *)0)) { return; } else { } return; } } void mwifiex_dev_debugfs_remove(struct mwifiex_private *priv ) { { if ((unsigned long )priv == (unsigned long )((struct mwifiex_private *)0)) { return; } else { } debugfs_remove_recursive(priv->dfs_dev_dir); return; } } void mwifiex_debugfs_init(void) { { if ((unsigned long )mwifiex_dfs_dir == (unsigned long )((struct dentry *)0)) { mwifiex_dfs_dir = debugfs_create_dir("mwifiex", (struct dentry *)0); } else { } return; } } void mwifiex_debugfs_remove(void) { { if ((unsigned long )mwifiex_dfs_dir != (unsigned long )((struct dentry *)0)) { debugfs_remove(mwifiex_dfs_dir); } else { } return; } } extern int ldv_release_14(void) ; extern int ldv_release_11(void) ; extern int ldv_release_9(void) ; int ldv_retval_14 ; int ldv_retval_0 ; extern int ldv_release_16(void) ; extern int ldv_release_12(void) ; int ldv_retval_6 ; extern int ldv_release_18(void) ; extern int ldv_release_10(void) ; extern int ldv_release_13(void) ; int ldv_retval_15 ; int ldv_retval_13 ; extern int ldv_release_17(void) ; int ldv_retval_9 ; int ldv_retval_4 ; extern int ldv_release_15(void) ; int ldv_retval_8 ; int ldv_retval_3 ; int ldv_retval_7 ; void ldv_file_operations_15(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(1000UL); mwifiex_dfs_device_dump_fops_group1 = (struct inode *)tmp; tmp___0 = ldv_init_zalloc(504UL); mwifiex_dfs_device_dump_fops_group2 = (struct file *)tmp___0; return; } } void ldv_file_operations_14(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(1000UL); mwifiex_dfs_regrdwr_fops_group1 = (struct inode *)tmp; tmp___0 = ldv_init_zalloc(504UL); mwifiex_dfs_regrdwr_fops_group2 = (struct file *)tmp___0; return; } } void ldv_file_operations_16(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(1000UL); mwifiex_dfs_getlog_fops_group1 = (struct inode *)tmp; tmp___0 = ldv_init_zalloc(504UL); mwifiex_dfs_getlog_fops_group2 = (struct file *)tmp___0; return; } } void ldv_file_operations_9(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(1000UL); mwifiex_dfs_debug_mask_fops_group1 = (struct inode *)tmp; tmp___0 = ldv_init_zalloc(504UL); mwifiex_dfs_debug_mask_fops_group2 = (struct file *)tmp___0; return; } } void ldv_file_operations_17(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(1000UL); mwifiex_dfs_debug_fops_group1 = (struct inode *)tmp; tmp___0 = ldv_init_zalloc(504UL); mwifiex_dfs_debug_fops_group2 = (struct file *)tmp___0; return; } } void ldv_file_operations_12(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(1000UL); mwifiex_dfs_memrw_fops_group1 = (struct inode *)tmp; tmp___0 = ldv_init_zalloc(504UL); mwifiex_dfs_memrw_fops_group2 = (struct file *)tmp___0; return; } } void ldv_file_operations_10(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(1000UL); mwifiex_dfs_histogram_fops_group1 = (struct inode *)tmp; tmp___0 = ldv_init_zalloc(504UL); mwifiex_dfs_histogram_fops_group2 = (struct file *)tmp___0; return; } } void ldv_file_operations_18(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(1000UL); mwifiex_dfs_info_fops_group1 = (struct inode *)tmp; tmp___0 = ldv_init_zalloc(504UL); mwifiex_dfs_info_fops_group2 = (struct file *)tmp___0; return; } } void ldv_file_operations_13(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(1000UL); mwifiex_dfs_rdeeprom_fops_group1 = (struct inode *)tmp; tmp___0 = ldv_init_zalloc(504UL); mwifiex_dfs_rdeeprom_fops_group2 = (struct file *)tmp___0; return; } } void ldv_file_operations_11(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_init_zalloc(1000UL); mwifiex_dfs_hscfg_fops_group1 = (struct inode *)tmp; tmp___0 = ldv_init_zalloc(504UL); mwifiex_dfs_hscfg_fops_group2 = (struct file *)tmp___0; return; } } void ldv_main_exported_11(void) { char *ldvarg2 ; void *tmp ; char *ldvarg5 ; void *tmp___0 ; loff_t *ldvarg0 ; void *tmp___1 ; loff_t *ldvarg3 ; void *tmp___2 ; size_t ldvarg4 ; size_t ldvarg1 ; int tmp___3 ; { tmp = ldv_init_zalloc(1UL); ldvarg2 = (char *)tmp; tmp___0 = ldv_init_zalloc(1UL); ldvarg5 = (char *)tmp___0; tmp___1 = ldv_init_zalloc(8UL); ldvarg0 = (loff_t *)tmp___1; tmp___2 = ldv_init_zalloc(8UL); ldvarg3 = (loff_t *)tmp___2; ldv_memset((void *)(& ldvarg4), 0, 8UL); ldv_memset((void *)(& ldvarg1), 0, 8UL); tmp___3 = __VERIFIER_nondet_int(); switch (tmp___3) { case 0: ; if (ldv_state_variable_11 == 1) { ldv_retval_0 = simple_open(mwifiex_dfs_hscfg_fops_group1, mwifiex_dfs_hscfg_fops_group2); if (ldv_retval_0 == 0) { ldv_state_variable_11 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_61274; case 1: ; if (ldv_state_variable_11 == 1) { mwifiex_hscfg_write(mwifiex_dfs_hscfg_fops_group2, (char const *)ldvarg5, ldvarg4, ldvarg3); ldv_state_variable_11 = 1; } else { } if (ldv_state_variable_11 == 2) { mwifiex_hscfg_write(mwifiex_dfs_hscfg_fops_group2, (char const *)ldvarg5, ldvarg4, ldvarg3); ldv_state_variable_11 = 2; } else { } goto ldv_61274; case 2: ; if (ldv_state_variable_11 == 2) { mwifiex_hscfg_read(mwifiex_dfs_hscfg_fops_group2, ldvarg2, ldvarg1, ldvarg0); ldv_state_variable_11 = 2; } else { } goto ldv_61274; case 3: ; if (ldv_state_variable_11 == 2) { ldv_release_11(); ldv_state_variable_11 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_61274; default: ldv_stop(); } ldv_61274: ; return; } } void ldv_main_exported_9(void) { size_t ldvarg30 ; char *ldvarg28 ; void *tmp ; loff_t *ldvarg29 ; void *tmp___0 ; char *ldvarg31 ; void *tmp___1 ; loff_t *ldvarg26 ; void *tmp___2 ; size_t ldvarg27 ; int tmp___3 ; { tmp = ldv_init_zalloc(1UL); ldvarg28 = (char *)tmp; tmp___0 = ldv_init_zalloc(8UL); ldvarg29 = (loff_t *)tmp___0; tmp___1 = ldv_init_zalloc(1UL); ldvarg31 = (char *)tmp___1; tmp___2 = ldv_init_zalloc(8UL); ldvarg26 = (loff_t *)tmp___2; ldv_memset((void *)(& ldvarg30), 0, 8UL); ldv_memset((void *)(& ldvarg27), 0, 8UL); tmp___3 = __VERIFIER_nondet_int(); switch (tmp___3) { case 0: ; if (ldv_state_variable_9 == 1) { ldv_retval_8 = simple_open(mwifiex_dfs_debug_mask_fops_group1, mwifiex_dfs_debug_mask_fops_group2); if (ldv_retval_8 == 0) { ldv_state_variable_9 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_61289; case 1: ; if (ldv_state_variable_9 == 1) { mwifiex_debug_mask_write(mwifiex_dfs_debug_mask_fops_group2, (char const *)ldvarg31, ldvarg30, ldvarg29); ldv_state_variable_9 = 1; } else { } if (ldv_state_variable_9 == 2) { mwifiex_debug_mask_write(mwifiex_dfs_debug_mask_fops_group2, (char const *)ldvarg31, ldvarg30, ldvarg29); ldv_state_variable_9 = 2; } else { } goto ldv_61289; case 2: ; if (ldv_state_variable_9 == 2) { mwifiex_debug_mask_read(mwifiex_dfs_debug_mask_fops_group2, ldvarg28, ldvarg27, ldvarg26); ldv_state_variable_9 = 2; } else { } goto ldv_61289; case 3: ; if (ldv_state_variable_9 == 2) { ldv_release_9(); ldv_state_variable_9 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_61289; default: ldv_stop(); } ldv_61289: ; return; } } void ldv_main_exported_17(void) { size_t ldvarg12 ; char *ldvarg13 ; void *tmp ; loff_t *ldvarg11 ; void *tmp___0 ; int tmp___1 ; { tmp = ldv_init_zalloc(1UL); ldvarg13 = (char *)tmp; tmp___0 = ldv_init_zalloc(8UL); ldvarg11 = (loff_t *)tmp___0; ldv_memset((void *)(& ldvarg12), 0, 8UL); tmp___1 = __VERIFIER_nondet_int(); switch (tmp___1) { case 0: ; if (ldv_state_variable_17 == 1) { ldv_retval_3 = simple_open(mwifiex_dfs_debug_fops_group1, mwifiex_dfs_debug_fops_group2); if (ldv_retval_3 == 0) { ldv_state_variable_17 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_61301; case 1: ; if (ldv_state_variable_17 == 2) { mwifiex_debug_read(mwifiex_dfs_debug_fops_group2, ldvarg13, ldvarg12, ldvarg11); ldv_state_variable_17 = 2; } else { } goto ldv_61301; case 2: ; if (ldv_state_variable_17 == 2) { ldv_release_17(); ldv_state_variable_17 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_61301; default: ldv_stop(); } ldv_61301: ; return; } } void ldv_main_exported_12(void) { size_t ldvarg33 ; char *ldvarg34 ; void *tmp ; size_t ldvarg36 ; loff_t *ldvarg32 ; void *tmp___0 ; loff_t *ldvarg35 ; void *tmp___1 ; char *ldvarg37 ; void *tmp___2 ; int tmp___3 ; { tmp = ldv_init_zalloc(1UL); ldvarg34 = (char *)tmp; tmp___0 = ldv_init_zalloc(8UL); ldvarg32 = (loff_t *)tmp___0; tmp___1 = ldv_init_zalloc(8UL); ldvarg35 = (loff_t *)tmp___1; tmp___2 = ldv_init_zalloc(1UL); ldvarg37 = (char *)tmp___2; ldv_memset((void *)(& ldvarg33), 0, 8UL); ldv_memset((void *)(& ldvarg36), 0, 8UL); tmp___3 = __VERIFIER_nondet_int(); switch (tmp___3) { case 0: ; if (ldv_state_variable_12 == 1) { ldv_retval_9 = simple_open(mwifiex_dfs_memrw_fops_group1, mwifiex_dfs_memrw_fops_group2); if (ldv_retval_9 == 0) { ldv_state_variable_12 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_61315; case 1: ; if (ldv_state_variable_12 == 1) { mwifiex_memrw_write(mwifiex_dfs_memrw_fops_group2, (char const *)ldvarg37, ldvarg36, ldvarg35); ldv_state_variable_12 = 1; } else { } if (ldv_state_variable_12 == 2) { mwifiex_memrw_write(mwifiex_dfs_memrw_fops_group2, (char const *)ldvarg37, ldvarg36, ldvarg35); ldv_state_variable_12 = 2; } else { } goto ldv_61315; case 2: ; if (ldv_state_variable_12 == 2) { mwifiex_memrw_read(mwifiex_dfs_memrw_fops_group2, ldvarg34, ldvarg33, ldvarg32); ldv_state_variable_12 = 2; } else { } goto ldv_61315; case 3: ; if (ldv_state_variable_12 == 2) { ldv_release_12(); ldv_state_variable_12 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_61315; default: ldv_stop(); } ldv_61315: ; return; } } void ldv_main_exported_15(void) { char *ldvarg109 ; void *tmp ; size_t ldvarg108 ; loff_t *ldvarg110 ; void *tmp___0 ; int tmp___1 ; { tmp = ldv_init_zalloc(1UL); ldvarg109 = (char *)tmp; tmp___0 = ldv_init_zalloc(8UL); ldvarg110 = (loff_t *)tmp___0; ldv_memset((void *)(& ldvarg108), 0, 8UL); tmp___1 = __VERIFIER_nondet_int(); switch (tmp___1) { case 0: ; if (ldv_state_variable_15 == 1) { ldv_retval_14 = simple_open(mwifiex_dfs_device_dump_fops_group1, mwifiex_dfs_device_dump_fops_group2); if (ldv_retval_14 == 0) { ldv_state_variable_15 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_61327; case 1: ; if (ldv_state_variable_15 == 2) { mwifiex_device_dump_read(mwifiex_dfs_device_dump_fops_group2, ldvarg109, ldvarg108, ldvarg110); ldv_state_variable_15 = 2; } else { } goto ldv_61327; case 2: ; if (ldv_state_variable_15 == 2) { ldv_release_15(); ldv_state_variable_15 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_61327; default: ldv_stop(); } ldv_61327: ; return; } } void ldv_main_exported_14(void) { char *ldvarg103 ; void *tmp ; loff_t *ldvarg107 ; void *tmp___0 ; size_t ldvarg105 ; char *ldvarg106 ; void *tmp___1 ; size_t ldvarg102 ; loff_t *ldvarg104 ; void *tmp___2 ; int tmp___3 ; { tmp = ldv_init_zalloc(1UL); ldvarg103 = (char *)tmp; tmp___0 = ldv_init_zalloc(8UL); ldvarg107 = (loff_t *)tmp___0; tmp___1 = ldv_init_zalloc(1UL); ldvarg106 = (char *)tmp___1; tmp___2 = ldv_init_zalloc(8UL); ldvarg104 = (loff_t *)tmp___2; ldv_memset((void *)(& ldvarg105), 0, 8UL); ldv_memset((void *)(& ldvarg102), 0, 8UL); tmp___3 = __VERIFIER_nondet_int(); switch (tmp___3) { case 0: ; if (ldv_state_variable_14 == 1) { ldv_retval_13 = simple_open(mwifiex_dfs_regrdwr_fops_group1, mwifiex_dfs_regrdwr_fops_group2); if (ldv_retval_13 == 0) { ldv_state_variable_14 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_61341; case 1: ; if (ldv_state_variable_14 == 1) { mwifiex_regrdwr_write(mwifiex_dfs_regrdwr_fops_group2, (char const *)ldvarg106, ldvarg105, ldvarg107); ldv_state_variable_14 = 1; } else { } if (ldv_state_variable_14 == 2) { mwifiex_regrdwr_write(mwifiex_dfs_regrdwr_fops_group2, (char const *)ldvarg106, ldvarg105, ldvarg107); ldv_state_variable_14 = 2; } else { } goto ldv_61341; case 2: ; if (ldv_state_variable_14 == 2) { mwifiex_regrdwr_read(mwifiex_dfs_regrdwr_fops_group2, ldvarg103, ldvarg102, ldvarg104); ldv_state_variable_14 = 2; } else { } goto ldv_61341; case 3: ; if (ldv_state_variable_14 == 2) { ldv_release_14(); ldv_state_variable_14 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_61341; default: ldv_stop(); } ldv_61341: ; return; } } void ldv_main_exported_18(void) { size_t ldvarg15 ; char *ldvarg16 ; void *tmp ; loff_t *ldvarg14 ; void *tmp___0 ; int tmp___1 ; { tmp = ldv_init_zalloc(1UL); ldvarg16 = (char *)tmp; tmp___0 = ldv_init_zalloc(8UL); ldvarg14 = (loff_t *)tmp___0; ldv_memset((void *)(& ldvarg15), 0, 8UL); tmp___1 = __VERIFIER_nondet_int(); switch (tmp___1) { case 0: ; if (ldv_state_variable_18 == 1) { ldv_retval_4 = simple_open(mwifiex_dfs_info_fops_group1, mwifiex_dfs_info_fops_group2); if (ldv_retval_4 == 0) { ldv_state_variable_18 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_61353; case 1: ; if (ldv_state_variable_18 == 2) { mwifiex_info_read(mwifiex_dfs_info_fops_group2, ldvarg16, ldvarg15, ldvarg14); ldv_state_variable_18 = 2; } else { } goto ldv_61353; case 2: ; if (ldv_state_variable_18 == 2) { ldv_release_18(); ldv_state_variable_18 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_61353; default: ldv_stop(); } ldv_61353: ; return; } } void ldv_main_exported_10(void) { char *ldvarg115 ; void *tmp ; size_t ldvarg114 ; loff_t *ldvarg113 ; void *tmp___0 ; char *ldvarg112 ; void *tmp___1 ; loff_t *ldvarg116 ; void *tmp___2 ; size_t ldvarg111 ; int tmp___3 ; { tmp = ldv_init_zalloc(1UL); ldvarg115 = (char *)tmp; tmp___0 = ldv_init_zalloc(8UL); ldvarg113 = (loff_t *)tmp___0; tmp___1 = ldv_init_zalloc(1UL); ldvarg112 = (char *)tmp___1; tmp___2 = ldv_init_zalloc(8UL); ldvarg116 = (loff_t *)tmp___2; ldv_memset((void *)(& ldvarg114), 0, 8UL); ldv_memset((void *)(& ldvarg111), 0, 8UL); tmp___3 = __VERIFIER_nondet_int(); switch (tmp___3) { case 0: ; if (ldv_state_variable_10 == 1) { ldv_retval_15 = simple_open(mwifiex_dfs_histogram_fops_group1, mwifiex_dfs_histogram_fops_group2); if (ldv_retval_15 == 0) { ldv_state_variable_10 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_61367; case 1: ; if (ldv_state_variable_10 == 1) { mwifiex_histogram_write(mwifiex_dfs_histogram_fops_group2, (char const *)ldvarg115, ldvarg114, ldvarg116); ldv_state_variable_10 = 1; } else { } if (ldv_state_variable_10 == 2) { mwifiex_histogram_write(mwifiex_dfs_histogram_fops_group2, (char const *)ldvarg115, ldvarg114, ldvarg116); ldv_state_variable_10 = 2; } else { } goto ldv_61367; case 2: ; if (ldv_state_variable_10 == 2) { mwifiex_histogram_read(mwifiex_dfs_histogram_fops_group2, ldvarg112, ldvarg111, ldvarg113); ldv_state_variable_10 = 2; } else { } goto ldv_61367; case 3: ; if (ldv_state_variable_10 == 2) { ldv_release_10(); ldv_state_variable_10 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_61367; default: ldv_stop(); } ldv_61367: ; return; } } void ldv_main_exported_13(void) { char *ldvarg22 ; void *tmp ; loff_t *ldvarg23 ; void *tmp___0 ; loff_t *ldvarg20 ; void *tmp___1 ; char *ldvarg25 ; void *tmp___2 ; size_t ldvarg21 ; size_t ldvarg24 ; int tmp___3 ; { tmp = ldv_init_zalloc(1UL); ldvarg22 = (char *)tmp; tmp___0 = ldv_init_zalloc(8UL); ldvarg23 = (loff_t *)tmp___0; tmp___1 = ldv_init_zalloc(8UL); ldvarg20 = (loff_t *)tmp___1; tmp___2 = ldv_init_zalloc(1UL); ldvarg25 = (char *)tmp___2; ldv_memset((void *)(& ldvarg21), 0, 8UL); ldv_memset((void *)(& ldvarg24), 0, 8UL); tmp___3 = __VERIFIER_nondet_int(); switch (tmp___3) { case 0: ; if (ldv_state_variable_13 == 1) { ldv_retval_7 = simple_open(mwifiex_dfs_rdeeprom_fops_group1, mwifiex_dfs_rdeeprom_fops_group2); if (ldv_retval_7 == 0) { ldv_state_variable_13 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_61382; case 1: ; if (ldv_state_variable_13 == 1) { mwifiex_rdeeprom_write(mwifiex_dfs_rdeeprom_fops_group2, (char const *)ldvarg25, ldvarg24, ldvarg23); ldv_state_variable_13 = 1; } else { } if (ldv_state_variable_13 == 2) { mwifiex_rdeeprom_write(mwifiex_dfs_rdeeprom_fops_group2, (char const *)ldvarg25, ldvarg24, ldvarg23); ldv_state_variable_13 = 2; } else { } goto ldv_61382; case 2: ; if (ldv_state_variable_13 == 2) { mwifiex_rdeeprom_read(mwifiex_dfs_rdeeprom_fops_group2, ldvarg22, ldvarg21, ldvarg20); ldv_state_variable_13 = 2; } else { } goto ldv_61382; case 3: ; if (ldv_state_variable_13 == 2) { ldv_release_13(); ldv_state_variable_13 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_61382; default: ldv_stop(); } ldv_61382: ; return; } } void ldv_main_exported_16(void) { char *ldvarg19 ; void *tmp ; loff_t *ldvarg17 ; void *tmp___0 ; size_t ldvarg18 ; int tmp___1 ; { tmp = ldv_init_zalloc(1UL); ldvarg19 = (char *)tmp; tmp___0 = ldv_init_zalloc(8UL); ldvarg17 = (loff_t *)tmp___0; ldv_memset((void *)(& ldvarg18), 0, 8UL); tmp___1 = __VERIFIER_nondet_int(); switch (tmp___1) { case 0: ; if (ldv_state_variable_16 == 1) { ldv_retval_6 = simple_open(mwifiex_dfs_getlog_fops_group1, mwifiex_dfs_getlog_fops_group2); if (ldv_retval_6 == 0) { ldv_state_variable_16 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_61394; case 1: ; if (ldv_state_variable_16 == 2) { mwifiex_getlog_read(mwifiex_dfs_getlog_fops_group2, ldvarg19, ldvarg18, ldvarg17); ldv_state_variable_16 = 2; } else { } goto ldv_61394; case 2: ; if (ldv_state_variable_16 == 2) { ldv_release_16(); ldv_state_variable_16 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_61394; default: ldv_stop(); } ldv_61394: ; return; } } bool ldv_queue_work_on_439(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } bool ldv_queue_delayed_work_on_440(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } bool ldv_queue_work_on_441(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct work_struct *ldv_func_arg3 ) { ldv_func_ret_type___1 ldv_func_res ; bool tmp ; { tmp = queue_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; activate_work_2(ldv_func_arg3, 2); return (ldv_func_res); } } void ldv_flush_workqueue_442(struct workqueue_struct *ldv_func_arg1 ) { { flush_workqueue(ldv_func_arg1); call_and_disable_all_2(2); return; } } bool ldv_queue_delayed_work_on_443(int ldv_func_arg1 , struct workqueue_struct *ldv_func_arg2 , struct delayed_work *ldv_func_arg3 , unsigned long ldv_func_arg4 ) { ldv_func_ret_type___2 ldv_func_res ; bool tmp ; { tmp = queue_delayed_work_on(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; activate_work_2(& ldv_func_arg3->work, 2); return (ldv_func_res); } } extern void *memset(void * , int , size_t ) ; __inline static void ldv_error(void) { { ERROR: ; __VERIFIER_error(); } } bool ldv_is_err(void const *ptr ) { { return ((unsigned long )ptr > 2012UL); } } void *ldv_err_ptr(long error ) { { return ((void *)(2012L - error)); } } long ldv_ptr_err(void const *ptr ) { { return ((long )(2012UL - (unsigned long )ptr)); } } bool ldv_is_err_or_null(void const *ptr ) { bool tmp ; int tmp___0 ; { if ((unsigned long )ptr == (unsigned long )((void const *)0)) { tmp___0 = 1; } else { tmp = ldv_is_err(ptr); if ((int )tmp) { tmp___0 = 1; } else { tmp___0 = 0; } } return ((bool )tmp___0); } } int ldv_module_refcounter = 1; void ldv_module_get(struct module *module ) { { if ((unsigned long )module != (unsigned long )((struct module *)0)) { ldv_module_refcounter = ldv_module_refcounter + 1; } else { } return; } } int ldv_try_module_get(struct module *module ) { int module_get_succeeded ; { if ((unsigned long )module != (unsigned long )((struct module *)0)) { module_get_succeeded = ldv_undef_int(); if (module_get_succeeded == 1) { ldv_module_refcounter = ldv_module_refcounter + 1; return (1); } else { return (0); } } else { } return (0); } } void ldv_module_put(struct module *module ) { { if ((unsigned long )module != (unsigned long )((struct module *)0)) { if (ldv_module_refcounter <= 1) { ldv_error(); } else { } ldv_module_refcounter = ldv_module_refcounter - 1; } else { } return; } } void ldv_module_put_and_exit(void) { { ldv_module_put((struct module *)1); LDV_STOP: ; goto LDV_STOP; } } unsigned int ldv_module_refcount(void) { { return ((unsigned int )(ldv_module_refcounter + -1)); } } void ldv_check_final_state(void) { { if (ldv_module_refcounter != 1) { ldv_error(); } else { } return; } }