extern void abort(void); #include void reach_error() { assert(0); } /* Generated by CIL v. 1.3.7 */ /* print_CIL_Input is false */ typedef signed char __s8; typedef unsigned char __u8; typedef short __s16; typedef unsigned short __u16; typedef int __s32; typedef unsigned int __u32; typedef long long __s64; typedef unsigned long long __u64; typedef 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 __kernel_long_t __kernel_suseconds_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 __kernel_long_t __kernel_off_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; typedef __u32 __kernel_dev_t; typedef __kernel_dev_t dev_t; typedef unsigned short umode_t; typedef __u32 nlink_t; typedef __kernel_off_t off_t; typedef __kernel_pid_t pid_t; typedef __kernel_clockid_t clockid_t; typedef _Bool bool; typedef __kernel_uid32_t uid_t; typedef __kernel_gid32_t gid_t; typedef __kernel_loff_t loff_t; typedef __kernel_size_t size_t; typedef __kernel_ssize_t ssize_t; typedef __kernel_time_t time_t; typedef __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 module; typedef void (*ctor_fn_t)(void); struct file_operations; struct device; struct net_device; struct completion; struct pt_regs; struct pid; typedef u16 __ticket_t; typedef u32 __ticketpair_t; struct __raw_tickets { __ticket_t head ; __ticket_t tail ; }; union __anonunion_ldv_2024_8 { __ticketpair_t head_tail ; struct __raw_tickets tickets ; }; struct arch_spinlock { union __anonunion_ldv_2024_8 ldv_2024 ; }; typedef struct arch_spinlock arch_spinlock_t; struct __anonstruct_ldv_2031_10 { u32 read ; s32 write ; }; union __anonunion_arch_rwlock_t_9 { s64 lock ; struct __anonstruct_ldv_2031_10 ldv_2031 ; }; typedef union __anonunion_arch_rwlock_t_9 arch_rwlock_t; struct task_struct; struct lockdep_map; struct mm_struct; struct pt_regs { unsigned long r15 ; unsigned long r14 ; unsigned long r13 ; unsigned long r12 ; unsigned long bp ; unsigned long bx ; unsigned long r11 ; unsigned long r10 ; unsigned long r9 ; unsigned long r8 ; unsigned long ax ; unsigned long cx ; unsigned long dx ; unsigned long si ; unsigned long di ; unsigned long orig_ax ; unsigned long ip ; unsigned long cs ; unsigned long flags ; unsigned long sp ; unsigned long ss ; }; struct __anonstruct_ldv_2096_12 { unsigned int a ; unsigned int b ; }; struct __anonstruct_ldv_2111_13 { u16 limit0 ; u16 base0 ; unsigned char base1 ; unsigned char type : 4 ; unsigned char s : 1 ; unsigned char dpl : 2 ; unsigned char p : 1 ; unsigned char limit : 4 ; unsigned char avl : 1 ; unsigned char l : 1 ; unsigned char d : 1 ; unsigned char g : 1 ; unsigned char base2 ; }; union __anonunion_ldv_2112_11 { struct __anonstruct_ldv_2096_12 ldv_2096 ; struct __anonstruct_ldv_2111_13 ldv_2111 ; }; struct desc_struct { union __anonunion_ldv_2112_11 ldv_2112 ; }; typedef unsigned long pgdval_t; typedef unsigned long pgprotval_t; struct pgprot { pgprotval_t pgprot ; }; typedef struct pgprot pgprot_t; struct __anonstruct_pgd_t_15 { pgdval_t pgd ; }; typedef struct __anonstruct_pgd_t_15 pgd_t; struct page; typedef struct page *pgtable_t; struct file; struct seq_file; struct thread_struct; struct cpumask; struct kernel_vm86_regs { struct pt_regs pt ; unsigned short es ; unsigned short __esh ; unsigned short ds ; unsigned short __dsh ; unsigned short fs ; unsigned short __fsh ; unsigned short gs ; unsigned short __gsh ; }; union __anonunion_ldv_2767_18 { struct pt_regs *regs ; struct kernel_vm86_regs *vm86 ; }; struct math_emu_info { long ___orig_eip ; union __anonunion_ldv_2767_18 ldv_2767 ; }; struct bug_entry { int bug_addr_disp ; int file_disp ; unsigned short line ; unsigned short flags ; }; struct cpumask { unsigned long bits[64U] ; }; typedef struct cpumask cpumask_t; typedef struct cpumask *cpumask_var_t; struct static_key; struct exec_domain; struct map_segment; struct exec_domain { char const *name ; void (*handler)(int , struct pt_regs * ) ; unsigned char pers_low ; unsigned char pers_high ; unsigned long *signal_map ; unsigned long *signal_invmap ; struct map_segment *err_map ; struct map_segment *socktype_map ; struct map_segment *sockopt_map ; struct map_segment *af_map ; struct module *module ; struct exec_domain *next ; }; struct seq_operations; struct i387_fsave_struct { u32 cwd ; u32 swd ; u32 twd ; u32 fip ; u32 fcs ; u32 foo ; u32 fos ; u32 st_space[20U] ; u32 status ; }; struct __anonstruct_ldv_5125_23 { u64 rip ; u64 rdp ; }; struct __anonstruct_ldv_5131_24 { u32 fip ; u32 fcs ; u32 foo ; u32 fos ; }; union __anonunion_ldv_5132_22 { struct __anonstruct_ldv_5125_23 ldv_5125 ; struct __anonstruct_ldv_5131_24 ldv_5131 ; }; union __anonunion_ldv_5141_25 { u32 padding1[12U] ; u32 sw_reserved[12U] ; }; struct i387_fxsave_struct { u16 cwd ; u16 swd ; u16 twd ; u16 fop ; union __anonunion_ldv_5132_22 ldv_5132 ; u32 mxcsr ; u32 mxcsr_mask ; u32 st_space[32U] ; u32 xmm_space[64U] ; u32 padding[12U] ; union __anonunion_ldv_5141_25 ldv_5141 ; }; struct i387_soft_struct { u32 cwd ; u32 swd ; u32 twd ; u32 fip ; u32 fcs ; u32 foo ; u32 fos ; u32 st_space[20U] ; u8 ftop ; u8 changed ; u8 lookahead ; u8 no_update ; u8 rm ; u8 alimit ; struct math_emu_info *info ; u32 entry_eip ; }; struct ymmh_struct { u32 ymmh_space[64U] ; }; struct xsave_hdr_struct { u64 xstate_bv ; u64 reserved1[2U] ; u64 reserved2[5U] ; }; struct xsave_struct { struct i387_fxsave_struct i387 ; struct xsave_hdr_struct xsave_hdr ; struct ymmh_struct ymmh ; }; union thread_xstate { struct i387_fsave_struct fsave ; struct i387_fxsave_struct fxsave ; struct i387_soft_struct soft ; struct xsave_struct xsave ; }; struct fpu { unsigned int last_cpu ; unsigned int has_fpu ; union thread_xstate *state ; }; struct kmem_cache; struct perf_event; struct thread_struct { struct desc_struct tls_array[3U] ; unsigned long sp0 ; unsigned long sp ; unsigned long usersp ; unsigned short es ; unsigned short ds ; unsigned short fsindex ; unsigned short gsindex ; unsigned long fs ; unsigned long gs ; struct perf_event *ptrace_bps[4U] ; unsigned long debugreg6 ; unsigned long ptrace_dr7 ; unsigned long cr2 ; unsigned long trap_nr ; unsigned long error_code ; struct fpu fpu ; unsigned long *io_bitmap_ptr ; unsigned long iopl ; unsigned int io_bitmap_max ; }; struct __anonstruct_mm_segment_t_27 { unsigned long seg ; }; typedef struct __anonstruct_mm_segment_t_27 mm_segment_t; typedef atomic64_t atomic_long_t; struct stack_trace { unsigned int nr_entries ; unsigned int max_entries ; unsigned long *entries ; int skip ; }; struct lockdep_subclass_key { char __one_byte ; } __attribute__((__packed__)) ; struct lock_class_key { struct lockdep_subclass_key subkeys[8U] ; }; struct lock_class { struct list_head hash_entry ; struct list_head lock_entry ; struct lockdep_subclass_key *key ; unsigned int subclass ; unsigned int dep_gen_id ; unsigned long usage_mask ; struct stack_trace usage_traces[13U] ; struct list_head locks_after ; struct list_head locks_before ; unsigned int version ; unsigned long ops ; char const *name ; int name_version ; unsigned long contention_point[4U] ; unsigned long contending_point[4U] ; }; struct lockdep_map { struct lock_class_key *key ; struct lock_class *class_cache[2U] ; char const *name ; int cpu ; unsigned long ip ; }; struct held_lock { u64 prev_chain_key ; unsigned long acquire_ip ; struct lockdep_map *instance ; struct lockdep_map *nest_lock ; u64 waittime_stamp ; u64 holdtime_stamp ; unsigned short class_idx : 13 ; unsigned char irq_context : 2 ; unsigned char trylock : 1 ; unsigned char read : 2 ; unsigned char check : 2 ; unsigned char hardirqs_off : 1 ; unsigned short references : 11 ; }; struct raw_spinlock { arch_spinlock_t raw_lock ; unsigned int magic ; unsigned int owner_cpu ; void *owner ; struct lockdep_map dep_map ; }; typedef struct raw_spinlock raw_spinlock_t; struct __anonstruct_ldv_5960_29 { u8 __padding[24U] ; struct lockdep_map dep_map ; }; union __anonunion_ldv_5961_28 { struct raw_spinlock rlock ; struct __anonstruct_ldv_5960_29 ldv_5960 ; }; struct spinlock { union __anonunion_ldv_5961_28 ldv_5961 ; }; typedef struct spinlock spinlock_t; struct __anonstruct_rwlock_t_30 { arch_rwlock_t raw_lock ; unsigned int magic ; unsigned int owner_cpu ; void *owner ; struct lockdep_map dep_map ; }; typedef struct __anonstruct_rwlock_t_30 rwlock_t; struct mutex { atomic_t count ; spinlock_t wait_lock ; struct list_head wait_list ; struct task_struct *owner ; char const *name ; void *magic ; struct lockdep_map dep_map ; }; struct mutex_waiter { struct list_head list ; struct task_struct *task ; void *magic ; }; struct timespec; struct compat_timespec; struct __anonstruct_futex_32 { u32 *uaddr ; u32 val ; u32 flags ; u32 bitset ; u64 time ; u32 *uaddr2 ; }; struct __anonstruct_nanosleep_33 { clockid_t clockid ; struct timespec *rmtp ; struct compat_timespec *compat_rmtp ; u64 expires ; }; struct pollfd; struct __anonstruct_poll_34 { struct pollfd *ufds ; int nfds ; int has_timeout ; unsigned long tv_sec ; unsigned long tv_nsec ; }; union __anonunion_ldv_6166_31 { struct __anonstruct_futex_32 futex ; struct __anonstruct_nanosleep_33 nanosleep ; struct __anonstruct_poll_34 poll ; }; struct restart_block { long (*fn)(struct restart_block * ) ; union __anonunion_ldv_6166_31 ldv_6166 ; }; struct thread_info { struct task_struct *task ; struct exec_domain *exec_domain ; __u32 flags ; __u32 status ; __u32 cpu ; int preempt_count ; mm_segment_t addr_limit ; struct restart_block restart_block ; void *sysenter_return ; unsigned char sig_on_uaccess_error : 1 ; unsigned char uaccess_err : 1 ; }; struct __anonstruct_seqlock_t_35 { unsigned int sequence ; spinlock_t lock ; }; typedef struct __anonstruct_seqlock_t_35 seqlock_t; struct seqcount { unsigned int sequence ; }; typedef struct seqcount seqcount_t; struct timespec { __kernel_time_t tv_sec ; long tv_nsec ; }; struct timeval { __kernel_time_t tv_sec ; __kernel_suseconds_t tv_usec ; }; struct user_namespace; typedef uid_t kuid_t; typedef gid_t kgid_t; struct kstat { u64 ino ; dev_t dev ; umode_t mode ; unsigned int nlink ; kuid_t uid ; kgid_t gid ; dev_t rdev ; loff_t size ; struct timespec atime ; struct timespec mtime ; struct timespec ctime ; unsigned long blksize ; unsigned long long blocks ; }; struct __wait_queue_head { spinlock_t lock ; struct list_head task_list ; }; typedef struct __wait_queue_head wait_queue_head_t; struct __anonstruct_nodemask_t_36 { unsigned long bits[16U] ; }; typedef struct __anonstruct_nodemask_t_36 nodemask_t; struct rw_semaphore; struct rw_semaphore { long count ; raw_spinlock_t wait_lock ; struct list_head wait_list ; struct lockdep_map dep_map ; }; struct completion { unsigned int done ; wait_queue_head_t wait ; }; struct notifier_block; union ktime { s64 tv64 ; }; typedef union ktime ktime_t; struct tvec_base; struct timer_list { struct list_head entry ; unsigned long expires ; struct tvec_base *base ; void (*function)(unsigned long ) ; unsigned long data ; int slack ; int start_pid ; void *start_site ; char start_comm[16U] ; struct lockdep_map lockdep_map ; }; struct hrtimer; enum hrtimer_restart; struct work_struct; struct work_struct { atomic_long_t data ; struct list_head entry ; void (*func)(struct work_struct * ) ; struct lockdep_map lockdep_map ; }; struct delayed_work { struct work_struct work ; struct timer_list timer ; int cpu ; }; struct notifier_block { int (*notifier_call)(struct notifier_block * , unsigned long , void * ) ; struct notifier_block *next ; int priority ; }; struct blocking_notifier_head { struct rw_semaphore rwsem ; struct notifier_block *head ; }; struct ctl_table; struct pm_message { int event ; }; typedef struct pm_message pm_message_t; struct dev_pm_ops { int (*prepare)(struct device * ) ; void (*complete)(struct device * ) ; int (*suspend)(struct device * ) ; int (*resume)(struct device * ) ; int (*freeze)(struct device * ) ; int (*thaw)(struct device * ) ; int (*poweroff)(struct device * ) ; int (*restore)(struct device * ) ; int (*suspend_late)(struct device * ) ; int (*resume_early)(struct device * ) ; int (*freeze_late)(struct device * ) ; int (*thaw_early)(struct device * ) ; int (*poweroff_late)(struct device * ) ; int (*restore_early)(struct device * ) ; int (*suspend_noirq)(struct device * ) ; int (*resume_noirq)(struct device * ) ; int (*freeze_noirq)(struct device * ) ; int (*thaw_noirq)(struct device * ) ; int (*poweroff_noirq)(struct device * ) ; int (*restore_noirq)(struct device * ) ; int (*runtime_suspend)(struct device * ) ; int (*runtime_resume)(struct device * ) ; int (*runtime_idle)(struct device * ) ; }; enum rpm_status { RPM_ACTIVE = 0, RPM_RESUMING = 1, RPM_SUSPENDED = 2, RPM_SUSPENDING = 3 } ; enum rpm_request { RPM_REQ_NONE = 0, RPM_REQ_IDLE = 1, RPM_REQ_SUSPEND = 2, RPM_REQ_AUTOSUSPEND = 3, RPM_REQ_RESUME = 4 } ; struct wakeup_source; struct pm_subsys_data { spinlock_t lock ; unsigned int refcount ; }; struct dev_pm_qos; struct dev_pm_info { pm_message_t power_state ; unsigned char can_wakeup : 1 ; unsigned char async_suspend : 1 ; bool is_prepared ; bool is_suspended ; bool ignore_children ; bool early_init ; spinlock_t lock ; struct list_head entry ; struct completion completion ; struct wakeup_source *wakeup ; bool wakeup_path ; bool syscore ; struct timer_list suspend_timer ; unsigned long timer_expires ; struct work_struct work ; wait_queue_head_t wait_queue ; atomic_t usage_count ; atomic_t child_count ; unsigned char disable_depth : 3 ; unsigned char idle_notification : 1 ; unsigned char request_pending : 1 ; unsigned char deferred_resume : 1 ; unsigned char run_wake : 1 ; unsigned char runtime_auto : 1 ; unsigned char no_callbacks : 1 ; unsigned char irq_safe : 1 ; unsigned char use_autosuspend : 1 ; unsigned char timer_autosuspends : 1 ; enum rpm_request request ; enum rpm_status runtime_status ; int runtime_error ; int autosuspend_delay ; unsigned long last_busy ; unsigned long active_jiffies ; unsigned long suspended_jiffies ; unsigned long accounting_timestamp ; struct pm_subsys_data *subsys_data ; struct dev_pm_qos *qos ; }; struct dev_pm_domain { struct dev_pm_ops ops ; }; struct __anonstruct_mm_context_t_101 { void *ldt ; int size ; unsigned short ia32_compat ; struct mutex lock ; void *vdso ; }; typedef struct __anonstruct_mm_context_t_101 mm_context_t; struct vm_area_struct; struct rb_node { unsigned long __rb_parent_color ; struct rb_node *rb_right ; struct rb_node *rb_left ; }; struct rb_root { struct rb_node *rb_node ; }; struct nsproxy; struct 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_ldv_13049_129 { struct ctl_table *ctl_table ; int used ; int count ; int nreg ; }; union __anonunion_ldv_13051_128 { struct __anonstruct_ldv_13049_129 ldv_13049 ; struct callback_head rcu ; }; struct ctl_table_set; struct ctl_table_header { union __anonunion_ldv_13051_128 ldv_13051 ; 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 cred; typedef __u64 Elf64_Addr; typedef __u16 Elf64_Half; typedef __u32 Elf64_Word; typedef __u64 Elf64_Xword; struct elf64_sym { Elf64_Word st_name ; unsigned char st_info ; unsigned char st_other ; Elf64_Half st_shndx ; Elf64_Addr st_value ; Elf64_Xword st_size ; }; typedef struct elf64_sym Elf64_Sym; struct sock; struct kobject; enum kobj_ns_type { KOBJ_NS_TYPE_NONE = 0, KOBJ_NS_TYPE_NET = 1, KOBJ_NS_TYPES = 2 } ; struct kobj_ns_type_operations { enum kobj_ns_type type ; void *(*grab_current_ns)(void) ; void const *(*netlink_ns)(struct sock * ) ; void const *(*initial_ns)(void) ; void (*drop_ns)(void * ) ; }; struct attribute { char const *name ; umode_t mode ; bool ignore_lockdep ; struct lock_class_key *key ; struct lock_class_key skey ; }; struct attribute_group { char const *name ; umode_t (*is_visible)(struct kobject * , struct attribute * , int ) ; struct attribute **attrs ; }; struct bin_attribute { struct attribute attr ; size_t size ; void *private ; ssize_t (*read)(struct file * , struct kobject * , struct bin_attribute * , char * , loff_t , size_t ) ; ssize_t (*write)(struct file * , struct kobject * , struct bin_attribute * , char * , loff_t , size_t ) ; int (*mmap)(struct file * , struct kobject * , struct bin_attribute * , struct vm_area_struct * ) ; }; struct sysfs_ops { ssize_t (*show)(struct kobject * , struct attribute * , char * ) ; ssize_t (*store)(struct kobject * , struct attribute * , char const * , size_t ) ; void const *(*namespace)(struct kobject * , struct attribute const * ) ; }; struct sysfs_dirent; struct kref { atomic_t refcount ; }; struct kset; struct kobj_type; struct kobject { char const *name ; struct list_head entry ; struct kobject *parent ; struct kset *kset ; struct kobj_type *ktype ; struct sysfs_dirent *sd ; struct kref kref ; unsigned char state_initialized : 1 ; unsigned char state_in_sysfs : 1 ; unsigned char state_add_uevent_sent : 1 ; unsigned char state_remove_uevent_sent : 1 ; unsigned char uevent_suppress : 1 ; }; struct kobj_type { void (*release)(struct kobject * ) ; struct sysfs_ops const *sysfs_ops ; struct attribute **default_attrs ; struct kobj_ns_type_operations const *(*child_ns_type)(struct kobject * ) ; void const *(*namespace)(struct kobject * ) ; }; struct kobj_uevent_env { char *envp[32U] ; int envp_idx ; char buf[2048U] ; int buflen ; }; struct kset_uevent_ops { int (* const filter)(struct kset * , struct kobject * ) ; char const *(* const name)(struct kset * , struct kobject * ) ; int (* const uevent)(struct kset * , struct kobject * , struct kobj_uevent_env * ) ; }; struct kset { struct list_head list ; spinlock_t list_lock ; struct kobject kobj ; struct kset_uevent_ops const *uevent_ops ; }; struct kernel_param; struct kernel_param_ops { int (*set)(char const * , struct kernel_param const * ) ; int (*get)(char * , struct kernel_param const * ) ; void (*free)(void * ) ; }; struct kparam_string; struct kparam_array; union __anonunion_ldv_13829_134 { void *arg ; struct kparam_string const *str ; struct kparam_array const *arr ; }; struct kernel_param { char const *name ; struct kernel_param_ops const *ops ; u16 perm ; s16 level ; union __anonunion_ldv_13829_134 ldv_13829 ; }; struct kparam_string { unsigned int maxlen ; char *string ; }; struct kparam_array { unsigned int max ; unsigned int elemsize ; unsigned int *num ; struct kernel_param_ops const *ops ; void *elem ; }; struct static_key { atomic_t enabled ; }; struct tracepoint; struct tracepoint_func { void *func ; void *data ; }; struct tracepoint { char const *name ; struct static_key key ; void (*regfunc)(void) ; void (*unregfunc)(void) ; struct tracepoint_func *funcs ; }; struct kernel_symbol { unsigned long value ; char const *name ; }; struct mod_arch_specific { }; struct module_param_attrs; struct module_kobject { struct kobject kobj ; struct module *mod ; struct kobject *drivers_dir ; struct module_param_attrs *mp ; }; struct module_attribute { struct attribute attr ; ssize_t (*show)(struct module_attribute * , struct module_kobject * , char * ) ; ssize_t (*store)(struct module_attribute * , struct module_kobject * , char const * , size_t ) ; void (*setup)(struct module * , char const * ) ; int (*test)(struct module * ) ; void (*free)(struct module * ) ; }; struct exception_table_entry; enum module_state { MODULE_STATE_LIVE = 0, MODULE_STATE_COMING = 1, MODULE_STATE_GOING = 2 } ; struct module_ref { unsigned long incs ; unsigned long decs ; }; struct module_sect_attrs; struct module_notes_attrs; struct ftrace_event_call; struct module { enum module_state state ; struct list_head list ; char name[56U] ; struct module_kobject mkobj ; struct module_attribute *modinfo_attrs ; char const *version ; char const *srcversion ; struct kobject *holders_dir ; struct kernel_symbol const *syms ; unsigned long const *crcs ; unsigned int num_syms ; struct kernel_param *kp ; unsigned int num_kp ; unsigned int num_gpl_syms ; struct kernel_symbol const *gpl_syms ; unsigned long const *gpl_crcs ; struct kernel_symbol const *unused_syms ; unsigned long const *unused_crcs ; unsigned int num_unused_syms ; unsigned int num_unused_gpl_syms ; struct kernel_symbol const *unused_gpl_syms ; unsigned long const *unused_gpl_crcs ; bool sig_ok ; struct kernel_symbol const *gpl_future_syms ; unsigned long const *gpl_future_crcs ; unsigned int num_gpl_future_syms ; unsigned int num_exentries ; struct exception_table_entry *extable ; int (*init)(void) ; void *module_init ; void *module_core ; unsigned int init_size ; unsigned int core_size ; unsigned int init_text_size ; unsigned int core_text_size ; unsigned int init_ro_size ; unsigned int core_ro_size ; struct mod_arch_specific arch ; unsigned int taints ; unsigned int num_bugs ; struct list_head bug_list ; struct bug_entry *bug_table ; Elf64_Sym *symtab ; Elf64_Sym *core_symtab ; unsigned int num_symtab ; unsigned int core_num_syms ; char *strtab ; char *core_strtab ; struct module_sect_attrs *sect_attrs ; struct module_notes_attrs *notes_attrs ; char *args ; void *percpu ; unsigned int percpu_size ; unsigned int num_tracepoints ; struct tracepoint * const *tracepoints_ptrs ; unsigned int num_trace_bprintk_fmt ; char const **trace_bprintk_fmt_start ; struct ftrace_event_call **trace_events ; unsigned int num_trace_events ; struct list_head source_list ; struct list_head target_list ; struct task_struct *waiter ; void (*exit)(void) ; struct module_ref *refptr ; ctor_fn_t (**ctors)(void) ; unsigned int num_ctors ; }; struct plist_head { struct list_head node_list ; }; struct plist_node { int prio ; struct list_head prio_list ; struct list_head node_list ; }; struct klist_node; struct klist_node { void *n_klist ; struct list_head n_node ; struct kref n_ref ; }; struct dma_map_ops; struct dev_archdata { struct dma_map_ops *dma_ops ; void *iommu ; }; struct device_private; struct device_driver; struct driver_private; struct class; struct subsys_private; struct bus_type; struct device_node; struct iommu_ops; struct iommu_group; struct bus_attribute { struct attribute attr ; ssize_t (*show)(struct bus_type * , char * ) ; ssize_t (*store)(struct bus_type * , char const * , size_t ) ; }; struct device_attribute; struct driver_attribute; struct bus_type { char const *name ; char const *dev_name ; struct device *dev_root ; struct bus_attribute *bus_attrs ; struct device_attribute *dev_attrs ; struct driver_attribute *drv_attrs ; int (*match)(struct device * , struct device_driver * ) ; int (*uevent)(struct device * , struct kobj_uevent_env * ) ; int (*probe)(struct device * ) ; int (*remove)(struct device * ) ; void (*shutdown)(struct device * ) ; int (*suspend)(struct device * , pm_message_t ) ; int (*resume)(struct device * ) ; struct dev_pm_ops const *pm ; struct iommu_ops *iommu_ops ; struct subsys_private *p ; }; struct device_type; struct 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 ; 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 driver_attribute { struct attribute attr ; ssize_t (*show)(struct device_driver * , char * ) ; ssize_t (*store)(struct device_driver * , char const * , size_t ) ; }; struct class_attribute; struct class { char const *name ; struct module *owner ; struct class_attribute *class_attrs ; struct device_attribute *dev_attrs ; struct bin_attribute *dev_bin_attrs ; struct kobject *dev_kobj ; int (*dev_uevent)(struct device * , struct kobj_uevent_env * ) ; char *(*devnode)(struct device * , umode_t * ) ; void (*class_release)(struct class * ) ; void (*dev_release)(struct device * ) ; int (*suspend)(struct device * , pm_message_t ) ; int (*resume)(struct device * ) ; struct kobj_ns_type_operations const *ns_type ; void const *(*namespace)(struct device * ) ; struct dev_pm_ops const *pm ; struct subsys_private *p ; }; struct class_attribute { struct attribute attr ; ssize_t (*show)(struct class * , struct class_attribute * , char * ) ; ssize_t (*store)(struct class * , struct class_attribute * , char const * , size_t ) ; void const *(*namespace)(struct class * , struct class_attribute const * ) ; }; struct device_type { char const *name ; struct attribute_group const **groups ; int (*uevent)(struct device * , struct kobj_uevent_env * ) ; char *(*devnode)(struct device * , umode_t * ) ; void (*release)(struct device * ) ; struct dev_pm_ops const *pm ; }; struct device_attribute { struct attribute attr ; ssize_t (*show)(struct device * , struct device_attribute * , char * ) ; ssize_t (*store)(struct device * , struct device_attribute * , char const * , size_t ) ; }; struct device_dma_parameters { unsigned int max_segment_size ; unsigned long segment_boundary_mask ; }; struct acpi_dev_node { void *handle ; }; struct dma_coherent_mem; struct device { struct device *parent ; struct device_private *p ; struct kobject kobj ; char const *init_name ; struct device_type const *type ; struct mutex mutex ; struct bus_type *bus ; struct device_driver *driver ; void *platform_data ; struct dev_pm_info power ; struct dev_pm_domain *pm_domain ; int numa_node ; u64 *dma_mask ; u64 coherent_dma_mask ; struct device_dma_parameters *dma_parms ; struct list_head dma_pools ; struct dma_coherent_mem *dma_mem ; struct dev_archdata archdata ; struct device_node *of_node ; struct acpi_dev_node acpi_node ; dev_t devt ; u32 id ; spinlock_t devres_lock ; struct list_head devres_head ; struct klist_node knode_class ; struct class *class ; struct attribute_group const **groups ; void (*release)(struct device * ) ; struct iommu_group *iommu_group ; }; struct wakeup_source { char const *name ; struct list_head entry ; spinlock_t lock ; struct timer_list timer ; unsigned long timer_expires ; ktime_t total_time ; ktime_t max_time ; ktime_t last_time ; ktime_t start_prevent_time ; ktime_t prevent_sleep_time ; unsigned long event_count ; unsigned long active_count ; unsigned long relax_count ; unsigned long expire_count ; unsigned long wakeup_count ; bool active ; bool autosleep_enabled ; }; struct pm_qos_request { struct plist_node node ; int pm_qos_class ; struct delayed_work work ; }; struct pm_qos_flags_request { struct list_head node ; s32 flags ; }; enum dev_pm_qos_req_type { DEV_PM_QOS_LATENCY = 1, DEV_PM_QOS_FLAGS = 2 } ; union __anonunion_data_135 { struct plist_node pnode ; struct pm_qos_flags_request flr ; }; struct dev_pm_qos_request { enum dev_pm_qos_req_type type ; union __anonunion_data_135 data ; struct device *dev ; }; enum pm_qos_type { PM_QOS_UNITIALIZED = 0, PM_QOS_MAX = 1, PM_QOS_MIN = 2 } ; struct pm_qos_constraints { struct plist_head list ; s32 target_value ; s32 default_value ; enum pm_qos_type type ; struct blocking_notifier_head *notifiers ; }; struct pm_qos_flags { struct list_head list ; s32 effective_flags ; }; struct dev_pm_qos { struct pm_qos_constraints latency ; struct pm_qos_flags flags ; struct dev_pm_qos_request *latency_req ; struct dev_pm_qos_request *flags_req ; }; struct iovec { void *iov_base ; __kernel_size_t iov_len ; }; 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 uprobe; struct uprobe_task { enum uprobe_task_state state ; struct arch_uprobe_task autask ; struct uprobe *active_uprobe ; unsigned long xol_vaddr ; unsigned long vaddr ; }; struct xol_area { wait_queue_head_t wq ; atomic_t slot_count ; unsigned long *bitmap ; struct page *page ; unsigned long vaddr ; }; struct uprobes_state { struct xol_area *xol_area ; }; struct address_space; union __anonunion_ldv_15540_137 { unsigned long index ; void *freelist ; bool pfmemalloc ; }; struct __anonstruct_ldv_15550_141 { unsigned short inuse ; unsigned short objects : 15 ; unsigned char frozen : 1 ; }; union __anonunion_ldv_15552_140 { atomic_t _mapcount ; struct __anonstruct_ldv_15550_141 ldv_15550 ; int units ; }; struct __anonstruct_ldv_15554_139 { union __anonunion_ldv_15552_140 ldv_15552 ; atomic_t _count ; }; union __anonunion_ldv_15555_138 { unsigned long counters ; struct __anonstruct_ldv_15554_139 ldv_15554 ; }; struct __anonstruct_ldv_15556_136 { union __anonunion_ldv_15540_137 ldv_15540 ; union __anonunion_ldv_15555_138 ldv_15555 ; }; struct __anonstruct_ldv_15563_143 { struct page *next ; int pages ; int pobjects ; }; struct slab; union __anonunion_ldv_15567_142 { struct list_head lru ; struct __anonstruct_ldv_15563_143 ldv_15563 ; struct list_head list ; struct slab *slab_page ; }; union __anonunion_ldv_15572_144 { unsigned long private ; struct kmem_cache *slab_cache ; struct page *first_page ; }; struct page { unsigned long flags ; struct address_space *mapping ; struct __anonstruct_ldv_15556_136 ldv_15556 ; union __anonunion_ldv_15567_142 ldv_15567 ; union __anonunion_ldv_15572_144 ldv_15572 ; unsigned long debug_flags ; int _last_nid ; }; struct page_frag { struct page *page ; __u32 offset ; __u32 size ; }; struct __anonstruct_linear_146 { struct rb_node rb ; unsigned long rb_subtree_last ; }; union __anonunion_shared_145 { struct __anonstruct_linear_146 linear ; struct list_head nonlinear ; }; 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 ; union __anonunion_shared_145 shared ; struct list_head anon_vma_chain ; struct anon_vma *anon_vma ; struct vm_operations_struct const *vm_ops ; unsigned long vm_pgoff ; struct file *vm_file ; void *vm_private_data ; struct mempolicy *vm_policy ; }; struct core_thread { struct task_struct *task ; struct core_thread *next ; }; struct core_state { atomic_t nr_threads ; struct core_thread dumper ; struct completion startup ; }; struct mm_rss_stat { atomic_long_t count[3U] ; }; struct linux_binfmt; struct mmu_notifier_mm; struct mm_struct { struct vm_area_struct *mmap ; struct rb_root mm_rb ; struct vm_area_struct *mmap_cache ; unsigned long (*get_unmapped_area)(struct file * , unsigned long , unsigned long , unsigned long , unsigned long ) ; void (*unmap_area)(struct mm_struct * , unsigned long ) ; unsigned long mmap_base ; unsigned long task_size ; unsigned long cached_hole_size ; unsigned long free_area_cache ; unsigned long highest_vm_end ; pgd_t *pgd ; atomic_t mm_users ; atomic_t mm_count ; int map_count ; spinlock_t page_table_lock ; struct rw_semaphore mmap_sem ; struct list_head mmlist ; unsigned long hiwater_rss ; unsigned long hiwater_vm ; unsigned long total_vm ; unsigned long locked_vm ; unsigned long pinned_vm ; unsigned long shared_vm ; unsigned long exec_vm ; unsigned long stack_vm ; unsigned long def_flags ; unsigned long nr_ptes ; unsigned long start_code ; unsigned long end_code ; unsigned long start_data ; unsigned long end_data ; unsigned long start_brk ; unsigned long brk ; unsigned long start_stack ; unsigned long arg_start ; unsigned long arg_end ; unsigned long env_start ; unsigned long env_end ; unsigned long saved_auxv[44U] ; struct mm_rss_stat rss_stat ; struct linux_binfmt *binfmt ; cpumask_var_t cpu_vm_mask_var ; mm_context_t context ; unsigned long flags ; struct core_state *core_state ; spinlock_t ioctx_lock ; struct hlist_head ioctx_list ; struct task_struct *owner ; struct file *exe_file ; struct mmu_notifier_mm *mmu_notifier_mm ; pgtable_t pmd_huge_pte ; struct cpumask cpumask_allocation ; unsigned long numa_next_scan ; unsigned long numa_next_reset ; unsigned long numa_scan_offset ; int numa_scan_seq ; int first_nid ; struct uprobes_state uprobes_state ; }; struct shrink_control { gfp_t gfp_mask ; unsigned long nr_to_scan ; }; struct shrinker { int (*shrink)(struct shrinker * , struct shrink_control * ) ; int seeks ; long batch ; struct list_head list ; atomic_long_t nr_in_batch ; }; struct file_ra_state; struct user_struct; struct writeback_control; struct vm_fault { unsigned int flags ; unsigned long pgoff ; void *virtual_address ; struct page *page ; }; struct vm_operations_struct { void (*open)(struct vm_area_struct * ) ; void (*close)(struct vm_area_struct * ) ; int (*fault)(struct vm_area_struct * , struct vm_fault * ) ; int (*page_mkwrite)(struct vm_area_struct * , struct vm_fault * ) ; int (*access)(struct vm_area_struct * , unsigned long , void * , int , int ) ; int (*set_policy)(struct vm_area_struct * , struct mempolicy * ) ; struct mempolicy *(*get_policy)(struct vm_area_struct * , unsigned long ) ; int (*migrate)(struct vm_area_struct * , nodemask_t const * , nodemask_t const * , unsigned long ) ; int (*remap_pages)(struct vm_area_struct * , unsigned long , unsigned long , unsigned long ) ; }; struct scatterlist { unsigned long sg_magic ; unsigned long page_link ; unsigned int offset ; unsigned int length ; dma_addr_t dma_address ; unsigned int dma_length ; }; struct sg_table { struct scatterlist *sgl ; unsigned int nents ; unsigned int orig_nents ; }; typedef s32 dma_cookie_t; 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 sem_undo_list; struct sysv_sem { struct sem_undo_list *undo_list ; }; 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 msghdr { void *msg_name ; int msg_namelen ; struct iovec *msg_iov ; __kernel_size_t msg_iovlen ; void *msg_control ; __kernel_size_t msg_controllen ; unsigned int msg_flags ; }; struct __anonstruct_sync_serial_settings_148 { unsigned int clock_rate ; unsigned int clock_type ; unsigned short loopback ; }; typedef struct __anonstruct_sync_serial_settings_148 sync_serial_settings; struct __anonstruct_te1_settings_149 { unsigned int clock_rate ; unsigned int clock_type ; unsigned short loopback ; unsigned int slot_map ; }; typedef struct __anonstruct_te1_settings_149 te1_settings; struct __anonstruct_raw_hdlc_proto_150 { unsigned short encoding ; unsigned short parity ; }; typedef struct __anonstruct_raw_hdlc_proto_150 raw_hdlc_proto; struct __anonstruct_fr_proto_151 { 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_151 fr_proto; struct __anonstruct_fr_proto_pvc_152 { unsigned int dlci ; }; typedef struct __anonstruct_fr_proto_pvc_152 fr_proto_pvc; struct __anonstruct_fr_proto_pvc_info_153 { unsigned int dlci ; char master[16U] ; }; typedef struct __anonstruct_fr_proto_pvc_info_153 fr_proto_pvc_info; struct __anonstruct_cisco_proto_154 { unsigned int interval ; unsigned int timeout ; }; typedef struct __anonstruct_cisco_proto_154 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_155 { 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_155 ifs_ifsu ; }; union __anonunion_ifr_ifrn_156 { char ifrn_name[16U] ; }; union __anonunion_ifr_ifru_157 { 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_156 ifr_ifrn ; union __anonunion_ifr_ifru_157 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 nameidata; struct path; struct vfsmount; struct __anonstruct_ldv_19335_160 { u32 hash ; u32 len ; }; union __anonunion_ldv_19337_159 { struct __anonstruct_ldv_19335_160 ldv_19335 ; u64 hash_len ; }; struct qstr { union __anonunion_ldv_19337_159 ldv_19337 ; unsigned char const *name ; }; struct dentry_operations; struct super_block; union __anonunion_d_u_161 { struct list_head d_child ; struct callback_head d_rcu ; }; struct dentry { unsigned int d_flags ; seqcount_t d_seq ; struct hlist_bl_node d_hash ; struct dentry *d_parent ; struct qstr d_name ; struct inode *d_inode ; unsigned char d_iname[32U] ; unsigned int d_count ; spinlock_t d_lock ; struct dentry_operations const *d_op ; struct super_block *d_sb ; unsigned long d_time ; void *d_fsdata ; struct list_head d_lru ; union __anonunion_d_u_161 d_u ; struct list_head d_subdirs ; struct hlist_node d_alias ; }; struct dentry_operations { int (*d_revalidate)(struct dentry * , unsigned int ) ; int (*d_hash)(struct dentry const * , struct inode const * , struct qstr * ) ; int (*d_compare)(struct dentry const * , struct inode const * , struct dentry const * , struct inode const * , unsigned int , char const * , struct qstr const * ) ; int (*d_delete)(struct dentry const * ) ; void (*d_release)(struct dentry * ) ; void (*d_prune)(struct dentry * ) ; void (*d_iput)(struct dentry * , struct inode * ) ; char *(*d_dname)(struct dentry * , char * , int ) ; struct vfsmount *(*d_automount)(struct path * ) ; int (*d_manage)(struct dentry * , bool ) ; }; struct path { struct vfsmount *mnt ; struct dentry *dentry ; }; struct radix_tree_node; struct radix_tree_root { unsigned int height ; gfp_t gfp_mask ; struct radix_tree_node *rnode ; }; enum pid_type { PIDTYPE_PID = 0, PIDTYPE_PGID = 1, PIDTYPE_SID = 2, PIDTYPE_MAX = 3 } ; struct pid_namespace; struct upid { int nr ; struct pid_namespace *ns ; struct hlist_node pid_chain ; }; struct pid { atomic_t count ; unsigned int level ; struct hlist_head tasks[3U] ; struct callback_head rcu ; struct upid numbers[1U] ; }; struct pid_link { struct hlist_node node ; struct pid *pid ; }; struct kernel_cap_struct { __u32 cap[2U] ; }; typedef struct kernel_cap_struct kernel_cap_t; struct semaphore { raw_spinlock_t lock ; unsigned int count ; struct list_head wait_list ; }; 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 io_context; struct cgroup_subsys_state; struct export_operations; struct kiocb; struct pipe_inode_info; struct poll_table_struct; struct kstatfs; struct swap_info_struct; struct iattr { unsigned int ia_valid ; umode_t ia_mode ; kuid_t ia_uid ; kgid_t ia_gid ; loff_t ia_size ; struct timespec ia_atime ; struct timespec ia_mtime ; struct timespec ia_ctime ; struct file *ia_file ; }; struct percpu_counter { raw_spinlock_t lock ; s64 count ; struct list_head list ; s32 *counters ; }; struct fs_disk_quota { __s8 d_version ; __s8 d_flags ; __u16 d_fieldmask ; __u32 d_id ; __u64 d_blk_hardlimit ; __u64 d_blk_softlimit ; __u64 d_ino_hardlimit ; __u64 d_ino_softlimit ; __u64 d_bcount ; __u64 d_icount ; __s32 d_itimer ; __s32 d_btimer ; __u16 d_iwarns ; __u16 d_bwarns ; __s32 d_padding2 ; __u64 d_rtb_hardlimit ; __u64 d_rtb_softlimit ; __u64 d_rtbcount ; __s32 d_rtbtimer ; __u16 d_rtbwarns ; __s16 d_padding3 ; char d_padding4[8U] ; }; struct fs_qfilestat { __u64 qfs_ino ; __u64 qfs_nblks ; __u32 qfs_nextents ; }; typedef struct fs_qfilestat fs_qfilestat_t; struct fs_quota_stat { __s8 qs_version ; __u16 qs_flags ; __s8 qs_pad ; fs_qfilestat_t qs_uquota ; fs_qfilestat_t qs_gquota ; __u32 qs_incoredqs ; __s32 qs_btimelimit ; __s32 qs_itimelimit ; __s32 qs_rtbtimelimit ; __u16 qs_bwarnlimit ; __u16 qs_iwarnlimit ; }; struct dquot; typedef __kernel_uid32_t projid_t; typedef projid_t kprojid_t; struct if_dqinfo { __u64 dqi_bgrace ; __u64 dqi_igrace ; __u32 dqi_flags ; __u32 dqi_valid ; }; enum quota_type { USRQUOTA = 0, GRPQUOTA = 1, PRJQUOTA = 2 } ; typedef long long qsize_t; union __anonunion_ldv_20340_163 { kuid_t uid ; kgid_t gid ; kprojid_t projid ; }; struct kqid { union __anonunion_ldv_20340_163 ldv_20340 ; enum quota_type type ; }; struct mem_dqblk { qsize_t dqb_bhardlimit ; qsize_t dqb_bsoftlimit ; qsize_t dqb_curspace ; qsize_t dqb_rsvspace ; qsize_t dqb_ihardlimit ; qsize_t dqb_isoftlimit ; qsize_t dqb_curinodes ; time_t dqb_btime ; time_t dqb_itime ; }; struct quota_format_type; struct mem_dqinfo { struct quota_format_type *dqi_format ; int dqi_fmt_id ; struct list_head dqi_dirty_list ; unsigned long dqi_flags ; unsigned int dqi_bgrace ; unsigned int dqi_igrace ; qsize_t dqi_maxblimit ; qsize_t dqi_maxilimit ; void *dqi_priv ; }; struct dquot { struct hlist_node dq_hash ; struct list_head dq_inuse ; struct list_head dq_free ; struct list_head dq_dirty ; struct mutex dq_lock ; atomic_t dq_count ; wait_queue_head_t dq_wait_unused ; struct super_block *dq_sb ; struct kqid dq_id ; loff_t dq_off ; unsigned long dq_flags ; struct mem_dqblk dq_dqb ; }; struct quota_format_ops { int (*check_quota_file)(struct super_block * , int ) ; int (*read_file_info)(struct super_block * , int ) ; int (*write_file_info)(struct super_block * , int ) ; int (*free_file_info)(struct super_block * , int ) ; int (*read_dqblk)(struct dquot * ) ; int (*commit_dqblk)(struct dquot * ) ; int (*release_dqblk)(struct dquot * ) ; }; struct dquot_operations { int (*write_dquot)(struct dquot * ) ; struct dquot *(*alloc_dquot)(struct super_block * , int ) ; void (*destroy_dquot)(struct dquot * ) ; int (*acquire_dquot)(struct dquot * ) ; int (*release_dquot)(struct dquot * ) ; int (*mark_dirty)(struct dquot * ) ; int (*write_info)(struct super_block * , int ) ; qsize_t *(*get_reserved_space)(struct inode * ) ; }; struct quotactl_ops { int (*quota_on)(struct super_block * , int , int , struct path * ) ; int (*quota_on_meta)(struct super_block * , int , int ) ; int (*quota_off)(struct super_block * , int ) ; int (*quota_sync)(struct super_block * , int ) ; int (*get_info)(struct super_block * , int , struct if_dqinfo * ) ; int (*set_info)(struct super_block * , int , struct if_dqinfo * ) ; int (*get_dqblk)(struct super_block * , struct kqid , struct fs_disk_quota * ) ; int (*set_dqblk)(struct super_block * , struct kqid , struct fs_disk_quota * ) ; int (*get_xstate)(struct super_block * , struct fs_quota_stat * ) ; int (*set_xstate)(struct super_block * , unsigned int , int ) ; }; struct quota_format_type { int qf_fmt_id ; struct quota_format_ops const *qf_ops ; struct module *qf_owner ; struct quota_format_type *qf_next ; }; struct quota_info { unsigned int flags ; struct mutex dqio_mutex ; struct mutex dqonoff_mutex ; struct rw_semaphore dqptr_sem ; struct inode *files[2U] ; struct mem_dqinfo info[2U] ; struct quota_format_ops const *ops[2U] ; }; union __anonunion_arg_165 { char *buf ; void *data ; }; struct __anonstruct_read_descriptor_t_164 { size_t written ; size_t count ; union __anonunion_arg_165 arg ; int error ; }; typedef struct __anonstruct_read_descriptor_t_164 read_descriptor_t; struct address_space_operations { int (*writepage)(struct page * , struct writeback_control * ) ; int (*readpage)(struct file * , struct page * ) ; int (*writepages)(struct address_space * , struct writeback_control * ) ; int (*set_page_dirty)(struct page * ) ; int (*readpages)(struct file * , struct address_space * , struct list_head * , unsigned int ) ; int (*write_begin)(struct file * , struct address_space * , loff_t , unsigned int , unsigned int , struct page ** , void ** ) ; int (*write_end)(struct file * , struct address_space * , loff_t , unsigned int , unsigned int , struct page * , void * ) ; sector_t (*bmap)(struct address_space * , sector_t ) ; void (*invalidatepage)(struct page * , unsigned long ) ; int (*releasepage)(struct page * , gfp_t ) ; void (*freepage)(struct page * ) ; ssize_t (*direct_IO)(int , struct kiocb * , struct iovec const * , loff_t , unsigned long ) ; int (*get_xip_mem)(struct address_space * , unsigned long , int , void ** , unsigned long * ) ; int (*migratepage)(struct address_space * , struct page * , struct page * , enum migrate_mode ) ; int (*launder_page)(struct page * ) ; int (*is_partially_uptodate)(struct page * , read_descriptor_t * , unsigned long ) ; int (*error_remove_page)(struct address_space * , struct page * ) ; int (*swap_activate)(struct swap_info_struct * , struct file * , sector_t * ) ; void (*swap_deactivate)(struct file * ) ; }; struct backing_dev_info; struct address_space { struct inode *host ; struct radix_tree_root page_tree ; spinlock_t tree_lock ; unsigned int i_mmap_writable ; struct rb_root i_mmap ; struct list_head i_mmap_nonlinear ; struct mutex i_mmap_mutex ; unsigned long nrpages ; unsigned long writeback_index ; struct address_space_operations const *a_ops ; unsigned long flags ; struct backing_dev_info *backing_dev_info ; spinlock_t private_lock ; struct list_head private_list ; 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_ldv_20774_166 { unsigned int const i_nlink ; unsigned int __i_nlink ; }; union __anonunion_ldv_20794_167 { struct hlist_head i_dentry ; struct callback_head i_rcu ; }; struct file_lock; struct cdev; union __anonunion_ldv_20810_168 { struct pipe_inode_info *i_pipe ; struct block_device *i_bdev ; struct cdev *i_cdev ; }; struct inode { umode_t i_mode ; unsigned short i_opflags ; kuid_t i_uid ; kgid_t i_gid ; unsigned int i_flags ; struct posix_acl *i_acl ; struct posix_acl *i_default_acl ; struct inode_operations const *i_op ; struct super_block *i_sb ; struct address_space *i_mapping ; void *i_security ; unsigned long i_ino ; union __anonunion_ldv_20774_166 ldv_20774 ; dev_t i_rdev ; loff_t i_size ; struct timespec i_atime ; struct timespec i_mtime ; struct timespec i_ctime ; spinlock_t i_lock ; unsigned short i_bytes ; unsigned int i_blkbits ; blkcnt_t i_blocks ; unsigned long i_state ; struct mutex i_mutex ; unsigned long dirtied_when ; struct hlist_node i_hash ; struct list_head i_wb_list ; struct list_head i_lru ; struct list_head i_sb_list ; union __anonunion_ldv_20794_167 ldv_20794 ; u64 i_version ; atomic_t i_count ; atomic_t i_dio_count ; atomic_t i_writecount ; struct file_operations const *i_fop ; struct file_lock *i_flock ; struct address_space i_data ; struct dquot *i_dquot[2U] ; struct list_head i_devices ; union __anonunion_ldv_20810_168 ldv_20810 ; __u32 i_generation ; __u32 i_fsnotify_mask ; struct hlist_head i_fsnotify_marks ; atomic_t i_readcount ; void *i_private ; }; struct fown_struct { rwlock_t lock ; struct pid *pid ; enum pid_type pid_type ; kuid_t uid ; kuid_t euid ; int signum ; }; struct file_ra_state { unsigned long start ; unsigned int size ; unsigned int async_size ; unsigned int ra_pages ; unsigned int mmap_miss ; loff_t prev_pos ; }; union __anonunion_f_u_169 { struct list_head fu_list ; struct callback_head fu_rcuhead ; }; struct file { union __anonunion_f_u_169 f_u ; struct path f_path ; struct file_operations const *f_op ; spinlock_t f_lock ; int f_sb_list_cpu ; atomic_long_t f_count ; unsigned int f_flags ; fmode_t f_mode ; loff_t f_pos ; struct fown_struct f_owner ; struct cred const *f_cred ; struct file_ra_state f_ra ; u64 f_version ; void *f_security ; void *private_data ; struct list_head f_ep_links ; struct list_head f_tfile_llink ; struct address_space *f_mapping ; unsigned long f_mnt_write_state ; }; struct files_struct; typedef struct files_struct *fl_owner_t; struct file_lock_operations { void (*fl_copy_lock)(struct file_lock * , struct file_lock * ) ; void (*fl_release_private)(struct file_lock * ) ; }; struct lock_manager_operations { int (*lm_compare_owner)(struct file_lock * , struct file_lock * ) ; void (*lm_notify)(struct file_lock * ) ; int (*lm_grant)(struct file_lock * , struct file_lock * , int ) ; void (*lm_break)(struct file_lock * ) ; int (*lm_change)(struct file_lock ** , int ) ; }; struct net; struct nlm_lockowner; struct nfs_lock_info { u32 state ; struct nlm_lockowner *owner ; struct list_head list ; }; struct nfs4_lock_state; struct nfs4_lock_info { struct nfs4_lock_state *owner ; }; struct fasync_struct; struct __anonstruct_afs_171 { struct list_head link ; int state ; }; union __anonunion_fl_u_170 { struct nfs_lock_info nfs_fl ; struct nfs4_lock_info nfs4_fl ; struct __anonstruct_afs_171 afs ; }; struct file_lock { struct file_lock *fl_next ; struct list_head fl_link ; struct list_head fl_block ; fl_owner_t fl_owner ; unsigned int fl_flags ; unsigned char fl_type ; unsigned int fl_pid ; struct pid *fl_nspid ; wait_queue_head_t fl_wait ; struct file *fl_file ; loff_t fl_start ; loff_t fl_end ; struct fasync_struct *fl_fasync ; unsigned long fl_break_time ; unsigned long fl_downgrade_time ; struct file_lock_operations const *fl_ops ; struct lock_manager_operations const *fl_lmops ; union __anonunion_fl_u_170 fl_u ; }; struct fasync_struct { spinlock_t fa_lock ; int magic ; int fa_fd ; struct fasync_struct *fa_next ; struct file *fa_file ; struct callback_head fa_rcu ; }; struct sb_writers { struct percpu_counter counter[3U] ; wait_queue_head_t wait ; int frozen ; wait_queue_head_t wait_unfrozen ; struct lockdep_map lock_map[3U] ; }; struct file_system_type; struct super_operations; struct xattr_handler; struct mtd_info; struct super_block { struct list_head s_list ; dev_t s_dev ; unsigned char s_blocksize_bits ; unsigned long s_blocksize ; loff_t s_maxbytes ; struct file_system_type *s_type ; struct super_operations const *s_op ; struct dquot_operations const *dq_op ; struct quotactl_ops const *s_qcop ; struct export_operations const *s_export_op ; unsigned long s_flags ; unsigned long s_magic ; struct dentry *s_root ; struct rw_semaphore s_umount ; int s_count ; atomic_t s_active ; void *s_security ; struct xattr_handler const **s_xattr ; struct list_head s_inodes ; struct hlist_bl_head s_anon ; struct list_head *s_files ; struct list_head s_mounts ; struct list_head s_dentry_lru ; int s_nr_dentry_unused ; spinlock_t s_inode_lru_lock ; struct list_head s_inode_lru ; int s_nr_inodes_unused ; struct block_device *s_bdev ; struct backing_dev_info *s_bdi ; struct mtd_info *s_mtd ; struct hlist_node s_instances ; struct quota_info s_dquot ; struct sb_writers s_writers ; char s_id[32U] ; u8 s_uuid[16U] ; void *s_fs_info ; unsigned int s_max_links ; fmode_t s_mode ; u32 s_time_gran ; struct mutex s_vfs_rename_mutex ; char *s_subtype ; char *s_options ; struct dentry_operations const *s_d_op ; int cleancache_poolid ; struct shrinker s_shrink ; atomic_long_t s_remove_count ; int s_readonly_remount ; }; struct fiemap_extent_info { unsigned int fi_flags ; unsigned int fi_extents_mapped ; unsigned int fi_extents_max ; struct fiemap_extent *fi_extents_start ; }; struct file_operations { struct module *owner ; loff_t (*llseek)(struct file * , loff_t , int ) ; ssize_t (*read)(struct file * , char * , size_t , loff_t * ) ; ssize_t (*write)(struct file * , char const * , size_t , loff_t * ) ; ssize_t (*aio_read)(struct kiocb * , struct iovec const * , unsigned long , loff_t ) ; ssize_t (*aio_write)(struct kiocb * , struct iovec const * , unsigned long , loff_t ) ; int (*readdir)(struct file * , void * , int (*)(void * , char const * , int , loff_t , u64 , unsigned int ) ) ; unsigned int (*poll)(struct file * , struct poll_table_struct * ) ; long (*unlocked_ioctl)(struct file * , unsigned int , unsigned long ) ; long (*compat_ioctl)(struct file * , unsigned int , unsigned long ) ; int (*mmap)(struct file * , struct vm_area_struct * ) ; int (*open)(struct inode * , struct file * ) ; int (*flush)(struct file * , fl_owner_t ) ; int (*release)(struct inode * , struct file * ) ; int (*fsync)(struct file * , loff_t , loff_t , int ) ; int (*aio_fsync)(struct kiocb * , int ) ; int (*fasync)(int , struct file * , int ) ; int (*lock)(struct file * , int , struct file_lock * ) ; ssize_t (*sendpage)(struct file * , struct page * , int , size_t , loff_t * , int ) ; unsigned long (*get_unmapped_area)(struct file * , unsigned long , unsigned long , unsigned long , unsigned long ) ; int (*check_flags)(int ) ; int (*flock)(struct file * , int , struct file_lock * ) ; ssize_t (*splice_write)(struct pipe_inode_info * , struct file * , loff_t * , size_t , unsigned int ) ; ssize_t (*splice_read)(struct file * , loff_t * , struct pipe_inode_info * , size_t , unsigned int ) ; int (*setlease)(struct file * , long , struct file_lock ** ) ; long (*fallocate)(struct file * , int , loff_t , loff_t ) ; int (*show_fdinfo)(struct seq_file * , struct file * ) ; }; struct inode_operations { struct dentry *(*lookup)(struct inode * , struct dentry * , unsigned int ) ; void *(*follow_link)(struct dentry * , struct nameidata * ) ; int (*permission)(struct inode * , int ) ; struct posix_acl *(*get_acl)(struct inode * , int ) ; int (*readlink)(struct dentry * , char * , int ) ; void (*put_link)(struct dentry * , struct nameidata * , void * ) ; int (*create)(struct inode * , struct dentry * , umode_t , bool ) ; int (*link)(struct dentry * , struct inode * , struct dentry * ) ; int (*unlink)(struct inode * , struct dentry * ) ; int (*symlink)(struct inode * , struct dentry * , char const * ) ; int (*mkdir)(struct inode * , struct dentry * , umode_t ) ; int (*rmdir)(struct inode * , struct dentry * ) ; int (*mknod)(struct inode * , struct dentry * , umode_t , dev_t ) ; int (*rename)(struct inode * , struct dentry * , struct inode * , struct dentry * ) ; int (*setattr)(struct dentry * , struct iattr * ) ; int (*getattr)(struct vfsmount * , struct dentry * , struct kstat * ) ; int (*setxattr)(struct dentry * , char const * , void const * , size_t , int ) ; ssize_t (*getxattr)(struct dentry * , char const * , void * , size_t ) ; ssize_t (*listxattr)(struct dentry * , char * , size_t ) ; int (*removexattr)(struct dentry * , char const * ) ; int (*fiemap)(struct inode * , struct fiemap_extent_info * , u64 , u64 ) ; int (*update_time)(struct inode * , struct timespec * , int ) ; int (*atomic_open)(struct inode * , struct dentry * , struct file * , unsigned int , umode_t , int * ) ; }; struct super_operations { struct inode *(*alloc_inode)(struct super_block * ) ; void (*destroy_inode)(struct inode * ) ; void (*dirty_inode)(struct inode * , int ) ; int (*write_inode)(struct inode * , struct writeback_control * ) ; int (*drop_inode)(struct inode * ) ; void (*evict_inode)(struct inode * ) ; void (*put_super)(struct super_block * ) ; int (*sync_fs)(struct super_block * , int ) ; int (*freeze_fs)(struct super_block * ) ; int (*unfreeze_fs)(struct super_block * ) ; int (*statfs)(struct dentry * , struct kstatfs * ) ; int (*remount_fs)(struct super_block * , int * , char * ) ; void (*umount_begin)(struct super_block * ) ; int (*show_options)(struct seq_file * , struct dentry * ) ; int (*show_devname)(struct seq_file * , struct dentry * ) ; int (*show_path)(struct seq_file * , struct dentry * ) ; int (*show_stats)(struct seq_file * , struct dentry * ) ; ssize_t (*quota_read)(struct super_block * , int , char * , size_t , loff_t ) ; ssize_t (*quota_write)(struct super_block * , int , char const * , size_t , loff_t ) ; int (*bdev_try_to_free_page)(struct super_block * , struct page * , gfp_t ) ; int (*nr_cached_objects)(struct super_block * ) ; void (*free_cached_objects)(struct super_block * , int ) ; }; struct file_system_type { char const *name ; int fs_flags ; struct dentry *(*mount)(struct file_system_type * , int , char const * , void * ) ; void (*kill_sb)(struct super_block * ) ; struct module *owner ; struct file_system_type *next ; struct hlist_head fs_supers ; struct lock_class_key s_lock_key ; struct lock_class_key s_umount_key ; struct lock_class_key s_vfs_rename_key ; struct lock_class_key s_writers_key[3U] ; struct lock_class_key i_lock_key ; struct lock_class_key i_mutex_key ; struct lock_class_key i_mutex_dir_key ; }; struct io_event { __u64 data ; __u64 obj ; __s64 res ; __s64 res2 ; }; typedef unsigned long cputime_t; struct __anonstruct_sigset_t_172 { unsigned long sig[1U] ; }; typedef struct __anonstruct_sigset_t_172 sigset_t; struct siginfo; typedef void __signalfn_t(int ); typedef __signalfn_t *__sighandler_t; typedef void __restorefn_t(void); typedef __restorefn_t *__sigrestore_t; struct sigaction { __sighandler_t sa_handler ; unsigned long sa_flags ; __sigrestore_t sa_restorer ; sigset_t sa_mask ; }; struct k_sigaction { struct sigaction sa ; }; union sigval { int sival_int ; void *sival_ptr ; }; typedef union sigval sigval_t; struct __anonstruct__kill_174 { __kernel_pid_t _pid ; __kernel_uid32_t _uid ; }; struct __anonstruct__timer_175 { __kernel_timer_t _tid ; int _overrun ; char _pad[0U] ; sigval_t _sigval ; int _sys_private ; }; struct __anonstruct__rt_176 { __kernel_pid_t _pid ; __kernel_uid32_t _uid ; sigval_t _sigval ; }; struct __anonstruct__sigchld_177 { __kernel_pid_t _pid ; __kernel_uid32_t _uid ; int _status ; __kernel_clock_t _utime ; __kernel_clock_t _stime ; }; struct __anonstruct__sigfault_178 { void *_addr ; short _addr_lsb ; }; struct __anonstruct__sigpoll_179 { long _band ; int _fd ; }; struct __anonstruct__sigsys_180 { void *_call_addr ; int _syscall ; unsigned int _arch ; }; union __anonunion__sifields_173 { int _pad[28U] ; struct __anonstruct__kill_174 _kill ; struct __anonstruct__timer_175 _timer ; struct __anonstruct__rt_176 _rt ; struct __anonstruct__sigchld_177 _sigchld ; struct __anonstruct__sigfault_178 _sigfault ; struct __anonstruct__sigpoll_179 _sigpoll ; struct __anonstruct__sigsys_180 _sigsys ; }; struct siginfo { int si_signo ; int si_errno ; int si_code ; union __anonunion__sifields_173 _sifields ; }; typedef struct siginfo siginfo_t; struct sigpending { struct list_head list ; sigset_t signal ; }; struct seccomp_filter; struct seccomp { int mode ; struct seccomp_filter *filter ; }; struct rt_mutex_waiter; struct rlimit { unsigned long rlim_cur ; unsigned long 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 resolution ; ktime_t (*get_time)(void) ; ktime_t softirq_time ; ktime_t offset ; }; struct hrtimer_cpu_base { raw_spinlock_t lock ; unsigned int active_bases ; unsigned int clock_was_set ; ktime_t expires_next ; int hres_active ; int hang_detected ; unsigned long nr_events ; unsigned long nr_retries ; unsigned long nr_hangs ; ktime_t max_hang_time ; struct hrtimer_clock_base clock_base[3U] ; }; struct task_io_accounting { u64 rchar ; u64 wchar ; u64 syscr ; u64 syscw ; u64 read_bytes ; u64 write_bytes ; u64 cancelled_write_bytes ; }; struct latency_record { unsigned long backtrace[12U] ; unsigned int count ; unsigned long time ; unsigned long max ; }; typedef int32_t key_serial_t; typedef uint32_t key_perm_t; struct key; struct signal_struct; struct key_type; struct keyring_list; union __anonunion_ldv_23624_183 { struct list_head graveyard_link ; struct rb_node serial_node ; }; struct key_user; union __anonunion_ldv_23633_184 { time_t expiry ; time_t revoked_at ; }; union __anonunion_type_data_185 { struct list_head link ; unsigned long x[2U] ; void *p[2U] ; int reject_error ; }; union __anonunion_payload_186 { unsigned long value ; void *rcudata ; void *data ; struct keyring_list *subscriptions ; }; struct key { atomic_t usage ; key_serial_t serial ; union __anonunion_ldv_23624_183 ldv_23624 ; struct key_type *type ; struct rw_semaphore sem ; struct key_user *user ; void *security ; union __anonunion_ldv_23633_184 ldv_23633 ; time_t last_used_at ; kuid_t uid ; kgid_t gid ; key_perm_t perm ; unsigned short quotalen ; unsigned short datalen ; unsigned long flags ; char *description ; union __anonunion_type_data_185 type_data ; union __anonunion_payload_186 payload ; }; struct audit_context; struct group_info { atomic_t usage ; int ngroups ; int nblocks ; kgid_t small_block[32U] ; kgid_t *blocks[0U] ; }; struct thread_group_cred; 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 ; struct thread_group_cred *tgcred ; void *security ; struct user_struct *user ; struct user_namespace *user_ns ; struct group_info *group_info ; struct callback_head rcu ; }; struct llist_node; struct llist_node { struct llist_node *next ; }; struct futex_pi_state; struct robust_list_head; struct bio_list; struct fs_struct; struct perf_event_context; struct blk_plug; struct cfs_rq; struct task_group; struct kioctx; union __anonunion_ki_obj_187 { void *user ; struct task_struct *tsk ; }; struct eventfd_ctx; struct kiocb { struct list_head ki_run_list ; unsigned long ki_flags ; int ki_users ; unsigned int ki_key ; struct file *ki_filp ; struct kioctx *ki_ctx ; int (*ki_cancel)(struct kiocb * , struct io_event * ) ; ssize_t (*ki_retry)(struct kiocb * ) ; void (*ki_dtor)(struct kiocb * ) ; union __anonunion_ki_obj_187 ki_obj ; __u64 ki_user_data ; loff_t ki_pos ; void *private ; unsigned short ki_opcode ; size_t ki_nbytes ; char *ki_buf ; size_t ki_left ; struct iovec ki_inline_vec ; struct iovec *ki_iovec ; unsigned long ki_nr_segs ; unsigned long ki_cur_seg ; struct list_head ki_list ; struct list_head ki_batch ; struct eventfd_ctx *ki_eventfd ; }; struct aio_ring_info { unsigned long mmap_base ; unsigned long mmap_size ; struct page **ring_pages ; spinlock_t ring_lock ; long nr_pages ; unsigned int nr ; unsigned int tail ; struct page *internal_pages[8U] ; }; struct kioctx { atomic_t users ; int dead ; struct mm_struct *mm ; unsigned long user_id ; struct hlist_node list ; wait_queue_head_t wait ; spinlock_t ctx_lock ; int reqs_active ; struct list_head active_reqs ; struct list_head run_list ; unsigned int max_reqs ; struct aio_ring_info ring_info ; struct delayed_work wq ; struct callback_head callback_head ; }; struct sighand_struct { atomic_t count ; struct k_sigaction action[64U] ; spinlock_t siglock ; wait_queue_head_t signalfd_wqh ; }; struct pacct_struct { int ac_flag ; long ac_exitcode ; unsigned long ac_mem ; cputime_t ac_utime ; cputime_t ac_stime ; unsigned long ac_minflt ; unsigned long ac_majflt ; }; struct cpu_itimer { cputime_t expires ; cputime_t incr ; u32 error ; u32 incr_error ; }; struct cputime { cputime_t utime ; cputime_t stime ; }; struct task_cputime { cputime_t utime ; cputime_t stime ; unsigned long long sum_exec_runtime ; }; struct thread_group_cputimer { struct task_cputime cputime ; int running ; raw_spinlock_t lock ; }; struct autogroup; struct tty_struct; struct taskstats; struct tty_audit_buf; struct signal_struct { atomic_t sigcnt ; atomic_t live ; int nr_threads ; wait_queue_head_t wait_chldexit ; struct task_struct *curr_target ; struct sigpending shared_pending ; int group_exit_code ; int notify_count ; struct task_struct *group_exit_task ; int group_stop_count ; unsigned int flags ; unsigned char is_child_subreaper : 1 ; unsigned char has_child_subreaper : 1 ; struct list_head posix_timers ; struct hrtimer real_timer ; struct pid *leader_pid ; ktime_t it_real_incr ; struct cpu_itimer it[2U] ; struct thread_group_cputimer cputimer ; struct task_cputime cputime_expires ; struct list_head cpu_timers[3U] ; struct pid *tty_old_pgrp ; int leader ; struct tty_struct *tty ; struct autogroup *autogroup ; cputime_t utime ; cputime_t stime ; cputime_t cutime ; cputime_t cstime ; cputime_t gtime ; cputime_t cgtime ; 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 ; struct tty_audit_buf *tty_audit_buf ; struct rw_semaphore group_rwsem ; 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 files ; atomic_t sigpending ; atomic_t inotify_watches ; atomic_t inotify_devs ; atomic_t fanotify_listeners ; atomic_long_t epoll_watches ; unsigned long mq_bytes ; unsigned long locked_shm ; struct key *uid_keyring ; struct key *session_keyring ; struct hlist_node uidhash_node ; kuid_t uid ; atomic_long_t locked_vm ; }; struct reclaim_state; struct sched_info { unsigned long pcount ; unsigned long long run_delay ; unsigned long long last_arrival ; unsigned long long last_queued ; }; struct task_delay_info { spinlock_t lock ; unsigned int flags ; struct timespec blkio_start ; struct timespec blkio_end ; u64 blkio_delay ; u64 swapin_delay ; u32 blkio_count ; u32 swapin_count ; struct timespec freepages_start ; struct timespec freepages_end ; u64 freepages_delay ; u32 freepages_count ; }; struct uts_namespace; struct rq; struct sched_class { struct sched_class const *next ; void (*enqueue_task)(struct rq * , struct task_struct * , int ) ; void (*dequeue_task)(struct rq * , struct task_struct * , int ) ; void (*yield_task)(struct rq * ) ; bool (*yield_to_task)(struct rq * , struct task_struct * , bool ) ; void (*check_preempt_curr)(struct rq * , struct task_struct * , int ) ; struct task_struct *(*pick_next_task)(struct rq * ) ; void (*put_prev_task)(struct rq * , struct task_struct * ) ; int (*select_task_rq)(struct task_struct * , int , int ) ; void (*migrate_task_rq)(struct task_struct * , int ) ; void (*pre_schedule)(struct rq * , struct task_struct * ) ; void (*post_schedule)(struct rq * ) ; void (*task_waking)(struct task_struct * ) ; void (*task_woken)(struct rq * , struct task_struct * ) ; void (*set_cpus_allowed)(struct task_struct * , struct cpumask const * ) ; void (*rq_online)(struct rq * ) ; void (*rq_offline)(struct rq * ) ; void (*set_curr_task)(struct rq * ) ; void (*task_tick)(struct rq * , struct task_struct * , int ) ; void (*task_fork)(struct task_struct * ) ; void (*switched_from)(struct rq * , struct task_struct * ) ; void (*switched_to)(struct rq * , struct task_struct * ) ; void (*prio_changed)(struct rq * , struct task_struct * , int ) ; unsigned int (*get_rr_interval)(struct rq * , struct task_struct * ) ; void (*task_move_group)(struct task_struct * , int ) ; }; struct load_weight { unsigned long weight ; unsigned long inv_weight ; }; struct sched_avg { u32 runnable_avg_sum ; u32 runnable_avg_period ; u64 last_runnable_update ; s64 decay_count ; unsigned long load_avg_contrib ; }; struct sched_statistics { u64 wait_start ; u64 wait_max ; u64 wait_count ; u64 wait_sum ; u64 iowait_count ; u64 iowait_sum ; u64 sleep_start ; u64 sleep_max ; s64 sum_sleep_runtime ; u64 block_start ; u64 block_max ; u64 exec_max ; u64 slice_max ; u64 nr_migrations_cold ; u64 nr_failed_migrations_affine ; u64 nr_failed_migrations_running ; u64 nr_failed_migrations_hot ; u64 nr_forced_migrations ; u64 nr_wakeups ; u64 nr_wakeups_sync ; u64 nr_wakeups_migrate ; u64 nr_wakeups_local ; u64 nr_wakeups_remote ; u64 nr_wakeups_affine ; u64 nr_wakeups_affine_attempts ; u64 nr_wakeups_passive ; u64 nr_wakeups_idle ; }; struct sched_entity { struct load_weight load ; struct rb_node run_node ; struct list_head group_node ; unsigned int on_rq ; u64 exec_start ; u64 sum_exec_runtime ; u64 vruntime ; u64 prev_sum_exec_runtime ; u64 nr_migrations ; struct sched_statistics statistics ; struct sched_entity *parent ; struct cfs_rq *cfs_rq ; struct cfs_rq *my_q ; struct sched_avg avg ; }; struct rt_rq; struct sched_rt_entity { struct list_head run_list ; unsigned long timeout ; unsigned int time_slice ; struct sched_rt_entity *back ; struct sched_rt_entity *parent ; struct rt_rq *rt_rq ; struct rt_rq *my_q ; }; struct mem_cgroup; struct memcg_batch_info { int do_batch ; struct mem_cgroup *memcg ; unsigned long nr_pages ; unsigned long memsw_nr_pages ; }; struct css_set; struct compat_robust_list_head; struct task_struct { long volatile state ; void *stack ; atomic_t usage ; unsigned int flags ; unsigned int ptrace ; struct llist_node wake_entry ; int on_cpu ; int on_rq ; int prio ; int static_prio ; int normal_prio ; unsigned int rt_priority ; struct sched_class const *sched_class ; struct sched_entity se ; struct sched_rt_entity rt ; struct task_group *sched_task_group ; struct hlist_head preempt_notifiers ; unsigned char fpu_counter ; unsigned int policy ; int nr_cpus_allowed ; cpumask_t cpus_allowed ; struct sched_info sched_info ; struct list_head tasks ; struct plist_node pushable_tasks ; struct mm_struct *mm ; struct mm_struct *active_mm ; unsigned char brk_randomized : 1 ; int exit_state ; int exit_code ; int exit_signal ; int pdeath_signal ; unsigned int jobctl ; unsigned int personality ; unsigned char did_exec : 1 ; unsigned char in_execve : 1 ; unsigned char in_iowait : 1 ; unsigned char no_new_privs : 1 ; unsigned char sched_reset_on_fork : 1 ; unsigned char sched_contributes_to_load : 1 ; pid_t pid ; pid_t tgid ; unsigned long stack_canary ; struct task_struct *real_parent ; struct task_struct *parent ; struct list_head children ; struct list_head sibling ; struct task_struct *group_leader ; struct list_head ptraced ; struct list_head ptrace_entry ; struct pid_link pids[3U] ; struct list_head thread_group ; struct completion *vfork_done ; int *set_child_tid ; int *clear_child_tid ; cputime_t utime ; cputime_t stime ; cputime_t utimescaled ; cputime_t stimescaled ; cputime_t gtime ; struct cputime prev_cputime ; unsigned long nvcsw ; unsigned long nivcsw ; struct timespec start_time ; struct timespec real_start_time ; unsigned long min_flt ; unsigned long maj_flt ; struct task_cputime cputime_expires ; struct list_head cpu_timers[3U] ; struct cred const *real_cred ; struct cred const *cred ; char comm[16U] ; int link_count ; int total_link_count ; struct sysv_sem sysvsem ; unsigned long last_switch_count ; struct thread_struct thread ; struct fs_struct *fs ; struct files_struct *files ; struct nsproxy *nsproxy ; struct signal_struct *signal ; struct sighand_struct *sighand ; sigset_t blocked ; sigset_t real_blocked ; sigset_t saved_sigmask ; struct sigpending pending ; unsigned long sas_ss_sp ; size_t sas_ss_size ; int (*notifier)(void * ) ; void *notifier_data ; sigset_t *notifier_mask ; struct callback_head *task_works ; struct audit_context *audit_context ; kuid_t loginuid ; unsigned int sessionid ; struct seccomp seccomp ; u32 parent_exec_id ; u32 self_exec_id ; spinlock_t alloc_lock ; raw_spinlock_t pi_lock ; struct plist_head pi_waiters ; struct rt_mutex_waiter *pi_blocked_on ; struct mutex_waiter *blocked_on ; unsigned int irq_events ; unsigned long hardirq_enable_ip ; unsigned long hardirq_disable_ip ; unsigned int hardirq_enable_event ; unsigned int hardirq_disable_event ; int hardirqs_enabled ; int hardirq_context ; unsigned long softirq_disable_ip ; unsigned long softirq_enable_ip ; unsigned int softirq_disable_event ; unsigned int softirq_enable_event ; int softirqs_enabled ; int softirq_context ; u64 curr_chain_key ; int lockdep_depth ; unsigned int lockdep_recursion ; struct held_lock held_locks[48U] ; gfp_t lockdep_reclaim_gfp ; void *journal_info ; struct bio_list *bio_list ; struct blk_plug *plug ; struct reclaim_state *reclaim_state ; struct backing_dev_info *backing_dev_info ; struct io_context *io_context ; unsigned long ptrace_message ; siginfo_t *last_siginfo ; struct task_io_accounting ioac ; u64 acct_rss_mem1 ; u64 acct_vm_mem1 ; cputime_t acct_timexpd ; nodemask_t mems_allowed ; seqcount_t mems_allowed_seq ; int cpuset_mem_spread_rotor ; int cpuset_slab_spread_rotor ; struct css_set *cgroups ; struct list_head cg_list ; struct robust_list_head *robust_list ; struct compat_robust_list_head *compat_robust_list ; struct list_head pi_state_list ; struct futex_pi_state *pi_state_cache ; struct perf_event_context *perf_event_ctxp[2U] ; struct mutex perf_event_mutex ; struct list_head perf_event_list ; struct mempolicy *mempolicy ; short il_next ; short pref_node_fork ; int numa_scan_seq ; int numa_migrate_seq ; unsigned int numa_scan_period ; u64 node_stamp ; struct callback_head numa_work ; struct callback_head rcu ; struct pipe_inode_info *splice_pipe ; struct page_frag task_frag ; struct task_delay_info *delays ; int make_it_fail ; int nr_dirtied ; int nr_dirtied_pause ; unsigned long dirty_paused_when ; int latency_record_count ; struct latency_record latency_record[32U] ; unsigned long timer_slack_ns ; unsigned long default_timer_slack_ns ; unsigned long trace ; unsigned long trace_recursion ; struct memcg_batch_info memcg_batch ; unsigned int memcg_kmem_skip_account ; atomic_t ptrace_bp_refcnt ; struct uprobe_task *utask ; }; 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 ; }; enum ldv_20879 { SS_FREE = 0, SS_UNCONNECTED = 1, SS_CONNECTING = 2, SS_CONNECTED = 3, SS_DISCONNECTING = 4 } ; typedef enum ldv_20879 socket_state; 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 kiocb * , struct socket * , struct msghdr * , size_t ) ; int (*recvmsg)(struct kiocb * , 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 ) ; void (*set_peek_off)(struct sock * , int ) ; }; struct __anonstruct_ldv_26914_204 { struct mem_cgroup *memcg ; struct list_head list ; struct kmem_cache *root_cache ; bool dead ; atomic_t nr_pages ; struct work_struct destroy ; }; union __anonunion_ldv_26915_203 { struct kmem_cache *memcg_caches[0U] ; struct __anonstruct_ldv_26914_204 ldv_26914 ; }; struct memcg_cache_params { bool is_root_cache ; union __anonunion_ldv_26915_203 ldv_26915 ; }; struct kmem_cache_cpu { void **freelist ; unsigned long tid ; struct page *page ; struct page *partial ; unsigned int stat[26U] ; }; struct kmem_cache_node { spinlock_t list_lock ; unsigned long nr_partial ; struct list_head partial ; atomic_long_t nr_slabs ; atomic_long_t total_objects ; struct list_head full ; }; struct kmem_cache_order_objects { unsigned long x ; }; struct kmem_cache { struct kmem_cache_cpu *cpu_slab ; unsigned long flags ; unsigned long min_partial ; int size ; int object_size ; int offset ; int cpu_partial ; struct kmem_cache_order_objects oo ; struct kmem_cache_order_objects max ; struct kmem_cache_order_objects min ; gfp_t allocflags ; int refcount ; void (*ctor)(void * ) ; int inuse ; int align ; int reserved ; char const *name ; struct list_head list ; struct kobject kobj ; struct memcg_cache_params *memcg_params ; int max_attr_size ; int remote_node_defrag_ratio ; struct kmem_cache_node *node[1024U] ; }; struct exception_table_entry { int insn ; int fixup ; }; struct sk_buff; struct dma_attrs { unsigned long flags[1U] ; }; enum dma_data_direction { DMA_BIDIRECTIONAL = 0, DMA_TO_DEVICE = 1, DMA_FROM_DEVICE = 2, DMA_NONE = 3 } ; struct dma_map_ops { void *(*alloc)(struct device * , size_t , dma_addr_t * , gfp_t , struct dma_attrs * ) ; void (*free)(struct device * , size_t , void * , dma_addr_t , struct dma_attrs * ) ; int (*mmap)(struct device * , struct vm_area_struct * , void * , dma_addr_t , size_t , struct dma_attrs * ) ; int (*get_sgtable)(struct device * , struct sg_table * , void * , dma_addr_t , size_t , struct dma_attrs * ) ; dma_addr_t (*map_page)(struct device * , struct page * , unsigned long , size_t , enum dma_data_direction , struct dma_attrs * ) ; void (*unmap_page)(struct device * , dma_addr_t , size_t , enum dma_data_direction , struct dma_attrs * ) ; int (*map_sg)(struct device * , struct scatterlist * , int , enum dma_data_direction , struct dma_attrs * ) ; void (*unmap_sg)(struct device * , struct scatterlist * , int , enum dma_data_direction , struct dma_attrs * ) ; void (*sync_single_for_cpu)(struct device * , dma_addr_t , size_t , enum dma_data_direction ) ; void (*sync_single_for_device)(struct device * , dma_addr_t , size_t , enum dma_data_direction ) ; void (*sync_sg_for_cpu)(struct device * , struct scatterlist * , int , enum dma_data_direction ) ; void (*sync_sg_for_device)(struct device * , struct scatterlist * , int , enum dma_data_direction ) ; int (*mapping_error)(struct device * , dma_addr_t ) ; int (*dma_supported)(struct device * , u64 ) ; int (*set_dma_mask)(struct device * , u64 ) ; int is_phys ; }; typedef u64 netdev_features_t; struct nf_conntrack { atomic_t use ; }; struct nf_bridge_info { atomic_t use ; unsigned int mask ; struct net_device *physindev ; struct net_device *physoutdev ; unsigned long data[4U] ; }; struct sk_buff_head { struct sk_buff *next ; struct sk_buff *prev ; __u32 qlen ; spinlock_t lock ; }; typedef unsigned int sk_buff_data_t; struct sec_path; struct __anonstruct_ldv_28285_207 { __u16 csum_start ; __u16 csum_offset ; }; union __anonunion_ldv_28286_206 { __wsum csum ; struct __anonstruct_ldv_28285_207 ldv_28285 ; }; union __anonunion_ldv_28325_208 { __u32 mark ; __u32 dropcount ; __u32 avail_size ; }; struct sk_buff { struct sk_buff *next ; struct sk_buff *prev ; ktime_t tstamp ; struct sock *sk ; struct net_device *dev ; char cb[48U] ; unsigned long _skb_refdst ; struct sec_path *sp ; unsigned int len ; unsigned int data_len ; __u16 mac_len ; __u16 hdr_len ; union __anonunion_ldv_28286_206 ldv_28286 ; __u32 priority ; unsigned char local_df : 1 ; unsigned char cloned : 1 ; unsigned char ip_summed : 2 ; unsigned char nohdr : 1 ; unsigned char nfctinfo : 3 ; unsigned char pkt_type : 3 ; unsigned char fclone : 2 ; unsigned char ipvs_property : 1 ; unsigned char peeked : 1 ; unsigned char nf_trace : 1 ; __be16 protocol ; void (*destructor)(struct sk_buff * ) ; struct nf_conntrack *nfct ; struct sk_buff *nfct_reasm ; struct nf_bridge_info *nf_bridge ; int skb_iif ; __u32 rxhash ; __u16 vlan_tci ; __u16 tc_index ; __u16 tc_verd ; __u16 queue_mapping ; unsigned char ndisc_nodetype : 2 ; unsigned char pfmemalloc : 1 ; unsigned char ooo_okay : 1 ; unsigned char l4_rxhash : 1 ; unsigned char wifi_acked_valid : 1 ; unsigned char wifi_acked : 1 ; unsigned char no_fcs : 1 ; unsigned char head_frag : 1 ; unsigned char encapsulation : 1 ; dma_cookie_t dma_cookie ; __u32 secmark ; union __anonunion_ldv_28325_208 ldv_28325 ; sk_buff_data_t inner_transport_header ; sk_buff_data_t inner_network_header ; sk_buff_data_t transport_header ; sk_buff_data_t network_header ; sk_buff_data_t mac_header ; sk_buff_data_t tail ; sk_buff_data_t end ; unsigned char *head ; unsigned char *data ; unsigned int truesize ; atomic_t users ; }; struct dst_entry; struct rtable; struct ethhdr { unsigned char h_dest[6U] ; unsigned char h_source[6U] ; __be16 h_proto ; }; 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 reserved1[32U] ; char reserved2[12U] ; __u32 n_priv_flags ; __u32 n_stats ; __u32 testinfo_len ; __u32 eedump_len ; __u32 regdump_len ; }; struct ethtool_wolinfo { __u32 cmd ; __u32 supported ; __u32 wolopts ; __u8 sopass[6U] ; }; struct ethtool_regs { __u32 cmd ; __u32 version ; __u32 len ; __u8 data[0U] ; }; struct ethtool_eeprom { __u32 cmd ; __u32 magic ; __u32 offset ; __u32 len ; __u8 data[0U] ; }; struct ethtool_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_indir_size)(struct net_device * ) ; int (*get_rxfh_indir)(struct net_device * , u32 * ) ; int (*set_rxfh_indir)(struct net_device * , u32 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 * ) ; }; struct prot_inuse; struct netns_core { struct ctl_table_header *sysctl_hdr ; int sysctl_somaxconn ; struct prot_inuse *inuse ; }; struct u64_stats_sync { }; struct ipstats_mib { u64 mibs[31U] ; struct u64_stats_sync syncp ; }; struct icmp_mib { unsigned long mibs[27U] ; }; struct icmpmsg_mib { atomic_long_t mibs[512U] ; }; struct icmpv6_mib { unsigned long mibs[5U] ; }; struct icmpv6msg_mib { atomic_long_t mibs[512U] ; }; struct tcp_mib { unsigned long mibs[15U] ; }; struct udp_mib { unsigned long mibs[7U] ; }; struct linux_mib { unsigned long mibs[92U] ; }; struct linux_xfrm_mib { unsigned long mibs[27U] ; }; struct proc_dir_entry; struct netns_mib { struct tcp_mib *tcp_statistics[1U] ; struct ipstats_mib *ip_statistics[1U] ; struct linux_mib *net_statistics[1U] ; struct udp_mib *udp_statistics[1U] ; struct udp_mib *udplite_statistics[1U] ; struct icmp_mib *icmp_statistics[1U] ; struct icmpmsg_mib *icmpmsg_statistics ; struct proc_dir_entry *proc_net_devsnmp6 ; struct udp_mib *udp_stats_in6[1U] ; struct udp_mib *udplite_stats_in6[1U] ; struct ipstats_mib *ipv6_statistics[1U] ; struct icmpv6_mib *icmpv6_statistics[1U] ; struct icmpv6msg_mib *icmpv6msg_statistics ; struct linux_xfrm_mib *xfrm_statistics[1U] ; }; 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 { int nqueues ; atomic_t mem ; struct list_head lru_list ; int timeout ; int high_thresh ; int low_thresh ; }; struct tcpm_hash_bucket; struct ipv4_devconf; struct fib_rules_ops; struct fib_table; 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 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 ; struct sock *fibnl ; struct sock **icmp_sk ; struct inet_peer_base *peers ; struct tcpm_hash_bucket *tcp_metrics_hash ; unsigned int tcp_metrics_hash_log ; 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 ; kgid_t sysctl_ping_group_range[2U] ; long sysctl_tcp_mem[3U] ; atomic_t dev_addr_genid ; struct list_head mr_tables ; struct fib_rules_ops *mr_rules_ops ; }; struct neighbour; struct dst_ops { unsigned short family ; __be16 protocol ; unsigned int gc_thresh ; int (*gc)(struct dst_ops * ) ; struct dst_entry *(*check)(struct dst_entry * , __u32 ) ; 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 ; int bindv6only ; int flush_delay ; int ip6_rt_max_size ; int ip6_rt_gc_min_interval ; int ip6_rt_gc_timeout ; int ip6_rt_gc_interval ; int ip6_rt_gc_elasticity ; int ip6_rt_mtu_expires ; int ip6_rt_min_advmss ; int icmpv6_time ; }; struct ipv6_devconf; struct rt6_info; struct rt6_statistics; struct fib6_table; struct netns_ipv6 { struct netns_sysctl_ipv6 sysctl ; struct ipv6_devconf *devconf_all ; struct ipv6_devconf *devconf_dflt ; struct 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 list_head mr6_tables ; struct fib_rules_ops *mr6_rules_ops ; }; struct netns_nf_frag { struct netns_sysctl_ipv6 sysctl ; struct netns_frags frags ; }; struct sctp_mib; struct netns_sctp { struct sctp_mib *sctp_statistics[1U] ; 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 ; }; typedef int read_proc_t(char * , char ** , off_t , int , int * , void * ); typedef int write_proc_t(struct file * , char const * , unsigned long , void * ); struct proc_dir_entry { unsigned int low_ino ; umode_t mode ; nlink_t nlink ; kuid_t uid ; kgid_t gid ; loff_t size ; struct inode_operations const *proc_iops ; struct file_operations const *proc_fops ; struct proc_dir_entry *next ; struct proc_dir_entry *parent ; struct proc_dir_entry *subdir ; void *data ; read_proc_t *read_proc ; write_proc_t *write_proc ; atomic_t count ; int pde_users ; struct completion *pde_unload_completion ; struct list_head pde_openers ; spinlock_t pde_unload_lock ; u8 namelen ; char name[] ; }; struct nlattr; struct ebt_table; struct netns_xt { struct list_head tables[13U] ; struct ebt_table *broute_table ; struct ebt_table *frame_filter ; struct ebt_table *frame_nat ; }; struct hlist_nulls_node; struct hlist_nulls_head { struct hlist_nulls_node *first ; }; struct hlist_nulls_node { struct hlist_nulls_node *next ; struct hlist_nulls_node **pprev ; }; struct 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 ip_conntrack_stat; struct nf_ct_event_notifier; struct nf_exp_event_notifier; struct netns_ct { atomic_t count ; unsigned int expect_count ; unsigned int htable_size ; struct kmem_cache *nf_conntrack_cachep ; struct hlist_nulls_head *hash ; struct hlist_head *expect_hash ; struct hlist_nulls_head unconfirmed ; struct hlist_nulls_head dying ; struct ip_conntrack_stat *stat ; struct nf_ct_event_notifier *nf_conntrack_event_cb ; struct nf_exp_event_notifier *nf_expect_event_cb ; int sysctl_events ; unsigned int sysctl_events_retry_timeout ; int sysctl_acct ; int sysctl_tstamp ; int sysctl_checksum ; unsigned int sysctl_log_invalid ; int sysctl_auto_assign_helper ; bool auto_assign_helper_warned ; struct nf_ip_net nf_ct_proto ; struct hlist_head *nat_bysource ; unsigned int nat_htable_size ; 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 ; }; struct xfrm_policy_hash { struct hlist_head *table ; unsigned int hmask ; }; struct netns_xfrm { struct list_head state_all ; struct hlist_head *state_bydst ; struct hlist_head *state_bysrc ; struct hlist_head *state_byspi ; unsigned int state_hmask ; unsigned int state_num ; struct work_struct state_hash_work ; struct hlist_head state_gc_list ; struct work_struct state_gc_work ; wait_queue_head_t km_waitq ; struct list_head policy_all ; struct hlist_head *policy_byidx ; unsigned int policy_idx_hmask ; struct hlist_head policy_inexact[6U] ; struct xfrm_policy_hash policy_bydst[6U] ; unsigned int policy_count[6U] ; struct work_struct policy_hash_work ; struct 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 ; }; struct net_generic; struct netns_ipvs; struct net { atomic_t passive ; atomic_t count ; spinlock_t rules_mod_lock ; struct list_head list ; struct list_head cleanup_list ; struct list_head exit_list ; struct user_namespace *user_ns ; unsigned int proc_inum ; 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 ; 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_sctp sctp ; struct netns_dccp dccp ; struct netns_xt xt ; struct netns_ct ct ; 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 sock *diag_nlsk ; atomic_t rt_genid ; }; struct seq_file { char *buf ; size_t size ; size_t from ; size_t count ; loff_t index ; loff_t read_pos ; u64 version ; struct mutex lock ; struct seq_operations const *op ; int poll_event ; void *private ; }; struct seq_operations { void *(*start)(struct seq_file * , loff_t * ) ; void (*stop)(struct seq_file * , void * ) ; void *(*next)(struct seq_file * , void * , loff_t * ) ; int (*show)(struct seq_file * , void * ) ; }; struct dsa_chip_data { struct device *mii_bus ; int sw_addr ; char *port_names[12U] ; s8 *rtable ; }; struct dsa_platform_data { struct device *netdev ; int nr_chips ; struct dsa_chip_data *chip ; }; struct dsa_switch; struct dsa_switch_tree { struct dsa_platform_data *pd ; struct net_device *master_netdev ; __be16 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 mii_bus; struct dsa_switch { struct dsa_switch_tree *dst ; int index ; struct dsa_chip_data *pd ; struct dsa_switch_driver *drv ; struct mii_bus *master_mii_bus ; u32 dsa_port_mask ; u32 phys_port_mask ; struct mii_bus *slave_mii_bus ; struct net_device *ports[12U] ; }; struct dsa_switch_driver { struct list_head list ; __be16 tag_protocol ; int priv_size ; char *(*probe)(struct mii_bus * , int ) ; int (*setup)(struct dsa_switch * ) ; int (*set_addr)(struct dsa_switch * , u8 * ) ; int (*phy_read)(struct dsa_switch * , int , int ) ; int (*phy_write)(struct dsa_switch * , int , int , u16 ) ; void (*poll_link)(struct dsa_switch * ) ; 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 * ) ; }; 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_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_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 ) ; u8 (*setapp)(struct net_device * , u8 , u16 , u8 ) ; u8 (*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 idr_layer { unsigned long bitmap ; struct idr_layer *ary[64U] ; int count ; int layer ; struct callback_head callback_head ; }; struct idr { struct idr_layer *top ; struct idr_layer *id_free ; int layers ; int id_free_cnt ; spinlock_t lock ; }; struct xattr_handler { char const *prefix ; int flags ; size_t (*list)(struct dentry * , char * , size_t , char const * , size_t , int ) ; int (*get)(struct dentry * , char const * , void * , size_t , int ) ; int (*set)(struct dentry * , char const * , void const * , size_t , int , int ) ; }; struct simple_xattrs { struct list_head head ; spinlock_t lock ; }; struct cgroupfs_root; struct cgroup_subsys; struct cgroup; struct css_id; struct cgroup_subsys_state { struct cgroup *cgroup ; atomic_t refcnt ; unsigned long flags ; struct css_id *id ; struct work_struct dput_work ; }; struct cgroup { unsigned long flags ; atomic_t count ; int id ; struct list_head sibling ; struct list_head children ; struct list_head files ; struct cgroup *parent ; struct dentry *dentry ; struct cgroup_subsys_state *subsys[12U] ; struct cgroupfs_root *root ; struct cgroup *top_cgroup ; struct list_head css_sets ; struct list_head allcg_node ; struct list_head cft_q_node ; struct list_head release_list ; struct list_head pidlists ; struct mutex pidlist_mutex ; struct callback_head callback_head ; struct list_head event_list ; spinlock_t event_list_lock ; struct simple_xattrs xattrs ; }; struct css_set { atomic_t refcount ; struct hlist_node hlist ; struct list_head tasks ; struct list_head cg_links ; struct cgroup_subsys_state *subsys[12U] ; struct callback_head callback_head ; }; struct cgroup_map_cb { int (*fill)(struct cgroup_map_cb * , char const * , u64 ) ; void *state ; }; struct cftype { char name[64U] ; int private ; umode_t mode ; size_t max_write_len ; unsigned int flags ; struct simple_xattrs xattrs ; int (*open)(struct inode * , struct file * ) ; ssize_t (*read)(struct cgroup * , struct cftype * , struct file * , char * , size_t , loff_t * ) ; u64 (*read_u64)(struct cgroup * , struct cftype * ) ; s64 (*read_s64)(struct cgroup * , struct cftype * ) ; int (*read_map)(struct cgroup * , struct cftype * , struct cgroup_map_cb * ) ; int (*read_seq_string)(struct cgroup * , struct cftype * , struct seq_file * ) ; ssize_t (*write)(struct cgroup * , struct cftype * , struct file * , char const * , size_t , loff_t * ) ; int (*write_u64)(struct cgroup * , struct cftype * , u64 ) ; int (*write_s64)(struct cgroup * , struct cftype * , s64 ) ; int (*write_string)(struct cgroup * , struct cftype * , char const * ) ; int (*trigger)(struct cgroup * , unsigned int ) ; int (*release)(struct inode * , struct file * ) ; int (*register_event)(struct cgroup * , struct cftype * , struct eventfd_ctx * , char const * ) ; void (*unregister_event)(struct cgroup * , struct cftype * , struct eventfd_ctx * ) ; }; struct cftype_set { struct list_head node ; struct cftype *cfts ; }; struct cgroup_taskset; struct cgroup_subsys { struct cgroup_subsys_state *(*css_alloc)(struct cgroup * ) ; int (*css_online)(struct cgroup * ) ; void (*css_offline)(struct cgroup * ) ; void (*css_free)(struct cgroup * ) ; int (*can_attach)(struct cgroup * , struct cgroup_taskset * ) ; void (*cancel_attach)(struct cgroup * , struct cgroup_taskset * ) ; void (*attach)(struct cgroup * , struct cgroup_taskset * ) ; void (*fork)(struct task_struct * ) ; void (*exit)(struct cgroup * , struct cgroup * , struct task_struct * ) ; void (*bind)(struct cgroup * ) ; int subsys_id ; int active ; int disabled ; int early_init ; bool use_id ; bool broken_hierarchy ; bool warned_broken_hierarchy ; char const *name ; struct cgroupfs_root *root ; struct list_head sibling ; struct idr idr ; spinlock_t id_lock ; struct list_head cftsets ; struct cftype *base_cftypes ; struct cftype_set base_cftset ; struct module *module ; }; struct netprio_map { struct callback_head rcu ; u32 priomap_len ; u32 priomap[] ; }; struct xfrm_policy; struct xfrm_state; struct request_sock; 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 ; 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_info { __u32 vf ; __u8 mac[32U] ; __u32 vlan ; __u32 qos ; __u32 tx_rate ; __u32 spoofchk ; }; struct netpoll_info; struct phy_device; struct wireless_dev; enum netdev_tx { __NETDEV_TX_MIN = (-0x7FFFFFFF-1), NETDEV_TX_OK = 0, NETDEV_TX_BUSY = 16, NETDEV_TX_LOCKED = 32 } ; typedef enum netdev_tx netdev_tx_t; struct net_device_stats { unsigned long rx_packets ; unsigned long tx_packets ; unsigned long rx_bytes ; unsigned long tx_bytes ; unsigned long rx_errors ; unsigned long tx_errors ; unsigned long rx_dropped ; unsigned long tx_dropped ; unsigned long multicast ; unsigned long collisions ; unsigned long rx_length_errors ; unsigned long rx_over_errors ; unsigned long rx_crc_errors ; unsigned long rx_frame_errors ; unsigned long rx_fifo_errors ; unsigned long rx_missed_errors ; unsigned long tx_aborted_errors ; unsigned long tx_carrier_errors ; unsigned long tx_fifo_errors ; unsigned long tx_heartbeat_errors ; unsigned long tx_window_errors ; unsigned long rx_compressed ; unsigned long tx_compressed ; }; struct 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 (*rebuild)(struct sk_buff * ) ; int (*cache)(struct neighbour const * , struct hh_cache * , __be16 ) ; void (*cache_update)(struct hh_cache * , struct net_device const * , unsigned char const * ) ; }; 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 ; }; 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 work_struct free_work ; struct rps_dev_flow flows[0U] ; }; struct netdev_rx_queue { struct rps_map *rps_map ; struct rps_dev_flow_table *rps_flow_table ; struct kobject kobj ; struct 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 net_device_ops { int (*ndo_init)(struct net_device * ) ; void (*ndo_uninit)(struct net_device * ) ; int (*ndo_open)(struct net_device * ) ; int (*ndo_stop)(struct net_device * ) ; netdev_tx_t (*ndo_start_xmit)(struct sk_buff * , struct net_device * ) ; u16 (*ndo_select_queue)(struct net_device * , struct sk_buff * ) ; void (*ndo_change_rx_flags)(struct net_device * , int ) ; void (*ndo_set_rx_mode)(struct net_device * ) ; 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 * , unsigned short ) ; int (*ndo_vlan_rx_kill_vid)(struct net_device * , unsigned short ) ; void (*ndo_poll_controller)(struct net_device * ) ; int (*ndo_netpoll_setup)(struct net_device * , struct netpoll_info * , gfp_t ) ; void (*ndo_netpoll_cleanup)(struct net_device * ) ; int (*ndo_set_vf_mac)(struct net_device * , int , u8 * ) ; int (*ndo_set_vf_vlan)(struct net_device * , int , u16 , u8 ) ; int (*ndo_set_vf_tx_rate)(struct net_device * , int , int ) ; int (*ndo_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_port)(struct net_device * , int , struct nlattr ** ) ; int (*ndo_get_vf_port)(struct net_device * , int , struct sk_buff * ) ; 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 ) ; int (*ndo_fdb_del)(struct ndmsg * , struct net_device * , unsigned char const * ) ; int (*ndo_fdb_dump)(struct sk_buff * , struct netlink_callback * , struct net_device * , int ) ; int (*ndo_bridge_setlink)(struct net_device * , struct nlmsghdr * ) ; int (*ndo_bridge_getlink)(struct sk_buff * , u32 , u32 , struct net_device * ) ; }; struct iw_handler_def; struct iw_public_data; struct vlan_info; struct in_device; struct dn_dev; struct inet6_dev; struct cpu_rmap; struct pcpu_lstats; struct pcpu_tstats; struct pcpu_dstats; union __anonunion_ldv_36581_221 { void *ml_priv ; struct pcpu_lstats *lstats ; struct pcpu_tstats *tstats ; struct pcpu_dstats *dstats ; }; struct garp_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 ; unsigned int irq ; unsigned long state ; struct list_head dev_list ; struct list_head napi_list ; struct list_head unreg_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 ; int ifindex ; int iflink ; struct net_device_stats stats ; atomic_long_t rx_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 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 char neigh_priv_len ; unsigned short dev_id ; spinlock_t addr_list_lock ; struct netdev_hw_addr_list uc ; struct netdev_hw_addr_list mc ; bool uc_promisc ; unsigned int promiscuity ; unsigned int allmulti ; struct vlan_info *vlan_info ; struct dsa_switch_tree *dsa_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 ; unsigned long last_rx ; struct net_device *master ; unsigned char *dev_addr ; struct netdev_hw_addr_list dev_addrs ; unsigned char broadcast[32U] ; struct kset *queues_kset ; struct netdev_rx_queue *_rx ; unsigned int num_rx_queues ; unsigned int real_num_rx_queues ; struct cpu_rmap *rx_cpu_rmap ; rx_handler_func_t *rx_handler ; void *rx_handler_data ; struct netdev_queue *ingress_queue ; 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 ; struct xps_dev_maps *xps_maps ; unsigned long trans_start ; int watchdog_timeo ; struct timer_list watchdog_timer ; int *pcpu_refcnt ; struct list_head todo_list ; struct hlist_node index_hlist ; 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 ; struct net *nd_net ; union __anonunion_ldv_36581_221 ldv_36581 ; struct garp_port *garp_port ; struct device dev ; struct attribute_group const *sysfs_groups[4U] ; struct rtnl_link_ops const *rtnl_link_ops ; unsigned int gso_max_size ; u16 gso_max_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 ; int group ; struct pm_qos_request pm_qos_req ; }; struct res_counter { unsigned long long usage ; unsigned long long max_usage ; unsigned long long limit ; unsigned long long soft_limit ; unsigned long long failcnt ; spinlock_t lock ; struct res_counter *parent ; }; struct sock_filter { __u16 code ; __u8 jt ; __u8 jf ; __u32 k ; }; struct sk_filter { atomic_t refcnt ; unsigned int len ; unsigned int (*bpf_func)(struct sk_buff const * , struct sock_filter const * ) ; struct callback_head rcu ; struct sock_filter insns[0U] ; }; 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) ; }; struct neigh_table; struct neigh_parms { struct net *net ; struct net_device *dev ; struct neigh_parms *next ; 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 base_reachable_time ; int retrans_time ; int gc_staletime ; int reachable_time ; int delay_probe_time ; int queue_len_bytes ; int ucast_probes ; int app_probes ; int mcast_probes ; int anycast_delay ; int proxy_delay ; int proxy_qlen ; int locktime ; }; 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 ; struct net *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 { struct neigh_table *next ; int family ; int entry_size ; int key_len ; __u32 (*hash)(void const * , struct net_device const * , __u32 * ) ; 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 ; 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 ; }; union __anonunion_ldv_40716_226 { unsigned long expires ; struct dst_entry *from ; }; struct dn_route; union __anonunion_ldv_40741_227 { 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 ; union __anonunion_ldv_40716_226 ldv_40716 ; struct dst_entry *path ; void *__pad0 ; struct xfrm_state *xfrm ; int (*input)(struct sk_buff * ) ; int (*output)(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_ldv_40741_227 ldv_40741 ; }; struct __anonstruct_socket_lock_t_228 { spinlock_t slock ; int owned ; wait_queue_head_t wq ; struct lockdep_map dep_map ; }; typedef struct __anonstruct_socket_lock_t_228 socket_lock_t; struct proto; typedef __u32 __portpair; typedef __u64 __addrpair; struct __anonstruct_ldv_40958_230 { __be32 skc_daddr ; __be32 skc_rcv_saddr ; }; union __anonunion_ldv_40959_229 { __addrpair skc_addrpair ; struct __anonstruct_ldv_40958_230 ldv_40958 ; }; union __anonunion_ldv_40963_231 { unsigned int skc_hash ; __u16 skc_u16hashes[2U] ; }; struct __anonstruct_ldv_40969_233 { __be16 skc_dport ; __u16 skc_num ; }; union __anonunion_ldv_40970_232 { __portpair skc_portpair ; struct __anonstruct_ldv_40969_233 ldv_40969 ; }; union __anonunion_ldv_40978_234 { struct hlist_node skc_bind_node ; struct hlist_nulls_node skc_portaddr_node ; }; union __anonunion_ldv_40985_235 { struct hlist_node skc_node ; struct hlist_nulls_node skc_nulls_node ; }; struct sock_common { union __anonunion_ldv_40959_229 ldv_40959 ; union __anonunion_ldv_40963_231 ldv_40963 ; union __anonunion_ldv_40970_232 ldv_40970 ; unsigned short skc_family ; unsigned char volatile skc_state ; unsigned char skc_reuse ; int skc_bound_dev_if ; union __anonunion_ldv_40978_234 ldv_40978 ; struct proto *skc_prot ; struct net *skc_net ; int skc_dontcopy_begin[0U] ; union __anonunion_ldv_40985_235 ldv_40985 ; int skc_tx_queue_mapping ; atomic_t skc_refcnt ; int skc_dontcopy_end[0U] ; }; struct cg_proto; struct __anonstruct_sk_backlog_236 { 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_236 sk_backlog ; int sk_forward_alloc ; __u32 sk_rxhash ; atomic_t sk_drops ; int sk_rcvbuf ; struct sk_filter *sk_filter ; struct socket_wq *sk_wq ; struct sk_buff_head sk_async_wait_queue ; 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 : 2 ; unsigned char sk_userlocks : 4 ; unsigned char sk_protocol ; unsigned short sk_type ; int sk_wmem_queued ; gfp_t sk_allocation ; 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 ; unsigned short sk_ack_backlog ; unsigned short 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 ; void *sk_protinfo ; struct timer_list sk_timer ; ktime_t sk_stamp ; 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 * , int ) ; 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_237 { 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 kiocb * , struct sock * , struct msghdr * , size_t ) ; int (*recvmsg)(struct kiocb * , 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 (*mtu_reduced)(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 ; 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_237 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 { void (*enter_memory_pressure)(struct sock * ) ; struct res_counter *memory_allocated ; struct percpu_counter *sockets_allocated ; int *memory_pressure ; long *sysctl_mem ; unsigned long flags ; struct mem_cgroup *memcg ; }; struct request_values { }; struct request_sock_ops { int family ; int obj_size ; struct kmem_cache *slab ; char *slab_name ; int (*rtx_syn_ack)(struct sock * , struct request_sock * , struct request_values * ) ; void (*send_ack)(struct sock * , struct sk_buff * , struct request_sock * ) ; void (*send_reset)(struct sock * , struct sk_buff * ) ; void (*destructor)(struct request_sock * ) ; void (*syn_ack_timeout)(struct sock * , struct request_sock * ) ; }; struct request_sock { struct request_sock *dl_next ; u16 mss ; u8 num_retrans ; unsigned char cookie_ts : 1 ; unsigned char num_timeout : 7 ; u32 window_clamp ; u32 rcv_wnd ; u32 ts_recent ; unsigned long expires ; struct request_sock_ops const *rsk_ops ; struct sock *sk ; u32 secid ; u32 peer_secid ; }; struct timewait_sock_ops { struct kmem_cache *twsk_slab ; char *twsk_slab_name ; unsigned int twsk_obj_size ; int (*twsk_unique)(struct sock * , struct sock * , void * ) ; void (*twsk_destructor)(struct sock * ) ; }; typedef unsigned long kernel_ulong_t; struct acpi_device_id { __u8 id[16U] ; kernel_ulong_t driver_data ; }; struct of_device_id { char name[32U] ; char type[32U] ; char compatible[128U] ; void const *data ; }; 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 ; }; struct usb_host_interface { struct usb_interface_descriptor desc ; int extralen ; unsigned char *extra ; struct usb_host_endpoint *endpoint ; char *string ; }; enum usb_interface_condition { USB_INTERFACE_UNBOUND = 0, USB_INTERFACE_BINDING = 1, USB_INTERFACE_BOUND = 2, USB_INTERFACE_UNBINDING = 3 } ; struct usb_interface { struct usb_host_interface *altsetting ; struct usb_host_interface *cur_altsetting ; unsigned int num_altsetting ; struct usb_interface_assoc_descriptor *intf_assoc ; int minor ; enum usb_interface_condition condition ; unsigned char sysfs_files_created : 1 ; unsigned char ep_devs_created : 1 ; unsigned char unregistering : 1 ; unsigned char needs_remote_wakeup : 1 ; unsigned char needs_altsetting0 : 1 ; unsigned char needs_binding : 1 ; unsigned char reset_running : 1 ; unsigned char resetting_device : 1 ; struct device dev ; struct device *usb_dev ; atomic_t pm_usage_cnt ; struct work_struct reset_ws ; }; struct usb_interface_cache { unsigned int num_altsetting ; struct kref ref ; struct usb_host_interface altsetting[0U] ; }; struct usb_host_config { struct usb_config_descriptor desc ; char *string ; struct usb_interface_assoc_descriptor *intf_assoc[16U] ; struct usb_interface *interface[32U] ; struct usb_interface_cache *intf_cache[32U] ; unsigned char *extra ; int extralen ; }; struct usb_host_bos { struct usb_bos_descriptor *desc ; struct usb_ext_cap_descriptor *ext_cap ; struct usb_ss_cap_descriptor *ss_cap ; struct usb_ss_container_id_descriptor *ss_id ; }; struct usb_devmap { unsigned long devicemap[2U] ; }; struct mon_bus; struct usb_bus { struct device *controller ; int busnum ; char const *bus_name ; u8 uses_dma ; u8 uses_pio_for_control ; u8 otg_port ; unsigned char is_b_host : 1 ; unsigned char b_hnp_enable : 1 ; unsigned char no_stop_on_short : 1 ; unsigned int sg_tablesize ; int devnum_next ; struct usb_devmap devmap ; struct usb_device *root_hub ; struct usb_bus *hs_companion ; struct list_head bus_list ; int bandwidth_allocated ; int bandwidth_int_reqs ; int bandwidth_isoc_reqs ; struct mon_bus *mon_bus ; int monitored ; }; struct usb_tt; enum usb_device_removable { USB_DEVICE_REMOVABLE_UNKNOWN = 0, USB_DEVICE_REMOVABLE = 1, USB_DEVICE_FIXED = 2 } ; struct usb3_lpm_parameters { unsigned int mel ; unsigned int pel ; unsigned int sel ; int timeout ; }; struct usb_device { int devnum ; char devpath[16U] ; u32 route ; enum usb_device_state state ; enum usb_device_speed speed ; struct usb_tt *tt ; int ttport ; unsigned int toggle[2U] ; struct usb_device *parent ; struct usb_bus *bus ; struct usb_host_endpoint ep0 ; struct device dev ; struct usb_device_descriptor descriptor ; struct usb_host_bos *bos ; struct usb_host_config *config ; struct usb_host_config *actconfig ; struct usb_host_endpoint *ep_in[16U] ; struct usb_host_endpoint *ep_out[16U] ; char **rawdescriptors ; unsigned short bus_mA ; u8 portnum ; u8 level ; unsigned char can_submit : 1 ; unsigned char persist_enabled : 1 ; unsigned char have_langid : 1 ; unsigned char authorized : 1 ; unsigned char authenticated : 1 ; unsigned char wusb : 1 ; unsigned char lpm_capable : 1 ; unsigned char usb2_hw_lpm_capable : 1 ; unsigned char usb2_hw_lpm_enabled : 1 ; unsigned char usb3_lpm_enabled : 1 ; int string_langid ; char *product ; char *manufacturer ; char *serial ; struct list_head filelist ; int maxchild ; u32 quirks ; atomic_t urbnum ; unsigned long active_duration ; unsigned long connect_time ; unsigned char do_remote_wakeup : 1 ; unsigned char reset_resume : 1 ; unsigned char port_is_suspended : 1 ; struct wusb_dev *wusb_dev ; int slot_id ; enum usb_device_removable removable ; struct usb3_lpm_parameters u1_params ; struct usb3_lpm_parameters u2_params ; unsigned int lpm_disable_count ; }; struct usb_iso_packet_descriptor { unsigned int offset ; unsigned int length ; unsigned int actual_length ; int status ; }; struct urb; struct usb_anchor { struct list_head urb_list ; wait_queue_head_t wait ; spinlock_t lock ; unsigned char poisoned : 1 ; }; struct 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 ipv6_devconf { __s32 forwarding ; __s32 hop_limit ; __s32 mtu6 ; __s32 accept_ra ; __s32 accept_redirects ; __s32 autoconf ; __s32 dad_transmits ; __s32 rtr_solicits ; __s32 rtr_solicit_interval ; __s32 rtr_solicit_delay ; __s32 force_mld_version ; __s32 use_tempaddr ; __s32 temp_valid_lft ; __s32 temp_prefered_lft ; __s32 regen_max_retry ; __s32 max_desync_factor ; __s32 max_addresses ; __s32 accept_ra_defrtr ; __s32 accept_ra_pinfo ; __s32 accept_ra_rtr_pref ; __s32 rtr_probe_interval ; __s32 accept_ra_rt_info_max_plen ; __s32 proxy_ndp ; __s32 accept_source_route ; __s32 optimistic_dad ; __s32 mc_forwarding ; __s32 disable_ipv6 ; __s32 accept_dad ; __s32 force_tllao ; __s32 ndisc_notify ; void *sysctl ; }; typedef char BOOLEAN; typedef char CHAR; typedef int INT; typedef long LONG; typedef unsigned char UCHAR; typedef unsigned char B_UINT8; typedef unsigned short USHORT; typedef unsigned short B_UINT16; typedef unsigned int UINT; typedef unsigned int B_UINT32; typedef unsigned long ULONG; typedef char *PCHAR; typedef void *PVOID; typedef unsigned char *PUCHAR; typedef unsigned long long LARGE_INTEGER; typedef unsigned int UINT32; enum eNVM_TYPE { NVM_AUTODETECT = 0, NVM_EEPROM = 1, NVM_FLASH = 2, NVM_UNKNOWN = 3 } ; typedef enum eNVM_TYPE NVM_TYPE; struct bcm_mibs_parameters { u32 wmanIfSfid ; u32 wmanIfCmnCpsSfState ; u32 wmanIfCmnCpsMaxSustainedRate ; u32 wmanIfCmnCpsMaxTrafficBurst ; u32 wmanIfCmnCpsMinReservedRate ; u32 wmanIfCmnCpsToleratedJitter ; u32 wmanIfCmnCpsMaxLatency ; u32 wmanIfCmnCpsFixedVsVariableSduInd ; u32 wmanIfCmnCpsSduSize ; u32 wmanIfCmnCpsSfSchedulingType ; u32 wmanIfCmnCpsArqEnable ; u32 wmanIfCmnCpsArqWindowSize ; u32 wmanIfCmnCpsArqBlockLifetime ; u32 wmanIfCmnCpsArqSyncLossTimeout ; u32 wmanIfCmnCpsArqDeliverInOrder ; u32 wmanIfCmnCpsArqRxPurgeTimeout ; u32 wmanIfCmnCpsArqBlockSize ; u32 wmanIfCmnCpsMinRsvdTolerableRate ; u32 wmanIfCmnCpsReqTxPolicy ; u32 wmanIfCmnSfCsSpecification ; u32 wmanIfCmnCpsTargetSaid ; }; struct bcm_mibs_dropped_cntrl_msg { unsigned long cm_responses ; unsigned long cm_control_newdsx_multiclassifier_resp ; unsigned long link_control_resp ; unsigned long status_rsp ; unsigned long stats_pointer_resp ; unsigned long idle_mode_status ; unsigned long auth_ss_host_msg ; unsigned long low_priority_message ; }; struct _S_PHS_RULE { B_UINT8 u8PHSI ; B_UINT8 u8PHSFLength ; B_UINT8 u8PHSF[255U] ; B_UINT8 u8PHSMLength ; B_UINT8 u8PHSM[255U] ; B_UINT8 u8PHSS ; B_UINT8 u8PHSV ; B_UINT8 u8RefCnt ; B_UINT8 bUnclassifiedPHSRule ; B_UINT8 u8Reserved[3U] ; LONG PHSModifiedBytes ; ULONG PHSModifiedNumPackets ; ULONG PHSErrorNumPackets ; }; typedef struct _S_PHS_RULE S_PHS_RULE; struct _S_CLASSIFIER_ENTRY { B_UINT8 bUsed ; B_UINT16 uiClassifierRuleId ; B_UINT8 u8PHSI ; S_PHS_RULE *pstPhsRule ; B_UINT8 bUnclassifiedPHSRule ; }; typedef struct _S_CLASSIFIER_ENTRY S_CLASSIFIER_ENTRY; struct _S_CLASSIFIER_TABLE { B_UINT16 uiTotalClassifiers ; S_CLASSIFIER_ENTRY stActivePhsRulesList[20U] ; S_CLASSIFIER_ENTRY stOldPhsRulesList[20U] ; B_UINT16 uiOldestPhsRuleIndex ; }; typedef struct _S_CLASSIFIER_TABLE S_CLASSIFIER_TABLE; struct _S_SERVICEFLOW_ENTRY { B_UINT8 bUsed ; B_UINT16 uiVcid ; S_CLASSIFIER_TABLE *pstClassifierTable ; }; typedef struct _S_SERVICEFLOW_ENTRY S_SERVICEFLOW_ENTRY; struct _S_SERVICEFLOW_TABLE { B_UINT16 uiTotalServiceFlows ; S_SERVICEFLOW_ENTRY stSFList[17U] ; }; typedef struct _S_SERVICEFLOW_TABLE S_SERVICEFLOW_TABLE; struct _PHS_DEVICE_EXTENSION { S_SERVICEFLOW_TABLE *pstServiceFlowPhsRulesTable ; void *CompressedTxBuffer ; void *UnCompressedRxBuffer ; }; typedef struct _PHS_DEVICE_EXTENSION PHS_DEVICE_EXTENSION; enum LedEvents { SHUTDOWN_EXIT = 0, DRIVER_INIT = 1, FW_DOWNLOAD = 2, FW_DOWNLOAD_DONE = 4, NO_NETWORK_ENTRY = 8, NORMAL_OPERATION = 16, LOWPOWER_MODE_ENTER = 32, IDLEMODE_CONTINUE = 64, IDLEMODE_EXIT = 128, LED_THREAD_INACTIVE = 256, LED_THREAD_ACTIVE = 512, DRIVER_HALT = 255 } ; typedef enum LedEvents LedEventInfo_t; struct LedStateInfo_t { UCHAR LED_Type ; UCHAR LED_On_State ; UCHAR LED_Blink_State ; UCHAR GPIO_Num ; UCHAR BitPolarity ; }; typedef struct LedStateInfo_t LEDStateInfo; struct _LED_INFO_STRUCT { LEDStateInfo LEDState[4U] ; BOOLEAN bIdleMode_tx_from_host ; BOOLEAN bIdle_led_off ; wait_queue_head_t notify_led_event ; wait_queue_head_t idleModeSyncEvent ; struct task_struct *led_cntrl_threadid ; int led_thread_running ; BOOLEAN bLedInitDone ; }; typedef struct _LED_INFO_STRUCT LED_INFO_STRUCT; enum bcm_flash2x_section_val { NO_SECTION_VAL = 0, ISO_IMAGE1 = 1, ISO_IMAGE2 = 2, DSD0 = 3, DSD1 = 4, DSD2 = 5, VSA0 = 6, VSA1 = 7, VSA2 = 8, SCSI = 9, CONTROL_SECTION = 10, ISO_IMAGE1_PART2 = 11, ISO_IMAGE1_PART3 = 12, ISO_IMAGE2_PART2 = 13, ISO_IMAGE2_PART3 = 14, TOTAL_SECTIONS = 15 } ; struct _FLASH_CS_INFO { B_UINT32 MagicNumber ; B_UINT32 FlashLayoutVersion ; B_UINT32 ISOImageVersion ; B_UINT32 SCSIFirmwareVersion ; B_UINT32 OffsetFromZeroForPart1ISOImage ; B_UINT32 OffsetFromZeroForScsiFirmware ; B_UINT32 SizeOfScsiFirmware ; B_UINT32 OffsetFromZeroForPart2ISOImage ; B_UINT32 OffsetFromZeroForCalibrationStart ; B_UINT32 OffsetFromZeroForCalibrationEnd ; B_UINT32 OffsetFromZeroForVSAStart ; B_UINT32 OffsetFromZeroForVSAEnd ; B_UINT32 OffsetFromZeroForControlSectionStart ; B_UINT32 OffsetFromZeroForControlSectionData ; B_UINT32 CDLessInactivityTimeout ; B_UINT32 NewImageSignature ; B_UINT32 FlashSectorSizeSig ; B_UINT32 FlashSectorSize ; B_UINT32 FlashWriteSupportSize ; B_UINT32 TotalFlashSize ; B_UINT32 FlashBaseAddr ; B_UINT32 FlashPartMaxSize ; B_UINT32 IsCDLessDeviceBootSig ; B_UINT32 MassStorageTimeout ; }; typedef struct _FLASH_CS_INFO *PFLASH_CS_INFO; struct _FLASH_2X_CS_INFO { B_UINT32 MagicNumber ; B_UINT32 FlashLayoutVersion ; B_UINT32 ISOImageVersion ; B_UINT32 SCSIFirmwareVersion ; B_UINT32 OffsetFromZeroForPart1ISOImage ; B_UINT32 OffsetFromZeroForScsiFirmware ; B_UINT32 SizeOfScsiFirmware ; B_UINT32 OffsetFromZeroForPart2ISOImage ; B_UINT32 OffsetFromZeroForDSDStart ; B_UINT32 OffsetFromZeroForDSDEnd ; B_UINT32 OffsetFromZeroForVSAStart ; B_UINT32 OffsetFromZeroForVSAEnd ; B_UINT32 OffsetFromZeroForControlSectionStart ; B_UINT32 OffsetFromZeroForControlSectionData ; B_UINT32 CDLessInactivityTimeout ; B_UINT32 NewImageSignature ; B_UINT32 FlashSectorSizeSig ; B_UINT32 FlashSectorSize ; B_UINT32 FlashWriteSupportSize ; B_UINT32 TotalFlashSize ; B_UINT32 FlashBaseAddr ; B_UINT32 FlashPartMaxSize ; B_UINT32 IsCDLessDeviceBootSig ; B_UINT32 MassStorageTimeout ; B_UINT32 OffsetISOImage1Part1Start ; B_UINT32 OffsetISOImage1Part1End ; B_UINT32 OffsetISOImage1Part2Start ; B_UINT32 OffsetISOImage1Part2End ; B_UINT32 OffsetISOImage1Part3Start ; B_UINT32 OffsetISOImage1Part3End ; B_UINT32 OffsetISOImage2Part1Start ; B_UINT32 OffsetISOImage2Part1End ; B_UINT32 OffsetISOImage2Part2Start ; B_UINT32 OffsetISOImage2Part2End ; B_UINT32 OffsetISOImage2Part3Start ; B_UINT32 OffsetISOImage2Part3End ; B_UINT32 OffsetFromDSDStartForDSDHeader ; B_UINT32 OffsetFromZeroForDSD1Start ; B_UINT32 OffsetFromZeroForDSD1End ; B_UINT32 OffsetFromZeroForDSD2Start ; B_UINT32 OffsetFromZeroForDSD2End ; B_UINT32 OffsetFromZeroForVSA1Start ; B_UINT32 OffsetFromZeroForVSA1End ; B_UINT32 OffsetFromZeroForVSA2Start ; B_UINT32 OffsetFromZeroForVSA2End ; B_UINT32 SectorAccessBitMap[64U] ; }; typedef struct _FLASH_2X_CS_INFO *PFLASH2X_CS_INFO; struct _VENDOR_SECTION_INFO { B_UINT32 OffsetFromZeroForSectionStart ; B_UINT32 OffsetFromZeroForSectionEnd ; B_UINT32 AccessFlags ; B_UINT32 Reserved[16U] ; }; typedef struct _VENDOR_SECTION_INFO VENDOR_SECTION_INFO; struct _FLASH2X_VENDORSPECIFIC_INFO { VENDOR_SECTION_INFO VendorSection[15U] ; B_UINT32 Reserved[16U] ; }; typedef struct _FLASH2X_VENDORSPECIFIC_INFO *PFLASH2X_VENDORSPECIFIC_INFO; struct _TARGET_PARAMS { B_UINT32 m_u32CfgVersion ; B_UINT32 m_u32CenterFrequency ; B_UINT32 m_u32BandAScan ; B_UINT32 m_u32BandBScan ; B_UINT32 m_u32BandCScan ; B_UINT32 m_u32ErtpsOptions ; B_UINT32 m_u32PHSEnable ; B_UINT32 m_u32HoEnable ; B_UINT32 m_u32HoReserved1 ; B_UINT32 m_u32HoReserved2 ; B_UINT32 m_u32MimoEnable ; B_UINT32 m_u32SecurityEnable ; B_UINT32 m_u32PowerSavingModesEnable ; B_UINT32 m_u32PowerSavingModeOptions ; B_UINT32 m_u32ArqEnable ; B_UINT32 m_u32HarqEnable ; B_UINT32 m_u32EEPROMFlag ; B_UINT32 m_u32Customize ; B_UINT32 m_u32ConfigBW ; B_UINT32 m_u32ShutDownInitThresholdTimer ; B_UINT32 m_u32RadioParameter ; B_UINT32 m_u32PhyParameter1 ; B_UINT32 m_u32PhyParameter2 ; B_UINT32 m_u32PhyParameter3 ; B_UINT32 m_u32TestOptions ; B_UINT32 m_u32MaxMACDataperDLFrame ; B_UINT32 m_u32MaxMACDataperULFrame ; B_UINT32 m_u32Corr2MacFlags ; B_UINT32 HostDrvrConfig1 ; B_UINT32 HostDrvrConfig2 ; B_UINT32 HostDrvrConfig3 ; B_UINT32 HostDrvrConfig4 ; B_UINT32 HostDrvrConfig5 ; B_UINT32 HostDrvrConfig6 ; B_UINT32 m_u32SegmentedPUSCenable ; B_UINT32 m_u32BandAMCEnable ; }; typedef struct _TARGET_PARAMS *PSTARGETPARAMS; struct _S_BCM_DEBUG_STATE { UINT type ; UINT subtype[9U] ; UINT debug_level ; }; typedef struct _S_BCM_DEBUG_STATE S_BCM_DEBUG_STATE; struct __anonstruct_ldv_45842_255 { ULONG ulIpv4Addr[4U] ; ULONG ulIpv4Mask[4U] ; }; struct __anonstruct_ldv_45846_256 { ULONG ulIpv6Addr[16U] ; ULONG ulIpv6Mask[16U] ; }; struct __anonstruct_ldv_45850_257 { UCHAR ucIpv4Address[16U] ; UCHAR ucIpv4Mask[16U] ; }; struct __anonstruct_ldv_45854_258 { UCHAR ucIpv6Address[64U] ; UCHAR ucIpv6Mask[64U] ; }; union _U_IP_ADDRESS { struct __anonstruct_ldv_45842_255 ldv_45842 ; struct __anonstruct_ldv_45846_256 ldv_45846 ; struct __anonstruct_ldv_45850_257 ldv_45850 ; struct __anonstruct_ldv_45854_258 ldv_45854 ; }; typedef union _U_IP_ADDRESS U_IP_ADDRESS; struct bcm_hdr_suppression_contextinfo { UCHAR ucaHdrSuppressionInBuf[255U] ; UCHAR ucaHdrSuppressionOutBuf[256U] ; }; struct bcm_classifier_rule { ULONG ulSFID ; UCHAR ucReserved[2U] ; B_UINT16 uiClassifierRuleIndex ; BOOLEAN bUsed ; USHORT usVCID_Value ; B_UINT8 u8ClassifierRulePriority ; U_IP_ADDRESS stSrcIpAddress ; UCHAR ucIPSourceAddressLength ; U_IP_ADDRESS stDestIpAddress ; UCHAR ucIPDestinationAddressLength ; UCHAR ucIPTypeOfServiceLength ; UCHAR ucTosLow ; UCHAR ucTosHigh ; UCHAR ucTosMask ; UCHAR ucProtocolLength ; UCHAR ucProtocol[32U] ; USHORT usSrcPortRangeLo[4U] ; USHORT usSrcPortRangeHi[4U] ; UCHAR ucSrcPortRangeLength ; USHORT usDestPortRangeLo[4U] ; USHORT usDestPortRangeHi[4U] ; UCHAR ucDestPortRangeLength ; BOOLEAN bProtocolValid ; BOOLEAN bTOSValid ; BOOLEAN bDestIpValid ; BOOLEAN bSrcIpValid ; UCHAR ucDirection ; BOOLEAN bIpv6Protocol ; UINT32 u32PHSRuleID ; S_PHS_RULE sPhsRule ; UCHAR u8AssociatedPHSI ; UCHAR ucEthCSSrcMACLen ; UCHAR au8EThCSSrcMAC[6U] ; UCHAR au8EThCSSrcMACMask[6U] ; UCHAR ucEthCSDestMACLen ; UCHAR au8EThCSDestMAC[6U] ; UCHAR au8EThCSDestMACMask[6U] ; UCHAR ucEtherTypeLen ; UCHAR au8EthCSEtherType[3U] ; UCHAR usUserPriority[2U] ; USHORT usVLANID ; USHORT usValidityBitMap ; }; struct bcm_fragmented_packet_info { BOOLEAN bUsed ; ULONG ulSrcIpAddress ; USHORT usIpIdentification ; struct bcm_classifier_rule *pstMatchedClassifierEntry ; BOOLEAN bOutOfOrderFragment ; }; struct __anonstruct_ldv_45945_260 { struct sk_buff *FirstTxQueue ; struct sk_buff *LastTxQueue ; }; struct __anonstruct_ldv_45949_261 { struct sk_buff *ControlHead ; struct sk_buff *ControlTail ; }; union __anonunion_ldv_45950_259 { struct __anonstruct_ldv_45945_260 ldv_45945 ; struct __anonstruct_ldv_45949_261 ldv_45949 ; }; struct bcm_packet_info { ULONG ulSFID ; USHORT usVCID_Value ; UINT uiThreshold ; B_UINT8 u8TrafficPriority ; BOOLEAN bValid ; BOOLEAN bActive ; BOOLEAN bActivateRequestSent ; B_UINT8 u8QueueType ; UINT uiMaxBucketSize ; UINT uiCurrentQueueDepthOnTarget ; UINT uiCurrentBytesOnHost ; UINT uiCurrentPacketsOnHost ; UINT uiDroppedCountBytes ; UINT uiDroppedCountPackets ; UINT uiSentBytes ; UINT uiSentPackets ; UINT uiCurrentDrainRate ; UINT uiThisPeriodSentBytes ; LARGE_INTEGER liDrainCalculated ; UINT uiCurrentTokenCount ; LARGE_INTEGER liLastUpdateTokenAt ; UINT uiMaxAllowedRate ; UINT NumOfPacketsSent ; UCHAR ucDirection ; USHORT usCID ; struct bcm_mibs_parameters stMibsExtServiceFlowTable ; UINT uiCurrentRxRate ; UINT uiThisPeriodRxBytes ; UINT uiTotalRxBytes ; UINT uiTotalTxBytes ; UINT uiPendedLast ; UCHAR ucIpVersion ; union __anonunion_ldv_45950_259 ldv_45950 ; BOOLEAN bProtocolValid ; BOOLEAN bTOSValid ; BOOLEAN bDestIpValid ; BOOLEAN bSrcIpValid ; BOOLEAN bActiveSet ; BOOLEAN bAdmittedSet ; BOOLEAN bAuthorizedSet ; BOOLEAN bClassifierPriority ; UCHAR ucServiceClassName[32U] ; BOOLEAN bHeaderSuppressionEnabled ; spinlock_t SFQueueLock ; void *pstSFIndication ; struct timeval stLastUpdateTokenAt ; atomic_t uiPerSFTxResourceCount ; UINT uiMaxLatency ; UCHAR bIPCSSupport ; UCHAR bEthCSSupport ; }; struct bcm_mini_adapter; struct bcm_tarang_data { struct bcm_tarang_data *next ; struct bcm_mini_adapter *Adapter ; struct sk_buff *RxAppControlHead ; struct sk_buff *RxAppControlTail ; int AppCtrlQueueLen ; BOOLEAN MacTracingEnabled ; BOOLEAN bApplicationToExit ; struct bcm_mibs_dropped_cntrl_msg stDroppedAppCntrlMsgs ; ULONG RxCntrlMsgBitMask ; }; struct bcm_targetdsx_buffer { ULONG ulTargetDsxBuffer ; B_UINT16 tid ; BOOLEAN valid ; }; struct bcm_mini_adapter { struct bcm_mini_adapter *next ; struct net_device *dev ; u32 msg_enable ; CHAR *caDsxReqResp ; atomic_t ApplicationRunning ; BOOLEAN AppCtrlQueueOverFlow ; atomic_t CurrentApplicationCount ; atomic_t RegisteredApplicationCount ; BOOLEAN LinkUpStatus ; BOOLEAN TimerActive ; u32 StatisticsPointer ; struct sk_buff *RxControlHead ; struct sk_buff *RxControlTail ; struct semaphore RxAppControlQueuelock ; struct semaphore fw_download_sema ; struct bcm_tarang_data *pTarangs ; spinlock_t control_queue_lock ; wait_queue_head_t process_read_wait_queue ; atomic_t TotalPacketCount ; atomic_t TxPktAvail ; atomic_t CurrNumFreeTxDesc ; USHORT PrevNumRecvDescs ; USHORT CurrNumRecvDescs ; UINT u32TotalDSD ; struct bcm_packet_info PackInfo[17U] ; struct bcm_classifier_rule astClassifierTable[100U] ; BOOLEAN TransferMode ; BOOLEAN bETHCSEnabled ; ULONG BEBucketSize ; ULONG rtPSBucketSize ; UCHAR LinkStatus ; BOOLEAN AutoLinkUp ; BOOLEAN AutoSyncup ; int major ; int minor ; wait_queue_head_t tx_packet_wait_queue ; wait_queue_head_t process_rx_cntrlpkt ; atomic_t process_waiting ; BOOLEAN fw_download_done ; char *txctlpacket[100U] ; atomic_t cntrlpktCnt ; atomic_t index_app_read_cntrlpkt ; atomic_t index_wr_txcntrlpkt ; atomic_t index_rd_txcntrlpkt ; UINT index_datpkt ; struct semaphore rdmwrmsync ; struct bcm_targetdsx_buffer astTargetDsxBuffer[24U] ; ULONG ulFreeTargetBufferCnt ; ULONG ulCurrentTargetBuffer ; ULONG ulTotalTargetBuffersAvailable ; unsigned long chip_id ; wait_queue_head_t lowpower_mode_wait_queue ; BOOLEAN bFlashBoot ; BOOLEAN bBinDownloaded ; BOOLEAN bCfgDownloaded ; BOOLEAN bSyncUpRequestSent ; USHORT usBestEffortQueueIndex ; wait_queue_head_t ioctl_fw_dnld_wait_queue ; BOOLEAN waiting_to_fw_download_done ; pid_t fw_download_process_pid ; PSTARGETPARAMS pstargetparams ; BOOLEAN device_removed ; BOOLEAN DeviceAccess ; BOOLEAN bIsAutoCorrectEnabled ; BOOLEAN bDDRInitDone ; int DDRSetting ; ULONG ulPowerSaveMode ; spinlock_t txtransmitlock ; B_UINT8 txtransmit_running ; struct task_struct *control_packet_handler ; struct task_struct *transmit_packet_thread ; LED_INFO_STRUCT LEDInfo ; LedEventInfo_t DriverState ; PVOID pvInterfaceAdapter ; int (*bcm_file_download)(PVOID , struct file * , unsigned int ) ; int (*bcm_file_readback_from_chip)(PVOID , struct file * , unsigned int ) ; int (*interface_rdm)(PVOID , UINT , PVOID , int ) ; int (*interface_wrm)(PVOID , UINT , PVOID , int ) ; int (*interface_transmit)(PVOID , PVOID , UINT ) ; BOOLEAN IdleMode ; BOOLEAN bDregRequestSentInIdleMode ; BOOLEAN bTriedToWakeUpFromlowPowerMode ; BOOLEAN bShutStatus ; BOOLEAN bWakeUpDevice ; unsigned int usIdleModePattern ; BOOLEAN bLinkDownRequested ; int downloadDDR ; PHS_DEVICE_EXTENSION stBCMPhsContext ; struct bcm_hdr_suppression_contextinfo stPhsTxContextInfo ; uint8_t ucaPHSPktRestoreBuf[2048U] ; uint8_t bPHSEnabled ; BOOLEAN AutoFirmDld ; BOOLEAN bMipsConfig ; BOOLEAN bDPLLConfig ; UINT32 aTxPktSizeHist[12U] ; UINT32 aRxPktSizeHist[12U] ; struct bcm_fragmented_packet_info astFragmentedPktClassifierTable[256U] ; atomic_t uiMBupdate ; UINT32 PmuMode ; NVM_TYPE eNVMType ; UINT uiSectorSize ; UINT uiSectorSizeInCFG ; BOOLEAN bSectorSizeOverride ; BOOLEAN bStatusWrite ; UINT uiNVMDSDSize ; UINT uiVendorExtnFlag ; UINT ulFlashCalStart ; ULONG ulFlashControlSectionStart ; ULONG ulFlashWriteSize ; ULONG ulFlashID ; int (*fpFlashWrite)(struct bcm_mini_adapter * , UINT , PVOID ) ; int (*fpFlashWriteWithStatusCheck)(struct bcm_mini_adapter * , UINT , PVOID ) ; struct semaphore NVMRdmWrmLock ; struct device *pstCreatedClassDevice ; PFLASH2X_CS_INFO psFlash2xCSInfo ; PFLASH_CS_INFO psFlashCSInfo ; PFLASH2X_VENDORSPECIFIC_INFO psFlash2xVendorInfo ; UINT uiFlashBaseAdd ; UINT uiActiveISOOffset ; enum bcm_flash2x_section_val eActiveISO ; enum bcm_flash2x_section_val eActiveDSD ; UINT uiActiveDSDOffsetAtFwDld ; UINT uiFlashLayoutMajorVersion ; UINT uiFlashLayoutMinorVersion ; BOOLEAN bAllDSDWriteAllow ; BOOLEAN bSigCorrupted ; BOOLEAN bHeaderChangeAllowed ; int SelectedChip ; BOOLEAN bEndPointHalted ; BOOLEAN bFlashRawRead ; BOOLEAN bPreparingForLowPowerMode ; BOOLEAN bDoSuspend ; UINT syscfgBefFwDld ; BOOLEAN StopAllXaction ; UINT32 liTimeSinceLastNetEntry ; struct semaphore LowPowerModeSync ; ULONG liDrainCalculated ; UINT gpioBitMap ; S_BCM_DEBUG_STATE stDebugState ; }; struct bcm_firmware_info { void *pvMappedFirmwareAddress ; ULONG u32FirmwareLength ; ULONG u32StartingAddress ; }; struct bcm_bulk_endpoint_in { char *bulk_in_buffer ; size_t bulk_in_size ; unsigned char bulk_in_endpointAddr ; unsigned int bulk_in_pipe ; }; struct bcm_bulk_endpoint_out { unsigned char bulk_out_buffer ; size_t bulk_out_size ; unsigned char bulk_out_endpointAddr ; unsigned int bulk_out_pipe ; unsigned char int_out_interval ; }; struct bcm_intr_endpoint_in { char *int_in_buffer ; size_t int_in_size ; unsigned char int_in_endpointAddr ; unsigned char int_in_interval ; unsigned int int_in_pipe ; }; struct bcm_intr_endpoint_out { char *int_out_buffer ; size_t int_out_size ; unsigned char int_out_endpointAddr ; unsigned char int_out_interval ; unsigned int int_out_pipe ; }; struct bcm_usb_tcb { struct urb *urb ; void *psIntfAdapter ; bool bUsed ; }; struct bcm_usb_rcb { struct urb *urb ; void *psIntfAdapter ; bool bUsed ; }; struct bcm_interface_adapter { struct usb_device *udev ; struct usb_interface *interface ; struct bcm_bulk_endpoint_in sBulkIn ; struct bcm_bulk_endpoint_out sBulkOut ; struct bcm_intr_endpoint_in sIntrIn ; struct bcm_intr_endpoint_out sIntrOut ; unsigned long ulInterruptData[2U] ; struct urb *psInterruptUrb ; struct bcm_usb_tcb asUsbTcb[128U] ; struct bcm_usb_rcb asUsbRcb[128U] ; atomic_t uNumTcbUsed ; atomic_t uCurrTcb ; atomic_t uNumRcbUsed ; atomic_t uCurrRcb ; struct bcm_mini_adapter *psAdapter ; bool bFlashBoot ; bool bHighSpeedDevice ; bool bSuspended ; bool bPreparingForBusSuspend ; struct work_struct usbSuspendWork ; }; typedef int ldv_func_ret_type___2; enum hrtimer_restart; typedef void VOID; typedef unsigned int *PUINT; struct __wait_queue; typedef struct __wait_queue wait_queue_t; struct __wait_queue { unsigned int flags ; void *private ; int (*func)(wait_queue_t * , unsigned int , int , void * ) ; struct list_head task_list ; }; enum hrtimer_restart; struct usb_device_id { __u16 match_flags ; __u16 idVendor ; __u16 idProduct ; __u16 bcdDevice_lo ; __u16 bcdDevice_hi ; __u8 bDeviceClass ; __u8 bDeviceSubClass ; __u8 bDeviceProtocol ; __u8 bInterfaceClass ; __u8 bInterfaceSubClass ; __u8 bInterfaceProtocol ; __u8 bInterfaceNumber ; kernel_ulong_t driver_info ; }; struct usb_driver; struct usb_dynids { spinlock_t lock ; struct list_head list ; }; struct usbdrv_wrap { struct device_driver driver ; int for_devices ; }; struct usb_driver { char const *name ; int (*probe)(struct usb_interface * , struct usb_device_id const * ) ; void (*disconnect)(struct usb_interface * ) ; int (*unlocked_ioctl)(struct usb_interface * , unsigned int , void * ) ; int (*suspend)(struct usb_interface * , pm_message_t ) ; int (*resume)(struct usb_interface * ) ; int (*reset_resume)(struct usb_interface * ) ; int (*pre_reset)(struct usb_interface * ) ; int (*post_reset)(struct usb_interface * ) ; struct usb_device_id const *id_table ; struct usb_dynids dynids ; struct usbdrv_wrap drvwrap ; unsigned char no_dynamic_id : 1 ; unsigned char supports_autosuspend : 1 ; unsigned char disable_hub_initiated_lpm : 1 ; unsigned char soft_unbind : 1 ; }; typedef int ldv_func_ret_type___6; enum hrtimer_restart; struct bcm_leader { USHORT Vcid ; USHORT PLength ; UCHAR Status ; UCHAR Unused[3U] ; }; enum hrtimer_restart; enum hrtimer_restart; enum hrtimer_restart; struct bcm_link_request { struct bcm_leader Leader ; UCHAR szData[4U] ; }; enum hrtimer_restart; struct bcm_packet_class_rules { u16 u16UserPriority ; u16 u16VLANID ; u16 u16PacketClassificationRuleIndex ; u8 u8ClassifierRulePriority ; u8 u8IPTypeOfServiceLength ; u8 u8IPTypeOfService[3U] ; u8 u8Protocol ; u8 u8IPMaskedSourceAddressLength ; u8 u8IPMaskedSourceAddress[32U] ; u8 u8IPDestinationAddressLength ; u8 u8IPDestinationAddress[32U] ; u8 u8ProtocolSourcePortRangeLength ; u8 u8ProtocolSourcePortRange[4U] ; u8 u8ProtocolDestPortRangeLength ; u8 u8ProtocolDestPortRange[4U] ; u8 u8EthernetDestMacAddressLength ; u8 u8EthernetDestMacAddress[12U] ; u8 u8EthernetSourceMACAddressLength ; u8 u8EthernetSourceMACAddress[12U] ; u8 u8EthertypeLength ; u8 u8Ethertype[3U] ; u8 u8AssociatedPHSI ; u8 u8VendorSpecificClassifierParamLength ; u8 u8VendorSpecificClassifierParam[1U] ; u8 u8IPv6FlowLableLength ; u8 u8IPv6FlowLable[3U] ; u8 u8ClassifierActionRule ; u16 u16ValidityBitMap ; }; struct bcm_phs_rules { u8 u8PHSI ; u8 u8PHSFLength ; u8 u8PHSF[255U] ; u8 u8PHSMLength ; u8 u8PHSM[255U] ; u8 u8PHSS ; u8 u8PHSV ; u8 u8VendorSpecificPHSParamsLength ; u8 u8VendorSpecificPHSParams[10U] ; u8 u8Padding[2U] ; }; struct bcm_convergence_types { u8 u8ClassfierDSCAction ; u8 u8PhsDSCAction ; u8 u8Padding[2U] ; struct bcm_packet_class_rules cCPacketClassificationRule ; struct bcm_phs_rules cPhsRule ; }; struct bcm_connect_mgr_params { u32 u32SFID ; u32 u32MaxSustainedTrafficRate ; u32 u32MaxTrafficBurst ; u32 u32MinReservedTrafficRate ; u32 u32ToleratedJitter ; u32 u32MaximumLatency ; u16 u16CID ; u16 u16TargetSAID ; u16 u16ARQWindowSize ; u16 u16ARQRetryTxTimeOut ; u16 u16ARQRetryRxTimeOut ; u16 u16ARQBlockLifeTime ; u16 u16ARQSyncLossTimeOut ; u16 u16ARQRxPurgeTimeOut ; u16 u16ARQBlockSize ; u16 u16SDUInterArrivalTime ; u16 u16TimeBase ; u16 u16UnsolicitedGrantInterval ; u16 u16UnsolicitedPollingInterval ; u16 u16MacOverhead ; u16 u16MBSContentsID[10U] ; u8 u8MBSContentsIDLength ; u8 u8ServiceClassNameLength ; u8 u8ServiceClassName[32U] ; u8 u8MBSService ; u8 u8QosParamSet ; u8 u8TrafficPriority ; u8 u8ServiceFlowSchedulingType ; u8 u8RequesttransmissionPolicy ; u8 u8FixedLengthVSVariableLengthSDUIndicator ; u8 u8SDUSize ; u8 u8ARQEnable ; u8 u8ARQDeliverInOrder ; u8 u8RxARQAckProcessingTime ; u8 u8CSSpecification ; u8 u8TypeOfDataDeliveryService ; u8 u8PagingPreference ; u8 u8MBSZoneIdentifierassignment ; u8 u8TrafficIndicationPreference ; u8 u8GlobalServicesClassNameLength ; u8 u8GlobalServicesClassName[6U] ; u8 u8SNFeedbackEnabled ; u8 u8FSNSize ; u8 u8CIDAllocation4activeBSsLength ; u8 u8CIDAllocation4activeBSs[10U] ; u8 u8PDUSNExtendedSubheader4HarqReordering ; u8 u8HARQServiceFlows ; u8 u8AuthTokenLength ; u8 u8AuthToken[10U] ; u8 u8HarqChannelMappingLength ; u8 u8HARQChannelMapping[16U] ; u8 u8VendorSpecificQoSParamLength ; u8 u8VendorSpecificQoSParam[1U] ; u8 u8TotalClassifiers ; u8 bValid ; u8 u8Padding ; struct bcm_convergence_types cConvergenceSLTypes[4U] ; }; struct bcm_add_request { u8 u8Type ; u8 eConnectionDir ; u16 u16TID ; u16 u16CID ; u16 u16VCID ; struct bcm_connect_mgr_params *psfParameterSet ; }; struct bcm_add_indication { u8 u8Type ; u8 eConnectionDir ; u16 u16TID ; u16 u16CID ; u16 u16VCID ; struct bcm_connect_mgr_params *psfAuthorizedSet ; struct bcm_connect_mgr_params *psfAdmittedSet ; struct bcm_connect_mgr_params *psfActiveSet ; u8 u8CC ; u8 u8Padd ; u16 u16Padd ; }; struct bcm_del_request { u8 u8Type ; u8 u8Padding ; u16 u16TID ; u32 u32SFID ; }; struct bcm_del_indication { u8 u8Type ; u8 u8Padding ; u16 u16TID ; u16 u16CID ; u16 u16VCID ; u32 u32SFID ; u8 u8ConfirmationCode ; u8 u8Padding1[3U] ; }; struct bcm_stim_sfhostnotify { u32 SFID ; u16 newCID ; u16 VCID ; u8 RetainSF ; u8 QoSParamSet ; u16 u16reserved ; }; typedef struct _PHS_DEVICE_EXTENSION *PPHS_DEVICE_EXTENSION; struct bcm_add_indication_alt { u8 u8Type ; u8 u8Direction ; u16 u16TID ; u16 u16CID ; u16 u16VCID ; struct bcm_connect_mgr_params sfAuthorizedSet ; struct bcm_connect_mgr_params sfAdmittedSet ; struct bcm_connect_mgr_params sfActiveSet ; u8 u8CC ; u8 u8Padd ; u16 u16Padd ; }; struct bcm_change_indication { u8 u8Type ; u8 u8Direction ; u16 u16TID ; u16 u16CID ; u16 u16VCID ; struct bcm_connect_mgr_params sfAuthorizedSet ; struct bcm_connect_mgr_params sfAdmittedSet ; struct bcm_connect_mgr_params sfActiveSet ; u8 u8CC ; u8 u8Padd ; u16 u16Padd ; }; enum _E_IPADDR_CONTEXT { eSrcIpAddress = 0, eDestIpAddress = 1 } ; typedef enum _E_IPADDR_CONTEXT E_IPADDR_CONTEXT; enum E_CLASSIFIER_ACTION { eInvalidClassifierAction = 0, eAddClassifier = 1, eReplaceClassifier = 2, eDeleteClassifier = 3 } ; enum hrtimer_restart; struct IPV6HeaderFormatTag { UCHAR ucVersionPrio ; UCHAR aucFlowLabel[3U] ; USHORT usPayloadLength ; UCHAR ucNextHeader ; UCHAR ucHopLimit ; ULONG ulSrcIpAddress[4U] ; ULONG ulDestIpAddress[4U] ; }; typedef struct IPV6HeaderFormatTag IPV6Header; struct IPV6RoutingHeaderFormatTag { UCHAR ucNextHeader ; UCHAR ucRoutingType ; UCHAR ucNumAddresses ; UCHAR ucNextAddress ; ULONG ulReserved ; }; typedef struct IPV6RoutingHeaderFormatTag IPV6RoutingHeader; struct IPV6DestOptionsHeaderFormatTag { UCHAR ucNextHeader ; UCHAR ucHdrExtLen ; UCHAR ucDestOptions[6U] ; }; typedef struct IPV6DestOptionsHeaderFormatTag IPV6DestOptionsHeader; struct IPV6AuthenticationHeaderFormatTag { UCHAR ucNextHeader ; UCHAR ucLength ; USHORT usReserved ; ULONG ulSecurityParametersIndex ; }; typedef struct IPV6AuthenticationHeaderFormatTag IPV6AuthenticationHeader; typedef __u16 __sum16; enum hrtimer_restart; struct tcphdr { __be16 source ; __be16 dest ; __be32 seq ; __be32 ack_seq ; unsigned char res1 : 4 ; unsigned char doff : 4 ; unsigned char fin : 1 ; unsigned char syn : 1 ; unsigned char rst : 1 ; unsigned char psh : 1 ; unsigned char ack : 1 ; unsigned char urg : 1 ; unsigned char ece : 1 ; unsigned char cwr : 1 ; __be16 window ; __sum16 check ; __be16 urg_ptr ; }; struct udphdr { __be16 source ; __be16 dest ; __be16 len ; __sum16 check ; }; struct iphdr { unsigned char ihl : 4 ; unsigned char version : 4 ; __u8 tos ; __be16 tot_len ; __be16 id ; __be16 frag_off ; __u8 ttl ; __u8 protocol ; __sum16 check ; __be32 saddr ; __be32 daddr ; }; struct bcm_eth_header { UCHAR au8DestinationAddress[6U] ; UCHAR au8SourceAddress[6U] ; USHORT u16Etype ; }; union __anonunion_ldv_46329_262 { struct udphdr uhdr ; struct tcphdr thdr ; }; struct TransportHeaderT { union __anonunion_ldv_46329_262 ldv_46329 ; }; typedef struct TransportHeaderT xporthdr; enum _E_NWPKT_IPFRAME_TYPE { eNonIPPacket = 0, eIPv4Packet = 1, eIPv6Packet = 2 } ; typedef enum _E_NWPKT_IPFRAME_TYPE E_NWPKT_IPFRAME_TYPE; enum _E_NWPKT_ETHFRAME_TYPE { eEthUnsupportedFrame = 0, eEth802LLCFrame = 1, eEth802LLCSNAPFrame = 2, eEth802QVLANFrame = 3, eEthOtherFrame = 4 } ; typedef enum _E_NWPKT_ETHFRAME_TYPE E_NWPKT_ETHFRAME_TYPE; struct _S_ETHCS_PKT_INFO { E_NWPKT_IPFRAME_TYPE eNwpktIPFrameType ; E_NWPKT_ETHFRAME_TYPE eNwpktEthFrameType ; USHORT usEtherType ; UCHAR ucDSAP ; }; typedef struct _S_ETHCS_PKT_INFO S_ETHCS_PKT_INFO; typedef struct _S_ETHCS_PKT_INFO *PS_ETHCS_PKT_INFO; struct _ETH_CS_802_Q_FRAME { struct bcm_eth_header EThHdr ; unsigned char UserPriority : 3 ; unsigned char CFI : 1 ; unsigned short VLANID : 12 ; USHORT EthType ; }; typedef struct _ETH_CS_802_Q_FRAME ETH_CS_802_Q_FRAME; struct _ETH_CS_802_LLC_FRAME { struct bcm_eth_header EThHdr ; unsigned char DSAP ; unsigned char SSAP ; unsigned char Control ; }; typedef struct _ETH_CS_802_LLC_FRAME ETH_CS_802_LLC_FRAME; struct _ETH_CS_802_LLC_SNAP_FRAME { struct bcm_eth_header EThHdr ; unsigned char DSAP ; unsigned char SSAP ; unsigned char Control ; unsigned char OUI[3U] ; unsigned short usEtherType ; }; typedef struct _ETH_CS_802_LLC_SNAP_FRAME ETH_CS_802_LLC_SNAP_FRAME; struct _TCP_HEADER { USHORT usSrcPort ; USHORT usDestPort ; ULONG ulSeqNumber ; ULONG ulAckNumber ; UCHAR HeaderLength ; UCHAR ucFlags ; USHORT usWindowsSize ; USHORT usChkSum ; USHORT usUrgetPtr ; }; typedef struct _TCP_HEADER *PTCP_HEADER; enum hrtimer_restart; struct skb_frag_struct; typedef struct skb_frag_struct skb_frag_t; struct __anonstruct_page_205 { struct page *p ; }; struct skb_frag_struct { struct __anonstruct_page_205 page ; __u32 page_offset ; __u32 size ; }; struct skb_shared_hwtstamps { ktime_t hwtstamp ; ktime_t syststamp ; }; 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 ; __be32 ip6_frag_id ; atomic_t dataref ; void *destructor_arg ; skb_frag_t frags[17U] ; }; enum hrtimer_restart; enum hrtimer_restart; struct bcm_ddr_setting { UINT ulRegAddress ; UINT ulRegValue ; }; enum hrtimer_restart; enum hrtimer_restart; enum hrtimer_restart; enum hrtimer_restart; typedef unsigned long ulong; enum hrtimer_restart; struct _LINK_STATE { UCHAR ucLinkStatus ; UCHAR bIdleMode ; UCHAR bShutdownMode ; }; typedef struct _LINK_STATE LINK_STATE; struct __anonstruct_ldv_45224_250 { unsigned long ulIpv4Addr[4U] ; unsigned long ulIpv4Mask[4U] ; }; struct __anonstruct_ldv_45228_251 { unsigned long ulIpv6Addr[16U] ; unsigned long ulIpv6Mask[16U] ; }; struct __anonstruct_ldv_45232_252 { unsigned char ucIpv4Address[16U] ; unsigned char ucIpv4Mask[16U] ; }; struct __anonstruct_ldv_45236_253 { unsigned char ucIpv6Address[64U] ; unsigned char ucIpv6Mask[64U] ; }; union bcm_mibs_ip_addr { struct __anonstruct_ldv_45224_250 ldv_45224 ; struct __anonstruct_ldv_45228_251 ldv_45228 ; struct __anonstruct_ldv_45232_252 ldv_45232 ; struct __anonstruct_ldv_45236_253 ldv_45236 ; }; struct bcm_mibs_host_info { u64 GoodTransmits ; u64 GoodReceives ; unsigned long NumDesUsed ; unsigned long CurrNumFreeDesc ; unsigned long PrevNumFreeDesc ; unsigned long PrevNumRcevBytes ; unsigned long CurrNumRcevBytes ; unsigned long BEBucketSize ; unsigned long rtPSBucketSize ; unsigned long LastTxQueueIndex ; bool TxOutofDescriptors ; bool TimerActive ; u32 u32TotalDSD ; u32 aTxPktSizeHist[12U] ; u32 aRxPktSizeHist[12U] ; }; struct bcm_mibs_classifier_rule { unsigned long ulSFID ; unsigned char ucReserved[2U] ; u16 uiClassifierRuleIndex ; bool bUsed ; unsigned short usVCID_Value ; u8 u8ClassifierRulePriority ; union bcm_mibs_ip_addr stSrcIpAddress ; unsigned char ucIPSourceAddressLength ; union bcm_mibs_ip_addr stDestIpAddress ; unsigned char ucIPDestinationAddressLength ; unsigned char ucIPTypeOfServiceLength ; unsigned char ucTosLow ; unsigned char ucTosHigh ; unsigned char ucTosMask ; unsigned char ucProtocolLength ; unsigned char ucProtocol[32U] ; unsigned short usSrcPortRangeLo[4U] ; unsigned short usSrcPortRangeHi[4U] ; unsigned char ucSrcPortRangeLength ; unsigned short usDestPortRangeLo[4U] ; unsigned short usDestPortRangeHi[4U] ; unsigned char ucDestPortRangeLength ; bool bProtocolValid ; bool bTOSValid ; bool bDestIpValid ; bool bSrcIpValid ; unsigned char ucDirection ; bool bIpv6Protocol ; u32 u32PHSRuleID ; }; struct bcm_mibs_phs_rule { unsigned long ulSFID ; u8 u8PHSI ; u8 u8PHSFLength ; u8 u8PHSF[255U] ; u8 u8PHSMLength ; u8 u8PHSM[255U] ; u8 u8PHSS ; u8 u8PHSV ; u8 reserved[5U] ; long PHSModifiedBytes ; unsigned long PHSModifiedNumPackets ; unsigned long PHSErrorNumPackets ; }; struct bcm_mibs_table { unsigned long ulSFID ; unsigned short usVCID_Value ; unsigned int uiThreshold ; u8 u8TrafficPriority ; bool bValid ; bool bActive ; bool bActivateRequestSent ; u8 u8QueueType ; unsigned int uiMaxBucketSize ; unsigned int uiCurrentQueueDepthOnTarget ; unsigned int uiCurrentBytesOnHost ; unsigned int uiCurrentPacketsOnHost ; unsigned int uiDroppedCountBytes ; unsigned int uiDroppedCountPackets ; unsigned int uiSentBytes ; unsigned int uiSentPackets ; unsigned int uiCurrentDrainRate ; unsigned int uiThisPeriodSentBytes ; u64 liDrainCalculated ; unsigned int uiCurrentTokenCount ; u64 liLastUpdateTokenAt ; unsigned int uiMaxAllowedRate ; unsigned int NumOfPacketsSent ; unsigned char ucDirection ; unsigned short usCID ; struct bcm_mibs_parameters stMibsExtServiceFlowTable ; unsigned int uiCurrentRxRate ; unsigned int uiThisPeriodRxBytes ; unsigned int uiTotalRxBytes ; unsigned int uiTotalTxBytes ; }; struct bcm_host_stats_mibs { struct bcm_mibs_host_info stHostInfo ; struct bcm_mibs_classifier_rule astClassifierTable[100U] ; struct bcm_mibs_table astSFtable[17U] ; struct bcm_mibs_phs_rule astPhsRulesTable[100U] ; struct bcm_mibs_dropped_cntrl_msg stDroppedAppCntrlMsgs ; }; struct bcm_rdm_buffer { unsigned long Register ; unsigned long Length ; }; struct bcm_wrm_buffer { unsigned long Register ; unsigned long Length ; unsigned char Data[4U] ; }; struct bcm_ioctl_buffer { void *InputBuffer ; unsigned long InputLength ; void *OutputBuffer ; unsigned long OutputLength ; }; struct bcm_gpio_info { unsigned int uiGpioNumber ; unsigned int uiGpioValue ; }; struct bcm_user_thread_req { unsigned int ThreadState ; }; enum bcm_interface_type { BCM_MII = 0, BCM_CARDBUS = 1, BCM_USB = 2, BCM_SDIO = 3, BCM_PCMCIA = 4 } ; struct bcm_driver_info { NVM_TYPE u32NVMType ; unsigned int MaxRDMBufferSize ; enum bcm_interface_type u32InterfaceType ; unsigned int u32DSDStartOffset ; unsigned int u32RxAlignmentCorrection ; unsigned int u32Reserved[10U] ; }; struct bcm_nvm_readwrite { void *pBuffer ; uint32_t uiOffset ; uint32_t uiNumBytes ; bool bVerify ; }; struct bcm_bulk_wrm_buffer { unsigned long Register ; unsigned long SwapEndian ; unsigned long Values[1U] ; }; struct bcm_flash2x_readwrite { enum bcm_flash2x_section_val Section ; u32 offset ; u32 numOfBytes ; u32 bVerify ; void *pDataBuff ; }; struct bcm_flash2x_copy_section { enum bcm_flash2x_section_val SrcSection ; enum bcm_flash2x_section_val DstSection ; u32 offset ; u32 numOfBytes ; }; struct bcm_flash2x_bitmap { unsigned char ISO_IMAGE1 ; unsigned char ISO_IMAGE2 ; unsigned char DSD0 ; unsigned char DSD1 ; unsigned char DSD2 ; unsigned char VSA0 ; unsigned char VSA1 ; unsigned char VSA2 ; unsigned char SCSI ; unsigned char CONTROL_SECTION ; unsigned char Reserved0 ; unsigned char Reserved1 ; unsigned char Reserved2 ; }; struct bcm_time_elapsed { unsigned long long ul64TimeElapsedSinceNetEntry ; u32 uiReserved[4U] ; }; struct bcm_gpio_multi_info { unsigned int uiGPIOCommand ; unsigned int uiGPIOMask ; unsigned int uiGPIOValue ; }; struct bcm_gpio_multi_mode { unsigned int uiGPIOMode ; unsigned int uiGPIOMask ; }; enum hrtimer_restart; enum hrtimer_restart; enum _E_CLASSIFIER_ENTRY_CONTEXT { eActiveClassifierRuleContext = 0, eOldClassifierRuleContext = 1 } ; typedef enum _E_CLASSIFIER_ENTRY_CONTEXT E_CLASSIFIER_ENTRY_CONTEXT; enum hrtimer_restart; typedef unsigned long long ULONG64; enum hrtimer_restart; typedef struct _FLASH_CS_INFO FLASH_CS_INFO; enum hrtimer_restart; long ldv__builtin_expect(long exp , long c ) ; extern int printk(char const * , ...) ; extern void might_fault(void) ; extern void __bad_percpu_size(void) ; extern void *memset(void * , int , size_t ) ; extern int memcmp(void const * , void const * , size_t ) ; extern void warn_slowpath_fmt(char const * , int const , char const * , ...) ; __inline static void atomic_set(atomic_t *v , int i ) { { v->counter = i; return; } } extern int mutex_trylock(struct mutex * ) ; int ldv_mutex_trylock_4(struct mutex *ldv_func_arg1 ) ; extern void mutex_unlock(struct mutex * ) ; void ldv_mutex_unlock_2(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_5(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_7(struct mutex *ldv_func_arg1 ) ; extern void mutex_lock(struct mutex * ) ; void ldv_mutex_lock_1(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_3(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_6(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_cred_guard_mutex_of_signal_struct(struct mutex *lock ) ; void ldv_mutex_unlock_cred_guard_mutex_of_signal_struct(struct mutex *lock ) ; void ldv_mutex_lock_lock(struct mutex *lock ) ; void ldv_mutex_unlock_lock(struct mutex *lock ) ; void ldv_mutex_lock_mutex_of_device(struct mutex *lock ) ; int ldv_mutex_trylock_mutex_of_device(struct mutex *lock ) ; void ldv_mutex_unlock_mutex_of_device(struct mutex *lock ) ; extern unsigned long kernel_stack ; __inline static struct thread_info *current_thread_info(void) { struct thread_info *ti ; unsigned long pfo_ret__ ; { switch (8UL) { case 1: __asm__ ("movb %%gs:%P1,%0": "=q" (pfo_ret__): "p" (& kernel_stack)); goto ldv_6189; case 2: __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_6189; case 4: __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_6189; case 8: __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_6189; default: __bad_percpu_size(); } ldv_6189: ti = (struct thread_info *)(pfo_ret__ - 8152UL); return (ti); } } extern void __wake_up(wait_queue_head_t * , unsigned int , int , void * ) ; extern ssize_t vfs_read(struct file * , char * , size_t , loff_t * ) ; extern void kfree(void const * ) ; extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if(!cond) {abort();} } extern void *malloc(size_t size); long ldv_is_err(const void *ptr) { return ((unsigned long)ptr > ((unsigned long)-4095)); } void *ldv_malloc(size_t size) { if (__VERIFIER_nondet_int()) { void *res = malloc(size); assume_abort_if_not(!ldv_is_err(res)); return res; } else { return ((void *)0); } } void *__kmalloc(size_t size, gfp_t t) { return ldv_malloc(size); } void *ldv_malloc(size_t size ) ; __inline static void *kmalloc(size_t size , gfp_t flags ) { void *tmp___2 ; { tmp___2 = __kmalloc(size, flags); return (tmp___2); } } void *ldv_zalloc(size_t size ) ; __inline static void *kzalloc(size_t size , gfp_t flags ) { void *tmp ; { tmp = kmalloc(size, flags | 32768U); return (tmp); } } extern unsigned long _copy_from_user(void * , void const * , unsigned int ) ; __inline static unsigned long copy_from_user(void *to , void const *from , unsigned long n ) { int sz ; unsigned long tmp ; int __ret_warn_on ; long tmp___0 ; long tmp___1 ; long tmp___2 ; { tmp = __builtin_object_size((void const *)to, 0); sz = (int )tmp; might_fault(); tmp___1 = ldv__builtin_expect(sz == -1, 1L); if (tmp___1 != 0L) { n = _copy_from_user(to, from, (unsigned int )n); } else { tmp___2 = ldv__builtin_expect((unsigned long )sz >= n, 1L); if (tmp___2 != 0L) { n = _copy_from_user(to, from, (unsigned int )n); } else { __ret_warn_on = 1; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_fmt("/work/ldvuser/zakharov_benchmarks/bench/cpa/inst/current/envs/linux-3.8-rc1/linux-3.8-rc1/arch/x86/include/asm/uaccess_64.h", 66, "Buffer overflow detected!\n"); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); } } return (n); } } __inline static void *netdev_priv(struct net_device const *dev ) { { return ((void *)dev + 2816U); } } struct net_device *gblpnetdev ; int ddr_init(struct bcm_mini_adapter *Adapter ) ; int rdm(struct bcm_mini_adapter *Adapter , unsigned int uiAddress , PCHAR pucBuff , size_t sSize ) ; int wrm(struct bcm_mini_adapter *Adapter , unsigned int uiAddress , PCHAR pucBuff , size_t sSize ) ; int wrmalt(struct bcm_mini_adapter *Adapter , unsigned int uiAddress , unsigned int *pucBuff , size_t size ) ; void beceem_parse_target_struct(struct bcm_mini_adapter *Adapter ) ; int bcm_ioctl_fw_download(struct bcm_mini_adapter *Adapter , struct bcm_firmware_info *psFwInfo ) ; int InitLedSettings(struct bcm_mini_adapter *Adapter ) ; INT PropagateCalParamsFromFlashToMemory(struct bcm_mini_adapter *Adapter ) ; INT BcmInitNVM(struct bcm_mini_adapter *ps_adapter ) ; INT buffDnldVerify(struct bcm_mini_adapter *Adapter , unsigned char *mappedbuffer , unsigned int u32FirmwareLength , unsigned long u32StartingAddress ) ; INT InterfaceRDM(struct bcm_interface_adapter *psIntfAdapter , unsigned int addr , void *buff , int len ) ; INT InterfaceWRM(struct bcm_interface_adapter *psIntfAdapter , unsigned int addr , void *buff , int len ) ; int InterfaceFileDownload(PVOID arg , struct file *flp , unsigned int on_chip_loc ) ; int InterfaceFileReadbackFromChip(PVOID arg , struct file *flp , unsigned int on_chip_loc ) ; int InterfaceFileDownload(PVOID arg , struct file *flp , unsigned int on_chip_loc ) { mm_segment_t oldfs ; int errno ; int len ; loff_t pos ; struct bcm_interface_adapter *psIntfAdapter ; char *buff ; void *tmp ; struct thread_info *tmp___0 ; struct thread_info *tmp___1 ; mm_segment_t __constr_expr_0 ; ssize_t tmp___2 ; struct thread_info *tmp___3 ; { oldfs.seg = 0UL; errno = 0; len = 0; pos = 0LL; psIntfAdapter = (struct bcm_interface_adapter *)arg; tmp = kmalloc(2048UL, 208U); buff = (char *)tmp; if ((unsigned long )buff == (unsigned long )((char *)0)) { return (-12); } else { } ldv_46824: tmp___0 = current_thread_info(); oldfs = tmp___0->addr_limit; tmp___1 = current_thread_info(); __constr_expr_0.seg = 0xffffffffffffffffUL; tmp___1->addr_limit = __constr_expr_0; tmp___2 = vfs_read(flp, buff, 2048UL, & pos); len = (int )tmp___2; tmp___3 = current_thread_info(); tmp___3->addr_limit = oldfs; if (len <= 0) { if (len < 0) { if ((((unsigned long )psIntfAdapter->psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && (psIntfAdapter->psAdapter)->stDebugState.debug_level > 6U) && (int )(psIntfAdapter->psAdapter)->stDebugState.type & 1) && ((psIntfAdapter->psAdapter)->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:len < 0", "InterfaceFileDownload"); } else { } errno = len; } else { errno = 0; if ((((unsigned long )psIntfAdapter->psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && (psIntfAdapter->psAdapter)->stDebugState.debug_level > 6U) && (int )(psIntfAdapter->psAdapter)->stDebugState.type & 1) && ((psIntfAdapter->psAdapter)->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:Got end of file!", "InterfaceFileDownload"); } else { } } goto ldv_46823; } else { } errno = InterfaceWRM(psIntfAdapter, on_chip_loc, (PVOID )buff, len); if (errno != 0) { printk("\016%s:WRM Failed! status: %d", "InterfaceFileDownload", errno); goto ldv_46823; } else { } on_chip_loc = on_chip_loc + 2048U; goto ldv_46824; ldv_46823: kfree((void const *)buff); return (errno); } } int InterfaceFileReadbackFromChip(PVOID arg , struct file *flp , unsigned int on_chip_loc ) { char *buff ; char *buff_readback ; unsigned int reg ; mm_segment_t oldfs ; int errno ; int len ; int is_config_file ; loff_t pos ; int fw_down ; INT Status ; struct bcm_interface_adapter *psIntfAdapter ; int bytes ; void *tmp ; void *tmp___0 ; struct thread_info *tmp___1 ; struct thread_info *tmp___2 ; mm_segment_t __constr_expr_0 ; ssize_t tmp___3 ; struct thread_info *tmp___4 ; int tmp___5 ; { reg = 0U; oldfs.seg = 0UL; errno = 0; len = 0; is_config_file = 0; pos = 0LL; Status = 0; psIntfAdapter = (struct bcm_interface_adapter *)arg; tmp = kmalloc(2048UL, 1U); buff = (char *)tmp; tmp___0 = kmalloc(2048UL, 1U); buff_readback = (char *)tmp___0; if ((unsigned long )buff == (unsigned long )((char *)0) || (unsigned long )buff_readback == (unsigned long )((char *)0)) { kfree((void const *)buff); kfree((void const *)buff_readback); return (-12); } else { } is_config_file = on_chip_loc == 3210784768U; memset((void *)buff_readback, 0, 2048UL); memset((void *)buff, 0, 2048UL); ldv_46849: tmp___1 = current_thread_info(); oldfs = tmp___1->addr_limit; tmp___2 = current_thread_info(); __constr_expr_0.seg = 0xffffffffffffffffUL; tmp___2->addr_limit = __constr_expr_0; tmp___3 = vfs_read(flp, buff, 2048UL, & pos); len = (int )tmp___3; tmp___4 = current_thread_info(); tmp___4->addr_limit = oldfs; fw_down = fw_down + 1; if (len <= 0) { if (len < 0) { if ((((unsigned long )psIntfAdapter->psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && (psIntfAdapter->psAdapter)->stDebugState.debug_level > 6U) && (int )(psIntfAdapter->psAdapter)->stDebugState.type & 1) && ((psIntfAdapter->psAdapter)->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:len < 0", "InterfaceFileReadbackFromChip"); } else { } errno = len; } else { errno = 0; if ((((unsigned long )psIntfAdapter->psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && (psIntfAdapter->psAdapter)->stDebugState.debug_level > 6U) && (int )(psIntfAdapter->psAdapter)->stDebugState.type & 1) && ((psIntfAdapter->psAdapter)->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:Got end of file!", "InterfaceFileReadbackFromChip"); } else { } } goto ldv_46844; } else { } bytes = InterfaceRDM(psIntfAdapter, on_chip_loc, (PVOID )buff_readback, len); if (bytes < 0) { Status = bytes; if ((((unsigned long )psIntfAdapter->psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && (psIntfAdapter->psAdapter)->stDebugState.debug_level > 6U) && (int )(psIntfAdapter->psAdapter)->stDebugState.type & 1) && ((psIntfAdapter->psAdapter)->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:RDM of len %d Failed! %d", "InterfaceFileReadbackFromChip", len, reg); } else { } goto exit; } else { } reg = reg + 1U; if ((unsigned long )len - 4UL <= 3UL) { tmp___5 = memcmp((void const *)buff_readback, (void const *)buff, (size_t )len); if (tmp___5 != 0) { if ((((unsigned long )psIntfAdapter->psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && (psIntfAdapter->psAdapter)->stDebugState.debug_level > 6U) && (int )(psIntfAdapter->psAdapter)->stDebugState.type & 1) && ((psIntfAdapter->psAdapter)->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:Firmware Download is not proper %d", "InterfaceFileReadbackFromChip", fw_down); } else { } if ((((unsigned long )psIntfAdapter->psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && (psIntfAdapter->psAdapter)->stDebugState.debug_level > 6U) && (int )(psIntfAdapter->psAdapter)->stDebugState.type & 1) && ((psIntfAdapter->psAdapter)->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:Length is: %d", "InterfaceFileReadbackFromChip", len); } else { } Status = -5; goto exit; } else { len = len + -4; goto ldv_46847; ldv_46846: ; if (*((unsigned int *)buff_readback + (unsigned long )len) != *((unsigned int *)buff + (unsigned long )len)) { if ((((unsigned long )psIntfAdapter->psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && (psIntfAdapter->psAdapter)->stDebugState.debug_level > 6U) && (int )(psIntfAdapter->psAdapter)->stDebugState.type & 1) && ((psIntfAdapter->psAdapter)->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:Firmware Download is not proper %d", "InterfaceFileReadbackFromChip", fw_down); } else { } if ((((unsigned long )psIntfAdapter->psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && (psIntfAdapter->psAdapter)->stDebugState.debug_level > 6U) && (int )(psIntfAdapter->psAdapter)->stDebugState.type & 1) && ((psIntfAdapter->psAdapter)->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:Val from Binary %x, Val From Read Back %x ", "InterfaceFileReadbackFromChip", *((unsigned int *)buff + (unsigned long )len), *((unsigned int *)buff_readback + (unsigned long )len)); } else { } if ((((unsigned long )psIntfAdapter->psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && (psIntfAdapter->psAdapter)->stDebugState.debug_level > 6U) && (int )(psIntfAdapter->psAdapter)->stDebugState.type & 1) && ((psIntfAdapter->psAdapter)->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:len =%x!!!", "InterfaceFileReadbackFromChip", len); } else { } Status = -5; goto exit; } else { } len = len + -4; ldv_46847: ; if (len != 0) { goto ldv_46846; } else { goto ldv_46848; } ldv_46848: ; } } else { } on_chip_loc = on_chip_loc + 2048U; goto ldv_46849; ldv_46844: ; exit: kfree((void const *)buff); kfree((void const *)buff_readback); return (Status); } } static int bcm_download_config_file(struct bcm_mini_adapter *Adapter , struct bcm_firmware_info *psFwInfo ) { int retval ; B_UINT32 value ; void *tmp ; unsigned long tmp___0 ; { retval = 0; value = 0U; if ((unsigned long )Adapter->pstargetparams == (unsigned long )((PSTARGETPARAMS )0)) { tmp = kmalloc(144UL, 208U); Adapter->pstargetparams = (PSTARGETPARAMS )tmp; if ((unsigned long )Adapter->pstargetparams == (unsigned long )((PSTARGETPARAMS )0)) { return (-12); } else { } } else { } if (psFwInfo->u32FirmwareLength != 144UL) { return (-5); } else { } tmp___0 = copy_from_user((void *)Adapter->pstargetparams, (void const *)psFwInfo->pvMappedFirmwareAddress, psFwInfo->u32FirmwareLength); retval = (int )tmp___0; if (retval != 0) { kfree((void const *)Adapter->pstargetparams); Adapter->pstargetparams = 0; return (-14); } else { } beceem_parse_target_struct(Adapter); BcmInitNVM(Adapter); retval = InitLedSettings(Adapter); if (retval != 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (Adapter->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:INIT LED Failed\n", "bcm_download_config_file"); } else { } return (retval); } else { } if (Adapter->LEDInfo.led_thread_running & 1) { Adapter->LEDInfo.bLedInitDone = 0; Adapter->DriverState = 1; __wake_up(& Adapter->LEDInfo.notify_led_event, 3U, 1, 0); } else { } if (Adapter->LEDInfo.led_thread_running & 1) { Adapter->DriverState = 2; __wake_up(& Adapter->LEDInfo.notify_led_event, 3U, 1, 0); } else { } retval = ddr_init(Adapter); if (retval != 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (Adapter->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:DDR Init Failed\n", "bcm_download_config_file"); } else { } return (retval); } else { } value = 0U; wrmalt(Adapter, 3215982596U, & value, 4UL); wrmalt(Adapter, 3215982592U, & value, 4UL); if ((unsigned int )Adapter->eNVMType == 2U) { retval = PropagateCalParamsFromFlashToMemory(Adapter); if (retval != 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (Adapter->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:propagaion of cal param failed with status :%d", "bcm_download_config_file", retval); } else { } return (retval); } else { } } else { } retval = buffDnldVerify(Adapter, (unsigned char *)Adapter->pstargetparams, 144U, 3210784768UL); if (retval != 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (Adapter->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:configuration file not downloaded properly", "bcm_download_config_file"); } else { Adapter->bCfgDownloaded = 1; } } else { } return (retval); } } static int bcm_compare_buff_contents(unsigned char *readbackbuff , unsigned char *buff , unsigned int len ) { int retval ; struct bcm_mini_adapter *Adapter ; void *tmp ; int tmp___0 ; { retval = 0; tmp = netdev_priv((struct net_device const *)gblpnetdev); Adapter = (struct bcm_mini_adapter *)tmp; if ((unsigned long )len - 4UL <= 3UL) { tmp___0 = memcmp((void const *)readbackbuff, (void const *)buff, (size_t )len); if (tmp___0 != 0) { retval = -22; } else { len = len - 4U; goto ldv_46867; ldv_46866: ; if (*((unsigned int *)readbackbuff + (unsigned long )len) != *((unsigned int *)buff + (unsigned long )len)) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (Adapter->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:Firmware Download is not proper", "bcm_compare_buff_contents"); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (Adapter->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:Val from Binary %x, Val From Read Back %x ", "bcm_compare_buff_contents", *((unsigned int *)buff + (unsigned long )len), *((unsigned int *)readbackbuff + (unsigned long )len)); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (Adapter->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:len =%x!!!", "bcm_compare_buff_contents", len); } else { } retval = -22; goto ldv_46865; } else { } len = len - 4U; ldv_46867: ; if (len != 0U) { goto ldv_46866; } else { goto ldv_46865; } ldv_46865: ; } } else { } return (retval); } } int bcm_ioctl_fw_download(struct bcm_mini_adapter *Adapter , struct bcm_firmware_info *psFwInfo ) { int retval ; PUCHAR buff ; void *tmp ; unsigned long tmp___0 ; { retval = 0; buff = 0; atomic_set(& Adapter->uiMBupdate, 0); if ((int )((signed char )Adapter->bCfgDownloaded) == 0 && psFwInfo->u32StartingAddress != 3210784768UL) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (Adapter->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:Download the config File first\n", "bcm_ioctl_fw_download"); } else { } return (-22); } else { } if (psFwInfo->u32StartingAddress == 3210784768UL) { retval = bcm_download_config_file(Adapter, psFwInfo); } else { tmp = kzalloc(psFwInfo->u32FirmwareLength, 208U); buff = (PUCHAR )tmp; if ((unsigned long )buff == (unsigned long )((PUCHAR )0)) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (Adapter->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:Failed in allocation memory", "bcm_ioctl_fw_download"); } else { } return (-12); } else { } tmp___0 = copy_from_user((void *)buff, (void const *)psFwInfo->pvMappedFirmwareAddress, psFwInfo->u32FirmwareLength); retval = (int )tmp___0; if (retval != 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (Adapter->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:copying buffer from user space failed", "bcm_ioctl_fw_download"); } else { } retval = -14; goto error; } else { } retval = buffDnldVerify(Adapter, buff, (unsigned int )psFwInfo->u32FirmwareLength, psFwInfo->u32StartingAddress); if (retval != 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (Adapter->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:f/w download failed status :%d", "bcm_ioctl_fw_download", retval); } else { } goto error; } else { } } error: kfree((void const *)buff); return (retval); } } static INT buffDnld(struct bcm_mini_adapter *Adapter , PUCHAR mappedbuffer , UINT u32FirmwareLength , ULONG u32StartingAddress ) { unsigned int len ; int retval ; { len = 0U; retval = 0; len = u32FirmwareLength; goto ldv_46887; ldv_46886: ; if (2048U < u32FirmwareLength) { len = 2048U; } else { len = u32FirmwareLength; } retval = wrm(Adapter, (UINT )u32StartingAddress, (PCHAR )mappedbuffer, (size_t )len); if (retval != 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (Adapter->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:wrm failed with status :%d", "buffDnld", retval); } else { } goto ldv_46885; } else { } u32StartingAddress = (ULONG )len + u32StartingAddress; u32FirmwareLength = u32FirmwareLength - len; mappedbuffer = mappedbuffer + (unsigned long )len; ldv_46887: ; if (u32FirmwareLength != 0U) { goto ldv_46886; } else { goto ldv_46885; } ldv_46885: ; return (retval); } } static INT buffRdbkVerify(struct bcm_mini_adapter *Adapter , PUCHAR mappedbuffer , UINT u32FirmwareLength , ULONG u32StartingAddress ) { UINT len ; INT retval ; PUCHAR readbackbuff ; void *tmp ; int bytes ; { len = u32FirmwareLength; retval = 0; tmp = kzalloc(2048UL, 208U); readbackbuff = (PUCHAR )tmp; if ((unsigned long )readbackbuff == (unsigned long )((PUCHAR )0)) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (Adapter->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:MEMORY ALLOCATION FAILED", "buffRdbkVerify"); } else { } return (-12); } else { } goto ldv_46901; ldv_46900: ; if (2048U < u32FirmwareLength) { len = 2048U; } else { len = u32FirmwareLength; } bytes = rdm(Adapter, (UINT )u32StartingAddress, (PCHAR )readbackbuff, (size_t )len); if (bytes < 0) { retval = bytes; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (Adapter->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:rdm failed with status %d", "buffRdbkVerify", retval); } else { } goto ldv_46899; } else { } retval = bcm_compare_buff_contents(readbackbuff, mappedbuffer, len); if (retval != 0) { goto ldv_46899; } else { } u32StartingAddress = (ULONG )len + u32StartingAddress; u32FirmwareLength = u32FirmwareLength - len; mappedbuffer = mappedbuffer + (unsigned long )len; ldv_46901: ; if (u32FirmwareLength != 0U && retval == 0) { goto ldv_46900; } else { goto ldv_46899; } ldv_46899: kfree((void const *)readbackbuff); return (retval); } } INT buffDnldVerify(struct bcm_mini_adapter *Adapter , unsigned char *mappedbuffer , unsigned int u32FirmwareLength , unsigned long u32StartingAddress ) { INT status ; { status = 0; status = buffDnld(Adapter, mappedbuffer, u32FirmwareLength, u32StartingAddress); if (status != 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (Adapter->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:Buffer download failed", "buffDnldVerify"); } else { } goto error; } else { } status = buffRdbkVerify(Adapter, mappedbuffer, u32FirmwareLength, u32StartingAddress); if (status != 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (Adapter->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:Buffer readback verifier failed", "buffDnldVerify"); } else { } goto error; } else { } error: ; return (status); } } void ldv_mutex_lock_1(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_2(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_3(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_device(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_4(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___2 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex_of_device(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_5(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_device(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_6(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_7(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } __inline static __u32 __arch_swab32(__u32 val ) { { __asm__ ("bswapl %0": "=r" (val): "0" (val)); return (val); } } __inline static __u32 __fswab32(__u32 val ) { __u32 tmp ; { tmp = __arch_swab32(val); return (tmp); } } int ldv_mutex_trylock_18(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_16(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_19(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_21(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_15(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_17(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_20(struct mutex *ldv_func_arg1 ) ; extern unsigned long volatile jiffies ; extern unsigned long msecs_to_jiffies(unsigned int const ) ; extern int usb_autopm_get_interface(struct usb_interface * ) ; extern int usb_interrupt_msg(struct usb_device * , unsigned int , void * , int , int * , int ) ; __inline static unsigned int __create_pipe(struct usb_device *dev , unsigned int endpoint ) { { return ((unsigned int )(dev->devnum << 8) | (endpoint << 15)); } } int rdmalt(struct bcm_mini_adapter *Adapter , unsigned int uiAddress , unsigned int *pucBuff , size_t size ) ; void SendIdleModeResponse(struct bcm_mini_adapter *Adapter ) ; VOID OverrideServiceFlowParams(struct bcm_mini_adapter *Adapter , PUINT puiBuffer ) ; INT InterfaceIdleModeWakeup(struct bcm_mini_adapter *Adapter ) ; INT InterfaceIdleModeRespond(struct bcm_mini_adapter *Adapter , unsigned int *puiBuffer ) ; VOID InterfaceHandleShutdownModeWakeup(struct bcm_mini_adapter *Adapter ) ; INT InterfaceIdleModeRespond(struct bcm_mini_adapter *Adapter , unsigned int *puiBuffer ) { int status ; unsigned int uiRegRead ; int bytes ; __u32 tmp___1 ; __u32 tmp___2 ; __u32 tmp___3 ; __u32 tmp___4 ; { status = 0; uiRegRead = 0U; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 8192U) != 0U) { tmp___1 = __fswab32(*puiBuffer); printk("\017%s:SubType of Message :0x%X", "InterfaceIdleModeRespond", tmp___1); } else { } tmp___4 = __fswab32(*puiBuffer); if (tmp___4 == 210U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 8192U) != 0U) { printk("\017%s: Got GO_TO_IDLE_MODE_PAYLOAD(210) Msg Subtype", "InterfaceIdleModeRespond"); } else { } tmp___2 = __fswab32(*(puiBuffer + 1UL)); if (tmp___2 == 0U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 8192U) != 0U) { printk("\017%s:Got IDLE MODE WAKE UP Response From F/W", "InterfaceIdleModeRespond"); } else { } status = wrmalt(Adapter, 267395068U, & uiRegRead, 4UL); if (status != 0) { printk("\016%s:wrm failed while clearing Idle Mode Reg", "InterfaceIdleModeRespond"); return (status); } else { } if (Adapter->ulPowerSaveMode == 0UL) { uiRegRead = 0U; status = wrmalt(Adapter, 251658364U, & uiRegRead, 4UL); if (status != 0) { printk("\016%s:wrm failed while clearing Idle Mode\tReg", "InterfaceIdleModeRespond"); return (status); } else { } } else if (Adapter->ulPowerSaveMode != 4UL) { bytes = rdmalt(Adapter, 251730032U, & uiRegRead, 4UL); if (bytes < 0) { status = bytes; printk("\016%s:rdm failed while clearing H/W Abort Reg0", "InterfaceIdleModeRespond"); return (status); } else { } bytes = rdmalt(Adapter, 251730036U, & uiRegRead, 4UL); if (bytes < 0) { status = bytes; printk("\016%s:rdm failed while clearing H/W Abort\tReg1", "InterfaceIdleModeRespond"); return (status); } else { } } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 8192U) != 0U) { printk("\017%s:Device Up from Idle Mode", "InterfaceIdleModeRespond"); } else { } Adapter->IdleMode = 0; Adapter->bTriedToWakeUpFromlowPowerMode = 0; __wake_up(& Adapter->lowpower_mode_wait_queue, 3U, 1, 0); } else { if ((int )((signed char )Adapter->IdleMode) == 1) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 8192U) != 0U) { printk("\017%s:Device is already in Idle mode....", "InterfaceIdleModeRespond"); } else { } return (status); } else { } uiRegRead = 0U; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 8192U) != 0U) { printk("\017%s:Got Req from F/W to go in IDLE mode \n", "InterfaceIdleModeRespond"); } else { } if (((Adapter->chip_id == 3201184529UL || Adapter->chip_id == 3201184528UL) || Adapter->chip_id == 3201184513UL) || Adapter->chip_id == 3201184545UL) { bytes = rdmalt(Adapter, 251661656U, & uiRegRead, 4UL); if (bytes < 0) { status = bytes; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 8192U) != 0U) { printk("\017%s:rdm failed while Reading HPM_CONFIG_LDO145 Reg 0\n", "InterfaceIdleModeRespond"); } else { } return (status); } else { } uiRegRead = uiRegRead | 131072U; status = wrmalt(Adapter, 251661656U, & uiRegRead, 4UL); if (status != 0) { printk("\016%s:wrm failed while clearing Idle Mode Reg\n", "InterfaceIdleModeRespond"); return (status); } else { } } else { } SendIdleModeResponse(Adapter); } } else { tmp___3 = __fswab32(*puiBuffer); if (tmp___3 == 187U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 8192U) != 0U) { printk("\017%s:OverRiding Service Flow Params", "InterfaceIdleModeRespond"); } else { } OverrideServiceFlowParams(Adapter, puiBuffer); } else { } } return (status); } } static int InterfaceAbortIdlemode(struct bcm_mini_adapter *Adapter , unsigned int Pattern ) { int status ; unsigned int value ; unsigned int chip_id ; unsigned long timeout ; unsigned long itr ; int lenwritten ; unsigned char aucAbortPattern[8U] ; struct bcm_interface_adapter *psInterfaceAdapter ; unsigned int tmp ; unsigned long tmp___0 ; { status = 0; timeout = 0UL; itr = 0UL; lenwritten = 0; aucAbortPattern[0] = 255U; aucAbortPattern[1] = 255U; aucAbortPattern[2] = 255U; aucAbortPattern[3] = 255U; aucAbortPattern[4] = 255U; aucAbortPattern[5] = 255U; aucAbortPattern[6] = 255U; aucAbortPattern[7] = 255U; psInterfaceAdapter = (struct bcm_interface_adapter *)Adapter->pvInterfaceAdapter; if ((int )psInterfaceAdapter->bSuspended && (int )((signed char )Adapter->bDoSuspend) == 1) { status = usb_autopm_get_interface(psInterfaceAdapter->interface); if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 8192U) != 0U) { printk("\017%s:Bus got wakeup..Aborting Idle mode... status:%d \n", "InterfaceAbortIdlemode", status); } else { } } else { } if (Adapter->ulPowerSaveMode == 0UL || Adapter->ulPowerSaveMode == 4UL) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 8192U) != 0U) { printk("\017%s:Writing pattern<%d> to SW_ABORT_IDLEMODE_LOC\n", "InterfaceAbortIdlemode", Pattern); } else { } status = wrmalt(Adapter, 267395068U, & Pattern, 4UL); if (status != 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 8192U) != 0U) { printk("\017%s:WRM to Register SW_ABORT_IDLEMODE_LOC failed..", "InterfaceAbortIdlemode"); } else { } return (status); } else { } } else { } if (Adapter->ulPowerSaveMode == 0UL) { value = 2147483648U; status = wrmalt(Adapter, 251658364U, & value, 4UL); if (status != 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 8192U) != 0U) { printk("\017%s:WRM to DEBUG_INTERRUPT_GENERATOR_REGISTOR Register failed", "InterfaceAbortIdlemode"); } else { } return (status); } else { } } else if (Adapter->ulPowerSaveMode != 4UL) { tmp = __create_pipe(psInterfaceAdapter->udev, (unsigned int )psInterfaceAdapter->sIntrOut.int_out_endpointAddr); status = usb_interrupt_msg(psInterfaceAdapter->udev, tmp | 1073741824U, (void *)(& aucAbortPattern), 8, & lenwritten, 5000); if (status != 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 8192U) != 0U) { printk("\017%s:Sending Abort pattern down fails with status:%d..\n", "InterfaceAbortIdlemode", status); } else { } return (status); } else if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 8192U) != 0U) { printk("\017%s:NOB Sent down :%d", "InterfaceAbortIdlemode", lenwritten); } else { } tmp___0 = msecs_to_jiffies(50U); timeout = tmp___0 + (unsigned long )jiffies; goto ldv_46833; ldv_46832: itr = itr + 1UL; rdmalt(Adapter, 251658240U, & chip_id, 4UL); if ((chip_id & 4294967055U) == 3201184256U) { chip_id = chip_id & 4294967055U; } else { } if ((unsigned long )chip_id == Adapter->chip_id) { goto ldv_46831; } else { } ldv_46833: ; if (timeout > (unsigned long )jiffies) { goto ldv_46832; } else { goto ldv_46831; } ldv_46831: ; if (timeout < (unsigned long )jiffies) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 8192U) != 0U) { printk("\017%s:Not able to read chip-id even after 25 msec", "InterfaceAbortIdlemode"); } else if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 8192U) != 0U) { printk("\017%s:Number of completed iteration to read chip-id :%lu", "InterfaceAbortIdlemode", itr); } else { } } else { } status = wrmalt(Adapter, 267395068U, & Pattern, 4UL); if (status != 0) { printk("\016%s:WRM to Register SW_ABORT_IDLEMODE_LOC failed..", "InterfaceAbortIdlemode"); return (status); } else { } } else { } return (status); } } INT InterfaceIdleModeWakeup(struct bcm_mini_adapter *Adapter ) { ULONG Status ; { Status = 0UL; if ((int )((signed char )Adapter->bTriedToWakeUpFromlowPowerMode) != 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 8192U) != 0U) { printk("\017%s:Wake up already attempted.. ignoring\n", "InterfaceIdleModeWakeup"); } else { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 8192U) != 0U) { printk("\017%s:Writing Low Power Mode Abort pattern to the Device\n", "InterfaceIdleModeWakeup"); } else { } Adapter->bTriedToWakeUpFromlowPowerMode = 1; InterfaceAbortIdlemode(Adapter, Adapter->usIdleModePattern); } } else { } return ((INT )Status); } } VOID InterfaceHandleShutdownModeWakeup(struct bcm_mini_adapter *Adapter ) { unsigned int uiRegVal ; INT Status ; int bytes ; { uiRegVal = 0U; Status = 0; if (Adapter->ulPowerSaveMode == 0UL) { uiRegVal = 0U; Status = wrmalt(Adapter, 251658364U, & uiRegVal, 4UL); if (Status != 0) { printk("\016%s:WRM to DEBUG_INTERRUPT_GENERATOR_REGISTOR Failed with err :%d", "InterfaceHandleShutdownModeWakeup", Status); return; } else { } } else { bytes = rdmalt(Adapter, 251730032U, & uiRegVal, 4UL); if (bytes < 0) { Status = bytes; printk("\016%s:RDM of DEVICE_INT_OUT_EP_REG0 failed with Err :%d", "InterfaceHandleShutdownModeWakeup", Status); return; } else { } bytes = rdmalt(Adapter, 251730036U, & uiRegVal, 4UL); if (bytes < 0) { Status = bytes; printk("\016%s:RDM of DEVICE_INT_OUT_EP_REG1 failed with Err :%d", "InterfaceHandleShutdownModeWakeup", Status); return; } else { } } return; } } void ldv_mutex_lock_15(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_16(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_17(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_device(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_18(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___2 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex_of_device(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_19(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_device(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_20(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_21(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } __inline static void INIT_LIST_HEAD(struct list_head *list ) { { list->next = list; list->prev = list; return; } } extern struct task_struct *current_task ; __inline static struct task_struct *get_current(void) { struct task_struct *pfo_ret__ ; { switch (8UL) { case 1: __asm__ ("movb %%gs:%P1,%0": "=q" (pfo_ret__): "p" (& current_task)); goto ldv_2861; case 2: __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& current_task)); goto ldv_2861; case 4: __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& current_task)); goto ldv_2861; case 8: __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& current_task)); goto ldv_2861; default: __bad_percpu_size(); } ldv_2861: ; return (pfo_ret__); } } __inline static long PTR_ERR(void const *ptr ) { { return ((long )ptr); } } __inline static long IS_ERR(void const *ptr ) { long tmp ; { tmp = ldv__builtin_expect((unsigned long )ptr > 0xfffffffffffff000UL, 0L); return (tmp); } } extern void lockdep_init_map(struct lockdep_map * , char const * , struct lock_class_key * , int ) ; int ldv_mutex_trylock_32(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_30(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_33(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_35(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_29(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_31(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_34(struct mutex *ldv_func_arg1 ) ; int ldv_state_variable_3 ; int ldv_state_variable_2 ; int ref_cnt ; extern int __VERIFIER_nondet_int(void) ; int ldv_state_variable_1 ; int usb_counter ; int ldv_state_variable_4 ; int ldv_state_variable_0 ; extern void prepare_to_wait(wait_queue_head_t * , wait_queue_t * , int ) ; extern void finish_wait(wait_queue_head_t * , wait_queue_t * ) ; extern int autoremove_wake_function(wait_queue_t * , unsigned int , int , void * ) ; extern void __init_work(struct work_struct * , int ) ; extern struct module __this_module ; extern struct class *__class_create(struct module * , char const * , struct lock_class_key * ) ; extern void class_destroy(struct class * ) ; extern int device_init_wakeup(struct device * , bool ) ; extern void *dev_get_drvdata(struct device const * ) ; extern int dev_set_drvdata(struct device * , void * ) ; extern int dev_err(struct device const * , char const * , ...) ; extern int _dev_info(struct device const * , char const * , ...) ; extern void __const_udelay(unsigned long ) ; extern void msleep(unsigned int ) ; extern long schedule_timeout(long ) ; extern void netif_device_detach(struct net_device * ) ; __inline static u32 netif_msg_init(int debug_value , int default_msg_enable_bits ) { { if (debug_value < 0 || (unsigned int )debug_value > 31U) { return ((u32 )default_msg_enable_bits); } else { } if (debug_value == 0) { return (0U); } else { } return ((u32 )((1 << debug_value) + -1)); } } extern struct net_device *alloc_etherdev_mqs(int , unsigned int , unsigned int ) ; extern void pm_runtime_set_autosuspend_delay(struct device * , int ) ; __inline static void *usb_get_intfdata(struct usb_interface *intf ) { void *tmp ; { tmp = dev_get_drvdata((struct device const *)(& intf->dev)); return (tmp); } } __inline static void usb_set_intfdata(struct usb_interface *intf , void *data ) { { dev_set_drvdata(& intf->dev, data); return; } } __inline static struct usb_device *interface_to_usbdev(struct usb_interface *intf ) { struct device const *__mptr ; { __mptr = (struct device const *)intf->dev.parent; return ((struct usb_device *)__mptr + 0xffffffffffffff78UL); } } extern struct usb_device *usb_get_dev(struct usb_device * ) ; extern void usb_put_dev(struct usb_device * ) ; extern int usb_reset_device(struct usb_device * ) ; extern void usb_enable_autosuspend(struct usb_device * ) ; extern void usb_disable_autosuspend(struct usb_device * ) ; extern int usb_register_driver(struct usb_driver * , struct module * , char const * ) ; int ldv_usb_register_driver_36(struct usb_driver *ldv_func_arg1 , struct module *ldv_func_arg2 , char const *ldv_func_arg3 ) ; extern void usb_deregister(struct usb_driver * ) ; void ldv_usb_deregister_37(struct usb_driver *arg ) ; extern struct urb *usb_alloc_urb(int , gfp_t ) ; extern void usb_free_urb(struct urb * ) ; extern int usb_set_interface(struct usb_device * , int , int ) ; int InitAdapter(struct bcm_mini_adapter *psAdapter ) ; int register_control_device_interface(struct bcm_mini_adapter *Adapter ) ; VOID AdapterFree(struct bcm_mini_adapter *Adapter ) ; int reset_card_proc(struct bcm_mini_adapter *ps_adapter ) ; int InitCardAndDownloadFirmware(struct bcm_mini_adapter *ps_adapter ) ; INT BeceemEEPROMBulkRead(struct bcm_mini_adapter *Adapter , PUINT pBuffer , unsigned int uiOffset , unsigned int uiNumBytes ) ; INT BeceemEEPROMBulkWrite(struct bcm_mini_adapter *Adapter , PUCHAR pBuffer , unsigned int uiOffset , unsigned int uiNumBytes , BOOLEAN bVerify ) ; INT ReadBeceemEEPROM(struct bcm_mini_adapter *Adapter , unsigned int uiOffset , unsigned int *pBuffer ) ; VOID putUsbSuspend(struct work_struct *work ) ; int CreateInterruptUrb(struct bcm_interface_adapter *psIntfAdapter ) ; INT StartInterruptUrb(struct bcm_interface_adapter *psIntfAdapter ) ; int BcmRDM(void *arg , unsigned int addr , void *buff , int len ) ; int BcmWRM(void *arg , unsigned int addr , void *buff , int len ) ; BOOLEAN InterfaceRx(struct bcm_interface_adapter *psIntfAdapter ) ; INT InterfaceTransmitPacket(PVOID arg , PVOID data , UINT len ) ; struct class *bcm_class ; static struct usb_device_id InterfaceUsbtable[10U] = { {3U, 6543U, 768U, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 0UL}, {3U, 6543U, 528U, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 0UL}, {3U, 6543U, 544U, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 0UL}, {3U, 6543U, 350U, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 0UL}, {3U, 6610U, 306U, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 0UL}, {3U, 1161U, 57367U, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 0UL}, {3U, 6610U, 7U, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 0UL}, {3U, 6610U, 370U, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 0UL}, {3U, 6610U, 371U, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 0UL}, {(unsigned short)0, (unsigned short)0, (unsigned short)0, (unsigned short)0, (unsigned short)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, (unsigned char)0, 0UL}}; struct usb_device_id const __mod_usb_device_table ; static int debug = -1; static unsigned int const default_msg = 255U; static int InterfaceAdapterInit(struct bcm_interface_adapter *psIntfAdapter ) ; static void InterfaceAdapterFree(struct bcm_interface_adapter *psIntfAdapter ) { int i ; { i = 0; if ((psIntfAdapter->psAdapter)->LEDInfo.led_thread_running & 1) { (psIntfAdapter->psAdapter)->DriverState = 255; __wake_up(& (psIntfAdapter->psAdapter)->LEDInfo.notify_led_event, 3U, 1, 0); } else { } reset_card_proc(psIntfAdapter->psAdapter); goto ldv_46846; ldv_46845: ; if ((((unsigned long )psIntfAdapter->psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && (psIntfAdapter->psAdapter)->stDebugState.debug_level > 6U) && (int )(psIntfAdapter->psAdapter)->stDebugState.type & 1) && (int )(psIntfAdapter->psAdapter)->stDebugState.subtype[1] & 1) { printk("\017%s:Device is being accessed.\n", "InterfaceAdapterFree"); } else { } msleep(100U); ldv_46846: ; if ((int )((signed char )(psIntfAdapter->psAdapter)->DeviceAccess) != 0) { goto ldv_46845; } else { goto ldv_46847; } ldv_46847: usb_free_urb(psIntfAdapter->psInterruptUrb); i = 0; goto ldv_46849; ldv_46848: ; if ((unsigned long )psIntfAdapter->asUsbTcb[i].urb != (unsigned long )((struct urb *)0)) { usb_free_urb(psIntfAdapter->asUsbTcb[i].urb); psIntfAdapter->asUsbTcb[i].urb = 0; } else { } i = i + 1; ldv_46849: ; if (i <= 127) { goto ldv_46848; } else { goto ldv_46850; } ldv_46850: i = 0; goto ldv_46852; ldv_46851: ; if ((unsigned long )psIntfAdapter->asUsbRcb[i].urb != (unsigned long )((struct urb *)0)) { kfree((void const *)(psIntfAdapter->asUsbRcb[i].urb)->transfer_buffer); usb_free_urb(psIntfAdapter->asUsbRcb[i].urb); psIntfAdapter->asUsbRcb[i].urb = 0; } else { } i = i + 1; ldv_46852: ; if (i <= 127) { goto ldv_46851; } else { goto ldv_46853; } ldv_46853: AdapterFree(psIntfAdapter->psAdapter); return; } } static void ConfigureEndPointTypesThroughEEPROM(struct bcm_mini_adapter *Adapter ) { unsigned long ulReg ; int bytes ; __u32 tmp ; { ulReg = 0UL; ulReg = 2685403407UL; BeceemEEPROMBulkWrite(Adapter, (unsigned char *)(& ulReg), 296U, 4U, 1); ulReg = 1073741824UL; BeceemEEPROMBulkWrite(Adapter, (unsigned char *)(& ulReg), 300U, 4U, 1); ulReg = 2819621135UL; BeceemEEPROMBulkWrite(Adapter, (unsigned char *)(& ulReg), 306U, 4U, 1); if ((int )((struct bcm_interface_adapter *)Adapter->pvInterfaceAdapter)->bHighSpeedDevice) { ulReg = 654311424UL; BeceemEEPROMBulkWrite(Adapter, (unsigned char *)(& ulReg), 310U, 4U, 1); } else { ulReg = 620756992UL; BeceemEEPROMBulkWrite(Adapter, (unsigned char *)(& ulReg), 310U, 4U, 1); } ulReg = 4027580687UL; BeceemEEPROMBulkWrite(Adapter, (unsigned char *)(& ulReg), 316U, 4U, 1); ulReg = 2348810240UL; BeceemEEPROMBulkWrite(Adapter, (unsigned char *)(& ulReg), 320U, 4U, 1); bytes = rdmalt(Adapter, 251728120U, (unsigned int *)(& ulReg), 4UL); if (bytes < 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (int )Adapter->stDebugState.subtype[1] & 1) { printk("\017%s:reading of Tx EP failed\n", "ConfigureEndPointTypesThroughEEPROM"); } else { } return; } else { } ulReg = ulReg | 6UL; tmp = __fswab32((unsigned int )ulReg); ulReg = (unsigned long )tmp; BeceemEEPROMBulkWrite(Adapter, (unsigned char *)(& ulReg), 460U, 4U, 1); ulReg = 4161798415UL; BeceemEEPROMBulkWrite(Adapter, (unsigned char *)(& ulReg), 456U, 4U, 1); ulReg = 3356492047UL; BeceemEEPROMBulkWrite(Adapter, (unsigned char *)(& ulReg), 466U, 4U, 1); ulReg = 0UL; BeceemEEPROMBulkWrite(Adapter, (unsigned char *)(& ulReg), 470U, 4U, 1); ReadBeceemEEPROM(Adapter, 508U, (UINT *)(& ulReg)); ulReg = ulReg & 16908287UL; BeceemEEPROMBulkWrite(Adapter, (unsigned char *)(& ulReg), 508U, 4U, 1); ReadBeceemEEPROM(Adapter, 168U, (UINT *)(& ulReg)); if ((ulReg & 16711680UL) >> 16 > 48UL) { ulReg = (ulReg & 4278255615UL) | 3145728UL; BeceemEEPROMBulkWrite(Adapter, (unsigned char *)(& ulReg), 168U, 4U, 1); } else { } ReadBeceemEEPROM(Adapter, 328U, (UINT *)(& ulReg)); if ((ulReg & 16711680UL) >> 16 > 48UL) { ulReg = (ulReg & 4278255615UL) | 3145728UL; BeceemEEPROMBulkWrite(Adapter, (unsigned char *)(& ulReg), 328U, 4U, 1); } else { } ulReg = 0UL; BeceemEEPROMBulkWrite(Adapter, (unsigned char *)(& ulReg), 290U, 4U, 1); ulReg = 0UL; BeceemEEPROMBulkWrite(Adapter, (unsigned char *)(& ulReg), 450U, 4U, 1); return; } } static int usbbcm_device_probe(struct usb_interface *intf , struct usb_device_id const *id ) { struct usb_device *udev ; struct usb_device *tmp ; int retval ; struct bcm_mini_adapter *psAdapter ; struct bcm_interface_adapter *psIntfAdapter ; struct net_device *ndev ; void *tmp___0 ; int i ; void *tmp___1 ; uint32_t uiNackZeroLengthInt ; struct lock_class_key __key ; atomic_long_t __constr_expr_0 ; { tmp = interface_to_usbdev(intf); udev = tmp; ndev = alloc_etherdev_mqs(144096, 18U, 18U); if ((unsigned long )ndev == (unsigned long )((struct net_device *)0)) { dev_err((struct device const *)(& udev->dev), "beceem: no memory for device\n"); return (-12); } else { } ndev->dev.parent = & intf->dev; tmp___0 = netdev_priv((struct net_device const *)ndev); psAdapter = (struct bcm_mini_adapter *)tmp___0; psAdapter->dev = ndev; psAdapter->msg_enable = netif_msg_init(debug, (int )default_msg); psAdapter->stDebugState.debug_level = 7U; psAdapter->stDebugState.type = 1U; psAdapter->stDebugState.subtype[1] = 255U; i = 0; goto ldv_46872; ldv_46871: ; if (((i == 1 || i == 2) || i == 4) || i == 8) { printk("\016%s:subtype[%d] = 0x%08x\n", "usbbcm_device_probe", i, psAdapter->stDebugState.subtype[i]); } else { } i = i + 1; ldv_46872: ; if (i <= 8) { goto ldv_46871; } else { goto ldv_46873; } ldv_46873: retval = InitAdapter(psAdapter); if (retval != 0) { dev_err((struct device const *)(& udev->dev), "beceem: InitAdapter Failed\n"); AdapterFree(psAdapter); return (retval); } else { } tmp___1 = kzalloc(6400UL, 208U); psIntfAdapter = (struct bcm_interface_adapter *)tmp___1; if ((unsigned long )psIntfAdapter == (unsigned long )((struct bcm_interface_adapter *)0)) { dev_err((struct device const *)(& udev->dev), "beceem: no memory for Interface adapter\n"); AdapterFree(psAdapter); return (-12); } else { } psAdapter->pvInterfaceAdapter = (PVOID )psIntfAdapter; psIntfAdapter->psAdapter = psAdapter; psIntfAdapter->interface = intf; usb_set_intfdata(intf, (void *)psIntfAdapter); if ((((unsigned long )psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && psAdapter->stDebugState.debug_level > 6U) && (int )psAdapter->stDebugState.type & 1) && (int )psAdapter->stDebugState.subtype[1] & 1) { printk("\017%s:psIntfAdapter 0x%p\n", "usbbcm_device_probe", psIntfAdapter); } else { } retval = InterfaceAdapterInit(psIntfAdapter); if (retval != 0) { if (retval == -2) { if ((((unsigned long )psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && psAdapter->stDebugState.debug_level > 6U) && (int )psAdapter->stDebugState.type & 1) && (int )psAdapter->stDebugState.subtype[1] & 1) { printk("\017%s:File Not Found. Use app to download.\n", "usbbcm_device_probe"); } else { } return (0); } else { } if ((((unsigned long )psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && psAdapter->stDebugState.debug_level > 6U) && (int )psAdapter->stDebugState.type & 1) && (int )psAdapter->stDebugState.subtype[1] & 1) { printk("\017%s:InterfaceAdapterInit failed.\n", "usbbcm_device_probe"); } else { } usb_set_intfdata(intf, 0); udev = interface_to_usbdev(intf); usb_put_dev(udev); InterfaceAdapterFree(psIntfAdapter); return (retval); } else { } if (psAdapter->chip_id > 3201172224UL) { uiNackZeroLengthInt = 4U; retval = wrmalt(psAdapter, 251730040U, & uiNackZeroLengthInt, 4UL); if (retval != 0) { return (retval); } else { } } else { } if (((unsigned int )(udev->actconfig)->desc.bmAttributes & 32U) != 0U) { if ((int )((signed char )psAdapter->bDoSuspend) != 0) { pm_runtime_set_autosuspend_delay(& udev->dev, 0); intf->needs_remote_wakeup = 1U; usb_enable_autosuspend(udev); device_init_wakeup(& intf->dev, 1); __init_work(& psIntfAdapter->usbSuspendWork, 0); __constr_expr_0.counter = 4195328L; psIntfAdapter->usbSuspendWork.data = __constr_expr_0; lockdep_init_map(& psIntfAdapter->usbSuspendWork.lockdep_map, "(&psIntfAdapter->usbSuspendWork)", & __key, 0); INIT_LIST_HEAD(& psIntfAdapter->usbSuspendWork.entry); psIntfAdapter->usbSuspendWork.func = & putUsbSuspend; if ((((unsigned long )psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && psAdapter->stDebugState.debug_level > 6U) && (int )psAdapter->stDebugState.type & 1) && (int )psAdapter->stDebugState.subtype[1] & 1) { printk("\017%s:Enabling USB Auto-Suspend\n", "usbbcm_device_probe"); } else { } } else { intf->needs_remote_wakeup = 0U; usb_disable_autosuspend(udev); } } else { } psAdapter->stDebugState.subtype[1] = 0U; return (retval); } } static void usbbcm_disconnect(struct usb_interface *intf ) { struct bcm_interface_adapter *psIntfAdapter ; void *tmp ; struct bcm_mini_adapter *psAdapter ; struct usb_device *udev ; struct usb_device *tmp___0 ; { tmp = usb_get_intfdata(intf); psIntfAdapter = (struct bcm_interface_adapter *)tmp; tmp___0 = interface_to_usbdev(intf); udev = tmp___0; if ((unsigned long )psIntfAdapter == (unsigned long )((struct bcm_interface_adapter *)0)) { return; } else { } psAdapter = psIntfAdapter->psAdapter; netif_device_detach(psAdapter->dev); if ((int )((signed char )psAdapter->bDoSuspend) != 0) { intf->needs_remote_wakeup = 0U; } else { } psAdapter->device_removed = 1; usb_set_intfdata(intf, 0); InterfaceAdapterFree(psIntfAdapter); usb_put_dev(udev); return; } } static int AllocUsbCb(struct bcm_interface_adapter *psIntfAdapter ) { int i ; { i = 0; i = 0; goto ldv_46889; ldv_46888: psIntfAdapter->asUsbTcb[i].urb = usb_alloc_urb(0, 208U); if ((unsigned long )psIntfAdapter->asUsbTcb[i].urb == (unsigned long )((struct urb *)0)) { printk("\016%s:Can\'t allocate Tx urb for index %d\n", "AllocUsbCb", i); return (-12); } else { } i = i + 1; ldv_46889: ; if (i <= 127) { goto ldv_46888; } else { goto ldv_46890; } ldv_46890: i = 0; goto ldv_46892; ldv_46891: psIntfAdapter->asUsbRcb[i].urb = usb_alloc_urb(0, 208U); if ((unsigned long )psIntfAdapter->asUsbRcb[i].urb == (unsigned long )((struct urb *)0)) { printk("\016%s:Can\'t allocate Rx urb for index %d\n", "AllocUsbCb", i); return (-12); } else { } (psIntfAdapter->asUsbRcb[i].urb)->transfer_buffer = kmalloc(2048UL, 208U); if ((unsigned long )(psIntfAdapter->asUsbRcb[i].urb)->transfer_buffer == (unsigned long )((void *)0)) { printk("\016%s:Can\'t allocate Rx buffer for index %d\n", "AllocUsbCb", i); return (-12); } else { } (psIntfAdapter->asUsbRcb[i].urb)->transfer_buffer_length = 2048U; i = i + 1; ldv_46892: ; if (i <= 127) { goto ldv_46891; } else { goto ldv_46893; } ldv_46893: ; return (0); } } static int device_run(struct bcm_interface_adapter *psIntfAdapter ) { int value ; UINT status ; int tmp ; INT tmp___0 ; long __ret ; wait_queue_t __wait ; struct task_struct *tmp___1 ; int tmp___2 ; { value = 0; status = 0U; tmp = InitCardAndDownloadFirmware(psIntfAdapter->psAdapter); status = (UINT )tmp; if (status != 0U) { printk("\vbeceemInitCardAndDownloadFirmware failed.\n"); return ((int )status); } else { } if ((int )((signed char )(psIntfAdapter->psAdapter)->fw_download_done) == 1) { tmp___0 = StartInterruptUrb(psIntfAdapter); if (tmp___0 != 0) { if ((((unsigned long )psIntfAdapter->psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && (psIntfAdapter->psAdapter)->stDebugState.debug_level > 6U) && (int )(psIntfAdapter->psAdapter)->stDebugState.type & 1) && (int )(psIntfAdapter->psAdapter)->stDebugState.subtype[1] & 1) { printk("\017%s:Cannot send interrupt in URB\n", "device_run"); } else { } } else { } (psIntfAdapter->psAdapter)->waiting_to_fw_download_done = 0; __ret = 1250L; if ((int )((signed char )(psIntfAdapter->psAdapter)->waiting_to_fw_download_done) == 0) { tmp___1 = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp___1; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; ldv_46903: prepare_to_wait(& (psIntfAdapter->psAdapter)->ioctl_fw_dnld_wait_queue, & __wait, 2); if ((int )((signed char )(psIntfAdapter->psAdapter)->waiting_to_fw_download_done) != 0) { goto ldv_46902; } else { } __ret = schedule_timeout(__ret); if (__ret == 0L) { goto ldv_46902; } else { } goto ldv_46903; ldv_46902: finish_wait(& (psIntfAdapter->psAdapter)->ioctl_fw_dnld_wait_queue, & __wait); } else { } value = (int )__ret; if (value == 0) { printk("\vbeceem: Timeout waiting for mailbox interrupt.\n"); } else { } tmp___2 = register_control_device_interface(psIntfAdapter->psAdapter); if (tmp___2 < 0) { printk("\vbeceem: Register Control Device failed.\n"); return (-5); } else { } } else { } return (0); } } __inline static int bcm_usb_endpoint_dir_in(struct usb_endpoint_descriptor const *epd ) { { return ((int )((signed char )epd->bEndpointAddress) < 0); } } __inline static int bcm_usb_endpoint_dir_out(struct usb_endpoint_descriptor const *epd ) { { return ((int )((signed char )epd->bEndpointAddress) >= 0); } } __inline static int bcm_usb_endpoint_xfer_bulk(struct usb_endpoint_descriptor const *epd ) { { return (((int )epd->bmAttributes & 3) == 2); } } __inline static int bcm_usb_endpoint_xfer_int(struct usb_endpoint_descriptor const *epd ) { { return (((int )epd->bmAttributes & 3) == 3); } } __inline static int bcm_usb_endpoint_is_bulk_in(struct usb_endpoint_descriptor const *epd ) { int tmp ; int tmp___0 ; int tmp___1 ; { tmp = bcm_usb_endpoint_xfer_bulk(epd); if (tmp != 0) { tmp___0 = bcm_usb_endpoint_dir_in(epd); if (tmp___0 != 0) { tmp___1 = 1; } else { tmp___1 = 0; } } else { tmp___1 = 0; } return (tmp___1); } } __inline static int bcm_usb_endpoint_is_bulk_out(struct usb_endpoint_descriptor const *epd ) { int tmp ; int tmp___0 ; int tmp___1 ; { tmp = bcm_usb_endpoint_xfer_bulk(epd); if (tmp != 0) { tmp___0 = bcm_usb_endpoint_dir_out(epd); if (tmp___0 != 0) { tmp___1 = 1; } else { tmp___1 = 0; } } else { tmp___1 = 0; } return (tmp___1); } } __inline static int bcm_usb_endpoint_is_int_in(struct usb_endpoint_descriptor const *epd ) { int tmp ; int tmp___0 ; int tmp___1 ; { tmp = bcm_usb_endpoint_xfer_int(epd); if (tmp != 0) { tmp___0 = bcm_usb_endpoint_dir_in(epd); if (tmp___0 != 0) { tmp___1 = 1; } else { tmp___1 = 0; } } else { tmp___1 = 0; } return (tmp___1); } } __inline static int bcm_usb_endpoint_is_int_out(struct usb_endpoint_descriptor const *epd ) { int tmp ; int tmp___0 ; int tmp___1 ; { tmp = bcm_usb_endpoint_xfer_int(epd); if (tmp != 0) { tmp___0 = bcm_usb_endpoint_dir_out(epd); if (tmp___0 != 0) { tmp___1 = 1; } else { tmp___1 = 0; } } else { tmp___1 = 0; } return (tmp___1); } } static int InterfaceAdapterInit(struct bcm_interface_adapter *psIntfAdapter ) { struct usb_host_interface *iface_desc ; struct usb_endpoint_descriptor *endpoint ; size_t buffer_size ; unsigned long value ; int retval ; int usedIntOutForBulkTransfer ; BOOLEAN bBcm16 ; UINT uiData ; int bytes ; struct usb_device *tmp ; int tmp___0 ; int tmp___1 ; UINT _uiData ; int tmp___2 ; int tmp___3 ; unsigned int tmp___4 ; int tmp___5 ; unsigned int tmp___6 ; int tmp___7 ; void *tmp___8 ; int tmp___9 ; unsigned int tmp___10 ; void *tmp___11 ; int tmp___12 ; int tmp___13 ; { retval = 0; usedIntOutForBulkTransfer = 0; bBcm16 = 0; uiData = 0U; tmp = interface_to_usbdev(psIntfAdapter->interface); psIntfAdapter->udev = usb_get_dev(tmp); psIntfAdapter->bHighSpeedDevice = (unsigned int )(psIntfAdapter->udev)->speed == 3U; (psIntfAdapter->psAdapter)->interface_rdm = & BcmRDM; (psIntfAdapter->psAdapter)->interface_wrm = & BcmWRM; bytes = rdmalt(psIntfAdapter->psAdapter, 251658240U, (unsigned int *)(& (psIntfAdapter->psAdapter)->chip_id), 4UL); if (bytes < 0) { retval = bytes; printk("\016%s:CHIP ID Read Failed\n", "InterfaceAdapterInit"); return (retval); } else { } if (((psIntfAdapter->psAdapter)->chip_id & 0xffffffffffffff0fUL) == 3201184256UL) { (psIntfAdapter->psAdapter)->chip_id = (psIntfAdapter->psAdapter)->chip_id & 0xffffffffffffff0fUL; } else { } _dev_info((struct device const *)(& (psIntfAdapter->udev)->dev), "RDM Chip ID 0x%lx\n", (psIntfAdapter->psAdapter)->chip_id); iface_desc = (psIntfAdapter->interface)->cur_altsetting; if ((psIntfAdapter->psAdapter)->chip_id == 3201172240UL) { BeceemEEPROMBulkRead(psIntfAdapter->psAdapter, & uiData, 0U, 4U); if (uiData == 1296254274U) { bBcm16 = 1; } else { } _dev_info((struct device const *)(& (psIntfAdapter->udev)->dev), "number of alternate setting %d\n", (psIntfAdapter->interface)->num_altsetting); if ((int )((signed char )bBcm16) == 1) { if ((int )psIntfAdapter->bHighSpeedDevice) { retval = usb_set_interface(psIntfAdapter->udev, 0, 1); } else { } if ((((unsigned long )psIntfAdapter->psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && (psIntfAdapter->psAdapter)->stDebugState.debug_level > 6U) && (int )(psIntfAdapter->psAdapter)->stDebugState.type & 1) && (int )(psIntfAdapter->psAdapter)->stDebugState.subtype[1] & 1) { printk("\017%s:BCM16 is applicable on this dongle\n", "InterfaceAdapterInit"); } else { } if (retval != 0 || ! psIntfAdapter->bHighSpeedDevice) { usedIntOutForBulkTransfer = 1; endpoint = & (iface_desc->endpoint + 1UL)->desc; if ((((unsigned long )psIntfAdapter->psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && (psIntfAdapter->psAdapter)->stDebugState.debug_level > 6U) && (int )(psIntfAdapter->psAdapter)->stDebugState.type & 1) && (int )(psIntfAdapter->psAdapter)->stDebugState.subtype[1] & 1) { printk("\017%s:Interface altsetting failed or modem is configured to Full Speed, hence will work on default setting 0\n", "InterfaceAdapterInit"); } else { } if ((int )psIntfAdapter->bHighSpeedDevice) { tmp___0 = bcm_usb_endpoint_is_int_out((struct usb_endpoint_descriptor const *)endpoint); if (tmp___0 == 0) { goto _L; } else { goto _L___0; } } else _L___0: /* CIL Label */ if (! psIntfAdapter->bHighSpeedDevice) { tmp___1 = bcm_usb_endpoint_is_bulk_out((struct usb_endpoint_descriptor const *)endpoint); if (tmp___1 == 0) { _L: /* CIL Label */ if ((((unsigned long )psIntfAdapter->psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && (psIntfAdapter->psAdapter)->stDebugState.debug_level > 6U) && (int )(psIntfAdapter->psAdapter)->stDebugState.type & 1) && (int )(psIntfAdapter->psAdapter)->stDebugState.subtype[1] & 1) { printk("\017%s:Configuring the EEPROM\n", "InterfaceAdapterInit"); } else { } ConfigureEndPointTypesThroughEEPROM(psIntfAdapter->psAdapter); retval = usb_reset_device(psIntfAdapter->udev); if (retval != 0) { if ((((unsigned long )psIntfAdapter->psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && (psIntfAdapter->psAdapter)->stDebugState.debug_level > 6U) && (int )(psIntfAdapter->psAdapter)->stDebugState.type & 1) && (int )(psIntfAdapter->psAdapter)->stDebugState.subtype[1] & 1) { printk("\017%s:reset failed. Re-enumerating the device.\n", "InterfaceAdapterInit"); } else { } return (retval); } else { } } else { } } else { } if (! psIntfAdapter->bHighSpeedDevice) { tmp___2 = bcm_usb_endpoint_is_bulk_out((struct usb_endpoint_descriptor const *)endpoint); if (tmp___2 != 0) { _uiData = 654311424U; if ((((unsigned long )psIntfAdapter->psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && (psIntfAdapter->psAdapter)->stDebugState.debug_level > 6U) && (int )(psIntfAdapter->psAdapter)->stDebugState.type & 1) && (int )(psIntfAdapter->psAdapter)->stDebugState.subtype[1] & 1) { printk("\017%s:Reverting Bulk to INT as it is in Full Speed mode.\n", "InterfaceAdapterInit"); } else { } BeceemEEPROMBulkWrite(psIntfAdapter->psAdapter, (unsigned char *)(& _uiData), 310U, 4U, 1); } else { } } else { } } else { usedIntOutForBulkTransfer = 3; endpoint = & (iface_desc->endpoint + 3UL)->desc; if ((((unsigned long )psIntfAdapter->psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && (psIntfAdapter->psAdapter)->stDebugState.debug_level > 6U) && (int )(psIntfAdapter->psAdapter)->stDebugState.type & 1) && (int )(psIntfAdapter->psAdapter)->stDebugState.subtype[1] & 1) { printk("\017%s:Choosing AltSetting as a default setting.\n", "InterfaceAdapterInit"); } else { } tmp___3 = bcm_usb_endpoint_is_int_out((struct usb_endpoint_descriptor const *)endpoint); if (tmp___3 == 0) { if ((((unsigned long )psIntfAdapter->psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && (psIntfAdapter->psAdapter)->stDebugState.debug_level > 6U) && (int )(psIntfAdapter->psAdapter)->stDebugState.type & 1) && (int )(psIntfAdapter->psAdapter)->stDebugState.subtype[1] & 1) { printk("\017%s:Dongle does not have BCM16 Fix.\n", "InterfaceAdapterInit"); } else { } ConfigureEndPointTypesThroughEEPROM(psIntfAdapter->psAdapter); retval = usb_reset_device(psIntfAdapter->udev); if (retval != 0) { if ((((unsigned long )psIntfAdapter->psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && (psIntfAdapter->psAdapter)->stDebugState.debug_level > 6U) && (int )(psIntfAdapter->psAdapter)->stDebugState.type & 1) && (int )(psIntfAdapter->psAdapter)->stDebugState.subtype[1] & 1) { printk("\017%s:reset failed. Re-enumerating the device.\n", "InterfaceAdapterInit"); } else { } return (retval); } else { } } else { } } } else { } } else { } iface_desc = (psIntfAdapter->interface)->cur_altsetting; value = 0UL; goto ldv_46962; ldv_46961: endpoint = & (iface_desc->endpoint + value)->desc; if ((unsigned int )psIntfAdapter->sBulkIn.bulk_in_endpointAddr == 0U) { tmp___5 = bcm_usb_endpoint_is_bulk_in((struct usb_endpoint_descriptor const *)endpoint); if (tmp___5 != 0) { buffer_size = (size_t )endpoint->wMaxPacketSize; psIntfAdapter->sBulkIn.bulk_in_size = buffer_size; psIntfAdapter->sBulkIn.bulk_in_endpointAddr = endpoint->bEndpointAddress; tmp___4 = __create_pipe(psIntfAdapter->udev, (unsigned int )psIntfAdapter->sBulkIn.bulk_in_endpointAddr); psIntfAdapter->sBulkIn.bulk_in_pipe = tmp___4 | 3221225600U; } else { } } else { } if ((unsigned int )psIntfAdapter->sBulkOut.bulk_out_endpointAddr == 0U) { tmp___7 = bcm_usb_endpoint_is_bulk_out((struct usb_endpoint_descriptor const *)endpoint); if (tmp___7 != 0) { psIntfAdapter->sBulkOut.bulk_out_endpointAddr = endpoint->bEndpointAddress; tmp___6 = __create_pipe(psIntfAdapter->udev, (unsigned int )psIntfAdapter->sBulkOut.bulk_out_endpointAddr); psIntfAdapter->sBulkOut.bulk_out_pipe = tmp___6 | 3221225472U; } else { } } else { } if ((unsigned int )psIntfAdapter->sIntrIn.int_in_endpointAddr == 0U) { tmp___9 = bcm_usb_endpoint_is_int_in((struct usb_endpoint_descriptor const *)endpoint); if (tmp___9 != 0) { buffer_size = (size_t )endpoint->wMaxPacketSize; psIntfAdapter->sIntrIn.int_in_size = buffer_size; psIntfAdapter->sIntrIn.int_in_endpointAddr = endpoint->bEndpointAddress; psIntfAdapter->sIntrIn.int_in_interval = endpoint->bInterval; tmp___8 = kmalloc(buffer_size, 208U); psIntfAdapter->sIntrIn.int_in_buffer = (char *)tmp___8; if ((unsigned long )psIntfAdapter->sIntrIn.int_in_buffer == (unsigned long )((char *)0)) { dev_err((struct device const *)(& (psIntfAdapter->udev)->dev), "could not allocate interrupt_in_buffer\n"); return (-22); } else { } } else { } } else { } if ((unsigned int )psIntfAdapter->sIntrOut.int_out_endpointAddr == 0U) { tmp___12 = bcm_usb_endpoint_is_int_out((struct usb_endpoint_descriptor const *)endpoint); if (tmp___12 != 0) { if (((unsigned int )psIntfAdapter->sBulkOut.bulk_out_endpointAddr == 0U && (psIntfAdapter->psAdapter)->chip_id == 3201172240UL) && (unsigned long )usedIntOutForBulkTransfer == value) { buffer_size = (size_t )endpoint->wMaxPacketSize; psIntfAdapter->sBulkOut.bulk_out_size = buffer_size; psIntfAdapter->sBulkOut.bulk_out_endpointAddr = endpoint->bEndpointAddress; tmp___10 = __create_pipe(psIntfAdapter->udev, (unsigned int )psIntfAdapter->sBulkOut.bulk_out_endpointAddr); psIntfAdapter->sBulkOut.bulk_out_pipe = tmp___10 | 1073741824U; psIntfAdapter->sBulkOut.int_out_interval = endpoint->bInterval; } else if (value == 5UL) { buffer_size = (size_t )endpoint->wMaxPacketSize; psIntfAdapter->sIntrOut.int_out_size = buffer_size; psIntfAdapter->sIntrOut.int_out_endpointAddr = endpoint->bEndpointAddress; psIntfAdapter->sIntrOut.int_out_interval = endpoint->bInterval; tmp___11 = kmalloc(buffer_size, 208U); psIntfAdapter->sIntrOut.int_out_buffer = (char *)tmp___11; if ((unsigned long )psIntfAdapter->sIntrOut.int_out_buffer == (unsigned long )((char *)0)) { dev_err((struct device const *)(& (psIntfAdapter->udev)->dev), "could not allocate interrupt_out_buffer\n"); return (-22); } else { } } else { } } else { } } else { } value = value + 1UL; ldv_46962: ; if ((unsigned long )iface_desc->desc.bNumEndpoints > value) { goto ldv_46961; } else { goto ldv_46963; } ldv_46963: usb_set_intfdata(psIntfAdapter->interface, (void *)psIntfAdapter); (psIntfAdapter->psAdapter)->bcm_file_download = & InterfaceFileDownload; (psIntfAdapter->psAdapter)->bcm_file_readback_from_chip = & InterfaceFileReadbackFromChip; (psIntfAdapter->psAdapter)->interface_transmit = & InterfaceTransmitPacket; retval = CreateInterruptUrb(psIntfAdapter); if (retval != 0) { printk("\016%s:Cannot create interrupt urb\n", "InterfaceAdapterInit"); return (retval); } else { } retval = AllocUsbCb(psIntfAdapter); if (retval != 0) { return (retval); } else { } tmp___13 = device_run(psIntfAdapter); return (tmp___13); } } static int InterfaceSuspend(struct usb_interface *intf , pm_message_t message ) { struct bcm_interface_adapter *psIntfAdapter ; void *tmp ; { tmp = usb_get_intfdata(intf); psIntfAdapter = (struct bcm_interface_adapter *)tmp; psIntfAdapter->bSuspended = 1; if ((int )psIntfAdapter->bPreparingForBusSuspend) { psIntfAdapter->bPreparingForBusSuspend = 0; if ((unsigned int )(psIntfAdapter->psAdapter)->LinkStatus == 4U) { (psIntfAdapter->psAdapter)->IdleMode = 1; if ((((unsigned long )psIntfAdapter->psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && (psIntfAdapter->psAdapter)->stDebugState.debug_level > 6U) && (int )(psIntfAdapter->psAdapter)->stDebugState.type & 1) && (int )(psIntfAdapter->psAdapter)->stDebugState.subtype[1] & 1) { printk("\017%s:Host Entered in PMU Idle Mode.\n", "InterfaceSuspend"); } else { } } else { (psIntfAdapter->psAdapter)->bShutStatus = 1; if ((((unsigned long )psIntfAdapter->psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && (psIntfAdapter->psAdapter)->stDebugState.debug_level > 6U) && (int )(psIntfAdapter->psAdapter)->stDebugState.type & 1) && (int )(psIntfAdapter->psAdapter)->stDebugState.subtype[1] & 1) { printk("\017%s:Host Entered in PMU Shutdown Mode.\n", "InterfaceSuspend"); } else { } } } else { } (psIntfAdapter->psAdapter)->bPreparingForLowPowerMode = 0; __wake_up(& (psIntfAdapter->psAdapter)->lowpower_mode_wait_queue, 3U, 1, 0); return (0); } } static int InterfaceResume(struct usb_interface *intf ) { struct bcm_interface_adapter *psIntfAdapter ; void *tmp ; unsigned long __ms ; unsigned long tmp___0 ; { tmp = usb_get_intfdata(intf); psIntfAdapter = (struct bcm_interface_adapter *)tmp; __ms = 100UL; goto ldv_46976; ldv_46975: __const_udelay(4295000UL); ldv_46976: tmp___0 = __ms; __ms = __ms - 1UL; if (tmp___0 != 0UL) { goto ldv_46975; } else { goto ldv_46977; } ldv_46977: psIntfAdapter->bSuspended = 0; StartInterruptUrb(psIntfAdapter); InterfaceRx(psIntfAdapter); return (0); } } static struct usb_driver usbbcm_driver = {"usbbcm", & usbbcm_device_probe, & usbbcm_disconnect, 0, & InterfaceSuspend, & InterfaceResume, 0, 0, 0, (struct usb_device_id const *)(& InterfaceUsbtable), {{{{{{0U}}, 0U, 0U, 0, {0, {0, 0}, 0, 0, 0UL}}}}, {0, 0}}, {{0, 0, 0, 0, (_Bool)0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 0}, (unsigned char)0, 1U, (unsigned char)0, (unsigned char)0}; static int bcm_init(void) { int retval ; struct lock_class_key __key ; struct class *tmp ; long tmp___0 ; long tmp___1 ; { printk("\016%s: %s, %s\n", (char *)"beceem", (char *)"Beceem Communications Inc. WiMAX driver", (char *)"5.2.45"); printk("\016%s\n", (char *)"Copyright 2010. Beceem Communications Inc"); tmp = __class_create(& __this_module, "beceem", & __key); bcm_class = tmp; tmp___1 = IS_ERR((void const *)bcm_class); if (tmp___1 != 0L) { printk("\vbeceem: could not create class\n"); tmp___0 = PTR_ERR((void const *)bcm_class); return ((int )tmp___0); } else { } retval = ldv_usb_register_driver_36(& usbbcm_driver, & __this_module, "bcm_wimax"); if (retval < 0) { printk("\vbeceem: could not register usb driver\n"); class_destroy(bcm_class); return (retval); } else { } return (0); } } static void bcm_exit(void) { { ldv_usb_deregister_37(& usbbcm_driver); class_destroy(bcm_class); return; } } pm_message_t ldvarg0 ; int ldv_retval_2 ; struct usb_device_id *ldvarg1 ; int ldv_retval_5 ; int ldv_retval_0 ; struct usb_interface *usbbcm_driver_group1 ; void ldv_initialize(void) ; int ldv_retval_1 ; void ldv_check_final_state(void) ; int ldv_retval_3 ; extern int ldv_usbbcm_driver_reset_resume_4(void) ; void ldv_main_exported_3(void) ; void ldv_main_exported_2(void) ; void ldv_main_exported_1(void) ; int main(void) { int tmp ; int tmp___0 ; int tmp___1 ; { ldv_initialize(); ldv_state_variable_4 = 0; ldv_state_variable_1 = 0; ref_cnt = 0; ldv_state_variable_0 = 1; ldv_state_variable_3 = 0; ldv_state_variable_2 = 0; ldv_47048: tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_state_variable_4 != 0) { tmp___0 = __VERIFIER_nondet_int(); switch (tmp___0) { case 0: ; if (ldv_state_variable_4 == 1) { ldv_retval_3 = usbbcm_device_probe(usbbcm_driver_group1, (struct usb_device_id const *)ldvarg1); if (ldv_retval_3 == 0) { ldv_state_variable_4 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_47031; case 1: ; if (ldv_state_variable_4 == 3 && usb_counter == 0) { usbbcm_disconnect(usbbcm_driver_group1); ldv_state_variable_4 = 1; ref_cnt = ref_cnt - 1; } else { } if (ldv_state_variable_4 == 2 && usb_counter == 0) { usbbcm_disconnect(usbbcm_driver_group1); ldv_state_variable_4 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_47031; case 2: ; if (ldv_state_variable_4 == 2) { ldv_retval_2 = InterfaceSuspend(usbbcm_driver_group1, ldvarg0); if (ldv_retval_2 == 0) { ldv_state_variable_4 = 3; } else { } } else { } goto ldv_47031; case 3: ; if (ldv_state_variable_4 == 3) { ldv_retval_1 = InterfaceResume(usbbcm_driver_group1); if (ldv_retval_1 == 0) { ldv_state_variable_4 = 2; } else { } } else { } goto ldv_47031; case 4: ; if (ldv_state_variable_4 == 3) { ldv_retval_0 = ldv_usbbcm_driver_reset_resume_4(); if (ldv_retval_0 == 0) { ldv_state_variable_4 = 2; } else { } } else { } goto ldv_47031; default: ; goto ldv_47031; } ldv_47031: ; } else { } goto ldv_47037; case 1: ; if (ldv_state_variable_1 != 0) { ldv_main_exported_1(); } else { } goto ldv_47037; case 2: ; if (ldv_state_variable_0 != 0) { tmp___1 = __VERIFIER_nondet_int(); switch (tmp___1) { case 0: ; if (ldv_state_variable_0 == 2 && ref_cnt == 0) { bcm_exit(); ldv_state_variable_0 = 3; goto ldv_final; } else { } goto ldv_47042; case 1: ; if (ldv_state_variable_0 == 1) { ldv_retval_5 = bcm_init(); 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_2 = 1; } else { } } else { } goto ldv_47042; default: ; goto ldv_47042; } ldv_47042: ; } else { } goto ldv_47037; case 3: ; if (ldv_state_variable_3 != 0) { ldv_main_exported_3(); } else { } goto ldv_47037; case 4: ; if (ldv_state_variable_2 != 0) { ldv_main_exported_2(); } else { } goto ldv_47037; default: ; goto ldv_47037; } ldv_47037: ; goto ldv_47048; ldv_final: ldv_check_final_state(); return 0; } } void ldv_mutex_lock_29(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_30(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_31(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_device(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_32(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___2 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex_of_device(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_33(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_device(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_34(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_35(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } int ldv_usb_register_driver_36(struct usb_driver *ldv_func_arg1 , struct module *ldv_func_arg2 , char const *ldv_func_arg3 ) { ldv_func_ret_type___6 ldv_func_res ; int tmp ; { tmp = usb_register_driver(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3); ldv_func_res = tmp; ldv_state_variable_4 = 1; usb_counter = 0; return (ldv_func_res); } } void ldv_usb_deregister_37(struct usb_driver *arg ) { { usb_deregister(arg); ldv_state_variable_4 = 0; return; } } __inline static int constant_test_bit(unsigned int nr , unsigned long const volatile *addr ) { { return ((int )((unsigned long )*(addr + (unsigned long )(nr / 64U)) >> ((int )nr & 63)) & 1); } } __inline static __u16 __fswab16(__u16 val ) { { return ((__u16 )((int )((short )((int )val << 8)) | (int )((short )((int )val >> 8)))); } } extern void *memcpy(void * , void const * , size_t ) ; __inline static int atomic_read(atomic_t const *v ) { { return ((int )*((int 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; } } int ldv_mutex_trylock_50(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_48(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_51(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_53(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_47(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_49(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_52(struct mutex *ldv_func_arg1 ) ; extern void _raw_spin_lock(raw_spinlock_t * ) ; extern void _raw_spin_unlock(raw_spinlock_t * ) ; __inline static void spin_lock(spinlock_t *lock ) { { _raw_spin_lock(& lock->ldv_5961.rlock); return; } } __inline static void spin_unlock(spinlock_t *lock ) { { _raw_spin_unlock(& lock->ldv_5961.rlock); return; } } extern void consume_skb(struct sk_buff * ) ; extern unsigned char *skb_put(struct sk_buff * , unsigned int ) ; extern unsigned char *skb_push(struct sk_buff * , unsigned int ) ; extern unsigned char *skb_pull(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(0, length); return (tmp); } } __inline static bool netif_running(struct net_device const *dev ) { int tmp ; { tmp = constant_test_bit(0U, (unsigned long const volatile *)(& dev->state)); return (tmp != 0); } } extern int netif_rx(struct sk_buff * ) ; extern __be16 eth_type_trans(struct sk_buff * , struct net_device * ) ; __inline static void usb_fill_bulk_urb(struct urb *urb , struct usb_device *dev , unsigned int pipe , void *transfer_buffer , int buffer_length , void (*complete_fn)(struct urb * ) , void *context ) { { urb->dev = dev; urb->pipe = pipe; urb->transfer_buffer = transfer_buffer; urb->transfer_buffer_length = (u32 )buffer_length; urb->complete = complete_fn; urb->context = context; return; } } extern int usb_submit_urb(struct urb * , gfp_t ) ; int PHSReceive(struct bcm_mini_adapter *Adapter , USHORT usVcid , struct sk_buff *packet , UINT *punPacketLen , UCHAR *pucEthernetHdr , UINT bHeaderSuppressionEnabled ) ; static int SearchVcid(struct bcm_mini_adapter *Adapter , unsigned short usVcid ) { int iIndex ; { iIndex = 0; iIndex = 16; goto ldv_46816; ldv_46815: ; if ((int )Adapter->PackInfo[iIndex].usVCID_Value == (int )usVcid) { return (iIndex); } else { } iIndex = iIndex - 1; ldv_46816: ; if (iIndex >= 0) { goto ldv_46815; } else { goto ldv_46817; } ldv_46817: ; return (18); } } static struct bcm_usb_rcb *GetBulkInRcb(struct bcm_interface_adapter *psIntfAdapter ) { struct bcm_usb_rcb *pRcb ; UINT index ; int tmp ; int tmp___2 ; int tmp___3 ; { pRcb = 0; index = 0U; tmp___3 = atomic_read((atomic_t const *)(& psIntfAdapter->uNumRcbUsed)); if (tmp___3 <= 127 && (int )((signed char )(psIntfAdapter->psAdapter)->StopAllXaction) == 0) { tmp = atomic_read((atomic_t const *)(& psIntfAdapter->uCurrRcb)); index = (UINT )tmp; pRcb = (struct bcm_usb_rcb *)(& psIntfAdapter->asUsbRcb) + (unsigned long )index; pRcb->bUsed = 1; pRcb->psIntfAdapter = (void *)psIntfAdapter; if ((((unsigned long )psIntfAdapter->psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && (psIntfAdapter->psAdapter)->stDebugState.debug_level > 6U) && ((psIntfAdapter->psAdapter)->stDebugState.type & 4U) != 0U) && (int )(psIntfAdapter->psAdapter)->stDebugState.subtype[4] & 1) { tmp___2 = atomic_read((atomic_t const *)(& psIntfAdapter->uNumRcbUsed)); printk("\017%s:Got Rx desc %d used %d", "GetBulkInRcb", index, tmp___2); } else { } index = (index + 1U) & 127U; atomic_set(& psIntfAdapter->uCurrRcb, (int )index); atomic_inc(& psIntfAdapter->uNumRcbUsed); } else { } return (pRcb); } } static void read_bulk_callback(struct urb *urb ) { struct sk_buff *skb ; BOOLEAN bHeaderSupressionEnabled ; int QueueIndex ; UINT uiIndex ; int process_done ; struct bcm_usb_rcb *pRcb ; struct bcm_interface_adapter *psIntfAdapter ; struct bcm_mini_adapter *Adapter ; struct bcm_leader *pLeader ; long tmp ; size_t __len ; void *__ret ; size_t __len___0 ; void *__ret___0 ; size_t __len___1 ; void *__ret___1 ; size_t __len___2 ; void *__ret___2 ; bool tmp___0 ; __u16 tmp___1 ; { skb = 0; bHeaderSupressionEnabled = 0; QueueIndex = 18; uiIndex = 0U; process_done = 1; pRcb = (struct bcm_usb_rcb *)urb->context; psIntfAdapter = (struct bcm_interface_adapter *)pRcb->psIntfAdapter; Adapter = psIntfAdapter->psAdapter; pLeader = (struct bcm_leader *)urb->transfer_buffer; tmp = ldv__builtin_expect((Adapter->msg_enable & 2048U) != 0U, 0L); if (tmp != 0L) { printk("\016beceem %s: rx urb status %d length %d\n", (char *)(& (Adapter->dev)->name), urb->status, urb->actual_length); } else { } if (((int )((signed char )Adapter->device_removed) == 1 || (int )((signed char )Adapter->bEndPointHalted) == 1) || urb->actual_length == 0U) { pRcb->bUsed = 0; atomic_dec(& psIntfAdapter->uNumRcbUsed); return; } else { } if (urb->status != 0) { if (urb->status == -32) { Adapter->bEndPointHalted = 1; __wake_up(& Adapter->tx_packet_wait_queue, 3U, 1, 0); } else if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 4U) != 0U) && (int )Adapter->stDebugState.subtype[4] & 1) { printk("\017%s:Rx URB has got cancelled. status :%d", "read_bulk_callback", urb->status); } else { } pRcb->bUsed = 0; atomic_dec(& psIntfAdapter->uNumRcbUsed); urb->status = 0; return; } else { } if ((int )((signed char )Adapter->bDoSuspend) != 0 && (int )((signed char )Adapter->bPreparingForLowPowerMode) != 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 4U) != 0U) && (int )Adapter->stDebugState.subtype[4] & 1) { printk("\017%s:device is going in low power mode while PMU option selected..hence rx packet should not be process", "read_bulk_callback"); } else { } return; } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 4U) != 0U) && (int )Adapter->stDebugState.subtype[4] & 1) { printk("\017%s:Read back done len %d\n", "read_bulk_callback", (int )pLeader->PLength); } else { } if ((unsigned int )pLeader->PLength == 0U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 4U) != 0U) && (int )Adapter->stDebugState.subtype[4] & 1) { printk("\017%s:Leader Length 0", "read_bulk_callback"); } else { } atomic_dec(& psIntfAdapter->uNumRcbUsed); return; } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 4U) != 0U) && (int )Adapter->stDebugState.subtype[4] & 1) { printk("\017%s:Leader Status:0x%hX, Length:0x%hX, VCID:0x%hX", "read_bulk_callback", (int )pLeader->Status, (int )pLeader->PLength, (int )pLeader->Vcid); } else { } if ((unsigned int )pLeader->PLength > 2048U) { if ((Adapter->msg_enable & 64U) != 0U) { printk("\016beceem %s: corrupted leader length...%d\n", (char *)(& (Adapter->dev)->name), (int )pLeader->PLength); } else { } (Adapter->dev)->stats.rx_dropped = (Adapter->dev)->stats.rx_dropped + 1UL; atomic_dec(& psIntfAdapter->uNumRcbUsed); return; } else { } QueueIndex = SearchVcid(Adapter, (int )pLeader->Vcid); if (QueueIndex <= 16) { bHeaderSupressionEnabled = Adapter->PackInfo[QueueIndex].bHeaderSuppressionEnabled; bHeaderSupressionEnabled = (int )((BOOLEAN )Adapter->bPHSEnabled) & (int )bHeaderSupressionEnabled; } else { } skb = dev_alloc_skb((unsigned int )((int )pLeader->PLength + 48)); if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { printk("\016%s:NO SKBUFF!!! Dropping the Packet", "read_bulk_callback"); atomic_dec(& psIntfAdapter->uNumRcbUsed); return; } else { } tmp___1 = __fswab16((int )pLeader->Vcid); if ((unsigned int )tmp___1 == 0U || ((unsigned int )pLeader->Status <= 31U || (unsigned int )pLeader->Status > 63U)) { if ((((unsigned long )psIntfAdapter->psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && (psIntfAdapter->psAdapter)->stDebugState.debug_level > 6U) && ((psIntfAdapter->psAdapter)->stDebugState.type & 4U) != 0U) && ((psIntfAdapter->psAdapter)->stDebugState.subtype[4] & 8U) != 0U) { printk("\017%s:Received control pkt...", "read_bulk_callback"); } else { } *((unsigned short *)skb->data) = (unsigned short )pLeader->Status; __len = (size_t )pLeader->PLength; __ret = memcpy((void *)skb->data + 2U, (void const *)urb->transfer_buffer + 8U, __len); skb->len = (unsigned int )pLeader->PLength + 2U; spin_lock(& Adapter->control_queue_lock); if ((unsigned long )Adapter->RxControlHead == (unsigned long )((struct sk_buff *)0)) { Adapter->RxControlHead = skb; } else { (Adapter->RxControlTail)->next = skb; } skb->next = 0; Adapter->RxControlTail = skb; spin_unlock(& Adapter->control_queue_lock); atomic_inc(& Adapter->cntrlpktCnt); __wake_up(& Adapter->process_rx_cntrlpkt, 3U, 1, 0); } else { if ((((unsigned long )psIntfAdapter->psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && (psIntfAdapter->psAdapter)->stDebugState.debug_level > 6U) && ((psIntfAdapter->psAdapter)->stDebugState.type & 4U) != 0U) && ((psIntfAdapter->psAdapter)->stDebugState.subtype[4] & 16U) != 0U) { printk("\017%s:Received Data pkt...", "read_bulk_callback"); } else { } skb_reserve(skb, 34); __len___0 = (size_t )pLeader->PLength; __ret___0 = memcpy((void *)skb->data + 14U, (void const *)urb->transfer_buffer + 8U, __len___0); skb->dev = Adapter->dev; skb_put(skb, (unsigned int )((int )pLeader->PLength + 14)); Adapter->PackInfo[QueueIndex].uiTotalRxBytes = Adapter->PackInfo[QueueIndex].uiTotalRxBytes + (UINT )pLeader->PLength; Adapter->PackInfo[QueueIndex].uiThisPeriodRxBytes = Adapter->PackInfo[QueueIndex].uiThisPeriodRxBytes + (UINT )pLeader->PLength; if ((((unsigned long )psIntfAdapter->psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && (psIntfAdapter->psAdapter)->stDebugState.debug_level > 6U) && ((psIntfAdapter->psAdapter)->stDebugState.type & 4U) != 0U) && ((psIntfAdapter->psAdapter)->stDebugState.subtype[4] & 16U) != 0U) { printk("\017%s:Received Data pkt of len :0x%X", "read_bulk_callback", (int )pLeader->PLength); } else { } tmp___0 = netif_running((struct net_device const *)Adapter->dev); if ((int )tmp___0) { skb_pull(skb, 14U); PHSReceive(Adapter, (int )pLeader->Vcid, skb, & skb->len, 0, (UINT )bHeaderSupressionEnabled); if ((unsigned int )Adapter->PackInfo[QueueIndex].bEthCSSupport == 0U) { skb_push(skb, 14U); __len___1 = 6UL; if (__len___1 > 63UL) { __ret___1 = memcpy((void *)skb->data, (void const *)(skb->dev)->dev_addr, __len___1); } else { __ret___1 = memcpy((void *)skb->data, (void const *)(skb->dev)->dev_addr, __len___1); } __len___2 = 6UL; if (__len___2 > 63UL) { __ret___2 = memcpy((void *)skb->data + 6U, (void const *)(skb->dev)->dev_addr, __len___2); } else { __ret___2 = memcpy((void *)skb->data + 6U, (void const *)(skb->dev)->dev_addr, __len___2); } *(skb->data + 11UL) = (unsigned char )((int )*(skb->data + 11UL) + 1); *(skb->data + 12UL) = 8U; *(skb->data + 13UL) = 0U; pLeader->PLength = (unsigned int )pLeader->PLength + 14U; } else { } skb->protocol = eth_type_trans(skb, Adapter->dev); process_done = netif_rx(skb); } else { if ((((unsigned long )psIntfAdapter->psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && (psIntfAdapter->psAdapter)->stDebugState.debug_level > 6U) && ((psIntfAdapter->psAdapter)->stDebugState.type & 4U) != 0U) && ((psIntfAdapter->psAdapter)->stDebugState.subtype[4] & 16U) != 0U) { printk("\017%s:i/f not up hance freeing SKB...", "read_bulk_callback"); } else { } consume_skb(skb); } (Adapter->dev)->stats.rx_packets = (Adapter->dev)->stats.rx_packets + 1UL; (Adapter->dev)->stats.rx_bytes = (Adapter->dev)->stats.rx_bytes + (unsigned long )pLeader->PLength; uiIndex = 0U; goto ldv_46850; ldv_46849: ; if ((UINT )pLeader->PLength <= (uiIndex + 1U) * 128U && (UINT )pLeader->PLength > uiIndex * 128U) { Adapter->aRxPktSizeHist[uiIndex] = Adapter->aRxPktSizeHist[uiIndex] + 1U; } else { } uiIndex = uiIndex + 1U; ldv_46850: ; if (uiIndex <= 11U) { goto ldv_46849; } else { goto ldv_46851; } ldv_46851: ; } Adapter->PrevNumRecvDescs = (USHORT )((int )Adapter->PrevNumRecvDescs + 1); pRcb->bUsed = 0; atomic_dec(& psIntfAdapter->uNumRcbUsed); return; } } static int ReceiveRcb(struct bcm_interface_adapter *psIntfAdapter , struct bcm_usb_rcb *pRcb ) { struct urb *urb ; int retval ; unsigned int tmp ; { urb = pRcb->urb; retval = 0; tmp = __create_pipe(psIntfAdapter->udev, (unsigned int )psIntfAdapter->sBulkIn.bulk_in_endpointAddr); usb_fill_bulk_urb(urb, psIntfAdapter->udev, tmp | 3221225600U, urb->transfer_buffer, 2048, & read_bulk_callback, (void *)pRcb); if ((((int )((signed char )(psIntfAdapter->psAdapter)->device_removed) == 0 && (int )((signed char )(psIntfAdapter->psAdapter)->bEndPointHalted) == 0) && ! psIntfAdapter->bSuspended) && ! psIntfAdapter->bPreparingForBusSuspend) { retval = usb_submit_urb(urb, 32U); if (retval != 0) { if ((((unsigned long )psIntfAdapter->psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && (psIntfAdapter->psAdapter)->stDebugState.debug_level > 6U) && ((psIntfAdapter->psAdapter)->stDebugState.type & 4U) != 0U) && (int )(psIntfAdapter->psAdapter)->stDebugState.subtype[4] & 1) { printk("\017%s:failed submitting read urb, error %d", "ReceiveRcb", retval); } else { } if (retval == -32) { (psIntfAdapter->psAdapter)->bEndPointHalted = 1; __wake_up(& (psIntfAdapter->psAdapter)->tx_packet_wait_queue, 3U, 1, 0); } else { } } else { } } else { } return (retval); } } BOOLEAN InterfaceRx(struct bcm_interface_adapter *psIntfAdapter ) { USHORT RxDescCount ; int tmp ; struct bcm_usb_rcb *pRcb ; { tmp = atomic_read((atomic_t const *)(& psIntfAdapter->uNumRcbUsed)); RxDescCount = 64U - (unsigned int )((USHORT )tmp); pRcb = 0; goto ldv_46866; ldv_46865: pRcb = GetBulkInRcb(psIntfAdapter); if ((unsigned long )pRcb == (unsigned long )((struct bcm_usb_rcb *)0)) { printk("\016%s:Unable to get Rcb pointer", "InterfaceRx"); return (0); } else { } ReceiveRcb(psIntfAdapter, pRcb); RxDescCount = (USHORT )((int )RxDescCount - 1); ldv_46866: ; if ((unsigned int )RxDescCount != 0U) { goto ldv_46865; } else { goto ldv_46867; } ldv_46867: ; return (1); } } void ldv_mutex_lock_47(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_48(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_49(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_device(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_50(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___2 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex_of_device(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_51(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_device(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_52(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_53(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } int ldv_mutex_trylock_64(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_62(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_65(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_67(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_61(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_63(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_66(struct mutex *ldv_func_arg1 ) ; __inline static void usb_fill_int_urb(struct urb *urb , struct usb_device *dev , unsigned int pipe , void *transfer_buffer , int buffer_length , void (*complete_fn)(struct urb * ) , void *context , int interval ) { { urb->dev = dev; urb->pipe = pipe; urb->transfer_buffer = transfer_buffer; urb->transfer_buffer_length = (u32 )buffer_length; urb->complete = complete_fn; urb->context = context; if ((unsigned int )dev->speed == 3U || (unsigned int )dev->speed == 5U) { urb->interval = 1 << (interval + -1); } else { urb->interval = interval; } urb->start_frame = -1; return; } } static void read_int_callback(struct urb *urb ) { int status ; struct bcm_interface_adapter *psIntfAdapter ; struct bcm_mini_adapter *Adapter ; int tmp___1 ; int tmp___2 ; int tmp___3 ; { status = urb->status; psIntfAdapter = (struct bcm_interface_adapter *)urb->context; Adapter = psIntfAdapter->psAdapter; if ((Adapter->msg_enable & 512U) != 0U) { printk("\016beceem %s: interrupt status %d\n", (char *)(& (Adapter->dev)->name), status); } else { } if ((int )((signed char )Adapter->device_removed) == 1) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 524288U) != 0U) { printk("\017%s:Device has Got Removed.", "read_int_callback"); } else { } return; } else { } if ((((int )((signed char )Adapter->bPreparingForLowPowerMode) == 1 && (int )((signed char )Adapter->bDoSuspend) == 1) || (int )psIntfAdapter->bSuspended) || (int )psIntfAdapter->bPreparingForBusSuspend) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 524288U) != 0U) { printk("\017%s:Interrupt call back is called while suspending the device", "read_int_callback"); } else { } return; } else { } switch (status) { case 0: ; if (urb->actual_length != 0U) { if ((psIntfAdapter->ulInterruptData[1] & 255UL) != 0UL) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 524288U) != 0U) { printk("\017%s:Got USIM interrupt", "read_int_callback"); } else { } } else { } if ((psIntfAdapter->ulInterruptData[1] & 65280UL) != 0UL) { atomic_set(& Adapter->CurrNumFreeTxDesc, (int )((psIntfAdapter->ulInterruptData[1] & 65280UL) >> 8)); atomic_set(& Adapter->uiMBupdate, 1); if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 524288U) != 0U) { tmp___1 = atomic_read((atomic_t const *)(& Adapter->CurrNumFreeTxDesc)); printk("\017%s:TX mailbox contains %d", "read_int_callback", tmp___1); } else { } } else { } if (psIntfAdapter->ulInterruptData[1] >> 16 != 0UL) { Adapter->CurrNumRecvDescs = (USHORT )(psIntfAdapter->ulInterruptData[1] >> 16); if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 524288U) != 0U) { printk("\017%s:RX mailbox contains %d", "read_int_callback", (int )Adapter->CurrNumRecvDescs); } else { } InterfaceRx(psIntfAdapter); } else { } if ((int )((signed char )Adapter->fw_download_done) != 0 && Adapter->downloadDDR == 0) { tmp___2 = atomic_read((atomic_t const *)(& Adapter->CurrNumFreeTxDesc)); if (tmp___2 != 0) { (psIntfAdapter->psAdapter)->downloadDDR = (psIntfAdapter->psAdapter)->downloadDDR + 1; __wake_up(& Adapter->tx_packet_wait_queue, 3U, 1, 0); } else { } } else { } if ((int )((signed char )Adapter->waiting_to_fw_download_done) == 0) { Adapter->waiting_to_fw_download_done = 1; __wake_up(& Adapter->ioctl_fw_dnld_wait_queue, 3U, 1, 0); } else { } tmp___3 = atomic_read((atomic_t const *)(& Adapter->TxPktAvail)); if (tmp___3 == 0) { atomic_set(& Adapter->TxPktAvail, 1); __wake_up(& Adapter->tx_packet_wait_queue, 3U, 1, 0); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 524288U) != 0U) { printk("\017%s:Firing interrupt in URB", "read_int_callback"); } else { } } else { } goto ldv_46818; case -2: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 524288U) != 0U) { printk("\017%s:URB has got disconnected ....", "read_int_callback"); } else { } return; case -115: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 524288U) != 0U) { printk("\017%s:Impossibe condition has occurred... something very bad is going on", "read_int_callback"); } else { } goto ldv_46818; case -32: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 524288U) != 0U) { printk("\017%s:Interrupt IN endPoint has got halted/stalled...need to clear this", "read_int_callback"); } else { } Adapter->bEndPointHalted = 1; __wake_up(& Adapter->tx_packet_wait_queue, 3U, 1, 0); urb->status = 0; return; case -104: ; case -108: ; case -19: ; case -22: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 524288U) != 0U) { printk("\017%s:interrupt urb error %d", "read_int_callback", status); } else { } urb->status = 0; goto ldv_46818; default: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 2U) != 0U) { printk("\017%s:GOT DEFAULT INTERRUPT URB STATUS :%d..Please Analyze it...", "read_int_callback", status); } else { } goto ldv_46818; } ldv_46818: StartInterruptUrb(psIntfAdapter); return; } } int CreateInterruptUrb(struct bcm_interface_adapter *psIntfAdapter ) { unsigned int tmp ; { psIntfAdapter->psInterruptUrb = usb_alloc_urb(0, 208U); if ((unsigned long )psIntfAdapter->psInterruptUrb == (unsigned long )((struct urb *)0)) { if ((((unsigned long )psIntfAdapter->psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && (psIntfAdapter->psAdapter)->stDebugState.debug_level > 6U) && ((psIntfAdapter->psAdapter)->stDebugState.type & 8U) != 0U) && ((psIntfAdapter->psAdapter)->stDebugState.subtype[8] & 524288U) != 0U) { printk("\017%s:Cannot allocate interrupt urb", "CreateInterruptUrb"); } else { } return (-12); } else { } (psIntfAdapter->psInterruptUrb)->transfer_buffer = (void *)(& psIntfAdapter->ulInterruptData); (psIntfAdapter->psInterruptUrb)->transfer_buffer_length = 16U; tmp = __create_pipe(psIntfAdapter->udev, (unsigned int )psIntfAdapter->sIntrIn.int_in_endpointAddr); psIntfAdapter->sIntrIn.int_in_pipe = tmp | 1073741952U; usb_fill_int_urb(psIntfAdapter->psInterruptUrb, psIntfAdapter->udev, psIntfAdapter->sIntrIn.int_in_pipe, (psIntfAdapter->psInterruptUrb)->transfer_buffer, (int )(psIntfAdapter->psInterruptUrb)->transfer_buffer_length, & read_int_callback, (void *)psIntfAdapter, (int )psIntfAdapter->sIntrIn.int_in_interval); if ((((unsigned long )psIntfAdapter->psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && (psIntfAdapter->psAdapter)->stDebugState.debug_level > 6U) && ((psIntfAdapter->psAdapter)->stDebugState.type & 8U) != 0U) && ((psIntfAdapter->psAdapter)->stDebugState.subtype[8] & 524288U) != 0U) { printk("\017%s:Interrupt Interval: %d\n", "CreateInterruptUrb", (int )psIntfAdapter->sIntrIn.int_in_interval); } else { } return (0); } } INT StartInterruptUrb(struct bcm_interface_adapter *psIntfAdapter ) { INT status ; { status = 0; if (((((int )((signed char )(psIntfAdapter->psAdapter)->device_removed) == 0 && (int )((signed char )(psIntfAdapter->psAdapter)->bEndPointHalted) == 0) && ! psIntfAdapter->bSuspended) && ! psIntfAdapter->bPreparingForBusSuspend) && (int )((signed char )(psIntfAdapter->psAdapter)->StopAllXaction) == 0) { status = usb_submit_urb(psIntfAdapter->psInterruptUrb, 32U); if (status != 0) { if ((((unsigned long )psIntfAdapter->psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && (psIntfAdapter->psAdapter)->stDebugState.debug_level > 6U) && ((psIntfAdapter->psAdapter)->stDebugState.type & 8U) != 0U) && ((psIntfAdapter->psAdapter)->stDebugState.subtype[8] & 524288U) != 0U) { printk("\017%s:Cannot send int urb %d\n", "StartInterruptUrb", status); } else { } if (status == -32) { (psIntfAdapter->psAdapter)->bEndPointHalted = 1; __wake_up(& (psIntfAdapter->psAdapter)->tx_packet_wait_queue, 3U, 1, 0); } else { } } else { } } else { } return (status); } } void ldv_mutex_lock_61(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_62(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_63(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_device(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_64(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___2 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex_of_device(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_65(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_device(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_66(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_67(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } int ldv_mutex_trylock_78(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_76(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_79(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_81(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_75(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_77(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_80(struct mutex *ldv_func_arg1 ) ; extern void usb_autopm_put_interface(struct usb_interface * ) ; extern void usb_kill_urb(struct urb * ) ; extern int usb_control_msg(struct usb_device * , unsigned int , __u8 , __u8 , __u16 , __u16 , void * , __u16 , int ) ; extern int usb_clear_halt(struct usb_device * , int ) ; INT Bcm_clear_halt_of_endpoints(struct bcm_mini_adapter *Adapter ) ; VOID Bcm_kill_all_URBs(struct bcm_interface_adapter *psIntfAdapter ) ; INT InterfaceRDM(struct bcm_interface_adapter *psIntfAdapter , unsigned int addr , void *buff , int len ) { int bytes ; unsigned int tmp ; { if ((unsigned long )psIntfAdapter == (unsigned long )((struct bcm_interface_adapter *)0)) { return (-22); } else { } if ((int )((signed char )(psIntfAdapter->psAdapter)->device_removed) == 1) { printk("\016%s:Device got removed", "InterfaceRDM"); return (-19); } else { } if ((int )((signed char )(psIntfAdapter->psAdapter)->StopAllXaction) == 1 && (psIntfAdapter->psAdapter)->chip_id > 3201184511UL) { if ((((unsigned long )psIntfAdapter->psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && (psIntfAdapter->psAdapter)->stDebugState.debug_level > 6U) && ((psIntfAdapter->psAdapter)->stDebugState.type & 8U) != 0U) && ((psIntfAdapter->psAdapter)->stDebugState.subtype[8] & 32768U) != 0U) { printk("\017%s:Currently Xaction is not allowed on the bus", "InterfaceRDM"); } else { } return (-13); } else { } if ((int )psIntfAdapter->bSuspended || (int )psIntfAdapter->bPreparingForBusSuspend) { if ((((unsigned long )psIntfAdapter->psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && (psIntfAdapter->psAdapter)->stDebugState.debug_level > 6U) && ((psIntfAdapter->psAdapter)->stDebugState.type & 8U) != 0U) && ((psIntfAdapter->psAdapter)->stDebugState.subtype[8] & 32768U) != 0U) { printk("\017%s:Bus is in suspended states hence RDM not allowed..", "InterfaceRDM"); } else { } return (-13); } else { } (psIntfAdapter->psAdapter)->DeviceAccess = 1; tmp = __create_pipe(psIntfAdapter->udev, 0U); bytes = usb_control_msg(psIntfAdapter->udev, tmp | 2147483776U, 2, 194, (int )((__u16 )addr), (int )((__u16 )(addr >> 16)), buff, (int )((__u16 )len), 5000); if (bytes == -19) { (psIntfAdapter->psAdapter)->device_removed = 1; } else { } if (bytes < 0) { if ((((unsigned long )psIntfAdapter->psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && (psIntfAdapter->psAdapter)->stDebugState.debug_level > 6U) && ((psIntfAdapter->psAdapter)->stDebugState.type & 8U) != 0U) && ((psIntfAdapter->psAdapter)->stDebugState.subtype[8] & 32768U) != 0U) { printk("\017%s:RDM failed status :%d", "InterfaceRDM", bytes); } else if ((((unsigned long )psIntfAdapter->psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && (psIntfAdapter->psAdapter)->stDebugState.debug_level > 6U) && ((psIntfAdapter->psAdapter)->stDebugState.type & 8U) != 0U) && ((psIntfAdapter->psAdapter)->stDebugState.subtype[8] & 32768U) != 0U) { printk("\017%s:RDM sent %d", "InterfaceRDM", bytes); } else { } } else { } (psIntfAdapter->psAdapter)->DeviceAccess = 0; return (bytes); } } INT InterfaceWRM(struct bcm_interface_adapter *psIntfAdapter , unsigned int addr , void *buff , int len ) { int retval ; unsigned int tmp ; { retval = 0; if ((unsigned long )psIntfAdapter == (unsigned long )((struct bcm_interface_adapter *)0)) { return (-22); } else { } if ((int )((signed char )(psIntfAdapter->psAdapter)->device_removed) == 1) { printk("\016%s:Device got removed", "InterfaceWRM"); return (-19); } else { } if ((int )((signed char )(psIntfAdapter->psAdapter)->StopAllXaction) == 1 && (psIntfAdapter->psAdapter)->chip_id > 3201184511UL) { if ((((unsigned long )psIntfAdapter->psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && (psIntfAdapter->psAdapter)->stDebugState.debug_level > 6U) && ((psIntfAdapter->psAdapter)->stDebugState.type & 8U) != 0U) && ((psIntfAdapter->psAdapter)->stDebugState.subtype[8] & 16384U) != 0U) { printk("\017%s:Currently Xaction is not allowed on the bus...", "InterfaceWRM"); } else { } return (-13); } else { } if ((int )psIntfAdapter->bSuspended || (int )psIntfAdapter->bPreparingForBusSuspend) { if ((((unsigned long )psIntfAdapter->psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && (psIntfAdapter->psAdapter)->stDebugState.debug_level > 6U) && ((psIntfAdapter->psAdapter)->stDebugState.type & 8U) != 0U) && ((psIntfAdapter->psAdapter)->stDebugState.subtype[8] & 16384U) != 0U) { printk("\017%s:Bus is in suspended states hence RDM not allowed..", "InterfaceWRM"); } else { } return (-13); } else { } (psIntfAdapter->psAdapter)->DeviceAccess = 1; tmp = __create_pipe(psIntfAdapter->udev, 0U); retval = usb_control_msg(psIntfAdapter->udev, tmp | 2147483648U, 1, 66, (int )((__u16 )addr), (int )((__u16 )(addr >> 16)), buff, (int )((__u16 )len), 5000); if (retval == -19) { (psIntfAdapter->psAdapter)->device_removed = 1; } else { } if (retval < 0) { if ((((unsigned long )psIntfAdapter->psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && (psIntfAdapter->psAdapter)->stDebugState.debug_level > 6U) && ((psIntfAdapter->psAdapter)->stDebugState.type & 8U) != 0U) && ((psIntfAdapter->psAdapter)->stDebugState.subtype[8] & 16384U) != 0U) { printk("\017%s:WRM failed status :%d", "InterfaceWRM", retval); } else { } (psIntfAdapter->psAdapter)->DeviceAccess = 0; return (retval); } else { (psIntfAdapter->psAdapter)->DeviceAccess = 0; if ((((unsigned long )psIntfAdapter->psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && (psIntfAdapter->psAdapter)->stDebugState.debug_level > 6U) && ((psIntfAdapter->psAdapter)->stDebugState.type & 8U) != 0U) && ((psIntfAdapter->psAdapter)->stDebugState.subtype[8] & 16384U) != 0U) { printk("\017%s:WRM sent %d", "InterfaceWRM", retval); } else { } return (0); } } } int BcmRDM(void *arg , unsigned int addr , void *buff , int len ) { INT tmp ; { tmp = InterfaceRDM((struct bcm_interface_adapter *)arg, addr, buff, len); return (tmp); } } int BcmWRM(void *arg , unsigned int addr , void *buff , int len ) { INT tmp ; { tmp = InterfaceWRM((struct bcm_interface_adapter *)arg, addr, buff, len); return (tmp); } } INT Bcm_clear_halt_of_endpoints(struct bcm_mini_adapter *Adapter ) { struct bcm_interface_adapter *psIntfAdapter ; int status ; { psIntfAdapter = (struct bcm_interface_adapter *)Adapter->pvInterfaceAdapter; status = 0; Bcm_kill_all_URBs(psIntfAdapter); status = usb_clear_halt(psIntfAdapter->udev, (int )psIntfAdapter->sIntrIn.int_in_pipe); if (status != 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 524288U) != 0U) { printk("\017%s:Unable to Clear Halt of Interrupt IN end point. :%d ", "Bcm_clear_halt_of_endpoints", status); } else { } } else { } status = usb_clear_halt(psIntfAdapter->udev, (int )psIntfAdapter->sBulkIn.bulk_in_pipe); if (status != 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 524288U) != 0U) { printk("\017%s:Unable to Clear Halt of Bulk IN end point. :%d ", "Bcm_clear_halt_of_endpoints", status); } else { } } else { } status = usb_clear_halt(psIntfAdapter->udev, (int )psIntfAdapter->sBulkOut.bulk_out_pipe); if (status != 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 524288U) != 0U) { printk("\017%s:Unable to Clear Halt of Bulk OUT end point. :%d ", "Bcm_clear_halt_of_endpoints", status); } else { } } else { } return (status); } } VOID Bcm_kill_all_URBs(struct bcm_interface_adapter *psIntfAdapter ) { struct urb *tempUrb ; unsigned int i ; { tempUrb = 0; if ((unsigned long )psIntfAdapter->psInterruptUrb != (unsigned long )((struct urb *)0)) { if ((psIntfAdapter->psInterruptUrb)->status == -115) { usb_kill_urb(psIntfAdapter->psInterruptUrb); } else { } } else { } i = 0U; goto ldv_46850; ldv_46849: tempUrb = psIntfAdapter->asUsbTcb[i].urb; if ((unsigned long )tempUrb != (unsigned long )((struct urb *)0)) { if (tempUrb->status == -115) { usb_kill_urb(tempUrb); } else { } } else { } i = i + 1U; ldv_46850: ; if (i <= 127U) { goto ldv_46849; } else { goto ldv_46851; } ldv_46851: i = 0U; goto ldv_46853; ldv_46852: tempUrb = psIntfAdapter->asUsbRcb[i].urb; if ((unsigned long )tempUrb != (unsigned long )((struct urb *)0)) { if (tempUrb->status == -115) { usb_kill_urb(tempUrb); } else { } } else { } i = i + 1U; ldv_46853: ; if (i <= 127U) { goto ldv_46852; } else { goto ldv_46854; } ldv_46854: atomic_set(& psIntfAdapter->uNumTcbUsed, 0); atomic_set(& psIntfAdapter->uCurrTcb, 0); atomic_set(& psIntfAdapter->uNumRcbUsed, 0); atomic_set(& psIntfAdapter->uCurrRcb, 0); return; } } VOID putUsbSuspend(struct work_struct *work ) { struct bcm_interface_adapter *psIntfAdapter ; struct usb_interface *intf ; struct work_struct const *__mptr ; { psIntfAdapter = 0; intf = 0; __mptr = (struct work_struct const *)work; psIntfAdapter = (struct bcm_interface_adapter *)__mptr + 0xffffffffffffe750UL; intf = psIntfAdapter->interface; if (! psIntfAdapter->bSuspended) { usb_autopm_put_interface(intf); } else { } return; } } void ldv_mutex_lock_75(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_76(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_77(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_device(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_78(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___2 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex_of_device(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_79(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_device(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_80(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_81(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } int ldv_mutex_trylock_92(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_90(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_93(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_95(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_89(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_91(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_94(struct mutex *ldv_func_arg1 ) ; extern bool schedule_work(struct work_struct * ) ; extern void *usb_alloc_coherent(struct usb_device * , size_t , gfp_t , dma_addr_t * ) ; extern void usb_free_coherent(struct usb_device * , size_t , void * , dma_addr_t ) ; static void write_bulk_callback(struct urb *urb ) { struct bcm_usb_tcb *pTcb ; struct bcm_interface_adapter *psIntfAdapter ; struct bcm_link_request *pControlMsg ; struct bcm_mini_adapter *psAdapter ; BOOLEAN bpowerDownMsg ; struct bcm_mini_adapter *Adapter ; void *tmp ; long tmp___0 ; { pTcb = (struct bcm_usb_tcb *)urb->context; psIntfAdapter = (struct bcm_interface_adapter *)pTcb->psIntfAdapter; pControlMsg = (struct bcm_link_request *)urb->transfer_buffer; psAdapter = psIntfAdapter->psAdapter; bpowerDownMsg = 0; tmp = netdev_priv((struct net_device const *)gblpnetdev); Adapter = (struct bcm_mini_adapter *)tmp; tmp___0 = ldv__builtin_expect((Adapter->msg_enable & 1024U) != 0U, 0L); if (tmp___0 != 0L) { printk("\016beceem %s: transmit status %d\n", (char *)(& (Adapter->dev)->name), urb->status); } else { } if (urb->status != 0) { if (urb->status == -32) { (psIntfAdapter->psAdapter)->bEndPointHalted = 1; __wake_up(& (psIntfAdapter->psAdapter)->tx_packet_wait_queue, 3U, 1, 0); } else if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 2U) != 0U) { printk("\017%s:Tx URB has got cancelled. status :%d", "write_bulk_callback", urb->status); } else { } } else { } pTcb->bUsed = 0; atomic_dec(& psIntfAdapter->uNumTcbUsed); if ((int )((signed char )psAdapter->bPreparingForLowPowerMode) == 1) { if ((unsigned int )pControlMsg->szData[0] == 210U && (unsigned int )pControlMsg->szData[1] == 2U) { bpowerDownMsg = 1; if (urb->status != 0) { psAdapter->bPreparingForLowPowerMode = 0; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 2U) != 0U) { printk("\017%s:Idle Mode Request msg failed to reach to Modem", "write_bulk_callback"); } else { } __wake_up(& psAdapter->lowpower_mode_wait_queue, 3U, 1, 0); StartInterruptUrb(psIntfAdapter); goto err_exit; } else { } if ((int )((signed char )psAdapter->bDoSuspend) == 0) { psAdapter->IdleMode = 1; psAdapter->bPreparingForLowPowerMode = 0; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 2U) != 0U) { printk("\017%s:Host Entered in Idle Mode State...", "write_bulk_callback"); } else { } __wake_up(& psAdapter->lowpower_mode_wait_queue, 3U, 1, 0); } else { } } else if ((((unsigned int )pControlMsg->Leader.Status == 131U && (unsigned int )pControlMsg->szData[0] == 246U) && (unsigned int )pControlMsg->szData[1] == 8U) && (unsigned int )pControlMsg->szData[2] == 1U) { if (urb->status != 0) { psAdapter->bPreparingForLowPowerMode = 0; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 2U) != 0U) { printk("\017%s:Shutdown Request Msg failed to reach to Modem", "write_bulk_callback"); } else { } __wake_up(& psAdapter->lowpower_mode_wait_queue, 3U, 1, 0); StartInterruptUrb(psIntfAdapter); goto err_exit; } else { } bpowerDownMsg = 1; if ((int )((signed char )psAdapter->bDoSuspend) == 0) { psAdapter->bShutStatus = 1; psAdapter->bPreparingForLowPowerMode = 0; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 2U) != 0U) { printk("\017%s:Host Entered in shutdown Mode State...", "write_bulk_callback"); } else { } __wake_up(& psAdapter->lowpower_mode_wait_queue, 3U, 1, 0); } else { } } else { } if ((int )((signed char )psAdapter->bDoSuspend) != 0 && (int )((signed char )bpowerDownMsg) != 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 2U) != 0U) { printk("\017%s:Issuing the Bus suspend request to USB stack", "write_bulk_callback"); } else { } psIntfAdapter->bPreparingForBusSuspend = 1; schedule_work(& psIntfAdapter->usbSuspendWork); } else { } } else { } err_exit: usb_free_coherent(urb->dev, (size_t )urb->transfer_buffer_length, urb->transfer_buffer, urb->transfer_dma); return; } } static struct bcm_usb_tcb *GetBulkOutTcb(struct bcm_interface_adapter *psIntfAdapter ) { struct bcm_usb_tcb *pTcb ; UINT index ; int tmp ; int tmp___2 ; int tmp___3 ; { pTcb = 0; index = 0U; tmp___3 = atomic_read((atomic_t const *)(& psIntfAdapter->uNumTcbUsed)); if (tmp___3 <= 127 && (int )((signed char )(psIntfAdapter->psAdapter)->StopAllXaction) == 0) { tmp = atomic_read((atomic_t const *)(& psIntfAdapter->uCurrTcb)); index = (UINT )tmp; pTcb = (struct bcm_usb_tcb *)(& psIntfAdapter->asUsbTcb) + (unsigned long )index; pTcb->bUsed = 1; pTcb->psIntfAdapter = (void *)psIntfAdapter; if ((((unsigned long )psIntfAdapter->psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && (psIntfAdapter->psAdapter)->stDebugState.debug_level > 6U) && ((psIntfAdapter->psAdapter)->stDebugState.type & 2U) != 0U) && ((psIntfAdapter->psAdapter)->stDebugState.subtype[2] & 2U) != 0U) { tmp___2 = atomic_read((atomic_t const *)(& psIntfAdapter->uNumTcbUsed)); printk("\017%s:Got Tx desc %d used %d", "GetBulkOutTcb", index, tmp___2); } else { } index = (index + 1U) & 127U; atomic_set(& psIntfAdapter->uCurrTcb, (int )index); atomic_inc(& psIntfAdapter->uNumTcbUsed); } else { } return (pTcb); } } static int TransmitTcb(struct bcm_interface_adapter *psIntfAdapter , struct bcm_usb_tcb *pTcb , PVOID data , int len ) { struct urb *urb ; int retval ; size_t __len ; void *__ret ; { urb = pTcb->urb; retval = 0; urb->transfer_buffer = usb_alloc_coherent(psIntfAdapter->udev, (size_t )len, 32U, & urb->transfer_dma); if ((unsigned long )urb->transfer_buffer == (unsigned long )((void *)0)) { printk("\016%s:Error allocating memory\n", "TransmitTcb"); return (-12); } else { } __len = (size_t )len; __ret = memcpy(urb->transfer_buffer, (void const *)data, __len); urb->transfer_buffer_length = (u32 )len; if ((((unsigned long )psIntfAdapter->psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && (psIntfAdapter->psAdapter)->stDebugState.debug_level > 6U) && ((psIntfAdapter->psAdapter)->stDebugState.type & 2U) != 0U) && ((psIntfAdapter->psAdapter)->stDebugState.subtype[2] & 2U) != 0U) { printk("\017%s:Sending Bulk out packet\n", "TransmitTcb"); } else { } if ((psIntfAdapter->psAdapter)->chip_id == 3201172240UL && (int )psIntfAdapter->bHighSpeedDevice) { usb_fill_int_urb(urb, psIntfAdapter->udev, psIntfAdapter->sBulkOut.bulk_out_pipe, urb->transfer_buffer, len, & write_bulk_callback, (void *)pTcb, (int )psIntfAdapter->sBulkOut.int_out_interval); } else { usb_fill_bulk_urb(urb, psIntfAdapter->udev, psIntfAdapter->sBulkOut.bulk_out_pipe, urb->transfer_buffer, len, & write_bulk_callback, (void *)pTcb); } urb->transfer_flags = urb->transfer_flags | 4U; if ((((int )((signed char )(psIntfAdapter->psAdapter)->device_removed) == 0 && (int )((signed char )(psIntfAdapter->psAdapter)->bEndPointHalted) == 0) && ! psIntfAdapter->bSuspended) && ! psIntfAdapter->bPreparingForBusSuspend) { retval = usb_submit_urb(urb, 32U); if (retval != 0) { if ((((unsigned long )psIntfAdapter->psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && (psIntfAdapter->psAdapter)->stDebugState.debug_level > 6U) && ((psIntfAdapter->psAdapter)->stDebugState.type & 2U) != 0U) && ((psIntfAdapter->psAdapter)->stDebugState.subtype[2] & 2U) != 0U) { printk("\017%s:failed submitting write urb, error %d", "TransmitTcb", retval); } else { } if (retval == -32) { (psIntfAdapter->psAdapter)->bEndPointHalted = 1; __wake_up(& (psIntfAdapter->psAdapter)->tx_packet_wait_queue, 3U, 1, 0); } else { } } else { } } else { } return (retval); } } INT InterfaceTransmitPacket(PVOID arg , PVOID data , UINT len ) { struct bcm_usb_tcb *pTcb ; struct bcm_interface_adapter *psIntfAdapter ; int tmp ; { pTcb = 0; psIntfAdapter = (struct bcm_interface_adapter *)arg; pTcb = GetBulkOutTcb(psIntfAdapter); if ((unsigned long )pTcb == (unsigned long )((struct bcm_usb_tcb *)0)) { printk("\016%s:No URB to transmit packet, dropping packet", "InterfaceTransmitPacket"); return (-14); } else { } tmp = TransmitTcb(psIntfAdapter, pTcb, data, (int )len); return (tmp); } } void ldv_mutex_lock_89(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_90(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_91(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_device(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_92(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___2 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex_of_device(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_93(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_device(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_94(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_95(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } __inline static void clear_bit(int nr , unsigned long volatile *addr ) { { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; btr %1,%0": "+m" (*((long volatile *)addr)): "Ir" (nr)); return; } } int ldv_mutex_trylock_106(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_104(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_107(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_109(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_103(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_105(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_108(struct mutex *ldv_func_arg1 ) ; extern unsigned long get_seconds(void) ; extern unsigned long _copy_to_user(void * , void const * , unsigned int ) ; __inline static int copy_to_user(void *dst , void const *src , unsigned int size ) { unsigned long tmp ; { might_fault(); tmp = _copy_to_user(dst, src, size); return ((int )tmp); } } __inline static 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 netif_tx_start_queue(struct netdev_queue *dev_queue ) { { clear_bit(0, (unsigned long volatile *)(& dev_queue->state)); return; } } __inline static void netif_start_queue(struct net_device *dev ) { struct netdev_queue *tmp ; { tmp = netdev_get_tx_queue((struct net_device const *)dev, 0U); netif_tx_start_queue(tmp); return; } } extern void netif_carrier_on(struct net_device * ) ; unsigned long StoreCmControlResponseMessage(struct bcm_mini_adapter *Adapter , void *pvBuffer , unsigned int *puBufferLength ) ; int AllocAdapterDsxBuffer(struct bcm_mini_adapter *Adapter ) ; int FreeAdapterDsxBuffer(struct bcm_mini_adapter *Adapter ) ; unsigned long SetUpTargetDsxBuffers(struct bcm_mini_adapter *Adapter ) ; BOOLEAN CmControlResponseMessage(struct bcm_mini_adapter *Adapter , void *pvBuffer ) ; void DumpPhsRules(PPHS_DEVICE_EXTENSION pDeviceExtension ) ; ULONG PhsUpdateClassifierRule(void *pvContext , B_UINT16 uiVcid , B_UINT16 uiClsId , S_PHS_RULE *psPhsRule , B_UINT8 u8AssociatedPHSI ) ; ULONG PhsDeletePHSRule(void *pvContext , B_UINT16 uiVcid , B_UINT8 u8PHSI ) ; ULONG PhsDeleteClassifierRule(void *pvContext , B_UINT16 uiVcid , B_UINT16 uiClsId ) ; ULONG PhsDeleteSFRules(void *pvContext , B_UINT16 uiVcid ) ; VOID DeleteAllClassifiersForSF(struct bcm_mini_adapter *Adapter , UINT uiSearchRuleIndex ) ; INT CopyBufferToControlPacket(struct bcm_mini_adapter *Adapter , void *ioBuffer ) ; VOID SortPackInfo(struct bcm_mini_adapter *Adapter ) ; VOID SortClassifiers(struct bcm_mini_adapter *Adapter ) ; INT SearchSfid(struct bcm_mini_adapter *Adapter , UINT uiSfid ) ; int get_dsx_sf_data_to_application(struct bcm_mini_adapter *Adapter , UINT uiSFId , void *user_buffer ) ; void CopyMIBSExtendedSFParameters(struct bcm_mini_adapter *Adapter , struct bcm_connect_mgr_params *psfLocalSet , UINT uiSearchRuleIndex ) ; void ClearTargetDSXBuffer(struct bcm_mini_adapter *Adapter , B_UINT16 TID , BOOLEAN bFreeAll ) ; void flush_queue(struct bcm_mini_adapter *Adapter , unsigned int iQIndex ) ; static ULONG GetNextTargetBufferLocation(struct bcm_mini_adapter *Adapter , B_UINT16 tid ) ; INT SearchSfid(struct bcm_mini_adapter *Adapter , UINT uiSfid ) { int i ; { i = 16; goto ldv_46824; ldv_46823: ; if (Adapter->PackInfo[i].ulSFID == (ULONG )uiSfid) { return (i); } else { } i = i - 1; ldv_46824: ; if (i >= 0) { goto ldv_46823; } else { goto ldv_46825; } ldv_46825: ; return (18); } } static int SearchFreeSfid(struct bcm_mini_adapter *Adapter ) { int i ; { i = 0; goto ldv_46831; ldv_46830: ; if (Adapter->PackInfo[i].ulSFID == 0UL) { return (i); } else { } i = i + 1; ldv_46831: ; if (i <= 15) { goto ldv_46830; } else { goto ldv_46832; } ldv_46832: ; return (18); } } static int SearchClsid(struct bcm_mini_adapter *Adapter , ULONG ulSFID , B_UINT16 uiClassifierID ) { int i ; { i = 0; goto ldv_46840; ldv_46839: ; if (((int )((signed char )Adapter->astClassifierTable[i].bUsed) != 0 && (int )Adapter->astClassifierTable[i].uiClassifierRuleIndex == (int )uiClassifierID) && Adapter->astClassifierTable[i].ulSFID == ulSFID) { return (i); } else { } i = i + 1; ldv_46840: ; if (i <= 99) { goto ldv_46839; } else { goto ldv_46841; } ldv_46841: ; return (101); } } static int SearchFreeClsid(struct bcm_mini_adapter *Adapter ) { int i ; { i = 0; goto ldv_46847; ldv_46846: ; if ((int )((signed char )Adapter->astClassifierTable[i].bUsed) == 0) { return (i); } else { } i = i + 1; ldv_46847: ; if (i <= 99) { goto ldv_46846; } else { goto ldv_46848; } ldv_46848: ; return (101); } } static VOID deleteSFBySfid(struct bcm_mini_adapter *Adapter , UINT uiSearchRuleIndex ) { { flush_queue(Adapter, uiSearchRuleIndex); DeleteAllClassifiersForSF(Adapter, uiSearchRuleIndex); memset((void *)(& Adapter->PackInfo) + (unsigned long )uiSearchRuleIndex, 0, 200UL); return; } } __inline static VOID CopyIpAddrToClassifier(struct bcm_classifier_rule *pstClassifierEntry , B_UINT8 u8IpAddressLen , B_UINT8 *pu8IpAddressMaskSrc , BOOLEAN bIpVersion6 , E_IPADDR_CONTEXT eIpAddrContext ) { int i ; UINT nSizeOfIPAddressInBytes ; UCHAR *ptrClassifierIpAddress ; UCHAR *ptrClassifierIpMask ; struct bcm_mini_adapter *Adapter ; void *tmp ; size_t __len ; void *__ret ; __u32 tmp___0 ; __u32 tmp___1 ; size_t __len___0 ; void *__ret___0 ; __u32 tmp___2 ; __u32 tmp___3 ; __u32 tmp___4 ; __u32 tmp___5 ; __u32 tmp___6 ; __u32 tmp___7 ; int tmp___8 ; { i = 0; nSizeOfIPAddressInBytes = 4U; ptrClassifierIpAddress = 0; ptrClassifierIpMask = 0; tmp = netdev_priv((struct net_device const *)gblpnetdev); Adapter = (struct bcm_mini_adapter *)tmp; if ((int )((signed char )bIpVersion6) != 0) { nSizeOfIPAddressInBytes = 16U; } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:Ip Address Range Length:0x%X ", "CopyIpAddrToClassifier", (int )u8IpAddressLen); } else { } if ((int )((signed char )bIpVersion6) != 0) { tmp___8 = 128; } else { tmp___8 = 32; } if (tmp___8 >= (int )u8IpAddressLen) { if ((unsigned int )eIpAddrContext == 1U) { pstClassifierEntry->ucIPDestinationAddressLength = (UCHAR )((UINT )u8IpAddressLen / (nSizeOfIPAddressInBytes * 2U)); if ((int )((signed char )bIpVersion6) != 0) { ptrClassifierIpAddress = (UCHAR *)(& pstClassifierEntry->stDestIpAddress.ldv_45854.ucIpv6Address); ptrClassifierIpMask = (UCHAR *)(& pstClassifierEntry->stDestIpAddress.ldv_45854.ucIpv6Mask); } else { ptrClassifierIpAddress = (UCHAR *)(& pstClassifierEntry->stDestIpAddress.ldv_45850.ucIpv4Address); ptrClassifierIpMask = (UCHAR *)(& pstClassifierEntry->stDestIpAddress.ldv_45850.ucIpv4Mask); } } else if ((unsigned int )eIpAddrContext == 0U) { pstClassifierEntry->ucIPSourceAddressLength = (UCHAR )((UINT )u8IpAddressLen / (nSizeOfIPAddressInBytes * 2U)); if ((int )((signed char )bIpVersion6) != 0) { ptrClassifierIpAddress = (UCHAR *)(& pstClassifierEntry->stSrcIpAddress.ldv_45854.ucIpv6Address); ptrClassifierIpMask = (UCHAR *)(& pstClassifierEntry->stSrcIpAddress.ldv_45854.ucIpv6Mask); } else { ptrClassifierIpAddress = (UCHAR *)(& pstClassifierEntry->stSrcIpAddress.ldv_45850.ucIpv4Address); ptrClassifierIpMask = (UCHAR *)(& pstClassifierEntry->stSrcIpAddress.ldv_45850.ucIpv4Mask); } } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:Address Length:0x%X\n", "CopyIpAddrToClassifier", (int )pstClassifierEntry->ucIPDestinationAddressLength); } else { } goto ldv_46873; ldv_46872: __len = (size_t )nSizeOfIPAddressInBytes; __ret = memcpy((void *)ptrClassifierIpAddress + (unsigned long )((UINT )i * nSizeOfIPAddressInBytes), (void const *)pu8IpAddressMaskSrc + (unsigned long )(((UINT )i * nSizeOfIPAddressInBytes) * 2U), __len); if ((int )((signed char )bIpVersion6) == 0) { if ((unsigned int )eIpAddrContext == 0U) { tmp___0 = __fswab32((unsigned int )pstClassifierEntry->stSrcIpAddress.ldv_45842.ulIpv4Addr[i]); pstClassifierEntry->stSrcIpAddress.ldv_45842.ulIpv4Addr[i] = (ULONG )tmp___0; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:Src Ip Address:0x%luX ", "CopyIpAddrToClassifier", pstClassifierEntry->stSrcIpAddress.ldv_45842.ulIpv4Addr[i]); } else { } } else if ((unsigned int )eIpAddrContext == 1U) { tmp___1 = __fswab32((unsigned int )pstClassifierEntry->stDestIpAddress.ldv_45842.ulIpv4Addr[i]); pstClassifierEntry->stDestIpAddress.ldv_45842.ulIpv4Addr[i] = (ULONG )tmp___1; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:Dest Ip Address:0x%luX ", "CopyIpAddrToClassifier", pstClassifierEntry->stDestIpAddress.ldv_45842.ulIpv4Addr[i]); } else { } } else { } } else { } u8IpAddressLen = (int )u8IpAddressLen - (int )((B_UINT8 )nSizeOfIPAddressInBytes); if ((UINT )u8IpAddressLen >= nSizeOfIPAddressInBytes) { __len___0 = (size_t )nSizeOfIPAddressInBytes; __ret___0 = memcpy((void *)ptrClassifierIpMask + (unsigned long )((UINT )i * nSizeOfIPAddressInBytes), (void const *)(pu8IpAddressMaskSrc + ((unsigned long )nSizeOfIPAddressInBytes + (unsigned long )(((UINT )i * nSizeOfIPAddressInBytes) * 2U))), __len___0); if ((int )((signed char )bIpVersion6) == 0) { if ((unsigned int )eIpAddrContext == 0U) { tmp___2 = __fswab32((unsigned int )pstClassifierEntry->stSrcIpAddress.ldv_45842.ulIpv4Mask[i]); pstClassifierEntry->stSrcIpAddress.ldv_45842.ulIpv4Mask[i] = (ULONG )tmp___2; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:Src Ip Mask Address:0x%luX ", "CopyIpAddrToClassifier", pstClassifierEntry->stSrcIpAddress.ldv_45842.ulIpv4Mask[i]); } else { } } else if ((unsigned int )eIpAddrContext == 1U) { tmp___3 = __fswab32((unsigned int )pstClassifierEntry->stDestIpAddress.ldv_45842.ulIpv4Mask[i]); pstClassifierEntry->stDestIpAddress.ldv_45842.ulIpv4Mask[i] = (ULONG )tmp___3; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:Dest Ip Mask Address:0x%luX ", "CopyIpAddrToClassifier", pstClassifierEntry->stDestIpAddress.ldv_45842.ulIpv4Mask[i]); } else { } } else { } } else { } u8IpAddressLen = (int )u8IpAddressLen - (int )((B_UINT8 )nSizeOfIPAddressInBytes); } else { } if ((unsigned int )u8IpAddressLen == 0U) { pstClassifierEntry->bDestIpValid = 1; } else { } i = i + 1; ldv_46873: ; if ((UINT )u8IpAddressLen >= nSizeOfIPAddressInBytes && i <= 3) { goto ldv_46872; } else { goto ldv_46874; } ldv_46874: ; if ((int )((signed char )bIpVersion6) != 0) { i = 0; goto ldv_46876; ldv_46875: ; if ((unsigned int )eIpAddrContext == 0U) { tmp___4 = __fswab32((unsigned int )pstClassifierEntry->stSrcIpAddress.ldv_45846.ulIpv6Addr[i]); pstClassifierEntry->stSrcIpAddress.ldv_45846.ulIpv6Addr[i] = (ULONG )tmp___4; tmp___5 = __fswab32((unsigned int )pstClassifierEntry->stSrcIpAddress.ldv_45846.ulIpv6Mask[i]); pstClassifierEntry->stSrcIpAddress.ldv_45846.ulIpv6Mask[i] = (ULONG )tmp___5; } else if ((unsigned int )eIpAddrContext == 1U) { tmp___6 = __fswab32((unsigned int )pstClassifierEntry->stDestIpAddress.ldv_45846.ulIpv6Addr[i]); pstClassifierEntry->stDestIpAddress.ldv_45846.ulIpv6Addr[i] = (ULONG )tmp___6; tmp___7 = __fswab32((unsigned int )pstClassifierEntry->stDestIpAddress.ldv_45846.ulIpv6Mask[i]); pstClassifierEntry->stDestIpAddress.ldv_45846.ulIpv6Mask[i] = (ULONG )tmp___7; } else { } i = i + 1; ldv_46876: ; if (i <= 15) { goto ldv_46875; } else { goto ldv_46877; } ldv_46877: ; } else { } } else { } return; } } void ClearTargetDSXBuffer(struct bcm_mini_adapter *Adapter , B_UINT16 TID , BOOLEAN bFreeAll ) { int i ; { i = 0; goto ldv_46887; ldv_46886: ; if ((int )((signed char )Adapter->astTargetDsxBuffer[i].valid) != 0) { goto ldv_46884; } else { } if ((int )((signed char )bFreeAll) != 0 || (int )Adapter->astTargetDsxBuffer[i].tid == (int )TID) { printk("\016%s:ClearTargetDSXBuffer: found tid %d buffer cleared %lx\n", "ClearTargetDSXBuffer", (int )TID, Adapter->astTargetDsxBuffer[i].ulTargetDsxBuffer); Adapter->astTargetDsxBuffer[i].valid = 1; Adapter->astTargetDsxBuffer[i].tid = 0U; Adapter->ulFreeTargetBufferCnt = Adapter->ulFreeTargetBufferCnt + 1UL; } else { } ldv_46884: i = i + 1; ldv_46887: ; if ((ULONG )i < Adapter->ulTotalTargetBuffersAvailable) { goto ldv_46886; } else { goto ldv_46888; } ldv_46888: ; return; } } __inline static VOID CopyClassifierRuleToSF(struct bcm_mini_adapter *Adapter , struct bcm_convergence_types *psfCSType , UINT uiSearchRuleIndex , UINT nClassifierIndex ) { struct bcm_classifier_rule *pstClassifierEntry ; int i ; __u16 tmp___1 ; __u16 tmp___2 ; __u16 tmp___3 ; __u16 tmp___4 ; __u16 tmp___5 ; __u16 tmp___6 ; size_t __len ; void *__ret ; size_t __len___0 ; void *__ret___0 ; size_t __len___1 ; void *__ret___1 ; size_t __len___2 ; void *__ret___2 ; size_t __len___3 ; void *__ret___3 ; size_t __len___4 ; void *__ret___4 ; __u16 tmp___7 ; __u16 tmp___8 ; { pstClassifierEntry = 0; if ((unsigned int )Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value == 0U || nClassifierIndex > 99U) { return; } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { tmp___1 = __fswab16((int )psfCSType->cCPacketClassificationRule.u16PacketClassificationRuleIndex); printk("\017%s:Storing Classifier Rule Index : %X", "CopyClassifierRuleToSF", (int )tmp___1); } else { } if (nClassifierIndex > 99U) { return; } else { } pstClassifierEntry = (struct bcm_classifier_rule *)(& Adapter->astClassifierTable) + (unsigned long )nClassifierIndex; if ((unsigned long )pstClassifierEntry != (unsigned long )((struct bcm_classifier_rule *)0)) { pstClassifierEntry->bIpv6Protocol = (unsigned int )Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion == 6U; pstClassifierEntry->ucDestPortRangeLength = (UCHAR )((unsigned int )psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRangeLength / 4U); if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:Destination Port Range Length:0x%X ", "CopyClassifierRuleToSF", (int )pstClassifierEntry->ucDestPortRangeLength); } else { } if ((unsigned int )psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRangeLength <= 4U) { i = 0; goto ldv_46899; ldv_46898: pstClassifierEntry->usDestPortRangeLo[i] = *((unsigned short *)(& psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange) + (unsigned long )i); pstClassifierEntry->usDestPortRangeHi[i] = *((unsigned short *)(& psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange) + ((unsigned long )i + 2UL)); tmp___2 = __fswab16((int )pstClassifierEntry->usDestPortRangeLo[i]); pstClassifierEntry->usDestPortRangeLo[i] = tmp___2; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:Destination Port Range Lo:0x%X ", "CopyClassifierRuleToSF", (int )pstClassifierEntry->usDestPortRangeLo[i]); } else { } tmp___3 = __fswab16((int )pstClassifierEntry->usDestPortRangeHi[i]); pstClassifierEntry->usDestPortRangeHi[i] = tmp___3; i = i + 1; ldv_46899: ; if ((int )pstClassifierEntry->ucDestPortRangeLength > i) { goto ldv_46898; } else { goto ldv_46900; } ldv_46900: ; } else { pstClassifierEntry->ucDestPortRangeLength = 0U; } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:Source Port Range Length:0x%X ", "CopyClassifierRuleToSF", (int )psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength); } else { } if ((unsigned int )psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength <= 4U) { pstClassifierEntry->ucSrcPortRangeLength = (UCHAR )((unsigned int )psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength / 4U); i = 0; goto ldv_46902; ldv_46901: pstClassifierEntry->usSrcPortRangeLo[i] = *((unsigned short *)(& psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange) + (unsigned long )i); pstClassifierEntry->usSrcPortRangeHi[i] = *((unsigned short *)(& psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange) + ((unsigned long )i + 2UL)); tmp___4 = __fswab16((int )pstClassifierEntry->usSrcPortRangeLo[i]); pstClassifierEntry->usSrcPortRangeLo[i] = tmp___4; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:Source Port Range Lo:0x%X ", "CopyClassifierRuleToSF", (int )pstClassifierEntry->usSrcPortRangeLo[i]); } else { } tmp___5 = __fswab16((int )pstClassifierEntry->usSrcPortRangeHi[i]); pstClassifierEntry->usSrcPortRangeHi[i] = tmp___5; i = i + 1; ldv_46902: ; if ((int )pstClassifierEntry->ucSrcPortRangeLength > i) { goto ldv_46901; } else { goto ldv_46903; } ldv_46903: ; } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:Ip Destination Parameters : ", "CopyClassifierRuleToSF"); } else { } CopyIpAddrToClassifier(pstClassifierEntry, (int )psfCSType->cCPacketClassificationRule.u8IPDestinationAddressLength, (B_UINT8 *)(& psfCSType->cCPacketClassificationRule.u8IPDestinationAddress), (unsigned int )Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion == 6U, 1); if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:Ip Source Parameters : ", "CopyClassifierRuleToSF"); } else { } CopyIpAddrToClassifier(pstClassifierEntry, (int )psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddressLength, (B_UINT8 *)(& psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddress), (unsigned int )Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion == 6U, 0); if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:TOS Length:0x%X ", "CopyClassifierRuleToSF", (int )psfCSType->cCPacketClassificationRule.u8IPTypeOfServiceLength); } else { } if ((unsigned int )psfCSType->cCPacketClassificationRule.u8IPTypeOfServiceLength == 3U) { pstClassifierEntry->ucIPTypeOfServiceLength = psfCSType->cCPacketClassificationRule.u8IPTypeOfServiceLength; pstClassifierEntry->ucTosLow = psfCSType->cCPacketClassificationRule.u8IPTypeOfService[0]; pstClassifierEntry->ucTosHigh = psfCSType->cCPacketClassificationRule.u8IPTypeOfService[1]; pstClassifierEntry->ucTosMask = psfCSType->cCPacketClassificationRule.u8IPTypeOfService[2]; pstClassifierEntry->bTOSValid = 1; } else { } if ((unsigned int )psfCSType->cCPacketClassificationRule.u8Protocol == 0U) { pstClassifierEntry->ucProtocolLength = 0U; } else { pstClassifierEntry->ucProtocolLength = 1U; } pstClassifierEntry->ucProtocol[0] = psfCSType->cCPacketClassificationRule.u8Protocol; pstClassifierEntry->u8ClassifierRulePriority = psfCSType->cCPacketClassificationRule.u8ClassifierRulePriority; pstClassifierEntry->ucDirection = Adapter->PackInfo[uiSearchRuleIndex].ucDirection; tmp___6 = __fswab16((int )psfCSType->cCPacketClassificationRule.u16PacketClassificationRuleIndex); pstClassifierEntry->uiClassifierRuleIndex = tmp___6; pstClassifierEntry->usVCID_Value = Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value; pstClassifierEntry->ulSFID = Adapter->PackInfo[uiSearchRuleIndex].ulSFID; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:Search Index %d Dir: %d, Index: %d, Vcid: %d\n", "CopyClassifierRuleToSF", uiSearchRuleIndex, (int )pstClassifierEntry->ucDirection, (int )pstClassifierEntry->uiClassifierRuleIndex, (int )pstClassifierEntry->usVCID_Value); } else { } if ((unsigned int )psfCSType->cCPacketClassificationRule.u8AssociatedPHSI != 0U) { pstClassifierEntry->u8AssociatedPHSI = psfCSType->cCPacketClassificationRule.u8AssociatedPHSI; } else { } pstClassifierEntry->ucEthCSSrcMACLen = psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddressLength; __len = 6UL; if (__len > 63UL) { __ret = memcpy((void *)(& pstClassifierEntry->au8EThCSSrcMAC), (void const *)(& psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress), __len); } else { __ret = memcpy((void *)(& pstClassifierEntry->au8EThCSSrcMAC), (void const *)(& psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress), __len); } __len___0 = 6UL; if (__len___0 > 63UL) { __ret___0 = memcpy((void *)(& pstClassifierEntry->au8EThCSSrcMACMask), (void const *)(& psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress) + 6U, __len___0); } else { __ret___0 = memcpy((void *)(& pstClassifierEntry->au8EThCSSrcMACMask), (void const *)(& psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress) + 6U, __len___0); } pstClassifierEntry->ucEthCSDestMACLen = psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddressLength; __len___1 = 6UL; if (__len___1 > 63UL) { __ret___1 = memcpy((void *)(& pstClassifierEntry->au8EThCSDestMAC), (void const *)(& psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress), __len___1); } else { __ret___1 = memcpy((void *)(& pstClassifierEntry->au8EThCSDestMAC), (void const *)(& psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress), __len___1); } __len___2 = 6UL; if (__len___2 > 63UL) { __ret___2 = memcpy((void *)(& pstClassifierEntry->au8EThCSDestMACMask), (void const *)(& psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress) + 6U, __len___2); } else { __ret___2 = memcpy((void *)(& pstClassifierEntry->au8EThCSDestMACMask), (void const *)(& psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress) + 6U, __len___2); } pstClassifierEntry->ucEtherTypeLen = psfCSType->cCPacketClassificationRule.u8EthertypeLength; __len___3 = 3UL; if (__len___3 > 63UL) { __ret___3 = memcpy((void *)(& pstClassifierEntry->au8EthCSEtherType), (void const *)(& psfCSType->cCPacketClassificationRule.u8Ethertype), __len___3); } else { __ret___3 = memcpy((void *)(& pstClassifierEntry->au8EthCSEtherType), (void const *)(& psfCSType->cCPacketClassificationRule.u8Ethertype), __len___3); } __len___4 = 2UL; if (__len___4 > 63UL) { __ret___4 = memcpy((void *)(& pstClassifierEntry->usUserPriority), (void const *)(& psfCSType->cCPacketClassificationRule.u16UserPriority), __len___4); } else { __ret___4 = memcpy((void *)(& pstClassifierEntry->usUserPriority), (void const *)(& psfCSType->cCPacketClassificationRule.u16UserPriority), __len___4); } tmp___7 = __fswab16((int )psfCSType->cCPacketClassificationRule.u16VLANID); pstClassifierEntry->usVLANID = tmp___7; tmp___8 = __fswab16((int )psfCSType->cCPacketClassificationRule.u16ValidityBitMap); pstClassifierEntry->usValidityBitMap = tmp___8; pstClassifierEntry->bUsed = 1; } else { } return; } } __inline static VOID DeleteClassifierRuleFromSF(struct bcm_mini_adapter *Adapter , UINT uiSearchRuleIndex , UINT nClassifierIndex ) { struct bcm_classifier_rule *pstClassifierEntry ; B_UINT16 u16PacketClassificationRuleIndex ; USHORT usVCID ; { pstClassifierEntry = 0; usVCID = Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value; if (nClassifierIndex > 99U) { return; } else { } if ((unsigned int )usVCID == 0U) { return; } else { } u16PacketClassificationRuleIndex = Adapter->astClassifierTable[nClassifierIndex].uiClassifierRuleIndex; pstClassifierEntry = (struct bcm_classifier_rule *)(& Adapter->astClassifierTable) + (unsigned long )nClassifierIndex; if ((unsigned long )pstClassifierEntry != (unsigned long )((struct bcm_classifier_rule *)0)) { pstClassifierEntry->bUsed = 0; pstClassifierEntry->uiClassifierRuleIndex = 0U; memset((void *)pstClassifierEntry, 0, 1216UL); PhsDeleteClassifierRule((void *)(& Adapter->stBCMPhsContext), (int )usVCID, (int )u16PacketClassificationRuleIndex); } else { } return; } } VOID DeleteAllClassifiersForSF(struct bcm_mini_adapter *Adapter , UINT uiSearchRuleIndex ) { struct bcm_classifier_rule *pstClassifierEntry ; int i ; USHORT ulVCID ; { pstClassifierEntry = 0; ulVCID = Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value; if ((unsigned int )ulVCID == 0U) { return; } else { } i = 0; goto ldv_46938; ldv_46937: ; if ((int )Adapter->astClassifierTable[i].usVCID_Value == (int )ulVCID) { pstClassifierEntry = (struct bcm_classifier_rule *)(& Adapter->astClassifierTable) + (unsigned long )i; if ((int )((signed char )pstClassifierEntry->bUsed) != 0) { DeleteClassifierRuleFromSF(Adapter, uiSearchRuleIndex, (UINT )i); } else { } } else { } i = i + 1; ldv_46938: ; if (i <= 99) { goto ldv_46937; } else { goto ldv_46939; } ldv_46939: PhsDeleteSFRules((void *)(& Adapter->stBCMPhsContext), (int )ulVCID); return; } } static VOID CopyToAdapter(struct bcm_mini_adapter *Adapter , struct bcm_connect_mgr_params *psfLocalSet , UINT uiSearchRuleIndex , UCHAR ucDsxType , struct bcm_add_indication_alt *pstAddIndication ) { ULONG ulSFID ; UINT nClassifierIndex ; enum E_CLASSIFIER_ACTION eClassifierAction ; B_UINT16 u16PacketClassificationRuleIndex ; int i ; struct bcm_convergence_types *psfCSType ; S_PHS_RULE sPhsRule ; USHORT uVCID ; UINT UGIValue ; __u32 tmp___1 ; __u32 tmp___2 ; size_t __len ; void *__ret ; __u32 tmp___3 ; __u16 tmp___4 ; int tmp___5 ; int tmp___6 ; int tmp___7 ; int tmp___8 ; unsigned int uiClassifierIndex ; size_t __len___0 ; void *__ret___0 ; size_t __len___1 ; void *__ret___1 ; size_t __len___2 ; void *__ret___2 ; size_t __len___3 ; void *__ret___3 ; size_t __len___4 ; void *__ret___4 ; __u32 tmp___9 ; __u32 tmp___10 ; __u32 tmp___11 ; __u16 tmp___12 ; UINT UGIFactor ; __u32 tmp___15 ; { nClassifierIndex = 0U; eClassifierAction = 0; u16PacketClassificationRuleIndex = 0U; psfCSType = 0; uVCID = Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value; UGIValue = 0U; Adapter->PackInfo[uiSearchRuleIndex].bValid = 1; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:Search Rule Index = %d\n", "CopyToAdapter", uiSearchRuleIndex); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { tmp___1 = __fswab32(psfLocalSet->u32SFID); printk("\017%s:%s: SFID= %x ", "CopyToAdapter", "CopyToAdapter", tmp___1); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:Updating Queue %d", "CopyToAdapter", uiSearchRuleIndex); } else { } tmp___2 = __fswab32(psfLocalSet->u32SFID); ulSFID = (ULONG )tmp___2; Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport = 0U; Adapter->PackInfo[uiSearchRuleIndex].bEthCSSupport = 0U; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:CopyToAdapter : u8CSSpecification : %X\n", "CopyToAdapter", (int )psfLocalSet->u8CSSpecification); } else { } switch ((int )psfLocalSet->u8CSSpecification) { case 1: Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport = 1U; goto ldv_46958; case 2: Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport = 2U; goto ldv_46958; case 3: ; case 4: Adapter->PackInfo[uiSearchRuleIndex].bEthCSSupport = 1U; goto ldv_46958; case 7: ; case 5: Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport = 1U; Adapter->PackInfo[uiSearchRuleIndex].bEthCSSupport = 1U; goto ldv_46958; case 8: ; case 6: Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport = 2U; Adapter->PackInfo[uiSearchRuleIndex].bEthCSSupport = 1U; goto ldv_46958; default: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:Error in value of CS Classification.. setting default to IP CS\n", "CopyToAdapter"); } else { } Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport = 1U; goto ldv_46958; } ldv_46958: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:CopyToAdapter : Queue No : %X ETH CS Support : %X , IP CS Support : %X\n", "CopyToAdapter", uiSearchRuleIndex, (int )Adapter->PackInfo[uiSearchRuleIndex].bEthCSSupport, (int )Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport); } else { } if ((unsigned int )Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport == 2U) { Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion = 6U; } else { Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion = 4U; } if ((int )((signed char )Adapter->bETHCSEnabled) == 0) { Adapter->PackInfo[uiSearchRuleIndex].bEthCSSupport = 0U; } else { } if ((unsigned int )psfLocalSet->u8ServiceClassNameLength != 0U && (unsigned int )psfLocalSet->u8ServiceClassNameLength <= 31U) { __len = (size_t )psfLocalSet->u8ServiceClassNameLength; __ret = memcpy((void *)(& Adapter->PackInfo[uiSearchRuleIndex].ucServiceClassName), (void const *)(& psfLocalSet->u8ServiceClassName), __len); } else { } Adapter->PackInfo[uiSearchRuleIndex].u8QueueType = psfLocalSet->u8ServiceFlowSchedulingType; if ((unsigned int )Adapter->PackInfo[uiSearchRuleIndex].u8QueueType == 2U && (unsigned int )Adapter->PackInfo[uiSearchRuleIndex].ucDirection != 0U) { Adapter->usBestEffortQueueIndex = (USHORT )uiSearchRuleIndex; } else { } tmp___3 = __fswab32(psfLocalSet->u32SFID); Adapter->PackInfo[uiSearchRuleIndex].ulSFID = (ULONG )tmp___3; Adapter->PackInfo[uiSearchRuleIndex].u8TrafficPriority = psfLocalSet->u8TrafficPriority; i = 0; goto ldv_46981; ldv_46980: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:Classifier index =%d", "CopyToAdapter", i); } else { } psfCSType = (struct bcm_convergence_types *)(& psfLocalSet->cConvergenceSLTypes) + (unsigned long )i; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:Classifier index =%d", "CopyToAdapter", i); } else { } if ((unsigned int )psfCSType->cCPacketClassificationRule.u8ClassifierRulePriority != 0U) { Adapter->PackInfo[uiSearchRuleIndex].bClassifierPriority = 1; } else { } if ((unsigned int )psfCSType->cCPacketClassificationRule.u8ClassifierRulePriority != 0U) { Adapter->PackInfo[uiSearchRuleIndex].bClassifierPriority = 1; } else { } if ((unsigned int )ucDsxType == 13U) { eClassifierAction = 1; } else if ((unsigned int )ucDsxType == 16U) { switch ((int )psfCSType->u8ClassfierDSCAction) { case 0: eClassifierAction = 1; goto ldv_46971; case 1: eClassifierAction = 2; goto ldv_46971; case 2: eClassifierAction = 3; goto ldv_46971; default: eClassifierAction = 0; } ldv_46971: ; } else { } tmp___4 = __fswab16((int )psfCSType->cCPacketClassificationRule.u16PacketClassificationRuleIndex); u16PacketClassificationRuleIndex = tmp___4; switch ((unsigned int )eClassifierAction) { case 1: tmp___5 = SearchClsid(Adapter, ulSFID, (int )u16PacketClassificationRuleIndex); nClassifierIndex = (UINT )tmp___5; if (nClassifierIndex > 100U) { tmp___6 = SearchFreeClsid(Adapter); nClassifierIndex = (UINT )tmp___6; if (nClassifierIndex > 100U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:Error Failed To get a free Classifier Entry", "CopyToAdapter"); } else { } goto ldv_46976; } else { } CopyClassifierRuleToSF(Adapter, psfCSType, uiSearchRuleIndex, nClassifierIndex); } else if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:CopyToAdapter: Error The Specified Classifier Already Exists and attempted To Add Classifier with Same PCRI : 0x%x\n", "CopyToAdapter", (int )u16PacketClassificationRuleIndex); } else { } goto ldv_46976; case 2: tmp___7 = SearchClsid(Adapter, ulSFID, (int )u16PacketClassificationRuleIndex); nClassifierIndex = (UINT )tmp___7; if (nClassifierIndex > 100U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:Error Search for Classifier To be replaced failed", "CopyToAdapter"); } else { } goto ldv_46976; } else { } CopyClassifierRuleToSF(Adapter, psfCSType, uiSearchRuleIndex, nClassifierIndex); goto ldv_46976; case 3: tmp___8 = SearchClsid(Adapter, ulSFID, (int )u16PacketClassificationRuleIndex); nClassifierIndex = (UINT )tmp___8; if (nClassifierIndex > 100U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:Error Search for Classifier To be deleted failed", "CopyToAdapter"); } else { } goto ldv_46976; } else { } DeleteClassifierRuleFromSF(Adapter, uiSearchRuleIndex, nClassifierIndex); goto ldv_46976; default: ; goto ldv_46976; } ldv_46976: i = i + 1; ldv_46981: ; if ((int )psfLocalSet->u8TotalClassifiers > i) { goto ldv_46980; } else { goto ldv_46982; } ldv_46982: i = 0; goto ldv_47009; ldv_47008: psfCSType = (struct bcm_convergence_types *)(& psfLocalSet->cConvergenceSLTypes) + (unsigned long )i; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:psfCSType->u8PhsDSCAction : 0x%x\n", "CopyToAdapter", (int )psfCSType->u8PhsDSCAction); } else { } switch ((int )psfCSType->u8PhsDSCAction) { case 3: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:Deleting All PHS Rules For VCID: 0x%X\n", "CopyToAdapter", (int )uVCID); } else { } PhsDeleteSFRules((void *)(& Adapter->stBCMPhsContext), (int )uVCID); goto ldv_46984; case 2: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:PHS DSC Action = Delete PHS Rule\n", "CopyToAdapter"); } else { } if ((unsigned int )psfCSType->cPhsRule.u8PHSI != 0U) { PhsDeletePHSRule((void *)(& Adapter->stBCMPhsContext), (int )uVCID, (int )psfCSType->cCPacketClassificationRule.u8AssociatedPHSI); } else { } goto ldv_46984; default: ; if ((unsigned int )ucDsxType == 16U) { goto ldv_46984; } else { } case 0: ; case 1: ; if ((unsigned int )psfCSType->cPhsRule.u8PHSI != 0U) { uiClassifierIndex = 0U; if ((unsigned int )pstAddIndication->u8Direction == 1U) { uiClassifierIndex = 0U; goto ldv_47000; ldv_46999: ; if (((int )((signed char )Adapter->astClassifierTable[uiClassifierIndex].bUsed) != 0 && Adapter->astClassifierTable[uiClassifierIndex].ulSFID == Adapter->PackInfo[uiSearchRuleIndex].ulSFID) && (int )Adapter->astClassifierTable[uiClassifierIndex].u8AssociatedPHSI == (int )psfCSType->cPhsRule.u8PHSI) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:Adding PHS Rule For Classifier: 0x%x cPhsRule.u8PHSI: 0x%x\n", "CopyToAdapter", (int )Adapter->astClassifierTable[uiClassifierIndex].uiClassifierRuleIndex, (int )psfCSType->cPhsRule.u8PHSI); } else { } sPhsRule.u8PHSI = psfCSType->cPhsRule.u8PHSI; sPhsRule.u8PHSFLength = psfCSType->cPhsRule.u8PHSFLength; sPhsRule.u8PHSMLength = psfCSType->cPhsRule.u8PHSMLength; sPhsRule.u8PHSS = psfCSType->cPhsRule.u8PHSS; sPhsRule.u8PHSV = psfCSType->cPhsRule.u8PHSV; __len___0 = 255UL; if (__len___0 > 63UL) { __ret___0 = memcpy((void *)(& sPhsRule.u8PHSF), (void const *)(& psfCSType->cPhsRule.u8PHSF), __len___0); } else { __ret___0 = memcpy((void *)(& sPhsRule.u8PHSF), (void const *)(& psfCSType->cPhsRule.u8PHSF), __len___0); } __len___1 = 255UL; if (__len___1 > 63UL) { __ret___1 = memcpy((void *)(& sPhsRule.u8PHSM), (void const *)(& psfCSType->cPhsRule.u8PHSM), __len___1); } else { __ret___1 = memcpy((void *)(& sPhsRule.u8PHSM), (void const *)(& psfCSType->cPhsRule.u8PHSM), __len___1); } sPhsRule.u8RefCnt = 0U; sPhsRule.bUnclassifiedPHSRule = 0U; sPhsRule.PHSModifiedBytes = 0L; sPhsRule.PHSModifiedNumPackets = 0UL; sPhsRule.PHSErrorNumPackets = 0UL; PhsUpdateClassifierRule((void *)(& Adapter->stBCMPhsContext), (int )uVCID, (int )Adapter->astClassifierTable[uiClassifierIndex].uiClassifierRuleIndex, & sPhsRule, (int )Adapter->astClassifierTable[uiClassifierIndex].u8AssociatedPHSI); if ((unsigned int )sPhsRule.u8PHSI != 0U) { Adapter->astClassifierTable[uiClassifierIndex].u32PHSRuleID = (UINT32 )sPhsRule.u8PHSI; __len___2 = 544UL; if (__len___2 > 63UL) { __ret___2 = memcpy((void *)(& Adapter->astClassifierTable[uiClassifierIndex].sPhsRule), (void const *)(& sPhsRule), __len___2); } else { __ret___2 = memcpy((void *)(& Adapter->astClassifierTable[uiClassifierIndex].sPhsRule), (void const *)(& sPhsRule), __len___2); } } else { } } else { } uiClassifierIndex = uiClassifierIndex + 1U; ldv_47000: ; if (uiClassifierIndex <= 99U) { goto ldv_46999; } else { goto ldv_47001; } ldv_47001: ; } else { sPhsRule.u8PHSI = psfCSType->cPhsRule.u8PHSI; sPhsRule.u8PHSFLength = psfCSType->cPhsRule.u8PHSFLength; sPhsRule.u8PHSMLength = psfCSType->cPhsRule.u8PHSMLength; sPhsRule.u8PHSS = psfCSType->cPhsRule.u8PHSS; sPhsRule.u8PHSV = psfCSType->cPhsRule.u8PHSV; __len___3 = 255UL; if (__len___3 > 63UL) { __ret___3 = memcpy((void *)(& sPhsRule.u8PHSF), (void const *)(& psfCSType->cPhsRule.u8PHSF), __len___3); } else { __ret___3 = memcpy((void *)(& sPhsRule.u8PHSF), (void const *)(& psfCSType->cPhsRule.u8PHSF), __len___3); } __len___4 = 255UL; if (__len___4 > 63UL) { __ret___4 = memcpy((void *)(& sPhsRule.u8PHSM), (void const *)(& psfCSType->cPhsRule.u8PHSM), __len___4); } else { __ret___4 = memcpy((void *)(& sPhsRule.u8PHSM), (void const *)(& psfCSType->cPhsRule.u8PHSM), __len___4); } sPhsRule.u8RefCnt = 0U; sPhsRule.bUnclassifiedPHSRule = 1U; sPhsRule.PHSModifiedBytes = 0L; sPhsRule.PHSModifiedNumPackets = 0UL; sPhsRule.PHSErrorNumPackets = 0UL; PhsUpdateClassifierRule((void *)(& Adapter->stBCMPhsContext), (int )uVCID, (int )sPhsRule.u8PHSI, & sPhsRule, (int )sPhsRule.u8PHSI); } } else { } goto ldv_46984; } ldv_46984: i = i + 1; ldv_47009: ; if ((int )psfLocalSet->u8TotalClassifiers > i) { goto ldv_47008; } else { goto ldv_47010; } ldv_47010: ; if (psfLocalSet->u32MaxSustainedTrafficRate == 0U) { Adapter->PackInfo[uiSearchRuleIndex].uiMaxAllowedRate = 52428800U; } else { tmp___10 = __fswab32(psfLocalSet->u32MaxSustainedTrafficRate); if (tmp___10 > 52428800U) { Adapter->PackInfo[uiSearchRuleIndex].uiMaxAllowedRate = 52428800U; } else { tmp___9 = __fswab32(psfLocalSet->u32MaxSustainedTrafficRate); Adapter->PackInfo[uiSearchRuleIndex].uiMaxAllowedRate = tmp___9; } } tmp___11 = __fswab32(psfLocalSet->u32MaximumLatency); Adapter->PackInfo[uiSearchRuleIndex].uiMaxLatency = tmp___11; if (Adapter->PackInfo[uiSearchRuleIndex].uiMaxLatency == 0U) { Adapter->PackInfo[uiSearchRuleIndex].uiMaxLatency = 4294967295U; } else { } if ((unsigned int )Adapter->PackInfo[uiSearchRuleIndex].u8QueueType == 5U || (unsigned int )Adapter->PackInfo[uiSearchRuleIndex].u8QueueType == 6U) { tmp___12 = __fswab16((int )psfLocalSet->u16UnsolicitedGrantInterval); UGIValue = (UINT )tmp___12; } else { } if (UGIValue == 0U) { UGIValue = 250U; } else { } Adapter->PackInfo[uiSearchRuleIndex].uiMaxBucketSize = ((Adapter->PackInfo[uiSearchRuleIndex].uiMaxAllowedRate * UGIValue) * 4U) / 1000U; if (Adapter->PackInfo[uiSearchRuleIndex].uiMaxBucketSize <= 11311U) { UGIFactor = 0U; UGIFactor = Adapter->PackInfo[uiSearchRuleIndex].uiMaxLatency / UGIValue + 1U; if (UGIFactor > 4U) { Adapter->PackInfo[uiSearchRuleIndex].uiMaxBucketSize = ((Adapter->PackInfo[uiSearchRuleIndex].uiMaxAllowedRate * UGIFactor) * UGIValue) / 1000U; } else { } if (Adapter->PackInfo[uiSearchRuleIndex].uiMaxBucketSize > 11312U) { Adapter->PackInfo[uiSearchRuleIndex].uiMaxBucketSize = 11312U; } else { } } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:LAT: %d, UGI: %d\n", "CopyToAdapter", Adapter->PackInfo[uiSearchRuleIndex].uiMaxLatency, UGIValue); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { tmp___15 = __fswab32(psfLocalSet->u32MaxSustainedTrafficRate); printk("\017%s:uiMaxAllowedRate: 0x%x, u32MaxSustainedTrafficRate: 0x%x ,uiMaxBucketSize: 0x%x", "CopyToAdapter", Adapter->PackInfo[uiSearchRuleIndex].uiMaxAllowedRate, tmp___15, Adapter->PackInfo[uiSearchRuleIndex].uiMaxBucketSize); } else { } CopyMIBSExtendedSFParameters(Adapter, psfLocalSet, uiSearchRuleIndex); Adapter->PackInfo[uiSearchRuleIndex].bHeaderSuppressionEnabled = ((int )psfLocalSet->u8RequesttransmissionPolicy & 16) == 0; kfree((void const *)Adapter->PackInfo[uiSearchRuleIndex].pstSFIndication); Adapter->PackInfo[uiSearchRuleIndex].pstSFIndication = (void *)pstAddIndication; SortPackInfo(Adapter); SortClassifiers(Adapter); DumpPhsRules(& Adapter->stBCMPhsContext); if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:%s <=====", "CopyToAdapter", "CopyToAdapter"); } else { } return; } } static VOID DumpCmControlPacket(PVOID pvBuffer ) { int uiLoopIndex ; int nIndex ; struct bcm_add_indication_alt *pstAddIndication ; UINT nCurClassifierCnt ; struct bcm_mini_adapter *Adapter ; void *tmp ; __u16 tmp___2 ; __u16 tmp___5 ; __u16 tmp___8 ; __u32 tmp___11 ; __u16 tmp___14 ; struct bcm_convergence_types *psfCSType ; struct bcm_convergence_types *psfCSType___0 ; struct bcm_convergence_types *psfCSType___1 ; { tmp = netdev_priv((struct net_device const *)gblpnetdev); Adapter = (struct bcm_mini_adapter *)tmp; pstAddIndication = (struct bcm_add_indication_alt *)pvBuffer; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:======>", "DumpCmControlPacket"); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8Type: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->u8Type); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8Direction: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->u8Direction); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { tmp___2 = __fswab16((int )pstAddIndication->u16TID); printk("\017%s:u16TID: 0x%X", "DumpCmControlPacket", (int )tmp___2); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { tmp___5 = __fswab16((int )pstAddIndication->u16CID); printk("\017%s:u16CID: 0x%X", "DumpCmControlPacket", (int )tmp___5); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { tmp___8 = __fswab16((int )pstAddIndication->u16VCID); printk("\017%s:u16VCID: 0x%X", "DumpCmControlPacket", (int )tmp___8); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: AuthorizedSet--->", "DumpCmControlPacket"); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { tmp___11 = __fswab32(pstAddIndication->sfAuthorizedSet.u32SFID); printk("\017%s:u32SFID: 0x%X", "DumpCmControlPacket", tmp___11); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { tmp___14 = __fswab16((int )pstAddIndication->sfAuthorizedSet.u16CID); printk("\017%s:u16CID: 0x%X", "DumpCmControlPacket", (int )tmp___14); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8ServiceClassNameLength: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfAuthorizedSet.u8ServiceClassNameLength); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8ServiceClassName: 0x%X ,0x%X , 0x%X, 0x%X, 0x%X, 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfAuthorizedSet.u8ServiceClassName[0], (int )pstAddIndication->sfAuthorizedSet.u8ServiceClassName[1], (int )pstAddIndication->sfAuthorizedSet.u8ServiceClassName[2], (int )pstAddIndication->sfAuthorizedSet.u8ServiceClassName[3], (int )pstAddIndication->sfAuthorizedSet.u8ServiceClassName[4], (int )pstAddIndication->sfAuthorizedSet.u8ServiceClassName[5]); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8MBSService: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfAuthorizedSet.u8MBSService); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8QosParamSet: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfAuthorizedSet.u8QosParamSet); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8TrafficPriority: 0x%X, %p", "DumpCmControlPacket", (int )pstAddIndication->sfAuthorizedSet.u8TrafficPriority, & pstAddIndication->sfAuthorizedSet.u8TrafficPriority); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u32MaxSustainedTrafficRate: 0x%X 0x%p", "DumpCmControlPacket", pstAddIndication->sfAuthorizedSet.u32MaxSustainedTrafficRate, & pstAddIndication->sfAuthorizedSet.u32MaxSustainedTrafficRate); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u32MaxTrafficBurst: 0x%X", "DumpCmControlPacket", pstAddIndication->sfAuthorizedSet.u32MaxTrafficBurst); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u32MinReservedTrafficRate\t: 0x%X", "DumpCmControlPacket", pstAddIndication->sfAuthorizedSet.u32MinReservedTrafficRate); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8VendorSpecificQoSParamLength: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfAuthorizedSet.u8VendorSpecificQoSParamLength); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8VendorSpecificQoSParam: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfAuthorizedSet.u8VendorSpecificQoSParam[0]); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8ServiceFlowSchedulingType: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfAuthorizedSet.u8ServiceFlowSchedulingType); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u32ToleratedJitter: 0x%X", "DumpCmControlPacket", pstAddIndication->sfAuthorizedSet.u32ToleratedJitter); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u32MaximumLatency: 0x%X", "DumpCmControlPacket", pstAddIndication->sfAuthorizedSet.u32MaximumLatency); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8FixedLengthVSVariableLengthSDUIndicator: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfAuthorizedSet.u8FixedLengthVSVariableLengthSDUIndicator); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8SDUSize: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfAuthorizedSet.u8SDUSize); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u16TargetSAID: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfAuthorizedSet.u16TargetSAID); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8ARQEnable: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfAuthorizedSet.u8ARQEnable); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u16ARQWindowSize: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfAuthorizedSet.u16ARQWindowSize); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u16ARQRetryTxTimeOut: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfAuthorizedSet.u16ARQRetryTxTimeOut); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u16ARQRetryRxTimeOut: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfAuthorizedSet.u16ARQRetryRxTimeOut); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u16ARQBlockLifeTime: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfAuthorizedSet.u16ARQBlockLifeTime); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u16ARQSyncLossTimeOut: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfAuthorizedSet.u16ARQSyncLossTimeOut); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8ARQDeliverInOrder: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfAuthorizedSet.u8ARQDeliverInOrder); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u16ARQRxPurgeTimeOut: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfAuthorizedSet.u16ARQRxPurgeTimeOut); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u16ARQBlockSize: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfAuthorizedSet.u16ARQBlockSize); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8CSSpecification: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfAuthorizedSet.u8CSSpecification); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8TypeOfDataDeliveryService: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfAuthorizedSet.u8TypeOfDataDeliveryService); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u16SDUInterArrivalTime: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfAuthorizedSet.u16SDUInterArrivalTime); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u16TimeBase: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfAuthorizedSet.u16TimeBase); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8PagingPreference: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfAuthorizedSet.u8PagingPreference); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u16UnsolicitedPollingInterval: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfAuthorizedSet.u16UnsolicitedPollingInterval); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:sfAuthorizedSet.u8HARQChannelMapping %x %x %x ", "DumpCmControlPacket", *((unsigned int *)(& pstAddIndication->sfAuthorizedSet.u8HARQChannelMapping)), *((unsigned int *)(& pstAddIndication->sfAuthorizedSet.u8HARQChannelMapping) + 4U), (int )*((USHORT *)(& pstAddIndication->sfAuthorizedSet.u8HARQChannelMapping) + 8U)); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8TrafficIndicationPreference: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfAuthorizedSet.u8TrafficIndicationPreference); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: Total Classifiers Received: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfAuthorizedSet.u8TotalClassifiers); } else { } nCurClassifierCnt = (UINT )pstAddIndication->sfAuthorizedSet.u8TotalClassifiers; if (nCurClassifierCnt > 4U) { nCurClassifierCnt = 4U; } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:pstAddIndication->sfAuthorizedSet.bValid %d", "DumpCmControlPacket", (int )pstAddIndication->sfAuthorizedSet.bValid); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:pstAddIndication->sfAuthorizedSet.u16MacOverhead %x", "DumpCmControlPacket", (int )pstAddIndication->sfAuthorizedSet.u16MacOverhead); } else { } if ((unsigned int )pstAddIndication->sfAuthorizedSet.bValid == 0U) { pstAddIndication->sfAuthorizedSet.bValid = 1U; } else { } nIndex = 0; goto ldv_47032; ldv_47031: psfCSType = 0; psfCSType = (struct bcm_convergence_types *)(& pstAddIndication->sfAuthorizedSet.cConvergenceSLTypes) + (unsigned long )nIndex; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:psfCSType = %p", "DumpCmControlPacket", psfCSType); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:CCPacketClassificationRuleSI====>", "DumpCmControlPacket"); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8ClassifierRulePriority: 0x%X ", "DumpCmControlPacket", (int )psfCSType->cCPacketClassificationRule.u8ClassifierRulePriority); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8IPTypeOfServiceLength: 0x%X ", "DumpCmControlPacket", (int )psfCSType->cCPacketClassificationRule.u8IPTypeOfServiceLength); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8IPTypeOfService[3]: 0x%X ,0x%X ,0x%X ", "DumpCmControlPacket", (int )psfCSType->cCPacketClassificationRule.u8IPTypeOfService[0], (int )psfCSType->cCPacketClassificationRule.u8IPTypeOfService[1], (int )psfCSType->cCPacketClassificationRule.u8IPTypeOfService[2]); } else { } uiLoopIndex = 0; goto ldv_47023; ldv_47022: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8Protocol: 0x%02X ", "DumpCmControlPacket", (int )psfCSType->cCPacketClassificationRule.u8Protocol); } else { } uiLoopIndex = uiLoopIndex + 1; ldv_47023: ; if (uiLoopIndex <= 0) { goto ldv_47022; } else { goto ldv_47024; } ldv_47024: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8IPMaskedSourceAddressLength: 0x%X ", "DumpCmControlPacket", (int )psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddressLength); } else { } uiLoopIndex = 0; goto ldv_47026; ldv_47025: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8IPMaskedSourceAddress[32]: 0x%02X ", "DumpCmControlPacket", (int )psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddress[uiLoopIndex]); } else { } uiLoopIndex = uiLoopIndex + 1; ldv_47026: ; if (uiLoopIndex <= 31) { goto ldv_47025; } else { goto ldv_47027; } ldv_47027: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8IPDestinationAddressLength: 0x%X ", "DumpCmControlPacket", (int )psfCSType->cCPacketClassificationRule.u8IPDestinationAddressLength); } else { } uiLoopIndex = 0; goto ldv_47029; ldv_47028: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8IPDestinationAddress[32]: 0x%02X ", "DumpCmControlPacket", (int )psfCSType->cCPacketClassificationRule.u8IPDestinationAddress[uiLoopIndex]); } else { } uiLoopIndex = uiLoopIndex + 1; ldv_47029: ; if (uiLoopIndex <= 31) { goto ldv_47028; } else { goto ldv_47030; } ldv_47030: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8ProtocolSourcePortRangeLength:0x%X ", "DumpCmControlPacket", (int )psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8ProtocolSourcePortRange[4]: 0x%02X ,0x%02X ,0x%02X ,0x%02X ", "DumpCmControlPacket", (int )psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[0], (int )psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[1], (int )psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[2], (int )psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[3]); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8ProtocolDestPortRangeLength: 0x%02X ", "DumpCmControlPacket", (int )psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRangeLength); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8ProtocolDestPortRange[4]: 0x%02X ,0x%02X ,0x%02X ,0x%02X ", "DumpCmControlPacket", (int )psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[0], (int )psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[1], (int )psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[2], (int )psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange[3]); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8EthernetDestMacAddressLength: 0x%02X ", "DumpCmControlPacket", (int )psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddressLength); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8EthernetDestMacAddress[6]: %pM", "DumpCmControlPacket", (u8 *)(& psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddress)); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8EthernetSourceMACAddressLength: 0x%02X ", "DumpCmControlPacket", (int )psfCSType->cCPacketClassificationRule.u8EthernetDestMacAddressLength); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8EthernetSourceMACAddress[6]: %pM", "DumpCmControlPacket", (u8 *)(& psfCSType->cCPacketClassificationRule.u8EthernetSourceMACAddress)); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8EthertypeLength: 0x%02X ", "DumpCmControlPacket", (int )psfCSType->cCPacketClassificationRule.u8EthertypeLength); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8Ethertype[3]: 0x%02X ,0x%02X ,0x%02X ", "DumpCmControlPacket", (int )psfCSType->cCPacketClassificationRule.u8Ethertype[0], (int )psfCSType->cCPacketClassificationRule.u8Ethertype[1], (int )psfCSType->cCPacketClassificationRule.u8Ethertype[2]); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u16UserPriority: 0x%X ", "DumpCmControlPacket", (int )psfCSType->cCPacketClassificationRule.u16UserPriority); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u16VLANID: 0x%X ", "DumpCmControlPacket", (int )psfCSType->cCPacketClassificationRule.u16VLANID); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8AssociatedPHSI: 0x%02X ", "DumpCmControlPacket", (int )psfCSType->cCPacketClassificationRule.u8AssociatedPHSI); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u16PacketClassificationRuleIndex: 0x%X ", "DumpCmControlPacket", (int )psfCSType->cCPacketClassificationRule.u16PacketClassificationRuleIndex); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8VendorSpecificClassifierParamLength: 0x%X ", "DumpCmControlPacket", (int )psfCSType->cCPacketClassificationRule.u8VendorSpecificClassifierParamLength); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8VendorSpecificClassifierParam[1]: 0x%X ", "DumpCmControlPacket", (int )psfCSType->cCPacketClassificationRule.u8VendorSpecificClassifierParam[0]); } else { } nIndex = nIndex + 1; ldv_47032: ; if ((UINT )nIndex < nCurClassifierCnt) { goto ldv_47031; } else { goto ldv_47033; } ldv_47033: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:bValid: 0x%02X", "DumpCmControlPacket", (int )pstAddIndication->sfAuthorizedSet.bValid); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:AdmittedSet--->", "DumpCmControlPacket"); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u32SFID: 0x%X", "DumpCmControlPacket", pstAddIndication->sfAdmittedSet.u32SFID); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u16CID: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfAdmittedSet.u16CID); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8ServiceClassNameLength: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfAdmittedSet.u8ServiceClassNameLength); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8ServiceClassName: 0x%*ph", "DumpCmControlPacket", 6, (u8 *)(& pstAddIndication->sfAdmittedSet.u8ServiceClassName)); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8MBSService: 0x%02X", "DumpCmControlPacket", (int )pstAddIndication->sfAdmittedSet.u8MBSService); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8QosParamSet: 0x%02X", "DumpCmControlPacket", (int )pstAddIndication->sfAdmittedSet.u8QosParamSet); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8TrafficPriority: 0x%02X", "DumpCmControlPacket", (int )pstAddIndication->sfAdmittedSet.u8TrafficPriority); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u32MaxTrafficBurst: 0x%X", "DumpCmControlPacket", pstAddIndication->sfAdmittedSet.u32MaxTrafficBurst); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u32MinReservedTrafficRate: 0x%X", "DumpCmControlPacket", pstAddIndication->sfAdmittedSet.u32MinReservedTrafficRate); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8VendorSpecificQoSParamLength: 0x%02X", "DumpCmControlPacket", (int )pstAddIndication->sfAdmittedSet.u8VendorSpecificQoSParamLength); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8VendorSpecificQoSParam: 0x%02X", "DumpCmControlPacket", (int )pstAddIndication->sfAdmittedSet.u8VendorSpecificQoSParam[0]); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8ServiceFlowSchedulingType: 0x%02X", "DumpCmControlPacket", (int )pstAddIndication->sfAdmittedSet.u8ServiceFlowSchedulingType); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u32ToleratedJitter: 0x%X", "DumpCmControlPacket", pstAddIndication->sfAdmittedSet.u32ToleratedJitter); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u32MaximumLatency: 0x%X", "DumpCmControlPacket", pstAddIndication->sfAdmittedSet.u32MaximumLatency); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8FixedLengthVSVariableLengthSDUIndicator: 0x%02X", "DumpCmControlPacket", (int )pstAddIndication->sfAdmittedSet.u8FixedLengthVSVariableLengthSDUIndicator); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8SDUSize: 0x%02X", "DumpCmControlPacket", (int )pstAddIndication->sfAdmittedSet.u8SDUSize); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u16TargetSAID: 0x%02X", "DumpCmControlPacket", (int )pstAddIndication->sfAdmittedSet.u16TargetSAID); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8ARQEnable: 0x%02X", "DumpCmControlPacket", (int )pstAddIndication->sfAdmittedSet.u8ARQEnable); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u16ARQWindowSize: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfAdmittedSet.u16ARQWindowSize); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u16ARQRetryTxTimeOut: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfAdmittedSet.u16ARQRetryTxTimeOut); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u16ARQRetryRxTimeOut: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfAdmittedSet.u16ARQRetryRxTimeOut); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u16ARQBlockLifeTime: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfAdmittedSet.u16ARQBlockLifeTime); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u16ARQSyncLossTimeOut: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfAdmittedSet.u16ARQSyncLossTimeOut); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8ARQDeliverInOrder: 0x%02X", "DumpCmControlPacket", (int )pstAddIndication->sfAdmittedSet.u8ARQDeliverInOrder); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u16ARQRxPurgeTimeOut: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfAdmittedSet.u16ARQRxPurgeTimeOut); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u16ARQBlockSize: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfAdmittedSet.u16ARQBlockSize); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8CSSpecification: 0x%02X", "DumpCmControlPacket", (int )pstAddIndication->sfAdmittedSet.u8CSSpecification); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8TypeOfDataDeliveryService: 0x%02X", "DumpCmControlPacket", (int )pstAddIndication->sfAdmittedSet.u8TypeOfDataDeliveryService); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u16SDUInterArrivalTime: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfAdmittedSet.u16SDUInterArrivalTime); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u16TimeBase: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfAdmittedSet.u16TimeBase); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8PagingPreference: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfAdmittedSet.u8PagingPreference); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8TrafficIndicationPreference: 0x%02X", "DumpCmControlPacket", (int )pstAddIndication->sfAdmittedSet.u8TrafficIndicationPreference); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: Total Classifiers Received: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfAdmittedSet.u8TotalClassifiers); } else { } nCurClassifierCnt = (UINT )pstAddIndication->sfAdmittedSet.u8TotalClassifiers; if (nCurClassifierCnt > 4U) { nCurClassifierCnt = 4U; } else { } nIndex = 0; goto ldv_47045; ldv_47044: psfCSType___0 = 0; psfCSType___0 = (struct bcm_convergence_types *)(& pstAddIndication->sfAdmittedSet.cConvergenceSLTypes) + (unsigned long )nIndex; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: CCPacketClassificationRuleSI====>", "DumpCmControlPacket"); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8ClassifierRulePriority: 0x%02X ", "DumpCmControlPacket", (int )psfCSType___0->cCPacketClassificationRule.u8ClassifierRulePriority); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8IPTypeOfServiceLength: 0x%02X", "DumpCmControlPacket", (int )psfCSType___0->cCPacketClassificationRule.u8IPTypeOfServiceLength); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8IPTypeOfService[3]: 0x%*ph", "DumpCmControlPacket", 3, (u8 *)(& psfCSType___0->cCPacketClassificationRule.u8IPTypeOfService)); } else { } uiLoopIndex = 0; goto ldv_47036; ldv_47035: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8Protocol: 0x%02X ", "DumpCmControlPacket", (int )psfCSType___0->cCPacketClassificationRule.u8Protocol); } else { } uiLoopIndex = uiLoopIndex + 1; ldv_47036: ; if (uiLoopIndex <= 0) { goto ldv_47035; } else { goto ldv_47037; } ldv_47037: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8IPMaskedSourceAddressLength: 0x%02X ", "DumpCmControlPacket", (int )psfCSType___0->cCPacketClassificationRule.u8IPMaskedSourceAddressLength); } else { } uiLoopIndex = 0; goto ldv_47039; ldv_47038: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8IPMaskedSourceAddress[32]: 0x%02X ", "DumpCmControlPacket", (int )psfCSType___0->cCPacketClassificationRule.u8IPMaskedSourceAddress[uiLoopIndex]); } else { } uiLoopIndex = uiLoopIndex + 1; ldv_47039: ; if (uiLoopIndex <= 31) { goto ldv_47038; } else { goto ldv_47040; } ldv_47040: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8IPDestinationAddressLength: 0x%02X ", "DumpCmControlPacket", (int )psfCSType___0->cCPacketClassificationRule.u8IPDestinationAddressLength); } else { } uiLoopIndex = 0; goto ldv_47042; ldv_47041: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8IPDestinationAddress[32]: 0x%02X ", "DumpCmControlPacket", (int )psfCSType___0->cCPacketClassificationRule.u8IPDestinationAddress[uiLoopIndex]); } else { } uiLoopIndex = uiLoopIndex + 1; ldv_47042: ; if (uiLoopIndex <= 31) { goto ldv_47041; } else { goto ldv_47043; } ldv_47043: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8ProtocolSourcePortRangeLength: 0x%02X ", "DumpCmControlPacket", (int )psfCSType___0->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8ProtocolSourcePortRange[4]: 0x%*ph ", "DumpCmControlPacket", 4, (u8 *)(& psfCSType___0->cCPacketClassificationRule.u8ProtocolSourcePortRange)); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8ProtocolDestPortRangeLength: 0x%02X ", "DumpCmControlPacket", (int )psfCSType___0->cCPacketClassificationRule.u8ProtocolDestPortRangeLength); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8ProtocolDestPortRange[4]: 0x%*ph ", "DumpCmControlPacket", 4, (u8 *)(& psfCSType___0->cCPacketClassificationRule.u8ProtocolDestPortRange)); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8EthernetDestMacAddressLength: 0x%02X ", "DumpCmControlPacket", (int )psfCSType___0->cCPacketClassificationRule.u8EthernetDestMacAddressLength); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8EthernetDestMacAddress[6]: %pM", "DumpCmControlPacket", (u8 *)(& psfCSType___0->cCPacketClassificationRule.u8EthernetDestMacAddress)); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8EthernetSourceMACAddressLength: 0x%02X ", "DumpCmControlPacket", (int )psfCSType___0->cCPacketClassificationRule.u8EthernetDestMacAddressLength); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8EthernetSourceMACAddress[6]: %pM", "DumpCmControlPacket", (u8 *)(& psfCSType___0->cCPacketClassificationRule.u8EthernetSourceMACAddress)); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8EthertypeLength: 0x%02X ", "DumpCmControlPacket", (int )psfCSType___0->cCPacketClassificationRule.u8EthertypeLength); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8Ethertype[3]: 0x%*ph", "DumpCmControlPacket", 3, (u8 *)(& psfCSType___0->cCPacketClassificationRule.u8Ethertype)); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u16UserPriority: 0x%X ", "DumpCmControlPacket", (int )psfCSType___0->cCPacketClassificationRule.u16UserPriority); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u16VLANID: 0x%X ", "DumpCmControlPacket", (int )psfCSType___0->cCPacketClassificationRule.u16VLANID); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8AssociatedPHSI: 0x%02X ", "DumpCmControlPacket", (int )psfCSType___0->cCPacketClassificationRule.u8AssociatedPHSI); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u16PacketClassificationRuleIndex: 0x%X ", "DumpCmControlPacket", (int )psfCSType___0->cCPacketClassificationRule.u16PacketClassificationRuleIndex); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8VendorSpecificClassifierParamLength: 0x%02X", "DumpCmControlPacket", (int )psfCSType___0->cCPacketClassificationRule.u8VendorSpecificClassifierParamLength); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8VendorSpecificClassifierParam[1]: 0x%02X ", "DumpCmControlPacket", (int )psfCSType___0->cCPacketClassificationRule.u8VendorSpecificClassifierParam[0]); } else { } nIndex = nIndex + 1; ldv_47045: ; if ((UINT )nIndex < nCurClassifierCnt) { goto ldv_47044; } else { goto ldv_47046; } ldv_47046: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:bValid: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfAdmittedSet.bValid); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: ActiveSet--->", "DumpCmControlPacket"); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u32SFID: 0x%X", "DumpCmControlPacket", pstAddIndication->sfActiveSet.u32SFID); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u16CID: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfActiveSet.u16CID); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8ServiceClassNameLength: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfActiveSet.u8ServiceClassNameLength); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8ServiceClassName: 0x%*ph", "DumpCmControlPacket", 6, (u8 *)(& pstAddIndication->sfActiveSet.u8ServiceClassName)); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8MBSService: 0x%02X", "DumpCmControlPacket", (int )pstAddIndication->sfActiveSet.u8MBSService); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8QosParamSet: 0x%02X", "DumpCmControlPacket", (int )pstAddIndication->sfActiveSet.u8QosParamSet); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8TrafficPriority: 0x%02X", "DumpCmControlPacket", (int )pstAddIndication->sfActiveSet.u8TrafficPriority); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u32MaxTrafficBurst: 0x%X", "DumpCmControlPacket", pstAddIndication->sfActiveSet.u32MaxTrafficBurst); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u32MinReservedTrafficRate: 0x%X", "DumpCmControlPacket", pstAddIndication->sfActiveSet.u32MinReservedTrafficRate); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8VendorSpecificQoSParamLength: 0x%02X", "DumpCmControlPacket", (int )pstAddIndication->sfActiveSet.u8VendorSpecificQoSParamLength); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8VendorSpecificQoSParam: 0x%02X", "DumpCmControlPacket", (int )pstAddIndication->sfActiveSet.u8VendorSpecificQoSParam[0]); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8ServiceFlowSchedulingType: 0x%02X", "DumpCmControlPacket", (int )pstAddIndication->sfActiveSet.u8ServiceFlowSchedulingType); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u32ToleratedJitter: 0x%X", "DumpCmControlPacket", pstAddIndication->sfActiveSet.u32ToleratedJitter); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u32MaximumLatency: 0x%X", "DumpCmControlPacket", pstAddIndication->sfActiveSet.u32MaximumLatency); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8FixedLengthVSVariableLengthSDUIndicator: 0x%02X", "DumpCmControlPacket", (int )pstAddIndication->sfActiveSet.u8FixedLengthVSVariableLengthSDUIndicator); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8SDUSize: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfActiveSet.u8SDUSize); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: u16TargetSAID: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfActiveSet.u16TargetSAID); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: u8ARQEnable: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfActiveSet.u8ARQEnable); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: u16ARQWindowSize: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfActiveSet.u16ARQWindowSize); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: u16ARQRetryTxTimeOut: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfActiveSet.u16ARQRetryTxTimeOut); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: u16ARQRetryRxTimeOut: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfActiveSet.u16ARQRetryRxTimeOut); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: u16ARQBlockLifeTime: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfActiveSet.u16ARQBlockLifeTime); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: u16ARQSyncLossTimeOut: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfActiveSet.u16ARQSyncLossTimeOut); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: u8ARQDeliverInOrder: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfActiveSet.u8ARQDeliverInOrder); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: u16ARQRxPurgeTimeOut: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfActiveSet.u16ARQRxPurgeTimeOut); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: u16ARQBlockSize: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfActiveSet.u16ARQBlockSize); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: u8CSSpecification: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfActiveSet.u8CSSpecification); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: u8TypeOfDataDeliveryService: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfActiveSet.u8TypeOfDataDeliveryService); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: u16SDUInterArrivalTime: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfActiveSet.u16SDUInterArrivalTime); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: u16TimeBase: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfActiveSet.u16TimeBase); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: u8PagingPreference: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfActiveSet.u8PagingPreference); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: u8TrafficIndicationPreference: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfActiveSet.u8TrafficIndicationPreference); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: Total Classifiers Received: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfActiveSet.u8TotalClassifiers); } else { } nCurClassifierCnt = (UINT )pstAddIndication->sfActiveSet.u8TotalClassifiers; if (nCurClassifierCnt > 4U) { nCurClassifierCnt = 4U; } else { } nIndex = 0; goto ldv_47058; ldv_47057: psfCSType___1 = 0; psfCSType___1 = (struct bcm_convergence_types *)(& pstAddIndication->sfActiveSet.cConvergenceSLTypes) + (unsigned long )nIndex; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: CCPacketClassificationRuleSI====>", "DumpCmControlPacket"); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: u8ClassifierRulePriority: 0x%X ", "DumpCmControlPacket", (int )psfCSType___1->cCPacketClassificationRule.u8ClassifierRulePriority); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: u8IPTypeOfServiceLength: 0x%X ", "DumpCmControlPacket", (int )psfCSType___1->cCPacketClassificationRule.u8IPTypeOfServiceLength); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: u8IPTypeOfService[3]: 0x%X ,0x%X ,0x%X ", "DumpCmControlPacket", (int )psfCSType___1->cCPacketClassificationRule.u8IPTypeOfService[0], (int )psfCSType___1->cCPacketClassificationRule.u8IPTypeOfService[1], (int )psfCSType___1->cCPacketClassificationRule.u8IPTypeOfService[2]); } else { } uiLoopIndex = 0; goto ldv_47049; ldv_47048: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: u8Protocol: 0x%X ", "DumpCmControlPacket", (int )psfCSType___1->cCPacketClassificationRule.u8Protocol); } else { } uiLoopIndex = uiLoopIndex + 1; ldv_47049: ; if (uiLoopIndex <= 0) { goto ldv_47048; } else { goto ldv_47050; } ldv_47050: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8IPMaskedSourceAddressLength: 0x%X ", "DumpCmControlPacket", (int )psfCSType___1->cCPacketClassificationRule.u8IPMaskedSourceAddressLength); } else { } uiLoopIndex = 0; goto ldv_47052; ldv_47051: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8IPMaskedSourceAddress[32]: 0x%X ", "DumpCmControlPacket", (int )psfCSType___1->cCPacketClassificationRule.u8IPMaskedSourceAddress[uiLoopIndex]); } else { } uiLoopIndex = uiLoopIndex + 1; ldv_47052: ; if (uiLoopIndex <= 31) { goto ldv_47051; } else { goto ldv_47053; } ldv_47053: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8IPDestinationAddressLength: 0x%02X ", "DumpCmControlPacket", (int )psfCSType___1->cCPacketClassificationRule.u8IPDestinationAddressLength); } else { } uiLoopIndex = 0; goto ldv_47055; ldv_47054: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: u8IPDestinationAddress[32]:0x%X ", "DumpCmControlPacket", (int )psfCSType___1->cCPacketClassificationRule.u8IPDestinationAddress[uiLoopIndex]); } else { } uiLoopIndex = uiLoopIndex + 1; ldv_47055: ; if (uiLoopIndex <= 31) { goto ldv_47054; } else { goto ldv_47056; } ldv_47056: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: u8ProtocolSourcePortRangeLength: 0x%X ", "DumpCmControlPacket", (int )psfCSType___1->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: u8ProtocolSourcePortRange[4]: 0x%X ,0x%X ,0x%X ,0x%X ", "DumpCmControlPacket", (int )psfCSType___1->cCPacketClassificationRule.u8ProtocolSourcePortRange[0], (int )psfCSType___1->cCPacketClassificationRule.u8ProtocolSourcePortRange[1], (int )psfCSType___1->cCPacketClassificationRule.u8ProtocolSourcePortRange[2], (int )psfCSType___1->cCPacketClassificationRule.u8ProtocolSourcePortRange[3]); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: u8ProtocolDestPortRangeLength: 0x%X ", "DumpCmControlPacket", (int )psfCSType___1->cCPacketClassificationRule.u8ProtocolDestPortRangeLength); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: u8ProtocolDestPortRange[4]: 0x%X ,0x%X ,0x%X ,0x%X ", "DumpCmControlPacket", (int )psfCSType___1->cCPacketClassificationRule.u8ProtocolDestPortRange[0], (int )psfCSType___1->cCPacketClassificationRule.u8ProtocolDestPortRange[1], (int )psfCSType___1->cCPacketClassificationRule.u8ProtocolDestPortRange[2], (int )psfCSType___1->cCPacketClassificationRule.u8ProtocolDestPortRange[3]); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: u8EthernetDestMacAddressLength: 0x%X ", "DumpCmControlPacket", (int )psfCSType___1->cCPacketClassificationRule.u8EthernetDestMacAddressLength); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: u8EthernetDestMacAddress[6]: 0x%X ,0x%X ,0x%X ,0x%X ,0x%X ,0x%X", "DumpCmControlPacket", (int )psfCSType___1->cCPacketClassificationRule.u8EthernetDestMacAddress[0], (int )psfCSType___1->cCPacketClassificationRule.u8EthernetDestMacAddress[1], (int )psfCSType___1->cCPacketClassificationRule.u8EthernetDestMacAddress[2], (int )psfCSType___1->cCPacketClassificationRule.u8EthernetDestMacAddress[3], (int )psfCSType___1->cCPacketClassificationRule.u8EthernetDestMacAddress[4], (int )psfCSType___1->cCPacketClassificationRule.u8EthernetDestMacAddress[5]); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: u8EthernetSourceMACAddressLength: 0x%X ", "DumpCmControlPacket", (int )psfCSType___1->cCPacketClassificationRule.u8EthernetDestMacAddressLength); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s:u8EthernetSourceMACAddress[6]: 0x%X ,0x%X ,0x%X ,0x%X ,0x%X ,0x%X", "DumpCmControlPacket", (int )psfCSType___1->cCPacketClassificationRule.u8EthernetSourceMACAddress[0], (int )psfCSType___1->cCPacketClassificationRule.u8EthernetSourceMACAddress[1], (int )psfCSType___1->cCPacketClassificationRule.u8EthernetSourceMACAddress[2], (int )psfCSType___1->cCPacketClassificationRule.u8EthernetSourceMACAddress[3], (int )psfCSType___1->cCPacketClassificationRule.u8EthernetSourceMACAddress[4], (int )psfCSType___1->cCPacketClassificationRule.u8EthernetSourceMACAddress[5]); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: u8EthertypeLength: 0x%X ", "DumpCmControlPacket", (int )psfCSType___1->cCPacketClassificationRule.u8EthertypeLength); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: u8Ethertype[3]: 0x%X ,0x%X ,0x%X ", "DumpCmControlPacket", (int )psfCSType___1->cCPacketClassificationRule.u8Ethertype[0], (int )psfCSType___1->cCPacketClassificationRule.u8Ethertype[1], (int )psfCSType___1->cCPacketClassificationRule.u8Ethertype[2]); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: u16UserPriority: 0x%X ", "DumpCmControlPacket", (int )psfCSType___1->cCPacketClassificationRule.u16UserPriority); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: u16VLANID: 0x%X ", "DumpCmControlPacket", (int )psfCSType___1->cCPacketClassificationRule.u16VLANID); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: u8AssociatedPHSI: 0x%X ", "DumpCmControlPacket", (int )psfCSType___1->cCPacketClassificationRule.u8AssociatedPHSI); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: u16PacketClassificationRuleIndex:0x%X ", "DumpCmControlPacket", (int )psfCSType___1->cCPacketClassificationRule.u16PacketClassificationRuleIndex); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: u8VendorSpecificClassifierParamLength:0x%X ", "DumpCmControlPacket", (int )psfCSType___1->cCPacketClassificationRule.u8VendorSpecificClassifierParamLength); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: u8VendorSpecificClassifierParam[1]:0x%X ", "DumpCmControlPacket", (int )psfCSType___1->cCPacketClassificationRule.u8VendorSpecificClassifierParam[0]); } else { } nIndex = nIndex + 1; ldv_47058: ; if ((UINT )nIndex < nCurClassifierCnt) { goto ldv_47057; } else { goto ldv_47059; } ldv_47059: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 1024U) != 0U) { printk("\017%s: bValid: 0x%X", "DumpCmControlPacket", (int )pstAddIndication->sfActiveSet.bValid); } else { } return; } } __inline static ULONG RestoreSFParam(struct bcm_mini_adapter *Adapter , ULONG ulAddrSFParamSet , PUCHAR pucDestBuffer ) { UINT nBytesToRead ; __u32 tmp ; int tmp___0 ; { nBytesToRead = 2816U; if (ulAddrSFParamSet == 0UL || (unsigned long )pucDestBuffer == (unsigned long )((PUCHAR )0)) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:Got Param address as 0!!", "RestoreSFParam"); } else { } return (0UL); } else { } tmp = __fswab32((unsigned int )ulAddrSFParamSet); ulAddrSFParamSet = (ULONG )tmp; tmp___0 = rdm(Adapter, (UINT )ulAddrSFParamSet, (PCHAR )pucDestBuffer, (size_t )nBytesToRead); if (tmp___0 < 0) { return (0xffffffffffffffffUL); } else { } return (1UL); } } static ULONG StoreSFParam(struct bcm_mini_adapter *Adapter , PUCHAR pucSrcBuffer , ULONG ulAddrSFParamSet ) { UINT nBytesToWrite ; int ret ; { nBytesToWrite = 2816U; ret = 0; if (ulAddrSFParamSet == 0UL || (unsigned long )pucSrcBuffer == (unsigned long )((PUCHAR )0)) { return (0UL); } else { } ret = wrm(Adapter, (UINT )ulAddrSFParamSet, (PCHAR )pucSrcBuffer, (size_t )nBytesToWrite); if (ret < 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:%s:%d WRM failed", "StoreSFParam", "StoreSFParam", 1368); } else { } return ((ULONG )ret); } else { } return (1UL); } } unsigned long StoreCmControlResponseMessage(struct bcm_mini_adapter *Adapter , void *pvBuffer , unsigned int *puBufferLength ) { struct bcm_add_indication_alt *pstAddIndicationAlt ; struct bcm_add_indication *pstAddIndication ; struct bcm_del_request *pstDeletionRequest ; UINT uiSearchRuleIndex ; ULONG ulSFID ; __u32 tmp ; INT tmp___0 ; void *tmp___1 ; ULONG tmp___2 ; ULONG tmp___3 ; __u32 tmp___4 ; struct bcm_add_request AddRequest ; size_t __len ; void *__ret ; ULONG tmp___5 ; ULONG tmp___6 ; __u32 tmp___7 ; ULONG tmp___8 ; ULONG tmp___9 ; __u32 tmp___10 ; { pstAddIndicationAlt = 0; pstAddIndication = 0; pstAddIndicationAlt = (struct bcm_add_indication_alt *)pvBuffer; if ((unsigned int )pstAddIndicationAlt->u8Type == 17U) { pstDeletionRequest = (struct bcm_del_request *)pvBuffer; tmp = __fswab32(pstDeletionRequest->u32SFID); ulSFID = (ULONG )tmp; tmp___0 = SearchSfid(Adapter, (UINT )ulSFID); uiSearchRuleIndex = (UINT )tmp___0; if (uiSearchRuleIndex <= 16U) { deleteSFBySfid(Adapter, uiSearchRuleIndex); Adapter->u32TotalDSD = Adapter->u32TotalDSD + 1U; } else { } return (1UL); } else { } if ((unsigned int )pstAddIndicationAlt->u8Type == 18U || (unsigned int )pstAddIndicationAlt->u8Type == 19U) { return (1UL); } else { } tmp___1 = kmalloc(40UL, 208U); pstAddIndication = (struct bcm_add_indication *)tmp___1; if ((unsigned long )pstAddIndication == (unsigned long )((struct bcm_add_indication *)0)) { return (0UL); } else { } tmp___2 = GetNextTargetBufferLocation(Adapter, (int )pstAddIndicationAlt->u16TID); pstAddIndication->psfAuthorizedSet = (struct bcm_connect_mgr_params *)tmp___2; if ((unsigned long )pstAddIndication->psfAuthorizedSet == (unsigned long )((struct bcm_connect_mgr_params *)0)) { kfree((void const *)pstAddIndication); return (0UL); } else { } tmp___3 = StoreSFParam(Adapter, (unsigned char *)(& pstAddIndicationAlt->sfAuthorizedSet), (unsigned long )pstAddIndication->psfAuthorizedSet); if (tmp___3 != 1UL) { kfree((void const *)pstAddIndication); return (0UL); } else { } tmp___4 = __fswab32((unsigned int )((long )pstAddIndication->psfAuthorizedSet)); pstAddIndication->psfAuthorizedSet = (struct bcm_connect_mgr_params *)((long )tmp___4); if ((unsigned int )pstAddIndicationAlt->u8Type == 11U) { AddRequest.u8Type = pstAddIndicationAlt->u8Type; AddRequest.eConnectionDir = pstAddIndicationAlt->u8Direction; AddRequest.u16TID = pstAddIndicationAlt->u16TID; AddRequest.u16CID = pstAddIndicationAlt->u16CID; AddRequest.u16VCID = pstAddIndicationAlt->u16VCID; AddRequest.psfParameterSet = pstAddIndication->psfAuthorizedSet; *puBufferLength = 16U; __len = 16UL; if (__len > 63UL) { __ret = memcpy(pvBuffer, (void const *)(& AddRequest), __len); } else { __ret = memcpy(pvBuffer, (void const *)(& AddRequest), __len); } kfree((void const *)pstAddIndication); return (1UL); } else { } pstAddIndication->u8Type = pstAddIndicationAlt->u8Type; pstAddIndication->eConnectionDir = pstAddIndicationAlt->u8Direction; pstAddIndication->u16TID = pstAddIndicationAlt->u16TID; pstAddIndication->u16CID = pstAddIndicationAlt->u16CID; pstAddIndication->u16VCID = pstAddIndicationAlt->u16VCID; pstAddIndication->u8CC = pstAddIndicationAlt->u8CC; tmp___5 = GetNextTargetBufferLocation(Adapter, (int )pstAddIndicationAlt->u16TID); pstAddIndication->psfAdmittedSet = (struct bcm_connect_mgr_params *)tmp___5; if ((unsigned long )pstAddIndication->psfAdmittedSet == (unsigned long )((struct bcm_connect_mgr_params *)0)) { kfree((void const *)pstAddIndication); return (0UL); } else { } tmp___6 = StoreSFParam(Adapter, (unsigned char *)(& pstAddIndicationAlt->sfAdmittedSet), (unsigned long )pstAddIndication->psfAdmittedSet); if (tmp___6 != 1UL) { kfree((void const *)pstAddIndication); return (0UL); } else { } tmp___7 = __fswab32((unsigned int )((long )pstAddIndication->psfAdmittedSet)); pstAddIndication->psfAdmittedSet = (struct bcm_connect_mgr_params *)((long )tmp___7); tmp___8 = GetNextTargetBufferLocation(Adapter, (int )pstAddIndicationAlt->u16TID); pstAddIndication->psfActiveSet = (struct bcm_connect_mgr_params *)tmp___8; if ((unsigned long )pstAddIndication->psfActiveSet == (unsigned long )((struct bcm_connect_mgr_params *)0)) { kfree((void const *)pstAddIndication); return (0UL); } else { } tmp___9 = StoreSFParam(Adapter, (unsigned char *)(& pstAddIndicationAlt->sfActiveSet), (unsigned long )pstAddIndication->psfActiveSet); if (tmp___9 != 1UL) { kfree((void const *)pstAddIndication); return (0UL); } else { } tmp___10 = __fswab32((unsigned int )((long )pstAddIndication->psfActiveSet)); pstAddIndication->psfActiveSet = (struct bcm_connect_mgr_params *)((long )tmp___10); *puBufferLength = 40U; *((struct bcm_add_indication *)pvBuffer) = *pstAddIndication; kfree((void const *)pstAddIndication); return (1UL); } } __inline static struct bcm_add_indication_alt *RestoreCmControlResponseMessage(struct bcm_mini_adapter *Adapter , PVOID pvBuffer ) { ULONG ulStatus ; struct bcm_add_indication *pstAddIndication ; struct bcm_add_indication_alt *pstAddIndicationDest ; void *tmp ; __u16 tmp___2 ; __u16 tmp___5 ; __u16 tmp___8 ; { ulStatus = 0UL; pstAddIndication = 0; pstAddIndicationDest = 0; pstAddIndication = (struct bcm_add_indication *)pvBuffer; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:=====>", "RestoreCmControlResponseMessage"); } else { } if (((unsigned int )pstAddIndication->u8Type == 17U || (unsigned int )pstAddIndication->u8Type == 18U) || (unsigned int )pstAddIndication->u8Type == 19U) { return ((struct bcm_add_indication_alt *)pvBuffer); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:Inside RestoreCmControlResponseMessage ", "RestoreCmControlResponseMessage"); } else { } tmp = kmalloc(8460UL, 208U); pstAddIndicationDest = (struct bcm_add_indication_alt *)tmp; if ((unsigned long )pstAddIndicationDest != (unsigned long )((struct bcm_add_indication_alt *)0)) { memset((void *)pstAddIndicationDest, 0, 8460UL); } else { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:Failed to allocate memory for SF Add Indication Structure ", "RestoreCmControlResponseMessage"); } else { } return (0); } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:AddIndication-u8Type : 0x%X", "RestoreCmControlResponseMessage", (int )pstAddIndication->u8Type); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:AddIndication-u8Direction : 0x%X", "RestoreCmControlResponseMessage", (int )pstAddIndication->eConnectionDir); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { tmp___2 = __fswab16((int )pstAddIndication->u16TID); printk("\017%s:AddIndication-u8TID : 0x%X", "RestoreCmControlResponseMessage", (int )tmp___2); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { tmp___5 = __fswab16((int )pstAddIndication->u16CID); printk("\017%s:AddIndication-u8CID : 0x%X", "RestoreCmControlResponseMessage", (int )tmp___5); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { tmp___8 = __fswab16((int )pstAddIndication->u16VCID); printk("\017%s:AddIndication-u16VCID : 0x%X", "RestoreCmControlResponseMessage", (int )tmp___8); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:AddIndication-autorized set loc : %p", "RestoreCmControlResponseMessage", pstAddIndication->psfAuthorizedSet); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:AddIndication-admitted set loc : %p", "RestoreCmControlResponseMessage", pstAddIndication->psfAdmittedSet); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:AddIndication-Active set loc : %p", "RestoreCmControlResponseMessage", pstAddIndication->psfActiveSet); } else { } pstAddIndicationDest->u8Type = pstAddIndication->u8Type; pstAddIndicationDest->u8Direction = pstAddIndication->eConnectionDir; pstAddIndicationDest->u16TID = pstAddIndication->u16TID; pstAddIndicationDest->u16CID = pstAddIndication->u16CID; pstAddIndicationDest->u16VCID = pstAddIndication->u16VCID; pstAddIndicationDest->u8CC = pstAddIndication->u8CC; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:Restoring Active Set ", "RestoreCmControlResponseMessage"); } else { } ulStatus = RestoreSFParam(Adapter, (unsigned long )pstAddIndication->psfActiveSet, (unsigned char *)(& pstAddIndicationDest->sfActiveSet)); if (ulStatus != 1UL) { goto failed_restore_sf_param; } else { } if ((unsigned int )pstAddIndicationDest->sfActiveSet.u8TotalClassifiers > 4U) { pstAddIndicationDest->sfActiveSet.u8TotalClassifiers = 4U; } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:Restoring Admitted Set ", "RestoreCmControlResponseMessage"); } else { } ulStatus = RestoreSFParam(Adapter, (unsigned long )pstAddIndication->psfAdmittedSet, (unsigned char *)(& pstAddIndicationDest->sfAdmittedSet)); if (ulStatus != 1UL) { goto failed_restore_sf_param; } else { } if ((unsigned int )pstAddIndicationDest->sfAdmittedSet.u8TotalClassifiers > 4U) { pstAddIndicationDest->sfAdmittedSet.u8TotalClassifiers = 4U; } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:Restoring Authorized Set ", "RestoreCmControlResponseMessage"); } else { } ulStatus = RestoreSFParam(Adapter, (unsigned long )pstAddIndication->psfAuthorizedSet, (unsigned char *)(& pstAddIndicationDest->sfAuthorizedSet)); if (ulStatus != 1UL) { goto failed_restore_sf_param; } else { } if ((unsigned int )pstAddIndicationDest->sfAuthorizedSet.u8TotalClassifiers > 4U) { pstAddIndicationDest->sfAuthorizedSet.u8TotalClassifiers = 4U; } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:Dumping the whole raw packet", "RestoreCmControlResponseMessage"); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:============================================================", "RestoreCmControlResponseMessage"); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s: pstAddIndicationDest->sfActiveSet size %zx %p", "RestoreCmControlResponseMessage", 8460UL, pstAddIndicationDest); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:============================================================", "RestoreCmControlResponseMessage"); } else { } return (pstAddIndicationDest); failed_restore_sf_param: kfree((void const *)pstAddIndicationDest); if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:<=====", "RestoreCmControlResponseMessage"); } else { } return (0); } } unsigned long SetUpTargetDsxBuffers(struct bcm_mini_adapter *Adapter ) { ULONG ulTargetDsxBuffersBase ; ULONG ulCntTargetBuffers ; ULONG i ; int Status ; { ulTargetDsxBuffersBase = 0UL; if ((unsigned long )Adapter == (unsigned long )((struct bcm_mini_adapter *)0)) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:Adapter was NULL!!!", "SetUpTargetDsxBuffers"); } else { } return (0UL); } else { } if (Adapter->astTargetDsxBuffer[0].ulTargetDsxBuffer != 0UL) { return (1UL); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:Size of Each DSX Buffer(Also size of connection manager parameters): %zx ", "SetUpTargetDsxBuffers", 2816UL); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:Reading DSX buffer From Target location %x ", "SetUpTargetDsxBuffers", 3210783876U); } else { } Status = rdmalt(Adapter, 3210783876U, (unsigned int *)(& ulTargetDsxBuffersBase), 4UL); if (Status < 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:RDM failed!!", "SetUpTargetDsxBuffers"); } else { } return (0UL); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:Base Address Of DSX Target Buffer : 0x%lx", "SetUpTargetDsxBuffers", ulTargetDsxBuffersBase); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:Tgt Buffer is Now %lx :", "SetUpTargetDsxBuffers", ulTargetDsxBuffersBase); } else { } ulCntTargetBuffers = 25UL; if (24UL < ulCntTargetBuffers) { Adapter->ulTotalTargetBuffersAvailable = 24UL; } else { Adapter->ulTotalTargetBuffersAvailable = ulCntTargetBuffers; } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s: Total Target DSX Buffer setup %lx ", "SetUpTargetDsxBuffers", Adapter->ulTotalTargetBuffersAvailable); } else { } i = 0UL; goto ldv_47107; ldv_47106: Adapter->astTargetDsxBuffer[i].ulTargetDsxBuffer = ulTargetDsxBuffersBase; Adapter->astTargetDsxBuffer[i].valid = 1; Adapter->astTargetDsxBuffer[i].tid = 0U; ulTargetDsxBuffersBase = ulTargetDsxBuffersBase + 2816UL; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s: Target DSX Buffer %lx setup at 0x%lx", "SetUpTargetDsxBuffers", i, Adapter->astTargetDsxBuffer[i].ulTargetDsxBuffer); } else { } i = i + 1UL; ldv_47107: ; if (Adapter->ulTotalTargetBuffersAvailable > i) { goto ldv_47106; } else { goto ldv_47108; } ldv_47108: Adapter->ulCurrentTargetBuffer = 0UL; Adapter->ulFreeTargetBufferCnt = Adapter->ulTotalTargetBuffersAvailable; return (1UL); } } static ULONG GetNextTargetBufferLocation(struct bcm_mini_adapter *Adapter , B_UINT16 tid ) { ULONG dsx_buf ; ULONG idx ; ULONG max_try ; { if (Adapter->ulTotalTargetBuffersAvailable == 0UL || Adapter->ulFreeTargetBufferCnt == 0UL) { ClearTargetDSXBuffer(Adapter, (int )tid, 0); return (0UL); } else { } idx = Adapter->ulCurrentTargetBuffer; max_try = Adapter->ulTotalTargetBuffersAvailable; goto ldv_47117; ldv_47116: idx = (idx + 1UL) % Adapter->ulTotalTargetBuffersAvailable; max_try = max_try - 1UL; ldv_47117: ; if (max_try != 0UL && (int )((signed char )Adapter->astTargetDsxBuffer[idx].valid) != 1) { goto ldv_47116; } else { goto ldv_47118; } ldv_47118: ; if (max_try == 0UL) { printk("\016%s:\n GetNextTargetBufferLocation : Error No Free Target DSX Buffers FreeCnt : %lx ", "GetNextTargetBufferLocation", Adapter->ulFreeTargetBufferCnt); ClearTargetDSXBuffer(Adapter, (int )tid, 0); return (0UL); } else { } dsx_buf = Adapter->astTargetDsxBuffer[idx].ulTargetDsxBuffer; Adapter->astTargetDsxBuffer[idx].valid = 0; Adapter->astTargetDsxBuffer[idx].tid = tid; Adapter->ulFreeTargetBufferCnt = Adapter->ulFreeTargetBufferCnt - 1UL; idx = (idx + 1UL) % Adapter->ulTotalTargetBuffersAvailable; Adapter->ulCurrentTargetBuffer = idx; printk("\016%s:GetNextTargetBufferLocation :Returning address %lx tid %d\n", "GetNextTargetBufferLocation", dsx_buf, (int )tid); return (dsx_buf); } } int AllocAdapterDsxBuffer(struct bcm_mini_adapter *Adapter ) { void *tmp ; { tmp = kmalloc(8468UL, 208U); Adapter->caDsxReqResp = (CHAR *)tmp; if ((unsigned long )Adapter->caDsxReqResp == (unsigned long )((CHAR *)0)) { return (-12); } else { } return (0); } } int FreeAdapterDsxBuffer(struct bcm_mini_adapter *Adapter ) { { kfree((void const *)Adapter->caDsxReqResp); return (0); } } BOOLEAN CmControlResponseMessage(struct bcm_mini_adapter *Adapter , void *pvBuffer ) { struct bcm_connect_mgr_params *psfLocalSet ; struct bcm_add_indication_alt *pstAddIndication ; struct bcm_change_indication *pstChangeIndication ; struct bcm_leader *pLeader ; __u16 tmp___1 ; UINT uiSearchRuleIndex ; __u16 tmp___4 ; int tmp___5 ; __u16 tmp___6 ; __u16 tmp___7 ; size_t __len ; void *__ret ; unsigned long tmp___8 ; UINT uiSearchRuleIndex___0 ; __u32 tmp___9 ; INT tmp___10 ; __u16 tmp___11 ; __u16 tmp___12 ; __u16 tmp___15 ; UINT uiSearchRuleIndex___1 ; ULONG ulSFID ; __u32 tmp___16 ; INT tmp___17 ; { psfLocalSet = 0; pstAddIndication = 0; pstChangeIndication = 0; pLeader = 0; pstAddIndication = RestoreCmControlResponseMessage(Adapter, pvBuffer); if ((unsigned long )pstAddIndication == (unsigned long )((struct bcm_add_indication_alt *)0)) { ClearTargetDSXBuffer(Adapter, (int )((struct bcm_add_indication *)pvBuffer)->u16TID, 0); printk("\016%s:Error in restoring Service Flow param structure from DSx message", "CmControlResponseMessage"); return (0); } else { } DumpCmControlPacket((PVOID )pstAddIndication); if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:====>", "CmControlResponseMessage"); } else { } pLeader = (struct bcm_leader *)Adapter->caDsxReqResp; pLeader->Status = 137U; pLeader->Vcid = 0U; ClearTargetDSXBuffer(Adapter, (int )pstAddIndication->u16TID, 0); printk("\016%s:### TID RECEIVED %d\n", "CmControlResponseMessage", (int )pstAddIndication->u16TID); switch ((int )pstAddIndication->u8Type) { case 11: pLeader->PLength = 8460U; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:Sending DSA Response....\n", "CmControlResponseMessage"); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:SENDING DSA RESPONSE TO MAC %d", "CmControlResponseMessage", (int )pLeader->PLength); } else { } *((struct bcm_add_indication_alt *)Adapter->caDsxReqResp + 8U) = *pstAddIndication; ((struct bcm_add_indication_alt *)Adapter->caDsxReqResp + 8U)->u8Type = 12U; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { tmp___1 = __fswab16((int )pstAddIndication->u16VCID); printk("\017%s: VCID = %x", "CmControlResponseMessage", (int )tmp___1); } else { } CopyBufferToControlPacket(Adapter, (void *)Adapter->caDsxReqResp); kfree((void const *)pstAddIndication); goto ldv_47136; case 12: pLeader->PLength = 8460U; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:SENDING DSA ACK TO MAC %d", "CmControlResponseMessage", (int )pLeader->PLength); } else { } *((struct bcm_add_indication_alt *)Adapter->caDsxReqResp + 8U) = *pstAddIndication; ((struct bcm_add_indication_alt *)Adapter->caDsxReqResp + 8U)->u8Type = 13U; case 13: uiSearchRuleIndex = 0U; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { tmp___4 = __fswab16((int )pstAddIndication->u16VCID); printk("\017%s:VCID:0x%X", "CmControlResponseMessage", (int )tmp___4); } else { } tmp___5 = SearchFreeSfid(Adapter); uiSearchRuleIndex = (UINT )tmp___5; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:uiSearchRuleIndex:0x%X ", "CmControlResponseMessage", uiSearchRuleIndex); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:Direction:0x%X ", "CmControlResponseMessage", (int )pstAddIndication->u8Direction); } else { } if (uiSearchRuleIndex <= 16U) { Adapter->PackInfo[uiSearchRuleIndex].ucDirection = pstAddIndication->u8Direction; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:bValid:0x%X ", "CmControlResponseMessage", (int )pstAddIndication->sfActiveSet.bValid); } else { } if ((unsigned int )pstAddIndication->sfActiveSet.bValid == 1U) { Adapter->PackInfo[uiSearchRuleIndex].bActiveSet = 1; } else { } if ((unsigned int )pstAddIndication->sfAuthorizedSet.bValid == 1U) { Adapter->PackInfo[uiSearchRuleIndex].bAuthorizedSet = 1; } else { } if ((unsigned int )pstAddIndication->sfAdmittedSet.bValid == 1U) { Adapter->PackInfo[uiSearchRuleIndex].bAdmittedSet = 1; } else { } if ((unsigned int )pstAddIndication->sfActiveSet.bValid == 0U) { Adapter->PackInfo[uiSearchRuleIndex].bActive = 0; Adapter->PackInfo[uiSearchRuleIndex].bActivateRequestSent = 0; if ((unsigned int )pstAddIndication->sfAdmittedSet.bValid != 0U) { psfLocalSet = & pstAddIndication->sfAdmittedSet; } else if ((unsigned int )pstAddIndication->sfAuthorizedSet.bValid != 0U) { psfLocalSet = & pstAddIndication->sfAuthorizedSet; } else { } } else { psfLocalSet = & pstAddIndication->sfActiveSet; Adapter->PackInfo[uiSearchRuleIndex].bActive = 1; } if ((unsigned long )psfLocalSet == (unsigned long )((struct bcm_connect_mgr_params *)0)) { printk("\016%s:No set is valid\n", "CmControlResponseMessage"); Adapter->PackInfo[uiSearchRuleIndex].bActive = 0; Adapter->PackInfo[uiSearchRuleIndex].bValid = 0; Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value = 0U; kfree((void const *)pstAddIndication); } else if ((unsigned int )psfLocalSet->bValid != 0U && (unsigned int )pstAddIndication->u8CC == 0U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:DSA ACK", "CmControlResponseMessage"); } else { } tmp___6 = __fswab16((int )pstAddIndication->u16VCID); Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value = tmp___6; tmp___7 = __fswab16((int )pstAddIndication->u16CID); Adapter->PackInfo[uiSearchRuleIndex].usCID = tmp___7; if ((unsigned int )pstAddIndication->u8Direction == 1U) { atomic_set(& Adapter->PackInfo[uiSearchRuleIndex].uiPerSFTxResourceCount, 60); } else { } CopyToAdapter(Adapter, psfLocalSet, uiSearchRuleIndex, 13, pstAddIndication); __len = 4UL; if (__len > 63UL) { __ret = memcpy(pvBuffer + 1U, (void const *)(& psfLocalSet->u32SFID), __len); } else { __ret = memcpy(pvBuffer + 1U, (void const *)(& psfLocalSet->u32SFID), __len); } if ((unsigned int )pstAddIndication->sfActiveSet.bValid == 1U) { if ((unsigned int )pstAddIndication->u8Direction == 1U) { if ((int )((signed char )Adapter->LinkUpStatus) == 0) { netif_carrier_on(Adapter->dev); netif_start_queue(Adapter->dev); Adapter->LinkUpStatus = 1; if ((Adapter->msg_enable & 4U) != 0U) { printk("\016beceem %s: link up\n", (char *)(& (Adapter->dev)->name)); } else { } atomic_set(& Adapter->TxPktAvail, 1); __wake_up(& Adapter->tx_packet_wait_queue, 3U, 1, 0); tmp___8 = get_seconds(); Adapter->liTimeSinceLastNetEntry = (UINT32 )tmp___8; } else { } } else { } } else { } } else { Adapter->PackInfo[uiSearchRuleIndex].bActive = 0; Adapter->PackInfo[uiSearchRuleIndex].bValid = 0; Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value = 0U; kfree((void const *)pstAddIndication); } } else { printk("\016%s:DSA ACK did not get valid SFID", "CmControlResponseMessage"); kfree((void const *)pstAddIndication); return (0); } goto ldv_47136; case 14: pLeader->PLength = 8460U; pstChangeIndication = (struct bcm_change_indication *)pstAddIndication; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:SENDING DSC RESPONSE TO MAC %d", "CmControlResponseMessage", (int )pLeader->PLength); } else { } *((struct bcm_change_indication *)Adapter->caDsxReqResp + 8U) = *pstChangeIndication; ((struct bcm_change_indication *)Adapter->caDsxReqResp + 8U)->u8Type = 15U; CopyBufferToControlPacket(Adapter, (void *)Adapter->caDsxReqResp); kfree((void const *)pstAddIndication); goto ldv_47136; case 15: pLeader->PLength = 8460U; pstChangeIndication = (struct bcm_change_indication *)pstAddIndication; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:SENDING DSC ACK TO MAC %d", "CmControlResponseMessage", (int )pLeader->PLength); } else { } *((struct bcm_change_indication *)Adapter->caDsxReqResp + 8U) = *pstChangeIndication; ((struct bcm_change_indication *)Adapter->caDsxReqResp + 8U)->u8Type = 16U; case 16: uiSearchRuleIndex___0 = 0U; pstChangeIndication = (struct bcm_change_indication *)pstAddIndication; tmp___9 = __fswab32(pstChangeIndication->sfActiveSet.u32SFID); tmp___10 = SearchSfid(Adapter, tmp___9); uiSearchRuleIndex___0 = (UINT )tmp___10; if (uiSearchRuleIndex___0 > 16U) { printk("\016%s:SF doesn\'t exist for which DSC_ACK is received", "CmControlResponseMessage"); } else { } if (uiSearchRuleIndex___0 <= 16U) { Adapter->PackInfo[uiSearchRuleIndex___0].ucDirection = pstChangeIndication->u8Direction; if ((unsigned int )pstChangeIndication->sfActiveSet.bValid == 1U) { Adapter->PackInfo[uiSearchRuleIndex___0].bActiveSet = 1; } else { } if ((unsigned int )pstChangeIndication->sfAuthorizedSet.bValid == 1U) { Adapter->PackInfo[uiSearchRuleIndex___0].bAuthorizedSet = 1; } else { } if ((unsigned int )pstChangeIndication->sfAdmittedSet.bValid == 1U) { Adapter->PackInfo[uiSearchRuleIndex___0].bAdmittedSet = 1; } else { } if ((unsigned int )pstChangeIndication->sfActiveSet.bValid == 0U) { Adapter->PackInfo[uiSearchRuleIndex___0].bActive = 0; Adapter->PackInfo[uiSearchRuleIndex___0].bActivateRequestSent = 0; if ((unsigned int )pstChangeIndication->sfAdmittedSet.bValid != 0U) { psfLocalSet = & pstChangeIndication->sfAdmittedSet; } else if ((unsigned int )pstChangeIndication->sfAuthorizedSet.bValid != 0U) { psfLocalSet = & pstChangeIndication->sfAuthorizedSet; } else { } } else { psfLocalSet = & pstChangeIndication->sfActiveSet; Adapter->PackInfo[uiSearchRuleIndex___0].bActive = 1; } if ((unsigned long )psfLocalSet == (unsigned long )((struct bcm_connect_mgr_params *)0)) { printk("\016%s:No set is valid\n", "CmControlResponseMessage"); Adapter->PackInfo[uiSearchRuleIndex___0].bActive = 0; Adapter->PackInfo[uiSearchRuleIndex___0].bValid = 0; Adapter->PackInfo[uiSearchRuleIndex___0].usVCID_Value = 0U; kfree((void const *)pstAddIndication); } else if ((unsigned int )psfLocalSet->bValid != 0U && (unsigned int )pstChangeIndication->u8CC == 0U) { tmp___11 = __fswab16((int )pstChangeIndication->u16VCID); Adapter->PackInfo[uiSearchRuleIndex___0].usVCID_Value = tmp___11; printk("\016%s:CC field is %d bvalid = %d\n", "CmControlResponseMessage", (int )pstChangeIndication->u8CC, (int )psfLocalSet->bValid); tmp___12 = __fswab16((int )pstChangeIndication->u16VCID); printk("\016%s:VCID= %d\n", "CmControlResponseMessage", (int )tmp___12); tmp___15 = __fswab16((int )pstChangeIndication->u16CID); Adapter->PackInfo[uiSearchRuleIndex___0].usCID = tmp___15; CopyToAdapter(Adapter, psfLocalSet, uiSearchRuleIndex___0, 16, pstAddIndication); *((unsigned long *)pvBuffer + 1U) = (unsigned long )psfLocalSet->u32SFID; } else if ((unsigned int )pstChangeIndication->u8CC == 6U) { deleteSFBySfid(Adapter, uiSearchRuleIndex___0); kfree((void const *)pstAddIndication); } else { } } else { printk("\016%s:DSC ACK did not get valid SFID", "CmControlResponseMessage"); kfree((void const *)pstAddIndication); return (0); } goto ldv_47136; case 17: pLeader->PLength = 16U; *((struct bcm_del_indication *)Adapter->caDsxReqResp + 8U) = *((struct bcm_del_indication *)pstAddIndication); tmp___16 = __fswab32(((struct bcm_del_indication *)pstAddIndication)->u32SFID); ulSFID = (ULONG )tmp___16; tmp___17 = SearchSfid(Adapter, (UINT )ulSFID); uiSearchRuleIndex___1 = (UINT )tmp___17; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:DSD - Removing connection %x", "CmControlResponseMessage", uiSearchRuleIndex___1); } else { } if (uiSearchRuleIndex___1 <= 16U) { deleteSFBySfid(Adapter, uiSearchRuleIndex___1); Adapter->u32TotalDSD = Adapter->u32TotalDSD + 1U; } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:SENDING DSD RESPONSE TO MAC", "CmControlResponseMessage"); } else { } ((struct bcm_del_indication *)Adapter->caDsxReqResp + 8U)->u8Type = 18U; CopyBufferToControlPacket(Adapter, (void *)Adapter->caDsxReqResp); case 18: ; goto ldv_47136; case 19: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:DSD ACK Rcd, let App handle it\n", "CmControlResponseMessage"); } else { } goto ldv_47136; default: kfree((void const *)pstAddIndication); return (0); } ldv_47136: ; return (1); } } int get_dsx_sf_data_to_application(struct bcm_mini_adapter *Adapter , UINT uiSFId , void *user_buffer ) { int status ; struct bcm_packet_info *psSfInfo ; int tmp ; { status = 0; psSfInfo = 0; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:status =%d", "get_dsx_sf_data_to_application", status); } else { } status = SearchSfid(Adapter, uiSFId); if (status > 16) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:SFID %d not present in queue !!!", "get_dsx_sf_data_to_application", uiSFId); } else { } return (-22); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:status =%d", "get_dsx_sf_data_to_application", status); } else { } psSfInfo = (struct bcm_packet_info *)(& Adapter->PackInfo) + (unsigned long )status; if ((unsigned long )psSfInfo->pstSFIndication != (unsigned long )((void *)0)) { tmp = copy_to_user(user_buffer, (void const *)psSfInfo->pstSFIndication, 8460U); if (tmp != 0) { printk("\016%s:copy to user failed SFID %d, present in queue !!!", "get_dsx_sf_data_to_application", uiSFId); status = -14; return (status); } else { } } else { } return (0); } } VOID OverrideServiceFlowParams(struct bcm_mini_adapter *Adapter , PUINT puiBuffer ) { B_UINT32 u32NumofSFsinMsg ; __u32 tmp ; struct bcm_stim_sfhostnotify *pHostInfo ; UINT uiSearchRuleIndex ; ULONG ulSFID ; __u32 tmp___0 ; INT tmp___1 ; __u16 tmp___2 ; __u16 tmp___3 ; { tmp = __fswab32(*(puiBuffer + 1UL)); u32NumofSFsinMsg = tmp; pHostInfo = 0; uiSearchRuleIndex = 0U; ulSFID = 0UL; puiBuffer = puiBuffer + 2UL; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:u32NumofSFsinMsg: 0x%x\n", "OverrideServiceFlowParams", u32NumofSFsinMsg); } else { } goto ldv_47170; ldv_47171: u32NumofSFsinMsg = u32NumofSFsinMsg - 1U; pHostInfo = (struct bcm_stim_sfhostnotify *)puiBuffer; puiBuffer = (unsigned int *)pHostInfo + 1U; tmp___0 = __fswab32(pHostInfo->SFID); ulSFID = (ULONG )tmp___0; tmp___1 = SearchSfid(Adapter, (UINT )ulSFID); uiSearchRuleIndex = (UINT )tmp___1; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:SFID: 0x%lx\n", "OverrideServiceFlowParams", ulSFID); } else { } if (uiSearchRuleIndex > 16U || uiSearchRuleIndex == 16U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:The SFID <%lx> doesn\'t exist in host entry or is Invalid\n", "OverrideServiceFlowParams", ulSFID); } else { } goto ldv_47170; } else { } if ((unsigned int )pHostInfo->RetainSF == 0U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:Going to Delete SF", "OverrideServiceFlowParams"); } else { } deleteSFBySfid(Adapter, uiSearchRuleIndex); } else { tmp___2 = __fswab16((int )pHostInfo->VCID); Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value = tmp___2; tmp___3 = __fswab16((int )pHostInfo->newCID); Adapter->PackInfo[uiSearchRuleIndex].usCID = tmp___3; Adapter->PackInfo[uiSearchRuleIndex].bActive = 0; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:pHostInfo->QoSParamSet: 0x%x\n", "OverrideServiceFlowParams", (int )pHostInfo->QoSParamSet); } else { } if ((int )pHostInfo->QoSParamSet & 1) { Adapter->PackInfo[uiSearchRuleIndex].bAuthorizedSet = 1; } else { } if (((int )pHostInfo->QoSParamSet & 2) != 0) { Adapter->PackInfo[uiSearchRuleIndex].bAdmittedSet = 1; } else { } if (((int )pHostInfo->QoSParamSet & 4) != 0) { Adapter->PackInfo[uiSearchRuleIndex].bActiveSet = 1; Adapter->PackInfo[uiSearchRuleIndex].bActive = 1; } else { } } ldv_47170: ; if (u32NumofSFsinMsg != 0U && u32NumofSFsinMsg <= 16U) { goto ldv_47171; } else { goto ldv_47172; } ldv_47172: ; return; } } void ldv_mutex_lock_103(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_104(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_105(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_device(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_106(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___2 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex_of_device(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_107(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_device(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_108(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_109(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } int ldv_mutex_trylock_120(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_118(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_121(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_123(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_117(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_119(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_122(struct mutex *ldv_func_arg1 ) ; USHORT IpVersion6(struct bcm_mini_adapter *Adapter , PVOID pcIpHeader , struct bcm_classifier_rule *pstClassifierRule ) ; VOID DumpIpv6Address(ULONG *puIpv6Address ) ; BOOLEAN MatchSrcPort(struct bcm_classifier_rule *pstClassifierRule , USHORT ushSrcPort ) ; BOOLEAN MatchDestPort(struct bcm_classifier_rule *pstClassifierRule , USHORT ushDestPort ) ; BOOLEAN MatchProtocol(struct bcm_classifier_rule *pstClassifierRule , UCHAR ucProtocol ) ; static BOOLEAN MatchSrcIpv6Address(struct bcm_classifier_rule *pstClassifierRule , IPV6Header *pstIpv6Header ) ; static BOOLEAN MatchDestIpv6Address(struct bcm_classifier_rule *pstClassifierRule , IPV6Header *pstIpv6Header ) ; static VOID DumpIpv6Header(IPV6Header *pstIpv6Header ) ; static UCHAR *GetNextIPV6ChainedHeader(UCHAR **ppucPayload , UCHAR *pucNextHeader , BOOLEAN *bParseDone , USHORT *pusPayloadLength ) { UCHAR *pucRetHeaderPtr ; UCHAR *pucPayloadPtr ; USHORT usNextHeaderOffset ; struct bcm_mini_adapter *Adapter ; void *tmp ; IPV6RoutingHeader *pstIpv6RoutingHeader ; IPV6DestOptionsHeader *pstIpv6DestOptsHdr ; int nTotalOptions ; IPV6AuthenticationHeader *pstIpv6AuthHdr ; int nHdrLen ; { pucRetHeaderPtr = 0; pucPayloadPtr = 0; usNextHeaderOffset = 0U; tmp = netdev_priv((struct net_device const *)gblpnetdev); Adapter = (struct bcm_mini_adapter *)tmp; if (((unsigned long )ppucPayload == (unsigned long )((UCHAR **)0) || (unsigned int )*pusPayloadLength == 0U) || (int )((signed char )*bParseDone) != 0) { *bParseDone = 1; return (0); } else { } pucRetHeaderPtr = *ppucPayload; pucPayloadPtr = *ppucPayload; if ((unsigned long )pucRetHeaderPtr == (unsigned long )((UCHAR *)0) || (unsigned long )pucPayloadPtr == (unsigned long )((UCHAR *)0)) { *bParseDone = 1; return (0); } else { } *bParseDone = 0; switch ((int )*pucNextHeader) { case 0: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 16384U) != 0U) { printk("\017%s:\nIPv6 HopByHop Header", "GetNextIPV6ChainedHeader"); } else { } usNextHeaderOffset = (unsigned int )usNextHeaderOffset + 16U; goto ldv_46830; case 43: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 16384U) != 0U) { printk("\017%s:\nIPv6 Routing Header", "GetNextIPV6ChainedHeader"); } else { } pstIpv6RoutingHeader = (IPV6RoutingHeader *)pucPayloadPtr; usNextHeaderOffset = (unsigned int )usNextHeaderOffset + 16U; usNextHeaderOffset = (unsigned int )((USHORT )pstIpv6RoutingHeader->ucNumAddresses) * 16U + (unsigned int )usNextHeaderOffset; goto ldv_46830; case 44: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 16384U) != 0U) { printk("\017%s:\nIPv6 Fragmentation Header", "GetNextIPV6ChainedHeader"); } else { } usNextHeaderOffset = (unsigned int )usNextHeaderOffset + 16U; goto ldv_46830; case 60: pstIpv6DestOptsHdr = (IPV6DestOptionsHeader *)pucPayloadPtr; nTotalOptions = (int )pstIpv6DestOptsHdr->ucHdrExtLen; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 16384U) != 0U) { printk("\017%s:\nIPv6 DestOpts Header Header", "GetNextIPV6ChainedHeader"); } else { } usNextHeaderOffset = (unsigned int )usNextHeaderOffset + 8U; usNextHeaderOffset = (unsigned int )((USHORT )nTotalOptions) * 8U + (unsigned int )usNextHeaderOffset; goto ldv_46830; case 51: pstIpv6AuthHdr = (IPV6AuthenticationHeader *)pucPayloadPtr; nHdrLen = (int )pstIpv6AuthHdr->ucLength; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 16384U) != 0U) { printk("\017%s:\nIPv6 Authentication Header", "GetNextIPV6ChainedHeader"); } else { } usNextHeaderOffset = (unsigned int )((USHORT )nHdrLen) * 4U + (unsigned int )usNextHeaderOffset; goto ldv_46830; case 52: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 16384U) != 0U) { printk("\017%s:\nIPv6 Encrypted Security Payload Header", "GetNextIPV6ChainedHeader"); } else { } *bParseDone = 1; goto ldv_46830; case 2: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 16384U) != 0U) { printk("\017%s:\nICMP Header", "GetNextIPV6ChainedHeader"); } else { } *bParseDone = 1; goto ldv_46830; case 6: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 16384U) != 0U) { printk("\017%s:\nTCP Header", "GetNextIPV6ChainedHeader"); } else { } *bParseDone = 1; goto ldv_46830; case 17: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 16384U) != 0U) { printk("\017%s:\nUDP Header", "GetNextIPV6ChainedHeader"); } else { } *bParseDone = 1; goto ldv_46830; default: *bParseDone = 1; goto ldv_46830; } ldv_46830: ; if ((int )((signed char )*bParseDone) == 0) { if ((int )*pusPayloadLength <= (int )usNextHeaderOffset) { *bParseDone = 1; } else { *pucNextHeader = *pucPayloadPtr; pucPayloadPtr = pucPayloadPtr + (unsigned long )usNextHeaderOffset; *pusPayloadLength = (int )*pusPayloadLength - (int )usNextHeaderOffset; } } else { } *ppucPayload = pucPayloadPtr; return (pucRetHeaderPtr); } } static UCHAR GetIpv6ProtocolPorts(UCHAR *pucPayload , USHORT *pusSrcPort , USHORT *pusDestPort , USHORT usPayloadLength , UCHAR ucNextHeader ) { UCHAR *pIpv6HdrScanContext ; BOOLEAN bDone ; UCHAR ucHeaderType ; UCHAR *pucNextHeader ; struct bcm_mini_adapter *Adapter ; void *tmp ; USHORT tmp___0 ; __u16 tmp___5 ; __u16 tmp___6 ; { pIpv6HdrScanContext = pucPayload; bDone = 0; ucHeaderType = 0U; pucNextHeader = 0; tmp = netdev_priv((struct net_device const *)gblpnetdev); Adapter = (struct bcm_mini_adapter *)tmp; if ((unsigned long )pucPayload == (unsigned long )((UCHAR *)0) || (unsigned int )usPayloadLength == 0U) { return (0U); } else { } tmp___0 = 0U; *pusDestPort = tmp___0; *pusSrcPort = tmp___0; ucHeaderType = ucNextHeader; goto ldv_46860; ldv_46859: pucNextHeader = GetNextIPV6ChainedHeader(& pIpv6HdrScanContext, & ucHeaderType, & bDone, & usPayloadLength); if ((int )((signed char )bDone) != 0) { if ((unsigned int )ucHeaderType == 6U || (unsigned int )ucHeaderType == 17U) { *pusSrcPort = *((unsigned short *)pucNextHeader); *pusDestPort = *((unsigned short *)pucNextHeader + 2U); if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 16384U) != 0U) { tmp___5 = __fswab16((int )*pusDestPort); tmp___6 = __fswab16((int )*pusSrcPort); printk("\017%s:\nProtocol Ports - Src Port :0x%x Dest Port : 0x%x", "GetIpv6ProtocolPorts", (int )tmp___6, (int )tmp___5); } else { } } else { } goto ldv_46858; } else { } ldv_46860: ; if ((int )((signed char )bDone) == 0) { goto ldv_46859; } else { goto ldv_46858; } ldv_46858: ; return (ucHeaderType); } } USHORT IpVersion6(struct bcm_mini_adapter *Adapter , PVOID pcIpHeader , struct bcm_classifier_rule *pstClassifierRule ) { USHORT ushDestPort ; USHORT ushSrcPort ; UCHAR ucNextProtocolAboveIP ; IPV6Header *pstIpv6Header ; BOOLEAN bClassificationSucceed ; __u16 tmp___1 ; __u16 tmp___2 ; __u16 tmp___5 ; __u16 tmp___6 ; INT iMatchedSFQueueIndex ; { ushDestPort = 0U; ushSrcPort = 0U; ucNextProtocolAboveIP = 0U; pstIpv6Header = 0; bClassificationSucceed = 0; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 16384U) != 0U) { printk("\017%s:IpVersion6 ==========>\n", "IpVersion6"); } else { } pstIpv6Header = (IPV6Header *)pcIpHeader; DumpIpv6Header(pstIpv6Header); ucNextProtocolAboveIP = GetIpv6ProtocolPorts((UCHAR *)pcIpHeader + 72U, & ushSrcPort, & ushDestPort, (int )pstIpv6Header->usPayloadLength, (int )pstIpv6Header->ucNextHeader); if ((unsigned int )pstClassifierRule->ucDirection == 0U) { goto ldv_46872; } else { } if ((int )((signed char )pstClassifierRule->bIpv6Protocol) == 0) { goto ldv_46872; } else { } bClassificationSucceed = MatchSrcIpv6Address(pstClassifierRule, pstIpv6Header); if ((int )((signed char )bClassificationSucceed) == 0) { goto ldv_46872; } else { } bClassificationSucceed = MatchDestIpv6Address(pstClassifierRule, pstIpv6Header); if ((int )((signed char )bClassificationSucceed) == 0) { goto ldv_46872; } else { } bClassificationSucceed = MatchProtocol(pstClassifierRule, (int )ucNextProtocolAboveIP); if ((int )((signed char )bClassificationSucceed) == 0) { goto ldv_46872; } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 16384U) != 0U) { printk("\017%s:\nIPv6 Protocol Matched", "IpVersion6"); } else { } if ((unsigned int )ucNextProtocolAboveIP == 6U || (unsigned int )ucNextProtocolAboveIP == 17U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 16384U) != 0U) { tmp___1 = __fswab16((int )ushSrcPort); printk("\017%s:\nIPv6 Source Port:%x\n", "IpVersion6", (int )tmp___1); } else { } tmp___2 = __fswab16((int )ushSrcPort); bClassificationSucceed = MatchSrcPort(pstClassifierRule, (int )tmp___2); if ((int )((signed char )bClassificationSucceed) == 0) { goto ldv_46872; } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 16384U) != 0U) { printk("\017%s:\nIPv6 Src Port Matched", "IpVersion6"); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 16384U) != 0U) { tmp___5 = __fswab16((int )ushDestPort); printk("\017%s:\nIPv6 Destination Port:%x\n", "IpVersion6", (int )tmp___5); } else { } tmp___6 = __fswab16((int )ushDestPort); bClassificationSucceed = MatchDestPort(pstClassifierRule, (int )tmp___6); if ((int )((signed char )bClassificationSucceed) == 0) { goto ldv_46872; } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 16384U) != 0U) { printk("\017%s:\nIPv6 Dest Port Matched", "IpVersion6"); } else { } } else { } ldv_46872: ; if ((int )((signed char )bClassificationSucceed) == 1) { iMatchedSFQueueIndex = 0; iMatchedSFQueueIndex = SearchSfid(Adapter, (UINT )pstClassifierRule->ulSFID); if (iMatchedSFQueueIndex > 16) { bClassificationSucceed = 0; } else if ((int )((signed char )Adapter->PackInfo[iMatchedSFQueueIndex].bActive) == 0) { bClassificationSucceed = 0; } else { } } else { } return ((USHORT )bClassificationSucceed); } } static BOOLEAN MatchSrcIpv6Address(struct bcm_classifier_rule *pstClassifierRule , IPV6Header *pstIpv6Header ) { UINT uiLoopIndex ; UINT uiIpv6AddIndex ; UINT uiIpv6AddrNoLongWords ; ULONG aulSrcIP[4U] ; struct bcm_mini_adapter *Adapter ; void *tmp ; UINT uiCountIPSrcAddresses ; __u32 tmp___0 ; { uiLoopIndex = 0U; uiIpv6AddIndex = 0U; uiIpv6AddrNoLongWords = 4U; tmp = netdev_priv((struct net_device const *)gblpnetdev); Adapter = (struct bcm_mini_adapter *)tmp; uiCountIPSrcAddresses = (unsigned int )pstClassifierRule->ucIPSourceAddressLength; if (uiCountIPSrcAddresses == 0U) { return (1); } else { } uiIpv6AddIndex = 0U; goto ldv_46885; ldv_46884: tmp___0 = __fswab32((unsigned int )pstIpv6Header->ulSrcIpAddress[uiIpv6AddIndex]); aulSrcIP[uiIpv6AddIndex] = (ULONG )tmp___0; uiIpv6AddIndex = uiIpv6AddIndex + 1U; ldv_46885: ; if (uiIpv6AddIndex < uiIpv6AddrNoLongWords) { goto ldv_46884; } else { goto ldv_46886; } ldv_46886: uiLoopIndex = 0U; goto ldv_46892; ldv_46891: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 16384U) != 0U) { printk("\017%s:\n Src Ipv6 Address In Received Packet :\n ", "MatchSrcIpv6Address"); } else { } DumpIpv6Address((ULONG *)(& aulSrcIP)); if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 16384U) != 0U) { printk("\017%s:\n Src Ipv6 Mask In Classifier Rule:\n", "MatchSrcIpv6Address"); } else { } DumpIpv6Address((ULONG *)(& pstClassifierRule->stSrcIpAddress.ldv_45846.ulIpv6Mask) + (unsigned long )uiLoopIndex); if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 16384U) != 0U) { printk("\017%s:\n Src Ipv6 Address In Classifier Rule :\n", "MatchSrcIpv6Address"); } else { } DumpIpv6Address((ULONG *)(& pstClassifierRule->stSrcIpAddress.ldv_45846.ulIpv6Addr) + (unsigned long )uiLoopIndex); uiIpv6AddIndex = 0U; goto ldv_46890; ldv_46889: ; if ((pstClassifierRule->stSrcIpAddress.ldv_45846.ulIpv6Mask[uiLoopIndex + uiIpv6AddIndex] & aulSrcIP[uiIpv6AddIndex]) != pstClassifierRule->stSrcIpAddress.ldv_45846.ulIpv6Addr[uiLoopIndex + uiIpv6AddIndex]) { goto ldv_46888; } else { } if (uiIpv6AddrNoLongWords - 1U == uiIpv6AddIndex) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 16384U) != 0U) { printk("\017%s:Ipv6 Src Ip Address Matched\n", "MatchSrcIpv6Address"); } else { } return (1); } else { } uiIpv6AddIndex = uiIpv6AddIndex + 1U; ldv_46890: ; if (uiIpv6AddIndex < uiIpv6AddrNoLongWords) { goto ldv_46889; } else { goto ldv_46888; } ldv_46888: uiLoopIndex = uiLoopIndex + uiIpv6AddrNoLongWords; ldv_46892: ; if (uiLoopIndex < uiCountIPSrcAddresses) { goto ldv_46891; } else { goto ldv_46893; } ldv_46893: ; return (0); } } static BOOLEAN MatchDestIpv6Address(struct bcm_classifier_rule *pstClassifierRule , IPV6Header *pstIpv6Header ) { UINT uiLoopIndex ; UINT uiIpv6AddIndex ; UINT uiIpv6AddrNoLongWords ; ULONG aulDestIP[4U] ; struct bcm_mini_adapter *Adapter ; void *tmp ; UINT uiCountIPDestinationAddresses ; __u32 tmp___0 ; { uiLoopIndex = 0U; uiIpv6AddIndex = 0U; uiIpv6AddrNoLongWords = 4U; tmp = netdev_priv((struct net_device const *)gblpnetdev); Adapter = (struct bcm_mini_adapter *)tmp; uiCountIPDestinationAddresses = (unsigned int )pstClassifierRule->ucIPDestinationAddressLength; if (uiCountIPDestinationAddresses == 0U) { return (1); } else { } uiIpv6AddIndex = 0U; goto ldv_46905; ldv_46904: tmp___0 = __fswab32((unsigned int )pstIpv6Header->ulDestIpAddress[uiIpv6AddIndex]); aulDestIP[uiIpv6AddIndex] = (ULONG )tmp___0; uiIpv6AddIndex = uiIpv6AddIndex + 1U; ldv_46905: ; if (uiIpv6AddIndex < uiIpv6AddrNoLongWords) { goto ldv_46904; } else { goto ldv_46906; } ldv_46906: uiLoopIndex = 0U; goto ldv_46912; ldv_46911: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 16384U) != 0U) { printk("\017%s:\n Destination Ipv6 Address In Received Packet :\n ", "MatchDestIpv6Address"); } else { } DumpIpv6Address((ULONG *)(& aulDestIP)); if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 16384U) != 0U) { printk("\017%s:\n Destination Ipv6 Mask In Classifier Rule :\n", "MatchDestIpv6Address"); } else { } DumpIpv6Address((ULONG *)(& pstClassifierRule->stDestIpAddress.ldv_45846.ulIpv6Mask) + (unsigned long )uiLoopIndex); if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 16384U) != 0U) { printk("\017%s:\n Destination Ipv6 Address In Classifier Rule :\n", "MatchDestIpv6Address"); } else { } DumpIpv6Address((ULONG *)(& pstClassifierRule->stDestIpAddress.ldv_45846.ulIpv6Addr) + (unsigned long )uiLoopIndex); uiIpv6AddIndex = 0U; goto ldv_46910; ldv_46909: ; if ((pstClassifierRule->stDestIpAddress.ldv_45846.ulIpv6Mask[uiLoopIndex + uiIpv6AddIndex] & aulDestIP[uiIpv6AddIndex]) != pstClassifierRule->stDestIpAddress.ldv_45846.ulIpv6Addr[uiLoopIndex + uiIpv6AddIndex]) { goto ldv_46908; } else { } if (uiIpv6AddrNoLongWords - 1U == uiIpv6AddIndex) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 16384U) != 0U) { printk("\017%s:Ipv6 Destination Ip Address Matched\n", "MatchDestIpv6Address"); } else { } return (1); } else { } uiIpv6AddIndex = uiIpv6AddIndex + 1U; ldv_46910: ; if (uiIpv6AddIndex < uiIpv6AddrNoLongWords) { goto ldv_46909; } else { goto ldv_46908; } ldv_46908: uiLoopIndex = uiLoopIndex + uiIpv6AddrNoLongWords; ldv_46912: ; if (uiLoopIndex < uiCountIPDestinationAddresses) { goto ldv_46911; } else { goto ldv_46913; } ldv_46913: ; return (0); } } VOID DumpIpv6Address(ULONG *puIpv6Address ) { UINT uiIpv6AddrNoLongWords ; UINT uiIpv6AddIndex ; struct bcm_mini_adapter *Adapter ; void *tmp ; { uiIpv6AddrNoLongWords = 4U; uiIpv6AddIndex = 0U; tmp = netdev_priv((struct net_device const *)gblpnetdev); Adapter = (struct bcm_mini_adapter *)tmp; uiIpv6AddIndex = 0U; goto ldv_46922; ldv_46921: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 16384U) != 0U) { printk("\017%s::%lx", "DumpIpv6Address", *(puIpv6Address + (unsigned long )uiIpv6AddIndex)); } else { } uiIpv6AddIndex = uiIpv6AddIndex + 1U; ldv_46922: ; if (uiIpv6AddIndex < uiIpv6AddrNoLongWords) { goto ldv_46921; } else { goto ldv_46923; } ldv_46923: ; return; } } static VOID DumpIpv6Header(IPV6Header *pstIpv6Header ) { UCHAR ucVersion ; UCHAR ucPrio ; struct bcm_mini_adapter *Adapter ; void *tmp ; __u16 tmp___2 ; { tmp = netdev_priv((struct net_device const *)gblpnetdev); Adapter = (struct bcm_mini_adapter *)tmp; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 16384U) != 0U) { printk("\017%s:----Ipv6 Header---", "DumpIpv6Header"); } else { } ucVersion = (unsigned int )pstIpv6Header->ucVersionPrio & 240U; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 16384U) != 0U) { printk("\017%s:Version : %x\n", "DumpIpv6Header", (int )ucVersion); } else { } ucPrio = (unsigned int )pstIpv6Header->ucVersionPrio & 15U; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 16384U) != 0U) { printk("\017%s:Priority : %x\n", "DumpIpv6Header", (int )ucPrio); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 16384U) != 0U) { tmp___2 = __fswab16((int )pstIpv6Header->usPayloadLength); printk("\017%s:Payload Length : %x\n", "DumpIpv6Header", (int )tmp___2); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 16384U) != 0U) { printk("\017%s:Next Header : %x\n", "DumpIpv6Header", (int )pstIpv6Header->ucNextHeader); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 16384U) != 0U) { printk("\017%s:Hop Limit : %x\n", "DumpIpv6Header", (int )pstIpv6Header->ucHopLimit); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 16384U) != 0U) { printk("\017%s:Src Address :\n", "DumpIpv6Header"); } else { } DumpIpv6Address((ULONG *)(& pstIpv6Header->ulSrcIpAddress)); if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 16384U) != 0U) { printk("\017%s:Dest Address :\n", "DumpIpv6Header"); } else { } DumpIpv6Address((ULONG *)(& pstIpv6Header->ulDestIpAddress)); if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 16384U) != 0U) { printk("\017%s:----Ipv6 Header End---", "DumpIpv6Header"); } else { } return; } } void ldv_mutex_lock_117(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_118(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_119(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_device(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_120(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___2 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex_of_device(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_121(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_device(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_122(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_123(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } int ldv_mutex_trylock_134(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_132(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_135(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_137(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_131(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_133(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_136(struct mutex *ldv_func_arg1 ) ; extern void _raw_spin_lock_bh(raw_spinlock_t * ) ; extern void _raw_spin_unlock_bh(raw_spinlock_t * ) ; __inline static void spin_lock_bh(spinlock_t *lock ) { { _raw_spin_lock_bh(& lock->ldv_5961.rlock); return; } } __inline static void spin_unlock_bh(spinlock_t *lock ) { { _raw_spin_unlock_bh(& lock->ldv_5961.rlock); return; } } void DumpFullPacket(UCHAR *pBuf , UINT nPktLen ) ; VOID flush_all_queues(struct bcm_mini_adapter *Adapter ) ; VOID PruneQueueAllSF(struct bcm_mini_adapter *Adapter ) ; USHORT ClassifyPacket(struct bcm_mini_adapter *Adapter , struct sk_buff *skb ) ; struct bcm_classifier_rule *GetFragIPClsEntry(struct bcm_mini_adapter *Adapter , USHORT usIpIdentification , ULONG SrcIP ) ; void AddFragIPClsEntry(struct bcm_mini_adapter *Adapter , struct bcm_fragmented_packet_info *psFragPktInfo ) ; void DelFragIPClsEntry(struct bcm_mini_adapter *Adapter , USHORT usIpIdentification , ULONG SrcIp ) ; static void EThCSGetPktInfo(struct bcm_mini_adapter *Adapter , PVOID pvEthPayload , PS_ETHCS_PKT_INFO pstEthCsPktInfo ) ; static BOOLEAN EThCSClassifyPkt(struct bcm_mini_adapter *Adapter , struct sk_buff *skb , PS_ETHCS_PKT_INFO pstEthCsPktInfo , struct bcm_classifier_rule *pstClassifierRule , B_UINT8 EthCSCupport ) ; static USHORT IpVersion4(struct bcm_mini_adapter *Adapter , struct iphdr *iphd , struct bcm_classifier_rule *pstClassifierRule ) ; static VOID PruneQueue(struct bcm_mini_adapter *Adapter , INT iIndex ) ; BOOLEAN MatchSrcIpAddress(struct bcm_classifier_rule *pstClassifierRule , ULONG ulSrcIP ) { UCHAR ucLoopIndex ; struct bcm_mini_adapter *Adapter ; void *tmp ; __u32 tmp___0 ; { ucLoopIndex = 0U; tmp = netdev_priv((struct net_device const *)gblpnetdev); Adapter = (struct bcm_mini_adapter *)tmp; tmp___0 = __fswab32((unsigned int )ulSrcIP); ulSrcIP = (ULONG )tmp___0; if ((unsigned int )pstClassifierRule->ucIPSourceAddressLength == 0U) { return (1); } else { } ucLoopIndex = 0U; goto ldv_46835; ldv_46834: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:Src Ip Address Mask:0x%x PacketIp:0x%x and Classification:0x%x", "MatchSrcIpAddress", (unsigned int )pstClassifierRule->stSrcIpAddress.ldv_45842.ulIpv4Mask[(int )ucLoopIndex], (unsigned int )ulSrcIP, (unsigned int )pstClassifierRule->stSrcIpAddress.ldv_45846.ulIpv6Addr[(int )ucLoopIndex]); } else { } if (((pstClassifierRule->stSrcIpAddress.ldv_45842.ulIpv4Addr[(int )ucLoopIndex] ^ ulSrcIP) & pstClassifierRule->stSrcIpAddress.ldv_45842.ulIpv4Mask[(int )ucLoopIndex]) == 0UL) { return (1); } else { } ucLoopIndex = (UCHAR )((int )ucLoopIndex + 1); ldv_46835: ; if ((int )pstClassifierRule->ucIPSourceAddressLength > (int )ucLoopIndex) { goto ldv_46834; } else { goto ldv_46836; } ldv_46836: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:Src Ip Address Not Matched", "MatchSrcIpAddress"); } else { } return (0); } } BOOLEAN MatchDestIpAddress(struct bcm_classifier_rule *pstClassifierRule , ULONG ulDestIP ) { UCHAR ucLoopIndex ; struct bcm_mini_adapter *Adapter ; void *tmp ; __u32 tmp___0 ; { ucLoopIndex = 0U; tmp = netdev_priv((struct net_device const *)gblpnetdev); Adapter = (struct bcm_mini_adapter *)tmp; tmp___0 = __fswab32((unsigned int )ulDestIP); ulDestIP = (ULONG )tmp___0; if ((unsigned int )pstClassifierRule->ucIPDestinationAddressLength == 0U) { return (1); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:Destination Ip Address 0x%x 0x%x 0x%x ", "MatchDestIpAddress", (unsigned int )ulDestIP, (unsigned int )pstClassifierRule->stDestIpAddress.ldv_45842.ulIpv4Mask[(int )ucLoopIndex], (unsigned int )pstClassifierRule->stDestIpAddress.ldv_45842.ulIpv4Addr[(int )ucLoopIndex]); } else { } ucLoopIndex = 0U; goto ldv_46845; ldv_46844: ; if (((pstClassifierRule->stDestIpAddress.ldv_45842.ulIpv4Addr[(int )ucLoopIndex] ^ ulDestIP) & pstClassifierRule->stDestIpAddress.ldv_45842.ulIpv4Mask[(int )ucLoopIndex]) == 0UL) { return (1); } else { } ucLoopIndex = (UCHAR )((int )ucLoopIndex + 1); ldv_46845: ; if ((int )pstClassifierRule->ucIPDestinationAddressLength > (int )ucLoopIndex) { goto ldv_46844; } else { goto ldv_46846; } ldv_46846: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:Destination Ip Address Not Matched", "MatchDestIpAddress"); } else { } return (0); } } BOOLEAN MatchTos(struct bcm_classifier_rule *pstClassifierRule , UCHAR ucTypeOfService ) { struct bcm_mini_adapter *Adapter ; void *tmp ; { tmp = netdev_priv((struct net_device const *)gblpnetdev); Adapter = (struct bcm_mini_adapter *)tmp; if ((unsigned int )pstClassifierRule->ucIPTypeOfServiceLength != 3U) { return (1); } else { } if (((int )pstClassifierRule->ucTosMask & (int )ucTypeOfService) <= (int )pstClassifierRule->ucTosHigh && ((int )pstClassifierRule->ucTosMask & (int )ucTypeOfService) >= (int )pstClassifierRule->ucTosLow) { return (1); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:Type Of Service Not Matched", "MatchTos"); } else { } return (0); } } BOOLEAN MatchProtocol(struct bcm_classifier_rule *pstClassifierRule , UCHAR ucProtocol ) { UCHAR ucLoopIndex ; struct bcm_mini_adapter *Adapter ; void *tmp ; { ucLoopIndex = 0U; tmp = netdev_priv((struct net_device const *)gblpnetdev); Adapter = (struct bcm_mini_adapter *)tmp; if ((unsigned int )pstClassifierRule->ucProtocolLength == 0U) { return (1); } else { } ucLoopIndex = 0U; goto ldv_46861; ldv_46860: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:Protocol:0x%X Classification Protocol:0x%X", "MatchProtocol", (int )ucProtocol, (int )pstClassifierRule->ucProtocol[(int )ucLoopIndex]); } else { } if ((int )pstClassifierRule->ucProtocol[(int )ucLoopIndex] == (int )ucProtocol) { return (1); } else { } ucLoopIndex = (UCHAR )((int )ucLoopIndex + 1); ldv_46861: ; if ((int )pstClassifierRule->ucProtocolLength > (int )ucLoopIndex) { goto ldv_46860; } else { goto ldv_46862; } ldv_46862: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:Protocol Not Matched", "MatchProtocol"); } else { } return (0); } } BOOLEAN MatchSrcPort(struct bcm_classifier_rule *pstClassifierRule , USHORT ushSrcPort ) { UCHAR ucLoopIndex ; struct bcm_mini_adapter *Adapter ; void *tmp ; { ucLoopIndex = 0U; tmp = netdev_priv((struct net_device const *)gblpnetdev); Adapter = (struct bcm_mini_adapter *)tmp; if ((unsigned int )pstClassifierRule->ucSrcPortRangeLength == 0U) { return (1); } else { } ucLoopIndex = 0U; goto ldv_46870; ldv_46869: ; if ((int )pstClassifierRule->usSrcPortRangeHi[(int )ucLoopIndex] >= (int )ushSrcPort && (int )pstClassifierRule->usSrcPortRangeLo[(int )ucLoopIndex] <= (int )ushSrcPort) { return (1); } else { } ucLoopIndex = (UCHAR )((int )ucLoopIndex + 1); ldv_46870: ; if ((int )pstClassifierRule->ucSrcPortRangeLength > (int )ucLoopIndex) { goto ldv_46869; } else { goto ldv_46871; } ldv_46871: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:Src Port: %x Not Matched ", "MatchSrcPort", (int )ushSrcPort); } else { } return (0); } } BOOLEAN MatchDestPort(struct bcm_classifier_rule *pstClassifierRule , USHORT ushDestPort ) { UCHAR ucLoopIndex ; struct bcm_mini_adapter *Adapter ; void *tmp ; { ucLoopIndex = 0U; tmp = netdev_priv((struct net_device const *)gblpnetdev); Adapter = (struct bcm_mini_adapter *)tmp; if ((unsigned int )pstClassifierRule->ucDestPortRangeLength == 0U) { return (1); } else { } ucLoopIndex = 0U; goto ldv_46881; ldv_46880: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:Matching Port:0x%X 0x%X 0x%X", "MatchDestPort", (int )ushDestPort, (int )pstClassifierRule->usDestPortRangeLo[(int )ucLoopIndex], (int )pstClassifierRule->usDestPortRangeHi[(int )ucLoopIndex]); } else { } if ((int )pstClassifierRule->usDestPortRangeHi[(int )ucLoopIndex] >= (int )ushDestPort && (int )pstClassifierRule->usDestPortRangeLo[(int )ucLoopIndex] <= (int )ushDestPort) { return (1); } else { } ucLoopIndex = (UCHAR )((int )ucLoopIndex + 1); ldv_46881: ; if ((int )pstClassifierRule->ucDestPortRangeLength > (int )ucLoopIndex) { goto ldv_46880; } else { goto ldv_46882; } ldv_46882: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:Dest Port: %x Not Matched", "MatchDestPort", (int )ushDestPort); } else { } return (0); } } static USHORT IpVersion4(struct bcm_mini_adapter *Adapter , struct iphdr *iphd , struct bcm_classifier_rule *pstClassifierRule ) { xporthdr *xprt_hdr ; BOOLEAN bClassificationSucceed ; int tmp___1 ; int tmp___2 ; __u16 tmp___3 ; int tmp___6 ; int tmp___7 ; __u16 tmp___8 ; INT iMatchedSFQueueIndex ; { xprt_hdr = 0; bClassificationSucceed = 0; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:========>", "IpVersion4"); } else { } xprt_hdr = (xporthdr *)iphd + 20U; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:Trying to see Direction = %d %d", "IpVersion4", (int )pstClassifierRule->ucDirection, (int )pstClassifierRule->usVCID_Value); } else { } if ((int )((signed char )pstClassifierRule->bUsed) == 0 || (unsigned int )pstClassifierRule->ucDirection == 0U) { bClassificationSucceed = 0; goto ldv_46891; } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:is IPv6 check!", "IpVersion4"); } else { } if ((int )((signed char )pstClassifierRule->bIpv6Protocol) != 0) { goto ldv_46891; } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:Trying to match Source IP Address", "IpVersion4"); } else { } bClassificationSucceed = MatchSrcIpAddress(pstClassifierRule, (ULONG )iphd->saddr); if ((int )((signed char )bClassificationSucceed) == 0) { goto ldv_46891; } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:Source IP Address Matched", "IpVersion4"); } else { } bClassificationSucceed = MatchDestIpAddress(pstClassifierRule, (ULONG )iphd->daddr); if ((int )((signed char )bClassificationSucceed) == 0) { goto ldv_46891; } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:Destination IP Address Matched", "IpVersion4"); } else { } bClassificationSucceed = MatchTos(pstClassifierRule, (int )iphd->tos); if ((int )((signed char )bClassificationSucceed) == 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:TOS Match failed\n", "IpVersion4"); } else { } goto ldv_46891; } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:TOS Matched", "IpVersion4"); } else { } bClassificationSucceed = MatchProtocol(pstClassifierRule, (int )iphd->protocol); if ((int )((signed char )bClassificationSucceed) == 0) { goto ldv_46891; } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:Protocol Matched", "IpVersion4"); } else { } if ((unsigned int )iphd->protocol != 6U && (unsigned int )iphd->protocol != 17U) { goto ldv_46891; } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { if ((unsigned int )iphd->protocol == 17U) { tmp___1 = (int )xprt_hdr->ldv_46329.uhdr.source; } else { tmp___1 = (int )xprt_hdr->ldv_46329.thdr.source; } printk("\017%s:Source Port %04x", "IpVersion4", tmp___1); } else { } if ((unsigned int )iphd->protocol == 17U) { tmp___2 = xprt_hdr->ldv_46329.uhdr.source; } else { tmp___2 = xprt_hdr->ldv_46329.thdr.source; } tmp___3 = __fswab16(tmp___2); bClassificationSucceed = MatchSrcPort(pstClassifierRule, (int )tmp___3); if ((int )((signed char )bClassificationSucceed) == 0) { goto ldv_46891; } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:Src Port Matched", "IpVersion4"); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { if ((unsigned int )iphd->protocol == 17U) { tmp___6 = (int )xprt_hdr->ldv_46329.uhdr.dest; } else { tmp___6 = (int )xprt_hdr->ldv_46329.thdr.dest; } printk("\017%s:Destination Port %04x", "IpVersion4", tmp___6); } else { } if ((unsigned int )iphd->protocol == 17U) { tmp___7 = xprt_hdr->ldv_46329.uhdr.dest; } else { tmp___7 = xprt_hdr->ldv_46329.thdr.dest; } tmp___8 = __fswab16(tmp___7); bClassificationSucceed = MatchDestPort(pstClassifierRule, (int )tmp___8); if ((int )((signed char )bClassificationSucceed) == 0) { goto ldv_46891; } else { } ldv_46891: ; if ((int )((signed char )bClassificationSucceed) == 1) { iMatchedSFQueueIndex = 0; iMatchedSFQueueIndex = SearchSfid(Adapter, (UINT )pstClassifierRule->ulSFID); if (iMatchedSFQueueIndex > 16) { bClassificationSucceed = 0; } else if ((int )((signed char )Adapter->PackInfo[iMatchedSFQueueIndex].bActive) == 0) { bClassificationSucceed = 0; } else { } } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:IpVersion4 <==========", "IpVersion4"); } else { } return ((USHORT )bClassificationSucceed); } } VOID PruneQueueAllSF(struct bcm_mini_adapter *Adapter ) { UINT iIndex ; { iIndex = 0U; iIndex = 0U; goto ldv_46899; ldv_46898: ; if ((int )((signed char )Adapter->PackInfo[iIndex].bValid) == 0) { goto ldv_46897; } else { } PruneQueue(Adapter, (INT )iIndex); ldv_46897: iIndex = iIndex + 1U; ldv_46899: ; if (iIndex <= 15U) { goto ldv_46898; } else { goto ldv_46900; } ldv_46900: ; return; } } static VOID PruneQueue(struct bcm_mini_adapter *Adapter , INT iIndex ) { struct sk_buff *PacketToDrop ; struct net_device_stats *netstats ; int tmp___1 ; { PacketToDrop = 0; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 32768U) != 0U) { printk("\017%s:=====> Index %d", "PruneQueue", iIndex); } else { } if (iIndex == 16) { return; } else { } if (((unsigned long )Adapter == (unsigned long )((struct bcm_mini_adapter *)0) || iIndex < 0) || iIndex > 16) { return; } else { } netstats = & (Adapter->dev)->stats; spin_lock_bh(& Adapter->PackInfo[iIndex].SFQueueLock); ldv_46909: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 32768U) != 0U) { printk("\017%s:uiCurrentBytesOnHost:%x uiMaxBucketSize :%x", "PruneQueue", Adapter->PackInfo[iIndex].uiCurrentBytesOnHost, Adapter->PackInfo[iIndex].uiMaxBucketSize); } else { } PacketToDrop = Adapter->PackInfo[iIndex].ldv_45950.ldv_45945.FirstTxQueue; if ((unsigned long )PacketToDrop == (unsigned long )((struct sk_buff *)0)) { goto ldv_46908; } else { } if (Adapter->PackInfo[iIndex].uiCurrentPacketsOnHost <= 127U && (((unsigned long )jiffies - (unsigned long )*((B_UINT32 *)(& PacketToDrop->cb) + 1UL)) * 1000UL) / 250UL <= (unsigned long )Adapter->PackInfo[iIndex].uiMaxLatency) { goto ldv_46908; } else { } if ((unsigned long )PacketToDrop != (unsigned long )((struct sk_buff *)0)) { if ((Adapter->msg_enable & 128U) != 0U) { printk("\016beceem %s: tx queue %d overlimit\n", (char *)(& (Adapter->dev)->name), iIndex); } else { } netstats->tx_dropped = netstats->tx_dropped + 1UL; if ((unsigned long )Adapter->PackInfo[iIndex].ldv_45950.ldv_45945.FirstTxQueue != (unsigned long )((struct sk_buff *)0)) { if ((unsigned long )(Adapter->PackInfo[iIndex].ldv_45950.ldv_45945.FirstTxQueue)->next == (unsigned long )((struct sk_buff *)0)) { Adapter->PackInfo[iIndex].ldv_45950.ldv_45945.LastTxQueue = 0; } else { } Adapter->PackInfo[iIndex].ldv_45950.ldv_45945.FirstTxQueue = (Adapter->PackInfo[iIndex].ldv_45950.ldv_45945.FirstTxQueue)->next; } else { } Adapter->PackInfo[iIndex].uiCurrentBytesOnHost = Adapter->PackInfo[iIndex].uiCurrentBytesOnHost - PacketToDrop->len; Adapter->PackInfo[iIndex].uiCurrentPacketsOnHost = Adapter->PackInfo[iIndex].uiCurrentPacketsOnHost - 1U; Adapter->PackInfo[iIndex].uiDroppedCountBytes = Adapter->PackInfo[iIndex].uiDroppedCountBytes + PacketToDrop->len; Adapter->PackInfo[iIndex].uiDroppedCountPackets = Adapter->PackInfo[iIndex].uiDroppedCountPackets + 1U; consume_skb(PacketToDrop); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 32768U) != 0U) { printk("\017%s:Dropped Bytes:%x Dropped Packets:%x", "PruneQueue", Adapter->PackInfo[iIndex].uiDroppedCountBytes, Adapter->PackInfo[iIndex].uiDroppedCountPackets); } else { } atomic_dec(& Adapter->TotalPacketCount); goto ldv_46909; ldv_46908: spin_unlock_bh(& Adapter->PackInfo[iIndex].SFQueueLock); if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 32768U) != 0U) { tmp___1 = atomic_read((atomic_t const *)(& Adapter->TotalPacketCount)); printk("\017%s:TotalPacketCount:%x", "PruneQueue", tmp___1); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 32768U) != 0U) { printk("\017%s:<=====", "PruneQueue"); } else { } return; } } VOID flush_all_queues(struct bcm_mini_adapter *Adapter ) { INT iQIndex ; UINT uiTotalPacketLength ; struct sk_buff *PacketToDrop ; struct net_device_stats *netstats ; { PacketToDrop = 0; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:=====>", "flush_all_queues"); } else { } iQIndex = 0; goto ldv_46922; ldv_46921: netstats = & (Adapter->dev)->stats; spin_lock_bh(& Adapter->PackInfo[iQIndex].SFQueueLock); goto ldv_46919; ldv_46918: PacketToDrop = Adapter->PackInfo[iQIndex].ldv_45950.ldv_45945.FirstTxQueue; if ((unsigned long )PacketToDrop != (unsigned long )((struct sk_buff *)0)) { uiTotalPacketLength = PacketToDrop->len; netstats->tx_dropped = netstats->tx_dropped + 1UL; } else { uiTotalPacketLength = 0U; } if ((unsigned long )Adapter->PackInfo[iQIndex].ldv_45950.ldv_45945.FirstTxQueue != (unsigned long )((struct sk_buff *)0)) { if ((unsigned long )(Adapter->PackInfo[iQIndex].ldv_45950.ldv_45945.FirstTxQueue)->next == (unsigned long )((struct sk_buff *)0)) { Adapter->PackInfo[iQIndex].ldv_45950.ldv_45945.LastTxQueue = 0; } else { } Adapter->PackInfo[iQIndex].ldv_45950.ldv_45945.FirstTxQueue = (Adapter->PackInfo[iQIndex].ldv_45950.ldv_45945.FirstTxQueue)->next; } else { } consume_skb(PacketToDrop); Adapter->PackInfo[iQIndex].uiCurrentBytesOnHost = Adapter->PackInfo[iQIndex].uiCurrentBytesOnHost - uiTotalPacketLength; Adapter->PackInfo[iQIndex].uiCurrentPacketsOnHost = Adapter->PackInfo[iQIndex].uiCurrentPacketsOnHost - 1U; Adapter->PackInfo[iQIndex].uiDroppedCountBytes = Adapter->PackInfo[iQIndex].uiDroppedCountBytes + uiTotalPacketLength; Adapter->PackInfo[iQIndex].uiDroppedCountPackets = Adapter->PackInfo[iQIndex].uiDroppedCountPackets + 1U; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:Dropped Bytes:%x Dropped Packets:%x", "flush_all_queues", Adapter->PackInfo[iQIndex].uiDroppedCountBytes, Adapter->PackInfo[iQIndex].uiDroppedCountPackets); } else { } atomic_dec(& Adapter->TotalPacketCount); ldv_46919: ; if ((unsigned long )Adapter->PackInfo[iQIndex].ldv_45950.ldv_45945.FirstTxQueue != (unsigned long )((struct sk_buff *)0)) { goto ldv_46918; } else { goto ldv_46920; } ldv_46920: spin_unlock_bh(& Adapter->PackInfo[iQIndex].SFQueueLock); iQIndex = iQIndex + 1; ldv_46922: ; if (iQIndex <= 15) { goto ldv_46921; } else { goto ldv_46923; } ldv_46923: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:<=====", "flush_all_queues"); } else { } return; } } USHORT ClassifyPacket(struct bcm_mini_adapter *Adapter , struct sk_buff *skb ) { INT uiLoopIndex ; struct bcm_classifier_rule *pstClassifierRule ; S_ETHCS_PKT_INFO stEthCsPktInfo ; PVOID pvEThPayload ; struct iphdr *pIpHeader ; INT uiSfIndex ; USHORT usIndex ; BOOLEAN bFragmentedPkt ; BOOLEAN bClassificationSucceed ; USHORT usCurrFragment ; PTCP_HEADER pTcpHeader ; UCHAR IpHeaderLength ; UCHAR TcpHeaderLength ; __u16 tmp ; __u16 tmp___0 ; __u16 tmp___1 ; USHORT tmp___2 ; USHORT tmp___3 ; __u16 tmp___4 ; INT tmp___5 ; struct bcm_fragmented_packet_info stFragPktInfo ; { uiLoopIndex = 0; pstClassifierRule = 0; pvEThPayload = 0; pIpHeader = 0; uiSfIndex = 0; usIndex = Adapter->usBestEffortQueueIndex; bFragmentedPkt = 0; bClassificationSucceed = 0; usCurrFragment = 0U; pvEThPayload = (PVOID )skb->data; *((UINT32 *)(& skb->cb) + 2UL) = 0U; EThCSGetPktInfo(Adapter, pvEThPayload, & stEthCsPktInfo); switch ((unsigned int )stEthCsPktInfo.eNwpktEthFrameType) { case 1: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:ClassifyPacket : 802LLCFrame\n", "ClassifyPacket"); } else { } pIpHeader = (struct iphdr *)pvEThPayload + 17U; goto ldv_46943; case 2: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:ClassifyPacket : 802LLC SNAP Frame\n", "ClassifyPacket"); } else { } pIpHeader = (struct iphdr *)pvEThPayload + 22U; goto ldv_46943; case 3: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:ClassifyPacket : 802.1Q VLANFrame\n", "ClassifyPacket"); } else { } pIpHeader = (struct iphdr *)pvEThPayload + 18U; goto ldv_46943; case 4: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:ClassifyPacket : ETH Other Frame\n", "ClassifyPacket"); } else { } pIpHeader = (struct iphdr *)pvEThPayload + 14U; goto ldv_46943; default: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:ClassifyPacket : Unrecognized ETH Frame\n", "ClassifyPacket"); } else { } pIpHeader = (struct iphdr *)pvEThPayload + 14U; goto ldv_46943; } ldv_46943: ; if ((unsigned int )stEthCsPktInfo.eNwpktIPFrameType == 1U) { tmp = __fswab16((int )pIpHeader->frag_off); usCurrFragment = (unsigned int )tmp & 8191U; tmp___0 = __fswab16((int )pIpHeader->frag_off); if (((int )tmp___0 & 8192) != 0 || (unsigned int )usCurrFragment != 0U) { bFragmentedPkt = 1; } else { } if ((int )((signed char )bFragmentedPkt) != 0) { pstClassifierRule = GetFragIPClsEntry(Adapter, (int )pIpHeader->id, (ULONG )pIpHeader->saddr); if ((unsigned long )pstClassifierRule != (unsigned long )((struct bcm_classifier_rule *)0)) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:It is next Fragmented pkt", "ClassifyPacket"); } else { } bClassificationSucceed = 1; } else { } tmp___1 = __fswab16((int )pIpHeader->frag_off); if (((int )tmp___1 & 8192) == 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:This is the last fragmented Pkt", "ClassifyPacket"); } else { } DelFragIPClsEntry(Adapter, (int )pIpHeader->id, (ULONG )pIpHeader->saddr); } else { } } else { } } else { } uiLoopIndex = 99; goto ldv_46951; ldv_46950: ; if ((int )((signed char )bClassificationSucceed) != 0) { goto ldv_46948; } else { } if ((int )((signed char )Adapter->astClassifierTable[uiLoopIndex].bUsed) == 0) { bClassificationSucceed = 0; goto ldv_46949; } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:Adapter->PackInfo[%d].bvalid=True\n", "ClassifyPacket", uiLoopIndex); } else { } if ((unsigned int )Adapter->astClassifierTable[uiLoopIndex].ucDirection == 0U) { bClassificationSucceed = 0; goto ldv_46949; } else { } pstClassifierRule = (struct bcm_classifier_rule *)(& Adapter->astClassifierTable) + (unsigned long )uiLoopIndex; uiSfIndex = SearchSfid(Adapter, (UINT )pstClassifierRule->ulSFID); if (uiSfIndex > 16) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:Queue Not Valid. SearchSfid for this classifier Failed\n", "ClassifyPacket"); } else { } goto ldv_46949; } else { } if ((unsigned int )Adapter->PackInfo[uiSfIndex].bEthCSSupport != 0U) { if ((unsigned int )stEthCsPktInfo.eNwpktEthFrameType == 0U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s: ClassifyPacket : Packet Not a Valid Supported Ethernet Frame \n", "ClassifyPacket"); } else { } bClassificationSucceed = 0; goto ldv_46949; } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:Performing ETH CS Classification on Classifier Rule ID : %x Service Flow ID : %lx\n", "ClassifyPacket", (int )pstClassifierRule->uiClassifierRuleIndex, Adapter->PackInfo[uiSfIndex].ulSFID); } else { } bClassificationSucceed = EThCSClassifyPkt(Adapter, skb, & stEthCsPktInfo, pstClassifierRule, (int )Adapter->PackInfo[uiSfIndex].bEthCSSupport); if ((int )((signed char )bClassificationSucceed) == 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:ClassifyPacket : Ethernet CS Classification Failed\n", "ClassifyPacket"); } else { } goto ldv_46949; } else { } } else if ((unsigned int )stEthCsPktInfo.eNwpktEthFrameType != 4U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s: ClassifyPacket : Packet Not a 802.3 Ethernet Frame... hence not allowed over non-ETH CS SF \n", "ClassifyPacket"); } else { } bClassificationSucceed = 0; goto ldv_46949; } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:Proceeding to IP CS Clasification", "ClassifyPacket"); } else { } if ((unsigned int )Adapter->PackInfo[uiSfIndex].bIPCSSupport != 0U) { if ((unsigned int )stEthCsPktInfo.eNwpktIPFrameType == 0U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s: ClassifyPacket : Packet is Not an IP Packet \n", "ClassifyPacket"); } else { } bClassificationSucceed = 0; goto ldv_46949; } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:Dump IP Header : \n", "ClassifyPacket"); } else { } DumpFullPacket((UCHAR *)pIpHeader, 20U); if ((unsigned int )stEthCsPktInfo.eNwpktIPFrameType == 1U) { tmp___2 = IpVersion4(Adapter, pIpHeader, pstClassifierRule); bClassificationSucceed = (BOOLEAN )tmp___2; } else if ((unsigned int )stEthCsPktInfo.eNwpktIPFrameType == 2U) { tmp___3 = IpVersion6(Adapter, (PVOID )pIpHeader, pstClassifierRule); bClassificationSucceed = (BOOLEAN )tmp___3; } else { } } else { } ldv_46949: uiLoopIndex = uiLoopIndex - 1; ldv_46951: ; if (uiLoopIndex >= 0) { goto ldv_46950; } else { goto ldv_46948; } ldv_46948: ; if ((int )((signed char )bClassificationSucceed) == 1) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:CF id : %d, SF ID is =%lu", "ClassifyPacket", (int )pstClassifierRule->uiClassifierRuleIndex, pstClassifierRule->ulSFID); } else { } *((UINT32 *)(& skb->cb)) = (UINT32 )pstClassifierRule->uiClassifierRuleIndex; if (((unsigned int )pIpHeader->protocol == 6U && (int )((signed char )bFragmentedPkt) == 0) && skb->len > 65U) { IpHeaderLength = pIpHeader->ihl; pTcpHeader = (struct _TCP_HEADER *)pIpHeader + (unsigned long )((int )IpHeaderLength * 4); TcpHeaderLength = (int )pTcpHeader->HeaderLength >> 4; if (((int )pTcpHeader->ucFlags & 16) != 0) { tmp___4 = __fswab16((int )pIpHeader->tot_len); if ((int )tmp___4 == ((int )IpHeaderLength + (int )TcpHeaderLength) * 4) { *((UINT32 *)(& skb->cb) + 2UL) = 16U; } else { } } else { } } else { } tmp___5 = SearchSfid(Adapter, (UINT )pstClassifierRule->ulSFID); usIndex = (USHORT )tmp___5; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:index is\t=%d", "ClassifyPacket", (int )usIndex); } else { } if ((int )((signed char )bFragmentedPkt) != 0 && (unsigned int )usCurrFragment == 0U) { stFragPktInfo.bUsed = 1; stFragPktInfo.ulSrcIpAddress = (ULONG )pIpHeader->saddr; stFragPktInfo.usIpIdentification = pIpHeader->id; stFragPktInfo.pstMatchedClassifierEntry = pstClassifierRule; stFragPktInfo.bOutOfOrderFragment = 0; AddFragIPClsEntry(Adapter, & stFragPktInfo); } else { } } else { } if ((int )((signed char )bClassificationSucceed) != 0) { return (usIndex); } else { return (17U); } } } static BOOLEAN EthCSMatchSrcMACAddress(struct bcm_classifier_rule *pstClassifierRule , PUCHAR Mac ) { UINT i ; struct bcm_mini_adapter *Adapter ; void *tmp ; { i = 0U; tmp = netdev_priv((struct net_device const *)gblpnetdev); Adapter = (struct bcm_mini_adapter *)tmp; if ((unsigned int )pstClassifierRule->ucEthCSSrcMACLen == 0U) { return (1); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:%s \n", "EthCSMatchSrcMACAddress", "EthCSMatchSrcMACAddress"); } else { } i = 0U; goto ldv_46961; ldv_46960: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:SRC MAC[%x] = %x ClassifierRuleSrcMAC = %x Mask : %x\n", "EthCSMatchSrcMACAddress", i, (int )*(Mac + (unsigned long )i), (int )pstClassifierRule->au8EThCSSrcMAC[i], (int )pstClassifierRule->au8EThCSSrcMACMask[i]); } else { } if ((unsigned int )(((int )pstClassifierRule->au8EThCSSrcMAC[i] ^ (int )*(Mac + (unsigned long )i)) & (int )pstClassifierRule->au8EThCSSrcMACMask[i]) != 0U) { return (0); } else { } i = i + 1U; ldv_46961: ; if (i <= 5U) { goto ldv_46960; } else { goto ldv_46962; } ldv_46962: ; return (1); } } static BOOLEAN EthCSMatchDestMACAddress(struct bcm_classifier_rule *pstClassifierRule , PUCHAR Mac ) { UINT i ; struct bcm_mini_adapter *Adapter ; void *tmp ; { i = 0U; tmp = netdev_priv((struct net_device const *)gblpnetdev); Adapter = (struct bcm_mini_adapter *)tmp; if ((unsigned int )pstClassifierRule->ucEthCSDestMACLen == 0U) { return (1); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:%s \n", "EthCSMatchDestMACAddress", "EthCSMatchDestMACAddress"); } else { } i = 0U; goto ldv_46971; ldv_46970: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:SRC MAC[%x] = %x ClassifierRuleSrcMAC = %x Mask : %x\n", "EthCSMatchDestMACAddress", i, (int )*(Mac + (unsigned long )i), (int )pstClassifierRule->au8EThCSDestMAC[i], (int )pstClassifierRule->au8EThCSDestMACMask[i]); } else { } if ((unsigned int )(((int )pstClassifierRule->au8EThCSDestMAC[i] ^ (int )*(Mac + (unsigned long )i)) & (int )pstClassifierRule->au8EThCSDestMACMask[i]) != 0U) { return (0); } else { } i = i + 1U; ldv_46971: ; if (i <= 5U) { goto ldv_46970; } else { goto ldv_46972; } ldv_46972: ; return (1); } } static BOOLEAN EthCSMatchEThTypeSAP(struct bcm_classifier_rule *pstClassifierRule , struct sk_buff *skb , PS_ETHCS_PKT_INFO pstEthCsPktInfo ) { struct bcm_mini_adapter *Adapter ; void *tmp ; int tmp___0 ; { tmp = netdev_priv((struct net_device const *)gblpnetdev); Adapter = (struct bcm_mini_adapter *)tmp; if ((unsigned int )pstClassifierRule->ucEtherTypeLen == 0U || (unsigned int )pstClassifierRule->au8EthCSEtherType[0] == 0U) { return (1); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:%s SrcEtherType:%x CLS EtherType[0]:%x\n", "EthCSMatchEThTypeSAP", "EthCSMatchEThTypeSAP", (int )pstEthCsPktInfo->usEtherType, (int )pstClassifierRule->au8EthCSEtherType[0]); } else { } if ((unsigned int )pstClassifierRule->au8EthCSEtherType[0] == 1U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:%s CLS EtherType[1]:%x EtherType[2]:%x\n", "EthCSMatchEThTypeSAP", "EthCSMatchEThTypeSAP", (int )pstClassifierRule->au8EthCSEtherType[1], (int )pstClassifierRule->au8EthCSEtherType[2]); } else { } tmp___0 = memcmp((void const *)(& pstEthCsPktInfo->usEtherType), (void const *)(& pstClassifierRule->au8EthCSEtherType) + 1U, 2UL); if (tmp___0 == 0) { return (1); } else { return (0); } } else { } if ((unsigned int )pstClassifierRule->au8EthCSEtherType[0] == 2U) { if ((unsigned int )pstEthCsPktInfo->eNwpktEthFrameType != 1U) { return (0); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:%s EthCS DSAP:%x EtherType[2]:%x\n", "EthCSMatchEThTypeSAP", "EthCSMatchEThTypeSAP", (int )pstEthCsPktInfo->ucDSAP, (int )pstClassifierRule->au8EthCSEtherType[2]); } else { } if ((int )pstEthCsPktInfo->ucDSAP == (int )pstClassifierRule->au8EthCSEtherType[2]) { return (1); } else { return (0); } } else { } return (0); } } static BOOLEAN EthCSMatchVLANRules(struct bcm_classifier_rule *pstClassifierRule , struct sk_buff *skb , PS_ETHCS_PKT_INFO pstEthCsPktInfo ) { BOOLEAN bClassificationSucceed ; USHORT usVLANID ; B_UINT8 uPriority ; struct bcm_mini_adapter *Adapter ; void *tmp ; __u16 tmp___2 ; __u16 tmp___3 ; __u16 tmp___4 ; { bClassificationSucceed = 0; uPriority = 0U; tmp = netdev_priv((struct net_device const *)gblpnetdev); Adapter = (struct bcm_mini_adapter *)tmp; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { tmp___2 = __fswab16((int )*((USHORT *)(& pstClassifierRule->usUserPriority))); printk("\017%s:%s CLS UserPrio:%x CLS VLANID:%x\n", "EthCSMatchVLANRules", "EthCSMatchVLANRules", (int )tmp___2, (int )pstClassifierRule->usVLANID); } else { } if ((int )pstClassifierRule->usValidityBitMap & 1) { if ((unsigned int )pstEthCsPktInfo->eNwpktEthFrameType != 3U) { return (0); } else { } tmp___3 = __fswab16((int )*((USHORT *)skb->data + 14U)); uPriority = (B_UINT8 )((int )tmp___3 >> 13); if ((int )pstClassifierRule->usUserPriority[0] <= (int )uPriority && (int )pstClassifierRule->usUserPriority[1] >= (int )uPriority) { bClassificationSucceed = 1; } else { } if ((int )((signed char )bClassificationSucceed) == 0) { return (0); } else { } } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:ETH CS 802.1 D User Priority Rule Matched\n", "EthCSMatchVLANRules"); } else { } bClassificationSucceed = 0; if (((int )pstClassifierRule->usValidityBitMap & 2) != 0) { if ((unsigned int )pstEthCsPktInfo->eNwpktEthFrameType != 3U) { return (0); } else { } tmp___4 = __fswab16((int )*((USHORT *)skb->data + 14U)); usVLANID = (unsigned int )tmp___4 & 4095U; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:%s Pkt VLANID %x Priority: %d\n", "EthCSMatchVLANRules", "EthCSMatchVLANRules", (int )usVLANID, (int )uPriority); } else { } if ((int )pstClassifierRule->usVLANID >> 4 == (int )usVLANID) { bClassificationSucceed = 1; } else { } if ((int )((signed char )bClassificationSucceed) == 0) { return (0); } else { } } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:ETH CS 802.1 Q VLAN ID Rule Matched\n", "EthCSMatchVLANRules"); } else { } return (1); } } static BOOLEAN EThCSClassifyPkt(struct bcm_mini_adapter *Adapter , struct sk_buff *skb , PS_ETHCS_PKT_INFO pstEthCsPktInfo , struct bcm_classifier_rule *pstClassifierRule , B_UINT8 EthCSCupport ) { BOOLEAN bClassificationSucceed ; { bClassificationSucceed = 0; bClassificationSucceed = EthCSMatchSrcMACAddress(pstClassifierRule, (PUCHAR )(& ((struct bcm_eth_header *)skb->data)->au8SourceAddress)); if ((int )((signed char )bClassificationSucceed) == 0) { return (0); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:ETH CS SrcMAC Matched\n", "EThCSClassifyPkt"); } else { } bClassificationSucceed = EthCSMatchDestMACAddress(pstClassifierRule, (PUCHAR )(& ((struct bcm_eth_header *)skb->data)->au8DestinationAddress)); if ((int )((signed char )bClassificationSucceed) == 0) { return (0); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:ETH CS DestMAC Matched\n", "EThCSClassifyPkt"); } else { } bClassificationSucceed = EthCSMatchEThTypeSAP(pstClassifierRule, skb, pstEthCsPktInfo); if ((int )((signed char )bClassificationSucceed) == 0) { return (0); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:ETH CS EthType/802.2SAP Matched\n", "EThCSClassifyPkt"); } else { } bClassificationSucceed = EthCSMatchVLANRules(pstClassifierRule, skb, pstEthCsPktInfo); if ((int )((signed char )bClassificationSucceed) == 0) { return (0); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:ETH CS 802.1 VLAN Rules Matched\n", "EThCSClassifyPkt"); } else { } return (bClassificationSucceed); } } static void EThCSGetPktInfo(struct bcm_mini_adapter *Adapter , PVOID pvEthPayload , PS_ETHCS_PKT_INFO pstEthCsPktInfo ) { USHORT u16Etype ; __u16 tmp ; __u16 tmp___0 ; { tmp = __fswab16((int )((struct bcm_eth_header *)pvEthPayload)->u16Etype); u16Etype = tmp; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:EthCSGetPktInfo : Eth Hdr Type : %X\n", "EThCSGetPktInfo", (int )u16Etype); } else { } if ((unsigned int )u16Etype > 1500U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:EthCSGetPktInfo : ETH2 Frame \n", "EThCSGetPktInfo"); } else { } if ((unsigned int )u16Etype == 129U) { pstEthCsPktInfo->eNwpktEthFrameType = 3; u16Etype = ((ETH_CS_802_Q_FRAME *)pvEthPayload)->EthType; } else { pstEthCsPktInfo->eNwpktEthFrameType = 4; tmp___0 = __fswab16((int )u16Etype); u16Etype = tmp___0; } } else { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:802.2 LLC Frame \n", "EThCSGetPktInfo"); } else { } pstEthCsPktInfo->eNwpktEthFrameType = 1; pstEthCsPktInfo->ucDSAP = ((ETH_CS_802_LLC_FRAME *)pvEthPayload)->DSAP; if ((unsigned int )pstEthCsPktInfo->ucDSAP == 170U && (unsigned int )((ETH_CS_802_LLC_FRAME *)pvEthPayload)->SSAP == 170U) { pstEthCsPktInfo->eNwpktEthFrameType = 2; u16Etype = ((ETH_CS_802_LLC_SNAP_FRAME *)pvEthPayload)->usEtherType; } else { } } if ((unsigned int )u16Etype == 8U) { pstEthCsPktInfo->eNwpktIPFrameType = 1; } else if ((unsigned int )u16Etype == 56710U) { pstEthCsPktInfo->eNwpktIPFrameType = 2; } else { pstEthCsPktInfo->eNwpktIPFrameType = 0; } pstEthCsPktInfo->usEtherType = ((struct bcm_eth_header *)pvEthPayload)->u16Etype; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:EthCsPktInfo->eNwpktIPFrameType : %x\n", "EThCSGetPktInfo", (unsigned int )pstEthCsPktInfo->eNwpktIPFrameType); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:EthCsPktInfo->eNwpktEthFrameType : %x\n", "EThCSGetPktInfo", (unsigned int )pstEthCsPktInfo->eNwpktEthFrameType); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:EthCsPktInfo->usEtherType : %x\n", "EThCSGetPktInfo", (int )pstEthCsPktInfo->usEtherType); } else { } return; } } void ldv_mutex_lock_131(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_132(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_133(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_device(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_134(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___2 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex_of_device(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_135(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_device(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_136(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_137(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } __inline static int variable_test_bit(int nr , unsigned long const volatile *addr ) { int oldbit ; { __asm__ volatile ("bt %2,%1\n\tsbb %0,%0": "=r" (oldbit): "m" (*((unsigned long *)addr)), "Ir" (nr)); return (oldbit); } } extern void print_hex_dump(char const * , char const * , int , int , int , void const * , size_t , bool ) ; int ldv_mutex_trylock_148(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_146(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_149(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_151(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_145(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_147(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_150(struct mutex *ldv_func_arg1 ) ; __inline static int test_ti_thread_flag(struct thread_info *ti , int flag ) { int tmp ; { tmp = variable_test_bit(flag, (unsigned long const volatile *)(& ti->flags)); return (tmp); } } extern void schedule(void) ; __inline static int test_tsk_thread_flag(struct task_struct *tsk , int flag ) { int tmp ; { tmp = test_ti_thread_flag((struct thread_info *)tsk->stack, flag); return (tmp); } } __inline static int signal_pending(struct task_struct *p ) { int tmp ; long tmp___0 ; { tmp = test_tsk_thread_flag(p, 2); tmp___0 = ldv__builtin_expect(tmp != 0, 0L); return ((int )tmp___0); } } extern int pskb_expand_head(struct sk_buff * , int , int , gfp_t ) ; __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_cloned(struct sk_buff const *skb ) { unsigned char *tmp ; int tmp___0 ; int tmp___1 ; { if ((unsigned int )*((unsigned char *)skb + 124UL) != 0U) { tmp = skb_end_pointer(skb); tmp___0 = atomic_read((atomic_t const *)(& ((struct skb_shared_info *)tmp)->dataref)); if ((tmp___0 & 65535) != 1) { tmp___1 = 1; } else { tmp___1 = 0; } } else { tmp___1 = 0; } return (tmp___1); } } __inline static unsigned int skb_headroom(struct sk_buff const *skb ) { { return ((unsigned int )((long )skb->data) - (unsigned int )((long )skb->head)); } } __inline static int __skb_cow(struct sk_buff *skb , unsigned int headroom , int cloned ) { int delta ; unsigned int tmp ; unsigned int tmp___0 ; int _max1 ; int _max2 ; int tmp___1 ; int _max1___0 ; int _max2___0 ; int tmp___2 ; int tmp___3 ; { delta = 0; tmp___0 = skb_headroom((struct sk_buff const *)skb); if (tmp___0 < headroom) { tmp = skb_headroom((struct sk_buff const *)skb); delta = (int )(headroom - tmp); } else { } if (delta != 0 || cloned != 0) { _max1 = 32; _max2 = 64; if (_max1 > _max2) { tmp___1 = _max1; } else { tmp___1 = _max2; } _max1___0 = 32; _max2___0 = 64; if (_max1___0 > _max2___0) { tmp___2 = _max1___0; } else { tmp___2 = _max2___0; } tmp___3 = pskb_expand_head(skb, ((tmp___1 + -1) + delta) & - tmp___2, 0, 32U); return (tmp___3); } else { } return (0); } } __inline static int skb_cow(struct sk_buff *skb , unsigned int headroom ) { int tmp ; int tmp___0 ; { tmp = skb_cloned((struct sk_buff const *)skb); tmp___0 = __skb_cow(skb, headroom, tmp); return (tmp___0); } } __inline static u16 skb_get_queue_mapping(struct sk_buff const *skb ) { { return ((u16 )skb->queue_mapping); } } extern bool kthread_should_stop(void) ; int download_ddr_settings(struct bcm_mini_adapter *Adapter ) ; int PHSTransmit(struct bcm_mini_adapter *Adapter , struct sk_buff **pPacket , USHORT Vcid , B_UINT16 uiClassifierRuleID , BOOLEAN bHeaderSuppressionEnabled , unsigned int *PacketLen , UCHAR bEthCSSupport ) ; INT SetupNextSend(struct bcm_mini_adapter *Adapter , struct sk_buff *Packet , USHORT Vcid ) ; VOID LinkMessage(struct bcm_mini_adapter *Adapter ) ; VOID transmit_packets(struct bcm_mini_adapter *Adapter ) ; INT SendControlPacket(struct bcm_mini_adapter *Adapter , char *pControlPacket ) ; int tx_pkt_handler(struct bcm_mini_adapter *Adapter ) ; void update_per_sf_desc_cnts(struct bcm_mini_adapter *Adapter ) ; INT SendControlPacket(struct bcm_mini_adapter *Adapter , char *pControlPacket ) { struct bcm_leader *PLeader ; int tmp ; { PLeader = (struct bcm_leader *)pControlPacket; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8U) != 0U) { printk("\017%s:Tx", "SendControlPacket"); } else { } if ((unsigned long )pControlPacket == (unsigned long )((char *)0) || (unsigned long )Adapter == (unsigned long )((struct bcm_mini_adapter *)0)) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8U) != 0U) { printk("\017%s:Got NULL Control Packet or Adapter", "SendControlPacket"); } else { } return (-1); } else { } tmp = atomic_read((atomic_t const *)(& Adapter->CurrNumFreeTxDesc)); if (tmp < ((int )PLeader->PLength + -1) / 2040 + 1) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8U) != 0U) { printk("\017%s:NO FREE DESCRIPTORS TO SEND CONTROL PACKET", "SendControlPacket"); } else { } return (-1); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8U) != 0U) { printk("\017%s:Leader Status: %x", "SendControlPacket", (int )PLeader->Status); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8U) != 0U) { printk("\017%s:Leader VCID: %x", "SendControlPacket", (int )PLeader->Vcid); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8U) != 0U) { printk("\017%s:Leader Length: %x", "SendControlPacket", (int )PLeader->PLength); } else { } if ((int )((signed char )Adapter->device_removed) != 0) { return (0); } else { } if ((Adapter->msg_enable & 4096U) != 0U) { print_hex_dump("\017", "beceem tx control: ", 0, 16, 1, (void const *)pControlPacket, (unsigned long )PLeader->PLength + 8UL, 0); } else { } (*(Adapter->interface_transmit))(Adapter->pvInterfaceAdapter, (PVOID )pControlPacket, (UINT )PLeader->PLength + 8U); atomic_dec(& Adapter->CurrNumFreeTxDesc); if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8U) != 0U) { printk("\017%s:<=========", "SendControlPacket"); } else { } return (0); } } INT SetupNextSend(struct bcm_mini_adapter *Adapter , struct sk_buff *Packet , USHORT Vcid ) { int status ; BOOLEAN bHeaderSupressionEnabled ; B_UINT16 uiClassifierRuleID ; u16 QueueIndex ; u16 tmp ; struct bcm_leader Leader ; unsigned int tmp___0 ; size_t __len ; void *__ret ; size_t __len___0 ; void *__ret___0 ; unsigned char *tmp___1 ; unsigned char *tmp___2 ; struct net_device_stats *netstats ; { status = 0; bHeaderSupressionEnabled = 0; tmp = skb_get_queue_mapping((struct sk_buff const *)Packet); QueueIndex = tmp; Leader.Vcid = 0U; Leader.PLength = (unsigned short)0; Leader.Status = (unsigned char)0; Leader.Unused[0] = (unsigned char)0; Leader.Unused[1] = (unsigned char)0; Leader.Unused[2] = (unsigned char)0; if (Packet->len > 2040U) { status = -1; goto errExit; } else { } uiClassifierRuleID = (B_UINT16 )*((UINT32 *)(& Packet->cb)); bHeaderSupressionEnabled = (int )Adapter->PackInfo[(int )QueueIndex].bHeaderSuppressionEnabled & (int )((BOOLEAN )Adapter->bPHSEnabled); if ((int )((signed char )Adapter->device_removed) != 0) { status = -1; goto errExit; } else { } status = PHSTransmit(Adapter, & Packet, (int )Vcid, (int )uiClassifierRuleID, (int )bHeaderSupressionEnabled, & Packet->len, (int )Adapter->PackInfo[(int )QueueIndex].bEthCSSupport); if (status != 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 2U) != 0U) { printk("\017%s:PHS Transmit failed..\n", "SetupNextSend"); } else { } goto errExit; } else { } Leader.Vcid = Vcid; if (*((UINT32 *)(& Packet->cb) + 2UL) == 16U) { Leader.Status = 1U; } else { Leader.Status = 0U; } if ((unsigned int )Adapter->PackInfo[(int )QueueIndex].bEthCSSupport != 0U) { Leader.PLength = (USHORT )Packet->len; tmp___0 = skb_headroom((struct sk_buff const *)Packet); if (tmp___0 <= 7U) { status = skb_cow(Packet, 8U); if (status != 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 2U) != 0U) { printk("\017%s:bcm_transmit : Failed To Increase headRoom\n", "SetupNextSend"); } else { } goto errExit; } else { } } else { } skb_push(Packet, 8U); __len = 8UL; if (__len > 63UL) { __ret = memcpy((void *)Packet->data, (void const *)(& Leader), __len); } else { __ret = memcpy((void *)Packet->data, (void const *)(& Leader), __len); } } else { Leader.PLength = (unsigned int )((USHORT )Packet->len) - 14U; __len___0 = 8UL; if (__len___0 > 63UL) { tmp___1 = skb_pull(Packet, 6U); __ret___0 = memcpy((void *)tmp___1, (void const *)(& Leader), __len___0); } else { tmp___2 = skb_pull(Packet, 6U); __ret___0 = memcpy((void *)tmp___2, (void const *)(& Leader), __len___0); } } status = (*(Adapter->interface_transmit))(Adapter->pvInterfaceAdapter, (PVOID )Packet->data, (UINT )Leader.PLength + 8U); if (status != 0) { (Adapter->dev)->stats.tx_errors = (Adapter->dev)->stats.tx_errors + 1UL; if ((Adapter->msg_enable & 128U) != 0U) { printk("\016beceem %s: transmit error %d\n", (char *)(& (Adapter->dev)->name), status); } else { } } else { netstats = & (Adapter->dev)->stats; Adapter->PackInfo[(int )QueueIndex].uiTotalTxBytes = Adapter->PackInfo[(int )QueueIndex].uiTotalTxBytes + (UINT )Leader.PLength; netstats->tx_bytes = netstats->tx_bytes + (unsigned long )Leader.PLength; netstats->tx_packets = netstats->tx_packets + 1UL; Adapter->PackInfo[(int )QueueIndex].uiCurrentTokenCount = Adapter->PackInfo[(int )QueueIndex].uiCurrentTokenCount - (UINT )((int )Leader.PLength << 3); Adapter->PackInfo[(int )QueueIndex].uiSentBytes = Adapter->PackInfo[(int )QueueIndex].uiSentBytes + Packet->len; Adapter->PackInfo[(int )QueueIndex].uiSentPackets = Adapter->PackInfo[(int )QueueIndex].uiSentPackets + 1U; Adapter->PackInfo[(int )QueueIndex].NumOfPacketsSent = Adapter->PackInfo[(int )QueueIndex].NumOfPacketsSent + 1U; atomic_dec(& Adapter->PackInfo[(int )QueueIndex].uiPerSFTxResourceCount); Adapter->PackInfo[(int )QueueIndex].uiThisPeriodSentBytes = Adapter->PackInfo[(int )QueueIndex].uiThisPeriodSentBytes + (UINT )Leader.PLength; } atomic_dec(& Adapter->CurrNumFreeTxDesc); errExit: consume_skb(Packet); return (status); } } static int tx_pending(struct bcm_mini_adapter *Adapter ) { int tmp ; int tmp___0 ; int tmp___1 ; { tmp = atomic_read((atomic_t const *)(& Adapter->TxPktAvail)); if (tmp != 0) { tmp___0 = atomic_read((atomic_t const *)(& Adapter->CurrNumFreeTxDesc)); if (tmp___0 > 5) { tmp___1 = 1; } else { goto _L; } } else _L: /* CIL Label */ if ((int )((signed char )Adapter->device_removed) != 0) { tmp___1 = 1; } else if (Adapter->downloadDDR == 1) { tmp___1 = 1; } else { tmp___1 = 0; } return (tmp___1); } } int tx_pkt_handler(struct bcm_mini_adapter *Adapter ) { int status ; long __ret ; unsigned long tmp ; wait_queue_t __wait ; struct task_struct *tmp___0 ; int tmp___1 ; int tmp___2 ; int __ret___0 ; wait_queue_t __wait___0 ; struct task_struct *tmp___3 ; int tmp___4 ; struct task_struct *tmp___5 ; int tmp___6 ; int tmp___7 ; int tmp___8 ; int tmp___9 ; int tmp___10 ; bool tmp___11 ; int tmp___12 ; { status = 0; goto ldv_46854; ldv_46856: ; if ((int )((signed char )Adapter->LinkUpStatus) != 0) { tmp = msecs_to_jiffies(10U); __ret = (long )tmp; tmp___2 = tx_pending(Adapter); if (tmp___2 == 0) { tmp___0 = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp___0; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; ldv_46845: prepare_to_wait(& Adapter->tx_packet_wait_queue, & __wait, 2); tmp___1 = tx_pending(Adapter); if (tmp___1 != 0) { goto ldv_46844; } else { } __ret = schedule_timeout(__ret); if (__ret == 0L) { goto ldv_46844; } else { } goto ldv_46845; ldv_46844: finish_wait(& Adapter->tx_packet_wait_queue, & __wait); } else { } } else { __ret___0 = 0; tmp___7 = tx_pending(Adapter); if (tmp___7 == 0) { tmp___3 = get_current(); __wait___0.flags = 0U; __wait___0.private = (void *)tmp___3; __wait___0.func = & autoremove_wake_function; __wait___0.task_list.next = & __wait___0.task_list; __wait___0.task_list.prev = & __wait___0.task_list; ldv_46851: prepare_to_wait(& Adapter->tx_packet_wait_queue, & __wait___0, 1); tmp___4 = tx_pending(Adapter); if (tmp___4 != 0) { goto ldv_46849; } else { } tmp___5 = get_current(); tmp___6 = signal_pending(tmp___5); if (tmp___6 == 0) { schedule(); goto ldv_46850; } else { } __ret___0 = -512; goto ldv_46849; ldv_46850: ; goto ldv_46851; ldv_46849: finish_wait(& Adapter->tx_packet_wait_queue, & __wait___0); } else { } } if ((int )((signed char )Adapter->device_removed) != 0) { goto ldv_46853; } else { } if (Adapter->downloadDDR == 1) { Adapter->downloadDDR = Adapter->downloadDDR + 1; status = download_ddr_settings(Adapter); if (status != 0) { printk("\vbeceem DDR DOWNLOAD FAILED! %d\n", status); } else { } goto ldv_46854; } else { } if ((int )((signed char )Adapter->bEndPointHalted) == 1) { Bcm_clear_halt_of_endpoints(Adapter); Adapter->bEndPointHalted = 0; StartInterruptUrb((struct bcm_interface_adapter *)Adapter->pvInterfaceAdapter); } else { } if ((int )((signed char )Adapter->LinkUpStatus) != 0 && (int )((signed char )Adapter->IdleMode) == 0) { tmp___8 = atomic_read((atomic_t const *)(& Adapter->TotalPacketCount)); if (tmp___8 != 0) { update_per_sf_desc_cnts(Adapter); } else { } } else { } tmp___9 = atomic_read((atomic_t const *)(& Adapter->CurrNumFreeTxDesc)); if ((tmp___9 != 0 && (unsigned int )Adapter->LinkStatus == 1U) && (int )((signed char )Adapter->bSyncUpRequestSent) == 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 1024U) != 0U) { printk("\017%s:Calling LinkMessage", "tx_pkt_handler"); } else { } LinkMessage(Adapter); } else { } if ((int )((signed char )Adapter->IdleMode) != 0 || (int )((signed char )Adapter->bShutStatus) != 0) { tmp___10 = atomic_read((atomic_t const *)(& Adapter->TotalPacketCount)); if (tmp___10 != 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 1024U) != 0U) { printk("\017%s:Device in Low Power mode...waking up", "tx_pkt_handler"); } else { } Adapter->usIdleModePattern = 2U; Adapter->bWakeUpDevice = 1; __wake_up(& Adapter->process_rx_cntrlpkt, 3U, 1, 0); } else { } } else { } transmit_packets(Adapter); atomic_set(& Adapter->TxPktAvail, 0); ldv_46854: tmp___11 = kthread_should_stop(); if (tmp___11) { tmp___12 = 0; } else { tmp___12 = 1; } if (tmp___12) { goto ldv_46856; } else { goto ldv_46853; } ldv_46853: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 1024U) != 0U) { printk("\017%s:Exiting the tx thread..\n", "tx_pkt_handler"); } else { } Adapter->transmit_packet_thread = 0; return (0); } } void ldv_mutex_lock_145(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_146(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_147(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_device(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_148(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___2 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex_of_device(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_149(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_device(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_150(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_151(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } __inline static void set_bit(unsigned int nr , unsigned long volatile *addr ) { { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; bts %1,%0": "+m" (*((long volatile *)addr)): "Ir" (nr): "memory"); return; } } extern int snprintf(char * , size_t , char const * , ...) ; extern char *strcpy(char * , char const * ) ; extern void warn_slowpath_null(char const * , int const ) ; int ldv_mutex_trylock_162(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_160(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_163(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_165(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_159(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_161(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_164(struct mutex *ldv_func_arg1 ) ; __inline static void netif_tx_stop_queue(struct netdev_queue *dev_queue ) { int __ret_warn_on ; long tmp ; long tmp___0 ; { __ret_warn_on = (unsigned long )dev_queue == (unsigned long )((struct netdev_queue *)0); tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("include/linux/netdevice.h", 1880); } else { } tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { printk("\016netif_stop_queue() cannot be called before register_netdev()\n"); return; } else { } set_bit(0U, (unsigned long volatile *)(& dev_queue->state)); return; } } __inline static void netif_stop_queue(struct net_device *dev ) { struct netdev_queue *tmp ; { tmp = netdev_get_tx_queue((struct net_device const *)dev, 0U); netif_tx_stop_queue(tmp); return; } } extern void netif_carrier_off(struct net_device * ) ; extern int register_netdev(struct net_device * ) ; int ldv_register_netdev_166(struct net_device *dev ) ; extern void unregister_netdev(struct net_device * ) ; void ldv_unregister_netdev_167(struct net_device *dev ) ; extern int eth_mac_addr(struct net_device * , void * ) ; extern int eth_change_mtu(struct net_device * , int ) ; extern int eth_validate_addr(struct net_device * ) ; __inline static int usb_make_path(struct usb_device *dev , char *buf , size_t size ) { int actual ; int tmp ; { actual = snprintf(buf, size, "usb-%s-%s", (dev->bus)->bus_name, (char *)(& dev->devpath)); if ((int )size > actual) { tmp = actual; } else { tmp = -1; } return (tmp); } } struct net_device *gblpnetdev ; int register_networkdev(struct bcm_mini_adapter *Adapter ) ; void unregister_networkdev(struct bcm_mini_adapter *Adapter ) ; INT ReadMacAddressFromNVM(struct bcm_mini_adapter *Adapter ) ; static INT bcm_open(struct net_device *dev ) { struct bcm_mini_adapter *Adapter ; void *tmp ; { tmp = netdev_priv((struct net_device const *)dev); Adapter = (struct bcm_mini_adapter *)tmp; if ((int )((signed char )Adapter->fw_download_done) == 0) { printk("\rbeceem %s: link up failed (download in progress)\n", (char *)(& dev->name)); return (-16); } else { } if ((Adapter->msg_enable & 32U) != 0U) { printk("\016beceem %s: enabling interface\n", (char *)(& dev->name)); } else { } if ((int )((signed char )Adapter->LinkUpStatus) != 0) { if ((Adapter->msg_enable & 4U) != 0U) { printk("\016beceem %s: link up\n", (char *)(& dev->name)); } else { } netif_carrier_on(Adapter->dev); netif_start_queue(Adapter->dev); } else { } return (0); } } static INT bcm_close(struct net_device *dev ) { struct bcm_mini_adapter *Adapter ; void *tmp ; { tmp = netdev_priv((struct net_device const *)dev); Adapter = (struct bcm_mini_adapter *)tmp; if ((Adapter->msg_enable & 16U) != 0U) { printk("\016beceem %s: disabling interface\n", (char *)(& dev->name)); } else { } netif_carrier_off(dev); netif_stop_queue(dev); return (0); } } static u16 bcm_select_queue(struct net_device *dev , struct sk_buff *skb ) { void *tmp ; USHORT tmp___0 ; { tmp = netdev_priv((struct net_device const *)dev); tmp___0 = ClassifyPacket((struct bcm_mini_adapter *)tmp, skb); return (tmp___0); } } static netdev_tx_t bcm_transmit(struct sk_buff *skb , struct net_device *dev ) { struct bcm_mini_adapter *Adapter ; void *tmp ; u16 qindex ; u16 tmp___0 ; int tmp___1 ; { tmp = netdev_priv((struct net_device const *)dev); Adapter = (struct bcm_mini_adapter *)tmp; tmp___0 = skb_get_queue_mapping((struct sk_buff const *)skb); qindex = tmp___0; if ((int )((signed char )Adapter->device_removed) != 0 || (int )((signed char )Adapter->LinkUpStatus) == 0) { goto drop; } else { } if ((int )((signed char )Adapter->TransferMode) != 0) { goto drop; } else { } if ((unsigned int )qindex == 17U) { goto drop; } else { } if (Adapter->PackInfo[(int )qindex].uiCurrentPacketsOnHost > 127U) { return (16); } else { } if ((Adapter->msg_enable & 256U) != 0U) { printk("\016beceem %s: enqueueing packet to queue %d\n", (char *)(& dev->name), (int )qindex); } else { } spin_lock(& Adapter->PackInfo[(int )qindex].SFQueueLock); Adapter->PackInfo[(int )qindex].uiCurrentBytesOnHost = Adapter->PackInfo[(int )qindex].uiCurrentBytesOnHost + skb->len; Adapter->PackInfo[(int )qindex].uiCurrentPacketsOnHost = Adapter->PackInfo[(int )qindex].uiCurrentPacketsOnHost + 1U; *((B_UINT32 *)(& skb->cb) + 1UL) = (B_UINT32 )jiffies; if ((unsigned long )Adapter->PackInfo[(int )qindex].ldv_45950.ldv_45945.FirstTxQueue == (unsigned long )((struct sk_buff *)0)) { Adapter->PackInfo[(int )qindex].ldv_45950.ldv_45945.FirstTxQueue = skb; } else { (Adapter->PackInfo[(int )qindex].ldv_45950.ldv_45945.LastTxQueue)->next = skb; } skb->next = 0; Adapter->PackInfo[(int )qindex].ldv_45950.ldv_45945.LastTxQueue = skb; atomic_inc(& Adapter->TotalPacketCount); spin_unlock(& Adapter->PackInfo[(int )qindex].SFQueueLock); tmp___1 = atomic_read((atomic_t const *)(& Adapter->TxPktAvail)); if (tmp___1 == 0) { atomic_set(& Adapter->TxPktAvail, 1); __wake_up(& Adapter->tx_packet_wait_queue, 3U, 1, 0); } else { } return (0); drop: consume_skb(skb); return (0); } } static struct net_device_ops const bcmNetDevOps = {0, 0, & bcm_open, & bcm_close, & bcm_transmit, & bcm_select_queue, 0, 0, & eth_mac_addr, & eth_validate_addr, 0, 0, & eth_change_mtu, 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}; static struct device_type wimax_type = {"wimax", 0, 0, 0, 0, 0}; static int bcm_get_settings(struct net_device *dev , struct ethtool_cmd *cmd ) { { cmd->supported = 0U; cmd->advertising = 0U; cmd->speed = 10000U; cmd->duplex = 1U; cmd->port = 0U; cmd->phy_address = 0U; cmd->transceiver = 0U; cmd->autoneg = 0U; cmd->maxtxpkt = 0U; cmd->maxrxpkt = 0U; return (0); } } static void bcm_get_drvinfo(struct net_device *dev , struct ethtool_drvinfo *info ) { struct bcm_mini_adapter *Adapter ; void *tmp ; struct bcm_interface_adapter *psIntfAdapter ; struct usb_device *udev ; struct usb_device *tmp___0 ; { tmp = netdev_priv((struct net_device const *)dev); Adapter = (struct bcm_mini_adapter *)tmp; psIntfAdapter = (struct bcm_interface_adapter *)Adapter->pvInterfaceAdapter; tmp___0 = interface_to_usbdev(psIntfAdapter->interface); udev = tmp___0; strcpy((char *)(& info->driver), "beceem"); strcpy((char *)(& info->version), "5.2.45"); snprintf((char *)(& info->fw_version), 32UL, "%u.%u", Adapter->uiFlashLayoutMajorVersion, Adapter->uiFlashLayoutMinorVersion); usb_make_path(udev, (char *)(& info->bus_info), 32UL); return; } } static u32 bcm_get_link(struct net_device *dev ) { struct bcm_mini_adapter *Adapter ; void *tmp ; { tmp = netdev_priv((struct net_device const *)dev); Adapter = (struct bcm_mini_adapter *)tmp; return ((u32 )Adapter->LinkUpStatus); } } static u32 bcm_get_msglevel(struct net_device *dev ) { struct bcm_mini_adapter *Adapter ; void *tmp ; { tmp = netdev_priv((struct net_device const *)dev); Adapter = (struct bcm_mini_adapter *)tmp; return (Adapter->msg_enable); } } static void bcm_set_msglevel(struct net_device *dev , u32 level ) { struct bcm_mini_adapter *Adapter ; void *tmp ; { tmp = netdev_priv((struct net_device const *)dev); Adapter = (struct bcm_mini_adapter *)tmp; Adapter->msg_enable = level; return; } } static struct ethtool_ops const bcm_ethtool_ops = {& bcm_get_settings, 0, & bcm_get_drvinfo, 0, 0, 0, 0, & bcm_get_msglevel, & bcm_set_msglevel, 0, & bcm_get_link, 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}; int register_networkdev(struct bcm_mini_adapter *Adapter ) { struct net_device *net ; struct bcm_interface_adapter *IntfAdapter ; struct usb_interface *udev ; struct usb_device *xdev ; int result ; { net = Adapter->dev; IntfAdapter = (struct bcm_interface_adapter *)Adapter->pvInterfaceAdapter; udev = IntfAdapter->interface; xdev = IntfAdapter->udev; net->netdev_ops = & bcmNetDevOps; net->ethtool_ops = & bcm_ethtool_ops; net->mtu = 1400U; net->tx_queue_len = 5UL; net->flags = net->flags | 128U; netif_carrier_off(net); net->dev.type = (struct device_type const *)(& wimax_type); result = ReadMacAddressFromNVM(Adapter); if (result != 0) { dev_err((struct device const *)(& udev->dev), "beceem Error in Reading the mac Address: %d", result); return (-5); } else { } result = ldv_register_netdev_166(net); if (result != 0) { return (result); } else { } gblpnetdev = Adapter->dev; if ((Adapter->msg_enable & 2U) != 0U) { _dev_info((struct device const *)(& udev->dev), "beceem %s: register usb-%s-%s %pM\n", (char *)(& net->name), (xdev->bus)->bus_name, (char *)(& xdev->devpath), net->dev_addr); } else { } return (0); } } void unregister_networkdev(struct bcm_mini_adapter *Adapter ) { struct net_device *net ; struct bcm_interface_adapter *IntfAdapter ; struct usb_interface *udev ; struct usb_device *xdev ; { net = Adapter->dev; IntfAdapter = (struct bcm_interface_adapter *)Adapter->pvInterfaceAdapter; udev = IntfAdapter->interface; xdev = IntfAdapter->udev; if ((Adapter->msg_enable & 2U) != 0U) { _dev_info((struct device const *)(& udev->dev), "beceem %s: unregister usb-%s%s\n", (char *)(& net->name), (xdev->bus)->bus_name, (char *)(& xdev->devpath)); } else { } ldv_unregister_netdev_167(Adapter->dev); return; } } struct ethtool_cmd *ldvarg18 ; struct sk_buff *ldvarg11 ; int ldvarg12 ; u32 ldvarg16 ; struct sk_buff *ldvarg15 ; struct net_device *net_device_ops_group1 ; struct ethtool_drvinfo *ldvarg17 ; struct net_device *ldvarg14 ; struct net_device *bcm_ethtool_ops_group0 ; struct net_device *ldvarg13 ; int ldv_retval_6 ; extern int ldv_bcmNetDevOps_ndo_uninit_3(void) ; void *ldvarg10 ; struct net_device *ldvarg9 ; extern int ldv_bcmNetDevOps_ndo_init_3(void) ; int ldv_retval_7 ; void ldv_main_exported_3(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_state_variable_3 == 1) { bcm_select_queue(ldvarg14, ldvarg15); ldv_state_variable_3 = 1; } else { } if (ldv_state_variable_3 == 3) { bcm_select_queue(ldvarg14, ldvarg15); ldv_state_variable_3 = 3; } else { } if (ldv_state_variable_3 == 2) { bcm_select_queue(ldvarg14, ldvarg15); ldv_state_variable_3 = 2; } else { } goto ldv_46902; case 1: ; if (ldv_state_variable_3 == 1) { eth_validate_addr(ldvarg13); ldv_state_variable_3 = 1; } else { } if (ldv_state_variable_3 == 3) { eth_validate_addr(ldvarg13); ldv_state_variable_3 = 3; } else { } if (ldv_state_variable_3 == 2) { eth_validate_addr(ldvarg13); ldv_state_variable_3 = 2; } else { } goto ldv_46902; case 2: ; if (ldv_state_variable_3 == 3) { bcm_close(net_device_ops_group1); ldv_state_variable_3 = 2; } else { } goto ldv_46902; case 3: ; if (ldv_state_variable_3 == 3) { eth_change_mtu(net_device_ops_group1, ldvarg12); ldv_state_variable_3 = 3; } else { } if (ldv_state_variable_3 == 2) { eth_change_mtu(net_device_ops_group1, ldvarg12); ldv_state_variable_3 = 2; } else { } goto ldv_46902; case 4: ; if (ldv_state_variable_3 == 2) { ldv_retval_7 = bcm_open(net_device_ops_group1); if (ldv_retval_7 == 0) { ldv_state_variable_3 = 3; } else { } } else { } goto ldv_46902; case 5: ; if (ldv_state_variable_3 == 3) { bcm_transmit(ldvarg11, net_device_ops_group1); ldv_state_variable_3 = 3; } else { } goto ldv_46902; case 6: ; if (ldv_state_variable_3 == 1) { eth_mac_addr(ldvarg9, ldvarg10); ldv_state_variable_3 = 1; } else { } if (ldv_state_variable_3 == 3) { eth_mac_addr(ldvarg9, ldvarg10); ldv_state_variable_3 = 3; } else { } if (ldv_state_variable_3 == 2) { eth_mac_addr(ldvarg9, ldvarg10); ldv_state_variable_3 = 2; } else { } goto ldv_46902; case 7: ; if (ldv_state_variable_3 == 1) { ldv_retval_6 = ldv_bcmNetDevOps_ndo_init_3(); if (ldv_retval_6 == 0) { ldv_state_variable_3 = 2; usb_counter = usb_counter + 1; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_46902; case 8: ; if (ldv_state_variable_3 == 2) { ldv_bcmNetDevOps_ndo_uninit_3(); ldv_state_variable_3 = 1; usb_counter = usb_counter - 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_46902; default: ; goto ldv_46902; } ldv_46902: ; return; } } void ldv_main_exported_2(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_state_variable_2 == 1) { bcm_get_settings(bcm_ethtool_ops_group0, ldvarg18); ldv_state_variable_2 = 1; } else { } goto ldv_46918; case 1: ; if (ldv_state_variable_2 == 1) { bcm_get_msglevel(bcm_ethtool_ops_group0); ldv_state_variable_2 = 1; } else { } goto ldv_46918; case 2: ; if (ldv_state_variable_2 == 1) { bcm_get_drvinfo(bcm_ethtool_ops_group0, ldvarg17); ldv_state_variable_2 = 1; } else { } goto ldv_46918; case 3: ; if (ldv_state_variable_2 == 1) { bcm_set_msglevel(bcm_ethtool_ops_group0, ldvarg16); ldv_state_variable_2 = 1; } else { } goto ldv_46918; case 4: ; if (ldv_state_variable_2 == 1) { bcm_get_link(bcm_ethtool_ops_group0); ldv_state_variable_2 = 1; } else { } goto ldv_46918; default: ; goto ldv_46918; } ldv_46918: ; return; } } void ldv_mutex_lock_159(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_160(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_161(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_device(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_162(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___2 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex_of_device(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_163(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_device(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_164(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_165(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } int ldv_register_netdev_166(struct net_device *dev ) { ldv_func_ret_type___6 ldv_func_res ; int tmp ; { tmp = register_netdev(dev); ldv_func_res = tmp; ldv_state_variable_3 = 1; return (ldv_func_res); } } void ldv_unregister_netdev_167(struct net_device *dev ) { { unregister_netdev(dev); ldv_state_variable_3 = 0; return; } } int ldv_mutex_trylock_180(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_178(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_181(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_183(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_177(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_179(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_182(struct mutex *ldv_func_arg1 ) ; static struct bcm_ddr_setting asT3_DDRSetting133MHz[49U] = { {251660288U, 29202U}, {251660320U, 133251071U}, {251660304U, 3989U}, {251660384U, 0U}, {251660416U, 989U}, {251660352U, 268376832U}, {251660400U, 2U}, {251699268U, 536870911U}, {251699264U, 520093696U}, {251699332U, 486539263U}, {251699328U, 469762048U}, {251699276U, 12U}, {251686912U, 65537U}, {251686916U, 16843008U}, {251686920U, 16777217U}, {251686924U, 0U}, {251686928U, 16777216U}, {251686932U, 16777472U}, {251686936U, 16777216U}, {251686940U, 16908289U}, {251686944U, 67305735U}, {251686948U, 33554439U}, {251686952U, 33686018U}, {251686956U, 33949194U}, {251686960U, 83886080U}, {251686964U, 3U}, {251686968U, 285868544U}, {251686972U, 34607120U}, {251686976U, 1165300224U}, {251686980U, 285871360U}, {251686984U, 135987974U}, {251686988U, 0U}, {251686992U, 28U}, {251686996U, 0U}, {251687000U, 0U}, {251687004U, 0U}, {251687008U, 1057900U}, {251687012U, 16U}, {251687016U, 0U}, {251687020U, 1U}, {251687024U, 28672U}, {251687028U, 0U}, {251687032U, 0U}, {251687036U, 0U}, {251687040U, 0U}, {251687044U, 0U}, {251687060U, 260U}, {251699200U, 22U}, {251686936U, 16842752U}}; static struct bcm_ddr_setting asT3_DDRSetting80MHz[46U] = { {251660304U, 3989U}, {251660320U, 133300223U}, {251660384U, 0U}, {251660416U, 989U}, {251699268U, 536870911U}, {251699264U, 520093696U}, {251699332U, 486539263U}, {251699328U, 469762048U}, {251699200U, 22U}, {251699276U, 12U}, {251686912U, 65537U}, {251686916U, 16777216U}, {251686920U, 16777217U}, {251686924U, 0U}, {251686928U, 16777216U}, {251686932U, 16777472U}, {251686936U, 16777216U}, {251686940U, 16908288U}, {251686944U, 67240199U}, {251686948U, 7U}, {251686952U, 33686017U}, {251686956U, 33817610U}, {251686960U, 67108864U}, {251686964U, 2U}, {251686968U, 520487424U}, {251686972U, 471999007U}, {251686976U, 2315281920U}, {251686980U, 572131328U}, {251686984U, 40436228U}, {251686988U, 0U}, {251686992U, 28U}, {251686996U, 0U}, {251687000U, 0U}, {251687004U, 0U}, {251687008U, 660950U}, {251687012U, 10U}, {251687016U, 0U}, {251687020U, 1U}, {251687024U, 16384U}, {251687028U, 0U}, {251687032U, 0U}, {251687036U, 0U}, {251687040U, 0U}, {251687044U, 0U}, {251687060U, 260U}, {251686936U, 16842752U}}; static struct bcm_ddr_setting asT3_DDRSetting100MHz[49U] = { {251660288U, 28680U}, {251660304U, 3989U}, {251660320U, 133250623U}, {251660384U, 0U}, {251660416U, 989U}, {251660352U, 268376832U}, {251660400U, 2U}, {251699268U, 536870911U}, {251699264U, 520093696U}, {251699332U, 486539263U}, {251699328U, 469762048U}, {251699276U, 12U}, {251699200U, 22U}, {251686912U, 65537U}, {251686916U, 16843008U}, {251686920U, 16777217U}, {251686924U, 0U}, {251686928U, 16777216U}, {251686932U, 16777472U}, {251686936U, 16777216U}, {251686940U, 16908289U}, {251686944U, 67240199U}, {251686948U, 7U}, {251686952U, 16908801U}, {251686956U, 33817610U}, {251686960U, 100663296U}, {251686964U, 4U}, {251686968U, 537395712U}, {251686972U, 33751840U}, {251686976U, 1853821440U}, {251686980U, 18418176U}, {251686984U, 101843717U}, {251686988U, 0U}, {251686992U, 28U}, {251686996U, 0U}, {251687000U, 0U}, {251687004U, 0U}, {251687008U, 536278U}, {251687012U, 10U}, {251687016U, 0U}, {251687020U, 1U}, {251687024U, 20480U}, {251687028U, 0U}, {251687032U, 0U}, {251687036U, 0U}, {251687040U, 0U}, {251687044U, 0U}, {251687060U, 260U}, {251686936U, 16842752U}}; static struct bcm_ddr_setting asDPLL_266MHZ[7U] = { {251660288U, 29202U}, {251660320U, 133251071U}, {251660304U, 3989U}, {251660384U, 0U}, {251660416U, 989U}, {251660352U, 268376832U}, {251660400U, 2U}}; static struct bcm_ddr_setting asT3B_DDRSetting133MHz[48U] = { {251660304U, 3989U}, {251660304U, 3989U}, {251660304U, 3989U}, {251660320U, 133248594U}, {251660352U, 268371968U}, {251660416U, 989U}, {251660384U, 0U}, {251699268U, 536870911U}, {251699264U, 520093696U}, {251699332U, 486539263U}, {251699328U, 469762048U}, {251699200U, 22U}, {251686912U, 65537U}, {251686916U, 16843008U}, {251686920U, 16777217U}, {251686924U, 0U}, {251686928U, 16777216U}, {251686932U, 16777472U}, {251686936U, 16777216U}, {251686940U, 16908289U}, {251686944U, 67305735U}, {251686948U, 33554439U}, {251686952U, 33686018U}, {251686956U, 33949194U}, {251686960U, 83886080U}, {251686964U, 3U}, {251686968U, 319422976U}, {251686972U, 34607122U}, {251686976U, 1165824512U}, {251686980U, 286461184U}, {251686984U, 67961606U}, {251686988U, 0U}, {251686992U, 28U}, {251686996U, 0U}, {251687000U, 0U}, {251687004U, 0U}, {251687008U, 1057900U}, {251687012U, 18U}, {251687016U, 0U}, {251687020U, 1U}, {251687024U, 28672U}, {251687028U, 0U}, {251687032U, 0U}, {251687036U, 0U}, {251687040U, 0U}, {251687044U, 0U}, {251687060U, 260U}, {251686936U, 16842752U}}; static struct bcm_ddr_setting asT3B_DDRSetting80MHz[46U] = { {251660304U, 3989U}, {251660320U, 133251071U}, {251660352U, 268377856U}, {251660416U, 989U}, {251660384U, 0U}, {251699268U, 536870911U}, {251699264U, 520093696U}, {251699332U, 486539263U}, {251699328U, 469762048U}, {251699200U, 22U}, {251686912U, 65537U}, {251686916U, 16777216U}, {251686920U, 16777217U}, {251686924U, 0U}, {251686928U, 16777216U}, {251686932U, 16777472U}, {251686936U, 16777216U}, {251686940U, 16908288U}, {251686944U, 67240199U}, {251686948U, 7U}, {251686952U, 33686017U}, {251686956U, 33817610U}, {251686960U, 67108864U}, {251686964U, 33554434U}, {251686968U, 520487426U}, {251686972U, 471999007U}, {251686976U, 2315281920U}, {251686980U, 572131328U}, {251686984U, 40436228U}, {251686988U, 0U}, {251686992U, 16777244U}, {251686996U, 0U}, {251687000U, 0U}, {251687004U, 0U}, {251687008U, 660950U}, {251687012U, 10U}, {251687016U, 0U}, {251687020U, 1U}, {251687024U, 16384U}, {251687028U, 0U}, {251687032U, 0U}, {251687036U, 0U}, {251687040U, 0U}, {251687044U, 0U}, {251687060U, 260U}, {251686936U, 16842752U}}; static struct bcm_ddr_setting asT3B_DDRSetting100MHz[46U] = { {251660304U, 3989U}, {251660320U, 133248667U}, {251660352U, 268371968U}, {251660416U, 989U}, {251660384U, 0U}, {251699268U, 536870911U}, {251699264U, 520093696U}, {251699332U, 486539263U}, {251699328U, 469762048U}, {251699200U, 22U}, {251686912U, 65537U}, {251686916U, 16843008U}, {251686920U, 16777217U}, {251686924U, 0U}, {251686928U, 16777216U}, {251686932U, 16777472U}, {251686936U, 16777216U}, {251686940U, 16908288U}, {251686944U, 67240199U}, {251686948U, 7U}, {251686952U, 16908801U}, {251686956U, 33817610U}, {251686960U, 100663296U}, {251686964U, 33554436U}, {251686968U, 537395712U}, {251686972U, 33751840U}, {251686976U, 1853821440U}, {251686980U, 18418176U}, {251686984U, 101843717U}, {251686988U, 0U}, {251686992U, 16777244U}, {251686996U, 0U}, {251687000U, 0U}, {251687004U, 0U}, {251687008U, 536278U}, {251687012U, 10U}, {251687016U, 0U}, {251687020U, 1U}, {251687024U, 20480U}, {251687028U, 0U}, {251687032U, 0U}, {251687036U, 0U}, {251687040U, 0U}, {251687044U, 0U}, {251687060U, 260U}, {251686936U, 16842752U}}; static struct bcm_ddr_setting asT3LP_DDRSetting133MHz[51U] = { {251660320U, 66139739U}, {251660304U, 12181U}, {251660416U, 989U}, {251660352U, 268369920U}, {251660384U, 0U}, {251699268U, 536870911U}, {251699264U, 520093696U}, {251699332U, 486539263U}, {251699328U, 469762048U}, {251699200U, 22U}, {251686912U, 65537U}, {251686916U, 16843008U}, {251686920U, 16777217U}, {251686924U, 0U}, {251686928U, 16777216U}, {251686932U, 16777472U}, {251686936U, 16777216U}, {251686940U, 16908289U}, {251686944U, 67305735U}, {251686948U, 33554439U}, {251686952U, 33686016U}, {251686956U, 33949194U}, {251686960U, 83886080U}, {251686964U, 3U}, {251686968U, 537526784U}, {251686972U, 34607136U}, {251686976U, 1165038080U}, {251686980U, 286067968U}, {251686984U, 67633926U}, {251686988U, 0U}, {251686992U, 16777244U}, {251686996U, 0U}, {251687000U, 0U}, {251687004U, 0U}, {251687008U, 1057887U}, {251687012U, 16U}, {251687016U, 0U}, {251687020U, 1U}, {251687024U, 28672U}, {251687028U, 0U}, {251687032U, 0U}, {251687036U, 0U}, {251687040U, 0U}, {251687044U, 0U}, {251687048U, 16777217U}, {251687052U, 257U}, {251687056U, 0U}, {251687060U, 262144U}, {251687064U, 0U}, {251687112U, 260U}, {251686936U, 16842752U}}; static struct bcm_ddr_setting asT3LP_DDRSetting100MHz[52U] = { {251660304U, 12181U}, {251660320U, 66139803U}, {251660352U, 268369920U}, {251660384U, 0U}, {251660416U, 989U}, {251660352U, 268369920U}, {251699268U, 536870911U}, {251699264U, 520093696U}, {251699332U, 486539263U}, {251699328U, 469762048U}, {251686912U, 65537U}, {251686916U, 16843008U}, {251686920U, 16777217U}, {251686924U, 0U}, {251686928U, 16777216U}, {251686932U, 16777472U}, {251686936U, 16777216U}, {251686940U, 16908288U}, {251686944U, 67240199U}, {251686948U, 7U}, {251686952U, 16908800U}, {251686956U, 33817610U}, {251686960U, 100663296U}, {251686964U, 4U}, {251686968U, 520618496U}, {251686972U, 33751839U}, {251686976U, 1845498368U}, {251686980U, 18483712U}, {251686984U, 50332421U}, {251686988U, 0U}, {251686992U, 16777244U}, {251686996U, 0U}, {251687000U, 0U}, {251687004U, 0U}, {251687008U, 536278U}, {251687012U, 10U}, {251687016U, 0U}, {251687020U, 1U}, {251687024U, 20480U}, {251687028U, 0U}, {251687032U, 0U}, {251687036U, 0U}, {251687040U, 0U}, {251687044U, 0U}, {251687048U, 16777217U}, {251687052U, 257U}, {251687056U, 0U}, {251687060U, 65536U}, {251687064U, 0U}, {251687112U, 260U}, {251699200U, 22U}, {251686936U, 16842752U}}; static struct bcm_ddr_setting asT3LP_DDRSetting80MHz[51U] = { {251660320U, 133251071U}, {251660304U, 12181U}, {251660384U, 0U}, {251660416U, 989U}, {251660352U, 268377856U}, {251699268U, 536870911U}, {251699264U, 520093696U}, {251699332U, 486539263U}, {251699328U, 469762048U}, {251699200U, 22U}, {251686912U, 65537U}, {251686916U, 16777216U}, {251686920U, 16777217U}, {251686924U, 0U}, {251686928U, 16777216U}, {251686932U, 16777472U}, {251686936U, 16777216U}, {251686940U, 16908288U}, {251686944U, 67240199U}, {251686948U, 7U}, {251686952U, 33686016U}, {251686956U, 33817610U}, {251686960U, 67108864U}, {251686964U, 2U}, {251686968U, 486932992U}, {251686972U, 471999005U}, {251686976U, 2316396032U}, {251686980U, 573376512U}, {251686984U, 40436228U}, {251686988U, 0U}, {251686992U, 16777244U}, {251686996U, 0U}, {251687000U, 0U}, {251687004U, 0U}, {251687008U, 660950U}, {251687012U, 10U}, {251687016U, 0U}, {251687020U, 1U}, {251687024U, 16384U}, {251687028U, 0U}, {251687032U, 0U}, {251687036U, 0U}, {251687040U, 0U}, {251687044U, 0U}, {251687048U, 16777217U}, {251687052U, 257U}, {251687056U, 0U}, {251687060U, 65536U}, {251687064U, 0U}, {251687112U, 260U}, {251686936U, 16842752U}}; static struct bcm_ddr_setting asT3LPB_DDRSetting160MHz[52U] = { {251660320U, 66140123U}, {251660304U, 25438101U}, {251660384U, 0U}, {251660416U, 989U}, {251660352U, 268370944U}, {251699268U, 536870911U}, {251699264U, 520093696U}, {251670608U, 33U}, {251699332U, 486539263U}, {251699328U, 469762048U}, {251699200U, 22U}, {251686912U, 65537U}, {251686916U, 16777217U}, {251686920U, 16777473U}, {251686924U, 0U}, {251686928U, 16777472U}, {251686932U, 16777472U}, {251686936U, 16777216U}, {251686940U, 16908288U}, {251686944U, 67305735U}, {251686948U, 33554439U}, {251686952U, 33686016U}, {251686956U, 33949194U}, {251686960U, 84741376U}, {251686964U, 3U}, {251686968U, 386531840U}, {251686972U, 34607122U}, {251686976U, 1159074304U}, {251686980U, 287640576U}, {251686984U, 81396487U}, {251686988U, 0U}, {251686992U, 28U}, {251686996U, 0U}, {251687000U, 0U}, {251687004U, 0U}, {251687008U, 1321910U}, {251687012U, 541261844U}, {251687016U, 0U}, {251687020U, 1U}, {251687024U, 36864U}, {251687028U, 0U}, {251687032U, 0U}, {251687036U, 0U}, {251687040U, 0U}, {251687044U, 0U}, {251687048U, 16777217U}, {251687052U, 257U}, {251687056U, 0U}, {251687060U, 262144U}, {251687064U, 0U}, {251687112U, 260U}, {251686936U, 16842752U}}; static struct bcm_ddr_setting asT3LPB_DDRSetting133MHz[52U] = { {251660320U, 66139739U}, {251660304U, 12181U}, {251660416U, 989U}, {251660352U, 268369920U}, {251660384U, 0U}, {251699268U, 536870911U}, {251699264U, 520093696U}, {251670608U, 33U}, {251699332U, 486539263U}, {251699328U, 469762048U}, {251699200U, 22U}, {251686912U, 65537U}, {251686916U, 16843008U}, {251686920U, 16777217U}, {251686924U, 0U}, {251686928U, 16777216U}, {251686932U, 16777472U}, {251686936U, 16777216U}, {251686940U, 16908289U}, {251686944U, 67305735U}, {251686948U, 33554439U}, {251686952U, 33686016U}, {251686956U, 33949194U}, {251686960U, 83886080U}, {251686964U, 3U}, {251686968U, 420086272U}, {251686972U, 34607127U}, {251686976U, 1159139840U}, {251686980U, 287902976U}, {251686984U, 67633926U}, {251686988U, 0U}, {251686992U, 16777244U}, {251686996U, 0U}, {251687000U, 0U}, {251687004U, 0U}, {251687008U, 1057887U}, {251687012U, 16U}, {251687016U, 0U}, {251687020U, 1U}, {251687024U, 28672U}, {251687028U, 0U}, {251687032U, 0U}, {251687036U, 0U}, {251687040U, 0U}, {251687044U, 0U}, {251687048U, 16777217U}, {251687052U, 257U}, {251687056U, 0U}, {251687060U, 262144U}, {251687064U, 0U}, {251687112U, 260U}, {251686936U, 16842752U}}; static struct bcm_ddr_setting asT3LPB_DDRSetting100MHz[53U] = { {251660304U, 12181U}, {251660320U, 66139803U}, {251660352U, 268369920U}, {251660384U, 0U}, {251660416U, 989U}, {251660352U, 268369920U}, {251699268U, 536870911U}, {251699264U, 520093696U}, {251670608U, 33U}, {251699332U, 486539263U}, {251699328U, 469762048U}, {251686912U, 65537U}, {251686916U, 16843008U}, {251686920U, 16777217U}, {251686924U, 0U}, {251686928U, 16777216U}, {251686932U, 16777472U}, {251686936U, 16777216U}, {251686940U, 16908288U}, {251686944U, 67240199U}, {251686948U, 7U}, {251686952U, 16908800U}, {251686956U, 33817610U}, {251686960U, 100663296U}, {251686964U, 4U}, {251686968U, 520618496U}, {251686972U, 33751839U}, {251686976U, 1845498368U}, {251686980U, 18483712U}, {251686984U, 50332421U}, {251686988U, 0U}, {251686992U, 16777244U}, {251686996U, 0U}, {251687000U, 0U}, {251687004U, 0U}, {251687008U, 536278U}, {251687012U, 10U}, {251687016U, 0U}, {251687020U, 1U}, {251687024U, 20480U}, {251687028U, 0U}, {251687032U, 0U}, {251687036U, 0U}, {251687040U, 0U}, {251687044U, 0U}, {251687048U, 16777217U}, {251687052U, 257U}, {251687056U, 0U}, {251687060U, 65536U}, {251687064U, 0U}, {251687112U, 260U}, {251699200U, 22U}, {251686936U, 16842752U}}; static struct bcm_ddr_setting asT3LPB_DDRSetting80MHz[52U] = { {251660320U, 133251071U}, {251660304U, 12181U}, {251660384U, 0U}, {251660416U, 989U}, {251660352U, 268377856U}, {251699268U, 536870911U}, {251699264U, 520093696U}, {251670608U, 33U}, {251699332U, 486539263U}, {251699328U, 469762048U}, {251699200U, 22U}, {251686912U, 65537U}, {251686916U, 16777216U}, {251686920U, 16777217U}, {251686924U, 0U}, {251686928U, 16777216U}, {251686932U, 16777472U}, {251686936U, 16777216U}, {251686940U, 16908288U}, {251686944U, 67240199U}, {251686948U, 7U}, {251686952U, 33686016U}, {251686956U, 33817610U}, {251686960U, 67108864U}, {251686964U, 2U}, {251686968U, 486932992U}, {251686972U, 471999005U}, {251686976U, 2316396032U}, {251686980U, 573376512U}, {251686984U, 40436228U}, {251686988U, 0U}, {251686992U, 16777244U}, {251686996U, 0U}, {251687000U, 0U}, {251687004U, 0U}, {251687008U, 660950U}, {251687012U, 10U}, {251687016U, 0U}, {251687020U, 1U}, {251687024U, 16384U}, {251687028U, 0U}, {251687032U, 0U}, {251687036U, 0U}, {251687040U, 0U}, {251687044U, 0U}, {251687048U, 16777217U}, {251687052U, 257U}, {251687056U, 0U}, {251687060U, 65536U}, {251687064U, 0U}, {251687112U, 260U}, {251686936U, 16842752U}}; int ddr_init(struct bcm_mini_adapter *Adapter ) { struct bcm_ddr_setting *psDDRSetting ; ULONG RegCount ; UINT value ; UINT uiResetValue ; UINT uiClockSetting ; int retval ; size_t __len ; void *__ret ; unsigned long __ms ; unsigned long tmp ; unsigned long __ms___0 ; unsigned long tmp___0 ; { psDDRSetting = 0; RegCount = 0UL; value = 0U; uiResetValue = 0U; uiClockSetting = 0U; retval = 0; switch (Adapter->chip_id) { case -1093783040: ; switch (Adapter->DDRSetting) { case 0: psDDRSetting = (struct bcm_ddr_setting *)(& asT3LP_DDRSetting80MHz); RegCount = 51UL; goto ldv_46835; case 1: psDDRSetting = (struct bcm_ddr_setting *)(& asT3LP_DDRSetting100MHz); RegCount = 52UL; goto ldv_46835; case 3: psDDRSetting = (struct bcm_ddr_setting *)(& asT3LP_DDRSetting133MHz); RegCount = 51UL; if ((int )((signed char )Adapter->bMipsConfig) == 0) { uiClockSetting = 66139730U; } else { uiClockSetting = 66139739U; } goto ldv_46835; default: ; return (-22); } ldv_46835: ; goto ldv_46839; case -1093782784: ; case -1093782767: ; case -1093782768: ; case -1093782783: ; case -1093782751: ; if ((Adapter->chip_id != 3201184529UL && Adapter->chip_id != 3201184528UL) && Adapter->chip_id != 3201184545UL) { retval = rdmalt(Adapter, 251660336U, & uiResetValue, 4UL); if (retval < 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (Adapter->stDebugState.subtype[1] & 32768U) != 0U) { printk("\017%s:%s:%d RDM failed\n", "ddr_init", "ddr_init", 871); } else { } return (retval); } else { } uiResetValue = uiResetValue | 68U; retval = wrmalt(Adapter, 251660336U, & uiResetValue, 4UL); if (retval < 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (Adapter->stDebugState.subtype[1] & 16384U) != 0U) { printk("\017%s:%s:%d WRM failed\n", "ddr_init", "ddr_init", 877); } else { } return (retval); } else { } } else { } switch (Adapter->DDRSetting) { case 0: psDDRSetting = (struct bcm_ddr_setting *)(& asT3LPB_DDRSetting80MHz); RegCount = 46UL; goto ldv_46847; case 1: psDDRSetting = (struct bcm_ddr_setting *)(& asT3LPB_DDRSetting100MHz); RegCount = 46UL; goto ldv_46847; case 3: psDDRSetting = (struct bcm_ddr_setting *)(& asT3LPB_DDRSetting133MHz); RegCount = 48UL; if ((int )((signed char )Adapter->bMipsConfig) == 0) { uiClockSetting = 66139730U; } else { uiClockSetting = 66139739U; } goto ldv_46847; case 5: psDDRSetting = (struct bcm_ddr_setting *)(& asT3LPB_DDRSetting160MHz); RegCount = 52UL; if ((int )((signed char )Adapter->bMipsConfig) == 0) { uiClockSetting = 66140114U; } else { uiClockSetting = 66140123U; } } ldv_46847: ; goto ldv_46839; case -1093795568: ; case -1093795552: ; case -1093795551: ; case -1093795536: ; case -1093795072: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (int )Adapter->stDebugState.subtype[1] & 1) { printk("\017%s:DDR Setting: %x\n", "ddr_init", Adapter->DDRSetting); } else { } switch (Adapter->DDRSetting) { case 0: psDDRSetting = (struct bcm_ddr_setting *)(& asT3_DDRSetting80MHz); RegCount = 46UL; goto ldv_46857; case 1: psDDRSetting = (struct bcm_ddr_setting *)(& asT3_DDRSetting100MHz); RegCount = 49UL; goto ldv_46857; case 3: psDDRSetting = (struct bcm_ddr_setting *)(& asT3_DDRSetting133MHz); RegCount = 49UL; goto ldv_46857; default: ; return (-22); } ldv_46857: ; case -1093795056: ; switch (Adapter->DDRSetting) { case 0: psDDRSetting = (struct bcm_ddr_setting *)(& asT3B_DDRSetting80MHz); RegCount = 46UL; goto ldv_46863; case 1: psDDRSetting = (struct bcm_ddr_setting *)(& asT3B_DDRSetting100MHz); RegCount = 46UL; goto ldv_46863; case 3: ; if ((int )((signed char )Adapter->bDPLLConfig) == 1) { __len = 56UL; if (__len > 63UL) { __ret = memcpy((void *)(& asT3B_DDRSetting133MHz), (void const *)(& asDPLL_266MHZ), __len); } else { __ret = memcpy((void *)(& asT3B_DDRSetting133MHz), (void const *)(& asDPLL_266MHZ), __len); } psDDRSetting = (struct bcm_ddr_setting *)(& asT3B_DDRSetting133MHz); RegCount = 48UL; } else { psDDRSetting = (struct bcm_ddr_setting *)(& asT3B_DDRSetting133MHz); RegCount = 48UL; if ((int )((signed char )Adapter->bMipsConfig) == 0) { uiClockSetting = 133248594U; } else { uiClockSetting = 133248603U; } } goto ldv_46863; default: ; return (-22); } ldv_46863: ; goto ldv_46839; default: ; return (-22); } ldv_46839: value = 0U; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (int )Adapter->stDebugState.subtype[1] & 1) { printk("\017%s:Register Count is =%lu\n", "ddr_init", RegCount); } else { } goto ldv_46873; ldv_46872: ; if (uiClockSetting != 0U && psDDRSetting->ulRegAddress == 251660320U) { value = uiClockSetting; } else { value = psDDRSetting->ulRegValue; } retval = wrmalt(Adapter, psDDRSetting->ulRegAddress, & value, 4UL); if (retval != 0) { printk("\016%s:%s:%d\n", "ddr_init", "ddr_init", 1015); goto ldv_46871; } else { } RegCount = RegCount - 1UL; psDDRSetting = psDDRSetting + 1; ldv_46873: ; if (RegCount != 0UL && retval == 0) { goto ldv_46872; } else { goto ldv_46871; } ldv_46871: ; if (Adapter->chip_id > 3201184511UL) { if (1) { __const_udelay(12885000UL); } else { __ms = 3UL; goto ldv_46876; ldv_46875: __const_udelay(4295000UL); ldv_46876: tmp = __ms; __ms = __ms - 1UL; if (tmp != 0UL) { goto ldv_46875; } else { goto ldv_46877; } ldv_46877: ; } if ((Adapter->chip_id != 3201184529UL && Adapter->chip_id != 3201184528UL) && Adapter->chip_id != 3201184545UL) { uiResetValue = 16842753U; retval = wrmalt(Adapter, 251686936U, & uiResetValue, 4UL); if (retval < 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (Adapter->stDebugState.subtype[1] & 32768U) != 0U) { printk("\017%s:%s:%d RDM failed\n", "ddr_init", "ddr_init", 1035); } else { } return (retval); } else { } uiResetValue = 262176U; retval = wrmalt(Adapter, 251687060U, & uiResetValue, 4UL); if (retval < 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (Adapter->stDebugState.subtype[1] & 32768U) != 0U) { printk("\017%s:%s:%d RDM failed\n", "ddr_init", "ddr_init", 1041); } else { } return (retval); } else { } uiResetValue = 16908545U; retval = wrmalt(Adapter, 251686940U, & uiResetValue, 4UL); if (retval < 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (Adapter->stDebugState.subtype[1] & 32768U) != 0U) { printk("\017%s:%s:%d RDM failed\n", "ddr_init", "ddr_init", 1047); } else { } return (retval); } else { } uiResetValue = 16842752U; retval = wrmalt(Adapter, 251686936U, & uiResetValue, 4UL); if (retval < 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (Adapter->stDebugState.subtype[1] & 32768U) != 0U) { printk("\017%s:%s:%d RDM failed\n", "ddr_init", "ddr_init", 1053); } else { } return (retval); } else { } } else { } if (1) { __const_udelay(12885000UL); } else { __ms___0 = 3UL; goto ldv_46880; ldv_46879: __const_udelay(4295000UL); ldv_46880: tmp___0 = __ms___0; __ms___0 = __ms___0 - 1UL; if (tmp___0 != 0UL) { goto ldv_46879; } else { goto ldv_46881; } ldv_46881: ; } if (Adapter->PmuMode == 0U) { retval = rdmalt(Adapter, 251661312U, & uiResetValue, 4UL); if (retval < 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (Adapter->stDebugState.subtype[1] & 32768U) != 0U) { printk("\017%s:%s:%d RDM failed\n", "ddr_init", "ddr_init", 1069); } else { } return (retval); } else { } retval = rdmalt(Adapter, 251661312U, & uiResetValue, 4UL); if (retval < 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (Adapter->stDebugState.subtype[1] & 32768U) != 0U) { printk("\017%s:%s:%d RDM failed\n", "ddr_init", "ddr_init", 1074); } else { } return (retval); } else { } uiResetValue = 1254056U; retval = wrmalt(Adapter, 251661596U, & uiResetValue, 4UL); if (retval < 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (Adapter->stDebugState.subtype[1] & 32768U) != 0U) { printk("\017%s:%s:%d RDM failed\n", "ddr_init", "ddr_init", 1080); } else { } return (retval); } else { } retval = rdmalt(Adapter, 251661312U, & uiResetValue, 4UL); if (retval < 0) { printk("\016%s:%s:%d RDM failed\n", "ddr_init", "ddr_init", 1085); return (retval); } else { } retval = rdmalt(Adapter, 251661312U, & uiResetValue, 4UL); if (retval < 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (Adapter->stDebugState.subtype[1] & 32768U) != 0U) { printk("\017%s:%s:%d RDM failed\n", "ddr_init", "ddr_init", 1090); } else { } return (retval); } else { } uiResetValue = 1254038U; retval = wrmalt(Adapter, 251661588U, & uiResetValue, 4UL); if (retval < 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (Adapter->stDebugState.subtype[1] & 32768U) != 0U) { printk("\017%s:%s:%d RDM failed\n", "ddr_init", "ddr_init", 1096); } else { } return (retval); } else { } } else if (Adapter->PmuMode == 2U) { retval = rdmalt(Adapter, 251661312U, & uiResetValue, 4UL); if (retval < 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (Adapter->stDebugState.subtype[1] & 32768U) != 0U) { printk("\017%s:%s:%d RDM failed\n", "ddr_init", "ddr_init", 1105); } else { } return (retval); } else { } retval = rdmalt(Adapter, 251661312U, & uiResetValue, 4UL); if (retval < 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (Adapter->stDebugState.subtype[1] & 32768U) != 0U) { printk("\017%s:%s:%d RDM failed\n", "ddr_init", "ddr_init", 1110); } else { } return (retval); } else { } uiResetValue = 1610818202U; retval = wrmalt(Adapter, 251661588U, & uiResetValue, 4UL); if (retval < 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (Adapter->stDebugState.subtype[1] & 32768U) != 0U) { printk("\017%s:%s:%d RDM failed\n", "ddr_init", "ddr_init", 1116); } else { } return (retval); } else { } retval = rdmalt(Adapter, 251661312U, & uiResetValue, 4UL); if (retval < 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (Adapter->stDebugState.subtype[1] & 32768U) != 0U) { printk("\017%s:%s:%d RDM failed\n", "ddr_init", "ddr_init", 1121); } else { } return (retval); } else { } retval = rdmalt(Adapter, 251661312U, & uiResetValue, 4UL); if (retval < 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (Adapter->stDebugState.subtype[1] & 32768U) != 0U) { printk("\017%s:%s:%d RDM failed\n", "ddr_init", "ddr_init", 1126); } else { } return (retval); } else { } uiResetValue = 1254056U; retval = wrmalt(Adapter, 251661596U, & uiResetValue, 4UL); if (retval < 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (Adapter->stDebugState.subtype[1] & 32768U) != 0U) { printk("\017%s:%s:%d RDM failed\n", "ddr_init", "ddr_init", 1132); } else { } return (retval); } else { } } else { } } else { } Adapter->bDDRInitDone = 1; return (retval); } } int download_ddr_settings(struct bcm_mini_adapter *Adapter ) { struct bcm_ddr_setting *psDDRSetting ; ULONG RegCount ; unsigned long ul_ddr_setting_load_addr ; UINT value ; int retval ; BOOLEAN bOverrideSelfRefresh ; int tmp ; int tmp___0 ; { psDDRSetting = 0; RegCount = 0UL; ul_ddr_setting_load_addr = 3217042176UL; value = 0U; retval = 0; bOverrideSelfRefresh = 0; switch (Adapter->chip_id) { case -1093783040: ; switch (Adapter->DDRSetting) { case 0: psDDRSetting = (struct bcm_ddr_setting *)(& asT3LP_DDRSetting80MHz); RegCount = 51UL; RegCount = RegCount - 9UL; psDDRSetting = psDDRSetting + 9UL; goto ldv_46895; case 1: psDDRSetting = (struct bcm_ddr_setting *)(& asT3LP_DDRSetting100MHz); RegCount = 52UL; RegCount = RegCount - 11UL; psDDRSetting = psDDRSetting + 11UL; goto ldv_46895; case 3: bOverrideSelfRefresh = 1; psDDRSetting = (struct bcm_ddr_setting *)(& asT3LP_DDRSetting133MHz); RegCount = 51UL; RegCount = RegCount - 9UL; psDDRSetting = psDDRSetting + 9UL; goto ldv_46895; default: ; return (-22); } ldv_46895: ; goto ldv_46903; case -1093782784: ; case -1093782767: ; case -1093782768: ; case -1093782783: ; case -1093782751: ; switch (Adapter->DDRSetting) { case 0: psDDRSetting = (struct bcm_ddr_setting *)(& asT3LPB_DDRSetting80MHz); RegCount = 52UL; RegCount = RegCount - 7UL; psDDRSetting = psDDRSetting + 7UL; goto ldv_46912; case 1: psDDRSetting = (struct bcm_ddr_setting *)(& asT3LPB_DDRSetting100MHz); RegCount = 53UL; RegCount = RegCount - 8UL; psDDRSetting = psDDRSetting + 8UL; goto ldv_46912; case 3: bOverrideSelfRefresh = 1; psDDRSetting = (struct bcm_ddr_setting *)(& asT3LPB_DDRSetting133MHz); RegCount = 52UL; RegCount = RegCount - 7UL; psDDRSetting = psDDRSetting + 7UL; goto ldv_46912; case 5: bOverrideSelfRefresh = 1; psDDRSetting = (struct bcm_ddr_setting *)(& asT3LPB_DDRSetting160MHz); RegCount = 52UL; RegCount = RegCount - 7UL; psDDRSetting = psDDRSetting + 7UL; goto ldv_46912; default: ; return (-22); } ldv_46912: ; goto ldv_46903; case -1093795072: ; switch (Adapter->DDRSetting) { case 0: psDDRSetting = (struct bcm_ddr_setting *)(& asT3_DDRSetting80MHz); RegCount = 46UL; RegCount = RegCount - 10UL; psDDRSetting = psDDRSetting + 10UL; goto ldv_46927; case 1: psDDRSetting = (struct bcm_ddr_setting *)(& asT3_DDRSetting100MHz); RegCount = 49UL; RegCount = RegCount - 13UL; psDDRSetting = psDDRSetting + 13UL; goto ldv_46927; case 3: psDDRSetting = (struct bcm_ddr_setting *)(& asT3_DDRSetting133MHz); RegCount = 49UL; RegCount = RegCount - 12UL; psDDRSetting = psDDRSetting + 12UL; goto ldv_46927; default: ; return (-22); } ldv_46927: ; goto ldv_46903; case -1093795056: ; switch (Adapter->DDRSetting) { case 0: psDDRSetting = (struct bcm_ddr_setting *)(& asT3B_DDRSetting80MHz); RegCount = 46UL; RegCount = RegCount - 9UL; psDDRSetting = psDDRSetting + 9UL; goto ldv_46939; case 1: psDDRSetting = (struct bcm_ddr_setting *)(& asT3B_DDRSetting100MHz); RegCount = 46UL; RegCount = RegCount - 9UL; psDDRSetting = psDDRSetting + 9UL; goto ldv_46939; case 3: bOverrideSelfRefresh = 1; psDDRSetting = (struct bcm_ddr_setting *)(& asT3B_DDRSetting133MHz); RegCount = 48UL; RegCount = RegCount - 11UL; psDDRSetting = psDDRSetting + 11UL; goto ldv_46939; } ldv_46939: ; goto ldv_46903; default: ; return (-22); } ldv_46903: value = (UINT )RegCount; retval = wrmalt(Adapter, (UINT )ul_ddr_setting_load_addr, & value, 4UL); if (retval != 0) { printk("\016%s:%s:%d\n", "download_ddr_settings", "download_ddr_settings", 1278); return (retval); } else { } ul_ddr_setting_load_addr = ul_ddr_setting_load_addr + 8UL; value = 488508880U; retval = wrmalt(Adapter, (UINT )ul_ddr_setting_load_addr, & value, 4UL); if (retval != 0) { printk("\016%s:%s:%d\n", "download_ddr_settings", "download_ddr_settings", 1288); return (retval); } else { } ul_ddr_setting_load_addr = ul_ddr_setting_load_addr + 8UL; RegCount = RegCount; goto ldv_46950; ldv_46949: value = psDDRSetting->ulRegAddress; retval = wrmalt(Adapter, (UINT )ul_ddr_setting_load_addr, & value, 4UL); ul_ddr_setting_load_addr = ul_ddr_setting_load_addr + 8UL; if (retval == 0) { if ((int )((signed char )bOverrideSelfRefresh) != 0 && psDDRSetting->ulRegAddress == 251686936U) { value = psDDRSetting->ulRegValue | 256U; tmp = wrmalt(Adapter, (UINT )ul_ddr_setting_load_addr, & value, 4UL); if (tmp != 0) { printk("\016%s:%s:%d\n", "download_ddr_settings", "download_ddr_settings", 1307); goto ldv_46948; } else { } } else { value = psDDRSetting->ulRegValue; tmp___0 = wrmalt(Adapter, (UINT )ul_ddr_setting_load_addr, & value, 4UL); if (tmp___0 != 0) { printk("\016%s:%s:%d\n", "download_ddr_settings", "download_ddr_settings", 1317); goto ldv_46948; } else { } } } else { } ul_ddr_setting_load_addr = ul_ddr_setting_load_addr + 8UL; RegCount = RegCount - 1UL; psDDRSetting = psDDRSetting + 1; ldv_46950: ; if (RegCount != 0UL && retval == 0) { goto ldv_46949; } else { goto ldv_46948; } ldv_46948: ; return (retval); } } void ldv_mutex_lock_177(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_178(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_179(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_device(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_180(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___2 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex_of_device(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_181(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_device(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_182(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_183(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } int ldv_mutex_trylock_194(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_192(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_195(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_197(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_191(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_193(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_196(struct mutex *ldv_func_arg1 ) ; 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->ldv_5961.rlock); } } __inline static void spin_unlock_irqrestore(spinlock_t *lock , unsigned long flags ) { { _raw_spin_unlock_irqrestore(& lock->ldv_5961.rlock, flags); return; } } extern void down(struct semaphore * ) ; extern void up(struct semaphore * ) ; extern struct sk_buff *skb_clone(struct sk_buff * , gfp_t ) ; VOID LinkControlResponseMessage(struct bcm_mini_adapter *Adapter , PUCHAR pucBuffer ) ; VOID StatisticsResponse(struct bcm_mini_adapter *Adapter , void *pvBuffer ) ; int control_packet_handler(struct bcm_mini_adapter *Adapter ) ; INT flushAllAppQ(void) ; static VOID handle_rx_control_packet(struct bcm_mini_adapter *Adapter , struct sk_buff *skb ) { struct bcm_tarang_data *pTarang ; BOOLEAN HighPriorityMessage ; struct sk_buff *newPacket ; CHAR cntrl_msg_mask_bit ; BOOLEAN drop_pkt_flag ; USHORT usStatus ; { pTarang = 0; HighPriorityMessage = 0; newPacket = 0; cntrl_msg_mask_bit = 0; drop_pkt_flag = 1; usStatus = *((unsigned short *)skb->data); if ((Adapter->msg_enable & 4096U) != 0U) { print_hex_dump("\017", "beceem rx control: ", 0, 16, 1, (void const *)skb->data, (size_t )skb->len, 0); } else { } switch ((int )usStatus) { case 160: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 512U) != 0U) { printk("\017%s:MAC Version Seems to be Non Multi-Classifier, rejected by Driver", "handle_rx_control_packet"); } else { } HighPriorityMessage = 1; goto ldv_46822; case 169: HighPriorityMessage = 1; if ((unsigned int )Adapter->LinkStatus == 4U) { CmControlResponseMessage(Adapter, (void *)skb->data + 2U); } else { } goto ldv_46822; case 162: ; case 161: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 512U) != 0U) { printk("\017%s:LINK_CONTROL_RESP", "handle_rx_control_packet"); } else { } HighPriorityMessage = 1; LinkControlResponseMessage(Adapter, skb->data + 2UL); goto ldv_46822; case 166: HighPriorityMessage = 1; StatisticsResponse(Adapter, (PVOID )skb->data + 2U); goto ldv_46822; case 163: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 512U) != 0U) { printk("\017%s:IDLE_MODE_STATUS Type Message Got from F/W", "handle_rx_control_packet"); } else { } InterfaceIdleModeRespond(Adapter, (unsigned int *)skb->data + 2U); HighPriorityMessage = 1; goto ldv_46822; case 168: HighPriorityMessage = 1; goto ldv_46822; default: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 512U) != 0U) { printk("\017%s:Got Default Response", "handle_rx_control_packet"); } else { } goto ldv_46822; } ldv_46822: down(& Adapter->RxAppControlQueuelock); pTarang = Adapter->pTarangs; goto ldv_46842; ldv_46841: ; if ((int )((signed char )Adapter->device_removed) != 0) { goto ldv_46830; } else { } drop_pkt_flag = 1; cntrl_msg_mask_bit = (int )((CHAR )usStatus) & 31; if ((pTarang->RxCntrlMsgBitMask & (ULONG )(1 << (int )cntrl_msg_mask_bit)) != 0UL) { drop_pkt_flag = 0; } else { } if (((int )((signed char )drop_pkt_flag) == 1 || pTarang->AppCtrlQueueLen > 200) || (pTarang->AppCtrlQueueLen > 100 && (int )((signed char )HighPriorityMessage) == 0)) { switch ((int )*((unsigned short *)skb->data)) { case 160: pTarang->stDroppedAppCntrlMsgs.cm_responses = pTarang->stDroppedAppCntrlMsgs.cm_responses + 1UL; goto ldv_46832; case 169: pTarang->stDroppedAppCntrlMsgs.cm_control_newdsx_multiclassifier_resp = pTarang->stDroppedAppCntrlMsgs.cm_control_newdsx_multiclassifier_resp + 1UL; goto ldv_46832; case 162: pTarang->stDroppedAppCntrlMsgs.link_control_resp = pTarang->stDroppedAppCntrlMsgs.link_control_resp + 1UL; goto ldv_46832; case 161: pTarang->stDroppedAppCntrlMsgs.status_rsp = pTarang->stDroppedAppCntrlMsgs.status_rsp + 1UL; goto ldv_46832; case 166: pTarang->stDroppedAppCntrlMsgs.stats_pointer_resp = pTarang->stDroppedAppCntrlMsgs.stats_pointer_resp + 1UL; goto ldv_46832; case 163: pTarang->stDroppedAppCntrlMsgs.idle_mode_status = pTarang->stDroppedAppCntrlMsgs.idle_mode_status + 1UL; goto ldv_46832; case 168: pTarang->stDroppedAppCntrlMsgs.auth_ss_host_msg = pTarang->stDroppedAppCntrlMsgs.auth_ss_host_msg + 1UL; goto ldv_46832; default: pTarang->stDroppedAppCntrlMsgs.low_priority_message = pTarang->stDroppedAppCntrlMsgs.low_priority_message + 1UL; goto ldv_46832; } ldv_46832: ; goto ldv_46840; } else { } newPacket = skb_clone(skb, 208U); if ((unsigned long )newPacket == (unsigned long )((struct sk_buff *)0)) { goto ldv_46830; } else { } if ((unsigned long )pTarang->RxAppControlHead == (unsigned long )((struct sk_buff *)0)) { pTarang->RxAppControlHead = newPacket; } else { (pTarang->RxAppControlTail)->next = newPacket; } newPacket->next = 0; pTarang->RxAppControlTail = newPacket; pTarang->AppCtrlQueueLen = pTarang->AppCtrlQueueLen + 1; ldv_46840: pTarang = pTarang->next; ldv_46842: ; if ((unsigned long )pTarang != (unsigned long )((struct bcm_tarang_data *)0)) { goto ldv_46841; } else { goto ldv_46830; } ldv_46830: up(& Adapter->RxAppControlQueuelock); __wake_up(& Adapter->process_read_wait_queue, 3U, 1, 0); consume_skb(skb); if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 512U) != 0U) { printk("\017%s:After wake_up_interruptible", "handle_rx_control_packet"); } else { } return; } } int control_packet_handler(struct bcm_mini_adapter *Adapter ) { struct sk_buff *ctrl_packet ; unsigned long flags ; int __ret ; wait_queue_t __wait ; struct task_struct *tmp ; int tmp___0 ; bool tmp___1 ; struct task_struct *tmp___2 ; int tmp___3 ; int tmp___4 ; bool tmp___5 ; int tmp___6 ; bool tmp___7 ; raw_spinlock_t *tmp___8 ; int tmp___9 ; { ctrl_packet = 0; flags = 0UL; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 512U) != 0U) { printk("\017%s:Entering to make thread wait on control packet event!", "control_packet_handler"); } else { } ldv_46862: __ret = 0; tmp___4 = atomic_read((atomic_t const *)(& Adapter->cntrlpktCnt)); if (tmp___4 == 0 && (int )((signed char )Adapter->bWakeUpDevice) == 0) { tmp___5 = kthread_should_stop(); if (tmp___5) { tmp___6 = 0; } else { tmp___6 = 1; } if (tmp___6) { tmp = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; ldv_46853: prepare_to_wait(& Adapter->process_rx_cntrlpkt, & __wait, 1); tmp___0 = atomic_read((atomic_t const *)(& Adapter->cntrlpktCnt)); if (tmp___0 != 0 || (int )((signed char )Adapter->bWakeUpDevice) != 0) { goto ldv_46851; } else { tmp___1 = kthread_should_stop(); if ((int )tmp___1) { goto ldv_46851; } else { } } tmp___2 = get_current(); tmp___3 = signal_pending(tmp___2); if (tmp___3 == 0) { schedule(); goto ldv_46852; } else { } __ret = -512; goto ldv_46851; ldv_46852: ; goto ldv_46853; ldv_46851: finish_wait(& Adapter->process_rx_cntrlpkt, & __wait); } else { } } else { } tmp___7 = kthread_should_stop(); if ((int )tmp___7) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 512U) != 0U) { printk("\017%s:Exiting\n", "control_packet_handler"); } else { } return (0); } else { } if ((int )((signed char )Adapter->bWakeUpDevice) == 1) { Adapter->bWakeUpDevice = 0; if ((int )((signed char )Adapter->bTriedToWakeUpFromlowPowerMode) == 0 && ((int )((signed char )Adapter->IdleMode) == 1 || (int )((signed char )Adapter->bShutStatus) == 1)) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 512U) != 0U) { printk("\017%s:Calling InterfaceAbortIdlemode\n", "control_packet_handler"); } else { } InterfaceIdleModeWakeup(Adapter); } else { } goto ldv_46855; } else { } goto ldv_46860; ldv_46859: tmp___8 = spinlock_check(& Adapter->control_queue_lock); flags = _raw_spin_lock_irqsave(tmp___8); ctrl_packet = Adapter->RxControlHead; if ((unsigned long )ctrl_packet != (unsigned long )((struct sk_buff *)0)) { if ((unsigned long )Adapter->RxControlHead != (unsigned long )((struct sk_buff *)0)) { if ((unsigned long )(Adapter->RxControlHead)->next == (unsigned long )((struct sk_buff *)0)) { Adapter->RxControlTail = 0; } else { } Adapter->RxControlHead = (Adapter->RxControlHead)->next; } else { } } else { } spin_unlock_irqrestore(& Adapter->control_queue_lock, flags); handle_rx_control_packet(Adapter, ctrl_packet); atomic_dec(& Adapter->cntrlpktCnt); ldv_46860: tmp___9 = atomic_read((atomic_t const *)(& Adapter->cntrlpktCnt)); if (tmp___9 != 0) { goto ldv_46859; } else { goto ldv_46861; } ldv_46861: SetUpTargetDsxBuffers(Adapter); ldv_46855: ; goto ldv_46862; return (0); } } INT flushAllAppQ(void) { struct bcm_mini_adapter *Adapter ; void *tmp ; struct bcm_tarang_data *pTarang ; struct sk_buff *PacketToDrop ; { tmp = netdev_priv((struct net_device const *)gblpnetdev); Adapter = (struct bcm_mini_adapter *)tmp; pTarang = 0; PacketToDrop = 0; pTarang = Adapter->pTarangs; goto ldv_46873; ldv_46872: ; goto ldv_46870; ldv_46869: PacketToDrop = pTarang->RxAppControlHead; if ((unsigned long )pTarang->RxAppControlHead != (unsigned long )((struct sk_buff *)0)) { if ((unsigned long )(pTarang->RxAppControlHead)->next == (unsigned long )((struct sk_buff *)0)) { pTarang->RxAppControlTail = 0; } else { } pTarang->RxAppControlHead = (pTarang->RxAppControlHead)->next; } else { } consume_skb(PacketToDrop); ldv_46870: ; if ((unsigned long )pTarang->RxAppControlHead != (unsigned long )((struct sk_buff *)0)) { goto ldv_46869; } else { goto ldv_46871; } ldv_46871: pTarang->AppCtrlQueueLen = 0; memset((void *)(& pTarang->stDroppedAppCntrlMsgs), 0, 64UL); pTarang = pTarang->next; ldv_46873: ; if ((unsigned long )pTarang != (unsigned long )((struct bcm_tarang_data *)0)) { goto ldv_46872; } else { goto ldv_46874; } ldv_46874: ; return (0); } } void ldv_mutex_lock_191(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_192(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_193(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_device(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_194(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___2 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex_of_device(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_195(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_device(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_196(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_197(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } int ldv_mutex_trylock_208(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_206(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_209(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_211(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_205(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_207(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_210(struct mutex *ldv_func_arg1 ) ; extern void do_gettimeofday(struct timeval * ) ; void update_per_cid_rx(struct bcm_mini_adapter *Adapter ) ; static VOID UpdateTokenCount(struct bcm_mini_adapter *Adapter ) { ULONG liCurrentTime ; INT i ; struct timeval tv ; size_t __len ; void *__ret ; { i = 0; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 256U) != 0U) { printk("\017%s:=====>\n", "UpdateTokenCount"); } else { } if ((unsigned long )Adapter == (unsigned long )((struct bcm_mini_adapter *)0)) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 256U) != 0U) { printk("\017%s:Adapter found NULL!\n", "UpdateTokenCount"); } else { } return; } else { } do_gettimeofday(& tv); i = 0; goto ldv_46821; ldv_46820: ; if ((int )((signed char )Adapter->PackInfo[i].bValid) == 1 && (unsigned int )Adapter->PackInfo[i].ucDirection == 1U) { liCurrentTime = (ULONG )((tv.tv_sec - Adapter->PackInfo[i].stLastUpdateTokenAt.tv_sec) * 1000L + (tv.tv_usec - Adapter->PackInfo[i].stLastUpdateTokenAt.tv_usec) / 1000L); if (liCurrentTime != 0UL) { Adapter->PackInfo[i].uiCurrentTokenCount = Adapter->PackInfo[i].uiCurrentTokenCount + (UINT )(((ULONG )Adapter->PackInfo[i].uiMaxAllowedRate * liCurrentTime) / 1000UL); __len = 16UL; if (__len > 63UL) { __ret = memcpy((void *)(& Adapter->PackInfo[i].stLastUpdateTokenAt), (void const *)(& tv), __len); } else { __ret = memcpy((void *)(& Adapter->PackInfo[i].stLastUpdateTokenAt), (void const *)(& tv), __len); } Adapter->PackInfo[i].liLastUpdateTokenAt = (LARGE_INTEGER )liCurrentTime; if (Adapter->PackInfo[i].uiCurrentTokenCount >= Adapter->PackInfo[i].uiMaxBucketSize) { Adapter->PackInfo[i].uiCurrentTokenCount = Adapter->PackInfo[i].uiMaxBucketSize; } else { } } else { } } else { } i = i + 1; ldv_46821: ; if (i <= 16) { goto ldv_46820; } else { goto ldv_46822; } ldv_46822: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 256U) != 0U) { printk("\017%s:<=====\n", "UpdateTokenCount"); } else { } return; } } static ULONG GetSFTokenCount(struct bcm_mini_adapter *Adapter , struct bcm_packet_info *psSF ) { { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 256U) != 0U) { printk("\017%s:IsPacketAllowedForFlow ===>", "GetSFTokenCount"); } else { } if ((unsigned long )Adapter == (unsigned long )((struct bcm_mini_adapter *)0) || ((unsigned long )((struct bcm_packet_info *)(& Adapter->PackInfo)) > (unsigned long )psSF && (unsigned long )psSF > (unsigned long )((struct bcm_packet_info *)(& Adapter->PackInfo) + 16UL))) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 256U) != 0U) { printk("\017%s:IPAFF: Got wrong Parameters:Adapter: %p, QIndex: %zd\n", "GetSFTokenCount", Adapter, ((long )psSF - (long )(& Adapter->PackInfo)) / 384L); } else { } return (0UL); } else { } if ((int )((signed char )psSF->bValid) != 0 && (unsigned int )psSF->ucDirection != 0U) { if (psSF->uiCurrentTokenCount != 0U) { return ((ULONG )psSF->uiCurrentTokenCount); } else { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 256U) != 0U) { printk("\017%s:Not enough tokens in queue %zd Available %u\n", "GetSFTokenCount", ((long )psSF - (long )(& Adapter->PackInfo)) / 384L, psSF->uiCurrentTokenCount); } else { } psSF->uiPendedLast = 1U; } } else if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 256U) != 0U) { printk("\017%s:IPAFF: Queue %zd not valid\n", "GetSFTokenCount", ((long )psSF - (long )(& Adapter->PackInfo)) / 384L); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 256U) != 0U) { printk("\017%s:IsPacketAllowedForFlow <===", "GetSFTokenCount"); } else { } return (0UL); } } static INT SendPacketFromQueue(struct bcm_mini_adapter *Adapter , struct bcm_packet_info *psSF , struct sk_buff *Packet ) { INT Status ; UINT uiIndex ; UINT PktLen ; { Status = -1; uiIndex = 0U; PktLen = 0U; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 65536U) != 0U) { printk("\017%s:=====>", "SendPacketFromQueue"); } else { } if (((unsigned long )Adapter == (unsigned long )((struct bcm_mini_adapter *)0) || (unsigned long )Packet == (unsigned long )((struct sk_buff *)0)) || (unsigned long )psSF == (unsigned long )((struct bcm_packet_info *)0)) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 65536U) != 0U) { printk("\017%s:Got NULL Adapter or Packet", "SendPacketFromQueue"); } else { } return (-22); } else { } if (psSF->liDrainCalculated == 0ULL) { psSF->liDrainCalculated = (LARGE_INTEGER )jiffies; } else { } PktLen = Packet->len; Status = SetupNextSend(Adapter, Packet, (int )psSF->usVCID_Value); if (Status == 0) { uiIndex = 0U; goto ldv_46838; ldv_46837: ; if ((uiIndex + 1U) * 128U >= PktLen && uiIndex * 128U < PktLen) { Adapter->aTxPktSizeHist[uiIndex] = Adapter->aTxPktSizeHist[uiIndex] + 1U; } else { } uiIndex = uiIndex + 1U; ldv_46838: ; if (uiIndex <= 11U) { goto ldv_46837; } else { goto ldv_46839; } ldv_46839: ; } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 65536U) != 0U) { printk("\017%s:<=====", "SendPacketFromQueue"); } else { } return (Status); } } static VOID CheckAndSendPacketFromIndex(struct bcm_mini_adapter *Adapter , struct bcm_packet_info *psSF ) { struct sk_buff *QueuePacket ; char *pControlPacket ; INT Status ; int iPacketLen ; int tmp___1 ; int tmp___2 ; ULONG tmp___3 ; int tmp___4 ; int tmp___5 ; int tmp___6 ; int tmp___7 ; int tmp___8 ; { QueuePacket = 0; pControlPacket = 0; Status = 0; iPacketLen = 0; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 1024U) != 0U) { printk("\017%s:%zd ====>", "CheckAndSendPacketFromIndex", ((long )psSF - (long )(& Adapter->PackInfo)) / 384L); } else { } if ((unsigned long )((struct bcm_packet_info *)(& Adapter->PackInfo) + 16UL) != (unsigned long )psSF && (int )((signed char )Adapter->LinkUpStatus) != 0) { tmp___8 = atomic_read((atomic_t const *)(& psSF->uiPerSFTxResourceCount)); if (tmp___8 != 0) { if ((unsigned int )psSF->ucDirection == 0U) { return; } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 1024U) != 0U) { printk("\017%s:UpdateTokenCount ", "CheckAndSendPacketFromIndex"); } else { } if ((int )((signed char )Adapter->IdleMode) != 0 || (int )((signed char )Adapter->bPreparingForLowPowerMode) != 0) { return; } else { } tmp___2 = atomic_read((atomic_t const *)(& Adapter->CurrNumFreeTxDesc)); if (tmp___2 <= 5) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 1024U) != 0U) { tmp___1 = atomic_read((atomic_t const *)(& Adapter->CurrNumFreeTxDesc)); printk("\017%s: No Free Tx Descriptor(%d) is available for Data pkt..", "CheckAndSendPacketFromIndex", tmp___1); } else { } return; } else { } spin_lock_bh(& psSF->SFQueueLock); QueuePacket = psSF->ldv_45950.ldv_45945.FirstTxQueue; if ((unsigned long )QueuePacket != (unsigned long )((struct sk_buff *)0)) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 1024U) != 0U) { printk("\017%s:Dequeuing Data Packet", "CheckAndSendPacketFromIndex"); } else { } if ((unsigned int )psSF->bEthCSSupport != 0U) { iPacketLen = (int )QueuePacket->len; } else { iPacketLen = (int )(QueuePacket->len - 14U); } iPacketLen = iPacketLen << 3; tmp___3 = GetSFTokenCount(Adapter, psSF); if ((ULONG )iPacketLen <= tmp___3) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 1024U) != 0U) { printk("\017%s:Allowed bytes %d", "CheckAndSendPacketFromIndex", iPacketLen >> 3); } else { } if ((unsigned long )psSF->ldv_45950.ldv_45945.FirstTxQueue != (unsigned long )((struct sk_buff *)0)) { if ((unsigned long )(psSF->ldv_45950.ldv_45945.FirstTxQueue)->next == (unsigned long )((struct sk_buff *)0)) { psSF->ldv_45950.ldv_45945.LastTxQueue = 0; } else { } psSF->ldv_45950.ldv_45945.FirstTxQueue = (psSF->ldv_45950.ldv_45945.FirstTxQueue)->next; } else { } psSF->uiCurrentBytesOnHost = psSF->uiCurrentBytesOnHost - QueuePacket->len; psSF->uiCurrentPacketsOnHost = psSF->uiCurrentPacketsOnHost - 1U; atomic_dec(& Adapter->TotalPacketCount); spin_unlock_bh(& psSF->SFQueueLock); Status = SendPacketFromQueue(Adapter, psSF, QueuePacket); psSF->uiPendedLast = 0U; } else { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 1024U) != 0U) { printk("\017%s:For Queue: %zd\n", "CheckAndSendPacketFromIndex", ((long )psSF - (long )(& Adapter->PackInfo)) / 384L); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 1024U) != 0U) { printk("\017%s:\nAvailable Tokens = %d required = %d\n", "CheckAndSendPacketFromIndex", psSF->uiCurrentTokenCount, iPacketLen); } else { } psSF->uiPendedLast = 1U; spin_unlock_bh(& psSF->SFQueueLock); } } else { spin_unlock_bh(& psSF->SFQueueLock); } } else { goto _L; } } else { _L: /* CIL Label */ tmp___5 = atomic_read((atomic_t const *)(& Adapter->CurrNumFreeTxDesc)); if (tmp___5 > 0) { tmp___6 = atomic_read((atomic_t const *)(& Adapter->index_rd_txcntrlpkt)); tmp___7 = atomic_read((atomic_t const *)(& Adapter->index_wr_txcntrlpkt)); if (tmp___6 != tmp___7) { tmp___4 = atomic_read((atomic_t const *)(& Adapter->index_rd_txcntrlpkt)); pControlPacket = Adapter->txctlpacket[tmp___4 % 100]; if ((unsigned long )pControlPacket != (unsigned long )((char *)0)) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 1024U) != 0U) { printk("\017%s:Sending Control packet", "CheckAndSendPacketFromIndex"); } else { } Status = SendControlPacket(Adapter, pControlPacket); if (Status == 0) { spin_lock_bh(& psSF->SFQueueLock); psSF->NumOfPacketsSent = psSF->NumOfPacketsSent + 1U; psSF->uiSentBytes = psSF->uiSentBytes + (UINT )((struct bcm_leader *)pControlPacket)->PLength; psSF->uiSentPackets = psSF->uiSentPackets + 1U; atomic_dec(& Adapter->TotalPacketCount); psSF->uiCurrentBytesOnHost = psSF->uiCurrentBytesOnHost - (UINT )((struct bcm_leader *)pControlPacket)->PLength; psSF->uiCurrentPacketsOnHost = psSF->uiCurrentPacketsOnHost - 1U; atomic_inc(& Adapter->index_rd_txcntrlpkt); spin_unlock_bh(& psSF->SFQueueLock); } else if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 1024U) != 0U) { printk("\017%s:SendControlPacket Failed\n", "CheckAndSendPacketFromIndex"); } else { } } else if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 1024U) != 0U) { printk("\017%s: Control Pkt is not available, Indexing is wrong....", "CheckAndSendPacketFromIndex"); } else { } } else { } } else { } } return; } } VOID transmit_packets(struct bcm_mini_adapter *Adapter ) { UINT uiPrevTotalCount ; int iIndex ; BOOLEAN exit_flag ; int tmp ; { uiPrevTotalCount = 0U; iIndex = 0; exit_flag = 1; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 1024U) != 0U) { printk("\017%s:=====>", "transmit_packets"); } else { } if ((unsigned long )Adapter == (unsigned long )((struct bcm_mini_adapter *)0)) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 1024U) != 0U) { printk("\017%s:Got NULL Adapter", "transmit_packets"); } else { } return; } else { } if ((int )((signed char )Adapter->device_removed) == 1) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 1024U) != 0U) { printk("\017%s:Device removed", "transmit_packets"); } else { } return; } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 1024U) != 0U) { printk("\017%s:\nUpdateTokenCount ====>\n", "transmit_packets"); } else { } UpdateTokenCount(Adapter); if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 1024U) != 0U) { printk("\017%s:\nPruneQueueAllSF ====>\n", "transmit_packets"); } else { } PruneQueueAllSF(Adapter); tmp = atomic_read((atomic_t const *)(& Adapter->TotalPacketCount)); uiPrevTotalCount = (UINT )tmp; iIndex = 16; goto ldv_46858; ldv_46857: ; if (uiPrevTotalCount == 0U || (int )((signed char )Adapter->device_removed) == 1) { goto ldv_46856; } else { } if (((int )((signed char )Adapter->PackInfo[iIndex].bValid) != 0 && Adapter->PackInfo[iIndex].uiPendedLast != 0U) && Adapter->PackInfo[iIndex].uiCurrentBytesOnHost != 0U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 1024U) != 0U) { printk("\017%s:Calling CheckAndSendPacketFromIndex..", "transmit_packets"); } else { } CheckAndSendPacketFromIndex(Adapter, (struct bcm_packet_info *)(& Adapter->PackInfo) + (unsigned long )iIndex); uiPrevTotalCount = uiPrevTotalCount - 1U; } else { } iIndex = iIndex - 1; ldv_46858: ; if (iIndex >= 0) { goto ldv_46857; } else { goto ldv_46856; } ldv_46856: ; goto ldv_46864; ldv_46863: exit_flag = 1; iIndex = 16; goto ldv_46861; ldv_46860: ; if (uiPrevTotalCount == 0U || (int )((signed char )Adapter->device_removed) == 1) { goto ldv_46859; } else { } if (((int )((signed char )Adapter->PackInfo[iIndex].bValid) != 0 && Adapter->PackInfo[iIndex].uiCurrentBytesOnHost != 0U) && Adapter->PackInfo[iIndex].uiPendedLast == 0U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 1024U) != 0U) { printk("\017%s:Calling CheckAndSendPacketFromIndex..", "transmit_packets"); } else { } CheckAndSendPacketFromIndex(Adapter, (struct bcm_packet_info *)(& Adapter->PackInfo) + (unsigned long )iIndex); uiPrevTotalCount = uiPrevTotalCount - 1U; exit_flag = 0; } else { } iIndex = iIndex - 1; ldv_46861: ; if (iIndex >= 0) { goto ldv_46860; } else { goto ldv_46859; } ldv_46859: ; if ((int )((signed char )Adapter->IdleMode) != 0 || (int )((signed char )Adapter->bPreparingForLowPowerMode) != 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 1024U) != 0U) { printk("\017%s:In Idle Mode\n", "transmit_packets"); } else { } goto ldv_46862; } else { } if ((int )((signed char )exit_flag) == 1) { goto ldv_46862; } else { } ldv_46864: ; if (uiPrevTotalCount != 0U && (int )((signed char )Adapter->device_removed) == 0) { goto ldv_46863; } else { goto ldv_46862; } ldv_46862: update_per_cid_rx(Adapter); Adapter->txtransmit_running = 0U; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 1024U) != 0U) { printk("\017%s:<======", "transmit_packets"); } else { } return; } } void ldv_mutex_lock_205(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_206(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_207(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_device(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_208(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___2 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex_of_device(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_209(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_device(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_210(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_211(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } int ldv_mutex_trylock_222(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_220(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_223(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_225(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_219(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_221(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_224(struct mutex *ldv_func_arg1 ) ; extern void __raw_spin_lock_init(raw_spinlock_t * , char const * , struct lock_class_key * ) ; extern void __init_waitqueue_head(wait_queue_head_t * , char const * , struct lock_class_key * ) ; __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.ldv_2024.head_tail = 0U; __constr_expr_0.lock.magic = 3735899821U; __constr_expr_0.lock.owner_cpu = 4294967295U; __constr_expr_0.lock.owner = 0xffffffffffffffffUL; __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 int down_trylock(struct semaphore * ) ; extern struct file *filp_open(char const * , int , umode_t ) ; extern int filp_close(struct file * , fl_owner_t ) ; extern int kernel_read(struct file * , loff_t , char * , unsigned long ) ; extern loff_t vfs_llseek(struct file * , loff_t , int ) ; extern int wake_up_process(struct task_struct * ) ; extern void free_netdev(struct net_device * ) ; void ldv_free_netdev_226(struct net_device *dev ) ; extern struct task_struct *kthread_create_on_node(int (*)(void * ) , void * , int , char const * , ...) ; extern int kthread_stop(struct task_struct * ) ; int phs_init(PPHS_DEVICE_EXTENSION pPhsdeviceExtension , struct bcm_mini_adapter *Adapter ) ; int PhsCleanup(PPHS_DEVICE_EXTENSION pPHSDeviceExt ) ; void unregister_control_device_interface(struct bcm_mini_adapter *Adapter ) ; int run_card_proc(struct bcm_mini_adapter *ps_adapter ) ; void DumpPackInfo(struct bcm_mini_adapter *Adapter ) ; VOID ResetCounters(struct bcm_mini_adapter *Adapter ) ; INT BcmAllocFlashCSStructure(struct bcm_mini_adapter *psAdapter ) ; INT BcmDeAllocFlashCSStructure(struct bcm_mini_adapter *psAdapter ) ; int wrmaltWithLock(struct bcm_mini_adapter *Adapter , unsigned int uiAddress , unsigned int *pucBuff , size_t size ) ; int rdmaltWithLock(struct bcm_mini_adapter *Adapter , unsigned int uiAddress , unsigned int *pucBuff , size_t size ) ; int wrmWithLock(struct bcm_mini_adapter *Adapter , unsigned int uiAddress , PCHAR pucBuff , size_t sSize ) ; INT vendorextnExit(struct bcm_mini_adapter *Adapter ) ; INT vendorextnInit(struct bcm_mini_adapter *Adapter ) ; static int BcmFileDownload(struct bcm_mini_adapter *Adapter , char const *path , unsigned int loc ) ; static void doPowerAutoCorrection(struct bcm_mini_adapter *psAdapter ) ; static void HandleShutDownModeRequest(struct bcm_mini_adapter *Adapter , PUCHAR pucBuffer ) ; static int bcm_parse_target_params(struct bcm_mini_adapter *Adapter ) ; static void beceem_protocol_reset(struct bcm_mini_adapter *Adapter ) ; static void default_wimax_protocol_initialize(struct bcm_mini_adapter *Adapter ) { unsigned int uiLoopIndex ; { uiLoopIndex = 0U; goto ldv_46832; ldv_46831: Adapter->PackInfo[uiLoopIndex].uiThreshold = 10U; Adapter->PackInfo[uiLoopIndex].uiMaxAllowedRate = 104857600U; Adapter->PackInfo[uiLoopIndex].uiMaxBucketSize = 20971520U; uiLoopIndex = uiLoopIndex + 1U; ldv_46832: ; if (uiLoopIndex <= 15U) { goto ldv_46831; } else { goto ldv_46833; } ldv_46833: Adapter->BEBucketSize = 104857600UL; Adapter->rtPSBucketSize = 104857600UL; Adapter->LinkStatus = 1U; Adapter->TransferMode = 0; Adapter->usBestEffortQueueIndex = 65535U; return; } } int InitAdapter(struct bcm_mini_adapter *psAdapter ) { int i ; int Status ; 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 ; void *tmp ; int tmp___0 ; int tmp___1 ; { i = 0; Status = 0; if ((((unsigned long )psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && psAdapter->stDebugState.debug_level > 6U) && (int )psAdapter->stDebugState.type & 1) && (psAdapter->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:Initialising Adapter = %p", "InitAdapter", psAdapter); } else { } if ((unsigned long )psAdapter == (unsigned long )((struct bcm_mini_adapter *)0)) { if ((((unsigned long )psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && psAdapter->stDebugState.debug_level > 6U) && (int )psAdapter->stDebugState.type & 1) && (psAdapter->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:Adapter is NULL", "InitAdapter"); } else { } return (-22); } else { } sema_init(& psAdapter->NVMRdmWrmLock, 1); sema_init(& psAdapter->rdmwrmsync, 1); spinlock_check(& psAdapter->control_queue_lock); __raw_spin_lock_init(& psAdapter->control_queue_lock.ldv_5961.rlock, "&(&psAdapter->control_queue_lock)->rlock", & __key); spinlock_check(& psAdapter->txtransmitlock); __raw_spin_lock_init(& psAdapter->txtransmitlock.ldv_5961.rlock, "&(&psAdapter->txtransmitlock)->rlock", & __key___0); sema_init(& psAdapter->RxAppControlQueuelock, 1); sema_init(& psAdapter->fw_download_sema, 1); sema_init(& psAdapter->LowPowerModeSync, 1); i = 0; goto ldv_46844; ldv_46843: spinlock_check(& psAdapter->PackInfo[i].SFQueueLock); __raw_spin_lock_init(& psAdapter->PackInfo[i].SFQueueLock.ldv_5961.rlock, "&(&psAdapter->PackInfo[i].SFQueueLock)->rlock", & __key___1); i = i + 1; ldv_46844: ; if (i <= 16) { goto ldv_46843; } else { goto ldv_46845; } ldv_46845: i = 0; __init_waitqueue_head(& psAdapter->process_rx_cntrlpkt, "&psAdapter->process_rx_cntrlpkt", & __key___2); __init_waitqueue_head(& psAdapter->tx_packet_wait_queue, "&psAdapter->tx_packet_wait_queue", & __key___3); __init_waitqueue_head(& psAdapter->process_read_wait_queue, "&psAdapter->process_read_wait_queue", & __key___4); __init_waitqueue_head(& psAdapter->ioctl_fw_dnld_wait_queue, "&psAdapter->ioctl_fw_dnld_wait_queue", & __key___5); __init_waitqueue_head(& psAdapter->lowpower_mode_wait_queue, "&psAdapter->lowpower_mode_wait_queue", & __key___6); psAdapter->waiting_to_fw_download_done = 1; psAdapter->fw_download_done = 0; default_wimax_protocol_initialize(psAdapter); i = 0; goto ldv_46852; ldv_46851: tmp = kmalloc(2048UL, 208U); psAdapter->txctlpacket[i] = (char *)tmp; if ((unsigned long )psAdapter->txctlpacket[i] == (unsigned long )((char *)0)) { if ((((unsigned long )psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && psAdapter->stDebugState.debug_level > 6U) && (int )psAdapter->stDebugState.type & 1) && (psAdapter->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:No More Cntl pkts got, max got is %d", "InitAdapter", i); } else { } return (-12); } else { } i = i + 1; ldv_46852: ; if (i <= 99) { goto ldv_46851; } else { goto ldv_46853; } ldv_46853: tmp___0 = AllocAdapterDsxBuffer(psAdapter); if (tmp___0 != 0) { if ((((unsigned long )psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && psAdapter->stDebugState.debug_level > 6U) && (int )psAdapter->stDebugState.type & 1) && (psAdapter->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:Failed to allocate DSX buffers", "InitAdapter"); } else { } return (-22); } else { } tmp___1 = phs_init(& psAdapter->stBCMPhsContext, psAdapter); if (tmp___1 != 0) { if ((((unsigned long )psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && psAdapter->stDebugState.debug_level > 6U) && (int )psAdapter->stDebugState.type & 1) && (psAdapter->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:%s:%s:%d:Error PHS Init Failed=====>\n", "InitAdapter", (char *)"/work/ldvuser/zakharov_benchmarks/bench/cpa/work/current--X--drivers/staging/bcm/bcm_wimax.ko--X--x1linux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/34/dscv_tempdir/dscv/ri/32_7a/drivers/staging/bcm/Misc.c.prepared", "InitAdapter", 114); } else { } return (-12); } else { } Status = BcmAllocFlashCSStructure(psAdapter); if (Status != 0) { if ((((unsigned long )psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && psAdapter->stDebugState.debug_level > 6U) && (int )psAdapter->stDebugState.type & 1) && (psAdapter->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:Memory Allocation for Flash structure failed", "InitAdapter"); } else { } return (Status); } else { } Status = vendorextnInit(psAdapter); if (Status != 0) { if ((((unsigned long )psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && psAdapter->stDebugState.debug_level > 6U) && (int )psAdapter->stDebugState.type & 1) && (psAdapter->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:Vendor Init Failed", "InitAdapter"); } else { } return (Status); } else { } if ((((unsigned long )psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && psAdapter->stDebugState.debug_level > 6U) && (int )psAdapter->stDebugState.type & 1) && (psAdapter->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:Adapter initialised", "InitAdapter"); } else { } return (0); } } VOID AdapterFree(struct bcm_mini_adapter *Adapter ) { int count ; long tmp ; long tmp___0 ; int tmp___3 ; int tmp___4 ; { beceem_protocol_reset(Adapter); vendorextnExit(Adapter); if ((unsigned long )Adapter->control_packet_handler != (unsigned long )((struct task_struct *)0)) { tmp = IS_ERR((void const *)Adapter->control_packet_handler); if (tmp == 0L) { kthread_stop(Adapter->control_packet_handler); } else { } } else { } if ((unsigned long )Adapter->transmit_packet_thread != (unsigned long )((struct task_struct *)0)) { tmp___0 = IS_ERR((void const *)Adapter->transmit_packet_thread); if (tmp___0 == 0L) { kthread_stop(Adapter->transmit_packet_thread); } else { } } else { } __wake_up(& Adapter->process_read_wait_queue, 3U, 1, 0); if ((Adapter->LEDInfo.led_thread_running & 3) != 0) { kthread_stop(Adapter->LEDInfo.led_cntrl_threadid); } else { } unregister_networkdev(Adapter); goto ldv_46860; ldv_46859: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (Adapter->stDebugState.subtype[1] & 2U) != 0U) { tmp___3 = atomic_read((atomic_t const *)(& Adapter->ApplicationRunning)); printk("\017%s:Waiting for Application to close.. %d\n", "AdapterFree", tmp___3); } else { } msleep(100U); ldv_46860: tmp___4 = atomic_read((atomic_t const *)(& Adapter->ApplicationRunning)); if (tmp___4 != 0) { goto ldv_46859; } else { goto ldv_46861; } ldv_46861: unregister_control_device_interface(Adapter); kfree((void const *)Adapter->pstargetparams); count = 0; goto ldv_46863; ldv_46862: kfree((void const *)Adapter->txctlpacket[count]); count = count + 1; ldv_46863: ; if (count <= 99) { goto ldv_46862; } else { goto ldv_46864; } ldv_46864: FreeAdapterDsxBuffer(Adapter); kfree((void const *)Adapter->pvInterfaceAdapter); PhsCleanup(& Adapter->stBCMPhsContext); BcmDeAllocFlashCSStructure(Adapter); ldv_free_netdev_226(Adapter->dev); return; } } static int create_worker_threads(struct bcm_mini_adapter *psAdapter ) { struct task_struct *__k ; struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; struct task_struct *__k___0 ; struct task_struct *tmp___3 ; long tmp___4 ; long tmp___5 ; long tmp___6 ; { tmp = kthread_create_on_node((int (*)(void * ))(& control_packet_handler), (void *)psAdapter, -1, "%s-rx", (char *)"beceem"); __k = tmp; tmp___0 = IS_ERR((void const *)__k); if (tmp___0 == 0L) { wake_up_process(__k); } else { } psAdapter->control_packet_handler = __k; tmp___2 = IS_ERR((void const *)psAdapter->control_packet_handler); if (tmp___2 != 0L) { printk("\rbeceem: could not create control thread\n"); tmp___1 = PTR_ERR((void const *)psAdapter->control_packet_handler); return ((int )tmp___1); } else { } tmp___3 = kthread_create_on_node((int (*)(void * ))(& tx_pkt_handler), (void *)psAdapter, -1, "%s-tx", (char *)"beceem"); __k___0 = tmp___3; tmp___4 = IS_ERR((void const *)__k___0); if (tmp___4 == 0L) { wake_up_process(__k___0); } else { } psAdapter->transmit_packet_thread = __k___0; tmp___6 = IS_ERR((void const *)psAdapter->transmit_packet_thread); if (tmp___6 != 0L) { printk("\rbeceem: could not creat transmit thread\n"); kthread_stop(psAdapter->control_packet_handler); tmp___5 = PTR_ERR((void const *)psAdapter->transmit_packet_thread); return ((int )tmp___5); } else { } return (0); } } static struct file *open_firmware_file(struct bcm_mini_adapter *Adapter , char const *path ) { struct file *flp ; struct file *tmp ; long tmp___0 ; long tmp___1 ; { tmp = filp_open(path, 0, 448); flp = tmp; tmp___1 = IS_ERR((void const *)flp); if (tmp___1 != 0L) { tmp___0 = PTR_ERR((void const *)flp); printk("\vbeceemUnable To Open File %s, err %ld", path, tmp___0); flp = 0; } else { } if ((int )((signed char )Adapter->device_removed) != 0) { flp = 0; } else { } return (flp); } } static int BcmFileDownload(struct bcm_mini_adapter *Adapter , char const *path , unsigned int loc ) { int errorno ; struct file *flp ; struct timeval tv ; int tmp ; int tmp___0 ; { errorno = 0; flp = 0; tv.tv_sec = 0L; tv.tv_usec = 0L; flp = open_firmware_file(Adapter, path); if ((unsigned long )flp == (unsigned long )((struct file *)0)) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (Adapter->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:Unable to Open %s\n", "BcmFileDownload", path); } else { } return (-2); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (Adapter->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:Opened file is = %s and length =0x%lx to be downloaded at =0x%x", "BcmFileDownload", path, (unsigned long )((flp->f_path.dentry)->d_inode)->i_size, loc); } else { } do_gettimeofday(& tv); if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (Adapter->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:download start %lx", "BcmFileDownload", tv.tv_sec * 1000L + tv.tv_usec / 1000L); } else { } tmp = (*(Adapter->bcm_file_download))(Adapter->pvInterfaceAdapter, flp, loc); if (tmp != 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (Adapter->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:Failed to download the firmware with error %x!!!", "BcmFileDownload", -5); } else { } errorno = -5; goto exit_download; } else { } vfs_llseek(flp, 0LL, 0); tmp___0 = (*(Adapter->bcm_file_readback_from_chip))(Adapter->pvInterfaceAdapter, flp, loc); if (tmp___0 != 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (Adapter->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:Failed to read back firmware!", "BcmFileDownload"); } else { } errorno = -5; goto exit_download; } else { } exit_download: filp_close(flp, 0); return (errorno); } } INT CopyBufferToControlPacket(struct bcm_mini_adapter *Adapter , void *ioBuffer ) { struct bcm_leader *pLeader ; int Status ; unsigned char *ctrl_buff ; unsigned int pktlen ; struct bcm_link_request *pLinkReq ; PUCHAR pucAddIndication ; long __ret ; wait_queue_t __wait ; struct task_struct *tmp ; struct task_struct *tmp___0 ; int tmp___1 ; long __ret___0 ; wait_queue_t __wait___0 ; struct task_struct *tmp___2 ; struct task_struct *tmp___3 ; int tmp___4 ; int tmp___5 ; int tmp___8 ; unsigned long tmp___9 ; size_t __len ; void *__ret___1 ; { pLeader = 0; Status = 0; pktlen = 0U; pLinkReq = 0; pucAddIndication = 0; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8U) != 0U) { printk("\017%s:======>", "CopyBufferToControlPacket"); } else { } if ((unsigned long )ioBuffer == (unsigned long )((void *)0)) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8U) != 0U) { printk("\017%s:Got Null Buffer\n", "CopyBufferToControlPacket"); } else { } return (-22); } else { } pLinkReq = (struct bcm_link_request *)ioBuffer; pLeader = (struct bcm_leader *)ioBuffer; if (((int )((signed char )Adapter->bShutStatus) == 1 && (unsigned int )pLinkReq->szData[0] == 226U) && (unsigned int )pLinkReq->szData[1] == 1U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8U) != 0U) { printk("\017%s:SYNC DOWN Request in Shut Down Mode..\n", "CopyBufferToControlPacket"); } else { } return (-1); } else { } if ((unsigned int )pLeader->Status == 131U && (((unsigned int )pLinkReq->szData[0] == 245U && (unsigned int )pLinkReq->szData[1] == 1U) || (unsigned int )pLinkReq->szData[0] == 198U)) { if ((unsigned int )Adapter->LinkStatus > 2U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8U) != 0U) { printk("\017%s:LinkStatus is Greater than PHY_SYN_ACHIEVED", "CopyBufferToControlPacket"); } else { } return (-1); } else { } if ((int )((signed char )Adapter->bShutStatus) == 1) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8U) != 0U) { printk("\017%s:SYNC UP IN SHUTDOWN..Device WakeUp\n", "CopyBufferToControlPacket"); } else { } if ((int )((signed char )Adapter->bTriedToWakeUpFromlowPowerMode) == 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8U) != 0U) { printk("\017%s:Waking up for the First Time..\n", "CopyBufferToControlPacket"); } else { } Adapter->usIdleModePattern = 1U; Adapter->bWakeUpDevice = 1; __wake_up(& Adapter->process_rx_cntrlpkt, 3U, 1, 0); __ret = 1250L; if ((int )((signed char )Adapter->bShutStatus) != 0) { tmp = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; ldv_46904: prepare_to_wait(& Adapter->lowpower_mode_wait_queue, & __wait, 1); if ((int )((signed char )Adapter->bShutStatus) == 0) { goto ldv_46902; } else { } tmp___0 = get_current(); tmp___1 = signal_pending(tmp___0); if (tmp___1 == 0) { __ret = schedule_timeout(__ret); if (__ret == 0L) { goto ldv_46902; } else { } goto ldv_46903; } else { } __ret = -512L; goto ldv_46902; ldv_46903: ; goto ldv_46904; ldv_46902: finish_wait(& Adapter->lowpower_mode_wait_queue, & __wait); } else { } Status = (int )__ret; if (Status == -512) { return (Status); } else { } if ((int )((signed char )Adapter->bShutStatus) != 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8U) != 0U) { printk("\017%s:Shutdown Mode Wake up Failed - No Wake Up Received\n", "CopyBufferToControlPacket"); } else { } return (-1); } else { } } else if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8U) != 0U) { printk("\017%s:Wakeup has been tried already...\n", "CopyBufferToControlPacket"); } else { } } else { } } else { } if ((int )((signed char )Adapter->IdleMode) == 1) { if (((unsigned int )pLeader->Status == 131U || (unsigned int )pLeader->Status == 128U) || (unsigned int )pLeader->Status == 137U) { if ((unsigned int )pLeader->Status == 131U && (unsigned int )pLinkReq->szData[0] == 226U) { if ((unsigned int )pLinkReq->szData[1] == 1U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8U) != 0U) { printk("\017%s:Link Down Sent in Idle Mode\n", "CopyBufferToControlPacket"); } else { } Adapter->usIdleModePattern = 3U; } else { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8U) != 0U) { printk("\017%s:ABORT_IDLE_MODE pattern is being written\n", "CopyBufferToControlPacket"); } else { } Adapter->usIdleModePattern = 1U; } } else { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8U) != 0U) { printk("\017%s:ABORT_IDLE_MODE pattern is being written\n", "CopyBufferToControlPacket"); } else { } Adapter->usIdleModePattern = 2U; } Adapter->bWakeUpDevice = 1; __wake_up(& Adapter->process_rx_cntrlpkt, 3U, 1, 0); if ((unsigned int )pLinkReq->szData[0] == 226U) { return (0); } else { } __ret___0 = 1250L; if ((int )((signed char )Adapter->IdleMode) != 0) { tmp___2 = get_current(); __wait___0.flags = 0U; __wait___0.private = (void *)tmp___2; __wait___0.func = & autoremove_wake_function; __wait___0.task_list.next = & __wait___0.task_list; __wait___0.task_list.prev = & __wait___0.task_list; ldv_46910: prepare_to_wait(& Adapter->lowpower_mode_wait_queue, & __wait___0, 1); if ((int )((signed char )Adapter->IdleMode) == 0) { goto ldv_46908; } else { } tmp___3 = get_current(); tmp___4 = signal_pending(tmp___3); if (tmp___4 == 0) { __ret___0 = schedule_timeout(__ret___0); if (__ret___0 == 0L) { goto ldv_46908; } else { } goto ldv_46909; } else { } __ret___0 = -512L; goto ldv_46908; ldv_46909: ; goto ldv_46910; ldv_46908: finish_wait(& Adapter->lowpower_mode_wait_queue, & __wait___0); } else { } Status = (int )__ret___0; if (Status == -512) { return (Status); } else { } if ((int )((signed char )Adapter->IdleMode) != 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8U) != 0U) { printk("\017%s:Idle Mode Wake up Failed - No Wake Up Received\n", "CopyBufferToControlPacket"); } else { } return (-1); } else { } } else { return (0); } } else { } pLeader->Vcid = 0U; pktlen = (unsigned int )pLeader->PLength; tmp___5 = atomic_read((atomic_t const *)(& Adapter->index_wr_txcntrlpkt)); ctrl_buff = (unsigned char *)Adapter->txctlpacket[tmp___5 % 100]; if ((unsigned long )ctrl_buff == (unsigned long )((unsigned char *)0)) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8U) != 0U) { printk("\017%s:mem allocation Failed", "CopyBufferToControlPacket"); } else { } return (-12); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8U) != 0U) { tmp___8 = atomic_read((atomic_t const *)(& Adapter->index_wr_txcntrlpkt)); printk("\017%s:Control packet to be taken =%d and address is =%pincoming address is =%p and packet len=%x", "CopyBufferToControlPacket", tmp___8, ctrl_buff, ioBuffer, pktlen); } else { } if ((unsigned long )pLeader != (unsigned long )((struct bcm_leader *)0)) { if ((unsigned int )pLeader->Status == 128U || (unsigned int )pLeader->Status == 137U) { pucAddIndication = (unsigned char *)ioBuffer + 8UL; pktlen = (unsigned int )pLeader->PLength; tmp___9 = StoreCmControlResponseMessage(Adapter, (void *)pucAddIndication, & pktlen); Status = (int )tmp___9; if (Status != 1) { ClearTargetDSXBuffer(Adapter, (int )((struct bcm_add_indication_alt *)pucAddIndication)->u16TID, 0); if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8U) != 0U) { printk("\017%s: Error Restoring The DSX Control Packet. Dsx Buffers on Target may not be Setup Properly ", "CopyBufferToControlPacket"); } else { } return (-1); } else { } pLeader->PLength = (USHORT )pktlen; } else { } } else { } if ((unsigned long )pktlen + 8UL > 2048UL) { return (-22); } else { } memset((void *)ctrl_buff, 0, (unsigned long )pktlen + 8UL); if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8U) != 0U) { printk("\017%s:Copying the Control Packet Buffer with length=%d\n", "CopyBufferToControlPacket", (int )pLeader->PLength); } else { } *((struct bcm_leader *)ctrl_buff) = *pLeader; __len = (size_t )pLeader->PLength; __ret___1 = memcpy((void *)ctrl_buff + 8U, (void const *)ioBuffer + 8U, __len); if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8U) != 0U) { printk("\017%s:Enqueuing the Control Packet", "CopyBufferToControlPacket"); } else { } spin_lock_bh(& Adapter->PackInfo[16].SFQueueLock); Adapter->PackInfo[16].uiCurrentBytesOnHost = Adapter->PackInfo[16].uiCurrentBytesOnHost + (UINT )pLeader->PLength; Adapter->PackInfo[16].uiCurrentPacketsOnHost = Adapter->PackInfo[16].uiCurrentPacketsOnHost + 1U; atomic_inc(& Adapter->TotalPacketCount); spin_unlock_bh(& Adapter->PackInfo[16].SFQueueLock); Adapter->PackInfo[16].bValid = 1; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8U) != 0U) { printk("\017%s:CurrBytesOnHost: %x bValid: %x", "CopyBufferToControlPacket", Adapter->PackInfo[16].uiCurrentBytesOnHost, (int )Adapter->PackInfo[16].bValid); } else { } Status = 0; atomic_inc(& Adapter->index_wr_txcntrlpkt); if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8U) != 0U) { printk("\017%s:Calling transmit_packets", "CopyBufferToControlPacket"); } else { } atomic_set(& Adapter->TxPktAvail, 1); __wake_up(& Adapter->tx_packet_wait_queue, 3U, 1, 0); if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8U) != 0U) { printk("\017%s:<====", "CopyBufferToControlPacket"); } else { } return (Status); } } VOID LinkMessage(struct bcm_mini_adapter *Adapter ) { struct bcm_link_request *pstLinkRequest ; void *tmp ; void *tmp___0 ; { pstLinkRequest = 0; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 256U) != 0U) { printk("\017%s:=====>", "LinkMessage"); } else { } if ((unsigned int )Adapter->LinkStatus == 1U && (int )((signed char )Adapter->AutoSyncup) != 0) { tmp = kzalloc(12UL, 32U); pstLinkRequest = (struct bcm_link_request *)tmp; if ((unsigned long )pstLinkRequest == (unsigned long )((struct bcm_link_request *)0)) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 256U) != 0U) { printk("\017%s:Can not allocate memory for Link request!", "LinkMessage"); } else { } return; } else { } Adapter->LinkStatus = 1U; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 256U) != 0U) { printk("\017%s:Requesting For SyncUp...", "LinkMessage"); } else { } pstLinkRequest->szData[0] = 245U; pstLinkRequest->szData[1] = 1U; pstLinkRequest->Leader.Status = 131U; pstLinkRequest->Leader.PLength = 8U; Adapter->bSyncUpRequestSent = 1; } else if ((unsigned int )Adapter->LinkStatus == 2U && (int )((signed char )Adapter->AutoLinkUp) != 0) { tmp___0 = kzalloc(12UL, 32U); pstLinkRequest = (struct bcm_link_request *)tmp___0; if ((unsigned long )pstLinkRequest == (unsigned long )((struct bcm_link_request *)0)) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 256U) != 0U) { printk("\017%s:Can not allocate memory for Link request!", "LinkMessage"); } else { } return; } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 256U) != 0U) { printk("\017%s:Requesting For LinkUp...", "LinkMessage"); } else { } pstLinkRequest->szData[0] = 245U; pstLinkRequest->szData[1] = 2U; pstLinkRequest->Leader.Status = 131U; pstLinkRequest->Leader.PLength = 8U; } else { } if ((unsigned long )pstLinkRequest != (unsigned long )((struct bcm_link_request *)0)) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 256U) != 0U) { printk("\017%s:Calling CopyBufferToControlPacket", "LinkMessage"); } else { } CopyBufferToControlPacket(Adapter, (void *)pstLinkRequest); kfree((void const *)pstLinkRequest); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 256U) != 0U) { printk("\017%s:LinkMessage <=====", "LinkMessage"); } else { } return; } } VOID StatisticsResponse(struct bcm_mini_adapter *Adapter , void *pvBuffer ) { __u32 tmp ; { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:%s====>", "StatisticsResponse", "StatisticsResponse"); } else { } tmp = __fswab32(*((__be32 *)pvBuffer)); Adapter->StatisticsPointer = tmp; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:Stats at %x", "StatisticsResponse", Adapter->StatisticsPointer); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:%s <====", "StatisticsResponse", "StatisticsResponse"); } else { } return; } } VOID LinkControlResponseMessage(struct bcm_mini_adapter *Adapter , PUCHAR pucBuffer ) { PUCHAR puMacAddr ; size_t __len ; void *__ret ; { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 4U) != 0U) && (int )Adapter->stDebugState.subtype[4] & 1) { printk("\017%s:=====>", "LinkControlResponseMessage"); } else { } if ((unsigned int )*pucBuffer == 246U) { switch ((int )*(pucBuffer + 1UL)) { case 2: printk("\016%s:PHY_SYNC_ACHIVED", "LinkControlResponseMessage"); if ((unsigned int )Adapter->LinkStatus == 4U) { beceem_protocol_reset(Adapter); } else { } Adapter->usBestEffortQueueIndex = 17U; Adapter->LinkStatus = 2U; if (Adapter->LEDInfo.led_thread_running & 1) { Adapter->DriverState = 8; __wake_up(& Adapter->LEDInfo.notify_led_event, 3U, 1, 0); } else { } LinkMessage(Adapter); goto ldv_46931; case 4: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 4U) != 0U) && (int )Adapter->stDebugState.subtype[4] & 1) { printk("\017%s:LINKUP_DONE", "LinkControlResponseMessage"); } else { } Adapter->LinkStatus = 4U; Adapter->bPHSEnabled = *(pucBuffer + 3UL); Adapter->bETHCSEnabled = (int )((BOOLEAN )*(pucBuffer + 4UL)) & 63; printk("\016%s:PHS Support Status Received In LinkUp Ack : %x\n", "LinkControlResponseMessage", (int )Adapter->bPHSEnabled); if ((int )((signed char )Adapter->bShutStatus) == 0 && (int )((signed char )Adapter->IdleMode) == 0) { if (Adapter->LEDInfo.led_thread_running & 1) { Adapter->DriverState = 16; __wake_up(& Adapter->LEDInfo.notify_led_event, 3U, 1, 0); } else { } } else { } LinkMessage(Adapter); goto ldv_46931; case 1: Adapter->LinkUpStatus = 0; Adapter->LinkStatus = 0U; Adapter->usBestEffortQueueIndex = 17U; Adapter->bTriedToWakeUpFromlowPowerMode = 0; Adapter->IdleMode = 0; beceem_protocol_reset(Adapter); goto ldv_46931; case 8: ; case 9: HandleShutDownModeRequest(Adapter, pucBuffer); goto ldv_46931; default: printk("\016%s:default case:LinkResponse %x", "LinkControlResponseMessage", (int )*(pucBuffer + 1UL)); goto ldv_46931; } ldv_46931: ; } else if ((unsigned int )*pucBuffer == 236U) { puMacAddr = pucBuffer + 1UL; Adapter->LinkStatus = 1U; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 4U) != 0U) && (int )Adapter->stDebugState.subtype[4] & 1) { printk("\017%s:MAC address response, sending SYNC_UP", "LinkControlResponseMessage"); } else { } LinkMessage(Adapter); __len = 6UL; if (__len > 63UL) { __ret = memcpy((void *)(Adapter->dev)->dev_addr, (void const *)puMacAddr, __len); } else { __ret = memcpy((void *)(Adapter->dev)->dev_addr, (void const *)puMacAddr, __len); } } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 4U) != 0U) && (int )Adapter->stDebugState.subtype[4] & 1) { printk("\017%s:%s <=====", "LinkControlResponseMessage", "LinkControlResponseMessage"); } else { } return; } } void SendIdleModeResponse(struct bcm_mini_adapter *Adapter ) { int status ; int NVMAccess ; int lowPwrAbortMsg ; struct timeval tv ; struct bcm_link_request stIdleResponse ; int iRetVal ; long __ret ; unsigned long tmp ; wait_queue_t __wait ; struct task_struct *tmp___0 ; int tmp___1 ; { status = 0; NVMAccess = 0; lowPwrAbortMsg = 0; stIdleResponse.Leader.Vcid = 0U; stIdleResponse.Leader.PLength = (unsigned short)0; stIdleResponse.Leader.Status = (unsigned char)0; stIdleResponse.Leader.Unused[0] = (unsigned char)0; stIdleResponse.Leader.Unused[1] = (unsigned char)0; stIdleResponse.Leader.Unused[2] = (unsigned char)0; stIdleResponse.szData[0] = (unsigned char)0; stIdleResponse.szData[1] = (unsigned char)0; stIdleResponse.szData[2] = (unsigned char)0; stIdleResponse.szData[3] = (unsigned char)0; memset((void *)(& tv), 0, 16UL); stIdleResponse.Leader.Status = 129U; stIdleResponse.Leader.PLength = 8U; stIdleResponse.szData[0] = 210U; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 4U) != 0U) && (int )Adapter->stDebugState.subtype[4] & 1) { printk("\017%s: ============>", "SendIdleModeResponse"); } else { } NVMAccess = down_trylock(& Adapter->NVMRdmWrmLock); lowPwrAbortMsg = down_trylock(& Adapter->LowPowerModeSync); if (NVMAccess != 0 || lowPwrAbortMsg != 0) { goto _L___0; } else { tmp___1 = atomic_read((atomic_t const *)(& Adapter->TotalPacketCount)); if (tmp___1 != 0) { _L___0: /* CIL Label */ if (Adapter->ulPowerSaveMode != 4UL) { if (NVMAccess == 0) { up(& Adapter->NVMRdmWrmLock); } else { } if (lowPwrAbortMsg == 0) { up(& Adapter->LowPowerModeSync); } else { } stIdleResponse.szData[1] = 3U; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 4U) != 0U) && (int )Adapter->stDebugState.subtype[4] & 1) { printk("\017%s:HOST IS NACKING Idle mode To F/W!!!!!!!!", "SendIdleModeResponse"); } else { } Adapter->bPreparingForLowPowerMode = 0; } else { goto _L; } } else { _L: /* CIL Label */ stIdleResponse.szData[1] = 2U; Adapter->StatisticsPointer = 0U; if (Adapter->LEDInfo.led_thread_running & 1) { iRetVal = 0; Adapter->DriverState = 32; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 4U) != 0U) && (int )Adapter->stDebugState.subtype[4] & 1) { printk("\017%s:LED Thread is Running..Hence Setting LED Event as IDLEMODE_ENTER jiffies:%ld", "SendIdleModeResponse", jiffies); } else { } __wake_up(& Adapter->LEDInfo.notify_led_event, 3U, 1, 0); tmp = msecs_to_jiffies(1000U); __ret = (long )tmp; if ((int )((signed char )Adapter->LEDInfo.bIdle_led_off) == 0) { tmp___0 = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp___0; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; ldv_46954: prepare_to_wait(& Adapter->LEDInfo.idleModeSyncEvent, & __wait, 2); if ((int )((signed char )Adapter->LEDInfo.bIdle_led_off) != 0) { goto ldv_46953; } else { } __ret = schedule_timeout(__ret); if (__ret == 0L) { goto ldv_46953; } else { } goto ldv_46954; ldv_46953: finish_wait(& Adapter->LEDInfo.idleModeSyncEvent, & __wait); } else { } iRetVal = (int )__ret; if (iRetVal <= 0) { stIdleResponse.szData[1] = 3U; Adapter->DriverState = 16; __wake_up(& Adapter->LEDInfo.notify_led_event, 3U, 1, 0); if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 4U) != 0U) && (int )Adapter->stDebugState.subtype[4] & 1) { printk("\017%s:NACKING Idle mode as time out happen from LED side!!!!!!!!", "SendIdleModeResponse"); } else { } } else { } } else { } if ((unsigned int )stIdleResponse.szData[1] == 2U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 4U) != 0U) && (int )Adapter->stDebugState.subtype[4] & 1) { printk("\017%s:ACKING IDLE MODE !!!!!!!!!", "SendIdleModeResponse"); } else { } down(& Adapter->rdmwrmsync); Adapter->bPreparingForLowPowerMode = 1; up(& Adapter->rdmwrmsync); if ((int )((signed char )Adapter->bDoSuspend) == 1) { Bcm_kill_all_URBs((struct bcm_interface_adapter *)Adapter->pvInterfaceAdapter); } else { } } else { Adapter->bPreparingForLowPowerMode = 0; } if (NVMAccess == 0) { up(& Adapter->NVMRdmWrmLock); } else { } if (lowPwrAbortMsg == 0) { up(& Adapter->LowPowerModeSync); } else { } } } status = CopyBufferToControlPacket(Adapter, (void *)(& stIdleResponse)); if (status != 0) { printk("\016%s:fail to send the Idle mode Request\n", "SendIdleModeResponse"); Adapter->bPreparingForLowPowerMode = 0; StartInterruptUrb((struct bcm_interface_adapter *)Adapter->pvInterfaceAdapter); } else { } do_gettimeofday(& tv); if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 4U) != 0U) && (int )Adapter->stDebugState.subtype[4] & 1) { printk("\017%s:IdleMode Msg submitter to Q :%ld ms", "SendIdleModeResponse", tv.tv_sec * 1000L + tv.tv_usec / 1000L); } else { } return; } } void DumpPackInfo(struct bcm_mini_adapter *Adapter ) { unsigned int uiLoopIndex ; unsigned int uiIndex ; unsigned int uiClsfrIndex ; struct bcm_classifier_rule *pstClassifierEntry ; int tmp___1 ; { uiLoopIndex = 0U; uiIndex = 0U; uiClsfrIndex = 0U; pstClassifierEntry = 0; uiLoopIndex = 0U; goto ldv_46979; ldv_46978: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:*********** Showing Details Of Queue %d***** ******", "DumpPackInfo", uiLoopIndex); } else { } if ((int )((signed char )Adapter->PackInfo[uiLoopIndex].bValid) == 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:bValid is FALSE for %X index\n", "DumpPackInfo", uiLoopIndex); } else { } goto ldv_46964; } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s: Dumping\tSF Rule Entry For SFID %lX\n", "DumpPackInfo", Adapter->PackInfo[uiLoopIndex].ulSFID); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s: ucDirection %X\n", "DumpPackInfo", (int )Adapter->PackInfo[uiLoopIndex].ucDirection); } else { } if ((unsigned int )Adapter->PackInfo[uiLoopIndex].ucIpVersion == 6U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:Ipv6 Service Flow\n", "DumpPackInfo"); } else if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:Ipv4 Service Flow\n", "DumpPackInfo"); } else { } } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:SF Traffic Priority %X\n", "DumpPackInfo", (int )Adapter->PackInfo[uiLoopIndex].u8TrafficPriority); } else { } uiClsfrIndex = 0U; goto ldv_46976; ldv_46975: pstClassifierEntry = (struct bcm_classifier_rule *)(& Adapter->astClassifierTable) + (unsigned long )uiClsfrIndex; if ((int )((signed char )pstClassifierEntry->bUsed) == 0) { goto ldv_46965; } else { } if (pstClassifierEntry->ulSFID != Adapter->PackInfo[uiLoopIndex].ulSFID) { goto ldv_46965; } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:\tDumping Classifier Rule Entry For Index: %X Classifier Rule ID : %X\n", "DumpPackInfo", uiClsfrIndex, (int )pstClassifierEntry->uiClassifierRuleIndex); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:\tDumping Classifier Rule Entry For Index: %X usVCID_Value : %X\n", "DumpPackInfo", uiClsfrIndex, (int )pstClassifierEntry->usVCID_Value); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:\tDumping Classifier Rule Entry For Index: %X bProtocolValid : %X\n", "DumpPackInfo", uiClsfrIndex, (int )pstClassifierEntry->bProtocolValid); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:\tDumping Classifier Rule Entry For Index: %X bTOSValid : %X\n", "DumpPackInfo", uiClsfrIndex, (int )pstClassifierEntry->bTOSValid); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:\tDumping Classifier Rule Entry For Index: %X bDestIpValid : %X\n", "DumpPackInfo", uiClsfrIndex, (int )pstClassifierEntry->bDestIpValid); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:\tDumping Classifier Rule Entry For Index: %X bSrcIpValid : %X\n", "DumpPackInfo", uiClsfrIndex, (int )pstClassifierEntry->bSrcIpValid); } else { } uiIndex = 0U; goto ldv_46967; ldv_46966: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:\tusSrcPortRangeLo:%X\n", "DumpPackInfo", (int )pstClassifierEntry->usSrcPortRangeLo[uiIndex]); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:\tusSrcPortRangeHi:%X\n", "DumpPackInfo", (int )pstClassifierEntry->usSrcPortRangeHi[uiIndex]); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:\tusDestPortRangeLo:%X\n", "DumpPackInfo", (int )pstClassifierEntry->usDestPortRangeLo[uiIndex]); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:\tusDestPortRangeHi:%X\n", "DumpPackInfo", (int )pstClassifierEntry->usDestPortRangeHi[uiIndex]); } else { } uiIndex = uiIndex + 1U; ldv_46967: ; if (uiIndex <= 3U) { goto ldv_46966; } else { goto ldv_46968; } ldv_46968: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:\tucIPSourceAddressLength : 0x%x\n", "DumpPackInfo", (int )pstClassifierEntry->ucIPSourceAddressLength); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:\tucIPDestinationAddressLength : 0x%x\n", "DumpPackInfo", (int )pstClassifierEntry->ucIPDestinationAddressLength); } else { } uiIndex = 0U; goto ldv_46970; ldv_46969: ; if ((unsigned int )Adapter->PackInfo[uiLoopIndex].ucIpVersion == 6U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:\tIpv6 ulSrcIpAddr :\n", "DumpPackInfo"); } else { } DumpIpv6Address((ULONG *)(& pstClassifierEntry->stSrcIpAddress.ldv_45846.ulIpv6Addr)); if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:\tIpv6 ulSrcIpMask :\n", "DumpPackInfo"); } else { } DumpIpv6Address((ULONG *)(& pstClassifierEntry->stSrcIpAddress.ldv_45846.ulIpv6Mask)); } else { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:\tulSrcIpAddr:%lX\n", "DumpPackInfo", pstClassifierEntry->stSrcIpAddress.ldv_45842.ulIpv4Addr[uiIndex]); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:\tulSrcIpMask:%lX\n", "DumpPackInfo", pstClassifierEntry->stSrcIpAddress.ldv_45842.ulIpv4Mask[uiIndex]); } else { } } uiIndex = uiIndex + 1U; ldv_46970: ; if ((unsigned int )pstClassifierEntry->ucIPSourceAddressLength > uiIndex) { goto ldv_46969; } else { goto ldv_46971; } ldv_46971: uiIndex = 0U; goto ldv_46973; ldv_46972: ; if ((unsigned int )Adapter->PackInfo[uiLoopIndex].ucIpVersion == 6U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:\tIpv6 ulDestIpAddr :\n", "DumpPackInfo"); } else { } DumpIpv6Address((ULONG *)(& pstClassifierEntry->stDestIpAddress.ldv_45846.ulIpv6Addr)); if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:\tIpv6 ulDestIpMask :\n", "DumpPackInfo"); } else { } DumpIpv6Address((ULONG *)(& pstClassifierEntry->stDestIpAddress.ldv_45846.ulIpv6Mask)); } else { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:\tulDestIpAddr:%lX\n", "DumpPackInfo", pstClassifierEntry->stDestIpAddress.ldv_45842.ulIpv4Addr[uiIndex]); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:\tulDestIpMask:%lX\n", "DumpPackInfo", pstClassifierEntry->stDestIpAddress.ldv_45842.ulIpv4Mask[uiIndex]); } else { } } uiIndex = uiIndex + 1U; ldv_46973: ; if ((unsigned int )pstClassifierEntry->ucIPDestinationAddressLength > uiIndex) { goto ldv_46972; } else { goto ldv_46974; } ldv_46974: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:\tucProtocol:0x%X\n", "DumpPackInfo", (int )pstClassifierEntry->ucProtocol[0]); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:\tu8ClassifierRulePriority:%X\n", "DumpPackInfo", (int )pstClassifierEntry->u8ClassifierRulePriority); } else { } ldv_46965: uiClsfrIndex = uiClsfrIndex + 1U; ldv_46976: ; if (uiClsfrIndex <= 99U) { goto ldv_46975; } else { goto ldv_46977; } ldv_46977: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:ulSFID:%lX\n", "DumpPackInfo", Adapter->PackInfo[uiLoopIndex].ulSFID); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:usVCID_Value:%X\n", "DumpPackInfo", (int )Adapter->PackInfo[uiLoopIndex].usVCID_Value); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:PhsEnabled: 0x%X\n", "DumpPackInfo", (int )Adapter->PackInfo[uiLoopIndex].bHeaderSuppressionEnabled); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:uiThreshold:%X\n", "DumpPackInfo", Adapter->PackInfo[uiLoopIndex].uiThreshold); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:bValid:%X\n", "DumpPackInfo", (int )Adapter->PackInfo[uiLoopIndex].bValid); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:bActive:%X\n", "DumpPackInfo", (int )Adapter->PackInfo[uiLoopIndex].bActive); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:ActivateReqSent: %x", "DumpPackInfo", (int )Adapter->PackInfo[uiLoopIndex].bActivateRequestSent); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:u8QueueType:%X\n", "DumpPackInfo", (int )Adapter->PackInfo[uiLoopIndex].u8QueueType); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:uiMaxBucketSize:%X\n", "DumpPackInfo", Adapter->PackInfo[uiLoopIndex].uiMaxBucketSize); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { tmp___1 = atomic_read((atomic_t const *)(& Adapter->PackInfo[uiLoopIndex].uiPerSFTxResourceCount)); printk("\017%s:uiPerSFTxResourceCount:%X\n", "DumpPackInfo", tmp___1); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:CurrQueueDepthOnTarget: %x\n", "DumpPackInfo", Adapter->PackInfo[uiLoopIndex].uiCurrentQueueDepthOnTarget); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:uiCurrentBytesOnHost:%X\n", "DumpPackInfo", Adapter->PackInfo[uiLoopIndex].uiCurrentBytesOnHost); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:uiCurrentPacketsOnHost:%X\n", "DumpPackInfo", Adapter->PackInfo[uiLoopIndex].uiCurrentPacketsOnHost); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:uiDroppedCountBytes:%X\n", "DumpPackInfo", Adapter->PackInfo[uiLoopIndex].uiDroppedCountBytes); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:uiDroppedCountPackets:%X\n", "DumpPackInfo", Adapter->PackInfo[uiLoopIndex].uiDroppedCountPackets); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:uiSentBytes:%X\n", "DumpPackInfo", Adapter->PackInfo[uiLoopIndex].uiSentBytes); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:uiSentPackets:%X\n", "DumpPackInfo", Adapter->PackInfo[uiLoopIndex].uiSentPackets); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:uiCurrentDrainRate:%X\n", "DumpPackInfo", Adapter->PackInfo[uiLoopIndex].uiCurrentDrainRate); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:uiThisPeriodSentBytes:%X\n", "DumpPackInfo", Adapter->PackInfo[uiLoopIndex].uiThisPeriodSentBytes); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:liDrainCalculated:%llX\n", "DumpPackInfo", Adapter->PackInfo[uiLoopIndex].liDrainCalculated); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:uiCurrentTokenCount:%X\n", "DumpPackInfo", Adapter->PackInfo[uiLoopIndex].uiCurrentTokenCount); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:liLastUpdateTokenAt:%llX\n", "DumpPackInfo", Adapter->PackInfo[uiLoopIndex].liLastUpdateTokenAt); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:uiMaxAllowedRate:%X\n", "DumpPackInfo", Adapter->PackInfo[uiLoopIndex].uiMaxAllowedRate); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:uiPendedLast:%X\n", "DumpPackInfo", Adapter->PackInfo[uiLoopIndex].uiPendedLast); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:NumOfPacketsSent:%X\n", "DumpPackInfo", Adapter->PackInfo[uiLoopIndex].NumOfPacketsSent); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:Direction: %x\n", "DumpPackInfo", (int )Adapter->PackInfo[uiLoopIndex].ucDirection); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:CID: %x\n", "DumpPackInfo", (int )Adapter->PackInfo[uiLoopIndex].usCID); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:ProtocolValid: %x\n", "DumpPackInfo", (int )Adapter->PackInfo[uiLoopIndex].bProtocolValid); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:TOSValid: %x\n", "DumpPackInfo", (int )Adapter->PackInfo[uiLoopIndex].bTOSValid); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:DestIpValid: %x\n", "DumpPackInfo", (int )Adapter->PackInfo[uiLoopIndex].bDestIpValid); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:SrcIpValid: %x\n", "DumpPackInfo", (int )Adapter->PackInfo[uiLoopIndex].bSrcIpValid); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:ActiveSet: %x\n", "DumpPackInfo", (int )Adapter->PackInfo[uiLoopIndex].bActiveSet); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:AdmittedSet: %x\n", "DumpPackInfo", (int )Adapter->PackInfo[uiLoopIndex].bAdmittedSet); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:AuthzSet: %x\n", "DumpPackInfo", (int )Adapter->PackInfo[uiLoopIndex].bAuthorizedSet); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:ClassifyPrority: %x\n", "DumpPackInfo", (int )Adapter->PackInfo[uiLoopIndex].bClassifierPriority); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:uiMaxLatency: %x\n", "DumpPackInfo", Adapter->PackInfo[uiLoopIndex].uiMaxLatency); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:ServiceClassName: %*ph\n", "DumpPackInfo", 4, (UCHAR *)(& Adapter->PackInfo[uiLoopIndex].ucServiceClassName)); } else { } ldv_46964: uiLoopIndex = uiLoopIndex + 1U; ldv_46979: ; if (uiLoopIndex <= 16U) { goto ldv_46978; } else { goto ldv_46980; } ldv_46980: uiLoopIndex = 0U; goto ldv_46982; ldv_46981: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:Adapter->aRxPktSizeHist[%x] = %x\n", "DumpPackInfo", uiLoopIndex, Adapter->aRxPktSizeHist[uiLoopIndex]); } else { } uiLoopIndex = uiLoopIndex + 1U; ldv_46982: ; if (uiLoopIndex <= 11U) { goto ldv_46981; } else { goto ldv_46983; } ldv_46983: uiLoopIndex = 0U; goto ldv_46985; ldv_46984: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:Adapter->aTxPktSizeHist[%x] = %x\n", "DumpPackInfo", uiLoopIndex, Adapter->aTxPktSizeHist[uiLoopIndex]); } else { } uiLoopIndex = uiLoopIndex + 1U; ldv_46985: ; if (uiLoopIndex <= 11U) { goto ldv_46984; } else { goto ldv_46986; } ldv_46986: ; return; } } int reset_card_proc(struct bcm_mini_adapter *ps_adapter ) { int retval ; struct bcm_mini_adapter *Adapter ; void *tmp ; struct bcm_interface_adapter *psIntfAdapter ; unsigned int value ; unsigned int uiResetValue ; int bytes ; unsigned long __ms ; unsigned long tmp___0 ; { retval = 0; tmp = netdev_priv((struct net_device const *)gblpnetdev); Adapter = (struct bcm_mini_adapter *)tmp; psIntfAdapter = 0; value = 0U; uiResetValue = 0U; psIntfAdapter = (struct bcm_interface_adapter *)ps_adapter->pvInterfaceAdapter; ps_adapter->bDDRInitDone = 0; if (ps_adapter->chip_id > 3201184511UL) { rdmalt(ps_adapter, 251661312U, & value, 4UL); rdmalt(ps_adapter, 251661312U, & value, 4UL); value = (ps_adapter->syscfgBefFwDld & 96U) | value; wrmalt(ps_adapter, 251661312U, & value, 4UL); } else { } (psIntfAdapter->psAdapter)->StopAllXaction = 1; Bcm_kill_all_URBs(psIntfAdapter); if (ps_adapter->chip_id > 3201184511UL) { printk("\016%s:Resetting UMA-B\n", "reset_card_proc"); retval = usb_reset_device(psIntfAdapter->udev); (psIntfAdapter->psAdapter)->StopAllXaction = 0; if (retval != 0) { printk("\016%s:Reset failed with ret value :%d", "reset_card_proc", retval); goto err_exit; } else { } if (((ps_adapter->chip_id == 3201184529UL || ps_adapter->chip_id == 3201184528UL) || ps_adapter->chip_id == 3201184513UL) || ps_adapter->chip_id == 3201184545UL) { bytes = rdmalt(ps_adapter, 251661652U, & value, 4UL); if (bytes < 0) { retval = bytes; printk("\016%s:read failed with status :%d", "reset_card_proc", retval); goto err_exit; } else { } value = value | 1U; retval = wrmalt(ps_adapter, 251661652U, & value, 4UL); if (retval < 0) { printk("\016%s:write failed with status :%d", "reset_card_proc", retval); goto err_exit; } else { } } else { } } else { bytes = rdmalt(ps_adapter, 251686936U, & value, 4UL); if (bytes < 0) { retval = bytes; printk("\016%s:read failed with status :%d", "reset_card_proc", retval); goto err_exit; } else { } value = value & 4294901759U; retval = wrmalt(ps_adapter, 251686936U, & value, 4UL); if (retval < 0) { printk("\016%s:write failed with status :%d", "reset_card_proc", retval); goto err_exit; } else { } value = 0U; retval = wrmalt(ps_adapter, 251658300U, & value, 4UL); if (retval < 0) { printk("\016%s:write failed with status :%d", "reset_card_proc", retval); goto err_exit; } else { } value = 768U; retval = wrmalt(ps_adapter, 251658292U, & value, 4UL); if (retval < 0) { printk("\016%s:write failed with status :%d", "reset_card_proc", retval); goto err_exit; } else { } __ms = 50UL; goto ldv_47000; ldv_46999: __const_udelay(4295000UL); ldv_47000: tmp___0 = __ms; __ms = __ms - 1UL; if (tmp___0 != 0UL) { goto ldv_46999; } else { goto ldv_47001; } ldv_47001: ; } if ((int )((signed char )ps_adapter->bFlashBoot) != 0) { rdmalt(ps_adapter, 251658252U, & uiResetValue, 4UL); uiResetValue = uiResetValue | 1073741824U; wrmalt(ps_adapter, 251658252U, & uiResetValue, 4UL); } else { } if (ps_adapter->chip_id > 3201184511UL) { uiResetValue = 0U; rdmalt(ps_adapter, 251661312U, & uiResetValue, 4UL); if ((uiResetValue & 16U) != 0U) { uiResetValue = 0U; rdmalt(ps_adapter, 251661312U, & uiResetValue, 4UL); uiResetValue = uiResetValue & 4294967279U; wrmalt(ps_adapter, 251661312U, & uiResetValue, 4UL); } else { } } else { } uiResetValue = 0U; wrmalt(ps_adapter, 251730028U, & uiResetValue, 4UL); err_exit: (psIntfAdapter->psAdapter)->StopAllXaction = 0; return (retval); } } int run_card_proc(struct bcm_mini_adapter *ps_adapter ) { int status ; int bytes ; unsigned int value ; int tmp ; { status = 0; value = 0U; bytes = rdmalt(ps_adapter, 251658252U, & value, 4UL); if (bytes < 0) { status = bytes; if ((((unsigned long )ps_adapter != (unsigned long )((struct bcm_mini_adapter *)0) && ps_adapter->stDebugState.debug_level > 6U) && (int )ps_adapter->stDebugState.type & 1) && (ps_adapter->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:%s:%d\n", "run_card_proc", "run_card_proc", 945); } else { } return (status); } else { } if ((int )((signed char )ps_adapter->bFlashBoot) != 0) { value = value & 3221225471U; } else { value = value | 1073741824U; } tmp = wrmalt(ps_adapter, 251658252U, & value, 4UL); if (tmp < 0) { if ((((unsigned long )ps_adapter != (unsigned long )((struct bcm_mini_adapter *)0) && ps_adapter->stDebugState.debug_level > 6U) && (int )ps_adapter->stDebugState.type & 1) && (ps_adapter->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:%s:%d\n", "run_card_proc", "run_card_proc", 955); } else { } return (-1); } else { } return (status); } } int InitCardAndDownloadFirmware(struct bcm_mini_adapter *ps_adapter ) { int status ; unsigned int value ; int tmp ; int tmp___0 ; unsigned long __ms ; unsigned long tmp___1 ; { value = 0U; status = create_worker_threads(ps_adapter); if (status < 0) { return (status); } else { } status = bcm_parse_target_params(ps_adapter); if (status != 0) { return (status); } else { } if (ps_adapter->chip_id > 3201184511UL) { rdmalt(ps_adapter, 251661312U, & value, 4UL); ps_adapter->syscfgBefFwDld = value; if ((value & 96U) == 0U) { ps_adapter->bFlashBoot = 1; } else { } } else { } reset_card_proc(ps_adapter); BcmInitNVM(ps_adapter); status = ddr_init(ps_adapter); if (status != 0) { printk("\vbeceemddr_init Failed\n"); return (status); } else { } status = buffDnldVerify(ps_adapter, (unsigned char *)ps_adapter->pstargetparams, 144U, 3210784768UL); if (status != 0) { if ((((unsigned long )ps_adapter != (unsigned long )((struct bcm_mini_adapter *)0) && ps_adapter->stDebugState.debug_level > 6U) && (int )ps_adapter->stDebugState.type & 1) && (ps_adapter->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:Error downloading CFG file", "InitCardAndDownloadFirmware"); } else { } goto OUT; } else { } tmp = register_networkdev(ps_adapter); if (tmp != 0) { if ((((unsigned long )ps_adapter != (unsigned long )((struct bcm_mini_adapter *)0) && ps_adapter->stDebugState.debug_level > 6U) && (int )ps_adapter->stDebugState.type & 1) && (ps_adapter->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:Register Netdevice failed. Cleanup needs to be performed.", "InitCardAndDownloadFirmware"); } else { } return (-5); } else { } if ((int )((signed char )ps_adapter->AutoFirmDld) == 0) { if ((((unsigned long )ps_adapter != (unsigned long )((struct bcm_mini_adapter *)0) && ps_adapter->stDebugState.debug_level > 6U) && (int )ps_adapter->stDebugState.type & 1) && (ps_adapter->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:AutoFirmDld Disabled in CFG File..\n", "InitCardAndDownloadFirmware"); } else { } tmp___0 = register_control_device_interface(ps_adapter); if (tmp___0 < 0) { if ((((unsigned long )ps_adapter != (unsigned long )((struct bcm_mini_adapter *)0) && ps_adapter->stDebugState.debug_level > 6U) && (int )ps_adapter->stDebugState.type & 1) && (ps_adapter->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:Register Control Device failed. Cleanup needs to be performed.", "InitCardAndDownloadFirmware"); } else { } return (-5); } else { } return (0); } else { } status = InitLedSettings(ps_adapter); if (status != 0) { printk("\016%s:INIT LED FAILED\n", "InitCardAndDownloadFirmware"); return (status); } else { } if (ps_adapter->LEDInfo.led_thread_running & 1) { ps_adapter->DriverState = 1; __wake_up(& ps_adapter->LEDInfo.notify_led_event, 3U, 1, 0); } else { } if (ps_adapter->LEDInfo.led_thread_running & 1) { ps_adapter->DriverState = 2; __wake_up(& ps_adapter->LEDInfo.notify_led_event, 3U, 1, 0); } else { } value = 0U; wrmalt(ps_adapter, 3215982596U, & value, 4UL); wrmalt(ps_adapter, 3215982592U, & value, 4UL); if ((unsigned int )ps_adapter->eNVMType == 2U) { status = PropagateCalParamsFromFlashToMemory(ps_adapter); if (status != 0) { if ((((unsigned long )ps_adapter != (unsigned long )((struct bcm_mini_adapter *)0) && ps_adapter->stDebugState.debug_level > 6U) && (int )ps_adapter->stDebugState.type & 1) && (ps_adapter->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:Propagation of Cal param failed ..", "InitCardAndDownloadFirmware"); } else { } goto OUT; } else { } } else { } status = BcmFileDownload(ps_adapter, "/lib/firmware/macxvi200.bin", 3217031168U); if (status != 0) { if ((((unsigned long )ps_adapter != (unsigned long )((struct bcm_mini_adapter *)0) && ps_adapter->stDebugState.debug_level > 6U) && (int )ps_adapter->stDebugState.type & 1) && (ps_adapter->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:No Firmware File is present...\n", "InitCardAndDownloadFirmware"); } else { } goto OUT; } else { } status = run_card_proc(ps_adapter); if (status != 0) { if ((((unsigned long )ps_adapter != (unsigned long )((struct bcm_mini_adapter *)0) && ps_adapter->stDebugState.debug_level > 6U) && (int )ps_adapter->stDebugState.type & 1) && (ps_adapter->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:run_card_proc Failed\n", "InitCardAndDownloadFirmware"); } else { } goto OUT; } else { } ps_adapter->fw_download_done = 1; __ms = 10UL; goto ldv_47018; ldv_47017: __const_udelay(4295000UL); ldv_47018: tmp___1 = __ms; __ms = __ms - 1UL; if (tmp___1 != 0UL) { goto ldv_47017; } else { goto ldv_47019; } ldv_47019: ; OUT: ; if (ps_adapter->LEDInfo.led_thread_running & 1) { ps_adapter->DriverState = 4; __wake_up(& ps_adapter->LEDInfo.notify_led_event, 3U, 1, 0); } else { } return (status); } } static int bcm_parse_target_params(struct bcm_mini_adapter *Adapter ) { struct file *flp ; char *buff ; int len ; void *tmp ; void *tmp___0 ; size_t __len ; void *__ret ; { flp = 0; len = 0; tmp = kmalloc(1024UL, 208U); buff = (char *)tmp; if ((unsigned long )buff == (unsigned long )((char *)0)) { return (-12); } else { } tmp___0 = kmalloc(144UL, 208U); Adapter->pstargetparams = (PSTARGETPARAMS )tmp___0; if ((unsigned long )Adapter->pstargetparams == (unsigned long )((PSTARGETPARAMS )0)) { kfree((void const *)buff); return (-12); } else { } flp = open_firmware_file(Adapter, "/lib/firmware/macxvi.cfg"); if ((unsigned long )flp == (unsigned long )((struct file *)0)) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (Adapter->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:NOT ABLE TO OPEN THE %s FILE\n", "bcm_parse_target_params", (char *)"/lib/firmware/macxvi.cfg"); } else { } kfree((void const *)buff); kfree((void const *)Adapter->pstargetparams); Adapter->pstargetparams = 0; return (-2); } else { } len = kernel_read(flp, 0LL, buff, 1024UL); filp_close(flp, 0); if (len != 144) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (int )Adapter->stDebugState.type & 1) && (Adapter->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:Mismatch in Target Param Structure!\n", "bcm_parse_target_params"); } else { } kfree((void const *)buff); kfree((void const *)Adapter->pstargetparams); Adapter->pstargetparams = 0; return (-2); } else { } __len = 144UL; if (__len > 63UL) { __ret = memcpy((void *)Adapter->pstargetparams, (void const *)buff, __len); } else { __ret = memcpy((void *)Adapter->pstargetparams, (void const *)buff, __len); } kfree((void const *)buff); beceem_parse_target_struct(Adapter); return (0); } } void beceem_parse_target_struct(struct bcm_mini_adapter *Adapter ) { unsigned int uiHostDrvrCfg6 ; unsigned int uiEEPROMFlag ; __u32 tmp ; __u32 tmp___0 ; __u32 tmp___1 ; __u32 tmp___2 ; __u32 tmp___3 ; __u32 tmp___4 ; __u32 tmp___5 ; __u32 tmp___6 ; __u32 tmp___7 ; __u32 tmp___8 ; { uiHostDrvrCfg6 = 0U; uiEEPROMFlag = 0U; tmp = __fswab32((Adapter->pstargetparams)->m_u32PhyParameter2); if ((int )tmp & 1) { printk("\016beceem: AutoSyncup is Disabled\n"); Adapter->AutoSyncup = 0; } else { printk("\016beceem: AutoSyncup is Enabled\n"); Adapter->AutoSyncup = 1; } tmp___0 = __fswab32((Adapter->pstargetparams)->HostDrvrConfig6); if ((tmp___0 & 2U) != 0U) { printk("\016beceem: Enabling autolink up"); Adapter->AutoLinkUp = 1; } else { printk("\016beceem: Disabling autolink up"); Adapter->AutoLinkUp = 0; } tmp___1 = __fswab32((Adapter->pstargetparams)->HostDrvrConfig6); Adapter->DDRSetting = (int )(tmp___1 >> 8) & 15; tmp___2 = __fswab32((Adapter->pstargetparams)->HostDrvrConfig6); Adapter->ulPowerSaveMode = (ULONG )(tmp___2 >> 12) & 15UL; printk("\016beceem: DDR Setting: %x\n", Adapter->DDRSetting); printk("\016beceem: Power Save Mode: %lx\n", Adapter->ulPowerSaveMode); tmp___3 = __fswab32((Adapter->pstargetparams)->HostDrvrConfig6); if ((int )tmp___3 & 1) { printk("\016beceem: Enabling Auto Firmware Download\n"); Adapter->AutoFirmDld = 1; } else { printk("\016beceem: Disabling Auto Firmware Download\n"); Adapter->AutoFirmDld = 0; } tmp___4 = __fswab32((Adapter->pstargetparams)->HostDrvrConfig6); uiHostDrvrCfg6 = tmp___4; Adapter->bMipsConfig = (int )((BOOLEAN )(uiHostDrvrCfg6 >> 20)) & 1; printk("\016beceem: MIPSConfig : 0x%X\n", (int )Adapter->bMipsConfig); Adapter->bDPLLConfig = (int )((BOOLEAN )(uiHostDrvrCfg6 >> 19)) & 1; Adapter->PmuMode = (uiHostDrvrCfg6 >> 24) & 3U; printk("\016beceem: PMU MODE: %x", Adapter->PmuMode); if ((uiHostDrvrCfg6 & 65536U) != 0U) { Adapter->bDoSuspend = 1; printk("\016beceem: Making DoSuspend TRUE as per configFile"); } else { } tmp___5 = __fswab32((Adapter->pstargetparams)->m_u32EEPROMFlag); uiEEPROMFlag = tmp___5; printk("\016beceem: uiEEPROMFlag : 0x%X\n", uiEEPROMFlag); Adapter->eNVMType = (enum eNVM_TYPE )((uiEEPROMFlag >> 4) & 3U); Adapter->bStatusWrite = (int )((BOOLEAN )(uiEEPROMFlag >> 6)) & 1; tmp___6 = __fswab32((Adapter->pstargetparams)->HostDrvrConfig4); Adapter->uiSectorSizeInCFG = (tmp___6 & 65535U) * 1024U; tmp___7 = __fswab32((Adapter->pstargetparams)->HostDrvrConfig4); Adapter->bSectorSizeOverride = tmp___7 >> 16 != 0U; tmp___8 = __fswab32((Adapter->pstargetparams)->m_u32PowerSavingModeOptions); if ((int )tmp___8 & 1) { Adapter->ulPowerSaveMode = 4UL; } else { } if (Adapter->ulPowerSaveMode != 4UL) { doPowerAutoCorrection(Adapter); } else { } return; } } static void doPowerAutoCorrection(struct bcm_mini_adapter *psAdapter ) { unsigned int reporting_mode ; __u32 tmp ; __u32 tmp___0 ; { tmp = __fswab32((psAdapter->pstargetparams)->m_u32PowerSavingModeOptions); reporting_mode = tmp & 2U; psAdapter->bIsAutoCorrectEnabled = ((int )((signed char )(psAdapter->ulPowerSaveMode >> 3)) & 1) == 0; if (reporting_mode == 1U) { if ((((unsigned long )psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && psAdapter->stDebugState.debug_level > 6U) && (int )psAdapter->stDebugState.type & 1) && (psAdapter->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:can\'t do suspen/resume as reporting mode is enable", "doPowerAutoCorrection"); } else { } psAdapter->bDoSuspend = 0; } else { } if ((int )((signed char )psAdapter->bIsAutoCorrectEnabled) != 0 && psAdapter->chip_id > 3201184511UL) { psAdapter->ulPowerSaveMode = 1UL; psAdapter->bDoSuspend = 0; (psAdapter->pstargetparams)->HostDrvrConfig6 = (psAdapter->pstargetparams)->HostDrvrConfig6 & 4279238655U; tmp___0 = __fswab32((__u32 )psAdapter->ulPowerSaveMode << 12U); (psAdapter->pstargetparams)->HostDrvrConfig6 = (psAdapter->pstargetparams)->HostDrvrConfig6 | tmp___0; } else if ((int )((signed char )psAdapter->bIsAutoCorrectEnabled) == 0) { psAdapter->ulPowerSaveMode = psAdapter->ulPowerSaveMode & 0xfffffffffffffff7UL; (psAdapter->pstargetparams)->HostDrvrConfig6 = (psAdapter->pstargetparams)->HostDrvrConfig6 & 4286578687U; if ((((unsigned long )psAdapter != (unsigned long )((struct bcm_mini_adapter *)0) && psAdapter->stDebugState.debug_level > 6U) && (int )psAdapter->stDebugState.type & 1) && (psAdapter->stDebugState.subtype[1] & 2U) != 0U) { printk("\017%s:Using Forced User Choice: %lx\n", "doPowerAutoCorrection", psAdapter->ulPowerSaveMode); } else { } } else { } return; } } static void convertEndian(unsigned char rwFlag , unsigned int *puiBuffer , unsigned int uiByteCount ) { unsigned int uiIndex ; __u32 tmp ; __u32 tmp___0 ; { uiIndex = 0U; if ((unsigned int )rwFlag == 1U) { uiIndex = 0U; goto ldv_47047; ldv_47046: tmp = __fswab32(*(puiBuffer + (unsigned long )uiIndex)); *(puiBuffer + (unsigned long )uiIndex) = tmp; uiIndex = uiIndex + 1U; ldv_47047: ; if (uiByteCount / 4U > uiIndex) { goto ldv_47046; } else { goto ldv_47048; } ldv_47048: ; } else { uiIndex = 0U; goto ldv_47050; ldv_47049: tmp___0 = __fswab32(*(puiBuffer + (unsigned long )uiIndex)); *(puiBuffer + (unsigned long )uiIndex) = tmp___0; uiIndex = uiIndex + 1U; ldv_47050: ; if (uiByteCount / 4U > uiIndex) { goto ldv_47049; } else { goto ldv_47051; } ldv_47051: ; } return; } } int rdm(struct bcm_mini_adapter *Adapter , unsigned int uiAddress , PCHAR pucBuff , size_t sSize ) { int tmp ; { tmp = (*(Adapter->interface_rdm))(Adapter->pvInterfaceAdapter, uiAddress, (PVOID )pucBuff, (int )sSize); return (tmp); } } int wrm(struct bcm_mini_adapter *Adapter , unsigned int uiAddress , PCHAR pucBuff , size_t sSize ) { int iRetVal ; { iRetVal = (*(Adapter->interface_wrm))(Adapter->pvInterfaceAdapter, uiAddress, (PVOID )pucBuff, (int )sSize); return (iRetVal); } } int wrmalt(struct bcm_mini_adapter *Adapter , unsigned int uiAddress , unsigned int *pucBuff , size_t size ) { int tmp ; { convertEndian(1, pucBuff, (unsigned int )size); tmp = wrm(Adapter, uiAddress, (PCHAR )pucBuff, size); return (tmp); } } int rdmalt(struct bcm_mini_adapter *Adapter , unsigned int uiAddress , unsigned int *pucBuff , size_t size ) { int uiRetVal ; { uiRetVal = 0; uiRetVal = rdm(Adapter, uiAddress, (PCHAR )pucBuff, size); convertEndian(0, pucBuff, (unsigned int )size); return (uiRetVal); } } int wrmWithLock(struct bcm_mini_adapter *Adapter , unsigned int uiAddress , PCHAR pucBuff , size_t sSize ) { int status ; { status = 0; down(& Adapter->rdmwrmsync); if (((int )((signed char )Adapter->IdleMode) == 1 || (int )((signed char )Adapter->bShutStatus) == 1) || (int )((signed char )Adapter->bPreparingForLowPowerMode) == 1) { status = -13; goto exit; } else { } status = wrm(Adapter, uiAddress, pucBuff, sSize); exit: up(& Adapter->rdmwrmsync); return (status); } } int wrmaltWithLock(struct bcm_mini_adapter *Adapter , unsigned int uiAddress , unsigned int *pucBuff , size_t size ) { int iRetVal ; { iRetVal = 0; down(& Adapter->rdmwrmsync); if (((int )((signed char )Adapter->IdleMode) == 1 || (int )((signed char )Adapter->bShutStatus) == 1) || (int )((signed char )Adapter->bPreparingForLowPowerMode) == 1) { iRetVal = -13; goto exit; } else { } iRetVal = wrmalt(Adapter, uiAddress, pucBuff, size); exit: up(& Adapter->rdmwrmsync); return (iRetVal); } } int rdmaltWithLock(struct bcm_mini_adapter *Adapter , unsigned int uiAddress , unsigned int *pucBuff , size_t size ) { int uiRetVal ; { uiRetVal = 0; down(& Adapter->rdmwrmsync); if (((int )((signed char )Adapter->IdleMode) == 1 || (int )((signed char )Adapter->bShutStatus) == 1) || (int )((signed char )Adapter->bPreparingForLowPowerMode) == 1) { uiRetVal = -13; goto exit; } else { } uiRetVal = rdmalt(Adapter, uiAddress, pucBuff, size); exit: up(& Adapter->rdmwrmsync); return (uiRetVal); } } static void HandleShutDownModeWakeup(struct bcm_mini_adapter *Adapter ) { int clear_abort_pattern ; int Status ; { clear_abort_pattern = 0; Status = 0; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 16U) != 0U) { printk("\017%s:====>\n", "HandleShutDownModeWakeup"); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 16U) != 0U) { printk("\017%s:Clearing Shut Down Software abort pattern\n", "HandleShutDownModeWakeup"); } else { } Status = wrmalt(Adapter, 267395068U, (unsigned int *)(& clear_abort_pattern), 4UL); if (Status != 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 16U) != 0U) { printk("\017%s:WRM to SW_ABORT_IDLEMODE_LOC failed with err:%d", "HandleShutDownModeWakeup", Status); } else { } return; } else { } if (Adapter->ulPowerSaveMode != 4UL) { msleep(100U); InterfaceHandleShutdownModeWakeup(Adapter); msleep(100U); } else { } if (Adapter->LEDInfo.led_thread_running & 1) { Adapter->DriverState = 8; __wake_up(& Adapter->LEDInfo.notify_led_event, 3U, 1, 0); } else { } Adapter->bTriedToWakeUpFromlowPowerMode = 0; Adapter->bShutStatus = 0; __wake_up(& Adapter->lowpower_mode_wait_queue, 3U, 1, 0); if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 16U) != 0U) { printk("\017%s:<====\n", "HandleShutDownModeWakeup"); } else { } return; } } static void SendShutModeResponse(struct bcm_mini_adapter *Adapter ) { struct bcm_link_request stShutdownResponse ; unsigned int NVMAccess ; unsigned int lowPwrAbortMsg ; unsigned int Status ; int tmp ; int tmp___0 ; int iRetVal ; long __ret ; unsigned long tmp___1 ; wait_queue_t __wait ; struct task_struct *tmp___2 ; int tmp___3 ; INT tmp___4 ; { NVMAccess = 0U; lowPwrAbortMsg = 0U; Status = 0U; memset((void *)(& stShutdownResponse), 0, 12UL); stShutdownResponse.Leader.Status = 131U; stShutdownResponse.Leader.PLength = 8U; stShutdownResponse.szData[0] = 246U; stShutdownResponse.szData[1] = 8U; tmp = down_trylock(& Adapter->NVMRdmWrmLock); NVMAccess = (unsigned int )tmp; tmp___0 = down_trylock(& Adapter->LowPowerModeSync); lowPwrAbortMsg = (unsigned int )tmp___0; if (NVMAccess != 0U || lowPwrAbortMsg != 0U) { goto _L; } else { tmp___3 = atomic_read((atomic_t const *)(& Adapter->TotalPacketCount)); if (tmp___3 != 0) { _L: /* CIL Label */ if (NVMAccess == 0U) { up(& Adapter->NVMRdmWrmLock); } else { } if (lowPwrAbortMsg == 0U) { up(& Adapter->LowPowerModeSync); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 16U) != 0U) { printk("\017%s:Device Access is going on NACK the Shut Down MODE\n", "SendShutModeResponse"); } else { } stShutdownResponse.szData[2] = 2U; Adapter->bPreparingForLowPowerMode = 0; } else { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 16U) != 0U) { printk("\017%s:Sending SHUTDOWN MODE ACK\n", "SendShutModeResponse"); } else { } stShutdownResponse.szData[2] = 1U; if (Adapter->LEDInfo.led_thread_running & 1) { iRetVal = 0; Adapter->DriverState = 32; __wake_up(& Adapter->LEDInfo.notify_led_event, 3U, 1, 0); tmp___1 = msecs_to_jiffies(1000U); __ret = (long )tmp___1; if ((int )((signed char )Adapter->LEDInfo.bIdle_led_off) == 0) { tmp___2 = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp___2; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; ldv_47120: prepare_to_wait(& Adapter->LEDInfo.idleModeSyncEvent, & __wait, 2); if ((int )((signed char )Adapter->LEDInfo.bIdle_led_off) != 0) { goto ldv_47119; } else { } __ret = schedule_timeout(__ret); if (__ret == 0L) { goto ldv_47119; } else { } goto ldv_47120; ldv_47119: finish_wait(& Adapter->LEDInfo.idleModeSyncEvent, & __wait); } else { } iRetVal = (int )__ret; if (iRetVal <= 0) { stShutdownResponse.szData[1] = 2U; Adapter->DriverState = 8; __wake_up(& Adapter->LEDInfo.notify_led_event, 3U, 1, 0); } else { } } else { } if ((unsigned int )stShutdownResponse.szData[2] == 1U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 16U) != 0U) { printk("\017%s:ACKING SHUTDOWN MODE !!!!!!!!!", "SendShutModeResponse"); } else { } down(& Adapter->rdmwrmsync); Adapter->bPreparingForLowPowerMode = 1; up(& Adapter->rdmwrmsync); if ((int )((signed char )Adapter->bDoSuspend) == 1) { Bcm_kill_all_URBs((struct bcm_interface_adapter *)Adapter->pvInterfaceAdapter); } else { } } else { Adapter->bPreparingForLowPowerMode = 0; } if (NVMAccess == 0U) { up(& Adapter->NVMRdmWrmLock); } else { } if (lowPwrAbortMsg == 0U) { up(& Adapter->LowPowerModeSync); } else { } } } tmp___4 = CopyBufferToControlPacket(Adapter, (void *)(& stShutdownResponse)); Status = (unsigned int )tmp___4; if (Status != 0U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 16U) != 0U) { printk("\017%s:fail to send the Idle mode Request\n", "SendShutModeResponse"); } else { } Adapter->bPreparingForLowPowerMode = 0; StartInterruptUrb((struct bcm_interface_adapter *)Adapter->pvInterfaceAdapter); } else { } return; } } static void HandleShutDownModeRequest(struct bcm_mini_adapter *Adapter , PUCHAR pucBuffer ) { unsigned int uiResetValue ; { uiResetValue = 0U; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 16U) != 0U) { printk("\017%s:====>\n", "HandleShutDownModeRequest"); } else { } if ((unsigned int )*(pucBuffer + 1UL) == 9U) { HandleShutDownModeWakeup(Adapter); } else if ((unsigned int )*(pucBuffer + 1UL) == 8U) { if (((Adapter->chip_id == 3201184529UL || Adapter->chip_id == 3201184528UL) || Adapter->chip_id == 3201184513UL) || Adapter->chip_id == 3201184545UL) { rdmalt(Adapter, 251661656U, & uiResetValue, 4UL); uiResetValue = uiResetValue | 131072U; wrmalt(Adapter, 251661656U, & uiResetValue, 4UL); } else { } SendShutModeResponse(Adapter); if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 16U) != 0U) { printk("\017%s:ShutDownModeResponse:Notification received: Sending the response(Ack/Nack)\n", "HandleShutDownModeRequest"); } else { } } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 16U) != 0U) { printk("\017%s:<====\n", "HandleShutDownModeRequest"); } else { } return; } } VOID ResetCounters(struct bcm_mini_adapter *Adapter ) { { beceem_protocol_reset(Adapter); Adapter->CurrNumRecvDescs = 0U; Adapter->PrevNumRecvDescs = 0U; Adapter->LinkUpStatus = 0; Adapter->LinkStatus = 0U; atomic_set(& Adapter->cntrlpktCnt, 0); atomic_set(& Adapter->TotalPacketCount, 0); Adapter->fw_download_done = 0; Adapter->LinkStatus = 0U; Adapter->AutoLinkUp = 0; Adapter->IdleMode = 0; Adapter->bShutStatus = 0; return; } } struct bcm_classifier_rule *GetFragIPClsEntry(struct bcm_mini_adapter *Adapter , USHORT usIpIdentification , ULONG SrcIP ) { unsigned int uiIndex ; { uiIndex = 0U; uiIndex = 0U; goto ldv_47138; ldv_47137: ; if ((((int )((signed char )Adapter->astFragmentedPktClassifierTable[uiIndex].bUsed) != 0 && (int )Adapter->astFragmentedPktClassifierTable[uiIndex].usIpIdentification == (int )usIpIdentification) && Adapter->astFragmentedPktClassifierTable[uiIndex].ulSrcIpAddress == SrcIP) && (int )((signed char )Adapter->astFragmentedPktClassifierTable[uiIndex].bOutOfOrderFragment) == 0) { return (Adapter->astFragmentedPktClassifierTable[uiIndex].pstMatchedClassifierEntry); } else { } uiIndex = uiIndex + 1U; ldv_47138: ; if (uiIndex <= 255U) { goto ldv_47137; } else { goto ldv_47139; } ldv_47139: ; return (0); } } void AddFragIPClsEntry(struct bcm_mini_adapter *Adapter , struct bcm_fragmented_packet_info *psFragPktInfo ) { unsigned int uiIndex ; size_t __len ; void *__ret ; { uiIndex = 0U; uiIndex = 0U; goto ldv_47150; ldv_47149: ; if ((int )((signed char )Adapter->astFragmentedPktClassifierTable[uiIndex].bUsed) == 0) { __len = 40UL; if (__len > 63UL) { __ret = memcpy((void *)(& Adapter->astFragmentedPktClassifierTable) + (unsigned long )uiIndex, (void const *)psFragPktInfo, __len); } else { __ret = memcpy((void *)(& Adapter->astFragmentedPktClassifierTable) + (unsigned long )uiIndex, (void const *)psFragPktInfo, __len); } goto ldv_47148; } else { } uiIndex = uiIndex + 1U; ldv_47150: ; if (uiIndex <= 255U) { goto ldv_47149; } else { goto ldv_47148; } ldv_47148: ; return; } } void DelFragIPClsEntry(struct bcm_mini_adapter *Adapter , USHORT usIpIdentification , ULONG SrcIp ) { unsigned int uiIndex ; { uiIndex = 0U; uiIndex = 0U; goto ldv_47158; ldv_47157: ; if (((int )((signed char )Adapter->astFragmentedPktClassifierTable[uiIndex].bUsed) != 0 && (int )Adapter->astFragmentedPktClassifierTable[uiIndex].usIpIdentification == (int )usIpIdentification) && Adapter->astFragmentedPktClassifierTable[uiIndex].ulSrcIpAddress == SrcIp) { memset((void *)(& Adapter->astFragmentedPktClassifierTable) + (unsigned long )uiIndex, 0, 40UL); } else { } uiIndex = uiIndex + 1U; ldv_47158: ; if (uiIndex <= 255U) { goto ldv_47157; } else { goto ldv_47159; } ldv_47159: ; return; } } void update_per_cid_rx(struct bcm_mini_adapter *Adapter ) { unsigned int qindex ; { qindex = 0U; if ((unsigned long )jiffies - Adapter->liDrainCalculated <= 249UL) { return; } else { } qindex = 0U; goto ldv_47165; ldv_47164: ; if ((unsigned int )Adapter->PackInfo[qindex].ucDirection == 0U) { Adapter->PackInfo[qindex].uiCurrentRxRate = (Adapter->PackInfo[qindex].uiCurrentRxRate + Adapter->PackInfo[qindex].uiThisPeriodRxBytes) / 2U; Adapter->PackInfo[qindex].uiThisPeriodRxBytes = 0U; } else { Adapter->PackInfo[qindex].uiCurrentDrainRate = (Adapter->PackInfo[qindex].uiCurrentDrainRate + Adapter->PackInfo[qindex].uiThisPeriodSentBytes) / 2U; Adapter->PackInfo[qindex].uiThisPeriodSentBytes = 0U; } qindex = qindex + 1U; ldv_47165: ; if (qindex <= 15U) { goto ldv_47164; } else { goto ldv_47166; } ldv_47166: Adapter->liDrainCalculated = jiffies; return; } } void update_per_sf_desc_cnts(struct bcm_mini_adapter *Adapter ) { int iIndex ; u32 uibuff[24U] ; int bytes ; int tmp ; { iIndex = 0; tmp = atomic_read((atomic_t const *)(& Adapter->uiMBupdate)); if (tmp == 0) { return; } else { } bytes = rdmaltWithLock(Adapter, 3221222400U, (unsigned int *)(& uibuff), 96UL); if (bytes < 0) { printk("\016%s:rdm failed\n", "update_per_sf_desc_cnts"); return; } else { } iIndex = 0; goto ldv_47175; ldv_47174: ; if ((int )((signed char )Adapter->PackInfo[iIndex].bValid) != 0 && (unsigned int )Adapter->PackInfo[iIndex].ucDirection != 0U) { if ((unsigned int )Adapter->PackInfo[iIndex].usVCID_Value <= 23U) { atomic_set(& Adapter->PackInfo[iIndex].uiPerSFTxResourceCount, (int )uibuff[(int )Adapter->PackInfo[iIndex].usVCID_Value]); } else { printk("\016%s:Invalid VCID : %x\n", "update_per_sf_desc_cnts", (int )Adapter->PackInfo[iIndex].usVCID_Value); } } else { } iIndex = iIndex + 1; ldv_47175: ; if (iIndex <= 15) { goto ldv_47174; } else { goto ldv_47176; } ldv_47176: atomic_set(& Adapter->uiMBupdate, 0); return; } } void flush_queue(struct bcm_mini_adapter *Adapter , unsigned int iQIndex ) { struct sk_buff *PacketToDrop ; struct net_device_stats *netstats ; int tmp ; { PacketToDrop = 0; netstats = & (Adapter->dev)->stats; spin_lock_bh(& Adapter->PackInfo[iQIndex].SFQueueLock); goto ldv_47184; ldv_47183: PacketToDrop = Adapter->PackInfo[iQIndex].ldv_45950.ldv_45945.FirstTxQueue; if ((unsigned long )PacketToDrop != (unsigned long )((struct sk_buff *)0) && PacketToDrop->len != 0U) { netstats->tx_dropped = netstats->tx_dropped + 1UL; if ((unsigned long )Adapter->PackInfo[iQIndex].ldv_45950.ldv_45945.FirstTxQueue != (unsigned long )((struct sk_buff *)0)) { if ((unsigned long )(Adapter->PackInfo[iQIndex].ldv_45950.ldv_45945.FirstTxQueue)->next == (unsigned long )((struct sk_buff *)0)) { Adapter->PackInfo[iQIndex].ldv_45950.ldv_45945.LastTxQueue = 0; } else { } Adapter->PackInfo[iQIndex].ldv_45950.ldv_45945.FirstTxQueue = (Adapter->PackInfo[iQIndex].ldv_45950.ldv_45945.FirstTxQueue)->next; } else { } Adapter->PackInfo[iQIndex].uiCurrentPacketsOnHost = Adapter->PackInfo[iQIndex].uiCurrentPacketsOnHost - 1U; Adapter->PackInfo[iQIndex].uiCurrentBytesOnHost = Adapter->PackInfo[iQIndex].uiCurrentBytesOnHost - PacketToDrop->len; Adapter->PackInfo[iQIndex].uiDroppedCountBytes = Adapter->PackInfo[iQIndex].uiDroppedCountBytes + PacketToDrop->len; Adapter->PackInfo[iQIndex].uiDroppedCountPackets = Adapter->PackInfo[iQIndex].uiDroppedCountPackets + 1U; consume_skb(PacketToDrop); atomic_dec(& Adapter->TotalPacketCount); } else { } ldv_47184: ; if ((unsigned long )Adapter->PackInfo[iQIndex].ldv_45950.ldv_45945.FirstTxQueue != (unsigned long )((struct sk_buff *)0)) { tmp = atomic_read((atomic_t const *)(& Adapter->TotalPacketCount)); if (tmp != 0) { goto ldv_47183; } else { goto ldv_47185; } } else { goto ldv_47185; } ldv_47185: spin_unlock_bh(& Adapter->PackInfo[iQIndex].SFQueueLock); return; } } static void beceem_protocol_reset(struct bcm_mini_adapter *Adapter ) { int i ; { if ((Adapter->msg_enable & 4U) != 0U) { printk("\rbeceem %s: protocol reset\n", (char *)(& (Adapter->dev)->name)); } else { } netif_carrier_off(Adapter->dev); netif_stop_queue(Adapter->dev); Adapter->IdleMode = 0; Adapter->LinkUpStatus = 0; ClearTargetDSXBuffer(Adapter, 0, 1); i = 0; goto ldv_47191; ldv_47190: DeleteAllClassifiersForSF(Adapter, (UINT )i); i = i + 1; ldv_47191: ; if (i <= 15) { goto ldv_47190; } else { goto ldv_47192; } ldv_47192: flush_all_queues(Adapter); if ((int )((signed char )Adapter->TimerActive) == 1) { Adapter->TimerActive = 0; } else { } memset((void *)(& Adapter->astFragmentedPktClassifierTable), 0, 10240UL); i = 0; goto ldv_47194; ldv_47193: memset((void *)(& Adapter->PackInfo[i].stMibsExtServiceFlowTable), 0, 84UL); i = i + 1; ldv_47194: ; if (i <= 15) { goto ldv_47193; } else { goto ldv_47195; } ldv_47195: ; return; } } void ldv_mutex_lock_219(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_220(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_221(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_device(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_222(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___2 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex_of_device(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_223(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_device(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_224(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_225(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_free_netdev_226(struct net_device *dev ) { { free_netdev(dev); ldv_state_variable_3 = 0; return; } } int ldv_mutex_trylock_238(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_236(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_239(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_241(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_235(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_237(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_240(struct mutex *ldv_func_arg1 ) ; extern void sort(void * , size_t , size_t , int (*)(void const * , void const * ) , void (*)(void * , void * , int ) ) ; static int compare_packet_info(void const *a , void const *b ) { struct bcm_packet_info const *pa ; struct bcm_packet_info const *pb ; { pa = (struct bcm_packet_info const *)a; pb = (struct bcm_packet_info const *)b; if ((int )((signed char )pa->bValid) == 0 || (int )((signed char )pb->bValid) == 0) { return (0); } else { } return ((int )pa->u8TrafficPriority - (int )pb->u8TrafficPriority); } } VOID SortPackInfo(struct bcm_mini_adapter *Adapter ) { { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:<=======", "SortPackInfo"); } else { } sort((void *)(& Adapter->PackInfo), 17UL, 384UL, & compare_packet_info, 0); return; } } static int compare_classifiers(void const *a , void const *b ) { struct bcm_classifier_rule const *pa ; struct bcm_classifier_rule const *pb ; { pa = (struct bcm_classifier_rule const *)a; pb = (struct bcm_classifier_rule const *)b; if ((int )((signed char )pa->bUsed) == 0 || (int )((signed char )pb->bUsed) == 0) { return (0); } else { } return ((int )pa->u8ClassifierRulePriority - (int )pb->u8ClassifierRulePriority); } } VOID SortClassifiers(struct bcm_mini_adapter *Adapter ) { { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 536870912U) != 0U) { printk("\017%s:<=======", "SortClassifiers"); } else { } sort((void *)(& Adapter->astClassifierTable), 100UL, 1216UL, & compare_classifiers, 0); return; } } void ldv_mutex_lock_235(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_236(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_237(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_device(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_238(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___2 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex_of_device(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_239(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_device(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_240(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_241(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } extern void *memdup_user(void const * , size_t ) ; extern size_t strlen(char const * ) ; int ldv_mutex_trylock_252(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_250(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_253(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_255(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_249(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_251(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_254(struct mutex *ldv_func_arg1 ) ; __inline static struct thread_info *current_thread_info___0(void) { struct thread_info *ti ; unsigned long pfo_ret__ ; { switch (8UL) { case 1: __asm__ ("movb %%gs:%P1,%0": "=q" (pfo_ret__): "p" (& kernel_stack)); goto ldv_6158; case 2: __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_6158; case 4: __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_6158; case 8: __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_6158; default: __bad_percpu_size(); } ldv_6158: ti = (struct thread_info *)(pfo_ret__ - 8152UL); return (ti); } } extern int __register_chrdev(unsigned int , unsigned int , unsigned int , char const * , struct file_operations const * ) ; extern void __unregister_chrdev(unsigned int , unsigned int , unsigned int , char const * ) ; __inline static int register_chrdev(unsigned int major , char const *name , struct file_operations const *fops ) { int tmp ; { tmp = __register_chrdev(major, 0U, 256U, name, fops); return (tmp); } } __inline static int ldv_register_chrdev_256(unsigned int major , char const *name , struct file_operations const *fops ) ; __inline static void unregister_chrdev(unsigned int major , char const *name ) { { __unregister_chrdev(major, 0U, 256U, name); return; } } __inline static void ldv_unregister_chrdev_257(unsigned int major , char const *name ) ; __inline static void ldv_unregister_chrdev_257(unsigned int major , char const *name ) ; extern loff_t no_llseek(struct file * , loff_t , int ) ; extern int nonseekable_open(struct inode * , struct file * ) ; extern struct device *device_create(struct class * , struct device * , dev_t , void * , char const * , ...) ; extern void device_destroy(struct class * , dev_t ) ; extern void kfree_skb(struct sk_buff * ) ; int ProcessGetHostMibs(struct bcm_mini_adapter *Adapter , struct bcm_host_stats_mibs *pstHostMibs ) ; void GetDroppedAppCntrlPktMibs(struct bcm_host_stats_mibs *pstHostMibs , struct bcm_tarang_data *pTarang ) ; INT BeceemNVMRead(struct bcm_mini_adapter *Adapter , PUINT pBuffer , unsigned int uiOffset , unsigned int uiNumBytes ) ; INT BeceemNVMWrite(struct bcm_mini_adapter *Adapter , PUINT pBuffer , unsigned int uiOffset , unsigned int uiNumBytes , BOOLEAN bVerify ) ; INT BcmUpdateSectorSize(struct bcm_mini_adapter *Adapter , unsigned int uiSectorSize ) ; BOOLEAN IsSectionExistInFlash(struct bcm_mini_adapter *Adapter , enum bcm_flash2x_section_val section ) ; INT BcmGetFlash2xSectionalBitMap(struct bcm_mini_adapter *Adapter , struct bcm_flash2x_bitmap *psFlash2xBitMap ) ; INT BcmFlash2xBulkWrite(struct bcm_mini_adapter *Adapter , PUINT pBuffer , enum bcm_flash2x_section_val eFlash2xSectVal , unsigned int uiOffset , unsigned int uiNumBytes , unsigned int bVerify ) ; INT BcmFlash2xBulkRead(struct bcm_mini_adapter *Adapter , PUINT pBuffer , enum bcm_flash2x_section_val eFlash2xSectionVal , unsigned int uiOffsetWithinSectionVal , unsigned int uiNumBytes ) ; INT BcmGetSectionValStartOffset(struct bcm_mini_adapter *Adapter , enum bcm_flash2x_section_val eFlashSectionVal ) ; INT BcmSetActiveSection(struct bcm_mini_adapter *Adapter , enum bcm_flash2x_section_val eFlash2xSectVal ) ; INT BcmCopyISO(struct bcm_mini_adapter *Adapter , struct bcm_flash2x_copy_section sCopySectStrut ) ; INT BcmFlash2xCorruptSig(struct bcm_mini_adapter *Adapter , enum bcm_flash2x_section_val eFlash2xSectionVal ) ; INT BcmFlash2xWriteSig(struct bcm_mini_adapter *Adapter , enum bcm_flash2x_section_val eFlashSectionVal ) ; INT validateFlash2xReadWrite(struct bcm_mini_adapter *Adapter , struct bcm_flash2x_readwrite *psFlash2xReadWrite ) ; INT IsFlash2x(struct bcm_mini_adapter *Adapter ) ; INT BcmCopySection(struct bcm_mini_adapter *Adapter , enum bcm_flash2x_section_val SrcSection , enum bcm_flash2x_section_val DstSection , unsigned int offset , unsigned int numOfBytes ) ; BOOLEAN IsNonCDLessDevice(struct bcm_mini_adapter *Adapter ) ; BOOLEAN IsReqGpioIsLedInNVM(struct bcm_mini_adapter *Adapter , UINT gpios ) ; INT vendorextnIoctl(struct bcm_mini_adapter *Adapter , UINT cmd , ULONG arg ) ; static int bcm_char_open(struct inode *inode , struct file *filp ) { struct bcm_mini_adapter *Adapter ; struct bcm_tarang_data *pTarang ; void *tmp ; void *tmp___0 ; { Adapter = 0; pTarang = 0; tmp = netdev_priv((struct net_device const *)gblpnetdev); Adapter = (struct bcm_mini_adapter *)tmp; tmp___0 = kzalloc(112UL, 208U); pTarang = (struct bcm_tarang_data *)tmp___0; if ((unsigned long )pTarang == (unsigned long )((struct bcm_tarang_data *)0)) { return (-12); } else { } pTarang->Adapter = Adapter; pTarang->RxCntrlMsgBitMask = 4294965247UL; down(& Adapter->RxAppControlQueuelock); pTarang->next = Adapter->pTarangs; Adapter->pTarangs = pTarang; up(& Adapter->RxAppControlQueuelock); filp->private_data = (void *)pTarang; atomic_inc(& Adapter->ApplicationRunning); nonseekable_open(inode, filp); return (0); } } static int bcm_char_release(struct inode *inode , struct file *filp ) { struct bcm_tarang_data *pTarang ; struct bcm_tarang_data *tmp ; struct bcm_tarang_data *ptmp ; struct bcm_mini_adapter *Adapter ; struct sk_buff *pkt ; struct sk_buff *npkt ; { Adapter = 0; pTarang = (struct bcm_tarang_data *)filp->private_data; if ((unsigned long )pTarang == (unsigned long )((struct bcm_tarang_data *)0)) { printk("\016%s:ptarang is null\n", "bcm_char_release"); return (0); } else { } Adapter = pTarang->Adapter; down(& Adapter->RxAppControlQueuelock); tmp = Adapter->pTarangs; ptmp = 0; goto ldv_46856; ldv_46855: ; if ((unsigned long )tmp == (unsigned long )pTarang) { goto ldv_46854; } else { } ptmp = tmp; tmp = tmp->next; ldv_46856: ; if ((unsigned long )tmp != (unsigned long )((struct bcm_tarang_data *)0)) { goto ldv_46855; } else { goto ldv_46854; } ldv_46854: ; if ((unsigned long )tmp != (unsigned long )((struct bcm_tarang_data *)0)) { if ((unsigned long )ptmp == (unsigned long )((struct bcm_tarang_data *)0)) { Adapter->pTarangs = tmp->next; } else { ptmp->next = tmp->next; } } else { up(& Adapter->RxAppControlQueuelock); return (0); } pkt = pTarang->RxAppControlHead; goto ldv_46858; ldv_46857: npkt = pkt->next; kfree_skb(pkt); pkt = npkt; ldv_46858: ; if ((unsigned long )pkt != (unsigned long )((struct sk_buff *)0)) { goto ldv_46857; } else { goto ldv_46859; } ldv_46859: up(& Adapter->RxAppControlQueuelock); atomic_dec(& Adapter->ApplicationRunning); kfree((void const *)pTarang); filp->private_data = 0; return (0); } } static ssize_t bcm_char_read(struct file *filp , char *buf , size_t size , loff_t *f_pos ) { struct bcm_tarang_data *pTarang ; struct bcm_mini_adapter *Adapter ; struct sk_buff *Packet ; ssize_t PktLen ; int wait_ret_val ; unsigned long ret ; int __ret ; wait_queue_t __wait ; struct task_struct *tmp ; struct task_struct *tmp___0 ; int tmp___1 ; size_t __min1 ; size_t __min2 ; size_t tmp___2 ; int tmp___3 ; struct task_struct *tmp___6 ; { pTarang = (struct bcm_tarang_data *)filp->private_data; Adapter = pTarang->Adapter; Packet = 0; PktLen = 0L; wait_ret_val = 0; ret = 0UL; __ret = 0; if ((unsigned long )pTarang->RxAppControlHead == (unsigned long )((struct sk_buff *)0) && (int )((signed char )Adapter->device_removed) == 0) { tmp = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; ldv_46876: prepare_to_wait(& Adapter->process_read_wait_queue, & __wait, 1); if ((unsigned long )pTarang->RxAppControlHead != (unsigned long )((struct sk_buff *)0) || (int )((signed char )Adapter->device_removed) != 0) { goto ldv_46874; } else { } tmp___0 = get_current(); tmp___1 = signal_pending(tmp___0); if (tmp___1 == 0) { schedule(); goto ldv_46875; } else { } __ret = -512; goto ldv_46874; ldv_46875: ; goto ldv_46876; ldv_46874: finish_wait(& Adapter->process_read_wait_queue, & __wait); } else { } wait_ret_val = __ret; if (wait_ret_val == -512) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:Exiting as i\'ve been asked to exit!!!\n", "bcm_char_read"); } else { } return ((ssize_t )wait_ret_val); } else { } if ((int )((signed char )Adapter->device_removed) != 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:Device Removed... Killing the Apps...\n", "bcm_char_read"); } else { } return (-19L); } else { } if ((int )((signed char )Adapter->fw_download_done) == 0) { return (-13L); } else { } down(& Adapter->RxAppControlQueuelock); if ((unsigned long )pTarang->RxAppControlHead != (unsigned long )((struct sk_buff *)0)) { Packet = pTarang->RxAppControlHead; if ((unsigned long )pTarang->RxAppControlHead != (unsigned long )((struct sk_buff *)0)) { if ((unsigned long )(pTarang->RxAppControlHead)->next == (unsigned long )((struct sk_buff *)0)) { pTarang->RxAppControlTail = 0; } else { } pTarang->RxAppControlHead = (pTarang->RxAppControlHead)->next; } else { } pTarang->AppCtrlQueueLen = pTarang->AppCtrlQueueLen - 1; } else { } up(& Adapter->RxAppControlQueuelock); if ((unsigned long )Packet != (unsigned long )((struct sk_buff *)0)) { PktLen = (ssize_t )Packet->len; __min1 = (size_t )PktLen; __min2 = size; if (__min1 < __min2) { tmp___2 = __min1; } else { tmp___2 = __min2; } tmp___3 = copy_to_user((void *)buf, (void const *)Packet->data, (unsigned int )tmp___2); ret = (unsigned long )tmp___3; if (ret != 0UL) { consume_skb(Packet); printk("\016%s:Returning from copy to user failure\n", "bcm_char_read"); return (-14L); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { tmp___6 = get_current(); printk("\017%s:Read %zd Bytes From Adapter packet = %p by process %d!\n", "bcm_char_read", PktLen, Packet, tmp___6->pid); } else { } consume_skb(Packet); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:<\n", "bcm_char_read"); } else { } return (PktLen); } } static long bcm_char_ioctl(struct file *filp , UINT cmd , ULONG arg ) { struct bcm_tarang_data *pTarang ; void *argp ; struct bcm_mini_adapter *Adapter ; INT Status ; int timeout ; struct bcm_ioctl_buffer IoBuffer ; int bytes ; unsigned long flag ; unsigned long roksum ; struct thread_info *tmp ; long tmp___0 ; unsigned long flag___0 ; unsigned long roksum___0 ; struct thread_info *tmp___1 ; long tmp___2 ; struct bcm_rdm_buffer sRdmBuffer ; PCHAR temp_buff ; UINT Bufflen ; u16 temp_value ; unsigned long tmp___3 ; unsigned long tmp___4 ; void *tmp___5 ; int tmp___6 ; struct bcm_wrm_buffer sWrmBuffer ; UINT uiTempVar ; unsigned long tmp___7 ; unsigned long tmp___8 ; struct bcm_rdm_buffer sRdmBuffer___0 ; PCHAR temp_buff___0 ; UINT uiTempVar___0 ; unsigned long tmp___9 ; unsigned long tmp___10 ; void *tmp___11 ; int tmp___12 ; struct bcm_wrm_buffer sWrmBuffer___0 ; UINT uiTempVar___1 ; unsigned long tmp___13 ; unsigned long tmp___14 ; UCHAR ucResetValue[4U] ; UINT value ; UINT uiBit ; UINT uiOperation ; struct bcm_gpio_info gpio_info ; unsigned long tmp___15 ; unsigned long tmp___16 ; BOOLEAN tmp___17 ; struct bcm_user_thread_req threadReq ; unsigned long tmp___18 ; unsigned long tmp___19 ; ULONG uiBit___0 ; UCHAR ucRead[4U] ; struct bcm_gpio_info gpio_info___0 ; unsigned long tmp___20 ; unsigned long tmp___21 ; UCHAR ucResetValue___0[4U] ; struct bcm_gpio_multi_info gpio_multi_info[2U] ; struct bcm_gpio_multi_info *pgpio_multi_info ; unsigned long tmp___22 ; unsigned long tmp___23 ; BOOLEAN tmp___24 ; UCHAR ucResetValue___1[4U] ; struct bcm_gpio_multi_mode gpio_multi_mode[2U] ; struct bcm_gpio_multi_mode *pgpio_multi_mode ; unsigned long tmp___25 ; unsigned long tmp___26 ; BOOLEAN tmp___27 ; PVOID pvBuffer ; unsigned long tmp___28 ; long tmp___29 ; long tmp___30 ; long __ret ; wait_queue_t __wait ; struct task_struct *tmp___31 ; struct task_struct *tmp___32 ; int tmp___33 ; int tmp___34 ; struct task_struct *tmp___35 ; int tmp___38 ; struct task_struct *tmp___39 ; unsigned long __ms ; unsigned long tmp___40 ; struct bcm_firmware_info *psFwInfo ; struct task_struct *tmp___41 ; int tmp___44 ; unsigned long tmp___45 ; void *tmp___46 ; unsigned long tmp___47 ; int tmp___48 ; int tmp___49 ; unsigned long __ms___0 ; unsigned long tmp___50 ; INT tmp___51 ; long __ret___0 ; wait_queue_t __wait___0 ; struct task_struct *tmp___52 ; int __ret_gu ; unsigned long __val_gu ; int __ret_gu___0 ; unsigned long __val_gu___0 ; INT NVMAccess ; int tmp___53 ; USHORT uiLoopIndex ; int __ret_gu___1 ; unsigned long __val_gu___1 ; int tmp___54 ; UINT uiData ; unsigned long tmp___55 ; ulong len ; unsigned long tmp___56 ; ulong __min1 ; ulong __min2 ; size_t tmp___57 ; ulong tmp___58 ; int tmp___59 ; LINK_STATE link_state ; unsigned long tmp___60 ; size_t __min1___0 ; size_t __min2___0 ; size_t tmp___61 ; int tmp___62 ; UINT tracing_flag ; unsigned long tmp___63 ; unsigned long tmp___64 ; ULONG ulSFId ; unsigned long tmp___65 ; unsigned long tmp___66 ; PVOID temp_buff___1 ; unsigned long tmp___67 ; int tmp___68 ; struct bcm_bulk_wrm_buffer *pBulkBuffer ; UINT uiTempVar___2 ; PCHAR pvBuffer___0 ; unsigned long tmp___69 ; void *tmp___70 ; long tmp___71 ; long tmp___72 ; unsigned long tmp___73 ; int tmp___74 ; UINT uiSectorSize ; unsigned long tmp___75 ; unsigned long tmp___76 ; int tmp___77 ; INT tmp___78 ; int tmp___79 ; struct bcm_nvm_readwrite stNVMReadWrite ; PUCHAR pReadData ; ULONG ulDSDMagicNumInUsrBuff ; struct timeval tv0 ; struct timeval tv1 ; INT tmp___80 ; unsigned long tmp___81 ; void *tmp___82 ; unsigned long tmp___83 ; void *tmp___84 ; long tmp___85 ; long tmp___86 ; int tmp___87 ; __u32 tmp___88 ; INT tmp___89 ; INT tmp___90 ; struct bcm_flash2x_readwrite sFlash2xRead ; PUCHAR pReadBuff ; UINT NOB ; UINT BuffSize ; UINT ReadBytes ; UINT ReadOffset ; void *OutPutBuff ; INT tmp___91 ; unsigned long tmp___92 ; unsigned long tmp___93 ; INT tmp___94 ; void *tmp___95 ; struct bcm_flash2x_readwrite sFlash2xWrite ; PUCHAR pWriteBuff ; void *InputAddr ; UINT NOB___0 ; UINT BuffSize___0 ; UINT WriteOffset ; UINT WriteBytes ; INT tmp___96 ; unsigned long tmp___97 ; unsigned long tmp___98 ; INT tmp___99 ; void *tmp___100 ; unsigned long tmp___101 ; struct bcm_flash2x_bitmap *psFlash2xBitMap ; unsigned long tmp___102 ; void *tmp___103 ; int tmp___104 ; enum bcm_flash2x_section_val eFlash2xSectionVal ; INT tmp___105 ; unsigned long tmp___106 ; unsigned long tmp___107 ; struct bcm_flash2x_copy_section sCopySectStrut ; INT tmp___108 ; unsigned long tmp___109 ; unsigned long tmp___110 ; BOOLEAN tmp___111 ; BOOLEAN tmp___112 ; BOOLEAN tmp___113 ; unsigned long tmp___114 ; int tmp___115 ; int tmp___116 ; INT tmp___117 ; UINT SectOfset ; enum bcm_flash2x_section_val eFlash2xSectionVal___0 ; INT tmp___118 ; unsigned long tmp___119 ; unsigned long tmp___120 ; INT tmp___121 ; struct bcm_nvm_readwrite stNVMRead ; INT NOB___1 ; INT BuffSize___1 ; INT ReadOffset___0 ; UINT ReadBytes___0 ; PUCHAR pReadBuff___0 ; void *OutPutBuff___0 ; unsigned long tmp___122 ; unsigned long tmp___123 ; void *tmp___124 ; ULONG RxCntrlMsgBitMask ; unsigned long tmp___125 ; unsigned long tmp___126 ; struct bcm_driver_info DevInfo ; unsigned long tmp___127 ; int tmp___128 ; struct bcm_time_elapsed stTimeElapsedSinceNetEntry ; unsigned long tmp___129 ; unsigned long tmp___130 ; int tmp___131 ; { pTarang = (struct bcm_tarang_data *)filp->private_data; argp = (void *)arg; Adapter = pTarang->Adapter; Status = -1; timeout = 0; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:Parameters Passed to control IOCTL cmd=0x%X arg=0x%lX", "bcm_char_ioctl", cmd, arg); } else { } if (((cmd >> 8) & 255U) != 107U) { return (-14L); } else { } if ((int )cmd < 0) { tmp = current_thread_info___0(); __asm__ ("add %3,%1 ; sbb %0,%0 ; cmp %1,%4 ; sbb $0,%0": "=&r" (flag), "=r" (roksum): "1" (argp), "g" ((long )(cmd >> 16) & 16383L), "rm" (tmp->addr_limit.seg)); tmp___0 = ldv__builtin_expect(flag == 0UL, 1L); Status = tmp___0 == 0L; } else if ((cmd & 1073741824U) != 0U) { tmp___1 = current_thread_info___0(); __asm__ ("add %3,%1 ; sbb %0,%0 ; cmp %1,%4 ; sbb $0,%0": "=&r" (flag___0), "=r" (roksum___0): "1" (argp), "g" ((long )(cmd >> 16) & 16383L), "rm" (tmp___1->addr_limit.seg)); tmp___2 = ldv__builtin_expect(flag___0 == 0UL, 1L); Status = tmp___2 == 0L; } else { Status = 0; } if (Status != 0) { return (-14L); } else { } if ((int )((signed char )Adapter->device_removed) != 0) { return (-14L); } else { } if ((int )((signed char )Adapter->fw_download_done) == 0) { switch (cmd) { case 1074031377: ; case 1074031370: ; case 1074031375: ; case 1074031373: ; case 1074031361: ; case 1074031372: ; case 1074031402: ; case 1074031403: ; return (-13L); default: ; goto ldv_46910; } ldv_46910: ; } else { } Status = vendorextnIoctl(Adapter, cmd, arg); if (Status != 65535) { return ((long )Status); } else { } switch (cmd) { case 1073834791: sRdmBuffer.Register = 0UL; sRdmBuffer.Length = 0UL; tmp___3 = copy_from_user((void *)(& IoBuffer), (void const *)argp, 32UL); if (tmp___3 != 0UL) { return (-14L); } else { } if (IoBuffer.InputLength > 16UL) { return (-22L); } else { } tmp___4 = copy_from_user((void *)(& sRdmBuffer), (void const *)IoBuffer.InputBuffer, IoBuffer.InputLength); if (tmp___4 != 0UL) { return (-14L); } else { } if (IoBuffer.OutputLength > 65535UL || IoBuffer.OutputLength == 0UL) { return (-22L); } else { } Bufflen = (UINT )IoBuffer.OutputLength; temp_value = 4U - ((unsigned int )((u16 )Bufflen) & 3U); Bufflen = ((UINT )temp_value & 3U) + Bufflen; tmp___5 = kmalloc((size_t )Bufflen, 208U); temp_buff = (PCHAR )tmp___5; if ((unsigned long )temp_buff == (unsigned long )((PCHAR )0)) { return (-12L); } else { } bytes = rdmalt(Adapter, (unsigned int )sRdmBuffer.Register, (unsigned int *)temp_buff, (size_t )Bufflen); if (bytes > 0) { Status = 0; tmp___6 = copy_to_user(IoBuffer.OutputBuffer, (void const *)temp_buff, (unsigned int )bytes); if (tmp___6 != 0) { kfree((void const *)temp_buff); return (-14L); } else { } } else { Status = bytes; } kfree((void const *)temp_buff); goto ldv_46916; case 1073834790: sWrmBuffer.Register = 0UL; sWrmBuffer.Length = 0UL; sWrmBuffer.Data[0] = (unsigned char)0; sWrmBuffer.Data[1] = (unsigned char)0; sWrmBuffer.Data[2] = (unsigned char)0; sWrmBuffer.Data[3] = (unsigned char)0; uiTempVar = 0U; tmp___7 = copy_from_user((void *)(& IoBuffer), (void const *)argp, 32UL); if (tmp___7 != 0UL) { return (-14L); } else { } if (IoBuffer.InputLength > 20UL) { return (-22L); } else { } tmp___8 = copy_from_user((void *)(& sWrmBuffer), (void const *)IoBuffer.InputBuffer, IoBuffer.InputLength); if (tmp___8 != 0UL) { return (-14L); } else { } uiTempVar = (UINT )sWrmBuffer.Register & 268435455U; if (((Adapter->pstargetparams)->m_u32Customize & 3U) == 0U && (((uiTempVar == 251670552U || uiTempVar == 251670556U) || uiTempVar == 251670536U) || uiTempVar == 251670560U)) { printk("\016%s:EEPROM Access Denied, not in VSG Mode\n", "bcm_char_ioctl"); return (-14L); } else { } Status = wrmalt(Adapter, (unsigned int )sWrmBuffer.Register, (unsigned int *)(& sWrmBuffer.Data), 8UL); if (Status == 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:WRM Done\n", "bcm_char_ioctl"); } else { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:WRM Failed\n", "bcm_char_ioctl"); } else { } Status = -14; } } else { } goto ldv_46916; case -2147194109: ; case -2147194023: sRdmBuffer___0.Register = 0UL; sRdmBuffer___0.Length = 0UL; temp_buff___0 = 0; uiTempVar___0 = 0U; if (((int )((signed char )Adapter->IdleMode) == 1 || (int )((signed char )Adapter->bShutStatus) == 1) || (int )((signed char )Adapter->bPreparingForLowPowerMode) == 1) { printk("\016%s:Device in Idle Mode, Blocking Rdms\n", "bcm_char_ioctl"); return (-13L); } else { } tmp___9 = copy_from_user((void *)(& IoBuffer), (void const *)argp, 32UL); if (tmp___9 != 0UL) { return (-14L); } else { } if (IoBuffer.InputLength > 16UL) { return (-22L); } else { } tmp___10 = copy_from_user((void *)(& sRdmBuffer___0), (void const *)IoBuffer.InputBuffer, IoBuffer.InputLength); if (tmp___10 != 0UL) { return (-14L); } else { } if (IoBuffer.OutputLength > 65535UL || IoBuffer.OutputLength == 0UL) { return (-22L); } else { } tmp___11 = kmalloc(IoBuffer.OutputLength, 208U); temp_buff___0 = (PCHAR )tmp___11; if ((unsigned long )temp_buff___0 == (unsigned long )((PCHAR )0)) { return (-1L); } else { } if ((sRdmBuffer___0.Register & 251658240UL) != 251658240UL || (sRdmBuffer___0.Register & 3UL) != 0UL) { printk("\016%s:RDM Done On invalid Address : %x Access Denied.\n", "bcm_char_ioctl", (int )sRdmBuffer___0.Register); kfree((void const *)temp_buff___0); return (-22L); } else { } uiTempVar___0 = (UINT )sRdmBuffer___0.Register & 268435455U; bytes = rdmaltWithLock(Adapter, (unsigned int )sRdmBuffer___0.Register, (unsigned int *)temp_buff___0, IoBuffer.OutputLength); if (bytes > 0) { Status = 0; tmp___12 = copy_to_user(IoBuffer.OutputBuffer, (void const *)temp_buff___0, (unsigned int )bytes); if (tmp___12 != 0) { kfree((void const *)temp_buff___0); return (-14L); } else { } } else { Status = bytes; } kfree((void const *)temp_buff___0); goto ldv_46916; case 1074031362: ; case 1074031448: sWrmBuffer___0.Register = 0UL; sWrmBuffer___0.Length = 0UL; sWrmBuffer___0.Data[0] = (unsigned char)0; sWrmBuffer___0.Data[1] = (unsigned char)0; sWrmBuffer___0.Data[2] = (unsigned char)0; sWrmBuffer___0.Data[3] = (unsigned char)0; uiTempVar___1 = 0U; if (((int )((signed char )Adapter->IdleMode) == 1 || (int )((signed char )Adapter->bShutStatus) == 1) || (int )((signed char )Adapter->bPreparingForLowPowerMode) == 1) { printk("\016%s:Device in Idle Mode, Blocking Wrms\n", "bcm_char_ioctl"); return (-13L); } else { } tmp___13 = copy_from_user((void *)(& IoBuffer), (void const *)argp, 32UL); if (tmp___13 != 0UL) { return (-14L); } else { } if (IoBuffer.InputLength > 20UL) { return (-22L); } else { } tmp___14 = copy_from_user((void *)(& sWrmBuffer___0), (void const *)IoBuffer.InputBuffer, IoBuffer.InputLength); if (tmp___14 != 0UL) { return (-14L); } else { } if ((sWrmBuffer___0.Register & 251658240UL) != 251658240UL || (sWrmBuffer___0.Register & 3UL) != 0UL) { printk("\016%s:WRM Done On invalid Address : %x Access Denied.\n", "bcm_char_ioctl", (int )sWrmBuffer___0.Register); return (-22L); } else { } uiTempVar___1 = (UINT )sWrmBuffer___0.Register & 268435455U; if ((((Adapter->pstargetparams)->m_u32Customize & 3U) == 0U && (((uiTempVar___1 == 251670552U || uiTempVar___1 == 251670556U) || uiTempVar___1 == 251670536U) || uiTempVar___1 == 251670560U)) && cmd == 1074031362U) { printk("\016%s:EEPROM Access Denied, not in VSG Mode\n", "bcm_char_ioctl"); return (-14L); } else { } Status = wrmaltWithLock(Adapter, (unsigned int )sWrmBuffer___0.Register, (unsigned int *)(& sWrmBuffer___0.Data), sWrmBuffer___0.Length); if (Status == 0) { printk("\016%s:WRM Done\n", "bcm_char_ioctl"); } else { } goto ldv_46916; case 1074031402: value = 0U; uiBit = 0U; uiOperation = 0U; gpio_info.uiGpioNumber = 0U; gpio_info.uiGpioValue = 0U; if (((int )((signed char )Adapter->IdleMode) == 1 || (int )((signed char )Adapter->bShutStatus) == 1) || (int )((signed char )Adapter->bPreparingForLowPowerMode) == 1) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:GPIO Can\'t be set/clear in Low power Mode", "bcm_char_ioctl"); } else { } return (-13L); } else { } tmp___15 = copy_from_user((void *)(& IoBuffer), (void const *)argp, 32UL); if (tmp___15 != 0UL) { return (-14L); } else { } if (IoBuffer.InputLength > 8UL) { return (-22L); } else { } tmp___16 = copy_from_user((void *)(& gpio_info), (void const *)IoBuffer.InputBuffer, IoBuffer.InputLength); if (tmp___16 != 0UL) { return (-14L); } else { } uiBit = gpio_info.uiGpioNumber; uiOperation = gpio_info.uiGpioValue; value = (UINT )(1 << (int )uiBit); tmp___17 = IsReqGpioIsLedInNVM(Adapter, value); if ((int )((signed char )tmp___17) == 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:Sorry, Requested GPIO<0x%X> is not correspond to LED !!!", "bcm_char_ioctl", value); } else { } Status = -22; goto ldv_46916; } else { } if (uiOperation != 0U) { Status = wrmaltWithLock(Adapter, 251658304U, & value, 4UL); if (Status == 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:Set the GPIO bit\n", "bcm_char_ioctl"); } else { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:Failed to set the %dth GPIO\n", "bcm_char_ioctl", uiBit); } else { } goto ldv_46916; } } else { } } else { Status = wrmaltWithLock(Adapter, 251658308U, & value, 4UL); if (Status == 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:Set the GPIO bit\n", "bcm_char_ioctl"); } else { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:Failed to clear the %dth GPIO\n", "bcm_char_ioctl", uiBit); } else { } goto ldv_46916; } } else { } } bytes = rdmaltWithLock(Adapter, 251658292U, (unsigned int *)(& ucResetValue), 4UL); if (bytes < 0) { Status = bytes; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:GPIO_MODE_REGISTER read failed", "bcm_char_ioctl"); } else { } goto ldv_46916; } else { Status = 0; } *((UINT *)(& ucResetValue)) = *((UINT *)(& ucResetValue)) | (UINT )(1 << (int )uiBit); Status = wrmaltWithLock(Adapter, 251658292U, (unsigned int *)(& ucResetValue), 4UL); if (Status == 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:Set the GPIO to output Mode\n", "bcm_char_ioctl"); } else { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:Failed to put GPIO in Output Mode\n", "bcm_char_ioctl"); } else { } goto ldv_46916; } } else { } goto ldv_46916; case 1074031480: threadReq.ThreadState = 0U; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:User made LED thread InActive", "bcm_char_ioctl"); } else { } if (((int )((signed char )Adapter->IdleMode) == 1 || (int )((signed char )Adapter->bShutStatus) == 1) || (int )((signed char )Adapter->bPreparingForLowPowerMode) == 1) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:GPIO Can\'t be set/clear in Low power Mode", "bcm_char_ioctl"); } else { } Status = -13; goto ldv_46916; } else { } tmp___18 = copy_from_user((void *)(& IoBuffer), (void const *)argp, 32UL); if (tmp___18 != 0UL) { return (-14L); } else { } if (IoBuffer.InputLength > 4UL) { return (-22L); } else { } tmp___19 = copy_from_user((void *)(& threadReq), (void const *)IoBuffer.InputBuffer, IoBuffer.InputLength); if (tmp___19 != 0UL) { return (-14L); } else { } if (Adapter->LEDInfo.led_thread_running != 0) { if (threadReq.ThreadState == 1U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:Activating thread req", "bcm_char_ioctl"); } else { } Adapter->DriverState = 512; } else { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:DeActivating Thread req.....", "bcm_char_ioctl"); } else { } Adapter->DriverState = 256; } __wake_up(& Adapter->LEDInfo.notify_led_event, 3U, 1, 0); } else { } goto ldv_46916; case 1074031403: uiBit___0 = 0UL; gpio_info___0.uiGpioNumber = 0U; gpio_info___0.uiGpioValue = 0U; if (((int )((signed char )Adapter->IdleMode) == 1 || (int )((signed char )Adapter->bShutStatus) == 1) || (int )((signed char )Adapter->bPreparingForLowPowerMode) == 1) { return (-13L); } else { } tmp___20 = copy_from_user((void *)(& IoBuffer), (void const *)argp, 32UL); if (tmp___20 != 0UL) { return (-14L); } else { } if (IoBuffer.InputLength > 8UL) { return (-22L); } else { } tmp___21 = copy_from_user((void *)(& gpio_info___0), (void const *)IoBuffer.InputBuffer, IoBuffer.InputLength); if (tmp___21 != 0UL) { return (-14L); } else { } uiBit___0 = (ULONG )gpio_info___0.uiGpioNumber; bytes = rdmaltWithLock(Adapter, 251658296U, (unsigned int *)(& ucRead), 4UL); if (bytes < 0) { Status = bytes; printk("\016%s:RDM Failed\n", "bcm_char_ioctl"); return ((long )Status); } else { Status = 0; } goto ldv_46916; case 1075866413: pgpio_multi_info = (struct bcm_gpio_multi_info *)(& gpio_multi_info); memset((void *)pgpio_multi_info, 0, 24UL); if (((int )((signed char )Adapter->IdleMode) == 1 || (int )((signed char )Adapter->bShutStatus) == 1) || (int )((signed char )Adapter->bPreparingForLowPowerMode) == 1) { return (-22L); } else { } tmp___22 = copy_from_user((void *)(& IoBuffer), (void const *)argp, 32UL); if (tmp___22 != 0UL) { return (-14L); } else { } if (IoBuffer.InputLength > 24UL) { return (-22L); } else { } tmp___23 = copy_from_user((void *)(& gpio_multi_info), (void const *)IoBuffer.InputBuffer, IoBuffer.InputLength); if (tmp___23 != 0UL) { return (-14L); } else { } tmp___24 = IsReqGpioIsLedInNVM(Adapter, pgpio_multi_info->uiGPIOMask); if ((int )((signed char )tmp___24) == 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:Sorry, Requested GPIO<0x%X> is not correspond to NVM LED bit map<0x%X>!!!", "bcm_char_ioctl", pgpio_multi_info->uiGPIOMask, Adapter->gpioBitMap); } else { } Status = -22; goto ldv_46916; } else { } if ((pgpio_multi_info->uiGPIOMask & pgpio_multi_info->uiGPIOCommand) != 0U) { *((UINT *)(& ucResetValue___0)) = (pgpio_multi_info->uiGPIOMask & pgpio_multi_info->uiGPIOCommand) & pgpio_multi_info->uiGPIOValue; if (*((UINT *)(& ucResetValue___0)) != 0U) { Status = wrmaltWithLock(Adapter, 251658304U, (unsigned int *)(& ucResetValue___0), 8UL); } else { } if (Status != 0) { printk("\016%s:WRM to BCM_GPIO_OUTPUT_SET_REG Failed.", "bcm_char_ioctl"); return ((long )Status); } else { } *((UINT *)(& ucResetValue___0)) = (pgpio_multi_info->uiGPIOMask & pgpio_multi_info->uiGPIOCommand) & ~ pgpio_multi_info->uiGPIOValue; if (*((UINT *)(& ucResetValue___0)) != 0U) { Status = wrmaltWithLock(Adapter, 251658308U, (unsigned int *)(& ucResetValue___0), 8UL); } else { } if (Status != 0) { printk("\016%s:WRM to BCM_GPIO_OUTPUT_CLR_REG Failed.", "bcm_char_ioctl"); return ((long )Status); } else { } } else { } if (pgpio_multi_info->uiGPIOMask != 0U) { bytes = rdmaltWithLock(Adapter, 251658296U, (unsigned int *)(& ucResetValue___0), 4UL); if (bytes < 0) { Status = bytes; printk("\016%s:RDM to GPIO_PIN_STATE_REGISTER Failed.", "bcm_char_ioctl"); return ((long )Status); } else { Status = 0; } pgpio_multi_info->uiGPIOValue = *((UINT *)(& ucResetValue___0)) & pgpio_multi_info->uiGPIOMask; } else { } Status = copy_to_user(IoBuffer.OutputBuffer, (void const *)(& gpio_multi_info), (unsigned int )IoBuffer.OutputLength); if (Status != 0) { printk("\016%s:Failed while copying Content to IOBufer for user space err:%d", "bcm_char_ioctl", Status); return (-14L); } else { } goto ldv_46916; case 1075866414: pgpio_multi_mode = (struct bcm_gpio_multi_mode *)(& gpio_multi_mode); if (((int )((signed char )Adapter->IdleMode) == 1 || (int )((signed char )Adapter->bShutStatus) == 1) || (int )((signed char )Adapter->bPreparingForLowPowerMode) == 1) { return (-22L); } else { } tmp___25 = copy_from_user((void *)(& IoBuffer), (void const *)argp, 32UL); if (tmp___25 != 0UL) { return (-14L); } else { } if (IoBuffer.InputLength > 16UL) { return (-22L); } else { } tmp___26 = copy_from_user((void *)(& gpio_multi_mode), (void const *)IoBuffer.InputBuffer, IoBuffer.InputLength); if (tmp___26 != 0UL) { return (-14L); } else { } bytes = rdmaltWithLock(Adapter, 251658292U, (unsigned int *)(& ucResetValue___1), 4UL); if (bytes < 0) { Status = bytes; printk("\016%s:Read of GPIO_MODE_REGISTER failed", "bcm_char_ioctl"); return ((long )Status); } else { Status = 0; } tmp___27 = IsReqGpioIsLedInNVM(Adapter, pgpio_multi_mode->uiGPIOMask); if ((int )((signed char )tmp___27) == 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:Sorry, Requested GPIO<0x%X> is not correspond to NVM LED bit map<0x%X>!!!", "bcm_char_ioctl", pgpio_multi_mode->uiGPIOMask, Adapter->gpioBitMap); } else { } Status = -22; goto ldv_46916; } else { } if (pgpio_multi_mode->uiGPIOMask != 0U) { *((UINT *)(& ucResetValue___1)) = *((UINT *)(& ucResetValue___1)) | (pgpio_multi_mode->uiGPIOMode & pgpio_multi_mode->uiGPIOMask); *((UINT *)(& ucResetValue___1)) = *((UINT *)(& ucResetValue___1)) & ~ (~ pgpio_multi_mode->uiGPIOMode & pgpio_multi_mode->uiGPIOMask); pgpio_multi_mode->uiGPIOMode = *((UINT *)(& ucResetValue___1)); Status = wrmaltWithLock(Adapter, 251658292U, (unsigned int *)(& ucResetValue___1), 8UL); if (Status == 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:WRM to GPIO_MODE_REGISTER Done", "bcm_char_ioctl"); } else { printk("\016%s:WRM to GPIO_MODE_REGISTER Failed", "bcm_char_ioctl"); Status = -14; goto ldv_46916; } } else { } } else { pgpio_multi_mode->uiGPIOMode = *((UINT *)(& ucResetValue___1)); } Status = copy_to_user(IoBuffer.OutputBuffer, (void const *)(& gpio_multi_mode), (unsigned int )IoBuffer.OutputLength); if (Status != 0) { printk("\016%s:Failed while copying Content to IOBufer for user space err:%d", "bcm_char_ioctl", Status); return (-14L); } else { } goto ldv_46916; case 1074031377: ; case 1074031370: ; case 1074031375: ; case 1074031373: ; case 1074031361: ; case 1074031372: pvBuffer = 0; tmp___28 = copy_from_user((void *)(& IoBuffer), (void const *)argp, 32UL); if (tmp___28 != 0UL) { return (-14L); } else { } if (IoBuffer.InputLength <= 11UL) { return (-22L); } else { } if (IoBuffer.InputLength > 2048UL) { return (-22L); } else { } pvBuffer = memdup_user((void const *)IoBuffer.InputBuffer, IoBuffer.InputLength); tmp___30 = IS_ERR((void const *)pvBuffer); if (tmp___30 != 0L) { tmp___29 = PTR_ERR((void const *)pvBuffer); return (tmp___29); } else { } down(& Adapter->LowPowerModeSync); __ret = 250L; if ((int )((signed char )Adapter->bPreparingForLowPowerMode) != 0) { tmp___31 = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp___31; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; ldv_46960: prepare_to_wait(& Adapter->lowpower_mode_wait_queue, & __wait, 1); if ((int )((signed char )Adapter->bPreparingForLowPowerMode) == 0) { goto ldv_46958; } else { } tmp___32 = get_current(); tmp___33 = signal_pending(tmp___32); if (tmp___33 == 0) { __ret = schedule_timeout(__ret); if (__ret == 0L) { goto ldv_46958; } else { } goto ldv_46959; } else { } __ret = -512L; goto ldv_46958; ldv_46959: ; goto ldv_46960; ldv_46958: finish_wait(& Adapter->lowpower_mode_wait_queue, & __wait); } else { } Status = (INT )__ret; if (Status == -512) { goto cntrlEnd; } else { } if ((int )((signed char )Adapter->bPreparingForLowPowerMode) != 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:Preparing Idle Mode is still True - Hence Rejecting control message\n", "bcm_char_ioctl"); } else { } Status = -1; goto cntrlEnd; } else { } Status = CopyBufferToControlPacket(Adapter, pvBuffer); cntrlEnd: up(& Adapter->LowPowerModeSync); kfree((void const *)pvBuffer); goto ldv_46916; case 1074031445: tmp___34 = down_trylock(& Adapter->NVMRdmWrmLock); if (tmp___34 != 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:IOCTL_BCM_CHIP_RESET not allowed as EEPROM Read/Write is in progress\n", "bcm_char_ioctl"); } else { } return (-13L); } else { } tmp___35 = get_current(); printk("\016%s:Starting the firmware download PID =0x%x!!!!\n", "bcm_char_ioctl", tmp___35->pid); tmp___38 = down_trylock(& Adapter->fw_download_sema); if (tmp___38 != 0) { return (-16L); } else { } Adapter->bBinDownloaded = 0; tmp___39 = get_current(); Adapter->fw_download_process_pid = tmp___39->pid; Adapter->bCfgDownloaded = 0; Adapter->fw_download_done = 0; netif_carrier_off(Adapter->dev); netif_stop_queue(Adapter->dev); Status = reset_card_proc(Adapter); if (Status != 0) { printk("\vbeceem %s: reset_card_proc Failed!\n", (char *)(& (Adapter->dev)->name)); up(& Adapter->fw_download_sema); up(& Adapter->NVMRdmWrmLock); return ((long )Status); } else { } __ms = 10UL; goto ldv_46966; ldv_46965: __const_udelay(4295000UL); ldv_46966: tmp___40 = __ms; __ms = __ms - 1UL; if (tmp___40 != 0UL) { goto ldv_46965; } else { goto ldv_46967; } ldv_46967: up(& Adapter->NVMRdmWrmLock); return ((long )Status); case 1074031446: psFwInfo = 0; tmp___41 = get_current(); printk("\016%s:Starting the firmware download PID =0x%x!!!!\n", "bcm_char_ioctl", tmp___41->pid); tmp___44 = down_trylock(& Adapter->fw_download_sema); if (tmp___44 == 0) { printk("\016%s:Invalid way to download buffer. Use Start and then call this!!!\n", "bcm_char_ioctl"); up(& Adapter->fw_download_sema); Status = -22; return ((long )Status); } else { } tmp___45 = copy_from_user((void *)(& IoBuffer), (void const *)argp, 32UL); if (tmp___45 != 0UL) { up(& Adapter->fw_download_sema); return (-14L); } else { } printk("\016%s:Length for FW DLD is : %lx\n", "bcm_char_ioctl", IoBuffer.InputLength); if (IoBuffer.InputLength > 24UL) { up(& Adapter->fw_download_sema); return (-22L); } else { } tmp___46 = kmalloc(24UL, 208U); psFwInfo = (struct bcm_firmware_info *)tmp___46; if ((unsigned long )psFwInfo == (unsigned long )((struct bcm_firmware_info *)0)) { up(& Adapter->fw_download_sema); return (-12L); } else { } tmp___47 = copy_from_user((void *)psFwInfo, (void const *)IoBuffer.InputBuffer, IoBuffer.InputLength); if (tmp___47 != 0UL) { up(& Adapter->fw_download_sema); kfree((void const *)psFwInfo); return (-14L); } else { } if ((unsigned long )psFwInfo->pvMappedFirmwareAddress == (unsigned long )((void *)0) || psFwInfo->u32FirmwareLength == 0UL) { printk("\016%s:Something else is wrong %lu\n", "bcm_char_ioctl", psFwInfo->u32FirmwareLength); up(& Adapter->fw_download_sema); kfree((void const *)psFwInfo); Status = -22; return ((long )Status); } else { } Status = bcm_ioctl_fw_download(Adapter, psFwInfo); if (Status != 0) { if (psFwInfo->u32StartingAddress == 3210784768UL) { printk("\016%s:IOCTL: Configuration File Upload Failed\n", "bcm_char_ioctl"); } else { } if (Adapter->LEDInfo.led_thread_running & 1) { Adapter->DriverState = 1; Adapter->LEDInfo.bLedInitDone = 0; __wake_up(& Adapter->LEDInfo.notify_led_event, 3U, 1, 0); } else { } } else { } if (Status != 0) { up(& Adapter->fw_download_sema); } else { } printk("\016%s:IOCTL: Firmware File Uploaded\n", "bcm_char_ioctl"); kfree((void const *)psFwInfo); return ((long )Status); case 1074031447: tmp___48 = down_trylock(& Adapter->fw_download_sema); if (tmp___48 == 0) { up(& Adapter->fw_download_sema); return (-22L); } else { } tmp___49 = down_trylock(& Adapter->NVMRdmWrmLock); if (tmp___49 != 0) { printk("\016%s:FW download blocked as EEPROM Read/Write is in progress\n", "bcm_char_ioctl"); up(& Adapter->fw_download_sema); return (-13L); } else { } Adapter->bBinDownloaded = 1; Adapter->bCfgDownloaded = 1; atomic_set(& Adapter->CurrNumFreeTxDesc, 0); Adapter->CurrNumRecvDescs = 0U; Adapter->downloadDDR = 0; Status = run_card_proc(Adapter); if (Status != 0) { printk("\016%s:Firm Download Failed\n", "bcm_char_ioctl"); up(& Adapter->fw_download_sema); up(& Adapter->NVMRdmWrmLock); return ((long )Status); } else if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:Firm Download Over...\n", "bcm_char_ioctl"); } else { } __ms___0 = 10UL; goto ldv_46973; ldv_46972: __const_udelay(4295000UL); ldv_46973: tmp___50 = __ms___0; __ms___0 = __ms___0 - 1UL; if (tmp___50 != 0UL) { goto ldv_46972; } else { goto ldv_46974; } ldv_46974: tmp___51 = StartInterruptUrb((struct bcm_interface_adapter *)Adapter->pvInterfaceAdapter); if (tmp___51 != 0) { printk("\016%s:Unable to send interrupt...\n", "bcm_char_ioctl"); } else { } timeout = 1250; Adapter->waiting_to_fw_download_done = 0; __ret___0 = (long )timeout; if ((int )((signed char )Adapter->waiting_to_fw_download_done) == 0) { tmp___52 = get_current(); __wait___0.flags = 0U; __wait___0.private = (void *)tmp___52; __wait___0.func = & autoremove_wake_function; __wait___0.task_list.next = & __wait___0.task_list; __wait___0.task_list.prev = & __wait___0.task_list; ldv_46978: prepare_to_wait(& Adapter->ioctl_fw_dnld_wait_queue, & __wait___0, 2); if ((int )((signed char )Adapter->waiting_to_fw_download_done) != 0) { goto ldv_46977; } else { } __ret___0 = schedule_timeout(__ret___0); if (__ret___0 == 0L) { goto ldv_46977; } else { } goto ldv_46978; ldv_46977: finish_wait(& Adapter->ioctl_fw_dnld_wait_queue, & __wait___0); } else { } Adapter->fw_download_process_pid = -1; Adapter->fw_download_done = 1; atomic_set(& Adapter->CurrNumFreeTxDesc, 0); Adapter->CurrNumRecvDescs = 0U; Adapter->PrevNumRecvDescs = 0U; atomic_set(& Adapter->cntrlpktCnt, 0); Adapter->LinkUpStatus = 0; Adapter->LinkStatus = 0U; if (Adapter->LEDInfo.led_thread_running & 1) { Adapter->DriverState = 4; __wake_up(& Adapter->LEDInfo.notify_led_event, 3U, 1, 0); } else { } if (timeout == 0) { Status = -19; } else { } up(& Adapter->fw_download_sema); up(& Adapter->NVMRdmWrmLock); return ((long )Status); case 1074293528: Status = 0; might_fault(); switch (8UL) { case 1: __asm__ volatile ("call __get_user_1": "=a" (__ret_gu), "=d" (__val_gu): "0" ((unsigned long *)arg)); goto ldv_46984; case 2: __asm__ volatile ("call __get_user_2": "=a" (__ret_gu), "=d" (__val_gu): "0" ((unsigned long *)arg)); goto ldv_46984; case 4: __asm__ volatile ("call __get_user_4": "=a" (__ret_gu), "=d" (__val_gu): "0" ((unsigned long *)arg)); goto ldv_46984; case 8: __asm__ volatile ("call __get_user_8": "=a" (__ret_gu), "=d" (__val_gu): "0" ((unsigned long *)arg)); goto ldv_46984; default: __asm__ volatile ("call __get_user_X": "=a" (__ret_gu), "=d" (__val_gu): "0" ((unsigned long *)arg)); goto ldv_46984; } ldv_46984: Adapter->BEBucketSize = __val_gu; if (__ret_gu != 0) { Status = -14; } else { } goto ldv_46916; case 1074293529: Status = 0; might_fault(); switch (8UL) { case 1: __asm__ volatile ("call __get_user_1": "=a" (__ret_gu___0), "=d" (__val_gu___0): "0" ((unsigned long *)arg)); goto ldv_46994; case 2: __asm__ volatile ("call __get_user_2": "=a" (__ret_gu___0), "=d" (__val_gu___0): "0" ((unsigned long *)arg)); goto ldv_46994; case 4: __asm__ volatile ("call __get_user_4": "=a" (__ret_gu___0), "=d" (__val_gu___0): "0" ((unsigned long *)arg)); goto ldv_46994; case 8: __asm__ volatile ("call __get_user_8": "=a" (__ret_gu___0), "=d" (__val_gu___0): "0" ((unsigned long *)arg)); goto ldv_46994; default: __asm__ volatile ("call __get_user_X": "=a" (__ret_gu___0), "=d" (__val_gu___0): "0" ((unsigned long *)arg)); goto ldv_46994; } ldv_46994: Adapter->rtPSBucketSize = __val_gu___0; if (__ret_gu___0 != 0) { Status = -14; } else { } goto ldv_46916; case 27414: tmp___53 = down_trylock(& Adapter->NVMRdmWrmLock); NVMAccess = tmp___53; if (NVMAccess != 0) { printk("\016%s: IOCTL_BCM_CHIP_RESET not allowed as EEPROM Read/Write is in progress\n", "bcm_char_ioctl"); return (-13L); } else { } down(& Adapter->RxAppControlQueuelock); Status = reset_card_proc(Adapter); flushAllAppQ(); up(& Adapter->RxAppControlQueuelock); up(& Adapter->NVMRdmWrmLock); ResetCounters(Adapter); goto ldv_46916; case 1074293536: Status = 0; uiLoopIndex = 0U; goto ldv_47015; ldv_47014: might_fault(); switch (8UL) { case 1: __asm__ volatile ("call __get_user_1": "=a" (__ret_gu___1), "=d" (__val_gu___1): "0" ((unsigned long *)arg)); goto ldv_47007; case 2: __asm__ volatile ("call __get_user_2": "=a" (__ret_gu___1), "=d" (__val_gu___1): "0" ((unsigned long *)arg)); goto ldv_47007; case 4: __asm__ volatile ("call __get_user_4": "=a" (__ret_gu___1), "=d" (__val_gu___1): "0" ((unsigned long *)arg)); goto ldv_47007; case 8: __asm__ volatile ("call __get_user_8": "=a" (__ret_gu___1), "=d" (__val_gu___1): "0" ((unsigned long *)arg)); goto ldv_47007; default: __asm__ volatile ("call __get_user_X": "=a" (__ret_gu___1), "=d" (__val_gu___1): "0" ((unsigned long *)arg)); goto ldv_47007; } ldv_47007: Adapter->PackInfo[(int )uiLoopIndex].uiThreshold = (UINT )__val_gu___1; if (__ret_gu___1 != 0) { Status = -14; goto ldv_47013; } else { } uiLoopIndex = (USHORT )((int )uiLoopIndex + 1); ldv_47015: ; if ((unsigned int )uiLoopIndex <= 16U) { goto ldv_47014; } else { goto ldv_47013; } ldv_47013: ; goto ldv_46916; case 27425: DumpPackInfo(Adapter); DumpPhsRules(& Adapter->stBCMPhsContext); Status = 0; goto ldv_46916; case -2147194077: tmp___54 = copy_to_user(argp, (void const *)(& Adapter->PackInfo), 6528U); if (tmp___54 != 0) { return (-14L); } else { } Status = 0; goto ldv_46916; case 1074031369: uiData = 0U; tmp___55 = copy_from_user((void *)(& uiData), (void const *)argp, 4UL); if (tmp___55 != 0UL) { return (-14L); } else { } if (uiData != 0U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:IOCTL_BCM_SWITCH_TRANSFER_MODE: ETH_PACKET_TUNNELING_MODE\n", "bcm_char_ioctl"); } else { } Adapter->TransferMode = 1; } else { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:IOCTL_BCM_SWITCH_TRANSFER_MODE: IP_PACKET_ONLY_MODE\n", "bcm_char_ioctl"); } else { } Adapter->TransferMode = 0; } Status = 0; goto ldv_46916; case -2147194071: tmp___56 = copy_from_user((void *)(& IoBuffer), (void const *)argp, 32UL); if (tmp___56 != 0UL) { return (-14L); } else { } __min1 = IoBuffer.OutputLength; tmp___57 = strlen("5.2.45"); __min2 = tmp___57 + 1UL; if (__min1 < __min2) { tmp___58 = __min1; } else { tmp___58 = __min2; } len = tmp___58; tmp___59 = copy_to_user(IoBuffer.OutputBuffer, (void const *)"5.2.45", (unsigned int )len); if (tmp___59 != 0) { return (-14L); } else { } Status = 0; goto ldv_46916; case 1074031400: tmp___60 = copy_from_user((void *)(& IoBuffer), (void const *)argp, 32UL); if (tmp___60 != 0UL) { printk("\016%s:copy_from_user failed..\n", "bcm_char_ioctl"); return (-14L); } else { } if (IoBuffer.OutputLength != 3UL) { Status = -22; goto ldv_46916; } else { } memset((void *)(& link_state), 0, 3UL); link_state.bIdleMode = (UCHAR )Adapter->IdleMode; link_state.bShutdownMode = (UCHAR )Adapter->bShutStatus; link_state.ucLinkStatus = Adapter->LinkStatus; __min1___0 = 3UL; __min2___0 = IoBuffer.OutputLength; if (__min1___0 < __min2___0) { tmp___61 = __min1___0; } else { tmp___61 = __min2___0; } tmp___62 = copy_to_user(IoBuffer.OutputBuffer, (void const *)(& link_state), (unsigned int )tmp___61); if (tmp___62 != 0) { printk("\016%s:Copy_to_user Failed..\n", "bcm_char_ioctl"); return (-14L); } else { } Status = 0; goto ldv_46916; case 1074031404: tmp___63 = copy_from_user((void *)(& IoBuffer), (void const *)argp, 32UL); if (tmp___63 != 0UL) { return (-14L); } else { } tmp___64 = copy_from_user((void *)(& tracing_flag), (void const *)IoBuffer.InputBuffer, 4UL); if (tmp___64 != 0UL) { return (-14L); } else { } if (tracing_flag != 0U) { (Adapter->pTarangs)->MacTracingEnabled = 1; } else { (Adapter->pTarangs)->MacTracingEnabled = 0; } goto ldv_46916; case -2147194028: ulSFId = 0UL; tmp___65 = copy_from_user((void *)(& IoBuffer), (void const *)argp, 32UL); if (tmp___65 != 0UL) { return (-14L); } else { } if (IoBuffer.OutputLength <= 8459UL) { printk("\016%s:Mismatch req: %lx needed is =0x%zx!!!", "bcm_char_ioctl", IoBuffer.OutputLength, 8460UL); return (-22L); } else { } tmp___66 = copy_from_user((void *)(& ulSFId), (void const *)IoBuffer.InputBuffer, 8UL); if (tmp___66 != 0UL) { return (-14L); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:Get DSX Data SF ID is =%lx\n", "bcm_char_ioctl", ulSFId); } else { } get_dsx_sf_data_to_application(Adapter, (UINT )ulSFId, IoBuffer.OutputBuffer); Status = 0; goto ldv_46916; case 1074031443: tmp___67 = copy_from_user((void *)(& IoBuffer), (void const *)argp, 32UL); if (tmp___67 != 0UL) { return (-14L); } else { } if (IoBuffer.OutputLength != 122048UL) { printk("\016%s:Length Check failed %lu %zd\n", "bcm_char_ioctl", IoBuffer.OutputLength, 122048UL); return (-22L); } else { } temp_buff___1 = kzalloc(122048UL, 208U); if ((unsigned long )temp_buff___1 == (unsigned long )((PVOID )0)) { return (-1L); } else { } Status = ProcessGetHostMibs(Adapter, (struct bcm_host_stats_mibs *)temp_buff___1); GetDroppedAppCntrlPktMibs((struct bcm_host_stats_mibs *)temp_buff___1, pTarang); if (Status != -1) { tmp___68 = copy_to_user(IoBuffer.OutputBuffer, (void const *)temp_buff___1, 122048U); if (tmp___68 != 0) { kfree((void const *)temp_buff___1); return (-14L); } else { } } else { } kfree((void const *)temp_buff___1); goto ldv_46916; case -2147194016: ; if ((int )((signed char )Adapter->bTriedToWakeUpFromlowPowerMode) == 0 && (int )((signed char )Adapter->IdleMode) == 1) { Adapter->usIdleModePattern = 2U; Adapter->bWakeUpDevice = 1; __wake_up(& Adapter->process_rx_cntrlpkt, 3U, 1, 0); } else { } Status = 0; goto ldv_46916; case 1074031371: uiTempVar___2 = 0U; pvBuffer___0 = 0; if (((int )((signed char )Adapter->IdleMode) == 1 || (int )((signed char )Adapter->bShutStatus) == 1) || (int )((signed char )Adapter->bPreparingForLowPowerMode) == 1) { printk("\016%s:Device in Idle/Shutdown Mode, Blocking Wrms\n", "bcm_char_ioctl"); Status = -13; goto ldv_46916; } else { } tmp___69 = copy_from_user((void *)(& IoBuffer), (void const *)argp, 32UL); if (tmp___69 != 0UL) { return (-14L); } else { } if (IoBuffer.InputLength <= 15UL) { return (-22L); } else { } tmp___70 = memdup_user((void const *)IoBuffer.InputBuffer, IoBuffer.InputLength); pvBuffer___0 = (PCHAR )tmp___70; tmp___72 = IS_ERR((void const *)pvBuffer___0); if (tmp___72 != 0L) { tmp___71 = PTR_ERR((void const *)pvBuffer___0); return (tmp___71); } else { } pBulkBuffer = (struct bcm_bulk_wrm_buffer *)pvBuffer___0; if ((pBulkBuffer->Register & 251658240UL) != 251658240UL || (pBulkBuffer->Register & 3UL) != 0UL) { kfree((void const *)pvBuffer___0); printk("\016%s:WRM Done On invalid Address : %x Access Denied.\n", "bcm_char_ioctl", (int )pBulkBuffer->Register); Status = -22; goto ldv_46916; } else { } uiTempVar___2 = (UINT )pBulkBuffer->Register & 268435455U; if ((((Adapter->pstargetparams)->m_u32Customize & 3U) == 0U && (((uiTempVar___2 == 251670552U || uiTempVar___2 == 251670556U) || uiTempVar___2 == 251670536U) || uiTempVar___2 == 251670560U)) && cmd == 1074031362U) { kfree((void const *)pvBuffer___0); printk("\016%s:EEPROM Access Denied, not in VSG Mode\n", "bcm_char_ioctl"); Status = -14; goto ldv_46916; } else { } if (pBulkBuffer->SwapEndian == 0UL) { Status = wrmWithLock(Adapter, (unsigned int )pBulkBuffer->Register, (char *)(& pBulkBuffer->Values), IoBuffer.InputLength - 16UL); } else { Status = wrmaltWithLock(Adapter, (unsigned int )pBulkBuffer->Register, (unsigned int *)(& pBulkBuffer->Values), IoBuffer.InputLength - 16UL); } if (Status != 0) { printk("\016%s:WRM Failed\n", "bcm_char_ioctl"); } else { } kfree((void const *)pvBuffer___0); goto ldv_46916; case -2147194013: tmp___73 = copy_from_user((void *)(& IoBuffer), (void const *)argp, 32UL); if (tmp___73 != 0UL) { return (-14L); } else { } if ((unsigned int )Adapter->eNVMType == 1U || (unsigned int )Adapter->eNVMType == 2U) { tmp___74 = copy_to_user(IoBuffer.OutputBuffer, (void const *)(& Adapter->uiNVMDSDSize), 4U); if (tmp___74 != 0) { return (-14L); } else { } } else { } Status = 0; goto ldv_46916; case -2147194012: uiSectorSize = 0U; if ((unsigned int )Adapter->eNVMType == 2U) { tmp___75 = copy_from_user((void *)(& IoBuffer), (void const *)argp, 32UL); if (tmp___75 != 0UL) { return (-14L); } else { } tmp___76 = copy_from_user((void *)(& uiSectorSize), (void const *)IoBuffer.InputBuffer, 4UL); if (tmp___76 != 0UL) { return (-14L); } else { } if (uiSectorSize <= 1023U || uiSectorSize > 524288U) { tmp___79 = copy_to_user(IoBuffer.OutputBuffer, (void const *)(& Adapter->uiSectorSize), 4U); if (tmp___79 != 0) { return (-14L); } else { tmp___78 = IsFlash2x(Adapter); if (tmp___78 != 0) { tmp___77 = copy_to_user(IoBuffer.OutputBuffer, (void const *)(& Adapter->uiSectorSize), 4U); if (tmp___77 != 0) { return (-14L); } else { if ((int )((signed char )Adapter->bShutStatus) == 1 || (int )((signed char )Adapter->IdleMode) == 1) { printk("\016%s:Device is in Idle/Shutdown Mode\n", "bcm_char_ioctl"); return (-13L); } else { } Adapter->uiSectorSize = uiSectorSize; BcmUpdateSectorSize(Adapter, Adapter->uiSectorSize); } } else { } } } else { } Status = 0; } else { Status = -1; } goto ldv_46916; case 1075866404: ; goto ldv_46916; case -2147194015: ; case 1074031458: pReadData = 0; ulDSDMagicNumInUsrBuff = 0UL; memset((void *)(& tv0), 0, 16UL); memset((void *)(& tv1), 0, 16UL); if ((unsigned int )Adapter->eNVMType == 2U && Adapter->uiFlashLayoutMajorVersion == 0U) { printk("\016%s:The Flash Control Section is Corrupted. Hence Rejection on NVM Read/Write\n", "bcm_char_ioctl"); return (-14L); } else { } tmp___80 = IsFlash2x(Adapter); if (tmp___80 != 0) { if (((unsigned int )Adapter->eActiveDSD != 3U && (unsigned int )Adapter->eActiveDSD != 4U) && (unsigned int )Adapter->eActiveDSD != 5U) { printk("\016%s:No DSD is active..hence NVM Command is blocked", "bcm_char_ioctl"); return (-1L); } else { } } else { } tmp___81 = copy_from_user((void *)(& IoBuffer), (void const *)argp, 32UL); if (tmp___81 != 0UL) { return (-14L); } else { } if (cmd == 2147773281U) { tmp___82 = IoBuffer.OutputBuffer; } else { tmp___82 = IoBuffer.InputBuffer; } tmp___83 = copy_from_user((void *)(& stNVMReadWrite), (void const *)tmp___82, 24UL); if (tmp___83 != 0UL) { return (-14L); } else { } if (stNVMReadWrite.uiNumBytes > Adapter->uiNVMDSDSize) { return (-1L); } else { } if (stNVMReadWrite.uiOffset > Adapter->uiNVMDSDSize - stNVMReadWrite.uiNumBytes) { return (-1L); } else { } tmp___84 = memdup_user((void const *)stNVMReadWrite.pBuffer, (size_t )stNVMReadWrite.uiNumBytes); pReadData = (PUCHAR )tmp___84; tmp___86 = IS_ERR((void const *)pReadData); if (tmp___86 != 0L) { tmp___85 = PTR_ERR((void const *)pReadData); return (tmp___85); } else { } do_gettimeofday(& tv0); if (cmd == 2147773281U) { down(& Adapter->NVMRdmWrmLock); if (((int )((signed char )Adapter->IdleMode) == 1 || (int )((signed char )Adapter->bShutStatus) == 1) || (int )((signed char )Adapter->bPreparingForLowPowerMode) == 1) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:Device is in Idle/Shutdown Mode\n", "bcm_char_ioctl"); } else { } up(& Adapter->NVMRdmWrmLock); kfree((void const *)pReadData); return (-13L); } else { } Status = BeceemNVMRead(Adapter, (unsigned int *)pReadData, stNVMReadWrite.uiOffset, stNVMReadWrite.uiNumBytes); up(& Adapter->NVMRdmWrmLock); if (Status != 0) { kfree((void const *)pReadData); return ((long )Status); } else { } tmp___87 = copy_to_user(stNVMReadWrite.pBuffer, (void const *)pReadData, stNVMReadWrite.uiNumBytes); if (tmp___87 != 0) { kfree((void const *)pReadData); return (-14L); } else { } } else { down(& Adapter->NVMRdmWrmLock); if (((int )((signed char )Adapter->IdleMode) == 1 || (int )((signed char )Adapter->bShutStatus) == 1) || (int )((signed char )Adapter->bPreparingForLowPowerMode) == 1) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:Device is in Idle/Shutdown Mode\n", "bcm_char_ioctl"); } else { } up(& Adapter->NVMRdmWrmLock); kfree((void const *)pReadData); return (-13L); } else { } Adapter->bHeaderChangeAllowed = 1; tmp___89 = IsFlash2x(Adapter); if (tmp___89 != 0) { Status = BcmFlash2xCorruptSig(Adapter, Adapter->eActiveDSD); if (Status != 0) { if (stNVMReadWrite.uiOffset + stNVMReadWrite.uiNumBytes != Adapter->uiNVMDSDSize || stNVMReadWrite.uiNumBytes <= 3U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:DSD Sig is present neither in Flash nor User provided Input..", "bcm_char_ioctl"); } else { } up(& Adapter->NVMRdmWrmLock); kfree((void const *)pReadData); return ((long )Status); } else { } tmp___88 = __fswab32(*((unsigned int *)(pReadData + ((unsigned long )stNVMReadWrite.uiNumBytes + 0xfffffffffffffffcUL)))); ulDSDMagicNumInUsrBuff = (ULONG )tmp___88; if (ulDSDMagicNumInUsrBuff != 3201174877UL) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:DSD Sig is present neither in Flash nor User provided Input..", "bcm_char_ioctl"); } else { } up(& Adapter->NVMRdmWrmLock); kfree((void const *)pReadData); return ((long )Status); } else { } } else { } } else { } Status = BeceemNVMWrite(Adapter, (unsigned int *)pReadData, stNVMReadWrite.uiOffset, stNVMReadWrite.uiNumBytes, (int )stNVMReadWrite.bVerify); tmp___90 = IsFlash2x(Adapter); if (tmp___90 != 0) { BcmFlash2xWriteSig(Adapter, Adapter->eActiveDSD); } else { } Adapter->bHeaderChangeAllowed = 0; up(& Adapter->NVMRdmWrmLock); if (Status != 0) { kfree((void const *)pReadData); return ((long )Status); } else { } } do_gettimeofday(& tv1); if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s: timetaken by Write/read :%ld msec\n", "bcm_char_ioctl", (tv1.tv_sec - tv0.tv_sec) * 1000L + (tv1.tv_usec - tv0.tv_usec) / 1000L); } else { } kfree((void const *)pReadData); return (0L); case -2147194011: sFlash2xRead.Section = 0; sFlash2xRead.offset = 0U; sFlash2xRead.numOfBytes = 0U; sFlash2xRead.bVerify = 0U; sFlash2xRead.pDataBuff = 0; pReadBuff = 0; NOB = 0U; BuffSize = 0U; ReadBytes = 0U; ReadOffset = 0U; tmp___91 = IsFlash2x(Adapter); if (tmp___91 != 1) { printk("\016%s:Flash Does not have 2.x map", "bcm_char_ioctl"); return (-22L); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:IOCTL_BCM_FLASH2X_SECTION_READ Called", "bcm_char_ioctl"); } else { } tmp___92 = copy_from_user((void *)(& IoBuffer), (void const *)argp, 32UL); if (tmp___92 != 0UL) { return (-14L); } else { } tmp___93 = copy_from_user((void *)(& sFlash2xRead), (void const *)IoBuffer.InputBuffer, 24UL); if (tmp___93 != 0UL) { return (-14L); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:\nsFlash2xRead.Section :%x", "bcm_char_ioctl", (unsigned int )sFlash2xRead.Section); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:\nsFlash2xRead.offset :%x", "bcm_char_ioctl", sFlash2xRead.offset); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:\nsFlash2xRead.numOfBytes :%x", "bcm_char_ioctl", sFlash2xRead.numOfBytes); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:\nsFlash2xRead.bVerify :%x\n", "bcm_char_ioctl", sFlash2xRead.bVerify); } else { } tmp___94 = validateFlash2xReadWrite(Adapter, & sFlash2xRead); if (tmp___94 == 0) { return (-1L); } else { } NOB = sFlash2xRead.numOfBytes; if (Adapter->uiSectorSize < NOB) { BuffSize = Adapter->uiSectorSize; } else { BuffSize = NOB; } ReadOffset = sFlash2xRead.offset; OutPutBuff = IoBuffer.OutputBuffer; tmp___95 = kzalloc((size_t )BuffSize, 208U); pReadBuff = (PUCHAR )tmp___95; if ((unsigned long )pReadBuff == (unsigned long )((PUCHAR )0)) { printk("\016%s:Memory allocation failed for Flash 2.x Read Structure", "bcm_char_ioctl"); return (-12L); } else { } down(& Adapter->NVMRdmWrmLock); if (((int )((signed char )Adapter->IdleMode) == 1 || (int )((signed char )Adapter->bShutStatus) == 1) || (int )((signed char )Adapter->bPreparingForLowPowerMode) == 1) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:Device is in Idle/Shutdown Mode\n", "bcm_char_ioctl"); } else { } up(& Adapter->NVMRdmWrmLock); kfree((void const *)pReadBuff); return (-13L); } else { } goto ldv_47062; ldv_47061: ; if (Adapter->uiSectorSize < NOB) { ReadBytes = Adapter->uiSectorSize; } else { ReadBytes = NOB; } Status = BcmFlash2xBulkRead(Adapter, (unsigned int *)pReadBuff, sFlash2xRead.Section, ReadOffset, ReadBytes); if (Status != 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:Flash 2x read err with Status :%d", "bcm_char_ioctl", Status); } else { } goto ldv_47060; } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:\n", "bcm_char_ioctl"); print_hex_dump("\017", " ", 2, 16, 1, (void const *)pReadBuff, (size_t )ReadBytes, 0); } else { } Status = copy_to_user(OutPutBuff, (void const *)pReadBuff, ReadBytes); if (Status != 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:Copy to use failed with status :%d", "bcm_char_ioctl", Status); } else { } up(& Adapter->NVMRdmWrmLock); kfree((void const *)pReadBuff); return (-14L); } else { } NOB = NOB - ReadBytes; if (NOB != 0U) { ReadOffset = ReadOffset + ReadBytes; OutPutBuff = OutPutBuff + (unsigned long )ReadBytes; } else { } ldv_47062: ; if (NOB != 0U) { goto ldv_47061; } else { goto ldv_47060; } ldv_47060: up(& Adapter->NVMRdmWrmLock); kfree((void const *)pReadBuff); goto ldv_46916; case 1074031462: sFlash2xWrite.Section = 0; sFlash2xWrite.offset = 0U; sFlash2xWrite.numOfBytes = 0U; sFlash2xWrite.bVerify = 0U; sFlash2xWrite.pDataBuff = 0; NOB___0 = 0U; BuffSize___0 = 0U; WriteOffset = 0U; WriteBytes = 0U; tmp___96 = IsFlash2x(Adapter); if (tmp___96 != 1) { printk("\016%s:Flash Does not have 2.x map", "bcm_char_ioctl"); return (-22L); } else { } Adapter->bAllDSDWriteAllow = 0; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:IOCTL_BCM_FLASH2X_SECTION_WRITE Called", "bcm_char_ioctl"); } else { } tmp___97 = copy_from_user((void *)(& IoBuffer), (void const *)argp, 32UL); if (tmp___97 != 0UL) { return (-14L); } else { } tmp___98 = copy_from_user((void *)(& sFlash2xWrite), (void const *)IoBuffer.InputBuffer, 24UL); if (tmp___98 != 0UL) { return (-14L); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:\nsFlash2xRead.Section :%x", "bcm_char_ioctl", (unsigned int )sFlash2xWrite.Section); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:\nsFlash2xRead.offset :%d", "bcm_char_ioctl", sFlash2xWrite.offset); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:\nsFlash2xRead.numOfBytes :%x", "bcm_char_ioctl", sFlash2xWrite.numOfBytes); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:\nsFlash2xRead.bVerify :%x\n", "bcm_char_ioctl", sFlash2xWrite.bVerify); } else { } if (((unsigned int )sFlash2xWrite.Section != 6U && (unsigned int )sFlash2xWrite.Section != 7U) && (unsigned int )sFlash2xWrite.Section != 8U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:Only VSA write is allowed", "bcm_char_ioctl"); } else { } return (-22L); } else { } tmp___99 = validateFlash2xReadWrite(Adapter, & sFlash2xWrite); if (tmp___99 == 0) { return (-1L); } else { } InputAddr = sFlash2xWrite.pDataBuff; WriteOffset = sFlash2xWrite.offset; NOB___0 = sFlash2xWrite.numOfBytes; if (Adapter->uiSectorSize < NOB___0) { BuffSize___0 = Adapter->uiSectorSize; } else { BuffSize___0 = NOB___0; } tmp___100 = kmalloc((size_t )BuffSize___0, 208U); pWriteBuff = (PUCHAR )tmp___100; if ((unsigned long )pWriteBuff == (unsigned long )((PUCHAR )0)) { return (-12L); } else { } WriteBytes = Adapter->uiSectorSize; if (WriteOffset % Adapter->uiSectorSize != 0U) { WriteBytes = Adapter->uiSectorSize - WriteOffset % Adapter->uiSectorSize; } else { } if (NOB___0 < WriteBytes) { WriteBytes = NOB___0; } else { } down(& Adapter->NVMRdmWrmLock); if (((int )((signed char )Adapter->IdleMode) == 1 || (int )((signed char )Adapter->bShutStatus) == 1) || (int )((signed char )Adapter->bPreparingForLowPowerMode) == 1) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:Device is in Idle/Shutdown Mode\n", "bcm_char_ioctl"); } else { } up(& Adapter->NVMRdmWrmLock); kfree((void const *)pWriteBuff); return (-13L); } else { } BcmFlash2xCorruptSig(Adapter, sFlash2xWrite.Section); ldv_47072: tmp___101 = copy_from_user((void *)pWriteBuff, (void const *)InputAddr, (unsigned long )WriteBytes); Status = (INT )tmp___101; if (Status != 0) { printk("\016%s:Copy to user failed with status :%d", "bcm_char_ioctl", Status); up(& Adapter->NVMRdmWrmLock); kfree((void const *)pWriteBuff); return (-14L); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:\n", "bcm_char_ioctl"); print_hex_dump("\017", " ", 2, 16, 1, (void const *)pWriteBuff, (size_t )WriteBytes, 0); } else { } Status = BcmFlash2xBulkWrite(Adapter, (unsigned int *)pWriteBuff, sFlash2xWrite.Section, WriteOffset, WriteBytes, sFlash2xWrite.bVerify); if (Status != 0) { printk("\016%s:Flash 2x read err with Status :%d", "bcm_char_ioctl", Status); goto ldv_47071; } else { } NOB___0 = NOB___0 - WriteBytes; if (NOB___0 != 0U) { WriteOffset = WriteOffset + WriteBytes; InputAddr = InputAddr + (unsigned long )WriteBytes; if (Adapter->uiSectorSize < NOB___0) { WriteBytes = Adapter->uiSectorSize; } else { WriteBytes = NOB___0; } } else { } if (NOB___0 != 0U) { goto ldv_47072; } else { goto ldv_47071; } ldv_47071: BcmFlash2xWriteSig(Adapter, sFlash2xWrite.Section); up(& Adapter->NVMRdmWrmLock); kfree((void const *)pWriteBuff); goto ldv_46916; case -2147194009: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:IOCTL_BCM_GET_FLASH2X_SECTION_BITMAP Called", "bcm_char_ioctl"); } else { } tmp___102 = copy_from_user((void *)(& IoBuffer), (void const *)argp, 32UL); if (tmp___102 != 0UL) { return (-14L); } else { } if (IoBuffer.OutputLength != 13UL) { return (-22L); } else { } tmp___103 = kzalloc(13UL, 208U); psFlash2xBitMap = (struct bcm_flash2x_bitmap *)tmp___103; if ((unsigned long )psFlash2xBitMap == (unsigned long )((struct bcm_flash2x_bitmap *)0)) { printk("\016%s:Memory is not available", "bcm_char_ioctl"); return (-12L); } else { } down(& Adapter->NVMRdmWrmLock); if (((int )((signed char )Adapter->IdleMode) == 1 || (int )((signed char )Adapter->bShutStatus) == 1) || (int )((signed char )Adapter->bPreparingForLowPowerMode) == 1) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:Device is in Idle/Shutdown Mode\n", "bcm_char_ioctl"); } else { } up(& Adapter->NVMRdmWrmLock); kfree((void const *)psFlash2xBitMap); return (-13L); } else { } BcmGetFlash2xSectionalBitMap(Adapter, psFlash2xBitMap); up(& Adapter->NVMRdmWrmLock); tmp___104 = copy_to_user(IoBuffer.OutputBuffer, (void const *)psFlash2xBitMap, 13U); if (tmp___104 != 0) { kfree((void const *)psFlash2xBitMap); return (-14L); } else { } kfree((void const *)psFlash2xBitMap); goto ldv_46916; case 1074031464: eFlash2xSectionVal = 0; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:IOCTL_BCM_SET_ACTIVE_SECTION Called", "bcm_char_ioctl"); } else { } tmp___105 = IsFlash2x(Adapter); if (tmp___105 != 1) { printk("\016%s:Flash Does not have 2.x map", "bcm_char_ioctl"); return (-22L); } else { } tmp___106 = copy_from_user((void *)(& IoBuffer), (void const *)argp, 32UL); Status = (INT )tmp___106; if (Status != 0) { printk("\016%s:Copy of IOCTL BUFFER failed", "bcm_char_ioctl"); return (-14L); } else { } tmp___107 = copy_from_user((void *)(& eFlash2xSectionVal), (void const *)IoBuffer.InputBuffer, 4UL); Status = (INT )tmp___107; if (Status != 0) { printk("\016%s:Copy of flash section val failed", "bcm_char_ioctl"); return (-14L); } else { } down(& Adapter->NVMRdmWrmLock); if (((int )((signed char )Adapter->IdleMode) == 1 || (int )((signed char )Adapter->bShutStatus) == 1) || (int )((signed char )Adapter->bPreparingForLowPowerMode) == 1) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:Device is in Idle/Shutdown Mode\n", "bcm_char_ioctl"); } else { } up(& Adapter->NVMRdmWrmLock); return (-13L); } else { } Status = BcmSetActiveSection(Adapter, eFlash2xSectionVal); if (Status != 0) { printk("\016%s:Failed to make it\'s priority Highest. Status %d", "bcm_char_ioctl", Status); } else { } up(& Adapter->NVMRdmWrmLock); goto ldv_46916; case 27497: Adapter->bAllDSDWriteAllow = 0; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:IOCTL_BCM_IDENTIFY_ACTIVE_SECTION called", "bcm_char_ioctl"); } else { } Status = 0; goto ldv_46916; case 1074031472: sCopySectStrut.SrcSection = 0; sCopySectStrut.DstSection = 0; sCopySectStrut.offset = 0U; sCopySectStrut.numOfBytes = 0U; Status = 0; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:IOCTL_BCM_COPY_SECTION Called", "bcm_char_ioctl"); } else { } Adapter->bAllDSDWriteAllow = 0; tmp___108 = IsFlash2x(Adapter); if (tmp___108 != 1) { printk("\016%s:Flash Does not have 2.x map", "bcm_char_ioctl"); return (-22L); } else { } tmp___109 = copy_from_user((void *)(& IoBuffer), (void const *)argp, 32UL); Status = (INT )tmp___109; if (Status != 0) { printk("\016%s:Copy of IOCTL BUFFER failed Status :%d", "bcm_char_ioctl", Status); return (-14L); } else { } tmp___110 = copy_from_user((void *)(& sCopySectStrut), (void const *)IoBuffer.InputBuffer, 16UL); Status = (INT )tmp___110; if (Status != 0) { printk("\016%s:Copy of Copy_Section_Struct failed with Status :%d", "bcm_char_ioctl", Status); return (-14L); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:Source SEction :%x", "bcm_char_ioctl", (unsigned int )sCopySectStrut.SrcSection); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:Destination SEction :%x", "bcm_char_ioctl", (unsigned int )sCopySectStrut.DstSection); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:offset :%x", "bcm_char_ioctl", sCopySectStrut.offset); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:NOB :%x", "bcm_char_ioctl", sCopySectStrut.numOfBytes); } else { } tmp___111 = IsSectionExistInFlash(Adapter, sCopySectStrut.SrcSection); if ((int )((signed char )tmp___111) == 0) { printk("\016%s:Source Section<%x> does not exixt in Flash ", "bcm_char_ioctl", (unsigned int )sCopySectStrut.SrcSection); return (-22L); } else { } tmp___112 = IsSectionExistInFlash(Adapter, sCopySectStrut.DstSection); if ((int )((signed char )tmp___112) == 0) { printk("\016%s:Destinatio Section<%x> does not exixt in Flash ", "bcm_char_ioctl", (unsigned int )sCopySectStrut.DstSection); return (-22L); } else { } if ((unsigned int )sCopySectStrut.SrcSection == (unsigned int )sCopySectStrut.DstSection) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:Source and Destination section should be different", "bcm_char_ioctl"); } else { } return (-22L); } else { } down(& Adapter->NVMRdmWrmLock); if (((int )((signed char )Adapter->IdleMode) == 1 || (int )((signed char )Adapter->bShutStatus) == 1) || (int )((signed char )Adapter->bPreparingForLowPowerMode) == 1) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:Device is in Idle/Shutdown Mode\n", "bcm_char_ioctl"); } else { } up(& Adapter->NVMRdmWrmLock); return (-13L); } else { } if ((unsigned int )sCopySectStrut.SrcSection == 1U || (unsigned int )sCopySectStrut.SrcSection == 2U) { tmp___113 = IsNonCDLessDevice(Adapter); if ((int )((signed char )tmp___113) != 0) { printk("\016%s:Device is Non-CDLess hence won\'t have ISO !!", "bcm_char_ioctl"); Status = -22; } else if (sCopySectStrut.numOfBytes == 0U) { Status = BcmCopyISO(Adapter, sCopySectStrut); } else { printk("\016%s:Partial Copy of ISO section is not Allowed..", "bcm_char_ioctl"); Status = -1; } up(& Adapter->NVMRdmWrmLock); return ((long )Status); } else { } Status = BcmCopySection(Adapter, sCopySectStrut.SrcSection, sCopySectStrut.DstSection, sCopySectStrut.offset, sCopySectStrut.numOfBytes); up(& Adapter->NVMRdmWrmLock); goto ldv_46916; case -2147193999: Status = 0; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s: IOCTL_BCM_GET_FLASH_CS_INFO Called", "bcm_char_ioctl"); } else { } tmp___114 = copy_from_user((void *)(& IoBuffer), (void const *)argp, 32UL); Status = (INT )tmp___114; if (Status != 0) { printk("\016%s:Copy of IOCTL BUFFER failed", "bcm_char_ioctl"); return (-14L); } else { } if ((unsigned int )Adapter->eNVMType != 2U) { printk("\016%s:Connected device does not have flash", "bcm_char_ioctl"); Status = -22; goto ldv_46916; } else { } tmp___117 = IsFlash2x(Adapter); if (tmp___117 == 1) { if (IoBuffer.OutputLength <= 435UL) { return (-22L); } else { } tmp___115 = copy_to_user(IoBuffer.OutputBuffer, (void const *)Adapter->psFlash2xCSInfo, 436U); if (tmp___115 != 0) { return (-14L); } else { } } else { if (IoBuffer.OutputLength <= 95UL) { return (-22L); } else { } tmp___116 = copy_to_user(IoBuffer.OutputBuffer, (void const *)Adapter->psFlashCSInfo, 96U); if (tmp___116 != 0) { return (-14L); } else { } } goto ldv_46916; case 1074031474: SectOfset = 0U; eFlash2xSectionVal___0 = 0; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:IOCTL_BCM_SELECT_DSD Called", "bcm_char_ioctl"); } else { } tmp___118 = IsFlash2x(Adapter); if (tmp___118 != 1) { printk("\016%s:Flash Does not have 2.x map", "bcm_char_ioctl"); return (-22L); } else { } tmp___119 = copy_from_user((void *)(& IoBuffer), (void const *)argp, 32UL); Status = (INT )tmp___119; if (Status != 0) { printk("\016%s:Copy of IOCTL BUFFER failed", "bcm_char_ioctl"); return (-14L); } else { } tmp___120 = copy_from_user((void *)(& eFlash2xSectionVal___0), (void const *)IoBuffer.InputBuffer, 4UL); Status = (INT )tmp___120; if (Status != 0) { printk("\016%s:Copy of flash section val failed", "bcm_char_ioctl"); return (-14L); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:Read Section :%d", "bcm_char_ioctl", (unsigned int )eFlash2xSectionVal___0); } else { } if (((unsigned int )eFlash2xSectionVal___0 != 3U && (unsigned int )eFlash2xSectionVal___0 != 4U) && (unsigned int )eFlash2xSectionVal___0 != 5U) { printk("\016%s:Passed section<%x> is not DSD section", "bcm_char_ioctl", (unsigned int )eFlash2xSectionVal___0); return (-1L); } else { } tmp___121 = BcmGetSectionValStartOffset(Adapter, eFlash2xSectionVal___0); SectOfset = (UINT )tmp___121; if (SectOfset == 4294967295U) { printk("\016%s:Provided Section val <%d> does not exixt in Flash 2.x", "bcm_char_ioctl", (unsigned int )eFlash2xSectionVal___0); return (-22L); } else { } Adapter->bAllDSDWriteAllow = 1; Adapter->ulFlashCalStart = SectOfset; Adapter->eActiveDSD = eFlash2xSectionVal___0; Status = 0; goto ldv_46916; case -2147193995: ReadOffset___0 = 0; ReadBytes___0 = 0U; if ((unsigned int )Adapter->eNVMType != 2U) { printk("\016%s:NVM TYPE is not Flash", "bcm_char_ioctl"); return (-22L); } else { } tmp___122 = copy_from_user((void *)(& IoBuffer), (void const *)argp, 32UL); if (tmp___122 != 0UL) { printk("\016%s:copy_from_user 1 failed\n", "bcm_char_ioctl"); return (-14L); } else { } tmp___123 = copy_from_user((void *)(& stNVMRead), (void const *)IoBuffer.OutputBuffer, 24UL); if (tmp___123 != 0UL) { return (-14L); } else { } NOB___1 = (INT )stNVMRead.uiNumBytes; if (NOB___1 > 65536) { BuffSize___1 = 65536; } else { BuffSize___1 = NOB___1; } ReadOffset___0 = (INT )stNVMRead.uiOffset; OutPutBuff___0 = stNVMRead.pBuffer; tmp___124 = kzalloc((size_t )BuffSize___1, 208U); pReadBuff___0 = (PUCHAR )tmp___124; if ((unsigned long )pReadBuff___0 == (unsigned long )((PUCHAR )0)) { printk("\016%s:Memory allocation failed for Flash 2.x Read Structure", "bcm_char_ioctl"); Status = -12; goto ldv_46916; } else { } down(& Adapter->NVMRdmWrmLock); if (((int )((signed char )Adapter->IdleMode) == 1 || (int )((signed char )Adapter->bShutStatus) == 1) || (int )((signed char )Adapter->bPreparingForLowPowerMode) == 1) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:Device is in Idle/Shutdown Mode\n", "bcm_char_ioctl"); } else { } kfree((void const *)pReadBuff___0); up(& Adapter->NVMRdmWrmLock); return (-13L); } else { } Adapter->bFlashRawRead = 1; goto ldv_47094; ldv_47093: ; if (NOB___1 > 65536) { ReadBytes___0 = 65536U; } else { ReadBytes___0 = (UINT )NOB___1; } Status = BeceemNVMRead(Adapter, (unsigned int *)pReadBuff___0, (UINT )ReadOffset___0, ReadBytes___0); if (Status != 0) { printk("\016%s:Flash 2x read err with Status :%d", "bcm_char_ioctl", Status); goto ldv_47092; } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:\n", "bcm_char_ioctl"); print_hex_dump("\017", " ", 2, 16, 1, (void const *)pReadBuff___0, (size_t )ReadBytes___0, 0); } else { } Status = copy_to_user(OutPutBuff___0, (void const *)pReadBuff___0, ReadBytes___0); if (Status != 0) { printk("\016%s:Copy to use failed with status :%d", "bcm_char_ioctl", Status); up(& Adapter->NVMRdmWrmLock); kfree((void const *)pReadBuff___0); return (-14L); } else { } NOB___1 = (INT )((UINT )NOB___1 - ReadBytes___0); if (NOB___1 != 0) { ReadOffset___0 = (INT )((UINT )ReadOffset___0 + ReadBytes___0); OutPutBuff___0 = OutPutBuff___0 + (unsigned long )ReadBytes___0; } else { } ldv_47094: ; if (NOB___1 != 0) { goto ldv_47093; } else { goto ldv_47092; } ldv_47092: Adapter->bFlashRawRead = 0; up(& Adapter->NVMRdmWrmLock); kfree((void const *)pReadBuff___0); goto ldv_46916; case 1074031476: RxCntrlMsgBitMask = 0UL; tmp___125 = copy_from_user((void *)(& IoBuffer), (void const *)argp, 32UL); Status = (INT )tmp___125; if (Status != 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:copy of Ioctl buffer is failed from user space", "bcm_char_ioctl"); } else { } return (-14L); } else { } if (IoBuffer.InputLength != 8UL) { Status = -22; goto ldv_46916; } else { } tmp___126 = copy_from_user((void *)(& RxCntrlMsgBitMask), (void const *)IoBuffer.InputBuffer, IoBuffer.InputLength); Status = (INT )tmp___126; if (Status != 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:copy of control bit mask failed from user space", "bcm_char_ioctl"); } else { } return (-14L); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:\n Got user defined cntrl msg bit mask :%lx", "bcm_char_ioctl", RxCntrlMsgBitMask); } else { } pTarang->RxCntrlMsgBitMask = RxCntrlMsgBitMask; goto ldv_46916; case -2147193993: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:Called IOCTL_BCM_GET_DEVICE_DRIVER_INFO\n", "bcm_char_ioctl"); } else { } DevInfo.MaxRDMBufferSize = 4096U; DevInfo.u32DSDStartOffset = 512U; DevInfo.u32RxAlignmentCorrection = 0U; DevInfo.u32NVMType = Adapter->eNVMType; DevInfo.u32InterfaceType = 2; tmp___127 = copy_from_user((void *)(& IoBuffer), (void const *)argp, 32UL); if (tmp___127 != 0UL) { return (-14L); } else { } if (IoBuffer.OutputLength <= 59UL) { return (-22L); } else { } tmp___128 = copy_to_user(IoBuffer.OutputBuffer, (void const *)(& DevInfo), 60U); if (tmp___128 != 0) { return (-14L); } else { } goto ldv_46916; case -2147193994: stTimeElapsedSinceNetEntry.ul64TimeElapsedSinceNetEntry = 0ULL; stTimeElapsedSinceNetEntry.uiReserved[0] = 0U; stTimeElapsedSinceNetEntry.uiReserved[1] = 0U; stTimeElapsedSinceNetEntry.uiReserved[2] = 0U; stTimeElapsedSinceNetEntry.uiReserved[3] = 0U; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:IOCTL_BCM_TIME_SINCE_NET_ENTRY called", "bcm_char_ioctl"); } else { } tmp___129 = copy_from_user((void *)(& IoBuffer), (void const *)argp, 32UL); if (tmp___129 != 0UL) { return (-14L); } else { } if (IoBuffer.OutputLength <= 23UL) { return (-22L); } else { } tmp___130 = get_seconds(); stTimeElapsedSinceNetEntry.ul64TimeElapsedSinceNetEntry = (unsigned long long )(tmp___130 - (unsigned long )Adapter->liTimeSinceLastNetEntry); tmp___131 = copy_to_user(IoBuffer.OutputBuffer, (void const *)(& stTimeElapsedSinceNetEntry), 24U); if (tmp___131 != 0) { return (-14L); } else { } goto ldv_46916; case 27412: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 67108864U) != 0U) { printk("\017%s:IOCTL_CLOSE_NOTIFICATION", "bcm_char_ioctl"); } else { } goto ldv_46916; default: printk("\016beceem: unknown ioctl cmd=%#x\n", cmd); Status = -1; goto ldv_46916; } ldv_46916: ; return ((long )Status); } } static struct file_operations const bcm_fops = {& __this_module, & no_llseek, & bcm_char_read, 0, 0, 0, 0, 0, & bcm_char_ioctl, 0, 0, & bcm_char_open, 0, & bcm_char_release, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; int register_control_device_interface(struct bcm_mini_adapter *Adapter ) { long tmp ; long tmp___0 ; { if (Adapter->major > 0) { return (Adapter->major); } else { } Adapter->major = ldv_register_chrdev_256(0U, "tarang", & bcm_fops); if (Adapter->major < 0) { printk("\vbeceem: could not created character device\n"); return (Adapter->major); } else { } Adapter->pstCreatedClassDevice = device_create(bcm_class, 0, (dev_t )(Adapter->major << 20), (void *)Adapter, "tarang"); tmp___0 = IS_ERR((void const *)Adapter->pstCreatedClassDevice); if (tmp___0 != 0L) { printk("\vbeceem: class device create failed\n"); ldv_unregister_chrdev_257((unsigned int )Adapter->major, "tarang"); tmp = PTR_ERR((void const *)Adapter->pstCreatedClassDevice); return ((int )tmp); } else { } return (0); } } void unregister_control_device_interface(struct bcm_mini_adapter *Adapter ) { { if (Adapter->major > 0) { device_destroy(bcm_class, (dev_t )(Adapter->major << 20)); ldv_unregister_chrdev_257((unsigned int )Adapter->major, "tarang"); } else { } return; } } struct inode *bcm_fops_group1 ; size_t ldvarg7 ; unsigned int ldvarg3 ; loff_t ldvarg5 ; loff_t *ldvarg6 ; struct file *bcm_fops_group2 ; char *ldvarg8 ; int ldv_retval_4 ; int ldvarg4 ; unsigned long ldvarg2 ; void ldv_main_exported_1(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_state_variable_1 == 2) { bcm_char_release(bcm_fops_group1, bcm_fops_group2); ldv_state_variable_1 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_47124; case 1: ; if (ldv_state_variable_1 == 2) { bcm_char_read(bcm_fops_group2, ldvarg8, ldvarg7, ldvarg6); ldv_state_variable_1 = 2; } else { } goto ldv_47124; case 2: ; if (ldv_state_variable_1 == 2) { no_llseek(bcm_fops_group2, ldvarg5, ldvarg4); ldv_state_variable_1 = 2; } else { } goto ldv_47124; case 3: ; if (ldv_state_variable_1 == 1) { ldv_retval_4 = bcm_char_open(bcm_fops_group1, bcm_fops_group2); if (ldv_retval_4 == 0) { ldv_state_variable_1 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_47124; case 4: ; if (ldv_state_variable_1 == 2) { bcm_char_ioctl(bcm_fops_group2, ldvarg3, ldvarg2); ldv_state_variable_1 = 2; } else { } goto ldv_47124; default: ; goto ldv_47124; } ldv_47124: ; return; } } void ldv_mutex_lock_249(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_250(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_251(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_device(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_252(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___2 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex_of_device(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_253(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_device(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_254(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_255(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } __inline static int ldv_register_chrdev_256(unsigned int major , char const *name , struct file_operations const *fops ) { ldv_func_ret_type___6 ldv_func_res ; int tmp ; { tmp = register_chrdev(major, name, fops); ldv_func_res = tmp; ldv_state_variable_1 = 1; return (ldv_func_res); } } __inline static void ldv_unregister_chrdev_257(unsigned int major , char const *name ) { { unregister_chrdev(major, name); ldv_state_variable_1 = 0; return; } } int ldv_mutex_trylock_272(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_270(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_273(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_275(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_269(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_271(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_274(struct mutex *ldv_func_arg1 ) ; UINT GetServiceFlowEntry(S_SERVICEFLOW_TABLE *psServiceFlowTable , B_UINT16 uiVcid , S_SERVICEFLOW_ENTRY **ppstServiceFlowEntry ) ; int ProcessGetHostMibs(struct bcm_mini_adapter *Adapter , struct bcm_host_stats_mibs *pstHostMibs ) { S_SERVICEFLOW_ENTRY *pstServiceFlowEntry ; S_PHS_RULE *pstPhsRule ; S_CLASSIFIER_TABLE *pstClassifierTable ; S_CLASSIFIER_ENTRY *pstClassifierRule ; PPHS_DEVICE_EXTENSION pDeviceExtension ; UINT nClassifierIndex ; UINT nPhsTableIndex ; UINT nSfIndex ; UINT uiIndex ; size_t __len ; void *__ret ; size_t __len___0 ; void *__ret___0 ; UINT tmp ; size_t __len___1 ; void *__ret___1 ; int tmp___0 ; size_t __len___2 ; void *__ret___2 ; size_t __len___3 ; void *__ret___3 ; { pstServiceFlowEntry = 0; pstPhsRule = 0; pstClassifierTable = 0; pstClassifierRule = 0; pDeviceExtension = & Adapter->stBCMPhsContext; nClassifierIndex = 0U; nPhsTableIndex = 0U; nSfIndex = 0U; uiIndex = 0U; if ((unsigned long )pDeviceExtension == (unsigned long )((PPHS_DEVICE_EXTENSION )0)) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 268435456U) != 0U) { printk("\017%s:Invalid Device Extension\n", "ProcessGetHostMibs"); } else { } return (-1); } else { } nClassifierIndex = 0U; goto ldv_46828; ldv_46827: ; if ((int )((signed char )Adapter->astClassifierTable[nClassifierIndex].bUsed) == 1) { __len = 632UL; if (__len > 63UL) { __ret = memcpy((void *)(& pstHostMibs->astClassifierTable) + (unsigned long )nClassifierIndex, (void const *)(& Adapter->astClassifierTable) + (unsigned long )nClassifierIndex, __len); } else { __ret = memcpy((void *)(& pstHostMibs->astClassifierTable) + (unsigned long )nClassifierIndex, (void const *)(& Adapter->astClassifierTable) + (unsigned long )nClassifierIndex, __len); } } else { } nClassifierIndex = nClassifierIndex + 1U; ldv_46828: ; if (nClassifierIndex <= 99U) { goto ldv_46827; } else { goto ldv_46829; } ldv_46829: nSfIndex = 0U; goto ldv_46841; ldv_46840: ; if ((int )((signed char )Adapter->PackInfo[nSfIndex].bValid) != 0) { __len___0 = 200UL; if (__len___0 > 63UL) { __ret___0 = memcpy((void *)(& pstHostMibs->astSFtable) + (unsigned long )nSfIndex, (void const *)(& Adapter->PackInfo) + (unsigned long )nSfIndex, __len___0); } else { __ret___0 = memcpy((void *)(& pstHostMibs->astSFtable) + (unsigned long )nSfIndex, (void const *)(& Adapter->PackInfo) + (unsigned long )nSfIndex, __len___0); } } else { goto ldv_46833; } tmp = GetServiceFlowEntry(pDeviceExtension->pstServiceFlowPhsRulesTable, (int )Adapter->PackInfo[nSfIndex].usVCID_Value, & pstServiceFlowEntry); if (tmp == 4294967295U) { goto ldv_46833; } else { } pstClassifierTable = pstServiceFlowEntry->pstClassifierTable; uiIndex = 0U; goto ldv_46838; ldv_46837: pstClassifierRule = (S_CLASSIFIER_ENTRY *)(& pstClassifierTable->stActivePhsRulesList) + (unsigned long )uiIndex; if ((unsigned int )pstClassifierRule->bUsed != 0U) { pstPhsRule = pstClassifierRule->pstPhsRule; pstHostMibs->astPhsRulesTable[nPhsTableIndex].ulSFID = Adapter->PackInfo[nSfIndex].ulSFID; __len___1 = 544UL; if (__len___1 > 63UL) { __ret___1 = memcpy((void *)(& pstHostMibs->astPhsRulesTable[nPhsTableIndex].u8PHSI), (void const *)(& pstPhsRule->u8PHSI), __len___1); } else { __ret___1 = memcpy((void *)(& pstHostMibs->astPhsRulesTable[nPhsTableIndex].u8PHSI), (void const *)(& pstPhsRule->u8PHSI), __len___1); } nPhsTableIndex = nPhsTableIndex + 1U; } else { } uiIndex = uiIndex + 1U; ldv_46838: ; if (uiIndex <= 19U) { goto ldv_46837; } else { goto ldv_46839; } ldv_46839: ; ldv_46833: nSfIndex = nSfIndex + 1U; ldv_46841: ; if (nSfIndex <= 16U) { goto ldv_46840; } else { goto ldv_46842; } ldv_46842: pstHostMibs->stHostInfo.GoodTransmits = (u64 )(Adapter->dev)->stats.tx_packets; pstHostMibs->stHostInfo.GoodReceives = (u64 )(Adapter->dev)->stats.rx_packets; tmp___0 = atomic_read((atomic_t const *)(& Adapter->CurrNumFreeTxDesc)); pstHostMibs->stHostInfo.CurrNumFreeDesc = (unsigned long )tmp___0; pstHostMibs->stHostInfo.BEBucketSize = Adapter->BEBucketSize; pstHostMibs->stHostInfo.rtPSBucketSize = Adapter->rtPSBucketSize; pstHostMibs->stHostInfo.TimerActive = (int )((signed char )Adapter->TimerActive) != 0; pstHostMibs->stHostInfo.u32TotalDSD = Adapter->u32TotalDSD; __len___2 = 48UL; if (__len___2 > 63UL) { __ret___2 = memcpy((void *)(& pstHostMibs->stHostInfo.aTxPktSizeHist), (void const *)(& Adapter->aTxPktSizeHist), __len___2); } else { __ret___2 = memcpy((void *)(& pstHostMibs->stHostInfo.aTxPktSizeHist), (void const *)(& Adapter->aTxPktSizeHist), __len___2); } __len___3 = 48UL; if (__len___3 > 63UL) { __ret___3 = memcpy((void *)(& pstHostMibs->stHostInfo.aRxPktSizeHist), (void const *)(& Adapter->aRxPktSizeHist), __len___3); } else { __ret___3 = memcpy((void *)(& pstHostMibs->stHostInfo.aRxPktSizeHist), (void const *)(& Adapter->aRxPktSizeHist), __len___3); } return (0); } } void GetDroppedAppCntrlPktMibs(struct bcm_host_stats_mibs *pstHostMibs , struct bcm_tarang_data *pTarang ) { size_t __len ; void *__ret ; { __len = 64UL; if (__len > 63UL) { __ret = memcpy((void *)(& pstHostMibs->stDroppedAppCntrlMsgs), (void const *)(& pTarang->stDroppedAppCntrlMsgs), __len); } else { __ret = memcpy((void *)(& pstHostMibs->stDroppedAppCntrlMsgs), (void const *)(& pTarang->stDroppedAppCntrlMsgs), __len); } return; } } void CopyMIBSExtendedSFParameters(struct bcm_mini_adapter *Adapter , struct bcm_connect_mgr_params *psfLocalSet , UINT uiSearchRuleIndex ) { struct bcm_mibs_parameters *t ; __u32 tmp ; __u32 tmp___0 ; __u32 tmp___1 ; __u32 tmp___2 ; __u16 tmp___3 ; __u32 tmp___4 ; __u16 tmp___5 ; __u32 tmp___6 ; __u16 tmp___7 ; __u32 tmp___8 ; __u32 tmp___9 ; __u16 tmp___10 ; __u32 tmp___11 ; __u16 tmp___12 ; __u32 tmp___13 ; __u32 tmp___14 ; __u32 tmp___15 ; __u16 tmp___16 ; __u32 tmp___17 ; { t = & Adapter->PackInfo[uiSearchRuleIndex].stMibsExtServiceFlowTable; t->wmanIfSfid = psfLocalSet->u32SFID; t->wmanIfCmnCpsMaxSustainedRate = psfLocalSet->u32MaxSustainedTrafficRate; t->wmanIfCmnCpsMaxTrafficBurst = psfLocalSet->u32MaxTrafficBurst; t->wmanIfCmnCpsMinReservedRate = psfLocalSet->u32MinReservedTrafficRate; t->wmanIfCmnCpsToleratedJitter = psfLocalSet->u32ToleratedJitter; t->wmanIfCmnCpsMaxLatency = psfLocalSet->u32MaximumLatency; t->wmanIfCmnCpsFixedVsVariableSduInd = (u32 )psfLocalSet->u8FixedLengthVSVariableLengthSDUIndicator; tmp = __fswab32(t->wmanIfCmnCpsFixedVsVariableSduInd); t->wmanIfCmnCpsFixedVsVariableSduInd = tmp; t->wmanIfCmnCpsSduSize = (u32 )psfLocalSet->u8SDUSize; tmp___0 = __fswab32(t->wmanIfCmnCpsSduSize); t->wmanIfCmnCpsSduSize = tmp___0; t->wmanIfCmnCpsSfSchedulingType = (u32 )psfLocalSet->u8ServiceFlowSchedulingType; tmp___1 = __fswab32(t->wmanIfCmnCpsSfSchedulingType); t->wmanIfCmnCpsSfSchedulingType = tmp___1; t->wmanIfCmnCpsArqEnable = (u32 )psfLocalSet->u8ARQEnable; tmp___2 = __fswab32(t->wmanIfCmnCpsArqEnable); t->wmanIfCmnCpsArqEnable = tmp___2; tmp___3 = __fswab16((int )psfLocalSet->u16ARQWindowSize); t->wmanIfCmnCpsArqWindowSize = (u32 )tmp___3; tmp___4 = __fswab32(t->wmanIfCmnCpsArqWindowSize); t->wmanIfCmnCpsArqWindowSize = tmp___4; tmp___5 = __fswab16((int )psfLocalSet->u16ARQBlockLifeTime); t->wmanIfCmnCpsArqBlockLifetime = (u32 )tmp___5; tmp___6 = __fswab32(t->wmanIfCmnCpsArqBlockLifetime); t->wmanIfCmnCpsArqBlockLifetime = tmp___6; tmp___7 = __fswab16((int )psfLocalSet->u16ARQSyncLossTimeOut); t->wmanIfCmnCpsArqSyncLossTimeout = (u32 )tmp___7; tmp___8 = __fswab32(t->wmanIfCmnCpsArqSyncLossTimeout); t->wmanIfCmnCpsArqSyncLossTimeout = tmp___8; t->wmanIfCmnCpsArqDeliverInOrder = (u32 )psfLocalSet->u8ARQDeliverInOrder; tmp___9 = __fswab32(t->wmanIfCmnCpsArqDeliverInOrder); t->wmanIfCmnCpsArqDeliverInOrder = tmp___9; tmp___10 = __fswab16((int )psfLocalSet->u16ARQRxPurgeTimeOut); t->wmanIfCmnCpsArqRxPurgeTimeout = (u32 )tmp___10; tmp___11 = __fswab32(t->wmanIfCmnCpsArqRxPurgeTimeout); t->wmanIfCmnCpsArqRxPurgeTimeout = tmp___11; tmp___12 = __fswab16((int )psfLocalSet->u16ARQBlockSize); t->wmanIfCmnCpsArqBlockSize = (u32 )tmp___12; tmp___13 = __fswab32(t->wmanIfCmnCpsArqBlockSize); t->wmanIfCmnCpsArqBlockSize = tmp___13; t->wmanIfCmnCpsReqTxPolicy = (u32 )psfLocalSet->u8RequesttransmissionPolicy; tmp___14 = __fswab32(t->wmanIfCmnCpsReqTxPolicy); t->wmanIfCmnCpsReqTxPolicy = tmp___14; t->wmanIfCmnSfCsSpecification = (u32 )psfLocalSet->u8CSSpecification; tmp___15 = __fswab32(t->wmanIfCmnSfCsSpecification); t->wmanIfCmnSfCsSpecification = tmp___15; tmp___16 = __fswab16((int )psfLocalSet->u16TargetSAID); t->wmanIfCmnCpsTargetSaid = (u32 )tmp___16; tmp___17 = __fswab32(t->wmanIfCmnCpsTargetSaid); t->wmanIfCmnCpsTargetSaid = tmp___17; return; } } void ldv_mutex_lock_269(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_270(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_271(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_device(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_272(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___2 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex_of_device(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_273(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_device(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_274(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_275(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } int ldv_mutex_trylock_286(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_284(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_287(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_289(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_283(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_285(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_288(struct mutex *ldv_func_arg1 ) ; extern struct sk_buff *skb_copy(struct sk_buff const * , gfp_t ) ; static UINT CreateSFToClassifierRuleMapping(B_UINT16 uiVcid , B_UINT16 uiClsId , S_SERVICEFLOW_TABLE *psServiceFlowTable , S_PHS_RULE *psPhsRule , B_UINT8 u8AssociatedPHSI ) ; static UINT CreateClassiferToPHSRuleMapping(B_UINT16 uiVcid , B_UINT16 uiClsId , S_SERVICEFLOW_ENTRY *pstServiceFlowEntry , S_PHS_RULE *psPhsRule , B_UINT8 u8AssociatedPHSI ) ; static UINT CreateClassifierPHSRule(B_UINT16 uiClsId , S_CLASSIFIER_TABLE *psaClassifiertable , S_PHS_RULE *psPhsRule , E_CLASSIFIER_ENTRY_CONTEXT eClsContext , B_UINT8 u8AssociatedPHSI ) ; static UINT UpdateClassifierPHSRule(B_UINT16 uiClsId , S_CLASSIFIER_ENTRY *pstClassifierEntry , S_CLASSIFIER_TABLE *psaClassifiertable , S_PHS_RULE *psPhsRule , B_UINT8 u8AssociatedPHSI ) ; static BOOLEAN ValidatePHSRuleComplete(S_PHS_RULE *psPhsRule ) ; static BOOLEAN DerefPhsRule(B_UINT16 uiClsId , S_CLASSIFIER_TABLE *psaClassifiertable , S_PHS_RULE *pstPhsRule ) ; static UINT GetClassifierEntry(S_CLASSIFIER_TABLE *pstClassifierTable , B_UINT32 uiClsid , E_CLASSIFIER_ENTRY_CONTEXT eClsContext , S_CLASSIFIER_ENTRY **ppstClassifierEntry ) ; static UINT GetPhsRuleEntry(S_CLASSIFIER_TABLE *pstClassifierTable , B_UINT32 uiPHSI , E_CLASSIFIER_ENTRY_CONTEXT eClsContext , S_PHS_RULE **ppstPhsRule ) ; static void free_phs_serviceflow_rules(S_SERVICEFLOW_TABLE *psServiceFlowRulesTable ) ; static int phs_compress(S_PHS_RULE *phs_rule , unsigned char *in_buf , unsigned char *out_buf , unsigned int *header_size , UINT *new_header_size ) ; static int verify_suppress_phsf(unsigned char *in_buffer , unsigned char *out_buffer , unsigned char *phsf , unsigned char *phsm , unsigned int phss , unsigned int phsv , UINT *new_header_size ) ; static int phs_decompress(unsigned char *in_buf , unsigned char *out_buf , S_PHS_RULE *decomp_phs_rules , UINT *header_size ) ; static ULONG PhsCompress(void *pvContext , B_UINT16 uiVcid , B_UINT16 uiClsId , void *pvInputBuffer , void *pvOutputBuffer , UINT *pOldHeaderSize , UINT *pNewHeaderSize ) ; static ULONG PhsDeCompress(void *pvContext , B_UINT16 uiVcid , void *pvInputBuffer , void *pvOutputBuffer , UINT *pInHeaderSize , UINT *pOutHeaderSize ) ; int PHSTransmit(struct bcm_mini_adapter *Adapter , struct sk_buff **pPacket , USHORT Vcid , B_UINT16 uiClassifierRuleID , BOOLEAN bHeaderSuppressionEnabled , unsigned int *PacketLen , UCHAR bEthCSSupport ) { UINT unPHSPktHdrBytesCopied ; UINT unPhsOldHdrSize ; UINT unPHSNewPktHeaderLen ; PUCHAR pucPHSPktHdrInBuf ; PUCHAR pucPHSPktHdrOutBuf ; UINT usPacketType ; UINT BytesToRemove ; BOOLEAN bPHSI ; LONG ulPhsStatus ; UINT numBytesCompressed ; struct sk_buff *newPacket ; struct sk_buff *Packet ; ULONG tmp ; int tmp___0 ; size_t __len ; void *__ret ; size_t __len___0 ; void *__ret___0 ; int tmp___1 ; unsigned int tmp___2 ; { unPHSPktHdrBytesCopied = 0U; unPhsOldHdrSize = 0U; unPHSNewPktHeaderLen = 0U; pucPHSPktHdrInBuf = (PUCHAR )(& Adapter->stPhsTxContextInfo.ucaHdrSuppressionInBuf); pucPHSPktHdrOutBuf = (PUCHAR )(& Adapter->stPhsTxContextInfo.ucaHdrSuppressionOutBuf); BytesToRemove = 0U; bPHSI = 0; ulPhsStatus = 0L; numBytesCompressed = 0U; newPacket = 0; Packet = *pPacket; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 65536U) != 0U) { printk("\017%s:In PHSTransmit", "PHSTransmit"); } else { } if ((unsigned int )bEthCSSupport == 0U) { BytesToRemove = 14U; } else { } usPacketType = (UINT )((struct ethhdr *)Packet->data)->h_proto; pucPHSPktHdrInBuf = Packet->data + (unsigned long )BytesToRemove; if (*PacketLen - BytesToRemove <= 254U) { unPHSPktHdrBytesCopied = *PacketLen - BytesToRemove; } else { unPHSPktHdrBytesCopied = 255U; } if (unPHSPktHdrBytesCopied != 0U && unPHSPktHdrBytesCopied <= 255U) { if ((usPacketType == 8U || usPacketType == 56710U) && (int )((signed char )bHeaderSuppressionEnabled) != 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 65536U) != 0U) { printk("\017%s:\nTrying to PHS Compress Using Classifier rule 0x%X", "PHSTransmit", (int )uiClassifierRuleID); } else { } unPHSNewPktHeaderLen = unPHSPktHdrBytesCopied; tmp = PhsCompress((void *)(& Adapter->stBCMPhsContext), (int )Vcid, (int )uiClassifierRuleID, (void *)pucPHSPktHdrInBuf, (void *)pucPHSPktHdrOutBuf, & unPhsOldHdrSize, & unPHSNewPktHeaderLen); ulPhsStatus = (LONG )tmp; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 65536U) != 0U) { printk("\017%s:\nPHS Old header Size : %d New Header Size %d\n", "PHSTransmit", unPhsOldHdrSize, unPHSNewPktHeaderLen); } else { } if (unPHSNewPktHeaderLen == unPhsOldHdrSize) { if (ulPhsStatus == 161L) { bPHSI = (BOOLEAN )*pucPHSPktHdrOutBuf; } else { } ulPhsStatus = 162L; } else { } if (ulPhsStatus == 161L) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 65536U) != 0U) { printk("\017%s:PHS Sending packet Compressed", "PHSTransmit"); } else { } tmp___0 = skb_cloned((struct sk_buff const *)Packet); if (tmp___0 != 0) { newPacket = skb_copy((struct sk_buff const *)Packet, 32U); if ((unsigned long )newPacket == (unsigned long )((struct sk_buff *)0)) { return (-1); } else { } consume_skb(Packet); Packet = newPacket; *pPacket = Packet; pucPHSPktHdrInBuf = Packet->data + (unsigned long )BytesToRemove; } else { } numBytesCompressed = (unPhsOldHdrSize - unPHSNewPktHeaderLen) - 1U; __len = (size_t )(unPHSNewPktHeaderLen + 1U); __ret = memcpy((void *)pucPHSPktHdrInBuf + (unsigned long )numBytesCompressed, (void const *)pucPHSPktHdrOutBuf, __len); __len___0 = (size_t )BytesToRemove; __ret___0 = memcpy((void *)Packet->data + (unsigned long )numBytesCompressed, (void const *)Packet->data, __len___0); skb_pull(Packet, numBytesCompressed); return (0); } else { tmp___2 = skb_headroom((struct sk_buff const *)Packet); if (tmp___2 == 0U) { tmp___1 = skb_cow(Packet, 1U); if (tmp___1 != 0) { printk("\016%s:SKB Cow Failed\n", "PHSTransmit"); return (-1); } else { } } else { } skb_push(Packet, 1U); *(Packet->data + (unsigned long )BytesToRemove) = (unsigned char )bPHSI; return (0); } } else { if ((int )((signed char )bHeaderSuppressionEnabled) == 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 65536U) != 0U) { printk("\017%s:\nHeader Suppression Disabled For SF: No PHS\n", "PHSTransmit"); } else { } } else { } return (0); } } else { } return (0); } } int PHSReceive(struct bcm_mini_adapter *Adapter , USHORT usVcid , struct sk_buff *packet , UINT *punPacketLen , UCHAR *pucEthernetHdr , UINT bHeaderSuppressionEnabled ) { u32 nStandardPktHdrLen ; u32 nTotalsuppressedPktHdrBytes ; int ulPhsStatus ; PUCHAR pucInBuff ; UINT TotalBytesAdded ; ULONG tmp ; unsigned int tmp___0 ; int tmp___1 ; unsigned int tmp___2 ; size_t __len ; void *__ret ; { nStandardPktHdrLen = 0U; nTotalsuppressedPktHdrBytes = 0U; ulPhsStatus = 0; pucInBuff = 0; TotalBytesAdded = 0U; if (bHeaderSuppressionEnabled == 0U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 131072U) != 0U) { printk("\017%s:\nPhs Disabled for incoming packet", "PHSReceive"); } else { } return (ulPhsStatus); } else { } pucInBuff = packet->data; nStandardPktHdrLen = packet->len; tmp = PhsDeCompress((void *)(& Adapter->stBCMPhsContext), (int )usVcid, (void *)pucInBuff, (void *)(& Adapter->ucaPHSPktRestoreBuf), & nTotalsuppressedPktHdrBytes, & nStandardPktHdrLen); ulPhsStatus = (int )tmp; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 131072U) != 0U) { printk("\017%s:\nSuppressed PktHdrLen : 0x%x Restored PktHdrLen : 0x%x", "PHSReceive", nTotalsuppressedPktHdrBytes, nStandardPktHdrLen); } else { } if (ulPhsStatus != 161) { skb_pull(packet, 1U); return (0); } else { TotalBytesAdded = (nStandardPktHdrLen - nTotalsuppressedPktHdrBytes) - 1U; if (TotalBytesAdded != 0U) { tmp___2 = skb_headroom((struct sk_buff const *)packet); if (tmp___2 >= TotalBytesAdded + 16U) { skb_push(packet, TotalBytesAdded); } else { tmp___0 = skb_headroom((struct sk_buff const *)packet); tmp___1 = skb_cow(packet, tmp___0 + TotalBytesAdded); if (tmp___1 != 0) { printk("\016%s:cow failed in receive\n", "PHSReceive"); return (-1); } else { } skb_push(packet, TotalBytesAdded); } } else { } __len = (size_t )nStandardPktHdrLen; __ret = memcpy((void *)packet->data, (void const *)(& Adapter->ucaPHSPktRestoreBuf), __len); } return (0); } } void DumpFullPacket(UCHAR *pBuf , UINT nPktLen ) { struct bcm_mini_adapter *Adapter ; void *tmp ; { tmp = netdev_priv((struct net_device const *)gblpnetdev); Adapter = (struct bcm_mini_adapter *)tmp; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:Dumping Data Packet", "DumpFullPacket"); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 2U) != 0U) && (Adapter->stDebugState.subtype[2] & 8192U) != 0U) { printk("\017%s:\n", "DumpFullPacket"); print_hex_dump("\017", " ", 2, 16, 1, (void const *)pBuf, (size_t )nPktLen, 0); } else { } return; } } int phs_init(PPHS_DEVICE_EXTENSION pPhsdeviceExtension , struct bcm_mini_adapter *Adapter ) { int i ; S_SERVICEFLOW_TABLE *pstServiceFlowTable ; void *tmp ; S_SERVICEFLOW_ENTRY sServiceFlow ; void *tmp___0 ; { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 33554432U) != 0U) { printk("\017%s:\nPHS:phs_init function ", "phs_init"); } else { } if ((unsigned long )pPhsdeviceExtension->pstServiceFlowPhsRulesTable != (unsigned long )((S_SERVICEFLOW_TABLE *)0)) { return (-22); } else { } tmp = kzalloc(280UL, 208U); pPhsdeviceExtension->pstServiceFlowPhsRulesTable = (S_SERVICEFLOW_TABLE *)tmp; if ((unsigned long )pPhsdeviceExtension->pstServiceFlowPhsRulesTable == (unsigned long )((S_SERVICEFLOW_TABLE *)0)) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 33554432U) != 0U) { printk("\017%s:\nAllocation ServiceFlowPhsRulesTable failed", "phs_init"); } else { } return (-12); } else { } pstServiceFlowTable = pPhsdeviceExtension->pstServiceFlowPhsRulesTable; i = 0; goto ldv_46946; ldv_46945: sServiceFlow = pstServiceFlowTable->stSFList[i]; tmp___0 = kzalloc(976UL, 208U); sServiceFlow.pstClassifierTable = (S_CLASSIFIER_TABLE *)tmp___0; if ((unsigned long )sServiceFlow.pstClassifierTable == (unsigned long )((S_CLASSIFIER_TABLE *)0)) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 33554432U) != 0U) { printk("\017%s:\nAllocation failed", "phs_init"); } else { } free_phs_serviceflow_rules(pPhsdeviceExtension->pstServiceFlowPhsRulesTable); pPhsdeviceExtension->pstServiceFlowPhsRulesTable = 0; return (-12); } else { } i = i + 1; ldv_46946: ; if (i <= 16) { goto ldv_46945; } else { goto ldv_46947; } ldv_46947: pPhsdeviceExtension->CompressedTxBuffer = kmalloc(1532UL, 208U); if ((unsigned long )pPhsdeviceExtension->CompressedTxBuffer == (unsigned long )((void *)0)) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 33554432U) != 0U) { printk("\017%s:\nAllocation failed", "phs_init"); } else { } free_phs_serviceflow_rules(pPhsdeviceExtension->pstServiceFlowPhsRulesTable); pPhsdeviceExtension->pstServiceFlowPhsRulesTable = 0; return (-12); } else { } pPhsdeviceExtension->UnCompressedRxBuffer = kmalloc(1532UL, 208U); if ((unsigned long )pPhsdeviceExtension->UnCompressedRxBuffer == (unsigned long )((void *)0)) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 33554432U) != 0U) { printk("\017%s:\nAllocation failed", "phs_init"); } else { } kfree((void const *)pPhsdeviceExtension->CompressedTxBuffer); free_phs_serviceflow_rules(pPhsdeviceExtension->pstServiceFlowPhsRulesTable); pPhsdeviceExtension->pstServiceFlowPhsRulesTable = 0; return (-12); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 33554432U) != 0U) { printk("\017%s:\n phs_init Successful", "phs_init"); } else { } return (0); } } int PhsCleanup(PPHS_DEVICE_EXTENSION pPHSDeviceExt ) { { if ((unsigned long )pPHSDeviceExt->pstServiceFlowPhsRulesTable != (unsigned long )((S_SERVICEFLOW_TABLE *)0)) { free_phs_serviceflow_rules(pPHSDeviceExt->pstServiceFlowPhsRulesTable); pPHSDeviceExt->pstServiceFlowPhsRulesTable = 0; } else { } kfree((void const *)pPHSDeviceExt->CompressedTxBuffer); pPHSDeviceExt->CompressedTxBuffer = 0; kfree((void const *)pPHSDeviceExt->UnCompressedRxBuffer); pPHSDeviceExt->UnCompressedRxBuffer = 0; return (0); } } ULONG PhsUpdateClassifierRule(void *pvContext , B_UINT16 uiVcid , B_UINT16 uiClsId , S_PHS_RULE *psPhsRule , B_UINT8 u8AssociatedPHSI ) { ULONG lStatus ; UINT nSFIndex ; S_SERVICEFLOW_ENTRY *pstServiceFlowEntry ; struct bcm_mini_adapter *Adapter ; void *tmp ; PPHS_DEVICE_EXTENSION pDeviceExtension ; UINT tmp___0 ; UINT tmp___1 ; { lStatus = 0UL; nSFIndex = 0U; pstServiceFlowEntry = 0; tmp = netdev_priv((struct net_device const *)gblpnetdev); Adapter = (struct bcm_mini_adapter *)tmp; pDeviceExtension = (struct _PHS_DEVICE_EXTENSION *)pvContext; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 33554432U) != 0U) { printk("\017%s:PHS With Corr2 Changes \n", "PhsUpdateClassifierRule"); } else { } if ((unsigned long )pDeviceExtension == (unsigned long )((PPHS_DEVICE_EXTENSION )0)) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 33554432U) != 0U) { printk("\017%s:Invalid Device Extension\n", "PhsUpdateClassifierRule"); } else { } return (2048UL); } else { } if ((unsigned int )u8AssociatedPHSI == 0U) { return (2049UL); } else { } nSFIndex = GetServiceFlowEntry(pDeviceExtension->pstServiceFlowPhsRulesTable, (int )uiVcid, & pstServiceFlowEntry); if (nSFIndex == 4294967295U) { tmp___0 = CreateSFToClassifierRuleMapping((int )uiVcid, (int )uiClsId, pDeviceExtension->pstServiceFlowPhsRulesTable, psPhsRule, (int )u8AssociatedPHSI); lStatus = (ULONG )tmp___0; return (lStatus); } else { } tmp___1 = CreateClassiferToPHSRuleMapping((int )uiVcid, (int )uiClsId, pstServiceFlowEntry, psPhsRule, (int )u8AssociatedPHSI); lStatus = (ULONG )tmp___1; return (lStatus); } } ULONG PhsDeletePHSRule(void *pvContext , B_UINT16 uiVcid , B_UINT8 u8PHSI ) { ULONG lStatus ; UINT nSFIndex ; UINT nClsidIndex ; S_SERVICEFLOW_ENTRY *pstServiceFlowEntry ; S_CLASSIFIER_TABLE *pstClassifierRulesTable ; struct bcm_mini_adapter *Adapter ; void *tmp ; PPHS_DEVICE_EXTENSION pDeviceExtension ; { lStatus = 0UL; nSFIndex = 0U; nClsidIndex = 0U; pstServiceFlowEntry = 0; pstClassifierRulesTable = 0; tmp = netdev_priv((struct net_device const *)gblpnetdev); Adapter = (struct bcm_mini_adapter *)tmp; pDeviceExtension = (struct _PHS_DEVICE_EXTENSION *)pvContext; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 33554432U) != 0U) { printk("\017%s:======>\n", "PhsDeletePHSRule"); } else { } if ((unsigned long )pDeviceExtension != (unsigned long )((PPHS_DEVICE_EXTENSION )0)) { nSFIndex = GetServiceFlowEntry(pDeviceExtension->pstServiceFlowPhsRulesTable, (int )uiVcid, & pstServiceFlowEntry); if (nSFIndex == 4294967295U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 33554432U) != 0U) { printk("\017%s:SFID Match Failed\n", "PhsDeletePHSRule"); } else { } return (2051UL); } else { } pstClassifierRulesTable = pstServiceFlowEntry->pstClassifierTable; if ((unsigned long )pstClassifierRulesTable != (unsigned long )((S_CLASSIFIER_TABLE *)0)) { nClsidIndex = 0U; goto ldv_46978; ldv_46977: ; if ((unsigned int )pstClassifierRulesTable->stActivePhsRulesList[nClsidIndex].bUsed != 0U && (unsigned long )pstClassifierRulesTable->stActivePhsRulesList[nClsidIndex].pstPhsRule != (unsigned long )((S_PHS_RULE *)0)) { if ((int )(pstClassifierRulesTable->stActivePhsRulesList[nClsidIndex].pstPhsRule)->u8PHSI == (int )u8PHSI) { if ((unsigned int )(pstClassifierRulesTable->stActivePhsRulesList[nClsidIndex].pstPhsRule)->u8RefCnt != 0U) { (pstClassifierRulesTable->stActivePhsRulesList[nClsidIndex].pstPhsRule)->u8RefCnt = (B_UINT8 )((int )(pstClassifierRulesTable->stActivePhsRulesList[nClsidIndex].pstPhsRule)->u8RefCnt - 1); } else { } if ((unsigned int )(pstClassifierRulesTable->stActivePhsRulesList[nClsidIndex].pstPhsRule)->u8RefCnt == 0U) { kfree((void const *)pstClassifierRulesTable->stActivePhsRulesList[nClsidIndex].pstPhsRule); } else { } memset((void *)(& pstClassifierRulesTable->stActivePhsRulesList) + (unsigned long )nClsidIndex, 0, 24UL); } else { } } else { } nClsidIndex = nClsidIndex + 1U; ldv_46978: ; if (nClsidIndex <= 19U) { goto ldv_46977; } else { goto ldv_46979; } ldv_46979: ; } else { } } else { } return (lStatus); } } ULONG PhsDeleteClassifierRule(void *pvContext , B_UINT16 uiVcid , B_UINT16 uiClsId ) { ULONG lStatus ; UINT nSFIndex ; UINT nClsidIndex ; S_SERVICEFLOW_ENTRY *pstServiceFlowEntry ; S_CLASSIFIER_ENTRY *pstClassifierEntry ; struct bcm_mini_adapter *Adapter ; void *tmp ; PPHS_DEVICE_EXTENSION pDeviceExtension ; { lStatus = 0UL; nSFIndex = 0U; nClsidIndex = 0U; pstServiceFlowEntry = 0; pstClassifierEntry = 0; tmp = netdev_priv((struct net_device const *)gblpnetdev); Adapter = (struct bcm_mini_adapter *)tmp; pDeviceExtension = (struct _PHS_DEVICE_EXTENSION *)pvContext; if ((unsigned long )pDeviceExtension != (unsigned long )((PPHS_DEVICE_EXTENSION )0)) { nSFIndex = GetServiceFlowEntry(pDeviceExtension->pstServiceFlowPhsRulesTable, (int )uiVcid, & pstServiceFlowEntry); if (nSFIndex == 4294967295U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 33554432U) != 0U) { printk("\017%s:SFID Match Failed\n", "PhsDeleteClassifierRule"); } else { } return (2051UL); } else { } nClsidIndex = GetClassifierEntry(pstServiceFlowEntry->pstClassifierTable, (B_UINT32 )uiClsId, 0, & pstClassifierEntry); if (nClsidIndex != 4294967295U && (unsigned int )pstClassifierEntry->bUnclassifiedPHSRule == 0U) { if ((unsigned long )pstClassifierEntry->pstPhsRule != (unsigned long )((S_PHS_RULE *)0)) { if ((unsigned int )(pstClassifierEntry->pstPhsRule)->u8RefCnt != 0U) { (pstClassifierEntry->pstPhsRule)->u8RefCnt = (B_UINT8 )((int )(pstClassifierEntry->pstPhsRule)->u8RefCnt - 1); } else { } if ((unsigned int )(pstClassifierEntry->pstPhsRule)->u8RefCnt == 0U) { kfree((void const *)pstClassifierEntry->pstPhsRule); } else { } } else { } memset((void *)pstClassifierEntry, 0, 24UL); } else { } nClsidIndex = GetClassifierEntry(pstServiceFlowEntry->pstClassifierTable, (B_UINT32 )uiClsId, 1, & pstClassifierEntry); if (nClsidIndex != 4294967295U && (unsigned int )pstClassifierEntry->bUnclassifiedPHSRule == 0U) { kfree((void const *)pstClassifierEntry->pstPhsRule); memset((void *)pstClassifierEntry, 0, 24UL); } else { } } else { } return (lStatus); } } ULONG PhsDeleteSFRules(void *pvContext , B_UINT16 uiVcid ) { ULONG lStatus ; UINT nSFIndex ; UINT nClsidIndex ; S_SERVICEFLOW_ENTRY *pstServiceFlowEntry ; S_CLASSIFIER_TABLE *pstClassifierRulesTable ; struct bcm_mini_adapter *Adapter ; void *tmp ; PPHS_DEVICE_EXTENSION pDeviceExtension ; { lStatus = 0UL; nSFIndex = 0U; nClsidIndex = 0U; pstServiceFlowEntry = 0; pstClassifierRulesTable = 0; tmp = netdev_priv((struct net_device const *)gblpnetdev); Adapter = (struct bcm_mini_adapter *)tmp; pDeviceExtension = (struct _PHS_DEVICE_EXTENSION *)pvContext; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 33554432U) != 0U) { printk("\017%s:====> \n", "PhsDeleteSFRules"); } else { } if ((unsigned long )pDeviceExtension != (unsigned long )((PPHS_DEVICE_EXTENSION )0)) { nSFIndex = GetServiceFlowEntry(pDeviceExtension->pstServiceFlowPhsRulesTable, (int )uiVcid, & pstServiceFlowEntry); if (nSFIndex == 4294967295U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 33554432U) != 0U) { printk("\017%s:SFID Match Failed\n", "PhsDeleteSFRules"); } else { } return (2051UL); } else { } pstClassifierRulesTable = pstServiceFlowEntry->pstClassifierTable; if ((unsigned long )pstClassifierRulesTable != (unsigned long )((S_CLASSIFIER_TABLE *)0)) { nClsidIndex = 0U; goto ldv_47006; ldv_47005: ; if ((unsigned long )pstClassifierRulesTable->stActivePhsRulesList[nClsidIndex].pstPhsRule != (unsigned long )((S_PHS_RULE *)0)) { if ((unsigned int )(pstClassifierRulesTable->stActivePhsRulesList[nClsidIndex].pstPhsRule)->u8RefCnt != 0U) { (pstClassifierRulesTable->stActivePhsRulesList[nClsidIndex].pstPhsRule)->u8RefCnt = (B_UINT8 )((int )(pstClassifierRulesTable->stActivePhsRulesList[nClsidIndex].pstPhsRule)->u8RefCnt - 1); } else { } if ((unsigned int )(pstClassifierRulesTable->stActivePhsRulesList[nClsidIndex].pstPhsRule)->u8RefCnt == 0U) { kfree((void const *)pstClassifierRulesTable->stActivePhsRulesList[nClsidIndex].pstPhsRule); } else { } pstClassifierRulesTable->stActivePhsRulesList[nClsidIndex].pstPhsRule = 0; } else { } memset((void *)(& pstClassifierRulesTable->stActivePhsRulesList) + (unsigned long )nClsidIndex, 0, 24UL); if ((unsigned long )pstClassifierRulesTable->stOldPhsRulesList[nClsidIndex].pstPhsRule != (unsigned long )((S_PHS_RULE *)0)) { if ((unsigned int )(pstClassifierRulesTable->stOldPhsRulesList[nClsidIndex].pstPhsRule)->u8RefCnt != 0U) { (pstClassifierRulesTable->stOldPhsRulesList[nClsidIndex].pstPhsRule)->u8RefCnt = (B_UINT8 )((int )(pstClassifierRulesTable->stOldPhsRulesList[nClsidIndex].pstPhsRule)->u8RefCnt - 1); } else { } if ((unsigned int )(pstClassifierRulesTable->stOldPhsRulesList[nClsidIndex].pstPhsRule)->u8RefCnt == 0U) { kfree((void const *)pstClassifierRulesTable->stOldPhsRulesList[nClsidIndex].pstPhsRule); } else { } pstClassifierRulesTable->stOldPhsRulesList[nClsidIndex].pstPhsRule = 0; } else { } memset((void *)(& pstClassifierRulesTable->stOldPhsRulesList) + (unsigned long )nClsidIndex, 0, 24UL); nClsidIndex = nClsidIndex + 1U; ldv_47006: ; if (nClsidIndex <= 19U) { goto ldv_47005; } else { goto ldv_47007; } ldv_47007: ; } else { } pstServiceFlowEntry->bUsed = 0U; pstServiceFlowEntry->uiVcid = 0U; } else { } return (lStatus); } } static ULONG PhsCompress(void *pvContext , B_UINT16 uiVcid , B_UINT16 uiClsId , void *pvInputBuffer , void *pvOutputBuffer , UINT *pOldHeaderSize , UINT *pNewHeaderSize ) { UINT nSFIndex ; UINT nClsidIndex ; S_SERVICEFLOW_ENTRY *pstServiceFlowEntry ; S_CLASSIFIER_ENTRY *pstClassifierEntry ; S_PHS_RULE *pstPhsRule ; ULONG lStatus ; struct bcm_mini_adapter *Adapter ; void *tmp ; PPHS_DEVICE_EXTENSION pDeviceExtension ; BOOLEAN tmp___0 ; int tmp___1 ; { nSFIndex = 0U; nClsidIndex = 0U; pstServiceFlowEntry = 0; pstClassifierEntry = 0; pstPhsRule = 0; lStatus = 0UL; tmp = netdev_priv((struct net_device const *)gblpnetdev); Adapter = (struct bcm_mini_adapter *)tmp; pDeviceExtension = (struct _PHS_DEVICE_EXTENSION *)pvContext; if ((unsigned long )pDeviceExtension == (unsigned long )((PPHS_DEVICE_EXTENSION )0)) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 65536U) != 0U) { printk("\017%s:Invalid Device Extension\n", "PhsCompress"); } else { } lStatus = 162UL; return (lStatus); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 65536U) != 0U) { printk("\017%s:Suppressing header \n", "PhsCompress"); } else { } nSFIndex = GetServiceFlowEntry(pDeviceExtension->pstServiceFlowPhsRulesTable, (int )uiVcid, & pstServiceFlowEntry); if (nSFIndex == 4294967295U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 65536U) != 0U) { printk("\017%s:SFID Match Failed\n", "PhsCompress"); } else { } lStatus = 162UL; return (lStatus); } else { } nClsidIndex = GetClassifierEntry(pstServiceFlowEntry->pstClassifierTable, (B_UINT32 )uiClsId, 0, & pstClassifierEntry); if (nClsidIndex == 4294967295U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 65536U) != 0U) { printk("\017%s:No PHS Rule Defined For Classifier\n", "PhsCompress"); } else { } lStatus = 162UL; return (lStatus); } else { } pstPhsRule = pstClassifierEntry->pstPhsRule; tmp___0 = ValidatePHSRuleComplete(pstPhsRule); if ((int )((signed char )tmp___0) == 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 33554432U) != 0U) { printk("\017%s:PHS Rule Defined For Classifier But Not Complete\n", "PhsCompress"); } else { } lStatus = 162UL; return (lStatus); } else { } tmp___1 = phs_compress(pstPhsRule, (unsigned char *)pvInputBuffer, (unsigned char *)pvOutputBuffer, pOldHeaderSize, pNewHeaderSize); lStatus = (ULONG )tmp___1; if (lStatus == 161UL) { pstPhsRule->PHSModifiedBytes = pstPhsRule->PHSModifiedBytes + (LONG )((*pOldHeaderSize - *pNewHeaderSize) - 1U); pstPhsRule->PHSModifiedNumPackets = pstPhsRule->PHSModifiedNumPackets + 1UL; } else { pstPhsRule->PHSErrorNumPackets = pstPhsRule->PHSErrorNumPackets + 1UL; } return (lStatus); } } static ULONG PhsDeCompress(void *pvContext , B_UINT16 uiVcid , void *pvInputBuffer , void *pvOutputBuffer , UINT *pInHeaderSize , UINT *pOutHeaderSize ) { UINT nSFIndex ; UINT nPhsRuleIndex ; S_SERVICEFLOW_ENTRY *pstServiceFlowEntry ; S_PHS_RULE *pstPhsRule ; UINT phsi ; struct bcm_mini_adapter *Adapter ; void *tmp ; PPHS_DEVICE_EXTENSION pDeviceExtension ; int tmp___0 ; { nSFIndex = 0U; nPhsRuleIndex = 0U; pstServiceFlowEntry = 0; pstPhsRule = 0; tmp = netdev_priv((struct net_device const *)gblpnetdev); Adapter = (struct bcm_mini_adapter *)tmp; pDeviceExtension = (struct _PHS_DEVICE_EXTENSION *)pvContext; *pInHeaderSize = 0U; if ((unsigned long )pDeviceExtension == (unsigned long )((PPHS_DEVICE_EXTENSION )0)) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 131072U) != 0U) { printk("\017%s:Invalid Device Extension\n", "PhsDeCompress"); } else { } return (2048UL); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 131072U) != 0U) { printk("\017%s:Restoring header\n", "PhsDeCompress"); } else { } phsi = (UINT )*((unsigned char *)pvInputBuffer); if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 131072U) != 0U) { printk("\017%s:PHSI To Be Used For restore : %x\n", "PhsDeCompress", phsi); } else { } if (phsi == 0U) { return (162UL); } else { } nSFIndex = GetServiceFlowEntry(pDeviceExtension->pstServiceFlowPhsRulesTable, (int )uiVcid, & pstServiceFlowEntry); if (nSFIndex == 4294967295U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 131072U) != 0U) { printk("\017%s:SFID Match Failed During Lookup\n", "PhsDeCompress"); } else { } return (2051UL); } else { } nPhsRuleIndex = GetPhsRuleEntry(pstServiceFlowEntry->pstClassifierTable, phsi, 0, & pstPhsRule); if (nPhsRuleIndex == 4294967295U) { nPhsRuleIndex = GetPhsRuleEntry(pstServiceFlowEntry->pstClassifierTable, phsi, 1, & pstPhsRule); if (nPhsRuleIndex == 4294967295U) { return (2057UL); } else { } } else { } tmp___0 = phs_decompress((unsigned char *)pvInputBuffer, (unsigned char *)pvOutputBuffer, pstPhsRule, pOutHeaderSize); *pInHeaderSize = (UINT )tmp___0; pstPhsRule->PHSModifiedBytes = pstPhsRule->PHSModifiedBytes + (LONG )((*pOutHeaderSize - *pInHeaderSize) - 1U); pstPhsRule->PHSModifiedNumPackets = pstPhsRule->PHSModifiedNumPackets + 1UL; return (161UL); } } static void free_phs_serviceflow_rules(S_SERVICEFLOW_TABLE *psServiceFlowRulesTable ) { int i ; int j ; struct bcm_mini_adapter *Adapter ; void *tmp ; S_SERVICEFLOW_ENTRY stServiceFlowEntry ; S_CLASSIFIER_TABLE *pstClassifierRulesTable ; { tmp = netdev_priv((struct net_device const *)gblpnetdev); Adapter = (struct bcm_mini_adapter *)tmp; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 33554432U) != 0U) { printk("\017%s:=======>\n", "free_phs_serviceflow_rules"); } else { } if ((unsigned long )psServiceFlowRulesTable != (unsigned long )((S_SERVICEFLOW_TABLE *)0)) { i = 0; goto ldv_47055; ldv_47054: stServiceFlowEntry = psServiceFlowRulesTable->stSFList[i]; pstClassifierRulesTable = stServiceFlowEntry.pstClassifierTable; if ((unsigned long )pstClassifierRulesTable != (unsigned long )((S_CLASSIFIER_TABLE *)0)) { j = 0; goto ldv_47052; ldv_47051: ; if ((unsigned long )pstClassifierRulesTable->stActivePhsRulesList[j].pstPhsRule != (unsigned long )((S_PHS_RULE *)0)) { if ((unsigned int )(pstClassifierRulesTable->stActivePhsRulesList[j].pstPhsRule)->u8RefCnt != 0U) { (pstClassifierRulesTable->stActivePhsRulesList[j].pstPhsRule)->u8RefCnt = (B_UINT8 )((int )(pstClassifierRulesTable->stActivePhsRulesList[j].pstPhsRule)->u8RefCnt - 1); } else { } if ((unsigned int )(pstClassifierRulesTable->stActivePhsRulesList[j].pstPhsRule)->u8RefCnt == 0U) { kfree((void const *)pstClassifierRulesTable->stActivePhsRulesList[j].pstPhsRule); } else { } pstClassifierRulesTable->stActivePhsRulesList[j].pstPhsRule = 0; } else { } if ((unsigned long )pstClassifierRulesTable->stOldPhsRulesList[j].pstPhsRule != (unsigned long )((S_PHS_RULE *)0)) { if ((unsigned int )(pstClassifierRulesTable->stOldPhsRulesList[j].pstPhsRule)->u8RefCnt != 0U) { (pstClassifierRulesTable->stOldPhsRulesList[j].pstPhsRule)->u8RefCnt = (B_UINT8 )((int )(pstClassifierRulesTable->stOldPhsRulesList[j].pstPhsRule)->u8RefCnt - 1); } else { } if ((unsigned int )(pstClassifierRulesTable->stOldPhsRulesList[j].pstPhsRule)->u8RefCnt == 0U) { kfree((void const *)pstClassifierRulesTable->stOldPhsRulesList[j].pstPhsRule); } else { } pstClassifierRulesTable->stOldPhsRulesList[j].pstPhsRule = 0; } else { } j = j + 1; ldv_47052: ; if (j <= 19) { goto ldv_47051; } else { goto ldv_47053; } ldv_47053: kfree((void const *)pstClassifierRulesTable); pstClassifierRulesTable = 0; stServiceFlowEntry.pstClassifierTable = pstClassifierRulesTable; } else { } i = i + 1; ldv_47055: ; if (i <= 16) { goto ldv_47054; } else { goto ldv_47056; } ldv_47056: ; } else { } kfree((void const *)psServiceFlowRulesTable); psServiceFlowRulesTable = 0; return; } } static BOOLEAN ValidatePHSRuleComplete(S_PHS_RULE *psPhsRule ) { { if ((unsigned long )psPhsRule != (unsigned long )((S_PHS_RULE *)0)) { if ((unsigned int )psPhsRule->u8PHSI == 0U) { return (0); } else { } if ((unsigned int )psPhsRule->u8PHSS == 0U) { return (0); } else { } if ((unsigned int )psPhsRule->u8PHSFLength == 0U) { return (0); } else { } return (1); } else { return (0); } } } UINT GetServiceFlowEntry(S_SERVICEFLOW_TABLE *psServiceFlowTable , B_UINT16 uiVcid , S_SERVICEFLOW_ENTRY **ppstServiceFlowEntry ) { int i ; { i = 0; goto ldv_47067; ldv_47066: ; if ((unsigned int )psServiceFlowTable->stSFList[i].bUsed != 0U) { if ((int )psServiceFlowTable->stSFList[i].uiVcid == (int )uiVcid) { *ppstServiceFlowEntry = (S_SERVICEFLOW_ENTRY *)(& psServiceFlowTable->stSFList) + (unsigned long )i; return ((UINT )i); } else { } } else { } i = i + 1; ldv_47067: ; if (i <= 16) { goto ldv_47066; } else { goto ldv_47068; } ldv_47068: *ppstServiceFlowEntry = 0; return (4294967295U); } } static UINT GetClassifierEntry(S_CLASSIFIER_TABLE *pstClassifierTable , B_UINT32 uiClsid , E_CLASSIFIER_ENTRY_CONTEXT eClsContext , S_CLASSIFIER_ENTRY **ppstClassifierEntry ) { int i ; S_CLASSIFIER_ENTRY *psClassifierRules ; { psClassifierRules = 0; i = 0; goto ldv_47078; ldv_47077: ; if ((unsigned int )eClsContext == 0U) { psClassifierRules = (S_CLASSIFIER_ENTRY *)(& pstClassifierTable->stActivePhsRulesList) + (unsigned long )i; } else { psClassifierRules = (S_CLASSIFIER_ENTRY *)(& pstClassifierTable->stOldPhsRulesList) + (unsigned long )i; } if ((unsigned int )psClassifierRules->bUsed != 0U) { if ((B_UINT32 )psClassifierRules->uiClassifierRuleId == uiClsid) { *ppstClassifierEntry = psClassifierRules; return ((UINT )i); } else { } } else { } i = i + 1; ldv_47078: ; if (i <= 19) { goto ldv_47077; } else { goto ldv_47079; } ldv_47079: *ppstClassifierEntry = 0; return (4294967295U); } } static UINT GetPhsRuleEntry(S_CLASSIFIER_TABLE *pstClassifierTable , B_UINT32 uiPHSI , E_CLASSIFIER_ENTRY_CONTEXT eClsContext , S_PHS_RULE **ppstPhsRule ) { int i ; S_CLASSIFIER_ENTRY *pstClassifierRule ; { pstClassifierRule = 0; i = 0; goto ldv_47089; ldv_47088: ; if ((unsigned int )eClsContext == 0U) { pstClassifierRule = (S_CLASSIFIER_ENTRY *)(& pstClassifierTable->stActivePhsRulesList) + (unsigned long )i; } else { pstClassifierRule = (S_CLASSIFIER_ENTRY *)(& pstClassifierTable->stOldPhsRulesList) + (unsigned long )i; } if ((unsigned int )pstClassifierRule->bUsed != 0U) { if ((B_UINT32 )pstClassifierRule->u8PHSI == uiPHSI) { *ppstPhsRule = pstClassifierRule->pstPhsRule; return ((UINT )i); } else { } } else { } i = i + 1; ldv_47089: ; if (i <= 19) { goto ldv_47088; } else { goto ldv_47090; } ldv_47090: *ppstPhsRule = 0; return (4294967295U); } } static UINT CreateSFToClassifierRuleMapping(B_UINT16 uiVcid , B_UINT16 uiClsId , S_SERVICEFLOW_TABLE *psServiceFlowTable , S_PHS_RULE *psPhsRule , B_UINT8 u8AssociatedPHSI ) { S_CLASSIFIER_TABLE *psaClassifiertable ; UINT uiStatus ; int iSfIndex ; BOOLEAN bFreeEntryFound ; { psaClassifiertable = 0; uiStatus = 0U; bFreeEntryFound = 0; iSfIndex = 0; goto ldv_47104; ldv_47103: ; if ((unsigned int )psServiceFlowTable->stSFList[iSfIndex].bUsed == 0U) { bFreeEntryFound = 1; goto ldv_47102; } else { } iSfIndex = iSfIndex + 1; ldv_47104: ; if (iSfIndex <= 16) { goto ldv_47103; } else { goto ldv_47102; } ldv_47102: ; if ((int )((signed char )bFreeEntryFound) == 0) { return (2053U); } else { } psaClassifiertable = psServiceFlowTable->stSFList[iSfIndex].pstClassifierTable; uiStatus = CreateClassifierPHSRule((int )uiClsId, psaClassifiertable, psPhsRule, 0, (int )u8AssociatedPHSI); if (uiStatus == 0U) { psServiceFlowTable->stSFList[iSfIndex].bUsed = 1U; psServiceFlowTable->stSFList[iSfIndex].uiVcid = uiVcid; } else { } return (uiStatus); } } static UINT CreateClassiferToPHSRuleMapping(B_UINT16 uiVcid , B_UINT16 uiClsId , S_SERVICEFLOW_ENTRY *pstServiceFlowEntry , S_PHS_RULE *psPhsRule , B_UINT8 u8AssociatedPHSI ) { S_CLASSIFIER_ENTRY *pstClassifierEntry ; UINT uiStatus ; UINT nClassifierIndex ; S_CLASSIFIER_TABLE *psaClassifiertable ; struct bcm_mini_adapter *Adapter ; void *tmp ; size_t __len ; void *__ret ; size_t __len___0 ; void *__ret___0 ; { pstClassifierEntry = 0; uiStatus = 0U; nClassifierIndex = 0U; psaClassifiertable = 0; tmp = netdev_priv((struct net_device const *)gblpnetdev); Adapter = (struct bcm_mini_adapter *)tmp; psaClassifiertable = pstServiceFlowEntry->pstClassifierTable; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 33554432U) != 0U) { printk("\017%s:==>", "CreateClassiferToPHSRuleMapping"); } else { } nClassifierIndex = GetClassifierEntry(pstServiceFlowEntry->pstClassifierTable, (B_UINT32 )uiClsId, 0, & pstClassifierEntry); if (nClassifierIndex == 4294967295U) { uiStatus = CreateClassifierPHSRule((int )uiClsId, psaClassifiertable, psPhsRule, 0, (int )u8AssociatedPHSI); return (uiStatus); } else { } if ((int )pstClassifierEntry->u8PHSI == (int )psPhsRule->u8PHSI) { if ((unsigned long )pstClassifierEntry->pstPhsRule == (unsigned long )((S_PHS_RULE *)0)) { return (2049U); } else { } if ((unsigned int )psPhsRule->u8PHSFLength != 0U) { __len = 255UL; if (__len > 63UL) { __ret = memcpy((void *)(& (pstClassifierEntry->pstPhsRule)->u8PHSF), (void const *)(& psPhsRule->u8PHSF), __len); } else { __ret = memcpy((void *)(& (pstClassifierEntry->pstPhsRule)->u8PHSF), (void const *)(& psPhsRule->u8PHSF), __len); } } else { } if ((unsigned int )psPhsRule->u8PHSFLength != 0U) { (pstClassifierEntry->pstPhsRule)->u8PHSFLength = psPhsRule->u8PHSFLength; } else { } if ((unsigned int )psPhsRule->u8PHSMLength != 0U) { __len___0 = 255UL; if (__len___0 > 63UL) { __ret___0 = memcpy((void *)(& (pstClassifierEntry->pstPhsRule)->u8PHSM), (void const *)(& psPhsRule->u8PHSM), __len___0); } else { __ret___0 = memcpy((void *)(& (pstClassifierEntry->pstPhsRule)->u8PHSM), (void const *)(& psPhsRule->u8PHSM), __len___0); } } else { } if ((unsigned int )psPhsRule->u8PHSMLength != 0U) { (pstClassifierEntry->pstPhsRule)->u8PHSMLength = psPhsRule->u8PHSMLength; } else { } if ((unsigned int )psPhsRule->u8PHSS != 0U) { (pstClassifierEntry->pstPhsRule)->u8PHSS = psPhsRule->u8PHSS; } else { } (pstClassifierEntry->pstPhsRule)->u8PHSV = psPhsRule->u8PHSV; } else { uiStatus = UpdateClassifierPHSRule((int )uiClsId, pstClassifierEntry, psaClassifiertable, psPhsRule, (int )u8AssociatedPHSI); } return (uiStatus); } } static UINT CreateClassifierPHSRule(B_UINT16 uiClsId , S_CLASSIFIER_TABLE *psaClassifiertable , S_PHS_RULE *psPhsRule , E_CLASSIFIER_ENTRY_CONTEXT eClsContext , B_UINT8 u8AssociatedPHSI ) { UINT iClassifierIndex ; BOOLEAN bFreeEntryFound ; S_CLASSIFIER_ENTRY *psClassifierRules ; UINT nStatus ; struct bcm_mini_adapter *Adapter ; void *tmp ; void *tmp___0 ; size_t __len ; void *__ret ; { iClassifierIndex = 0U; bFreeEntryFound = 0; psClassifierRules = 0; nStatus = 0U; tmp = netdev_priv((struct net_device const *)gblpnetdev); Adapter = (struct bcm_mini_adapter *)tmp; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 33554432U) != 0U) { printk("\017%s:Inside CreateClassifierPHSRule", "CreateClassifierPHSRule"); } else { } if ((unsigned long )psaClassifiertable == (unsigned long )((S_CLASSIFIER_TABLE *)0)) { return (2052U); } else { } if ((unsigned int )eClsContext == 1U) { iClassifierIndex = GetClassifierEntry(psaClassifiertable, (B_UINT32 )uiClsId, eClsContext, & psClassifierRules); if (iClassifierIndex != 4294967295U) { bFreeEntryFound = 1; } else { } } else { } if ((int )((signed char )bFreeEntryFound) == 0) { iClassifierIndex = 0U; goto ldv_47139; ldv_47138: ; if ((unsigned int )eClsContext == 0U) { psClassifierRules = (S_CLASSIFIER_ENTRY *)(& psaClassifiertable->stActivePhsRulesList) + (unsigned long )iClassifierIndex; } else { psClassifierRules = (S_CLASSIFIER_ENTRY *)(& psaClassifiertable->stOldPhsRulesList) + (unsigned long )iClassifierIndex; } if ((unsigned int )psClassifierRules->bUsed == 0U) { bFreeEntryFound = 1; goto ldv_47137; } else { } iClassifierIndex = iClassifierIndex + 1U; ldv_47139: ; if (iClassifierIndex <= 19U) { goto ldv_47138; } else { goto ldv_47137; } ldv_47137: ; } else { } if ((int )((signed char )bFreeEntryFound) == 0) { if ((unsigned int )eClsContext == 0U) { return (2054U); } else { if ((unsigned int )psaClassifiertable->uiOldestPhsRuleIndex > 19U) { psaClassifiertable->uiOldestPhsRuleIndex = 0U; } else { } iClassifierIndex = (UINT )psaClassifiertable->uiOldestPhsRuleIndex; psClassifierRules = (S_CLASSIFIER_ENTRY *)(& psaClassifiertable->stOldPhsRulesList) + (unsigned long )iClassifierIndex; psaClassifiertable->uiOldestPhsRuleIndex = (B_UINT16 )((int )psaClassifiertable->uiOldestPhsRuleIndex + 1); } } else { } if ((unsigned int )eClsContext == 1U) { if ((unsigned long )psClassifierRules->pstPhsRule == (unsigned long )((S_PHS_RULE *)0)) { tmp___0 = kmalloc(544UL, 208U); psClassifierRules->pstPhsRule = (S_PHS_RULE *)tmp___0; if ((unsigned long )psClassifierRules->pstPhsRule == (unsigned long )((S_PHS_RULE *)0)) { return (2055U); } else { } } else { } psClassifierRules->bUsed = 1U; psClassifierRules->uiClassifierRuleId = uiClsId; psClassifierRules->u8PHSI = psPhsRule->u8PHSI; psClassifierRules->bUnclassifiedPHSRule = psPhsRule->bUnclassifiedPHSRule; __len = 544UL; if (__len > 63UL) { __ret = memcpy((void *)psClassifierRules->pstPhsRule, (void const *)psPhsRule, __len); } else { __ret = memcpy((void *)psClassifierRules->pstPhsRule, (void const *)psPhsRule, __len); } } else { nStatus = UpdateClassifierPHSRule((int )uiClsId, psClassifierRules, psaClassifiertable, psPhsRule, (int )u8AssociatedPHSI); } return (nStatus); } } static UINT UpdateClassifierPHSRule(B_UINT16 uiClsId , S_CLASSIFIER_ENTRY *pstClassifierEntry , S_CLASSIFIER_TABLE *psaClassifiertable , S_PHS_RULE *psPhsRule , B_UINT8 u8AssociatedPHSI ) { S_PHS_RULE *pstAddPhsRule ; UINT nPhsRuleIndex ; BOOLEAN bPHSRuleOrphaned ; struct bcm_mini_adapter *Adapter ; void *tmp ; void *tmp___0 ; size_t __len ; void *__ret ; { pstAddPhsRule = 0; nPhsRuleIndex = 0U; bPHSRuleOrphaned = 0; tmp = netdev_priv((struct net_device const *)gblpnetdev); Adapter = (struct bcm_mini_adapter *)tmp; psPhsRule->u8RefCnt = 0U; bPHSRuleOrphaned = DerefPhsRule((int )uiClsId, psaClassifiertable, pstClassifierEntry->pstPhsRule); nPhsRuleIndex = GetPhsRuleEntry(psaClassifiertable, (B_UINT32 )u8AssociatedPHSI, 0, & pstAddPhsRule); if (nPhsRuleIndex == 4294967295U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 33554432U) != 0U) { printk("\017%s:\nAdding New PHSRuleEntry For Classifier", "UpdateClassifierPHSRule"); } else { } if ((unsigned int )psPhsRule->u8PHSI == 0U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 33554432U) != 0U) { printk("\017%s:\nError PHSI is Zero\n", "UpdateClassifierPHSRule"); } else { } return (2049U); } else { } if ((int )((signed char )bPHSRuleOrphaned) == 0) { tmp___0 = kmalloc(544UL, 208U); pstClassifierEntry->pstPhsRule = (S_PHS_RULE *)tmp___0; if ((unsigned long )pstClassifierEntry->pstPhsRule == (unsigned long )((S_PHS_RULE *)0)) { return (2055U); } else { } } else { } __len = 544UL; if (__len > 63UL) { __ret = memcpy((void *)pstClassifierEntry->pstPhsRule, (void const *)psPhsRule, __len); } else { __ret = memcpy((void *)pstClassifierEntry->pstPhsRule, (void const *)psPhsRule, __len); } } else { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 33554432U) != 0U) { printk("\017%s:\nTying Classifier to Existing PHS Rule", "UpdateClassifierPHSRule"); } else { } if ((int )((signed char )bPHSRuleOrphaned) != 0) { kfree((void const *)pstClassifierEntry->pstPhsRule); pstClassifierEntry->pstPhsRule = 0; } else { } pstClassifierEntry->pstPhsRule = pstAddPhsRule; } pstClassifierEntry->bUsed = 1U; pstClassifierEntry->u8PHSI = (pstClassifierEntry->pstPhsRule)->u8PHSI; pstClassifierEntry->uiClassifierRuleId = uiClsId; (pstClassifierEntry->pstPhsRule)->u8RefCnt = (B_UINT8 )((int )(pstClassifierEntry->pstPhsRule)->u8RefCnt + 1); pstClassifierEntry->bUnclassifiedPHSRule = (pstClassifierEntry->pstPhsRule)->bUnclassifiedPHSRule; return (0U); } } static BOOLEAN DerefPhsRule(B_UINT16 uiClsId , S_CLASSIFIER_TABLE *psaClassifiertable , S_PHS_RULE *pstPhsRule ) { { if ((unsigned long )pstPhsRule == (unsigned long )((S_PHS_RULE *)0)) { return (0); } else { } if ((unsigned int )pstPhsRule->u8RefCnt != 0U) { pstPhsRule->u8RefCnt = (B_UINT8 )((int )pstPhsRule->u8RefCnt - 1); } else { } if ((unsigned int )pstPhsRule->u8RefCnt == 0U) { return (1); } else { return (0); } } } void DumpPhsRules(PPHS_DEVICE_EXTENSION pDeviceExtension ) { int i ; int j ; int k ; int l ; struct bcm_mini_adapter *Adapter ; void *tmp ; S_SERVICEFLOW_ENTRY stServFlowEntry ; S_CLASSIFIER_ENTRY stClsEntry ; { tmp = netdev_priv((struct net_device const *)gblpnetdev); Adapter = (struct bcm_mini_adapter *)tmp; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:\n Dumping PHS Rules : \n", "DumpPhsRules"); } else { } i = 0; goto ldv_47187; ldv_47186: stServFlowEntry = (pDeviceExtension->pstServiceFlowPhsRulesTable)->stSFList[i]; if ((unsigned int )stServFlowEntry.bUsed != 0U) { j = 0; goto ldv_47184; ldv_47183: l = 0; goto ldv_47181; ldv_47180: ; if (l == 0) { stClsEntry = (stServFlowEntry.pstClassifierTable)->stActivePhsRulesList[j]; if ((unsigned int )stClsEntry.bUsed != 0U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017\n Active PHS Rule : \n"); } else { } } else { } } else { stClsEntry = (stServFlowEntry.pstClassifierTable)->stOldPhsRulesList[j]; if ((unsigned int )stClsEntry.bUsed != 0U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017\n Old PHS Rule : \n"); } else { } } else { } } if ((unsigned int )stClsEntry.bUsed != 0U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:\n VCID : %#X", "DumpPhsRules", (int )stServFlowEntry.uiVcid); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017\n ClassifierID : %#X", (int )stClsEntry.uiClassifierRuleId); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017\n PHSRuleID : %#X", (int )stClsEntry.u8PHSI); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017\n****************PHS Rule********************\n"); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017\n PHSI : %#X", (int )(stClsEntry.pstPhsRule)->u8PHSI); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017\n PHSFLength : %#X ", (int )(stClsEntry.pstPhsRule)->u8PHSFLength); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017\n PHSF : "); } else { } k = 0; goto ldv_47175; ldv_47174: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%#X ", (int )(stClsEntry.pstPhsRule)->u8PHSF[k]); } else { } k = k + 1; ldv_47175: ; if ((int )(stClsEntry.pstPhsRule)->u8PHSFLength > k) { goto ldv_47174; } else { goto ldv_47176; } ldv_47176: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017\n PHSMLength : %#X", (int )(stClsEntry.pstPhsRule)->u8PHSMLength); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017\n PHSM :"); } else { } k = 0; goto ldv_47178; ldv_47177: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%#X ", (int )(stClsEntry.pstPhsRule)->u8PHSM[k]); } else { } k = k + 1; ldv_47178: ; if ((int )(stClsEntry.pstPhsRule)->u8PHSMLength > k) { goto ldv_47177; } else { goto ldv_47179; } ldv_47179: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017\n PHSS : %#X ", (int )(stClsEntry.pstPhsRule)->u8PHSS); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017\n PHSV : %#X", (int )(stClsEntry.pstPhsRule)->u8PHSV); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 64U) != 0U) { printk("\017%s:\n********************************************\n", "DumpPhsRules"); } else { } } else { } l = l + 1; ldv_47181: ; if (l <= 1) { goto ldv_47180; } else { goto ldv_47182; } ldv_47182: j = j + 1; ldv_47184: ; if (j <= 19) { goto ldv_47183; } else { goto ldv_47185; } ldv_47185: ; } else { } i = i + 1; ldv_47187: ; if (i <= 16) { goto ldv_47186; } else { goto ldv_47188; } ldv_47188: ; return; } } static int phs_decompress(unsigned char *in_buf , unsigned char *out_buf , S_PHS_RULE *decomp_phs_rules , UINT *header_size ) { int phss ; int size ; S_PHS_RULE *tmp_memb ; int bit ; int i ; unsigned char *phsf ; unsigned char *phsm ; int in_buf_len ; struct bcm_mini_adapter *Adapter ; void *tmp ; { size = 0; i = 0; in_buf_len = (int )(*header_size - 1U); tmp = netdev_priv((struct net_device const *)gblpnetdev); Adapter = (struct bcm_mini_adapter *)tmp; in_buf = in_buf + 1; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 131072U) != 0U) { printk("\017%s:====>\n", "phs_decompress"); } else { } *header_size = 0U; if ((unsigned long )decomp_phs_rules == (unsigned long )((S_PHS_RULE *)0)) { return (0); } else { } tmp_memb = decomp_phs_rules; phss = (int )tmp_memb->u8PHSS; phsf = (unsigned char *)(& tmp_memb->u8PHSF); phsm = (unsigned char *)(& tmp_memb->u8PHSM); if (phss > 255) { phss = 255; } else { } goto ldv_47206; ldv_47205: bit = ((int )*phsm << i) & 128; if (bit == 128) { *out_buf = *phsf; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 131072U) != 0U) { printk("\017%s:\nDECOMP:In phss %d phsf %d ouput %d", "phs_decompress", phss, (int )*phsf, (int )*out_buf); } else { } } else { *out_buf = *in_buf; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 131072U) != 0U) { printk("\017%s:\nDECOMP:In phss %d input %d ouput %d", "phs_decompress", phss, (int )*in_buf, (int )*out_buf); } else { } in_buf = in_buf + 1; size = size + 1; } out_buf = out_buf + 1; phsf = phsf + 1; phss = phss - 1; i = i + 1; *header_size = *header_size + 1U; if (i > 7) { i = 0; phsm = phsm + 1; } else { } ldv_47206: ; if (phss > 0 && size < in_buf_len) { goto ldv_47205; } else { goto ldv_47207; } ldv_47207: ; return (size); } } static int phs_compress(S_PHS_RULE *phs_rule , unsigned char *in_buf , unsigned char *out_buf , unsigned int *header_size , UINT *new_header_size ) { unsigned char *old_addr ; int suppress ; struct bcm_mini_adapter *Adapter ; void *tmp ; { old_addr = out_buf; suppress = 0; tmp = netdev_priv((struct net_device const *)gblpnetdev); Adapter = (struct bcm_mini_adapter *)tmp; if ((unsigned long )phs_rule == (unsigned long )((S_PHS_RULE *)0)) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 65536U) != 0U) { printk("\017%s:\nphs_compress(): phs_rule null!", "phs_compress"); } else { } *out_buf = 0U; return (162); } else { } if ((UINT )phs_rule->u8PHSS <= *new_header_size) { *header_size = (UINT )phs_rule->u8PHSS; } else { *header_size = *new_header_size; } out_buf = out_buf + 1; suppress = verify_suppress_phsf(in_buf, out_buf, (unsigned char *)(& phs_rule->u8PHSF), (unsigned char *)(& phs_rule->u8PHSM), (unsigned int )phs_rule->u8PHSS, (unsigned int )phs_rule->u8PHSV, new_header_size); if (suppress == 161) { *old_addr = phs_rule->u8PHSI; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 65536U) != 0U) { printk("\017%s:\nCOMP:In phs_compress phsi %d", "phs_compress", (int )phs_rule->u8PHSI); } else { } } else { *old_addr = 0U; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 65536U) != 0U) { printk("\017%s:\nCOMP:In phs_compress PHSV Verification failed", "phs_compress"); } else { } } return (suppress); } } static int verify_suppress_phsf(unsigned char *in_buffer , unsigned char *out_buffer , unsigned char *phsf , unsigned char *phsm , unsigned int phss , unsigned int phsv , UINT *new_header_size ) { unsigned int size ; int bit ; int i ; struct bcm_mini_adapter *Adapter ; void *tmp ; { size = 0U; i = 0; tmp = netdev_priv((struct net_device const *)gblpnetdev); Adapter = (struct bcm_mini_adapter *)tmp; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 65536U) != 0U) { printk("\017%s:\nCOMP:In verify_phsf PHSM - 0x%X", "verify_suppress_phsf", (int )*phsm); } else { } if (*new_header_size < phss) { phss = *new_header_size; } else { } goto ldv_47234; ldv_47233: bit = ((int )*phsm << i) & 128; if (bit == 128) { if ((int )*in_buffer != (int )*phsf) { if (phsv == 0U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 65536U) != 0U) { printk("\017%s:\nCOMP:In verify_phsf failed for field %d buf %d phsf %d", "verify_suppress_phsf", phss, (int )*in_buffer, (int )*phsf); } else { } return (162); } else if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 65536U) != 0U) { printk("\017%s:\nCOMP:In verify_phsf success for field %d buf %d phsf %d", "verify_suppress_phsf", phss, (int )*in_buffer, (int )*phsf); } else { *out_buffer = *in_buffer; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 65536U) != 0U) { printk("\017%s:\nCOMP:In copying_header input %d out %d", "verify_suppress_phsf", (int )*in_buffer, (int )*out_buffer); } else { } out_buffer = out_buffer + 1; size = size + 1U; } } else { } } else { } in_buffer = in_buffer + 1; phsf = phsf + 1; phss = phss - 1U; i = i + 1; if (i > 7) { i = 0; phsm = phsm + 1; } else { } ldv_47234: ; if (phss != 0U) { goto ldv_47233; } else { goto ldv_47235; } ldv_47235: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 65536U) != 0U) { printk("\017%s:\nCOMP:In verify_phsf success", "verify_suppress_phsf"); } else { } *new_header_size = size; return (161); } } void ldv_mutex_lock_283(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_284(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_285(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_device(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_286(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___2 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex_of_device(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_287(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_device(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_288(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_289(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } int ldv_mutex_trylock_300(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_298(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_301(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_303(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_297(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_299(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_302(struct mutex *ldv_func_arg1 ) ; static B_UINT16 CFG_CalculateChecksum(B_UINT8 *pu8Buffer , B_UINT32 u32Size ) { B_UINT16 u16CheckSum ; B_UINT32 tmp ; { u16CheckSum = 0U; goto ldv_46816; ldv_46815: u16CheckSum = (int )((B_UINT16 )(~ ((int )*pu8Buffer))) + (int )u16CheckSum; pu8Buffer = pu8Buffer + 1; ldv_46816: tmp = u32Size; u32Size = u32Size - 1U; if (tmp != 0U) { goto ldv_46815; } else { goto ldv_46817; } ldv_46817: ; return (u16CheckSum); } } BOOLEAN IsReqGpioIsLedInNVM(struct bcm_mini_adapter *Adapter , UINT gpios ) { INT Status ; { Status = (INT )(~ Adapter->gpioBitMap & gpios); if (Status != 0) { return (0); } else { return (1); } } } static INT LED_Blink(struct bcm_mini_adapter *Adapter , UINT GPIO_Num , UCHAR uiLedIndex , ULONG timeout , INT num_of_time , LedEventInfo_t currdriverstate ) { int Status ; BOOLEAN bInfinite ; UINT gpio_val ; long __ret ; unsigned long tmp ; wait_queue_t __wait ; struct task_struct *tmp___0 ; bool tmp___1 ; struct task_struct *tmp___2 ; int tmp___3 ; bool tmp___4 ; int tmp___5 ; UINT gpio_val___0 ; bool tmp___6 ; UINT gpio_val___1 ; UINT gpio_val___2 ; long __ret___0 ; unsigned long tmp___7 ; wait_queue_t __wait___0 ; struct task_struct *tmp___8 ; bool tmp___9 ; struct task_struct *tmp___10 ; int tmp___11 ; bool tmp___12 ; int tmp___13 ; { Status = 0; bInfinite = 0; if (num_of_time < 0) { bInfinite = 1; num_of_time = 1; } else { } goto ldv_46852; ldv_46851: ; if ((unsigned int )Adapter->DriverState == (unsigned int )currdriverstate) { gpio_val = GPIO_Num; if ((unsigned int )Adapter->LEDInfo.LEDState[(int )uiLedIndex].BitPolarity == 1U) { wrmaltWithLock(Adapter, 251658304U, & gpio_val, 4UL); } else { wrmaltWithLock(Adapter, 251658308U, & gpio_val, 4UL); } } else { } tmp = msecs_to_jiffies((unsigned int const )timeout); __ret = (long )tmp; if ((unsigned int )Adapter->DriverState == (unsigned int )currdriverstate) { tmp___4 = kthread_should_stop(); if (tmp___4) { tmp___5 = 0; } else { tmp___5 = 1; } if (tmp___5) { tmp___0 = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp___0; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; ldv_46838: prepare_to_wait(& Adapter->LEDInfo.notify_led_event, & __wait, 1); if ((unsigned int )Adapter->DriverState != (unsigned int )currdriverstate) { goto ldv_46836; } else { tmp___1 = kthread_should_stop(); if ((int )tmp___1) { goto ldv_46836; } else { } } tmp___2 = get_current(); tmp___3 = signal_pending(tmp___2); if (tmp___3 == 0) { __ret = schedule_timeout(__ret); if (__ret == 0L) { goto ldv_46836; } else { } goto ldv_46837; } else { } __ret = -512L; goto ldv_46836; ldv_46837: ; goto ldv_46838; ldv_46836: finish_wait(& Adapter->LEDInfo.notify_led_event, & __wait); } else { } } else { } Status = (int )__ret; tmp___6 = kthread_should_stop(); if ((int )tmp___6) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 2048U) != 0U) { printk("\017%s:Led thread got signal to exit..hence exiting", "LED_Blink"); } else { } Adapter->LEDInfo.led_thread_running = 0; gpio_val___0 = GPIO_Num; if ((unsigned int )Adapter->LEDInfo.LEDState[(int )uiLedIndex].BitPolarity == 1U) { wrmaltWithLock(Adapter, 251658308U, & gpio_val___0, 4UL); } else { wrmaltWithLock(Adapter, 251658304U, & gpio_val___0, 4UL); } Status = 1; goto ldv_46842; } else { } if (Status != 0) { gpio_val___1 = GPIO_Num; if ((unsigned int )Adapter->LEDInfo.LEDState[(int )uiLedIndex].BitPolarity == 1U) { wrmaltWithLock(Adapter, 251658308U, & gpio_val___1, 4UL); } else { wrmaltWithLock(Adapter, 251658304U, & gpio_val___1, 4UL); } Status = 1; goto ldv_46842; } else { } gpio_val___2 = GPIO_Num; if ((unsigned int )Adapter->LEDInfo.LEDState[(int )uiLedIndex].BitPolarity == 1U) { wrmaltWithLock(Adapter, 251658308U, & gpio_val___2, 4UL); } else { wrmaltWithLock(Adapter, 251658304U, & gpio_val___2, 4UL); } tmp___7 = msecs_to_jiffies((unsigned int const )timeout); __ret___0 = (long )tmp___7; if ((unsigned int )Adapter->DriverState == (unsigned int )currdriverstate) { tmp___12 = kthread_should_stop(); if (tmp___12) { tmp___13 = 0; } else { tmp___13 = 1; } if (tmp___13) { tmp___8 = get_current(); __wait___0.flags = 0U; __wait___0.private = (void *)tmp___8; __wait___0.func = & autoremove_wake_function; __wait___0.task_list.next = & __wait___0.task_list; __wait___0.task_list.prev = & __wait___0.task_list; ldv_46849: prepare_to_wait(& Adapter->LEDInfo.notify_led_event, & __wait___0, 1); if ((unsigned int )Adapter->DriverState != (unsigned int )currdriverstate) { goto ldv_46847; } else { tmp___9 = kthread_should_stop(); if ((int )tmp___9) { goto ldv_46847; } else { } } tmp___10 = get_current(); tmp___11 = signal_pending(tmp___10); if (tmp___11 == 0) { __ret___0 = schedule_timeout(__ret___0); if (__ret___0 == 0L) { goto ldv_46847; } else { } goto ldv_46848; } else { } __ret___0 = -512L; goto ldv_46847; ldv_46848: ; goto ldv_46849; ldv_46847: finish_wait(& Adapter->LEDInfo.notify_led_event, & __wait___0); } else { } } else { } Status = (int )__ret___0; if ((int )((signed char )bInfinite) == 0) { num_of_time = num_of_time - 1; } else { } ldv_46852: ; if (num_of_time != 0) { goto ldv_46851; } else { goto ldv_46842; } ldv_46842: ; return (Status); } } static INT ScaleRateofTransfer(ULONG rate ) { { if (rate <= 3UL) { return ((INT )rate); } else if (rate > 3UL && rate <= 100UL) { return (5); } else if (rate > 100UL && rate <= 200UL) { return (6); } else if (rate > 200UL && rate <= 300UL) { return (7); } else if (rate > 300UL && rate <= 400UL) { return (8); } else if (rate > 400UL && rate <= 500UL) { return (9); } else if (rate > 500UL && rate <= 600UL) { return (10); } else { return (10); } } } static INT LED_Proportional_Blink(struct bcm_mini_adapter *Adapter , UCHAR GPIO_Num_tx , UCHAR uiTxLedIndex , UCHAR GPIO_Num_rx , UCHAR uiRxLedIndex , LedEventInfo_t currdriverstate ) { ULONG64 Initial_num_of_packts_tx ; ULONG64 Initial_num_of_packts_rx ; ULONG64 Final_num_of_packts_tx ; ULONG64 Final_num_of_packts_rx ; ULONG64 rate_of_transfer_tx ; ULONG64 rate_of_transfer_rx ; int Status ; INT num_of_time ; INT num_of_time_tx ; INT num_of_time_rx ; UINT remDelay ; BOOLEAN bBlinkBothLED ; ulong timeout ; INT tmp ; INT tmp___0 ; INT tmp___1 ; INT tmp___2 ; INT tmp___3 ; INT tmp___4 ; long __ret ; unsigned long tmp___5 ; wait_queue_t __wait ; struct task_struct *tmp___6 ; bool tmp___7 ; struct task_struct *tmp___8 ; int tmp___9 ; bool tmp___10 ; int tmp___11 ; bool tmp___12 ; UINT gpio_val ; UINT gpio_val___0 ; { Initial_num_of_packts_tx = 0ULL; Initial_num_of_packts_rx = 0ULL; Final_num_of_packts_tx = 0ULL; Final_num_of_packts_rx = 0ULL; rate_of_transfer_tx = 0ULL; rate_of_transfer_rx = 0ULL; Status = 0; num_of_time = 0; num_of_time_tx = 0; num_of_time_rx = 0; remDelay = 0U; bBlinkBothLED = 1; timeout = 0UL; Initial_num_of_packts_tx = (ULONG64 )(Adapter->dev)->stats.tx_packets; Initial_num_of_packts_rx = (ULONG64 )(Adapter->dev)->stats.rx_packets; num_of_time_tx = ScaleRateofTransfer((unsigned long )rate_of_transfer_tx); num_of_time_rx = ScaleRateofTransfer((unsigned long )rate_of_transfer_rx); goto ldv_46887; ldv_46886: timeout = 50UL; if ((int )((signed char )bBlinkBothLED) != 0) { if (num_of_time_tx > num_of_time_rx) { num_of_time = num_of_time_rx; } else { num_of_time = num_of_time_tx; } if (num_of_time > 0) { tmp = LED_Blink(Adapter, (UINT )(1 << (int )GPIO_Num_tx), (int )uiTxLedIndex, timeout, num_of_time, currdriverstate); if (tmp == 1) { return (1); } else { } tmp___0 = LED_Blink(Adapter, (UINT )(1 << (int )GPIO_Num_rx), (int )uiRxLedIndex, timeout, num_of_time, currdriverstate); if (tmp___0 == 1) { return (1); } else { } } else { } if (num_of_time == num_of_time_tx) { tmp___1 = LED_Blink(Adapter, (UINT )(1 << (int )GPIO_Num_rx), (int )uiRxLedIndex, timeout, num_of_time_rx - num_of_time, currdriverstate); if (tmp___1 == 1) { return (1); } else { } num_of_time = num_of_time_rx; } else { tmp___2 = LED_Blink(Adapter, (UINT )(1 << (int )GPIO_Num_tx), (int )uiTxLedIndex, timeout, num_of_time_tx - num_of_time, currdriverstate); if (tmp___2 == 1) { return (1); } else { } num_of_time = num_of_time_tx; } } else if (num_of_time == num_of_time_tx) { tmp___4 = LED_Blink(Adapter, (UINT )(1 << (int )GPIO_Num_tx), (int )uiTxLedIndex, timeout, num_of_time, currdriverstate); if (tmp___4 == 1) { return (1); } else { tmp___3 = LED_Blink(Adapter, (UINT )(1 << (int )GPIO_Num_rx), (int )uiRxLedIndex, timeout, num_of_time, currdriverstate); if (tmp___3 == 1) { return (1); } else { } } } else { } remDelay = (UINT )(10 - num_of_time); if (remDelay != 0U) { timeout = (ulong )(remDelay * 100U); tmp___5 = msecs_to_jiffies((unsigned int const )timeout); __ret = (long )tmp___5; if ((unsigned int )Adapter->DriverState == (unsigned int )currdriverstate) { tmp___10 = kthread_should_stop(); if (tmp___10) { tmp___11 = 0; } else { tmp___11 = 1; } if (tmp___11) { tmp___6 = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp___6; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; ldv_46881: prepare_to_wait(& Adapter->LEDInfo.notify_led_event, & __wait, 1); if ((unsigned int )Adapter->DriverState != (unsigned int )currdriverstate) { goto ldv_46879; } else { tmp___7 = kthread_should_stop(); if ((int )tmp___7) { goto ldv_46879; } else { } } tmp___8 = get_current(); tmp___9 = signal_pending(tmp___8); if (tmp___9 == 0) { __ret = schedule_timeout(__ret); if (__ret == 0L) { goto ldv_46879; } else { } goto ldv_46880; } else { } __ret = -512L; goto ldv_46879; ldv_46880: ; goto ldv_46881; ldv_46879: finish_wait(& Adapter->LEDInfo.notify_led_event, & __wait); } else { } } else { } Status = (int )__ret; tmp___12 = kthread_should_stop(); if ((int )tmp___12) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 2048U) != 0U) { printk("\017%s:Led thread got signal to exit..hence exiting", "LED_Proportional_Blink"); } else { } Adapter->LEDInfo.led_thread_running = 0; return (1); } else { } if (Status != 0) { return (1); } else { } } else { } gpio_val = (UINT )(1 << (int )GPIO_Num_tx); if ((unsigned int )Adapter->LEDInfo.LEDState[(int )uiTxLedIndex].BitPolarity == 1U) { wrmaltWithLock(Adapter, 251658308U, & gpio_val, 4UL); } else { wrmaltWithLock(Adapter, 251658304U, & gpio_val, 4UL); } gpio_val___0 = (UINT )(1 << (int )GPIO_Num_rx); if ((unsigned int )Adapter->LEDInfo.LEDState[(int )uiTxLedIndex].BitPolarity == 1U) { wrmaltWithLock(Adapter, 251658308U, & gpio_val___0, 4UL); } else { wrmaltWithLock(Adapter, 251658304U, & gpio_val___0, 4UL); } Final_num_of_packts_tx = (ULONG64 )(Adapter->dev)->stats.tx_packets; Final_num_of_packts_rx = (ULONG64 )(Adapter->dev)->stats.rx_packets; rate_of_transfer_tx = Final_num_of_packts_tx - Initial_num_of_packts_tx; rate_of_transfer_rx = Final_num_of_packts_rx - Initial_num_of_packts_rx; Initial_num_of_packts_tx = Final_num_of_packts_tx; Initial_num_of_packts_rx = Final_num_of_packts_rx; num_of_time_tx = ScaleRateofTransfer((unsigned long )rate_of_transfer_tx); num_of_time_rx = ScaleRateofTransfer((unsigned long )rate_of_transfer_rx); ldv_46887: ; if ((int )((signed char )Adapter->device_removed) == 0) { goto ldv_46886; } else { goto ldv_46888; } ldv_46888: ; return (Status); } } static INT ValidateDSDParamsChecksum(struct bcm_mini_adapter *Adapter , ULONG ulParamOffset , USHORT usParamLen ) { INT Status ; PUCHAR puBuffer ; USHORT usChksmOrg ; USHORT usChecksumCalculated ; void *tmp ; INT tmp___0 ; INT tmp___1 ; __u16 tmp___2 ; { Status = 0; puBuffer = 0; usChksmOrg = 0U; usChecksumCalculated = 0U; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 2048U) != 0U) { printk("\017%s:LED Thread:ValidateDSDParamsChecksum: 0x%lx 0x%X", "ValidateDSDParamsChecksum", ulParamOffset, (int )usParamLen); } else { } tmp = kmalloc((size_t )usParamLen, 208U); puBuffer = (PUCHAR )tmp; if ((unsigned long )puBuffer == (unsigned long )((PUCHAR )0)) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 2048U) != 0U) { printk("\017%s:LED Thread: ValidateDSDParamsChecksum Allocation failed", "ValidateDSDParamsChecksum"); } else { } return (-12); } else { } tmp___0 = BeceemNVMRead(Adapter, (unsigned int *)puBuffer, (UINT )ulParamOffset, (UINT )usParamLen); if (tmp___0 != 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 2048U) != 0U) { printk("\017%s:LED Thread: ValidateDSDParamsChecksum BeceemNVMRead failed", "ValidateDSDParamsChecksum"); } else { } Status = -199; goto exit; } else { } usChecksumCalculated = CFG_CalculateChecksum(puBuffer, (B_UINT32 )usParamLen); if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 2048U) != 0U) { printk("\017%s:LED Thread: usCheckSumCalculated = 0x%x\n", "ValidateDSDParamsChecksum", (int )usChecksumCalculated); } else { } tmp___1 = BeceemNVMRead(Adapter, (unsigned int *)(& usChksmOrg), (UINT )usParamLen + (UINT )ulParamOffset, 2U); if (tmp___1 != 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 2048U) != 0U) { printk("\017%s:LED Thread: ValidateDSDParamsChecksum BeceemNVMRead failed", "ValidateDSDParamsChecksum"); } else { } Status = -199; goto exit; } else { } tmp___2 = __fswab16((int )usChksmOrg); usChksmOrg = tmp___2; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 2048U) != 0U) { printk("\017%s:LED Thread: usChksmOrg = 0x%x", "ValidateDSDParamsChecksum", (int )usChksmOrg); } else { } if ((int )usChecksumCalculated != (int )usChksmOrg) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 2048U) != 0U) { printk("\017%s:LED Thread: ValidateDSDParamsChecksum: Checksums don\'t match", "ValidateDSDParamsChecksum"); } else { } Status = -199; goto exit; } else { } exit: kfree((void const *)puBuffer); return (Status); } } static INT ValidateHWParmStructure(struct bcm_mini_adapter *Adapter , ULONG ulHwParamOffset ) { INT Status ; USHORT HwParamLen ; __u16 tmp ; { Status = 0; HwParamLen = 0U; ulHwParamOffset = ulHwParamOffset + 512UL; BeceemNVMRead(Adapter, (unsigned int *)(& HwParamLen), (UINT )ulHwParamOffset, 2U); tmp = __fswab16((int )HwParamLen); HwParamLen = tmp; if ((unsigned int )HwParamLen == 0U || (UINT )HwParamLen > Adapter->uiNVMDSDSize) { return (-199); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 2048U) != 0U) { printk("\017%s:LED Thread:HwParamLen = 0x%x", "ValidateHWParmStructure", (int )HwParamLen); } else { } Status = ValidateDSDParamsChecksum(Adapter, ulHwParamOffset, (int )HwParamLen); return (Status); } } static int ReadLEDInformationFromEEPROM(struct bcm_mini_adapter *Adapter , UCHAR *GPIO_Array ) { int Status ; ULONG dwReadValue ; USHORT usHwParamData ; USHORT usEEPROMVersion ; UCHAR ucIndex ; UCHAR ucGPIOInfo[32U] ; __u16 tmp ; __u32 tmp___0 ; { Status = 0; dwReadValue = 0UL; usHwParamData = 0U; usEEPROMVersion = 0U; ucIndex = 0U; ucGPIOInfo[0] = 0U; BeceemNVMRead(Adapter, (unsigned int *)(& usEEPROMVersion), 526U, 2U); if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 2048U) != 0U) { printk("\017%s:usEEPROMVersion: Minor:0x%X Major:0x%x", "ReadLEDInformationFromEEPROM", (int )usEEPROMVersion & 255, ((int )usEEPROMVersion >> 8) & 255); } else { } if ((((int )usEEPROMVersion >> 8) & 255) <= 4) { BeceemNVMRead(Adapter, (unsigned int *)(& usHwParamData), 536U, 2U); tmp = __fswab16((int )usHwParamData); usHwParamData = tmp; dwReadValue = (ULONG )usHwParamData; } else { Status = ValidateDSDParamsChecksum(Adapter, 512UL, 84); if (Status != 0) { return (Status); } else { } BeceemNVMRead(Adapter, (unsigned int *)(& dwReadValue), 544U, 4U); tmp___0 = __fswab32((unsigned int )dwReadValue); dwReadValue = (ULONG )tmp___0; } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 2048U) != 0U) { printk("\017%s:LED Thread: Start address of HW_PARAM structure = 0x%lx", "ReadLEDInformationFromEEPROM", dwReadValue); } else { } if (dwReadValue <= 511UL || (ULONG )(Adapter->uiNVMDSDSize - 512U) < dwReadValue) { return (-199); } else { } Status = ValidateHWParmStructure(Adapter, dwReadValue); if (Status != 0) { return (Status); } else { } dwReadValue = dwReadValue + 512UL; dwReadValue = dwReadValue + 3UL; BeceemNVMRead(Adapter, (PUINT )(& ucGPIOInfo), (UINT )dwReadValue, 32U); ucIndex = 0U; goto ldv_46925; ldv_46924: ; switch ((int )ucGPIOInfo[(int )ucIndex]) { case 1: *(GPIO_Array + 1UL) = ucIndex; Adapter->gpioBitMap = Adapter->gpioBitMap | (UINT )(1 << (int )ucIndex); goto ldv_46919; case 2: *(GPIO_Array + 2UL) = ucIndex; Adapter->gpioBitMap = Adapter->gpioBitMap | (UINT )(1 << (int )ucIndex); goto ldv_46919; case 3: *(GPIO_Array + 3UL) = ucIndex; Adapter->gpioBitMap = Adapter->gpioBitMap | (UINT )(1 << (int )ucIndex); goto ldv_46919; case 4: *(GPIO_Array + 4UL) = ucIndex; Adapter->gpioBitMap = Adapter->gpioBitMap | (UINT )(1 << (int )ucIndex); goto ldv_46919; default: ; goto ldv_46919; } ldv_46919: ucIndex = (UCHAR )((int )ucIndex + 1); ldv_46925: ; if ((unsigned int )ucIndex <= 31U) { goto ldv_46924; } else { goto ldv_46926; } ldv_46926: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 2048U) != 0U) { printk("\017%s:GPIO\'s bit map correspond to LED :0x%X", "ReadLEDInformationFromEEPROM", Adapter->gpioBitMap); } else { } return (Status); } } static int ReadConfigFileStructure(struct bcm_mini_adapter *Adapter , BOOLEAN *bEnableThread ) { int Status ; UCHAR GPIO_Array[5U] ; UINT uiIndex ; UINT uiNum_of_LED_Type ; PUCHAR puCFGData ; UCHAR bData ; long tmp ; { Status = 0; uiIndex = 0U; uiNum_of_LED_Type = 0U; puCFGData = 0; bData = 0U; memset((void *)(& GPIO_Array), 255, 5UL); if ((unsigned long )Adapter->pstargetparams == (unsigned long )((PSTARGETPARAMS )0)) { goto _L; } else { tmp = IS_ERR((void const *)Adapter->pstargetparams); if (tmp != 0L) { _L: /* CIL Label */ if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 2048U) != 0U) { printk("\017%s:Target Params not Avail.\n", "ReadConfigFileStructure"); } else { } return (-2); } else { } } Status = ReadLEDInformationFromEEPROM(Adapter, (UCHAR *)(& GPIO_Array)); if (Status == -199) { *bEnableThread = 0; return (0); } else if (Status != 0) { *bEnableThread = 0; return (Status); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 2048U) != 0U) { printk("\017%s:LED Thread: Config file read successfully\n", "ReadConfigFileStructure"); } else { } puCFGData = (unsigned char *)(& (Adapter->pstargetparams)->HostDrvrConfig1); uiIndex = 0U; goto ldv_46939; ldv_46938: bData = *puCFGData; if ((int )((signed char )bData) < 0) { Adapter->LEDInfo.LEDState[uiIndex].BitPolarity = 0U; bData = (unsigned int )bData & 127U; } else { } Adapter->LEDInfo.LEDState[uiIndex].LED_Type = bData; if ((unsigned int )bData <= 4U) { Adapter->LEDInfo.LEDState[uiIndex].GPIO_Num = GPIO_Array[(int )bData]; } else { Adapter->LEDInfo.LEDState[uiIndex].GPIO_Num = 255U; } puCFGData = puCFGData + 1; bData = *puCFGData; Adapter->LEDInfo.LEDState[uiIndex].LED_On_State = bData; puCFGData = puCFGData + 1; bData = *puCFGData; Adapter->LEDInfo.LEDState[uiIndex].LED_Blink_State = bData; puCFGData = puCFGData + 1; uiIndex = uiIndex + 1U; ldv_46939: ; if (uiIndex <= 3U) { goto ldv_46938; } else { goto ldv_46940; } ldv_46940: uiIndex = 0U; goto ldv_46942; ldv_46941: ; if (((unsigned int )Adapter->LEDInfo.LEDState[uiIndex].LED_Type == 255U || (unsigned int )Adapter->LEDInfo.LEDState[uiIndex].LED_Type == 127U) || (unsigned int )Adapter->LEDInfo.LEDState[uiIndex].LED_Type == 0U) { uiNum_of_LED_Type = uiNum_of_LED_Type + 1U; } else { } uiIndex = uiIndex + 1U; ldv_46942: ; if (uiIndex <= 3U) { goto ldv_46941; } else { goto ldv_46943; } ldv_46943: ; if (uiNum_of_LED_Type > 3U) { *bEnableThread = 0; } else { } return (Status); } } static VOID LedGpioInit(struct bcm_mini_adapter *Adapter ) { UINT uiResetValue ; UINT uiIndex ; int tmp ; UINT gpio_val ; int tmp___0 ; { uiResetValue = 0U; uiIndex = 0U; tmp = rdmalt(Adapter, 251658292U, & uiResetValue, 4UL); if (tmp < 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 2048U) != 0U) { printk("\017%s:LED Thread: RDM Failed\n", "LedGpioInit"); } else { } } else { } uiIndex = 0U; goto ldv_46952; ldv_46951: ; if ((unsigned int )Adapter->LEDInfo.LEDState[uiIndex].GPIO_Num != 255U) { uiResetValue = (UINT )(1 << (int )Adapter->LEDInfo.LEDState[uiIndex].GPIO_Num) | uiResetValue; } else { } gpio_val = (UINT )(1 << (int )Adapter->LEDInfo.LEDState[uiIndex].GPIO_Num); if ((unsigned int )Adapter->LEDInfo.LEDState[uiIndex].BitPolarity == 1U) { wrmaltWithLock(Adapter, 251658308U, & gpio_val, 4UL); } else { wrmaltWithLock(Adapter, 251658304U, & gpio_val, 4UL); } uiIndex = uiIndex + 1U; ldv_46952: ; if (uiIndex <= 3U) { goto ldv_46951; } else { goto ldv_46953; } ldv_46953: tmp___0 = wrmalt(Adapter, 251658292U, & uiResetValue, 4UL); if (tmp___0 < 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 2048U) != 0U) { printk("\017%s:LED Thread: WRM Failed\n", "LedGpioInit"); } else { } } else { } Adapter->LEDInfo.bIdle_led_off = 0; return; } } static INT BcmGetGPIOPinInfo(struct bcm_mini_adapter *Adapter , UCHAR *GPIO_num_tx , UCHAR *GPIO_num_rx , UCHAR *uiLedTxIndex , UCHAR *uiLedRxIndex , LedEventInfo_t currdriverstate ) { UINT uiIndex ; { uiIndex = 0U; *GPIO_num_tx = 255U; *GPIO_num_rx = 255U; uiIndex = 0U; goto ldv_46964; ldv_46963: ; if (((unsigned int )currdriverstate == 16U || (unsigned int )currdriverstate == 128U) || (unsigned int )currdriverstate == 2U) { if (((unsigned int )Adapter->LEDInfo.LEDState[uiIndex].LED_Blink_State & (unsigned int )currdriverstate) != 0U) { if ((unsigned int )Adapter->LEDInfo.LEDState[uiIndex].GPIO_Num != 255U) { if ((unsigned int )*GPIO_num_tx == 255U) { *GPIO_num_tx = Adapter->LEDInfo.LEDState[uiIndex].GPIO_Num; *uiLedTxIndex = (UCHAR )uiIndex; } else { *GPIO_num_rx = Adapter->LEDInfo.LEDState[uiIndex].GPIO_Num; *uiLedRxIndex = (UCHAR )uiIndex; } } else if (((unsigned int )Adapter->LEDInfo.LEDState[uiIndex].LED_On_State & (unsigned int )currdriverstate) != 0U) { if ((unsigned int )Adapter->LEDInfo.LEDState[uiIndex].GPIO_Num != 255U) { *GPIO_num_tx = Adapter->LEDInfo.LEDState[uiIndex].GPIO_Num; *uiLedTxIndex = (UCHAR )uiIndex; } else { } } else { } } else { } } else { } uiIndex = uiIndex + 1U; ldv_46964: ; if (uiIndex <= 3U) { goto ldv_46963; } else { goto ldv_46965; } ldv_46965: ; return (0); } } static VOID LEDControlThread(struct bcm_mini_adapter *Adapter ) { UINT uiIndex ; UCHAR GPIO_num ; UCHAR uiLedIndex ; UINT uiResetValue ; LedEventInfo_t currdriverstate ; ulong timeout ; INT Status ; UCHAR dummyGPIONum ; UCHAR dummyIndex ; int __ret ; wait_queue_t __wait ; struct task_struct *tmp ; bool tmp___0 ; struct task_struct *tmp___1 ; int tmp___2 ; bool tmp___3 ; int tmp___4 ; UINT gpio_val ; bool tmp___5 ; UINT gpio_val___0 ; UINT gpio_val___1 ; UINT gpio_val___2 ; UINT gpio_val___3 ; UCHAR GPIO_num_tx ; UCHAR GPIO_num_rx ; UCHAR uiLEDTx ; UCHAR uiLEDRx ; UINT gpio_val___4 ; UINT gpio_val___5 ; UINT gpio_val___6 ; { uiIndex = 0U; GPIO_num = 0U; uiLedIndex = 0U; uiResetValue = 0U; currdriverstate = 0; timeout = 0UL; Status = 0; dummyGPIONum = 0U; dummyIndex = 0U; Adapter->LEDInfo.bIdleMode_tx_from_host = 0; GPIO_num = 255U; ldv_47020: ; if (((unsigned int )GPIO_num == 255U || (((unsigned int )currdriverstate != 2U && (unsigned int )currdriverstate != 16U) && (unsigned int )currdriverstate != 32U)) || (unsigned int )currdriverstate == 256U) { __ret = 0; if ((unsigned int )Adapter->DriverState == (unsigned int )currdriverstate) { tmp___3 = kthread_should_stop(); if (tmp___3) { tmp___4 = 0; } else { tmp___4 = 1; } if (tmp___4) { tmp = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; ldv_46982: prepare_to_wait(& Adapter->LEDInfo.notify_led_event, & __wait, 1); if ((unsigned int )Adapter->DriverState != (unsigned int )currdriverstate) { goto ldv_46980; } else { tmp___0 = kthread_should_stop(); if ((int )tmp___0) { goto ldv_46980; } else { } } tmp___1 = get_current(); tmp___2 = signal_pending(tmp___1); if (tmp___2 == 0) { schedule(); goto ldv_46981; } else { } __ret = -512; goto ldv_46980; ldv_46981: ; goto ldv_46982; ldv_46980: finish_wait(& Adapter->LEDInfo.notify_led_event, & __wait); } else { } } else { } Status = __ret; } else { } tmp___5 = kthread_should_stop(); if ((int )tmp___5 || (int )((signed char )Adapter->device_removed) != 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 2048U) != 0U) { printk("\017%s:Led thread got signal to exit..hence exiting", "LEDControlThread"); } else { } Adapter->LEDInfo.led_thread_running = 0; gpio_val = (UINT )(1 << (int )GPIO_num); if ((unsigned int )Adapter->LEDInfo.LEDState[(int )uiLedIndex].BitPolarity == 1U) { wrmaltWithLock(Adapter, 251658308U, & gpio_val, 4UL); } else { wrmaltWithLock(Adapter, 251658304U, & gpio_val, 4UL); } return; } else { } if ((unsigned int )GPIO_num != 255U) { gpio_val___0 = (UINT )(1 << (int )GPIO_num); if ((unsigned int )Adapter->LEDInfo.LEDState[(int )uiLedIndex].BitPolarity == 1U) { wrmaltWithLock(Adapter, 251658308U, & gpio_val___0, 4UL); } else { wrmaltWithLock(Adapter, 251658304U, & gpio_val___0, 4UL); } } else { } if ((int )((signed char )Adapter->LEDInfo.bLedInitDone) == 0) { LedGpioInit(Adapter); Adapter->LEDInfo.bLedInitDone = 1; } else { } switch ((unsigned int )Adapter->DriverState) { case 1: currdriverstate = 1; BcmGetGPIOPinInfo(Adapter, & GPIO_num, & dummyGPIONum, & uiLedIndex, & dummyIndex, currdriverstate); if ((unsigned int )GPIO_num != 255U) { gpio_val___1 = (UINT )(1 << (int )GPIO_num); if ((unsigned int )Adapter->LEDInfo.LEDState[(int )uiLedIndex].BitPolarity == 1U) { wrmaltWithLock(Adapter, 251658304U, & gpio_val___1, 4UL); } else { wrmaltWithLock(Adapter, 251658308U, & gpio_val___1, 4UL); } } else { } goto ldv_46989; case 2: currdriverstate = 2; BcmGetGPIOPinInfo(Adapter, & GPIO_num, & dummyGPIONum, & uiLedIndex, & dummyIndex, currdriverstate); if ((unsigned int )GPIO_num != 255U) { timeout = 50UL; LED_Blink(Adapter, (UINT )(1 << (int )GPIO_num), (int )uiLedIndex, timeout, -1, currdriverstate); } else { } goto ldv_46989; case 4: currdriverstate = 4; BcmGetGPIOPinInfo(Adapter, & GPIO_num, & dummyGPIONum, & uiLedIndex, & dummyIndex, currdriverstate); if ((unsigned int )GPIO_num != 255U) { gpio_val___2 = (UINT )(1 << (int )GPIO_num); if ((unsigned int )Adapter->LEDInfo.LEDState[(int )uiLedIndex].BitPolarity == 1U) { wrmaltWithLock(Adapter, 251658304U, & gpio_val___2, 4UL); } else { wrmaltWithLock(Adapter, 251658308U, & gpio_val___2, 4UL); } } else { } goto ldv_46989; case 0: ; case 8: currdriverstate = 8; BcmGetGPIOPinInfo(Adapter, & GPIO_num, & dummyGPIONum, & uiLedIndex, & dummyGPIONum, currdriverstate); if ((unsigned int )GPIO_num != 255U) { gpio_val___3 = (UINT )(1 << (int )GPIO_num); if ((unsigned int )Adapter->LEDInfo.LEDState[(int )uiLedIndex].BitPolarity == 1U) { wrmaltWithLock(Adapter, 251658304U, & gpio_val___3, 4UL); } else { wrmaltWithLock(Adapter, 251658308U, & gpio_val___3, 4UL); } } else { } goto ldv_46989; case 16: GPIO_num_tx = 255U; GPIO_num_rx = 255U; uiLEDTx = 0U; uiLEDRx = 0U; currdriverstate = 16; Adapter->LEDInfo.bIdle_led_off = 0; BcmGetGPIOPinInfo(Adapter, & GPIO_num_tx, & GPIO_num_rx, & uiLEDTx, & uiLEDRx, currdriverstate); if ((unsigned int )GPIO_num_tx == 255U && (unsigned int )GPIO_num_rx == 255U) { GPIO_num = 255U; } else { if ((unsigned int )GPIO_num_tx == 255U) { GPIO_num_tx = GPIO_num_rx; uiLEDTx = uiLEDRx; } else if ((unsigned int )GPIO_num_rx == 255U) { GPIO_num_rx = GPIO_num_tx; uiLEDRx = uiLEDTx; } else { } LED_Proportional_Blink(Adapter, (int )GPIO_num_tx, (int )uiLEDTx, (int )GPIO_num_rx, (int )uiLEDRx, currdriverstate); } goto ldv_46989; case 32: currdriverstate = 32; if (Adapter->ulPowerSaveMode == 0UL) { uiResetValue = 0U; uiIndex = 0U; goto ldv_47004; ldv_47003: ; if ((unsigned int )Adapter->LEDInfo.LEDState[uiIndex].GPIO_Num != 255U) { gpio_val___4 = (UINT )(1 << (int )Adapter->LEDInfo.LEDState[uiIndex].GPIO_Num); if ((unsigned int )Adapter->LEDInfo.LEDState[uiIndex].BitPolarity == 1U) { wrmaltWithLock(Adapter, 251658308U, & gpio_val___4, 4UL); } else { wrmaltWithLock(Adapter, 251658304U, & gpio_val___4, 4UL); } } else { } uiIndex = uiIndex + 1U; ldv_47004: ; if (uiIndex <= 3U) { goto ldv_47003; } else { goto ldv_47005; } ldv_47005: ; } else { } Adapter->LEDInfo.bLedInitDone = 0; Adapter->LEDInfo.bIdle_led_off = 1; __wake_up(& Adapter->LEDInfo.idleModeSyncEvent, 3U, 1, 0); GPIO_num = 255U; goto ldv_46989; case 64: currdriverstate = 64; GPIO_num = 255U; goto ldv_46989; case 128: ; goto ldv_46989; case 255: currdriverstate = 255; GPIO_num = 255U; uiIndex = 0U; goto ldv_47011; ldv_47010: ; if ((unsigned int )Adapter->LEDInfo.LEDState[uiIndex].GPIO_Num != 255U) { gpio_val___5 = (UINT )(1 << (int )Adapter->LEDInfo.LEDState[uiIndex].GPIO_Num); if ((unsigned int )Adapter->LEDInfo.LEDState[uiIndex].BitPolarity == 1U) { wrmaltWithLock(Adapter, 251658308U, & gpio_val___5, 4UL); } else { wrmaltWithLock(Adapter, 251658304U, & gpio_val___5, 4UL); } } else { } uiIndex = uiIndex + 1U; ldv_47011: ; if (uiIndex <= 3U) { goto ldv_47010; } else { goto ldv_47012; } ldv_47012: ; goto ldv_46989; case 256: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 2048U) != 0U) { printk("\017%s:InActivating LED thread...", "LEDControlThread"); } else { } currdriverstate = 256; Adapter->LEDInfo.led_thread_running = 2; Adapter->LEDInfo.bLedInitDone = 0; uiIndex = 0U; goto ldv_47016; ldv_47015: ; if ((unsigned int )Adapter->LEDInfo.LEDState[uiIndex].GPIO_Num != 255U) { gpio_val___6 = (UINT )(1 << (int )Adapter->LEDInfo.LEDState[uiIndex].GPIO_Num); if ((unsigned int )Adapter->LEDInfo.LEDState[uiIndex].BitPolarity == 1U) { wrmaltWithLock(Adapter, 251658308U, & gpio_val___6, 4UL); } else { wrmaltWithLock(Adapter, 251658304U, & gpio_val___6, 4UL); } } else { } uiIndex = uiIndex + 1U; ldv_47016: ; if (uiIndex <= 3U) { goto ldv_47015; } else { goto ldv_47017; } ldv_47017: ; goto ldv_46989; case 512: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 2048U) != 0U) { printk("\017%s:Activating LED thread again...", "LEDControlThread"); } else { } if ((int )((signed char )Adapter->LinkUpStatus) == 0) { Adapter->DriverState = 8; } else { Adapter->DriverState = 16; } Adapter->LEDInfo.led_thread_running = 1; goto ldv_46989; default: ; goto ldv_46989; } ldv_46989: ; goto ldv_47020; Adapter->LEDInfo.led_thread_running = 0; } } int InitLedSettings(struct bcm_mini_adapter *Adapter ) { int Status ; BOOLEAN bEnableThread ; UCHAR uiIndex ; struct lock_class_key __key ; struct lock_class_key __key___0 ; struct task_struct *__k ; struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; { Status = 0; bEnableThread = 1; uiIndex = 0U; uiIndex = 0U; goto ldv_47028; ldv_47027: Adapter->LEDInfo.LEDState[(int )uiIndex].BitPolarity = 1U; uiIndex = (UCHAR )((int )uiIndex + 1); ldv_47028: ; if ((unsigned int )uiIndex <= 3U) { goto ldv_47027; } else { goto ldv_47029; } ldv_47029: Status = ReadConfigFileStructure(Adapter, & bEnableThread); if (Status != 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 2048U) != 0U) { printk("\017%s:LED Thread: FAILED in ReadConfigFileStructure\n", "InitLedSettings"); } else { } return (Status); } else { } if (Adapter->LEDInfo.led_thread_running != 0) { if ((int )((signed char )bEnableThread) != 0) { } else { Adapter->DriverState = 255; __wake_up(& Adapter->LEDInfo.notify_led_event, 3U, 1, 0); Adapter->LEDInfo.led_thread_running = 0; } } else if ((int )((signed char )bEnableThread) != 0) { __init_waitqueue_head(& Adapter->LEDInfo.notify_led_event, "&Adapter->LEDInfo.notify_led_event", & __key); __init_waitqueue_head(& Adapter->LEDInfo.idleModeSyncEvent, "&Adapter->LEDInfo.idleModeSyncEvent", & __key___0); Adapter->LEDInfo.led_thread_running = 1; Adapter->LEDInfo.bIdle_led_off = 0; tmp = kthread_create_on_node((int (*)(void * ))(& LEDControlThread), (void *)Adapter, -1, "led_control_thread"); __k = tmp; tmp___0 = IS_ERR((void const *)__k); if (tmp___0 == 0L) { wake_up_process(__k); } else { } Adapter->LEDInfo.led_cntrl_threadid = __k; tmp___2 = IS_ERR((void const *)Adapter->LEDInfo.led_cntrl_threadid); if (tmp___2 != 0L) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 2048U) != 0U) { printk("\017%s:Not able to spawn Kernel Thread\n", "InitLedSettings"); } else { } Adapter->LEDInfo.led_thread_running = 0; tmp___1 = PTR_ERR((void const *)Adapter->LEDInfo.led_cntrl_threadid); return ((int )tmp___1); } else { } } else { } return (Status); } } void ldv_mutex_lock_297(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_298(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_299(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_device(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_300(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___2 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex_of_device(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_301(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_device(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_302(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_303(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } int ldv_mutex_trylock_314(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_312(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_315(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_317(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_311(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_313(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_316(struct mutex *ldv_func_arg1 ) ; INT vendorextnGetSectionInfo(PVOID pContext , PFLASH2X_VENDORSPECIFIC_INFO pVendorInfo ) ; INT vendorextnReadSection(PVOID pContext , PUCHAR pBuffer , enum bcm_flash2x_section_val SectionVal , UINT offset , UINT numOfBytes ) ; INT vendorextnWriteSection(PVOID pContext , PUCHAR pBuffer , enum bcm_flash2x_section_val SectionVal , UINT offset , UINT numOfBytes , BOOLEAN bVerify ) ; INT vendorextnWriteSectionWithoutErase(PVOID pContext , PUCHAR pBuffer , enum bcm_flash2x_section_val SectionVal , UINT offset , UINT numOfBytes ) ; static int BcmDoChipSelect(struct bcm_mini_adapter *Adapter , unsigned int offset ) ; static int BcmGetActiveDSD(struct bcm_mini_adapter *Adapter ) ; static int BcmGetActiveISO(struct bcm_mini_adapter *Adapter ) ; static unsigned int BcmGetEEPROMSize(struct bcm_mini_adapter *Adapter ) ; static int BcmGetFlashCSInfo(struct bcm_mini_adapter *Adapter ) ; static unsigned int BcmGetFlashSectorSize(struct bcm_mini_adapter *Adapter , unsigned int FlashSectorSizeSig , unsigned int FlashSectorSize ) ; static VOID BcmValidateNvmType(struct bcm_mini_adapter *Adapter ) ; static int BcmGetNvmSize(struct bcm_mini_adapter *Adapter ) ; static unsigned int BcmGetFlashSize(struct bcm_mini_adapter *Adapter ) ; static NVM_TYPE BcmGetNvmType(struct bcm_mini_adapter *Adapter ) ; static int BcmGetSectionValEndOffset(struct bcm_mini_adapter *Adapter , enum bcm_flash2x_section_val eFlash2xSectionVal ) ; static B_UINT8 IsOffsetWritable(struct bcm_mini_adapter *Adapter , unsigned int uiOffset ) ; static int IsSectionWritable(struct bcm_mini_adapter *Adapter , enum bcm_flash2x_section_val Section ) ; static int IsSectionExistInVendorInfo(struct bcm_mini_adapter *Adapter , enum bcm_flash2x_section_val section ) ; static int ReadDSDPriority(struct bcm_mini_adapter *Adapter , enum bcm_flash2x_section_val dsd ) ; static int ReadDSDSignature(struct bcm_mini_adapter *Adapter , enum bcm_flash2x_section_val dsd ) ; static int ReadISOPriority(struct bcm_mini_adapter *Adapter , enum bcm_flash2x_section_val iso ) ; static int ReadISOSignature(struct bcm_mini_adapter *Adapter , enum bcm_flash2x_section_val iso ) ; static int CorruptDSDSig(struct bcm_mini_adapter *Adapter , enum bcm_flash2x_section_val eFlash2xSectionVal ) ; static int CorruptISOSig(struct bcm_mini_adapter *Adapter , enum bcm_flash2x_section_val eFlash2xSectionVal ) ; static int SaveHeaderIfPresent(struct bcm_mini_adapter *Adapter , PUCHAR pBuff , unsigned int uiOffset ) ; static int WriteToFlashWithoutSectorErase(struct bcm_mini_adapter *Adapter , PUINT pBuff , enum bcm_flash2x_section_val eFlash2xSectionVal , unsigned int uiOffset , unsigned int uiNumBytes ) ; static enum bcm_flash2x_section_val getHighestPriDSD(struct bcm_mini_adapter *Adapter ) ; static enum bcm_flash2x_section_val getHighestPriISO(struct bcm_mini_adapter *Adapter ) ; static int BeceemFlashBulkRead(struct bcm_mini_adapter *Adapter , PUINT pBuffer , unsigned int uiOffset , unsigned int uiNumBytes ) ; static int BeceemFlashBulkWrite(struct bcm_mini_adapter *Adapter , PUINT pBuffer , unsigned int uiOffset , unsigned int uiNumBytes , BOOLEAN bVerify ) ; static int GetFlashBaseAddr(struct bcm_mini_adapter *Adapter ) ; static int ReadBeceemEEPROMBulk(struct bcm_mini_adapter *Adapter , unsigned int dwAddress , unsigned int *pdwData , unsigned int dwNumWords ) ; static UCHAR ReadEEPROMStatusRegister(struct bcm_mini_adapter *Adapter ) { UCHAR uiData ; unsigned int dwRetries ; unsigned int uiStatus ; unsigned int value ; unsigned int value1 ; { uiData = 0U; dwRetries = 5120U; uiStatus = 0U; value = 0U; value1 = 0U; value = 83886080U; wrmalt(Adapter, 251670552U, & value, 4UL); goto ldv_46906; ldv_46905: value = 0U; uiStatus = 0U; rdmalt(Adapter, 251670532U, & uiStatus, 4UL); if ((int )((signed char )Adapter->device_removed) == 1) { printk("\016%s:Modem has got removed hence exiting....", "ReadEEPROMStatusRegister"); goto ldv_46904; } else { } if ((uiStatus & 32U) != 0U) { value = uiStatus & 48U; wrmalt(Adapter, 251670532U, & value, 4UL); value = 0U; rdmalt(Adapter, 251670560U, & value, 4UL); uiData = (unsigned char )value; goto ldv_46904; } else { } dwRetries = dwRetries - 1U; if (dwRetries == 0U) { rdmalt(Adapter, 251670532U, & value, 4UL); rdmalt(Adapter, 251670536U, & value1, 4UL); printk("\016%s:0x3004 = %x 0x3008 = %x, retries = %d failed.\n", "ReadEEPROMStatusRegister", value, value1, 5120); return (uiData); } else { } if ((dwRetries & 63U) == 0U) { __const_udelay(4295000UL); } else { } uiStatus = 0U; ldv_46906: ; if (dwRetries != 0U) { goto ldv_46905; } else { goto ldv_46904; } ldv_46904: ; return (uiData); } } static int ReadBeceemEEPROMBulk(struct bcm_mini_adapter *Adapter , unsigned int dwAddress , unsigned int *pdwData , unsigned int dwNumWords ) { unsigned int dwIndex ; unsigned int dwRetries ; unsigned int uiStatus ; unsigned int value ; unsigned int value1 ; UCHAR *pvalue ; unsigned int tmp ; { dwIndex = 0U; dwRetries = 5120U; uiStatus = 0U; value = 0U; value1 = 0U; value = 5U; wrmalt(Adapter, 251670604U, & value, 4UL); value = 0U; wrmalt(Adapter, 251670604U, & value, 4UL); value = 48U; wrmalt(Adapter, 251670532U, & value, 4UL); if (dwNumWords == 4U) { tmp = 4211081216U; } else { tmp = 989855744U; } value = tmp | dwAddress; wrmalt(Adapter, 251670552U, & value, 4UL); goto ldv_46922; ldv_46921: uiStatus = 0U; rdmalt(Adapter, 251670532U, & uiStatus, 4UL); if ((int )((signed char )Adapter->device_removed) == 1) { printk("\016%s:Modem has got Removed.hence exiting from loop...", "ReadBeceemEEPROMBulk"); return (-19); } else { } if (dwNumWords == 4U) { if ((uiStatus & 16U) != 0U) { value = uiStatus & 48U; wrmalt(Adapter, 251670532U, & value, 4UL); goto ldv_46920; } else if (dwNumWords == 1U) { if ((uiStatus & 32U) != 0U) { if (Adapter->chip_id == 3201171984UL) { __const_udelay(3436000UL); } else { } value = uiStatus & 48U; wrmalt(Adapter, 251670532U, & value, 4UL); goto ldv_46920; } else { } } else { } } else { } uiStatus = 0U; dwRetries = dwRetries - 1U; if (dwRetries == 0U) { value = 0U; value1 = 0U; rdmalt(Adapter, 251670532U, & value, 4UL); rdmalt(Adapter, 251670536U, & value1, 4UL); printk("\016%s:dwNumWords %d 0x3004 = %x 0x3008 = %x retries = %d failed.\n", "ReadBeceemEEPROMBulk", dwNumWords, value, value1, 5120); return (-1); } else { } if ((dwRetries & 63U) == 0U) { __const_udelay(4295000UL); } else { } ldv_46922: ; if (dwRetries != 0U) { goto ldv_46921; } else { goto ldv_46920; } ldv_46920: dwIndex = 0U; goto ldv_46924; ldv_46923: pvalue = (UCHAR *)pdwData + (unsigned long )dwIndex; value = 0U; rdmalt(Adapter, 251670560U, & value, 4UL); *pvalue = (UCHAR )value; value = 0U; rdmalt(Adapter, 251670560U, & value, 4UL); *(pvalue + 1UL) = (UCHAR )value; value = 0U; rdmalt(Adapter, 251670560U, & value, 4UL); *(pvalue + 2UL) = (UCHAR )value; value = 0U; rdmalt(Adapter, 251670560U, & value, 4UL); *(pvalue + 3UL) = (UCHAR )value; dwIndex = dwIndex + 1U; ldv_46924: ; if (dwIndex < dwNumWords) { goto ldv_46923; } else { goto ldv_46925; } ldv_46925: ; return (0); } } INT ReadBeceemEEPROM(struct bcm_mini_adapter *Adapter , unsigned int uiOffset , unsigned int *pBuffer ) { unsigned int uiData[8U] ; unsigned int uiByteOffset ; unsigned int uiTempOffset ; size_t __len ; void *__ret ; { uiData[0] = 0U; uiData[1] = 0U; uiData[2] = 0U; uiData[3] = 0U; uiData[4] = 0U; uiData[5] = 0U; uiData[6] = 0U; uiData[7] = 0U; uiByteOffset = 0U; uiTempOffset = 0U; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s: ====> ", "ReadBeceemEEPROM"); } else { } uiTempOffset = uiOffset & 4294967280U; uiByteOffset = uiOffset - uiTempOffset; ReadBeceemEEPROMBulk(Adapter, uiTempOffset, (unsigned int *)(& uiData), 4U); if (uiByteOffset > 12U) { ReadBeceemEEPROMBulk(Adapter, uiTempOffset + 16U, (unsigned int *)(& uiData) + 4UL, 4U); } else { } __len = 4UL; if (__len > 63UL) { __ret = memcpy((void *)pBuffer, (void const *)(& uiData) + (unsigned long )uiByteOffset, __len); } else { __ret = memcpy((void *)pBuffer, (void const *)(& uiData) + (unsigned long )uiByteOffset, __len); } return (0); } } INT ReadMacAddressFromNVM(struct bcm_mini_adapter *Adapter ) { int Status ; unsigned char puMacAddr[6U] ; size_t __len ; void *__ret ; { Status = BeceemNVMRead(Adapter, (unsigned int *)(& puMacAddr), 512U, 6U); if (Status == 0) { __len = 6UL; if (__len > 63UL) { __ret = memcpy((void *)(Adapter->dev)->dev_addr, (void const *)(& puMacAddr), __len); } else { __ret = memcpy((void *)(Adapter->dev)->dev_addr, (void const *)(& puMacAddr), __len); } } else { } return (Status); } } INT BeceemEEPROMBulkRead(struct bcm_mini_adapter *Adapter , PUINT pBuffer , unsigned int uiOffset , unsigned int uiNumBytes ) { unsigned int uiData[4U] ; unsigned int uiBytesRemaining ; unsigned int uiIndex ; unsigned int uiTempOffset ; unsigned int uiExtraBytes ; unsigned int uiFailureRetries ; PUCHAR pcBuff ; size_t __len ; void *__ret ; size_t __len___0 ; void *__ret___0 ; size_t __len___1 ; void *__ret___1 ; unsigned long __ms ; unsigned long tmp ; int tmp___0 ; size_t __len___2 ; void *__ret___2 ; unsigned long __ms___0 ; unsigned long tmp___1 ; INT tmp___2 ; PUCHAR pCharBuff ; size_t __len___3 ; void *__ret___3 ; unsigned long __ms___1 ; unsigned long tmp___3 ; INT tmp___4 ; { uiData[0] = 0U; uiData[1] = 0U; uiData[2] = 0U; uiData[3] = 0U; uiBytesRemaining = uiNumBytes; uiIndex = 0U; uiTempOffset = 0U; uiExtraBytes = 0U; uiFailureRetries = 0U; pcBuff = (unsigned char *)pBuffer; if ((uiOffset & 15U) != 0U && uiBytesRemaining != 0U) { uiTempOffset = uiOffset & 4294967280U; uiExtraBytes = uiOffset - uiTempOffset; ReadBeceemEEPROMBulk(Adapter, uiTempOffset, (unsigned int *)(& uiData), 4U); if (16U - uiExtraBytes <= uiBytesRemaining) { __len = (size_t )(16U - uiExtraBytes); __ret = memcpy((void *)pBuffer, (void const *)(& uiData) + (unsigned long )uiExtraBytes, __len); uiBytesRemaining = (uiExtraBytes + uiBytesRemaining) - 16U; uiIndex = (uiIndex - uiExtraBytes) + 16U; uiOffset = (uiOffset - uiExtraBytes) + 16U; } else { __len___0 = (size_t )uiBytesRemaining; __ret___0 = memcpy((void *)pBuffer, (void const *)(& uiData) + (unsigned long )uiExtraBytes, __len___0); uiIndex = uiIndex + uiBytesRemaining; uiOffset = uiOffset + uiBytesRemaining; uiBytesRemaining = 0U; } } else { } goto ldv_46988; ldv_46987: ; if ((int )((signed char )Adapter->device_removed) != 0) { return (-1); } else { } if (uiBytesRemaining > 15U) { tmp___0 = ReadBeceemEEPROMBulk(Adapter, uiOffset, (unsigned int *)(& uiData), 4U); if (tmp___0 == 0) { __len___1 = 16UL; if (__len___1 > 63UL) { __ret___1 = memcpy((void *)pcBuff + (unsigned long )uiIndex, (void const *)(& uiData), __len___1); } else { __ret___1 = memcpy((void *)pcBuff + (unsigned long )uiIndex, (void const *)(& uiData), __len___1); } uiOffset = uiOffset + 16U; uiBytesRemaining = uiBytesRemaining - 16U; uiIndex = uiIndex + 16U; } else { uiFailureRetries = uiFailureRetries + 1U; if (1) { __const_udelay(12885000UL); } else { __ms = 3UL; goto ldv_46970; ldv_46969: __const_udelay(4295000UL); ldv_46970: tmp = __ms; __ms = __ms - 1UL; if (tmp != 0UL) { goto ldv_46969; } else { goto ldv_46971; } ldv_46971: ; } } } else if (uiBytesRemaining > 3U) { tmp___2 = ReadBeceemEEPROM(Adapter, uiOffset, (UINT *)(& uiData)); if (tmp___2 == 0) { __len___2 = 4UL; if (__len___2 > 63UL) { __ret___2 = memcpy((void *)pcBuff + (unsigned long )uiIndex, (void const *)(& uiData), __len___2); } else { __ret___2 = memcpy((void *)pcBuff + (unsigned long )uiIndex, (void const *)(& uiData), __len___2); } uiOffset = uiOffset + 4U; uiBytesRemaining = uiBytesRemaining - 4U; uiIndex = uiIndex + 4U; } else { uiFailureRetries = uiFailureRetries + 1U; if (1) { __const_udelay(12885000UL); } else { __ms___0 = 3UL; goto ldv_46977; ldv_46976: __const_udelay(4295000UL); ldv_46977: tmp___1 = __ms___0; __ms___0 = __ms___0 - 1UL; if (tmp___1 != 0UL) { goto ldv_46976; } else { goto ldv_46978; } ldv_46978: ; } } } else { pCharBuff = (unsigned char *)pBuffer; pCharBuff = pCharBuff + (unsigned long )uiIndex; tmp___4 = ReadBeceemEEPROM(Adapter, uiOffset, (UINT *)(& uiData)); if (tmp___4 == 0) { __len___3 = (size_t )uiBytesRemaining; __ret___3 = memcpy((void *)pCharBuff, (void const *)(& uiData), __len___3); uiBytesRemaining = 0U; } else { uiFailureRetries = uiFailureRetries + 1U; if (1) { __const_udelay(12885000UL); } else { __ms___1 = 3UL; goto ldv_46985; ldv_46984: __const_udelay(4295000UL); ldv_46985: tmp___3 = __ms___1; __ms___1 = __ms___1 - 1UL; if (tmp___3 != 0UL) { goto ldv_46984; } else { goto ldv_46986; } ldv_46986: ; } } } ldv_46988: ; if (uiBytesRemaining != 0U && uiFailureRetries != 128U) { goto ldv_46987; } else { goto ldv_46989; } ldv_46989: ; return (0); } } static int BeceemFlashBulkRead(struct bcm_mini_adapter *Adapter , PUINT pBuffer , unsigned int uiOffset , unsigned int uiNumBytes ) { unsigned int uiIndex ; unsigned int uiBytesToRead ; int Status ; unsigned int uiPartOffset ; int bytes ; int tmp ; int tmp___0 ; { uiIndex = 0U; uiBytesToRead = uiNumBytes; Status = 0; uiPartOffset = 0U; if ((int )((signed char )Adapter->device_removed) != 0) { printk("\016%s:Device Got Removed", "BeceemFlashBulkRead"); return (-19); } else { } Adapter->SelectedChip = -1; if ((uiOffset & 15U) != 0U) { BcmDoChipSelect(Adapter, uiOffset); tmp = GetFlashBaseAddr(Adapter); uiPartOffset = (uiOffset & 16777215U) + (unsigned int )tmp; uiBytesToRead = 16U - (uiOffset & 15U); if (uiNumBytes < uiBytesToRead) { uiBytesToRead = uiNumBytes; } else { uiBytesToRead = uiBytesToRead; } bytes = rdm(Adapter, uiPartOffset, (char *)pBuffer + (unsigned long )uiIndex, (size_t )uiBytesToRead); if (bytes < 0) { Status = bytes; Adapter->SelectedChip = -1; return (Status); } else { } uiIndex = uiIndex + uiBytesToRead; uiOffset = uiOffset + uiBytesToRead; uiNumBytes = uiNumBytes - uiBytesToRead; } else { } goto ldv_47004; ldv_47003: BcmDoChipSelect(Adapter, uiOffset); tmp___0 = GetFlashBaseAddr(Adapter); uiPartOffset = (uiOffset & 16777215U) + (unsigned int )tmp___0; if (16U < uiNumBytes) { uiBytesToRead = 16U; } else { uiBytesToRead = uiNumBytes; } bytes = rdm(Adapter, uiPartOffset, (char *)pBuffer + (unsigned long )uiIndex, (size_t )uiBytesToRead); if (bytes < 0) { Status = bytes; goto ldv_47002; } else { } uiIndex = uiIndex + uiBytesToRead; uiOffset = uiOffset + uiBytesToRead; uiNumBytes = uiNumBytes - uiBytesToRead; ldv_47004: ; if (uiNumBytes != 0U) { goto ldv_47003; } else { goto ldv_47002; } ldv_47002: Adapter->SelectedChip = -1; return (Status); } } static unsigned int BcmGetFlashSize(struct bcm_mini_adapter *Adapter ) { INT tmp ; { tmp = IsFlash2x(Adapter); if (tmp != 0) { return ((Adapter->psFlash2xCSInfo)->OffsetFromDSDStartForDSDHeader + 1024U); } else { return (32768U); } } } static unsigned int BcmGetEEPROMSize(struct bcm_mini_adapter *Adapter ) { unsigned int uiData ; unsigned int uiIndex ; INT tmp ; { uiData = 0U; uiIndex = 0U; BeceemEEPROMBulkRead(Adapter, & uiData, 0U, 4U); if (uiData == 1296254274U) { uiIndex = 2U; goto ldv_47014; ldv_47013: BeceemEEPROMBulkRead(Adapter, & uiData, uiIndex * 1024U, 4U); if (uiData == 1296254274U) { return (uiIndex * 1024U); } else { } uiIndex = uiIndex * 2U; ldv_47014: ; if (uiIndex <= 256U) { goto ldv_47013; } else { goto ldv_47015; } ldv_47015: ; } else { uiData = 3133078222U; tmp = BeceemEEPROMBulkWrite(Adapter, (unsigned char *)(& uiData), 0U, 4U, 1); if (tmp == 0) { uiData = 0U; uiIndex = 2U; goto ldv_47017; ldv_47016: BeceemEEPROMBulkRead(Adapter, & uiData, uiIndex * 1024U, 4U); if (uiData == 3133078222U) { return (uiIndex * 1024U); } else { } uiIndex = uiIndex * 2U; ldv_47017: ; if (uiIndex <= 256U) { goto ldv_47016; } else { goto ldv_47018; } ldv_47018: ; } else { } } return (0U); } } static int FlashSectorErase(struct bcm_mini_adapter *Adapter , unsigned int addr , unsigned int numOfSectors ) { unsigned int iIndex ; unsigned int iRetries ; unsigned int uiStatus ; unsigned int value ; int bytes ; int tmp ; unsigned long __ms ; unsigned long tmp___0 ; { iIndex = 0U; iRetries = 0U; uiStatus = 0U; iIndex = 0U; goto ldv_47037; ldv_47036: value = 100663296U; wrmalt(Adapter, 2936025152U, & value, 4UL); value = (addr & 16777215U) | 3623878656U; wrmalt(Adapter, 2936025152U, & value, 4UL); iRetries = 0U; ldv_47034: value = 83886080U; tmp = wrmalt(Adapter, 2936025152U, & value, 4UL); if (tmp < 0) { printk("\016%s:Programing of FLASH_SPI_CMDQ_REG fails", "FlashSectorErase"); return (-1); } else { } bytes = rdmalt(Adapter, 2936025160U, & uiStatus, 4UL); if (bytes < 0) { uiStatus = (unsigned int )bytes; printk("\016%s:Reading status of FLASH_SPI_READQ_REG fails", "FlashSectorErase"); return ((int )uiStatus); } else { } iRetries = iRetries + 1U; __ms = 10UL; goto ldv_47032; ldv_47031: __const_udelay(4295000UL); ldv_47032: tmp___0 = __ms; __ms = __ms - 1UL; if (tmp___0 != 0UL) { goto ldv_47031; } else { goto ldv_47033; } ldv_47033: ; if ((int )uiStatus & 1 && iRetries <= 399U) { goto ldv_47034; } else { goto ldv_47035; } ldv_47035: ; if ((int )uiStatus & 1) { printk("\016%s:iRetries crossing the limit of 80000\n", "FlashSectorErase"); return (-1); } else { } addr = Adapter->uiSectorSize + addr; iIndex = iIndex + 1U; ldv_47037: ; if (iIndex < numOfSectors) { goto ldv_47036; } else { goto ldv_47038; } ldv_47038: ; return (0); } } static int flashByteWrite(struct bcm_mini_adapter *Adapter , unsigned int uiOffset , PVOID pData ) { unsigned int uiStatus ; int iRetries ; unsigned int value ; ULONG ulData ; int bytes ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; { uiStatus = 0U; iRetries = 64; ulData = (ULONG )*((unsigned char *)pData); if (ulData == 255UL) { return (0); } else { } value = 100663296U; tmp = wrmalt(Adapter, 2936025152U, & value, 4UL); if (tmp < 0) { printk("\016%s:Write enable in FLASH_SPI_CMDQ_REG register fails", "flashByteWrite"); return (-1); } else { } tmp___0 = wrm(Adapter, 2936025156U, (char *)(& ulData), 4UL); if (tmp___0 < 0) { printk("\016%s:DATA Write on FLASH_SPI_WRITEQ_REG fails", "flashByteWrite"); return (-1); } else { } value = (uiOffset & 16777215U) | 33554432U; tmp___1 = wrmalt(Adapter, 2936025152U, & value, 4UL); if (tmp___1 < 0) { printk("\016%s:Programming of FLASH_SPI_CMDQ_REG fails", "flashByteWrite"); return (-1); } else { } ldv_47050: value = 83886080U; tmp___2 = wrmalt(Adapter, 2936025152U, & value, 4UL); if (tmp___2 < 0) { printk("\016%s:Programing of FLASH_SPI_CMDQ_REG fails", "flashByteWrite"); return (-1); } else { } bytes = rdmalt(Adapter, 2936025160U, & uiStatus, 4UL); if (bytes < 0) { uiStatus = (unsigned int )bytes; printk("\016%s:Reading status of FLASH_SPI_READQ_REG fails", "flashByteWrite"); return ((int )uiStatus); } else { } iRetries = iRetries - 1; if (iRetries != 0 && ((unsigned int )iRetries & 15U) == 0U) { __const_udelay(4295000UL); } else { } if ((int )uiStatus & 1 && iRetries > 0) { goto ldv_47050; } else { goto ldv_47051; } ldv_47051: ; if ((int )uiStatus & 1) { printk("\016%s:Flash Write fails even after checking status for 200 times.", "flashByteWrite"); return (-1); } else { } return (0); } } static int flashWrite(struct bcm_mini_adapter *Adapter , unsigned int uiOffset , PVOID pData ) { unsigned int uiStatus ; int iRetries ; unsigned int value ; unsigned int uiErasePattern[4U] ; int bytes ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; { uiStatus = 0U; iRetries = 64; uiErasePattern[0] = 4294967295U; uiErasePattern[1] = 4294967295U; uiErasePattern[2] = 4294967295U; uiErasePattern[3] = 4294967295U; tmp = memcmp((void const *)pData, (void const *)(& uiErasePattern), 16UL); if (tmp == 0) { return (0); } else { } value = 100663296U; tmp___0 = wrmalt(Adapter, 2936025152U, & value, 4UL); if (tmp___0 < 0) { printk("\016%s:Write Enable of FLASH_SPI_CMDQ_REG fails", "flashWrite"); return (-1); } else { } tmp___1 = wrm(Adapter, uiOffset, (char *)pData, 16UL); if (tmp___1 < 0) { printk("\016%s:Data write fails...", "flashWrite"); return (-1); } else { } ldv_47063: value = 83886080U; tmp___2 = wrmalt(Adapter, 2936025152U, & value, 4UL); if (tmp___2 < 0) { printk("\016%s:Programing of FLASH_SPI_CMDQ_REG fails", "flashWrite"); return (-1); } else { } bytes = rdmalt(Adapter, 2936025160U, & uiStatus, 4UL); if (bytes < 0) { uiStatus = (unsigned int )bytes; printk("\016%s:Reading status of FLASH_SPI_READQ_REG fails", "flashWrite"); return ((int )uiStatus); } else { } iRetries = iRetries - 1; if (iRetries != 0 && ((unsigned int )iRetries & 15U) == 0U) { __const_udelay(4295000UL); } else { } if ((int )uiStatus & 1 && iRetries > 0) { goto ldv_47063; } else { goto ldv_47064; } ldv_47064: ; if ((int )uiStatus & 1) { printk("\016%s:Flash Write fails even after checking status for 200 times.", "flashWrite"); return (-1); } else { } return (0); } } static int flashByteWriteStatus(struct bcm_mini_adapter *Adapter , unsigned int uiOffset , PVOID pData ) { unsigned int uiStatus ; int iRetries ; ULONG ulData ; unsigned int value ; int bytes ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; { uiStatus = 0U; iRetries = 64; ulData = (ULONG )*((unsigned char *)pData); if (ulData == 255UL) { return (0); } else { } value = 100663296U; tmp = wrmalt(Adapter, 2936025152U, & value, 4UL); if (tmp < 0) { printk("\016%s:Write enable in FLASH_SPI_CMDQ_REG register fails", "flashByteWriteStatus"); return (0); } else { } tmp___0 = wrm(Adapter, 2936025156U, (char *)(& ulData), 4UL); if (tmp___0 < 0) { printk("\016%s:DATA Write on FLASH_SPI_WRITEQ_REG fails", "flashByteWriteStatus"); return (-1); } else { } value = (uiOffset & 16777215U) | 33554432U; tmp___1 = wrmalt(Adapter, 2936025152U, & value, 4UL); if (tmp___1 < 0) { printk("\016%s:Programming of FLASH_SPI_CMDQ_REG fails", "flashByteWriteStatus"); return (-1); } else { } ldv_47076: value = 83886080U; tmp___2 = wrmalt(Adapter, 2936025152U, & value, 4UL); if (tmp___2 < 0) { printk("\016%s:Programing of FLASH_SPI_CMDQ_REG fails", "flashByteWriteStatus"); return (-1); } else { } bytes = rdmalt(Adapter, 2936025160U, & uiStatus, 4UL); if (bytes < 0) { uiStatus = (unsigned int )bytes; printk("\016%s:Reading status of FLASH_SPI_READQ_REG fails", "flashByteWriteStatus"); return ((int )uiStatus); } else { } iRetries = iRetries - 1; if (iRetries != 0 && ((unsigned int )iRetries & 15U) == 0U) { __const_udelay(4295000UL); } else { } if ((int )uiStatus & 1 && iRetries > 0) { goto ldv_47076; } else { goto ldv_47077; } ldv_47077: ; if ((int )uiStatus & 1) { printk("\016%s:Flash Write fails even after checking status for 200 times.", "flashByteWriteStatus"); return (-1); } else { } return (0); } } static int flashWriteStatus(struct bcm_mini_adapter *Adapter , unsigned int uiOffset , PVOID pData ) { unsigned int uiStatus ; int iRetries ; unsigned int value ; unsigned int uiErasePattern[4U] ; int bytes ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; { uiStatus = 0U; iRetries = 64; uiErasePattern[0] = 4294967295U; uiErasePattern[1] = 4294967295U; uiErasePattern[2] = 4294967295U; uiErasePattern[3] = 4294967295U; tmp = memcmp((void const *)pData, (void const *)(& uiErasePattern), 16UL); if (tmp == 0) { return (0); } else { } value = 100663296U; tmp___0 = wrmalt(Adapter, 2936025152U, & value, 4UL); if (tmp___0 < 0) { printk("\016%s:Write Enable of FLASH_SPI_CMDQ_REG fails", "flashWriteStatus"); return (-1); } else { } tmp___1 = wrm(Adapter, uiOffset, (char *)pData, 16UL); if (tmp___1 < 0) { printk("\016%s:Data write fails...", "flashWriteStatus"); return (-1); } else { } ldv_47089: value = 83886080U; tmp___2 = wrmalt(Adapter, 2936025152U, & value, 4UL); if (tmp___2 < 0) { printk("\016%s:Programing of FLASH_SPI_CMDQ_REG fails", "flashWriteStatus"); return (-1); } else { } bytes = rdmalt(Adapter, 2936025160U, & uiStatus, 4UL); if (bytes < 0) { uiStatus = (unsigned int )bytes; printk("\016%s:Reading status of FLASH_SPI_READQ_REG fails", "flashWriteStatus"); return ((int )uiStatus); } else { } iRetries = iRetries - 1; if (iRetries != 0 && ((unsigned int )iRetries & 15U) == 0U) { __const_udelay(4295000UL); } else { } if ((int )uiStatus & 1 && iRetries > 0) { goto ldv_47089; } else { goto ldv_47090; } ldv_47090: ; if ((int )uiStatus & 1) { printk("\016%s:Flash Write fails even after checking status for 200 times.", "flashWriteStatus"); return (-1); } else { } return (0); } } static VOID BcmRestoreBlockProtectStatus(struct bcm_mini_adapter *Adapter , ULONG ulWriteStatus ) { unsigned int value ; { value = 100663296U; wrmalt(Adapter, 2936025152U, & value, 4UL); __const_udelay(85900UL); value = ((unsigned int )ulWriteStatus << 16U) | 16777216U; wrmalt(Adapter, 2936025152U, & value, 4UL); __const_udelay(85900UL); return; } } static ULONG BcmFlashUnProtectBlock(struct bcm_mini_adapter *Adapter , unsigned int uiOffset , unsigned int uiLength ) { ULONG ulStatus ; ULONG ulWriteStatus ; unsigned int value ; { ulStatus = 0UL; ulWriteStatus = 0UL; uiOffset = uiOffset & 1048575U; if (Adapter->ulFlashID == 12526990UL) { value = 83886080U; wrmalt(Adapter, 2936025152U, & value, 4UL); __const_udelay(42950UL); rdmalt(Adapter, 2936025160U, (unsigned int *)(& ulStatus), 8UL); ulStatus = ulStatus >> 24; ulWriteStatus = ulStatus; if (ulStatus != 0UL) { if (uiOffset + uiLength <= 524288U) { ulWriteStatus = ulWriteStatus | 16UL; ulWriteStatus = ulWriteStatus & 0xfffffffffffffff3UL; } else if (uiOffset + uiLength <= 786432U) { ulWriteStatus = ulWriteStatus | 12UL; ulWriteStatus = ulWriteStatus & 0xffffffffffffffefUL; } else if (uiOffset + uiLength <= 917504U) { ulWriteStatus = ulWriteStatus | 8UL; ulWriteStatus = ulWriteStatus & 0xffffffffffffffebUL; } else if (uiOffset + uiLength <= 983040U) { ulWriteStatus = ulWriteStatus | 4UL; ulWriteStatus = ulWriteStatus & 0xffffffffffffffe7UL; } else { ulWriteStatus = ulWriteStatus & 0xffffffffffffffe3UL; } value = 100663296U; wrmalt(Adapter, 2936025152U, & value, 4UL); __const_udelay(85900UL); value = ((unsigned int )ulWriteStatus << 16U) | 16777216U; wrmalt(Adapter, 2936025152U, & value, 4UL); __const_udelay(85900UL); } else { } } else { } return (ulStatus); } } static int BeceemFlashBulkWrite(struct bcm_mini_adapter *Adapter , PUINT pBuffer , unsigned int uiOffset , unsigned int uiNumBytes , BOOLEAN bVerify ) { PCHAR pTempBuff ; PUCHAR pcBuffer ; unsigned int uiIndex ; unsigned int uiOffsetFromSectStart ; unsigned int uiSectAlignAddr ; unsigned int uiCurrSectOffsetAddr ; unsigned int uiSectBoundary ; unsigned int uiNumSectTobeRead ; UCHAR ucReadBk[16U] ; ULONG ulStatus ; int Status ; unsigned int uiTemp ; unsigned int index ; unsigned int uiPartOffset ; void *tmp ; B_UINT8 tmp___0 ; INT tmp___1 ; int tmp___2 ; int tmp___3 ; size_t __len ; void *__ret ; size_t __len___0 ; void *__ret___0 ; INT tmp___4 ; int tmp___5 ; unsigned int uiReadIndex ; int tmp___6 ; int tmp___7 ; int tmp___8 ; int tmp___9 ; { pTempBuff = 0; pcBuffer = (unsigned char *)pBuffer; uiIndex = 0U; uiOffsetFromSectStart = 0U; uiSectAlignAddr = 0U; uiCurrSectOffsetAddr = 0U; uiSectBoundary = 0U; uiNumSectTobeRead = 0U; ucReadBk[0] = 0U; ucReadBk[1] = (unsigned char)0; ucReadBk[2] = (unsigned char)0; ucReadBk[3] = (unsigned char)0; ucReadBk[4] = (unsigned char)0; ucReadBk[5] = (unsigned char)0; ucReadBk[6] = (unsigned char)0; ucReadBk[7] = (unsigned char)0; ucReadBk[8] = (unsigned char)0; ucReadBk[9] = (unsigned char)0; ucReadBk[10] = (unsigned char)0; ucReadBk[11] = (unsigned char)0; ucReadBk[12] = (unsigned char)0; ucReadBk[13] = (unsigned char)0; ucReadBk[14] = (unsigned char)0; ucReadBk[15] = (unsigned char)0; ulStatus = 0UL; Status = 0; uiTemp = 0U; index = 0U; uiPartOffset = 0U; uiOffsetFromSectStart = - Adapter->uiSectorSize & uiOffset; uiSectAlignAddr = - Adapter->uiSectorSize & uiOffset; uiCurrSectOffsetAddr = (Adapter->uiSectorSize - 1U) & uiOffset; uiSectBoundary = Adapter->uiSectorSize + uiSectAlignAddr; tmp = kmalloc((size_t )Adapter->uiSectorSize, 208U); pTempBuff = (PCHAR )tmp; if ((unsigned long )pTempBuff == (unsigned long )((PCHAR )0)) { goto BeceemFlashBulkWrite_EXIT; } else { } if (uiOffset + uiNumBytes < uiSectBoundary) { uiNumSectTobeRead = 1U; } else { uiNumSectTobeRead = (uiCurrSectOffsetAddr + uiNumBytes) / Adapter->uiSectorSize; if ((uiCurrSectOffsetAddr + uiNumBytes) % Adapter->uiSectorSize != 0U) { uiNumSectTobeRead = uiNumSectTobeRead + 1U; } else { } } tmp___1 = IsFlash2x(Adapter); if (tmp___1 != 0 && (int )((signed char )Adapter->bAllDSDWriteAllow) == 0) { index = 0U; uiTemp = uiNumSectTobeRead; goto ldv_47128; ldv_47127: tmp___0 = IsOffsetWritable(Adapter, Adapter->uiSectorSize * index + uiOffsetFromSectStart); if ((unsigned int )tmp___0 == 0U) { printk("\016%s:Sector Starting at offset <0X%X> is not writable", "BeceemFlashBulkWrite", Adapter->uiSectorSize * index + uiOffsetFromSectStart); Status = -1; goto BeceemFlashBulkWrite_EXIT; } else { } uiTemp = uiTemp - 1U; index = index + 1U; ldv_47128: ; if (uiTemp != 0U) { goto ldv_47127; } else { goto ldv_47129; } ldv_47129: ; } else { } Adapter->SelectedChip = -1; goto ldv_47147; ldv_47146: tmp___2 = GetFlashBaseAddr(Adapter); uiPartOffset = (uiSectAlignAddr & 16777215U) + (unsigned int )tmp___2; BcmDoChipSelect(Adapter, uiSectAlignAddr); tmp___3 = BeceemFlashBulkRead(Adapter, (unsigned int *)pTempBuff, uiOffsetFromSectStart, Adapter->uiSectorSize); if (tmp___3 != 0) { Status = -1; goto BeceemFlashBulkWrite_EXIT; } else { } ulStatus = BcmFlashUnProtectBlock(Adapter, uiSectAlignAddr, Adapter->uiSectorSize); if (uiNumSectTobeRead > 1U) { __len = (size_t )(uiSectBoundary - (uiSectAlignAddr + uiCurrSectOffsetAddr)); __ret = memcpy((void *)pTempBuff + (unsigned long )uiCurrSectOffsetAddr, (void const *)pcBuffer, __len); pcBuffer = pcBuffer + (unsigned long )(uiSectBoundary - (uiSectAlignAddr + uiCurrSectOffsetAddr)); uiNumBytes = ((uiSectAlignAddr + uiCurrSectOffsetAddr) - uiSectBoundary) + uiNumBytes; } else { __len___0 = (size_t )uiNumBytes; __ret___0 = memcpy((void *)pTempBuff + (unsigned long )uiCurrSectOffsetAddr, (void const *)pcBuffer, __len___0); } tmp___4 = IsFlash2x(Adapter); if (tmp___4 != 0) { SaveHeaderIfPresent(Adapter, (unsigned char *)pTempBuff, uiOffsetFromSectStart); } else { } FlashSectorErase(Adapter, uiPartOffset, 1U); uiIndex = 0U; goto ldv_47137; ldv_47136: ; if ((int )((signed char )Adapter->device_removed) != 0) { Status = -1; goto BeceemFlashBulkWrite_EXIT; } else { } tmp___5 = (*(Adapter->fpFlashWrite))(Adapter, uiPartOffset + uiIndex, (PVOID )pTempBuff + (unsigned long )uiIndex); if (tmp___5 != 0) { Status = -1; goto BeceemFlashBulkWrite_EXIT; } else { } uiIndex = (unsigned int )Adapter->ulFlashWriteSize + uiIndex; ldv_47137: ; if (Adapter->uiSectorSize > uiIndex) { goto ldv_47136; } else { goto ldv_47138; } ldv_47138: uiIndex = 0U; goto ldv_47144; ldv_47143: tmp___9 = BeceemFlashBulkRead(Adapter, (unsigned int *)(& ucReadBk), uiOffsetFromSectStart + uiIndex, 16U); if (tmp___9 == 0) { if (Adapter->ulFlashWriteSize == 1UL) { uiReadIndex = 0U; uiReadIndex = 0U; goto ldv_47141; ldv_47140: ; if ((int )ucReadBk[uiReadIndex] != (int )*(pTempBuff + (unsigned long )(uiIndex + uiReadIndex))) { tmp___6 = (*(Adapter->fpFlashWriteWithStatusCheck))(Adapter, (uiPartOffset + uiIndex) + uiReadIndex, (PVOID )pTempBuff + (unsigned long )(uiIndex + uiReadIndex)); if (tmp___6 != 0) { Status = -1; goto BeceemFlashBulkWrite_EXIT; } else { } } else { } uiReadIndex = uiReadIndex + 1U; ldv_47141: ; if (uiReadIndex <= 15U) { goto ldv_47140; } else { goto ldv_47142; } ldv_47142: ; } else { tmp___8 = memcmp((void const *)(& ucReadBk), (void const *)pTempBuff + (unsigned long )uiIndex, 16UL); if (tmp___8 != 0) { tmp___7 = (*(Adapter->fpFlashWriteWithStatusCheck))(Adapter, uiPartOffset + uiIndex, (PVOID )pTempBuff + (unsigned long )uiIndex); if (tmp___7 != 0) { Status = -1; goto BeceemFlashBulkWrite_EXIT; } else { } } else { } } } else { } uiIndex = uiIndex + 16U; ldv_47144: ; if (Adapter->uiSectorSize > uiIndex) { goto ldv_47143; } else { goto ldv_47145; } ldv_47145: ; if (ulStatus != 0UL) { BcmRestoreBlockProtectStatus(Adapter, ulStatus); ulStatus = 0UL; } else { } uiCurrSectOffsetAddr = 0U; uiSectAlignAddr = uiSectBoundary; uiSectBoundary = Adapter->uiSectorSize + uiSectBoundary; uiOffsetFromSectStart = Adapter->uiSectorSize + uiOffsetFromSectStart; uiNumSectTobeRead = uiNumSectTobeRead - 1U; ldv_47147: ; if (uiNumSectTobeRead != 0U) { goto ldv_47146; } else { goto ldv_47148; } ldv_47148: ; BeceemFlashBulkWrite_EXIT: ; if (ulStatus != 0UL) { BcmRestoreBlockProtectStatus(Adapter, ulStatus); } else { } kfree((void const *)pTempBuff); Adapter->SelectedChip = -1; return (Status); } } static int BeceemFlashBulkWriteStatus(struct bcm_mini_adapter *Adapter , PUINT pBuffer , unsigned int uiOffset , unsigned int uiNumBytes , BOOLEAN bVerify ) { PCHAR pTempBuff ; PUCHAR pcBuffer ; unsigned int uiIndex ; unsigned int uiOffsetFromSectStart ; unsigned int uiSectAlignAddr ; unsigned int uiCurrSectOffsetAddr ; unsigned int uiSectBoundary ; unsigned int uiNumSectTobeRead ; UCHAR ucReadBk[16U] ; ULONG ulStatus ; unsigned int Status ; unsigned int uiTemp ; unsigned int index ; unsigned int uiPartOffset ; void *tmp ; B_UINT8 tmp___0 ; INT tmp___1 ; int tmp___2 ; int tmp___3 ; size_t __len ; void *__ret ; size_t __len___0 ; void *__ret___0 ; INT tmp___4 ; int tmp___5 ; int tmp___6 ; int tmp___7 ; { pTempBuff = 0; pcBuffer = (unsigned char *)pBuffer; uiIndex = 0U; uiOffsetFromSectStart = 0U; uiSectAlignAddr = 0U; uiCurrSectOffsetAddr = 0U; uiSectBoundary = 0U; uiNumSectTobeRead = 0U; ucReadBk[0] = 0U; ucReadBk[1] = (unsigned char)0; ucReadBk[2] = (unsigned char)0; ucReadBk[3] = (unsigned char)0; ucReadBk[4] = (unsigned char)0; ucReadBk[5] = (unsigned char)0; ucReadBk[6] = (unsigned char)0; ucReadBk[7] = (unsigned char)0; ucReadBk[8] = (unsigned char)0; ucReadBk[9] = (unsigned char)0; ucReadBk[10] = (unsigned char)0; ucReadBk[11] = (unsigned char)0; ucReadBk[12] = (unsigned char)0; ucReadBk[13] = (unsigned char)0; ucReadBk[14] = (unsigned char)0; ucReadBk[15] = (unsigned char)0; ulStatus = 0UL; Status = 0U; uiTemp = 0U; index = 0U; uiPartOffset = 0U; uiOffsetFromSectStart = - Adapter->uiSectorSize & uiOffset; uiSectAlignAddr = - Adapter->uiSectorSize & uiOffset; uiCurrSectOffsetAddr = (Adapter->uiSectorSize - 1U) & uiOffset; uiSectBoundary = Adapter->uiSectorSize + uiSectAlignAddr; tmp = kmalloc((size_t )Adapter->uiSectorSize, 208U); pTempBuff = (PCHAR )tmp; if ((unsigned long )pTempBuff == (unsigned long )((PCHAR )0)) { goto BeceemFlashBulkWriteStatus_EXIT; } else { } if (uiOffset + uiNumBytes < uiSectBoundary) { uiNumSectTobeRead = 1U; } else { uiNumSectTobeRead = (uiCurrSectOffsetAddr + uiNumBytes) / Adapter->uiSectorSize; if ((uiCurrSectOffsetAddr + uiNumBytes) % Adapter->uiSectorSize != 0U) { uiNumSectTobeRead = uiNumSectTobeRead + 1U; } else { } } tmp___1 = IsFlash2x(Adapter); if (tmp___1 != 0 && (int )((signed char )Adapter->bAllDSDWriteAllow) == 0) { index = 0U; uiTemp = uiNumSectTobeRead; goto ldv_47173; ldv_47172: tmp___0 = IsOffsetWritable(Adapter, Adapter->uiSectorSize * index + uiOffsetFromSectStart); if ((unsigned int )tmp___0 == 0U) { printk("\016%s:Sector Starting at offset <0X%x> is not writable", "BeceemFlashBulkWriteStatus", Adapter->uiSectorSize * index + uiOffsetFromSectStart); Status = 4294967295U; goto BeceemFlashBulkWriteStatus_EXIT; } else { } uiTemp = uiTemp - 1U; index = index + 1U; ldv_47173: ; if (uiTemp != 0U) { goto ldv_47172; } else { goto ldv_47174; } ldv_47174: ; } else { } Adapter->SelectedChip = -1; goto ldv_47188; ldv_47187: tmp___2 = GetFlashBaseAddr(Adapter); uiPartOffset = (uiSectAlignAddr & 16777215U) + (unsigned int )tmp___2; BcmDoChipSelect(Adapter, uiSectAlignAddr); tmp___3 = BeceemFlashBulkRead(Adapter, (unsigned int *)pTempBuff, uiOffsetFromSectStart, Adapter->uiSectorSize); if (tmp___3 != 0) { Status = 4294967295U; goto BeceemFlashBulkWriteStatus_EXIT; } else { } ulStatus = BcmFlashUnProtectBlock(Adapter, uiOffsetFromSectStart, Adapter->uiSectorSize); if (uiNumSectTobeRead > 1U) { __len = (size_t )(uiSectBoundary - (uiSectAlignAddr + uiCurrSectOffsetAddr)); __ret = memcpy((void *)pTempBuff + (unsigned long )uiCurrSectOffsetAddr, (void const *)pcBuffer, __len); pcBuffer = pcBuffer + (unsigned long )(uiSectBoundary - (uiSectAlignAddr + uiCurrSectOffsetAddr)); uiNumBytes = ((uiSectAlignAddr + uiCurrSectOffsetAddr) - uiSectBoundary) + uiNumBytes; } else { __len___0 = (size_t )uiNumBytes; __ret___0 = memcpy((void *)pTempBuff + (unsigned long )uiCurrSectOffsetAddr, (void const *)pcBuffer, __len___0); } tmp___4 = IsFlash2x(Adapter); if (tmp___4 != 0) { SaveHeaderIfPresent(Adapter, (unsigned char *)pTempBuff, uiOffsetFromSectStart); } else { } FlashSectorErase(Adapter, uiPartOffset, 1U); uiIndex = 0U; goto ldv_47182; ldv_47181: ; if ((int )((signed char )Adapter->device_removed) != 0) { Status = 4294967295U; goto BeceemFlashBulkWriteStatus_EXIT; } else { } tmp___5 = (*(Adapter->fpFlashWriteWithStatusCheck))(Adapter, uiPartOffset + uiIndex, (PVOID )pTempBuff + (unsigned long )uiIndex); if (tmp___5 != 0) { Status = 4294967295U; goto BeceemFlashBulkWriteStatus_EXIT; } else { } uiIndex = (unsigned int )Adapter->ulFlashWriteSize + uiIndex; ldv_47182: ; if (Adapter->uiSectorSize > uiIndex) { goto ldv_47181; } else { goto ldv_47183; } ldv_47183: ; if ((int )((signed char )bVerify) != 0) { uiIndex = 0U; goto ldv_47185; ldv_47184: tmp___7 = BeceemFlashBulkRead(Adapter, (unsigned int *)(& ucReadBk), uiOffsetFromSectStart + uiIndex, 16U); if (tmp___7 == 0) { tmp___6 = memcmp((void const *)(& ucReadBk), (void const *)pTempBuff + (unsigned long )uiIndex, 16UL); if (tmp___6 != 0) { Status = 4294967295U; goto BeceemFlashBulkWriteStatus_EXIT; } else { } } else { } uiIndex = uiIndex + 16U; ldv_47185: ; if (Adapter->uiSectorSize > uiIndex) { goto ldv_47184; } else { goto ldv_47186; } ldv_47186: ; } else { } if (ulStatus != 0UL) { BcmRestoreBlockProtectStatus(Adapter, ulStatus); ulStatus = 0UL; } else { } uiCurrSectOffsetAddr = 0U; uiSectAlignAddr = uiSectBoundary; uiSectBoundary = Adapter->uiSectorSize + uiSectBoundary; uiOffsetFromSectStart = Adapter->uiSectorSize + uiOffsetFromSectStart; uiNumSectTobeRead = uiNumSectTobeRead - 1U; ldv_47188: ; if (uiNumSectTobeRead != 0U) { goto ldv_47187; } else { goto ldv_47189; } ldv_47189: ; BeceemFlashBulkWriteStatus_EXIT: ; if (ulStatus != 0UL) { BcmRestoreBlockProtectStatus(Adapter, ulStatus); } else { } kfree((void const *)pTempBuff); Adapter->SelectedChip = -1; return ((int )Status); } } int PropagateCalParamsFromEEPROMToMemory(struct bcm_mini_adapter *Adapter ) { PCHAR pBuff ; void *tmp ; unsigned int uiEepromSize ; unsigned int uiIndex ; unsigned int uiBytesToCopy ; unsigned int uiCalStartAddr ; unsigned int uiMemoryLoc ; unsigned int value ; int Status ; INT tmp___0 ; INT tmp___1 ; { tmp = kmalloc(4096UL, 208U); pBuff = (PCHAR )tmp; uiEepromSize = 0U; uiIndex = 0U; uiBytesToCopy = 0U; uiCalStartAddr = 512U; uiMemoryLoc = 3215982600U; Status = 0; if ((unsigned long )pBuff == (unsigned long )((PCHAR )0)) { return (-12); } else { } tmp___0 = BeceemEEPROMBulkRead(Adapter, & uiEepromSize, 524U, 4U); if (tmp___0 != 0) { kfree((void const *)pBuff); return (-1); } else { } uiEepromSize = uiEepromSize >> 16; if (uiEepromSize > 1048576U) { kfree((void const *)pBuff); return (-1); } else { } if (4096U < uiEepromSize) { uiBytesToCopy = 4096U; } else { uiBytesToCopy = uiEepromSize; } goto ldv_47203; ldv_47202: tmp___1 = BeceemEEPROMBulkRead(Adapter, (unsigned int *)pBuff, uiCalStartAddr, uiBytesToCopy); if (tmp___1 != 0) { Status = -1; goto ldv_47201; } else { } wrm(Adapter, uiMemoryLoc, pBuff + (unsigned long )uiIndex, (size_t )uiBytesToCopy); uiMemoryLoc = uiMemoryLoc + uiBytesToCopy; uiEepromSize = uiEepromSize - uiBytesToCopy; uiCalStartAddr = uiCalStartAddr + uiBytesToCopy; uiIndex = uiBytesToCopy / 4U + uiIndex; if (4096U < uiEepromSize) { uiBytesToCopy = 4096U; } else { uiBytesToCopy = uiEepromSize; } ldv_47203: ; if (uiBytesToCopy != 0U) { goto ldv_47202; } else { goto ldv_47201; } ldv_47201: value = 3199057581U; wrmalt(Adapter, 3215982596U, & value, 4UL); value = 3199057581U; wrmalt(Adapter, 3215982592U, & value, 4UL); kfree((void const *)pBuff); return (Status); } } INT PropagateCalParamsFromFlashToMemory(struct bcm_mini_adapter *Adapter ) { PCHAR pBuff ; PCHAR pPtr ; unsigned int uiEepromSize ; unsigned int uiBytesToCopy ; unsigned int uiCalStartAddr ; unsigned int uiMemoryLoc ; unsigned int value ; int Status ; INT tmp ; __u32 tmp___0 ; void *tmp___1 ; INT tmp___2 ; { uiEepromSize = 0U; uiBytesToCopy = 0U; uiCalStartAddr = 512U; uiMemoryLoc = 3215982600U; Status = 0; value = 3199057581U; wrmalt(Adapter, 3215982596U, & value, 4UL); value = 3199057581U; wrmalt(Adapter, 3215982592U, & value, 4UL); tmp = BeceemNVMRead(Adapter, & uiEepromSize, 524U, 4U); if (tmp != 0) { return (-1); } else { } tmp___0 = __fswab32(uiEepromSize); uiEepromSize = tmp___0; uiEepromSize = uiEepromSize >> 16; uiEepromSize = uiEepromSize - 512U; if (uiEepromSize > 1048576U) { return (-1); } else { } tmp___1 = kmalloc((size_t )uiEepromSize, 208U); pBuff = (PCHAR )tmp___1; if ((unsigned long )pBuff == (unsigned long )((PCHAR )0)) { return (-12); } else { } tmp___2 = BeceemNVMRead(Adapter, (unsigned int *)pBuff, uiCalStartAddr, uiEepromSize); if (tmp___2 != 0) { kfree((void const *)pBuff); return (-1); } else { } pPtr = pBuff; if (4096U < uiEepromSize) { uiBytesToCopy = 4096U; } else { uiBytesToCopy = uiEepromSize; } goto ldv_47218; ldv_47217: Status = wrm(Adapter, uiMemoryLoc, pPtr, (size_t )uiBytesToCopy); if (Status != 0) { printk("\016%s:wrm failed with status :%d", "PropagateCalParamsFromFlashToMemory", Status); goto ldv_47216; } else { } pPtr = pPtr + (unsigned long )uiBytesToCopy; uiEepromSize = uiEepromSize - uiBytesToCopy; uiMemoryLoc = uiMemoryLoc + uiBytesToCopy; if (4096U < uiEepromSize) { uiBytesToCopy = 4096U; } else { uiBytesToCopy = uiEepromSize; } ldv_47218: ; if (uiBytesToCopy != 0U) { goto ldv_47217; } else { goto ldv_47216; } ldv_47216: kfree((void const *)pBuff); return (Status); } } static int BeceemEEPROMReadBackandVerify(struct bcm_mini_adapter *Adapter , PUINT pBuffer , unsigned int uiOffset , unsigned int uiNumBytes ) { unsigned int uiRdbk ; unsigned int uiIndex ; unsigned int uiData ; unsigned int auiData[4U] ; unsigned long __ms ; unsigned long tmp ; int tmp___0 ; int tmp___1 ; unsigned long __ms___0 ; unsigned long tmp___2 ; size_t __len ; void *__ret ; int tmp___3 ; { uiRdbk = 0U; uiIndex = 0U; uiData = 0U; auiData[0] = 0U; auiData[1] = 0U; auiData[2] = 0U; auiData[3] = 0U; goto ldv_47241; ldv_47240: ; if ((int )((signed char )Adapter->device_removed) != 0) { return (-1); } else { } if (uiNumBytes > 15U) { BeceemEEPROMBulkRead(Adapter, (unsigned int *)(& auiData), uiOffset, 16U); tmp___1 = memcmp((void const *)pBuffer + (unsigned long )uiIndex, (void const *)(& auiData), 16UL); if (tmp___1 != 0) { BeceemEEPROMBulkWrite(Adapter, (unsigned char *)pBuffer + (unsigned long )uiIndex, uiOffset, 16U, 0); if (1) { __const_udelay(12885000UL); } else { __ms = 3UL; goto ldv_47231; ldv_47230: __const_udelay(4295000UL); ldv_47231: tmp = __ms; __ms = __ms - 1UL; if (tmp != 0UL) { goto ldv_47230; } else { goto ldv_47232; } ldv_47232: ; } BeceemEEPROMBulkRead(Adapter, (unsigned int *)(& auiData), uiOffset, 16U); tmp___0 = memcmp((void const *)pBuffer + (unsigned long )uiIndex, (void const *)(& auiData), 16UL); if (tmp___0 != 0) { return (-1); } else { } } else { } uiOffset = uiOffset + 16U; uiNumBytes = uiNumBytes - 16U; uiIndex = uiIndex + 4U; } else if (uiNumBytes > 3U) { BeceemEEPROMBulkRead(Adapter, & uiData, uiOffset, 4U); if (*(pBuffer + (unsigned long )uiIndex) != uiData) { BeceemEEPROMBulkWrite(Adapter, (unsigned char *)pBuffer + (unsigned long )uiIndex, uiOffset, 4U, 0); if (1) { __const_udelay(12885000UL); } else { __ms___0 = 3UL; goto ldv_47235; ldv_47234: __const_udelay(4295000UL); ldv_47235: tmp___2 = __ms___0; __ms___0 = __ms___0 - 1UL; if (tmp___2 != 0UL) { goto ldv_47234; } else { goto ldv_47236; } ldv_47236: ; } BeceemEEPROMBulkRead(Adapter, & uiData, uiOffset, 4U); if (*(pBuffer + (unsigned long )uiIndex) != uiData) { return (-1); } else { } } else { } uiOffset = uiOffset + 4U; uiNumBytes = uiNumBytes - 4U; uiIndex = uiIndex + 1U; } else { uiData = 0U; __len = (size_t )uiNumBytes; __ret = memcpy((void *)(& uiData), (void const *)pBuffer + (unsigned long )uiIndex * 4UL, __len); BeceemEEPROMBulkRead(Adapter, & uiRdbk, uiOffset, 4U); tmp___3 = memcmp((void const *)(& uiData), (void const *)(& uiRdbk), (size_t )uiNumBytes); if (tmp___3 != 0) { return (-1); } else { } uiNumBytes = 0U; } ldv_47241: ; if (uiNumBytes != 0U) { goto ldv_47240; } else { goto ldv_47242; } ldv_47242: ; return (0); } } static VOID BcmSwapWord(unsigned int *ptr1 ) { unsigned int tempval ; char *ptr2 ; char *ptr ; { tempval = *ptr1; ptr2 = (char *)(& tempval); ptr = (char *)ptr1; *ptr = *(ptr2 + 3UL); *(ptr + 1UL) = *(ptr2 + 2UL); *(ptr + 2UL) = *(ptr2 + 1UL); *(ptr + 3UL) = *ptr2; return; } } static int BeceemEEPROMWritePage(struct bcm_mini_adapter *Adapter , unsigned int *uiData , unsigned int uiOffset ) { unsigned int uiRetries ; unsigned int uiStatus ; UCHAR uiEpromStatus ; unsigned int value ; { uiRetries = 5120U; uiStatus = 0U; uiEpromStatus = 0U; value = 0U; value = 7U; wrmalt(Adapter, 251670604U, & value, 4UL); value = 0U; wrmalt(Adapter, 251670604U, & value, 4UL); value = 28720U; wrmalt(Adapter, 251670532U, & value, 4UL); value = 100663296U; wrmalt(Adapter, 251670552U, & value, 4UL); value = *uiData; BcmSwapWord(& value); wrm(Adapter, 251670556U, (PCHAR )(& value), 4UL); value = *(uiData + 1UL); BcmSwapWord(& value); wrm(Adapter, 251670556U, (PCHAR )(& value), 4UL); value = *(uiData + 2UL); BcmSwapWord(& value); wrm(Adapter, 251670556U, (PCHAR )(& value), 4UL); value = *(uiData + 3UL); BcmSwapWord(& value); wrm(Adapter, 251670556U, (PCHAR )(& value), 4UL); value = uiOffset | 4194304000U; wrmalt(Adapter, 251670552U, & value, 4UL); uiStatus = 0U; rdmalt(Adapter, 251670532U, & uiStatus, 4UL); goto ldv_47260; ldv_47259: uiRetries = uiRetries - 1U; if (uiRetries == 0U) { printk("\016%s:0x0f003004 = %x, %d retries failed.\n", "BeceemEEPROMWritePage", uiStatus, 5120); return (-1); } else { } if ((uiRetries & 63U) == 0U) { __const_udelay(4295000UL); } else { } uiStatus = 0U; rdmalt(Adapter, 251670532U, & uiStatus, 4UL); if ((int )((signed char )Adapter->device_removed) == 1) { printk("\016%s:Modem got removed hence exiting from loop....", "BeceemEEPROMWritePage"); return (-19); } else { } ldv_47260: ; if ((uiStatus & 4096U) == 0U) { goto ldv_47259; } else { goto ldv_47261; } ldv_47261: ; if (uiRetries != 0U) { value = uiStatus & 28672U; wrmalt(Adapter, 251670532U, & value, 4UL); } else { } uiRetries = 5120U; uiEpromStatus = 0U; goto ldv_47263; ldv_47262: uiEpromStatus = ReadEEPROMStatusRegister(Adapter); if ((int )((signed char )Adapter->device_removed) == 1) { printk("\016%s:Modem has got removed hence exiting from loop...", "BeceemEEPROMWritePage"); return (-19); } else { } if (((unsigned int )uiEpromStatus & 1U) == 0U) { printk("\016%s:EEPROM status register = %x tries = %d\n", "BeceemEEPROMWritePage", (int )uiEpromStatus, 5120U - uiRetries); return (0); } else { } uiRetries = uiRetries - 1U; if (uiRetries == 0U) { printk("\016%s:0x0f003004 = %x, for EEPROM status read %d retries failed.\n", "BeceemEEPROMWritePage", (int )uiEpromStatus, 5120); return (-1); } else { } uiEpromStatus = 0U; if ((uiRetries & 63U) == 0U) { __const_udelay(4295000UL); } else { } ldv_47263: ; if (uiRetries != 0U) { goto ldv_47262; } else { goto ldv_47264; } ldv_47264: ; return (0); } } INT BeceemEEPROMBulkWrite(struct bcm_mini_adapter *Adapter , PUCHAR pBuffer , unsigned int uiOffset , unsigned int uiNumBytes , BOOLEAN bVerify ) { unsigned int uiBytesToCopy ; unsigned int uiData[4U] ; unsigned int uiIndex ; unsigned int uiTempOffset ; unsigned int uiExtraBytes ; size_t __len ; void *__ret ; int tmp ; size_t __len___0 ; void *__ret___0 ; int tmp___0 ; int tmp___1 ; size_t __len___1 ; void *__ret___1 ; int tmp___2 ; { uiBytesToCopy = uiNumBytes; uiData[0] = 0U; uiData[1] = 0U; uiData[2] = 0U; uiData[3] = 0U; uiIndex = 0U; uiTempOffset = 0U; uiExtraBytes = 0U; if ((uiOffset & 15U) != 0U && uiBytesToCopy != 0U) { uiTempOffset = uiOffset & 4294967280U; uiExtraBytes = uiOffset - uiTempOffset; BeceemEEPROMBulkRead(Adapter, (unsigned int *)(& uiData), uiTempOffset, 16U); if (16U - uiExtraBytes <= uiBytesToCopy) { __len = (size_t )(16U - uiExtraBytes); __ret = memcpy((void *)(& uiData) + (unsigned long )uiExtraBytes, (void const *)pBuffer, __len); tmp = BeceemEEPROMWritePage(Adapter, (unsigned int *)(& uiData), uiTempOffset); if (tmp == -1) { return (-1); } else { } uiBytesToCopy = (uiExtraBytes + uiBytesToCopy) - 16U; uiIndex = (uiIndex - uiExtraBytes) + 16U; uiOffset = (uiOffset - uiExtraBytes) + 16U; } else { __len___0 = (size_t )uiBytesToCopy; __ret___0 = memcpy((void *)(& uiData) + (unsigned long )uiExtraBytes, (void const *)pBuffer, __len___0); tmp___0 = BeceemEEPROMWritePage(Adapter, (unsigned int *)(& uiData), uiTempOffset); if (tmp___0 == -1) { return (-1); } else { } uiIndex = uiIndex + uiBytesToCopy; uiOffset = uiOffset + uiBytesToCopy; uiBytesToCopy = 0U; } } else { } goto ldv_47287; ldv_47286: ; if ((int )((signed char )Adapter->device_removed) != 0) { return (-1); } else { } if (uiBytesToCopy > 15U) { tmp___1 = BeceemEEPROMWritePage(Adapter, (unsigned int *)pBuffer + (unsigned long )uiIndex, uiOffset); if (tmp___1 == -1) { return (-1); } else { } uiIndex = uiIndex + 16U; uiOffset = uiOffset + 16U; uiBytesToCopy = uiBytesToCopy - 16U; } else { BeceemEEPROMBulkRead(Adapter, (unsigned int *)(& uiData), uiOffset, 16U); __len___1 = (size_t )uiBytesToCopy; __ret___1 = memcpy((void *)(& uiData), (void const *)pBuffer + (unsigned long )uiIndex, __len___1); tmp___2 = BeceemEEPROMWritePage(Adapter, (unsigned int *)(& uiData), uiOffset); if (tmp___2 == -1) { return (-1); } else { } uiBytesToCopy = 0U; } ldv_47287: ; if (uiBytesToCopy != 0U) { goto ldv_47286; } else { goto ldv_47288; } ldv_47288: ; return (0); } } INT BeceemNVMRead(struct bcm_mini_adapter *Adapter , PUINT pBuffer , unsigned int uiOffset , unsigned int uiNumBytes ) { int Status ; unsigned int uiTemp ; unsigned int value ; INT tmp ; int tmp___0 ; { Status = 0; uiTemp = 0U; if ((unsigned int )Adapter->eNVMType == 2U) { if ((int )((signed char )Adapter->bFlashRawRead) == 0) { tmp___0 = IsSectionExistInVendorInfo(Adapter, Adapter->eActiveDSD); if (tmp___0 != 0) { tmp = vendorextnReadSection((PVOID )Adapter, (unsigned char *)pBuffer, Adapter->eActiveDSD, uiOffset, uiNumBytes); return (tmp); } else { } uiOffset = Adapter->ulFlashCalStart + uiOffset; } else { } rdmalt(Adapter, 251661440U, & uiTemp, 4UL); value = 0U; wrmalt(Adapter, 251661440U, & value, 4UL); Status = BeceemFlashBulkRead(Adapter, pBuffer, uiOffset, uiNumBytes); wrmalt(Adapter, 251661440U, & uiTemp, 4UL); } else if ((unsigned int )Adapter->eNVMType == 1U) { Status = BeceemEEPROMBulkRead(Adapter, pBuffer, uiOffset, uiNumBytes); } else { Status = -1; } return (Status); } } INT BeceemNVMWrite(struct bcm_mini_adapter *Adapter , PUINT pBuffer , unsigned int uiOffset , unsigned int uiNumBytes , BOOLEAN bVerify ) { int Status ; unsigned int uiTemp ; unsigned int uiMemoryLoc ; unsigned int uiIndex ; unsigned int value ; unsigned int uiFlashOffset ; int tmp ; ULONG ulBytesTobeSkipped ; PUCHAR pcBuffer ; { Status = 0; uiTemp = 0U; uiMemoryLoc = 3215982600U; uiIndex = 0U; uiFlashOffset = 0U; if ((unsigned int )Adapter->eNVMType == 2U) { tmp = IsSectionExistInVendorInfo(Adapter, Adapter->eActiveDSD); if (tmp != 0) { Status = vendorextnWriteSection((PVOID )Adapter, (unsigned char *)pBuffer, Adapter->eActiveDSD, uiOffset, uiNumBytes, (int )bVerify); } else { uiFlashOffset = Adapter->ulFlashCalStart + uiOffset; rdmalt(Adapter, 251661440U, & uiTemp, 4UL); value = 0U; wrmalt(Adapter, 251661440U, & value, 4UL); if ((int )((signed char )Adapter->bStatusWrite) == 1) { Status = BeceemFlashBulkWriteStatus(Adapter, pBuffer, uiFlashOffset, uiNumBytes, (int )bVerify); } else { Status = BeceemFlashBulkWrite(Adapter, pBuffer, uiFlashOffset, uiNumBytes, (int )bVerify); } } if (uiOffset > 511U) { uiMemoryLoc = (uiOffset + uiMemoryLoc) - 512U; goto ldv_47313; ldv_47312: ; if (uiNumBytes > 4096U) { wrm(Adapter, uiMemoryLoc + uiIndex, (char *)pBuffer + (unsigned long )(uiIndex / 4U), 4096UL); uiNumBytes = uiNumBytes - 4096U; uiIndex = uiIndex + 4096U; } else { wrm(Adapter, uiMemoryLoc + uiIndex, (char *)pBuffer + (unsigned long )(uiIndex / 4U), (size_t )uiNumBytes); uiNumBytes = 0U; goto ldv_47311; } ldv_47313: ; if (uiNumBytes != 0U) { goto ldv_47312; } else { goto ldv_47311; } ldv_47311: ; } else if (uiOffset + uiNumBytes > 512U) { ulBytesTobeSkipped = 0UL; pcBuffer = (unsigned char *)pBuffer; uiNumBytes = (uiOffset + uiNumBytes) - 512U; ulBytesTobeSkipped = (ULONG )(512U - uiOffset) + ulBytesTobeSkipped; uiOffset = 512U; goto ldv_47318; ldv_47317: ; if (uiNumBytes > 4096U) { wrm(Adapter, uiMemoryLoc + uiIndex, (char *)(pcBuffer + ((ULONG )uiIndex + ulBytesTobeSkipped)), 4096UL); uiNumBytes = uiNumBytes - 4096U; uiIndex = uiIndex + 4096U; } else { wrm(Adapter, uiMemoryLoc + uiIndex, (char *)(pcBuffer + ((ULONG )uiIndex + ulBytesTobeSkipped)), (size_t )uiNumBytes); uiNumBytes = 0U; goto ldv_47316; } ldv_47318: ; if (uiNumBytes != 0U) { goto ldv_47317; } else { goto ldv_47316; } ldv_47316: ; } else { } wrmalt(Adapter, 251661440U, & uiTemp, 4UL); } else if ((unsigned int )Adapter->eNVMType == 1U) { Status = BeceemEEPROMBulkWrite(Adapter, (unsigned char *)pBuffer, uiOffset, uiNumBytes, (int )bVerify); if ((int )((signed char )bVerify) != 0) { Status = BeceemEEPROMReadBackandVerify(Adapter, pBuffer, uiOffset, uiNumBytes); } else { } } else { Status = -1; } return (Status); } } INT BcmUpdateSectorSize(struct bcm_mini_adapter *Adapter , unsigned int uiSectorSize ) { int Status ; FLASH_CS_INFO sFlashCsInfo ; unsigned int uiTemp ; unsigned int uiSectorSig ; unsigned int uiCurrentSectorSize ; unsigned int value ; __u32 tmp ; __u32 tmp___0 ; __u32 tmp___1 ; { Status = -1; sFlashCsInfo.MagicNumber = 0U; sFlashCsInfo.FlashLayoutVersion = 0U; sFlashCsInfo.ISOImageVersion = 0U; sFlashCsInfo.SCSIFirmwareVersion = 0U; sFlashCsInfo.OffsetFromZeroForPart1ISOImage = 0U; sFlashCsInfo.OffsetFromZeroForScsiFirmware = 0U; sFlashCsInfo.SizeOfScsiFirmware = 0U; sFlashCsInfo.OffsetFromZeroForPart2ISOImage = 0U; sFlashCsInfo.OffsetFromZeroForCalibrationStart = 0U; sFlashCsInfo.OffsetFromZeroForCalibrationEnd = 0U; sFlashCsInfo.OffsetFromZeroForVSAStart = 0U; sFlashCsInfo.OffsetFromZeroForVSAEnd = 0U; sFlashCsInfo.OffsetFromZeroForControlSectionStart = 0U; sFlashCsInfo.OffsetFromZeroForControlSectionData = 0U; sFlashCsInfo.CDLessInactivityTimeout = 0U; sFlashCsInfo.NewImageSignature = 0U; sFlashCsInfo.FlashSectorSizeSig = 0U; sFlashCsInfo.FlashSectorSize = 0U; sFlashCsInfo.FlashWriteSupportSize = 0U; sFlashCsInfo.TotalFlashSize = 0U; sFlashCsInfo.FlashBaseAddr = 0U; sFlashCsInfo.FlashPartMaxSize = 0U; sFlashCsInfo.IsCDLessDeviceBootSig = 0U; sFlashCsInfo.MassStorageTimeout = 0U; uiTemp = 0U; uiSectorSig = 0U; uiCurrentSectorSize = 0U; rdmalt(Adapter, 251661440U, & uiTemp, 4UL); value = 0U; wrmalt(Adapter, 251661440U, & value, 4UL); BeceemFlashBulkRead(Adapter, (unsigned int *)(& sFlashCsInfo), (unsigned int )Adapter->ulFlashControlSectionStart, 96U); tmp = __fswab32(sFlashCsInfo.FlashSectorSizeSig); uiSectorSig = tmp; tmp___0 = __fswab32(sFlashCsInfo.FlashSectorSize); uiCurrentSectorSize = tmp___0; if (uiSectorSig == 3405691582U) { if (uiCurrentSectorSize <= 524288U && uiCurrentSectorSize > 1023U) { if (uiSectorSize == uiCurrentSectorSize) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:Provided sector size is same as programmed in Flash", "BcmUpdateSectorSize"); } else { } Status = 0; goto Restore; } else { } } else { } } else { } if (uiSectorSize <= 524288U && uiSectorSize > 1023U) { tmp___1 = __fswab32(uiSectorSize); sFlashCsInfo.FlashSectorSize = tmp___1; sFlashCsInfo.FlashSectorSizeSig = 3199925962U; Status = BeceemFlashBulkWrite(Adapter, (unsigned int *)(& sFlashCsInfo), (unsigned int )Adapter->ulFlashControlSectionStart, 96U, 1); } else { } Restore: wrmalt(Adapter, 251661440U, & uiTemp, 4UL); return (Status); } } static unsigned int BcmGetFlashSectorSize(struct bcm_mini_adapter *Adapter , unsigned int FlashSectorSizeSig , unsigned int FlashSectorSize ) { unsigned int uiSectorSize ; unsigned int uiSectorSig ; { uiSectorSize = 0U; uiSectorSig = 0U; if ((int )((signed char )Adapter->bSectorSizeOverride) != 0 && (Adapter->uiSectorSizeInCFG <= 524288U && Adapter->uiSectorSizeInCFG > 1023U)) { Adapter->uiSectorSize = Adapter->uiSectorSizeInCFG; } else { uiSectorSig = FlashSectorSizeSig; if (uiSectorSig == 3405691582U) { uiSectorSize = FlashSectorSize; if (uiSectorSize <= 524288U && uiSectorSize > 1023U) { Adapter->uiSectorSize = uiSectorSize; } else if (Adapter->uiSectorSizeInCFG <= 524288U && Adapter->uiSectorSizeInCFG > 1023U) { Adapter->uiSectorSize = Adapter->uiSectorSizeInCFG; } else { Adapter->uiSectorSize = 65536U; } } else if (Adapter->uiSectorSizeInCFG <= 524288U && Adapter->uiSectorSizeInCFG > 1023U) { Adapter->uiSectorSize = Adapter->uiSectorSizeInCFG; } else { Adapter->uiSectorSize = 65536U; } } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:Sector size :%x\n", "BcmGetFlashSectorSize", Adapter->uiSectorSize); } else { } return (Adapter->uiSectorSize); } } static int BcmInitEEPROMQueues(struct bcm_mini_adapter *Adapter ) { unsigned int value ; UCHAR tmp___1 ; { value = 0U; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:Fixing reset value on 0x0f003004 register\n", "BcmInitEEPROMQueues"); } else { } value = 32U; wrmalt(Adapter, 251670532U, & value, 4UL); if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s: Flushing the queues\n", "BcmInitEEPROMQueues"); } else { } value = 15U; wrmalt(Adapter, 251670604U, & value, 4UL); value = 0U; wrmalt(Adapter, 251670604U, & value, 4UL); if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { tmp___1 = ReadEEPROMStatusRegister(Adapter); printk("\017%s:EEPROM Status register value = %x\n", "BcmInitEEPROMQueues", (int )tmp___1); } else { } return (0); } } INT BcmInitNVM(struct bcm_mini_adapter *ps_adapter ) { { BcmValidateNvmType(ps_adapter); BcmInitEEPROMQueues(ps_adapter); if ((unsigned int )ps_adapter->eNVMType == 0U) { ps_adapter->eNVMType = BcmGetNvmType(ps_adapter); if ((unsigned int )ps_adapter->eNVMType == 3U) { printk("\016%s:NVM Type is unknown!!\n", "BcmInitNVM"); } else { } } else if ((unsigned int )ps_adapter->eNVMType == 2U) { BcmGetFlashCSInfo(ps_adapter); } else { } BcmGetNvmSize(ps_adapter); return (0); } } static int BcmGetNvmSize(struct bcm_mini_adapter *Adapter ) { { if ((unsigned int )Adapter->eNVMType == 1U) { Adapter->uiNVMDSDSize = BcmGetEEPROMSize(Adapter); } else if ((unsigned int )Adapter->eNVMType == 2U) { Adapter->uiNVMDSDSize = BcmGetFlashSize(Adapter); } else { } return (0); } } static VOID BcmValidateNvmType(struct bcm_mini_adapter *Adapter ) { { if ((unsigned int )Adapter->eNVMType == 2U && Adapter->chip_id <= 3201184511UL) { Adapter->eNVMType = 0; } else { } return; } } static ULONG BcmReadFlashRDID(struct bcm_mini_adapter *Adapter ) { ULONG ulRDID ; unsigned int value ; { ulRDID = 0UL; value = 2667577344U; wrmalt(Adapter, 2936025152U, & value, 4UL); __const_udelay(42950UL); rdmalt(Adapter, 2936025160U, (unsigned int *)(& ulRDID), 8UL); return (ulRDID >> 8); } } INT BcmAllocFlashCSStructure(struct bcm_mini_adapter *psAdapter ) { void *tmp ; void *tmp___0 ; void *tmp___1 ; { if ((unsigned long )psAdapter == (unsigned long )((struct bcm_mini_adapter *)0)) { printk("\016%s:Adapter structure point is NULL", "BcmAllocFlashCSStructure"); return (-22); } else { } tmp = kzalloc(96UL, 208U); psAdapter->psFlashCSInfo = (struct _FLASH_CS_INFO *)tmp; if ((unsigned long )psAdapter->psFlashCSInfo == (unsigned long )((PFLASH_CS_INFO )0)) { printk("\016%s:Can\'t Allocate memory for Flash 1.x", "BcmAllocFlashCSStructure"); return (-12); } else { } tmp___0 = kzalloc(436UL, 208U); psAdapter->psFlash2xCSInfo = (struct _FLASH_2X_CS_INFO *)tmp___0; if ((unsigned long )psAdapter->psFlash2xCSInfo == (unsigned long )((PFLASH2X_CS_INFO )0)) { printk("\016%s:Can\'t Allocate memory for Flash 2.x", "BcmAllocFlashCSStructure"); kfree((void const *)psAdapter->psFlashCSInfo); return (-12); } else { } tmp___1 = kzalloc(1204UL, 208U); psAdapter->psFlash2xVendorInfo = (struct _FLASH2X_VENDORSPECIFIC_INFO *)tmp___1; if ((unsigned long )psAdapter->psFlash2xVendorInfo == (unsigned long )((PFLASH2X_VENDORSPECIFIC_INFO )0)) { printk("\016%s:Can\'t Allocate Vendor Info Memory for Flash 2.x", "BcmAllocFlashCSStructure"); kfree((void const *)psAdapter->psFlashCSInfo); kfree((void const *)psAdapter->psFlash2xCSInfo); return (-12); } else { } return (0); } } INT BcmDeAllocFlashCSStructure(struct bcm_mini_adapter *psAdapter ) { { if ((unsigned long )psAdapter == (unsigned long )((struct bcm_mini_adapter *)0)) { printk("\016%s:Adapter structure point is NULL", "BcmDeAllocFlashCSStructure"); return (-22); } else { } kfree((void const *)psAdapter->psFlashCSInfo); kfree((void const *)psAdapter->psFlash2xCSInfo); kfree((void const *)psAdapter->psFlash2xVendorInfo); return (0); } } static int BcmDumpFlash2XCSStructure(PFLASH2X_CS_INFO psFlash2xCSInfo , struct bcm_mini_adapter *Adapter ) { unsigned int Index ; { Index = 0U; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:**********************FLASH2X CS Structure *******************", "BcmDumpFlash2XCSStructure"); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:Signature is :%x", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->MagicNumber); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:Flash Major Version :%d", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->FlashLayoutVersion & 65535U); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:Flash Minor Version :%d", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->FlashLayoutVersion >> 16); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s: ISOImageMajorVersion:0x%x", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->ISOImageVersion); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:SCSIFirmwareMajorVersion :0x%x", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->SCSIFirmwareVersion); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:OffsetFromZeroForPart1ISOImage :0x%x", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->OffsetFromZeroForPart1ISOImage); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:OffsetFromZeroForScsiFirmware :0x%x", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->OffsetFromZeroForScsiFirmware); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:SizeOfScsiFirmware :0x%x", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->SizeOfScsiFirmware); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:OffsetFromZeroForPart2ISOImage :0x%x", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->OffsetFromZeroForPart2ISOImage); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:OffsetFromZeroForDSDStart :0x%x", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->OffsetFromZeroForDSDStart); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:OffsetFromZeroForDSDEnd :0x%x", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->OffsetFromZeroForDSDEnd); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:OffsetFromZeroForVSAStart :0x%x", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->OffsetFromZeroForVSAStart); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:OffsetFromZeroForVSAEnd :0x%x", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->OffsetFromZeroForVSAEnd); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:OffsetFromZeroForControlSectionStart :0x%x", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->OffsetFromZeroForControlSectionStart); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:OffsetFromZeroForControlSectionData :0x%x", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->OffsetFromZeroForControlSectionData); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:CDLessInactivityTimeout :0x%x", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->CDLessInactivityTimeout); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:NewImageSignature :0x%x", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->NewImageSignature); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:FlashSectorSizeSig :0x%x", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->FlashSectorSizeSig); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:FlashSectorSize :0x%x", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->FlashSectorSize); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:FlashWriteSupportSize :0x%x", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->FlashWriteSupportSize); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:TotalFlashSize :0x%X", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->TotalFlashSize); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:FlashBaseAddr :0x%x", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->FlashBaseAddr); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:FlashPartMaxSize :0x%x", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->FlashPartMaxSize); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:IsCDLessDeviceBootSig :0x%x", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->IsCDLessDeviceBootSig); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:MassStorageTimeout :0x%x", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->MassStorageTimeout); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:OffsetISOImage1Part1Start :0x%x", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->OffsetISOImage1Part1Start); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:OffsetISOImage1Part1End :0x%x", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->OffsetISOImage1Part1End); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:OffsetISOImage1Part2Start :0x%x", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->OffsetISOImage1Part2Start); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:OffsetISOImage1Part2End :0x%x", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->OffsetISOImage1Part2End); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:OffsetISOImage1Part3Start :0x%x", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->OffsetISOImage1Part3Start); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:OffsetISOImage1Part3End :0x%x", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->OffsetISOImage1Part3End); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:OffsetISOImage2Part1Start :0x%x", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->OffsetISOImage2Part1Start); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:OffsetISOImage2Part1End\t:0x%x", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->OffsetISOImage2Part1End); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:OffsetISOImage2Part2Start :0x%x", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->OffsetISOImage2Part2Start); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:OffsetISOImage2Part2End :0x%x", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->OffsetISOImage2Part2End); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:OffsetISOImage2Part3Start :0x%x", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->OffsetISOImage2Part3Start); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:OffsetISOImage2Part3End :0x%x", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->OffsetISOImage2Part3End); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:OffsetFromDSDStartForDSDHeader :0x%x", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->OffsetFromDSDStartForDSDHeader); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:OffsetFromZeroForDSD1Start :0x%x", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->OffsetFromZeroForDSD1Start); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:OffsetFromZeroForDSD1End :0x%x", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->OffsetFromZeroForDSD1End); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:OffsetFromZeroForDSD2Start :0x%x", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->OffsetFromZeroForDSD2Start); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:OffsetFromZeroForDSD2End :0x%x", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->OffsetFromZeroForDSD2End); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:OffsetFromZeroForVSA1Start :0x%x", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->OffsetFromZeroForVSA1Start); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:OffsetFromZeroForVSA1End :0x%x", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->OffsetFromZeroForVSA1End); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:OffsetFromZeroForVSA2Start :0x%x", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->OffsetFromZeroForVSA2Start); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:OffsetFromZeroForVSA2End :0x%x", "BcmDumpFlash2XCSStructure", psFlash2xCSInfo->OffsetFromZeroForVSA2End); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:Sector Access Bit Map is Defined as :", "BcmDumpFlash2XCSStructure"); } else { } Index = 0U; goto ldv_47374; ldv_47373: ; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:SectorAccessBitMap[%d] :0x%x", "BcmDumpFlash2XCSStructure", Index, psFlash2xCSInfo->SectorAccessBitMap[Index]); } else { } Index = Index + 1U; ldv_47374: ; if (Index <= 63U) { goto ldv_47373; } else { goto ldv_47375; } ldv_47375: ; return (0); } } static int ConvertEndianOf2XCSStructure(PFLASH2X_CS_INFO psFlash2xCSInfo ) { unsigned int Index ; __u32 tmp ; __u32 tmp___0 ; __u32 tmp___1 ; __u32 tmp___2 ; __u32 tmp___3 ; __u32 tmp___4 ; __u32 tmp___5 ; __u32 tmp___6 ; __u32 tmp___7 ; __u32 tmp___8 ; __u32 tmp___9 ; __u32 tmp___10 ; __u32 tmp___11 ; __u32 tmp___12 ; __u32 tmp___13 ; __u32 tmp___14 ; __u32 tmp___15 ; __u32 tmp___16 ; __u32 tmp___17 ; __u32 tmp___18 ; __u32 tmp___19 ; __u32 tmp___20 ; __u32 tmp___21 ; __u32 tmp___22 ; __u32 tmp___23 ; __u32 tmp___24 ; __u32 tmp___25 ; __u32 tmp___26 ; __u32 tmp___27 ; __u32 tmp___28 ; __u32 tmp___29 ; __u32 tmp___30 ; __u32 tmp___31 ; __u32 tmp___32 ; __u32 tmp___33 ; __u32 tmp___34 ; __u32 tmp___35 ; __u32 tmp___36 ; __u32 tmp___37 ; __u32 tmp___38 ; __u32 tmp___39 ; __u32 tmp___40 ; __u32 tmp___41 ; __u32 tmp___42 ; __u32 tmp___43 ; __u32 tmp___44 ; { Index = 0U; tmp = __fswab32(psFlash2xCSInfo->MagicNumber); psFlash2xCSInfo->MagicNumber = tmp; tmp___0 = __fswab32(psFlash2xCSInfo->FlashLayoutVersion); psFlash2xCSInfo->FlashLayoutVersion = tmp___0; tmp___1 = __fswab32(psFlash2xCSInfo->ISOImageVersion); psFlash2xCSInfo->ISOImageVersion = tmp___1; tmp___2 = __fswab32(psFlash2xCSInfo->SCSIFirmwareVersion); psFlash2xCSInfo->SCSIFirmwareVersion = tmp___2; tmp___3 = __fswab32(psFlash2xCSInfo->OffsetFromZeroForPart1ISOImage); psFlash2xCSInfo->OffsetFromZeroForPart1ISOImage = tmp___3; tmp___4 = __fswab32(psFlash2xCSInfo->OffsetFromZeroForScsiFirmware); psFlash2xCSInfo->OffsetFromZeroForScsiFirmware = tmp___4; tmp___5 = __fswab32(psFlash2xCSInfo->SizeOfScsiFirmware); psFlash2xCSInfo->SizeOfScsiFirmware = tmp___5; tmp___6 = __fswab32(psFlash2xCSInfo->OffsetFromZeroForPart2ISOImage); psFlash2xCSInfo->OffsetFromZeroForPart2ISOImage = tmp___6; tmp___7 = __fswab32(psFlash2xCSInfo->OffsetFromZeroForDSDStart); psFlash2xCSInfo->OffsetFromZeroForDSDStart = tmp___7; tmp___8 = __fswab32(psFlash2xCSInfo->OffsetFromZeroForDSDEnd); psFlash2xCSInfo->OffsetFromZeroForDSDEnd = tmp___8; tmp___9 = __fswab32(psFlash2xCSInfo->OffsetFromZeroForVSAStart); psFlash2xCSInfo->OffsetFromZeroForVSAStart = tmp___9; tmp___10 = __fswab32(psFlash2xCSInfo->OffsetFromZeroForVSAEnd); psFlash2xCSInfo->OffsetFromZeroForVSAEnd = tmp___10; tmp___11 = __fswab32(psFlash2xCSInfo->OffsetFromZeroForControlSectionStart); psFlash2xCSInfo->OffsetFromZeroForControlSectionStart = tmp___11; tmp___12 = __fswab32(psFlash2xCSInfo->OffsetFromZeroForControlSectionData); psFlash2xCSInfo->OffsetFromZeroForControlSectionData = tmp___12; tmp___13 = __fswab32(psFlash2xCSInfo->CDLessInactivityTimeout); psFlash2xCSInfo->CDLessInactivityTimeout = tmp___13; tmp___14 = __fswab32(psFlash2xCSInfo->NewImageSignature); psFlash2xCSInfo->NewImageSignature = tmp___14; tmp___15 = __fswab32(psFlash2xCSInfo->FlashSectorSizeSig); psFlash2xCSInfo->FlashSectorSizeSig = tmp___15; tmp___16 = __fswab32(psFlash2xCSInfo->FlashSectorSize); psFlash2xCSInfo->FlashSectorSize = tmp___16; tmp___17 = __fswab32(psFlash2xCSInfo->FlashWriteSupportSize); psFlash2xCSInfo->FlashWriteSupportSize = tmp___17; tmp___18 = __fswab32(psFlash2xCSInfo->TotalFlashSize); psFlash2xCSInfo->TotalFlashSize = tmp___18; tmp___19 = __fswab32(psFlash2xCSInfo->FlashBaseAddr); psFlash2xCSInfo->FlashBaseAddr = tmp___19; tmp___20 = __fswab32(psFlash2xCSInfo->FlashPartMaxSize); psFlash2xCSInfo->FlashPartMaxSize = tmp___20; tmp___21 = __fswab32(psFlash2xCSInfo->IsCDLessDeviceBootSig); psFlash2xCSInfo->IsCDLessDeviceBootSig = tmp___21; tmp___22 = __fswab32(psFlash2xCSInfo->MassStorageTimeout); psFlash2xCSInfo->MassStorageTimeout = tmp___22; tmp___23 = __fswab32(psFlash2xCSInfo->OffsetISOImage1Part1Start); psFlash2xCSInfo->OffsetISOImage1Part1Start = tmp___23; tmp___24 = __fswab32(psFlash2xCSInfo->OffsetISOImage1Part1End); psFlash2xCSInfo->OffsetISOImage1Part1End = tmp___24; tmp___25 = __fswab32(psFlash2xCSInfo->OffsetISOImage1Part2Start); psFlash2xCSInfo->OffsetISOImage1Part2Start = tmp___25; tmp___26 = __fswab32(psFlash2xCSInfo->OffsetISOImage1Part2End); psFlash2xCSInfo->OffsetISOImage1Part2End = tmp___26; tmp___27 = __fswab32(psFlash2xCSInfo->OffsetISOImage1Part3Start); psFlash2xCSInfo->OffsetISOImage1Part3Start = tmp___27; tmp___28 = __fswab32(psFlash2xCSInfo->OffsetISOImage1Part3End); psFlash2xCSInfo->OffsetISOImage1Part3End = tmp___28; tmp___29 = __fswab32(psFlash2xCSInfo->OffsetISOImage2Part1Start); psFlash2xCSInfo->OffsetISOImage2Part1Start = tmp___29; tmp___30 = __fswab32(psFlash2xCSInfo->OffsetISOImage2Part1End); psFlash2xCSInfo->OffsetISOImage2Part1End = tmp___30; tmp___31 = __fswab32(psFlash2xCSInfo->OffsetISOImage2Part2Start); psFlash2xCSInfo->OffsetISOImage2Part2Start = tmp___31; tmp___32 = __fswab32(psFlash2xCSInfo->OffsetISOImage2Part2End); psFlash2xCSInfo->OffsetISOImage2Part2End = tmp___32; tmp___33 = __fswab32(psFlash2xCSInfo->OffsetISOImage2Part3Start); psFlash2xCSInfo->OffsetISOImage2Part3Start = tmp___33; tmp___34 = __fswab32(psFlash2xCSInfo->OffsetISOImage2Part3End); psFlash2xCSInfo->OffsetISOImage2Part3End = tmp___34; tmp___35 = __fswab32(psFlash2xCSInfo->OffsetFromDSDStartForDSDHeader); psFlash2xCSInfo->OffsetFromDSDStartForDSDHeader = tmp___35; tmp___36 = __fswab32(psFlash2xCSInfo->OffsetFromZeroForDSD1Start); psFlash2xCSInfo->OffsetFromZeroForDSD1Start = tmp___36; tmp___37 = __fswab32(psFlash2xCSInfo->OffsetFromZeroForDSD1End); psFlash2xCSInfo->OffsetFromZeroForDSD1End = tmp___37; tmp___38 = __fswab32(psFlash2xCSInfo->OffsetFromZeroForDSD2Start); psFlash2xCSInfo->OffsetFromZeroForDSD2Start = tmp___38; tmp___39 = __fswab32(psFlash2xCSInfo->OffsetFromZeroForDSD2End); psFlash2xCSInfo->OffsetFromZeroForDSD2End = tmp___39; tmp___40 = __fswab32(psFlash2xCSInfo->OffsetFromZeroForVSA1Start); psFlash2xCSInfo->OffsetFromZeroForVSA1Start = tmp___40; tmp___41 = __fswab32(psFlash2xCSInfo->OffsetFromZeroForVSA1End); psFlash2xCSInfo->OffsetFromZeroForVSA1End = tmp___41; tmp___42 = __fswab32(psFlash2xCSInfo->OffsetFromZeroForVSA2Start); psFlash2xCSInfo->OffsetFromZeroForVSA2Start = tmp___42; tmp___43 = __fswab32(psFlash2xCSInfo->OffsetFromZeroForVSA2End); psFlash2xCSInfo->OffsetFromZeroForVSA2End = tmp___43; Index = 0U; goto ldv_47381; ldv_47380: tmp___44 = __fswab32(psFlash2xCSInfo->SectorAccessBitMap[Index]); psFlash2xCSInfo->SectorAccessBitMap[Index] = tmp___44; Index = Index + 1U; ldv_47381: ; if (Index <= 63U) { goto ldv_47380; } else { goto ldv_47382; } ldv_47382: ; return (0); } } static int ConvertEndianOfCSStructure(PFLASH_CS_INFO psFlashCSInfo ) { __u32 tmp ; __u32 tmp___0 ; __u32 tmp___1 ; __u32 tmp___2 ; __u32 tmp___3 ; __u32 tmp___4 ; __u32 tmp___5 ; __u32 tmp___6 ; __u32 tmp___7 ; __u32 tmp___8 ; __u32 tmp___9 ; __u32 tmp___10 ; __u32 tmp___11 ; __u32 tmp___12 ; __u32 tmp___13 ; __u32 tmp___14 ; __u32 tmp___15 ; __u32 tmp___16 ; __u32 tmp___17 ; __u32 tmp___18 ; __u32 tmp___19 ; __u32 tmp___20 ; __u32 tmp___21 ; { tmp = __fswab32(psFlashCSInfo->MagicNumber); psFlashCSInfo->MagicNumber = tmp; tmp___0 = __fswab32(psFlashCSInfo->FlashLayoutVersion); psFlashCSInfo->FlashLayoutVersion = tmp___0; tmp___1 = __fswab32(psFlashCSInfo->ISOImageVersion); psFlashCSInfo->ISOImageVersion = tmp___1; psFlashCSInfo->SCSIFirmwareVersion = psFlashCSInfo->SCSIFirmwareVersion; tmp___2 = __fswab32(psFlashCSInfo->OffsetFromZeroForPart1ISOImage); psFlashCSInfo->OffsetFromZeroForPart1ISOImage = tmp___2; tmp___3 = __fswab32(psFlashCSInfo->OffsetFromZeroForScsiFirmware); psFlashCSInfo->OffsetFromZeroForScsiFirmware = tmp___3; tmp___4 = __fswab32(psFlashCSInfo->SizeOfScsiFirmware); psFlashCSInfo->SizeOfScsiFirmware = tmp___4; tmp___5 = __fswab32(psFlashCSInfo->OffsetFromZeroForPart2ISOImage); psFlashCSInfo->OffsetFromZeroForPart2ISOImage = tmp___5; tmp___6 = __fswab32(psFlashCSInfo->OffsetFromZeroForCalibrationStart); psFlashCSInfo->OffsetFromZeroForCalibrationStart = tmp___6; tmp___7 = __fswab32(psFlashCSInfo->OffsetFromZeroForCalibrationEnd); psFlashCSInfo->OffsetFromZeroForCalibrationEnd = tmp___7; tmp___8 = __fswab32(psFlashCSInfo->OffsetFromZeroForVSAStart); psFlashCSInfo->OffsetFromZeroForVSAStart = tmp___8; tmp___9 = __fswab32(psFlashCSInfo->OffsetFromZeroForVSAEnd); psFlashCSInfo->OffsetFromZeroForVSAEnd = tmp___9; tmp___10 = __fswab32(psFlashCSInfo->OffsetFromZeroForControlSectionStart); psFlashCSInfo->OffsetFromZeroForControlSectionStart = tmp___10; tmp___11 = __fswab32(psFlashCSInfo->OffsetFromZeroForControlSectionData); psFlashCSInfo->OffsetFromZeroForControlSectionData = tmp___11; tmp___12 = __fswab32(psFlashCSInfo->CDLessInactivityTimeout); psFlashCSInfo->CDLessInactivityTimeout = tmp___12; tmp___13 = __fswab32(psFlashCSInfo->NewImageSignature); psFlashCSInfo->NewImageSignature = tmp___13; tmp___14 = __fswab32(psFlashCSInfo->FlashSectorSizeSig); psFlashCSInfo->FlashSectorSizeSig = tmp___14; tmp___15 = __fswab32(psFlashCSInfo->FlashSectorSize); psFlashCSInfo->FlashSectorSize = tmp___15; tmp___16 = __fswab32(psFlashCSInfo->FlashWriteSupportSize); psFlashCSInfo->FlashWriteSupportSize = tmp___16; tmp___17 = __fswab32(psFlashCSInfo->TotalFlashSize); psFlashCSInfo->TotalFlashSize = tmp___17; tmp___18 = __fswab32(psFlashCSInfo->FlashBaseAddr); psFlashCSInfo->FlashBaseAddr = tmp___18; tmp___19 = __fswab32(psFlashCSInfo->FlashPartMaxSize); psFlashCSInfo->FlashPartMaxSize = tmp___19; tmp___20 = __fswab32(psFlashCSInfo->IsCDLessDeviceBootSig); psFlashCSInfo->IsCDLessDeviceBootSig = tmp___20; tmp___21 = __fswab32(psFlashCSInfo->MassStorageTimeout); psFlashCSInfo->MassStorageTimeout = tmp___21; return (0); } } static int IsSectionExistInVendorInfo(struct bcm_mini_adapter *Adapter , enum bcm_flash2x_section_val section ) { { return ((Adapter->uiVendorExtnFlag != 0U && (int )(Adapter->psFlash2xVendorInfo)->VendorSection[(unsigned int )section].AccessFlags & 1) && (Adapter->psFlash2xVendorInfo)->VendorSection[(unsigned int )section].OffsetFromZeroForSectionStart != 3149651421U); } } static VOID UpdateVendorInfo(struct bcm_mini_adapter *Adapter ) { B_UINT32 i ; unsigned int uiSizeSection ; INT tmp ; B_UINT32 tmp___0 ; B_UINT32 tmp___1 ; B_UINT32 tmp___2 ; B_UINT32 tmp___3 ; B_UINT32 tmp___4 ; B_UINT32 tmp___5 ; B_UINT32 tmp___6 ; B_UINT32 tmp___7 ; B_UINT32 tmp___8 ; B_UINT32 tmp___9 ; B_UINT32 tmp___10 ; B_UINT32 tmp___11 ; { i = 0U; uiSizeSection = 0U; Adapter->uiVendorExtnFlag = 0U; i = 0U; goto ldv_47396; ldv_47395: (Adapter->psFlash2xVendorInfo)->VendorSection[i].OffsetFromZeroForSectionStart = 3149651421U; i = i + 1U; ldv_47396: ; if (i <= 14U) { goto ldv_47395; } else { goto ldv_47397; } ldv_47397: tmp = vendorextnGetSectionInfo((PVOID )Adapter, Adapter->psFlash2xVendorInfo); if (tmp != 0) { return; } else { } i = 0U; goto ldv_47398; ldv_47407: ; if (((Adapter->psFlash2xVendorInfo)->VendorSection[i].AccessFlags & 1U) == 0U) { i = i + 1U; goto ldv_47398; } else { } Adapter->uiVendorExtnFlag = 1U; uiSizeSection = (Adapter->psFlash2xVendorInfo)->VendorSection[i].OffsetFromZeroForSectionEnd - (Adapter->psFlash2xVendorInfo)->VendorSection[i].OffsetFromZeroForSectionStart; switch (i) { case 3: ; if ((unsigned long )uiSizeSection >= (unsigned long )(Adapter->psFlash2xCSInfo)->OffsetFromDSDStartForDSDHeader + 1024UL && (Adapter->psFlash2xVendorInfo)->VendorSection[i].OffsetFromZeroForSectionStart != 3149651421U) { tmp___0 = 2863320268U; (Adapter->psFlash2xCSInfo)->OffsetFromZeroForDSDEnd = tmp___0; (Adapter->psFlash2xCSInfo)->OffsetFromZeroForDSDStart = tmp___0; } else { tmp___1 = 3149651421U; (Adapter->psFlash2xCSInfo)->OffsetFromZeroForDSDEnd = tmp___1; (Adapter->psFlash2xCSInfo)->OffsetFromZeroForDSDStart = tmp___1; } goto ldv_47400; case 4: ; if ((unsigned long )uiSizeSection >= (unsigned long )(Adapter->psFlash2xCSInfo)->OffsetFromDSDStartForDSDHeader + 1024UL && (Adapter->psFlash2xVendorInfo)->VendorSection[i].OffsetFromZeroForSectionStart != 3149651421U) { tmp___2 = 2863320268U; (Adapter->psFlash2xCSInfo)->OffsetFromZeroForDSD1End = tmp___2; (Adapter->psFlash2xCSInfo)->OffsetFromZeroForDSD1Start = tmp___2; } else { tmp___3 = 3149651421U; (Adapter->psFlash2xCSInfo)->OffsetFromZeroForDSD1End = tmp___3; (Adapter->psFlash2xCSInfo)->OffsetFromZeroForDSD1Start = tmp___3; } goto ldv_47400; case 5: ; if ((unsigned long )uiSizeSection >= (unsigned long )(Adapter->psFlash2xCSInfo)->OffsetFromDSDStartForDSDHeader + 1024UL && (Adapter->psFlash2xVendorInfo)->VendorSection[i].OffsetFromZeroForSectionStart != 3149651421U) { tmp___4 = 2863320268U; (Adapter->psFlash2xCSInfo)->OffsetFromZeroForDSD2End = tmp___4; (Adapter->psFlash2xCSInfo)->OffsetFromZeroForDSD2Start = tmp___4; } else { tmp___5 = 3149651421U; (Adapter->psFlash2xCSInfo)->OffsetFromZeroForDSD2End = tmp___5; (Adapter->psFlash2xCSInfo)->OffsetFromZeroForDSD2Start = tmp___5; } goto ldv_47400; case 6: ; if ((Adapter->psFlash2xVendorInfo)->VendorSection[i].OffsetFromZeroForSectionStart != 3149651421U) { tmp___6 = 2863320268U; (Adapter->psFlash2xCSInfo)->OffsetFromZeroForVSAEnd = tmp___6; (Adapter->psFlash2xCSInfo)->OffsetFromZeroForVSAStart = tmp___6; } else { tmp___7 = 3149651421U; (Adapter->psFlash2xCSInfo)->OffsetFromZeroForVSAEnd = tmp___7; (Adapter->psFlash2xCSInfo)->OffsetFromZeroForVSAStart = tmp___7; } goto ldv_47400; case 7: ; if ((Adapter->psFlash2xVendorInfo)->VendorSection[i].OffsetFromZeroForSectionStart != 3149651421U) { tmp___8 = 2863320268U; (Adapter->psFlash2xCSInfo)->OffsetFromZeroForVSA1End = tmp___8; (Adapter->psFlash2xCSInfo)->OffsetFromZeroForVSA1Start = tmp___8; } else { tmp___9 = 3149651421U; (Adapter->psFlash2xCSInfo)->OffsetFromZeroForVSA1End = tmp___9; (Adapter->psFlash2xCSInfo)->OffsetFromZeroForVSA1Start = tmp___9; } goto ldv_47400; case 8: ; if ((Adapter->psFlash2xVendorInfo)->VendorSection[i].OffsetFromZeroForSectionStart != 3149651421U) { tmp___10 = 2863320268U; (Adapter->psFlash2xCSInfo)->OffsetFromZeroForVSA2End = tmp___10; (Adapter->psFlash2xCSInfo)->OffsetFromZeroForVSA2Start = tmp___10; } else { tmp___11 = 3149651421U; (Adapter->psFlash2xCSInfo)->OffsetFromZeroForVSA2End = tmp___11; (Adapter->psFlash2xCSInfo)->OffsetFromZeroForVSA2Start = tmp___11; } goto ldv_47400; default: ; goto ldv_47400; } ldv_47400: i = i + 1U; ldv_47398: ; if (i <= 14U) { goto ldv_47407; } else { goto ldv_47408; } ldv_47408: ; return; } } static int BcmGetFlashCSInfo(struct bcm_mini_adapter *Adapter ) { unsigned int value ; unsigned int uiFlashLayoutMajorVersion ; __u32 tmp ; __u32 tmp___2 ; __u32 tmp___3 ; INT tmp___4 ; { Adapter->uiFlashLayoutMinorVersion = 0U; Adapter->uiFlashLayoutMajorVersion = 0U; Adapter->ulFlashControlSectionStart = 16711680UL; Adapter->uiFlashBaseAdd = 0U; Adapter->ulFlashCalStart = 0U; memset((void *)Adapter->psFlashCSInfo, 0, 96UL); memset((void *)Adapter->psFlash2xCSInfo, 0, 436UL); if ((int )((signed char )Adapter->bDDRInitDone) == 0) { value = 520093696U; wrmalt(Adapter, 2936053888U, & value, 4UL); } else { } BeceemFlashBulkRead(Adapter, (unsigned int *)Adapter->psFlashCSInfo, (unsigned int )Adapter->ulFlashControlSectionStart, 8U); tmp = __fswab32((Adapter->psFlashCSInfo)->FlashLayoutVersion); (Adapter->psFlashCSInfo)->FlashLayoutVersion = tmp; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:Flash Layout Version :%X", "BcmGetFlashCSInfo", (Adapter->psFlashCSInfo)->FlashLayoutVersion); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { tmp___2 = __fswab32((Adapter->psFlashCSInfo)->MagicNumber); printk("\017%s:Signature is :%x\n", "BcmGetFlashCSInfo", tmp___2); } else { } tmp___3 = __fswab32((Adapter->psFlashCSInfo)->MagicNumber); if (tmp___3 == 3201233317U) { uiFlashLayoutMajorVersion = (Adapter->psFlashCSInfo)->FlashLayoutVersion & 65535U; Adapter->uiFlashLayoutMinorVersion = (Adapter->psFlashCSInfo)->FlashLayoutVersion >> 16; } else { Adapter->uiFlashLayoutMinorVersion = 0U; uiFlashLayoutMajorVersion = 0U; } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:FLASH LAYOUT MAJOR VERSION :%X", "BcmGetFlashCSInfo", uiFlashLayoutMajorVersion); } else { } if (uiFlashLayoutMajorVersion <= 1U) { BeceemFlashBulkRead(Adapter, (unsigned int *)Adapter->psFlashCSInfo, (unsigned int )Adapter->ulFlashControlSectionStart, 96U); ConvertEndianOfCSStructure(Adapter->psFlashCSInfo); Adapter->ulFlashCalStart = (Adapter->psFlashCSInfo)->OffsetFromZeroForCalibrationStart; if (Adapter->uiFlashLayoutMajorVersion != 1U || Adapter->uiFlashLayoutMinorVersion != 1U) { Adapter->ulFlashControlSectionStart = (ULONG )(Adapter->psFlashCSInfo)->OffsetFromZeroForControlSectionStart; } else { } if ((((Adapter->psFlashCSInfo)->MagicNumber == 3201233317U && (Adapter->psFlashCSInfo)->SCSIFirmwareVersion >> 16 > 4U) && (Adapter->psFlashCSInfo)->FlashSectorSizeSig == 3405691582U) && (Adapter->psFlashCSInfo)->FlashWriteSupportSize == 1U) { Adapter->ulFlashWriteSize = (ULONG )(Adapter->psFlashCSInfo)->FlashWriteSupportSize; Adapter->fpFlashWrite = & flashByteWrite; Adapter->fpFlashWriteWithStatusCheck = & flashByteWriteStatus; } else { Adapter->ulFlashWriteSize = 16UL; Adapter->fpFlashWrite = & flashWrite; Adapter->fpFlashWriteWithStatusCheck = & flashWriteStatus; } BcmGetFlashSectorSize(Adapter, (Adapter->psFlashCSInfo)->FlashSectorSizeSig, (Adapter->psFlashCSInfo)->FlashSectorSize); Adapter->uiFlashBaseAdd = (Adapter->psFlashCSInfo)->FlashBaseAddr & 4244635647U; } else { tmp___4 = BcmFlash2xBulkRead(Adapter, (unsigned int *)Adapter->psFlash2xCSInfo, 0, (UINT )Adapter->ulFlashControlSectionStart, 436U); if (tmp___4 != 0) { printk("\016%s:Unable to read CS structure\n", "BcmGetFlashCSInfo"); return (-1); } else { } ConvertEndianOf2XCSStructure(Adapter->psFlash2xCSInfo); BcmDumpFlash2XCSStructure(Adapter->psFlash2xCSInfo, Adapter); if ((((Adapter->psFlash2xCSInfo)->MagicNumber == 3201233317U && (Adapter->psFlash2xCSInfo)->SCSIFirmwareVersion >> 16 > 4U) && (Adapter->psFlash2xCSInfo)->FlashSectorSizeSig == 3405691582U) && (Adapter->psFlash2xCSInfo)->FlashWriteSupportSize == 1U) { Adapter->ulFlashWriteSize = (ULONG )(Adapter->psFlash2xCSInfo)->FlashWriteSupportSize; Adapter->fpFlashWrite = & flashByteWrite; Adapter->fpFlashWriteWithStatusCheck = & flashByteWriteStatus; } else { Adapter->ulFlashWriteSize = 16UL; Adapter->fpFlashWrite = & flashWrite; Adapter->fpFlashWriteWithStatusCheck = & flashWriteStatus; } BcmGetFlashSectorSize(Adapter, (Adapter->psFlash2xCSInfo)->FlashSectorSizeSig, (Adapter->psFlash2xCSInfo)->FlashSectorSize); UpdateVendorInfo(Adapter); BcmGetActiveDSD(Adapter); BcmGetActiveISO(Adapter); Adapter->uiFlashBaseAdd = (Adapter->psFlash2xCSInfo)->FlashBaseAddr & 4244635647U; Adapter->ulFlashControlSectionStart = (ULONG )(Adapter->psFlash2xCSInfo)->OffsetFromZeroForControlSectionStart; } Adapter->ulFlashID = BcmReadFlashRDID(Adapter); Adapter->uiFlashLayoutMajorVersion = uiFlashLayoutMajorVersion; return (0); } } static NVM_TYPE BcmGetNvmType(struct bcm_mini_adapter *Adapter ) { unsigned int uiData ; unsigned int tmp ; { uiData = 0U; BeceemEEPROMBulkRead(Adapter, & uiData, 0U, 4U); if (uiData == 1296254274U) { return (1); } else { } BcmGetFlashCSInfo(Adapter); BeceemFlashBulkRead(Adapter, & uiData, Adapter->ulFlashCalStart, 4U); if (uiData == 1296254274U) { return (2); } else { } tmp = BcmGetEEPROMSize(Adapter); if (tmp != 0U) { return (1); } else { } return (3); } } INT BcmGetSectionValStartOffset(struct bcm_mini_adapter *Adapter , enum bcm_flash2x_section_val eFlashSectionVal ) { int SectStartOffset ; int tmp ; BOOLEAN tmp___0 ; BOOLEAN tmp___1 ; { SectStartOffset = 0; SectStartOffset = -1; tmp = IsSectionExistInVendorInfo(Adapter, eFlashSectionVal); if (tmp != 0) { return ((INT )(Adapter->psFlash2xVendorInfo)->VendorSection[(unsigned int )eFlashSectionVal].OffsetFromZeroForSectionStart); } else { } switch ((unsigned int )eFlashSectionVal) { case 1: ; if ((Adapter->psFlash2xCSInfo)->OffsetISOImage1Part1Start != 3149651421U) { tmp___0 = IsNonCDLessDevice(Adapter); if ((int )((signed char )tmp___0) == 0) { SectStartOffset = (int )(Adapter->psFlash2xCSInfo)->OffsetISOImage1Part1Start; } else { } } else { } goto ldv_47425; case 2: ; if ((Adapter->psFlash2xCSInfo)->OffsetISOImage2Part1Start != 3149651421U) { tmp___1 = IsNonCDLessDevice(Adapter); if ((int )((signed char )tmp___1) == 0) { SectStartOffset = (int )(Adapter->psFlash2xCSInfo)->OffsetISOImage2Part1Start; } else { } } else { } goto ldv_47425; case 3: ; if ((Adapter->psFlash2xCSInfo)->OffsetFromZeroForDSDStart != 3149651421U) { SectStartOffset = (int )(Adapter->psFlash2xCSInfo)->OffsetFromZeroForDSDStart; } else { } goto ldv_47425; case 4: ; if ((Adapter->psFlash2xCSInfo)->OffsetFromZeroForDSD1Start != 3149651421U) { SectStartOffset = (int )(Adapter->psFlash2xCSInfo)->OffsetFromZeroForDSD1Start; } else { } goto ldv_47425; case 5: ; if ((Adapter->psFlash2xCSInfo)->OffsetFromZeroForDSD2Start != 3149651421U) { SectStartOffset = (int )(Adapter->psFlash2xCSInfo)->OffsetFromZeroForDSD2Start; } else { } goto ldv_47425; case 6: ; if ((Adapter->psFlash2xCSInfo)->OffsetFromZeroForVSAStart != 3149651421U) { SectStartOffset = (int )(Adapter->psFlash2xCSInfo)->OffsetFromZeroForVSAStart; } else { } goto ldv_47425; case 7: ; if ((Adapter->psFlash2xCSInfo)->OffsetFromZeroForVSA1Start != 3149651421U) { SectStartOffset = (int )(Adapter->psFlash2xCSInfo)->OffsetFromZeroForVSA1Start; } else { } goto ldv_47425; case 8: ; if ((Adapter->psFlash2xCSInfo)->OffsetFromZeroForVSA2Start != 3149651421U) { SectStartOffset = (int )(Adapter->psFlash2xCSInfo)->OffsetFromZeroForVSA2Start; } else { } goto ldv_47425; case 9: ; if ((Adapter->psFlash2xCSInfo)->OffsetFromZeroForScsiFirmware != 3149651421U) { SectStartOffset = (int )(Adapter->psFlash2xCSInfo)->OffsetFromZeroForScsiFirmware; } else { } goto ldv_47425; case 10: ; if ((Adapter->psFlash2xCSInfo)->OffsetFromZeroForControlSectionStart != 3149651421U) { SectStartOffset = (int )(Adapter->psFlash2xCSInfo)->OffsetFromZeroForControlSectionStart; } else { } goto ldv_47425; case 11: ; if ((Adapter->psFlash2xCSInfo)->OffsetISOImage1Part2Start != 3149651421U) { SectStartOffset = (int )(Adapter->psFlash2xCSInfo)->OffsetISOImage1Part2Start; } else { } goto ldv_47425; case 12: ; if ((Adapter->psFlash2xCSInfo)->OffsetISOImage1Part3Start != 3149651421U) { SectStartOffset = (int )(Adapter->psFlash2xCSInfo)->OffsetISOImage1Part3Start; } else { } goto ldv_47425; case 13: ; if ((Adapter->psFlash2xCSInfo)->OffsetISOImage2Part2Start != 3149651421U) { SectStartOffset = (int )(Adapter->psFlash2xCSInfo)->OffsetISOImage2Part2Start; } else { } goto ldv_47425; case 14: ; if ((Adapter->psFlash2xCSInfo)->OffsetISOImage2Part3Start != 3149651421U) { SectStartOffset = (int )(Adapter->psFlash2xCSInfo)->OffsetISOImage2Part3Start; } else { } goto ldv_47425; default: printk("\016%s:Section Does not exist in Flash 2.x", "BcmGetSectionValStartOffset"); SectStartOffset = -1; } ldv_47425: ; return (SectStartOffset); } } static int BcmGetSectionValEndOffset(struct bcm_mini_adapter *Adapter , enum bcm_flash2x_section_val eFlash2xSectionVal ) { int SectEndOffset ; int tmp ; BOOLEAN tmp___0 ; BOOLEAN tmp___1 ; { SectEndOffset = 0; SectEndOffset = -1; tmp = IsSectionExistInVendorInfo(Adapter, eFlash2xSectionVal); if (tmp != 0) { return ((int )(Adapter->psFlash2xVendorInfo)->VendorSection[(unsigned int )eFlash2xSectionVal].OffsetFromZeroForSectionEnd); } else { } switch ((unsigned int )eFlash2xSectionVal) { case 1: ; if ((Adapter->psFlash2xCSInfo)->OffsetISOImage1Part1End != 3149651421U) { tmp___0 = IsNonCDLessDevice(Adapter); if ((int )((signed char )tmp___0) == 0) { SectEndOffset = (int )(Adapter->psFlash2xCSInfo)->OffsetISOImage1Part1End; } else { } } else { } goto ldv_47447; case 2: ; if ((Adapter->psFlash2xCSInfo)->OffsetISOImage2Part1End != 3149651421U) { tmp___1 = IsNonCDLessDevice(Adapter); if ((int )((signed char )tmp___1) == 0) { SectEndOffset = (int )(Adapter->psFlash2xCSInfo)->OffsetISOImage2Part1End; } else { } } else { } goto ldv_47447; case 3: ; if ((Adapter->psFlash2xCSInfo)->OffsetFromZeroForDSDEnd != 3149651421U) { SectEndOffset = (int )(Adapter->psFlash2xCSInfo)->OffsetFromZeroForDSDEnd; } else { } goto ldv_47447; case 4: ; if ((Adapter->psFlash2xCSInfo)->OffsetFromZeroForDSD1End != 3149651421U) { SectEndOffset = (int )(Adapter->psFlash2xCSInfo)->OffsetFromZeroForDSD1End; } else { } goto ldv_47447; case 5: ; if ((Adapter->psFlash2xCSInfo)->OffsetFromZeroForDSD2End != 3149651421U) { SectEndOffset = (int )(Adapter->psFlash2xCSInfo)->OffsetFromZeroForDSD2End; } else { } goto ldv_47447; case 6: ; if ((Adapter->psFlash2xCSInfo)->OffsetFromZeroForVSAEnd != 3149651421U) { SectEndOffset = (int )(Adapter->psFlash2xCSInfo)->OffsetFromZeroForVSAEnd; } else { } goto ldv_47447; case 7: ; if ((Adapter->psFlash2xCSInfo)->OffsetFromZeroForVSA1End != 3149651421U) { SectEndOffset = (int )(Adapter->psFlash2xCSInfo)->OffsetFromZeroForVSA1End; } else { } goto ldv_47447; case 8: ; if ((Adapter->psFlash2xCSInfo)->OffsetFromZeroForVSA2End != 3149651421U) { SectEndOffset = (int )(Adapter->psFlash2xCSInfo)->OffsetFromZeroForVSA2End; } else { } goto ldv_47447; case 9: ; if ((Adapter->psFlash2xCSInfo)->OffsetFromZeroForScsiFirmware != 3149651421U) { SectEndOffset = (int )((Adapter->psFlash2xCSInfo)->OffsetFromZeroForScsiFirmware + (Adapter->psFlash2xCSInfo)->SizeOfScsiFirmware); } else { } goto ldv_47447; case 10: SectEndOffset = -1; case 11: ; if ((Adapter->psFlash2xCSInfo)->OffsetISOImage1Part2End != 3149651421U) { SectEndOffset = (int )(Adapter->psFlash2xCSInfo)->OffsetISOImage1Part2End; } else { } goto ldv_47447; case 12: ; if ((Adapter->psFlash2xCSInfo)->OffsetISOImage1Part3End != 3149651421U) { SectEndOffset = (int )(Adapter->psFlash2xCSInfo)->OffsetISOImage1Part3End; } else { } goto ldv_47447; case 13: ; if ((Adapter->psFlash2xCSInfo)->OffsetISOImage2Part2End != 3149651421U) { SectEndOffset = (int )(Adapter->psFlash2xCSInfo)->OffsetISOImage2Part2End; } else { } goto ldv_47447; case 14: ; if ((Adapter->psFlash2xCSInfo)->OffsetISOImage2Part3End != 3149651421U) { SectEndOffset = (int )(Adapter->psFlash2xCSInfo)->OffsetISOImage2Part3End; } else { } goto ldv_47447; default: SectEndOffset = -1; } ldv_47447: ; return (SectEndOffset); } } INT BcmFlash2xBulkRead(struct bcm_mini_adapter *Adapter , PUINT pBuffer , enum bcm_flash2x_section_val eFlash2xSectionVal , unsigned int uiOffsetWithinSectionVal , unsigned int uiNumBytes ) { int Status ; int SectionStartOffset ; unsigned int uiAbsoluteOffset ; unsigned int uiTemp ; unsigned int value ; INT tmp ; int tmp___0 ; { Status = 0; SectionStartOffset = 0; uiAbsoluteOffset = 0U; uiTemp = 0U; value = 0U; if ((unsigned long )Adapter == (unsigned long )((struct bcm_mini_adapter *)0)) { printk("\016%s:Adapter structure is NULL", "BcmFlash2xBulkRead"); return (-22); } else { } if ((int )((signed char )Adapter->device_removed) != 0) { printk("\016%s:Device has been removed", "BcmFlash2xBulkRead"); return (-19); } else { } if ((unsigned int )eFlash2xSectionVal == 0U) { SectionStartOffset = 0; } else { SectionStartOffset = BcmGetSectionValStartOffset(Adapter, eFlash2xSectionVal); } if (SectionStartOffset == -1) { printk("\016%s:This Section<%d> does not exixt in Flash 2.x Map ", "BcmFlash2xBulkRead", (unsigned int )eFlash2xSectionVal); return (-22); } else { } tmp___0 = IsSectionExistInVendorInfo(Adapter, eFlash2xSectionVal); if (tmp___0 != 0) { tmp = vendorextnReadSection((PVOID )Adapter, (unsigned char *)pBuffer, eFlash2xSectionVal, uiOffsetWithinSectionVal, uiNumBytes); return (tmp); } else { } uiAbsoluteOffset = uiOffsetWithinSectionVal + (unsigned int )SectionStartOffset; rdmalt(Adapter, 251661440U, & uiTemp, 4UL); value = 0U; wrmalt(Adapter, 251661440U, & value, 4UL); Status = BeceemFlashBulkRead(Adapter, pBuffer, uiAbsoluteOffset, uiNumBytes); wrmalt(Adapter, 251661440U, & uiTemp, 4UL); if (Status != 0) { printk("\016%s:Flash Read Failed with Status :%d", "BcmFlash2xBulkRead", Status); return (Status); } else { } return (Status); } } INT BcmFlash2xBulkWrite(struct bcm_mini_adapter *Adapter , PUINT pBuffer , enum bcm_flash2x_section_val eFlash2xSectVal , unsigned int uiOffset , unsigned int uiNumBytes , unsigned int bVerify ) { int Status ; unsigned int FlashSectValStartOffset ; unsigned int uiTemp ; unsigned int value ; INT tmp ; INT tmp___0 ; int tmp___1 ; { Status = 0; FlashSectValStartOffset = 0U; uiTemp = 0U; value = 0U; if ((unsigned long )Adapter == (unsigned long )((struct bcm_mini_adapter *)0)) { printk("\016%s:Adapter structure is NULL", "BcmFlash2xBulkWrite"); return (-22); } else { } if ((int )((signed char )Adapter->device_removed) != 0) { printk("\016%s:Device has been removed", "BcmFlash2xBulkWrite"); return (-19); } else { } if ((unsigned int )eFlash2xSectVal == 0U) { FlashSectValStartOffset = 0U; } else { tmp = BcmGetSectionValStartOffset(Adapter, eFlash2xSectVal); FlashSectValStartOffset = (unsigned int )tmp; } if (FlashSectValStartOffset == 4294967295U) { printk("\016%s:This Section<%d> does not exixt in Flash Map 2.x", "BcmFlash2xBulkWrite", (unsigned int )eFlash2xSectVal); return (-22); } else { } tmp___1 = IsSectionExistInVendorInfo(Adapter, eFlash2xSectVal); if (tmp___1 != 0) { tmp___0 = vendorextnWriteSection((PVOID )Adapter, (unsigned char *)pBuffer, eFlash2xSectVal, uiOffset, uiNumBytes, (int )((BOOLEAN )bVerify)); return (tmp___0); } else { } uiOffset = uiOffset + FlashSectValStartOffset; rdmalt(Adapter, 251661440U, & uiTemp, 4UL); value = 0U; wrmalt(Adapter, 251661440U, & value, 4UL); Status = BeceemFlashBulkWrite(Adapter, pBuffer, uiOffset, uiNumBytes, (int )((BOOLEAN )bVerify)); wrmalt(Adapter, 251661440U, & uiTemp, 4UL); if (Status != 0) { printk("\016%s:Flash Write failed with Status :%d", "BcmFlash2xBulkWrite", Status); return (Status); } else { } return (Status); } } static int BcmGetActiveDSD(struct bcm_mini_adapter *Adapter ) { enum bcm_flash2x_section_val uiHighestPriDSD ; int tmp ; int tmp___0 ; int tmp___1 ; { uiHighestPriDSD = 0; uiHighestPriDSD = getHighestPriDSD(Adapter); Adapter->eActiveDSD = uiHighestPriDSD; if ((unsigned int )uiHighestPriDSD == 3U) { Adapter->ulFlashCalStart = (Adapter->psFlash2xCSInfo)->OffsetFromZeroForDSDStart; } else { } if ((unsigned int )uiHighestPriDSD == 4U) { Adapter->ulFlashCalStart = (Adapter->psFlash2xCSInfo)->OffsetFromZeroForDSD1Start; } else { } if ((unsigned int )uiHighestPriDSD == 5U) { Adapter->ulFlashCalStart = (Adapter->psFlash2xCSInfo)->OffsetFromZeroForDSD2Start; } else { } if ((unsigned int )Adapter->eActiveDSD != 0U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:Active DSD :%d", "BcmGetActiveDSD", (unsigned int )Adapter->eActiveDSD); } else { } } else { } if ((unsigned int )Adapter->eActiveDSD == 0U) { tmp___1 = IsSectionWritable(Adapter, 5); if (tmp___1 != 0) { Adapter->eActiveDSD = 5; Adapter->ulFlashCalStart = (Adapter->psFlash2xCSInfo)->OffsetFromZeroForDSD2Start; } else { tmp___0 = IsSectionWritable(Adapter, 4); if (tmp___0 != 0) { Adapter->eActiveDSD = 4; Adapter->ulFlashCalStart = (Adapter->psFlash2xCSInfo)->OffsetFromZeroForDSD1Start; } else { tmp = IsSectionWritable(Adapter, 3); if (tmp != 0) { Adapter->eActiveDSD = 3; Adapter->ulFlashCalStart = (Adapter->psFlash2xCSInfo)->OffsetFromZeroForDSDStart; } else { } } } } else { } return (0); } } static int BcmGetActiveISO(struct bcm_mini_adapter *Adapter ) { int HighestPriISO ; enum bcm_flash2x_section_val tmp ; { HighestPriISO = 0; tmp = getHighestPriISO(Adapter); HighestPriISO = (int )tmp; Adapter->eActiveISO = (enum bcm_flash2x_section_val )HighestPriISO; if ((unsigned int )Adapter->eActiveISO == 2U) { Adapter->uiActiveISOOffset = (Adapter->psFlash2xCSInfo)->OffsetISOImage2Part1Start; } else if ((unsigned int )Adapter->eActiveISO == 1U) { Adapter->uiActiveISOOffset = (Adapter->psFlash2xCSInfo)->OffsetISOImage1Part1Start; } else { } if ((unsigned int )Adapter->eActiveISO != 0U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:Active ISO :%x", "BcmGetActiveISO", (unsigned int )Adapter->eActiveISO); } else { } } else { } return (0); } } static B_UINT8 IsOffsetWritable(struct bcm_mini_adapter *Adapter , unsigned int uiOffset ) { unsigned int uiSectorNum ; unsigned int uiWordOfSectorPermission ; unsigned int uiBitofSectorePermission ; B_UINT32 permissionBits ; { uiSectorNum = 0U; uiWordOfSectorPermission = 0U; uiBitofSectorePermission = 0U; permissionBits = 0U; uiSectorNum = uiOffset / Adapter->uiSectorSize; uiWordOfSectorPermission = (Adapter->psFlash2xCSInfo)->SectorAccessBitMap[uiSectorNum / 16U]; uiBitofSectorePermission = (~ uiSectorNum & 15U) * 2U; permissionBits = (unsigned int )(3 << (int )uiBitofSectorePermission) & uiWordOfSectorPermission; permissionBits = (permissionBits >> (int )uiBitofSectorePermission) & 3U; if (permissionBits == 0U) { return (1U); } else { return (0U); } } } static int BcmDumpFlash2xSectionBitMap(struct bcm_flash2x_bitmap *psFlash2xBitMap ) { struct bcm_mini_adapter *Adapter ; void *tmp ; { tmp = netdev_priv((struct net_device const *)gblpnetdev); Adapter = (struct bcm_mini_adapter *)tmp; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:***************Flash 2.x Section Bitmap***************", "BcmDumpFlash2xSectionBitMap"); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:ISO_IMAGE1 :0X%x", "BcmDumpFlash2xSectionBitMap", (int )psFlash2xBitMap->ISO_IMAGE1); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:ISO_IMAGE2 :0X%x", "BcmDumpFlash2xSectionBitMap", (int )psFlash2xBitMap->ISO_IMAGE2); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:DSD0 :0X%x", "BcmDumpFlash2xSectionBitMap", (int )psFlash2xBitMap->DSD0); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:DSD1 :0X%x", "BcmDumpFlash2xSectionBitMap", (int )psFlash2xBitMap->DSD1); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:DSD2 :0X%x", "BcmDumpFlash2xSectionBitMap", (int )psFlash2xBitMap->DSD2); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:VSA0 :0X%x", "BcmDumpFlash2xSectionBitMap", (int )psFlash2xBitMap->VSA0); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:VSA1 :0X%x", "BcmDumpFlash2xSectionBitMap", (int )psFlash2xBitMap->VSA1); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:VSA2 :0X%x", "BcmDumpFlash2xSectionBitMap", (int )psFlash2xBitMap->VSA2); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:SCSI :0X%x", "BcmDumpFlash2xSectionBitMap", (int )psFlash2xBitMap->SCSI); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:CONTROL_SECTION :0X%x", "BcmDumpFlash2xSectionBitMap", (int )psFlash2xBitMap->CONTROL_SECTION); } else { } return (0); } } INT BcmGetFlash2xSectionalBitMap(struct bcm_mini_adapter *Adapter , struct bcm_flash2x_bitmap *psFlash2xBitMap ) { PFLASH2X_CS_INFO psFlash2xCSInfo ; enum bcm_flash2x_section_val uiHighestPriDSD ; enum bcm_flash2x_section_val uiHighestPriISO ; BOOLEAN SetActiveDSDDone ; BOOLEAN SetActiveISODone ; 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 ; { psFlash2xCSInfo = Adapter->psFlash2xCSInfo; uiHighestPriDSD = 0; uiHighestPriISO = 0; SetActiveDSDDone = 0; SetActiveISODone = 0; tmp = IsFlash2x(Adapter); if (tmp == 0) { psFlash2xBitMap->ISO_IMAGE2 = 0U; psFlash2xBitMap->ISO_IMAGE1 = 0U; psFlash2xBitMap->DSD0 = 11U; psFlash2xBitMap->DSD1 = 0U; psFlash2xBitMap->DSD2 = 0U; psFlash2xBitMap->VSA0 = 0U; psFlash2xBitMap->VSA1 = 0U; psFlash2xBitMap->VSA2 = 0U; psFlash2xBitMap->CONTROL_SECTION = 0U; psFlash2xBitMap->SCSI = 0U; psFlash2xBitMap->Reserved0 = 0U; psFlash2xBitMap->Reserved1 = 0U; psFlash2xBitMap->Reserved2 = 0U; return (0); } else { } uiHighestPriDSD = getHighestPriDSD(Adapter); uiHighestPriISO = getHighestPriISO(Adapter); if (psFlash2xCSInfo->OffsetISOImage2Part1Start != 3149651421U) { psFlash2xBitMap->ISO_IMAGE2 = (unsigned int )psFlash2xBitMap->ISO_IMAGE2 | 1U; tmp___0 = ReadISOSignature(Adapter, 2); if (tmp___0 == -1093795504) { psFlash2xBitMap->ISO_IMAGE2 = (unsigned int )psFlash2xBitMap->ISO_IMAGE2 | 2U; } else { } tmp___1 = IsSectionWritable(Adapter, 2); if (tmp___1 == 0) { psFlash2xBitMap->ISO_IMAGE2 = (unsigned int )psFlash2xBitMap->ISO_IMAGE2 | 4U; } else { } if ((int )((signed char )SetActiveISODone) == 0 && (unsigned int )uiHighestPriISO == 2U) { psFlash2xBitMap->ISO_IMAGE2 = (unsigned int )psFlash2xBitMap->ISO_IMAGE2 | 8U; SetActiveISODone = 1; } else { } } else { } if (psFlash2xCSInfo->OffsetISOImage1Part1Start != 3149651421U) { psFlash2xBitMap->ISO_IMAGE1 = (unsigned int )psFlash2xBitMap->ISO_IMAGE1 | 1U; tmp___2 = ReadISOSignature(Adapter, 1); if (tmp___2 == -1093795504) { psFlash2xBitMap->ISO_IMAGE1 = (unsigned int )psFlash2xBitMap->ISO_IMAGE1 | 2U; } else { } tmp___3 = IsSectionWritable(Adapter, 1); if (tmp___3 == 0) { psFlash2xBitMap->ISO_IMAGE1 = (unsigned int )psFlash2xBitMap->ISO_IMAGE1 | 4U; } else { } if ((int )((signed char )SetActiveISODone) == 0 && (unsigned int )uiHighestPriISO == 1U) { psFlash2xBitMap->ISO_IMAGE1 = (unsigned int )psFlash2xBitMap->ISO_IMAGE1 | 8U; SetActiveISODone = 1; } else { } } else { } if (psFlash2xCSInfo->OffsetFromZeroForDSD2Start != 3149651421U) { psFlash2xBitMap->DSD2 = (unsigned int )psFlash2xBitMap->DSD2 | 1U; tmp___4 = ReadDSDSignature(Adapter, 5); if (tmp___4 == -1093792419) { psFlash2xBitMap->DSD2 = (unsigned int )psFlash2xBitMap->DSD2 | 2U; } else { } tmp___5 = IsSectionWritable(Adapter, 5); if (tmp___5 == 0) { psFlash2xBitMap->DSD2 = (unsigned int )psFlash2xBitMap->DSD2 | 4U; } else if ((int )((signed char )SetActiveDSDDone) == 0 && (unsigned int )uiHighestPriDSD == 5U) { psFlash2xBitMap->DSD2 = (unsigned int )psFlash2xBitMap->DSD2 | 8U; SetActiveDSDDone = 1; } else { } } else { } if (psFlash2xCSInfo->OffsetFromZeroForDSD1Start != 3149651421U) { psFlash2xBitMap->DSD1 = (unsigned int )psFlash2xBitMap->DSD1 | 1U; tmp___6 = ReadDSDSignature(Adapter, 4); if (tmp___6 == -1093792419) { psFlash2xBitMap->DSD1 = (unsigned int )psFlash2xBitMap->DSD1 | 2U; } else { } tmp___7 = IsSectionWritable(Adapter, 4); if (tmp___7 == 0) { psFlash2xBitMap->DSD1 = (unsigned int )psFlash2xBitMap->DSD1 | 4U; } else if ((int )((signed char )SetActiveDSDDone) == 0 && (unsigned int )uiHighestPriDSD == 4U) { psFlash2xBitMap->DSD1 = (unsigned int )psFlash2xBitMap->DSD1 | 8U; SetActiveDSDDone = 1; } else { } } else { } if (psFlash2xCSInfo->OffsetFromZeroForDSDStart != 3149651421U) { psFlash2xBitMap->DSD0 = (unsigned int )psFlash2xBitMap->DSD0 | 1U; tmp___8 = ReadDSDSignature(Adapter, 3); if (tmp___8 == -1093792419) { psFlash2xBitMap->DSD0 = (unsigned int )psFlash2xBitMap->DSD0 | 2U; } else { } tmp___9 = IsSectionWritable(Adapter, 3); if (tmp___9 == 0) { psFlash2xBitMap->DSD0 = (unsigned int )psFlash2xBitMap->DSD0 | 4U; } else if ((int )((signed char )SetActiveDSDDone) == 0 && (unsigned int )uiHighestPriDSD == 3U) { psFlash2xBitMap->DSD0 = (unsigned int )psFlash2xBitMap->DSD0 | 8U; SetActiveDSDDone = 1; } else { } } else { } if (psFlash2xCSInfo->OffsetFromZeroForVSAStart != 3149651421U) { psFlash2xBitMap->VSA0 = (unsigned int )psFlash2xBitMap->VSA0 | 1U; psFlash2xBitMap->VSA0 = (unsigned int )psFlash2xBitMap->VSA0 | 2U; tmp___10 = IsSectionWritable(Adapter, 6); if (tmp___10 == 0) { psFlash2xBitMap->VSA0 = (unsigned int )psFlash2xBitMap->VSA0 | 4U; } else { } psFlash2xBitMap->VSA0 = (unsigned int )psFlash2xBitMap->VSA0 | 8U; } else { } if (psFlash2xCSInfo->OffsetFromZeroForVSA1Start != 3149651421U) { psFlash2xBitMap->VSA1 = (unsigned int )psFlash2xBitMap->VSA1 | 1U; psFlash2xBitMap->VSA1 = (unsigned int )psFlash2xBitMap->VSA1 | 2U; tmp___11 = IsSectionWritable(Adapter, 7); if (tmp___11 == 0) { psFlash2xBitMap->VSA1 = (unsigned int )psFlash2xBitMap->VSA1 | 4U; } else { } psFlash2xBitMap->VSA1 = (unsigned int )psFlash2xBitMap->VSA1 | 8U; } else { } if (psFlash2xCSInfo->OffsetFromZeroForVSA2Start != 3149651421U) { psFlash2xBitMap->VSA2 = (unsigned int )psFlash2xBitMap->VSA2 | 1U; psFlash2xBitMap->VSA2 = (unsigned int )psFlash2xBitMap->VSA2 | 2U; tmp___12 = IsSectionWritable(Adapter, 8); if (tmp___12 == 0) { psFlash2xBitMap->VSA2 = (unsigned int )psFlash2xBitMap->VSA2 | 4U; } else { } psFlash2xBitMap->VSA2 = (unsigned int )psFlash2xBitMap->VSA2 | 8U; } else { } if (psFlash2xCSInfo->OffsetFromZeroForScsiFirmware != 3149651421U) { psFlash2xBitMap->SCSI = (unsigned int )psFlash2xBitMap->SCSI | 1U; psFlash2xBitMap->SCSI = (unsigned int )psFlash2xBitMap->SCSI | 2U; tmp___13 = IsSectionWritable(Adapter, 9); if (tmp___13 == 0) { psFlash2xBitMap->SCSI = (unsigned int )psFlash2xBitMap->SCSI | 4U; } else { } psFlash2xBitMap->SCSI = (unsigned int )psFlash2xBitMap->SCSI | 8U; } else { } if (psFlash2xCSInfo->OffsetFromZeroForControlSectionStart != 3149651421U) { psFlash2xBitMap->CONTROL_SECTION = (unsigned int )psFlash2xBitMap->CONTROL_SECTION | 1U; psFlash2xBitMap->CONTROL_SECTION = (unsigned int )psFlash2xBitMap->CONTROL_SECTION | 2U; tmp___14 = IsSectionWritable(Adapter, 10); if (tmp___14 == 0) { psFlash2xBitMap->CONTROL_SECTION = (unsigned int )psFlash2xBitMap->CONTROL_SECTION | 4U; } else { } psFlash2xBitMap->CONTROL_SECTION = (unsigned int )psFlash2xBitMap->CONTROL_SECTION | 8U; } else { } psFlash2xBitMap->Reserved0 = 0U; psFlash2xBitMap->Reserved0 = 0U; psFlash2xBitMap->Reserved0 = 0U; BcmDumpFlash2xSectionBitMap(psFlash2xBitMap); return (0); } } INT BcmSetActiveSection(struct bcm_mini_adapter *Adapter , enum bcm_flash2x_section_val eFlash2xSectVal ) { unsigned int SectImagePriority ; int Status ; int HighestPriDSD ; int HighestPriISO ; enum bcm_flash2x_section_val tmp ; int tmp___0 ; enum bcm_flash2x_section_val tmp___1 ; int tmp___2 ; __u32 tmp___3 ; int tmp___4 ; enum bcm_flash2x_section_val tmp___5 ; int tmp___6 ; enum bcm_flash2x_section_val tmp___7 ; enum bcm_flash2x_section_val tmp___8 ; __u32 tmp___9 ; int tmp___10 ; { SectImagePriority = 0U; Status = 0; HighestPriDSD = 0; HighestPriISO = 0; Status = IsSectionWritable(Adapter, eFlash2xSectVal); if (Status != 1) { printk("\016%s:Provided Section <%d> is not writable", "BcmSetActiveSection", (unsigned int )eFlash2xSectVal); return (-1); } else { } Adapter->bHeaderChangeAllowed = 1; switch ((unsigned int )eFlash2xSectVal) { case 1: ; case 2: tmp___4 = ReadISOSignature(Adapter, eFlash2xSectVal); if (tmp___4 == -1093795504) { tmp = getHighestPriISO(Adapter); HighestPriISO = (int )tmp; if ((unsigned int )HighestPriISO == (unsigned int )eFlash2xSectVal) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:Given ISO<%x> already has highest priority", "BcmSetActiveSection", (unsigned int )eFlash2xSectVal); } else { } Status = 0; goto ldv_47531; } else { } tmp___0 = ReadISOPriority(Adapter, (enum bcm_flash2x_section_val )HighestPriISO); SectImagePriority = (unsigned int )(tmp___0 + 1); if (SectImagePriority == 0U) { tmp___2 = IsSectionWritable(Adapter, (enum bcm_flash2x_section_val )HighestPriISO); if (tmp___2 != 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:SectImagePriority wraparound happened, eFlash2xSectVal: 0x%x\n", "BcmSetActiveSection", (unsigned int )eFlash2xSectVal); } else { } SectImagePriority = 16777216U; Status = BcmFlash2xBulkWrite(Adapter, & SectImagePriority, (enum bcm_flash2x_section_val )HighestPriISO, 12U, 4U, 1U); if (Status != 0) { printk("\016%s:Priority has not been written properly", "BcmSetActiveSection"); Status = -1; goto ldv_47531; } else { } tmp___1 = getHighestPriISO(Adapter); HighestPriISO = (int )tmp___1; if ((unsigned int )HighestPriISO == (unsigned int )eFlash2xSectVal) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:Given ISO<%x> already has highest priority", "BcmSetActiveSection", (unsigned int )eFlash2xSectVal); } else { } Status = 0; goto ldv_47531; } else { } SectImagePriority = 2U; } else { } } else { } tmp___3 = __fswab32(SectImagePriority); SectImagePriority = tmp___3; Status = BcmFlash2xBulkWrite(Adapter, & SectImagePriority, eFlash2xSectVal, 12U, 4U, 1U); if (Status != 0) { printk("\016%s:Priority has not been written properly", "BcmSetActiveSection"); goto ldv_47531; } else { } } else { printk("\016%s:Signature is currupted. Hence can\'t increase the priority", "BcmSetActiveSection"); Status = -1; goto ldv_47531; } goto ldv_47531; case 3: ; case 4: ; case 5: tmp___10 = ReadDSDSignature(Adapter, eFlash2xSectVal); if (tmp___10 == -1093792419) { tmp___5 = getHighestPriDSD(Adapter); HighestPriDSD = (int )tmp___5; if ((unsigned int )HighestPriDSD == (unsigned int )eFlash2xSectVal) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:Given DSD<%x> already has highest priority", "BcmSetActiveSection", (unsigned int )eFlash2xSectVal); } else { } Status = 0; goto ldv_47531; } else { } tmp___6 = ReadDSDPriority(Adapter, (enum bcm_flash2x_section_val )HighestPriDSD); SectImagePriority = (unsigned int )(tmp___6 + 1); if (SectImagePriority == 0U) { printk("\016%s:SectImagePriority wraparound happened, eFlash2xSectVal: 0x%x\n", "BcmSetActiveSection", (unsigned int )eFlash2xSectVal); SectImagePriority = 16777216U; Status = BcmFlash2xBulkWrite(Adapter, & SectImagePriority, (enum bcm_flash2x_section_val )HighestPriDSD, (Adapter->psFlash2xCSInfo)->OffsetFromDSDStartForDSDHeader + 8U, 4U, 1U); if (Status != 0) { printk("\016%s:Priority has not been written properly", "BcmSetActiveSection"); goto ldv_47531; } else { } tmp___7 = getHighestPriDSD(Adapter); HighestPriDSD = (int )tmp___7; if ((unsigned int )HighestPriDSD == (unsigned int )eFlash2xSectVal) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:Made the DSD: %x highest by reducing priority of other\n", "BcmSetActiveSection", (unsigned int )eFlash2xSectVal); } else { } Status = 0; goto ldv_47531; } else { } SectImagePriority = 33554432U; Status = BcmFlash2xBulkWrite(Adapter, & SectImagePriority, (enum bcm_flash2x_section_val )HighestPriDSD, (Adapter->psFlash2xCSInfo)->OffsetFromDSDStartForDSDHeader + 8U, 4U, 1U); if (Status != 0) { printk("\016%s:Priority has not been written properly", "BcmSetActiveSection"); goto ldv_47531; } else { } tmp___8 = getHighestPriDSD(Adapter); HighestPriDSD = (int )tmp___8; if ((unsigned int )HighestPriDSD == (unsigned int )eFlash2xSectVal) { Status = 0; goto ldv_47531; } else { } SectImagePriority = 3U; } else { } tmp___9 = __fswab32(SectImagePriority); SectImagePriority = tmp___9; Status = BcmFlash2xBulkWrite(Adapter, & SectImagePriority, eFlash2xSectVal, (Adapter->psFlash2xCSInfo)->OffsetFromDSDStartForDSDHeader + 8U, 4U, 1U); if (Status != 0) { printk("\016%s:Priority has not been written properly", "BcmSetActiveSection"); Status = -1; goto ldv_47531; } else { } } else { printk("\016%s:Signature is currupted. Hence can\'t increase the priority", "BcmSetActiveSection"); Status = -1; goto ldv_47531; } goto ldv_47531; case 6: ; case 7: ; case 8: ; goto ldv_47531; default: Status = -1; goto ldv_47531; } ldv_47531: Adapter->bHeaderChangeAllowed = 0; return (Status); } } INT BcmCopyISO(struct bcm_mini_adapter *Adapter , struct bcm_flash2x_copy_section sCopySectStrut ) { PCHAR Buff ; enum bcm_flash2x_section_val eISOReadPart ; enum bcm_flash2x_section_val eISOWritePart ; unsigned int uiReadOffsetWithinPart ; unsigned int uiWriteOffsetWithinPart ; unsigned int uiTotalDataToCopy ; BOOLEAN IsThisHeaderSector ; unsigned int sigOffset ; unsigned int ISOLength ; unsigned int Status ; unsigned int SigBuff[16U] ; unsigned int i ; int tmp ; INT tmp___0 ; __u32 tmp___1 ; void *tmp___2 ; INT tmp___3 ; size_t __len ; void *__ret ; INT tmp___4 ; INT tmp___5 ; size_t __len___0 ; void *__ret___0 ; INT tmp___6 ; { Buff = 0; eISOReadPart = 0; eISOWritePart = 0; uiReadOffsetWithinPart = 0U; uiWriteOffsetWithinPart = 0U; uiTotalDataToCopy = 0U; IsThisHeaderSector = 0; sigOffset = 0U; ISOLength = 0U; Status = 0U; i = 0U; tmp = ReadISOSignature(Adapter, sCopySectStrut.SrcSection); if (tmp != -1093795504) { printk("\016%s:error as Source ISO Section does not have valid signature", "BcmCopyISO"); return (-1); } else { } tmp___0 = BcmFlash2xBulkRead(Adapter, & ISOLength, sCopySectStrut.SrcSection, 4U, 4U); Status = (unsigned int )tmp___0; if (Status != 0U) { printk("\016%s:Read failed while copying ISO\n", "BcmCopyISO"); return ((INT )Status); } else { } tmp___1 = __fswab32(ISOLength); ISOLength = tmp___1; if (ISOLength % Adapter->uiSectorSize != 0U) { ISOLength = Adapter->uiSectorSize * (ISOLength / Adapter->uiSectorSize + 1U); } else { } sigOffset = 0U; tmp___2 = kzalloc((size_t )Adapter->uiSectorSize, 208U); Buff = (PCHAR )tmp___2; if ((unsigned long )Buff == (unsigned long )((PCHAR )0)) { printk("\016%s:Memory allocation failed for section size", "BcmCopyISO"); return (-12); } else { } if ((unsigned int )sCopySectStrut.SrcSection == 1U && (unsigned int )sCopySectStrut.DstSection == 2U) { eISOReadPart = 1; eISOWritePart = 2; uiReadOffsetWithinPart = 0U; uiWriteOffsetWithinPart = 0U; uiTotalDataToCopy = (((((Adapter->psFlash2xCSInfo)->OffsetISOImage1Part1End - (Adapter->psFlash2xCSInfo)->OffsetISOImage1Part1Start) + (Adapter->psFlash2xCSInfo)->OffsetISOImage1Part2End) - (Adapter->psFlash2xCSInfo)->OffsetISOImage1Part2Start) + (Adapter->psFlash2xCSInfo)->OffsetISOImage1Part3End) - (Adapter->psFlash2xCSInfo)->OffsetISOImage1Part3Start; if (uiTotalDataToCopy < ISOLength) { printk("\016%s:error as Source ISO Section does not have valid signature", "BcmCopyISO"); Status = 4294967295U; goto out; } else { } uiTotalDataToCopy = (((((Adapter->psFlash2xCSInfo)->OffsetISOImage2Part1End - (Adapter->psFlash2xCSInfo)->OffsetISOImage2Part1Start) + (Adapter->psFlash2xCSInfo)->OffsetISOImage2Part2End) - (Adapter->psFlash2xCSInfo)->OffsetISOImage2Part2Start) + (Adapter->psFlash2xCSInfo)->OffsetISOImage2Part3End) - (Adapter->psFlash2xCSInfo)->OffsetISOImage2Part3Start; if (uiTotalDataToCopy < ISOLength) { printk("\016%s:error as Dest ISO Section does not have enough section size", "BcmCopyISO"); Status = 4294967295U; goto out; } else { } uiTotalDataToCopy = ISOLength; CorruptISOSig(Adapter, 2); goto ldv_47565; ldv_47564: ; if (Adapter->uiSectorSize == uiTotalDataToCopy) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:Writing the signature sector", "BcmCopyISO"); } else { } eISOReadPart = 1; uiReadOffsetWithinPart = 0U; eISOWritePart = 2; uiWriteOffsetWithinPart = 0U; IsThisHeaderSector = 1; } else { uiReadOffsetWithinPart = Adapter->uiSectorSize + uiReadOffsetWithinPart; uiWriteOffsetWithinPart = Adapter->uiSectorSize + uiWriteOffsetWithinPart; if ((unsigned int )eISOReadPart == 1U && (Adapter->psFlash2xCSInfo)->OffsetISOImage1Part1End - (Adapter->psFlash2xCSInfo)->OffsetISOImage1Part1Start == uiReadOffsetWithinPart) { eISOReadPart = 11; uiReadOffsetWithinPart = 0U; } else { } if ((unsigned int )eISOReadPart == 11U && (Adapter->psFlash2xCSInfo)->OffsetISOImage1Part2End - (Adapter->psFlash2xCSInfo)->OffsetISOImage1Part2Start == uiReadOffsetWithinPart) { eISOReadPart = 12; uiReadOffsetWithinPart = 0U; } else { } if ((unsigned int )eISOWritePart == 2U && (Adapter->psFlash2xCSInfo)->OffsetISOImage2Part1End - (Adapter->psFlash2xCSInfo)->OffsetISOImage2Part1Start == uiWriteOffsetWithinPart) { eISOWritePart = 13; uiWriteOffsetWithinPart = 0U; } else { } if ((unsigned int )eISOWritePart == 13U && (Adapter->psFlash2xCSInfo)->OffsetISOImage2Part2End - (Adapter->psFlash2xCSInfo)->OffsetISOImage2Part2Start == uiWriteOffsetWithinPart) { eISOWritePart = 14; uiWriteOffsetWithinPart = 0U; } else { } } tmp___3 = BcmFlash2xBulkRead(Adapter, (unsigned int *)Buff, eISOReadPart, uiReadOffsetWithinPart, Adapter->uiSectorSize); Status = (unsigned int )tmp___3; if (Status != 0U) { printk("\016%s:Read failed while copying ISO: Part: %x, OffsetWithinPart: %x\n", "BcmCopyISO", (unsigned int )eISOReadPart, uiReadOffsetWithinPart); goto ldv_47557; } else { } if ((int )((signed char )IsThisHeaderSector) == 1) { __len = 16UL; if (__len > 63UL) { __ret = memcpy((void *)(& SigBuff), (void const *)Buff + (unsigned long )sigOffset, __len); } else { __ret = memcpy((void *)(& SigBuff), (void const *)Buff + (unsigned long )sigOffset, __len); } i = 0U; goto ldv_47562; ldv_47561: *(Buff + ((unsigned long )sigOffset + (unsigned long )i)) = -1; i = i + 1U; ldv_47562: ; if (i <= 15U) { goto ldv_47561; } else { goto ldv_47563; } ldv_47563: ; } else { } Adapter->bHeaderChangeAllowed = 1; tmp___4 = BcmFlash2xBulkWrite(Adapter, (unsigned int *)Buff, eISOWritePart, uiWriteOffsetWithinPart, Adapter->uiSectorSize, 1U); Status = (unsigned int )tmp___4; if (Status != 0U) { printk("\016%s:Write failed while copying ISO: Part: %x, OffsetWithinPart: %x\n", "BcmCopyISO", (unsigned int )eISOWritePart, uiWriteOffsetWithinPart); goto ldv_47557; } else { } Adapter->bHeaderChangeAllowed = 0; if ((int )((signed char )IsThisHeaderSector) == 1) { WriteToFlashWithoutSectorErase(Adapter, (unsigned int *)(& SigBuff), eISOWritePart, sigOffset, 16U); IsThisHeaderSector = 0; } else { } uiTotalDataToCopy = uiTotalDataToCopy - Adapter->uiSectorSize; ldv_47565: ; if (uiTotalDataToCopy != 0U) { goto ldv_47564; } else { goto ldv_47557; } ldv_47557: ; } else { } if ((unsigned int )sCopySectStrut.SrcSection == 2U && (unsigned int )sCopySectStrut.DstSection == 1U) { eISOReadPart = 2; eISOWritePart = 1; uiReadOffsetWithinPart = 0U; uiWriteOffsetWithinPart = 0U; uiTotalDataToCopy = (((((Adapter->psFlash2xCSInfo)->OffsetISOImage2Part1End - (Adapter->psFlash2xCSInfo)->OffsetISOImage2Part1Start) + (Adapter->psFlash2xCSInfo)->OffsetISOImage2Part2End) - (Adapter->psFlash2xCSInfo)->OffsetISOImage2Part2Start) + (Adapter->psFlash2xCSInfo)->OffsetISOImage2Part3End) - (Adapter->psFlash2xCSInfo)->OffsetISOImage2Part3Start; if (uiTotalDataToCopy < ISOLength) { printk("\016%s:error as Source ISO Section does not have valid signature", "BcmCopyISO"); Status = 4294967295U; goto out; } else { } uiTotalDataToCopy = (((((Adapter->psFlash2xCSInfo)->OffsetISOImage1Part1End - (Adapter->psFlash2xCSInfo)->OffsetISOImage1Part1Start) + (Adapter->psFlash2xCSInfo)->OffsetISOImage1Part2End) - (Adapter->psFlash2xCSInfo)->OffsetISOImage1Part2Start) + (Adapter->psFlash2xCSInfo)->OffsetISOImage1Part3End) - (Adapter->psFlash2xCSInfo)->OffsetISOImage1Part3Start; if (uiTotalDataToCopy < ISOLength) { printk("\016%s:error as Dest ISO Section does not have enough section size", "BcmCopyISO"); Status = 4294967295U; goto out; } else { } uiTotalDataToCopy = ISOLength; CorruptISOSig(Adapter, 1); goto ldv_47574; ldv_47573: ; if (Adapter->uiSectorSize == uiTotalDataToCopy) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:Writing the signature sector", "BcmCopyISO"); } else { } eISOReadPart = 2; uiReadOffsetWithinPart = 0U; eISOWritePart = 1; uiWriteOffsetWithinPart = 0U; IsThisHeaderSector = 1; } else { uiReadOffsetWithinPart = Adapter->uiSectorSize + uiReadOffsetWithinPart; uiWriteOffsetWithinPart = Adapter->uiSectorSize + uiWriteOffsetWithinPart; if ((unsigned int )eISOReadPart == 2U && (Adapter->psFlash2xCSInfo)->OffsetISOImage2Part1End - (Adapter->psFlash2xCSInfo)->OffsetISOImage2Part1Start == uiReadOffsetWithinPart) { eISOReadPart = 13; uiReadOffsetWithinPart = 0U; } else { } if ((unsigned int )eISOReadPart == 13U && (Adapter->psFlash2xCSInfo)->OffsetISOImage2Part2End - (Adapter->psFlash2xCSInfo)->OffsetISOImage2Part2Start == uiReadOffsetWithinPart) { eISOReadPart = 14; uiReadOffsetWithinPart = 0U; } else { } if ((unsigned int )eISOWritePart == 1U && (Adapter->psFlash2xCSInfo)->OffsetISOImage1Part1End - (Adapter->psFlash2xCSInfo)->OffsetISOImage1Part1Start == uiWriteOffsetWithinPart) { eISOWritePart = 11; uiWriteOffsetWithinPart = 0U; } else { } if ((unsigned int )eISOWritePart == 11U && (Adapter->psFlash2xCSInfo)->OffsetISOImage1Part2End - (Adapter->psFlash2xCSInfo)->OffsetISOImage1Part2Start == uiWriteOffsetWithinPart) { eISOWritePart = 12; uiWriteOffsetWithinPart = 0U; } else { } } tmp___5 = BcmFlash2xBulkRead(Adapter, (unsigned int *)Buff, eISOReadPart, uiReadOffsetWithinPart, Adapter->uiSectorSize); Status = (unsigned int )tmp___5; if (Status != 0U) { printk("\016%s:Read failed while copying ISO: Part: %x, OffsetWithinPart: %x\n", "BcmCopyISO", (unsigned int )eISOReadPart, uiReadOffsetWithinPart); goto ldv_47566; } else { } if ((int )((signed char )IsThisHeaderSector) == 1) { __len___0 = 16UL; if (__len___0 > 63UL) { __ret___0 = memcpy((void *)(& SigBuff), (void const *)Buff + (unsigned long )sigOffset, __len___0); } else { __ret___0 = memcpy((void *)(& SigBuff), (void const *)Buff + (unsigned long )sigOffset, __len___0); } i = 0U; goto ldv_47571; ldv_47570: *(Buff + ((unsigned long )sigOffset + (unsigned long )i)) = -1; i = i + 1U; ldv_47571: ; if (i <= 15U) { goto ldv_47570; } else { goto ldv_47572; } ldv_47572: ; } else { } Adapter->bHeaderChangeAllowed = 1; tmp___6 = BcmFlash2xBulkWrite(Adapter, (unsigned int *)Buff, eISOWritePart, uiWriteOffsetWithinPart, Adapter->uiSectorSize, 1U); Status = (unsigned int )tmp___6; if (Status != 0U) { printk("\016%s:Write failed while copying ISO: Part: %x, OffsetWithinPart: %x\n", "BcmCopyISO", (unsigned int )eISOWritePart, uiWriteOffsetWithinPart); goto ldv_47566; } else { } Adapter->bHeaderChangeAllowed = 0; if ((int )((signed char )IsThisHeaderSector) == 1) { WriteToFlashWithoutSectorErase(Adapter, (unsigned int *)(& SigBuff), eISOWritePart, sigOffset, 16U); IsThisHeaderSector = 0; } else { } uiTotalDataToCopy = uiTotalDataToCopy - Adapter->uiSectorSize; ldv_47574: ; if (uiTotalDataToCopy != 0U) { goto ldv_47573; } else { goto ldv_47566; } ldv_47566: ; } else { } out: kfree((void const *)Buff); return ((INT )Status); } } INT BcmFlash2xCorruptSig(struct bcm_mini_adapter *Adapter , enum bcm_flash2x_section_val eFlash2xSectionVal ) { int Status ; { Status = 0; printk("\016%s:Section Value :%x\n", "BcmFlash2xCorruptSig", (unsigned int )eFlash2xSectionVal); if (((unsigned int )eFlash2xSectionVal == 3U || (unsigned int )eFlash2xSectionVal == 4U) || (unsigned int )eFlash2xSectionVal == 5U) { Status = CorruptDSDSig(Adapter, eFlash2xSectionVal); } else if ((unsigned int )eFlash2xSectionVal == 1U || (unsigned int )eFlash2xSectionVal == 2U) { Status = CorruptISOSig(Adapter, eFlash2xSectionVal); } else { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:Given Section <%d>does not have Header", "BcmFlash2xCorruptSig", (unsigned int )eFlash2xSectionVal); } else { } return (0); } return (Status); } } INT BcmFlash2xWriteSig(struct bcm_mini_adapter *Adapter , enum bcm_flash2x_section_val eFlashSectionVal ) { unsigned int uiSignature ; unsigned int uiOffset ; int tmp ; int tmp___0 ; int tmp___1 ; { uiSignature = 0U; uiOffset = 0U; if ((int )((signed char )Adapter->bSigCorrupted) == 0) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:Signature is not corrupted by driver, hence not restoring\n", "BcmFlash2xWriteSig"); } else { } return (0); } else { } if ((int )((signed char )Adapter->bAllDSDWriteAllow) == 0) { tmp = IsSectionWritable(Adapter, eFlashSectionVal); if (tmp == 0) { printk("\016%s:Section is not Writable...Hence can\'t Write signature", "BcmFlash2xWriteSig"); return (-1); } else { } } else { } if (((unsigned int )eFlashSectionVal == 3U || (unsigned int )eFlashSectionVal == 4U) || (unsigned int )eFlashSectionVal == 5U) { uiSignature = 1561185982U; uiOffset = (Adapter->psFlash2xCSInfo)->OffsetFromDSDStartForDSDHeader; uiOffset = uiOffset + 1020U; tmp___0 = ReadDSDSignature(Adapter, eFlashSectionVal); if (((unsigned int )tmp___0 & 4278190080U) != 0U) { printk("\016%s:Corrupted Pattern is not there. Hence won\'t write sig", "BcmFlash2xWriteSig"); return (-1); } else { } } else if ((unsigned int )eFlashSectionVal == 1U || (unsigned int )eFlashSectionVal == 2U) { uiSignature = 1342295742U; uiOffset = 0U; tmp___1 = ReadISOSignature(Adapter, eFlashSectionVal); if (((unsigned int )tmp___1 & 4278190080U) != 0U) { printk("\016%s:Currupted Pattern is not there. Hence won\'t write sig", "BcmFlash2xWriteSig"); return (-1); } else { } } else { printk("\016%s:GIVEN SECTION< %d > IS NOT VALID FOR SIG WRITE...", "BcmFlash2xWriteSig", (unsigned int )eFlashSectionVal); return (-1); } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:Restoring the signature", "BcmFlash2xWriteSig"); } else { } Adapter->bHeaderChangeAllowed = 1; Adapter->bSigCorrupted = 0; BcmFlash2xBulkWrite(Adapter, & uiSignature, eFlashSectionVal, uiOffset, 4U, 1U); Adapter->bHeaderChangeAllowed = 0; return (0); } } INT validateFlash2xReadWrite(struct bcm_mini_adapter *Adapter , struct bcm_flash2x_readwrite *psFlash2xReadWrite ) { unsigned int uiNumOfBytes ; unsigned int uiSectStartOffset ; unsigned int uiSectEndOffset ; BOOLEAN 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 ; { uiNumOfBytes = 0U; uiSectStartOffset = 0U; uiSectEndOffset = 0U; uiNumOfBytes = psFlash2xReadWrite->numOfBytes; tmp = IsSectionExistInFlash(Adapter, psFlash2xReadWrite->Section); if ((int )((signed char )tmp) != 1) { printk("\016%s:Section<%x> does not exixt in Flash", "validateFlash2xReadWrite", (unsigned int )psFlash2xReadWrite->Section); return (0); } else { } tmp___0 = BcmGetSectionValStartOffset(Adapter, psFlash2xReadWrite->Section); uiSectStartOffset = (unsigned int )tmp___0; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:Start offset :%x ,section :%d\n", "validateFlash2xReadWrite", uiSectStartOffset, (unsigned int )psFlash2xReadWrite->Section); } else { } if ((unsigned int )psFlash2xReadWrite->Section == 1U || (unsigned int )psFlash2xReadWrite->Section == 2U) { if ((unsigned int )psFlash2xReadWrite->Section == 1U) { tmp___1 = BcmGetSectionValEndOffset(Adapter, 1); tmp___2 = BcmGetSectionValStartOffset(Adapter, 1); tmp___3 = BcmGetSectionValEndOffset(Adapter, 11); tmp___4 = BcmGetSectionValStartOffset(Adapter, 11); tmp___5 = BcmGetSectionValEndOffset(Adapter, 12); tmp___6 = BcmGetSectionValStartOffset(Adapter, 12); uiSectEndOffset = (unsigned int )(((((tmp___1 - tmp___2) + tmp___3) - tmp___4) + tmp___5) - tmp___6); } else if ((unsigned int )psFlash2xReadWrite->Section == 2U) { tmp___7 = BcmGetSectionValEndOffset(Adapter, 2); tmp___8 = BcmGetSectionValStartOffset(Adapter, 2); tmp___9 = BcmGetSectionValEndOffset(Adapter, 13); tmp___10 = BcmGetSectionValStartOffset(Adapter, 13); tmp___11 = BcmGetSectionValEndOffset(Adapter, 14); tmp___12 = BcmGetSectionValStartOffset(Adapter, 14); uiSectEndOffset = (unsigned int )(((((tmp___7 - tmp___8) + tmp___9) - tmp___10) + tmp___11) - tmp___12); } else { } uiSectEndOffset = uiSectStartOffset + uiSectEndOffset; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:Total size of the ISO Image :%x", "validateFlash2xReadWrite", uiSectEndOffset); } else { } } else { tmp___13 = BcmGetSectionValEndOffset(Adapter, psFlash2xReadWrite->Section); uiSectEndOffset = (unsigned int )tmp___13; } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:End offset :%x\n", "validateFlash2xReadWrite", uiSectEndOffset); } else { } if ((psFlash2xReadWrite->offset + uiSectStartOffset) + uiNumOfBytes <= uiSectEndOffset) { return (1); } else { printk("\016%s:Invalid Request....", "validateFlash2xReadWrite"); return (0); } } } INT IsFlash2x(struct bcm_mini_adapter *Adapter ) { { if (Adapter->uiFlashLayoutMajorVersion > 1U) { return (1); } else { return (0); } } } static int GetFlashBaseAddr(struct bcm_mini_adapter *Adapter ) { unsigned int uiBaseAddr ; { uiBaseAddr = 0U; if ((int )((signed char )Adapter->bDDRInitDone) != 0) { if ((Adapter->uiFlashLayoutMajorVersion != 0U && (int )((signed char )Adapter->bFlashRawRead) == 0) && (Adapter->uiFlashLayoutMajorVersion != 1U || Adapter->uiFlashLayoutMinorVersion != 1U)) { uiBaseAddr = Adapter->uiFlashBaseAdd; } else { uiBaseAddr = 469762048U; } } else if ((Adapter->uiFlashLayoutMajorVersion != 0U && (int )((signed char )Adapter->bFlashRawRead) == 0) && (Adapter->uiFlashLayoutMajorVersion != 1U || Adapter->uiFlashLayoutMinorVersion != 1U)) { uiBaseAddr = Adapter->uiFlashBaseAdd | 520093696U; } else { uiBaseAddr = 520093696U; } return ((int )uiBaseAddr); } } INT BcmCopySection(struct bcm_mini_adapter *Adapter , enum bcm_flash2x_section_val SrcSection , enum bcm_flash2x_section_val DstSection , unsigned int offset , unsigned int numOfBytes ) { unsigned int BuffSize ; unsigned int BytesToBeCopied ; PUCHAR pBuff ; int Status ; int tmp ; INT tmp___0 ; int tmp___1 ; INT tmp___2 ; int tmp___3 ; INT tmp___4 ; void *tmp___5 ; { BuffSize = 0U; BytesToBeCopied = 0U; pBuff = 0; Status = 0; if ((unsigned int )SrcSection == (unsigned int )DstSection) { printk("\016%s:Source and Destination should be different ...try again", "BcmCopySection"); return (-22); } else { } if (((unsigned int )SrcSection != 3U && (unsigned int )SrcSection != 4U) && (unsigned int )SrcSection != 5U) { printk("\016%s:Source should be DSD subsection", "BcmCopySection"); return (-22); } else { } if (((unsigned int )DstSection != 3U && (unsigned int )DstSection != 4U) && (unsigned int )DstSection != 5U) { printk("\016%s:Destination should be DSD subsection", "BcmCopySection"); return (-22); } else { } if (numOfBytes == 0U) { tmp = BcmGetSectionValEndOffset(Adapter, SrcSection); tmp___0 = BcmGetSectionValStartOffset(Adapter, SrcSection); numOfBytes = (unsigned int )(tmp - tmp___0); if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:Section Size :0x%x", "BcmCopySection", numOfBytes); } else { } } else { } tmp___1 = BcmGetSectionValEndOffset(Adapter, SrcSection); tmp___2 = BcmGetSectionValStartOffset(Adapter, SrcSection); if (offset + numOfBytes > (unsigned int )(tmp___1 - tmp___2)) { printk("\016%s: Input parameters going beyond the section offS: %x numB: %x of Source Section\n", "BcmCopySection", offset, numOfBytes); return (-22); } else { } tmp___3 = BcmGetSectionValEndOffset(Adapter, DstSection); tmp___4 = BcmGetSectionValStartOffset(Adapter, DstSection); if (offset + numOfBytes > (unsigned int )(tmp___3 - tmp___4)) { printk("\016%s:Input parameters going beyond the section offS: %x numB: %x of Destination Section\n", "BcmCopySection", offset, numOfBytes); return (-22); } else { } if (Adapter->uiSectorSize < numOfBytes) { BuffSize = Adapter->uiSectorSize; } else { BuffSize = numOfBytes; } tmp___5 = kzalloc((size_t )BuffSize, 208U); pBuff = (PUCHAR )tmp___5; if ((unsigned long )pBuff == (unsigned long )((PUCHAR )0)) { printk("\016%s:Memory allocation failed.. ", "BcmCopySection"); return (-12); } else { } BytesToBeCopied = Adapter->uiSectorSize; if (offset % Adapter->uiSectorSize != 0U) { BytesToBeCopied = Adapter->uiSectorSize - offset % Adapter->uiSectorSize; } else { } if (BytesToBeCopied > numOfBytes) { BytesToBeCopied = numOfBytes; } else { } Adapter->bHeaderChangeAllowed = 1; ldv_47616: Status = BcmFlash2xBulkRead(Adapter, (unsigned int *)pBuff, SrcSection, offset, BytesToBeCopied); if (Status != 0) { printk("\016%s:Read failed at offset :%d for NOB :%d", "BcmCopySection", (unsigned int )SrcSection, BytesToBeCopied); goto ldv_47615; } else { } Status = BcmFlash2xBulkWrite(Adapter, (unsigned int *)pBuff, DstSection, offset, BytesToBeCopied, 0U); if (Status != 0) { printk("\016%s:Write failed at offset :%d for NOB :%d", "BcmCopySection", (unsigned int )DstSection, BytesToBeCopied); goto ldv_47615; } else { } offset = offset + BytesToBeCopied; numOfBytes = numOfBytes - BytesToBeCopied; if (numOfBytes != 0U) { if (Adapter->uiSectorSize < numOfBytes) { BytesToBeCopied = Adapter->uiSectorSize; } else { BytesToBeCopied = numOfBytes; } } else { } if (numOfBytes != 0U) { goto ldv_47616; } else { goto ldv_47615; } ldv_47615: kfree((void const *)pBuff); Adapter->bHeaderChangeAllowed = 0; return (Status); } } static int SaveHeaderIfPresent(struct bcm_mini_adapter *Adapter , PUCHAR pBuff , unsigned int uiOffset ) { unsigned int offsetToProtect ; unsigned int HeaderSizeToProtect ; BOOLEAN bHasHeader ; PUCHAR pTempBuff ; unsigned int uiSectAlignAddr ; unsigned int sig ; int tmp ; int tmp___0 ; int tmp___1 ; INT tmp___2 ; INT tmp___3 ; void *tmp___4 ; size_t __len ; void *__ret ; __u32 tmp___5 ; { offsetToProtect = 0U; HeaderSizeToProtect = 0U; bHasHeader = 0; pTempBuff = 0; uiSectAlignAddr = 0U; sig = 0U; uiSectAlignAddr = - Adapter->uiSectorSize & uiOffset; tmp = BcmGetSectionValEndOffset(Adapter, 5); if ((UINT )tmp - Adapter->uiSectorSize == uiSectAlignAddr) { offsetToProtect = (Adapter->psFlash2xCSInfo)->OffsetFromDSDStartForDSDHeader % Adapter->uiSectorSize; HeaderSizeToProtect = 1024U; bHasHeader = 1; } else { tmp___0 = BcmGetSectionValEndOffset(Adapter, 4); if ((UINT )tmp___0 - Adapter->uiSectorSize == uiSectAlignAddr) { offsetToProtect = (Adapter->psFlash2xCSInfo)->OffsetFromDSDStartForDSDHeader % Adapter->uiSectorSize; HeaderSizeToProtect = 1024U; bHasHeader = 1; } else { tmp___1 = BcmGetSectionValEndOffset(Adapter, 3); if ((UINT )tmp___1 - Adapter->uiSectorSize == uiSectAlignAddr) { offsetToProtect = (Adapter->psFlash2xCSInfo)->OffsetFromDSDStartForDSDHeader % Adapter->uiSectorSize; HeaderSizeToProtect = 1024U; bHasHeader = 1; } else { } } } tmp___2 = BcmGetSectionValStartOffset(Adapter, 1); if ((unsigned int )tmp___2 == uiSectAlignAddr) { offsetToProtect = 0U; HeaderSizeToProtect = 256U; bHasHeader = 1; } else { tmp___3 = BcmGetSectionValStartOffset(Adapter, 2); if ((unsigned int )tmp___3 == uiSectAlignAddr) { offsetToProtect = 0U; HeaderSizeToProtect = 256U; bHasHeader = 1; } else { } } if ((int )((signed char )bHasHeader) != 0 && (int )((signed char )Adapter->bHeaderChangeAllowed) == 0) { tmp___4 = kzalloc((size_t )HeaderSizeToProtect, 208U); pTempBuff = (unsigned char *)tmp___4; if ((unsigned long )pTempBuff == (unsigned long )((PUCHAR )0)) { printk("\016%s:Memory allocation failed", "SaveHeaderIfPresent"); return (-12); } else { } BeceemFlashBulkRead(Adapter, (unsigned int *)pTempBuff, uiSectAlignAddr + offsetToProtect, HeaderSizeToProtect); if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:\n", "SaveHeaderIfPresent"); print_hex_dump("\017", " ", 2, 16, 1, (void const *)pTempBuff, (size_t )HeaderSizeToProtect, 0); } else { } __len = (size_t )HeaderSizeToProtect; __ret = memcpy((void *)pBuff + (unsigned long )offsetToProtect, (void const *)pTempBuff, __len); kfree((void const *)pTempBuff); } else { } if ((int )((signed char )bHasHeader) != 0 && (int )((signed char )Adapter->bSigCorrupted) != 0) { sig = *((unsigned int *)(pBuff + ((unsigned long )offsetToProtect + 1020UL))); tmp___5 = __fswab32(sig); sig = tmp___5; if ((sig & 4278190080U) != 0U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:Desired pattern is not at sig offset. Hence won\'t restore", "SaveHeaderIfPresent"); } else { } Adapter->bSigCorrupted = 0; return (0); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s: Corrupted sig is :%X", "SaveHeaderIfPresent", sig); } else { } *((unsigned int *)(pBuff + ((unsigned long )offsetToProtect + 1020UL))) = 1561185982U; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:Restoring the signature in Header Write only", "SaveHeaderIfPresent"); } else { } Adapter->bSigCorrupted = 0; } else { } return (0); } } static int BcmDoChipSelect(struct bcm_mini_adapter *Adapter , unsigned int offset ) { unsigned int FlashConfig ; int ChipNum ; unsigned int GPIOConfig ; unsigned int PartNum ; { FlashConfig = 0U; ChipNum = 0; GPIOConfig = 0U; PartNum = 0U; ChipNum = (int )(offset / 16777216U); if (Adapter->SelectedChip == ChipNum) { return (0); } else { } Adapter->SelectedChip = ChipNum; rdmalt(Adapter, 2936025168U, & FlashConfig, 4UL); rdmalt(Adapter, 2936012848U, & GPIOConfig, 4UL); switch (ChipNum) { case 0: PartNum = 0U; goto ldv_47641; case 1: PartNum = 3U; GPIOConfig = GPIOConfig | 16384U; goto ldv_47641; case 2: PartNum = 1U; GPIOConfig = GPIOConfig | 4096U; goto ldv_47641; case 3: PartNum = 2U; GPIOConfig = GPIOConfig | 8192U; goto ldv_47641; } ldv_47641: ; if (((FlashConfig >> 12) & 3U) == PartNum) { return (0); } else { } FlashConfig = FlashConfig & 4294955007U; FlashConfig = (PartNum << 12) | FlashConfig; wrmalt(Adapter, 2936012848U, & GPIOConfig, 4UL); __const_udelay(429500UL); wrmalt(Adapter, 2936025168U, & FlashConfig, 4UL); __const_udelay(429500UL); return (0); } } static int ReadDSDSignature(struct bcm_mini_adapter *Adapter , enum bcm_flash2x_section_val dsd ) { unsigned int uiDSDsig ; __u32 tmp ; { uiDSDsig = 0U; if (((unsigned int )dsd != 3U && (unsigned int )dsd != 4U) && (unsigned int )dsd != 5U) { printk("\016%s:passed section value is not for DSDs", "ReadDSDSignature"); return (-1); } else { } BcmFlash2xBulkRead(Adapter, & uiDSDsig, dsd, (Adapter->psFlash2xCSInfo)->OffsetFromDSDStartForDSDHeader + 1020U, 4U); tmp = __fswab32(uiDSDsig); uiDSDsig = tmp; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:DSD SIG :%x", "ReadDSDSignature", uiDSDsig); } else { } return ((int )uiDSDsig); } } static int ReadDSDPriority(struct bcm_mini_adapter *Adapter , enum bcm_flash2x_section_val dsd ) { unsigned int uiDSDPri ; __u32 tmp ; int tmp___0 ; int tmp___1 ; { uiDSDPri = 4294967295U; tmp___1 = IsSectionWritable(Adapter, dsd); if (tmp___1 != 0) { tmp___0 = ReadDSDSignature(Adapter, dsd); if (tmp___0 == -1093792419) { BcmFlash2xBulkRead(Adapter, & uiDSDPri, dsd, (Adapter->psFlash2xCSInfo)->OffsetFromDSDStartForDSDHeader + 8U, 4U); tmp = __fswab32(uiDSDPri); uiDSDPri = tmp; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:DSD<%x> Priority :%x", "ReadDSDPriority", (unsigned int )dsd, uiDSDPri); } else { } } else { } } else { } return ((int )uiDSDPri); } } static enum bcm_flash2x_section_val getHighestPriDSD(struct bcm_mini_adapter *Adapter ) { int DSDHighestPri ; int DsdPri ; enum bcm_flash2x_section_val HighestPriDSD ; int tmp ; int tmp___0 ; int tmp___1 ; { DSDHighestPri = -1; DsdPri = 0; HighestPriDSD = 0; tmp = IsSectionWritable(Adapter, 5); if (tmp != 0) { DSDHighestPri = ReadDSDPriority(Adapter, 5); HighestPriDSD = 5; } else { } tmp___0 = IsSectionWritable(Adapter, 4); if (tmp___0 != 0) { DsdPri = ReadDSDPriority(Adapter, 4); if (DSDHighestPri < DsdPri) { DSDHighestPri = DsdPri; HighestPriDSD = 4; } else { } } else { } tmp___1 = IsSectionWritable(Adapter, 3); if (tmp___1 != 0) { DsdPri = ReadDSDPriority(Adapter, 3); if (DSDHighestPri < DsdPri) { DSDHighestPri = DsdPri; HighestPriDSD = 3; } else { } } else { } if ((unsigned int )HighestPriDSD != 0U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:Highest DSD :%x , and its Pri :%x", "getHighestPriDSD", (unsigned int )HighestPriDSD, DSDHighestPri); } else { } } else { } return (HighestPriDSD); } } static int ReadISOSignature(struct bcm_mini_adapter *Adapter , enum bcm_flash2x_section_val iso ) { unsigned int uiISOsig ; __u32 tmp ; { uiISOsig = 0U; if ((unsigned int )iso != 1U && (unsigned int )iso != 2U) { printk("\016%s:passed section value is not for ISOs", "ReadISOSignature"); return (-1); } else { } BcmFlash2xBulkRead(Adapter, & uiISOsig, iso, 0U, 4U); tmp = __fswab32(uiISOsig); uiISOsig = tmp; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:ISO SIG :%x", "ReadISOSignature", uiISOsig); } else { } return ((int )uiISOsig); } } static int ReadISOPriority(struct bcm_mini_adapter *Adapter , enum bcm_flash2x_section_val iso ) { unsigned int ISOPri ; __u32 tmp ; int tmp___0 ; int tmp___1 ; { ISOPri = 4294967295U; tmp___1 = IsSectionWritable(Adapter, iso); if (tmp___1 != 0) { tmp___0 = ReadISOSignature(Adapter, iso); if (tmp___0 == -1093795504) { BcmFlash2xBulkRead(Adapter, & ISOPri, iso, 12U, 4U); tmp = __fswab32(ISOPri); ISOPri = tmp; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:ISO<%x> Priority :%x", "ReadISOPriority", (unsigned int )iso, ISOPri); } else { } } else { } } else { } return ((int )ISOPri); } } static enum bcm_flash2x_section_val getHighestPriISO(struct bcm_mini_adapter *Adapter ) { int ISOHighestPri ; int ISOPri ; enum bcm_flash2x_section_val HighestPriISO ; int tmp ; int tmp___0 ; { ISOHighestPri = -1; ISOPri = 0; HighestPriISO = 0; tmp = IsSectionWritable(Adapter, 2); if (tmp != 0) { ISOHighestPri = ReadISOPriority(Adapter, 2); HighestPriISO = 2; } else { } tmp___0 = IsSectionWritable(Adapter, 1); if (tmp___0 != 0) { ISOPri = ReadISOPriority(Adapter, 1); if (ISOHighestPri < ISOPri) { ISOHighestPri = ISOPri; HighestPriISO = 1; } else { } } else { } if ((unsigned int )HighestPriISO != 0U) { if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:Highest ISO :%x and its Pri :%x", "getHighestPriISO", (unsigned int )HighestPriISO, ISOHighestPri); } else { } } else { } return (HighestPriISO); } } static int WriteToFlashWithoutSectorErase(struct bcm_mini_adapter *Adapter , PUINT pBuff , enum bcm_flash2x_section_val eFlash2xSectionVal , unsigned int uiOffset , unsigned int uiNumBytes ) { unsigned int uiTemp ; unsigned int value ; unsigned int i ; unsigned int uiPartOffset ; unsigned int uiStartOffset ; int Status ; PUCHAR pcBuff ; INT tmp ; INT tmp___0 ; int tmp___1 ; int tmp___2 ; { uiTemp = 0U; value = 0U; i = 0U; uiPartOffset = 0U; uiStartOffset = 0U; Status = 0; pcBuff = (unsigned char *)pBuff; if ((ULONG )uiNumBytes % Adapter->ulFlashWriteSize != 0UL) { printk("\016%s:Writing without Sector Erase for non-FlashWriteSize number of bytes 0x%x\n", "WriteToFlashWithoutSectorErase", uiNumBytes); return (-1); } else { } tmp = BcmGetSectionValStartOffset(Adapter, eFlash2xSectionVal); uiStartOffset = (unsigned int )tmp; tmp___1 = IsSectionExistInVendorInfo(Adapter, eFlash2xSectionVal); if (tmp___1 != 0) { tmp___0 = vendorextnWriteSectionWithoutErase((PVOID )Adapter, pcBuff, eFlash2xSectionVal, uiOffset, uiNumBytes); return (tmp___0); } else { } uiOffset = uiOffset + uiStartOffset; rdmalt(Adapter, 251661440U, & uiTemp, 4UL); value = 0U; wrmalt(Adapter, 251661440U, & value, 4UL); Adapter->SelectedChip = -1; BcmDoChipSelect(Adapter, uiOffset); tmp___2 = GetFlashBaseAddr(Adapter); uiPartOffset = (uiOffset & 16777215U) + (unsigned int )tmp___2; i = 0U; goto ldv_47700; ldv_47699: ; if (Adapter->ulFlashWriteSize == 1UL) { Status = flashByteWrite(Adapter, uiPartOffset, (PVOID )pcBuff); } else { Status = flashWrite(Adapter, uiPartOffset, (PVOID )pcBuff); } if (Status != 0) { goto ldv_47698; } else { } pcBuff = pcBuff + Adapter->ulFlashWriteSize; uiPartOffset = (unsigned int )Adapter->ulFlashWriteSize + uiPartOffset; i = (unsigned int )Adapter->ulFlashWriteSize + i; ldv_47700: ; if (i < uiNumBytes) { goto ldv_47699; } else { goto ldv_47698; } ldv_47698: wrmalt(Adapter, 251661440U, & uiTemp, 4UL); Adapter->SelectedChip = -1; return (Status); } } BOOLEAN IsSectionExistInFlash(struct bcm_mini_adapter *Adapter , enum bcm_flash2x_section_val section ) { BOOLEAN SectionPresent ; BOOLEAN tmp ; BOOLEAN tmp___0 ; { SectionPresent = 0; switch ((unsigned int )section) { case 1: ; if ((Adapter->psFlash2xCSInfo)->OffsetISOImage1Part1Start != 3149651421U) { tmp = IsNonCDLessDevice(Adapter); if ((int )((signed char )tmp) == 0) { SectionPresent = 1; } else { } } else { } goto ldv_47707; case 2: ; if ((Adapter->psFlash2xCSInfo)->OffsetISOImage2Part1Start != 3149651421U) { tmp___0 = IsNonCDLessDevice(Adapter); if ((int )((signed char )tmp___0) == 0) { SectionPresent = 1; } else { } } else { } goto ldv_47707; case 3: ; if ((Adapter->psFlash2xCSInfo)->OffsetFromZeroForDSDStart != 3149651421U) { SectionPresent = 1; } else { } goto ldv_47707; case 4: ; if ((Adapter->psFlash2xCSInfo)->OffsetFromZeroForDSD1Start != 3149651421U) { SectionPresent = 1; } else { } goto ldv_47707; case 5: ; if ((Adapter->psFlash2xCSInfo)->OffsetFromZeroForDSD2Start != 3149651421U) { SectionPresent = 1; } else { } goto ldv_47707; case 6: ; if ((Adapter->psFlash2xCSInfo)->OffsetFromZeroForVSAStart != 3149651421U) { SectionPresent = 1; } else { } goto ldv_47707; case 7: ; if ((Adapter->psFlash2xCSInfo)->OffsetFromZeroForVSA1Start != 3149651421U) { SectionPresent = 1; } else { } goto ldv_47707; case 8: ; if ((Adapter->psFlash2xCSInfo)->OffsetFromZeroForVSA2Start != 3149651421U) { SectionPresent = 1; } else { } goto ldv_47707; case 9: ; if ((Adapter->psFlash2xCSInfo)->OffsetFromZeroForScsiFirmware != 3149651421U) { SectionPresent = 1; } else { } goto ldv_47707; case 10: ; if ((Adapter->psFlash2xCSInfo)->OffsetFromZeroForControlSectionStart != 3149651421U) { SectionPresent = 1; } else { } goto ldv_47707; default: printk("\016%s:Section Does not exist in Flash 2.x", "IsSectionExistInFlash"); SectionPresent = 0; } ldv_47707: ; return (SectionPresent); } } static int IsSectionWritable(struct bcm_mini_adapter *Adapter , enum bcm_flash2x_section_val Section ) { int offset ; int Status ; BOOLEAN tmp ; int tmp___0 ; B_UINT8 tmp___1 ; { offset = -1; Status = 0; tmp = IsSectionExistInFlash(Adapter, Section); if ((int )((signed char )tmp) == 0) { printk("\016%s:Section <%d> does not exixt", "IsSectionWritable", (unsigned int )Section); return (0); } else { } offset = BcmGetSectionValStartOffset(Adapter, Section); if (offset == -1) { printk("\016%s:Section<%d> does not exixt", "IsSectionWritable", (unsigned int )Section); return (0); } else { } tmp___0 = IsSectionExistInVendorInfo(Adapter, Section); if (tmp___0 != 0) { return (((Adapter->psFlash2xVendorInfo)->VendorSection[(unsigned int )Section].AccessFlags & 4U) == 0U); } else { } tmp___1 = IsOffsetWritable(Adapter, (unsigned int )offset); Status = (int )tmp___1; return (Status); } } static int CorruptDSDSig(struct bcm_mini_adapter *Adapter , enum bcm_flash2x_section_val eFlash2xSectionVal ) { PUCHAR pBuff ; unsigned int sig ; unsigned int uiOffset ; unsigned int BlockStatus ; unsigned int uiSectAlignAddr ; int tmp ; void *tmp___0 ; __u32 tmp___1 ; ULONG tmp___2 ; { pBuff = 0; sig = 0U; uiOffset = 0U; BlockStatus = 0U; uiSectAlignAddr = 0U; Adapter->bSigCorrupted = 0; if ((int )((signed char )Adapter->bAllDSDWriteAllow) == 0) { tmp = IsSectionWritable(Adapter, eFlash2xSectionVal); if (tmp != 1) { printk("\016%s:Section is not Writable...Hence can\'t Corrupt signature", "CorruptDSDSig"); return (-1); } else { } } else { } tmp___0 = kzalloc(16UL, 208U); pBuff = (unsigned char *)tmp___0; if ((unsigned long )pBuff == (unsigned long )((PUCHAR )0)) { printk("\016%s:Can\'t allocate memorey", "CorruptDSDSig"); return (-12); } else { } uiOffset = (Adapter->psFlash2xCSInfo)->OffsetFromDSDStartForDSDHeader + 1024U; uiOffset = uiOffset - 16U; BcmFlash2xBulkRead(Adapter, (unsigned int *)pBuff, eFlash2xSectionVal, uiOffset, 16U); sig = *((unsigned int *)pBuff + 12U); tmp___1 = __fswab32(sig); sig = tmp___1; if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:\n", "CorruptDSDSig"); print_hex_dump("\017", " ", 2, 16, 1, (void const *)pBuff, 16UL, 0); } else { } *(pBuff + 12UL) = 0U; if (sig == 3201174877U) { Adapter->bSigCorrupted = 1; if (Adapter->ulFlashWriteSize == 1UL) { uiSectAlignAddr = - Adapter->uiSectorSize & uiOffset; tmp___2 = BcmFlashUnProtectBlock(Adapter, uiSectAlignAddr, Adapter->uiSectorSize); BlockStatus = (unsigned int )tmp___2; WriteToFlashWithoutSectorErase(Adapter, (unsigned int *)pBuff + 12U, eFlash2xSectionVal, uiOffset + 12U, 1U); if (BlockStatus != 0U) { BcmRestoreBlockProtectStatus(Adapter, (ULONG )BlockStatus); BlockStatus = 0U; } else { } } else { WriteToFlashWithoutSectorErase(Adapter, (unsigned int *)pBuff, eFlash2xSectionVal, uiOffset, 16U); } } else { printk("\016%s:BCM Signature is not present in header", "CorruptDSDSig"); kfree((void const *)pBuff); return (-1); } kfree((void const *)pBuff); if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:Corrupted the signature", "CorruptDSDSig"); } else { } return (0); } } static int CorruptISOSig(struct bcm_mini_adapter *Adapter , enum bcm_flash2x_section_val eFlash2xSectionVal ) { PUCHAR pBuff ; unsigned int sig ; unsigned int uiOffset ; int tmp ; void *tmp___0 ; __u32 tmp___1 ; { pBuff = 0; sig = 0U; uiOffset = 0U; Adapter->bSigCorrupted = 0; tmp = IsSectionWritable(Adapter, eFlash2xSectionVal); if (tmp != 1) { printk("\016%s:Section is not Writable...Hence can\'t Corrupt signature", "CorruptISOSig"); return (-1); } else { } tmp___0 = kzalloc(16UL, 208U); pBuff = (unsigned char *)tmp___0; if ((unsigned long )pBuff == (unsigned long )((PUCHAR )0)) { printk("\016%s:Can\'t allocate memorey", "CorruptISOSig"); return (-12); } else { } uiOffset = 0U; BcmFlash2xBulkRead(Adapter, (unsigned int *)pBuff, eFlash2xSectionVal, uiOffset, 16U); sig = *((unsigned int *)pBuff); tmp___1 = __fswab32(sig); sig = tmp___1; *pBuff = 0U; if (sig == 3201171792U) { Adapter->bSigCorrupted = 1; WriteToFlashWithoutSectorErase(Adapter, (unsigned int *)pBuff, eFlash2xSectionVal, uiOffset, (unsigned int )Adapter->ulFlashWriteSize); } else { printk("\016%s:BCM Signature is not present in header", "CorruptISOSig"); kfree((void const *)pBuff); return (-1); } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:Corrupted the signature", "CorruptISOSig"); } else { } if ((((unsigned long )Adapter != (unsigned long )((struct bcm_mini_adapter *)0) && Adapter->stDebugState.debug_level > 6U) && (Adapter->stDebugState.type & 8U) != 0U) && (Adapter->stDebugState.subtype[8] & 134217728U) != 0U) { printk("\017%s:\n", "CorruptISOSig"); print_hex_dump("\017", " ", 2, 16, 1, (void const *)pBuff, 16UL, 0); } else { } kfree((void const *)pBuff); return (0); } } BOOLEAN IsNonCDLessDevice(struct bcm_mini_adapter *Adapter ) { { if ((Adapter->psFlash2xCSInfo)->IsCDLessDeviceBootSig == 3201216519U) { return (1); } else { return (0); } } } void ldv_mutex_lock_311(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_312(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_313(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_device(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_314(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___2 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex_of_device(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_315(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_device(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_316(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_317(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } int ldv_mutex_trylock_328(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_326(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_329(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_331(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_325(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_327(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_330(struct mutex *ldv_func_arg1 ) ; INT vendorextnGetSectionInfo(PVOID pContext , PFLASH2X_VENDORSPECIFIC_INFO pVendorInfo ) { { return (-1); } } INT vendorextnInit(struct bcm_mini_adapter *Adapter ) { { return (0); } } INT vendorextnExit(struct bcm_mini_adapter *Adapter ) { { return (0); } } INT vendorextnIoctl(struct bcm_mini_adapter *Adapter , UINT cmd , ULONG arg ) { { return (65535); } } INT vendorextnReadSection(PVOID pContext , PUCHAR pBuffer , enum bcm_flash2x_section_val SectionVal , UINT offset , UINT numOfBytes ) { { return (-1); } } INT vendorextnWriteSection(PVOID pContext , PUCHAR pBuffer , enum bcm_flash2x_section_val SectionVal , UINT offset , UINT numOfBytes , BOOLEAN bVerify ) { { return (-1); } } INT vendorextnWriteSectionWithoutErase(PVOID pContext , PUCHAR pBuffer , enum bcm_flash2x_section_val SectionVal , UINT offset , UINT numOfBytes ) { { return (-1); } } void ldv_mutex_lock_325(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_326(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_327(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mutex_of_device(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } int ldv_mutex_trylock_328(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___2 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_mutex_of_device(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_329(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mutex_of_device(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_330(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_331(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex_of_signal_struct(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } __inline static void ldv_error(void) __attribute__((__no_instrument_function__)) ; __inline static void ldv_error(void) { { ERROR: {reach_error();abort();} } } extern int __VERIFIER_nondet_int(void) ; long ldv__builtin_expect(long exp , long c ) { { return (exp); } } void ldv__builtin_trap(void) { { ldv_error(); return; } } static int ldv_mutex_cred_guard_mutex_of_signal_struct ; int ldv_mutex_lock_interruptible_cred_guard_mutex_of_signal_struct(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_cred_guard_mutex_of_signal_struct == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_cred_guard_mutex_of_signal_struct = 2; return (0); } else { return (-4); } } } int ldv_mutex_lock_killable_cred_guard_mutex_of_signal_struct(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_cred_guard_mutex_of_signal_struct == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_cred_guard_mutex_of_signal_struct = 2; return (0); } else { return (-4); } } } void ldv_mutex_lock_cred_guard_mutex_of_signal_struct(struct mutex *lock ) { { if (ldv_mutex_cred_guard_mutex_of_signal_struct == 1) { } else { ldv_error(); } ldv_mutex_cred_guard_mutex_of_signal_struct = 2; return; } } int ldv_mutex_trylock_cred_guard_mutex_of_signal_struct(struct mutex *lock ) { int is_mutex_held_by_another_thread ; { if (ldv_mutex_cred_guard_mutex_of_signal_struct == 1) { } else { ldv_error(); } is_mutex_held_by_another_thread = __VERIFIER_nondet_int(); if (is_mutex_held_by_another_thread) { return (0); } else { ldv_mutex_cred_guard_mutex_of_signal_struct = 2; return (1); } } } int ldv_atomic_dec_and_mutex_lock_cred_guard_mutex_of_signal_struct(atomic_t *cnt , struct mutex *lock ) { int atomic_value_after_dec ; { if (ldv_mutex_cred_guard_mutex_of_signal_struct == 1) { } else { ldv_error(); } atomic_value_after_dec = __VERIFIER_nondet_int(); if (atomic_value_after_dec == 0) { ldv_mutex_cred_guard_mutex_of_signal_struct = 2; return (1); } else { } return (0); } } int ldv_mutex_is_locked_cred_guard_mutex_of_signal_struct(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_cred_guard_mutex_of_signal_struct == 1) { nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { return (0); } else { return (1); } } else { return (1); } } } void ldv_mutex_unlock_cred_guard_mutex_of_signal_struct(struct mutex *lock ) { { if (ldv_mutex_cred_guard_mutex_of_signal_struct == 2) { } else { ldv_error(); } ldv_mutex_cred_guard_mutex_of_signal_struct = 1; return; } } static int ldv_mutex_lock ; int ldv_mutex_lock_interruptible_lock(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_lock == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_lock = 2; return (0); } else { return (-4); } } } int ldv_mutex_lock_killable_lock(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_lock == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_lock = 2; return (0); } else { return (-4); } } } void ldv_mutex_lock_lock(struct mutex *lock ) { { if (ldv_mutex_lock == 1) { } else { ldv_error(); } ldv_mutex_lock = 2; return; } } int ldv_mutex_trylock_lock(struct mutex *lock ) { int is_mutex_held_by_another_thread ; { if (ldv_mutex_lock == 1) { } else { ldv_error(); } is_mutex_held_by_another_thread = __VERIFIER_nondet_int(); if (is_mutex_held_by_another_thread) { return (0); } else { ldv_mutex_lock = 2; return (1); } } } int ldv_atomic_dec_and_mutex_lock_lock(atomic_t *cnt , struct mutex *lock ) { int atomic_value_after_dec ; { if (ldv_mutex_lock == 1) { } else { ldv_error(); } atomic_value_after_dec = __VERIFIER_nondet_int(); if (atomic_value_after_dec == 0) { ldv_mutex_lock = 2; return (1); } else { } return (0); } } int ldv_mutex_is_locked_lock(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_lock == 1) { nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { return (0); } else { return (1); } } else { return (1); } } } void ldv_mutex_unlock_lock(struct mutex *lock ) { { if (ldv_mutex_lock == 2) { } else { ldv_error(); } ldv_mutex_lock = 1; return; } } static int ldv_mutex_mutex_of_device ; int ldv_mutex_lock_interruptible_mutex_of_device(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_mutex_of_device == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_mutex_of_device = 2; return (0); } else { return (-4); } } } int ldv_mutex_lock_killable_mutex_of_device(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_mutex_of_device == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_mutex_of_device = 2; return (0); } else { return (-4); } } } void ldv_mutex_lock_mutex_of_device(struct mutex *lock ) { { if (ldv_mutex_mutex_of_device == 1) { } else { ldv_error(); } ldv_mutex_mutex_of_device = 2; return; } } int ldv_mutex_trylock_mutex_of_device(struct mutex *lock ) { int is_mutex_held_by_another_thread ; { if (ldv_mutex_mutex_of_device == 1) { } else { ldv_error(); } is_mutex_held_by_another_thread = __VERIFIER_nondet_int(); if (is_mutex_held_by_another_thread) { return (0); } else { ldv_mutex_mutex_of_device = 2; return (1); } } } int ldv_atomic_dec_and_mutex_lock_mutex_of_device(atomic_t *cnt , struct mutex *lock ) { int atomic_value_after_dec ; { if (ldv_mutex_mutex_of_device == 1) { } else { ldv_error(); } atomic_value_after_dec = __VERIFIER_nondet_int(); if (atomic_value_after_dec == 0) { ldv_mutex_mutex_of_device = 2; return (1); } else { } return (0); } } int ldv_mutex_is_locked_mutex_of_device(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_mutex_of_device == 1) { nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { return (0); } else { return (1); } } else { return (1); } } } void ldv_mutex_unlock_mutex_of_device(struct mutex *lock ) { { if (ldv_mutex_mutex_of_device == 2) { } else { ldv_error(); } ldv_mutex_mutex_of_device = 1; return; } } void ldv_initialize(void) { { ldv_mutex_cred_guard_mutex_of_signal_struct = 1; ldv_mutex_lock = 1; ldv_mutex_mutex_of_device = 1; return; } } void ldv_check_final_state(void) { { if (ldv_mutex_cred_guard_mutex_of_signal_struct == 1) { } else { ldv_error(); } if (ldv_mutex_lock == 1) { } else { ldv_error(); } if (ldv_mutex_mutex_of_device == 1) { } else { ldv_error(); } return; } } #include "model/32_7a_cilled_true-unreach-call_linux-3.8-rc1-drivers--staging--bcm--bcm_wimax.ko-main.env.c" #include "model/common.env.c"